@ckeditor/ckeditor5-export-pdf
Version:
Export to PDF feature for CKEditor 5.
5 lines • 9.49 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,ExportPdfCommand:()=>u});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=a();return(c=function(t,e){return n[t-=268]})(t,e)}function a(){const t=["PDF export failed","blob","ariaLiveAnnouncer","data","config","affectsData","1290pZSjEM","6353343zGXvBb","_token","download","2371808GXRron",'">\n\t\t\t\t\t\t\t\t',"PDF export started","getDataSetValues","dataCallback","34GtCBKQ","fileName","461180Gqagxk","document.pdf","entries","status","wrapInAffixes","get","image","announce","set","Notification","\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</html>","createObjectURL","application/pdf","click","An error occurred while generating the PDF.","POST","getLabel","href","MergeFields","showWarning","stylesheets","getDefaultValues","29077590VEUOTN","18051UbcnlZ","remove","4098423kcmGVb","$defaultValues","merge_fields","getMergeFieldsIds","getMergeFieldType","editor","converterUrl","contentLanguageDirection","value",'<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="',"https://pdf-converter.cke-cs.com/v1/convert/","URL","PDF export successful","isEnabled","application/json","converterOptions","ExportPdf","EDITOR_STYLES","_downloadFile","MergeFieldsEditing","then","isBusy","previewMode","appID","locale","mergeFields","has","cke5","execute","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","token","assertive","catch","pending","finally","function","plugins","1985HyIzoK","createElement","stringify","$labels","fetch","8FctAJy","refresh"];return(a=function(){return t})()}!function(t){const e=c,n=t();for(;;)try{if(374567===-parseInt(e(318))/1+-parseInt(e(316))/2*(parseInt(e(341))/3)+-parseInt(e(311))/4+parseInt(e(294))/5*(-parseInt(e(307))/6)+parseInt(e(343))/7*(-parseInt(e(299))/8)+-parseInt(e(308))/9+parseInt(e(340))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(a);class u extends t.Command{constructor(t){const e=c;super(t),this[e(326)](e(278),!1),this[e(306)]=!1}[i(300)](){const t=i;this[t(270)]=!this[t(278)],this[t(351)]=this[t(278)]?t(290):void 0}[i(285)](t={}){const e=i,n=this[e(348)],r=t[e(349)]||e(353),c=t[e(315)]||(t=>t[e(304)][e(323)]()),a=n[e(293)][e(323)](e(273)),u=t[e(287)]||a[e(309)];return this[e(278)]=!0,this[e(300)](),(0,s.collectStylesheets)(t[e(338)]||[e(274)])[e(277)](async s=>{const i=e;if(n.ui[i(303)][i(325)](o(n[i(281)],i(313))),n[i(293)][i(283)](i(336))){t[i(272)]||(t[i(272)]={});const e=n[i(293)][i(323)](i(276)),r=e[i(279)],{prefix:s,suffix:o}=n[i(305)][i(323)](i(282)),c=i(286),a={prefix:s,suffix:o,data:{}};if(i(297)===r)for(const t of e[i(346)]())i(324)===e[i(347)](t)?a[i(304)][t]=c:a[i(304)][t]=e[i(322)](e[i(334)](t)||t);else{const t=i(344)===r?e[i(339)]():e[i(314)](r,!0);for(const n of Object[i(320)](t)){const[t,r]=n;i(324)===e[i(347)](t)?a[i(304)][t]=null!==r?r:c:a[i(304)][t]=null!==r?r:e[i(334)](t)||t}}t[i(272)][i(345)]=a}const a={html:i(352)+n[i(281)][i(350)]+i(312)+await c(n)+i(328),css:s,options:t[i(272)]},p={method:i(333),headers:{"Content-Type":i(271),Accept:i(330),...u?{Authorization:u[i(351)]}:null,"x-cs-app-id":t[i(280)]||i(284)},body:JSON[i(296)](a)};return window[i(298)](r,p)[i(277)](t=>{const e=i;if(200!==t[e(321)])throw t;return t[e(302)]()})[i(277)](e=>{const r=i;n.ui[r(303)][r(325)](o(n[r(281)],r(269)));const s=r(292)==typeof t[r(317)]?t[r(317)]():t[r(317)];this[r(275)](e,s||r(319))})})[e(289)](t=>{const r=e,s=n[r(293)][r(323)](r(327));throw n.ui[r(303)][r(325)](o(n[r(281)],r(301)),{politeness:r(288)}),s[r(337)](o(n[r(281)],r(332))),t})[e(291)](()=>{const t=e;this[t(278)]=!1,this[t(300)]()})}[i(275)](t,e){const n=i,r=document[n(295)]("a");r[n(335)]=window[n(268)][n(329)](t),r[n(310)]=e,r[n(331)](),r[n(342)]()}}var p=n(355);function d(t,e){const n=h();return(d=function(t,e){return n[t-=330]})(t,e)}const f=d;!function(t){const e=d,n=t();for(;;)try{if(327062===parseInt(e(368))/1*(parseInt(e(350))/2)+-parseInt(e(364))/3*(-parseInt(e(341))/4)+parseInt(e(372))/5*(parseInt(e(371))/6)+parseInt(e(331))/7*(-parseInt(e(335))/8)+-parseInt(e(342))/9+-parseInt(e(366))/10*(-parseInt(e(354))/11)+parseInt(e(348))/12*(-parseInt(e(344))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(h);class l extends t.Plugin{static get[f(362)](){return f(369)}static get[f(355)](){return!0}static get[f(338)](){return!0}[f(353)](){const t=f,n=this[t(370)];n.ui[t(352)][t(367)](t(345),()=>{const r=t,s=this[r(339)](e.ButtonView),o=n[r(343)][r(330)](r(345));return s[r(360)]({tooltip:!0}),s[r(359)](r(351)).to(o,r(333)),s}),n.ui[t(352)][t(367)](t(340),()=>this[t(339)](e.MenuBarMenuListItemButtonView))}[f(339)](t){const n=f,r=this[n(370)],s=r[n(357)][n(330)](n(345))||{},i=r[n(343)][n(330)](n(345)),c=new t(r[n(337)]),a=new e.SpinnerView;return c[n(336)][n(367)](a),a[n(359)](n(365)).to(i,n(333)),c[n(349)][n(359)](n(365)).to(i,n(333),t=>!t),c[n(360)]({icon:p.IconExportPdf}),c[n(359)](n(356)).to(i,n(356)),c[n(359)](n(361)).to(i,n(333),t=>o(r[n(337)],n(t?334:332))),this[n(347)](c,n(358),()=>{const t=n;r[t(358)](t(345),s),r[t(373)][t(346)][t(363)]()}),c}}function h(){const t=["exportPdf","view","listenTo","36tafhOD","iconView","48aMcGoW","isOn","componentFactory","init","154sPcZjQ","isOfficialPlugin","isEnabled","config","execute","bind","set","label","pluginName","focus","3XdQrvo","isVisible","407830xJhDph","add","34brYaFc","ExportPdfUI","editor","521742EUJFRo","5WcjOtS","editing","get","8659ysmkfo","Export to PDF","isBusy","Exporting PDF document","488BzbHnl","children","locale","isPremiumPlugin","_createButton","menuBar:exportPdf","120264uwbNvY","279216QYEheg","commands","1106118LxGObC"];return(h=function(){return t})()}const g=x;function x(t,e){const n=I();return(x=function(t,e){return n[t-=385]})(t,e)}function I(){const t=["plugins","680JdaJLP","init","CloudServices","12RnxeNB","267174EcKiGm","12buAhVa","50jUpjhN","token","582710mYOFpN","get","72157eZbTKf","9541UmOluv","isPremiumPlugin","ExportPdf","editor","requires","2108960oavcEU","pluginName","then","registerTokenUrl","_token","isOfficialPlugin","119976yJdGXO","tokenUrl","exportPdf","add","12788754OLrNsK","commands","config"];return(I=function(){return t})()}!function(t){const e=x,n=t();for(;;)try{if(305800===-parseInt(e(403))/1+-parseInt(e(398))/2*(-parseInt(e(385))/3)+-parseInt(e(409))/4+-parseInt(e(401))/5*(parseInt(e(396))/6)+parseInt(e(404))/7*(-parseInt(e(393))/8)+parseInt(e(397))/9*(-parseInt(e(399))/10)+parseInt(e(389))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(I);class P extends t.Plugin{[g(413)];static get[g(410)](){return g(406)}static get[g(414)](){return!0}static get[g(405)](){return!0}static get[g(408)](){return[g(395),e.Notification,l]}[g(394)](){const t=g,e=this[t(407)],n=e[t(391)][t(402)](t(387))||{};e[t(390)][t(388)](t(387),new u(e));const r=e[t(392)][t(402)](t(395));!1===n[t(386)]?this[t(413)]=null:n[t(386)]?r[t(412)](n[t(386)])[t(411)](e=>{this[t(413)]=e}):this[t(413)]=r[t(400)]}}function m(t,e){var n=A();return(m=function(t,e){return n[t-=302]})(t,e)}function A(){var t=["400JJKqkD","1577544Atzfla","454492MUDGIW","140rKayYz","977834MCmReD","44898tSGgdt","3600RbxwJU","3251012ONKpzU","5526zLflMM","407265CdreEG","18XXjLvk"];return(A=function(){return t})()}!function(t){for(var e=m,n=t();;)try{if(836441===parseInt(e(312))/1+parseInt(e(307))/2+-parseInt(e(310))/3*(-parseInt(e(302))/4)+parseInt(e(309))/5+-parseInt(e(305))/6*(-parseInt(e(303))/7)+parseInt(e(306))/8*(parseInt(e(308))/9)+-parseInt(e(311))/10*(parseInt(e(304))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(A)})(),(window.CKEditor5=window.CKEditor5||{}).exportPdf=r})();