@ckeditor/ckeditor5-basic-styles 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/basic-styles.js +5 -0
- package/build/translations/af.js +1 -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/bs.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-co.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/gu.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/hy.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/oc.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/sl.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 +137 -0
- package/dist/attributecommand.d.ts +78 -0
- package/dist/augmentation.d.ts +44 -0
- package/dist/bold/boldediting.d.ts +32 -0
- package/dist/bold/boldui.d.ts +29 -0
- package/dist/bold.d.ts +37 -0
- package/dist/code/codeediting.d.ts +37 -0
- package/dist/code/codeui.d.ts +30 -0
- package/dist/code.d.ts +38 -0
- package/dist/index-content.css +9 -0
- package/dist/index-editor.css +7 -0
- package/dist/index.css +20 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +981 -0
- package/dist/index.js.map +1 -0
- package/dist/italic/italicediting.d.ts +32 -0
- package/dist/italic/italicui.d.ts +29 -0
- package/dist/italic.d.ts +37 -0
- package/dist/strikethrough/strikethroughediting.d.ts +33 -0
- package/dist/strikethrough/strikethroughui.d.ts +29 -0
- package/dist/strikethrough.d.ts +37 -0
- package/dist/subscript/subscriptediting.d.ts +32 -0
- package/dist/subscript/subscriptui.d.ts +29 -0
- package/dist/subscript.d.ts +34 -0
- package/dist/superscript/superscriptediting.d.ts +32 -0
- package/dist/superscript/superscriptui.d.ts +29 -0
- package/dist/superscript.d.ts +34 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +5 -0
- package/dist/translations/af.umd.js +11 -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/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.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-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.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/gu.d.ts +8 -0
- package/dist/translations/gu.js +5 -0
- package/dist/translations/gu.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/hy.d.ts +8 -0
- package/dist/translations/hy.js +5 -0
- package/dist/translations/hy.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/oc.d.ts +8 -0
- package/dist/translations/oc.js +5 -0
- package/dist/translations/oc.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/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/underline/underlineediting.d.ts +32 -0
- package/dist/underline/underlineui.d.ts +29 -0
- package/dist/underline.d.ts +37 -0
- package/dist/utils.d.ts +24 -0
- package/lang/contexts.json +14 -0
- package/lang/translations/af.po +66 -0
- package/lang/translations/ar.po +66 -0
- package/lang/translations/ast.po +66 -0
- package/lang/translations/az.po +66 -0
- package/lang/translations/bg.po +66 -0
- package/lang/translations/bn.po +66 -0
- package/lang/translations/bs.po +66 -0
- package/lang/translations/ca.po +66 -0
- package/lang/translations/cs.po +66 -0
- package/lang/translations/da.po +66 -0
- package/lang/translations/de-ch.po +66 -0
- package/lang/translations/de.po +66 -0
- package/lang/translations/el.po +66 -0
- package/lang/translations/en-au.po +66 -0
- package/lang/translations/en-gb.po +66 -0
- package/lang/translations/en.po +66 -0
- package/lang/translations/eo.po +66 -0
- package/lang/translations/es-co.po +66 -0
- package/lang/translations/es.po +66 -0
- package/lang/translations/et.po +66 -0
- package/lang/translations/eu.po +66 -0
- package/lang/translations/fa.po +66 -0
- package/lang/translations/fi.po +66 -0
- package/lang/translations/fr.po +66 -0
- package/lang/translations/gl.po +66 -0
- package/lang/translations/gu.po +66 -0
- package/lang/translations/he.po +66 -0
- package/lang/translations/hi.po +66 -0
- package/lang/translations/hr.po +66 -0
- package/lang/translations/hu.po +66 -0
- package/lang/translations/hy.po +66 -0
- package/lang/translations/id.po +66 -0
- package/lang/translations/it.po +66 -0
- package/lang/translations/ja.po +66 -0
- package/lang/translations/jv.po +66 -0
- package/lang/translations/km.po +66 -0
- package/lang/translations/kn.po +66 -0
- package/lang/translations/ko.po +66 -0
- package/lang/translations/ku.po +66 -0
- package/lang/translations/lt.po +66 -0
- package/lang/translations/lv.po +66 -0
- package/lang/translations/ms.po +66 -0
- package/lang/translations/nb.po +66 -0
- package/lang/translations/ne.po +66 -0
- package/lang/translations/nl.po +66 -0
- package/lang/translations/no.po +66 -0
- package/lang/translations/oc.po +66 -0
- package/lang/translations/pl.po +66 -0
- package/lang/translations/pt-br.po +66 -0
- package/lang/translations/pt.po +66 -0
- package/lang/translations/ro.po +66 -0
- package/lang/translations/ru.po +66 -0
- package/lang/translations/si.po +66 -0
- package/lang/translations/sk.po +66 -0
- package/lang/translations/sl.po +66 -0
- package/lang/translations/sq.po +66 -0
- package/lang/translations/sr-latn.po +66 -0
- package/lang/translations/sr.po +66 -0
- package/lang/translations/sv.po +66 -0
- package/lang/translations/th.po +66 -0
- package/lang/translations/ti.po +66 -0
- package/lang/translations/tk.po +66 -0
- package/lang/translations/tr.po +66 -0
- package/lang/translations/tt.po +66 -0
- package/lang/translations/ug.po +66 -0
- package/lang/translations/uk.po +66 -0
- package/lang/translations/ur.po +66 -0
- package/lang/translations/uz.po +66 -0
- package/lang/translations/vi.po +66 -0
- package/lang/translations/zh-cn.po +66 -0
- package/lang/translations/zh.po +66 -0
- package/package.json +41 -0
- package/src/attributecommand.d.ts +74 -0
- package/src/attributecommand.js +105 -0
- package/src/augmentation.d.ts +40 -0
- package/src/augmentation.js +5 -0
- package/src/bold/boldediting.d.ts +28 -0
- package/src/bold/boldediting.js +78 -0
- package/src/bold/boldui.d.ts +25 -0
- package/src/bold/boldui.js +46 -0
- package/src/bold.d.ts +33 -0
- package/src/bold.js +39 -0
- package/src/code/codeediting.d.ts +33 -0
- package/src/code/codeediting.js +78 -0
- package/src/code/codeui.d.ts +26 -0
- package/src/code/codeui.js +47 -0
- package/src/code.d.ts +34 -0
- package/src/code.js +40 -0
- package/src/index.d.ts +30 -0
- package/src/index.js +30 -0
- package/src/italic/italicediting.d.ts +28 -0
- package/src/italic/italicediting.js +68 -0
- package/src/italic/italicui.d.ts +25 -0
- package/src/italic/italicui.js +47 -0
- package/src/italic.d.ts +33 -0
- package/src/italic.js +39 -0
- package/src/strikethrough/strikethroughediting.d.ts +29 -0
- package/src/strikethrough/strikethroughediting.js +70 -0
- package/src/strikethrough/strikethroughui.d.ts +25 -0
- package/src/strikethrough/strikethroughui.js +47 -0
- package/src/strikethrough.d.ts +33 -0
- package/src/strikethrough.js +39 -0
- package/src/subscript/subscriptediting.d.ts +28 -0
- package/src/subscript/subscriptediting.js +56 -0
- package/src/subscript/subscriptui.d.ts +25 -0
- package/src/subscript/subscriptui.js +46 -0
- package/src/subscript.d.ts +30 -0
- package/src/subscript.js +36 -0
- package/src/superscript/superscriptediting.d.ts +28 -0
- package/src/superscript/superscriptediting.js +56 -0
- package/src/superscript/superscriptui.d.ts +25 -0
- package/src/superscript/superscriptui.js +46 -0
- package/src/superscript.d.ts +30 -0
- package/src/superscript.js +36 -0
- package/src/underline/underlineediting.d.ts +28 -0
- package/src/underline/underlineediting.js +65 -0
- package/src/underline/underlineui.d.ts +25 -0
- package/src/underline/underlineui.js +47 -0
- package/src/underline.d.ts +33 -0
- package/src/underline.js +39 -0
- package/src/utils.d.ts +20 -0
- package/src/utils.js +38 -0
- package/theme/code.css +14 -0
- package/theme/icons/code.svg +1 -0
- package/theme/icons/italic.svg +1 -0
- package/theme/icons/strikethrough.svg +1 -0
- package/theme/icons/subscript.svg +1 -0
- package/theme/icons/superscript.svg +1 -0
- package/theme/icons/underline.svg +1 -0
package/src/italic.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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 basic-styles/italic
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ItalicEditing from './italic/italicediting.js';
|
|
10
|
+
import ItalicUI from './italic/italicui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The italic feature.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
+
* and the {@glink api/basic-styles package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
|
|
18
|
+
* {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
|
|
19
|
+
*/
|
|
20
|
+
export default class Italic extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires() {
|
|
25
|
+
return [ItalicEditing, ItalicUI];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName() {
|
|
31
|
+
return 'Italic';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get isOfficialPlugin() {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 basic-styles/strikethrough/strikethroughediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The strikethrough editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
|
|
13
|
+
* `strikethroughsthrough` attribute in the model which renders to the view
|
|
14
|
+
* as a `<s>` element.
|
|
15
|
+
*/
|
|
16
|
+
export default class StrikethroughEditing extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "StrikethroughEditing";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get isOfficialPlugin(): true;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
init(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/strikethrough/strikethroughediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import AttributeCommand from '../attributecommand.js';
|
|
10
|
+
const STRIKETHROUGH = 'strikethrough';
|
|
11
|
+
/**
|
|
12
|
+
* The strikethrough editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
|
|
15
|
+
* `strikethroughsthrough` attribute in the model which renders to the view
|
|
16
|
+
* as a `<s>` element.
|
|
17
|
+
*/
|
|
18
|
+
export default class StrikethroughEditing extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName() {
|
|
23
|
+
return 'StrikethroughEditing';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get isOfficialPlugin() {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
init() {
|
|
35
|
+
const editor = this.editor;
|
|
36
|
+
const t = this.editor.t;
|
|
37
|
+
// Allow strikethrough attribute on text nodes.
|
|
38
|
+
editor.model.schema.extend('$text', { allowAttributes: STRIKETHROUGH });
|
|
39
|
+
editor.model.schema.setAttributeProperties(STRIKETHROUGH, {
|
|
40
|
+
isFormatting: true,
|
|
41
|
+
copyOnEnter: true
|
|
42
|
+
});
|
|
43
|
+
editor.conversion.attributeToElement({
|
|
44
|
+
model: STRIKETHROUGH,
|
|
45
|
+
view: 's',
|
|
46
|
+
upcastAlso: [
|
|
47
|
+
'del',
|
|
48
|
+
'strike',
|
|
49
|
+
{
|
|
50
|
+
styles: {
|
|
51
|
+
'text-decoration': 'line-through'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
// Create strikethrough command.
|
|
57
|
+
editor.commands.add(STRIKETHROUGH, new AttributeCommand(editor, STRIKETHROUGH));
|
|
58
|
+
// Set the Ctrl+Shift+X keystroke.
|
|
59
|
+
editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');
|
|
60
|
+
// Add the information about the keystroke to the accessibility database.
|
|
61
|
+
editor.accessibility.addKeystrokeInfos({
|
|
62
|
+
keystrokes: [
|
|
63
|
+
{
|
|
64
|
+
label: t('Strikethrough text'),
|
|
65
|
+
keystroke: 'CTRL+SHIFT+X'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 basic-styles/strikethrough/strikethroughui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The strikethrough UI feature. It introduces the Strikethrough button.
|
|
11
|
+
*/
|
|
12
|
+
export default class StrikethroughUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "StrikethroughUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get isOfficialPlugin(): true;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 basic-styles/strikethrough/strikethroughui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { getButtonCreator } from '../utils.js';
|
|
11
|
+
import strikethroughIcon from '../../theme/icons/strikethrough.svg';
|
|
12
|
+
const STRIKETHROUGH = 'strikethrough';
|
|
13
|
+
/**
|
|
14
|
+
* The strikethrough UI feature. It introduces the Strikethrough button.
|
|
15
|
+
*/
|
|
16
|
+
export default class StrikethroughUI extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName() {
|
|
21
|
+
return 'StrikethroughUI';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isOfficialPlugin() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init() {
|
|
33
|
+
const editor = this.editor;
|
|
34
|
+
const t = editor.locale.t;
|
|
35
|
+
const createButton = getButtonCreator({
|
|
36
|
+
editor,
|
|
37
|
+
commandName: STRIKETHROUGH,
|
|
38
|
+
plugin: this,
|
|
39
|
+
icon: strikethroughIcon,
|
|
40
|
+
keystroke: 'CTRL+SHIFT+X',
|
|
41
|
+
label: t('Strikethrough')
|
|
42
|
+
});
|
|
43
|
+
// Add strikethrough button to feature components.
|
|
44
|
+
editor.ui.componentFactory.add(STRIKETHROUGH, () => createButton(ButtonView));
|
|
45
|
+
editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 basic-styles/strikethrough
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import StrikethroughEditing from './strikethrough/strikethroughediting.js';
|
|
10
|
+
import StrikethroughUI from './strikethrough/strikethroughui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The strikethrough feature.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
+
* and the {@glink api/basic-styles package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
|
|
18
|
+
* {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
|
|
19
|
+
*/
|
|
20
|
+
export default class Strikethrough extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires(): readonly [typeof StrikethroughEditing, typeof StrikethroughUI];
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "Strikethrough";
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get isOfficialPlugin(): true;
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 basic-styles/strikethrough
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import StrikethroughEditing from './strikethrough/strikethroughediting.js';
|
|
10
|
+
import StrikethroughUI from './strikethrough/strikethroughui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The strikethrough feature.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
+
* and the {@glink api/basic-styles package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
|
|
18
|
+
* {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
|
|
19
|
+
*/
|
|
20
|
+
export default class Strikethrough extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires() {
|
|
25
|
+
return [StrikethroughEditing, StrikethroughUI];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName() {
|
|
31
|
+
return 'Strikethrough';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get isOfficialPlugin() {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 basic-styles/subscript/subscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The subscript editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
|
|
13
|
+
* as a `<sub>` element.
|
|
14
|
+
*/
|
|
15
|
+
export default class SubscriptEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "SubscriptEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get isOfficialPlugin(): true;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/subscript/subscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import AttributeCommand from '../attributecommand.js';
|
|
10
|
+
const SUBSCRIPT = 'subscript';
|
|
11
|
+
/**
|
|
12
|
+
* The subscript editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
|
|
15
|
+
* as a `<sub>` element.
|
|
16
|
+
*/
|
|
17
|
+
export default class SubscriptEditing extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName() {
|
|
22
|
+
return 'SubscriptEditing';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get isOfficialPlugin() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
init() {
|
|
34
|
+
const editor = this.editor;
|
|
35
|
+
// Allow sub attribute on text nodes.
|
|
36
|
+
editor.model.schema.extend('$text', { allowAttributes: SUBSCRIPT });
|
|
37
|
+
editor.model.schema.setAttributeProperties(SUBSCRIPT, {
|
|
38
|
+
isFormatting: true,
|
|
39
|
+
copyOnEnter: true
|
|
40
|
+
});
|
|
41
|
+
// Build converter from model to view for data and editing pipelines.
|
|
42
|
+
editor.conversion.attributeToElement({
|
|
43
|
+
model: SUBSCRIPT,
|
|
44
|
+
view: 'sub',
|
|
45
|
+
upcastAlso: [
|
|
46
|
+
{
|
|
47
|
+
styles: {
|
|
48
|
+
'vertical-align': 'sub'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
// Create sub command.
|
|
54
|
+
editor.commands.add(SUBSCRIPT, new AttributeCommand(editor, SUBSCRIPT));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 basic-styles/subscript/subscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The subscript UI feature. It introduces the Subscript button.
|
|
11
|
+
*/
|
|
12
|
+
export default class SubscriptUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "SubscriptUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get isOfficialPlugin(): true;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 basic-styles/subscript/subscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { getButtonCreator } from '../utils.js';
|
|
11
|
+
import subscriptIcon from '../../theme/icons/subscript.svg';
|
|
12
|
+
const SUBSCRIPT = 'subscript';
|
|
13
|
+
/**
|
|
14
|
+
* The subscript UI feature. It introduces the Subscript button.
|
|
15
|
+
*/
|
|
16
|
+
export default class SubscriptUI extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName() {
|
|
21
|
+
return 'SubscriptUI';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isOfficialPlugin() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init() {
|
|
33
|
+
const editor = this.editor;
|
|
34
|
+
const t = editor.locale.t;
|
|
35
|
+
const createButton = getButtonCreator({
|
|
36
|
+
editor,
|
|
37
|
+
commandName: SUBSCRIPT,
|
|
38
|
+
plugin: this,
|
|
39
|
+
icon: subscriptIcon,
|
|
40
|
+
label: t('Subscript')
|
|
41
|
+
});
|
|
42
|
+
// Add subscript button to feature components.
|
|
43
|
+
editor.ui.componentFactory.add(SUBSCRIPT, () => createButton(ButtonView));
|
|
44
|
+
editor.ui.componentFactory.add('menuBar:' + SUBSCRIPT, () => createButton(MenuBarMenuListItemButtonView));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -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 basic-styles/subscript
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import SubscriptEditing from './subscript/subscriptediting.js';
|
|
10
|
+
import SubscriptUI from './subscript/subscriptui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The subscript feature.
|
|
13
|
+
*
|
|
14
|
+
* It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
|
|
15
|
+
* {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
|
|
16
|
+
*/
|
|
17
|
+
export default class Subscript extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof SubscriptEditing, typeof SubscriptUI];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "Subscript";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get isOfficialPlugin(): true;
|
|
30
|
+
}
|
package/src/subscript.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 basic-styles/subscript
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import SubscriptEditing from './subscript/subscriptediting.js';
|
|
10
|
+
import SubscriptUI from './subscript/subscriptui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The subscript feature.
|
|
13
|
+
*
|
|
14
|
+
* It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
|
|
15
|
+
* {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
|
|
16
|
+
*/
|
|
17
|
+
export default class Subscript extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires() {
|
|
22
|
+
return [SubscriptEditing, SubscriptUI];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get pluginName() {
|
|
28
|
+
return 'Subscript';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get isOfficialPlugin() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 basic-styles/superscript/superscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The superscript editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
13
|
+
* as a `<super>` element.
|
|
14
|
+
*/
|
|
15
|
+
export default class SuperscriptEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "SuperscriptEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get isOfficialPlugin(): true;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript/superscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import AttributeCommand from '../attributecommand.js';
|
|
10
|
+
const SUPERSCRIPT = 'superscript';
|
|
11
|
+
/**
|
|
12
|
+
* The superscript editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
15
|
+
* as a `<super>` element.
|
|
16
|
+
*/
|
|
17
|
+
export default class SuperscriptEditing extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName() {
|
|
22
|
+
return 'SuperscriptEditing';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get isOfficialPlugin() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
init() {
|
|
34
|
+
const editor = this.editor;
|
|
35
|
+
// Allow super attribute on text nodes.
|
|
36
|
+
editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });
|
|
37
|
+
editor.model.schema.setAttributeProperties(SUPERSCRIPT, {
|
|
38
|
+
isFormatting: true,
|
|
39
|
+
copyOnEnter: true
|
|
40
|
+
});
|
|
41
|
+
// Build converter from model to view for data and editing pipelines.
|
|
42
|
+
editor.conversion.attributeToElement({
|
|
43
|
+
model: SUPERSCRIPT,
|
|
44
|
+
view: 'sup',
|
|
45
|
+
upcastAlso: [
|
|
46
|
+
{
|
|
47
|
+
styles: {
|
|
48
|
+
'vertical-align': 'super'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
// Create super command.
|
|
54
|
+
editor.commands.add(SUPERSCRIPT, new AttributeCommand(editor, SUPERSCRIPT));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 basic-styles/superscript/superscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The superscript UI feature. It introduces the Superscript button.
|
|
11
|
+
*/
|
|
12
|
+
export default class SuperscriptUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "SuperscriptUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get isOfficialPlugin(): true;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 basic-styles/superscript/superscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { getButtonCreator } from '../utils.js';
|
|
11
|
+
import superscriptIcon from '../../theme/icons/superscript.svg';
|
|
12
|
+
const SUPERSCRIPT = 'superscript';
|
|
13
|
+
/**
|
|
14
|
+
* The superscript UI feature. It introduces the Superscript button.
|
|
15
|
+
*/
|
|
16
|
+
export default class SuperscriptUI extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName() {
|
|
21
|
+
return 'SuperscriptUI';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isOfficialPlugin() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init() {
|
|
33
|
+
const editor = this.editor;
|
|
34
|
+
const t = editor.locale.t;
|
|
35
|
+
const createButton = getButtonCreator({
|
|
36
|
+
editor,
|
|
37
|
+
commandName: SUPERSCRIPT,
|
|
38
|
+
plugin: this,
|
|
39
|
+
icon: superscriptIcon,
|
|
40
|
+
label: t('Superscript')
|
|
41
|
+
});
|
|
42
|
+
// Add superscript button to feature components.
|
|
43
|
+
editor.ui.componentFactory.add(SUPERSCRIPT, () => createButton(ButtonView));
|
|
44
|
+
editor.ui.componentFactory.add('menuBar:' + SUPERSCRIPT, () => createButton(MenuBarMenuListItemButtonView));
|
|
45
|
+
}
|
|
46
|
+
}
|