Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-page-break

Package Overview
Dependencies
Maintainers
1
Versions
691
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-page-break - npm Package Compare versions

Comparing version 32.0.0 to 33.0.0

build/page-break.js.map

4

build/page-break.js
!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Page break":"Page break"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
* @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var e={587:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(609),a=n.n(r)()((function(e){return e[1]}));a.push([e.id,'.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}}',""]);const i=a},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 a={};if(r)for(var i=0;i<this.length;i++){var o=this[i][0];null!=o&&(a[o]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);r&&a[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,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),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(o[u].references++,o[u].updater(p)):o.push({identifier:d,updater:h(p,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 p(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 f(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=p.bind(null,n,i,!1),a=p.bind(null,n,i,!0)}else n=l(t),r=f.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}}}},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 a=t[r];if(void 0!==a)return a.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})};var r={};(()=>{"use strict";n.r(r),n.d(r,{PageBreak:()=>p,PageBreakEditing:()=>l,PageBreakUI:()=>u});var e=n(704),t=n(995);class a extends e.Command{refresh(){const e=this.editor.model,n=e.schema,r=e.document.selection;this.isEnabled=function(e,n,r){const a=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(a,"pageBreak")}(r,n,e)}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)}))}}var i=n(62),o=n.n(i),s=n(587),c={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o()(s.Z,c);s.Z.locals;class l extends e.Plugin{static get pluginName(){return"PageBreakEditing"}init(){const e=this.editor,n=e.model.schema,r=e.t,i=e.conversion;n.register("pageBreak",{isObject:!0,allowWhere:"$block"}),i.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}}),i.for("editingDowncast").elementToElement({model:"pageBreak",view:(e,{writer:n})=>{const a=r("Page break"),i=n.createContainerElement("div"),o=n.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=r("Page break")}));return n.addClass("page-break",i),n.insert(n.createPositionAt(i,0),o),function(e,n,r){return n.setCustomProperty("pageBreak",!0,e),(0,t.toWidget)(e,n,{label:r})}(i,n,a)}}),i.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 a(e))}}var d=n(273);class u extends e.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 d.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 p extends e.Plugin{static get requires(){return[l,u,t.Widget]}static get pluginName(){return"PageBreak"}}})(),(window.CKEditor5=window.CKEditor5||{}).pageBreak=r})();
*/(()=>{var e={587:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(609),a=n.n(r)()((function(e){return e[1]}));a.push([e.id,'.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}}',""]);const i=a},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 a={};if(r)for(var i=0;i<this.length;i++){var o=this[i][0];null!=o&&(a[o]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);r&&a[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,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),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(o[u].references++,o[u].updater(p)):o.push({identifier:d,updater:m(p,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 p(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 f(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,h=0;function m(e,t){var n,r,a;if(t.singleton){var i=h++;n=g||(g=l(t)),r=p.bind(null,n,i,!1),a=p.bind(null,n,i,!0)}else n=l(t),r=f.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}}}},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 a=t[r];if(void 0!==a)return a.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})};var r={};(()=>{"use strict";n.r(r),n.d(r,{PageBreak:()=>p,PageBreakEditing:()=>l,PageBreakUI:()=>u});var e=n(704),t=n(995);class a extends e.Command{refresh(){const e=this.editor.model,n=e.schema,r=e.document.selection;this.isEnabled=function(e,n,r){const a=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(a,"pageBreak")}(r,n,e)}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)}))}}var i=n(62),o=n.n(i),s=n(587),c={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o()(s.Z,c);s.Z.locals;class l extends e.Plugin{static get pluginName(){return"PageBreakEditing"}init(){const e=this.editor,n=e.model.schema,r=e.t,i=e.conversion;n.register("pageBreak",{isObject:!0,allowWhere:"$block"}),i.for("dataDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},t.createContainerElement("span",{style:"display: none"}))}),i.for("editingDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:n})=>{const a=r("Page break"),i=n.createContainerElement("div"),o=n.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=r("Page break")}));return n.addClass("page-break",i),n.insert(n.createPositionAt(i,0),o),function(e,n,r){return n.setCustomProperty("pageBreak",!0,e),(0,t.toWidget)(e,n,{label:r})}(i,n,a)}}),i.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 a(e))}}var d=n(273);class u extends e.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 d.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 p extends e.Plugin{static get requires(){return[l,u,t.Widget]}static get pluginName(){return"PageBreak"}}})(),(window.CKEditor5=window.CKEditor5||{}).pageBreak=r})();
{
"name": "@ckeditor/ckeditor5-page-break",
"version": "32.0.0",
"version": "33.0.0",
"description": "Page break feature for CKEditor 5.",

@@ -15,16 +15,16 @@ "keywords": [

"dependencies": {
"ckeditor5": "^32.0.0"
"ckeditor5": "^33.0.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-cloud-services": "^32.0.0",
"@ckeditor/ckeditor5-core": "^32.0.0",
"@ckeditor/ckeditor5-dev-utils": "^27.1.0",
"@ckeditor/ckeditor5-easy-image": "^32.0.0",
"@ckeditor/ckeditor5-editor-classic": "^32.0.0",
"@ckeditor/ckeditor5-engine": "^32.0.0",
"@ckeditor/ckeditor5-image": "^32.0.0",
"@ckeditor/ckeditor5-paragraph": "^32.0.0",
"@ckeditor/ckeditor5-theme-lark": "^32.0.0",
"@ckeditor/ckeditor5-ui": "^32.0.0",
"@ckeditor/ckeditor5-widget": "^32.0.0",
"@ckeditor/ckeditor5-cloud-services": "^33.0.0",
"@ckeditor/ckeditor5-core": "^33.0.0",
"@ckeditor/ckeditor5-dev-utils": "^28.0.1",
"@ckeditor/ckeditor5-easy-image": "^33.0.0",
"@ckeditor/ckeditor5-editor-classic": "^33.0.0",
"@ckeditor/ckeditor5-engine": "^33.0.0",
"@ckeditor/ckeditor5-image": "^33.0.0",
"@ckeditor/ckeditor5-paragraph": "^33.0.0",
"@ckeditor/ckeditor5-theme-lark": "^33.0.0",
"@ckeditor/ckeditor5-ui": "^33.0.0",
"@ckeditor/ckeditor5-widget": "^33.0.0",
"webpack": "^5.58.1",

@@ -31,0 +31,0 @@ "webpack-cli": "^4.9.0"

@@ -44,19 +44,18 @@ /**

conversion.for( 'dataDowncast' ).elementToElement( {
conversion.for( 'dataDowncast' ).elementToStructure( {
model: 'pageBreak',
view: ( modelElement, { writer } ) => {
const divElement = writer.createContainerElement( 'div', {
class: 'page-break',
// If user has no `.ck-content` styles, it should always break a page during print.
style: 'page-break-after: always'
} );
const divElement = writer.createContainerElement( 'div',
{
class: 'page-break',
// If user has no `.ck-content` styles, it should always break a page during print.
style: 'page-break-after: always'
},
// For a rationale of using span inside a div see:
// https://github.com/ckeditor/ckeditor5-page-break/pull/1#discussion_r328934062.
writer.createContainerElement( 'span', {
style: 'display: none'
} )
);
// For a rationale of using span inside a div see:
// https://github.com/ckeditor/ckeditor5-page-break/pull/1#discussion_r328934062.
const spanElement = writer.createContainerElement( 'span', {
style: 'display: none'
} );
writer.insert( writer.createPositionAt( divElement, 0 ), spanElement );
return divElement;

@@ -66,3 +65,3 @@ }

conversion.for( 'editingDowncast' ).elementToElement( {
conversion.for( 'editingDowncast' ).elementToStructure( {
model: 'pageBreak',

@@ -69,0 +68,0 @@ view: ( modelElement, { writer } ) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc