@ckeditor/ckeditor5-export-pdf
Version:
Export to PDF feature for CKEditor 5.
5 lines • 9.39 kB
JavaScript
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"An error occurred while generating the PDF.":"An error occurred while generating the PDF.","Export to PDF":"Export to PDF","Exporting PDF document":"Exporting PDF document","PDF export failed":"PDF export failed","PDF export started":"PDF export started","PDF export successful":"PDF export successful"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var t={237:t=>{"use strict";t.exports=CKEditor5.dll},311:(t,e,n)=>{t.exports=n(237)("./src/ui.js")},355:(t,e,n)=>{t.exports=n(237)("./src/icons.js")},584:(t,e,n)=>{t.exports=n(237)("./src/utils.js")},782:(t,e,n)=>{t.exports=n(237)("./src/core.js")}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}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})};var r={};(()=>{"use strict";n.r(r),n.d(r,{ExportPdf:()=>P});var t=n(782),e=n(311),s=n(584);function o(t,e){const n=t.t;switch(e){case"Export to PDF":return n("Export to PDF");case"An error occurred while generating the PDF.":return n("An error occurred while generating the PDF.");case"PDF export started":return n("PDF export started");case"PDF export failed":return n("PDF export failed");case"PDF export successful":return n("PDF export successful");case"Exporting PDF document":return n("Exporting PDF document");default:return e}}function i(t,e){const n=u();return(i=function(t,e){return n[t-=383]})(t,e)}const c=i;!function(t){const e=i,n=t();for(;;)try{if(711759===parseInt(e(440))/1*(parseInt(e(451))/2)+parseInt(e(384))/3*(parseInt(e(439))/4)+parseInt(e(422))/5+parseInt(e(453))/6+parseInt(e(450))/7+parseInt(e(426))/8*(parseInt(e(455))/9)+-parseInt(e(420))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(u);class a extends t.Command{constructor(t){const e=i;super(t),this[e(448)](e(391),!1),this[e(425)]=!1}[c(464)](){const t=c;this[t(383)]=!this[t(391)],this[t(415)]=this[t(391)]?t(465):void 0}[c(468)](t={}){const e=c,n=this[e(418)],r=t[e(411)]||e(404),i=t[e(394)]||(t=>t[e(388)][e(413)]()),a=n[e(433)][e(413)](e(421)),u=t[e(402)]||a[e(397)];return this[e(391)]=!0,this[e(464)](),(0,s.collectStylesheets)(t[e(441)]||[e(431)])[e(462)]((async s=>{const c=e;if(n.ui[c(417)][c(399)](o(n[c(398)],c(436))),n[c(433)][c(392)](c(461))){t[c(424)]||(t[c(424)]={});const e=n[c(433)][c(413)](c(428)),r=e[c(454)],{prefix:s,suffix:o}=n[c(393)][c(413)](c(385)),i=c(409),a={prefix:s,suffix:o,data:{}};if(c(445)===r)for(const t of e[c(456)]())c(463)===e[c(434)](t)?a[c(388)][t]=i:a[c(388)][t]=e[c(386)](e[c(449)](t)||t);else{const t=c(410)===r?e[c(452)]():e[c(443)](r,!0);for(const n of Object[c(466)](t)){const[t,r]=n;c(463)===e[c(434)](t)?a[c(388)][t]=null!==r?r:i:a[c(388)][t]=null!==r?r:e[c(449)](t)||t}}t[c(424)][c(403)]=a}const a={html:c(446)+n[c(398)][c(387)]+c(407)+await i(n)+c(430),css:s,options:t[c(424)]},p={method:c(419),headers:{"Content-Type":c(423),Accept:c(444),...u?{Authorization:u[c(415)]}:null,"x-cs-app-id":t[c(412)]||c(458)},body:JSON[c(405)](a)};return window[c(395)](r,p)[c(462)]((t=>{const e=c;if(200!==t[e(416)])throw t;return t[e(459)]()}))[c(462)]((e=>{const r=c;n.ui[r(417)][r(399)](o(n[r(398)],r(400)));const s=r(442)==typeof t[r(401)]?t[r(401)]():t[r(401)];this[r(414)](e,s||r(435))}))}))[e(390)]((t=>{const r=e,s=n[r(433)][r(413)](r(408));throw n.ui[r(417)][r(399)](o(n[r(398)],r(389)),{politeness:r(467)}),s[r(457)](o(n[r(398)],r(447))),t}))[e(396)]((()=>{const t=e;this[t(391)]=!1,this[t(464)]()}))}[c(414)](t,e){const n=c,r=document[n(460)]("a");r[n(432)]=window[n(437)][n(438)](t),r[n(427)]=e,r[n(429)](),r[n(406)]()}}function u(){const t=["status","ariaLiveAnnouncer","editor","POST","18654870SlssaD","ExportPdf","2021980JjbWjc","application/json","converterOptions","affectsData","16TYWMDW","download","MergeFieldsEditing","click","\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>","EDITOR_STYLES","href","plugins","getMergeFieldType","document.pdf","PDF export started","URL","createObjectURL","37864gOgQtW","383jWHEmV","stylesheets","function","getDataSetValues","application/pdf","$labels",'<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="',"An error occurred while generating the PDF.","set","getLabel","1330679pCwizZ","4862ycpsNu","getDefaultValues","93936YpFBGX","previewMode","1808109qwMSMy","getMergeFieldsIds","showWarning","cke5","blob","createElement","MergeFields","then","image","refresh","pending","entries","assertive","execute","isEnabled","201ecZuay","mergeFields","wrapInAffixes","contentLanguageDirection","data","PDF export failed","catch","isBusy","has","config","dataCallback","fetch","finally","_token","locale","announce","PDF export successful","fileName","token","merge_fields","https://pdf-converter.cke-cs.com/v1/convert/","stringify","remove",'">\n\t\t\t\t\t\t\t\t',"Notification","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","$defaultValues","converterUrl","appID","get","_downloadFile","value"];return(u=function(){return t})()}var p=n(355);const d=l;function l(t,e){const n=f();return(l=function(t,e){return n[t-=178]})(t,e)}function f(){const t=["ExportPdfUI","config","add","7312613qJHNxW","isOfficialPlugin","_createButton","isPremiumPlugin","10hKBaRC","children","editor","pluginName","view","isEnabled","50874daIAdT","execute","editing","1427525eeXGuX","componentFactory","set","Export to PDF","943524GtvlMG","24191bMvFSE","bind","isBusy","get","label","exportPdf","focus","init","isOn","9JnLYjO","iconView","34vNDUnb","locale","Exporting PDF document","217QSSRik","246726TDYqXL","3007304WLiEYV","listenTo","isVisible","menuBar:exportPdf","commands"];return(f=function(){return t})()}!function(t){const e=l,n=t();for(;;)try{if(218402===parseInt(e(207))/1*(-parseInt(e(218))/2)+parseInt(e(180))/3+parseInt(e(206))/4+parseInt(e(202))/5+-parseInt(e(199))/6*(parseInt(e(179))/7)+parseInt(e(181))/8*(-parseInt(e(216))/9)+-parseInt(e(193))/10*(-parseInt(e(189))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(f);class h extends t.Plugin{static get[d(196)](){return d(186)}static get[d(190)](){return!0}static get[d(192)](){return!0}[d(214)](){const t=d,n=this[t(195)];n.ui[t(203)][t(188)](t(212),(()=>{const r=t,s=this[r(191)](e.ButtonView),o=n[r(185)][r(210)](r(212));return s[r(204)]({tooltip:!0}),s[r(208)](r(215)).to(o,r(209)),s})),n.ui[t(203)][t(188)](t(184),(()=>this[t(191)](e.MenuBarMenuListItemButtonView)))}[d(191)](t){const n=d,r=this[n(195)],s=r[n(187)][n(210)](n(212))||{},i=r[n(185)][n(210)](n(212)),c=new t(r[n(219)]),a=new e.SpinnerView;return c[n(194)][n(188)](a),a[n(208)](n(183)).to(i,n(209)),c[n(217)][n(208)](n(183)).to(i,n(209),(t=>!t)),c[n(204)]({icon:p.IconExportPdf}),c[n(208)](n(198)).to(i,n(198)),c[n(208)](n(211)).to(i,n(209),(t=>o(r[n(219)],n(t?178:205)))),this[n(182)](c,n(200),(()=>{const t=n;r[t(200)](t(212),s),r[t(201)][t(197)][t(213)]()})),c}}const g=x;function I(){const t=["requires","1308432jriDYr","get","token","editor","pluginName","99638NAduqI","1302850ECYbVW","ExportPdf","commands","CloudServices","then","432768ZfUZFG","15vxPtnR","_token","config","isPremiumPlugin","add","init","102axdkYS","86863xTnZoi","tokenUrl","exportPdf","83188pGZoLt","registerTokenUrl","27IznVRK","plugins","1336240IFzzBb","isOfficialPlugin"];return(I=function(){return t})()}function x(t,e){const n=I();return(x=function(t,e){return n[t-=419]})(t,e)}!function(t){const e=x,n=t();for(;;)try{if(169107===parseInt(e(426))/1+parseInt(e(432))/2+parseInt(e(433))/3*(parseInt(e(443))/4)+-parseInt(e(447))/5+parseInt(e(439))/6*(-parseInt(e(440))/7)+-parseInt(e(421))/8+parseInt(e(445))/9*(parseInt(e(427))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(I);class P extends t.Plugin{[g(434)];static get[g(425)](){return g(428)}static get[g(419)](){return!0}static get[g(436)](){return!0}static get[g(420)](){return[g(430),e.Notification,h]}[g(438)](){const t=g,e=this[t(424)],n=e[t(435)][t(422)](t(442))||{};e[t(429)][t(437)](t(442),new a(e));const r=e[t(446)][t(422)](t(430));!1===n[t(441)]?this[t(434)]=null:n[t(441)]?r[t(444)](n[t(441)])[t(431)]((e=>{this[t(434)]=e})):this[t(434)]=r[t(423)]}}function D(t,e){var n=m();return(D=function(t,e){return n[t-=166]})(t,e)}function m(){var t=["11256pxXKqR","10IXnrum","1050396PBeKIB","1912284ICaLwJ","14500101YXRWSH","3384297SsQshs","321515iGJbGy","5IQzNxv","4BFkebl","281092QSGTBx","3136wRReVG"];return(m=function(){return t})()}!function(t){for(var e=D,n=t();;)try{if(358023===parseInt(e(173))/1*(parseInt(e(175))/2)+parseInt(e(168))/3+-parseInt(e(174))/4*(parseInt(e(172))/5)+-parseInt(e(169))/6+parseInt(e(166))/7*(parseInt(e(176))/8)+-parseInt(e(171))/9*(-parseInt(e(167))/10)+-parseInt(e(170))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(m)})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();