@ckeditor/ckeditor5-horizontal-line 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.
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import type { HorizontalLine, HorizontalLineCommand, HorizontalLineEditing, HorizontalLineUI } from './index.js';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [HorizontalLine.pluginName]: HorizontalLine;
9
- [HorizontalLineEditing.pluginName]: HorizontalLineEditing;
10
- [HorizontalLineUI.pluginName]: HorizontalLineUI;
11
- }
12
- interface CommandsMap {
13
- horizontalLine: HorizontalLineCommand;
14
- }
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import type { HorizontalLine, HorizontalLineCommand, HorizontalLineEditing, HorizontalLineUI } from "./index.js";
6
+ declare module "@ckeditor/ckeditor5-core" {
7
+ interface PluginsMap {
8
+ [HorizontalLine.pluginName]: HorizontalLine;
9
+ [HorizontalLineEditing.pluginName]: HorizontalLineEditing;
10
+ [HorizontalLineUI.pluginName]: HorizontalLineUI;
11
+ }
12
+ interface CommandsMap {
13
+ horizontalLine: HorizontalLineCommand;
14
+ }
15
15
  }
@@ -1,32 +1,32 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module horizontal-line/horizontalline
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { Widget } from '@ckeditor/ckeditor5-widget';
10
- import { HorizontalLineEditing } from './horizontallineediting.js';
11
- import { HorizontalLineUI } from './horizontallineui.js';
6
+ * @module horizontal-line/horizontalline
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { Widget } from "@ckeditor/ckeditor5-widget";
10
+ import { HorizontalLineEditing } from "./horizontallineediting.js";
11
+ import { HorizontalLineUI } from "./horizontallineui.js";
12
12
  /**
13
- * The horizontal line feature.
14
- *
15
- * It provides the possibility to insert a horizontal line into the rich-text editor.
16
- *
17
- * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.
18
- */
13
+ * The horizontal line feature.
14
+ *
15
+ * It provides the possibility to insert a horizontal line into the rich-text editor.
16
+ *
17
+ * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.
18
+ */
19
19
  export declare class HorizontalLine extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get requires(): readonly [typeof HorizontalLineEditing, typeof HorizontalLineUI, typeof Widget];
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName(): "HorizontalLine";
28
- /**
29
- * @inheritDoc
30
- */
31
- static get isOfficialPlugin(): true;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires(): PluginDependenciesOf<[HorizontalLineEditing, HorizontalLineUI, Widget]>;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName(): "HorizontalLine";
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static override get isOfficialPlugin(): true;
32
32
  }
@@ -1,28 +1,28 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { Command } from '@ckeditor/ckeditor5-core';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { Command } from "@ckeditor/ckeditor5-core";
6
6
  /**
7
- * The horizontal line command.
8
- *
9
- * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.
10
- *
11
- * To insert a horizontal line at the current selection, execute the command:
12
- *
13
- * ```ts
14
- * editor.execute( 'horizontalLine' );
15
- * ```
16
- */
7
+ * The horizontal line command.
8
+ *
9
+ * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.
10
+ *
11
+ * To insert a horizontal line at the current selection, execute the command:
12
+ *
13
+ * ```ts
14
+ * editor.execute( 'horizontalLine' );
15
+ * ```
16
+ */
17
17
  export declare class HorizontalLineCommand extends Command {
18
- /**
19
- * @inheritDoc
20
- */
21
- refresh(): void;
22
- /**
23
- * Executes the command.
24
- *
25
- * @fires execute
26
- */
27
- execute(): void;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ override refresh(): void;
22
+ /**
23
+ * Executes the command.
24
+ *
25
+ * @fires execute
26
+ */
27
+ override execute(): void;
28
28
  }
@@ -1,26 +1,26 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module horizontal-line/horizontallineediting
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import '../theme/horizontalline.css';
6
+ * @module horizontal-line/horizontallineediting
7
+ */
8
+ import { Plugin } from "@ckeditor/ckeditor5-core";
9
+ import "../theme/horizontalline.css";
10
10
  /**
11
- * The horizontal line editing feature.
12
- */
11
+ * The horizontal line editing feature.
12
+ */
13
13
  export declare class HorizontalLineEditing extends Plugin {
14
- /**
15
- * @inheritDoc
16
- */
17
- static get pluginName(): "HorizontalLineEditing";
18
- /**
19
- * @inheritDoc
20
- */
21
- static get isOfficialPlugin(): true;
22
- /**
23
- * @inheritDoc
24
- */
25
- init(): void;
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): "HorizontalLineEditing";
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static override get isOfficialPlugin(): true;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init(): void;
26
26
  }
