@ckeditor/ckeditor5-list 0.0.0-internal-20241017.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/CHANGELOG.md +4 -0
- package/LICENSE.md +17 -0
- package/README.md +26 -0
- package/build/list.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/ast.js +1 -0
- package/build/translations/az.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/en-gb.js +1 -0
- package/build/translations/eo.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/eu.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/jv.js +1 -0
- package/build/translations/km.js +1 -0
- package/build/translations/kn.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/ku.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nb.js +1 -0
- package/build/translations/ne.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/si.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sq.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/ti.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/tt.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +193 -0
- package/dist/augmentation.d.ts +57 -0
- package/dist/documentlist.d.ts +36 -0
- package/dist/documentlistproperties.d.ts +36 -0
- package/dist/index-content.css +116 -0
- package/dist/index-editor.css +82 -0
- package/dist/index.css +238 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +7994 -0
- package/dist/index.js.map +1 -0
- package/dist/legacylist/legacyconverters.d.ts +200 -0
- package/dist/legacylist/legacyindentcommand.d.ts +41 -0
- package/dist/legacylist/legacylistcommand.d.ts +60 -0
- package/dist/legacylist/legacylistediting.d.ts +40 -0
- package/dist/legacylist/legacylistutils.d.ts +49 -0
- package/dist/legacylist/legacyutils.d.ts +105 -0
- package/dist/legacylist.d.ts +34 -0
- package/dist/legacylistproperties/legacylistpropertiesediting.d.ts +80 -0
- package/dist/legacylistproperties/legacylistreversedcommand.d.ts +42 -0
- package/dist/legacylistproperties/legacyliststartcommand.d.ts +41 -0
- package/dist/legacylistproperties/legacyliststylecommand.d.ts +71 -0
- package/dist/legacylistproperties.d.ts +35 -0
- package/dist/legacytodolist/legacychecktodolistcommand.d.ts +56 -0
- package/dist/legacytodolist/legacytodolistconverters.d.ts +87 -0
- package/dist/legacytodolist/legacytodolistediting.d.ts +54 -0
- package/dist/legacytodolist.d.ts +35 -0
- package/dist/list/adjacentlistssupport.d.ts +23 -0
- package/dist/list/converters.d.ts +69 -0
- package/dist/list/listcommand.d.ts +96 -0
- package/dist/list/listediting.d.ts +230 -0
- package/dist/list/listindentcommand.d.ts +66 -0
- package/dist/list/listmergecommand.d.ts +80 -0
- package/dist/list/listsplitcommand.d.ts +71 -0
- package/dist/list/listui.d.ts +27 -0
- package/dist/list/listutils.d.ts +60 -0
- package/dist/list/utils/listwalker.d.ts +146 -0
- package/dist/list/utils/model.d.ts +213 -0
- package/dist/list/utils/postfixers.d.ts +41 -0
- package/dist/list/utils/view.d.ts +86 -0
- package/dist/list/utils.d.ts +22 -0
- package/dist/list.d.ts +34 -0
- package/dist/listconfig.d.ts +164 -0
- package/dist/listproperties/converters.d.ts +23 -0
- package/dist/listproperties/listpropertiesediting.d.ts +96 -0
- package/dist/listproperties/listpropertiesui.d.ts +31 -0
- package/dist/listproperties/listpropertiesutils.d.ts +41 -0
- package/dist/listproperties/listreversedcommand.d.ts +40 -0
- package/dist/listproperties/liststartcommand.d.ts +42 -0
- package/dist/listproperties/liststylecommand.d.ts +76 -0
- package/dist/listproperties/ui/listpropertiesview.d.ts +160 -0
- package/dist/listproperties/utils/config.d.ts +39 -0
- package/dist/listproperties/utils/style.d.ts +24 -0
- package/dist/listproperties.d.ts +35 -0
- package/dist/tododocumentlist.d.ts +36 -0
- package/dist/todolist/checktodolistcommand.d.ts +53 -0
- package/dist/todolist/todocheckboxchangeobserver.d.ts +45 -0
- package/dist/todolist/todolistediting.d.ts +53 -0
- package/dist/todolist/todolistui.d.ts +27 -0
- package/dist/todolist.d.ts +35 -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/lang/contexts.json +35 -0
- package/lang/translations/ar.po +150 -0
- package/lang/translations/ast.po +150 -0
- package/lang/translations/az.po +150 -0
- package/lang/translations/bg.po +150 -0
- package/lang/translations/bn.po +150 -0
- package/lang/translations/ca.po +150 -0
- package/lang/translations/cs.po +150 -0
- package/lang/translations/da.po +150 -0
- package/lang/translations/de-ch.po +150 -0
- package/lang/translations/de.po +150 -0
- package/lang/translations/el.po +150 -0
- package/lang/translations/en-au.po +150 -0
- package/lang/translations/en-gb.po +150 -0
- package/lang/translations/en.po +150 -0
- package/lang/translations/eo.po +150 -0
- package/lang/translations/es.po +150 -0
- package/lang/translations/et.po +150 -0
- package/lang/translations/eu.po +150 -0
- package/lang/translations/fa.po +150 -0
- package/lang/translations/fi.po +150 -0
- package/lang/translations/fr.po +150 -0
- package/lang/translations/gl.po +150 -0
- package/lang/translations/he.po +150 -0
- package/lang/translations/hi.po +150 -0
- package/lang/translations/hr.po +150 -0
- package/lang/translations/hu.po +150 -0
- package/lang/translations/id.po +150 -0
- package/lang/translations/it.po +150 -0
- package/lang/translations/ja.po +150 -0
- package/lang/translations/jv.po +150 -0
- package/lang/translations/km.po +150 -0
- package/lang/translations/kn.po +150 -0
- package/lang/translations/ko.po +150 -0
- package/lang/translations/ku.po +150 -0
- package/lang/translations/lt.po +150 -0
- package/lang/translations/lv.po +150 -0
- package/lang/translations/ms.po +150 -0
- package/lang/translations/nb.po +150 -0
- package/lang/translations/ne.po +150 -0
- package/lang/translations/nl.po +150 -0
- package/lang/translations/no.po +150 -0
- package/lang/translations/pl.po +150 -0
- package/lang/translations/pt-br.po +150 -0
- package/lang/translations/pt.po +150 -0
- package/lang/translations/ro.po +150 -0
- package/lang/translations/ru.po +150 -0
- package/lang/translations/si.po +150 -0
- package/lang/translations/sk.po +150 -0
- package/lang/translations/sq.po +150 -0
- package/lang/translations/sr-latn.po +150 -0
- package/lang/translations/sr.po +150 -0
- package/lang/translations/sv.po +150 -0
- package/lang/translations/th.po +150 -0
- package/lang/translations/ti.po +150 -0
- package/lang/translations/tk.po +150 -0
- package/lang/translations/tr.po +150 -0
- package/lang/translations/tt.po +150 -0
- package/lang/translations/ug.po +150 -0
- package/lang/translations/uk.po +150 -0
- package/lang/translations/ur.po +150 -0
- package/lang/translations/uz.po +150 -0
- package/lang/translations/vi.po +150 -0
- package/lang/translations/zh-cn.po +150 -0
- package/lang/translations/zh.po +150 -0
- package/package.json +45 -0
- package/src/augmentation.d.ts +53 -0
- package/src/augmentation.js +5 -0
- package/src/documentlist.d.ts +32 -0
- package/src/documentlist.js +47 -0
- package/src/documentlistproperties.d.ts +32 -0
- package/src/documentlistproperties.js +47 -0
- package/src/index.d.ts +45 -0
- package/src/index.js +39 -0
- package/src/legacylist/legacyconverters.d.ts +196 -0
- package/src/legacylist/legacyconverters.js +905 -0
- package/src/legacylist/legacyindentcommand.d.ts +37 -0
- package/src/legacylist/legacyindentcommand.js +107 -0
- package/src/legacylist/legacylistcommand.d.ts +56 -0
- package/src/legacylist/legacylistcommand.js +274 -0
- package/src/legacylist/legacylistediting.d.ts +36 -0
- package/src/legacylist/legacylistediting.js +167 -0
- package/src/legacylist/legacylistutils.d.ts +45 -0
- package/src/legacylist/legacylistutils.js +52 -0
- package/src/legacylist/legacyutils.d.ts +101 -0
- package/src/legacylist/legacyutils.js +347 -0
- package/src/legacylist.d.ts +30 -0
- package/src/legacylist.js +36 -0
- package/src/legacylistproperties/legacylistpropertiesediting.d.ts +76 -0
- package/src/legacylistproperties/legacylistpropertiesediting.js +702 -0
- package/src/legacylistproperties/legacylistreversedcommand.d.ts +38 -0
- package/src/legacylistproperties/legacylistreversedcommand.js +52 -0
- package/src/legacylistproperties/legacyliststartcommand.d.ts +37 -0
- package/src/legacylistproperties/legacyliststartcommand.js +51 -0
- package/src/legacylistproperties/legacyliststylecommand.d.ts +67 -0
- package/src/legacylistproperties/legacyliststylecommand.js +100 -0
- package/src/legacylistproperties.d.ts +31 -0
- package/src/legacylistproperties.js +37 -0
- package/src/legacytodolist/legacychecktodolistcommand.d.ts +52 -0
- package/src/legacytodolist/legacychecktodolistcommand.js +76 -0
- package/src/legacytodolist/legacytodolistconverters.d.ts +83 -0
- package/src/legacytodolist/legacytodolistconverters.js +261 -0
- package/src/legacytodolist/legacytodolistediting.d.ts +50 -0
- package/src/legacytodolist/legacytodolistediting.js +199 -0
- package/src/legacytodolist.d.ts +31 -0
- package/src/legacytodolist.js +37 -0
- package/src/list/adjacentlistssupport.d.ts +19 -0
- package/src/list/adjacentlistssupport.js +87 -0
- package/src/list/converters.d.ts +65 -0
- package/src/list/converters.js +491 -0
- package/src/list/listcommand.d.ts +92 -0
- package/src/list/listcommand.js +163 -0
- package/src/list/listediting.d.ts +226 -0
- package/src/list/listediting.js +678 -0
- package/src/list/listindentcommand.d.ts +62 -0
- package/src/list/listindentcommand.js +129 -0
- package/src/list/listmergecommand.d.ts +76 -0
- package/src/list/listmergecommand.js +174 -0
- package/src/list/listsplitcommand.d.ts +67 -0
- package/src/list/listsplitcommand.js +70 -0
- package/src/list/listui.d.ts +23 -0
- package/src/list/listui.js +41 -0
- package/src/list/listutils.d.ts +56 -0
- package/src/list/listutils.js +62 -0
- package/src/list/utils/listwalker.d.ts +142 -0
- package/src/list/utils/listwalker.js +182 -0
- package/src/list/utils/model.d.ts +209 -0
- package/src/list/utils/model.js +464 -0
- package/src/list/utils/postfixers.d.ts +37 -0
- package/src/list/utils/postfixers.js +126 -0
- package/src/list/utils/view.d.ts +82 -0
- package/src/list/utils/view.js +117 -0
- package/src/list/utils.d.ts +18 -0
- package/src/list/utils.js +51 -0
- package/src/list.d.ts +30 -0
- package/src/list.js +36 -0
- package/src/listconfig.d.ts +160 -0
- package/src/listconfig.js +5 -0
- package/src/listproperties/converters.d.ts +19 -0
- package/src/listproperties/converters.js +43 -0
- package/src/listproperties/listpropertiesediting.d.ts +92 -0
- package/src/listproperties/listpropertiesediting.js +275 -0
- package/src/listproperties/listpropertiesui.d.ts +27 -0
- package/src/listproperties/listpropertiesui.js +371 -0
- package/src/listproperties/listpropertiesutils.d.ts +37 -0
- package/src/listproperties/listpropertiesutils.js +50 -0
- package/src/listproperties/listreversedcommand.d.ts +36 -0
- package/src/listproperties/listreversedcommand.js +55 -0
- package/src/listproperties/liststartcommand.d.ts +38 -0
- package/src/listproperties/liststartcommand.js +60 -0
- package/src/listproperties/liststylecommand.d.ts +72 -0
- package/src/listproperties/liststylecommand.js +113 -0
- package/src/listproperties/ui/listpropertiesview.d.ts +156 -0
- package/src/listproperties/ui/listpropertiesview.js +301 -0
- package/src/listproperties/utils/config.d.ts +35 -0
- package/src/listproperties/utils/config.js +70 -0
- package/src/listproperties/utils/style.d.ts +20 -0
- package/src/listproperties/utils/style.js +54 -0
- package/src/listproperties.d.ts +31 -0
- package/src/listproperties.js +37 -0
- package/src/tododocumentlist.d.ts +32 -0
- package/src/tododocumentlist.js +47 -0
- package/src/todolist/checktodolistcommand.d.ts +49 -0
- package/src/todolist/checktodolistcommand.js +82 -0
- package/src/todolist/todocheckboxchangeobserver.d.ts +41 -0
- package/src/todolist/todocheckboxchangeobserver.js +37 -0
- package/src/todolist/todolistediting.d.ts +49 -0
- package/src/todolist/todolistediting.js +470 -0
- package/src/todolist/todolistui.d.ts +23 -0
- package/src/todolist/todolistui.js +34 -0
- package/src/todolist.d.ts +31 -0
- package/src/todolist.js +37 -0
- package/theme/documentlist.css +8 -0
- package/theme/icons/liststylecircle.svg +1 -0
- package/theme/icons/liststyledecimal.svg +1 -0
- package/theme/icons/liststyledecimalleadingzero.svg +1 -0
- package/theme/icons/liststyledisc.svg +1 -0
- package/theme/icons/liststylelowerlatin.svg +1 -0
- package/theme/icons/liststylelowerroman.svg +1 -0
- package/theme/icons/liststylesquare.svg +1 -0
- package/theme/icons/liststyleupperlatin.svg +1 -0
- package/theme/icons/liststyleupperroman.svg +1 -0
- package/theme/list.css +40 -0
- package/theme/listproperties.css +10 -0
- package/theme/liststyles.css +8 -0
- package/theme/todolist.css +140 -0
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
* @module list/list/listindentcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
10
|
+
/**
|
|
11
|
+
* The document list indent command. It is used by the {@link module:list/list~List list feature}.
|
|
12
|
+
*/
|
|
13
|
+
export default class ListIndentCommand extends Command {
|
|
14
|
+
/**
|
|
15
|
+
* Determines by how much the command will change the list item's indent attribute.
|
|
16
|
+
*/
|
|
17
|
+
private readonly _direction;
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the command.
|
|
20
|
+
*
|
|
21
|
+
* @param editor The editor instance.
|
|
22
|
+
* @param indentDirection The direction of indent. If it is equal to `backward`, the command
|
|
23
|
+
* will outdent a list item.
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: Editor, indentDirection: 'forward' | 'backward');
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
refresh(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
|
|
32
|
+
*
|
|
33
|
+
* @fires execute
|
|
34
|
+
* @fires afterExecute
|
|
35
|
+
*/
|
|
36
|
+
execute(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Fires the `afterExecute` event.
|
|
39
|
+
*
|
|
40
|
+
* @param changedBlocks The changed list elements.
|
|
41
|
+
*/
|
|
42
|
+
private _fireAfterExecute;
|
|
43
|
+
/**
|
|
44
|
+
* Checks whether the command can be enabled in the current context.
|
|
45
|
+
*
|
|
46
|
+
* @returns Whether the command should be enabled.
|
|
47
|
+
*/
|
|
48
|
+
private _checkEnabled;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Event fired by the {@link ~ListIndentCommand#execute} method.
|
|
52
|
+
*
|
|
53
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
54
|
+
* method, for example adjusting attributes of changed list items.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
* @eventName ~ListIndentCommand#afterExecute
|
|
58
|
+
*/
|
|
59
|
+
export type ListIndentCommandAfterExecuteEvent = {
|
|
60
|
+
name: 'afterExecute';
|
|
61
|
+
args: [changedBlocks: Array<Element>];
|
|
62
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
* @module list/list/listindentcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { expandListBlocksToCompleteItems, indentBlocks, isFirstBlockOfListItem, isListItemBlock, isSingleListItem, outdentBlocksWithMerge, sortBlocks, splitListItemBefore } from './utils/model.js';
|
|
10
|
+
import ListWalker from './utils/listwalker.js';
|
|
11
|
+
/**
|
|
12
|
+
* The document list indent command. It is used by the {@link module:list/list~List list feature}.
|
|
13
|
+
*/
|
|
14
|
+
export default class ListIndentCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the command.
|
|
17
|
+
*
|
|
18
|
+
* @param editor The editor instance.
|
|
19
|
+
* @param indentDirection The direction of indent. If it is equal to `backward`, the command
|
|
20
|
+
* will outdent a list item.
|
|
21
|
+
*/
|
|
22
|
+
constructor(editor, indentDirection) {
|
|
23
|
+
super(editor);
|
|
24
|
+
this._direction = indentDirection;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
refresh() {
|
|
30
|
+
this.isEnabled = this._checkEnabled();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
|
|
34
|
+
*
|
|
35
|
+
* @fires execute
|
|
36
|
+
* @fires afterExecute
|
|
37
|
+
*/
|
|
38
|
+
execute() {
|
|
39
|
+
const model = this.editor.model;
|
|
40
|
+
const blocks = getSelectedListBlocks(model.document.selection);
|
|
41
|
+
model.change(writer => {
|
|
42
|
+
const changedBlocks = [];
|
|
43
|
+
// Handle selection contained in the single list item and starting in the following blocks.
|
|
44
|
+
if (isSingleListItem(blocks) && !isFirstBlockOfListItem(blocks[0])) {
|
|
45
|
+
// Allow increasing indent of following list item blocks.
|
|
46
|
+
if (this._direction == 'forward') {
|
|
47
|
+
changedBlocks.push(...indentBlocks(blocks, writer));
|
|
48
|
+
}
|
|
49
|
+
// For indent make sure that indented blocks have a new ID.
|
|
50
|
+
// For outdent just split blocks from the list item (give them a new IDs).
|
|
51
|
+
changedBlocks.push(...splitListItemBefore(blocks[0], writer));
|
|
52
|
+
}
|
|
53
|
+
// More than a single list item is selected, or the first block of list item is selected.
|
|
54
|
+
else {
|
|
55
|
+
// Now just update the attributes of blocks.
|
|
56
|
+
if (this._direction == 'forward') {
|
|
57
|
+
changedBlocks.push(...indentBlocks(blocks, writer, { expand: true }));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
changedBlocks.push(...outdentBlocksWithMerge(blocks, writer));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Align the list item type to match the previous list item (from the same list).
|
|
64
|
+
for (const block of changedBlocks) {
|
|
65
|
+
// This block become a plain block (for example a paragraph).
|
|
66
|
+
if (!block.hasAttribute('listType')) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const previousItemBlock = ListWalker.first(block, { sameIndent: true });
|
|
70
|
+
if (previousItemBlock) {
|
|
71
|
+
writer.setAttribute('listType', previousItemBlock.getAttribute('listType'), block);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
this._fireAfterExecute(changedBlocks);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Fires the `afterExecute` event.
|
|
79
|
+
*
|
|
80
|
+
* @param changedBlocks The changed list elements.
|
|
81
|
+
*/
|
|
82
|
+
_fireAfterExecute(changedBlocks) {
|
|
83
|
+
this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Checks whether the command can be enabled in the current context.
|
|
87
|
+
*
|
|
88
|
+
* @returns Whether the command should be enabled.
|
|
89
|
+
*/
|
|
90
|
+
_checkEnabled() {
|
|
91
|
+
// Check whether any of position's ancestor is a list item.
|
|
92
|
+
let blocks = getSelectedListBlocks(this.editor.model.document.selection);
|
|
93
|
+
let firstBlock = blocks[0];
|
|
94
|
+
// If selection is not in a list item, the command is disabled.
|
|
95
|
+
if (!firstBlock) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
// If we are outdenting it is enough to be in list item. Every list item can always be outdented.
|
|
99
|
+
if (this._direction == 'backward') {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
// A single block of a list item is selected, so it could be indented as a sublist.
|
|
103
|
+
if (isSingleListItem(blocks) && !isFirstBlockOfListItem(blocks[0])) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
blocks = expandListBlocksToCompleteItems(blocks);
|
|
107
|
+
firstBlock = blocks[0];
|
|
108
|
+
// Check if there is any list item before selected items that could become a parent of selected items.
|
|
109
|
+
const siblingItem = ListWalker.first(firstBlock, { sameIndent: true });
|
|
110
|
+
if (!siblingItem) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (siblingItem.getAttribute('listType') == firstBlock.getAttribute('listType')) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns an array of selected blocks truncated to the first non list block element.
|
|
121
|
+
*/
|
|
122
|
+
function getSelectedListBlocks(selection) {
|
|
123
|
+
const blocks = Array.from(selection.getSelectedBlocks());
|
|
124
|
+
const firstNonListBlockIndex = blocks.findIndex(block => !isListItemBlock(block));
|
|
125
|
+
if (firstNonListBlockIndex != -1) {
|
|
126
|
+
blocks.length = firstNonListBlockIndex;
|
|
127
|
+
}
|
|
128
|
+
return blocks;
|
|
129
|
+
}
|
|
@@ -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
|
+
* @module list/list/listmergecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
10
|
+
/**
|
|
11
|
+
* The document list merge command. It is used by the {@link module:list/list~List list feature}.
|
|
12
|
+
*/
|
|
13
|
+
export default class ListMergeCommand extends Command {
|
|
14
|
+
/**
|
|
15
|
+
* Whether list item should be merged before or after the selected block.
|
|
16
|
+
*/
|
|
17
|
+
private readonly _direction;
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the command.
|
|
20
|
+
*
|
|
21
|
+
* @param editor The editor instance.
|
|
22
|
+
* @param direction Whether list item should be merged before or after the selected block.
|
|
23
|
+
*/
|
|
24
|
+
constructor(editor: Editor, direction: 'forward' | 'backward');
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
refresh(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Merges list blocks together (depending on the {@link #constructor}'s `direction` parameter).
|
|
31
|
+
*
|
|
32
|
+
* @fires execute
|
|
33
|
+
* @fires afterExecute
|
|
34
|
+
* @param options Command options.
|
|
35
|
+
* @param options.shouldMergeOnBlocksContentLevel When set `true`, merging will be performed together
|
|
36
|
+
* with {@link module:engine/model/model~Model#deleteContent} to get rid of the inline content in the selection or take advantage
|
|
37
|
+
* of the heuristics in `deleteContent()` that helps convert lists into paragraphs in certain cases.
|
|
38
|
+
*/
|
|
39
|
+
execute({ shouldMergeOnBlocksContentLevel }?: {
|
|
40
|
+
shouldMergeOnBlocksContentLevel?: boolean;
|
|
41
|
+
}): void;
|
|
42
|
+
/**
|
|
43
|
+
* Fires the `afterExecute` event.
|
|
44
|
+
*
|
|
45
|
+
* @param changedBlocks The changed list elements.
|
|
46
|
+
*/
|
|
47
|
+
private _fireAfterExecute;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether the command can be enabled in the current context.
|
|
50
|
+
*
|
|
51
|
+
* @returns Whether the command should be enabled.
|
|
52
|
+
*/
|
|
53
|
+
private _checkEnabled;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the boundary elements the merge should be executed for. These are not necessarily selection's first
|
|
56
|
+
* and last position parents but sometimes sibling or even further blocks depending on the context.
|
|
57
|
+
*
|
|
58
|
+
* @param selection The selection the merge is executed for.
|
|
59
|
+
* @param shouldMergeOnBlocksContentLevel When `true`, merge is performed together with
|
|
60
|
+
* {@link module:engine/model/model~Model#deleteContent} to remove the inline content within the selection.
|
|
61
|
+
*/
|
|
62
|
+
private _getMergeSubjectElements;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Event fired by the {@link ~ListMergeCommand#execute} method.
|
|
66
|
+
*
|
|
67
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
68
|
+
* method, for example adjusting attributes of changed list items.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
* @eventName ~ListMergeCommand#afterExecute
|
|
72
|
+
*/
|
|
73
|
+
export type ListMergeCommandAfterExecuteEvent = {
|
|
74
|
+
name: 'afterExecute';
|
|
75
|
+
args: [changedBlocks: Array<Element>];
|
|
76
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
* @module list/list/listmergecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { getNestedListBlocks, indentBlocks, sortBlocks, isFirstBlockOfListItem, mergeListItemBefore, isSingleListItem, getSelectedBlockObject, isListItemBlock } from './utils/model.js';
|
|
10
|
+
import ListWalker from './utils/listwalker.js';
|
|
11
|
+
/**
|
|
12
|
+
* The document list merge command. It is used by the {@link module:list/list~List list feature}.
|
|
13
|
+
*/
|
|
14
|
+
export default class ListMergeCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the command.
|
|
17
|
+
*
|
|
18
|
+
* @param editor The editor instance.
|
|
19
|
+
* @param direction Whether list item should be merged before or after the selected block.
|
|
20
|
+
*/
|
|
21
|
+
constructor(editor, direction) {
|
|
22
|
+
super(editor);
|
|
23
|
+
this._direction = direction;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
refresh() {
|
|
29
|
+
this.isEnabled = this._checkEnabled();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Merges list blocks together (depending on the {@link #constructor}'s `direction` parameter).
|
|
33
|
+
*
|
|
34
|
+
* @fires execute
|
|
35
|
+
* @fires afterExecute
|
|
36
|
+
* @param options Command options.
|
|
37
|
+
* @param options.shouldMergeOnBlocksContentLevel When set `true`, merging will be performed together
|
|
38
|
+
* with {@link module:engine/model/model~Model#deleteContent} to get rid of the inline content in the selection or take advantage
|
|
39
|
+
* of the heuristics in `deleteContent()` that helps convert lists into paragraphs in certain cases.
|
|
40
|
+
*/
|
|
41
|
+
execute({ shouldMergeOnBlocksContentLevel = false } = {}) {
|
|
42
|
+
const model = this.editor.model;
|
|
43
|
+
const selection = model.document.selection;
|
|
44
|
+
const changedBlocks = [];
|
|
45
|
+
model.change(writer => {
|
|
46
|
+
const { firstElement, lastElement } = this._getMergeSubjectElements(selection, shouldMergeOnBlocksContentLevel);
|
|
47
|
+
const firstIndent = firstElement.getAttribute('listIndent') || 0;
|
|
48
|
+
const lastIndent = lastElement.getAttribute('listIndent');
|
|
49
|
+
const lastElementId = lastElement.getAttribute('listItemId');
|
|
50
|
+
if (firstIndent != lastIndent) {
|
|
51
|
+
const nestedLastElementBlocks = getNestedListBlocks(lastElement);
|
|
52
|
+
changedBlocks.push(...indentBlocks([lastElement, ...nestedLastElementBlocks], writer, {
|
|
53
|
+
indentBy: firstIndent - lastIndent,
|
|
54
|
+
// If outdenting, the entire sub-tree that follows must be included.
|
|
55
|
+
expand: firstIndent < lastIndent
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
if (shouldMergeOnBlocksContentLevel) {
|
|
59
|
+
let sel = selection;
|
|
60
|
+
if (selection.isCollapsed) {
|
|
61
|
+
sel = writer.createSelection(writer.createRange(writer.createPositionAt(firstElement, 'end'), writer.createPositionAt(lastElement, 0)));
|
|
62
|
+
}
|
|
63
|
+
// Delete selected content. Replace entire content only for non-collapsed selection.
|
|
64
|
+
model.deleteContent(sel, { doNotResetEntireContent: selection.isCollapsed });
|
|
65
|
+
// Get the last "touched" element after deleteContent call (can't use the lastElement because
|
|
66
|
+
// it could get merged into the firstElement while deleting content).
|
|
67
|
+
const lastElementAfterDelete = sel.getLastPosition().parent;
|
|
68
|
+
// Check if the element after it was in the same list item and adjust it if needed.
|
|
69
|
+
const nextSibling = lastElementAfterDelete.nextSibling;
|
|
70
|
+
changedBlocks.push(lastElementAfterDelete);
|
|
71
|
+
if (nextSibling && nextSibling !== lastElement && nextSibling.getAttribute('listItemId') == lastElementId) {
|
|
72
|
+
changedBlocks.push(...mergeListItemBefore(nextSibling, lastElementAfterDelete, writer));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
changedBlocks.push(...mergeListItemBefore(lastElement, firstElement, writer));
|
|
77
|
+
}
|
|
78
|
+
this._fireAfterExecute(changedBlocks);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Fires the `afterExecute` event.
|
|
83
|
+
*
|
|
84
|
+
* @param changedBlocks The changed list elements.
|
|
85
|
+
*/
|
|
86
|
+
_fireAfterExecute(changedBlocks) {
|
|
87
|
+
this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Checks whether the command can be enabled in the current context.
|
|
91
|
+
*
|
|
92
|
+
* @returns Whether the command should be enabled.
|
|
93
|
+
*/
|
|
94
|
+
_checkEnabled() {
|
|
95
|
+
const model = this.editor.model;
|
|
96
|
+
const selection = model.document.selection;
|
|
97
|
+
const selectedBlockObject = getSelectedBlockObject(model);
|
|
98
|
+
if (selection.isCollapsed || selectedBlockObject) {
|
|
99
|
+
const positionParent = selectedBlockObject || selection.getFirstPosition().parent;
|
|
100
|
+
if (!isListItemBlock(positionParent)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const siblingNode = this._direction == 'backward' ?
|
|
104
|
+
positionParent.previousSibling :
|
|
105
|
+
positionParent.nextSibling;
|
|
106
|
+
if (!siblingNode) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (isSingleListItem([positionParent, siblingNode])) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const lastPosition = selection.getLastPosition();
|
|
115
|
+
const firstPosition = selection.getFirstPosition();
|
|
116
|
+
// If deleting within a single block of a list item, there's no need to merge anything.
|
|
117
|
+
// The default delete should be executed instead.
|
|
118
|
+
if (lastPosition.parent === firstPosition.parent) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (!isListItemBlock(lastPosition.parent)) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns the boundary elements the merge should be executed for. These are not necessarily selection's first
|
|
129
|
+
* and last position parents but sometimes sibling or even further blocks depending on the context.
|
|
130
|
+
*
|
|
131
|
+
* @param selection The selection the merge is executed for.
|
|
132
|
+
* @param shouldMergeOnBlocksContentLevel When `true`, merge is performed together with
|
|
133
|
+
* {@link module:engine/model/model~Model#deleteContent} to remove the inline content within the selection.
|
|
134
|
+
*/
|
|
135
|
+
_getMergeSubjectElements(selection, shouldMergeOnBlocksContentLevel) {
|
|
136
|
+
const model = this.editor.model;
|
|
137
|
+
const selectedBlockObject = getSelectedBlockObject(model);
|
|
138
|
+
let firstElement, lastElement;
|
|
139
|
+
if (selection.isCollapsed || selectedBlockObject) {
|
|
140
|
+
const positionParent = selectedBlockObject || selection.getFirstPosition().parent;
|
|
141
|
+
const isFirstBlock = isFirstBlockOfListItem(positionParent);
|
|
142
|
+
if (this._direction == 'backward') {
|
|
143
|
+
lastElement = positionParent;
|
|
144
|
+
if (isFirstBlock && !shouldMergeOnBlocksContentLevel) {
|
|
145
|
+
// For the "c" as an anchorElement:
|
|
146
|
+
// * a
|
|
147
|
+
// * b
|
|
148
|
+
// * [c] <-- this block should be merged with "a"
|
|
149
|
+
// It should find "a" element to merge with:
|
|
150
|
+
// * a
|
|
151
|
+
// * b
|
|
152
|
+
// c
|
|
153
|
+
firstElement = ListWalker.first(positionParent, { sameIndent: true, lowerIndent: true });
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
firstElement = positionParent.previousSibling;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// In case of the forward merge there is no case as above, just merge with next sibling.
|
|
161
|
+
firstElement = positionParent;
|
|
162
|
+
lastElement = positionParent.nextSibling;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
firstElement = selection.getFirstPosition().parent;
|
|
167
|
+
lastElement = selection.getLastPosition().parent;
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
firstElement: firstElement,
|
|
171
|
+
lastElement: lastElement
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
* @module list/list/listsplitcommand
|
|
7
|
+
*/
|
|
8
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
/**
|
|
11
|
+
* The document list split command that splits the list item at the selection.
|
|
12
|
+
*
|
|
13
|
+
* It is used by the {@link module:list/list~List list feature}.
|
|
14
|
+
*/
|
|
15
|
+
export default class ListSplitCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Whether list item should be split before or after the selected block.
|
|
18
|
+
*/
|
|
19
|
+
private readonly _direction;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the command.
|
|
22
|
+
*
|
|
23
|
+
* @param editor The editor instance.
|
|
24
|
+
* @param direction Whether list item should be split before or after the selected block.
|
|
25
|
+
*/
|
|
26
|
+
constructor(editor: Editor, direction: 'before' | 'after');
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
refresh(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Splits the list item at the selection.
|
|
33
|
+
*
|
|
34
|
+
* @fires execute
|
|
35
|
+
* @fires afterExecute
|
|
36
|
+
*/
|
|
37
|
+
execute(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Fires the `afterExecute` event.
|
|
40
|
+
*
|
|
41
|
+
* @param changedBlocks The changed list elements.
|
|
42
|
+
*/
|
|
43
|
+
private _fireAfterExecute;
|
|
44
|
+
/**
|
|
45
|
+
* Checks whether the command can be enabled in the current context.
|
|
46
|
+
*
|
|
47
|
+
* @returns Whether the command should be enabled.
|
|
48
|
+
*/
|
|
49
|
+
private _checkEnabled;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the model element that is the main focus of the command (according to the current selection and command direction).
|
|
52
|
+
*/
|
|
53
|
+
private _getStartBlock;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Event fired by the {@link ~ListSplitCommand#execute} method.
|
|
57
|
+
*
|
|
58
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
59
|
+
* method, for example adjusting attributes of changed list items.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
* @eventName ~ListSplitCommand#afterExecute
|
|
63
|
+
*/
|
|
64
|
+
export type ListSplitCommandAfterExecuteEvent = {
|
|
65
|
+
name: 'afterExecute';
|
|
66
|
+
args: [changedBlocks: Array<Element>];
|
|
67
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
6
|
+
import { isFirstBlockOfListItem, isListItemBlock, sortBlocks, splitListItemBefore } from './utils/model.js';
|
|
7
|
+
/**
|
|
8
|
+
* The document list split command that splits the list item at the selection.
|
|
9
|
+
*
|
|
10
|
+
* It is used by the {@link module:list/list~List list feature}.
|
|
11
|
+
*/
|
|
12
|
+
export default class ListSplitCommand extends Command {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of the command.
|
|
15
|
+
*
|
|
16
|
+
* @param editor The editor instance.
|
|
17
|
+
* @param direction Whether list item should be split before or after the selected block.
|
|
18
|
+
*/
|
|
19
|
+
constructor(editor, direction) {
|
|
20
|
+
super(editor);
|
|
21
|
+
this._direction = direction;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
refresh() {
|
|
27
|
+
this.isEnabled = this._checkEnabled();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Splits the list item at the selection.
|
|
31
|
+
*
|
|
32
|
+
* @fires execute
|
|
33
|
+
* @fires afterExecute
|
|
34
|
+
*/
|
|
35
|
+
execute() {
|
|
36
|
+
const editor = this.editor;
|
|
37
|
+
editor.model.change(writer => {
|
|
38
|
+
const changedBlocks = splitListItemBefore(this._getStartBlock(), writer);
|
|
39
|
+
this._fireAfterExecute(changedBlocks);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Fires the `afterExecute` event.
|
|
44
|
+
*
|
|
45
|
+
* @param changedBlocks The changed list elements.
|
|
46
|
+
*/
|
|
47
|
+
_fireAfterExecute(changedBlocks) {
|
|
48
|
+
this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Checks whether the command can be enabled in the current context.
|
|
52
|
+
*
|
|
53
|
+
* @returns Whether the command should be enabled.
|
|
54
|
+
*/
|
|
55
|
+
_checkEnabled() {
|
|
56
|
+
const selection = this.editor.model.document.selection;
|
|
57
|
+
const block = this._getStartBlock();
|
|
58
|
+
return selection.isCollapsed &&
|
|
59
|
+
isListItemBlock(block) &&
|
|
60
|
+
!isFirstBlockOfListItem(block);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns the model element that is the main focus of the command (according to the current selection and command direction).
|
|
64
|
+
*/
|
|
65
|
+
_getStartBlock() {
|
|
66
|
+
const doc = this.editor.model.document;
|
|
67
|
+
const positionParent = doc.selection.getFirstPosition().parent;
|
|
68
|
+
return (this._direction == 'before' ? positionParent : positionParent.nextSibling);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
/**
|
|
7
|
+
* The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
|
|
8
|
+
* allow to convert paragraphs to and from list items and indent or outdent them.
|
|
9
|
+
*/
|
|
10
|
+
export default class ListUI extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
static get pluginName(): "ListUI";
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get isOfficialPlugin(): true;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
init(): void;
|
|
23
|
+
}
|
|
@@ -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
|
+
* @module list/list/listui
|
|
7
|
+
*/
|
|
8
|
+
import { createUIComponents } from './utils.js';
|
|
9
|
+
import { icons, Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
/**
|
|
11
|
+
* The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
|
|
12
|
+
* allow to convert paragraphs to and from list items and indent or outdent them.
|
|
13
|
+
*/
|
|
14
|
+
export default class ListUI extends Plugin {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get pluginName() {
|
|
19
|
+
return 'ListUI';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get isOfficialPlugin() {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
init() {
|
|
31
|
+
const t = this.editor.t;
|
|
32
|
+
// Create button numberedList.
|
|
33
|
+
if (!this.editor.ui.componentFactory.has('numberedList')) {
|
|
34
|
+
createUIComponents(this.editor, 'numberedList', t('Numbered List'), icons.numberedList);
|
|
35
|
+
}
|
|
36
|
+
// Create button bulletedList.
|
|
37
|
+
if (!this.editor.ui.componentFactory.has('bulletedList')) {
|
|
38
|
+
createUIComponents(this.editor, 'bulletedList', t('Bulleted List'), icons.bulletedList);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|