@ckeditor/ckeditor5-alignment 34.2.0 → 35.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/CHANGELOG.md +162 -0
- package/build/alignment.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/ms.js +1 -0
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -0
- package/lang/translations/ar.po +1 -1
- package/lang/translations/bg.po +41 -0
- package/lang/translations/bn.po +41 -0
- package/lang/translations/ca.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/ms.po +41 -0
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +41 -0
- package/package.json +15 -14
- package/src/alignmentui.js +7 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Changelog
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
|
5
|
+
|
|
6
|
+
Changes for the past releases are available below.
|
|
7
|
+
|
|
8
|
+
## [19.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v18.0.0...v19.0.0) (2020-04-29)
|
|
9
|
+
|
|
10
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [18.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v17.0.0...v18.0.0) (2020-03-19)
|
|
14
|
+
|
|
15
|
+
### Other changes
|
|
16
|
+
|
|
17
|
+
* Updated translations. ([f1beaaa](https://github.com/ckeditor/ckeditor5-alignment/commit/f1beaaa))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [17.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v16.0.0...v17.0.0) (2020-02-18)
|
|
21
|
+
|
|
22
|
+
### MAJOR BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* The `align-left`, `align-right`, `align-center`, and `align-justify` icons have been moved to `@ckeditor/ckeditor5-core`.
|
|
25
|
+
|
|
26
|
+
### Other changes
|
|
27
|
+
|
|
28
|
+
* Moved alignment icons to `@ckeditor/ckeditor5-core` (see [ckeditor/ckeditor5-table#227](https://github.com/ckeditor/ckeditor5-table/issues/227)). ([410e279](https://github.com/ckeditor/ckeditor5-alignment/commit/410e279))
|
|
29
|
+
* Updated translations. ([288672f](https://github.com/ckeditor/ckeditor5-alignment/commit/288672f))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## [16.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v15.0.0...v16.0.0) (2019-12-04)
|
|
33
|
+
|
|
34
|
+
### Other changes
|
|
35
|
+
|
|
36
|
+
* Updated translations. ([9085f7b](https://github.com/ckeditor/ckeditor5-alignment/commit/9085f7b))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [15.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.2.0...v15.0.0) (2019-10-23)
|
|
40
|
+
|
|
41
|
+
### Other changes
|
|
42
|
+
|
|
43
|
+
* Updated translations. ([a719974](https://github.com/ckeditor/ckeditor5-alignment/commit/a719974)) ([2fed077](https://github.com/ckeditor/ckeditor5-alignment/commit/2fed077))
|
|
44
|
+
* Added `pluginName` to the editor plugin part of the feature. ([3b42798](https://github.com/ckeditor/ckeditor5-alignment/commit/3b42798))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [11.2.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.1.3...v11.2.0) (2019-08-26)
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* Integrated the text alignment feature with different editor content directions (LTR and RTL). See [ckeditor/ckeditor5#1151](https://github.com/ckeditor/ckeditor5/issues/1151). ([edc7d8b](https://github.com/ckeditor/ckeditor5-alignment/commit/edc7d8b))
|
|
52
|
+
|
|
53
|
+
### Bug fixes
|
|
54
|
+
|
|
55
|
+
* The UI buttons should be marked as toggleable for better assistive technologies support (see [ckeditor/ckeditor5#1403](https://github.com/ckeditor/ckeditor5/issues/1403)). ([599ea01](https://github.com/ckeditor/ckeditor5-alignment/commit/599ea01))
|
|
56
|
+
|
|
57
|
+
### Other changes
|
|
58
|
+
|
|
59
|
+
* The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([54f81b3](https://github.com/ckeditor/ckeditor5-alignment/commit/54f81b3))
|
|
60
|
+
* The text alignment toolbar should have a proper `aria-label` attribute (see [ckeditor/ckeditor5#1404](https://github.com/ckeditor/ckeditor5/issues/1404)). ([3ed81de](https://github.com/ckeditor/ckeditor5-alignment/commit/3ed81de))
|
|
61
|
+
* Updated translations. ([feb4ab3](https://github.com/ckeditor/ckeditor5-alignment/commit/feb4ab3))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## [11.1.3](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.1.2...v11.1.3) (2019-07-10)
|
|
65
|
+
|
|
66
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## [11.1.2](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.1.1...v11.1.2) (2019-07-04)
|
|
70
|
+
|
|
71
|
+
### Other changes
|
|
72
|
+
|
|
73
|
+
* Updated translations. ([bb7f494](https://github.com/ckeditor/ckeditor5-alignment/commit/bb7f494))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## [11.1.1](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.1.0...v11.1.1) (2019-06-05)
|
|
77
|
+
|
|
78
|
+
### Other changes
|
|
79
|
+
|
|
80
|
+
* Updated translations. ([32c32c1](https://github.com/ckeditor/ckeditor5-alignment/commit/32c32c1))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## [11.1.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v11.0.0...v11.1.0) (2019-04-10)
|
|
84
|
+
|
|
85
|
+
### Features
|
|
86
|
+
|
|
87
|
+
* Marked alignment as a formatting attribute using the `AttributeProperties#isFormatting` property. Closes [ckeditor/ckeditor5#1664](https://github.com/ckeditor/ckeditor5/issues/1664). ([6358e08](https://github.com/ckeditor/ckeditor5-alignment/commit/6358e08))
|
|
88
|
+
|
|
89
|
+
### Other changes
|
|
90
|
+
|
|
91
|
+
* Updated translations. ([78bfc40](https://github.com/ckeditor/ckeditor5-alignment/commit/78bfc40))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [11.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v10.0.4...v11.0.0) (2019-02-28)
|
|
95
|
+
|
|
96
|
+
### Other changes
|
|
97
|
+
|
|
98
|
+
* Updated translations. ([45e8dd5](https://github.com/ckeditor/ckeditor5-alignment/commit/45e8dd5)) ([a92c37b](https://github.com/ckeditor/ckeditor5-alignment/commit/a92c37b)) ([ef68e54](https://github.com/ckeditor/ckeditor5-alignment/commit/ef68e54))
|
|
99
|
+
|
|
100
|
+
### BREAKING CHANGES
|
|
101
|
+
|
|
102
|
+
* Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## [10.0.4](https://github.com/ckeditor/ckeditor5-alignment/compare/v10.0.3...v10.0.4) (2018-12-05)
|
|
106
|
+
|
|
107
|
+
### Other changes
|
|
108
|
+
|
|
109
|
+
* Improved SVG icons size. See [ckeditor/ckeditor5-theme-lark#206](https://github.com/ckeditor/ckeditor5-theme-lark/issues/206). ([1d71d33](https://github.com/ckeditor/ckeditor5-alignment/commit/1d71d33))
|
|
110
|
+
* Updated translations. ([547f8d8](https://github.com/ckeditor/ckeditor5-alignment/commit/547f8d8)) ([43d8225](https://github.com/ckeditor/ckeditor5-alignment/commit/43d8225))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## [10.0.3](https://github.com/ckeditor/ckeditor5-alignment/compare/v10.0.2...v10.0.3) (2018-10-08)
|
|
114
|
+
|
|
115
|
+
### Other changes
|
|
116
|
+
|
|
117
|
+
* Updated translations. ([5b30202](https://github.com/ckeditor/ckeditor5-alignment/commit/5b30202))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## [10.0.2](https://github.com/ckeditor/ckeditor5-alignment/compare/v10.0.1...v10.0.2) (2018-07-18)
|
|
121
|
+
|
|
122
|
+
### Other changes
|
|
123
|
+
|
|
124
|
+
* Updated translations. ([33c281c](https://github.com/ckeditor/ckeditor5-alignment/commit/33c281c))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## [10.0.1](https://github.com/ckeditor/ckeditor5-alignment/compare/v10.0.0...v10.0.1) (2018-06-21)
|
|
128
|
+
|
|
129
|
+
### Other changes
|
|
130
|
+
|
|
131
|
+
* Updated translations.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## [10.0.0](https://github.com/ckeditor/ckeditor5-alignment/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
|
|
135
|
+
|
|
136
|
+
### Other changes
|
|
137
|
+
|
|
138
|
+
* Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([eed1029](https://github.com/ckeditor/ckeditor5-alignment/commit/eed1029))
|
|
139
|
+
* Updated translations. ([baa1fbe](https://github.com/ckeditor/ckeditor5-alignment/commit/baa1fbe))
|
|
140
|
+
|
|
141
|
+
### BREAKING CHANGES
|
|
142
|
+
|
|
143
|
+
* The license under which CKEditor 5 is released has been changed from a triple GPL, LGPL and MPL license to a GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991) for more information.
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-alignment/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
|
|
147
|
+
|
|
148
|
+
### Other changes
|
|
149
|
+
|
|
150
|
+
* Updated translations. ([586ae62](https://github.com/ckeditor/ckeditor5-alignment/commit/586ae62))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-alignment/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
|
|
154
|
+
|
|
155
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-alignment/compare/v0.0.1...v1.0.0-beta.1) (2018-03-15)
|
|
159
|
+
|
|
160
|
+
### Features
|
|
161
|
+
|
|
162
|
+
* Initial implementation. Closes [#2](https://github.com/ckeditor/ckeditor5-alignment/issues/2).
|
package/build/alignment.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* @license Copyright (c) 2003-2022, 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")},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(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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 i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>f,AlignmentEditing:()=>g,AlignmentUI:()=>d});var t=n(704),e=n(209);const o=["left","right","center","justify"];function r(t){return o.includes(t)}function a(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function s(t){const n=t.map((t=>{let e;return e="string"==typeof t?{name:t}:t,e})).filter((t=>{const n=!!o.includes(t.name);return n||(0,e.logWarning)("alignment-config-name-not-recognized",{option:t}),n})),i=n.filter((t=>!!t.className)).length;if(i&&i<n.length)throw new e.CKEditorError("alignment-config-classnames-are-missing",{configuredOptions:t});return n.forEach(((n,i,o)=>{const r=o.slice(i+1);if(r.some((t=>t.name==n.name)))throw new e.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:t});if(n.className){if(r.some((t=>t.className==n.className)))throw new e.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:t})}})),n}const l="alignment";class c extends t.Command{refresh(){const t=this.editor.locale,n=(0,e.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!n&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,o=i.document,r=t.value;i.change((t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter((t=>this._canBeAligned(t))),i=e[0].getAttribute("alignment");a(r,n)||i===r||!r?function(t,e){for(const n of t)e.removeAttribute(l,n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute(l,n,i)}(e,t,r)}))}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,l)}}class g extends t.Plugin{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...o.map((t=>({name:t})))]})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=s(t.config.get("alignment.options")).filter((t=>r(t.name)&&!a(t.name,e))),o=i.some((t=>!!t.className));n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const n of t)e.view[n.name]={key:"class",value:n.className};return e}(i)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const{name:n}of t)e.view[n]={key:"style",value:{"text-align":n}};return e}(i));const l=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}(i);for(const e of l)t.conversion.for("upcast").attributeToAttribute(e);const g=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}(i);for(const e of g)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new c(t))}}var u=n(273);const m=new Map([["left",t.icons.alignLeft],["right",t.icons.alignRight],["center",t.icons.alignCenter],["justify",t.icons.alignJustify]]);class d extends t.Plugin{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=s(t.config.get("alignment.options"));i.map((t=>t.name)).filter(r).forEach((t=>this._addButton(t))),e.add("alignment",(
|
|
5
|
+
*/(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.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(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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 i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>f,AlignmentEditing:()=>g,AlignmentUI:()=>d});var t=n(704),e=n(209);const o=["left","right","center","justify"];function r(t){return o.includes(t)}function a(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function s(t){const n=t.map((t=>{let e;return e="string"==typeof t?{name:t}:t,e})).filter((t=>{const n=!!o.includes(t.name);return n||(0,e.logWarning)("alignment-config-name-not-recognized",{option:t}),n})),i=n.filter((t=>!!t.className)).length;if(i&&i<n.length)throw new e.CKEditorError("alignment-config-classnames-are-missing",{configuredOptions:t});return n.forEach(((n,i,o)=>{const r=o.slice(i+1);if(r.some((t=>t.name==n.name)))throw new e.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:t});if(n.className){if(r.some((t=>t.className==n.className)))throw new e.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:t})}})),n}const l="alignment";class c extends t.Command{refresh(){const t=this.editor.locale,n=(0,e.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!n&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,o=i.document,r=t.value;i.change((t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter((t=>this._canBeAligned(t))),i=e[0].getAttribute("alignment");a(r,n)||i===r||!r?function(t,e){for(const n of t)e.removeAttribute(l,n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute(l,n,i)}(e,t,r)}))}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,l)}}class g extends t.Plugin{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...o.map((t=>({name:t})))]})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=s(t.config.get("alignment.options")).filter((t=>r(t.name)&&!a(t.name,e))),o=i.some((t=>!!t.className));n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const n of t)e.view[n.name]={key:"class",value:n.className};return e}(i)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const{name:n}of t)e.view[n]={key:"style",value:{"text-align":n}};return e}(i));const l=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}(i);for(const e of l)t.conversion.for("upcast").attributeToAttribute(e);const g=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}(i);for(const e of g)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new c(t))}}var u=n(273);const m=new Map([["left",t.icons.alignLeft],["right",t.icons.alignRight],["center",t.icons.alignCenter],["justify",t.icons.alignJustify]]);class d extends t.Plugin{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=s(t.config.get("alignment.options"));i.map((t=>t.name)).filter(r).forEach((t=>this._addButton(t))),e.add("alignment",(o=>{const r=(0,u.createDropdown)(o),a=i.map((t=>e.create(`alignment:${t.name}`)));(0,u.addToolbarToDropdown)(r,a,{enableActiveItemFocusOnDropdownOpen:!0}),r.buttonView.set({label:n("Text alignment"),tooltip:!0}),r.toolbarView.isVertical=!0,r.toolbarView.ariaLabel=n("Text alignment toolbar"),r.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===o.contentLanguageDirection?m.get("right"):m.get("left");return r.buttonView.bind("icon").toMany(a,"isOn",((...t)=>{const e=t.findIndex((t=>t));return e<0?s:a[e].icon})),r.bind("isEnabled").toMany(a,"isEnabled",((...t)=>t.some((t=>t)))),this.listenTo(r,"execute",(()=>{t.editing.view.focus()})),r}))}_addButton(t){const e=this.editor;e.ui.componentFactory.add(`alignment:${t}`,(n=>{const i=e.commands.get("alignment"),o=new u.ButtonView(n);return o.set({label:this.localizedOptionTitles[t],icon:m.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",(e=>e===t)),this.listenTo(o,"execute",(()=>{e.execute("alignment",{value:t}),e.editing.view.focus()})),o}))}}class f extends t.Plugin{static get requires(){return[g,d]}static get pluginName(){return"Alignment"}}})(),(window.CKEditor5=window.CKEditor5||{}).alignment=i})();
|
package/build/translations/ar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(n){const i=n.ar=n.ar||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"محاذاة في المنتصف","Align left":"محاذاة لليسار","Align right":"محاذاة لليمين",Justify:"ضبط","Text alignment":"محاذاة النص","Text alignment toolbar":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
1
|
+
!function(n){const i=n.ar=n.ar||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"محاذاة في المنتصف","Align left":"محاذاة لليسار","Align right":"محاذاة لليمين",Justify:"ضبط","Text alignment":"محاذاة النص","Text alignment toolbar":"شريط أدوات محاذاة النص"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const i=n.bg=n.bg||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"Централно подравняване","Align left":"Ляво подравняване","Align right":"Дясно подравняване",Justify:"Разпредели по равно","Text alignment":"Подравняване на текста","Text alignment toolbar":"Лента за подравняване на текст"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const i=n.bn=n.bn||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"কেন্দ্র সারিবদ্ধ করুন","Align left":"বামে সারিবদ্ধ করুন","Align right":"ডানদিকে সারিবদ্ধ করুন",Justify:"জাস্টিফাই","Text alignment":"টেক্সট সারিবদ্ধকরণ","Text alignment toolbar":"টেক্সট শ্রেণীবিন্যাস টুলবার"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/build/translations/ca.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(i){const
|
|
1
|
+
!function(i){const e=i.ca=i.ca||{};e.dictionary=Object.assign(e.dictionary||{},{"Align center":"Alineació centre","Align left":"Alineació esquerra","Align right":"Alineació dreta",Justify:"Justificar","Text alignment":"Alineació text","Text alignment toolbar":"Barra d'eines d'alineació de text"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/build/translations/fi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(a){const i=a.fi=a.fi||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"Tasaa keskelle","Align left":"Tasaa vasemmalle","Align right":"Tasaa oikealle",Justify:"Tasaa molemmat reunat","Text alignment":"Tekstin tasaus","Text alignment toolbar":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
1
|
+
!function(a){const i=a.fi=a.fi||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"Tasaa keskelle","Align left":"Tasaa vasemmalle","Align right":"Tasaa oikealle",Justify:"Tasaa molemmat reunat","Text alignment":"Tekstin tasaus","Text alignment toolbar":"Tekstin suuntauksen työkalupalkki"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/build/translations/lt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(i){const t=i.lt=i.lt||{};t.dictionary=Object.assign(t.dictionary||{},{"Align center":"Centruoti","Align left":"Lygiuoti į kairę","Align right":"Lygiuoti į dešinę",Justify:"Lygiuoti per visą plotį","Text alignment":"Teksto lygiavimas","Text alignment toolbar":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
1
|
+
!function(i){const t=i.lt=i.lt||{};t.dictionary=Object.assign(t.dictionary||{},{"Align center":"Centruoti","Align left":"Lygiuoti į kairę","Align right":"Lygiuoti į dešinę",Justify:"Lygiuoti per visą plotį","Text alignment":"Teksto lygiavimas","Text alignment toolbar":"Teksto lygiavimo įrankių juosta"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(a){const n=a.ms=a.ms||{};n.dictionary=Object.assign(n.dictionary||{},{"Align center":"Jajarkan tengah","Align left":"Jajarkan kiri","Align right":"Jajarkan kiri",Justify:"Imbang","Text alignment":"Jajaran teks","Text alignment toolbar":"Bar alat capaian jajaran teks"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/build/translations/sv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){const
|
|
1
|
+
!function(t){const e=t.sv=t.sv||{};e.dictionary=Object.assign(e.dictionary||{},{"Align center":"Centrera","Align left":"Vänsterjustera","Align right":"Högerjustera",Justify:"Justera till marginaler","Text alignment":"Textjustering","Text alignment toolbar":"Verktygsfält för textjustering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){const t=n.th=n.th||{};t.dictionary=Object.assign(t.dictionary||{},{"Align center":"จัดกึ่งกลาง","Align left":"จัดชิดซ้าย","Align right":"จัดชิดขวา",Justify:"จัด(ขอบ)","Text alignment":"จัดตำแหน่งข้อความ","Text alignment toolbar":"แถบเครื่องมือจัดตำแหน่งข้อความ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/lang/translations/ar.po
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Bulgarian (https://www.transifex.com/ckeditor/teams/11143/bg/)\n"
|
|
16
|
+
"Language: bg\n"
|
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Toolbar button tooltip for aligning the text to the left."
|
|
20
|
+
msgid "Align left"
|
|
21
|
+
msgstr "Ляво подравняване"
|
|
22
|
+
|
|
23
|
+
msgctxt "Toolbar button tooltip for aligning the text to the right."
|
|
24
|
+
msgid "Align right"
|
|
25
|
+
msgstr "Дясно подравняване"
|
|
26
|
+
|
|
27
|
+
msgctxt "Toolbar button tooltip for aligning the text to center."
|
|
28
|
+
msgid "Align center"
|
|
29
|
+
msgstr "Централно подравняване"
|
|
30
|
+
|
|
31
|
+
msgctxt "Toolbar button tooltip for making the text justified."
|
|
32
|
+
msgid "Justify"
|
|
33
|
+
msgstr "Разпредели по равно"
|
|
34
|
+
|
|
35
|
+
msgctxt "Dropdown button tooltip for the text alignment feature."
|
|
36
|
+
msgid "Text alignment"
|
|
37
|
+
msgstr "Подравняване на текста"
|
|
38
|
+
|
|
39
|
+
msgctxt "Label used by assistive technologies describing the text alignment feature toolbar."
|
|
40
|
+
msgid "Text alignment toolbar"
|
|
41
|
+
msgstr "Лента за подравняване на текст"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Bengali (https://www.transifex.com/ckeditor/teams/11143/bn/)\n"
|
|
16
|
+
"Language: bn\n"
|
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Toolbar button tooltip for aligning the text to the left."
|
|
20
|
+
msgid "Align left"
|
|
21
|
+
msgstr "বামে সারিবদ্ধ করুন"
|
|
22
|
+
|
|
23
|
+
msgctxt "Toolbar button tooltip for aligning the text to the right."
|
|
24
|
+
msgid "Align right"
|
|
25
|
+
msgstr "ডানদিকে সারিবদ্ধ করুন"
|
|
26
|
+
|
|
27
|
+
msgctxt "Toolbar button tooltip for aligning the text to center."
|
|
28
|
+
msgid "Align center"
|
|
29
|
+
msgstr "কেন্দ্র সারিবদ্ধ করুন"
|
|
30
|
+
|
|
31
|
+
msgctxt "Toolbar button tooltip for making the text justified."
|
|
32
|
+
msgid "Justify"
|
|
33
|
+
msgstr "জাস্টিফাই"
|
|
34
|
+
|
|
35
|
+
msgctxt "Dropdown button tooltip for the text alignment feature."
|
|
36
|
+
msgid "Text alignment"
|
|
37
|
+
msgstr "টেক্সট সারিবদ্ধকরণ"
|
|
38
|
+
|
|
39
|
+
msgctxt "Label used by assistive technologies describing the text alignment feature toolbar."
|
|
40
|
+
msgid "Text alignment toolbar"
|
|
41
|
+
msgstr "টেক্সট শ্রেণীবিন্যাস টুলবার"
|
package/lang/translations/ca.po
CHANGED
package/lang/translations/fi.po
CHANGED
package/lang/translations/lt.po
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Malay (https://www.transifex.com/ckeditor/teams/11143/ms/)\n"
|
|
16
|
+
"Language: ms\n"
|
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Toolbar button tooltip for aligning the text to the left."
|
|
20
|
+
msgid "Align left"
|
|
21
|
+
msgstr "Jajarkan kiri"
|
|
22
|
+
|
|
23
|
+
msgctxt "Toolbar button tooltip for aligning the text to the right."
|
|
24
|
+
msgid "Align right"
|
|
25
|
+
msgstr "Jajarkan kiri"
|
|
26
|
+
|
|
27
|
+
msgctxt "Toolbar button tooltip for aligning the text to center."
|
|
28
|
+
msgid "Align center"
|
|
29
|
+
msgstr "Jajarkan tengah"
|
|
30
|
+
|
|
31
|
+
msgctxt "Toolbar button tooltip for making the text justified."
|
|
32
|
+
msgid "Justify"
|
|
33
|
+
msgstr "Imbang"
|
|
34
|
+
|
|
35
|
+
msgctxt "Dropdown button tooltip for the text alignment feature."
|
|
36
|
+
msgid "Text alignment"
|
|
37
|
+
msgstr "Jajaran teks"
|
|
38
|
+
|
|
39
|
+
msgctxt "Label used by assistive technologies describing the text alignment feature toolbar."
|
|
40
|
+
msgid "Text alignment toolbar"
|
|
41
|
+
msgstr "Bar alat capaian jajaran teks"
|
package/lang/translations/sv.po
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Thai (https://www.transifex.com/ckeditor/teams/11143/th/)\n"
|
|
16
|
+
"Language: th\n"
|
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Toolbar button tooltip for aligning the text to the left."
|
|
20
|
+
msgid "Align left"
|
|
21
|
+
msgstr "จัดชิดซ้าย"
|
|
22
|
+
|
|
23
|
+
msgctxt "Toolbar button tooltip for aligning the text to the right."
|
|
24
|
+
msgid "Align right"
|
|
25
|
+
msgstr "จัดชิดขวา"
|
|
26
|
+
|
|
27
|
+
msgctxt "Toolbar button tooltip for aligning the text to center."
|
|
28
|
+
msgid "Align center"
|
|
29
|
+
msgstr "จัดกึ่งกลาง"
|
|
30
|
+
|
|
31
|
+
msgctxt "Toolbar button tooltip for making the text justified."
|
|
32
|
+
msgid "Justify"
|
|
33
|
+
msgstr "จัด(ขอบ)"
|
|
34
|
+
|
|
35
|
+
msgctxt "Dropdown button tooltip for the text alignment feature."
|
|
36
|
+
msgid "Text alignment"
|
|
37
|
+
msgstr "จัดตำแหน่งข้อความ"
|
|
38
|
+
|
|
39
|
+
msgctxt "Label used by assistive technologies describing the text alignment feature toolbar."
|
|
40
|
+
msgid "Text alignment toolbar"
|
|
41
|
+
msgstr "แถบเครื่องมือจัดตำแหน่งข้อความ"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-alignment",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.0",
|
|
4
4
|
"description": "Text alignment feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "^
|
|
15
|
+
"ckeditor5": "^35.0.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@ckeditor/ckeditor5-block-quote": "^
|
|
19
|
-
"@ckeditor/ckeditor5-core": "^
|
|
18
|
+
"@ckeditor/ckeditor5-block-quote": "^35.0.0",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^35.0.0",
|
|
20
20
|
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
|
21
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
22
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
23
|
-
"@ckeditor/ckeditor5-enter": "^
|
|
24
|
-
"@ckeditor/ckeditor5-heading": "^
|
|
25
|
-
"@ckeditor/ckeditor5-image": "^
|
|
26
|
-
"@ckeditor/ckeditor5-list": "^
|
|
27
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
28
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
29
|
-
"@ckeditor/ckeditor5-typing": "^
|
|
21
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.0.0",
|
|
22
|
+
"@ckeditor/ckeditor5-engine": "^35.0.0",
|
|
23
|
+
"@ckeditor/ckeditor5-enter": "^35.0.0",
|
|
24
|
+
"@ckeditor/ckeditor5-heading": "^35.0.0",
|
|
25
|
+
"@ckeditor/ckeditor5-image": "^35.0.0",
|
|
26
|
+
"@ckeditor/ckeditor5-list": "^35.0.0",
|
|
27
|
+
"@ckeditor/ckeditor5-paragraph": "^35.0.0",
|
|
28
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.0.0",
|
|
29
|
+
"@ckeditor/ckeditor5-typing": "^35.0.0",
|
|
30
30
|
"webpack": "^5.58.1",
|
|
31
31
|
"webpack-cli": "^4.9.0"
|
|
32
32
|
},
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"src",
|
|
49
49
|
"theme",
|
|
50
50
|
"build",
|
|
51
|
-
"ckeditor5-metadata.json"
|
|
51
|
+
"ckeditor5-metadata.json",
|
|
52
|
+
"CHANGELOG.md"
|
|
52
53
|
],
|
|
53
54
|
"scripts": {
|
|
54
55
|
"dll:build": "webpack"
|
package/src/alignmentui.js
CHANGED
|
@@ -79,7 +79,7 @@ export default class AlignmentUI extends Plugin {
|
|
|
79
79
|
|
|
80
80
|
// Add existing alignment buttons to dropdown's toolbar.
|
|
81
81
|
const buttons = options.map( option => componentFactory.create( `alignment:${ option.name }` ) );
|
|
82
|
-
addToolbarToDropdown( dropdownView, buttons );
|
|
82
|
+
addToolbarToDropdown( dropdownView, buttons, { enableActiveItemFocusOnDropdownOpen: true } );
|
|
83
83
|
|
|
84
84
|
// Configure dropdown properties an behavior.
|
|
85
85
|
dropdownView.buttonView.set( {
|
|
@@ -116,6 +116,12 @@ export default class AlignmentUI extends Plugin {
|
|
|
116
116
|
// Enable button if any of the buttons is enabled.
|
|
117
117
|
dropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );
|
|
118
118
|
|
|
119
|
+
// Focus the editable after executing the command.
|
|
120
|
+
// Overrides a default behaviour where the focus is moved to the dropdown button (#12125).
|
|
121
|
+
this.listenTo( dropdownView, 'execute', () => {
|
|
122
|
+
editor.editing.view.focus();
|
|
123
|
+
} );
|
|
124
|
+
|
|
119
125
|
return dropdownView;
|
|
120
126
|
} );
|
|
121
127
|
}
|