@ckeditor/ckeditor5-autoformat 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/autoformat.js +5 -0
- package/build/translations/ar.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.js +1 -0
- package/build/translations/el.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/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/ko.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/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/sk.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/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/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +11 -0
- package/dist/augmentation.d.ts +14 -0
- package/dist/autoformat.d.ts +89 -0
- package/dist/blockautoformatediting.d.ts +61 -0
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +4 -0
- package/dist/index.css +4 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +520 -0
- package/dist/index.js.map +1 -0
- package/dist/inlineautoformatediting.d.ts +87 -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/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.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.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.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/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/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.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/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/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.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/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/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 +3 -0
- package/lang/translations/ar.po +22 -0
- package/lang/translations/bg.po +22 -0
- package/lang/translations/bn.po +22 -0
- package/lang/translations/ca.po +22 -0
- package/lang/translations/cs.po +22 -0
- package/lang/translations/da.po +22 -0
- package/lang/translations/de.po +22 -0
- package/lang/translations/el.po +22 -0
- package/lang/translations/en.po +22 -0
- package/lang/translations/es-co.po +22 -0
- package/lang/translations/es.po +22 -0
- package/lang/translations/et.po +22 -0
- package/lang/translations/fa.po +22 -0
- package/lang/translations/fi.po +22 -0
- package/lang/translations/fr.po +22 -0
- package/lang/translations/gl.po +22 -0
- package/lang/translations/he.po +22 -0
- package/lang/translations/hi.po +22 -0
- package/lang/translations/hr.po +22 -0
- package/lang/translations/hu.po +22 -0
- package/lang/translations/id.po +22 -0
- package/lang/translations/it.po +22 -0
- package/lang/translations/ja.po +22 -0
- package/lang/translations/ko.po +22 -0
- package/lang/translations/lt.po +22 -0
- package/lang/translations/lv.po +22 -0
- package/lang/translations/ms.po +22 -0
- package/lang/translations/nl.po +22 -0
- package/lang/translations/no.po +22 -0
- package/lang/translations/pl.po +22 -0
- package/lang/translations/pt-br.po +22 -0
- package/lang/translations/pt.po +22 -0
- package/lang/translations/ro.po +22 -0
- package/lang/translations/ru.po +22 -0
- package/lang/translations/sk.po +22 -0
- package/lang/translations/sr-latn.po +22 -0
- package/lang/translations/sr.po +22 -0
- package/lang/translations/sv.po +22 -0
- package/lang/translations/th.po +22 -0
- package/lang/translations/tr.po +22 -0
- package/lang/translations/tt.po +22 -0
- package/lang/translations/ug.po +22 -0
- package/lang/translations/uk.po +22 -0
- package/lang/translations/vi.po +22 -0
- package/lang/translations/zh-cn.po +22 -0
- package/lang/translations/zh.po +22 -0
- package/package.json +42 -0
- package/src/augmentation.d.ts +10 -0
- package/src/augmentation.js +5 -0
- package/src/autoformat.d.ts +85 -0
- package/src/autoformat.js +206 -0
- package/src/blockautoformatediting.d.ts +57 -0
- package/src/blockautoformatediting.js +137 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +11 -0
- package/src/inlineautoformatediting.d.ts +83 -0
- package/src/inlineautoformatediting.js +174 -0
package/CHANGELOG.md
ADDED
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Software License Agreement
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
**CKEditor 5 autoformat feature** – https://github.com/ckeditor/ckeditor5-autoformat <br>
|
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
|
+
|
|
7
|
+
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
|
8
|
+
|
|
9
|
+
Sources of Intellectual Property Included in CKEditor
|
|
10
|
+
-----------------------------------------------------
|
|
11
|
+
|
|
12
|
+
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
|
|
13
|
+
|
|
14
|
+
Trademarks
|
|
15
|
+
----------
|
|
16
|
+
|
|
17
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CKEditor 5 autoformat feature
|
|
2
|
+
========================================
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-autoformat)
|
|
5
|
+
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
+
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
+
|
|
8
|
+
This package implements the autoformatting feature for CKEditor 5. It allows styling text by typing sequences like `**bold this**`.
|
|
9
|
+
|
|
10
|
+
## Demo
|
|
11
|
+
|
|
12
|
+
Check out the [demo in the autoformat feature guide](https://ckeditor.com/docs/ckeditor5/latest/features/autoformat.html#demo).
|
|
13
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
See the [`@ckeditor/ckeditor5-autoformat` package](https://ckeditor.com/docs/ckeditor5/latest/api/autoformat.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install ckeditor5
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Revert autoformatting action":"Revert autoformatting action"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
|
|
2
|
+
/*!
|
|
3
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
+
* For licensing, see LICENSE.md.
|
|
5
|
+
*/(()=>{var t={782:(t,e,o)=>{t.exports=o(237)("./src/core.js")},783:(t,e,o)=>{t.exports=o(237)("./src/engine.js")},834:(t,e,o)=>{t.exports=o(237)("./src/typing.js")},584:(t,e,o)=>{t.exports=o(237)("./src/utils.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{Autoformat:()=>c,blockAutoformatEditing:()=>r,inlineAutoformatEditing:()=>a});var t=o(782),e=o(834),s=o(783),n=o(584);function r(t,e,o,i){let r,a=null;"function"==typeof i?r=i:(a=t.commands.get(i),r=()=>{t.execute(i)}),t.model.document.on("change:data",((d,c)=>{if(a&&!a.isEnabled||!e.isEnabled)return;const l=(0,n.first)(t.model.document.selection.getRanges());if(!l.isCollapsed)return;if(c.isUndo||!c.isLocal)return;const u=Array.from(t.model.document.differ.getChanges()),g=u[0];if(1!=u.length||"insert"!==g.type||"$text"!=g.name||1!=g.length)return;const h=g.position.parent;if(h.is("element","codeBlock"))return;if(h.is("element","listItem")&&"function"!=typeof i&&!["numberedList","bulletedList","todoList"].includes(i))return;if(a&&!0===a.value)return;const m=h.getChild(0),f=t.model.createRangeOn(m);if(!f.containsRange(l)&&!l.end.isEqual(f.end))return;const p=o.exec(m.data.substr(0,l.end.offset));p&&t.model.enqueueChange((e=>{const o=e.createPositionAt(h,0),i=e.createPositionAt(h,p[0].length),n=new s.LiveRange(o,i);if(!1!==r({match:p})){e.remove(n);const o=t.model.document.selection.getFirstRange(),i=e.createRangeIn(h);!h.isEmpty||i.isEqual(o)||i.containsRange(o,!0)||e.remove(h)}n.detach(),t.model.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function a(t,e,o,i){let s,n;o instanceof RegExp?s=o:n=o,n=n||(t=>{let e;const o=[],i=[];for(;null!==(e=s.exec(t))&&!(e&&e.length<4);){let{index:t,1:s,2:n,3:r}=e;const a=s+n+r;t+=e[0].length-a.length;const d=[t,t+s.length],c=[t+s.length+n.length,t+s.length+n.length+r.length];o.push(d),o.push(c),i.push([t+s.length,t+s.length+n.length])}return{remove:o,format:i}}),t.model.document.on("change:data",((o,s)=>{if(s.isUndo||!s.isLocal||!e.isEnabled)return;const r=t.model,a=r.document.selection;if(!a.isCollapsed)return;const c=Array.from(r.document.differ.getChanges()),l=c[0];if(1!=c.length||"insert"!==l.type||"$text"!=l.name||1!=l.length)return;const u=a.focus,g=u.parent,{text:h,range:m}=function(t,e){let o=t.start;const i=Array.from(t.getItems()).reduce(((t,i)=>!i.is("$text")&&!i.is("$textProxy")||i.getAttribute("code")?(o=e.createPositionAfter(i),""):t+i.data),"");return{text:i,range:e.createRange(o,t.end)}}(r.createRange(r.createPositionAt(g,0),u),r),f=n(h),p=d(m.start,f.format,r),b=d(m.start,f.remove,r);p.length&&b.length&&r.enqueueChange((e=>{if(!1!==i(e,p)){for(const t of b.reverse())e.remove(t);r.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function d(t,e,o){return e.filter((t=>void 0!==t[0]&&void 0!==t[1])).map((e=>o.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1]))))}class c extends t.Plugin{static get requires(){return[e.Delete]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&r(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&r(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&r(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&r(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=l(this.editor,"bold");a(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),a(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=l(this.editor,"italic");a(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),a(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=l(this.editor,"code");a(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=l(this.editor,"strikethrough");a(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter((t=>t.match(/^heading[1-6]$/))).forEach((e=>{const o=e[7],i=new RegExp(`^(#{${o}})\\s$`);r(this.editor,this,i,(()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&r(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const t=this.editor,e=t.model.document.selection;t.commands.get("codeBlock")&&r(t,this,/^```$/,(()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&r(this.editor,this,/^---$/,"horizontalLine")}}function l(t,e){return(o,i)=>{if(!t.commands.get(e).isEnabled)return!1;const s=t.model.schema.getValidRanges(i,e);for(const t of s)o.setAttribute(e,!0,t);o.removeSelectionAttribute(e)}}})(),(window.CKEditor5=window.CKEditor5||{}).autoformat=i})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.ar=i.ar||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"العودة إلى إجراء التنسيق التلقائي"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.bg=i.bg||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Отмяна на действие за автоматично форматиране"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const i=n.bn=n.bn||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"অটো ফরম্যাটিংয়ের কাজটি পূর্বাবস্থায় ফিরিয়ে আনুন"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(a){const i=a.ca=a.ca||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Desfés l'acció d'autoformatació"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const o=t.cs=t.cs||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Vzít zpět akci automatického formátování"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const o=t.da=t.da||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Fortryd autoformatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const i=n.de=n.de||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Automatischen Formatierungsvorgang rückgängig machen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.el=i.el||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Επαναφορά ενέργειας αυτόματης μορφοποίησης"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(o){const t=o["es-co"]=o["es-co"]||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Revertir la acción de formato automático"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.es=t.es||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Revierte la acción de formato automático"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.et=t.et||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Kustuta automaatse vorminduse toiming"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.fa=i.fa||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"بازیابی فرمت انجام شده"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.fi=t.fi||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Peruuta automaattimuokkaus"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const n=t.fr=t.fr||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Annuler l'action de formatage automatique"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const o=t.gl=t.gl||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Reverter a acción de formato automático"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.he=i.he||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"ביטול פעולת העיצוב האוטומטי"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.hi=i.hi||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"ऑटोफ़ॉर्मैटिंग एक्शन को रिवर्ट करें"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const a=t.hr=t.hr||{};a.dictionary=Object.assign(a.dictionary||{},{"Revert autoformatting action":"Vrati radnju automatskog formatiranja"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.hu=t.hu||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Automatikus formázási művelet visszaállítása"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.id=i.id||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Kembalikan tindakan pemformatan otomatis"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const t=i.it=i.it||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Annulla l'azione di formattazione automatica"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.ja=i.ja||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"オートフォーマットによる変更を元に戻す"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(o){const i=o.ko=o.ko||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"자동 서식 작업 되돌리기"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const t=i.lt=i.lt||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Sugrąžinti automatinio formatavimo veiksmą"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const a=t.lv=t.lv||{};a.dictionary=Object.assign(a.dictionary||{},{"Revert autoformatting action":"Atjaunot automātiskās formatēšanas darbību"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const t=n.ms=n.ms||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Pulihkan tindakan pemformatan automatik"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const t=n.nl=n.nl||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Maak automatisch formattering ongedaan"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const o=n.no=n.no||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Angre autoformatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(o){const t=o.pl=o.pl||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Cofa automatyczne formatowanie"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const o=t["pt-br"]=t["pt-br"]||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Reverter ação de autoformatação"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const o=t.pt=t.pt||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Reverter ação de formatação automática"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(a){const o=a.ro=a.ro||{};o.dictionary=Object.assign(o.dictionary||{},{"Revert autoformatting action":"Anulează acțiunea de formatare automată"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.ru=i.ru||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Отменить действие автоформатирования"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.sk=t.sk||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Vrátiť späť automatické formátovanie"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const a=t["sr-latn"]=t["sr-latn"]||{};a.dictionary=Object.assign(a.dictionary||{},{"Revert autoformatting action":"Vrati radnju automatskog formatiranja"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const a=t.sr=t.sr||{};a.dictionary=Object.assign(a.dictionary||{},{"Revert autoformatting action":"Vrati na automatsko formatiranje"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.sv=t.sv||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Ångra automatisk formatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.th=t.th||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"ยกเลิกการดำเนินการจัดรูปแบบอัตโนมัติ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const t=i.tr=i.tr||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Otomatik biçimlendirme işlemini geri al"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){const i=t.tt=t.tt||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"Автоматик форматлау гамәлләрен бетер"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.ug=i.ug||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"ئۆزلۈكىدىن پىچىم مەشغۇلاتىنى ئەسلىگە قايتۇرىدۇ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.uk=i.uk||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"Скасувати дію автоформатування"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const t=n.vi=n.vi||{};t.dictionary=Object.assign(t.dictionary||{},{"Revert autoformatting action":"Hoàn nguyên thao tác tự động định dạng"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const i=n["zh-cn"]=n["zh-cn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Revert autoformatting action":"恢复自动格式化操作"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.zh=i.zh||{};n.dictionary=Object.assign(n.dictionary||{},{"Revert autoformatting action":"復原自動格式化操作"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Autoformat",
|
|
5
|
+
"className": "Autoformat",
|
|
6
|
+
"description": "Enables a set of predefined autoformatting actions. It allows for formatting text by typing sequences like **bold this**.",
|
|
7
|
+
"docs": "features/autoformat.html",
|
|
8
|
+
"path": "src/autoformat.js"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import type { Autoformat } from './index.js';
|
|
10
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
11
|
+
interface PluginsMap {
|
|
12
|
+
[Autoformat.pluginName]: Autoformat;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
import { Delete } from 'ckeditor5/src/typing.js';
|
|
11
|
+
/**
|
|
12
|
+
* Enables a set of predefined autoformatting actions.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview, check the {@glink features/autoformat Autoformatting} feature guide
|
|
15
|
+
* and the {@glink api/autoformat package page}.
|
|
16
|
+
*/
|
|
17
|
+
export default class Autoformat extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof Delete];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "Autoformat";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get isOfficialPlugin(): true;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
afterInit(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Adds autoformatting related to the {@link module:list/list~List}.
|
|
36
|
+
*
|
|
37
|
+
* When typed:
|
|
38
|
+
* - `* ` or `- ` – A paragraph will be changed into a bulleted list.
|
|
39
|
+
* - `1. ` or `1) ` – A paragraph will be changed into a numbered list ("1" can be any digit or a list of digits).
|
|
40
|
+
* - `[] ` or `[ ] ` – A paragraph will be changed into a to-do list.
|
|
41
|
+
* - `[x] ` or `[ x ] ` – A paragraph will be changed into a checked to-do list.
|
|
42
|
+
*/
|
|
43
|
+
private _addListAutoformats;
|
|
44
|
+
/**
|
|
45
|
+
* Adds autoformatting related to the {@link module:basic-styles/bold~Bold},
|
|
46
|
+
* {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}
|
|
47
|
+
* and {@link module:basic-styles/strikethrough~Strikethrough}
|
|
48
|
+
*
|
|
49
|
+
* When typed:
|
|
50
|
+
* - `**foobar**` – `**` characters are removed and `foobar` is set to bold,
|
|
51
|
+
* - `__foobar__` – `__` characters are removed and `foobar` is set to bold,
|
|
52
|
+
* - `*foobar*` – `*` characters are removed and `foobar` is set to italic,
|
|
53
|
+
* - `_foobar_` – `_` characters are removed and `foobar` is set to italic,
|
|
54
|
+
* - ``` `foobar` – ``` ` ``` characters are removed and `foobar` is set to code,
|
|
55
|
+
* - `~~foobar~~` – `~~` characters are removed and `foobar` is set to strikethrough.
|
|
56
|
+
*/
|
|
57
|
+
private _addBasicStylesAutoformats;
|
|
58
|
+
/**
|
|
59
|
+
* Adds autoformatting related to {@link module:heading/heading~Heading}.
|
|
60
|
+
*
|
|
61
|
+
* It is using a number at the end of the command name to associate it with the proper trigger:
|
|
62
|
+
*
|
|
63
|
+
* * `heading` with a `heading1` value will be executed when typing `#`,
|
|
64
|
+
* * `heading` with a `heading2` value will be executed when typing `##`,
|
|
65
|
+
* * ... up to `heading6` for `######`.
|
|
66
|
+
*/
|
|
67
|
+
private _addHeadingAutoformats;
|
|
68
|
+
/**
|
|
69
|
+
* Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.
|
|
70
|
+
*
|
|
71
|
+
* When typed:
|
|
72
|
+
* * `> ` – A paragraph will be changed to a block quote.
|
|
73
|
+
*/
|
|
74
|
+
private _addBlockQuoteAutoformats;
|
|
75
|
+
/**
|
|
76
|
+
* Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.
|
|
77
|
+
*
|
|
78
|
+
* When typed:
|
|
79
|
+
* - `` ``` `` – A paragraph will be changed to a code block.
|
|
80
|
+
*/
|
|
81
|
+
private _addCodeBlockAutoformats;
|
|
82
|
+
/**
|
|
83
|
+
* Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.
|
|
84
|
+
*
|
|
85
|
+
* When typed:
|
|
86
|
+
* - `` --- `` – Will be replaced with a horizontal line.
|
|
87
|
+
*/
|
|
88
|
+
private _addHorizontalLineAutoformats;
|
|
89
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
import type Autoformat from './autoformat.js';
|
|
11
|
+
/**
|
|
12
|
+
* The block autoformatting engine. It allows to format various block patterns. For example,
|
|
13
|
+
* it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.
|
|
14
|
+
*
|
|
15
|
+
* The autoformatting operation is integrated with the undo manager,
|
|
16
|
+
* so the autoformatting step can be undone if the user's intention was not to format the text.
|
|
17
|
+
*
|
|
18
|
+
* See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation
|
|
19
|
+
* to learn how to create custom block autoformatters. You can also use
|
|
20
|
+
* the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
|
|
21
|
+
* (lists, headings, bold and italic).
|
|
22
|
+
*
|
|
23
|
+
* @module autoformat/blockautoformatediting
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.
|
|
27
|
+
* Calls the callback when inserted text matches the regular expression or the command name
|
|
28
|
+
* if provided instead of the callback.
|
|
29
|
+
*
|
|
30
|
+
* Examples of usage:
|
|
31
|
+
*
|
|
32
|
+
* To convert a paragraph into heading 1 when `- ` is typed, using just the command name:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* blockAutoformatEditing( editor, plugin, /^\- $/, 'heading1' );
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* To convert a paragraph into heading 1 when `- ` is typed, using just the callback:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* blockAutoformatEditing( editor, plugin, /^\- $/, ( context ) => {
|
|
42
|
+
* const { match } = context;
|
|
43
|
+
* const headingLevel = match[ 1 ].length;
|
|
44
|
+
*
|
|
45
|
+
* editor.execute( 'heading', {
|
|
46
|
+
* formatId: `heading${ headingLevel }`
|
|
47
|
+
* } );
|
|
48
|
+
* } );
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param editor The editor instance.
|
|
52
|
+
* @param plugin The autoformat plugin instance.
|
|
53
|
+
* @param pattern The regular expression to execute on just inserted text. The regular expression is tested against the text
|
|
54
|
+
* from the beginning until the caret position.
|
|
55
|
+
* @param callbackOrCommand The callback to execute or the command to run when the text is matched.
|
|
56
|
+
* In case of providing the callback, it receives the following parameter:
|
|
57
|
+
* * match RegExp.exec() result of matching the pattern to inserted text.
|
|
58
|
+
*/
|
|
59
|
+
export default function blockAutoformatEditing(editor: Editor, plugin: Autoformat, pattern: RegExp, callbackOrCommand: string | ((context: {
|
|
60
|
+
match: RegExpExecArray;
|
|
61
|
+
}) => unknown)): void;
|
package/dist/index.css
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module autoformat
|
|
11
|
+
*/
|
|
12
|
+
export { default as Autoformat } from './autoformat.js';
|
|
13
|
+
export { default as blockAutoformatEditing } from './blockautoformatediting.js';
|
|
14
|
+
export { default as inlineAutoformatEditing } from './inlineautoformatediting.js';
|
|
15
|
+
import './augmentation.js';
|