@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,82 @@
|
|
|
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/utils/view
|
|
7
|
+
*/
|
|
8
|
+
import type { DowncastWriter, ViewAttributeElement, ViewDocumentFragment, ViewElement, ViewNode } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import { type ListType } from '../listediting.js';
|
|
10
|
+
/**
|
|
11
|
+
* Checks if view element is a list type (ul or ol).
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function isListView(viewElement: ViewNode | ViewDocumentFragment): viewElement is ViewElement & {
|
|
16
|
+
name: 'ul' | 'ol';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Checks if view element is a list item (li).
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function isListItemView(viewElement: ViewNode | ViewDocumentFragment): viewElement is ViewElement & {
|
|
24
|
+
name: 'li';
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
|
|
28
|
+
*
|
|
29
|
+
* Also, fixes non HTML compliant lists indents:
|
|
30
|
+
*
|
|
31
|
+
* ```
|
|
32
|
+
* before: fixed list:
|
|
33
|
+
* OL OL
|
|
34
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
35
|
+
* |-> OL |-> OL
|
|
36
|
+
* |-> OL |
|
|
37
|
+
* | |-> OL |
|
|
38
|
+
* | |-> OL |
|
|
39
|
+
* | |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
40
|
+
* |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
41
|
+
*
|
|
42
|
+
* before: fixed list:
|
|
43
|
+
* OL OL
|
|
44
|
+
* |-> OL |
|
|
45
|
+
* |-> OL |
|
|
46
|
+
* |-> OL |
|
|
47
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
48
|
+
*
|
|
49
|
+
* before: fixed list:
|
|
50
|
+
* OL OL
|
|
51
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
52
|
+
* |-> OL |-> OL
|
|
53
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 1)
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export declare function getIndent(listItem: ViewElement): number;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a list attribute element (ol or ul).
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export declare function createListElement(writer: DowncastWriter, indent: number, type: ListType, id?: string): ViewAttributeElement;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a list item attribute element (li).
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare function createListItemElement(writer: DowncastWriter, indent: number, id: string): ViewAttributeElement;
|
|
71
|
+
/**
|
|
72
|
+
* Returns a view element name for the given list type.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export declare function getViewElementNameForListType(type?: ListType): 'ol' | 'ul';
|
|
77
|
+
/**
|
|
78
|
+
* Returns a view element ID for the given list type and indent.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function getViewElementIdForListType(type?: ListType, indent?: number): string;
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
* Checks if view element is a list type (ul or ol).
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function isListView(viewElement) {
|
|
11
|
+
return viewElement.is('element', 'ol') || viewElement.is('element', 'ul');
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Checks if view element is a list item (li).
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export function isListItemView(viewElement) {
|
|
19
|
+
return viewElement.is('element', 'li');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
|
|
23
|
+
*
|
|
24
|
+
* Also, fixes non HTML compliant lists indents:
|
|
25
|
+
*
|
|
26
|
+
* ```
|
|
27
|
+
* before: fixed list:
|
|
28
|
+
* OL OL
|
|
29
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
30
|
+
* |-> OL |-> OL
|
|
31
|
+
* |-> OL |
|
|
32
|
+
* | |-> OL |
|
|
33
|
+
* | |-> OL |
|
|
34
|
+
* | |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
35
|
+
* |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
36
|
+
*
|
|
37
|
+
* before: fixed list:
|
|
38
|
+
* OL OL
|
|
39
|
+
* |-> OL |
|
|
40
|
+
* |-> OL |
|
|
41
|
+
* |-> OL |
|
|
42
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
43
|
+
*
|
|
44
|
+
* before: fixed list:
|
|
45
|
+
* OL OL
|
|
46
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
47
|
+
* |-> OL |-> OL
|
|
48
|
+
* |-> LI (parent LIs: 0) |-> LI (indent: 1)
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function getIndent(listItem) {
|
|
54
|
+
let indent = 0;
|
|
55
|
+
let parent = listItem.parent;
|
|
56
|
+
while (parent) {
|
|
57
|
+
// Each LI in the tree will result in an increased indent for HTML compliant lists.
|
|
58
|
+
if (isListItemView(parent)) {
|
|
59
|
+
indent++;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// If however the list is nested in other list we should check previous sibling of any of the list elements...
|
|
63
|
+
const previousSibling = parent.previousSibling;
|
|
64
|
+
// ...because the we might need increase its indent:
|
|
65
|
+
// before: fixed list:
|
|
66
|
+
// OL OL
|
|
67
|
+
// |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
68
|
+
// |-> OL |-> OL
|
|
69
|
+
// |-> LI (parent LIs: 0) |-> LI (indent: 1)
|
|
70
|
+
if (previousSibling && isListItemView(previousSibling)) {
|
|
71
|
+
indent++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
parent = parent.parent;
|
|
75
|
+
}
|
|
76
|
+
return indent;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Creates a list attribute element (ol or ul).
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export function createListElement(writer, indent, type, id = getViewElementIdForListType(type, indent)) {
|
|
84
|
+
// Negative priorities so that restricted editing attribute won't wrap lists.
|
|
85
|
+
return writer.createAttributeElement(getViewElementNameForListType(type), null, {
|
|
86
|
+
priority: 2 * indent / 100 - 100,
|
|
87
|
+
id
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a list item attribute element (li).
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export function createListItemElement(writer, indent, id) {
|
|
96
|
+
// Negative priorities so that restricted editing attribute won't wrap list items.
|
|
97
|
+
return writer.createAttributeElement('li', null, {
|
|
98
|
+
priority: (2 * indent + 1) / 100 - 100,
|
|
99
|
+
id
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns a view element name for the given list type.
|
|
104
|
+
*
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export function getViewElementNameForListType(type) {
|
|
108
|
+
return type == 'numbered' || type == 'customNumbered' ? 'ol' : 'ul';
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns a view element ID for the given list type and indent.
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
export function getViewElementIdForListType(type, indent) {
|
|
116
|
+
return `list-${type}-${indent}`;
|
|
117
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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/utils
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* Helper method for creating toolbar and menu buttons and linking them with an appropriate command.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
* @param editor The editor instance to which the UI component will be added.
|
|
14
|
+
* @param commandName The name of the command.
|
|
15
|
+
* @param label The button label.
|
|
16
|
+
* @param icon The source of the icon.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createUIComponents(editor: Editor, commandName: 'bulletedList' | 'numberedList' | 'todoList', label: string, icon: string): void;
|
|
@@ -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
|
+
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
6
|
+
/**
|
|
7
|
+
* Helper method for creating toolbar and menu buttons and linking them with an appropriate command.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
* @param editor The editor instance to which the UI component will be added.
|
|
11
|
+
* @param commandName The name of the command.
|
|
12
|
+
* @param label The button label.
|
|
13
|
+
* @param icon The source of the icon.
|
|
14
|
+
*/
|
|
15
|
+
export function createUIComponents(editor, commandName, label, icon) {
|
|
16
|
+
editor.ui.componentFactory.add(commandName, () => {
|
|
17
|
+
const buttonView = _createButton(ButtonView, editor, commandName, label, icon);
|
|
18
|
+
buttonView.set({
|
|
19
|
+
tooltip: true,
|
|
20
|
+
isToggleable: true
|
|
21
|
+
});
|
|
22
|
+
return buttonView;
|
|
23
|
+
});
|
|
24
|
+
editor.ui.componentFactory.add(`menuBar:${commandName}`, () => {
|
|
25
|
+
const buttonView = _createButton(MenuBarMenuListItemButtonView, editor, commandName, label, icon);
|
|
26
|
+
buttonView.set({
|
|
27
|
+
role: 'menuitemcheckbox',
|
|
28
|
+
isToggleable: true
|
|
29
|
+
});
|
|
30
|
+
return buttonView;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a button to use either in toolbar or in menu bar.
|
|
35
|
+
*/
|
|
36
|
+
function _createButton(ButtonClass, editor, commandName, label, icon) {
|
|
37
|
+
const command = editor.commands.get(commandName);
|
|
38
|
+
const view = new ButtonClass(editor.locale);
|
|
39
|
+
view.set({
|
|
40
|
+
label,
|
|
41
|
+
icon
|
|
42
|
+
});
|
|
43
|
+
// Bind button model to command.
|
|
44
|
+
view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
|
|
45
|
+
// Execute the command.
|
|
46
|
+
view.on('execute', () => {
|
|
47
|
+
editor.execute(commandName);
|
|
48
|
+
editor.editing.view.focus();
|
|
49
|
+
});
|
|
50
|
+
return view;
|
|
51
|
+
}
|
package/src/list.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module list/list
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ListEditing from './list/listediting.js';
|
|
10
|
+
import ListUI from './list/listui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The list feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the {@link module:list/list/listediting~ListEditing list
|
|
15
|
+
* editing feature} and {@link module:list/list/listui~ListUI list UI feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class List extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof ListEditing, typeof ListUI];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "List";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get isOfficialPlugin(): true;
|
|
30
|
+
}
|
package/src/list.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module list/list
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ListEditing from './list/listediting.js';
|
|
10
|
+
import ListUI from './list/listui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The list feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the {@link module:list/list/listediting~ListEditing list
|
|
15
|
+
* editing feature} and {@link module:list/list/listui~ListUI list UI feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class List extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires() {
|
|
22
|
+
return [ListEditing, ListUI];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get pluginName() {
|
|
28
|
+
return 'List';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get isOfficialPlugin() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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/listconfig
|
|
7
|
+
*/
|
|
8
|
+
import { type ArrayOrItem } from 'ckeditor5/src/utils.js';
|
|
9
|
+
/**
|
|
10
|
+
* The configuration of the {@link module:list/list~List list} feature
|
|
11
|
+
* and the {@link module:list/legacylist~LegacyList legacy list} feature.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* ClassicEditor
|
|
15
|
+
* .create( editorElement, {
|
|
16
|
+
* list: ... // The list feature configuration.
|
|
17
|
+
* } )
|
|
18
|
+
* .then( ... )
|
|
19
|
+
* .catch( ... );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
23
|
+
*
|
|
24
|
+
* @interface ListConfig
|
|
25
|
+
*/
|
|
26
|
+
export interface ListConfig {
|
|
27
|
+
/**
|
|
28
|
+
* The configuration of the {@link module:list/listproperties~ListProperties} feature and the
|
|
29
|
+
* {@link module:list/legacylistproperties~LegacyListProperties legacy list properties} feature.
|
|
30
|
+
*
|
|
31
|
+
* Read more in {@link module:list/listconfig~ListPropertiesConfig}.
|
|
32
|
+
*/
|
|
33
|
+
properties?: ListPropertiesConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Allows multiple blocks in single list item.
|
|
36
|
+
*
|
|
37
|
+
* With this option enabled you can have block widgets, for example images or even tables, within a list item.
|
|
38
|
+
*
|
|
39
|
+
* **Note:** This is enabled by default.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
multiBlock?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The configuration of the {@link module:list/listproperties~ListProperties list properties} feature and the
|
|
47
|
+
* {@link module:list/legacylistproperties~LegacyListProperties legacy list properties} feature.
|
|
48
|
+
*
|
|
49
|
+
* This configuration controls the individual list properties. For instance, it enables or disables specific editor commands
|
|
50
|
+
* operating on lists ({@link module:list/listproperties/liststylecommand~ListStyleCommand `'listStyle'`},
|
|
51
|
+
* {@link module:list/listproperties/liststartcommand~ListStartCommand `'listStart'`},
|
|
52
|
+
* {@link module:list/listproperties/listreversedcommand~ListReversedCommand `'listReversed'`}, or on the legacy lists
|
|
53
|
+
* {@link module:list/legacylistproperties/legacyliststylecommand~LegacyListStyleCommand `'listStyle'`},
|
|
54
|
+
* {@link module:list/legacylistproperties/legacyliststartcommand~LegacyListStartCommand `'listStart'`},
|
|
55
|
+
* {@link module:list/legacylistproperties/legacylistreversedcommand~LegacyListReversedCommand `'listReversed'`}), the look of the UI
|
|
56
|
+
* (`'numberedList'` and `'bulletedList'` dropdowns), and the editor data pipeline (allowed HTML attributes).
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* ClassicEditor
|
|
60
|
+
* .create( editorElement, {
|
|
61
|
+
* list: {
|
|
62
|
+
* properties: {
|
|
63
|
+
* styles: true,
|
|
64
|
+
* startIndex: true,
|
|
65
|
+
* reversed: true
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* } )
|
|
69
|
+
* .then( ... )
|
|
70
|
+
* .catch( ... );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export interface ListPropertiesConfig {
|
|
74
|
+
/**
|
|
75
|
+
* When set, the list style feature will be enabled.
|
|
76
|
+
* It allows changing the `list-style-type` style or the `type` HTML attribute of a list.
|
|
77
|
+
*
|
|
78
|
+
* **Note**: Styling using the `type` HTML attribute is only available in
|
|
79
|
+
* {@link module:list/listproperties~ListProperties list properties}
|
|
80
|
+
* ({@link module:list/listconfig~ListPropertiesStyleConfig learn more}).
|
|
81
|
+
*
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
styles?: boolean | ListPropertiesStyleConfig | ArrayOrItem<ListPropertiesStyleListType>;
|
|
85
|
+
/**
|
|
86
|
+
* When set, the list start index feature will be enabled. It allows changing the `start` HTML attribute of the numbered lists. As a
|
|
87
|
+
* result, it will be possible to specify the start value of the first item in an ordered list.
|
|
88
|
+
*
|
|
89
|
+
* **Note**: This configuration does not affect bulleted and to-do lists.
|
|
90
|
+
*
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
startIndex?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* When set, the reversed list feature will be enabled. It allows changing the `reversed` HTML attribute of the numbered lists. As a
|
|
96
|
+
* result, it will be possible to make the list order descending instead of ascending.
|
|
97
|
+
*
|
|
98
|
+
* **Note**: This configuration does not affect bulleted and to-do lists.
|
|
99
|
+
*
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
reversed?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface ListPropertiesStyleConfig {
|
|
105
|
+
/**
|
|
106
|
+
* Enable style feature for the given list type only.
|
|
107
|
+
*
|
|
108
|
+
* ```ts
|
|
109
|
+
* {
|
|
110
|
+
* list: {
|
|
111
|
+
* properties: {
|
|
112
|
+
* styles: {
|
|
113
|
+
* listTypes: 'numbered'
|
|
114
|
+
* }
|
|
115
|
+
*
|
|
116
|
+
* // ...
|
|
117
|
+
* }
|
|
118
|
+
* },
|
|
119
|
+
*
|
|
120
|
+
* // ...
|
|
121
|
+
* }
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
*
|
|
125
|
+
* **Note**: This configuration works only with
|
|
126
|
+
* {@link module:list/listproperties~ListProperties list properties}.
|
|
127
|
+
*
|
|
128
|
+
* @default ['bulleted','numbered']
|
|
129
|
+
*/
|
|
130
|
+
listTypes?: ArrayOrItem<ListPropertiesStyleListType>;
|
|
131
|
+
/**
|
|
132
|
+
* When set `true`, the list style feature will use the `type` attribute of `<ul>` and `<ol>` elements instead of the `list-style-type`
|
|
133
|
+
* style.
|
|
134
|
+
*
|
|
135
|
+
* ```ts
|
|
136
|
+
* {
|
|
137
|
+
* list: {
|
|
138
|
+
* properties: {
|
|
139
|
+
* styles: {
|
|
140
|
+
* useAttribute: true
|
|
141
|
+
* },
|
|
142
|
+
*
|
|
143
|
+
* // ...
|
|
144
|
+
* }
|
|
145
|
+
* },
|
|
146
|
+
*
|
|
147
|
+
* // ...
|
|
148
|
+
* }
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* **Note**: Due to limitations of HTML, the "Decimal with leading zero" style is impossible to set using the `type` attribute.
|
|
152
|
+
*
|
|
153
|
+
* **Note**: This configuration works only with
|
|
154
|
+
* {@link module:list/listproperties~ListProperties list properties}.
|
|
155
|
+
*
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
useAttribute?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export type ListPropertiesStyleListType = 'numbered' | 'bulleted';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module list/listproperties/converters
|
|
7
|
+
*/
|
|
8
|
+
import type { UpcastElementEvent } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import type { GetCallback } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import type { AttributeStrategy } from './listpropertiesediting.js';
|
|
11
|
+
/**
|
|
12
|
+
* Returns a converter that consumes the `style`, `reversed`, and `start` attributes.
|
|
13
|
+
* In `style`, it searches for the `list-style-type` definition.
|
|
14
|
+
* If not found, the `"default"` value will be used.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
* @param strategy
|
|
18
|
+
*/
|
|
19
|
+
export declare function listPropertiesUpcastConverter(strategy: AttributeStrategy): GetCallback<UpcastElementEvent>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
* Returns a converter that consumes the `style`, `reversed`, and `start` attributes.
|
|
7
|
+
* In `style`, it searches for the `list-style-type` definition.
|
|
8
|
+
* If not found, the `"default"` value will be used.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
* @param strategy
|
|
12
|
+
*/
|
|
13
|
+
export function listPropertiesUpcastConverter(strategy) {
|
|
14
|
+
return (evt, data, conversionApi) => {
|
|
15
|
+
const { writer, schema, consumable } = conversionApi;
|
|
16
|
+
// If there is no view consumable to consume, set the default attribute value to be able to reconvert nested lists on parent change.
|
|
17
|
+
// So abort converting if attribute was directly consumed.
|
|
18
|
+
if (consumable.test(data.viewItem, strategy.viewConsumables) === false) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!data.modelRange) {
|
|
22
|
+
Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));
|
|
23
|
+
}
|
|
24
|
+
let applied = false;
|
|
25
|
+
for (const item of data.modelRange.getItems({ shallow: true })) {
|
|
26
|
+
if (!schema.checkAttribute(item, strategy.attributeName)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (!strategy.appliesToListItem(item)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
// Set list attributes only on same level items, those nested deeper are already handled by the recursive conversion.
|
|
33
|
+
if (item.hasAttribute(strategy.attributeName)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
writer.setAttribute(strategy.attributeName, strategy.getAttributeOnUpcast(data.viewItem), item);
|
|
37
|
+
applied = true;
|
|
38
|
+
}
|
|
39
|
+
if (applied) {
|
|
40
|
+
consumable.consume(data.viewItem, strategy.viewConsumables);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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/listproperties/listpropertiesediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { Consumables, DowncastWriter, Element, Item, ViewElement } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import ListEditing, { type ListItemAttributesMap } from '../list/listediting.js';
|
|
11
|
+
import ListPropertiesUtils from './listpropertiesutils.js';
|
|
12
|
+
/**
|
|
13
|
+
* The document list properties engine feature.
|
|
14
|
+
*
|
|
15
|
+
* It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
|
|
16
|
+
* Read more in {@link module:list/listconfig~ListPropertiesConfig}.
|
|
17
|
+
*/
|
|
18
|
+
export default class ListPropertiesEditing extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): readonly [typeof ListEditing, typeof ListPropertiesUtils];
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "ListPropertiesEditing";
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get isOfficialPlugin(): true;
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
constructor(editor: Editor);
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
init(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Strategy for dealing with `listItem` attributes supported by this plugin.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export interface AttributeStrategy {
|
|
46
|
+
/**
|
|
47
|
+
* The model attribute name.
|
|
48
|
+
*/
|
|
49
|
+
attributeName: keyof ListItemAttributesMap;
|
|
50
|
+
/**
|
|
51
|
+
* The model attribute default value.
|
|
52
|
+
*/
|
|
53
|
+
defaultValue: unknown;
|
|
54
|
+
/**
|
|
55
|
+
* The view consumable as expected by {@link module:engine/conversion/viewconsumable~ViewConsumable#consume `ViewConsumable`}.
|
|
56
|
+
*/
|
|
57
|
+
viewConsumables: Consumables;
|
|
58
|
+
/**
|
|
59
|
+
* Registers an editor command.
|
|
60
|
+
*/
|
|
61
|
+
addCommand(editor: Editor): void;
|
|
62
|
+
/**
|
|
63
|
+
* Verifies whether the strategy is applicable for the specified model element.
|
|
64
|
+
*/
|
|
65
|
+
appliesToListItem(element: Item): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Verifies whether the model attribute value is valid.
|
|
68
|
+
*/
|
|
69
|
+
hasValidAttribute(element: Element): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Sets the property on the view element.
|
|
72
|
+
*/
|
|
73
|
+
setAttributeOnDowncast(writer: DowncastWriter, value: unknown, element: ViewElement): void;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the property value from the view element.
|
|
76
|
+
*/
|
|
77
|
+
getAttributeOnUpcast(element: ViewElement): unknown;
|
|
78
|
+
}
|
|
79
|
+
declare module '../list/listediting' {
|
|
80
|
+
interface ListItemAttributesMap {
|
|
81
|
+
listStyle?: string;
|
|
82
|
+
listStart?: number;
|
|
83
|
+
listReversed?: boolean;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
declare module '../list/utils/model' {
|
|
87
|
+
interface ListElement {
|
|
88
|
+
getAttribute(key: 'listStyle'): string;
|
|
89
|
+
getAttribute(key: 'listStart'): number;
|
|
90
|
+
getAttribute(key: 'listReversed'): boolean;
|
|
91
|
+
}
|
|
92
|
+
}
|