@@ -1,29 +1,29 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module horizontal-line/horizontallineui
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
6
+ * @module horizontal-line/horizontallineui
7
+ */
8
+ import { Plugin } from "@ckeditor/ckeditor5-core";
9
9
  /**
10
- * The horizontal line UI plugin.
11
- */
10
+ * The horizontal line UI plugin.
11
+ */
12
12
  export declare class HorizontalLineUI extends Plugin {
13
- /**
14
- * @inheritDoc
15
- */
16
- static get pluginName(): "HorizontalLineUI";
17
- /**
18
- * @inheritDoc
19
- */
20
- static get isOfficialPlugin(): true;
21
- /**
22
- * @inheritDoc
23
- */
24
- init(): void;
25
- /**
26
- * Creates a button for horizontal line command to use either in toolbar or in menu bar.
27
- */
28
- private _createButton;
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "HorizontalLineUI";
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static override get isOfficialPlugin(): true;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ init(): void;
25
+ /**
26
+ * Creates a button for horizontal line command to use either in toolbar or in menu bar.
27
+ */
28
+ private _createButton;
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../theme/horizontalline.css","index.css"],"names":[],"mappings":";;;;AAMA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,UAAA,CAAA,IAAA,CAAA;ACLA,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI;AACpB;;ADSA,CAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA;ACNA,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM;AACxB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;AACrB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACX,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC;AACb,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG;AACb,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK;AACvB;;AAEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n\n.ck-editor__editable .ck-horizontal-line {\n\t/* Necessary to render properly next to floated objects, e.g. side image case. */\n\tdisplay: flow-root;\n}\n\n.ck-content hr {\n\tdisplay: inline-block;\n\twidth: 100%;\n\tmargin: 15px 0;\n\theight: 4px;\n\tbackground: hsl(0, 0%, 87%);\n\tborder: 0;\n\tvertical-align: middle;\n}\n",".ck-editor__editable .ck-horizontal-line {\n display: flow-root;\n}\n\n.ck-content hr {\n vertical-align: middle;\n background: #dedede;\n border: 0;\n width: 100%;\n height: 4px;\n margin: 15px 0;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
1
+ {"version":3,"sources":["../theme/horizontalline.css","index.css"],"names":[],"mappings":";;;;AAMA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,UAAA,CAAA,IAAA,CAAA;ACLA,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI;AACpB;;ADSA,CAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA;ACNA,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM;AACxB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;AACrB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACX,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC;AACb,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG;AACb,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK;AACvB;;AAEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n\n.ck-editor__editable .ck-horizontal-line {\n\t/* Necessary to render properly next to floated objects, e.g. side image case. */\n\tdisplay: flow-root;\n}\n\n.ck-content hr {\n\tdisplay: inline-block;\n\twidth: 100%;\n\tmargin: 15px 0;\n\theight: 4px;\n\tbackground: hsl(0, 0%, 87%);\n\tborder: 0;\n\tvertical-align: middle;\n}\n",".ck-editor__editable .ck-horizontal-line {\n display: flow-root;\n}\n\n.ck-content hr {\n vertical-align: middle;\n background: #dedede;\n border: 0;\n width: 100%;\n height: 4px;\n margin: 15px 0;\n display: inline-block;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module horizontal-line
7
- */
8
- export { HorizontalLine } from './horizontalline.js';
9
- export { HorizontalLineEditing } from './horizontallineediting.js';
10
- export { HorizontalLineUI } from './horizontallineui.js';
11
- export { HorizontalLineCommand } from './horizontallinecommand.js';
12
- import './augmentation.js';
6
+ * @module horizontal-line
7
+ */
8
+ export { HorizontalLine } from "./horizontalline.js";
9
+ export { HorizontalLineEditing } from "./horizontallineediting.js";
10
+ export { HorizontalLineUI } from "./horizontallineui.js";
11
+ export { HorizontalLineCommand } from "./horizontallinecommand.js";
12
+ import "./augmentation.js";
package/dist/index.js CHANGED
@@ -2,204 +2,240 @@
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 { IconHorizontalLine } 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 { IconHorizontalLine } from "@ckeditor/ckeditor5-icons";
8
+ import { ButtonView, MenuBarMenuListItemButtonView } from "@ckeditor/ckeditor5-ui";
9
9
 
10
10
  /**
11
- * The horizontal line command.
12
- *
13
- * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.
14
- *
15
- * To insert a horizontal line at the current selection, execute the command:
16
- *
17
- * ```ts
18
- * editor.execute( 'horizontalLine' );
19
- * ```
20
- */ class HorizontalLineCommand extends Command {
21
- /**
22
- * @inheritDoc
23
- */ refresh() {
24
- const model = this.editor.model;
25
- const schema = model.schema;
26
- const selection = model.document.selection;
27
- this.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);
28
- }
29
- /**
30
- * Executes the command.
31
- *
32
- * @fires execute
33
- */ execute() {
34
- const model = this.editor.model;
35
- model.change((writer)=>{
36
- const horizontalElement = writer.createElement('horizontalLine');
37
- model.insertObject(horizontalElement, null, null, {
38
- setSelection: 'after'
39
- });
40
- });
41
- }
42
- }
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
+ * The horizontal line command.
16
+ *
17
+ * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.
18
+ *
19
+ * To insert a horizontal line at the current selection, execute the command:
20
+ *
21
+ * ```ts
22
+ * editor.execute( 'horizontalLine' );
23
+ * ```
24
+ */
25
+ var HorizontalLineCommand = class extends Command {
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ refresh() {
30
+ const model = this.editor.model;
31
+ const schema = model.schema;
32
+ const selection = model.document.selection;
33
+ this.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);
34
+ }
35
+ /**
36
+ * Executes the command.
37
+ *
38
+ * @fires execute
39
+ */
40
+ execute() {
41
+ const model = this.editor.model;
42
+ model.change((writer) => {
43
+ const horizontalElement = writer.createElement("horizontalLine");
44
+ model.insertObject(horizontalElement, null, null, { setSelection: "after" });
45
+ });
46
+ }
47
+ };
43
48
  /**
44
- * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.
45
- *
46
- * @param model Model instance.
47
- */ function isHorizontalLineAllowedInParent(selection, schema, model) {
48
- const parent = getInsertHorizontalLineParent(selection, model);
49
- return schema.checkChild(parent, 'horizontalLine');
49
+ * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.
50
+ *
51
+ * @param model Model instance.
52
+ */
53
+ function isHorizontalLineAllowedInParent(selection, schema, model) {
54
+ const parent = getInsertHorizontalLineParent(selection, model);
55
+ return schema.checkChild(parent, "horizontalLine");
50
56
  }
51
57
  /**
52
- * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be
53
- * placed there.
54
- *
55
- * @param model Model instance.
56
- */ function getInsertHorizontalLineParent(selection, model) {
57
- const insertionRange = findOptimalInsertionRange(selection, model);
58
- const parent = insertionRange.start.parent;
59
- if (parent.isEmpty && !parent.is('rootElement')) {
60
- return parent.parent;
61
- }
62
- return parent;
58
+ * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be
59
+ * placed there.
60
+ *
61
+ * @param model Model instance.
62
+ */
63
+ function getInsertHorizontalLineParent(selection, model) {
64
+ const parent = findOptimalInsertionRange(selection, model).start.parent;
65
+ if (parent.isEmpty && !parent.is("rootElement")) return parent.parent;
66
+ return parent;
63
67
  }
64
68
 
65
69
  /**
66
- * The horizontal line editing feature.
67
- */ class HorizontalLineEditing extends Plugin {
68
- /**
69
- * @inheritDoc
70
- */ static get pluginName() {
71
- return 'HorizontalLineEditing';
72
- }
73
- /**
74
- * @inheritDoc
75
- */ static get isOfficialPlugin() {
76
- return true;
77
- }
78
- /**
79
- * @inheritDoc
80
- */ init() {
81
- const editor = this.editor;
82
- const schema = editor.model.schema;
83
- const t = editor.t;
84
- const conversion = editor.conversion;
85
- schema.register('horizontalLine', {
86
- inheritAllFrom: '$blockObject'
87
- });
88
- conversion.for('dataDowncast').elementToElement({
89
- model: 'horizontalLine',
90
- view: (modelElement, { writer })=>{
91
- return writer.createEmptyElement('hr');
92
- }
93
- });
94
- conversion.for('editingDowncast').elementToStructure({
95
- model: 'horizontalLine',
96
- view: (modelElement, { writer })=>{
97
- const label = t('Horizontal line');
98
- const viewWrapper = writer.createContainerElement('div', null, writer.createEmptyElement('hr'));
99
- writer.addClass('ck-horizontal-line', viewWrapper);
100
- writer.setCustomProperty('hr', true, viewWrapper);
101
- return toHorizontalLineWidget(viewWrapper, writer, label);
102
- }
103
- });
104
- conversion.for('upcast').elementToElement({
105
- view: 'hr',
106
- model: 'horizontalLine'
107
- });
108
- editor.commands.add('horizontalLine', new HorizontalLineCommand(editor));
109
- }
110
- }
70
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
71
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
72
+ */
73
+ /**
74
+ * @module horizontal-line/horizontallineediting
75
+ */
111
76
  /**
112
- * Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:
113
- * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to
114
- * recognize the horizontal line widget element.
115
- * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
116
- *
117
- * @param writer An instance of the view writer.
118
- */ function toHorizontalLineWidget(viewElement, writer, label) {
119
- writer.setCustomProperty('horizontalLine', true, viewElement);
120
- return toWidget(viewElement, writer, {
121
- label
122
- });
77
+ * The horizontal line editing feature.
78
+ */
79
+ var HorizontalLineEditing = class extends Plugin {
80
+ /**
81
+ * @inheritDoc
82
+ */
83
+ static get pluginName() {
84
+ return "HorizontalLineEditing";
85
+ }
86
+ /**
87
+ * @inheritDoc
88
+ */
89
+ static get isOfficialPlugin() {
90
+ return true;
91
+ }
92
+ /**
93
+ * @inheritDoc
94
+ */
95
+ init() {
96
+ const editor = this.editor;
97
+ const schema = editor.model.schema;
98
+ const t = editor.t;
99
+ const conversion = editor.conversion;
100
+ schema.register("horizontalLine", { inheritAllFrom: "$blockObject" });
101
+ conversion.for("dataDowncast").elementToElement({
102
+ model: "horizontalLine",
103
+ view: (modelElement, { writer }) => {
104
+ return writer.createEmptyElement("hr");
105
+ }
106
+ });
107
+ conversion.for("editingDowncast").elementToStructure({
108
+ model: "horizontalLine",
109
+ view: (modelElement, { writer }) => {
110
+ const label = t("Horizontal line");
111
+ const viewWrapper = writer.createContainerElement("div", null, writer.createEmptyElement("hr"));
112
+ writer.addClass("ck-horizontal-line", viewWrapper);
113
+ writer.setCustomProperty("hr", true, viewWrapper);
114
+ return toHorizontalLineWidget(viewWrapper, writer, label);
115
+ }
116
+ });
117
+ conversion.for("upcast").elementToElement({
118
+ view: "hr",
119
+ model: "horizontalLine"
120
+ });
121
+ editor.commands.add("horizontalLine", new HorizontalLineCommand(editor));
122
+ }
123
+ };
124
+ /**
125
+ * Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:
126
+ * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to
127
+ * recognize the horizontal line widget element.
128
+ * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
129
+ *
130
+ * @param writer An instance of the view writer.
131
+ */
132
+ function toHorizontalLineWidget(viewElement, writer, label) {
133
+ writer.setCustomProperty("horizontalLine", true, viewElement);
134
+ return toWidget(viewElement, writer, { label });
123
135
  }
124
136
 
125
137
  /**
126
- * The horizontal line UI plugin.
127
- */ class HorizontalLineUI extends Plugin {
128
- /**
129
- * @inheritDoc
130
- */ static get pluginName() {
131
- return 'HorizontalLineUI';
132
- }
133
- /**
134
- * @inheritDoc
135
- */ static get isOfficialPlugin() {
136
- return true;
137
- }
138
- /**
139
- * @inheritDoc
140
- */ init() {
141
- const editor = this.editor;
142
- // Add the `horizontalLine` button to feature components.
143
- editor.ui.componentFactory.add('horizontalLine', ()=>{
144
- const buttonView = this._createButton(ButtonView);
145
- buttonView.set({
146
- tooltip: true
147
- });
148
- return buttonView;
149
- });
150
- editor.ui.componentFactory.add('menuBar:horizontalLine', ()=>{
151
- return this._createButton(MenuBarMenuListItemButtonView);
152
- });
153
- }
154
- /**
155
- * Creates a button for horizontal line command to use either in toolbar or in menu bar.
156
- */ _createButton(ButtonClass) {
157
- const editor = this.editor;
158
- const locale = editor.locale;
159
- const command = editor.commands.get('horizontalLine');
160
- const view = new ButtonClass(editor.locale);
161
- const t = locale.t;
162
- view.set({
163
- label: t('Horizontal line'),
164
- icon: IconHorizontalLine
165
- });
166
- view.bind('isEnabled').to(command, 'isEnabled');
167
- // Execute the command.
168
- this.listenTo(view, 'execute', ()=>{
169
- editor.execute('horizontalLine');
170
- editor.editing.view.focus();
171
- });
172
- return view;
173
- }
174
- }
138
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
139
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
140
+ */
141
+ /**
142
+ * @module horizontal-line/horizontallineui
143
+ */
144
+ /**
145
+ * The horizontal line UI plugin.
146
+ */
147
+ var HorizontalLineUI = class extends Plugin {
148
+ /**
149
+ * @inheritDoc
150
+ */
151
+ static get pluginName() {
152
+ return "HorizontalLineUI";
153
+ }
154
+ /**
155
+ * @inheritDoc
156
+ */
157
+ static get isOfficialPlugin() {
158
+ return true;
159
+ }
160
+ /**
161
+ * @inheritDoc
162
+ */
163
+ init() {
164
+ const editor = this.editor;
165
+ editor.ui.componentFactory.add("horizontalLine", () => {
166
+ const buttonView = this._createButton(ButtonView);
167
+ buttonView.set({ tooltip: true });
168
+ return buttonView;
169
+ });
170
+ editor.ui.componentFactory.add("menuBar:horizontalLine", () => {
171
+ return this._createButton(MenuBarMenuListItemButtonView);
172
+ });
173
+ }
174
+ /**
175
+ * Creates a button for horizontal line command to use either in toolbar or in menu bar.
176
+ */
177
+ _createButton(ButtonClass) {
178
+ const editor = this.editor;
179
+ const locale = editor.locale;
180
+ const command = editor.commands.get("horizontalLine");
181
+ const view = new ButtonClass(editor.locale);
182
+ const t = locale.t;
183
+ view.set({
184
+ label: t("Horizontal line"),
185
+ icon: IconHorizontalLine
186
+ });
187
+ view.bind("isEnabled").to(command, "isEnabled");
188
+ this.listenTo(view, "execute", () => {
189
+ editor.execute("horizontalLine");
190
+ editor.editing.view.focus();
191
+ });
192
+ return view;
193
+ }
194
+ };
175
195
 
176
196
  /**
177
- * The horizontal line feature.
178
- *
179
- * It provides the possibility to insert a horizontal line into the rich-text editor.
180
- *
181
- * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.
182
- */ class HorizontalLine extends Plugin {
183
- /**
184
- * @inheritDoc
185
- */ static get requires() {
186
- return [
187
- HorizontalLineEditing,
188
- HorizontalLineUI,
189
- Widget
190
- ];
191
- }
192
- /**
193
- * @inheritDoc
194
- */ static get pluginName() {
195
- return 'HorizontalLine';
196
- }
197
- /**
198
- * @inheritDoc
199
- */ static get isOfficialPlugin() {
200
- return true;
201
- }
202
- }
197
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
198
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
199
+ */
200
+ /**
201
+ * @module horizontal-line/horizontalline
202
+ */
203
+ /**
204
+ * The horizontal line feature.
205
+ *
206
+ * It provides the possibility to insert a horizontal line into the rich-text editor.
207
+ *
208
+ * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.
209
+ */
210
+ var HorizontalLine = class extends Plugin {
211
+ /**
212
+ * @inheritDoc
213
+ */
214
+ static get requires() {
215
+ return [
216
+ HorizontalLineEditing,
217
+ HorizontalLineUI,
218
+ Widget
219
+ ];
220
+ }
221
+ /**
222
+ * @inheritDoc
223
+ */
224
+ static get pluginName() {
225
+ return "HorizontalLine";
226
+ }
227
+ /**
228
+ * @inheritDoc
229
+ */
230
+ static get isOfficialPlugin() {
231
+ return true;
232
+ }
233
+ };
234
+
235
+ /**
236
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
237
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
238
+ */
203
239
 
204
240
  export { HorizontalLine, HorizontalLineCommand, HorizontalLineEditing, HorizontalLineUI };
205
- //# sourceMappingURL=index.js.map
241
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js","../src/horizontallinecommand.ts","../src/horizontallineediting.ts","../src/horizontallineui.ts","../src/horizontalline.ts"],"names":["HorizontalLineCommand","Command","refresh","model","editor","schema","selection","document","isEnabled","isHorizontalLineAllowedInParent","execute","change","writer","horizontalElement","createElement","insertObject","setSelection","parent","getInsertHorizontalLineParent","checkChild","insertionRange","findOptimalInsertionRange","start","isEmpty","is","HorizontalLineEditing","Plugin","pluginName","isOfficialPlugin","init","t","conversion","register","inheritAllFrom","for","elementToElement","view","modelElement","createEmptyElement","elementToStructure","label","viewWrapper","createContainerElement","addClass","setCustomProperty","toHorizontalLineWidget","commands","add","viewElement","toWidget","HorizontalLineUI","ui","componentFactory","buttonView","_createButton","ButtonView","set","tooltip","MenuBarMenuListItemButtonView","ButtonClass","locale","command","get","icon","IconHorizontalLine","bind","to","listenTo","editing","focus","HorizontalLine","requires","Widget"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACtG,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AAC5E,MAAM,CAAC,CAAC,CAAC,UA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A,GAAA,CAA2BC,gBAAAA,CAAAA,CAAAA,CAAyB;AJ4JrD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CI3JL,MAAA,CAAO,IAAA;AACR,CAAA,CAAA,CAAA,CAAA;AACD;;AJ6JA,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACzF,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { findOptimalInsertionRange, toWidget, Widget } from '@ckeditor/ckeditor5-widget/dist/index.js';\nimport { IconHorizontalLine } from '@ckeditor/ckeditor5-icons/dist/index.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';\n\n/**\n * The horizontal line command.\n *\n * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.\n *\n * To insert a horizontal line at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'horizontalLine' );\n * ```\n */ class HorizontalLineCommand extends Command {\n /**\n\t * @inheritDoc\n\t */ refresh() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n this.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);\n }\n /**\n\t * Executes the command.\n\t *\n\t * @fires execute\n\t */ execute() {\n const model = this.editor.model;\n model.change((writer)=>{\n const horizontalElement = writer.createElement('horizontalLine');\n model.insertObject(horizontalElement, null, null, {\n setSelection: 'after'\n });\n });\n }\n}\n/**\n * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.\n *\n * @param model Model instance.\n */ function isHorizontalLineAllowedInParent(selection, schema, model) {\n const parent = getInsertHorizontalLineParent(selection, model);\n return schema.checkChild(parent, 'horizontalLine');\n}\n/**\n * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be\n * placed there.\n *\n * @param model Model instance.\n */ function getInsertHorizontalLineParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('rootElement')) {\n return parent.parent;\n }\n return parent;\n}\n\n/**\n * The horizontal line editing feature.\n */ class HorizontalLineEditing extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'HorizontalLineEditing';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.t;\n const conversion = editor.conversion;\n schema.register('horizontalLine', {\n inheritAllFrom: '$blockObject'\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'horizontalLine',\n view: (modelElement, { writer })=>{\n return writer.createEmptyElement('hr');\n }\n });\n conversion.for('editingDowncast').elementToStructure({\n model: 'horizontalLine',\n view: (modelElement, { writer })=>{\n const label = t('Horizontal line');\n const viewWrapper = writer.createContainerElement('div', null, writer.createEmptyElement('hr'));\n writer.addClass('ck-horizontal-line', viewWrapper);\n writer.setCustomProperty('hr', true, viewWrapper);\n return toHorizontalLineWidget(viewWrapper, writer, label);\n }\n });\n conversion.for('upcast').elementToElement({\n view: 'hr',\n model: 'horizontalLine'\n });\n editor.commands.add('horizontalLine', new HorizontalLineCommand(editor));\n }\n}\n/**\n * Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to\n * recognize the horizontal line widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n */ function toHorizontalLineWidget(viewElement, writer, label) {\n writer.setCustomProperty('horizontalLine', true, viewElement);\n return toWidget(viewElement, writer, {\n label\n });\n}\n\n/**\n * The horizontal line UI plugin.\n */ class HorizontalLineUI extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'HorizontalLineUI';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n // Add the `horizontalLine` button to feature components.\n editor.ui.componentFactory.add('horizontalLine', ()=>{\n const buttonView = this._createButton(ButtonView);\n buttonView.set({\n tooltip: true\n });\n return buttonView;\n });\n editor.ui.componentFactory.add('menuBar:horizontalLine', ()=>{\n return this._createButton(MenuBarMenuListItemButtonView);\n });\n }\n /**\n\t * Creates a button for horizontal line command to use either in toolbar or in menu bar.\n\t */ _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('horizontalLine');\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Horizontal line'),\n icon: IconHorizontalLine\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', ()=>{\n editor.execute('horizontalLine');\n editor.editing.view.focus();\n });\n return view;\n }\n}\n\n/**\n * The horizontal line feature.\n *\n * It provides the possibility to insert a horizontal line into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.\n */ class HorizontalLine extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n HorizontalLineEditing,\n HorizontalLineUI,\n Widget\n ];\n }\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'HorizontalLine';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n}\n\nexport { HorizontalLine, HorizontalLineCommand, HorizontalLineEditing, HorizontalLineUI };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallinecommand\n */\n\nimport type { ModelDocumentSelection, ModelElement, Model, ModelSchema, ModelSelection } from '@ckeditor/ckeditor5-engine';\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { findOptimalInsertionRange } from '@ckeditor/ckeditor5-widget';\n\n/**\n * The horizontal line command.\n *\n * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.\n *\n * To insert a horizontal line at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'horizontalLine' );\n * ```\n */\nexport class HorizontalLineCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic override refresh(): void {\n\t\tconst model = this.editor.model;\n\t\tconst schema = model.schema;\n\t\tconst selection = model.document.selection;\n\n\t\tthis.isEnabled = isHorizontalLineAllowedInParent( selection, schema, model );\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * @fires execute\n\t */\n\tpublic override execute(): void {\n\t\tconst model = this.editor.model;\n\n\t\tmodel.change( writer => {\n\t\t\tconst horizontalElement = writer.createElement( 'horizontalLine' );\n\n\t\t\tmodel.insertObject( horizontalElement, null, null, { setSelection: 'after' } );\n\t\t} );\n\t}\n}\n\n/**\n * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.\n *\n * @param model Model instance.\n */\nfunction isHorizontalLineAllowedInParent( selection: ModelSelection | ModelDocumentSelection, schema: ModelSchema, model: Model ): boolean {\n\tconst parent = getInsertHorizontalLineParent( selection, model );\n\n\treturn schema.checkChild( parent, 'horizontalLine' );\n}\n\n/**\n * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be\n * placed there.\n *\n * @param model Model instance.\n */\nfunction getInsertHorizontalLineParent( selection: ModelSelection | ModelDocumentSelection, model: Model ): ModelElement {\n\tconst insertionRange = findOptimalInsertionRange( selection, model );\n\tconst parent = insertionRange.start.parent;\n\n\tif ( parent.isEmpty && !parent.is( 'rootElement' ) ) {\n\t\treturn parent.parent! as ModelElement;\n\t}\n\n\treturn parent as ModelElement;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallineediting\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { toWidget } from '@ckeditor/ckeditor5-widget';\nimport type { ViewDowncastWriter, ViewElement } from '@ckeditor/ckeditor5-engine';\n\nimport { HorizontalLineCommand } from './horizontallinecommand.js';\n\nimport '../theme/horizontalline.css';\n\n/**\n * The horizontal line editing feature.\n */\nexport class HorizontalLineEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLineEditing' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\t\tconst t = editor.t;\n\t\tconst conversion = editor.conversion;\n\n\t\tschema.register( 'horizontalLine', {\n\t\t\tinheritAllFrom: '$blockObject'\n\t\t} );\n\n\t\tconversion.for( 'dataDowncast' ).elementToElement( {\n\t\t\tmodel: 'horizontalLine',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\treturn writer.createEmptyElement( 'hr' );\n\t\t\t}\n\t\t} );\n\n\t\tconversion.for( 'editingDowncast' ).elementToStructure( {\n\t\t\tmodel: 'horizontalLine',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\tconst label = t( 'Horizontal line' );\n\n\t\t\t\tconst viewWrapper = writer.createContainerElement( 'div', null,\n\t\t\t\t\twriter.createEmptyElement( 'hr' )\n\t\t\t\t);\n\n\t\t\t\twriter.addClass( 'ck-horizontal-line', viewWrapper );\n\t\t\t\twriter.setCustomProperty( 'hr', true, viewWrapper );\n\n\t\t\t\treturn toHorizontalLineWidget( viewWrapper, writer, label );\n\t\t\t}\n\t\t} );\n\n\t\tconversion.for( 'upcast' ).elementToElement( { view: 'hr', model: 'horizontalLine' } );\n\n\t\teditor.commands.add( 'horizontalLine', new HorizontalLineCommand( editor ) );\n\t}\n}\n\n/**\n * Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to\n * recognize the horizontal line widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n */\nfunction toHorizontalLineWidget( viewElement: ViewElement, writer: ViewDowncastWriter, label: string ): ViewElement {\n\twriter.setCustomProperty( 'horizontalLine', true, viewElement );\n\n\treturn toWidget( viewElement, writer, { label } );\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallineui\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { IconHorizontalLine } from '@ckeditor/ckeditor5-icons';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { type HorizontalLineCommand } from './horizontallinecommand.js';\n\n/**\n * The horizontal line UI plugin.\n */\nexport class HorizontalLineUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLineUI' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\t// Add the `horizontalLine` button to feature components.\n\t\teditor.ui.componentFactory.add( 'horizontalLine', () => {\n\t\t\tconst buttonView = this._createButton( ButtonView );\n\n\t\t\tbuttonView.set( {\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\treturn buttonView;\n\t\t} );\n\n\t\teditor.ui.componentFactory.add( 'menuBar:horizontalLine', () => {\n\t\t\treturn this._createButton( MenuBarMenuListItemButtonView );\n\t\t} );\n\t}\n\n\t/**\n\t * Creates a button for horizontal line command to use either in toolbar or in menu bar.\n\t */\n\tprivate _createButton<T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>( ButtonClass: T ): InstanceType<T> {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst command: HorizontalLineCommand = editor.commands.get( 'horizontalLine' )!;\n\t\tconst view = new ButtonClass( editor.locale ) as InstanceType<T>;\n\t\tconst t = locale.t;\n\n\t\tview.set( {\n\t\t\tlabel: t( 'Horizontal line' ),\n\t\t\ticon: IconHorizontalLine\n\t\t} );\n\n\t\tview.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\n\t\t// Execute the command.\n\t\tthis.listenTo( view, 'execute', () => {\n\t\t\teditor.execute( 'horizontalLine' );\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\treturn view;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontalline\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { Widget } from '@ckeditor/ckeditor5-widget';\nimport { HorizontalLineEditing } from './horizontallineediting.js';\nimport { HorizontalLineUI } from './horizontallineui.js';\n\n/**\n * The horizontal line feature.\n *\n * It provides the possibility to insert a horizontal line into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.\n */\nexport class HorizontalLine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ HorizontalLineEditing, HorizontalLineUI, Widget ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLine' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["index.js","../src/horizontallinecommand.ts","../src/horizontallineediting.ts","../src/horizontallineui.ts","../src/horizontalline.ts"],"names":[],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AAC1D,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC;AACxF,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;AAC9D,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;;AAElF,CAAC,CAAC;AACF,CAAC,CAAC,CAAC,OAAO,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;AACnF,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,SAAS,CAAC;AACjF,CAAC;AACD,CAAC,CAAC;AACF,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO;AAC7B;AACA,CAAC,CAAC,GAAG,CA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C,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;AACjF,CAAC;;AAED,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACzF,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Command, Plugin } from \"@ckeditor/ckeditor5-core\";\nimport { Widget, findOptimalInsertionRange, toWidget } from \"@ckeditor/ckeditor5-widget\";\nimport { IconHorizontalLine } from \"@ckeditor/ckeditor5-icons\";\nimport { ButtonView, MenuBarMenuListItemButtonView } from \"@ckeditor/ckeditor5-ui\";\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* The horizontal line command.\n*\n* The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.\n*\n* To insert a horizontal line at the current selection, execute the command:\n*\n* ```ts\n* editor.execute( 'horizontalLine' );\n* ```\n*/\nvar HorizontalLineCommand = class extends Command {\n\t/**\n\t* @inheritDoc\n\t*/\n\trefresh() {\n\t\tconst model = this.editor.model;\n\t\tconst schema = model.schema;\n\t\tconst selection = model.document.selection;\n\t\tthis.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);\n\t}\n\t/**\n\t* Executes the command.\n\t*\n\t* @fires execute\n\t*/\n\texecute() {\n\t\tconst model = this.editor.model;\n\t\tmodel.change((writer) => {\n\t\t\tconst horizontalElement = writer.createElement(\"horizontalLine\");\n\t\t\tmodel.insertObject(horizontalElement, null, null, { setSelection: \"after\" });\n\t\t});\n\t}\n};\n/**\n* Checks if a horizontal line is allowed by the schema in the optimal insertion parent.\n*\n* @param model Model instance.\n*/\nfunction isHorizontalLineAllowedInParent(selection, schema, model) {\n\tconst parent = getInsertHorizontalLineParent(selection, model);\n\treturn schema.checkChild(parent, \"horizontalLine\");\n}\n/**\n* Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be\n* placed there.\n*\n* @param model Model instance.\n*/\nfunction getInsertHorizontalLineParent(selection, model) {\n\tconst parent = findOptimalInsertionRange(selection, model).start.parent;\n\tif (parent.isEmpty && !parent.is(\"rootElement\")) return parent.parent;\n\treturn parent;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module horizontal-line/horizontallineediting\n*/\n/**\n* The horizontal line editing feature.\n*/\nvar HorizontalLineEditing = class extends Plugin {\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get pluginName() {\n\t\treturn \"HorizontalLineEditing\";\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get isOfficialPlugin() {\n\t\treturn true;\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\t\tconst t = editor.t;\n\t\tconst conversion = editor.conversion;\n\t\tschema.register(\"horizontalLine\", { inheritAllFrom: \"$blockObject\" });\n\t\tconversion.for(\"dataDowncast\").elementToElement({\n\t\t\tmodel: \"horizontalLine\",\n\t\t\tview: (modelElement, { writer }) => {\n\t\t\t\treturn writer.createEmptyElement(\"hr\");\n\t\t\t}\n\t\t});\n\t\tconversion.for(\"editingDowncast\").elementToStructure({\n\t\t\tmodel: \"horizontalLine\",\n\t\t\tview: (modelElement, { writer }) => {\n\t\t\t\tconst label = t(\"Horizontal line\");\n\t\t\t\tconst viewWrapper = writer.createContainerElement(\"div\", null, writer.createEmptyElement(\"hr\"));\n\t\t\t\twriter.addClass(\"ck-horizontal-line\", viewWrapper);\n\t\t\t\twriter.setCustomProperty(\"hr\", true, viewWrapper);\n\t\t\t\treturn toHorizontalLineWidget(viewWrapper, writer, label);\n\t\t\t}\n\t\t});\n\t\tconversion.for(\"upcast\").elementToElement({\n\t\t\tview: \"hr\",\n\t\t\tmodel: \"horizontalLine\"\n\t\t});\n\t\teditor.commands.add(\"horizontalLine\", new HorizontalLineCommand(editor));\n\t}\n};\n/**\n* Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:\n* * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to\n* recognize the horizontal line widget element.\n* * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n*\n* @param writer An instance of the view writer.\n*/\nfunction toHorizontalLineWidget(viewElement, writer, label) {\n\twriter.setCustomProperty(\"horizontalLine\", true, viewElement);\n\treturn toWidget(viewElement, writer, { label });\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module horizontal-line/horizontallineui\n*/\n/**\n* The horizontal line UI plugin.\n*/\nvar HorizontalLineUI = class extends Plugin {\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get pluginName() {\n\t\treturn \"HorizontalLineUI\";\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get isOfficialPlugin() {\n\t\treturn true;\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tinit() {\n\t\tconst editor = this.editor;\n\t\teditor.ui.componentFactory.add(\"horizontalLine\", () => {\n\t\t\tconst buttonView = this._createButton(ButtonView);\n\t\t\tbuttonView.set({ tooltip: true });\n\t\t\treturn buttonView;\n\t\t});\n\t\teditor.ui.componentFactory.add(\"menuBar:horizontalLine\", () => {\n\t\t\treturn this._createButton(MenuBarMenuListItemButtonView);\n\t\t});\n\t}\n\t/**\n\t* Creates a button for horizontal line command to use either in toolbar or in menu bar.\n\t*/\n\t_createButton(ButtonClass) {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst command = editor.commands.get(\"horizontalLine\");\n\t\tconst view = new ButtonClass(editor.locale);\n\t\tconst t = locale.t;\n\t\tview.set({\n\t\t\tlabel: t(\"Horizontal line\"),\n\t\t\ticon: IconHorizontalLine\n\t\t});\n\t\tview.bind(\"isEnabled\").to(command, \"isEnabled\");\n\t\tthis.listenTo(view, \"execute\", () => {\n\t\t\teditor.execute(\"horizontalLine\");\n\t\t\teditor.editing.view.focus();\n\t\t});\n\t\treturn view;\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module horizontal-line/horizontalline\n*/\n/**\n* The horizontal line feature.\n*\n* It provides the possibility to insert a horizontal line into the rich-text editor.\n*\n* For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.\n*/\nvar HorizontalLine = class extends Plugin {\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get requires() {\n\t\treturn [\n\t\t\tHorizontalLineEditing,\n\t\t\tHorizontalLineUI,\n\t\t\tWidget\n\t\t];\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get pluginName() {\n\t\treturn \"HorizontalLine\";\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get isOfficialPlugin() {\n\t\treturn true;\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n\nexport { HorizontalLine, HorizontalLineCommand, HorizontalLineEditing, HorizontalLineUI };\n//# sourceMappingURL=index.js.map","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallinecommand\n */\n\nimport type { ModelDocumentSelection, ModelElement, Model, ModelSchema, ModelSelection } from '@ckeditor/ckeditor5-engine';\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { findOptimalInsertionRange } from '@ckeditor/ckeditor5-widget';\n\n/**\n * The horizontal line command.\n *\n * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.\n *\n * To insert a horizontal line at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'horizontalLine' );\n * ```\n */\nexport class HorizontalLineCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic override refresh(): void {\n\t\tconst model = this.editor.model;\n\t\tconst schema = model.schema;\n\t\tconst selection = model.document.selection;\n\n\t\tthis.isEnabled = isHorizontalLineAllowedInParent( selection, schema, model );\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * @fires execute\n\t */\n\tpublic override execute(): void {\n\t\tconst model = this.editor.model;\n\n\t\tmodel.change( writer => {\n\t\t\tconst horizontalElement = writer.createElement( 'horizontalLine' );\n\n\t\t\tmodel.insertObject( horizontalElement, null, null, { setSelection: 'after' } );\n\t\t} );\n\t}\n}\n\n/**\n * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.\n *\n * @param model Model instance.\n */\nfunction isHorizontalLineAllowedInParent( selection: ModelSelection | ModelDocumentSelection, schema: ModelSchema, model: Model ): boolean {\n\tconst parent = getInsertHorizontalLineParent( selection, model );\n\n\treturn schema.checkChild( parent, 'horizontalLine' );\n}\n\n/**\n * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be\n * placed there.\n *\n * @param model Model instance.\n */\nfunction getInsertHorizontalLineParent( selection: ModelSelection | ModelDocumentSelection, model: Model ): ModelElement {\n\tconst insertionRange = findOptimalInsertionRange( selection, model );\n\tconst parent = insertionRange.start.parent;\n\n\tif ( parent.isEmpty && !parent.is( 'rootElement' ) ) {\n\t\treturn parent.parent! as ModelElement;\n\t}\n\n\treturn parent as ModelElement;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallineediting\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { toWidget } from '@ckeditor/ckeditor5-widget';\nimport type { ViewDowncastWriter, ViewElement } from '@ckeditor/ckeditor5-engine';\n\nimport { HorizontalLineCommand } from './horizontallinecommand.js';\n\nimport '../theme/horizontalline.css';\n\n/**\n * The horizontal line editing feature.\n */\nexport class HorizontalLineEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLineEditing' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\t\tconst t = editor.t;\n\t\tconst conversion = editor.conversion;\n\n\t\tschema.register( 'horizontalLine', {\n\t\t\tinheritAllFrom: '$blockObject'\n\t\t} );\n\n\t\tconversion.for( 'dataDowncast' ).elementToElement( {\n\t\t\tmodel: 'horizontalLine',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\treturn writer.createEmptyElement( 'hr' );\n\t\t\t}\n\t\t} );\n\n\t\tconversion.for( 'editingDowncast' ).elementToStructure( {\n\t\t\tmodel: 'horizontalLine',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\tconst label = t( 'Horizontal line' );\n\n\t\t\t\tconst viewWrapper = writer.createContainerElement( 'div', null,\n\t\t\t\t\twriter.createEmptyElement( 'hr' )\n\t\t\t\t);\n\n\t\t\t\twriter.addClass( 'ck-horizontal-line', viewWrapper );\n\t\t\t\twriter.setCustomProperty( 'hr', true, viewWrapper );\n\n\t\t\t\treturn toHorizontalLineWidget( viewWrapper, writer, label );\n\t\t\t}\n\t\t} );\n\n\t\tconversion.for( 'upcast' ).elementToElement( { view: 'hr', model: 'horizontalLine' } );\n\n\t\teditor.commands.add( 'horizontalLine', new HorizontalLineCommand( editor ) );\n\t}\n}\n\n/**\n * Converts a given {@link module:engine/view/element~ViewElement} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property} allowing to\n * recognize the horizontal line widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n */\nfunction toHorizontalLineWidget( viewElement: ViewElement, writer: ViewDowncastWriter, label: string ): ViewElement {\n\twriter.setCustomProperty( 'horizontalLine', true, viewElement );\n\n\treturn toWidget( viewElement, writer, { label } );\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontallineui\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { IconHorizontalLine } from '@ckeditor/ckeditor5-icons';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { type HorizontalLineCommand } from './horizontallinecommand.js';\n\n/**\n * The horizontal line UI plugin.\n */\nexport class HorizontalLineUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLineUI' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\t// Add the `horizontalLine` button to feature components.\n\t\teditor.ui.componentFactory.add( 'horizontalLine', () => {\n\t\t\tconst buttonView = this._createButton( ButtonView );\n\n\t\t\tbuttonView.set( {\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\treturn buttonView;\n\t\t} );\n\n\t\teditor.ui.componentFactory.add( 'menuBar:horizontalLine', () => {\n\t\t\treturn this._createButton( MenuBarMenuListItemButtonView );\n\t\t} );\n\t}\n\n\t/**\n\t * Creates a button for horizontal line command to use either in toolbar or in menu bar.\n\t */\n\tprivate _createButton<T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>( ButtonClass: T ): InstanceType<T> {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst command: HorizontalLineCommand = editor.commands.get( 'horizontalLine' )!;\n\t\tconst view = new ButtonClass( editor.locale ) as InstanceType<T>;\n\t\tconst t = locale.t;\n\n\t\tview.set( {\n\t\t\tlabel: t( 'Horizontal line' ),\n\t\t\ticon: IconHorizontalLine\n\t\t} );\n\n\t\tview.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\n\t\t// Execute the command.\n\t\tthis.listenTo( view, 'execute', () => {\n\t\t\teditor.execute( 'horizontalLine' );\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\treturn view;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module horizontal-line/horizontalline\n */\n\nimport { Plugin, type PluginDependenciesOf } from '@ckeditor/ckeditor5-core';\nimport { Widget } from '@ckeditor/ckeditor5-widget';\nimport { HorizontalLineEditing } from './horizontallineediting.js';\nimport { HorizontalLineUI } from './horizontallineui.js';\n\n/**\n * The horizontal line feature.\n *\n * It provides the possibility to insert a horizontal line into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.\n */\nexport class HorizontalLine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires(): PluginDependenciesOf<[ HorizontalLineEditing, HorizontalLineUI, Widget ]> {\n\t\treturn [ HorizontalLineEditing, HorizontalLineUI, Widget ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'HorizontalLine' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-horizontal-line",
3
- "version": "48.2.0-alpha.7",
3
+ "version": "48.3.0-alpha.0",
4
4
  "description": "Horizontal line feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,12 +26,12 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "48.2.0-alpha.7",
30
- "@ckeditor/ckeditor5-engine": "48.2.0-alpha.7",
31
- "@ckeditor/ckeditor5-icons": "48.2.0-alpha.7",
32
- "@ckeditor/ckeditor5-ui": "48.2.0-alpha.7",
33
- "@ckeditor/ckeditor5-utils": "48.2.0-alpha.7",
34
- "@ckeditor/ckeditor5-widget": "48.2.0-alpha.7"
29
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.0",
30
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.0",
31
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.0",
32
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.0",
33
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.0",
34
+ "@ckeditor/ckeditor5-widget": "48.3.0-alpha.0"
35
35
  },
36
36
  "files": [
37
37
  "dist",