@ckeditor/ckeditor5-list 48.2.0 → 48.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/augmentation.d.ts +54 -54
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +67 -67
- package/dist/index.js +7187 -8921
- package/dist/index.js.map +1 -1
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/legacylist/legacyconverters.d.ts +184 -184
- package/dist/legacylist/legacyindentcommand.d.ts +33 -33
- package/dist/legacylist/legacylistcommand.d.ts +52 -52
- package/dist/legacylist/legacylistediting.d.ts +32 -32
- package/dist/legacylist/legacylistutils.d.ts +40 -40
- package/dist/legacylist/legacyutils.d.ts +91 -91
- package/dist/legacylist.d.ts +25 -25
- package/dist/legacylistproperties/legacylistpropertiesediting.d.ts +71 -71
- package/dist/legacylistproperties/legacylistreversedcommand.d.ts +33 -33
- package/dist/legacylistproperties/legacyliststartcommand.d.ts +33 -33
- package/dist/legacylistproperties/legacyliststylecommand.d.ts +63 -63
- package/dist/legacylistproperties.d.ts +26 -26
- package/dist/legacytodolist/legacychecktodolistcommand.d.ts +47 -47
- package/dist/legacytodolist/legacytodolistconverters.d.ts +76 -76
- package/dist/legacytodolist/legacytodolistediting.d.ts +46 -46
- package/dist/legacytodolist.d.ts +26 -26
- package/dist/list/adjacentlistssupport.d.ts +16 -16
- package/dist/list/converters.d.ts +68 -68
- package/dist/list/listcommand.d.ts +84 -84
- package/dist/list/listediting.d.ts +213 -219
- package/dist/list/listindentcommand.d.ts +54 -54
- package/dist/list/listmergecommand.d.ts +68 -68
- package/dist/list/listsplitcommand.d.ts +59 -59
- package/dist/list/listui.d.ts +19 -19
- package/dist/list/listutils.d.ts +55 -55
- package/dist/list/utils/listwalker.d.ts +139 -139
- package/dist/list/utils/model.d.ts +202 -202
- package/dist/list/utils/postfixers.d.ts +30 -30
- package/dist/list/utils/view.d.ts +65 -65
- package/dist/list/utils.d.ts +15 -15
- package/dist/list.d.ts +25 -25
- package/dist/listconfig.d.ts +234 -234
- package/dist/listformatting/listitemboldintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontcolorintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontfamilyintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontsizeintegration.d.ts +29 -29
- package/dist/listformatting/listitemitalicintegration.d.ts +29 -29
- package/dist/listformatting.d.ts +66 -66
- package/dist/listproperties/converters.d.ts +15 -15
- package/dist/listproperties/listpropertiesediting.d.ts +91 -91
- package/dist/listproperties/listpropertiesui.d.ts +22 -22
- package/dist/listproperties/listpropertiesutils.d.ts +32 -32
- package/dist/listproperties/listreversedcommand.d.ts +31 -31
- package/dist/listproperties/liststartcommand.d.ts +34 -34
- package/dist/listproperties/liststylecommand.d.ts +67 -67
- package/dist/listproperties/ui/listpropertiesview.d.ts +147 -147
- package/dist/listproperties/utils/config.d.ts +32 -32
- package/dist/listproperties/utils/style.d.ts +31 -31
- package/dist/listproperties.d.ts +26 -26
- package/dist/todolist/checktodolistcommand.d.ts +44 -44
- package/dist/todolist/todocheckboxchangeobserver.d.ts +36 -36
- package/dist/todolist/todolistediting.d.ts +45 -45
- package/dist/todolist/todolistui.d.ts +19 -19
- package/dist/todolist.d.ts +26 -26
- package/package.json +10 -10
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command } from
|
|
6
|
+
* @module list/legacylistproperties/legacyliststartcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
11
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
12
|
+
*/
|
|
13
13
|
export declare class LegacyListStartCommand extends Command {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
value: number | null;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
override refresh(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Executes the command.
|
|
24
|
+
*
|
|
25
|
+
* @fires execute
|
|
26
|
+
* @param options Execute options.
|
|
27
|
+
* @param options.startIndex The list start index.
|
|
28
|
+
*/
|
|
29
|
+
override execute({ startIndex }?: {
|
|
30
|
+
startIndex?: number;
|
|
31
|
+
}): void;
|
|
32
|
+
/**
|
|
33
|
+
* Checks the command's {@link #value}.
|
|
34
|
+
*
|
|
35
|
+
* @returns The current value.
|
|
36
|
+
*/
|
|
37
|
+
private _getValue;
|
|
38
38
|
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
6
|
+
* @module list/legacylistproperties/legacyliststylecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
* The list style command. It changes the `listStyle` attribute of the selected list items.
|
|
11
|
+
*
|
|
12
|
+
* If the list type (numbered or bulleted) can be inferred from the passed style type,
|
|
13
|
+
* the command tries to convert selected items to a list of that type.
|
|
14
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
15
|
+
*/
|
|
16
16
|
export declare class LegacyListStyleCommand extends Command {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
17
|
+
isStyleTypeSupported: undefined;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
value: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The default type of the list style.
|
|
25
|
+
*/
|
|
26
|
+
readonly defaultType: string;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of the command.
|
|
29
|
+
*
|
|
30
|
+
* @param editor The editor instance.
|
|
31
|
+
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
32
|
+
* the command execution.
|
|
33
|
+
*/
|
|
34
|
+
constructor(editor: Editor, defaultType: string);
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
override refresh(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Executes the command.
|
|
41
|
+
*
|
|
42
|
+
* @fires execute
|
|
43
|
+
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
44
|
+
* style will be applied.
|
|
45
|
+
*/
|
|
46
|
+
override execute(options?: {
|
|
47
|
+
type?: string | null;
|
|
48
|
+
}): void;
|
|
49
|
+
/**
|
|
50
|
+
* Checks the command's {@link #value}.
|
|
51
|
+
*
|
|
52
|
+
* @returns The current value.
|
|
53
|
+
*/
|
|
54
|
+
private _getValue;
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the command can be enabled in the current context.
|
|
57
|
+
*
|
|
58
|
+
* @returns Whether the command should be enabled.
|
|
59
|
+
*/
|
|
60
|
+
private _checkEnabled;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
|
|
63
|
+
*
|
|
64
|
+
* @param options Additional options.
|
|
65
|
+
* @param options.type The type of the list style. If `null` is specified, the function does nothing.
|
|
66
|
+
*/
|
|
67
|
+
private _tryToConvertItemsToList;
|
|
68
68
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { LegacyListPropertiesEditing } from
|
|
10
|
-
import { ListPropertiesUI } from
|
|
6
|
+
* @module list/legacylistproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { LegacyListPropertiesEditing } from "./legacylistproperties/legacylistpropertiesediting.js";
|
|
10
|
+
import { ListPropertiesUI } from "./listproperties/listpropertiesui.js";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
* The legacy list properties feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the {@link module:list/legacylistproperties/legacylistpropertiesediting~LegacyListPropertiesEditing
|
|
15
|
+
* legacy list properties editing feature} and the
|
|
16
|
+
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
+
*/
|
|
18
18
|
export declare class LegacyListProperties extends Plugin {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): PluginDependenciesOf<[LegacyListPropertiesEditing, ListPropertiesUI]>;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "LegacyListProperties";
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static override get isOfficialPlugin(): true;
|
|
31
31
|
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
9
|
-
import type { ModelElement } from
|
|
6
|
+
* @module list/legacytodolist/legacychecktodolistcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* The check to-do command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
14
|
+
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
15
|
+
*/
|
|
16
16
|
export declare class LegacyCheckTodoListCommand extends Command {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
19
|
+
*
|
|
20
|
+
* @observable
|
|
21
|
+
* @readonly
|
|
22
|
+
*/
|
|
23
|
+
value: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
_selectedElements: Array<ModelElement>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
constructor(editor: Editor);
|
|
34
|
+
/**
|
|
35
|
+
* Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
|
|
36
|
+
*/
|
|
37
|
+
override refresh(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
40
|
+
*/
|
|
41
|
+
private _getSelectedItems;
|
|
42
|
+
/**
|
|
43
|
+
* Executes the command.
|
|
44
|
+
*
|
|
45
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
|
|
46
|
+
* the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
|
|
47
|
+
* value to decide what it should do.
|
|
48
|
+
*/
|
|
49
|
+
override execute(options?: {
|
|
50
|
+
forceValue?: boolean;
|
|
51
|
+
}): void;
|
|
52
52
|
}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { DowncastAttributeEvent, DowncastInsertEvent, ModelElement, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } from
|
|
9
|
-
import { type GetCallback } from
|
|
6
|
+
* @module list/legacytodolist/legacytodolistconverters
|
|
7
|
+
*/
|
|
8
|
+
import type { DowncastAttributeEvent, DowncastInsertEvent, ModelElement, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import { type GetCallback } from "@ckeditor/ckeditor5-utils";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
12
|
+
*
|
|
13
|
+
* It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~ViewUIElement checkbox element}
|
|
14
|
+
* at the beginning of each list item. It also merges the list with surrounding lists (if available).
|
|
15
|
+
*
|
|
16
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
20
|
+
* @param model Model instance.
|
|
21
|
+
* @param onCheckboxChecked Callback function.
|
|
22
|
+
* @returns Returns a conversion callback.
|
|
23
|
+
*/
|
|
24
24
|
export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element: ModelElement) => void): GetCallback<DowncastInsertEvent<ModelElement>>;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
27
|
+
*
|
|
28
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
32
|
+
* @param model Model instance.
|
|
33
|
+
* @returns Returns a conversion callback.
|
|
34
|
+
*/
|
|
35
35
|
export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<ModelElement>>;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
* A view-to-model converter for the checkbox element inside a view list item.
|
|
38
|
+
*
|
|
39
|
+
* It changes the `listType` of the model `listItem` to a `todo` value.
|
|
40
|
+
* When a view checkbox element is marked as checked, an additional `todoListChecked="true"` attribute is added to the model item.
|
|
41
|
+
*
|
|
42
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
* @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
|
|
46
|
+
*/
|
|
47
47
|
export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementEvent>;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
* A model-to-view converter for the `listType` attribute change on the `listItem` model element.
|
|
50
|
+
*
|
|
51
|
+
* This change means that the `<li>` element parent changes to `<ul class="todo-list">` and a
|
|
52
|
+
* {@link module:engine/view/uielement~ViewUIElement checkbox UI element} is added at the beginning
|
|
53
|
+
* of the list item element (or vice versa).
|
|
54
|
+
*
|
|
55
|
+
* This converter is preceded by {@link module:list/legacylist/legacyconverters~modelViewChangeType} and followed by
|
|
56
|
+
* {@link module:list/legacylist/legacyconverters~modelViewMergeAfterChangeType} to handle splitting and merging surrounding lists
|
|
57
|
+
* of the same type.
|
|
58
|
+
*
|
|
59
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
63
|
+
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
64
|
+
* @param view Editing view controller.
|
|
65
|
+
* @returns Returns a conversion callback.
|
|
66
|
+
*/
|
|
67
67
|
export declare function modelViewChangeType(onCheckedChange: (element: ModelElement) => void, view: EditingView): GetCallback<DowncastAttributeEvent<ModelElement>>;
|
|
68
68
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
* A model-to-view converter for the `todoListChecked` attribute change on the `listItem` model element.
|
|
70
|
+
*
|
|
71
|
+
* It marks the {@link module:engine/view/uielement~ViewUIElement checkbox UI element} as checked.
|
|
72
|
+
*
|
|
73
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
77
|
+
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
78
|
+
* @returns Returns a conversion callback.
|
|
79
|
+
*/
|
|
80
80
|
export declare function modelViewChangeChecked(onCheckedChange: (element: ModelElement) => void): GetCallback<DowncastAttributeEvent<ModelElement>>;
|
|
81
81
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
* A model-to-view position at zero offset mapper.
|
|
83
|
+
*
|
|
84
|
+
* This helper ensures that position inside todo-list in the view is mapped after the checkbox.
|
|
85
|
+
*
|
|
86
|
+
* It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
90
|
export declare function mapModelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin } from
|
|
6
|
-
import { LegacyListEditing } from
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { LegacyListEditing } from "../legacylist/legacylistediting.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
* The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items.
|
|
9
|
+
*
|
|
10
|
+
* It registers the entire functionality of the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing
|
|
11
|
+
* plugin} and extends it with the commands:
|
|
12
|
+
*
|
|
13
|
+
* - `'todoList'`,
|
|
14
|
+
* - `'checkTodoList'`,
|
|
15
|
+
* - `'todoListCheck'` as an alias for `checkTodoList` command.
|
|
16
|
+
*/
|
|
17
17
|
export declare class LegacyTodoListEditing extends Plugin {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "LegacyTodoListEditing";
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static override get isOfficialPlugin(): true;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): PluginDependenciesOf<[LegacyListEditing]>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
init(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Handles the checkbox element change, moves the selection to the corresponding model item to make it possible
|
|
36
|
+
* to toggle the `todoListChecked` attribute using the command, and restores the selection position.
|
|
37
|
+
*
|
|
38
|
+
* Some say it's a hack :) Moving the selection only for executing the command on a certain node and restoring it after,
|
|
39
|
+
* is not a clear solution. We need to design an API for using commands beyond the selection range.
|
|
40
|
+
* See https://github.com/ckeditor/ckeditor5/issues/1954.
|
|
41
|
+
*/
|
|
42
|
+
private _handleCheckmarkChange;
|
|
43
|
+
/**
|
|
44
|
+
* Observe when user enters or leaves todo list and set proper aria value in global live announcer.
|
|
45
|
+
* This allows screen readers to indicate when the user has entered and left the specified todo list.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
private _initAriaAnnouncements;
|
|
50
50
|
}
|