@ckeditor/ckeditor5-page-break
Advanced tools
Comparing version 27.1.0 to 28.0.0
@@ -5,2 +5,2 @@ /*! | ||
*/ | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.pageBreak=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){e.exports=n(2)("./src/core.js")},function(e,t,n){e.exports=n(2)("./src/widget.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,n){e.exports=n(2)("./src/ui.js")},function(e,t,n){var r=n(5),a=n(6);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);var i={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(a,i);e.exports=a.locals||{}},function(e,t,n){"use strict";var r,a=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]}}(),o=[];function s(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],a=0;a<e.length;a++){var i=e[a],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?(o[u].references++,o[u].updater(f)):o.push({identifier:d,updater:h(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 a=n.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=i(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.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 a=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,a);else{var i=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(i,o[t]):e.appendChild(i)}}function p(e,t,n){var r=n.css,a=n.media,i=n.sourceMap;if(a?e.setAttribute("media",a):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 g=null,m=0;function h(e,t){var n,r,a;if(t.singleton){var i=m++;n=g||(g=l(t)),r=f.bind(null,n,i,!1),a=f.bind(null,n,i,!0)}else n=l(t),r=p.bind(null,n,t),a=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 a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=a());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 a=s(n[r]);o[a].references--}for(var i=c(e,t),l=0;l<n.length;l++){var d=s(n[l]);0===o[d].references&&(o[d].updater(),o.splice(d,1))}n=i}}}},function(e,t){e.exports='.ck-content .page-break{position:relative;clear:both;padding:5px 0;display:flex;align-items:center;justify-content:center}.ck-content .page-break:after{content:"";position:absolute;border-bottom:2px dashed #c4c4c4;width:100%}.ck-content .page-break__label{position:relative;z-index:1;padding:.3em .6em;display:block;text-transform:uppercase;border:1px solid #c4c4c4;border-radius:2px;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;color:#333;background:#fff;box-shadow:2px 2px 1px rgba(0,0,0,.15);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}}'},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(1);class i extends r.Command{refresh(){this.isEnabled=function(e){const t=e.schema,n=e.document.selection;return function(e,t,n){const r=function(e,t){const n=Object(a.findOptimalInsertionPosition)(e,t).parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,n);return t.checkChild(r,"pageBreak")}(n,t,e)&&!Object(a.checkSelectionOnObject)(n,t)}(this.editor.model)}execute(){const e=this.editor.model;e.change(t=>{const n=t.createElement("pageBreak");e.insertContent(n);let r=n.nextSibling;!(r&&e.schema.checkChild(r,"$text"))&&e.schema.checkChild(n.parent,"paragraph")&&(r=t.createElement("paragraph"),e.insertContent(r,t.createPositionAfter(n))),r&&t.setSelection(r,0)})}}n(4);class o extends r.Plugin{static get pluginName(){return"PageBreakEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,r=e.conversion;t.register("pageBreak",{isObject:!0,allowWhere:"$block"}),r.for("dataDowncast").elementToElement({model:"pageBreak",view:(e,{writer:t})=>{const n=t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"}),r=t.createContainerElement("span",{style:"display: none"});return t.insert(t.createPositionAt(n,0),r),n}}),r.for("editingDowncast").elementToElement({model:"pageBreak",view:(e,{writer:t})=>{const r=n("Page break"),i=t.createContainerElement("div"),o=t.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=n("Page break")}));return t.addClass("page-break",i),t.insert(t.createPositionAt(i,0),o),function(e,t,n){return t.setCustomProperty("pageBreak",!0,e),Object(a.toWidget)(e,t,{label:n})}(i,t,r)}}),r.for("upcast").elementToElement({view:e=>{const t="always"==e.getStyle("page-break-before"),n="always"==e.getStyle("page-break-after");if(t||n){if(1==e.childCount){const t=e.getChild(0);if(!t.is("element","span")||"none"!=t.getStyle("display")||1!=t.childCount)return;const n=t.getChild(0);if(!n.is("$text")||" "!==n.data)return}else if(e.childCount>1)return;return{name:!0}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new i(e))}}var s=n(3);class c extends r.Plugin{static get pluginName(){return"PageBreakUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("pageBreak",n=>{const r=e.commands.get("pageBreak"),a=new s.ButtonView(n);return a.set({label:t("Page break"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.598.687h1.5v5h-1.5zm14.5 0h1.5v5h-1.5z"/><path d="M19.598 4.187v1.5h-16v-1.5zm-16 14.569h1.5v-5h-1.5zm14.5 0h1.5v-5h-1.5z"/><path d="M19.598 15.256v-1.5h-16v1.5zM5.081 9h6v2h-6zm8 0h6v2h-6zm-9.483 1L0 12.5v-5z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{e.execute("pageBreak"),e.editing.view.focus()}),a})}}class l extends r.Plugin{static get requires(){return[o,c,a.Widget]}static get pluginName(){return"PageBreak"}}t.default={PageBreak:l,PageBreakEditing:o,PageBreakUI:c}}]).default; | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.pageBreak=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){e.exports=n(2)("./src/core.js")},function(e,t,n){e.exports=n(2)("./src/widget.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,n){e.exports=n(2)("./src/ui.js")},function(e,t,n){var r=n(5),a=n(6);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);var o={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(a,o);e.exports=a.locals||{}},function(e,t,n){"use strict";var r,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=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]}}(),i=[];function c(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function s(e,t){for(var n={},r=[],a=0;a<e.length;a++){var o=e[a],s=t.base?o[0]+t.base:o[0],l=n[s]||0,u="".concat(s," ").concat(l);n[s]=l+1;var d=c(u),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(i[d].references++,i[d].updater(f)):i.push({identifier:u,updater:h(f,t),references:1}),r.push(u)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var a=n.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,n,r){var a=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,a);else{var o=document.createTextNode(a),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,a=n.media,o=n.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function h(e,t){var n,r,a;if(t.singleton){var o=m++;n=g||(g=l(t)),r=f.bind(null,n,o,!1),a=f.bind(null,n,o,!0)}else n=l(t),r=p.bind(null,n,t),a=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 a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=a());var n=s(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 a=c(n[r]);i[a].references--}for(var o=s(e,t),l=0;l<n.length;l++){var u=c(n[l]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},function(e,t){e.exports='.ck-content .page-break{position:relative;clear:both;padding:5px 0;display:flex;align-items:center;justify-content:center}.ck-content .page-break:after{content:"";position:absolute;border-bottom:2px dashed #c4c4c4;width:100%}.ck-content .page-break__label{position:relative;z-index:1;padding:.3em .6em;display:block;text-transform:uppercase;border:1px solid #c4c4c4;border-radius:2px;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;color:#333;background:#fff;box-shadow:2px 2px 1px rgba(0,0,0,.15);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}}'},function(e,t,n){"use strict";n.r(t),n.d(t,"PageBreak",(function(){return l})),n.d(t,"PageBreakEditing",(function(){return i})),n.d(t,"PageBreakUI",(function(){return s}));var r=n(0),a=n(1);class o extends r.Command{refresh(){this.isEnabled=function(e){const t=e.schema,n=e.document.selection;return function(e,t,n){const r=function(e,t){const n=Object(a.findOptimalInsertionPosition)(e,t).parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,n);return t.checkChild(r,"pageBreak")}(n,t,e)&&!Object(a.checkSelectionOnObject)(n,t)}(this.editor.model)}execute(){const e=this.editor.model;e.change(t=>{const n=t.createElement("pageBreak");e.insertContent(n);let r=n.nextSibling;!(r&&e.schema.checkChild(r,"$text"))&&e.schema.checkChild(n.parent,"paragraph")&&(r=t.createElement("paragraph"),e.insertContent(r,t.createPositionAfter(n))),r&&t.setSelection(r,0)})}}n(4);class i extends r.Plugin{static get pluginName(){return"PageBreakEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,r=e.conversion;t.register("pageBreak",{isObject:!0,allowWhere:"$block"}),r.for("dataDowncast").elementToElement({model:"pageBreak",view:(e,{writer:t})=>{const n=t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"}),r=t.createContainerElement("span",{style:"display: none"});return t.insert(t.createPositionAt(n,0),r),n}}),r.for("editingDowncast").elementToElement({model:"pageBreak",view:(e,{writer:t})=>{const r=n("Page break"),o=t.createContainerElement("div"),i=t.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=n("Page break")}));return t.addClass("page-break",o),t.insert(t.createPositionAt(o,0),i),function(e,t,n){return t.setCustomProperty("pageBreak",!0,e),Object(a.toWidget)(e,t,{label:n})}(o,t,r)}}),r.for("upcast").elementToElement({view:e=>{const t="always"==e.getStyle("page-break-before"),n="always"==e.getStyle("page-break-after");if(t||n){if(1==e.childCount){const t=e.getChild(0);if(!t.is("element","span")||"none"!=t.getStyle("display"))return}else if(e.childCount>1)return;return{name:!0}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new o(e))}}var c=n(3);class s extends r.Plugin{static get pluginName(){return"PageBreakUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("pageBreak",n=>{const r=e.commands.get("pageBreak"),a=new c.ButtonView(n);return a.set({label:t("Page break"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.598.687h1.5v5h-1.5zm14.5 0h1.5v5h-1.5z"/><path d="M19.598 4.187v1.5h-16v-1.5zm-16 14.569h1.5v-5h-1.5zm14.5 0h1.5v-5h-1.5z"/><path d="M19.598 15.256v-1.5h-16v1.5zM5.081 9h6v2h-6zm8 0h6v2h-6zm-9.483 1L0 12.5v-5z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{e.execute("pageBreak"),e.editing.view.focus()}),a})}}class l extends r.Plugin{static get requires(){return[i,s,a.Widget]}static get pluginName(){return"PageBreak"}}}]); |
{ | ||
"name": "@ckeditor/ckeditor5-page-break", | ||
"version": "27.1.0", | ||
"version": "28.0.0", | ||
"description": "Page break feature for CKEditor 5.", | ||
@@ -14,16 +14,16 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^27.1.0" | ||
"ckeditor5": "^28.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-cloud-services": "^27.1.0", | ||
"@ckeditor/ckeditor5-core": "^27.1.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^24.0.0", | ||
"@ckeditor/ckeditor5-easy-image": "^27.1.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^27.1.0", | ||
"@ckeditor/ckeditor5-engine": "^27.1.0", | ||
"@ckeditor/ckeditor5-image": "^27.1.0", | ||
"@ckeditor/ckeditor5-paragraph": "^27.1.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^27.1.0", | ||
"@ckeditor/ckeditor5-ui": "^27.1.0", | ||
"@ckeditor/ckeditor5-widget": "^27.1.0", | ||
"@ckeditor/ckeditor5-cloud-services": "^28.0.0", | ||
"@ckeditor/ckeditor5-core": "^28.0.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^25.0.0", | ||
"@ckeditor/ckeditor5-easy-image": "^28.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^28.0.0", | ||
"@ckeditor/ckeditor5-engine": "^28.0.0", | ||
"@ckeditor/ckeditor5-image": "^28.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^28.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^28.0.0", | ||
"@ckeditor/ckeditor5-ui": "^28.0.0", | ||
"@ckeditor/ckeditor5-widget": "^28.0.0", | ||
"webpack": "^4.43.0", | ||
@@ -30,0 +30,0 @@ "webpack-cli": "^3.3.11" |
@@ -10,10 +10,4 @@ /** | ||
import PageBreak from './pagebreak'; | ||
import PageBreakEditing from './pagebreakediting'; | ||
import PageBreakUI from './pagebreakui'; | ||
export default { | ||
PageBreak, | ||
PageBreakEditing, | ||
PageBreakUI | ||
}; | ||
export { default as PageBreak } from './pagebreak'; | ||
export { default as PageBreakEditing } from './pagebreakediting'; | ||
export { default as PageBreakUI } from './pagebreakui'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83093
49
342
+ Added@ckeditor/ckeditor5-clipboard@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-core@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-engine@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-enter@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-paragraph@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-select-all@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-typing@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-ui@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-undo@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-upload@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-utils@28.0.0(transitive)
+ Added@ckeditor/ckeditor5-widget@28.0.0(transitive)
+ Addedckeditor5@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-clipboard@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-core@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-engine@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-enter@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-paragraph@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-select-all@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-typing@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-ui@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-undo@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-upload@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-utils@27.1.0(transitive)
- Removed@ckeditor/ckeditor5-widget@27.1.0(transitive)
- Removedckeditor5@27.1.0(transitive)
Updatedckeditor5@^28.0.0