@ckeditor/ckeditor5-horizontal-line 32.0.0 → 34.1.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/LICENSE.md +2 -2
- package/README.md +2 -1
- package/build/horizontal-line.js +2 -2
- package/build/translations/el.js +1 -0
- package/build/translations/jv.js +1 -0
- package/build/translations/ur.js +1 -0
- package/lang/translations/el.po +21 -0
- package/lang/translations/jv.po +21 -0
- package/lang/translations/ur.po +21 -0
- package/package.json +13 -13
- package/src/horizontallinecommand.js +1 -18
- package/src/horizontallineediting.js +6 -7
package/LICENSE.md
CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
|
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**CKEditor 5 horizontal line feature** – https://github.com/ckeditor/ckeditor5-horizontal-line <br>
|
5
|
-
Copyright (c) 2003-2022, [CKSource
|
5
|
+
Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
6
6
|
|
7
7
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
8
8
|
|
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
|
|
14
14
|
Trademarks
|
15
15
|
----------
|
16
16
|
|
17
|
-
**CKEditor** is a trademark of [CKSource
|
17
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
package/README.md
CHANGED
@@ -3,7 +3,8 @@ CKEditor 5 horizontal line feature
|
|
3
3
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-horizontal-line)
|
5
5
|
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
6
|
-
[](https://travis-ci.com/ckeditor/ckeditor5)
|
6
|
+
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
7
|
+

|
7
8
|
|
8
9
|
This package implements the horizontal line feature for CKEditor 5.
|
9
10
|
|
package/build/horizontal-line.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Horizontal line":"Horizontal line"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
|
2
2
|
/*!
|
3
|
-
* @license Copyright (c) 2003-2022, CKSource
|
3
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
4
4
|
* For licensing, see LICENSE.md.
|
5
|
-
*/(()=>{var e={73:(e,t,n)=>{"use strict";n.d(t,{Z:()=>
|
5
|
+
*/(()=>{var e={73:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(609),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}",""]);const i=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},62:(e,t,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],c=t.base?i[0]+t.base:i[0],l=n[c]||0,d="".concat(c," ").concat(l);n[c]=l+1;var u=s(d),f={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(a[u].references++,a[u].updater(f)):a.push({identifier:d,updater:v(f,t),references:1}),r.push(d)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function h(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var m=null,p=0;function v(e,t){var n,r,o;if(t.singleton){var i=p++;n=m||(m=l(t)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else n=l(t),r=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=s(n[r]);a[o].references--}for(var i=c(e,t),l=0;l<n.length;l++){var d=s(n[l]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=i}}}},704:(e,t,n)=>{e.exports=n(79)("./src/core.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},995:(e,t,n)=>{e.exports=n(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{HorizontalLine:()=>f,HorizontalLineEditing:()=>l,HorizontalLineUI:()=>u});var e=n(704),t=n(995);class o extends e.Command{refresh(){const e=this.editor.model,n=e.schema,r=e.document.selection;this.isEnabled=function(e,n,r){const o=function(e,n){const r=(0,t.findOptimalInsertionRange)(e,n).start.parent;if(r.isEmpty&&!r.is("element","$root"))return r.parent;return r}(e,r);return n.checkChild(o,"horizontalLine")}(r,n,e)}execute(){const e=this.editor.model;e.change((t=>{const n=t.createElement("horizontalLine");e.insertObject(n,null,null,{setSelection:"after"})}))}}var i=n(62),a=n.n(i),s=n(73),c={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.Z,c);s.Z.locals;class l extends e.Plugin{static get pluginName(){return"HorizontalLineEditing"}init(){const e=this.editor,n=e.model.schema,r=e.t,i=e.conversion;n.register("horizontalLine",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,{writer:t})=>t.createEmptyElement("hr")}),i.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:n})=>{const o=r("Horizontal line"),i=n.createContainerElement("div",null,n.createEmptyElement("hr"));return n.addClass("ck-horizontal-line",i),n.setCustomProperty("hr",!0,i),function(e,n,r){return n.setCustomProperty("horizontalLine",!0,e),(0,t.toWidget)(e,n,{label:r})}(i,n,o)}}),i.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new o(e))}}var d=n(273);class u extends e.Plugin{static get pluginName(){return"HorizontalLineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("horizontalLine",(n=>{const r=e.commands.get("horizontalLine"),o=new d.ButtonView(n);return o.set({label:t("Horizontal line"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 9h16v2H2z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),this.listenTo(o,"execute",(()=>{e.execute("horizontalLine"),e.editing.view.focus()})),o}))}}class f extends e.Plugin{static get requires(){return[l,u,t.Widget]}static get pluginName(){return"HorizontalLine"}}})(),(window.CKEditor5=window.CKEditor5||{}).horizontalLine=r})();
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.el=i.el||{};n.dictionary=Object.assign(n.dictionary||{},{"Horizontal line":"Οριζόντια γραμμή"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.jv=i.jv||{};n.dictionary=Object.assign(n.dictionary||{},{"Horizontal line":"Garis horisontal"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.ur=i.ur||{};n.dictionary=Object.assign(n.dictionary||{},{"Horizontal line":"افقی خط"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
2
|
+
#
|
3
|
+
# !!! IMPORTANT !!!
|
4
|
+
#
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
7
|
+
#
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
9
|
+
#
|
10
|
+
# To learn more, check out the official contributor's guide:
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
12
|
+
#
|
13
|
+
msgid ""
|
14
|
+
msgstr ""
|
15
|
+
"Language-Team: Greek (https://www.transifex.com/ckeditor/teams/11143/el/)\n"
|
16
|
+
"Language: el\n"
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
|
+
|
19
|
+
msgctxt "Horizontal line"
|
20
|
+
msgid "Horizontal line"
|
21
|
+
msgstr "Οριζόντια γραμμή"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
2
|
+
#
|
3
|
+
# !!! IMPORTANT !!!
|
4
|
+
#
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
7
|
+
#
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
9
|
+
#
|
10
|
+
# To learn more, check out the official contributor's guide:
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
12
|
+
#
|
13
|
+
msgid ""
|
14
|
+
msgstr ""
|
15
|
+
"Language-Team: Javanese (https://www.transifex.com/ckeditor/teams/11143/jv/)\n"
|
16
|
+
"Language: jv\n"
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
|
+
|
19
|
+
msgctxt "Horizontal line"
|
20
|
+
msgid "Horizontal line"
|
21
|
+
msgstr "Garis horisontal"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
2
|
+
#
|
3
|
+
# !!! IMPORTANT !!!
|
4
|
+
#
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
7
|
+
#
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
9
|
+
#
|
10
|
+
# To learn more, check out the official contributor's guide:
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
12
|
+
#
|
13
|
+
msgid ""
|
14
|
+
msgstr ""
|
15
|
+
"Language-Team: Urdu (https://www.transifex.com/ckeditor/teams/11143/ur/)\n"
|
16
|
+
"Language: ur\n"
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
|
+
|
19
|
+
msgctxt "Horizontal line"
|
20
|
+
msgid "Horizontal line"
|
21
|
+
msgstr "افقی خط"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-horizontal-line",
|
3
|
-
"version": "
|
3
|
+
"version": "34.1.0",
|
4
4
|
"description": "Horizontal line feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,20 +12,20 @@
|
|
12
12
|
],
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"ckeditor5": "^
|
15
|
+
"ckeditor5": "^34.1.0"
|
16
16
|
},
|
17
17
|
"devDependencies": {
|
18
|
-
"@ckeditor/ckeditor5-cloud-services": "^
|
19
|
-
"@ckeditor/ckeditor5-core": "^
|
20
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
21
|
-
"@ckeditor/ckeditor5-easy-image": "^
|
22
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
23
|
-
"@ckeditor/ckeditor5-engine": "^
|
24
|
-
"@ckeditor/ckeditor5-image": "^
|
25
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
26
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
27
|
-
"@ckeditor/ckeditor5-ui": "^
|
28
|
-
"@ckeditor/ckeditor5-widget": "^
|
18
|
+
"@ckeditor/ckeditor5-cloud-services": "^34.1.0",
|
19
|
+
"@ckeditor/ckeditor5-core": "^34.1.0",
|
20
|
+
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
21
|
+
"@ckeditor/ckeditor5-easy-image": "^34.1.0",
|
22
|
+
"@ckeditor/ckeditor5-editor-classic": "^34.1.0",
|
23
|
+
"@ckeditor/ckeditor5-engine": "^34.1.0",
|
24
|
+
"@ckeditor/ckeditor5-image": "^34.1.0",
|
25
|
+
"@ckeditor/ckeditor5-paragraph": "^34.1.0",
|
26
|
+
"@ckeditor/ckeditor5-theme-lark": "^34.1.0",
|
27
|
+
"@ckeditor/ckeditor5-ui": "^34.1.0",
|
28
|
+
"@ckeditor/ckeditor5-widget": "^34.1.0",
|
29
29
|
"webpack": "^5.58.1",
|
30
30
|
"webpack-cli": "^4.9.0"
|
31
31
|
},
|
@@ -44,24 +44,7 @@ export default class HorizontalLineCommand extends Command {
|
|
44
44
|
model.change( writer => {
|
45
45
|
const horizontalElement = writer.createElement( 'horizontalLine' );
|
46
46
|
|
47
|
-
model.
|
48
|
-
|
49
|
-
let nextElement = horizontalElement.nextSibling;
|
50
|
-
|
51
|
-
// Check whether an element next to the inserted horizontal line is defined and can contain a text.
|
52
|
-
const canSetSelection = nextElement && model.schema.checkChild( nextElement, '$text' );
|
53
|
-
|
54
|
-
// If the element is missing, but a paragraph could be inserted next to the horizontal line, let's add it.
|
55
|
-
if ( !canSetSelection && model.schema.checkChild( horizontalElement.parent, 'paragraph' ) ) {
|
56
|
-
nextElement = writer.createElement( 'paragraph' );
|
57
|
-
|
58
|
-
model.insertContent( nextElement, writer.createPositionAfter( horizontalElement ) );
|
59
|
-
}
|
60
|
-
|
61
|
-
// Put the selection inside the element, at the beginning.
|
62
|
-
if ( nextElement ) {
|
63
|
-
writer.setSelection( nextElement, 0 );
|
64
|
-
}
|
47
|
+
model.insertObject( horizontalElement, null, null, { setSelection: 'after' } );
|
65
48
|
} );
|
66
49
|
}
|
67
50
|
}
|
@@ -37,8 +37,7 @@ export default class HorizontalLineEditing extends Plugin {
|
|
37
37
|
const conversion = editor.conversion;
|
38
38
|
|
39
39
|
schema.register( 'horizontalLine', {
|
40
|
-
|
41
|
-
allowWhere: '$block'
|
40
|
+
inheritAllFrom: '$blockObject'
|
42
41
|
} );
|
43
42
|
|
44
43
|
conversion.for( 'dataDowncast' ).elementToElement( {
|
@@ -48,18 +47,18 @@ export default class HorizontalLineEditing extends Plugin {
|
|
48
47
|
}
|
49
48
|
} );
|
50
49
|
|
51
|
-
conversion.for( 'editingDowncast' ).
|
50
|
+
conversion.for( 'editingDowncast' ).elementToStructure( {
|
52
51
|
model: 'horizontalLine',
|
53
52
|
view: ( modelElement, { writer } ) => {
|
54
53
|
const label = t( 'Horizontal line' );
|
55
|
-
|
56
|
-
const
|
54
|
+
|
55
|
+
const viewWrapper = writer.createContainerElement( 'div', null,
|
56
|
+
writer.createEmptyElement( 'hr' )
|
57
|
+
);
|
57
58
|
|
58
59
|
writer.addClass( 'ck-horizontal-line', viewWrapper );
|
59
60
|
writer.setCustomProperty( 'hr', true, viewWrapper );
|
60
61
|
|
61
|
-
writer.insert( writer.createPositionAt( viewWrapper, 0 ), viewHrElement );
|
62
|
-
|
63
62
|
return toHorizontalLineWidget( viewWrapper, writer, label );
|
64
63
|
}
|
65
64
|
} );
|