@ckeditor/ckeditor5-horizontal-line 0.0.0-nightly-20240603.0 → 0.0.0-nightly-20240604.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/README.md CHANGED
@@ -15,12 +15,6 @@ Check out the demo in the [horizontal line feature guide](https://ckeditor.com/d
15
15
 
16
16
  See the [`@ckeditor/ckeditor5-horizontal-line` package](https://ckeditor.com/docs/ckeditor5/latest/api/horizontal-line.html) page as well as the [horizontal line feature](https://ckeditor.com/docs/ckeditor5/latest/features/horizontal-line.html) guide in the [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
17
17
 
18
- ## Installation
19
-
20
- ```bash
21
- npm install ckeditor5
22
- ```
23
-
24
18
  ## License
25
19
 
26
20
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
package/dist/index.js CHANGED
@@ -6,30 +6,20 @@ import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';
6
6
  import { findOptimalInsertionRange, toWidget, Widget } from '@ckeditor/ckeditor5-widget/dist/index.js';
7
7
  import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
8
8
 
9
- /**
10
- * The horizontal line command.
11
- *
12
- * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.
13
- *
14
- * To insert a horizontal line at the current selection, execute the command:
15
- *
16
- * ```ts
17
- * editor.execute( 'horizontalLine' );
18
- * ```
19
- */ class HorizontalLineCommand extends Command {
9
+ class HorizontalLineCommand extends Command {
20
10
  /**
21
- * @inheritDoc
22
- */ refresh() {
11
+ * @inheritDoc
12
+ */ refresh() {
23
13
  const model = this.editor.model;
24
14
  const schema = model.schema;
25
15
  const selection = model.document.selection;
26
16
  this.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);
27
17
  }
28
18
  /**
29
- * Executes the command.
30
- *
31
- * @fires execute
32
- */ execute() {
19
+ * Executes the command.
20
+ *
21
+ * @fires execute
22
+ */ execute() {
33
23
  const model = this.editor.model;
34
24
  model.change((writer)=>{
35
25
  const horizontalElement = writer.createElement('horizontalLine');
@@ -61,17 +51,15 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
61
51
  return parent;
62
52
  }
63
53
 
64
- /**
65
- * The horizontal line editing feature.
66
- */ class HorizontalLineEditing extends Plugin {
54
+ class HorizontalLineEditing extends Plugin {
67
55
  /**
68
- * @inheritDoc
69
- */ static get pluginName() {
56
+ * @inheritDoc
57
+ */ static get pluginName() {
70
58
  return 'HorizontalLineEditing';
71
59
  }
72
60
  /**
73
- * @inheritDoc
74
- */ init() {
61
+ * @inheritDoc
62
+ */ init() {
75
63
  const editor = this.editor;
76
64
  const schema = editor.model.schema;
77
65
  const t = editor.t;
@@ -116,17 +104,15 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
116
104
  });
117
105
  }
118
106
 
119
- /**
120
- * The horizontal line UI plugin.
121
- */ class HorizontalLineUI extends Plugin {
107
+ class HorizontalLineUI extends Plugin {
122
108
  /**
123
- * @inheritDoc
124
- */ static get pluginName() {
109
+ * @inheritDoc
110
+ */ static get pluginName() {
125
111
  return 'HorizontalLineUI';
126
112
  }
127
113
  /**
128
- * @inheritDoc
129
- */ init() {
114
+ * @inheritDoc
115
+ */ init() {
130
116
  const editor = this.editor;
131
117
  // Add the `horizontalLine` button to feature components.
132
118
  editor.ui.componentFactory.add('horizontalLine', ()=>{
@@ -141,8 +127,8 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
141
127
  });
142
128
  }
143
129
  /**
144
- * Creates a button for horizontal line command to use either in toolbar or in menu bar.
145
- */ _createButton(ButtonClass) {
130
+ * Creates a button for horizontal line command to use either in toolbar or in menu bar.
131
+ */ _createButton(ButtonClass) {
146
132
  const editor = this.editor;
147
133
  const locale = editor.locale;
148
134
  const command = editor.commands.get('horizontalLine');
@@ -162,16 +148,10 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
162
148
  }
163
149
  }
164
150
 
165
- /**
166
- * The horizontal line feature.
167
- *
168
- * It provides the possibility to insert a horizontal line into the rich-text editor.
169
- *
170
- * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.
171
- */ class HorizontalLine extends Plugin {
151
+ class HorizontalLine extends Plugin {
172
152
  /**
173
- * @inheritDoc
174
- */ static get requires() {
153
+ * @inheritDoc
154
+ */ static get requires() {
175
155
  return [
176
156
  HorizontalLineEditing,
177
157
  HorizontalLineUI,
@@ -179,8 +159,8 @@ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-u
179
159
  ];
180
160
  }
181
161
  /**
182
- * @inheritDoc
183
- */ static get pluginName() {
162
+ * @inheritDoc
163
+ */ static get pluginName() {
184
164
  return 'HorizontalLine';
185
165
  }
186
166
  }
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","model","editor","schema","selection","document","isEnabled","isHorizontalLineAllowedInParent","change","writer","horizontalElement","createElement","insertObject","setSelection","parent","getInsertHorizontalLineParent","checkChild","insertionRange","findOptimalInsertionRange","start","isEmpty","is","HorizontalLineEditing","Plugin","pluginName","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","icons","horizontalLine","bind","to","listenTo","execute","edit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"index.js.map","sourcesContent":["import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { findOptimalInsertionRange, toWidget, Widget } from '@ckeditor/ckeditor5-widget/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('element', '$root')) {\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 */ 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~Element} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~Element#_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 */ 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: icons.horizontalLine\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\nexport { HorizontalLine, HorizontalLineEditing, HorizontalLineUI };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallinecommand\n */\n\nimport type { DocumentSelection, Element, Model, Schema, Selection } from 'ckeditor5/src/engine.js';\nimport { Command } from 'ckeditor5/src/core.js';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget.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 */\nexport default 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: Selection | DocumentSelection, schema: Schema, 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: Selection | DocumentSelection, model: Model ): Element {\n\tconst insertionRange = findOptimalInsertionRange( selection, model );\n\tconst parent = insertionRange.start.parent;\n\n\tif ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {\n\t\treturn parent.parent! as Element;\n\t}\n\n\treturn parent as Element;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallineediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { toWidget } from 'ckeditor5/src/widget.js';\nimport type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';\n\nimport HorizontalLineCommand from './horizontallinecommand.js';\n\nimport '../theme/horizontalline.css';\n\n/**\n * The horizontal line editing feature.\n */\nexport default 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 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~Element} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~Element#_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: DowncastWriter, label: string ): ViewElement {\n\twriter.setCustomProperty( 'horizontalLine', true, viewElement );\n\n\treturn toWidget( viewElement, writer, { label } );\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallineui\n */\n\nimport { icons, Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n\nimport type HorizontalLineCommand from './horizontallinecommand.js';\n\n/**\n * The horizontal line UI plugin.\n */\nexport default 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 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: icons.horizontalLine\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-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontalline\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\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 default 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"]}
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","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","icons","horizontalLine","bind","to","listenTo","editing","focus","HorizontalLine","requires","Widget"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChF,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CA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AAAA,CAAAA,CAAAA,CAAAA,qBAAAA,CAAAA;AAAuBwB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,gBAAAA,CAAAA;AAAkBuB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA;AAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACpE,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AJgID,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;AI9Hd,CACI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,GAAA,CAAW7C,UAAU,CAAA,CAAA,CAAA,CAAA;AJ+H7B,CI9HE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAO,CAAA,cAAA,CAAA,CAAA;AACR,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AJ+HD;AACA,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,qBAAqB,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG","file":"index.js.map","sourcesContent":["import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { findOptimalInsertionRange, toWidget, Widget } from '@ckeditor/ckeditor5-widget/dist/index.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';\n\nclass HorizontalLineCommand extends Command {\n /**\n * @inheritDoc\n */ 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 * Executes the command.\n *\n * @fires execute\n */ 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('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n\nclass HorizontalLineEditing extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'HorizontalLineEditing';\n }\n /**\n * @inheritDoc\n */ 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~Element} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~Element#_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\nclass HorizontalLineUI extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'HorizontalLineUI';\n }\n /**\n * @inheritDoc\n */ 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 * Creates a button for horizontal line command to use either in toolbar or in menu bar.\n */ _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: icons.horizontalLine\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\nclass HorizontalLine extends Plugin {\n /**\n * @inheritDoc\n */ static get requires() {\n return [\n HorizontalLineEditing,\n HorizontalLineUI,\n Widget\n ];\n }\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'HorizontalLine';\n }\n}\n\nexport { HorizontalLine, HorizontalLineEditing, HorizontalLineUI };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallinecommand\n */\n\nimport type { DocumentSelection, Element, Model, Schema, Selection } from 'ckeditor5/src/engine.js';\nimport { Command } from 'ckeditor5/src/core.js';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget.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 */\nexport default 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: Selection | DocumentSelection, schema: Schema, 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: Selection | DocumentSelection, model: Model ): Element {\n\tconst insertionRange = findOptimalInsertionRange( selection, model );\n\tconst parent = insertionRange.start.parent;\n\n\tif ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {\n\t\treturn parent.parent! as Element;\n\t}\n\n\treturn parent as Element;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallineediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { toWidget } from 'ckeditor5/src/widget.js';\nimport type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';\n\nimport HorizontalLineCommand from './horizontallinecommand.js';\n\nimport '../theme/horizontalline.css';\n\n/**\n * The horizontal line editing feature.\n */\nexport default 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 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~Element} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~Element#_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: DowncastWriter, label: string ): ViewElement {\n\twriter.setCustomProperty( 'horizontalLine', true, viewElement );\n\n\treturn toWidget( viewElement, writer, { label } );\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontallineui\n */\n\nimport { icons, Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n\nimport type HorizontalLineCommand from './horizontallinecommand.js';\n\n/**\n * The horizontal line UI plugin.\n */\nexport default 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 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: icons.horizontalLine\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-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module horizontal-line/horizontalline\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\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 default 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-horizontal-line",
3
- "version": "0.0.0-nightly-20240603.0",
3
+ "version": "0.0.0-nightly-20240604.0",
4
4
  "description": "Horizontal line feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,7 +13,7 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "ckeditor5": "0.0.0-nightly-20240603.0"
16
+ "ckeditor5": "0.0.0-nightly-20240604.0"
17
17
  },
18
18
  "author": "CKSource (http://cksource.com/)",
19
19
  "license": "GPL-2.0-or-later",