@ckeditor/ckeditor5-indent 40.2.0 → 41.0.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/LICENSE.md +1 -1
- package/build/indent.js +2 -2
- package/ckeditor5-metadata.json +2 -2
- package/lang/translations/ar.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +3 -2
- package/src/augmentation.d.ts +2 -2
- package/src/augmentation.js +1 -1
- package/src/indent.d.ts +4 -4
- package/src/indent.js +4 -4
- package/src/indentblock.d.ts +2 -2
- package/src/indentblock.js +6 -6
- package/src/indentblockcommand.d.ts +3 -3
- package/src/indentblockcommand.js +5 -5
- package/src/indentcommandbehavior/indentbehavior.d.ts +1 -1
- package/src/indentcommandbehavior/indentbehavior.js +1 -1
- package/src/indentcommandbehavior/indentusingclasses.d.ts +2 -2
- package/src/indentcommandbehavior/indentusingclasses.js +1 -1
- package/src/indentcommandbehavior/indentusingoffset.d.ts +2 -2
- package/src/indentcommandbehavior/indentusingoffset.js +1 -1
- package/src/indentconfig.d.ts +1 -1
- package/src/indentconfig.js +1 -1
- package/src/indentediting.d.ts +2 -2
- package/src/indentediting.js +2 -2
- package/src/indentui.d.ts +2 -2
- package/src/indentui.js +5 -7
- package/src/index.d.ts +8 -8
- package/src/index.js +6 -6
- package/theme/icons/indent.svg +0 -1
- package/theme/icons/outdent.svg +0 -1
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 block indentation feature** – https://github.com/ckeditor/ckeditor5-indent <br>
|
|
5
|
-
Copyright (c) 2003–
|
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
6
|
|
|
7
7
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
|
8
8
|
|
package/build/indent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Decrease indent":"Decrease indent","Increase indent":"Increase indent"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
|
|
2
2
|
/*!
|
|
3
|
-
* @license Copyright (c) 2003-
|
|
3
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
|
-
*/(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},492:(t,e,n)=>{t.exports=n(79)("./src/engine.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s),n.d(s,{Indent:()=>
|
|
5
|
+
*/(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},492:(t,e,n)=>{t.exports=n(79)("./src/engine.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s),n.d(s,{Indent:()=>r,IndentBlock:()=>g,IndentEditing:()=>e,IndentUI:()=>o});var t=n(704);class e extends t.Plugin{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new t.MultiCommand(e)),e.commands.add("outdent",new t.MultiCommand(e))}}var i=n(273);class o extends t.Plugin{static get pluginName(){return"IndentUI"}init(){const e=this.editor,n=e.locale,s=e.t,i="ltr"==n.uiLanguageDirection?t.icons.indent:t.icons.outdent,o="ltr"==n.uiLanguageDirection?t.icons.outdent:t.icons.indent;this._defineButton("indent",s("Increase indent"),i),this._defineButton("outdent",s("Decrease indent"),o)}_defineButton(t,e,n){const s=this.editor;s.ui.componentFactory.add(t,(o=>{const r=s.commands.get(t),d=new i.ButtonView(o);return d.set({label:e,icon:n,tooltip:!0}),d.bind("isEnabled").to(r,"isEnabled"),this.listenTo(d,"execute",(()=>{s.execute(t),s.editing.view.focus()})),d}))}}class r extends t.Plugin{static get pluginName(){return"Indent"}static get requires(){return[e,o]}}var d=n(492),c=n(209);class a extends t.Command{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=(0,c.first)(t.document.selection.getSelectedBlocks());e&&this._isIndentationChangeAllowed(e)?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=this._getBlocksToChange();t.change((t=>{for(const n of e){const e=n.getAttribute("blockIndent"),s=this._indentBehavior.getNextIndent(e);s?t.setAttribute("blockIndent",s,n):t.removeAttribute("blockIndent",n)}}))}_getBlocksToChange(){const t=this.editor.model.document.selection;return Array.from(t.getSelectedBlocks()).filter((t=>this._isIndentationChangeAllowed(t)))}_isIndentationChangeAllowed(t){const e=this.editor;if(!e.model.schema.checkAttribute(t,"blockIndent"))return!1;if(!e.plugins.has("ListUtils"))return!0;if(!this._indentBehavior.isForward)return!0;return!e.plugins.get("ListUtils").isListItemBlock(t)}}class l{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||"0");return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||"0");if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class u{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e<this.classes.length-1:e>=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const h=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class g extends t.Plugin{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock");e.classes&&e.classes.length?(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new a(t,new u({direction:"forward",classes:e.classes}))),t.commands.add("outdentBlock",new a(t,new u({direction:"backward",classes:e.classes})))):(t.data.addStyleProcessorRules(d.addMarginRules),this._setupConversionUsingOffset(),t.commands.add("indentBlock",new a(t,new l({direction:"forward",offset:e.offset,unit:e.unit}))),t.commands.add("outdentBlock",new a(t,new l({direction:"backward",offset:e.offset,unit:e.unit}))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),s=t.commands.get("outdent"),i=t.config.get("heading.options");(i&&i.map((t=>t.model))||h).forEach((t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})})),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),s.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>{if(!t.is("element","li"))return t.getStyle(e)}}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}})(),(window.CKEditor5=window.CKEditor5||{}).indent=s})();
|
package/ckeditor5-metadata.json
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
{
|
|
11
11
|
"type": "Button",
|
|
12
12
|
"name": "indent",
|
|
13
|
-
"iconPath": "theme/icons/indent.svg"
|
|
13
|
+
"iconPath": "@ckeditor/ckeditor5-core/theme/icons/indent.svg"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "Button",
|
|
17
17
|
"name": "outdent",
|
|
18
|
-
"iconPath": "theme/icons/outdent.svg"
|
|
18
|
+
"iconPath": "@ckeditor/ckeditor5-core/theme/icons/outdent.svg"
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
},
|
package/lang/translations/ar.po
CHANGED
package/lang/translations/az.po
CHANGED
package/lang/translations/bg.po
CHANGED
package/lang/translations/bn.po
CHANGED
package/lang/translations/ca.po
CHANGED
package/lang/translations/cs.po
CHANGED
package/lang/translations/da.po
CHANGED
package/lang/translations/de.po
CHANGED
package/lang/translations/el.po
CHANGED
package/lang/translations/en.po
CHANGED
package/lang/translations/es.po
CHANGED
package/lang/translations/et.po
CHANGED
package/lang/translations/fa.po
CHANGED
package/lang/translations/fi.po
CHANGED
package/lang/translations/fr.po
CHANGED
package/lang/translations/gl.po
CHANGED
package/lang/translations/he.po
CHANGED
package/lang/translations/hi.po
CHANGED
package/lang/translations/hr.po
CHANGED
package/lang/translations/hu.po
CHANGED
package/lang/translations/id.po
CHANGED
package/lang/translations/it.po
CHANGED
package/lang/translations/ja.po
CHANGED
package/lang/translations/ko.po
CHANGED
package/lang/translations/ku.po
CHANGED
package/lang/translations/lt.po
CHANGED
package/lang/translations/lv.po
CHANGED
package/lang/translations/ms.po
CHANGED
package/lang/translations/ne.po
CHANGED
package/lang/translations/nl.po
CHANGED
package/lang/translations/no.po
CHANGED
package/lang/translations/pl.po
CHANGED
package/lang/translations/pt.po
CHANGED
package/lang/translations/ro.po
CHANGED
package/lang/translations/ru.po
CHANGED
package/lang/translations/sk.po
CHANGED
package/lang/translations/sr.po
CHANGED
package/lang/translations/sv.po
CHANGED
package/lang/translations/th.po
CHANGED
package/lang/translations/tk.po
CHANGED
package/lang/translations/tr.po
CHANGED
package/lang/translations/ug.po
CHANGED
package/lang/translations/uk.po
CHANGED
package/lang/translations/ur.po
CHANGED
package/lang/translations/uz.po
CHANGED
package/lang/translations/vi.po
CHANGED
package/lang/translations/zh.po
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-indent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "41.0.0",
|
|
4
4
|
"description": "Block indentation feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"ckeditor5-plugin",
|
|
11
11
|
"ckeditor5-dll"
|
|
12
12
|
],
|
|
13
|
+
"type": "module",
|
|
13
14
|
"main": "src/index.js",
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "
|
|
16
|
+
"ckeditor5": "41.0.0"
|
|
16
17
|
},
|
|
17
18
|
"author": "CKSource (http://cksource.com/)",
|
|
18
19
|
"license": "GPL-2.0-or-later",
|
package/src/augmentation.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand } from './index';
|
|
5
|
+
import type { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand } from './index.js';
|
|
6
6
|
declare module '@ckeditor/ckeditor5-core' {
|
|
7
7
|
interface EditorConfig {
|
|
8
8
|
/**
|
package/src/augmentation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
package/src/indent.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indent
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import IndentEditing from './indentediting';
|
|
10
|
-
import IndentUI from './indentui';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import IndentEditing from './indentediting.js';
|
|
10
|
+
import IndentUI from './indentui.js';
|
|
11
11
|
/**
|
|
12
12
|
* The indent feature.
|
|
13
13
|
*
|
package/src/indent.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indent
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import IndentEditing from './indentediting';
|
|
10
|
-
import IndentUI from './indentui';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import IndentEditing from './indentediting.js';
|
|
10
|
+
import IndentUI from './indentui.js';
|
|
11
11
|
/**
|
|
12
12
|
* The indent feature.
|
|
13
13
|
*
|
package/src/indentblock.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentblock
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
9
|
/**
|
|
10
10
|
* The block indentation feature.
|
|
11
11
|
*
|
package/src/indentblock.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentblock
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { addMarginRules } from 'ckeditor5/src/engine';
|
|
10
|
-
import IndentBlockCommand from './indentblockcommand';
|
|
11
|
-
import IndentUsingOffset from './indentcommandbehavior/indentusingoffset';
|
|
12
|
-
import IndentUsingClasses from './indentcommandbehavior/indentusingclasses';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { addMarginRules } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import IndentBlockCommand from './indentblockcommand.js';
|
|
11
|
+
import IndentUsingOffset from './indentcommandbehavior/indentusingoffset.js';
|
|
12
|
+
import IndentUsingClasses from './indentcommandbehavior/indentusingclasses.js';
|
|
13
13
|
const DEFAULT_ELEMENTS = ['paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6'];
|
|
14
14
|
/**
|
|
15
15
|
* The block indentation feature.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentblockcommand
|
|
7
7
|
*/
|
|
8
|
-
import { Command, type Editor } from 'ckeditor5/src/core';
|
|
9
|
-
import type { IndentBehavior } from './indentcommandbehavior/indentbehavior';
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { IndentBehavior } from './indentcommandbehavior/indentbehavior.js';
|
|
10
10
|
/**
|
|
11
11
|
* The indent block command.
|
|
12
12
|
*
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentblockcommand
|
|
7
7
|
*/
|
|
8
|
-
import { Command } from 'ckeditor5/src/core';
|
|
9
|
-
import { first } from 'ckeditor5/src/utils';
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { first } from 'ckeditor5/src/utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* The indent block command.
|
|
12
12
|
*
|
|
@@ -85,14 +85,14 @@ export default class IndentBlockCommand extends Command {
|
|
|
85
85
|
if (!editor.model.schema.checkAttribute(element, 'blockIndent')) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
|
-
if (!editor.plugins.has('
|
|
88
|
+
if (!editor.plugins.has('ListUtils')) {
|
|
89
89
|
return true;
|
|
90
90
|
}
|
|
91
91
|
// Only forward indentation is disallowed in list items. This allows the user to outdent blocks that are already indented.
|
|
92
92
|
if (!this._indentBehavior.isForward) {
|
|
93
93
|
return true;
|
|
94
94
|
}
|
|
95
|
-
const documentListUtils = editor.plugins.get('
|
|
95
|
+
const documentListUtils = editor.plugins.get('ListUtils');
|
|
96
96
|
return !documentListUtils.isListItemBlock(element);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentcommandbehavior/indentusingclasses
|
|
7
7
|
*/
|
|
8
|
-
import type { IndentBehavior } from './indentbehavior';
|
|
8
|
+
import type { IndentBehavior } from './indentbehavior.js';
|
|
9
9
|
/**
|
|
10
10
|
* The block indentation behavior that uses classes to set indentation.
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentcommandbehavior/indentusingoffset
|
|
7
7
|
*/
|
|
8
|
-
import type { IndentBehavior } from './indentbehavior';
|
|
8
|
+
import type { IndentBehavior } from './indentbehavior.js';
|
|
9
9
|
/**
|
|
10
10
|
* The block indentation behavior that uses offsets to set indentation.
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/indentconfig.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/indentconfig.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
package/src/indentediting.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentediting
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
/**
|
|
10
10
|
* The indent editing feature.
|
|
11
11
|
*
|
package/src/indentediting.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentediting
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin, MultiCommand } from 'ckeditor5/src/core';
|
|
8
|
+
import { Plugin, MultiCommand } from 'ckeditor5/src/core.js';
|
|
9
9
|
/**
|
|
10
10
|
* The indent editing feature.
|
|
11
11
|
*
|
package/src/indentui.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
6
|
/**
|
|
7
7
|
* The indent UI feature.
|
|
8
8
|
*
|
package/src/indentui.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent/indentui
|
|
7
7
|
*/
|
|
8
|
-
import { ButtonView } from 'ckeditor5/src/ui';
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
-
import indentIcon from '../theme/icons/indent.svg';
|
|
11
|
-
import outdentIcon from '../theme/icons/outdent.svg';
|
|
8
|
+
import { ButtonView } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { icons, Plugin } from 'ckeditor5/src/core.js';
|
|
12
10
|
/**
|
|
13
11
|
* The indent UI feature.
|
|
14
12
|
*
|
|
@@ -31,8 +29,8 @@ export default class IndentUI extends Plugin {
|
|
|
31
29
|
const editor = this.editor;
|
|
32
30
|
const locale = editor.locale;
|
|
33
31
|
const t = editor.t;
|
|
34
|
-
const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ?
|
|
35
|
-
const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ?
|
|
32
|
+
const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? icons.indent : icons.outdent;
|
|
33
|
+
const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? icons.outdent : icons.indent;
|
|
36
34
|
this._defineButton('indent', t('Increase indent'), localizedIndentIcon);
|
|
37
35
|
this._defineButton('outdent', t('Decrease indent'), localizedOutdentIcon);
|
|
38
36
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent
|
|
7
7
|
*/
|
|
8
|
-
export { default as Indent } from './indent';
|
|
9
|
-
export { default as IndentEditing } from './indentediting';
|
|
10
|
-
export { default as IndentUI } from './indentui';
|
|
11
|
-
export { default as IndentBlock } from './indentblock';
|
|
12
|
-
export type { IndentBlockConfig } from './indentconfig';
|
|
13
|
-
export type { default as IndentBlockCommand } from './indentblockcommand';
|
|
14
|
-
import './augmentation';
|
|
8
|
+
export { default as Indent } from './indent.js';
|
|
9
|
+
export { default as IndentEditing } from './indentediting.js';
|
|
10
|
+
export { default as IndentUI } from './indentui.js';
|
|
11
|
+
export { default as IndentBlock } from './indentblock.js';
|
|
12
|
+
export type { IndentBlockConfig } from './indentconfig.js';
|
|
13
|
+
export type { default as IndentBlockCommand } from './indentblockcommand.js';
|
|
14
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module indent
|
|
7
7
|
*/
|
|
8
|
-
export { default as Indent } from './indent';
|
|
9
|
-
export { default as IndentEditing } from './indentediting';
|
|
10
|
-
export { default as IndentUI } from './indentui';
|
|
11
|
-
export { default as IndentBlock } from './indentblock';
|
|
12
|
-
import './augmentation';
|
|
8
|
+
export { default as Indent } from './indent.js';
|
|
9
|
+
export { default as IndentEditing } from './indentediting.js';
|
|
10
|
+
export { default as IndentUI } from './indentui.js';
|
|
11
|
+
export { default as IndentBlock } from './indentblock.js';
|
|
12
|
+
import './augmentation.js';
|
package/theme/icons/indent.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>
|
package/theme/icons/outdent.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>
|