@ckeditor/ckeditor5-page-break 48.8.1-alpha.4 → 49.0.0-alpha.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.
Files changed (161) hide show
  1. package/dist/augmentation.d.ts +13 -13
  2. package/dist/index-content.css +39 -37
  3. package/dist/index-content.css.map +1 -0
  4. package/dist/index-editor.css +3 -0
  5. package/dist/index-editor.css.map +1 -0
  6. package/dist/index.css +9 -9
  7. package/dist/index.css.map +1 -1
  8. package/dist/index.d.ts +12 -10
  9. package/dist/index.js +246 -236
  10. package/dist/index.js.map +1 -1
  11. package/dist/pagebreak.d.ts +27 -27
  12. package/dist/pagebreakcommand.d.ts +24 -24
  13. package/dist/pagebreakediting.d.ts +29 -30
  14. package/dist/pagebreakui.d.ts +24 -24
  15. package/dist/translations/af.js +1 -1
  16. package/dist/translations/af.umd.js +5 -3
  17. package/dist/translations/ar.js +1 -1
  18. package/dist/translations/ar.umd.js +5 -3
  19. package/dist/translations/ast.js +1 -1
  20. package/dist/translations/ast.umd.js +5 -3
  21. package/dist/translations/az.js +1 -1
  22. package/dist/translations/az.umd.js +5 -3
  23. package/dist/translations/be.js +1 -1
  24. package/dist/translations/be.umd.js +5 -3
  25. package/dist/translations/bg.js +1 -1
  26. package/dist/translations/bg.umd.js +5 -3
  27. package/dist/translations/bn.js +1 -1
  28. package/dist/translations/bn.umd.js +5 -3
  29. package/dist/translations/bs.js +1 -1
  30. package/dist/translations/bs.umd.js +5 -3
  31. package/dist/translations/ca.js +1 -1
  32. package/dist/translations/ca.umd.js +5 -3
  33. package/dist/translations/cs.js +1 -1
  34. package/dist/translations/cs.umd.js +5 -3
  35. package/dist/translations/da.js +1 -1
  36. package/dist/translations/da.umd.js +5 -3
  37. package/dist/translations/de-ch.js +1 -1
  38. package/dist/translations/de-ch.umd.js +5 -3
  39. package/dist/translations/de.js +1 -1
  40. package/dist/translations/de.umd.js +5 -3
  41. package/dist/translations/el.js +1 -1
  42. package/dist/translations/el.umd.js +5 -3
  43. package/dist/translations/en-au.js +1 -1
  44. package/dist/translations/en-au.umd.js +5 -3
  45. package/dist/translations/en-gb.js +1 -1
  46. package/dist/translations/en-gb.umd.js +5 -3
  47. package/dist/translations/en.js +1 -1
  48. package/dist/translations/en.umd.js +5 -3
  49. package/dist/translations/eo.js +1 -1
  50. package/dist/translations/eo.umd.js +5 -3
  51. package/dist/translations/es-co.js +1 -1
  52. package/dist/translations/es-co.umd.js +5 -3
  53. package/dist/translations/es.js +1 -1
  54. package/dist/translations/es.umd.js +5 -3
  55. package/dist/translations/et.js +1 -1
  56. package/dist/translations/et.umd.js +5 -3
  57. package/dist/translations/eu.js +1 -1
  58. package/dist/translations/eu.umd.js +5 -3
  59. package/dist/translations/fa.js +1 -1
  60. package/dist/translations/fa.umd.js +5 -3
  61. package/dist/translations/fi.js +1 -1
  62. package/dist/translations/fi.umd.js +5 -3
  63. package/dist/translations/fr.js +1 -1
  64. package/dist/translations/fr.umd.js +5 -3
  65. package/dist/translations/gl.js +1 -1
  66. package/dist/translations/gl.umd.js +5 -3
  67. package/dist/translations/gu.js +1 -1
  68. package/dist/translations/gu.umd.js +5 -3
  69. package/dist/translations/he.js +1 -1
  70. package/dist/translations/he.umd.js +5 -3
  71. package/dist/translations/hi.js +1 -1
  72. package/dist/translations/hi.umd.js +5 -3
  73. package/dist/translations/hr.js +1 -1
  74. package/dist/translations/hr.umd.js +5 -3
  75. package/dist/translations/hu.js +1 -1
  76. package/dist/translations/hu.umd.js +5 -3
  77. package/dist/translations/hy.js +1 -1
  78. package/dist/translations/hy.umd.js +5 -3
  79. package/dist/translations/id.js +1 -1
  80. package/dist/translations/id.umd.js +5 -3
  81. package/dist/translations/it.js +1 -1
  82. package/dist/translations/it.umd.js +5 -3
  83. package/dist/translations/ja.js +1 -1
  84. package/dist/translations/ja.umd.js +5 -3
  85. package/dist/translations/jv.js +1 -1
  86. package/dist/translations/jv.umd.js +5 -3
  87. package/dist/translations/kk.js +1 -1
  88. package/dist/translations/kk.umd.js +5 -3
  89. package/dist/translations/km.js +1 -1
  90. package/dist/translations/km.umd.js +5 -3
  91. package/dist/translations/kn.js +1 -1
  92. package/dist/translations/kn.umd.js +5 -3
  93. package/dist/translations/ko.js +1 -1
  94. package/dist/translations/ko.umd.js +5 -3
  95. package/dist/translations/ku.js +1 -1
  96. package/dist/translations/ku.umd.js +5 -3
  97. package/dist/translations/lt.js +1 -1
  98. package/dist/translations/lt.umd.js +5 -3
  99. package/dist/translations/lv.js +1 -1
  100. package/dist/translations/lv.umd.js +5 -3
  101. package/dist/translations/ms.js +1 -1
  102. package/dist/translations/ms.umd.js +5 -3
  103. package/dist/translations/nb.js +1 -1
  104. package/dist/translations/nb.umd.js +5 -3
  105. package/dist/translations/ne.js +1 -1
  106. package/dist/translations/ne.umd.js +5 -3
  107. package/dist/translations/nl.js +1 -1
  108. package/dist/translations/nl.umd.js +5 -3
  109. package/dist/translations/no.js +1 -1
  110. package/dist/translations/no.umd.js +5 -3
  111. package/dist/translations/oc.js +1 -1
  112. package/dist/translations/oc.umd.js +5 -3
  113. package/dist/translations/pl.js +1 -1
  114. package/dist/translations/pl.umd.js +5 -3
  115. package/dist/translations/pt-br.js +1 -1
  116. package/dist/translations/pt-br.umd.js +5 -3
  117. package/dist/translations/pt.js +1 -1
  118. package/dist/translations/pt.umd.js +5 -3
  119. package/dist/translations/ro.js +1 -1
  120. package/dist/translations/ro.umd.js +5 -3
  121. package/dist/translations/ru.js +1 -1
  122. package/dist/translations/ru.umd.js +5 -3
  123. package/dist/translations/si.js +1 -1
  124. package/dist/translations/si.umd.js +5 -3
  125. package/dist/translations/sk.js +1 -1
  126. package/dist/translations/sk.umd.js +5 -3
  127. package/dist/translations/sl.js +1 -1
  128. package/dist/translations/sl.umd.js +5 -3
  129. package/dist/translations/sq.js +1 -1
  130. package/dist/translations/sq.umd.js +5 -3
  131. package/dist/translations/sr-latn.js +1 -1
  132. package/dist/translations/sr-latn.umd.js +5 -3
  133. package/dist/translations/sr.js +1 -1
  134. package/dist/translations/sr.umd.js +5 -3
  135. package/dist/translations/sv.js +1 -1
  136. package/dist/translations/sv.umd.js +5 -3
  137. package/dist/translations/th.js +1 -1
  138. package/dist/translations/th.umd.js +5 -3
  139. package/dist/translations/ti.js +1 -1
  140. package/dist/translations/ti.umd.js +5 -3
  141. package/dist/translations/tk.js +1 -1
  142. package/dist/translations/tk.umd.js +5 -3
  143. package/dist/translations/tr.js +1 -1
  144. package/dist/translations/tr.umd.js +5 -3
  145. package/dist/translations/tt.js +1 -1
  146. package/dist/translations/tt.umd.js +5 -3
  147. package/dist/translations/ug.js +1 -1
  148. package/dist/translations/ug.umd.js +5 -3
  149. package/dist/translations/uk.js +1 -1
  150. package/dist/translations/uk.umd.js +5 -3
  151. package/dist/translations/ur.js +1 -1
  152. package/dist/translations/ur.umd.js +5 -3
  153. package/dist/translations/uz.js +1 -1
  154. package/dist/translations/uz.umd.js +5 -3
  155. package/dist/translations/vi.js +1 -1
  156. package/dist/translations/vi.umd.js +5 -3
  157. package/dist/translations/zh-cn.js +1 -1
  158. package/dist/translations/zh-cn.umd.js +5 -3
  159. package/dist/translations/zh.js +1 -1
  160. package/dist/translations/zh.umd.js +5 -3
  161. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -2,255 +2,265 @@
