UNPKG

@ckeditor/ckeditor5-export-pdf

Version:

Export to PDF feature for CKEditor 5.

5 lines • 9.39 kB
!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}}const i=c;function c(t,e){const n=u();return(c=function(t,e){return n[t-=202]})(t,e)}!function(t){const e=c,n=t();for(;;)try{if(268357===parseInt(e(225))/1*(parseInt(e(212))/2)+-parseInt(e(252))/3*(parseInt(e(273))/4)+parseInt(e(280))/5*(parseInt(e(222))/6)+-parseInt(e(243))/7*(parseInt(e(236))/8)+-parseInt(e(255))/9*(parseInt(e(260))/10)+parseInt(e(224))/11+parseInt(e(209))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(u);class a extends t.Command{constructor(t){const e=c;super(t),this[e(279)](e(216),!1),this[e(215)]=!1}[i(202)](){const t=i;this[t(249)]=!this[t(216)],this[t(206)]=this[t(216)]?t(281):void 0}[i(264)](t={}){const e=i,n=this[e(220)],r=t[e(278)]||e(251),c=t[e(227)]||(t=>t[e(204)][e(219)]()),a=n[e(238)][e(219)](e(230)),u=t[e(242)]||a[e(250)];return this[e(216)]=!0,this[e(202)](),(0,s.collectStylesheets)(t[e(218)]||[e(247)])[e(254)]((async s=>{const i=e;if(n.ui[i(211)][i(214)](o(n[i(205)],i(208))),n[i(238)][i(256)](i(267))){t[i(261)]||(t[i(261)]={});const e=n[i(238)][i(219)](i(269)),r=e[i(234)],{prefix:s,suffix:o}=n[i(284)][i(219)](i(259)),c=i(257),a={prefix:s,suffix:o,data:{}};if(i(288)===r)for(const t of e[i(282)]())i(253)===e[i(248)](t)?a[i(204)][t]=c:a[i(204)][t]=e[i(265)](e[i(210)](t)||t);else{const t=i(207)===r?e[i(244)]():e[i(272)](r,!0);for(const n of Object[i(266)](t)){const[t,r]=n;i(253)===e[i(248)](t)?a[i(204)][t]=null!==r?r:c:a[i(204)][t]=null!==r?r:e[i(210)](t)||t}}t[i(261)][i(276)]=a}const a={html:i(235)+n[i(205)][i(239)]+i(268)+await c(n)+i(231),css:s,options:t[i(261)]},p={method:i(237),headers:{"Content-Type":i(262),Accept:i(241),...u?{Authorization:u[i(206)]}:null,"x-cs-app-id":t[i(283)]||i(277)},body:JSON[i(232)](a)};return window[i(271)](r,p)[i(254)]((t=>{const e=i;if(200!==t[e(213)])throw t;return t[e(286)]()}))[i(254)]((e=>{const r=i;n.ui[r(211)][r(214)](o(n[r(205)],r(263)));const s=r(228)==typeof t[r(270)]?t[r(270)]():t[r(270)];this[r(203)](e,s||r(233))}))}))[e(285)]((t=>{const r=e,s=n[r(238)][r(219)](r(229));throw n.ui[r(211)][r(214)](o(n[r(205)],r(221)),{politeness:r(217)}),s[r(226)](o(n[r(205)],r(240))),t}))[e(287)]((()=>{const t=e;this[t(216)]=!1,this[t(202)]()}))}[i(203)](t,e){const n=i,r=document[n(246)]("a");r[n(245)]=window[n(223)][n(275)](t),r[n(258)]=e,r[n(274)](),r[n(289)]()}}function u(){const t=["\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>","stringify","document.pdf","previewMode",'<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="',"3064Hgcecj","POST","plugins","contentLanguageDirection","An error occurred while generating the PDF.","application/pdf","token","8456EeRJhH","getDefaultValues","href","createElement","EDITOR_STYLES","getMergeFieldType","isEnabled","_token","https://pdf-converter.cke-cs.com/v1/convert/","489249YQQhcU","image","then","36obkcSF","has","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","download","mergeFields","833880BkGFnN","converterOptions","application/json","PDF export successful","execute","wrapInAffixes","entries","MergeFields",'">\n\t\t\t\t\t\t\t\t',"MergeFieldsEditing","fileName","fetch","getDataSetValues","4BCbKnq","click","createObjectURL","merge_fields","cke5","converterUrl","set","5LricYh","pending","getMergeFieldsIds","appID","config","catch","blob","finally","$labels","remove","refresh","_downloadFile","data","locale","value","$defaultValues","PDF export started","5326896okIIhA","getLabel","ariaLiveAnnouncer","2nUjubT","status","announce","affectsData","isBusy","assertive","stylesheets","get","editor","PDF export failed","2299524xCgbIe","URL","3231349TZYBZj","106735nrsoEg","showWarning","dataCallback","function","Notification","ExportPdf"];return(u=function(){return t})()}var p=n(355);const d=f;function f(t,e){const n=l();return(f=function(t,e){return n[t-=373]})(t,e)}function l(){const t=["21273945hwehuh","iconView","13466990CJlySR","55yTYBKW","65288Yzzdjy","add","Exporting PDF document","isVisible","view","594642wDAbfJ","editor","isEnabled","componentFactory","editing","set","296sjvoaY","config","_createButton","Export to PDF","locale","isPremiumPlugin","get","isOfficialPlugin","label","focus","isOn","544454NffLVj","menuBar:exportPdf","execute","listenTo","46143bjiBpX","bind","pluginName","4SYXPDn","commands","ExportPdfUI","exportPdf","1832866EbHFaE","138bBwpLd","children","init","isBusy"];return(l=function(){return t})()}!function(t){const e=f,n=t();for(;;)try{if(913116===-parseInt(e(385))/1*(-parseInt(e(392))/2)+parseInt(e(397))/3*(-parseInt(e(405))/4)+parseInt(e(404))/5*(parseInt(e(410))/6)+parseInt(e(396))/7+parseInt(e(374))/8*(-parseInt(e(389))/9)+parseInt(e(403))/10+-parseInt(e(401))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(l);class h extends t.Plugin{static get[d(391)](){return d(394)}static get[d(381)](){return!0}static get[d(379)](){return!0}[d(399)](){const t=d,n=this[t(411)];n.ui[t(413)][t(406)](t(395),(()=>{const r=t,s=this[r(376)](e.ButtonView),o=n[r(393)][r(380)](r(395));return s[r(373)]({tooltip:!0}),s[r(390)](r(384)).to(o,r(400)),s})),n.ui[t(413)][t(406)](t(386),(()=>this[t(376)](e.MenuBarMenuListItemButtonView)))}[d(376)](t){const n=d,r=this[n(411)],s=r[n(375)][n(380)](n(395))||{},i=r[n(393)][n(380)](n(395)),c=new t(r[n(378)]),a=new e.SpinnerView;return c[n(398)][n(406)](a),a[n(390)](n(408)).to(i,n(400)),c[n(402)][n(390)](n(408)).to(i,n(400),(t=>!t)),c[n(373)]({icon:p.IconExportPdf}),c[n(390)](n(412)).to(i,n(412)),c[n(390)](n(382)).to(i,n(400),(t=>o(r[n(378)],n(t?407:377)))),this[n(388)](c,n(387),(()=>{const t=n;r[t(387)](t(395),s),r[t(414)][t(409)][t(383)]()})),c}}function g(t,e){const n=x();return(g=function(t,e){return n[t-=333]})(t,e)}const I=g;function x(){const t=["tokenUrl","requires","1273530DnNbNh","10115lBVvTA","init","244124neomvv","get","269760abmWRF","commands","token","registerTokenUrl","207108bsYWFd","691629bqJATf","ExportPdf","then","isPremiumPlugin","isOfficialPlugin","config","954cLDBPl","editor","exportPdf","1268192uNraSV","1CKuIMf","add","plugins","_token","9lqkzEd","pluginName","CloudServices"];return(x=function(){return t})()}!function(t){const e=g,n=t();for(;;)try{if(158088===-parseInt(e(351))/1*(parseInt(e(334))/2)+parseInt(e(341))/3+parseInt(e(340))/4+parseInt(e(336))/5+-parseInt(e(347))/6*(-parseInt(e(361))/7)+-parseInt(e(350))/8+parseInt(e(355))/9*(-parseInt(e(360))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(x);class P extends t.Plugin{[I(354)];static get[I(356)](){return I(342)}static get[I(345)](){return!0}static get[I(344)](){return!0}static get[I(359)](){return[I(357),e.Notification,h]}[I(333)](){const t=I,e=this[t(348)],n=e[t(346)][t(335)](t(349))||{};e[t(337)][t(352)](t(349),new a(e));const r=e[t(353)][t(335)](t(357));!1===n[t(358)]?this[t(354)]=null:n[t(358)]?r[t(339)](n[t(358)])[t(343)]((e=>{this[t(354)]=e})):this[t(354)]=r[t(338)]}}function A(t,e){var n=D();return(A=function(t,e){return n[t-=473]})(t,e)}function D(){var t=["263087KCxUhG","1315880piGHji","111zDgneW","7423843OEuSHy","24IpmvWr","10257474oKpqoB","38364DZUAnd","4481469KIZNaa","4585520vDBpQh"];return(D=function(){return t})()}!function(t){for(var e=A,n=t();;)try{if(925361===parseInt(e(481))/1+parseInt(e(473))/2+-parseInt(e(474))/3*(parseInt(e(478))/4)+-parseInt(e(480))/5+parseInt(e(477))/6+parseInt(e(475))/7+-parseInt(e(476))/8*(parseInt(e(479))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(D)})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();