@ckeditor/ckeditor5-heading 42.0.2 → 43.0.0-alpha.1

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 CHANGED
@@ -1,267 +1,4 @@
1
1
  Changelog
2
2
  =========
3
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-heading/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
-
10
- Internal changes only (updated dependencies, documentation, etc.).
11
-
12
-
13
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v17.0.0...v18.0.0) (March 19, 2020)
14
-
15
- ### Other changes
16
-
17
- * Updated translations. ([99855b5](https://github.com/ckeditor/ckeditor5-heading/commit/99855b5))
18
-
19
-
20
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v16.0.0...v17.0.0) (February 19, 2020)
21
-
22
- ### Bug fixes
23
-
24
- * Focus the editor before executing toolbar buttons' command. See [ckeditor/ckeditor5#353](https://github.com/ckeditor/ckeditor5/issues/353). ([2495b81](https://github.com/ckeditor/ckeditor5-heading/commit/2495b81))
25
-
26
- ### Other changes
27
-
28
- * Updated translations. ([f947574](https://github.com/ckeditor/ckeditor5-heading/commit/f947574))
29
-
30
-
31
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v15.0.0...v16.0.0) (December 4, 2019)
32
-
33
- ### Other changes
34
-
35
- * Updated translations. ([bf98b57](https://github.com/ckeditor/ckeditor5-heading/commit/bf98b57))
36
-
37
-
38
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.5...v15.0.0) (October 23, 2019)
39
-
40
- ### Features
41
-
42
- * Introduced the document title feature. Closes https://github.com/ckeditor/ckeditor5/issues/2003. Closes https://github.com/ckeditor/ckeditor5/issues/2005. ([a65c0ac](https://github.com/ckeditor/ckeditor5-heading/commit/a65c0ac))
43
-
44
- ### Other changes
45
-
46
- * Added `pluginName` property to editing plugin. ([93e8727](https://github.com/ckeditor/ckeditor5-heading/commit/93e8727))
47
- * Updated translations. ([bcb9dbf](https://github.com/ckeditor/ckeditor5-heading/commit/bcb9dbf)) ([d3d7107](https://github.com/ckeditor/ckeditor5-heading/commit/d3d7107))
48
-
49
-
50
- ## [11.0.5](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.4...v11.0.5) (August 26, 2019)
51
-
52
- ### Bug fixes
53
-
54
- * The UI buttons should be marked as toggleable for better assistive technologies support (see [ckeditor/ckeditor5#1403](https://github.com/ckeditor/ckeditor5/issues/1403)). ([5c41c1a](https://github.com/ckeditor/ckeditor5-heading/commit/5c41c1a))
55
-
56
- ### Other changes
57
-
58
- * 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). ([1a68915](https://github.com/ckeditor/ckeditor5-heading/commit/1a68915))
59
- * Updated translations. ([201cf3c](https://github.com/ckeditor/ckeditor5-heading/commit/201cf3c))
60
-
61
-
62
- ## [11.0.4](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.3...v11.0.4) (July 10, 2019)
63
-
64
- Internal changes only (updated dependencies, documentation, etc.).
65
-
66
-
67
- ## [11.0.3](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.2...v11.0.3) (July 4, 2019)
68
-
69
- ### Other changes
70
-
71
- * Updated translations. ([7e9eb81](https://github.com/ckeditor/ckeditor5-heading/commit/7e9eb81)) ([8143e12](https://github.com/ckeditor/ckeditor5-heading/commit/8143e12))
72
-
73
-
74
- ## [11.0.2](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.1...v11.0.2) (June 6, 2019)
75
-
76
- ### Other changes
77
-
78
- * Updated translations. ([ab95f35](https://github.com/ckeditor/ckeditor5-heading/commit/ab95f35))
79
-
80
-
81
- ## [11.0.1](https://github.com/ckeditor/ckeditor5-heading/compare/v11.0.0...v11.0.1) (April 4, 2019)
82
-
83
- ### Other changes
84
-
85
- * Updated translations. ([e7273cc](https://github.com/ckeditor/ckeditor5-heading/commit/e7273cc))
86
-
87
-
88
- ## [11.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v10.1.1...v11.0.0) (February 28, 2019)
89
-
90
- ### Features
91
-
92
- * Provided translations and enabled the default icons to make `heading4`, `heading5`, and `heading6` button components usable (as provided by `HeadingButtonUI`). Closes [#121](https://github.com/ckeditor/ckeditor5-heading/issues/121). ([17bea3d](https://github.com/ckeditor/ckeditor5-heading/commit/17bea3d))
93
-
94
- ### Other changes
95
-
96
- * Updated translations. ([b64cedc](https://github.com/ckeditor/ckeditor5-heading/commit/b64cedc)) ([c28003e](https://github.com/ckeditor/ckeditor5-heading/commit/c28003e)) ([d801159](https://github.com/ckeditor/ckeditor5-heading/commit/d801159))
97
-
98
- ### BREAKING CHANGES
99
-
100
- * 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))
101
-
102
-
103
- ## [10.1.1](https://github.com/ckeditor/ckeditor5-heading/compare/v10.1.0...v10.1.1) (December 5, 2018)
104
-
105
- ### Other changes
106
-
107
- * Improved SVG icons size. See [ckeditor/ckeditor5-theme-lark#206](https://github.com/ckeditor/ckeditor5-theme-lark/issues/206). ([3362715](https://github.com/ckeditor/ckeditor5-heading/commit/3362715))
108
- * The `<h1>` elements are now converted to `<heading1>` elements instead of being converted to `<paragraph>`s by default. Closes [#98](https://github.com/ckeditor/ckeditor5-heading/issues/98). Closes [ckeditor/ckeditor5-paste-from-office#2](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/2). ([c49b573](https://github.com/ckeditor/ckeditor5-heading/commit/c49b573))
109
- * Updated translations. ([91778ab](https://github.com/ckeditor/ckeditor5-heading/commit/91778ab)) ([6435579](https://github.com/ckeditor/ckeditor5-heading/commit/6435579))
110
-
111
-
112
- ## [10.1.0](https://github.com/ckeditor/ckeditor5-heading/compare/v10.0.2...v10.1.0) (October 8, 2018)
113
-
114
- ### Features
115
-
116
- * Heading 4 to heading 6 icons were added. This allows configuring the editor to contain heading1-heading6 buttons in the toolbar. Closes [#112](https://github.com/ckeditor/ckeditor5-heading/issues/112). ([1116f69](https://github.com/ckeditor/ckeditor5-heading/commit/1116f69))
117
-
118
- ### Other changes
119
-
120
- * Updated translations. ([e3798e5](https://github.com/ckeditor/ckeditor5-heading/commit/e3798e5))
121
-
122
-
123
- ## [10.0.2](https://github.com/ckeditor/ckeditor5-heading/compare/v10.0.1...v10.0.2) (July 18, 2018)
124
-
125
- ### Other changes
126
-
127
- * Refreshed the heading icons (see [ckeditor/ckeditor5-ui#394](https://github.com/ckeditor/ckeditor5-ui/issues/394)). ([fb3f144](https://github.com/ckeditor/ckeditor5-heading/commit/fb3f144))
128
- * Updated translations. ([0867c51](https://github.com/ckeditor/ckeditor5-heading/commit/0867c51))
129
-
130
-
131
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-heading/compare/v10.0.0...v10.0.1) (June 21, 2018)
132
-
133
- ### Other changes
134
-
135
- * Updated translations.
136
-
137
-
138
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-heading/compare/v1.0.0-beta.4...v10.0.0) (April 25, 2018)
139
-
140
- ### Other changes
141
-
142
- * Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([5e02366](https://github.com/ckeditor/ckeditor5-heading/commit/5e02366))
143
- * Updated translations. ([d6a56d6](https://github.com/ckeditor/ckeditor5-heading/commit/d6a56d6))
144
-
145
- ### BREAKING CHANGES
146
-
147
- * The license under which CKEditor&nbsp;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.
148
-
149
-
150
- ## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-heading/compare/v1.0.0-beta.2...v1.0.0-beta.4) (April 19, 2018)
151
-
152
- ### Features
153
-
154
- * Introduced `HeadingButtonsUI` plugin. Closes [#104](https://github.com/ckeditor/ckeditor5-heading/issues/104). ([a39bac2](https://github.com/ckeditor/ckeditor5-heading/commit/a39bac2))
155
-
156
-
157
- ## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-heading/compare/v1.0.0-beta.1...v1.0.0-beta.2) (April 10, 2018)
158
-
159
- ### Other changes
160
-
161
- * Aligned `ElementDefinition` usage to the changes in the engine. See [ckeditor/ckeditor5#742](https://github.com/ckeditor/ckeditor5/issues/742). ([96d24f4](https://github.com/ckeditor/ckeditor5-heading/commit/96d24f4))
162
- * Increased the specificity of CSS rules. Introduced the `.ck` class for editor UI components (see: [ckeditor/ckeditor5#494](https://github.com/ckeditor/ckeditor5/issues/494)). ([915ec69](https://github.com/ckeditor/ckeditor5-heading/commit/915ec69))
163
-
164
- ### BREAKING CHANGES
165
-
166
- * In the custom format of the heading feature configuration the `view.style`, `view.class` and `view.attribute` properties are now called `view.styles`, `view.classes` and `view.attributes`.
167
-
168
-
169
- ## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-heading/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (March 15, 2018)
170
-
171
- ### Other changes
172
-
173
- * Aligned feature class naming to the new scheme. ([511a9d8](https://github.com/ckeditor/ckeditor5-heading/commit/511a9d8))
174
- * Migrated package styles to PostCSS. Moved visual styles to `@ckeditor/ckeditor5-theme-lark` (see [ckeditor/ckeditor5-ui#144](https://github.com/ckeditor/ckeditor5-ui/issues/144)). ([965179e](https://github.com/ckeditor/ckeditor5-heading/commit/965179e))
175
- * Updated naming of UI components & commands. ([72ee3d6](https://github.com/ckeditor/ckeditor5-heading/commit/72ee3d6))
176
-
177
- ### BREAKING CHANGES
178
-
179
- * Renamed the `'headings'` dropdown UI component to `'heading'`.
180
- * The `'heading1'`, `'heading2'` and `'heading3'` commands are no longer available. They were replaced by the `'heading'` command that accepts the heading model element name as a value.
181
- * The `HeadingCommand#value` is no longer a Boolean only. Now it stores the name of the heading model element when the selection is inside a heading.
182
- * The `HeadingCommand` constructor's second parameter is now an array of supported model elements.
183
-
184
-
185
- ## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-heading/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (November 14, 2017)
186
-
187
- ### Other changes
188
-
189
- * Updated translations. ([c3ad925](https://github.com/ckeditor/ckeditor5-heading/commit/c3ad925))
190
- * Aligned the UI library usage to the [changes in the UI framework](https://github.com/ckeditor/ckeditor5-ui/pull/332).
191
-
192
-
193
- ## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-heading/compare/v0.10.0...v1.0.0-alpha.1) (October 3, 2017)
194
-
195
- Internal changes only (updated dependencies, documentation, etc.).
196
-
197
-
198
- ## [0.10.0](https://github.com/ckeditor/ckeditor5-heading/compare/v0.9.1...v0.10.0) (September 3, 2017)
199
-
200
- ### Bug fixes
201
-
202
- * It should not be possible to apply a heading to an image. Closes [#73](https://github.com/ckeditor/ckeditor5-heading/issues/73). ([02f66a0](https://github.com/ckeditor/ckeditor5-heading/commit/02f66a0))
203
-
204
- ### Other changes
205
-
206
- * Aligned the implementation to the new Command API (see https://github.com/ckeditor/ckeditor5-core/issues/88). ([63b6c1c](https://github.com/ckeditor/ckeditor5-heading/commit/63b6c1c))
207
- * Heading dropdown items should never revert the state, apply only. Closes [#83](https://github.com/ckeditor/ckeditor5-heading/issues/83). ([3f25a21](https://github.com/ckeditor/ckeditor5-heading/commit/3f25a21))
208
- * Removed `HeadingCommand`'s properties which were exposed unnecessarily. Closes [#78](https://github.com/ckeditor/ckeditor5-heading/issues/78). ([c80e691](https://github.com/ckeditor/ckeditor5-heading/commit/c80e691))
209
-
210
- ### BREAKING CHANGES
211
-
212
- * The command API has been changed.
213
- * The `HeadingCommand` constructor's second parameter was changed from the `options` object to the `modelElement` alone.
214
-
215
- ### Note
216
-
217
- * The `HeadingOption` interface was moved to the `heading/heading` module.
218
-
219
-
220
- ## [0.9.1](https://github.com/ckeditor/ckeditor5-heading/compare/v0.9.0...v0.9.1) (May 7, 2017)
221
-
222
- ### Other changes
223
-
224
- * Updated translations. ([eaff2b3](https://github.com/ckeditor/ckeditor5-heading/commit/eaff2b3))
225
-
226
-
227
- ## [0.9.0](https://github.com/ckeditor/ckeditor5-heading/compare/v0.8.0...v0.9.0) (April 5, 2017)
228
-
229
- ### Bug fixes
230
-
231
- * Changed the default heading dropdown title to a more meaningful one. Closes [#68](https://github.com/ckeditor/ckeditor5-heading/issues/68). Closes [#62](https://github.com/ckeditor/ckeditor5-heading/issues/62). ([1c16e96](https://github.com/ckeditor/ckeditor5-heading/commit/1c16e96)) and ([e58dadc](https://github.com/ckeditor/ckeditor5-heading/commit/e58dadc))
232
- * The dropdown should be inactive when none of the commands can be applied to the current selection. Closes [#66](https://github.com/ckeditor/ckeditor5-heading/issues/66). ([0ebd5cd](https://github.com/ckeditor/ckeditor5-heading/commit/0ebd5cd))
233
-
234
- ### Features
235
-
236
- * Active heading is marked in the dropdown list. Closes [#26](https://github.com/ckeditor/ckeditor5-heading/issues/26). ([39ba14b](https://github.com/ckeditor/ckeditor5-heading/commit/39ba14b))
237
- * Enabled the tooltip for the `'headings'` component in `editor.ui#componentFactory`. Closes [#55](https://github.com/ckeditor/ckeditor5-heading/issues/55). ([794e6df](https://github.com/ckeditor/ckeditor5-heading/commit/794e6df))
238
- * Named existing plugin(s). ([7d512cd](https://github.com/ckeditor/ckeditor5-heading/commit/7d512cd))
239
- * Split the `heading` command into independent commands. Closes [#53](https://github.com/ckeditor/ckeditor5-heading/issues/53). Closes [#56](https://github.com/ckeditor/ckeditor5-heading/issues/56). Closes [#52](https://github.com/ckeditor/ckeditor5-heading/issues/52). ([7a8f6f0](https://github.com/ckeditor/ckeditor5-heading/commit/7a8f6f0))
240
- * Styled items in the headings toolbar dropdown. Closes [#38](https://github.com/ckeditor/ckeditor5-heading/issues/38). ([0365333](https://github.com/ckeditor/ckeditor5-heading/commit/0365333))
241
-
242
- ### Other changes
243
-
244
- * Introduced consistent height and spacing among headings dropdown items. Closes [#63](https://github.com/ckeditor/ckeditor5-heading/issues/63). ([68d93ff](https://github.com/ckeditor/ckeditor5-heading/commit/68d93ff))
245
- * Updated translations. ([fc95eee](https://github.com/ckeditor/ckeditor5-heading/commit/fc95eee))
246
-
247
- ### BREAKING CHANGES
248
-
249
- * The `heading` command is no longer available. Replaced by `heading1`, `heading2`, `heading3`, and `paragraph`.
250
- * `Heading` plugin requires `Paragraph` to work properly (`ParagraphCommand` registered as "paragraph" in `editor.commands`).
251
- * `config.heading.options` format has changed. The valid `HeadingOption` syntax is now `{ modelElement: 'heading1', viewElement: 'h1', title: 'Heading 1' }`.
252
-
253
-
254
- ## [0.8.0](https://github.com/ckeditor/ckeditor5-heading/compare/v0.7.0...v0.8.0) (March 6, 2017)
255
-
256
- ### Features
257
-
258
- * Enabled configuration and localization of available headings (see `config.heading.options`). Closes [#33](https://github.com/ckeditor/ckeditor5/issues/33). ([de07a0c](https://github.com/ckeditor/ckeditor5-heading/commit/de07a0c))
259
-
260
- ### Other changes
261
-
262
- * Updated translations. ([50583b4](https://github.com/ckeditor/ckeditor5-heading/commit/50583b4))
263
-
264
-
265
- ### BREAKING CHANGES
266
-
267
- * The `heading` command now accepts the `id` option, not `formatId`.
4
+ All changes in the package are documented in https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
package/build/heading.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={707:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(935),i=n.n(o)()((function(e){return e[1]}));i.push([e.id,".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}",""]);const a=i},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var a=0;a<this.length;a++){var r=this[a][0];null!=r&&(i[r]=!0)}for(var s=0;s<e.length;s++){var d=[].concat(e[s]);o&&i[d[0]]||(n&&(d[2]?d[2]="".concat(n," and ").concat(d[2]):d[2]=n),t.push(d))}},t}},591:(e,t,n)=>{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function s(e){for(var t=-1,n=0;n<r.length;n++)if(r[n].identifier===e){t=n;break}return t}function d(e,t){for(var n={},o=[],i=0;i<e.length;i++){var a=e[i],d=t.base?a[0]+t.base:a[0],c=n[d]||0,l="".concat(d," ").concat(c);n[d]=c+1;var u=s(l),m={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(r[u].references++,r[u].updater(m)):r.push({identifier:l,updater:f(m,t),references:1}),o.push(l)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var r=a(e.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}return t}var l,u=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function m(e,t,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var a=document.createTextNode(i),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(a,r[t]):e.appendChild(a)}}function g(e,t,n){var o=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h=null,p=0;function f(e,t){var n,o,i;if(t.singleton){var a=p++;n=h||(h=c(t)),o=m.bind(null,n,a,!1),i=m.bind(null,n,a,!0)}else n=c(t),o=g.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=d(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var i=s(n[o]);r[i].references--}for(var a=d(e,t),c=0;c<n.length;c++){var l=s(n[c]);0===r[l].references&&(r[l].updater(),r.splice(l,1))}n=a}}}},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},179:(e,t,n)=>{e.exports=n(237)("./src/paragraph.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{"use strict";n.r(o),n.d(o,{Heading:()=>f,HeadingButtonsUI:()=>w,HeadingEditing:()=>d,HeadingUI:()=>p,Title:()=>x});var e=n(782),t=n(179),i=n(584);class a extends e.Command{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=(0,i.first)(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>r(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change((e=>{const i=Array.from(n.selection.getSelectedBlocks()).filter((e=>r(e,o,t.schema)));for(const t of i)t.is("element",o)||e.rename(t,o)}))}}function r(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const s="paragraph";class d extends e.Plugin{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[t.Paragraph]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)"paragraph"!==o.model&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new a(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,o)=>{const i=e.model.document.selection.getFirstPosition().parent;n.some((e=>i.is("element",e.model)))&&!i.is("element",s)&&0===i.childCount&&o.writer.rename(i,s)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:i.priorities.low+1})}}var c=n(311);function l(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e}))}var u=n(591),m=n.n(u),g=n(707),h={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};m()(g.A,h);g.A.locals;class p extends e.Plugin{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=l(e),o=t("Choose heading"),a=t("Heading");e.ui.componentFactory.add("heading",(t=>{const r={},s=new i.Collection,d=e.commands.get("heading"),l=e.commands.get("paragraph"),u=[d];for(const e of n){const t={type:"button",model:new c.ViewModel({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),u.push(l)):(t.model.bind("isOn").to(d,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const m=(0,c.createDropdown)(t);return(0,c.addListToDropdown)(m,s,{ariaLabel:a,role:"menu"}),m.buttonView.set({ariaLabel:a,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:a}),m.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),m.bind("isEnabled").toMany(u,"isEnabled",((...e)=>e.some((e=>e)))),m.buttonView.bind("label").to(d,"value",l,"value",((e,t)=>{const n=t?"paragraph":e;return"boolean"==typeof n?o:r[n]?r[n]:o})),m.buttonView.bind("ariaLabel").to(d,"value",l,"value",((e,t)=>{const n=t?"paragraph":e;return"boolean"==typeof n?a:r[n]?`${r[n]}, ${a}`:a})),this.listenTo(m,"execute",(t=>{const{commandName:n,commandValue:o}=t.source;e.execute(n,o?{value:o}:void 0),e.editing.view.focus()})),m})),e.ui.componentFactory.add("menuBar:heading",(o=>{const i=new c.MenuBarMenuView(o),a=e.commands.get("heading"),r=e.commands.get("paragraph"),s=[a],d=new c.MenuBarMenuListView(o);i.set({class:"ck-heading-dropdown"}),d.set({ariaLabel:t("Heading"),role:"menu"}),i.buttonView.set({label:t("Heading")}),i.panelView.children.add(d);for(const t of n){const n=new c.MenuBarMenuListItemView(o,i),l=new c.MenuBarMenuListItemButtonView(o);n.children.add(l),d.items.add(n),l.set({label:t.title,role:"menuitemradio",class:t.class}),l.bind("ariaChecked").to(l,"isOn"),l.delegate("execute").to(i),l.on("execute",(()=>{const n="paragraph"===t.model?"paragraph":"heading";e.execute(n,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(l.bind("isOn").to(r,"value"),s.push(r)):l.bind("isOn").to(a,"value",(e=>e===t.model))}return i.bind("isEnabled").toMany(s,"isEnabled",((...e)=>e.some((e=>e)))),i}))}}class f extends e.Plugin{static get requires(){return[d,p]}static get pluginName(){return"Heading"}}const v=(()=>({heading1:e.icons.heading1,heading2:e.icons.heading2,heading3:e.icons.heading3,heading4:e.icons.heading4,heading5:e.icons.heading5,heading6:e.icons.heading6}))();class w extends e.Plugin{init(){l(this.editor).filter((e=>"paragraph"!==e.model)).map((e=>this._createButton(e)))}_createButton(e){const t=this.editor;t.ui.componentFactory.add(e.model,(n=>{const o=new c.ButtonView(n),i=t.commands.get("heading");return o.label=e.title,o.icon=e.icon||v[e.model],o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",(t=>t==e.model)),o.on("execute",(()=>{t.execute("heading",{value:e.model}),t.editing.view.focus()})),o}))}}var b=n(783);const y=new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class x extends e.Plugin{constructor(){super(...arguments),this._bodyPlaceholder=new Map}static get pluginName(){return"Title"}static get requires(){return["Paragraph"]}init(){const e=this.editor,t=e.model;t.schema.register("title",{isBlock:!0,allowIn:"$root"}),t.schema.register("title-content",{isBlock:!0,allowIn:"title",allowAttributes:["alignment"]}),t.schema.extend("$text",{allowIn:"title-content"}),t.schema.addAttributeCheck((e=>{if(e.endsWith("title-content $text"))return!1})),e.editing.mapper.on("modelToViewPosition",T(e.editing.view)),e.data.mapper.on("modelToViewPosition",T(e.editing.view)),e.conversion.for("downcast").elementToElement({model:"title-content",view:"h1"}),e.conversion.for("downcast").add((e=>e.on("insert:title",((e,t,n)=>{n.consumable.consume(t.item,e.name)})))),e.data.upcastDispatcher.on("element:h1",C,{priority:"high"}),e.data.upcastDispatcher.on("element:h2",C,{priority:"high"}),e.data.upcastDispatcher.on("element:h3",C,{priority:"high"}),t.document.registerPostFixer((e=>this._fixTitleContent(e))),t.document.registerPostFixer((e=>this._fixTitleElement(e))),t.document.registerPostFixer((e=>this._fixBodyElement(e))),t.document.registerPostFixer((e=>this._fixExtraParagraph(e))),this._attachPlaceholders(),this._attachTabPressHandling()}getTitle(e={}){const t=e.rootName?e.rootName:void 0,n=this._getTitleElement(t).getChild(0);return this.editor.data.stringify(n,e)}getBody(e={}){const t=this.editor,n=t.data,o=t.model,i=e.rootName?e.rootName:void 0,a=t.model.document.getRoot(i),r=t.editing.view,s=new b.DowncastWriter(r.document),d=o.createRangeIn(a),c=s.createDocumentFragment(),l=o.createPositionAfter(a.getChild(0)),u=o.createRange(l,o.createPositionAt(a,"end")),m=new Map;for(const e of o.markers){const t=u.getIntersection(e.getRange());t&&m.set(e.name,t)}return n.mapper.clearBindings(),n.mapper.bindElements(a,c),n.downcastDispatcher.convert(d,m,s,e),s.remove(s.createRangeOn(c.getChild(0))),t.data.processor.toData(c)}_getTitleElement(e){const t=this.editor.model.document.getRoot(e);for(const e of t.getChildren())if(P(e))return e}_fixTitleContent(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this._getTitleElement(n);if(!o||1===o.maxOffset)continue;const i=Array.from(o.getChildren());i.shift();for(const t of i)e.move(e.createRangeOn(t),o,"after"),e.rename(t,"paragraph");t=!0}return t}_fixTitleElement(e){let t=!1;const n=this.editor.model;for(const o of this.editor.model.document.getRoots()){const i=Array.from(o.getChildren()).filter(P),a=i[0],r=o.getChild(0);if(r.is("element","title"))i.length>1&&(H(i,e,n),t=!0);else if(a||y.has(r.name))y.has(r.name)?E(r,e,n):e.move(e.createRangeOn(a),o,0),H(i,e,n),t=!0;else{const n=e.createElement("title");e.insert(n,o),e.insertElement("title-content",n),t=!0}}return t}_fixBodyElement(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this.editor.model.document.getRoot(n);if(o.childCount<2){const i=e.createElement("paragraph");e.insert(i,o,1),this._bodyPlaceholder.set(n,i),t=!0}}return t}_fixExtraParagraph(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this.editor.model.document.getRoot(n),i=this._bodyPlaceholder.get(n);k(i,o)&&(this._bodyPlaceholder.delete(n),e.remove(i),t=!0)}return t}_attachPlaceholders(){const e=this.editor,t=e.t,n=e.editing.view,o=e.sourceElement,i=e.config.get("title.placeholder")||t("Type your title"),a=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder")||t("Type or paste your content here.");e.editing.downcastDispatcher.on("insert:title-content",((e,t,o)=>{const a=o.mapper.toViewElement(t.item);a.placeholder=i,(0,b.enablePlaceholder)({view:n,element:a,keepOnFocus:!0})}));const r=new Map;n.document.registerPostFixer((e=>{let t=!1;for(const o of n.document.roots){if(o.isEmpty)continue;const n=o.getChild(1),i=r.get(o.rootName);n!==i&&(i&&((0,b.hidePlaceholder)(e,i),e.removeAttribute("data-placeholder",i)),e.setAttribute("data-placeholder",a,n),r.set(o.rootName,n),t=!0),t=(0,b.needsPlaceholder)(n,!0)&&2===o.childCount&&"p"===n.name?!!(0,b.showPlaceholder)(e,n)||t:!!(0,b.hidePlaceholder)(e,n)||t}return t}))}_attachTabPressHandling(){const e=this.editor,t=e.model;e.keystrokes.set("TAB",((e,n)=>{t.change((e=>{const o=t.document.selection,i=Array.from(o.getSelectedBlocks());if(1===i.length&&i[0].is("element","title-content")){const t=o.getFirstPosition().root.getChild(1);e.setSelection(t,0),n()}}))})),e.keystrokes.set("SHIFT + TAB",((n,o)=>{t.change((n=>{const a=t.document.selection;if(!a.isCollapsed)return;const r=(0,i.first)(a.getSelectedBlocks()),s=a.getFirstPosition(),d=e.model.document.getRoot(s.root.rootName),c=d.getChild(0);r===d.getChild(1)&&s.isAtStart&&(n.setSelection(c.getChild(0),0),o())}))}))}}function C(e,t,n){const o=t.modelCursor,i=t.viewItem;if(!o.isAtStart||!o.parent.is("element","$root"))return;if(!n.consumable.consume(i,{name:!0}))return;const a=n.writer,r=a.createElement("title"),s=a.createElement("title-content");a.append(s,r),a.insert(r,o),n.convertChildren(i,s),n.updateConversionResult(r,t)}function T(e){return(t,n)=>{const o=n.modelPosition.parent;if(!o.is("element","title"))return;const i=o.parent,a=n.mapper.toViewElement(i);n.viewPosition=e.createPositionAt(a,0),t.stop()}}function P(e){return e.is("element","title")}function E(e,t,n){const o=t.createElement("title");t.insert(o,e,"before"),t.insert(e,o,0),t.rename(e,"title-content"),n.schema.removeDisallowedAttributes([e],t)}function H(e,t,n){let o=!1;for(const i of e)0!==i.index&&(_(i,t,n),o=!0);return o}function _(e,t,n){const o=e.getChild(0);o.isEmpty?t.remove(e):(t.move(t.createRangeOn(o),e,"before"),t.rename(o,"paragraph"),t.remove(e),n.schema.removeDisallowedAttributes([o],t))}function k(e,t){return!(!e||!e.is("element","paragraph")||e.childCount)&&!(t.childCount<=2||t.getChild(t.childCount-1)!==e)}})(),(window.CKEditor5=window.CKEditor5||{}).heading=o})();
5
+ */(()=>{var e={707:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(935),i=n.n(o)()((function(e){return e[1]}));i.push([e.id,".ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}",""]);const a=i},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var a=0;a<this.length;a++){var r=this[a][0];null!=r&&(i[r]=!0)}for(var s=0;s<e.length;s++){var d=[].concat(e[s]);o&&i[d[0]]||(n&&(d[2]?d[2]="".concat(n," and ").concat(d[2]):d[2]=n),t.push(d))}},t}},591:(e,t,n)=>{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function s(e){for(var t=-1,n=0;n<r.length;n++)if(r[n].identifier===e){t=n;break}return t}function d(e,t){for(var n={},o=[],i=0;i<e.length;i++){var a=e[i],d=t.base?a[0]+t.base:a[0],c=n[d]||0,l="".concat(d," ").concat(c);n[d]=c+1;var u=s(l),g={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(r[u].references++,r[u].updater(g)):r.push({identifier:l,updater:f(g,t),references:1}),o.push(l)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var r=a(e.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}return t}var l,u=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function g(e,t,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var a=document.createTextNode(i),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(a,r[t]):e.appendChild(a)}}function m(e,t,n){var o=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h=null,p=0;function f(e,t){var n,o,i;if(t.singleton){var a=p++;n=h||(h=c(t)),o=g.bind(null,n,a,!1),i=g.bind(null,n,a,!0)}else n=c(t),o=m.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=d(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var i=s(n[o]);r[i].references--}for(var a=d(e,t),c=0;c<n.length;c++){var l=s(n[c]);0===r[l].references&&(r[l].updater(),r.splice(l,1))}n=a}}}},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},179:(e,t,n)=>{e.exports=n(237)("./src/paragraph.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{"use strict";n.r(o),n.d(o,{Heading:()=>f,HeadingButtonsUI:()=>b,HeadingEditing:()=>d,HeadingUI:()=>p,Title:()=>x});var e=n(782),t=n(179),i=n(584);class a extends e.Command{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=(0,i.first)(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>r(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,n=t.document,o=e.value;t.change((e=>{const i=Array.from(n.selection.getSelectedBlocks()).filter((e=>r(e,o,t.schema)));for(const t of i)t.is("element",o)||e.rename(t,o)}))}}function r(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const s="paragraph";class d extends e.Plugin{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[t.Paragraph]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const o of t)"paragraph"!==o.model&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new a(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,o)=>{const i=e.model.document.selection.getFirstPosition().parent;n.some((e=>i.is("element",e.model)))&&!i.is("element",s)&&0===i.childCount&&o.writer.rename(i,s)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:i.priorities.low+1})}}var c=n(311);function l(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e}))}var u=n(591),g=n.n(u),m=n(707),h={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};g()(m.A,h);m.A.locals;class p extends e.Plugin{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=l(e),o=t("Choose heading"),a=t("Heading");e.ui.componentFactory.add("heading",(t=>{const r={},s=new i.Collection,d=e.commands.get("heading"),l=e.commands.get("paragraph"),u=[d];for(const e of n){const t={type:"button",model:new c.ViewModel({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),u.push(l)):(t.model.bind("isOn").to(d,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const g=(0,c.createDropdown)(t);return(0,c.addListToDropdown)(g,s,{ariaLabel:a,role:"menu"}),g.buttonView.set({ariaLabel:a,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:a}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(u,"isEnabled",((...e)=>e.some((e=>e)))),g.buttonView.bind("label").to(d,"value",l,"value",((e,t)=>{const n=t?"paragraph":e;return"boolean"==typeof n?o:r[n]?r[n]:o})),g.buttonView.bind("ariaLabel").to(d,"value",l,"value",((e,t)=>{const n=t?"paragraph":e;return"boolean"==typeof n?a:r[n]?`${r[n]}, ${a}`:a})),this.listenTo(g,"execute",(t=>{const{commandName:n,commandValue:o}=t.source;e.execute(n,o?{value:o}:void 0),e.editing.view.focus()})),g})),e.ui.componentFactory.add("menuBar:heading",(o=>{const i=new c.MenuBarMenuView(o),a=e.commands.get("heading"),r=e.commands.get("paragraph"),s=[a],d=new c.MenuBarMenuListView(o);i.set({class:"ck-heading-dropdown"}),d.set({ariaLabel:t("Heading"),role:"menu"}),i.buttonView.set({label:t("Heading")}),i.panelView.children.add(d);for(const t of n){const n=new c.MenuBarMenuListItemView(o,i),l=new c.MenuBarMenuListItemButtonView(o);n.children.add(l),d.items.add(n),l.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),l.delegate("execute").to(i),l.on("execute",(()=>{const n="paragraph"===t.model?"paragraph":"heading";e.execute(n,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(l.bind("isOn").to(r,"value"),s.push(r)):l.bind("isOn").to(a,"value",(e=>e===t.model))}return i.bind("isEnabled").toMany(s,"isEnabled",((...e)=>e.some((e=>e)))),i}))}}class f extends e.Plugin{static get requires(){return[d,p]}static get pluginName(){return"Heading"}}const v=(()=>({heading1:e.icons.heading1,heading2:e.icons.heading2,heading3:e.icons.heading3,heading4:e.icons.heading4,heading5:e.icons.heading5,heading6:e.icons.heading6}))();class b extends e.Plugin{init(){l(this.editor).filter((e=>"paragraph"!==e.model)).map((e=>this._createButton(e)))}_createButton(e){const t=this.editor;t.ui.componentFactory.add(e.model,(n=>{const o=new c.ButtonView(n),i=t.commands.get("heading");return o.label=e.title,o.icon=e.icon||v[e.model],o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",(t=>t==e.model)),o.on("execute",(()=>{t.execute("heading",{value:e.model}),t.editing.view.focus()})),o}))}}var w=n(783);const y=new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class x extends e.Plugin{constructor(){super(...arguments),this._bodyPlaceholder=new Map}static get pluginName(){return"Title"}static get requires(){return["Paragraph"]}init(){const e=this.editor,t=e.model;t.schema.register("title",{isBlock:!0,allowIn:"$root"}),t.schema.register("title-content",{isBlock:!0,allowIn:"title",allowAttributes:["alignment"]}),t.schema.extend("$text",{allowIn:"title-content"}),t.schema.addAttributeCheck((e=>{if(e.endsWith("title-content $text"))return!1})),e.editing.mapper.on("modelToViewPosition",T(e.editing.view)),e.data.mapper.on("modelToViewPosition",T(e.editing.view)),e.conversion.for("downcast").elementToElement({model:"title-content",view:"h1"}),e.conversion.for("downcast").add((e=>e.on("insert:title",((e,t,n)=>{n.consumable.consume(t.item,e.name)})))),e.data.upcastDispatcher.on("element:h1",C,{priority:"high"}),e.data.upcastDispatcher.on("element:h2",C,{priority:"high"}),e.data.upcastDispatcher.on("element:h3",C,{priority:"high"}),t.document.registerPostFixer((e=>this._fixTitleContent(e))),t.document.registerPostFixer((e=>this._fixTitleElement(e))),t.document.registerPostFixer((e=>this._fixBodyElement(e))),t.document.registerPostFixer((e=>this._fixExtraParagraph(e))),this._attachPlaceholders(),this._attachTabPressHandling()}getTitle(e={}){const t=e.rootName?e.rootName:void 0,n=this._getTitleElement(t).getChild(0);return this.editor.data.stringify(n,e)}getBody(e={}){const t=this.editor,n=t.data,o=t.model,i=e.rootName?e.rootName:void 0,a=t.model.document.getRoot(i),r=t.editing.view,s=new w.DowncastWriter(r.document),d=o.createRangeIn(a),c=s.createDocumentFragment(),l=o.createPositionAfter(a.getChild(0)),u=o.createRange(l,o.createPositionAt(a,"end")),g=new Map;for(const e of o.markers){const t=u.getIntersection(e.getRange());t&&g.set(e.name,t)}return n.mapper.clearBindings(),n.mapper.bindElements(a,c),n.downcastDispatcher.convert(d,g,s,e),s.remove(s.createRangeOn(c.getChild(0))),t.data.processor.toData(c)}_getTitleElement(e){const t=this.editor.model.document.getRoot(e);for(const e of t.getChildren())if(_(e))return e}_fixTitleContent(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this._getTitleElement(n);if(!o||1===o.maxOffset)continue;const i=Array.from(o.getChildren());i.shift();for(const t of i)e.move(e.createRangeOn(t),o,"after"),e.rename(t,"paragraph");t=!0}return t}_fixTitleElement(e){let t=!1;const n=this.editor.model;for(const o of this.editor.model.document.getRoots()){const i=Array.from(o.getChildren()).filter(_),a=i[0],r=o.getChild(0);if(r.is("element","title"))i.length>1&&(E(i,e,n),t=!0);else if(a||y.has(r.name))y.has(r.name)?P(r,e,n):e.move(e.createRangeOn(a),o,0),E(i,e,n),t=!0;else{const n=e.createElement("title");e.insert(n,o),e.insertElement("title-content",n),t=!0}}return t}_fixBodyElement(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this.editor.model.document.getRoot(n);if(o.childCount<2){const i=e.createElement("paragraph");e.insert(i,o,1),this._bodyPlaceholder.set(n,i),t=!0}}return t}_fixExtraParagraph(e){let t=!1;for(const n of this.editor.model.document.getRootNames()){const o=this.editor.model.document.getRoot(n),i=this._bodyPlaceholder.get(n);k(i,o)&&(this._bodyPlaceholder.delete(n),e.remove(i),t=!0)}return t}_attachPlaceholders(){const e=this.editor,t=e.t,n=e.editing.view,o=e.sourceElement,i=e.config.get("title.placeholder")||t("Type your title"),a=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder")||t("Type or paste your content here.");e.editing.downcastDispatcher.on("insert:title-content",((e,t,o)=>{const a=o.mapper.toViewElement(t.item);a.placeholder=i,(0,w.enablePlaceholder)({view:n,element:a,keepOnFocus:!0})}));const r=new Map;n.document.registerPostFixer((e=>{let t=!1;for(const o of n.document.roots){if(o.isEmpty)continue;const n=o.getChild(1),i=r.get(o.rootName);n!==i&&(i&&((0,w.hidePlaceholder)(e,i),e.removeAttribute("data-placeholder",i)),e.setAttribute("data-placeholder",a,n),r.set(o.rootName,n),t=!0),t=(0,w.needsPlaceholder)(n,!0)&&2===o.childCount&&"p"===n.name?!!(0,w.showPlaceholder)(e,n)||t:!!(0,w.hidePlaceholder)(e,n)||t}return t}))}_attachTabPressHandling(){const e=this.editor,t=e.model;e.keystrokes.set("TAB",((e,n)=>{t.change((e=>{const o=t.document.selection,i=Array.from(o.getSelectedBlocks());if(1===i.length&&i[0].is("element","title-content")){const t=o.getFirstPosition().root.getChild(1);e.setSelection(t,0),n()}}))})),e.keystrokes.set("SHIFT + TAB",((n,o)=>{t.change((n=>{const a=t.document.selection;if(!a.isCollapsed)return;const r=(0,i.first)(a.getSelectedBlocks()),s=a.getFirstPosition(),d=e.model.document.getRoot(s.root.rootName),c=d.getChild(0);r===d.getChild(1)&&s.isAtStart&&(n.setSelection(c.getChild(0),0),o())}))}))}}function C(e,t,n){const o=t.modelCursor,i=t.viewItem;if(!o.isAtStart||!o.parent.is("element","$root"))return;if(!n.consumable.consume(i,{name:!0}))return;const a=n.writer,r=a.createElement("title"),s=a.createElement("title-content");a.append(s,r),a.insert(r,o),n.convertChildren(i,s),n.updateConversionResult(r,t)}function T(e){return(t,n)=>{const o=n.modelPosition.parent;if(!o.is("element","title"))return;const i=o.parent,a=n.mapper.toViewElement(i);n.viewPosition=e.createPositionAt(a,0),t.stop()}}function _(e){return e.is("element","title")}function P(e,t,n){const o=t.createElement("title");t.insert(o,e,"before"),t.insert(e,o,0),t.rename(e,"title-content"),n.schema.removeDisallowedAttributes([e],t)}function E(e,t,n){let o=!1;for(const i of e)0!==i.index&&(H(i,t,n),o=!0);return o}function H(e,t,n){const o=e.getChild(0);o.isEmpty?t.remove(e):(t.move(t.createRangeOn(o),e,"before"),t.rename(o,"paragraph"),t.remove(e),n.schema.removeDisallowedAttributes([o],t))}function k(e,t){return!(!e||!e.is("element","paragraph")||e.childCount)&&!(t.childCount<=2||t.getChild(t.childCount-1)!==e)}})(),(window.CKEditor5=window.CKEditor5||{}).heading=o})();
@@ -72,38 +72,12 @@ export interface HeadingConfig {
72
72
  /**
73
73
  * Heading option descriptor.
74
74
  */
75
- export type HeadingOption = HeadingElementOption | HeadingParagraphOption | HeadingCustomElementOption;
75
+ export type HeadingOption = HeadingElementOption | HeadingParagraphOption;
76
76
  export interface HeadingElementOption {
77
77
  /**
78
78
  * Name of the model element to convert.
79
79
  */
80
- model: 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
81
- /**
82
- * Definition of a view element to convert from/to.
83
- */
84
- view: ViewElementDefinition;
85
- /**
86
- * The user-readable title of the option.
87
- */
88
- title: string;
89
- /**
90
- * The class which will be added to the dropdown item representing this option.
91
- */
92
- class: string;
93
- /**
94
- * Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using the default configuration.
95
- */
96
- icon?: string;
97
- /**
98
- * An array with all matched elements that the view-to-model conversion should also accept.
99
- */
100
- upcastAlso?: ArrayOrItem<ViewElementDefinition | MatcherPattern>;
101
- }
102
- export interface HeadingCustomElementOption {
103
- /**
104
- * Name of the model element to convert.
105
- */
106
- model: `heading${string}`;
80
+ model: 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | `heading${string}` & Record<never, never>;
107
81
  /**
108
82
  * Definition of a view element to convert from/to.
109
83
  */
@@ -2,15 +2,15 @@
2
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
- .ck.ck-heading_heading1{
5
+ .ck.ck-heading_heading1 .ck-button__label{
6
6
  font-size:20px;
7
7
  }
8
8
 
9
- .ck.ck-heading_heading2{
9
+ .ck.ck-heading_heading2 .ck-button__label{
10
10
  font-size:17px;
11
11
  }
12
12
 
13
- .ck.ck-heading_heading3{
13
+ .ck.ck-heading_heading3 .ck-button__label{
14
14
  font-size:14px;
15
15
  }
16
16
 
package/dist/index.css CHANGED
@@ -7,15 +7,15 @@
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
9
 
10
- .ck.ck-heading_heading1 {
10
+ .ck.ck-heading_heading1 .ck-button__label {
11
11
  font-size: 20px;
12
12
  }
13
13
 
14
- .ck.ck-heading_heading2 {
14
+ .ck.ck-heading_heading2 .ck-button__label {
15
15
  font-size: 17px;
16
16
  }
17
17
 
18
- .ck.ck-heading_heading3 {
18
+ .ck.ck-heading_heading3 .ck-button__label {
19
19
  font-size: 14px;
20
20
  }
21
21
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../theme/heading.css","index.css"],"names":[],"mappings":";;;;AAAA,CAAA,CAAA;ACCA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5E,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO;AACnF,CAAC,CDAC,CAAA;ACCF;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAA,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,MAAA,CAAA,CAAA,IAAiB,CAAA;AAClB,CAAA;ACCA;AACA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n","/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
1
+ {"version":3,"sources":["../theme/heading.css","index.css"],"names":[],"mappings":";;;;AAAA,CAAA,CAAA;ACCA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5E,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO;AACnF,CAAC,CDAC,CAAA;ACCF;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe,CAAA;AAChB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAA,CAAA,eAAA,CAAA,CAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,MAAA,CAAA,CAAA,IAAiB,CAAA;AAClB,CAAA;ACCA;AACA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 .ck-button__label {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 .ck-button__label {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 .ck-button__label {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n","/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 .ck-button__label {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 .ck-button__label {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 .ck-button__label {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
package/dist/index.js CHANGED
@@ -329,11 +329,11 @@ const defaultModelElement = 'paragraph';
329
329
  listItemView.children.add(buttonView);
330
330
  listView.items.add(listItemView);
331
331
  buttonView.set({
332
+ isToggleable: true,
332
333
  label: option.title,
333
334
  role: 'menuitemradio',
334
335
  class: option.class
335
336
  });
336
- buttonView.bind('ariaChecked').to(buttonView, 'isOn');
337
337
  buttonView.delegate('execute').to(menuView);
338
338
  buttonView.on('execute', ()=>{
339
339
  const commandName = option.model === 'paragraph' ? 'paragraph' : 'heading';