2
2
  * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { findOptimalInsertionRange, toWidget, Widget } from '@ckeditor/ckeditor5-widget/dist/index.js';
7
- import { IconPageBreak } from '@ckeditor/ckeditor5-icons/dist/index.js';
8
- import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
5
+ import { Command, Plugin } from "@ckeditor/ckeditor5-core";
6
+ import { Widget, findOptimalInsertionRange, toWidget } from "@ckeditor/ckeditor5-widget";
7
+ import { IconPageBreak } from "@ckeditor/ckeditor5-icons";
8
+ import { ButtonView, MenuBarMenuListItemButtonView } from "@ckeditor/ckeditor5-ui";
9
9
 
10
10
  /**
11
- * The page break command.
12
- *
13
- * The command is registered by {@link module:page-break/pagebreakediting~PageBreakEditing} as `'pageBreak'`.
14
- *
15
- * To insert a page break at the current selection, execute the command:
16
- *
17
- * editor.execute( 'pageBreak' );
18
- */ class PageBreakCommand extends Command {
19
- /**
20
- * @inheritDoc
21
- */ refresh() {
22
- const model = this.editor.model;
23
- const schema = model.schema;
24
- const selection = model.document.selection;
25
- this.isEnabled = isPageBreakAllowedInParent(selection, schema, model);
26
- }
27
- /**
28
- * Executes the command.
29
- *
30
- * @fires execute
31
- */ execute() {
32
- const model = this.editor.model;
33
- model.change((writer)=>{
34
- const pageBreakElement = writer.createElement('pageBreak');
35
- model.insertObject(pageBreakElement, null, null, {
36
- setSelection: 'after'
37
- });
38
- });
39
- }
40
- }
11
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
12
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
13
+ */
14
+ /**
15
+ * @module page-break/pagebreakcommand
16
+ */
41
17
  /**
42
- * Checks if a page break is allowed by the schema in the optimal insertion parent.
43
- */ function isPageBreakAllowedInParent(selection, schema, model) {
44
- const parent = getInsertPageBreakParent(selection, model);
45
- return schema.checkChild(parent, 'pageBreak');
18
+ * The page break command.
19
+ *
20
+ * The command is registered by {@link module:page-break/pagebreakediting~PageBreakEditing} as `'pageBreak'`.
21
+ *
22
+ * To insert a page break at the current selection, execute the command:
23
+ *
24
+ * editor.execute( 'pageBreak' );
25
+ */
26
+ var PageBreakCommand = class extends Command {
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ refresh() {
31
+ const model = this.editor.model;
32
+ const schema = model.schema;
33
+ const selection = model.document.selection;
34
+ this.isEnabled = isPageBreakAllowedInParent(selection, schema, model);
35
+ }
36
+ /**
37
+ * Executes the command.
38
+ *
39
+ * @fires execute
40
+ */
41
+ execute() {
42
+ const model = this.editor.model;
43
+ model.change((writer) => {
44
+ const pageBreakElement = writer.createElement("pageBreak");
45
+ model.insertObject(pageBreakElement, null, null, { setSelection: "after" });
46
+ });
47
+ }
48
+ };
49
+ /**
50
+ * Checks if a page break is allowed by the schema in the optimal insertion parent.
51
+ */
52
+ function isPageBreakAllowedInParent(selection, schema, model) {
53
+ const parent = getInsertPageBreakParent(selection, model);
54
+ return schema.checkChild(parent, "pageBreak");
46
55
  }
47
56
  /**
48
- * Returns a node that will be used to insert a page break with `model.insertContent` to check if the page break can be placed there.
49
- */ function getInsertPageBreakParent(selection, model) {
50
- const insertionRange = findOptimalInsertionRange(selection, model);
51
- const parent = insertionRange.start.parent;
52
- if (parent.isEmpty && !parent.is('rootElement')) {
53
- return parent.parent;
54
- }
55
- return parent;
57
+ * Returns a node that will be used to insert a page break with `model.insertContent` to check if the page break can be placed there.
58
+ */
59
+ function getInsertPageBreakParent(selection, model) {
60
+ const parent = findOptimalInsertionRange(selection, model).start.parent;
61
+ if (parent.isEmpty && !parent.is("rootElement")) return parent.parent;
62
+ return parent;
56
63
  }
57
64
 
58
65
  /**
59
- * The page break editing feature.
60
- */ class PageBreakEditing extends Plugin {
61
- /**
62
- * @inheritDoc
63
- */ static get pluginName() {
64
- return 'PageBreakEditing';
65
- }
66
- /**
67
- * @inheritDoc
68
- * @internal
69
- */ static get licenseFeatureCode() {
70
- return 'PB';
71
- }
72
- /**
73
- * @inheritDoc
74
- */ static get isOfficialPlugin() {
75
- return true;
76
- }
77
- /**
78
- * @inheritDoc
79
- */ static get isPremiumPlugin() {
80
- return true;
81
- }
82
- /**
83
- * @inheritDoc
84
- */ init() {
85
- const editor = this.editor;
86
- const schema = editor.model.schema;
87
- const t = editor.t;
88
- const conversion = editor.conversion;
89
- schema.register('pageBreak', {
90
- inheritAllFrom: '$blockObject'
91
- });
92
- conversion.for('dataDowncast').elementToStructure({
93
- model: 'pageBreak',
94
- view: (modelElement, { writer })=>{
95
- const divElement = writer.createContainerElement('div', {
96
- class: 'page-break',
97
- // If user has no `.ck-content` styles, it should always break a page during print.
98
- style: 'page-break-after: always'
99
- }, // For a rationale of using span inside a div see:
100
- // https://github.com/ckeditor/ckeditor5-page-break/pull/1#discussion_r328934062.
101
- writer.createContainerElement('span', {
102
- style: 'display: none'
103
- }));
104
- return divElement;
105
- }
106
- });
107
- conversion.for('editingDowncast').elementToStructure({
108
- model: 'pageBreak',
109
- view: (modelElement, { writer })=>{
110
- const label = t('Page break');
111
- const viewWrapper = writer.createContainerElement('div');
112
- const viewLabelElement = writer.createRawElement('span', {
113
- class: 'page-break__label'
114
- }, function(domElement) {
115
- domElement.innerText = t('Page break');
116
- });
117
- writer.addClass('page-break', viewWrapper);
118
- writer.insert(writer.createPositionAt(viewWrapper, 0), viewLabelElement);
119
- return toPageBreakWidget(viewWrapper, writer, label);
120
- }
121
- });
122
- conversion.for('upcast').elementToElement({
123
- view: (element)=>{
124
- // For upcast conversion it's enough if we check for element style and verify if it's empty
125
- // or contains only hidden span element.
126
- const hasPageBreakBefore = element.getStyle('page-break-before') == 'always';
127
- const hasPageBreakAfter = element.getStyle('page-break-after') == 'always';
128
- if (!hasPageBreakBefore && !hasPageBreakAfter) {
129
- return null;
130
- }
131
- // The "page break" div accepts only single child or no child at all.
132
- if (element.childCount == 1) {
133
- const viewSpan = element.getChild(0);
134
- // The child must be the "span" element that is not displayed.
135
- if (!viewSpan.is('element', 'span') || viewSpan.getStyle('display') != 'none') {
136
- return null;
137
- }
138
- } else if (element.childCount > 1) {
139
- return null;
140
- }
141
- return {
142
- name: true,
143
- styles: [
144
- ...hasPageBreakBefore ? [
145
- 'page-break-before'
146
- ] : [],
147
- ...hasPageBreakAfter ? [
148
- 'page-break-after'
149
- ] : []
150
- ],
151
- ...element.hasClass('page-break') && {
152
- classes: [
153
- 'page-break'
154
- ]
155
- }
156
- };
157
- },
158
- model: 'pageBreak',
159
- // This conversion must be checked before <br> conversion because some editors use
160
- // <br style="page-break-before:always"> as a page break marker.
161
- converterPriority: 'high'
162
- });
163
- editor.commands.add('pageBreak', new PageBreakCommand(editor));
164
- }
165
- }
66
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
67
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
68
+ */
166
69
  /**
167
- * Converts a given {@link module:engine/view/element~ViewElement} to a page break widget:
168
- * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to
169
- * recognize the page break widget element.
170
- * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
171
- */ function toPageBreakWidget(viewElement, writer, label) {
172
- writer.setCustomProperty('pageBreak', true, viewElement);
173
- return toWidget(viewElement, writer, {
174
- label
175
- });
70
+ * @module page-break/pagebreakediting
71
+ */
72
+ /**
73
+ * The page break editing feature.
74
+ */
75
+ var PageBreakEditing = class extends Plugin {
76
+ /**
77
+ * @inheritDoc
78
+ */
79
+ static get pluginName() {
80
+ return "PageBreakEditing";
81
+ }
82
+ /**
83
+ * @inheritDoc
84
+ * @internal
85
+ */
86
+ static get licenseFeatureCode() {
87
+ return "PB";
88
+ }
89
+ /**
90
+ * @inheritDoc
91
+ */
92
+ static get isOfficialPlugin() {
93
+ return true;
94
+ }
95
+ /**
96
+ * @inheritDoc
97
+ */
98
+ static get isPremiumPlugin() {
99
+ return true;
100
+ }
101
+ /**
102
+ * @inheritDoc
103
+ */
104
+ init() {
105
+ const editor = this.editor;
106
+ const schema = editor.model.schema;
107
+ const t = editor.t;
108
+ const conversion = editor.conversion;
109
+ schema.register("pageBreak", { inheritAllFrom: "$blockObject" });
110
+ conversion.for("dataDowncast").elementToStructure({
111
+ model: "pageBreak",
112
+ view: (modelElement, { writer }) => {
113
+ return writer.createContainerElement("div", {
114
+ class: "page-break",
115
+ style: "page-break-after: always"
116
+ }, writer.createContainerElement("span", { style: "display: none" }));
117
+ }
118
+ });
119
+ conversion.for("editingDowncast").elementToStructure({
120
+ model: "pageBreak",
121
+ view: (modelElement, { writer }) => {
122
+ const label = t("Page break");
123
+ const viewWrapper = writer.createContainerElement("div");
124
+ const viewLabelElement = writer.createRawElement("span", { class: "page-break__label" }, function(domElement) {
125
+ domElement.innerText = t("Page break");
126
+ });
127
+ writer.addClass("page-break", viewWrapper);
128
+ writer.insert(writer.createPositionAt(viewWrapper, 0), viewLabelElement);
129
+ return toPageBreakWidget(viewWrapper, writer, label);
130
+ }
131
+ });
132
+ conversion.for("upcast").elementToElement({
133
+ view: (element) => {
134
+ const hasPageBreakBefore = element.getStyle("page-break-before") == "always";
135
+ const hasPageBreakAfter = element.getStyle("page-break-after") == "always";
136
+ if (!hasPageBreakBefore && !hasPageBreakAfter) return null;
137
+ if (element.childCount == 1) {
138
+ const viewSpan = element.getChild(0);
139
+ if (!viewSpan.is("element", "span") || viewSpan.getStyle("display") != "none") return null;
140
+ } else if (element.childCount > 1) return null;
141
+ return {
142
+ name: true,
143
+ styles: [...hasPageBreakBefore ? ["page-break-before"] : [], ...hasPageBreakAfter ? ["page-break-after"] : []],
144
+ ...element.hasClass("page-break") && { classes: ["page-break"] }
145
+ };
146
+ },
147
+ model: "pageBreak",
148
+ converterPriority: "high"
149
+ });
150
+ editor.commands.add("pageBreak", new PageBreakCommand(editor));
151
+ }
152
+ };
153
+ /**
154
+ * Converts a given {@link module:engine/view/element~ViewElement} to a page break widget:
155
+ * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to
156
+ * recognize the page break widget element.
157
+ * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
158
+ */
159
+ function toPageBreakWidget(viewElement, writer, label) {
160
+ writer.setCustomProperty("pageBreak", true, viewElement);
161
+ return toWidget(viewElement, writer, { label });
176
162
  }
177
163
 
178
164
  /**
179
- * The page break UI plugin.
180
- */ class PageBreakUI extends Plugin {
181
- /**
182
- * @inheritDoc
183
- */ static get pluginName() {
184
- return 'PageBreakUI';
185
- }
186
- /**
187
- * @inheritDoc
188
- */ static get isOfficialPlugin() {
189
- return true;
190
- }
191
- /**
192
- * @inheritDoc
193
- */ init() {
194
- const editor = this.editor;
195
- // Add pageBreak button to feature components.
196
- editor.ui.componentFactory.add('pageBreak', ()=>{
197
- const view = this._createButton(ButtonView);
198
- view.set({
199
- tooltip: true
200
- });
201
- return view;
202
- });
203
- editor.ui.componentFactory.add('menuBar:pageBreak', ()=>this._createButton(MenuBarMenuListItemButtonView));
204
- }
205
- /**
206
- * Creates a button for page break command to use either in toolbar or in menu bar.
207
- */ _createButton(ButtonClass) {
208
- const editor = this.editor;
209
- const locale = editor.locale;
210
- const command = editor.commands.get('pageBreak');
211
- const view = new ButtonClass(editor.locale);
212
- const t = locale.t;
213
- view.set({
214
- label: t('Page break'),
215
- icon: IconPageBreak
216
- });
217
- view.bind('isEnabled').to(command, 'isEnabled');
218
- // Execute the command.
219
- this.listenTo(view, 'execute', ()=>{
220
- editor.execute('pageBreak');
221
- editor.editing.view.focus();
222
- });
223
- return view;
224
- }
225
- }
165
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
166
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
167
+ */
168
+ /**
169
+ * @module page-break/pagebreakui
170
+ */
171
+ /**
172
+ * The page break UI plugin.
173
+ */
174
+ var PageBreakUI = class extends Plugin {
175
+ /**
176
+ * @inheritDoc
177
+ */
178
+ static get pluginName() {
179
+ return "PageBreakUI";
180
+ }
181
+ /**
182
+ * @inheritDoc
183
+ */
184
+ static get isOfficialPlugin() {
185
+ return true;
186
+ }
187
+ /**
188
+ * @inheritDoc
189
+ */
190
+ init() {
191
+ const editor = this.editor;
192
+ editor.ui.componentFactory.add("pageBreak", () => {
193
+ const view = this._createButton(ButtonView);
194
+ view.set({ tooltip: true });
195
+ return view;
196
+ });
197
+ editor.ui.componentFactory.add("menuBar:pageBreak", () => this._createButton(MenuBarMenuListItemButtonView));
198
+ }
199
+ /**
200
+ * Creates a button for page break command to use either in toolbar or in menu bar.
201
+ */
202
+ _createButton(ButtonClass) {
203
+ const editor = this.editor;
204
+ const locale = editor.locale;
205
+ const command = editor.commands.get("pageBreak");
206
+ const view = new ButtonClass(editor.locale);
207
+ const t = locale.t;
208
+ view.set({
209
+ label: t("Page break"),
210
+ icon: IconPageBreak
211
+ });
212
+ view.bind("isEnabled").to(command, "isEnabled");
213
+ this.listenTo(view, "execute", () => {
214
+ editor.execute("pageBreak");
215
+ editor.editing.view.focus();
216
+ });
217
+ return view;
218
+ }
219
+ };
226
220
 
227
221
  /**
228
- * The page break feature.
229
- *
230
- * It provides the possibility to insert a page break into the rich-text editor.
231
- *
232
- * For a detailed overview, check the {@glink features/page-break Page break feature} documentation.
233
- */ class PageBreak extends Plugin {
234
- /**
235
- * @inheritDoc
236
- */ static get requires() {
237
- return [
238
- PageBreakEditing,
239
- PageBreakUI,
240
- Widget
241
- ];
242
- }
243
- /**
244
- * @inheritDoc
245
- */ static get pluginName() {
246
- return 'PageBreak';
247
- }
248
- /**
249
- * @inheritDoc
250
- */ static get isOfficialPlugin() {
251
- return true;
252
- }
253
- }
222
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
223
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
224
+ */
225
+ /**
226
+ * @module page-break/pagebreak
227
+ */
228
+ /**
229
+ * The page break feature.
230
+ *
231
+ * It provides the possibility to insert a page break into the rich-text editor.
232
+ *
233
+ * For a detailed overview, check the {@glink features/page-break Page break feature} documentation.
234
+ */
235
+ var PageBreak = class extends Plugin {
236
+ /**
237
+ * @inheritDoc
238
+ */
239
+ static get requires() {
240
+ return [
241
+ PageBreakEditing,
242
+ PageBreakUI,
243
+ Widget
244
+ ];
245
+ }
246
+ /**
247
+ * @inheritDoc
248
+ */
249
+ static get pluginName() {
250
+ return "PageBreak";
251
+ }
252
+ /**
253
+ * @inheritDoc
254
+ */
255
+ static get isOfficialPlugin() {
256
+ return true;
257
+ }
258
+ };
259
+
260
+ /**
261
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
262
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
263
+ */
254
264
 
255
265
  export { PageBreak, PageBreakCommand, PageBreakEditing, PageBreakUI };
256
- //# sourceMappingURL=index.js.map
266
+ //# sourceMappingURL=index.js.map