UNPKG

@ckeditor/ckeditor5-export-word

Version:

Export to Word feature for CKEditor 5.

5 lines • 12.5 kB
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"An error occurred while generating the Word file.":"An error occurred while generating the Word file.","Export to Word":"Export to Word","Exporting Word document":"Exporting Word document","Word document export failed":"Word document export failed","Word document export started":"Word document export started","Word document export successful":"Word document 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 o=e[r];if(void 0!==o)return o.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.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,{ExportWord:()=>E,ExportWordCommand:()=>h});var t=n(782),e=n(311),o=n(584);function s(t,e={}){const n=i,r=t[n(473)][n(475)](n(512)),o=t[n(473)][n(475)](n(463)),s=t[n(473)][n(475)](n(506)),c=e;if(r&&o){const e=function(t){const e=i,n={};if(!t[e(465)])return n;for(const r of t)r[e(501)][e(513)](t=>{const o=e;void 0===n[r.id]&&(n[r.id]=[]),n[r.id][o(510)]({author:t[o(489)][o(462)],content:t[o(500)],created:t[o(499)],is_resolved:r[o(488)]})});return n}(t[n(473)][n(467)](n(463))[n(464)]({skipNotAttached:!0,skipEmpty:!0}));Object[n(469)](e)[n(465)]&&(c[n(501)]=e)}if(r&&s){const e=t[n(473)][n(467)](n(506)),r=t[n(473)][n(467)](n(512)),o=function(t,e){const n=i,r={};if(!t[n(465)]||!e[n(465)])return r;for(const{id:o,createdAt:s,authorId:i,attributes:c}of t){const t=c&&c[n(493)],a=t?t[n(497)]:e[n(467)](i)[n(462)];r[o]={author:a,created:s}}return r}(e[n(466)]({toJSON:!0}),r[n(509)]);Object[n(469)](o)[n(465)]&&(c[n(471)]=o)}return(c[n(471)]||c[n(501)])&&(c[n(470)]=(new(Intl[n(502)]))[n(476)]()[n(468)]),c}function i(t,e){const n=a();return(i=function(t,e){return n[t-=457]})(t,e)}function c(t,e={}){const n=i,r=t[n(473)][n(475)](n(512)),o=t[n(473)][n(475)](n(463)),s=t[n(473)][n(475)](n(506)),c=t[n(473)][n(475)](n(459)),a=t[n(460)][n(479)],u=e,d={};if(u[n(514)]=u[n(514)]||{},u[n(514)][n(505)]=u[n(514)][n(505)]||a,r&&o){const e=function(t){const e=i,n=[];if(!t[e(465)])return n;for(const r of t){const t=r[e(501)][e(513)](t=>({author:t[e(489)][e(462)],content:t[e(500)],created_at:t[e(499)]}));n[e(510)]({thread_id:r.id,is_resolved:r[e(488)],comments:t})}return n}(t[n(473)][n(467)](n(463))[n(464)]({skipNotAttached:!0,skipEmpty:!0}));e[n(465)]&&(d[n(487)]=e)}if(r&&s){const e=t[n(473)][n(467)](n(506)),r=t[n(473)][n(467)](n(512)),o=function(t,e){const n=i;return t[n(465)]&&e[n(465)]?t[n(513)](({id:t,createdAt:r,authorId:o,attributes:s})=>{const i=n,c=s&&s[i(493)];return{id:t,author:c?c[i(497)]:e[i(467)](o)[i(462)],created_at:r}}):[]}(e[n(466)]({toJSON:!0}),r[n(509)]);o[n(465)]&&(d[n(471)]=o)}if(c){const e=t[n(473)][n(467)](n(494)),r=e[n(457)],{prefix:o,suffix:s}=t[n(511)][n(467)](n(461));if(u[n(495)]={prefix:o,suffix:s},n(503)!==r){u[n(495)][n(498)]={};const t=n(491),o=n(481)===r?e[n(490)]():e[n(474)](r,!0);for(const r of Object[n(458)](o)){const[o,s]=r;n(504)===e[n(477)](o)?u[n(495)][n(498)][o]=null!==s?s:t:u[n(495)][n(498)][o]=null!==s?s:e[n(484)](o)||o}}}return(d[n(487)]||d[n(471)])&&(u[n(470)]=(new(Intl[n(502)]))[n(476)]()[n(468)],u[n(508)]=d),u}function a(){const t=["getLabel","1120430GJpaYA","2141139utScBO","comment_threads","isResolved","author","getDefaultValues","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","757425VXOYOd","@external","MergeFieldsEditing","merge_fields","72OhZlrI","authorName","data","createdAt","content","comments","DateTimeFormat","$labels","image","language","TrackChanges","7uTUELg","collaboration_features","users","push","config","Users","map","document","previewMode","entries","MergeFields","locale","mergeFields","name","CommentsRepository","getCommentThreads","length","getSuggestions","get","timeZone","keys","timezone","suggestions","679106qmSSjN","plugins","getDataSetValues","has","resolvedOptions","getMergeFieldType","5212016FHEVIG","contentLanguage","72185xNSvCP","$defaultValues","99dUJMEG","1200504wFAOqk"];return(a=function(){return t})()}function u(t,e){const n=t.t;switch(e){case"Export to Word":return n("Export to Word");case"An error occurred while generating the Word file.":return n("An error occurred while generating the Word file.");case"Word document export started":return n("Word document export started");case"Word document export failed":return n("Word document export failed");case"Word document export successful":return n("Word document export successful");case"Exporting Word document":return n("Exporting Word document");default:return e}}!function(t){const e=i,n=t();for(;;)try{if(504286===parseInt(e(492))/1+parseInt(e(472))/2+-parseInt(e(486))/3+-parseInt(e(496))/4*(parseInt(e(480))/5)+-parseInt(e(483))/6+parseInt(e(507))/7*(-parseInt(e(478))/8)+-parseInt(e(482))/9*(-parseInt(e(485))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(a);const d=p;function p(t,e){const n=f();return(p=function(t,e){return n[t-=287]})(t,e)}function f(){const t=["status","Word document export failed","stylesheets","version","pending","URL","12924bEMbAc","Word document export successful","application/json","execute","href","margin_top","value","showWarning","1830540heAavA","isBusy","</div>","then","document.docx","fetch","announce","orientation","application/docx","format","48wuwukx","553514pDtlUh","fileName","suggestions","ariaLiveAnnouncer","download","function","assertive","isEnabled","locale","ExportWord","dataCallback","plugins","config","remove","margin_left","476VjZWNm","125515yNifSo","createObjectURL","footer","margin_right","Notification","affectsData","options","finally","Word document export started","click","auto_pagination","https://docx-converter.cke-cs.com/v2/convert/html-docx","export-word-v1-api-is-deprecated","501452qbVCqJ","createElement","converterUrl","845628eSoNGE","252783eJAnmU","EDITOR_STYLES","catch","contentLanguageDirection","comments","_token","POST","_downloadFile","stringify",'<div class="ck-content" dir="',"https://docx-converter.cke-cs.com/v1/convert","get","margin_bottom","An error occurred while generating the Word file.","token","blob","refresh","data","header","editor","converterOptions","set"];return(f=function(){return t})()}!function(t){const e=p,n=t();for(;;)try{if(274896===parseInt(e(358))/1+parseInt(e(329))/2+parseInt(e(310))/3*(-parseInt(e(344))/4)+parseInt(e(345))/5+-parseInt(e(318))/6+parseInt(e(361))/7+-parseInt(e(328))/8*(-parseInt(e(362))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(f);const l=[d(325),d(315),d(348),d(294),d(343),d(327),d(300),d(347),d(366),d(331)];class h extends t.Command{constructor(t){const e=d;super(t),this[e(303)](e(319),!1),this[e(350)]=!1}[d(298)](){const t=d;this[t(336)]=!this[t(319)],this[t(316)]=this[t(319)]?t(308):void 0}[d(313)](t={}){const e=d,n=this[e(301)],r=t[e(307)]||2,i=1===r,a=t[e(360)]||e(i?292:356),p=t[e(302)]||{},f=n[e(340)][e(293)](e(338)),h=t[e(296)]||f[e(287)],g=!0===p[e(355)],m=t[e(339)]||(t=>t[e(299)][e(293)]({pagination:g}));return 2===r&&function(t){for(const e of l)if(void 0!==t[e])return!0;return!1}(p)&&(0,o.logWarning)(e(357)),this[e(319)]=!0,this[e(298)](),(0,o.collectStylesheets)(t[e(306)]||[e(363)])[e(321)](async r=>{const o=e;n.ui[o(332)][o(324)](u(n[o(337)],o(353)));const d=await m(n),f={html:o(291)+n[o(337)][o(365)]+'">'+d+o(320),css:r,[o(i?351:341)]:{...p,...i?s(n,p):c(n,p)}},l={method:o(288),headers:{"Content-Type":o(312),Accept:o(326),...h?{Authorization:h[o(316)]}:null},body:JSON[o(290)](f)};return window[o(323)](a,l)[o(321)](t=>{const e=o;if(200!==t[e(304)])throw t;return t[e(297)]()})[o(321)](e=>{const r=o;n.ui[r(332)][r(324)](u(n[r(337)],r(311)));const s=r(334)==typeof t[r(330)]?t[r(330)]():t[r(330)];this[r(289)](e,s||r(322))})})[e(364)](t=>{const r=e,o=n[r(340)][r(293)](r(349));throw n.ui[r(332)][r(324)](u(n[r(337)],r(305)),{politeness:r(335)}),o[r(317)](u(n[r(337)],r(295))),t})[e(352)](()=>{const t=e;this[t(319)]=!1,this[t(298)]()})}[d(289)](t,e){const n=d,r=document[n(359)]("a");r[n(314)]=window[n(309)][n(346)](t),r[n(333)]=e,r[n(354)](),r[n(342)]()}}var g=n(355);const m=x;function I(){const t=["editing","set","view","commands","7786458nOndrz","init","_createButton","focus","744357YzyYAy","config","execute","462114YDoulG","bind","6553765EGuCQQ","get","label","6ANyBGf","editor","pluginName","3962601kUXWnf","children","componentFactory","isOn","isVisible","Exporting Word document","isBusy","Export to Word","iconView","3456760QPsBwr","ExportWordUI","listenTo","isEnabled","exportWord","isOfficialPlugin","menuBar:exportWord","2938971nxPHkS","isPremiumPlugin","locale","add","4kSRtqD"];return(I=function(){return t})()}function x(t,e){const n=I();return(x=function(t,e){return n[t-=316]})(t,e)}!function(t){const e=x,n=t();for(;;)try{if(723300===-parseInt(e(324))/1+parseInt(e(329))/2*(parseInt(e(321))/3)+parseInt(e(352))/4*(parseInt(e(326))/5)+-parseInt(e(317))/6+parseInt(e(348))/7+-parseInt(e(341))/8+parseInt(e(332))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(I);class A extends t.Plugin{static get[m(331)](){return m(342)}static get[m(346)](){return!0}static get[m(349)](){return!0}[m(318)](){const t=m,n=this[t(330)];n.ui[t(334)][t(351)](t(345),()=>{const r=t,o=n[r(316)][r(327)](r(345)),s=this[r(319)](e.ButtonView);return s[r(354)]({tooltip:!0}),s[r(325)](r(335)).to(o,r(338)),s}),n.ui[t(334)][t(351)](t(347),()=>this[t(319)](e.MenuBarMenuListItemButtonView))}[m(319)](t){const n=m,r=this[n(330)],o=r[n(322)][n(327)](n(345))||{},s=r[n(316)][n(327)](n(345)),i=new t(r[n(350)]),c=new e.SpinnerView;return i[n(333)][n(351)](c),c[n(325)](n(336)).to(s,n(338)),i[n(340)][n(325)](n(336)).to(s,n(338),t=>!t),i[n(354)]({icon:g.IconExportWord}),i[n(325)](n(344)).to(s,n(344)),i[n(325)](n(328)).to(s,n(338),t=>u(r[n(350)],n(t?337:339))),this[n(343)](i,n(323),()=>{const t=n;r[t(323)](t(345),o),r[t(353)][t(355)][t(320)]()}),i}}const w=W;function W(t,e){const n=v();return(W=function(t,e){return n[t-=101]})(t,e)}function v(){const t=["1051062QhOWwl","1xDayOW","requires","editor","get","10718568KnSihw","tokenUrl","then","token","_token","15hpXOtl","plugins","exportWord","isOfficialPlugin","341996slICUp","config","pluginName","CloudServices","init","8017020eiUPdv","19133059pswAiD","commands","isPremiumPlugin","1128925DLLMFb","20raySSg","add","ExportWord","registerTokenUrl","6210QnoYat","2025oHfWJt"];return(v=function(){return t})()}!function(t){const e=W,n=t();for(;;)try{if(892201===parseInt(e(103))/1*(-parseInt(e(102))/2)+-parseInt(e(112))/3*(-parseInt(e(116))/4)+parseInt(e(101))/5*(-parseInt(e(130))/6)+parseInt(e(125))/7+-parseInt(e(107))/8+-parseInt(e(121))/9+parseInt(e(126))/10*(parseInt(e(122))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(v);class E extends t.Plugin{[w(111)];static get[w(118)](){return w(128)}static get[w(115)](){return!0}static get[w(124)](){return!0}static get[w(104)](){return[w(119),e.Notification,A]}[w(120)](){const t=w,e=this[t(105)],n=e[t(117)][t(106)](t(114))||{};e[t(123)][t(127)](t(114),new h(e));const r=e[t(113)][t(106)](t(119));!1===n[t(108)]?this[t(111)]=null:n[t(108)]?r[t(129)](n[t(108)])[t(109)](e=>{this[t(111)]=e}):this[t(111)]=r[t(110)]}}function b(){var t=["10jKCTcT","2558UGpgIk","1435316AUTUQN","37059BgvTJE","432467xBcDSd","6YKGCip","554665oFoLEz","32CRCrrs","181PvZaJg","4512101qKBecs","2499102qFpjVV"];return(b=function(){return t})()}function y(t,e){var n=b();return(y=function(t,e){return n[t-=378]})(t,e)}!function(t){for(var e=y,n=t();;)try{if(214835===parseInt(e(382))/1*(parseInt(e(386))/2)+parseInt(e(388))/3+-parseInt(e(387))/4+parseInt(e(380))/5*(-parseInt(e(379))/6)+-parseInt(e(378))/7*(parseInt(e(381))/8)+parseInt(e(384))/9+parseInt(e(385))/10*(parseInt(e(383))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(b)})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=r})();