1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
9 | import LegacyListEditing from '../legacylist/legacylistediting.js';
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export default class LegacyListPropertiesEditing extends Plugin {
|
20 | |
21 |
|
22 |
|
23 | static get requires(): readonly [typeof LegacyListEditing];
|
24 | |
25 |
|
26 |
|
27 | static get pluginName(): "LegacyListPropertiesEditing";
|
28 | |
29 |
|
30 |
|
31 | constructor(editor: Editor);
|
32 | /**
|
33 | * @inheritDoc
|
34 | */
|
35 | init(): void;
|
36 | /**
|
37 | * @inheritDoc
|
38 | */
|
39 | afterInit(): void;
|
40 | /**
|
41 | * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether two lists will be merged into a single
|
42 | * one after deleting the content.
|
43 | *
|
44 | * The purpose of this action is to adjust the `listStyle`, `listReversed` and `listStart` values
|
45 | * for the list that was merged.
|
46 | *
|
47 | * Consider the following model's content:
|
48 | *
|
49 | * ```xml
|
50 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
51 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
52 | * <paragraph>[A paragraph.]</paragraph>
|
53 | * <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 1</listItem>
|
54 | * <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 2</listItem>
|
55 | * ```
|
56 | *
|
57 | * After removing the paragraph element, the second list will be merged into the first one.
|
58 | * We want to inherit the `listStyle` attribute for the second list from the first one.
|
59 | *
|
60 | * ```xml
|
61 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
62 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
63 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
64 | * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
65 | * ```
|
66 | *
|
67 | * See https://github.com/ckeditor/ckeditor5/issues/7879.
|
68 | *
|
69 | * @param attributeStrategies Strategies for the enabled attributes.
|
70 | */
|
71 | private _mergeListAttributesWhileMergingLists;
|
72 | }
|