@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,38 @@
|
|
|
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/legacylistproperties/legacylistreversedcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
|
|
11
|
+
* reversed.
|
|
12
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
13
|
+
*/
|
|
14
|
+
export default class LegacyListReversedCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
value: boolean | null;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
refresh(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Executes the command.
|
|
25
|
+
*
|
|
26
|
+
* @fires execute
|
|
27
|
+
* @param options.reversed Whether the list should be reversed.
|
|
28
|
+
*/
|
|
29
|
+
execute(options?: {
|
|
30
|
+
reversed?: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
/**
|
|
33
|
+
* Checks the command's {@link #value}.
|
|
34
|
+
*
|
|
35
|
+
* @returns The current value.
|
|
36
|
+
*/
|
|
37
|
+
private _getValue;
|
|
38
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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/legacylistproperties/legacylistreversedcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { getSelectedListItems } from '../legacylist/legacyutils.js';
|
|
10
|
+
/**
|
|
11
|
+
* The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
|
|
12
|
+
* reversed.
|
|
13
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
14
|
+
*/
|
|
15
|
+
export default class LegacyListReversedCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
refresh() {
|
|
20
|
+
const value = this._getValue();
|
|
21
|
+
this.value = value;
|
|
22
|
+
this.isEnabled = value != null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Executes the command.
|
|
26
|
+
*
|
|
27
|
+
* @fires execute
|
|
28
|
+
* @param options.reversed Whether the list should be reversed.
|
|
29
|
+
*/
|
|
30
|
+
execute(options = {}) {
|
|
31
|
+
const model = this.editor.model;
|
|
32
|
+
const listItems = getSelectedListItems(model)
|
|
33
|
+
.filter(item => item.getAttribute('listType') == 'numbered');
|
|
34
|
+
model.change(writer => {
|
|
35
|
+
for (const item of listItems) {
|
|
36
|
+
writer.setAttribute('listReversed', !!options.reversed, item);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Checks the command's {@link #value}.
|
|
42
|
+
*
|
|
43
|
+
* @returns The current value.
|
|
44
|
+
*/
|
|
45
|
+
_getValue() {
|
|
46
|
+
const listItem = this.editor.model.document.selection.getFirstPosition().parent;
|
|
47
|
+
if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
|
|
48
|
+
return listItem.getAttribute('listReversed');
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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/legacylistproperties/legacyliststartcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
11
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
12
|
+
*/
|
|
13
|
+
export default class LegacyListStartCommand extends Command {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
value: number | null;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
refresh(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Executes the command.
|
|
24
|
+
*
|
|
25
|
+
* @fires execute
|
|
26
|
+
* @param options.startIndex The list start index.
|
|
27
|
+
*/
|
|
28
|
+
execute({ startIndex }?: {
|
|
29
|
+
startIndex?: number;
|
|
30
|
+
}): void;
|
|
31
|
+
/**
|
|
32
|
+
* Checks the command's {@link #value}.
|
|
33
|
+
*
|
|
34
|
+
* @returns The current value.
|
|
35
|
+
*/
|
|
36
|
+
private _getValue;
|
|
37
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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/legacylistproperties/legacyliststartcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { getSelectedListItems } from '../legacylist/legacyutils.js';
|
|
10
|
+
/**
|
|
11
|
+
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
12
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
13
|
+
*/
|
|
14
|
+
export default class LegacyListStartCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
refresh() {
|
|
19
|
+
const value = this._getValue();
|
|
20
|
+
this.value = value;
|
|
21
|
+
this.isEnabled = value != null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Executes the command.
|
|
25
|
+
*
|
|
26
|
+
* @fires execute
|
|
27
|
+
* @param options.startIndex The list start index.
|
|
28
|
+
*/
|
|
29
|
+
execute({ startIndex = 1 } = {}) {
|
|
30
|
+
const model = this.editor.model;
|
|
31
|
+
const listItems = getSelectedListItems(model)
|
|
32
|
+
.filter(item => item.getAttribute('listType') == 'numbered');
|
|
33
|
+
model.change(writer => {
|
|
34
|
+
for (const item of listItems) {
|
|
35
|
+
writer.setAttribute('listStart', startIndex >= 0 ? startIndex : 1, item);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Checks the command's {@link #value}.
|
|
41
|
+
*
|
|
42
|
+
* @returns The current value.
|
|
43
|
+
*/
|
|
44
|
+
_getValue() {
|
|
45
|
+
const listItem = this.editor.model.document.selection.getFirstPosition().parent;
|
|
46
|
+
if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
|
|
47
|
+
return listItem.getAttribute('listStart');
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -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/legacylistproperties/legacyliststylecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The list style command. It changes the `listStyle` attribute of the selected list items.
|
|
11
|
+
*
|
|
12
|
+
* If the list type (numbered or bulleted) can be inferred from the passed style type,
|
|
13
|
+
* the command tries to convert selected items to a list of that type.
|
|
14
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
15
|
+
*/
|
|
16
|
+
export default class LegacyListStyleCommand extends Command {
|
|
17
|
+
isStyleTypeSupported: undefined;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
value: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The default type of the list style.
|
|
25
|
+
*/
|
|
26
|
+
readonly defaultType: string;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of the command.
|
|
29
|
+
*
|
|
30
|
+
* @param editor The editor instance.
|
|
31
|
+
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
32
|
+
* the command execution.
|
|
33
|
+
*/
|
|
34
|
+
constructor(editor: Editor, defaultType: string);
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
refresh(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Executes the command.
|
|
41
|
+
*
|
|
42
|
+
* @fires execute
|
|
43
|
+
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
44
|
+
* style will be applied.
|
|
45
|
+
*/
|
|
46
|
+
execute(options?: {
|
|
47
|
+
type?: string | null;
|
|
48
|
+
}): void;
|
|
49
|
+
/**
|
|
50
|
+
* Checks the command's {@link #value}.
|
|
51
|
+
*
|
|
52
|
+
* @returns The current value.
|
|
53
|
+
*/
|
|
54
|
+
private _getValue;
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the command can be enabled in the current context.
|
|
57
|
+
*
|
|
58
|
+
* @returns Whether the command should be enabled.
|
|
59
|
+
*/
|
|
60
|
+
private _checkEnabled;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
|
|
63
|
+
*
|
|
64
|
+
* @param The type of the list style. If `null` is specified, the function does nothing.
|
|
65
|
+
*/
|
|
66
|
+
private _tryToConvertItemsToList;
|
|
67
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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/legacylistproperties/legacyliststylecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { getListTypeFromListStyleType, getSelectedListItems } from '../legacylist/legacyutils.js';
|
|
10
|
+
/**
|
|
11
|
+
* The list style command. It changes the `listStyle` attribute of the selected list items.
|
|
12
|
+
*
|
|
13
|
+
* If the list type (numbered or bulleted) can be inferred from the passed style type,
|
|
14
|
+
* the command tries to convert selected items to a list of that type.
|
|
15
|
+
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class LegacyListStyleCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the command.
|
|
20
|
+
*
|
|
21
|
+
* @param editor The editor instance.
|
|
22
|
+
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
23
|
+
* the command execution.
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor, defaultType) {
|
|
26
|
+
super(editor);
|
|
27
|
+
this.defaultType = defaultType;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
refresh() {
|
|
33
|
+
this.value = this._getValue();
|
|
34
|
+
this.isEnabled = this._checkEnabled();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Executes the command.
|
|
38
|
+
*
|
|
39
|
+
* @fires execute
|
|
40
|
+
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
41
|
+
* style will be applied.
|
|
42
|
+
*/
|
|
43
|
+
execute(options = {}) {
|
|
44
|
+
this._tryToConvertItemsToList(options);
|
|
45
|
+
const model = this.editor.model;
|
|
46
|
+
const listItems = getSelectedListItems(model);
|
|
47
|
+
if (!listItems.length) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
model.change(writer => {
|
|
51
|
+
for (const item of listItems) {
|
|
52
|
+
writer.setAttribute('listStyle', options.type || this.defaultType, item);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Checks the command's {@link #value}.
|
|
58
|
+
*
|
|
59
|
+
* @returns The current value.
|
|
60
|
+
*/
|
|
61
|
+
_getValue() {
|
|
62
|
+
const listItem = this.editor.model.document.selection.getFirstPosition().parent;
|
|
63
|
+
if (listItem && listItem.is('element', 'listItem')) {
|
|
64
|
+
return listItem.getAttribute('listStyle');
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Checks whether the command can be enabled in the current context.
|
|
70
|
+
*
|
|
71
|
+
* @returns Whether the command should be enabled.
|
|
72
|
+
*/
|
|
73
|
+
_checkEnabled() {
|
|
74
|
+
const editor = this.editor;
|
|
75
|
+
const numberedList = editor.commands.get('numberedList');
|
|
76
|
+
const bulletedList = editor.commands.get('bulletedList');
|
|
77
|
+
return numberedList.isEnabled || bulletedList.isEnabled;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
|
|
81
|
+
*
|
|
82
|
+
* @param The type of the list style. If `null` is specified, the function does nothing.
|
|
83
|
+
*/
|
|
84
|
+
_tryToConvertItemsToList(options) {
|
|
85
|
+
if (!options.type) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const listType = getListTypeFromListStyleType(options.type);
|
|
89
|
+
/* istanbul ignore next -- @preserve */
|
|
90
|
+
if (!listType) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const editor = this.editor;
|
|
94
|
+
const commandName = `${listType}List`;
|
|
95
|
+
const command = editor.commands.get(commandName);
|
|
96
|
+
if (!command.value) {
|
|
97
|
+
editor.execute(commandName);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -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
|
+
* @module list/legacylistproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
+
import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The legacy list properties feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the {@link module:list/legacylistproperties/legacylistpropertiesediting~LegacyListPropertiesEditing
|
|
15
|
+
* legacy list properties editing feature} and the
|
|
16
|
+
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class LegacyListProperties extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): readonly [typeof LegacyListPropertiesEditing, typeof ListPropertiesUI];
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "LegacyListProperties";
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get isOfficialPlugin(): true;
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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/legacylistproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
+
import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The legacy list properties feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the {@link module:list/legacylistproperties/legacylistpropertiesediting~LegacyListPropertiesEditing
|
|
15
|
+
* legacy list properties editing feature} and the
|
|
16
|
+
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class LegacyListProperties extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires() {
|
|
23
|
+
return [LegacyListPropertiesEditing, ListPropertiesUI];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName() {
|
|
29
|
+
return 'LegacyListProperties';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get isOfficialPlugin() {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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/legacytodolist/legacychecktodolistcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
10
|
+
/**
|
|
11
|
+
* The check to-do command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
14
|
+
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
15
|
+
*/
|
|
16
|
+
export default class LegacyCheckTodoListCommand extends Command {
|
|
17
|
+
/**
|
|
18
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
19
|
+
*
|
|
20
|
+
* @observable
|
|
21
|
+
* @readonly
|
|
22
|
+
*/
|
|
23
|
+
value: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
_selectedElements: Array<Element>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
constructor(editor: Editor);
|
|
34
|
+
/**
|
|
35
|
+
* Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
|
|
36
|
+
*/
|
|
37
|
+
refresh(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
40
|
+
*/
|
|
41
|
+
private _getSelectedItems;
|
|
42
|
+
/**
|
|
43
|
+
* Executes the command.
|
|
44
|
+
*
|
|
45
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
|
|
46
|
+
* the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
|
|
47
|
+
* value to decide what it should do.
|
|
48
|
+
*/
|
|
49
|
+
execute(options?: {
|
|
50
|
+
forceValue?: boolean;
|
|
51
|
+
}): void;
|
|
52
|
+
}
|
|
@@ -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/legacytodolist/legacychecktodolistcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
const attributeKey = 'todoListChecked';
|
|
10
|
+
/**
|
|
11
|
+
* The check to-do command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
14
|
+
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
15
|
+
*/
|
|
16
|
+
export default class LegacyCheckTodoListCommand extends Command {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
constructor(editor) {
|
|
21
|
+
super(editor);
|
|
22
|
+
this._selectedElements = [];
|
|
23
|
+
// Refresh command before executing to be sure all values are up to date.
|
|
24
|
+
// It is needed when selection has changed before command execution, in the same change block.
|
|
25
|
+
this.on('execute', () => {
|
|
26
|
+
this.refresh();
|
|
27
|
+
}, { priority: 'highest' });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
|
|
31
|
+
*/
|
|
32
|
+
refresh() {
|
|
33
|
+
this._selectedElements = this._getSelectedItems();
|
|
34
|
+
this.value = this._selectedElements.every(element => !!element.getAttribute(attributeKey));
|
|
35
|
+
this.isEnabled = !!this._selectedElements.length;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.
|
|
39
|
+
*/
|
|
40
|
+
_getSelectedItems() {
|
|
41
|
+
const model = this.editor.model;
|
|
42
|
+
const schema = model.schema;
|
|
43
|
+
const selectionRange = model.document.selection.getFirstRange();
|
|
44
|
+
const startElement = selectionRange.start.parent;
|
|
45
|
+
const elements = [];
|
|
46
|
+
if (schema.checkAttribute(startElement, attributeKey)) {
|
|
47
|
+
elements.push(startElement);
|
|
48
|
+
}
|
|
49
|
+
for (const item of selectionRange.getItems()) {
|
|
50
|
+
if (schema.checkAttribute(item, attributeKey) && !elements.includes(item)) {
|
|
51
|
+
elements.push(item);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return elements;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Executes the command.
|
|
58
|
+
*
|
|
59
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
|
|
60
|
+
* the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
|
|
61
|
+
* value to decide what it should do.
|
|
62
|
+
*/
|
|
63
|
+
execute(options = {}) {
|
|
64
|
+
this.editor.model.change(writer => {
|
|
65
|
+
for (const element of this._selectedElements) {
|
|
66
|
+
const value = (options.forceValue === undefined) ? !this.value : options.forceValue;
|
|
67
|
+
if (value) {
|
|
68
|
+
writer.setAttribute(attributeKey, true, element);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
writer.removeAttribute(attributeKey, element);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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/legacytodolist/legacytodolistconverters
|
|
7
|
+
*/
|
|
8
|
+
import type { DowncastAttributeEvent, DowncastInsertEvent, Element, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import { type GetCallback } from 'ckeditor5/src/utils.js';
|
|
10
|
+
/**
|
|
11
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
12
|
+
*
|
|
13
|
+
* It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~UIElement checkbox element}
|
|
14
|
+
* at the beginning of each list item. It also merges the list with surrounding lists (if available).
|
|
15
|
+
*
|
|
16
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
17
|
+
*
|
|
18
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
19
|
+
* @param model Model instance.
|
|
20
|
+
* @param onCheckboxChecked Callback function.
|
|
21
|
+
* @returns Returns a conversion callback.
|
|
22
|
+
*/
|
|
23
|
+
export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element: Element) => void): GetCallback<DowncastInsertEvent<Element>>;
|
|
24
|
+
/**
|
|
25
|
+
* A model-to-view converter for the `listItem` model element insertion.
|
|
26
|
+
*
|
|
27
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
28
|
+
*
|
|
29
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
30
|
+
* @param model Model instance.
|
|
31
|
+
* @returns Returns a conversion callback.
|
|
32
|
+
*/
|
|
33
|
+
export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<Element>>;
|
|
34
|
+
/**
|
|
35
|
+
* A view-to-model converter for the checkbox element inside a view list item.
|
|
36
|
+
*
|
|
37
|
+
* It changes the `listType` of the model `listItem` to a `todo` value.
|
|
38
|
+
* When a view checkbox element is marked as checked, an additional `todoListChecked="true"` attribute is added to the model item.
|
|
39
|
+
*
|
|
40
|
+
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
41
|
+
*
|
|
42
|
+
* @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
|
|
43
|
+
*/
|
|
44
|
+
export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementEvent>;
|
|
45
|
+
/**
|
|
46
|
+
* A model-to-view converter for the `listType` attribute change on the `listItem` model element.
|
|
47
|
+
*
|
|
48
|
+
* This change means that the `<li>` element parent changes to `<ul class="todo-list">` and a
|
|
49
|
+
* {@link module:engine/view/uielement~UIElement checkbox UI element} is added at the beginning
|
|
50
|
+
* of the list item element (or vice versa).
|
|
51
|
+
*
|
|
52
|
+
* This converter is preceded by {@link module:list/legacylist/legacyconverters~modelViewChangeType} and followed by
|
|
53
|
+
* {@link module:list/legacylist/legacyconverters~modelViewMergeAfterChangeType} to handle splitting and merging surrounding lists
|
|
54
|
+
* of the same type.
|
|
55
|
+
*
|
|
56
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
57
|
+
*
|
|
58
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
59
|
+
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
60
|
+
* @param view Editing view controller.
|
|
61
|
+
* @returns Returns a conversion callback.
|
|
62
|
+
*/
|
|
63
|
+
export declare function modelViewChangeType(onCheckedChange: (element: Element) => void, view: EditingView): GetCallback<DowncastAttributeEvent<Element>>;
|
|
64
|
+
/**
|
|
65
|
+
* A model-to-view converter for the `todoListChecked` attribute change on the `listItem` model element.
|
|
66
|
+
*
|
|
67
|
+
* It marks the {@link module:engine/view/uielement~UIElement checkbox UI element} as checked.
|
|
68
|
+
*
|
|
69
|
+
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
70
|
+
*
|
|
71
|
+
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
72
|
+
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
73
|
+
* @returns Returns a conversion callback.
|
|
74
|
+
*/
|
|
75
|
+
export declare function modelViewChangeChecked(onCheckedChange: (element: Element) => void): GetCallback<DowncastAttributeEvent<Element>>;
|
|
76
|
+
/**
|
|
77
|
+
* A model-to-view position at zero offset mapper.
|
|
78
|
+
*
|
|
79
|
+
* This helper ensures that position inside todo-list in the view is mapped after the checkbox.
|
|
80
|
+
*
|
|
81
|
+
* It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.
|
|
82
|
+
*/
|
|
83
|
+
export declare function mapModelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
|