@ckeditor/ckeditor5-import-word
Version:
Import from Word feature for CKEditor 5.
5 lines • 11.3 kB
JavaScript
!function(t){const r=t.en=t.en||{};r.dictionary=Object.assign(r.dictionary||{},{"An error occurred while importing the Word file.":"An error occurred while importing the Word file.","Import from Word":"Import from Word","Importing Word document":"Importing Word document"})}(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,r,e)=>{t.exports=e(237)("./src/ui.js")},331:(t,r,e)=>{t.exports=e(237)("./src/clipboard.js")},355:(t,r,e)=>{t.exports=e(237)("./src/icons.js")},584:(t,r,e)=>{t.exports=e(237)("./src/utils.js")},782:(t,r,e)=>{t.exports=e(237)("./src/core.js")},783:(t,r,e)=>{t.exports=e(237)("./src/engine.js")}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{ImportWord:()=>k,ImportWordCommand:()=>g,ImportWordEditing:()=>v,ImportWordUI:()=>u});var t=e(782),r=e(355),o=e(311);function i(t,r){const e=t.t;switch(r){case"Import from Word":return e("Import from Word");case"An error occurred while importing the Word file.":return e("An error occurred while importing the Word file.");case"Importing Word document":return e("Importing Word document");default:return r}}const s=a;function a(t,r){const e=c();return(a=function(t,r){return e[t-=361]})(t,r)}function c(){const t=["execute","get","componentFactory","10502630PBzFOr","2004534sIoaMA","children","1554aZHxiT","view","done","isOfficialPlugin","2208QFhEPe","importWord","4119cGaepf","init","commands","isEnabled","locale","_createButton","editing","95exsgSK","526xcHfDW","menuBar:importWord","pluginName","isOn","Import from Word","isPremiumPlugin","Importing Word document","191479QgBGZe","ImportWordUI","focus","editor","application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template","44228WTabLu","set","label","tooltip","isBusy","bind","isVisible","iconView","add","1768014kbbhky"];return(c=function(){return t})()}!function(t){const r=a,e=t();for(;;)try{if(291065===parseInt(r(372))/1+parseInt(r(365))/2*(parseInt(r(399))/3)+-parseInt(r(377))/4*(-parseInt(r(364))/5)+parseInt(r(386))/6+-parseInt(r(393))/7*(-parseInt(r(397))/8)+parseInt(r(391))/9+-parseInt(r(390))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(c);class u extends t.Plugin{static get[s(367)](){return s(373)}static get[s(396)](){return!0}static get[s(370)](){return!0}[s(400)](){const t=s,r=this[t(375)];r.ui[t(389)][t(385)](t(398),()=>{const e=t,n=this[e(362)](o.FileDialogButtonView),i=r[e(401)][e(388)](e(398));return n[e(382)](e(368)).to(i,e(381)),n[e(380)]=!0,n}),r.ui[t(389)][t(385)](t(366),()=>this[t(362)](o.MenuBarMenuListItemFileDialogButtonView))}[s(362)](t){const e=s,n=this[e(375)],a=n[e(401)][e(388)](e(398)),c=new t(n[e(361)]),u=new o.SpinnerView;return c[e(378)]({acceptedType:e(376)}),c[e(378)]({icon:r.IconImportWord}),c[e(382)](e(402)).to(a),c[e(382)](e(379)).to(a,e(381),t=>i(n[e(361)],e(t?371:369))),u[e(382)](e(383)).to(a,e(381)),c[e(384)][e(382)](e(383)).to(a,e(381),t=>!t),c[e(392)][e(385)](u),c.on(e(395),(t,r)=>{const o=e;n[o(387)](o(398),r[0],{}),n[o(363)][o(394)][o(374)]()}),c}}var p=e(331),l=e(783),d=e(584);const f=m;function h(){const t=["plugins","locale","isBusy","867385dfCSZn","merge_fields","reject","_handleImportResponse","aborted","file","isCollapsed","POST","set","finally","schema","setData","906574QRFKOF","enqueueChange","createPositionAfter","setSelection","_checkEnabled","importWord","importWord:","addMarker","headers","change:range","import-word-plugin-import-cancelled","execute","json","config","MergeFields","getRange","root","isEnabled","element","catch","deleteContent","_cleanUpAfterImport","1544lbczmr","get","DateTimeFormat","Notification","1086759eBhaAR","showWarning","_sendImportRequest","fire","createPositionBefore","stopListening","4290UaxuSG","editor","$graveyard","paragraph","selection","document","import-word-plugin-conversion-failed","resolve","_handleImportFailure","checkChild","value","isAtEnd","refresh","bind","createBatch","_importMarker","html","dataInsert","timeZone","Authorization","resolvedOptions","80353cKWbRG","has","view","ImportWordEditing","getToken","_prepareForImport","formatting","position","abort","clipboardInput","model","9079884yoNsmE","low","then","_abortController","stringify","rootName","isAtStart","getFirstPosition","converterUrl","240LZsHWf","mergeFields","_undoStepBatch","getSelectedBlocks","signal","2469870jjCRTo","split","text/html","isEmpty","parent","editing","removeMarker","An error occurred while importing the Word file.","markers"];return(h=function(){return t})()}function m(t,r){const e=h();return(m=function(t,r){return e[t-=170]})(t,r)}!function(t){const r=m,e=t();for(;;)try{if(630988===-parseInt(r(202))/1+parseInt(r(214))/2+-parseInt(r(240))/3+-parseInt(r(236))/4*(-parseInt(r(246))/5)+parseInt(r(190))/6+parseInt(r(267))/7*(-parseInt(r(185))/8)+parseInt(r(176))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(h);class g extends t.Command{[f(261)];[f(187)];[f(179)];constructor(t){const r=f;super(t),this[r(210)](r(201),!1),this[r(261)]=null,this[r(187)]=null,this[r(179)]=null,this.on(r(263),(e,n)=>{const o=r,i=new DataTransfer;i[o(213)](o(192),n[o(262)]);const s=this[o(261)][o(229)]();this[o(247)][o(175)][o(215)](this[o(187)],r=>{const e=o;this[e(261)][e(245)](),r[e(217)](s),t[e(195)][e(269)][e(251)][e(243)](e(174),{dataTransfer:i})})},{priority:r(177)})}[f(258)](){const t=f;this[t(231)]=this[t(218)]()}[f(225)](t,r={}){const e=f;if(this[e(201)])return Promise[e(253)]();const n=this[e(247)][e(227)][e(237)](e(219));if(this[e(247)][e(199)][e(268)](e(228))){const{prefix:t,suffix:n}=this[e(247)][e(227)][e(237)](e(186));r[e(203)]={prefix:t,suffix:n}}const o={url:n[e(184)],file:t,serviceConfig:{...r,formatting:n[e(171)],timezone:(new(Intl[e(238)]))[e(266)]()[e(264)]}};return this[e(170)](),this[e(242)](o)[e(178)](this[e(205)][e(259)](this))[e(233)](this[e(254)][e(259)](this))[e(211)](this[e(235)][e(259)](this))}[f(218)](){const t=f;if(this[t(201)])return!1;const r=this[t(247)][t(175)],e=r[t(212)],n=r[t(251)][t(250)],o=(0,d.first)(n[t(188)]());return!!o&&e[t(255)](o[t(194)],t(249))}[f(170)](){const t=f,r=this[t(247)],e=r[t(175)],n=e[t(251)][t(250)];this[t(179)]=new AbortController,this[t(187)]=r[t(175)][t(260)]({isUndoable:!0}),e[t(215)](this[t(187)],r=>{const o=t;n[o(208)]||e[o(234)](n,{leaveUnmerged:!0});const i=n[o(183)](),s=(0,d.first)(n[o(188)]());let a;a=s.is(o(232),o(249))&&s[o(193)]?i:i[o(182)]?e[o(244)](s):i[o(257)]?e[o(216)](s):r[o(191)](i)[o(172)],this[o(261)]=r[o(221)](o(220)+(0,d.uid)(),{usingOperation:!1,affectsData:!1,range:new l.ModelRange(a)}),this[o(261)].on(o(223),()=>{const t=o;t(248)===this[t(261)][t(229)]()[t(230)][t(181)]&&this[t(179)][t(173)]()})}),this[t(201)]=!0,this[t(258)]()}[f(235)](){const t=f,r=this[t(247)][t(175)];r[t(198)][t(268)](this[t(261)])&&r[t(215)](this[t(187)],r=>{const e=t;r[e(196)](this[e(261)])}),this[t(261)]=null,this[t(187)]=null,this[t(179)]=null,this[t(201)]=!1,this[t(258)]()}[f(242)]({url:t,file:r,serviceConfig:e}){const n=f,o=this[n(247)][n(199)][n(237)](n(270))[n(271)](),i=new FormData;i[n(210)](n(227),JSON[n(180)](e)),i[n(210)](n(207),r);const s={method:n(209),headers:{},body:i,signal:this[n(179)][n(189)]};return o&&(s[n(222)][n(265)]=o[n(256)]),fetch(t,s)}[f(205)](t){const r=f;return t.ok?t[r(226)]()[r(178)](t=>{const e=r;this[e(247)][e(175)][e(198)][e(268)](this[e(261)])&&e(248)!==this[e(261)][e(229)]()[e(230)][e(181)]&&this[e(243)](e(263),t)}):Promise[r(204)]()}[f(254)](){const t=f;if(this[t(179)][t(189)][t(206)])return void(0,d.logWarning)(t(224));const r=this[t(247)],e=i(r[t(200)],t(197));r[t(199)][t(237)](t(239))[t(241)](e),(0,d.logError)(t(252))}}const I=w;function w(t,r){const e=b();return(w=function(t,r){return e[t-=472]})(t,r)}function b(){const t=["token","init","172075UosOBV","editor","ImportWordEditing","none","CloudServices","isPremiumPlugin","isOfficialPlugin","tokenUrl","pluginName","2sfonNx","796158LhKSis","https://docx-converter.cke-cs.com/v2/convert/docx-html","registerTokenUrl","importWord","2836484RrkcTF","2631356ardxbo","_token","add","commands","requires","1091907uKVNNX","config","getToken","2238147QCewat","define","plugins","get","cloudServices","13172960foTuXD","inline"];return(b=function(){return t})()}!function(t){const r=w,e=t();for(;;)try{if(611071===parseInt(r(502))/1+parseInt(r(491))/2*(parseInt(r(473))/3)+parseInt(r(497))/4+parseInt(r(482))/5+parseInt(r(492))/6+-parseInt(r(496))/7+-parseInt(r(478))/8)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(b);class v extends t.Plugin{[I(498)];static get[I(490)](){return I(484)}static get[I(488)](){return!0}static get[I(487)](){return!0}static get[I(501)](){const t=I;return[o.Notification,p.ClipboardPipeline,t(486)]}constructor(t){const r=I;super(t),this[r(498)]=null}async[I(481)](){const t=I,r=this[t(483)];r[t(503)][t(474)](t(495),{converterUrl:t(493),tokenUrl:(r[t(503)][t(476)](t(477))||{})[t(489)],formatting:{resets:t(485),defaults:t(485),styles:t(479)}}),r[t(500)][t(499)](t(495),new g(r));const{tokenUrl:e}=r[t(503)][t(476)](t(495));if(e){const{tokenUrl:n}=r[t(503)][t(476)](t(477))||{};this[t(498)]=e===n?r[t(475)][t(476)](t(486))[t(480)]:await r[t(475)][t(476)](t(486))[t(494)](e)}}[I(472)](){return this[I(498)]}}var W=y;function y(t,r){var e=x();return(y=function(t,r){return e[t-=277]})(t,r)}function x(){var t=["3vZOHYn","isOfficialPlugin","11oELbId","19063610lEehrr","7124355xOyRsX","997476DPuziw","ImportWord","6288792fIEVYi","requires","3kuQOaR","7012071rtwwPb","isPremiumPlugin","432942FyPCHX","375288mzyORl","pluginName","55wPjhkp"];return(x=function(){return t})()}!function(t){for(var r=y,e=t();;)try{if(607592===-parseInt(r(277))/1*(-parseInt(r(289))/2)+parseInt(r(286))/3*(-parseInt(r(282))/4)+-parseInt(r(292))/5*(parseInt(r(290))/6)+-parseInt(r(281))/7+parseInt(r(284))/8+-parseInt(r(287))/9+parseInt(r(280))/10*(parseInt(r(279))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(x);class k extends t.Plugin{static get[W(291)](){return W(283)}static get[W(278)](){return!0}static get[W(288)](){return!0}static get[W(285)](){return[v,u]}}function P(){var t=["33pMkzWg","170678cwigIq","174562aJdfoF","12439537EYoVnZ","14008QGSQVU","24474NlznHT","13335183aYTpDZ","1030WwIjUs","3505244ifneRy","10OnCXYK","1673bSOAzD"];return(P=function(){return t})()}function O(t,r){var e=P();return(O=function(t,r){return e[t-=108]})(t,r)}!function(t){for(var r=O,e=t();;)try{if(893119===-parseInt(r(117))/1+parseInt(r(118))/2*(parseInt(r(116))/3)+parseInt(r(113))/4+-parseInt(r(112))/5*(parseInt(r(110))/6)+parseInt(r(115))/7*(parseInt(r(109))/8)+-parseInt(r(111))/9+parseInt(r(114))/10*(parseInt(r(108))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(P)})(),(window.CKEditor5=window.CKEditor5||{}).importWord=n})();