@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,36 @@
|
|
|
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 LegacyListUtils from './legacylistutils.js';
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
11
|
+
import { Enter } from 'ckeditor5/src/enter.js';
|
|
12
|
+
import { Delete } from 'ckeditor5/src/typing.js';
|
|
13
|
+
import '../../theme/list.css';
|
|
14
|
+
/**
|
|
15
|
+
* The engine of the list feature. It handles creating, editing and removing lists and list items.
|
|
16
|
+
*
|
|
17
|
+
* It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
|
|
18
|
+
*/
|
|
19
|
+
export default class LegacyListEditing extends Plugin {
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): "LegacyListEditing";
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof Enter, typeof Delete, typeof LegacyListUtils];
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
init(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
afterInit(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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/legacylist/legacylistutils
|
|
11
|
+
*/
|
|
12
|
+
import type { Element, Model, Position } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
14
|
+
/**
|
|
15
|
+
* A set of helpers related to legacy lists.
|
|
16
|
+
*/
|
|
17
|
+
export default class LegacyListUtils extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "LegacyListUtils";
|
|
22
|
+
/**
|
|
23
|
+
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
24
|
+
*/
|
|
25
|
+
getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
|
26
|
+
/**
|
|
27
|
+
* Returns an array with all `listItem` elements in the model selection.
|
|
28
|
+
*
|
|
29
|
+
* It returns all the items even if only a part of the list is selected, including items that belong to nested lists.
|
|
30
|
+
* If no list is selected, it returns an empty array.
|
|
31
|
+
* The order of the elements is not specified.
|
|
32
|
+
*/
|
|
33
|
+
getSelectedListItems(model: Model): Array<Element>;
|
|
34
|
+
/**
|
|
35
|
+
* Returns an array with all `listItem` elements that represent the same list.
|
|
36
|
+
*
|
|
37
|
+
* It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.
|
|
38
|
+
*
|
|
39
|
+
* Additionally, if the `position` is inside a list item, that list item will be returned as well.
|
|
40
|
+
*
|
|
41
|
+
* @param position Starting position.
|
|
42
|
+
* @param direction Walking direction.
|
|
43
|
+
*/
|
|
44
|
+
getSiblingNodes(position: Position, direction: 'forward' | 'backward'): Array<Element>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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/legacylist/legacyutils
|
|
11
|
+
*/
|
|
12
|
+
import { type DowncastConversionApi, type DowncastWriter, type Element, type Item, type Model, type Position, type ViewContainerElement, type ViewElement, type ViewItem, type ViewPosition } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
|
|
15
|
+
*
|
|
16
|
+
* @param writer The writer instance.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createViewListItemElement(writer: DowncastWriter): ViewContainerElement;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
|
|
21
|
+
* Then, it binds the created view list item (`<li>`) with the model `listItem` element.
|
|
22
|
+
* The function then returns the created view list item (`<li>`).
|
|
23
|
+
*
|
|
24
|
+
* @param modelItem Model list item.
|
|
25
|
+
* @param conversionApi Conversion interface.
|
|
26
|
+
* @returns View list element.
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateLiInUl(modelItem: Item, conversionApi: DowncastConversionApi): ViewContainerElement;
|
|
29
|
+
/**
|
|
30
|
+
* Helper function that inserts a view list at a correct place and merges it with its siblings.
|
|
31
|
+
* It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
|
|
32
|
+
* should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
|
|
33
|
+
* See comments below to better understand the algorithm.
|
|
34
|
+
*
|
|
35
|
+
* @param modelItem Model list item.
|
|
36
|
+
* @param injectedItem
|
|
37
|
+
* @param conversionApi Conversion interface.
|
|
38
|
+
* @param model The model instance.
|
|
39
|
+
*/
|
|
40
|
+
export declare function injectViewList(modelItem: Element, injectedItem: ViewContainerElement, conversionApi: DowncastConversionApi, model: Model): void;
|
|
41
|
+
/**
|
|
42
|
+
* Helper function that takes two parameters that are expected to be view list elements, and merges them.
|
|
43
|
+
* The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
|
|
44
|
+
*
|
|
45
|
+
* @param viewWriter The writer instance.
|
|
46
|
+
* @param firstList The first element to compare.
|
|
47
|
+
* @param secondList The second element to compare.
|
|
48
|
+
* @returns The position after merge or `null` when there was no merge.
|
|
49
|
+
*/
|
|
50
|
+
export declare function mergeViewLists(viewWriter: DowncastWriter, firstList: ViewItem, secondList: ViewItem): ViewPosition | null;
|
|
51
|
+
/**
|
|
52
|
+
* Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
|
|
53
|
+
* are after the given position.
|
|
54
|
+
*
|
|
55
|
+
* For example:
|
|
56
|
+
* `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
|
|
57
|
+
* For position ^, the position before "bar" will be returned.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare function positionAfterUiElements(viewPosition: ViewPosition): ViewPosition;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
|
|
63
|
+
* passed by the options object.
|
|
64
|
+
*
|
|
65
|
+
* @param options Search criteria.
|
|
66
|
+
* @param options.sameIndent Whether the sought sibling should have the same indentation.
|
|
67
|
+
* @param options.smallerIndent Whether the sought sibling should have a smaller indentation.
|
|
68
|
+
* @param options.listIndent The reference indentation.
|
|
69
|
+
* @param options.direction Walking direction.
|
|
70
|
+
*/
|
|
71
|
+
export declare function getSiblingListItem(modelItem: Item | null, options: {
|
|
72
|
+
sameIndent?: boolean;
|
|
73
|
+
smallerIndent?: boolean;
|
|
74
|
+
listIndent?: number;
|
|
75
|
+
direction?: 'forward' | 'backward';
|
|
76
|
+
}): Element | null;
|
|
77
|
+
/**
|
|
78
|
+
* Returns a first list view element that is direct child of the given view element.
|
|
79
|
+
*/
|
|
80
|
+
export declare function findNestedList(viewElement: ViewElement): ViewElement | null;
|
|
81
|
+
/**
|
|
82
|
+
* Returns an array with all `listItem` elements that represent the same list.
|
|
83
|
+
*
|
|
84
|
+
* It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.
|
|
85
|
+
*
|
|
86
|
+
* Additionally, if the `position` is inside a list item, that list item will be returned as well.
|
|
87
|
+
*
|
|
88
|
+
* @param position Starting position.
|
|
89
|
+
* @param direction Walking direction.
|
|
90
|
+
*/
|
|
91
|
+
export declare function getSiblingNodes(position: Position, direction: 'forward' | 'backward'): Array<Element>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns an array with all `listItem` elements in the model selection.
|
|
94
|
+
*
|
|
95
|
+
* It returns all the items even if only a part of the list is selected, including items that belong to nested lists.
|
|
96
|
+
* If no list is selected, it returns an empty array.
|
|
97
|
+
* The order of the elements is not specified.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare function getSelectedListItems(model: Model): Array<Element>;
|
|
102
|
+
/**
|
|
103
|
+
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
104
|
+
*/
|
|
105
|
+
export declare function getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
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/legacylist
|
|
11
|
+
*/
|
|
12
|
+
import LegacyListEditing from './legacylist/legacylistediting.js';
|
|
13
|
+
import ListUI from './list/listui.js';
|
|
14
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
15
|
+
/**
|
|
16
|
+
* The legacy list feature.
|
|
17
|
+
*
|
|
18
|
+
* This is a "glue" plugin that loads the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing feature}
|
|
19
|
+
* and {@link module:list/list/listui~ListUI list UI feature}.
|
|
20
|
+
*/
|
|
21
|
+
export default class LegacyList extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): readonly [typeof LegacyListEditing, typeof ListUI];
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get pluginName(): "LegacyList";
|
|
30
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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/legacylistproperties/legacylistpropertiesediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import LegacyListEditing from '../legacylist/legacylistediting.js';
|
|
14
|
+
/**
|
|
15
|
+
* The engine of the list properties feature.
|
|
16
|
+
*
|
|
17
|
+
* It sets the value for the `listItem` attribute of the {@link module:list/legacylist~LegacyList `<listItem>`} element that
|
|
18
|
+
* allows modifying the list style type.
|
|
19
|
+
*
|
|
20
|
+
* It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
|
|
21
|
+
* Read more in {@link module:list/listconfig~ListPropertiesConfig}.
|
|
22
|
+
*/
|
|
23
|
+
export default class LegacyListPropertiesEditing extends Plugin {
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof LegacyListEditing];
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static get pluginName(): "LegacyListPropertiesEditing";
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
constructor(editor: Editor);
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
init(): void;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
afterInit(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether two lists will be merged into a single
|
|
46
|
+
* one after deleting the content.
|
|
47
|
+
*
|
|
48
|
+
* The purpose of this action is to adjust the `listStyle`, `listReversed` and `listStart` values
|
|
49
|
+
* for the list that was merged.
|
|
50
|
+
*
|
|
51
|
+
* Consider the following model's content:
|
|
52
|
+
*
|
|
53
|
+
* ```xml
|
|
54
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
|
55
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
|
56
|
+
* <paragraph>[A paragraph.]</paragraph>
|
|
57
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 1</listItem>
|
|
58
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 2</listItem>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* After removing the paragraph element, the second list will be merged into the first one.
|
|
62
|
+
* We want to inherit the `listStyle` attribute for the second list from the first one.
|
|
63
|
+
*
|
|
64
|
+
* ```xml
|
|
65
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
|
66
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
|
67
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
|
|
68
|
+
* <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* See https://github.com/ckeditor/ckeditor5/issues/7879.
|
|
72
|
+
*
|
|
73
|
+
* @param attributeStrategies Strategies for the enabled attributes.
|
|
74
|
+
*/
|
|
75
|
+
private _mergeListAttributesWhileMergingLists;
|
|
76
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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/legacylistproperties/legacylistreversedcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
|
|
15
|
+
* reversed.
|
|
16
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class LegacyListReversedCommand extends Command {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
value: boolean | null;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
refresh(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Executes the command.
|
|
29
|
+
*
|
|
30
|
+
* @fires execute
|
|
31
|
+
* @param options.reversed Whether the list should be reversed.
|
|
32
|
+
*/
|
|
33
|
+
execute(options?: {
|
|
34
|
+
reversed?: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
/**
|
|
37
|
+
* Checks the command's {@link #value}.
|
|
38
|
+
*
|
|
39
|
+
* @returns The current value.
|
|
40
|
+
*/
|
|
41
|
+
private _getValue;
|
|
42
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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/legacylistproperties/legacyliststartcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
15
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class LegacyListStartCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
value: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
refresh(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Executes the command.
|
|
28
|
+
*
|
|
29
|
+
* @fires execute
|
|
30
|
+
* @param options.startIndex The list start index.
|
|
31
|
+
*/
|
|
32
|
+
execute({ startIndex }?: {
|
|
33
|
+
startIndex?: number;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* Checks the command's {@link #value}.
|
|
37
|
+
*
|
|
38
|
+
* @returns The current value.
|
|
39
|
+
*/
|
|
40
|
+
private _getValue;
|
|
41
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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/legacylistproperties/legacyliststylecommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The list style command. It changes the `listStyle` attribute of the selected list items.
|
|
15
|
+
*
|
|
16
|
+
* If the list type (numbered or bulleted) can be inferred from the passed style type,
|
|
17
|
+
* the command tries to convert selected items to a list of that type.
|
|
18
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
19
|
+
*/
|
|
20
|
+
export default class LegacyListStyleCommand extends Command {
|
|
21
|
+
isStyleTypeSupported: undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
value: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* The default type of the list style.
|
|
29
|
+
*/
|
|
30
|
+
readonly defaultType: string;
|
|
31
|
+
/**
|
|
32
|
+
* Creates an instance of the command.
|
|
33
|
+
*
|
|
34
|
+
* @param editor The editor instance.
|
|
35
|
+
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
36
|
+
* the command execution.
|
|
37
|
+
*/
|
|
38
|
+
constructor(editor: Editor, defaultType: string);
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
refresh(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Executes the command.
|
|
45
|
+
*
|
|
46
|
+
* @fires execute
|
|
47
|
+
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
48
|
+
* style will be applied.
|
|
49
|
+
*/
|
|
50
|
+
execute(options?: {
|
|
51
|
+
type?: string | null;
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Checks the command's {@link #value}.
|
|
55
|
+
*
|
|
56
|
+
* @returns The current value.
|
|
57
|
+
*/
|
|
58
|
+
private _getValue;
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether the command can be enabled in the current context.
|
|
61
|
+
*
|
|
62
|
+
* @returns Whether the command should be enabled.
|
|
63
|
+
*/
|
|
64
|
+
private _checkEnabled;
|
|
65
|
+
/**
|
|
66
|
+
* Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
|
|
67
|
+
*
|
|
68
|
+
* @param The type of the list style. If `null` is specified, the function does nothing.
|
|
69
|
+
*/
|
|
70
|
+
private _tryToConvertItemsToList;
|
|
71
|
+
}
|
|
@@ -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/legacylistproperties
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
|
|
14
|
+
import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
15
|
+
/**
|
|
16
|
+
* The legacy list properties feature.
|
|
17
|
+
*
|
|
18
|
+
* This is a "glue" plugin that loads the {@link module:list/legacylistproperties/legacylistpropertiesediting~LegacyListPropertiesEditing
|
|
19
|
+
* legacy list properties editing feature} and the
|
|
20
|
+
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
21
|
+
*/
|
|
22
|
+
export default class LegacyListProperties extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof LegacyListPropertiesEditing, typeof ListPropertiesUI];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "LegacyListProperties";
|
|
31
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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/legacychecktodolistcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
14
|
+
/**
|
|
15
|
+
* The check to-do command.
|
|
16
|
+
*
|
|
17
|
+
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
18
|
+
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
19
|
+
*/
|
|
20
|
+
export default class LegacyCheckTodoListCommand extends Command {
|
|
21
|
+
/**
|
|
22
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
23
|
+
*
|
|
24
|
+
* @observable
|
|
25
|
+
* @readonly
|
|
26
|
+
*/
|
|
27
|
+
value: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
_selectedElements: Array<Element>;
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
constructor(editor: Editor);
|
|
38
|
+
/**
|
|
39
|
+
* Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
|
|
40
|
+
*/
|
|
41
|
+
refresh(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
44
|
+
*/
|
|
45
|
+
private _getSelectedItems;
|
|
46
|
+
/**
|
|
47
|
+
* Executes the command.
|
|
48
|
+
*
|
|
49
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
|
|
50
|
+
* the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
|
|
51
|
+
* value to decide what it should do.
|
|
52
|
+
*/
|
|
53
|
+
execute(options?: {
|
|
54
|
+
forceValue?: boolean;
|
|
55
|
+
}): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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/legacytodolistconverters
|
|
11
|
+
*/
|
|
12
|
+
import type { DowncastAttributeEvent, DowncastInsertEvent, Element, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import { type GetCallback } from 'ckeditor5/src/utils.js';
|
|
14
|
+
/**
|
|
15
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
16
|
+
*
|
|
17
|
+
* It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~UIElement checkbox element}
|
|
18
|
+
* at the beginning of each list item. It also merges the list with surrounding lists (if available).
|
|
19
|
+
*
|
|
20
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
21
|
+
*
|
|
22
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
23
|
+
* @param model Model instance.
|
|
24
|
+
* @param onCheckboxChecked Callback function.
|
|
25
|
+
* @returns Returns a conversion callback.
|
|
26
|
+
*/
|
|
27
|
+
export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element: Element) => void): GetCallback<DowncastInsertEvent<Element>>;
|
|
28
|
+
/**
|
|
29
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
30
|
+
*
|
|
31
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
32
|
+
*
|
|
33
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
34
|
+
* @param model Model instance.
|
|
35
|
+
* @returns Returns a conversion callback.
|
|
36
|
+
*/
|
|
37
|
+
export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<Element>>;
|
|
38
|
+
/**
|
|
39
|
+
* A view-to-model converter for the checkbox element inside a view list item.
|
|
40
|
+
*
|
|
41
|
+
* It changes the `listType` of the model `listItem` to a `todo` value.
|
|
42
|
+
* When a view checkbox element is marked as checked, an additional `todoListChecked="true"` attribute is added to the model item.
|
|
43
|
+
*
|
|
44
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
45
|
+
*
|
|
46
|
+
* @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
|
|
47
|
+
*/
|
|
48
|
+
export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementEvent>;
|
|
49
|
+
/**
|
|
50
|
+
* A model-to-view converter for the `listType` attribute change on the `listItem` model element.
|
|
51
|
+
*
|
|
52
|
+
* This change means that the `<li>` element parent changes to `<ul class="todo-list">` and a
|
|
53
|
+
* {@link module:engine/view/uielement~UIElement checkbox UI element} is added at the beginning
|
|
54
|
+
* of the list item element (or vice versa).
|
|
55
|
+
*
|
|
56
|
+
* This converter is preceded by {@link module:list/legacylist/legacyconverters~modelViewChangeType} and followed by
|
|
57
|
+
* {@link module:list/legacylist/legacyconverters~modelViewMergeAfterChangeType} to handle splitting and merging surrounding lists
|
|
58
|
+
* of the same type.
|
|
59
|
+
*
|
|
60
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
61
|
+
*
|
|
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
|
+
export declare function modelViewChangeType(onCheckedChange: (element: Element) => void, view: EditingView): GetCallback<DowncastAttributeEvent<Element>>;
|
|
68
|
+
/**
|
|
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~UIElement checkbox UI element} as checked.
|
|
72
|
+
*
|
|
73
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
74
|
+
*
|
|
75
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
76
|
+
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
77
|
+
* @returns Returns a conversion callback.
|
|
78
|
+
*/
|
|
79
|
+
export declare function modelViewChangeChecked(onCheckedChange: (element: Element) => void): GetCallback<DowncastAttributeEvent<Element>>;
|
|
80
|
+
/**
|
|
81
|
+
* A model-to-view position at zero offset mapper.
|
|
82
|
+
*
|
|
83
|
+
* This helper ensures that position inside todo-list in the view is mapped after the checkbox.
|
|
84
|
+
*
|
|
85
|
+
* It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.
|
|
86
|
+
*/
|
|
87
|
+
export declare function mapModelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
|