@ckeditor/ckeditor5-list 41.3.1 → 41.4.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/build/list.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -0
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/dist/index-content.css +102 -0
- package/dist/index-editor.css +74 -0
- package/dist/index.css +238 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +7569 -0
- package/dist/index.js.map +1 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/ast.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/eo.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/eu.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/km.umd.js +11 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/kn.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/si.d.ts +8 -0
- package/dist/translations/si.js +5 -0
- package/dist/translations/si.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/types/augmentation.d.ts +57 -0
- package/dist/types/documentlist.d.ts +32 -0
- package/dist/types/documentlistproperties.d.ts +32 -0
- package/dist/types/index.d.ts +49 -0
- package/dist/types/legacylist/legacyconverters.d.ts +200 -0
- package/dist/types/legacylist/legacyindentcommand.d.ts +41 -0
- package/dist/types/legacylist/legacylistcommand.d.ts +60 -0
- package/dist/types/legacylist/legacylistediting.d.ts +36 -0
- package/dist/types/legacylist/legacylistutils.d.ts +45 -0
- package/dist/types/legacylist/legacyutils.d.ts +105 -0
- package/dist/types/legacylist.d.ts +30 -0
- package/dist/types/legacylistproperties/legacylistpropertiesediting.d.ts +76 -0
- package/dist/types/legacylistproperties/legacylistreversedcommand.d.ts +42 -0
- package/dist/types/legacylistproperties/legacyliststartcommand.d.ts +41 -0
- package/dist/types/legacylistproperties/legacyliststylecommand.d.ts +71 -0
- package/dist/types/legacylistproperties.d.ts +31 -0
- package/dist/types/legacytodolist/legacychecktodolistcommand.d.ts +56 -0
- package/dist/types/legacytodolist/legacytodolistconverters.d.ts +87 -0
- package/dist/types/legacytodolist/legacytodolistediting.d.ts +50 -0
- package/dist/types/legacytodolist.d.ts +31 -0
- package/dist/types/list/adjacentlistssupport.d.ts +19 -0
- package/dist/types/list/converters.d.ts +77 -0
- package/dist/types/list/listcommand.d.ts +96 -0
- package/dist/types/list/listediting.d.ts +226 -0
- package/dist/types/list/listindentcommand.d.ts +66 -0
- package/dist/types/list/listmergecommand.d.ts +80 -0
- package/dist/types/list/listsplitcommand.d.ts +71 -0
- package/dist/types/list/listui.d.ts +23 -0
- package/dist/types/list/listutils.d.ts +56 -0
- package/dist/types/list/utils/listwalker.d.ts +146 -0
- package/dist/types/list/utils/model.d.ts +213 -0
- package/dist/types/list/utils/postfixers.d.ts +41 -0
- package/dist/types/list/utils/view.d.ts +86 -0
- package/dist/types/list/utils.d.ts +22 -0
- package/dist/types/list.d.ts +30 -0
- package/dist/types/listconfig.d.ts +136 -0
- package/dist/types/listproperties/converters.d.ts +23 -0
- package/dist/types/listproperties/listpropertiesediting.d.ts +92 -0
- package/dist/types/listproperties/listpropertiesui.d.ts +27 -0
- package/dist/types/listproperties/listpropertiesutils.d.ts +37 -0
- package/dist/types/listproperties/listreversedcommand.d.ts +40 -0
- package/dist/types/listproperties/liststartcommand.d.ts +42 -0
- package/dist/types/listproperties/liststylecommand.d.ts +76 -0
- package/dist/types/listproperties/ui/listpropertiesview.d.ts +160 -0
- package/dist/types/listproperties/utils/style.d.ts +24 -0
- package/dist/types/listproperties.d.ts +31 -0
- package/dist/types/tododocumentlist.d.ts +32 -0
- package/dist/types/todolist/checktodolistcommand.d.ts +53 -0
- package/dist/types/todolist/todocheckboxchangeobserver.d.ts +45 -0
- package/dist/types/todolist/todolistediting.d.ts +49 -0
- package/dist/types/todolist/todolistui.d.ts +23 -0
- package/dist/types/todolist.d.ts +31 -0
- package/lang/contexts.json +3 -1
- package/lang/translations/ar.po +8 -0
- package/lang/translations/ast.po +8 -0
- package/lang/translations/az.po +8 -0
- package/lang/translations/bg.po +8 -0
- package/lang/translations/bn.po +8 -0
- package/lang/translations/ca.po +8 -0
- package/lang/translations/cs.po +8 -0
- package/lang/translations/da.po +8 -0
- package/lang/translations/de-ch.po +8 -0
- package/lang/translations/de.po +8 -0
- package/lang/translations/el.po +8 -0
- package/lang/translations/en-au.po +8 -0
- package/lang/translations/en-gb.po +8 -0
- package/lang/translations/en.po +8 -0
- package/lang/translations/eo.po +8 -0
- package/lang/translations/es.po +8 -0
- package/lang/translations/et.po +8 -0
- package/lang/translations/eu.po +8 -0
- package/lang/translations/fa.po +8 -0
- package/lang/translations/fi.po +8 -0
- package/lang/translations/fr.po +8 -0
- package/lang/translations/gl.po +8 -0
- package/lang/translations/he.po +8 -0
- package/lang/translations/hi.po +8 -0
- package/lang/translations/hr.po +8 -0
- package/lang/translations/hu.po +8 -0
- package/lang/translations/id.po +8 -0
- package/lang/translations/it.po +8 -0
- package/lang/translations/ja.po +8 -0
- package/lang/translations/jv.po +8 -0
- package/lang/translations/km.po +8 -0
- package/lang/translations/kn.po +8 -0
- package/lang/translations/ko.po +8 -0
- package/lang/translations/ku.po +8 -0
- package/lang/translations/lt.po +8 -0
- package/lang/translations/lv.po +8 -0
- package/lang/translations/ms.po +8 -0
- package/lang/translations/nb.po +8 -0
- package/lang/translations/ne.po +8 -0
- package/lang/translations/nl.po +8 -0
- package/lang/translations/no.po +8 -0
- package/lang/translations/pl.po +8 -0
- package/lang/translations/pt-br.po +8 -0
- package/lang/translations/pt.po +8 -0
- package/lang/translations/ro.po +8 -0
- package/lang/translations/ru.po +8 -0
- package/lang/translations/si.po +8 -0
- package/lang/translations/sk.po +8 -0
- package/lang/translations/sq.po +8 -0
- package/lang/translations/sr-latn.po +8 -0
- package/lang/translations/sr.po +8 -0
- package/lang/translations/sv.po +8 -0
- package/lang/translations/th.po +8 -0
- package/lang/translations/ti.po +150 -0
- package/lang/translations/tk.po +8 -0
- package/lang/translations/tr.po +8 -0
- package/lang/translations/tt.po +8 -0
- package/lang/translations/ug.po +8 -0
- package/lang/translations/uk.po +8 -0
- package/lang/translations/ur.po +8 -0
- package/lang/translations/uz.po +8 -0
- package/lang/translations/vi.po +8 -0
- package/lang/translations/zh-cn.po +8 -0
- package/lang/translations/zh.po +8 -0
- package/package.json +3 -2
- package/src/legacytodolist/legacytodolistediting.d.ts +7 -0
- package/src/legacytodolist/legacytodolistediting.js +32 -0
- package/src/list/listui.js +8 -3
- package/src/todolist/todolistediting.d.ts +7 -0
- package/src/todolist/todolistediting.js +38 -0
- package/theme/todolist.css +4 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
import LegacyListEditing from '../legacylist/legacylistediting.js';
|
|
11
|
+
/**
|
|
12
|
+
* The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items.
|
|
13
|
+
*
|
|
14
|
+
* It registers the entire functionality of the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing
|
|
15
|
+
* plugin} and extends it with the commands:
|
|
16
|
+
*
|
|
17
|
+
* - `'todoList'`,
|
|
18
|
+
* - `'checkTodoList'`,
|
|
19
|
+
* - `'todoListCheck'` as an alias for `checkTodoList` command.
|
|
20
|
+
*/
|
|
21
|
+
export default class LegacyTodoListEditing extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "LegacyTodoListEditing";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): readonly [typeof 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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/legacytodolist
|
|
11
|
+
*/
|
|
12
|
+
import LegacyTodoListEditing from './legacytodolist/legacytodolistediting.js';
|
|
13
|
+
import TodoListUI from './todolist/todolistui.js';
|
|
14
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
15
|
+
import '../theme/todolist.css';
|
|
16
|
+
/**
|
|
17
|
+
* The legacy to-do list feature.
|
|
18
|
+
*
|
|
19
|
+
* This is a "glue" plugin that loads the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing legacy to-do list
|
|
20
|
+
* editing feature} and the {@link module:list/todolist/todolistui~TodoListUI to-do list UI feature}.
|
|
21
|
+
*/
|
|
22
|
+
export default class LegacyTodoList extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof LegacyTodoListEditing, typeof TodoListUI];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "LegacyTodoList";
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
export default class AdjacentListsSupport extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
static get pluginName(): "AdjacentListsSupport";
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
init(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/list/converters
|
|
11
|
+
*/
|
|
12
|
+
import { type DowncastAttributeEvent, type EditingController, type Element, type ElementCreatorFunction, type Mapper, type Model, type UpcastElementEvent, type ViewElement, type DowncastRemoveEvent, type EditingView, type MapperModelToViewPositionEvent, type Schema } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import type { GetCallback } from 'ckeditor5/src/utils.js';
|
|
14
|
+
import { type ListElement } from './utils/model.js';
|
|
15
|
+
import type { default as ListEditing, DowncastStrategy } from './listediting.js';
|
|
16
|
+
/**
|
|
17
|
+
* Returns the upcast converter for list items. It's supposed to work after the block converters (content inside list items) are converted.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function listItemUpcastConverter(): GetCallback<UpcastElementEvent>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the upcast converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
|
|
24
|
+
* This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element. However,
|
|
25
|
+
* incorrect data can also be cleared if the view was incorrect.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function listUpcastCleanList(): GetCallback<UpcastElementEvent>;
|
|
30
|
+
/**
|
|
31
|
+
* Returns a model document change:data event listener that triggers conversion of related items if needed.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
* @param model The editor model.
|
|
35
|
+
* @param editing The editing controller.
|
|
36
|
+
* @param attributeNames The list of all model list attributes (including registered strategies).
|
|
37
|
+
* @param listEditing The document list editing plugin.
|
|
38
|
+
*/
|
|
39
|
+
export declare function reconvertItemsOnDataChange(model: Model, editing: EditingController, attributeNames: Array<string>, listEditing: ListEditing): () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the list item downcast converter.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
* @param attributeNames A list of attribute names that should be converted if they are set.
|
|
45
|
+
* @param strategies The strategies.
|
|
46
|
+
* @param model The model.
|
|
47
|
+
*/
|
|
48
|
+
export declare function listItemDowncastConverter(attributeNames: Array<string>, strategies: Array<DowncastStrategy>, model: Model, { dataPipeline }?: {
|
|
49
|
+
dataPipeline?: boolean;
|
|
50
|
+
}): GetCallback<DowncastAttributeEvent<ListElement>>;
|
|
51
|
+
/**
|
|
52
|
+
* The 'remove' downcast converter for custom markers.
|
|
53
|
+
*/
|
|
54
|
+
export declare function listItemDowncastRemoveConverter(schema: Schema): GetCallback<DowncastRemoveEvent>;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the bogus paragraph view element creator. A bogus paragraph is used if a list item contains only a single block or nested list.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
* @param attributeNames The list of all model list attributes (including registered strategies).
|
|
60
|
+
*/
|
|
61
|
+
export declare function bogusParagraphCreator(attributeNames: Array<string>, { dataPipeline }?: {
|
|
62
|
+
dataPipeline?: boolean;
|
|
63
|
+
}): ElementCreatorFunction;
|
|
64
|
+
/**
|
|
65
|
+
* Helper for mapping mode to view elements. It's using positions mapping instead of mapper.toViewElement( element )
|
|
66
|
+
* to find outermost view element. This is for cases when mapping is using inner view element like in the code blocks (pre > code).
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
* @param element The model element.
|
|
70
|
+
* @param mapper The mapper instance.
|
|
71
|
+
* @param model The model.
|
|
72
|
+
*/
|
|
73
|
+
export declare function findMappedViewElement(element: Element, mapper: Mapper, model: Model): ViewElement | null;
|
|
74
|
+
/**
|
|
75
|
+
* The model to view custom position mapping for cases when marker is injected at the beginning of a block.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createModelToViewPositionMapper(strategies: Array<DowncastStrategy>, view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/list/listcommand
|
|
11
|
+
*/
|
|
12
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import { type ListType } from './listediting.js';
|
|
15
|
+
/**
|
|
16
|
+
* The list command. It is used by the {@link module:list/list~List list feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class ListCommand extends Command {
|
|
19
|
+
/**
|
|
20
|
+
* The type of the list created by the command.
|
|
21
|
+
*/
|
|
22
|
+
readonly type: ListType;
|
|
23
|
+
/**
|
|
24
|
+
* A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
|
|
25
|
+
*
|
|
26
|
+
* @observable
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
value: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* List Walker options that change the range of the list items to be changed when the selection is collapsed within a list item.
|
|
32
|
+
*
|
|
33
|
+
* In a multi-level list, when the selection is collapsed within a list item, instead of changing only the list items of the same list
|
|
34
|
+
* type and current indent level, the entire list structure is changed (all list items at all indent levels of any list type).
|
|
35
|
+
*/
|
|
36
|
+
private readonly _listWalkerOptions?;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an instance of the command.
|
|
39
|
+
*
|
|
40
|
+
* @param editor The editor instance.
|
|
41
|
+
* @param type List type that will be handled by this command.
|
|
42
|
+
*/
|
|
43
|
+
constructor(editor: Editor, type: ListType, options?: {
|
|
44
|
+
multiLevel?: boolean;
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
refresh(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Executes the list command.
|
|
52
|
+
*
|
|
53
|
+
* @fires execute
|
|
54
|
+
* @fires afterExecute
|
|
55
|
+
* @param options Command options.
|
|
56
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`, the command will try to convert the
|
|
57
|
+
* selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
|
|
58
|
+
* to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
|
|
59
|
+
* @param options.additionalAttributes Additional attributes that are set for list items when the command is executed.
|
|
60
|
+
*/
|
|
61
|
+
execute(options?: {
|
|
62
|
+
forceValue?: boolean;
|
|
63
|
+
additionalAttributes?: Record<string, unknown>;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* Fires the `afterExecute` event.
|
|
67
|
+
*
|
|
68
|
+
* @param changedBlocks The changed list elements.
|
|
69
|
+
*/
|
|
70
|
+
private _fireAfterExecute;
|
|
71
|
+
/**
|
|
72
|
+
* Checks the command's {@link #value}.
|
|
73
|
+
*
|
|
74
|
+
* @returns The current value.
|
|
75
|
+
*/
|
|
76
|
+
private _getValue;
|
|
77
|
+
/**
|
|
78
|
+
* Checks whether the command can be enabled in the current context.
|
|
79
|
+
*
|
|
80
|
+
* @returns Whether the command should be enabled.
|
|
81
|
+
*/
|
|
82
|
+
private _checkEnabled;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Event fired by the {@link ~ListCommand#execute} method.
|
|
86
|
+
*
|
|
87
|
+
* It allows to execute an action after executing the {@link ~ListCommand#execute} method,
|
|
88
|
+
* for example adjusting attributes of changed list items.
|
|
89
|
+
*
|
|
90
|
+
* @internal
|
|
91
|
+
* @eventName ~ListCommand#afterExecute
|
|
92
|
+
*/
|
|
93
|
+
export type ListCommandAfterExecuteEvent = {
|
|
94
|
+
name: 'afterExecute';
|
|
95
|
+
args: [changedBlocks: Array<Element>];
|
|
96
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/list/listediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import type { DowncastWriter, Element, ViewElement, ViewAttributeElement, Writer } from 'ckeditor5/src/engine.js';
|
|
14
|
+
import { Delete } from 'ckeditor5/src/typing.js';
|
|
15
|
+
import { Enter } from 'ckeditor5/src/enter.js';
|
|
16
|
+
import ListUtils from './listutils.js';
|
|
17
|
+
import { ListBlocksIterable } from './utils/listwalker.js';
|
|
18
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
19
|
+
import '../../theme/documentlist.css';
|
|
20
|
+
import '../../theme/list.css';
|
|
21
|
+
export type ListType = 'numbered' | 'bulleted' | 'todo' | 'customNumbered' | 'customBulleted';
|
|
22
|
+
/**
|
|
23
|
+
* Map of model attributes applicable to list blocks.
|
|
24
|
+
*/
|
|
25
|
+
export interface ListItemAttributesMap {
|
|
26
|
+
listType?: ListType;
|
|
27
|
+
listIndent?: number;
|
|
28
|
+
listItemId?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The editing part of the document-list feature. It handles creating, editing and removing lists and list items.
|
|
32
|
+
*/
|
|
33
|
+
export default class ListEditing extends Plugin {
|
|
34
|
+
/**
|
|
35
|
+
* The list of registered downcast strategies.
|
|
36
|
+
*/
|
|
37
|
+
private readonly _downcastStrategies;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get pluginName(): "ListEditing";
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
static get requires(): readonly [typeof Enter, typeof Delete, typeof ListUtils, typeof ClipboardPipeline];
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
constructor(editor: Editor);
|
|
50
|
+
/**
|
|
51
|
+
* @inheritDoc
|
|
52
|
+
*/
|
|
53
|
+
init(): void;
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
afterInit(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Registers a downcast strategy.
|
|
60
|
+
*
|
|
61
|
+
* **Note**: Strategies must be registered in the `Plugin#init()` phase so that it can be applied
|
|
62
|
+
* in the `ListEditing#afterInit()`.
|
|
63
|
+
*
|
|
64
|
+
* @param strategy The downcast strategy to register.
|
|
65
|
+
*/
|
|
66
|
+
registerDowncastStrategy(strategy: DowncastStrategy): void;
|
|
67
|
+
/**
|
|
68
|
+
* Returns list of model attribute names that should affect downcast conversion.
|
|
69
|
+
*/
|
|
70
|
+
getListAttributeNames(): Array<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Attaches the listener to the {@link module:engine/view/document~Document#event:delete} event and handles backspace/delete
|
|
73
|
+
* keys in and around document lists.
|
|
74
|
+
*/
|
|
75
|
+
private _setupDeleteIntegration;
|
|
76
|
+
/**
|
|
77
|
+
* Attaches a listener to the {@link module:engine/view/document~Document#event:enter} event and handles enter key press
|
|
78
|
+
* in document lists.
|
|
79
|
+
*/
|
|
80
|
+
private _setupEnterIntegration;
|
|
81
|
+
/**
|
|
82
|
+
* Attaches a listener to the {@link module:engine/view/document~Document#event:tab} event and handles tab key and tab+shift keys
|
|
83
|
+
* presses in document lists.
|
|
84
|
+
*/
|
|
85
|
+
private _setupTabIntegration;
|
|
86
|
+
/**
|
|
87
|
+
* Registers the conversion helpers for the document-list feature.
|
|
88
|
+
*/
|
|
89
|
+
private _setupConversion;
|
|
90
|
+
/**
|
|
91
|
+
* Registers model post-fixers.
|
|
92
|
+
*/
|
|
93
|
+
private _setupModelPostFixing;
|
|
94
|
+
/**
|
|
95
|
+
* Integrates the feature with the clipboard via {@link module:engine/model/model~Model#insertContent} and
|
|
96
|
+
* {@link module:engine/model/model~Model#getSelectedContent}.
|
|
97
|
+
*/
|
|
98
|
+
private _setupClipboardIntegration;
|
|
99
|
+
/**
|
|
100
|
+
* Informs editor accessibility features about keystrokes brought by the plugin.
|
|
101
|
+
*/
|
|
102
|
+
private _setupAccessibilityIntegration;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The attribute to attribute downcast strategy for UL, OL, LI elements.
|
|
106
|
+
*/
|
|
107
|
+
export interface AttributeDowncastStrategy {
|
|
108
|
+
/**
|
|
109
|
+
* The scope of the downcast (whether it applies to LI or OL/UL).
|
|
110
|
+
*/
|
|
111
|
+
scope: 'list' | 'item';
|
|
112
|
+
/**
|
|
113
|
+
* The model attribute name.
|
|
114
|
+
*/
|
|
115
|
+
attributeName: string;
|
|
116
|
+
/**
|
|
117
|
+
* Sets the property on the view element.
|
|
118
|
+
*/
|
|
119
|
+
setAttributeOnDowncast(writer: DowncastWriter, value: unknown, element: ViewElement): void;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The custom marker downcast strategy.
|
|
123
|
+
*/
|
|
124
|
+
export interface ItemMarkerDowncastStrategy {
|
|
125
|
+
/**
|
|
126
|
+
* The scope of the downcast.
|
|
127
|
+
*/
|
|
128
|
+
scope: 'itemMarker';
|
|
129
|
+
/**
|
|
130
|
+
* The model attribute name.
|
|
131
|
+
*/
|
|
132
|
+
attributeName: string;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a view element for a custom item marker.
|
|
135
|
+
*/
|
|
136
|
+
createElement(writer: DowncastWriter, modelElement: Element, { dataPipeline }: {
|
|
137
|
+
dataPipeline?: boolean;
|
|
138
|
+
}): ViewElement | null;
|
|
139
|
+
/**
|
|
140
|
+
* Creates an AttributeElement to be used for wrapping a first block of a list item.
|
|
141
|
+
*/
|
|
142
|
+
createWrapperElement?(writer: DowncastWriter, modelElement: Element, { dataPipeline }: {
|
|
143
|
+
dataPipeline?: boolean;
|
|
144
|
+
}): ViewAttributeElement;
|
|
145
|
+
/**
|
|
146
|
+
* Should return true if the given list block can be wrapped with the wrapper created by `createWrapperElement()`
|
|
147
|
+
* or only the marker element should be wrapped.
|
|
148
|
+
*/
|
|
149
|
+
canWrapElement?(modelElement: Element): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Should return true if the custom marker can be injected into a given list block.
|
|
152
|
+
* Otherwise, custom marker view element is always injected before the block element.
|
|
153
|
+
*/
|
|
154
|
+
canInjectMarkerIntoElement?(modelElement: Element): boolean;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The downcast strategy.
|
|
158
|
+
*/
|
|
159
|
+
export type DowncastStrategy = AttributeDowncastStrategy | ItemMarkerDowncastStrategy;
|
|
160
|
+
/**
|
|
161
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list element
|
|
162
|
+
* is representing those attributes.
|
|
163
|
+
*
|
|
164
|
+
* It allows triggering a re-wrapping of a list item.
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
* @eventName ~ListEditing#postFixer
|
|
168
|
+
* @param listHead The head element of a list.
|
|
169
|
+
* @param writer The writer to do changes with.
|
|
170
|
+
* @param seenIds The set of already known IDs.
|
|
171
|
+
* @returns If a post-fixer made a change of the model tree, it should return `true`.
|
|
172
|
+
*/
|
|
173
|
+
export type ListEditingPostFixerEvent = {
|
|
174
|
+
name: 'postFixer';
|
|
175
|
+
args: [
|
|
176
|
+
{
|
|
177
|
+
listNodes: ListBlocksIterable;
|
|
178
|
+
listHead: Element;
|
|
179
|
+
writer: Writer;
|
|
180
|
+
seenIds: Set<string>;
|
|
181
|
+
}
|
|
182
|
+
];
|
|
183
|
+
return: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list element
|
|
187
|
+
* is representing those attributes.
|
|
188
|
+
*
|
|
189
|
+
* It allows triggering a re-wrapping of a list item.
|
|
190
|
+
*
|
|
191
|
+
* **Note**: For convenience this event is namespaced and could be captured as `checkAttributes:list` or `checkAttributes:item`.
|
|
192
|
+
*
|
|
193
|
+
* @internal
|
|
194
|
+
* @eventName ~ListEditing#checkAttributes
|
|
195
|
+
*/
|
|
196
|
+
export type ListEditingCheckAttributesEvent = {
|
|
197
|
+
name: 'checkAttributes' | 'checkAttributes:list' | 'checkAttributes:item';
|
|
198
|
+
args: [
|
|
199
|
+
{
|
|
200
|
+
viewElement: ViewElement & {
|
|
201
|
+
id?: string;
|
|
202
|
+
};
|
|
203
|
+
modelAttributes: ListItemAttributesMap;
|
|
204
|
+
}
|
|
205
|
+
];
|
|
206
|
+
return: boolean;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list block element
|
|
210
|
+
* is representing those attributes.
|
|
211
|
+
*
|
|
212
|
+
* It allows triggering a reconversion of a list item block.
|
|
213
|
+
*
|
|
214
|
+
* @internal
|
|
215
|
+
* @eventName ~ListEditing#checkElement
|
|
216
|
+
*/
|
|
217
|
+
export type ListEditingCheckElementEvent = {
|
|
218
|
+
name: 'checkElement';
|
|
219
|
+
args: [
|
|
220
|
+
{
|
|
221
|
+
viewElement: ViewElement;
|
|
222
|
+
modelElement: Element;
|
|
223
|
+
}
|
|
224
|
+
];
|
|
225
|
+
return: boolean;
|
|
226
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/list/listindentcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
14
|
+
/**
|
|
15
|
+
* The document list indent command. It is used by the {@link module:list/list~List list feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class ListIndentCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* Determines by how much the command will change the list item's indent attribute.
|
|
20
|
+
*/
|
|
21
|
+
private readonly _direction;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of the command.
|
|
24
|
+
*
|
|
25
|
+
* @param editor The editor instance.
|
|
26
|
+
* @param indentDirection The direction of indent. If it is equal to `backward`, the command
|
|
27
|
+
* will outdent a list item.
|
|
28
|
+
*/
|
|
29
|
+
constructor(editor: Editor, indentDirection: 'forward' | 'backward');
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
refresh(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
|
|
36
|
+
*
|
|
37
|
+
* @fires execute
|
|
38
|
+
* @fires afterExecute
|
|
39
|
+
*/
|
|
40
|
+
execute(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Fires the `afterExecute` event.
|
|
43
|
+
*
|
|
44
|
+
* @param changedBlocks The changed list elements.
|
|
45
|
+
*/
|
|
46
|
+
private _fireAfterExecute;
|
|
47
|
+
/**
|
|
48
|
+
* Checks whether the command can be enabled in the current context.
|
|
49
|
+
*
|
|
50
|
+
* @returns Whether the command should be enabled.
|
|
51
|
+
*/
|
|
52
|
+
private _checkEnabled;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Event fired by the {@link ~ListIndentCommand#execute} method.
|
|
56
|
+
*
|
|
57
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
58
|
+
* method, for example adjusting attributes of changed list items.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
* @eventName ~ListIndentCommand#afterExecute
|
|
62
|
+
*/
|
|
63
|
+
export type ListIndentCommandAfterExecuteEvent = {
|
|
64
|
+
name: 'afterExecute';
|
|
65
|
+
args: [changedBlocks: Array<Element>];
|
|
66
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module list/list/listmergecommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
14
|
+
/**
|
|
15
|
+
* The document list merge command. It is used by the {@link module:list/list~List list feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class ListMergeCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* Whether list item should be merged before or after the selected block.
|
|
20
|
+
*/
|
|
21
|
+
private readonly _direction;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of the command.
|
|
24
|
+
*
|
|
25
|
+
* @param editor The editor instance.
|
|
26
|
+
* @param direction Whether list item should be merged before or after the selected block.
|
|
27
|
+
*/
|
|
28
|
+
constructor(editor: Editor, direction: 'forward' | 'backward');
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
refresh(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Merges list blocks together (depending on the {@link #constructor}'s `direction` parameter).
|
|
35
|
+
*
|
|
36
|
+
* @fires execute
|
|
37
|
+
* @fires afterExecute
|
|
38
|
+
* @param options Command options.
|
|
39
|
+
* @param options.shouldMergeOnBlocksContentLevel When set `true`, merging will be performed together
|
|
40
|
+
* with {@link module:engine/model/model~Model#deleteContent} to get rid of the inline content in the selection or take advantage
|
|
41
|
+
* of the heuristics in `deleteContent()` that helps convert lists into paragraphs in certain cases.
|
|
42
|
+
*/
|
|
43
|
+
execute({ shouldMergeOnBlocksContentLevel }?: {
|
|
44
|
+
shouldMergeOnBlocksContentLevel?: boolean;
|
|
45
|
+
}): void;
|
|
46
|
+
/**
|
|
47
|
+
* Fires the `afterExecute` event.
|
|
48
|
+
*
|
|
49
|
+
* @param changedBlocks The changed list elements.
|
|
50
|
+
*/
|
|
51
|
+
private _fireAfterExecute;
|
|
52
|
+
/**
|
|
53
|
+
* Checks whether the command can be enabled in the current context.
|
|
54
|
+
*
|
|
55
|
+
* @returns Whether the command should be enabled.
|
|
56
|
+
*/
|
|
57
|
+
private _checkEnabled;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the boundary elements the merge should be executed for. These are not necessarily selection's first
|
|
60
|
+
* and last position parents but sometimes sibling or even further blocks depending on the context.
|
|
61
|
+
*
|
|
62
|
+
* @param selection The selection the merge is executed for.
|
|
63
|
+
* @param shouldMergeOnBlocksContentLevel When `true`, merge is performed together with
|
|
64
|
+
* {@link module:engine/model/model~Model#deleteContent} to remove the inline content within the selection.
|
|
65
|
+
*/
|
|
66
|
+
private _getMergeSubjectElements;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Event fired by the {@link ~ListMergeCommand#execute} method.
|
|
70
|
+
*
|
|
71
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
72
|
+
* method, for example adjusting attributes of changed list items.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
* @eventName ~ListMergeCommand#afterExecute
|
|
76
|
+
*/
|
|
77
|
+
export type ListMergeCommandAfterExecuteEvent = {
|
|
78
|
+
name: 'afterExecute';
|
|
79
|
+
args: [changedBlocks: Array<Element>];
|
|
80
|
+
};
|