@ckeditor/ckeditor5-export-word
Version:
Export to Word feature for CKEditor 5.
5 lines • 12.6 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,r)=>{t.exports=r(237)("./src/ui.js")},355:(t,e,r)=>{t.exports=r(237)("./src/icons.js")},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{ExportWord:()=>C,ExportWordCommand:()=>I,_getExportWordComments:()=>i,_getExportWordCommentsV2:()=>u,_getExportWordConverterOptionsV1:()=>s,_getExportWordConverterOptionsV2:()=>a,_getExportWordSuggestions:()=>c,_getExportWordSuggestionsV2:()=>d});var t=r(782),e=r(311),o=r(584);function s(t,e={}){const r=p,n=t[r(544)][r(504)](r(534)),o=t[r(544)][r(504)](r(542)),s=t[r(544)][r(504)](r(540)),a=e;if(n&&o){const e=i(t[r(544)][r(510)](r(542))[r(492)]({skipNotAttached:!0,skipEmpty:!0}));Object[r(525)](e)[r(528)]&&(a[r(520)]=e)}if(n&&s){const e=t[r(544)][r(510)](r(540)),n=t[r(544)][r(510)](r(534)),o=c(e[r(513)]({toJSON:!0}),n[r(518)]);Object[r(525)](o)[r(528)]&&(a[r(522)]=o)}return(a[r(522)]||a[r(520)])&&(a[r(499)]=(new(Intl[r(536)]))[r(497)]()[r(524)]),a}function i(t){const e=p,r={};if(!t[e(528)])return r;for(const n of t)n[e(520)][e(512)](t=>{const o=e;void 0===r[n.id]&&(r[n.id]=[]),r[n.id][o(511)]({author:t[o(508)][o(493)],content:t[o(543)],created:t[o(507)],is_resolved:n[o(533)]})});return r}function c(t,e){const r=p,n={};if(!t[r(528)]||!e[r(528)])return n;for(const{id:o,createdAt:s,authorId:i,attributes:c}of t){const t=c&&c[r(535)],a=t?t[r(506)]:e[r(510)](i)[r(493)];n[o]={author:a,created:s}}return n}function a(t,e={}){const r=p,n=t[r(544)][r(504)](r(534)),o=t[r(544)][r(504)](r(542)),s=t[r(544)][r(504)](r(540)),i=t[r(544)][r(504)](r(516)),c=t[r(531)][r(537)],a=e,f={};if(a[r(538)]=a[r(538)]||{},a[r(538)][r(530)]=a[r(538)][r(530)]||c,n&&o){const e=u(t[r(544)][r(510)](r(542))[r(492)]({skipNotAttached:!0,skipEmpty:!0}));e[r(528)]&&(f[r(515)]=e)}if(n&&s){const e=t[r(544)][r(510)](r(540)),n=t[r(544)][r(510)](r(534)),o=d(e[r(513)]({toJSON:!0}),n[r(518)]);o[r(528)]&&(f[r(522)]=o)}if(i){const e=t[r(544)][r(510)](r(489)),n=e[r(521)],{prefix:o,suffix:s}=t[r(491)][r(510)](r(502));if(a[r(514)]={prefix:o,suffix:s},r(500)!==n){a[r(514)][r(496)]={};const t=r(519),o=r(503)===n?e[r(532)]():e[r(539)](n,!0);for(const n of Object[r(505)](o)){const[o,s]=n;r(488)===e[r(509)](o)?a[r(514)][r(496)][o]=null!==s?s:t:a[r(514)][r(496)][o]=null!==s?s:e[r(517)](o)||o}}}return(f[r(515)]||f[r(522)])&&(a[r(499)]=(new(Intl[r(536)]))[r(497)]()[r(524)],a[r(501)]=f),a}function u(t){const e=p,r=[];if(!t[e(528)])return r;for(const n of t){const t=n[e(520)][e(512)](t=>({author:t[e(508)][e(493)],content:t[e(543)],created_at:t[e(507)]}));r[e(511)]({thread_id:n.id,is_resolved:n[e(533)],comments:t})}return r}function d(t,e){const r=p;return t[r(528)]&&e[r(528)]?t[r(512)](({id:t,createdAt:n,authorId:o,attributes:s})=>{const i=r,c=s&&s[i(535)];return{id:t,author:c?c[i(506)]:e[i(510)](o)[i(493)],created_at:n}}):[]}function p(t,e){const r=f();return(p=function(t,e){return r[t-=488]})(t,e)}function f(){const t=["getSuggestions","merge_fields","comment_threads","MergeFields","getLabel","users","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","comments","previewMode","suggestions","5799178DgmQhz","timeZone","keys","353798cbjqWO","5438637cHQlwM","length","4973470lTsgYr","language","locale","getDefaultValues","isResolved","Users","@external","DateTimeFormat","contentLanguage","document","getDataSetValues","TrackChanges","9JqdWQN","CommentsRepository","content","plugins","image","MergeFieldsEditing","1453998SzDKka","config","getCommentThreads","name","6649312DlTPlF","12847776kyPGla","data","resolvedOptions","6naTaiL","timezone","$labels","collaboration_features","mergeFields","$defaultValues","has","entries","authorName","createdAt","author","getMergeFieldType","get","push","map"];return(f=function(){return t})()}function l(t,e){const r=t.t;switch(e){case"Export to Word":return r("Export to Word");case"An error occurred while generating the Word file.":return r("An error occurred while generating the Word file.");case"Word document export started":return r("Word document export started");case"Word document export failed":return r("Word document export failed");case"Word document export successful":return r("Word document export successful");case"Exporting Word document":return r("Exporting Word document");default:return e}}!function(t){const e=p,r=t();for(;;)try{if(909372===parseInt(e(490))/1+-parseInt(e(526))/2+-parseInt(e(527))/3+parseInt(e(494))/4+-parseInt(e(529))/5*(parseInt(e(498))/6)+-parseInt(e(523))/7+-parseInt(e(495))/8*(-parseInt(e(541))/9))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(f);const g=m;!function(t){const e=m,r=t();for(;;)try{if(643994===parseInt(e(523))/1+-parseInt(e(560))/2+-parseInt(e(519))/3+-parseInt(e(578))/4+parseInt(e(506))/5*(parseInt(e(510))/6)+parseInt(e(547))/7*(parseInt(e(536))/8)+parseInt(e(533))/9*(-parseInt(e(579))/10))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(x);const h=[g(542),g(556),g(526),g(569),g(574),g(508),g(561),g(545),g(525),g(524)];function m(t,e){const r=x();return(m=function(t,e){return r[t-=500]})(t,e)}function x(){const t=["dataCallback","application/docx","affectsData","options","2973240JhqDXK","converterOptions","refresh","version","868393IuIeDE","suggestions","comments","margin_right","locale","stringify","get","pending","then","createElement","315891BcQrfM","ariaLiveAnnouncer","</div>","8hcybjQ","token","click","stylesheets","EDITOR_STYLES","fileName","orientation",'<div class="ck-content" dir="',"contentLanguageDirection","footer","finally","8586893PhRGKm","value","announce","Word document export failed","application/json","export-word-v1-api-is-deprecated","An error occurred while generating the Word file.","POST","function","margin_top","https://docx-converter.cke-cs.com/v2/convert/html-docx","config","remove","946714HNxJbG","header","href","isEnabled","editor","catch","data","isBusy","status","margin_bottom","auto_pagination","createObjectURL","converterUrl","set","margin_left","execute","Word document export successful","blob","3005140FNAUFm","10lozrdB","ExportWord","fetch","_downloadFile","URL","Word document export started","assertive","https://docx-converter.cke-cs.com/v1/convert","5sUoOQy","download","format","Notification","4798338tSMGfs","plugins","showWarning","_token","document.docx"];return(x=function(){return t})()}class I extends t.Command{constructor(t){const e=g;super(t),this[e(573)](e(567),!1),this[e(517)]=!1}[g(521)](){const t=g;this[t(563)]=!this[t(567)],this[t(548)]=this[t(567)]?t(530):void 0}[g(575)](t={}){const e=g,r=this[e(564)],n=t[e(522)]||2,i=1===n,c=t[e(572)]||e(i?505:557),u=t[e(520)]||{},d=r[e(511)][e(529)](e(580)),p=t[e(537)]||d[e(513)],f=!0===u[e(570)],m=t[e(515)]||(t=>t[e(566)][e(529)]({pagination:f}));return 2===n&&function(t){for(const e of h)if(void 0!==t[e])return!0;return!1}(u)&&(0,o.logWarning)(e(552)),this[e(567)]=!0,this[e(521)](),(0,o.collectStylesheets)(t[e(539)]||[e(540)])[e(531)](async n=>{const o=e;r.ui[o(534)][o(549)](l(r[o(527)],o(503)));const d=await m(r),f={html:o(543)+r[o(527)][o(544)]+'">'+d+o(535),css:n,[o(i?518:558)]:{...u,...i?s(r,u):a(r,u)}},g={method:o(554),headers:{"Content-Type":o(551),Accept:o(516),...p?{Authorization:p[o(548)]}:null},body:JSON[o(528)](f)};return window[o(500)](c,g)[o(531)](t=>{const e=o;if(200!==t[e(568)])throw t;return t[e(577)]()})[o(531)](e=>{const n=o;r.ui[n(534)][n(549)](l(r[n(527)],n(576)));const s=n(555)==typeof t[n(541)]?t[n(541)]():t[n(541)];this[n(501)](e,s||n(514))})})[e(565)](t=>{const n=e,o=r[n(511)][n(529)](n(509));throw r.ui[n(534)][n(549)](l(r[n(527)],n(550)),{politeness:n(504)}),o[n(512)](l(r[n(527)],n(553))),t})[e(546)](()=>{const t=e;this[t(567)]=!1,this[t(521)]()})}[g(501)](t,e){const r=g,n=document[r(532)]("a");n[r(562)]=window[r(502)][r(571)](t),n[r(507)]=e,n[r(538)](),n[r(559)]()}}var W=r(355);const A=E;function w(){const t=["view","95834CSuCeW","add","config","commands","iconView","exportWord","editor","componentFactory","6831528uSHQwA","isPremiumPlugin","752717QlhJGF","label","get","execute","listenTo","menuBar:exportWord","30dtFzat","children","isOfficialPlugin","set","112QtHDOY","ExportWordUI","init","editing","18993897JLeznZ","isEnabled","isBusy","isOn","1659900QzwLHu","Export to Word","bind","2788888iBQFTz","804482kuoeIF","Exporting Word document","locale","_createButton","focus","isVisible","pluginName"];return(w=function(){return t})()}function E(t,e){const r=w();return(E=function(t,e){return r[t-=361]})(t,e)}!function(t){const e=E,r=t();for(;;)try{if(820925===parseInt(e(368))/1+parseInt(e(376))/2*(-parseInt(e(392))/3)+parseInt(e(367))/4+parseInt(e(364))/5+-parseInt(e(384))/6+parseInt(e(386))/7*(-parseInt(e(396))/8)+parseInt(e(400))/9)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(w);class v extends t.Plugin{static get[A(374)](){return A(397)}static get[A(394)](){return!0}static get[A(385)](){return!0}[A(398)](){const t=A,r=this[t(382)];r.ui[t(383)][t(377)](t(381),()=>{const n=t,o=r[n(379)][n(388)](n(381)),s=this[n(371)](e.ButtonView);return s[n(395)]({tooltip:!0}),s[n(366)](n(363)).to(o,n(362)),s}),r.ui[t(383)][t(377)](t(391),()=>this[t(371)](e.MenuBarMenuListItemButtonView))}[A(371)](t){const r=A,n=this[r(382)],o=n[r(378)][r(388)](r(381))||{},s=n[r(379)][r(388)](r(381)),i=new t(n[r(370)]),c=new e.SpinnerView;return i[r(393)][r(377)](c),c[r(366)](r(373)).to(s,r(362)),i[r(380)][r(366)](r(373)).to(s,r(362),t=>!t),i[r(395)]({icon:W.IconExportWord}),i[r(366)](r(361)).to(s,r(361)),i[r(366)](r(387)).to(s,r(362),t=>l(n[r(370)],r(t?369:365))),this[r(390)](i,r(389),()=>{const t=r;n[t(389)](t(381),o),n[t(399)][t(375)][t(372)]()}),i}}const b=O;function y(){const t=["isPremiumPlugin","requires","registerTokenUrl","pluginName","add","4350930KaQTNK","then","ExportWord","CloudServices","config","token","1765648dwCXeU","get","3056164cwPtqW","4215533uAVyoE","210323uOdjnK","init","tokenUrl","exportWord","3634720rtgYAh","18RBxLCh","plugins","11501520rIlTfK","editor","commands","_token","isOfficialPlugin"];return(y=function(){return t})()}function O(t,e){const r=y();return(O=function(t,e){return r[t-=221]})(t,e)}!function(t){const e=O,r=t();for(;;)try{if(931940===parseInt(e(230))/1+-parseInt(e(228))/2+parseInt(e(247))/3+parseInt(e(226))/4+parseInt(e(234))/5+parseInt(e(235))/6*(-parseInt(e(229))/7)+parseInt(e(237))/8)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(y);class C extends t.Plugin{[b(240)];static get[b(245)](){return b(222)}static get[b(241)](){return!0}static get[b(242)](){return!0}static get[b(243)](){return[b(223),e.Notification,v]}[b(231)](){const t=b,e=this[t(238)],r=e[t(224)][t(227)](t(233))||{};e[t(239)][t(246)](t(233),new I(e));const n=e[t(236)][t(227)](t(223));!1===r[t(232)]?this[t(240)]=null:r[t(232)]?n[t(244)](r[t(232)])[t(221)](e=>{this[t(240)]=e}):this[t(240)]=n[t(225)]}}function S(t,e){var r=_();return(S=function(t,e){return r[t-=462]})(t,e)}function _(){var t=["734516BRDtEX","2392352YQNaqL","40BlgflQ","449490WtECnw","1cmyFDI","60QHoUwk","7420237JOEDrg","46353wowRbO","5309145jBLKky","1050920ZQAOCi","7JFarjm"];return(_=function(){return t})()}!function(t){for(var e=S,r=t();;)try{if(319177===-parseInt(e(471))/1*(-parseInt(e(467))/2)+parseInt(e(463))/3*(parseInt(e(472))/4)+-parseInt(e(469))/5*(parseInt(e(470))/6)+parseInt(e(466))/7*(parseInt(e(468))/8)+parseInt(e(464))/9+parseInt(e(465))/10+-parseInt(e(462))/11)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(_)})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=n})();