@ckeditor/ckeditor5-export-word
Version:
Export to Word feature for CKEditor 5.
5 lines • 12.8 kB
JavaScript
!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:()=>b});var t=n(782),e=n(311),o=n(584);function s(t,e={}){const n=c,r=t[n(266)][n(241)](n(247)),o=t[n(266)][n(241)](n(230)),s=t[n(266)][n(241)](n(264)),i=e;if(r&&o){const e=function(t){const e=c,n={};if(!t[e(284)])return n;for(const r of t)r[e(250)][e(285)](t=>{const o=e;void 0===n[r.id]&&(n[r.id]=[]),n[r.id][o(234)]({author:t[o(258)][o(281)],content:t[o(244)],created:t[o(276)],is_resolved:r[o(228)]})});return n}(t[n(266)][n(262)](n(230))[n(254)]({skipNotAttached:!0,skipEmpty:!0}));Object[n(227)](e)[n(284)]&&(i[n(250)]=e)}if(r&&s){const e=t[n(266)][n(262)](n(264)),r=t[n(266)][n(262)](n(247)),o=function(t,e){const n=c,r={};if(!t[n(284)]||!e[n(284)])return r;for(const{id:o,createdAt:s,authorId:i,attributes:c}of t){const t=c&&c[n(261)],a=t?t[n(243)]:e[n(262)](i)[n(281)];r[o]={author:a,created:s}}return r}(e[n(239)]({toJSON:!0}),r[n(229)]);Object[n(227)](o)[n(284)]&&(i[n(277)]=o)}return(i[n(277)]||i[n(250)])&&(i[n(269)]=(new(Intl[n(275)]))[n(240)]()[n(271)]),i}function i(t,e={}){const n=c,r=t[n(266)][n(241)](n(247)),o=t[n(266)][n(241)](n(230)),s=t[n(266)][n(241)](n(264)),i=t[n(266)][n(241)](n(278)),a=t[n(270)][n(233)],u=e,d={};if(u[n(252)]=u[n(252)]||{},u[n(252)][n(260)]=u[n(252)][n(260)]||a,r&&o){const e=function(t){const e=c,n=[];if(!t[e(284)])return n;for(const r of t){const t=r[e(250)][e(285)](t=>({author:t[e(258)][e(281)],content:t[e(244)],created_at:t[e(276)]}));n[e(234)]({thread_id:r.id,is_resolved:r[e(228)],comments:t})}return n}(t[n(266)][n(262)](n(230))[n(254)]({skipNotAttached:!0,skipEmpty:!0}));e[n(284)]&&(d[n(263)]=e)}if(r&&s){const e=t[n(266)][n(262)](n(264)),r=t[n(266)][n(262)](n(247)),o=function(t,e){const n=c;return t[n(284)]&&e[n(284)]?t[n(285)](({id:t,createdAt:r,authorId:o,attributes:s})=>{const i=n,c=s&&s[i(261)];return{id:t,author:c?c[i(243)]:e[i(262)](o)[i(281)],created_at:r}}):[]}(e[n(239)]({toJSON:!0}),r[n(229)]);o[n(284)]&&(d[n(277)]=o)}if(i){const e=t[n(266)][n(262)](n(283)),r=e[n(267)],{prefix:o,suffix:s}=t[n(249)][n(262)](n(257));if(u[n(274)]={prefix:o,suffix:s},n(226)!==r){u[n(274)][n(242)]={};const t=n(259),o=n(248)===r?e[n(245)]():e[n(237)](r,!0);for(const r of Object[n(280)](o)){const[o,s]=r;n(236)===e[n(256)](o)?u[n(274)][n(242)][o]=null!==s?s:t:u[n(274)][n(242)][o]=null!==s?s:e[n(238)](o)||o}}}return(d[n(263)]||d[n(277)])&&(u[n(269)]=(new(Intl[n(275)]))[n(240)]()[n(271)],u[n(251)]=d),u}function c(t,e){const n=a();return(c=function(t,e){return n[t-=225]})(t,e)}function a(){const t=["createdAt","suggestions","MergeFields","266280tveMMf","entries","name","1095087PqUDuk","MergeFieldsEditing","length","map","9pqsILK","$labels","keys","isResolved","users","CommentsRepository","3164932kOFbWC","1510JlYGhL","contentLanguage","push","7371656hCxRrM","image","getDataSetValues","getLabel","getSuggestions","resolvedOptions","has","data","authorName","content","getDefaultValues","683105EMAuVc","Users","$defaultValues","config","comments","collaboration_features","document","5045IoIHGb","getCommentThreads","598aSIsHs","getMergeFieldType","mergeFields","author","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","language","@external","get","comment_threads","TrackChanges","3WRKsEe","plugins","previewMode","154HmtwOg","timezone","locale","timeZone","894fEHFOb","2zfTEjw","merge_fields","DateTimeFormat"];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=c,n=t();for(;;)try{if(516307===parseInt(e(246))/1*(-parseInt(e(273))/2)+parseInt(e(265))/3*(parseInt(e(231))/4)+parseInt(e(253))/5*(parseInt(e(272))/6)+parseInt(e(282))/7+parseInt(e(235))/8*(-parseInt(e(225))/9)+-parseInt(e(232))/10*(-parseInt(e(268))/11)+parseInt(e(279))/12*(parseInt(e(255))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(a);const d=f;function p(){const t=["get","plugins","version","https://docx-converter.cke-cs.com/v1/convert","10tSjobw","fetch","converterOptions","click","locale","value","application/docx","119466oHfiHZ","export-word-v1-api-is-deprecated","format","auto_pagination","Notification","margin_bottom","1421728wyWAkf","converterUrl","fileName","margin_top","pending","href","POST","_token","862443TcVJXv","config","Word document export started","suggestions","152uZUzwI","download","finally",'<div class="ck-content" dir="',"remove","114bPTKFr","set","catch","createObjectURL","Word document export failed","comments","options","stringify","</div>","3SOTEfa","refresh","affectsData","dataCallback","assertive","blob","header","ExportWord","_downloadFile","An error occurred while generating the Word file.","ariaLiveAnnouncer","48AfxgUf","margin_left","7NokBnF","editor","URL","announce","token","Word document export successful","data","status","https://docx-converter.cke-cs.com/v2/convert/html-docx","document.docx","stylesheets","46466YgZjxp","EDITOR_STYLES","execute","3993462ZDjplf","orientation","2187224iYbRjW","then","margin_right","isEnabled","4955rIKhvt","footer","showWarning","createElement","function","contentLanguageDirection","isBusy","application/json"];return(p=function(){return t})()}function f(t,e){const n=p();return(f=function(t,e){return n[t-=481]})(t,e)}!function(t){const e=f,n=t();for(;;)try{if(235785===-parseInt(e(523))/1*(parseInt(e(562))/2)+parseInt(e(510))/3*(parseInt(e(484))/4)+parseInt(e(543))/5*(parseInt(e(501))/6)+-parseInt(e(534))/7*(parseInt(e(496))/8)+parseInt(e(492))/9*(parseInt(e(555))/10)+-parseInt(e(537))/11+parseInt(e(521))/12*(parseInt(e(539))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(p);const l=[d(538),d(487),d(541),d(483),d(522),d(564),d(516),d(544),d(506),d(495)];class h extends t.Command{constructor(t){const e=d;super(t),this[e(502)](e(549),!1),this[e(512)]=!1}[d(511)](){const t=d;this[t(542)]=!this[t(549)],this[t(560)]=this[t(549)]?t(488):void 0}[d(536)](t={}){const e=d,n=this[e(524)],r=t[e(553)]||2,c=1===r,a=t[e(485)]||e(c?554:531),p=t[e(557)]||{},f=n[e(552)][e(551)](e(517)),h=t[e(527)]||f[e(491)],g=!0===p[e(481)],m=t[e(513)]||(t=>t[e(529)][e(551)]({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(563)),this[e(549)]=!0,this[e(511)](),(0,o.collectStylesheets)(t[e(533)]||[e(535)])[e(540)](async r=>{const o=e;n.ui[o(520)][o(526)](u(n[o(559)],o(494)));const d=await m(n),f={html:o(499)+n[o(559)][o(548)]+'">'+d+o(509),css:r,[o(c?507:493)]:{...p,...c?s(n,p):i(n,p)}},l={method:o(490),headers:{"Content-Type":o(550),Accept:o(561),...h?{Authorization:h[o(560)]}:null},body:JSON[o(508)](f)};return window[o(556)](a,l)[o(540)](t=>{const e=o;if(200!==t[e(530)])throw t;return t[e(515)]()})[o(540)](e=>{const r=o;n.ui[r(520)][r(526)](u(n[r(559)],r(528)));const s=r(547)==typeof t[r(486)]?t[r(486)]():t[r(486)];this[r(518)](e,s||r(532))})})[e(503)](t=>{const r=e,o=n[r(552)][r(551)](r(482));throw n.ui[r(520)][r(526)](u(n[r(559)],r(505)),{politeness:r(514)}),o[r(545)](u(n[r(559)],r(519))),t})[e(498)](()=>{const t=e;this[t(549)]=!1,this[t(511)]()})}[d(518)](t,e){const n=d,r=document[n(546)]("a");r[n(489)]=window[n(525)][n(504)](t),r[n(497)]=e,r[n(558)](),r[n(500)]()}}var g=n(355);const m=I;function I(t,e){const n=x();return(I=function(t,e){return n[t-=343]})(t,e)}function x(){const t=["isOfficialPlugin","ExportWordUI","56280xAuonc","config","bind","pluginName","isVisible","2741840VLbCMu","commands","9RwSaJZ","init","9395250NVRIQV","view","isEnabled","exportWord","get","listenTo","editing","432748nPkNdj","1456184xOGzSG","focus","menuBar:exportWord","componentFactory","Export to Word","children","150HOkXmn","label","isBusy","execute","4020075ddrBAj","isOn","_createButton","add","locale","Exporting Word document","104088ZBseMu","editor","iconView","set","isPremiumPlugin","27ExpxCN"];return(x=function(){return t})()}!function(t){const e=I,n=t();for(;;)try{if(771431===parseInt(e(369))/1+-parseInt(e(358))/2+parseInt(e(360))/3*(parseInt(e(345))/4)+-parseInt(e(380))/5+parseInt(e(376))/6*(-parseInt(e(353))/7)+-parseInt(e(370))/8+-parseInt(e(350))/9*(-parseInt(e(362))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(x);class A extends t.Plugin{static get[m(356)](){return m(352)}static get[m(351)](){return!0}static get[m(349)](){return!0}[m(361)](){const t=m,n=this[t(346)];n.ui[t(373)][t(383)](t(365),()=>{const r=t,o=n[r(359)][r(366)](r(365)),s=this[r(382)](e.ButtonView);return s[r(348)]({tooltip:!0}),s[r(355)](r(381)).to(o,r(378)),s}),n.ui[t(373)][t(383)](t(372),()=>this[t(382)](e.MenuBarMenuListItemButtonView))}[m(382)](t){const n=m,r=this[n(346)],o=r[n(354)][n(366)](n(365))||{},s=r[n(359)][n(366)](n(365)),i=new t(r[n(343)]),c=new e.SpinnerView;return i[n(375)][n(383)](c),c[n(355)](n(357)).to(s,n(378)),i[n(347)][n(355)](n(357)).to(s,n(378),t=>!t),i[n(348)]({icon:g.IconExportWord}),i[n(355)](n(364)).to(s,n(364)),i[n(355)](n(377)).to(s,n(378),t=>u(r[n(343)],n(t?344:374))),this[n(367)](i,n(379),()=>{const t=n;r[t(379)](t(365),o),r[t(368)][t(363)][t(371)]()}),i}}const w=v;function v(t,e){const n=W();return(v=function(t,e){return n[t-=494]})(t,e)}function W(){const t=["391020LdovJY","isOfficialPlugin","token","exportWord","commands","tokenUrl","1085qRAlpI","25446unqMom","config","requires","_token","18eqvduv","isPremiumPlugin","plugins","2460axcsJs","get","506872exdMcw","CloudServices","then","10uzDVAV","editor","2604MsiwKZ","add","pluginName","ExportWord","4isCiEs","registerTokenUrl","init","2073235hLRUPM","20462376YfoZAs","4557751GcosKy"];return(W=function(){return t})()}!function(t){const e=v,n=t();for(;;)try{if(537841===parseInt(e(503))/1+-parseInt(e(517))/2*(-parseInt(e(524))/3)+parseInt(e(497))/4*(parseInt(e(500))/5)+-parseInt(e(510))/6*(-parseInt(e(509))/7)+-parseInt(e(519))/8*(-parseInt(e(514))/9)+parseInt(e(522))/10*(-parseInt(e(502))/11)+-parseInt(e(501))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(W);class b extends t.Plugin{[w(513)];static get[w(495)](){return w(496)}static get[w(504)](){return!0}static get[w(515)](){return!0}static get[w(512)](){return[w(520),e.Notification,A]}[w(499)](){const t=w,e=this[t(523)],n=e[t(511)][t(518)](t(506))||{};e[t(507)][t(494)](t(506),new h(e));const r=e[t(516)][t(518)](t(520));!1===n[t(508)]?this[t(513)]=null:n[t(508)]?r[t(498)](n[t(508)])[t(521)](e=>{this[t(513)]=e}):this[t(513)]=r[t(505)]}}function E(t,e){var n=y();return(E=function(t,e){return n[t-=465]})(t,e)}function y(){var t=["156666eSalnx","4554984suOGHv","1386604bIeduG","4393278NpbrTZ","103035TflIEc","3313432HcRDvx","18GLCoWl","2443950cmniij","4Jbccuw","3rNSCIs"];return(y=function(){return t})()}!function(t){for(var e=E,n=t();;)try{if(370908===-parseInt(e(465))/1*(parseInt(e(473))/2)+-parseInt(e(474))/3*(parseInt(e(467))/4)+parseInt(e(469))/5*(parseInt(e(471))/6)+parseInt(e(466))/7+-parseInt(e(470))/8+parseInt(e(468))/9+parseInt(e(472))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(y)})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=r})();