@ckeditor/ckeditor5-paragraph 48.2.0-alpha.7 → 48.3.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.
- package/dist/augmentation.d.ts +12 -12
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +283 -277
- package/dist/index.js.map +1 -1
- package/dist/insertparagraphcommand.d.ts +40 -40
- package/dist/paragraph.d.ts +61 -61
- package/dist/paragraphbuttonui.d.ts +31 -31
- package/dist/paragraphcommand.d.ts +33 -33
- package/package.json +6 -6
- package/dist/index.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2,292 +2,298 @@
|
|
|
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
|
|
6
|
-
import { first } from
|
|
7
|
-
import { ButtonView } from
|
|
8
|
-
import { IconParagraph } from
|
|
5
|
+
import { Command, Plugin } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { first } from "@ckeditor/ckeditor5-utils";
|
|
7
|
+
import { ButtonView } from "@ckeditor/ckeditor5-ui";
|
|
8
|
+
import { IconParagraph } from "@ckeditor/ckeditor5-icons";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/ refresh() {
|
|
21
|
-
const model = this.editor.model;
|
|
22
|
-
const document = model.document;
|
|
23
|
-
const block = first(document.selection.getSelectedBlocks());
|
|
24
|
-
this.value = !!block && block.is('element', 'paragraph');
|
|
25
|
-
this.isEnabled = !!block && checkCanBecomeParagraph(block, model.schema);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Executes the command. All the blocks (see {@link module:engine/model/schema~ModelSchema}) in the selection
|
|
29
|
-
* will be turned to paragraphs.
|
|
30
|
-
*
|
|
31
|
-
* @fires execute
|
|
32
|
-
* @param options Options for the executed command.
|
|
33
|
-
* @param options.selection The selection that the command should be applied to. By default,
|
|
34
|
-
* if not provided, the command is applied to the {@link module:engine/model/document~ModelDocument#selection}.
|
|
35
|
-
*/ execute(options = {}) {
|
|
36
|
-
const model = this.editor.model;
|
|
37
|
-
const document = model.document;
|
|
38
|
-
const selection = options.selection || document.selection;
|
|
39
|
-
// Don't execute command if selection is in non-editable place.
|
|
40
|
-
if (!model.canEditAt(selection)) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
model.change((writer)=>{
|
|
44
|
-
const blocks = selection.getSelectedBlocks();
|
|
45
|
-
for (const block of blocks){
|
|
46
|
-
if (!block.is('element', 'paragraph') && checkCanBecomeParagraph(block, model.schema)) {
|
|
47
|
-
writer.rename(block, 'paragraph');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
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 paragraph/paragraphcommand
|
|
16
|
+
*/
|
|
53
17
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
18
|
+
* The paragraph command.
|
|
19
|
+
*/
|
|
20
|
+
var ParagraphCommand = class extends Command {
|
|
21
|
+
constructor(editor) {
|
|
22
|
+
super(editor);
|
|
23
|
+
this._isEnabledBasedOnSelection = false;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
refresh() {
|
|
29
|
+
const model = this.editor.model;
|
|
30
|
+
const document = model.document;
|
|
31
|
+
const block = first(document.selection.getSelectedBlocks());
|
|
32
|
+
this.value = !!block && block.is("element", "paragraph");
|
|
33
|
+
this.isEnabled = !!block && checkCanBecomeParagraph(block, model.schema);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Executes the command. All the blocks (see {@link module:engine/model/schema~ModelSchema}) in the selection
|
|
37
|
+
* will be turned to paragraphs.
|
|
38
|
+
*
|
|
39
|
+
* @fires execute
|
|
40
|
+
* @param options Options for the executed command.
|
|
41
|
+
* @param options.selection The selection that the command should be applied to. By default,
|
|
42
|
+
* if not provided, the command is applied to the {@link module:engine/model/document~ModelDocument#selection}.
|
|
43
|
+
*/
|
|
44
|
+
execute(options = {}) {
|
|
45
|
+
const model = this.editor.model;
|
|
46
|
+
const document = model.document;
|
|
47
|
+
const selection = options.selection || document.selection;
|
|
48
|
+
if (!model.canEditAt(selection)) return;
|
|
49
|
+
model.change((writer) => {
|
|
50
|
+
const blocks = selection.getSelectedBlocks();
|
|
51
|
+
for (const block of blocks) if (!block.is("element", "paragraph") && checkCanBecomeParagraph(block, model.schema)) writer.rename(block, "paragraph");
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the given block can be replaced by a paragraph.
|
|
57
|
+
*
|
|
58
|
+
* @param block A block to be tested.
|
|
59
|
+
* @param schema The schema of the document.
|
|
60
|
+
*/
|
|
61
|
+
function checkCanBecomeParagraph(block, schema) {
|
|
62
|
+
return schema.checkChild(block.parent, "paragraph") && !schema.isObject(block);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// <paragraph>[]</paragraph> ---> <paragraph></paragraph><paragraph>[]</paragraph>
|
|
130
|
-
// <paragraph>foo[]</paragraph> ---> <paragraph>foo</paragraph><paragraph>[]</paragraph>
|
|
131
|
-
if (positionParent.isEmpty || isTextAllowed && position.isAtEnd) {
|
|
132
|
-
return model.createPositionAfter(positionParent);
|
|
133
|
-
}
|
|
134
|
-
// At the start of $block with text.
|
|
135
|
-
// <paragraph>[]foo</paragraph> ---> <paragraph>[]</paragraph><paragraph>foo</paragraph>
|
|
136
|
-
if (!positionParent.isEmpty && isTextAllowed && position.isAtStart) {
|
|
137
|
-
return model.createPositionBefore(positionParent);
|
|
138
|
-
}
|
|
139
|
-
return writer.split(position, allowedParent).position;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
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
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* @module paragraph/insertparagraphcommand
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* The insert paragraph command. It inserts a new paragraph at a specific
|
|
74
|
+
* {@link module:engine/model/position~ModelPosition document position}.
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Insert a new paragraph before an element in the document.
|
|
78
|
+
* editor.execute( 'insertParagraph', {
|
|
79
|
+
* position: editor.model.createPositionBefore( element )
|
|
80
|
+
* } );
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* If a paragraph is disallowed in the context of the specific position, the command
|
|
84
|
+
* will attempt to split position ancestors to find a place where it is possible
|
|
85
|
+
* to insert a paragraph.
|
|
86
|
+
*
|
|
87
|
+
* **Note**: This command moves the selection to the inserted paragraph.
|
|
88
|
+
*/
|
|
89
|
+
var InsertParagraphCommand = class extends Command {
|
|
90
|
+
constructor(editor) {
|
|
91
|
+
super(editor);
|
|
92
|
+
this._isEnabledBasedOnSelection = false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Executes the command.
|
|
96
|
+
*
|
|
97
|
+
* @param options Options for the executed command.
|
|
98
|
+
* @param options.position The model position at which the new paragraph will be inserted.
|
|
99
|
+
* @param options.attributes Attributes keys and values to set on a inserted paragraph.
|
|
100
|
+
* @fires execute
|
|
101
|
+
*/
|
|
102
|
+
execute(options) {
|
|
103
|
+
const model = this.editor.model;
|
|
104
|
+
const attributes = options.attributes;
|
|
105
|
+
let position = options.position;
|
|
106
|
+
if (!model.canEditAt(position)) return null;
|
|
107
|
+
return model.change((writer) => {
|
|
108
|
+
position = this._findPositionToInsertParagraph(position, writer);
|
|
109
|
+
if (!position) return null;
|
|
110
|
+
const paragraph = writer.createElement("paragraph");
|
|
111
|
+
if (attributes) model.schema.setAllowedAttributes(paragraph, attributes, writer);
|
|
112
|
+
model.insertContent(paragraph, position);
|
|
113
|
+
writer.setSelection(paragraph, "in");
|
|
114
|
+
return writer.createPositionAt(paragraph, 0);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns the best position to insert a new paragraph.
|
|
119
|
+
*/
|
|
120
|
+
_findPositionToInsertParagraph(position, writer) {
|
|
121
|
+
const model = this.editor.model;
|
|
122
|
+
if (model.schema.checkChild(position, "paragraph")) return position;
|
|
123
|
+
const allowedParent = model.schema.findAllowedParent(position, "paragraph");
|
|
124
|
+
if (!allowedParent) return null;
|
|
125
|
+
const positionParent = position.parent;
|
|
126
|
+
const isTextAllowed = model.schema.checkChild(positionParent, "$text");
|
|
127
|
+
if (positionParent.isEmpty || isTextAllowed && position.isAtEnd) return model.createPositionAfter(positionParent);
|
|
128
|
+
if (!positionParent.isEmpty && isTextAllowed && position.isAtStart) return model.createPositionBefore(positionParent);
|
|
129
|
+
return writer.split(position, allowedParent).position;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
142
132
|
|
|
143
133
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
134
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
135
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* @module paragraph/paragraph
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* The paragraph feature for the editor.
|
|
142
|
+
*
|
|
143
|
+
* It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
|
|
144
|
+
*
|
|
145
|
+
* It also brings two editors commands:
|
|
146
|
+
*
|
|
147
|
+
* * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
|
|
148
|
+
* blocks in the model selection into paragraphs.
|
|
149
|
+
* * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
|
|
150
|
+
* that inserts a new paragraph at a specified location in the model.
|
|
151
|
+
*/
|
|
152
|
+
var Paragraph = class Paragraph extends Plugin {
|
|
153
|
+
/**
|
|
154
|
+
* @inheritDoc
|
|
155
|
+
*/
|
|
156
|
+
static get pluginName() {
|
|
157
|
+
return "Paragraph";
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @inheritDoc
|
|
161
|
+
*/
|
|
162
|
+
static get isOfficialPlugin() {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @inheritDoc
|
|
167
|
+
*/
|
|
168
|
+
init() {
|
|
169
|
+
const editor = this.editor;
|
|
170
|
+
const model = editor.model;
|
|
171
|
+
editor.commands.add("paragraph", new ParagraphCommand(editor));
|
|
172
|
+
editor.commands.add("insertParagraph", new InsertParagraphCommand(editor));
|
|
173
|
+
model.schema.register("paragraph", { inheritAllFrom: "$block" });
|
|
174
|
+
editor.conversion.elementToElement({
|
|
175
|
+
model: "paragraph",
|
|
176
|
+
view: "p"
|
|
177
|
+
});
|
|
178
|
+
editor.conversion.for("upcast").elementToElement({
|
|
179
|
+
model: (viewElement, { writer }) => {
|
|
180
|
+
if (!Paragraph.paragraphLikeElements.has(viewElement.name)) return null;
|
|
181
|
+
if (viewElement.isEmpty) return null;
|
|
182
|
+
return writer.createElement("paragraph");
|
|
183
|
+
},
|
|
184
|
+
view: /.+/,
|
|
185
|
+
converterPriority: "low"
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* A list of element names which should be treated by the autoparagraphing algorithms as
|
|
190
|
+
* paragraph-like. This means that e.g. the following content:
|
|
191
|
+
*
|
|
192
|
+
* ```html
|
|
193
|
+
* <h1>Foo</h1>
|
|
194
|
+
* <table>
|
|
195
|
+
* <tr>
|
|
196
|
+
* <td>X</td>
|
|
197
|
+
* <td>
|
|
198
|
+
* <ul>
|
|
199
|
+
* <li>Y</li>
|
|
200
|
+
* <li>Z</li>
|
|
201
|
+
* </ul>
|
|
202
|
+
* </td>
|
|
203
|
+
* </tr>
|
|
204
|
+
* </table>
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
|
|
208
|
+
* Hence, if none of the features is going to convert those elements the above content will be automatically handled
|
|
209
|
+
* by the paragraph feature and converted to:
|
|
210
|
+
*
|
|
211
|
+
* ```html
|
|
212
|
+
* <p>Foo</p>
|
|
213
|
+
* <p>X</p>
|
|
214
|
+
* <p>Y</p>
|
|
215
|
+
* <p>Z</p>
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
|
|
219
|
+
* have a priority upon conversion.
|
|
220
|
+
*/
|
|
221
|
+
static paragraphLikeElements = new Set([
|
|
222
|
+
"blockquote",
|
|
223
|
+
"dd",
|
|
224
|
+
"div",
|
|
225
|
+
"dt",
|
|
226
|
+
"h1",
|
|
227
|
+
"h2",
|
|
228
|
+
"h3",
|
|
229
|
+
"h4",
|
|
230
|
+
"h5",
|
|
231
|
+
"h6",
|
|
232
|
+
"li",
|
|
233
|
+
"p",
|
|
234
|
+
"td",
|
|
235
|
+
"th"
|
|
236
|
+
]);
|
|
237
|
+
};
|
|
245
238
|
|
|
246
239
|
/**
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
240
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
241
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
242
|
+
*/
|
|
243
|
+
/**
|
|
244
|
+
* @module paragraph/paragraphbuttonui
|
|
245
|
+
*/
|
|
246
|
+
/**
|
|
247
|
+
* This plugin defines the `'paragraph'` button. It can be used together with
|
|
248
|
+
* {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown.
|
|
249
|
+
*
|
|
250
|
+
* This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must
|
|
251
|
+
* be added manually.
|
|
252
|
+
*
|
|
253
|
+
* ```ts
|
|
254
|
+
* ClassicEditor
|
|
255
|
+
* .create( {
|
|
256
|
+
* plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
|
|
257
|
+
* toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
|
|
258
|
+
* } )
|
|
259
|
+
* .then( ... )
|
|
260
|
+
* .catch( ... );
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
var ParagraphButtonUI = class extends Plugin {
|
|
264
|
+
/**
|
|
265
|
+
* @inheritDoc
|
|
266
|
+
*/
|
|
267
|
+
static get requires() {
|
|
268
|
+
return [Paragraph];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @inheritDoc
|
|
272
|
+
*/
|
|
273
|
+
init() {
|
|
274
|
+
const editor = this.editor;
|
|
275
|
+
const t = editor.t;
|
|
276
|
+
editor.ui.componentFactory.add("paragraph", (locale) => {
|
|
277
|
+
const view = new ButtonView(locale);
|
|
278
|
+
const command = editor.commands.get("paragraph");
|
|
279
|
+
view.label = t("Paragraph");
|
|
280
|
+
view.icon = IconParagraph;
|
|
281
|
+
view.tooltip = true;
|
|
282
|
+
view.isToggleable = true;
|
|
283
|
+
view.bind("isEnabled").to(command);
|
|
284
|
+
view.bind("isOn").to(command, "value");
|
|
285
|
+
view.on("execute", () => {
|
|
286
|
+
editor.execute("paragraph");
|
|
287
|
+
});
|
|
288
|
+
return view;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
295
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
296
|
+
*/
|
|
291
297
|
|
|
292
298
|
export { InsertParagraphCommand, Paragraph, ParagraphButtonUI, ParagraphCommand };
|
|
293
|
-
//# sourceMappingURL=index.js.map
|
|
299
|
+
//# sourceMappingURL=index.js.map
|