@ckeditor/ckeditor5-export-word
Version:
Export to Word feature for CKEditor 5.
5 lines • 13.4 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")},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=i();return(s=function(t,e){return n[t-=310]})(t,e)}function i(){const t=["users","isResolved","Users","resolvedOptions","3517040orhBPb","contentLanguage","config","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=","locale","authorName","getLabel","previewMode","image","collaboration_features","data","push","suggestions","14424zMpSVA","get","TrackChanges","mergeFields","5140954dgRxhO","getDefaultValues","has","getSuggestions","comment_threads","content","CommentsRepository","plugins","@external","23167168XmYyCN","document","entries","map","language","getDataSetValues","comments","merge_fields","createdAt","author","$labels","2540xefaGy","MergeFields","2211968wYzIyK","length","getMergeFieldType","keys","timeZone","3174630SQNeeV","name","getCommentThreads","DateTimeFormat","979086NcSEBA","$defaultValues","timezone","MergeFieldsEditing"];return(i=function(){return t})()}function c(t,e={}){const n=s,r=t[n(314)][n(365)](n(344)),o=t[n(314)][n(365)](n(313)),i=t[n(314)][n(365)](n(361)),c=e;if(r&&o){const e=function(t){const e=s,n={};if(!t[e(330)])return n;for(const r of t)r[e(322)][e(319)]((t=>{const o=e;void 0===n[r.id]&&(n[r.id]=[]),n[r.id][o(357)]({author:t[o(325)][o(335)],content:t[o(312)],created:t[o(324)],is_resolved:r[o(343)]})}));return n}(t[n(314)][n(360)](n(313))[n(336)]({skipNotAttached:!0,skipEmpty:!0}));Object[n(332)](e)[n(330)]&&(c[n(322)]=e)}if(r&&i){const e=t[n(314)][n(360)](n(361)),r=t[n(314)][n(360)](n(344)),o=function(t,e){const n=s,r={};if(!t[n(330)]||!e[n(330)])return r;for(const{id:o,createdAt:s,authorId:i,attributes:c}of t){const t=c&&c[n(315)],a=t?t[n(351)]:e[n(360)](i)[n(335)];r[o]={author:a,created:s}}return r}(e[n(310)]({toJSON:!0}),r[n(342)]);Object[n(332)](o)[n(330)]&&(c[n(358)]=o)}return(c[n(358)]||c[n(322)])&&(c[n(340)]=(new(Intl[n(337)]))[n(345)]()[n(333)]),c}function a(t,e={}){const n=s,r=t[n(314)][n(365)](n(344)),o=t[n(314)][n(365)](n(313)),i=t[n(314)][n(365)](n(361)),c=t[n(314)][n(365)](n(328)),a=t[n(350)][n(347)],u=e,d={};if(u[n(317)]=u[n(317)]||{},u[n(317)][n(320)]=u[n(317)][n(320)]||a,r&&o){const e=function(t){const e=s,n=[];if(!t[e(330)])return n;for(const r of t){const t=r[e(322)][e(319)]((t=>({author:t[e(325)][e(335)],content:t[e(312)],created_at:t[e(324)]})));n[e(357)]({thread_id:r.id,is_resolved:r[e(343)],comments:t})}return n}(t[n(314)][n(360)](n(313))[n(336)]({skipNotAttached:!0,skipEmpty:!0}));e[n(330)]&&(d[n(311)]=e)}if(r&&i){const e=t[n(314)][n(360)](n(361)),r=t[n(314)][n(360)](n(344)),o=function(t,e){const n=s;return t[n(330)]&&e[n(330)]?t[n(319)]((({id:t,createdAt:r,authorId:o,attributes:s})=>{const i=n,c=s&&s[i(315)];return{id:t,author:c?c[i(351)]:e[i(360)](o)[i(335)],created_at:r}})):[]}(e[n(310)]({toJSON:!0}),r[n(342)]);o[n(330)]&&(d[n(358)]=o)}if(c){const e=t[n(314)][n(360)](n(341)),r=e[n(353)],{prefix:o,suffix:s}=t[n(348)][n(360)](n(362));if(u[n(323)]={prefix:o,suffix:s},n(326)!==r){u[n(323)][n(356)]={};const t=n(349),o=n(339)===r?e[n(364)]():e[n(321)](r,!0);for(const r of Object[n(318)](o)){const[o,s]=r;n(354)===e[n(331)](o)?u[n(323)][n(356)][o]=null!==s?s:t:u[n(323)][n(356)][o]=null!==s?s:e[n(352)](o)||o}}}return(d[n(311)]||d[n(358)])&&(u[n(340)]=(new(Intl[n(337)]))[n(345)]()[n(333)],u[n(355)]=d),u}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=s,n=t();for(;;)try{if(639834===parseInt(e(338))/1+parseInt(e(329))/2+parseInt(e(334))/3+parseInt(e(346))/4+-parseInt(e(327))/5*(parseInt(e(359))/6)+parseInt(e(363))/7+-parseInt(e(316))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(i);const d=l;function p(){const t=["execute","margin_top","document.docx","data","margin_left","711629HhhJjx","get","finally","isBusy","POST","affectsData","plugins","margin_right","href","export-word-v1-api-is-deprecated","ExportWord","</div>","createElement","config","EDITOR_STYLES","319oFUULF","application/docx","footer","auto_pagination","remove","fileName","header","status","value","orientation",'<div class="ck-content" dir="',"suggestions","download","_downloadFile","42FTcUcG","margin_bottom","token","catch","click","application/json","assertive","options","function","version","Word document export successful","comments","https://docx-converter.cke-cs.com/v2/convert/html-docx","Notification","blob","ariaLiveAnnouncer","fetch","Word document export failed","announce","2VjeIxL","https://docx-converter.cke-cs.com/v1/convert","format","refresh","3158883kUdxTU","1227736QfUSpp","2065840JgxlvX","converterOptions","45qssadj","_token","isEnabled","stylesheets","3016180xzmwlF","set","contentLanguageDirection","408550HEwgAi","converterUrl","dataCallback","showWarning","pending","editor","284942yukAJw","URL","An error occurred while generating the Word file.","Word document export started","stringify","then","locale","createObjectURL"];return(p=function(){return t})()}!function(t){const e=l,n=t();for(;;)try{if(549691===parseInt(e(394))/1*(-parseInt(e(360))/2)+parseInt(e(364))/3+parseInt(e(372))/4+-parseInt(e(366))/5+-parseInt(e(341))/6*(-parseInt(e(381))/7)+parseInt(e(365))/8*(parseInt(e(368))/9)+parseInt(e(375))/10*(-parseInt(e(409))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(p);const f=[d(336),d(390),d(401),d(342),d(393),d(362),d(333),d(329),d(352),d(338)];function l(t,e){const n=p();return(l=function(t,e){return n[t-=328]})(t,e)}class h extends t.Command{constructor(t){const e=d;super(t),this[e(373)](e(397),!1),this[e(399)]=!1}[d(363)](){const t=d;this[t(370)]=!this[t(397)],this[t(335)]=this[t(397)]?t(379):void 0}[d(389)](t={}){const e=d,n=this[e(380)],r=t[e(350)]||2,s=1===r,i=t[e(376)]||e(s?361:353),p=t[e(367)]||{},l=n[e(400)][e(395)](e(404)),h=t[e(343)]||l[e(369)],g=!0===p[e(330)],m=t[e(377)]||(t=>t[e(392)][e(395)]({pagination:g}));return 2===r&&function(t){for(const e of f)if(void 0!==t[e])return!0;return!1}(p)&&(0,o.logWarning)(e(403)),this[e(397)]=!0,this[e(363)](),(0,o.collectStylesheets)(t[e(371)]||[e(408)])[e(386)]((async r=>{const o=e;n.ui[o(356)][o(359)](u(n[o(387)],o(384)));const d=await m(n),f={html:o(337)+n[o(387)][o(374)]+'">'+d+o(405),css:r,[o(s?348:407)]:{...p,...s?c(n,p):a(n,p)}},l={method:o(398),headers:{"Content-Type":o(346),Accept:o(328),...h?{Authorization:h[o(335)]}:null},body:JSON[o(385)](f)};return window[o(357)](i,l)[o(386)]((t=>{const e=o;if(200!==t[e(334)])throw t;return t[e(355)]()}))[o(386)]((e=>{const r=o;n.ui[r(356)][r(359)](u(n[r(387)],r(351)));const s=r(349)==typeof t[r(332)]?t[r(332)]():t[r(332)];this[r(340)](e,s||r(391))}))}))[e(344)]((t=>{const r=e,o=n[r(400)][r(395)](r(354));throw n.ui[r(356)][r(359)](u(n[r(387)],r(358)),{politeness:r(347)}),o[r(378)](u(n[r(387)],r(383))),t}))[e(396)]((()=>{const t=e;this[t(397)]=!1,this[t(363)]()}))}[d(340)](t,e){const n=d,r=document[n(406)]("a");r[n(402)]=window[n(382)][n(388)](t),r[n(339)]=e,r[n(345)](),r[n(331)]()}}function g(){const t=["Exporting Word document","execute","isPremiumPlugin","commands","editing","175494gdIZYG","bind","isBusy","label","listenTo","7GDOmQg","isOn","componentFactory","275sXmLEV","exportWord","editor","3813608bJdMaa","init","menuBar:exportWord","488280zvGRPa","isOfficialPlugin","isVisible","children","ExportWordUI","10SMkNar","Export to Word","add","pluginName","focus","11010zrrxMk","285873DHgFvr","_createButton","config","view","iconView","get","locale","54174LRHdUp","isEnabled","set","52EmiDeg","2123154vJEElK"];return(g=function(){return t})()}function m(t,e){const n=g();return(m=function(t,e){return n[t-=265]})(t,e)}const I=m;!function(t){const e=m,n=t();for(;;)try{if(264201===parseInt(e(267))/1+-parseInt(e(277))/2*(parseInt(e(274))/3)+parseInt(e(298))/4+-parseInt(e(292))/5*(-parseInt(e(266))/6)+-parseInt(e(289))/7*(-parseInt(e(295))/8)+-parseInt(e(278))/9*(parseInt(e(303))/10)+-parseInt(e(284))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(g);class x extends t.Plugin{static get[I(306)](){return I(302)}static get[I(299)](){return!0}static get[I(281)](){return!0}[I(296)](){const t=I,n=this[t(294)];n.ui[t(291)][t(305)](t(293),(()=>{const r=t,o=n[r(282)][r(272)](r(293)),s=this[r(268)](e.ButtonView);return s[r(276)]({tooltip:!0}),s[r(285)](r(290)).to(o,r(286)),s})),n.ui[t(291)][t(305)](t(297),(()=>this[t(268)](e.MenuBarMenuListItemButtonView)))}[I(268)](t){const n=I,r=this[n(294)],o=r[n(269)][n(272)](n(293))||{},s=r[n(282)][n(272)](n(293)),i=new t(r[n(273)]),c=new e.SpinnerView;return i[n(301)][n(305)](c),c[n(285)](n(300)).to(s,n(286)),i[n(271)][n(285)](n(300)).to(s,n(286),(t=>!t)),i[n(276)]({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.826 16.843a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Z"/><path d="m14 0 5 4.5v9.741a2.737 2.737 0 0 0-1.5-.617V6.5h-5v-5h-8v3H3V0h11Zm0 2v3h3.3L14 2Z"/><path d="M3 17.5h6.746c.1.22.23.429.391.623l.731.877H3v-1.5Z"/><path d="M8.5 6a1.5 1.5 0 0 1 1.493 1.356L10 7.5v7a1.5 1.5 0 0 1-1.356 1.493L8.5 16h-7a1.5 1.5 0 0 1-1.493-1.356L0 14.5v-7a1.5 1.5 0 0 1 1.356-1.493L1.5 6h7ZM7.483 8.795l-.042.088-.986 2.534-.947-2.528-.043-.092a.601.601 0 0 0-1.042.008l-.042.093-.883 2.465-.937-2.475-.042-.089a.6.6 0 0 0-1.107.42l.027.093 1.514 4 .044.092a.6.6 0 0 0 1.041-.01l.041-.092.88-2.458.925 2.467.046.096a.6.6 0 0 0 1.032 0l.043-.09 1.554-4 .028-.093a.6.6 0 0 0-1.104-.43v.001Z"/></svg>\n'}),i[n(285)](n(275)).to(s,n(275)),i[n(285)](n(287)).to(s,n(286),(t=>u(r[n(273)],n(t?279:304)))),this[n(288)](i,n(280),(()=>{const t=n;r[t(280)](t(293),o),r[t(283)][t(270)][t(265)]()})),i}}function v(t,e){const n=A();return(v=function(t,e){return n[t-=327]})(t,e)}const w=v;function A(){const t=["_token","config","get","tokenUrl","init","108qjETif","pluginName","184ygYxFu","10973300bSozRH","1161391bBjMny","editor","7PVFRSC","isPremiumPlugin","isOfficialPlugin","173771rfZrcg","plugins","7430216oLjIYS","requires","1079410cnXkCL","9tQulqZ","then","ExportWord","commands","6igqnxX","exportWord","1008jsGmag","CloudServices","token","1420914oQpfFb","add","61524MPebiO","1TUXJHe","registerTokenUrl"];return(A=function(){return t})()}!function(t){const e=v,n=t();for(;;)try{if(575969===parseInt(e(351))/1*(-parseInt(e(348))/2)+parseInt(e(350))/3*(-parseInt(e(327))/4)+-parseInt(e(338))/5*(-parseInt(e(343))/6)+-parseInt(e(331))/7*(-parseInt(e(336))/8)+-parseInt(e(339))/9*(-parseInt(e(328))/10)+-parseInt(e(329))/11*(-parseInt(e(358))/12)+parseInt(e(334))/13*(-parseInt(e(345))/14))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(A);class b extends t.Plugin{static get[w(359)](){return w(341)}static get[w(333)](){return!0}static get[w(332)](){return!0}static get[w(337)](){return[w(346),e.Notification,x]}[w(357)](){const t=w,e=this[t(330)],n=e[t(354)][t(355)](t(344))||{};e[t(342)][t(349)](t(344),new h(e));const r=e[t(335)][t(355)](t(346));!1===n[t(356)]?this[t(353)]=null:n[t(356)]?r[t(352)](n[t(356)])[t(340)]((e=>{this[t(353)]=e})):this[t(353)]=r[t(347)]}}function W(){var t=["25222dOFjox","8rmgYYn","28578wCMLsf","957620Oocvtz","2229168zRVcjY","88227TrHFtb","5PFJmtd","130863ZksSfh","728YvjwjU","10KotNRG","8994PdLgPS"];return(W=function(){return t})()}function y(t,e){var n=W();return(y=function(t,e){return n[t-=128]})(t,e)}!function(t){for(var e=y,n=t();;)try{if(176378===parseInt(e(131))/1*(-parseInt(e(136))/2)+parseInt(e(132))/3*(-parseInt(e(137))/4)+parseInt(e(128))/5+-parseInt(e(135))/6*(parseInt(e(133))/7)+parseInt(e(129))/8+parseInt(e(130))/9*(parseInt(e(134))/10)+parseInt(e(138))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(W)})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=r})();