@ckeditor/ckeditor5-export-pdf 38.1.1 → 38.2.0-alpha.1

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.
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var t={861:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(758),o=n.n(r)()((function(t){return t[1]}));o.push([t.id,":root{--ck-toolbar-spinner-size:18px}.ck-exportpdf_status-pending{position:relative}.ck.ck-exportpdf__spinner-container{display:none}.ck.ck-exportpdf__spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;left:0;margin:0 auto;right:0;top:50%;transform:translateY(-50%);z-index:1}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container,.ck.ck-exportpdf__spinner{height:var(--ck-toolbar-spinner-size);position:absolute;width:var(--ck-toolbar-spinner-size)}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container{animation:rotate 1.5s linear infinite;display:block}.ck-exportpdf_status-pending .ck.ck-button__icon{color:transparent}@keyframes rotate{to{transform:rotate(1turn)}}",""]);const i=o},758:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},278:(t,e,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s=[];function a(t){for(var e=-1,n=0;n<s.length;n++)if(s[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},r=[],o=0;o<t.length;o++){var i=t[o],c=e.base?i[0]+e.base:i[0],d=n[c]||0,l="".concat(c," ").concat(d);n[c]=d+1;var u=a(l),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(s[u].references++,s[u].updater(p)):s.push({identifier:l,updater:m(p,e),references:1}),r.push(l)}return r}function d(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var s=i(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var l,u=(l=[],function(t,e){return l[t]=e,l.filter(Boolean).join("\n")});function p(t,e,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=u(e,o);else{var i=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}function f(t,e,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var h=null,v=0;function m(t,e){var n,r,o;if(e.singleton){var i=v++;n=h||(h=d(e)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=d(e),r=f.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var o=a(n[r]);s[o].references--}for(var i=c(t,e),d=0;d<n.length;d++){var l=a(n[d]);0===s[l].references&&(s[l].updater(),s.splice(l,1))}n=i}}}},704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{ExportPdf:()=>h});var t=n(704),e=n(273);const o=[".ck-content","hasAttribute","push","warn","indexOf","then","styleSheets",":root","from","trim","text","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.","cssText","length"];var i,s;i=o,s=137,function(t){for(;--t;)i.push(i.shift())}(++s);const a=function(t,e){return o[t-=0]};function c(){const t=[],e=[];for(const n of Array.from(document[a("0x9")]))if(n.ownerNode[a("0x4")]("data-cke"))for(const r of Array[a("0xb")](n.cssRules))-1!==r.cssText.indexOf(a("0x3"))?t[a("0x5")](r[a("0x1")]):-1!==r[a("0x1")][a("0x7")](a("0xa"))&&e[a("0x5")](r[a("0x1")]);return t[a("0x2")]||console[a("0x6")](a("0x0")),[...e,...t].join(" ")[a("0xc")]()}class d extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,n=e.t,r=t.converterUrl||"https://pdf-converter.cke-cs.com/v1/convert/",o=t.dataCallback||(t=>t.data.get()),i=e.plugins.get("ExportPdf"),s=t.token||i._token;return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const n of t)"EDITOR_STYLES"!==n?e[a("0x5")](window.fetch(n).then((t=>t[a("0xd")]()))):e[a("0x5")](c());return Promise.all(e)[a("0x8")]((t=>t.join(" ")[a("0xc")]()))}(t.stylesheets||["EDITOR_STYLES"]).then((async n=>{const i={html:'<html>\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<meta charset="utf-8">\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<div class="ck-content" dir="'+e.locale.contentLanguageDirection+'">\n\t\t\t\t\t\t\t\t'+await o(e)+"\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t</html>",css:n,options:t.converterOptions},a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf",...s?{Authorization:s.value}:null,"x-cs-app-id":t.appID||"cke5"},body:JSON.stringify(i)};return window.fetch(r,a).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const n="function"==typeof t.fileName?t.fileName():t.fileName;this._downloadFile(e,n||"document.pdf")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(n("An error occurred while generating the PDF.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}_downloadFile(t,e){const n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e,n.click(),n.remove()}}var l=n(278),u=n.n(l),p=n(861),f={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};u()(p.Z,f);p.Z.locals;class h extends t.Plugin{static get pluginName(){return"ExportPdf"}static get requires(){return["CloudServices",e.Notification]}init(){const t=this.editor,n=t.t,r=t.config.get("exportPdf")||{};t.commands.add("exportPdf",new d(t)),t.ui.componentFactory.add("exportPdf",(o=>{const i=t.commands.get("exportPdf"),s=new e.ButtonView(o);s.set({label:n("Export to PDF"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M19 4.5 14 0H3v6.5h1.5v-5h8v5h5V11H19V4.5ZM14 2l3.3 3H14V2Z"/><path d="m12.452 18.5 1.25 1.5H3v-3h1.5v1.5h7.952Z"/><path d="M19.826 16.843a.75.75 0 1 0-1.152-.96L17.5 17.29V13H16v4.29l-1.174-1.408a.75.75 0 1 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Z"/><path d="M1.63 14.24V12.3h.88c.66 0 1.14-.15 1.46-.45.32-.3.48-.71.48-1.24 0-.52-.15-.91-.44-1.2C3.7 9.15 3.28 9 2.69 9H0v5.24h1.63Zm.4-3h-.4v-1.17h.46c.3 0 .5.05.62.17.1.11.16.25.16.42 0 .16-.06.3-.19.41-.13.11-.34.16-.66.16l.01.01Zm5.7 3c.28 0 .6-.05.96-.14.26-.07.5-.21.73-.42.22-.2.4-.47.53-.77.12-.31.19-.75.19-1.3 0-.37-.04-.7-.13-1.02a2.3 2.3 0 0 0-.42-.84c-.19-.24-.43-.43-.72-.56C8.57 9.06 8.2 9 7.72 9h-2.4v5.24H7.73Zm-.4-1.19h-.4v-2.86h.4c.43 0 .73.1.91.3.18.2.27.59.27 1.14 0 .42-.04.73-.12.91a.76.76 0 0 1-.34.4c-.14.07-.38.11-.72.11Zm5.3 1.2V12.1h2.02v-1.06h-2.03v-.91H15V9h-4v5.24h1.62l.01.01Z"/></svg>\n',tooltip:!0}),s.bind("isOn","isEnabled").to(i,"isBusy","isEnabled"),s.extendTemplate({attributes:{class:[s.bindTemplate.if("isOn","ck-exportpdf_status-pending")]}});const a=new e.View;return a.setTemplate({tag:"span",attributes:{class:["ck","ck-exportpdf__spinner-container"]},children:[{tag:"span",attributes:{class:["ck","ck-exportpdf__spinner"]}}]}),s.children.add(a),this.listenTo(s,"execute",(()=>{t.execute("exportPdf",r),t.editing.view.focus()})),s}));const o=t.plugins.get("CloudServices");!1===r.tokenUrl?this._token=null:r.tokenUrl?o.registerTokenUrl(r.tokenUrl).then((t=>{this._token=t})):this._token=o.token}}})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();
5
+ */(()=>{var t={561:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(758),o=n.n(r)()((function(t){return t[1]}));o.push([t.id,":root{--ck-toolbar-spinner-size:18px}.ck-exportpdf_status-pending{position:relative}.ck.ck-exportpdf__spinner-container{display:none}.ck.ck-exportpdf__spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;left:0;margin:0 auto;right:0;top:50%;transform:translateY(-50%);z-index:1}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container,.ck.ck-exportpdf__spinner{height:var(--ck-toolbar-spinner-size);position:absolute;width:var(--ck-toolbar-spinner-size)}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container{animation:rotate 1.5s linear infinite;display:block}.ck-exportpdf_status-pending .ck.ck-button__icon{color:transparent}@keyframes rotate{to{transform:rotate(1turn)}}",""]);const i=o},758:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},278:(t,e,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s=[];function a(t){for(var e=-1,n=0;n<s.length;n++)if(s[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},r=[],o=0;o<t.length;o++){var i=t[o],c=e.base?i[0]+e.base:i[0],d=n[c]||0,l="".concat(c," ").concat(d);n[c]=d+1;var u=a(l),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(s[u].references++,s[u].updater(p)):s.push({identifier:l,updater:x(p,e),references:1}),r.push(l)}return r}function d(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var s=i(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var l,u=(l=[],function(t,e){return l[t]=e,l.filter(Boolean).join("\n")});function p(t,e,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=u(e,o);else{var i=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}function f(t,e,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var h=null,v=0;function x(t,e){var n,r,o;if(e.singleton){var i=v++;n=h||(h=d(e)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=d(e),r=f.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var o=a(n[r]);s[o].references--}for(var i=c(t,e),d=0;d<n.length;d++){var l=a(n[d]);0===s[l].references&&(s[l].updater(),s.splice(l,1))}n=i}}}},704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{ExportPdf:()=>h});var t=n(704),e=n(273);const o=["data-cke","from","push","then","text",".ck-content","cssText","indexOf","join","all","ownerNode","hasAttribute","styleSheets","trim","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.",":root","fetch","cssRules"];var i,s;i=o,s=115,function(t){for(;--t;)i.push(i.shift())}(++s);const a=function(t,e){return o[t-=0]};function c(){const t=[],e=[];for(const n of Array[a("0xc")](document[a("0x5")]))if(n[a("0x3")][a("0x4")](a("0xb")))for(const r of Array[a("0xc")](n[a("0xa")]))-1!==r[a("0x11")][a("0x0")](a("0x10"))?t.push(r[a("0x11")]):-1!==r[a("0x11")][a("0x0")](a("0x8"))&&e.push(r[a("0x11")]);return t.length||console.warn(a("0x7")),[...e,...t][a("0x1")](" ").trim()}class d extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,n=e.t,r=t.converterUrl||"https://pdf-converter.cke-cs.com/v1/convert/",o=t.dataCallback||(t=>t.data.get()),i=e.plugins.get("ExportPdf"),s=t.token||i._token;return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const n of t)"EDITOR_STYLES"!==n?e[a("0xd")](window[a("0x9")](n)[a("0xe")]((t=>t[a("0xf")]()))):e[a("0xd")](c());return Promise[a("0x2")](e)[a("0xe")]((t=>t[a("0x1")](" ")[a("0x6")]()))}(t.stylesheets||["EDITOR_STYLES"]).then((async n=>{const i={html:'<html>\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<title>CKEditor 5 PDF document</title>\n\t\t\t\t\t\t\t<meta charset="utf-8">\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<div class="ck-content" dir="'+e.locale.contentLanguageDirection+'">\n\t\t\t\t\t\t\t\t'+await o(e)+"\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>",css:n,options:t.converterOptions},a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf",...s?{Authorization:s.value}:null,"x-cs-app-id":t.appID||"cke5"},body:JSON.stringify(i)};return window.fetch(r,a).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const n="function"==typeof t.fileName?t.fileName():t.fileName;this._downloadFile(e,n||"document.pdf")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(n("An error occurred while generating the PDF.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}_downloadFile(t,e){const n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e,n.click(),n.remove()}}var l=n(278),u=n.n(l),p=n(561),f={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};u()(p.Z,f);p.Z.locals;class h extends t.Plugin{static get pluginName(){return"ExportPdf"}static get requires(){return["CloudServices",e.Notification]}init(){const t=this.editor,n=t.t,r=t.config.get("exportPdf")||{};t.commands.add("exportPdf",new d(t)),t.ui.componentFactory.add("exportPdf",(o=>{const i=t.commands.get("exportPdf"),s=new e.ButtonView(o);s.set({label:n("Export to PDF"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M19 4.5 14 0H3v6.5h1.5v-5h8v5h5V11H19V4.5ZM14 2l3.3 3H14V2Z"/><path d="m12.452 18.5 1.25 1.5H3v-3h1.5v1.5h7.952Z"/><path d="M19.826 16.843a.75.75 0 1 0-1.152-.96L17.5 17.29V13H16v4.29l-1.174-1.408a.75.75 0 1 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Z"/><path d="M1.63 14.24V12.3h.88c.66 0 1.14-.15 1.46-.45.32-.3.48-.71.48-1.24 0-.52-.15-.91-.44-1.2C3.7 9.15 3.28 9 2.69 9H0v5.24h1.63Zm.4-3h-.4v-1.17h.46c.3 0 .5.05.62.17.1.11.16.25.16.42 0 .16-.06.3-.19.41-.13.11-.34.16-.66.16l.01.01Zm5.7 3c.28 0 .6-.05.96-.14.26-.07.5-.21.73-.42.22-.2.4-.47.53-.77.12-.31.19-.75.19-1.3 0-.37-.04-.7-.13-1.02a2.3 2.3 0 0 0-.42-.84c-.19-.24-.43-.43-.72-.56C8.57 9.06 8.2 9 7.72 9h-2.4v5.24H7.73Zm-.4-1.19h-.4v-2.86h.4c.43 0 .73.1.91.3.18.2.27.59.27 1.14 0 .42-.04.73-.12.91a.76.76 0 0 1-.34.4c-.14.07-.38.11-.72.11Zm5.3 1.2V12.1h2.02v-1.06h-2.03v-.91H15V9h-4v5.24h1.62l.01.01Z"/></svg>\n',tooltip:!0}),s.bind("isOn","isEnabled").to(i,"isBusy","isEnabled"),s.extendTemplate({attributes:{class:[s.bindTemplate.if("isOn","ck-exportpdf_status-pending")]}});const a=new e.View;return a.setTemplate({tag:"span",attributes:{class:["ck","ck-exportpdf__spinner-container"]},children:[{tag:"span",attributes:{class:["ck","ck-exportpdf__spinner"]}}]}),s.children.add(a),this.listenTo(s,"execute",(()=>{t.execute("exportPdf",r),t.editing.view.focus()})),s}));const o=t.plugins.get("CloudServices");!1===r.tokenUrl?this._token=null:r.tokenUrl?o.registerTokenUrl(r.tokenUrl).then((t=>{this._token=t})):this._token=o.token}}})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-export-pdf",
3
- "version": "38.1.1",
3
+ "version": "38.2.0-alpha.1",
4
4
  "description": "Export to PDF feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -28,8 +28,9 @@
28
28
  "HTML to PDF"
29
29
  ],
30
30
  "main": "src/index.js",
31
+ "type": "module",
31
32
  "dependencies": {
32
- "ckeditor5": "38.1.1"
33
+ "ckeditor5": "38.2.0-alpha.1"
33
34
  },
34
35
  "engines": {
35
36
  "node": ">=16.0.0",
@@ -1,21 +1,21 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { ExportPdfConfig, ExportPdf, ExportPdfCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the {@link module:export-pdf/exportpdf~ExportPdf export to PDF feature}.
10
- *
11
- * Read more in {@link module:export-pdf/exportpdf~ExportPdfConfig}.
12
- */
13
- exportPdf?: ExportPdfConfig;
14
- }
15
- interface PluginsMap {
16
- [ExportPdf.pluginName]: ExportPdf;
17
- }
18
- interface CommandsMap {
19
- exportPdf: ExportPdfCommand;
20
- }
21
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { ExportPdfConfig, ExportPdf, ExportPdfCommand } from './index.js';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:export-pdf/exportpdf~ExportPdf export to PDF feature}.
10
+ *
11
+ * Read more in {@link module:export-pdf/exportpdf~ExportPdfConfig}.
12
+ */
13
+ exportPdf?: ExportPdfConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [ExportPdf.pluginName]: ExportPdf;
17
+ }
18
+ interface CommandsMap {
19
+ exportPdf: ExportPdfCommand;
20
+ }
21
+ }
@@ -1,221 +1,221 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module export-pdf/exportpdf
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import { Notification } from 'ckeditor5/src/ui';
11
- import type { InitializedToken, TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
12
- import '../theme/exportpdf.css';
13
- /**
14
- * The export to PDF feature.
15
- *
16
- * It allows you to generate a PDF file directly from the editor content.
17
- *
18
- * For a detailed overview, check the {@glink features/converters/export-pdf export to PDF} feature documentation.
19
- */
20
- export default class ExportPdf extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "ExportPdf";
25
- /**
26
- * @inheritDoc
27
- */
28
- static get requires(): readonly ["CloudServices", typeof Notification];
29
- /**
30
- * @inheritDoc
31
- */
32
- init(): void;
33
- }
34
- /**
35
- * The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.
36
- *
37
- * ```ts
38
- * ClassicEditor
39
- * .create( editorElement, {
40
- * exportPdf: ... // Export to PDF feature options.
41
- * } )
42
- * .then( ... )
43
- * .catch( ... );
44
- * ```
45
- *
46
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
47
- */
48
- export interface ExportPdfConfig {
49
- /**
50
- * Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
51
- *
52
- * ```ts
53
- * const exportPdfConfig = {
54
- * stylesheets: [ './path/to/custom-style.css' ]
55
- * }
56
- * ```
57
- *
58
- * **NOTE:** If `stylesheets` are not provided, the plugin will sent only
59
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.
60
- *
61
- * **Default editor's content styles**:
62
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles The default editor content styles}
63
- * are applied to the generated PDF thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
64
- * If you don't want them to be applied, you have to omit the token:
65
- *
66
- * ```ts
67
- * const exportPdfConfig = {
68
- * stylesheets: [ './path/to/custom-editor-styles.css' ]
69
- * }
70
- * ```
71
- *
72
- * **Web fonts:** If you want to {@glink features/converters/export-pdf#providing-web-font-styles use web fonts} in your PDF document,
73
- * you should provide a path to the file containing the web font declaration before the `'EDITOR_STYLES'` token:
74
- *
75
- * ```ts
76
- * const exportPdfConfig = {
77
- * stylesheets: [
78
- * './path/to/fonts.css',
79
- * 'EDITOR_STYLES'
80
- * ]
81
- * }
82
- * ```
83
- *
84
- * **Web fonts and custom styling:** For more advanced styling, your configuration should look like this:
85
- *
86
- * ```ts
87
- * const exportPdfConfig = {
88
- * stylesheets: [
89
- * './path/to/fonts.css',
90
- * 'EDITOR_STYLES',
91
- * './path/to/custom-styles.css'
92
- * ]
93
- * }
94
- * ```
95
- *
96
- * @default `[ 'EDITOR_STYLES' ]`
97
- */
98
- stylesheets?: Array<string>;
99
- /**
100
- * The name of the generated PDF file.
101
- *
102
- * ```ts
103
- * // Static file name.
104
- * const exportPdfConfig = {
105
- * fileName: 'my-document.pdf'
106
- * }
107
- *
108
- * // Dynamic file name.
109
- * const exportPdfConfig = {
110
- * fileName: () => {
111
- * const articleTitle = document.querySelector( '#title' );
112
- *
113
- * return `${ articleTitle.value }.pdf`;
114
- * }
115
- * }
116
- * ```
117
- *
118
- * **NOTE:** The file name must contain the `.pdf` extension.
119
- * Otherwise your operating system or device may have trouble identifying the file type.
120
- *
121
- * @default 'document.pdf'
122
- */
123
- fileName?: string | (() => string);
124
- /**
125
- * A URL to the HTML to PDF converter.
126
- *
127
- * ```ts
128
- * const exportPdfConfig = {
129
- * converterUrl: 'https://myconverter.com/v1/'
130
- * }
131
- * ```
132
- *
133
- * **NOTE:** The plugin uses the default HTML to PDF converter delivered by CKEditor Cloud Services.
134
- * You can provide a URL to an on-premises converter instead.
135
- *
136
- * @default 'https://pdf-converter.cke-cs.com/v1/convert'
137
- */
138
- converterUrl?: string;
139
- /**
140
- * The HTML to PDF converter options.
141
- *
142
- * **NOTE:** Configuring the plugin is not mandatory but it is highly recommended,
143
- * especially if you want to get the most accurate results when generating the PDF file.
144
- * To learn more, please check the [HTML to PDF converter configuration](https://pdf-converter.cke-cs.com/docs).
145
- *
146
- * ```ts
147
- * const exportPdfConfig = {
148
- * converterOptions: {
149
- * ...
150
- * }
151
- * }
152
- * ```
153
- *
154
- * @default `{
155
- * format: 'A4',
156
- * margin_top: '0',
157
- * margin_bottom: '0',
158
- * margin_right: '0',
159
- * margin_left: '0',
160
- * page_orientation: 'portrait',
161
- * header_html: undefined,
162
- * footer_html: undefined,
163
- * header_and_footer_css: undefined,
164
- * wait_for_network: true,
165
- * wait_time: 0
166
- * }`
167
- */
168
- converterOptions?: ExportPdfConverterOptions;
169
- /**
170
- * A function to gather the HTML to be converted to PDF.
171
- *
172
- * **NOTE:** This option may be useful when the editor does not have `getData()` method,
173
- * or if the HTML to be converted should be different than the edited one.
174
- *
175
- * ```ts
176
- * const exportPdfConfig = {
177
- * dataCallback: ( editor: Editor ) => {
178
- * return `
179
- * <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
180
- * <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
181
- * `;
182
- * }
183
- * }
184
- * ```
185
- *
186
- * @default `( editor: Editor ) => editor.getData()`
187
- */
188
- dataCallback?: (editor: Editor) => string;
189
- /**
190
- * A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
191
- * the export to PDF feature.
192
- *
193
- * **Note:** The token can be disabled with the `false` value provided.
194
- *
195
- * See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
196
- */
197
- tokenUrl?: TokenUrl | false;
198
- /**
199
- * The authentication token.
200
- *
201
- * See: {@link module:cloud-services/cloudservices~CloudServices#token}
202
- */
203
- token?: InitializedToken;
204
- /**
205
- * The application unique identifier.
206
- */
207
- appID?: string;
208
- }
209
- export type ExportPdfConverterOptions = {
210
- format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
211
- margin_top?: string;
212
- margin_bottom?: string;
213
- margin_right?: string;
214
- margin_left?: string;
215
- header_html?: string;
216
- footer_html?: string;
217
- header_and_footer_css?: string;
218
- page_orientation?: 'portrait' | 'landscape';
219
- wait_for_network?: boolean;
220
- wait_time?: number;
221
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module export-pdf/exportpdf
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
10
+ import { Notification } from 'ckeditor5/src/ui.js';
11
+ import type { InitializedToken, TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
12
+ import '../theme/exportpdf.css';
13
+ /**
14
+ * The export to PDF feature.
15
+ *
16
+ * It allows you to generate a PDF file directly from the editor content.
17
+ *
18
+ * For a detailed overview, check the {@glink features/converters/export-pdf export to PDF} feature documentation.
19
+ */
20
+ export default class ExportPdf extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "ExportPdf";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get requires(): readonly ["CloudServices", typeof Notification];
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ init(): void;
33
+ }
34
+ /**
35
+ * The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.
36
+ *
37
+ * ```ts
38
+ * ClassicEditor
39
+ * .create( editorElement, {
40
+ * exportPdf: ... // Export to PDF feature options.
41
+ * } )
42
+ * .then( ... )
43
+ * .catch( ... );
44
+ * ```
45
+ *
46
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
47
+ */
48
+ export interface ExportPdfConfig {
49
+ /**
50
+ * Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
51
+ *
52
+ * ```ts
53
+ * const exportPdfConfig = {
54
+ * stylesheets: [ './path/to/custom-style.css' ]
55
+ * }
56
+ * ```
57
+ *
58
+ * **NOTE:** If `stylesheets` are not provided, the plugin will sent only
59
+ * {@glink installation/advanced/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.
60
+ *
61
+ * **Default editor's content styles**:
62
+ * {@glink installation/advanced/content-styles#the-full-list-of-content-styles The default editor content styles}
63
+ * are applied to the generated PDF thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
64
+ * If you don't want them to be applied, you have to omit the token:
65
+ *
66
+ * ```ts
67
+ * const exportPdfConfig = {
68
+ * stylesheets: [ './path/to/custom-editor-styles.css' ]
69
+ * }
70
+ * ```
71
+ *
72
+ * **Web fonts:** If you want to {@glink features/converters/export-pdf#providing-web-font-styles use web fonts} in your PDF document,
73
+ * you should provide a path to the file containing the web font declaration before the `'EDITOR_STYLES'` token:
74
+ *
75
+ * ```ts
76
+ * const exportPdfConfig = {
77
+ * stylesheets: [
78
+ * './path/to/fonts.css',
79
+ * 'EDITOR_STYLES'
80
+ * ]
81
+ * }
82
+ * ```
83
+ *
84
+ * **Web fonts and custom styling:** For more advanced styling, your configuration should look like this:
85
+ *
86
+ * ```ts
87
+ * const exportPdfConfig = {
88
+ * stylesheets: [
89
+ * './path/to/fonts.css',
90
+ * 'EDITOR_STYLES',
91
+ * './path/to/custom-styles.css'
92
+ * ]
93
+ * }
94
+ * ```
95
+ *
96
+ * @default `[ 'EDITOR_STYLES' ]`
97
+ */
98
+ stylesheets?: Array<string>;
99
+ /**
100
+ * The name of the generated PDF file.
101
+ *
102
+ * ```ts
103
+ * // Static file name.
104
+ * const exportPdfConfig = {
105
+ * fileName: 'my-document.pdf'
106
+ * }
107
+ *
108
+ * // Dynamic file name.
109
+ * const exportPdfConfig = {
110
+ * fileName: () => {
111
+ * const articleTitle = document.querySelector( '#title' );
112
+ *
113
+ * return `${ articleTitle.value }.pdf`;
114
+ * }
115
+ * }
116
+ * ```
117
+ *
118
+ * **NOTE:** The file name must contain the `.pdf` extension.
119
+ * Otherwise your operating system or device may have trouble identifying the file type.
120
+ *
121
+ * @default 'document.pdf'
122
+ */
123
+ fileName?: string | (() => string);
124
+ /**
125
+ * A URL to the HTML to PDF converter.
126
+ *
127
+ * ```ts
128
+ * const exportPdfConfig = {
129
+ * converterUrl: 'https://myconverter.com/v1/'
130
+ * }
131
+ * ```
132
+ *
133
+ * **NOTE:** The plugin uses the default HTML to PDF converter delivered by CKEditor Cloud Services.
134
+ * You can provide a URL to an on-premises converter instead.
135
+ *
136
+ * @default 'https://pdf-converter.cke-cs.com/v1/convert'
137
+ */
138
+ converterUrl?: string;
139
+ /**
140
+ * The HTML to PDF converter options.
141
+ *
142
+ * **NOTE:** Configuring the plugin is not mandatory but it is highly recommended,
143
+ * especially if you want to get the most accurate results when generating the PDF file.
144
+ * To learn more, please check the [HTML to PDF converter configuration](https://pdf-converter.cke-cs.com/docs).
145
+ *
146
+ * ```ts
147
+ * const exportPdfConfig = {
148
+ * converterOptions: {
149
+ * ...
150
+ * }
151
+ * }
152
+ * ```
153
+ *
154
+ * @default `{
155
+ * format: 'A4',
156
+ * margin_top: '0',
157
+ * margin_bottom: '0',
158
+ * margin_right: '0',
159
+ * margin_left: '0',
160
+ * page_orientation: 'portrait',
161
+ * header_html: undefined,
162
+ * footer_html: undefined,
163
+ * header_and_footer_css: undefined,
164
+ * wait_for_network: true,
165
+ * wait_time: 0
166
+ * }`
167
+ */
168
+ converterOptions?: ExportPdfConverterOptions;
169
+ /**
170
+ * A function to gather the HTML to be converted to PDF.
171
+ *
172
+ * **NOTE:** This option may be useful when the editor does not have `getData()` method,
173
+ * or if the HTML to be converted should be different than the edited one.
174
+ *
175
+ * ```ts
176
+ * const exportPdfConfig = {
177
+ * dataCallback: ( editor: Editor ) => {
178
+ * return `
179
+ * <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
180
+ * <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
181
+ * `;
182
+ * }
183
+ * }
184
+ * ```
185
+ *
186
+ * @default `( editor: Editor ) => editor.getData()`
187
+ */
188
+ dataCallback?: (editor: Editor) => string;
189
+ /**
190
+ * A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
191
+ * the export to PDF feature.
192
+ *
193
+ * **Note:** The token can be disabled with the `false` value provided.
194
+ *
195
+ * See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
196
+ */
197
+ tokenUrl?: TokenUrl | false;
198
+ /**
199
+ * The authentication token.
200
+ *
201
+ * See: {@link module:cloud-services/cloudservices~CloudServices#token}
202
+ */
203
+ token?: InitializedToken;
204
+ /**
205
+ * The application unique identifier.
206
+ */
207
+ appID?: string;
208
+ }
209
+ export type ExportPdfConverterOptions = {
210
+ format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
211
+ margin_top?: string;
212
+ margin_bottom?: string;
213
+ margin_right?: string;
214
+ margin_left?: string;
215
+ header_html?: string;
216
+ footer_html?: string;
217
+ header_and_footer_css?: string;
218
+ page_orientation?: 'portrait' | 'landscape';
219
+ wait_for_network?: boolean;
220
+ wait_time?: number;
221
+ };
package/src/exportpdf.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x47f237}from'ckeditor5/src/core';import{ButtonView as _0x3412c5,View as _0x3890a6,Notification as _0x211304}from'ckeditor5/src/ui';import _0x495741 from'./exportpdfcommand';import _0x56effa from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x47f237{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x211304];}['init'](){const _0x31470d=this['editor'],t=_0x31470d['t'],_0x52018b=_0x31470d['config']['get']('exportPdf')||{};_0x31470d['commands']['add']('exportPdf',new _0x495741(_0x31470d)),_0x31470d['ui']['componentFactory']['add']('exportPdf',_0x15e2ba=>{const _0x1f7ee9=_0x31470d['commands']['get']('exportPdf'),_0x408ffa=new _0x3412c5(_0x15e2ba);_0x408ffa['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x56effa,'tooltip':!0x0}),_0x408ffa['bind']('isOn','isEnabled')['to'](_0x1f7ee9,'isBusy','isEnabled'),_0x408ffa['extendTemplate']({'attributes':{'class':[_0x408ffa['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x3fb91c=new _0x3890a6();return _0x3fb91c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x408ffa['children']['add'](_0x3fb91c),this['listenTo'](_0x408ffa,'execute',()=>{_0x31470d['execute']('exportPdf',_0x52018b),_0x31470d['editing']['view']['focus']();}),_0x408ffa;});const _0x530de6=_0x31470d['plugins']['get']('CloudServices');!0x1===_0x52018b['tokenUrl']?this['_token']=null:_0x52018b['tokenUrl']?_0x530de6['registerTokenUrl'](_0x52018b['tokenUrl'])['then'](_0x5ebf33=>{this['_token']=_0x5ebf33;}):this['_token']=_0x530de6['token'];}}
23
+ import{Plugin as _0x4eb8c3}from'ckeditor5/src/core.js';import{ButtonView as _0x5eec15,View as _0x494155,Notification as _0x4e9af2}from'ckeditor5/src/ui.js';import _0xd30a8d from'./exportpdfcommand.js';import _0x40b53a from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x4eb8c3{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x4e9af2];}['init'](){const _0x220753=this['editor'],t=_0x220753['t'],_0x3b6372=_0x220753['config']['get']('exportPdf')||{};_0x220753['commands']['add']('exportPdf',new _0xd30a8d(_0x220753)),_0x220753['ui']['componentFactory']['add']('exportPdf',_0x46ed84=>{const _0x41198e=_0x220753['commands']['get']('exportPdf'),_0x56cb78=new _0x5eec15(_0x46ed84);_0x56cb78['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x40b53a,'tooltip':!0x0}),_0x56cb78['bind']('isOn','isEnabled')['to'](_0x41198e,'isBusy','isEnabled'),_0x56cb78['extendTemplate']({'attributes':{'class':[_0x56cb78['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x349a2d=new _0x494155();return _0x349a2d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x56cb78['children']['add'](_0x349a2d),this['listenTo'](_0x56cb78,'execute',()=>{_0x220753['execute']('exportPdf',_0x3b6372),_0x220753['editing']['view']['focus']();}),_0x56cb78;});const _0x471821=_0x220753['plugins']['get']('CloudServices');!0x1===_0x3b6372['tokenUrl']?this['_token']=null:_0x3b6372['tokenUrl']?_0x471821['registerTokenUrl'](_0x3b6372['tokenUrl'])['then'](_0x148e05=>{this['_token']=_0x148e05;}):this['_token']=_0x471821['token'];}}
@@ -1,39 +1,39 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module export-pdf/exportpdfcommand
7
- * @publicApi
8
- */
9
- import { Command, type Editor } from 'ckeditor5/src/core';
10
- import { type ExportPdfConfig } from './exportpdf';
11
- /**
12
- * The export to PDF command.
13
- *
14
- * It takes the editor's HTML and CSS rules from the document and sends them to the HTML to PDF converter.
15
- * After processing, the converter will send back a PDF file for download.
16
- */
17
- export default class ExportPdfCommand extends Command {
18
- /**
19
- * A command state that indicates if the command is currently executing.
20
- *
21
- * @observable
22
- */
23
- isBusy: boolean;
24
- /**
25
- * @inheritDoc
26
- */
27
- constructor(editor: Editor);
28
- /**
29
- * @inheritDoc
30
- */
31
- refresh(): void;
32
- /**
33
- * Executes the command.
34
- *
35
- * @fires execute
36
- * @param options Options for the executed command.
37
- */
38
- execute(options?: ExportPdfConfig): Promise<void>;
39
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module export-pdf/exportpdfcommand
7
+ * @publicApi
8
+ */
9
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
10
+ import { type ExportPdfConfig } from './exportpdf.js';
11
+ /**
12
+ * The export to PDF command.
13
+ *
14
+ * It takes the editor's HTML and CSS rules from the document and sends them to the HTML to PDF converter.
15
+ * After processing, the converter will send back a PDF file for download.
16
+ */
17
+ export default class ExportPdfCommand extends Command {
18
+ /**
19
+ * A command state that indicates if the command is currently executing.
20
+ *
21
+ * @observable
22
+ */
23
+ isBusy: boolean;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ constructor(editor: Editor);
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ refresh(): void;
32
+ /**
33
+ * Executes the command.
34
+ *
35
+ * @fires execute
36
+ * @param options Options for the executed command.
37
+ */
38
+ execute(options?: ExportPdfConfig): Promise<void>;
39
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x2ea006}from'ckeditor5/src/core';import{getStyles as _0x50bdf2}from'./utils';export default class i extends _0x2ea006{constructor(_0xaa7436){super(_0xaa7436),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x3c42f6={}){const _0x19a1ef=this['editor'],t=_0x19a1ef['t'],_0x375f07=_0x3c42f6['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x3a801c=_0x3c42f6['dataCallback']||(_0x55dc06=>_0x55dc06['data']['get']()),_0x5a6fa2=_0x19a1ef['plugins']['get']('ExportPdf'),_0x4c5118=_0x3c42f6['token']||_0x5a6fa2['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x50bdf2(_0x3c42f6['stylesheets']||['EDITOR_STYLES'])['then'](async _0x378c7c=>{const _0x449b39={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x19a1ef['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+await _0x3a801c(_0x19a1ef)+'\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09</html>','css':_0x378c7c,'options':_0x3c42f6['converterOptions']},_0x25d788={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x4c5118?{'Authorization':_0x4c5118['value']}:null,'x-cs-app-id':_0x3c42f6['appID']||'cke5'},'body':JSON['stringify'](_0x449b39)};return window['fetch'](_0x375f07,_0x25d788)['then'](_0x42dd95=>{if(0xc8!==_0x42dd95['status'])throw _0x42dd95;return _0x42dd95['blob']();})['then'](_0x7b9682=>{const _0x23c663='function'==typeof _0x3c42f6['fileName']?_0x3c42f6['fileName']():_0x3c42f6['fileName'];this['_downloadFile'](_0x7b9682,_0x23c663||'document.pdf');});})['catch'](_0x3bce93=>{throw _0x19a1ef['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x3bce93;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x46efe2,_0x327d43){const _0x4c0e2b=document['createElement']('a');_0x4c0e2b['href']=window['URL']['createObjectURL'](_0x46efe2),_0x4c0e2b['download']=_0x327d43,_0x4c0e2b['click'](),_0x4c0e2b['remove']();}}
23
+ import{Command as _0x4ec365}from'ckeditor5/src/core.js';import{getStyles as _0x54262c}from'./utils.js';export default class i extends _0x4ec365{constructor(_0x5b540b){super(_0x5b540b),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x22404b={}){const _0x39e556=this['editor'],t=_0x39e556['t'],_0x2af302=_0x22404b['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x1061d1=_0x22404b['dataCallback']||(_0x2b11f8=>_0x2b11f8['data']['get']()),_0x517535=_0x39e556['plugins']['get']('ExportPdf'),_0xd630f8=_0x22404b['token']||_0x517535['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x54262c(_0x22404b['stylesheets']||['EDITOR_STYLES'])['then'](async _0x34c1e0=>{const _0x1db411={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<title>CKEditor\x205\x20PDF\x20document</title>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x39e556['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+await _0x1061d1(_0x39e556)+'\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09</body>\x0a\x09\x09\x09\x09\x09</html>','css':_0x34c1e0,'options':_0x22404b['converterOptions']},_0x5ab59d={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0xd630f8?{'Authorization':_0xd630f8['value']}:null,'x-cs-app-id':_0x22404b['appID']||'cke5'},'body':JSON['stringify'](_0x1db411)};return window['fetch'](_0x2af302,_0x5ab59d)['then'](_0x371c04=>{if(0xc8!==_0x371c04['status'])throw _0x371c04;return _0x371c04['blob']();})['then'](_0x2a0162=>{const _0x3e8277='function'==typeof _0x22404b['fileName']?_0x22404b['fileName']():_0x22404b['fileName'];this['_downloadFile'](_0x2a0162,_0x3e8277||'document.pdf');});})['catch'](_0x244832=>{throw _0x39e556['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x244832;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x52863f,_0x5ad66b){const _0x4fa522=document['createElement']('a');_0x4fa522['href']=window['URL']['createObjectURL'](_0x52863f),_0x4fa522['download']=_0x5ad66b,_0x4fa522['click'](),_0x4fa522['remove']();}}
package/src/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module export-pdf
7
- */
8
- export { default as ExportPdf, type ExportPdfConfig } from './exportpdf';
9
- export type { default as ExportPdfCommand } from './exportpdfcommand';
10
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module export-pdf
7
+ */
8
+ export { default as ExportPdf, type ExportPdfConfig } from './exportpdf.js';
9
+ export type { default as ExportPdfCommand } from './exportpdfcommand.js';
10
+ import './augmentation.js';
package/src/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export{default as ExportPdf}from'./exportpdf';import'./augmentation';
23
+ export{default as ExportPdf}from'./exportpdf.js';import'./augmentation.js';
package/src/utils.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * A helper function for getting concatenated CSS rules from external stylesheets and the editor.
7
- *
8
- * @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
9
- */
10
- export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * A helper function for getting concatenated CSS rules from external stylesheets and the editor.
7
+ *
8
+ * @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
9
+ */
10
+ export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2266=['.ck-content','hasAttribute','push','warn','indexOf','then','styleSheets',':root','from','trim','text','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.','cssText','length'];(function(_0x8e1084,_0x2266fd){const _0x3d6fe5=function(_0x1a0bf8){while(--_0x1a0bf8){_0x8e1084['push'](_0x8e1084['shift']());}};_0x3d6fe5(++_0x2266fd);}(_0x2266,0x89));const _0x3d6f=function(_0x8e1084,_0x2266fd){_0x8e1084=_0x8e1084-0x0;let _0x3d6fe5=_0x2266[_0x8e1084];return _0x3d6fe5;};export function getStyles(_0x21f552){if(!_0x21f552)return new Promise(_0xf50e9c=>_0xf50e9c(''));const _0x4020aa=[];for(const _0x41186b of _0x21f552)'EDITOR_STYLES'!==_0x41186b?_0x4020aa[_0x3d6f('0x5')](window['fetch'](_0x41186b)['then'](_0x12ec5b=>_0x12ec5b[_0x3d6f('0xd')]())):_0x4020aa[_0x3d6f('0x5')](u());return Promise['all'](_0x4020aa)[_0x3d6f('0x8')](_0x3e060f=>_0x3e060f['join']('\x20')[_0x3d6f('0xc')]());}function u(){const _0x1857b4=[],_0x2c954d=[];for(const _0x592aea of Array['from'](document[_0x3d6f('0x9')])){if(_0x592aea['ownerNode'][_0x3d6f('0x4')]('data-cke'))for(const _0x1d909c of Array[_0x3d6f('0xb')](_0x592aea['cssRules']))-0x1!==_0x1d909c['cssText']['indexOf'](_0x3d6f('0x3'))?_0x1857b4[_0x3d6f('0x5')](_0x1d909c[_0x3d6f('0x1')]):-0x1!==_0x1d909c[_0x3d6f('0x1')][_0x3d6f('0x7')](_0x3d6f('0xa'))&&_0x2c954d[_0x3d6f('0x5')](_0x1d909c[_0x3d6f('0x1')]);}return _0x1857b4[_0x3d6f('0x2')]||console[_0x3d6f('0x6')](_0x3d6f('0x0')),[..._0x2c954d,..._0x1857b4]['join']('\x20')[_0x3d6f('0xc')]();}
23
+ const _0x2665=['data-cke','from','push','then','text','.ck-content','cssText','indexOf','join','all','ownerNode','hasAttribute','styleSheets','trim','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.',':root','fetch','cssRules'];(function(_0x3a1223,_0x266584){const _0x5578a0=function(_0x22c126){while(--_0x22c126){_0x3a1223['push'](_0x3a1223['shift']());}};_0x5578a0(++_0x266584);}(_0x2665,0x73));const _0x5578=function(_0x3a1223,_0x266584){_0x3a1223=_0x3a1223-0x0;let _0x5578a0=_0x2665[_0x3a1223];return _0x5578a0;};export function getStyles(_0x55c7cd){if(!_0x55c7cd)return new Promise(_0x388e62=>_0x388e62(''));const _0x5c9339=[];for(const _0x19f70b of _0x55c7cd)'EDITOR_STYLES'!==_0x19f70b?_0x5c9339[_0x5578('0xd')](window[_0x5578('0x9')](_0x19f70b)[_0x5578('0xe')](_0x40eb31=>_0x40eb31[_0x5578('0xf')]())):_0x5c9339[_0x5578('0xd')](u());return Promise[_0x5578('0x2')](_0x5c9339)[_0x5578('0xe')](_0x3e1825=>_0x3e1825[_0x5578('0x1')]('\x20')[_0x5578('0x6')]());}function u(){const _0x11989d=[],_0x41eb94=[];for(const _0x3e1e52 of Array[_0x5578('0xc')](document[_0x5578('0x5')])){if(_0x3e1e52[_0x5578('0x3')][_0x5578('0x4')](_0x5578('0xb')))for(const _0x28e298 of Array[_0x5578('0xc')](_0x3e1e52[_0x5578('0xa')]))-0x1!==_0x28e298[_0x5578('0x11')][_0x5578('0x0')](_0x5578('0x10'))?_0x11989d['push'](_0x28e298[_0x5578('0x11')]):-0x1!==_0x28e298[_0x5578('0x11')][_0x5578('0x0')](_0x5578('0x8'))&&_0x41eb94['push'](_0x28e298[_0x5578('0x11')]);}return _0x11989d['length']||console['warn'](_0x5578('0x7')),[..._0x41eb94,..._0x11989d][_0x5578('0x1')]('\x20')['trim']();}
@@ -1 +0,0 @@
1
- {"version":3,"file":"export-pdf.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAE4C;AACsB;;AAEhB;;AAEO;;AAEzB;;AAEhC;AACA;AACA;AACA;AACA;AACA,uCAAuC,0CAA0C;AACjF;AACA;AACA;AACe,wBAAwB,sDAAM;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B,0DAAY;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC,yDAAgB;;AAExD;AACA;AACA,oBAAoB,wDAAU;;AAE9B;AACA;AACA,UAAU,kEAAa;AACvB;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,uBAAuB,kDAAI;;AAE3B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA,cAAc,mCAAmC;;AAEjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kDAAkD;AACnE;AACA,YAAY,6CAA6C;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,QAAQ,sEAAsE;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,mHAAmH;AACxH;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,oEAAoE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gBAAgB;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mBAAmB,qBAAqB,GAAG;AACxE,2BAA2B,mBAAmB,sBAAsB,GAAG;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB,WAAW,kCAAkC;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY,uBAAuB;AACnC;;;;;;;;;;;;;;;;;;AC/RA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAE6C;;AAET;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,+BAA+B,uDAAO;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS,iDAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,wCAAwC;AAC/E,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;AC1IA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,kBAAkB;AACxB;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC/DA;AACkI;AAC7B;AACrG,8BAA8B,mFAA2B,CAAC,wGAAqC;AAC/F;AACA,gDAAgD,+BAA+B,6BAA6B,kBAAkB,oCAAoC,aAAa,0BAA0B,QAAQ,OAAO,QAAQ,cAAc,kBAAkB,sCAAsC,iCAAiC,2BAA2B,UAAU,2FAA2F,kBAAkB,qCAAqC,sCAAsC,iEAAiE,cAAc,sCAAsC,iDAAiD,kBAAkB,kBAAkB,GAAG,yBAAyB,OAAO,0oBAA0oB,oCAAoC,GAAG,kCAAkC,uBAAuB,GAAG,yCAAyC,kBAAkB,GAAG,+BAA+B,uBAAuB,aAAa,YAAY,aAAa,mBAAmB,0CAA0C,2CAA2C,uBAAuB,2CAA2C,kCAAkC,gCAAgC,eAAe,GAAG,sEAAsE,mBAAmB,uBAAuB,0CAA0C,2CAA2C,2CAA2C,GAAG,sDAAsD,uBAAuB,GAAG,uBAAuB,QAAQ,oCAAoC,GAAG,qBAAqB;AACpzE;AACA,iEAAe,uBAAuB,EAAC;;;;;;;;;;;;ACP1B;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;;AAEA;AACA,KAAK;AACL,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,qBAAqB;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACjEa;;AAEb,kCAAkC;;AAElC,8BAA8B;;AAE9B,kDAAkD,gBAAgB,gEAAgE,wDAAwD,6DAA6D,sDAAsD;;AAE7S,uCAAuC,uDAAuD,uCAAuC,SAAS,OAAO,oBAAoB;;AAEzK,yCAAyC,8FAA8F,wBAAwB,eAAe,eAAe,gBAAgB,YAAY,MAAM,wBAAwB,+BAA+B,aAAa,qBAAqB,uCAAuC,cAAc,WAAW,YAAY,UAAU,MAAM,mDAAmD,UAAU,sBAAsB;;AAEve,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,uDAAuD,cAAc;AACrE;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;;;;;;;;;;;;;;ACnCA,iEAAe,mvBAAmvB;;;;;;;;;;;;;;;;;;ACA7pB;AACrG,YAA0L;;AAE1L,eAAe,+CAA+C;;AAE9D;AACA;;AAEA,aAAa,0GAAG,CAAC,0JAAO;;;;AAIxB,iEAAe,iKAAc,MAAM;;;;;;;;;;;ACZtB;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;;AAEA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,KAAwC,GAAG,sBAAiB,GAAG,CAAI;;AAEnF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,qEAAqE,qBAAqB,cAAc;;AAExG;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA,yDAAyD;AACzD,IAAI;;AAEJ;;;AAGA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;;AAEA,qBAAqB,6BAA6B;AAClD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;AC5QA;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEmD","sources":["webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/src/exportpdf.js","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/src/exportpdfcommand.js","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/src/utils.js","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/theme/exportpdf.css","webpack://CKEditor5.exportPdf/../../node_modules/css-loader/dist/runtime/api.js","webpack://CKEditor5.exportPdf/../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/theme/icons/exportpdf.svg","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/theme/exportpdf.css?7632","webpack://CKEditor5.exportPdf/../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://CKEditor5.exportPdf/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.exportPdf/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.exportPdf/external var \"CKEditor5.dll\"","webpack://CKEditor5.exportPdf/webpack/bootstrap","webpack://CKEditor5.exportPdf/webpack/runtime/compat get default export","webpack://CKEditor5.exportPdf/webpack/runtime/define property getters","webpack://CKEditor5.exportPdf/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.exportPdf/webpack/runtime/make namespace object","webpack://CKEditor5.exportPdf/./packages/ckeditor5-export-pdf/src/index.js"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2022, 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 export-pdf/exportpdf\n * @publicApi\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, View, Notification } from 'ckeditor5/src/ui';\n\nimport ExportPdfCommand from './exportpdfcommand';\n\nimport exportPdfIcon from '../theme/icons/exportpdf.svg';\n\nimport '../theme/exportpdf.css';\n\n/**\n * The export to PDF feature.\n *\n * It allows you to generate a PDF file directly from the editor content.\n *\n * For a detailed overview, check the {@glink features/export-pdf export to PDF} feature documentation.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ExportPdf extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'ExportPdf';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ 'CloudServices', Notification ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\t\tconst config = editor.config.get( 'exportPdf' ) || {};\n\n\t\teditor.commands.add( 'exportPdf', new ExportPdfCommand( editor ) );\n\n\t\teditor.ui.componentFactory.add( 'exportPdf', locale => {\n\t\t\tconst command = editor.commands.get( 'exportPdf' );\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: t( 'Export to PDF' ),\n\t\t\t\ticon: exportPdfIcon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tview.bind( 'isOn', 'isEnabled' ).to( command, 'isBusy', 'isEnabled' );\n\n\t\t\tview.extendTemplate( {\n\t\t\t\tattributes: {\n\t\t\t\t\tclass: [\n\t\t\t\t\t\tview.bindTemplate.if( 'isOn', 'ck-exportpdf_status-pending' )\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tconst spinner = new View();\n\n\t\t\tspinner.setTemplate( {\n\t\t\t\ttag: 'span',\n\t\t\t\tattributes: {\n\t\t\t\t\tclass: [ 'ck', 'ck-exportpdf__spinner-container' ]\n\t\t\t\t},\n\t\t\t\tchildren: [ {\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tclass: [ 'ck', 'ck-exportpdf__spinner' ]\n\t\t\t\t\t}\n\t\t\t\t} ]\n\t\t\t} );\n\n\t\t\tview.children.add( spinner );\n\n\t\t\tthis.listenTo( view, 'execute', () => {\n\t\t\t\teditor.execute( 'exportPdf', config );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\n\t\t// Set up the Cloud Services token.\n\t\tconst cloudServices = editor.plugins.get( 'CloudServices' );\n\n\t\t// The authentication token provider.\n\t\t//\n\t\t// @protected\n\t\t// @member {module:cloud-services/token~Token} #_token\n\n\t\t// If the token is strictly disabled - don't use any.\n\t\tif ( config.tokenUrl === false ) {\n\t\t\tthis._token = null;\n\t\t}\n\n\t\t// Initialize a custom token provider.\n\t\telse if ( config.tokenUrl ) {\n\t\t\treturn cloudServices.registerTokenUrl( config.tokenUrl ).then( token => {\n\t\t\t\tthis._token = token;\n\t\t\t} );\n\t\t}\n\n\t\t// Or fall back to the default Cloud Services token provider.\n\t\telse {\n\t\t\tthis._token = cloudServices.token;\n\t\t}\n\t}\n}\n\n/**\n * The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.\n *\n * Read more in {@link module:export-pdf/exportpdf~ExportPdfConfig}.\n *\n * @member {module:export-pdf/exportpdf~ExportPdfConfig} module:core/editor/editorconfig~EditorConfig#exportPdf\n */\n\n/**\n * The configuration of the export to PDF feature. It is used by the PDF export features from the `@ckeditor/ckeditor5-export-pdf` package.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\texportPdf: ... // Export to PDF feature options.\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n *\n * @interface ExportPdfConfig\n */\n\n/**\n * Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).\n *\n *\tconst exportPdfConfig = {\n *\t\tstylesheets: [ './path/to/custom-style.css' ]\n *\t}\n *\n * **NOTE:** If `stylesheets` are not provided, the plugin will sent only\n * {@glink builds/guides/integration/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.\n *\n * **Default editor's content styles**:\n * {@glink builds/guides/integration/content-styles#the-full-list-of-content-styles The default editor content styles}\n * \tare applied to the generated PDF thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.\n * If you don't want them to be applied, you have to omit the token:\n *\n *\tconst exportPdfConfig = {\n *\t\tstylesheets: [ './path/to/custom-editor-styles.css' ]\n *\t}\n *\n * **Web fonts:** If you want to {@glink features/export-pdf#providing-web-font-styles use web fonts} in your PDF document,\n * you should provide a path to the file containing the web font declaration before the `'EDITOR_STYLES'` token:\n *\n *\tconst exportPdfConfig = {\n *\t\tstylesheets: [\n *\t\t\t'./path/to/fonts.css',\n *\t\t\t'EDITOR_STYLES'\n *\t\t]\n *\t}\n *\n * **Web fonts and custom styling:** For more advanced styling, your configuration should look like this:\n *\n *\tconst exportPdfConfig = {\n *\t\tstylesheets: [\n *\t\t\t'./path/to/fonts.css',\n *\t\t\t'EDITOR_STYLES',\n *\t\t\t'./path/to/custom-styles.css'\n *\t\t]\n *\t}\n *\n * Defaults to `[ 'EDITOR_STYLES' ]`.\n *\n * @member {Array.<String>} module:export-pdf/exportpdf~ExportPdfConfig#stylesheets\n */\n\n/**\n * The name of the generated PDF file.\n *\n *\tconst exportPdfConfig = {\n *\t\tfileName: 'my-document.pdf'\n *\t}\n *\n * **NOTE:** The file name must contain the `.pdf` extension.\n * Otherwise your operating system or device may have trouble identifying the file type.\n *\n * Defaults to `document.pdf`.\n *\n * @member {String} module:export-pdf/exportpdf~ExportPdfConfig#fileName\n */\n\n/**\n * A URL to the HTML to PDF converter.\n *\n *\tconst exportPdfConfig = {\n *\t\tconverterUrl: 'https://myconverter.com/v1/'\n *\t}\n *\n * **NOTE:** The plugin uses the default HTML to PDF converter delivered by CKEditor Cloud Services.\n * You can provide a URL to an on-premises converter instead.\n *\n * Defaults to `https://pdf-converter.cke-cs.com/v1/convert`.\n *\n * @member {String} module:export-pdf/exportpdf~ExportPdfConfig#converterUrl\n */\n\n/**\n * The HTML to PDF converter options.\n *\n * **NOTE:** Configuring the plugin is not mandatory but it is highly recommended,\n * especially if you want to get the most accurate results when generating the PDF file.\n * To learn more, please check the [HTML to PDF converter configuration](https://pdf-converter.cke-cs.com/docs).\n *\n *\tconst exportPdfConfig = {\n *\t\tconverterOptions: {\n *\t\t\t...\n *\t\t}\n *\t}\n *\n * Defaults to:\n *\n * \t{\n *\t\tformat: 'A4',\n *\t\tmargin_top: '0',\n *\t\tmargin_bottom: '0',\n *\t\tmargin_right: '0',\n *\t\tmargin_left: '0',\n *\t\tpage_orientation: 'portrait',\n *\t\theader_html: undefined,\n *\t\tfooter_html: undefined,\n *\t\theader_and_footer_css: undefined,\n *\t\twait_for_network: true,\n *\t\twait_time: 0\n *\t}\n *\n * @member {Object} module:export-pdf/exportpdf~ExportPdfConfig#converterOptions\n *\n */\n\n/**\n * A function to gather the HTML to be converted to PDF.\n *\n * **NOTE:** This option may be useful when the editor does not have `getData()` method,\n * or if the HTML to be converted should be different than the edited one.\n *\n *\tconst exportPdfConfig = {\n *\t\tdataCallback: ( editor ) => {\n *\t\t\treturn `\n *\t\t\t\t<header id=\"header\">${ editor.data.get( { rootName: 'header' } ) }</header>\n *\t\t\t\t<div id=\"content\">${ editor.data.get( { rootName: 'content' } ) }</div>\n *\t\t\t`;\n *\t\t}\n *\t}\n *\n * Defaults to\n *\n * \t( editor ) => editor.getData()\n *\n * @member {Function} module:export-pdf/exportpdf~ExportPdfConfig#dataCallback\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n */\n\n/**\n * A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for the\n * export to PDF feature.\n *\n * **Note:** The token can be disabled with the `false` value provided.\n *\n * See: {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl}\n *\n * @member {String|Function|false} module:export-pdf/exportpdf~ExportPdfConfig#tokenUrl\n */\n","/**\n * @license Copyright (c) 2003-2022, 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 export-pdf/exportpdfcommand\n * @publicApi\n */\n\n/* globals document, window */\n\nimport { Command } from 'ckeditor5/src/core';\n\nimport { getStyles } from './utils';\n\nconst PRODUCTION_URL = 'https://pdf-converter.cke-cs.com/v1/convert/';\n\n/**\n * The export to PDF command.\n *\n * It takes the editor's HTML and CSS rules from the document and sends them to the HTML to PDF converter.\n * After processing, the converter will send back a PDF file for download.\n *\n * @extends module:core/command~Command\n */\nexport default class ExportPdfCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * A command state that indicates if the command is currently executing.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isBusy\n\t\t */\n\t\tthis.set( 'isBusy', false );\n\n\t\t// It does not affect data so should be enabled in read-only mode.\n\t\tthis.affectsData = false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tthis.isEnabled = !this.isBusy;\n\t\tthis.value = this.isBusy ? 'pending' : undefined;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\texecute( options = {} ) {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\t\tconst url = options.converterUrl || PRODUCTION_URL;\n\t\tconst dataCallback = options.dataCallback || ( editor => editor.getData() );\n\t\tconst plugin = editor.plugins.get( 'ExportPdf' );\n\t\tconst token = options.token || plugin._token;\n\n\t\tthis.isBusy = true;\n\t\tthis.refresh();\n\n\t\treturn getStyles( options.stylesheets || [ 'EDITOR_STYLES' ] )\n\t\t\t.then( css => {\n\t\t\t\tconst data = {\n\t\t\t\t\thtml: `<html>\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<meta charset=\"utf-8\">\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<div class=\"ck-content\" dir=\"${ editor.locale.contentLanguageDirection }\">\n\t\t\t\t\t\t\t\t${ dataCallback( editor ) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t</html>`,\n\t\t\t\t\tcss,\n\t\t\t\t\toptions: options.converterOptions\n\t\t\t\t};\n\t\t\t\tconst init = {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Accept': 'application/pdf',\n\t\t\t\t\t\t...( token ? { 'Authorization': token.value } : null ),\n\t\t\t\t\t\t// Max-length of the value is 20 characters.\n\t\t\t\t\t\t'x-cs-app-id': options.appID || 'cke5'\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify( data )\n\t\t\t\t};\n\n\t\t\t\treturn window.fetch( url, init )\n\t\t\t\t\t.then( response => {\n\t\t\t\t\t\tif ( response.status !== 200 ) {\n\t\t\t\t\t\t\tthrow response;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn response.blob();\n\t\t\t\t\t} )\n\t\t\t\t\t.then( blob => {\n\t\t\t\t\t\tthis._downloadFile( blob, options.fileName || 'document.pdf' );\n\t\t\t\t\t} );\n\t\t\t} )\n\t\t\t.catch( err => {\n\t\t\t\tconst notification = editor.plugins.get( 'Notification' );\n\n\t\t\t\tnotification.showWarning( t( 'An error occurred while generating the PDF.' ) );\n\n\t\t\t\tthrow err;\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\tthis.isBusy = false;\n\t\t\t\tthis.refresh();\n\t\t\t} );\n\t}\n\n\t/**\n\t * A helper to create a link for downloading the returned PDF file from the server.\n\t *\n\t * @private\n\t * @param {Blob} blob The data object of the returned file.\n\t * @param {String} fileName The file name of the returned PDF file.\n\t */\n\n\t/* istanbul ignore next */\n\t_downloadFile( blob, fileName ) {\n\t\tconst link = document.createElement( 'a' );\n\n\t\tlink.href = window.URL.createObjectURL( blob );\n\t\tlink.download = fileName;\n\t\tlink.click();\n\n\t\tlink.remove();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, 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/* globals document, window, console */\n\n// A helper function for getting concatenated CSS rules from external stylesheets and the editor.\n//\n// @param {Array.<String>} [stylesheets] An array of stylesheet paths delivered by the user through the plugin configuration.\n// @returns {Promise.<String>} A Promise that returns concatenated styles.\nexport function getStyles( stylesheets ) {\n\tif ( !stylesheets ) {\n\t\treturn new Promise( resolve => resolve( '' ) );\n\t}\n\n\tconst styles = [];\n\n\tfor ( const stylesheet of stylesheets ) {\n\t\tif ( stylesheet === 'EDITOR_STYLES' ) {\n\t\t\tstyles.push( getEditorStyles() );\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tstyles.push( window.fetch( stylesheet ).then( response => response.text() ) );\n\t}\n\n\treturn Promise.all( styles ).then( values => {\n\t\t// We want to trim the returned value in case of `[ \"\", \"\", \"\", ... ]`.\n\t\treturn values.join( ' ' ).trim();\n\t} );\n}\n\n// A helper function for getting the basic editor content styles for the `.ck-content` class\n// and all CSS variables defined in the document.\n//\n// @returns {String} The editor styles concatenated with CSS variables.\nfunction getEditorStyles() {\n\tconst editorStyles = [];\n\tconst editorCSSVariables = [];\n\n\tfor ( const styleSheet of document.styleSheets ) {\n\t\tif ( styleSheet.ownerNode.hasAttribute( 'data-cke' ) ) {\n\t\t\tfor ( const rule of styleSheet.cssRules ) {\n\t\t\t\tif ( rule.cssText.indexOf( '.ck-content' ) !== -1 ) {\n\t\t\t\t\teditorStyles.push( rule.cssText );\n\t\t\t\t} else if ( rule.cssText.indexOf( ':root' ) !== -1 ) {\n\t\t\t\t\teditorCSSVariables.push( rule.cssText );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( !editorStyles.length ) {\n\t\tconsole.warn(\n\t\t\t'The editor stylesheet could not be found in the document. ' +\n\t\t\t'Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.'\n\t\t);\n\t}\n\n\t// We want to trim the returned value in case of `[ \"\", \"\", ... ]`.\n\treturn [ ...editorCSSVariables, ...editorStyles ].join( ' ' ).trim();\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-toolbar-spinner-size:18px}.ck-exportpdf_status-pending{position:relative}.ck.ck-exportpdf__spinner-container{display:none}.ck.ck-exportpdf__spinner{top:50%;left:0;right:0;margin:0 auto;border-radius:50%;border:2px solid var(--ck-color-text);border-top:2px solid transparent;transform:translateY(-50%);z-index:1}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container,.ck.ck-exportpdf__spinner{position:absolute;width:var(--ck-toolbar-spinner-size);height:var(--ck-toolbar-spinner-size)}.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container{display:block;animation:rotate 1.5s linear infinite}.ck-exportpdf_status-pending .ck.ck-button__icon{color:transparent}@keyframes rotate{to{transform:rotate(1turn)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./packages/ckeditor5-export-pdf/theme/exportpdf.css\"],\"names\":[],\"mappings\":\"AASA,MACC,8BACD,CAEA,6BACC,iBACD,CAEA,oCACC,YACD,CAEA,0BAEC,OAAQ,CACR,MAAO,CACP,OAAQ,CACR,aAAc,CAGd,iBAAkB,CAElB,qCAA6B,CAA7B,gCAA6B,CAC7B,0BAA2B,CAC3B,SACD,CAEA,2FAdC,iBAAkB,CAKlB,oCAAqC,CACrC,qCAcD,CANA,iEACC,aAAc,CAId,qCACD,CAEA,iDACC,iBACD,CAEA,kBACC,GACC,uBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2022, 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/* TODO\\n\\tExtract theme-lark styles before public release.\\n*/\\n\\n:root {\\n\\t--ck-toolbar-spinner-size: 18px;\\n}\\n\\n.ck-exportpdf_status-pending {\\n\\tposition: relative;\\n}\\n\\n.ck.ck-exportpdf__spinner-container {\\n\\tdisplay: none;\\n}\\n\\n.ck.ck-exportpdf__spinner {\\n\\tposition: absolute;\\n\\ttop: 50%;\\n\\tleft: 0;\\n\\tright: 0;\\n\\tmargin: 0 auto;\\n\\twidth: var(--ck-toolbar-spinner-size);\\n\\theight: var(--ck-toolbar-spinner-size);\\n\\tborder-radius: 50%;\\n\\tborder: 2px solid var(--ck-color-text);\\n\\tborder-top-color: transparent;\\n\\ttransform: translateY(-50%);\\n\\tz-index: 1;\\n}\\n\\n.ck-exportpdf_status-pending .ck.ck-exportpdf__spinner-container {\\n\\tdisplay: block;\\n\\tposition: absolute;\\n\\twidth: var(--ck-toolbar-spinner-size);\\n\\theight: var(--ck-toolbar-spinner-size);\\n\\tanimation: 1.5s infinite rotate linear;\\n}\\n\\n.ck-exportpdf_status-pending .ck.ck-button__icon {\\n\\tcolor: transparent;\\n}\\n\\n@keyframes rotate {\\n\\tto {\\n\\t\\ttransform: rotate(360deg)\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M14 0l5 4.5V20H3v-3h1.5v1.5h13v-12h-5v-5h-8v5H3V0h11zm3.3 5L14 2v3h3.3z\\\"/><path d=\\\"M2.63 14.24V12.3h.88c.66 0 1.14-.15 1.46-.45.32-.3.48-.71.48-1.24 0-.52-.15-.91-.44-1.2C4.7 9.15 4.28 9 3.69 9H1v5.24h1.63zm.4-3h-.4v-1.17h.46c.3 0 .5.05.62.17.1.11.16.25.16.42 0 .16-.06.3-.19.41-.13.11-.34.16-.66.16zm5.7 3c.28 0 .6-.05.96-.14.26-.07.5-.21.73-.42.22-.2.4-.47.53-.77.12-.31.19-.75.19-1.3 0-.37-.04-.7-.13-1.02a2.3 2.3 0 00-.42-.84c-.19-.24-.43-.43-.72-.56C9.57 9.06 9.2 9 8.72 9h-2.4v5.24h2.4zm-.4-1.19h-.4v-2.86h.4c.43 0 .73.1.91.3.18.2.27.59.27 1.14 0 .42-.04.73-.12.91a.76.76 0 01-.34.4c-.14.07-.38.11-.72.11zm5.3 1.2V12.1h2.02v-1.06h-2.03v-.91H16V9h-4v5.24h1.62z\\\"/></svg>\\n\";","import api from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../node_modules/css-loader/dist/cjs.js!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./exportpdf.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = CKEditor5.dll;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license Copyright (c) 2003-2022, 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 export-pdf\n */\n\nexport { default as ExportPdf } from './exportpdf';\n"],"names":[],"sourceRoot":""}