@ckeditor/ckeditor5-import-word 41.3.1 → 41.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/import-word.js +1 -1
- package/package.json +2 -2
- package/src/importword.js +1 -1
- package/src/importwordcommand.js +1 -1
- package/src/importwordediting.js +1 -1
- package/src/importwordui.js +1 -1
- package/src/index.js +1 -1
package/build/import-word.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
|
-
*/(()=>{var t={331:(t,e,r)=>{t.exports=r(237)("./src/clipboard.js")},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},783:(t,e,r)=>{t.exports=r(237)("./src/engine.js")},311:(t,e,r)=>{t.exports=r(237)("./src/ui.js")},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};(()=>{"use strict";r.r(o),r.d(o,{ImportWord:()=>g,ImportWordEditing:()=>u,ImportWordUI:()=>n});var t=r(782),e=r(311);class n extends t.Plugin{static get pluginName(){return"ImportWordUI"}init(){const t=this.editor;t.ui.componentFactory.add("importWord",(()=>{const r=this._createButton(e.FileDialogButtonView),o=t.commands.get("importWord");return r.bind("isOn").to(o,"isBusy"),r.tooltip=!0,r})),t.ui.componentFactory.add("menuBar:importWord",(()=>this._createButton(e.MenuBarMenuListItemFileDialogButtonView)))}_createButton(t){const r=this.editor,o=r.locale.t,n=r.commands.get("importWord"),i=new t(r.locale),s=new e.SpinnerView;return i.set({acceptedType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template"}),i.set({label:o("Import from Word"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14 0 5 4.5v8.892l-1.5-1.8V6.5h-5v-5h-8v3H3V0h11Zm0 2v3h3.3L14 2Z"/><path d="M10.74 18a2.76 2.76 0 0 1-.469-.5H3V19h9.25v-.374A2.737 2.737 0 0 1 10.74 18Z"/><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.602.602 0 0 0 1.032 0l.043-.09 1.554-4 .028-.093a.6.6 0 0 0-1.104-.43v.001ZM11.674 15.407a.75.75 0 1 0 1.152.96L14 14.96V20h1.5v-5.04l1.174 1.408a.75.75 0 1 0 1.152-.96l-2.346-2.816a.95.95 0 0 0-1.46 0l-2.346 2.815Z"/></svg>\n'}),i.bind("isEnabled").to(n),s.bind("isVisible").to(n,"isBusy"),i.iconView.bind("isVisible").to(n,"isBusy",(t=>!t)),i.children.add(s),i.on("done",((t,e)=>{r.execute("importWord",e[0],{}),r.editing.view.focus()})),i}}var i=r(331),s=r(783),a=r(584);class c extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this._importMarker=null,this._undoStepBatch=null,this._abortController=null,this.on("dataInsert",((e,r)=>{const o=new DataTransfer;o.setData("text/html",r.html);const n=this._importMarker.getRange();this.editor.model.enqueueChange(this._undoStepBatch,(e=>{this._importMarker.stopListening(),e.setSelection(n),t.editing.view.document.fire("clipboardInput",{dataTransfer:o})}))}),{priority:"low"})}refresh(){this.isEnabled=this._checkEnabled()}execute(t,e={}){if(this.isBusy)return Promise.resolve();const r=this.editor.config.get("importWord"),o={url:r.converterUrl,file:t,serviceConfig:{...e,formatting:r.formatting}};return this._prepareForImport(),this._sendImportRequest(o).then(this._handleImportResponse.bind(this)).catch(this._handleImportFailure.bind(this)).finally(this._cleanUpAfterImport.bind(this))}_checkEnabled(){if(this.isBusy)return!1;const t=this.editor.model,e=t.schema,r=t.document.selection,o=(0,a.first)(r.getSelectedBlocks());return!!o&&e.checkChild(o.parent,"paragraph")}_prepareForImport(){const t=this.editor,e=t.model,r=e.document.selection;this._abortController=new AbortController,this._undoStepBatch=t.model.createBatch({isUndoable:!0}),e.enqueueChange(this._undoStepBatch,(t=>{r.isCollapsed||e.deleteContent(r,{leaveUnmerged:!0});const o=r.getFirstPosition(),n=(0,a.first)(r.getSelectedBlocks());let i;i=n.is("element","paragraph")&&n.isEmpty?o:o.isAtStart?e.createPositionBefore(n):o.isAtEnd?e.createPositionAfter(n):t.split(o).position,this._importMarker=t.addMarker("importWord:"+(0,a.uid)(),{usingOperation:!1,affectsData:!1,range:new s.Range(i)}),this._importMarker.on("change:range",(()=>{"$graveyard"===this._importMarker.getRange().root.rootName&&this._abortController.abort()}))})),this.isBusy=!0,this.refresh()}_cleanUpAfterImport(){const t=this.editor.model;t.markers.has(this._importMarker)&&t.enqueueChange(this._undoStepBatch,(t=>{t.removeMarker(this._importMarker)})),this._importMarker=null,this._undoStepBatch=null,this._abortController=null,this.isBusy=!1,this.refresh()}_sendImportRequest({url:t,file:e,serviceConfig:r}){const o=this.editor.plugins.get("ImportWordEditing").getToken(),n=new FormData;n.set("config",JSON.stringify(r)),n.set("file",e);const i={method:"POST",headers:{},body:n,signal:this._abortController.signal};return o&&(i.headers.Authorization=o.value),fetch(t,i)}_handleImportResponse(t){return t.ok?t.json().then((t=>{this.editor.model.markers.has(this._importMarker)&&"$graveyard"!==this._importMarker.getRange().root.rootName&&this.fire("dataInsert",t)})):Promise.reject()}_handleImportFailure(){if(this._abortController.signal.aborted)return void(0,a.logWarning)("import-word-plugin-import-cancelled");const t=this.editor,e=(0,t.t)("An error occurred while importing the Word file.");t.plugins.get("Notification").showWarning(e),(0,a.logError)("import-word-plugin-conversion-failed")}}const l=p;function p(t,e){const r=d();return(p=function(t,e){return r[t-=
|
|
5
|
+
*/(()=>{var t={331:(t,e,r)=>{t.exports=r(237)("./src/clipboard.js")},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},783:(t,e,r)=>{t.exports=r(237)("./src/engine.js")},311:(t,e,r)=>{t.exports=r(237)("./src/ui.js")},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};(()=>{"use strict";r.r(o),r.d(o,{ImportWord:()=>g,ImportWordEditing:()=>u,ImportWordUI:()=>n});var t=r(782),e=r(311);class n extends t.Plugin{static get pluginName(){return"ImportWordUI"}init(){const t=this.editor;t.ui.componentFactory.add("importWord",(()=>{const r=this._createButton(e.FileDialogButtonView),o=t.commands.get("importWord");return r.bind("isOn").to(o,"isBusy"),r.tooltip=!0,r})),t.ui.componentFactory.add("menuBar:importWord",(()=>this._createButton(e.MenuBarMenuListItemFileDialogButtonView)))}_createButton(t){const r=this.editor,o=r.locale.t,n=r.commands.get("importWord"),i=new t(r.locale),s=new e.SpinnerView;return i.set({acceptedType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template"}),i.set({label:o("Import from Word"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14 0 5 4.5v8.892l-1.5-1.8V6.5h-5v-5h-8v3H3V0h11Zm0 2v3h3.3L14 2Z"/><path d="M10.74 18a2.76 2.76 0 0 1-.469-.5H3V19h9.25v-.374A2.737 2.737 0 0 1 10.74 18Z"/><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.602.602 0 0 0 1.032 0l.043-.09 1.554-4 .028-.093a.6.6 0 0 0-1.104-.43v.001ZM11.674 15.407a.75.75 0 1 0 1.152.96L14 14.96V20h1.5v-5.04l1.174 1.408a.75.75 0 1 0 1.152-.96l-2.346-2.816a.95.95 0 0 0-1.46 0l-2.346 2.815Z"/></svg>\n'}),i.bind("isEnabled").to(n),s.bind("isVisible").to(n,"isBusy"),i.iconView.bind("isVisible").to(n,"isBusy",(t=>!t)),i.children.add(s),i.on("done",((t,e)=>{r.execute("importWord",e[0],{}),r.editing.view.focus()})),i}}var i=r(331),s=r(783),a=r(584);class c extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this._importMarker=null,this._undoStepBatch=null,this._abortController=null,this.on("dataInsert",((e,r)=>{const o=new DataTransfer;o.setData("text/html",r.html);const n=this._importMarker.getRange();this.editor.model.enqueueChange(this._undoStepBatch,(e=>{this._importMarker.stopListening(),e.setSelection(n),t.editing.view.document.fire("clipboardInput",{dataTransfer:o})}))}),{priority:"low"})}refresh(){this.isEnabled=this._checkEnabled()}execute(t,e={}){if(this.isBusy)return Promise.resolve();const r=this.editor.config.get("importWord"),o={url:r.converterUrl,file:t,serviceConfig:{...e,formatting:r.formatting}};return this._prepareForImport(),this._sendImportRequest(o).then(this._handleImportResponse.bind(this)).catch(this._handleImportFailure.bind(this)).finally(this._cleanUpAfterImport.bind(this))}_checkEnabled(){if(this.isBusy)return!1;const t=this.editor.model,e=t.schema,r=t.document.selection,o=(0,a.first)(r.getSelectedBlocks());return!!o&&e.checkChild(o.parent,"paragraph")}_prepareForImport(){const t=this.editor,e=t.model,r=e.document.selection;this._abortController=new AbortController,this._undoStepBatch=t.model.createBatch({isUndoable:!0}),e.enqueueChange(this._undoStepBatch,(t=>{r.isCollapsed||e.deleteContent(r,{leaveUnmerged:!0});const o=r.getFirstPosition(),n=(0,a.first)(r.getSelectedBlocks());let i;i=n.is("element","paragraph")&&n.isEmpty?o:o.isAtStart?e.createPositionBefore(n):o.isAtEnd?e.createPositionAfter(n):t.split(o).position,this._importMarker=t.addMarker("importWord:"+(0,a.uid)(),{usingOperation:!1,affectsData:!1,range:new s.Range(i)}),this._importMarker.on("change:range",(()=>{"$graveyard"===this._importMarker.getRange().root.rootName&&this._abortController.abort()}))})),this.isBusy=!0,this.refresh()}_cleanUpAfterImport(){const t=this.editor.model;t.markers.has(this._importMarker)&&t.enqueueChange(this._undoStepBatch,(t=>{t.removeMarker(this._importMarker)})),this._importMarker=null,this._undoStepBatch=null,this._abortController=null,this.isBusy=!1,this.refresh()}_sendImportRequest({url:t,file:e,serviceConfig:r}){const o=this.editor.plugins.get("ImportWordEditing").getToken(),n=new FormData;n.set("config",JSON.stringify(r)),n.set("file",e);const i={method:"POST",headers:{},body:n,signal:this._abortController.signal};return o&&(i.headers.Authorization=o.value),fetch(t,i)}_handleImportResponse(t){return t.ok?t.json().then((t=>{this.editor.model.markers.has(this._importMarker)&&"$graveyard"!==this._importMarker.getRange().root.rootName&&this.fire("dataInsert",t)})):Promise.reject()}_handleImportFailure(){if(this._abortController.signal.aborted)return void(0,a.logWarning)("import-word-plugin-import-cancelled");const t=this.editor,e=(0,t.t)("An error occurred while importing the Word file.");t.plugins.get("Notification").showWarning(e),(0,a.logError)("import-word-plugin-conversion-failed")}}const l=p;function p(t,e){const r=d();return(p=function(t,e){return r[t-=103]})(t,e)}function d(){const t=["importWord","none","token","plugins","commands","editor","requires","https://docx-converter.cke-cs.com/v2/convert/docx-html","config","2763666LOTkVY","1070997HbHNWm","getToken","29337LDtULU","define","1844615lBGLMv","ImportWordEditing","9786308DxSfFh","1408448fjvrnl","355352PialMT","CloudServices","init","add","cloudServices","pluginName","tokenUrl","registerTokenUrl","get","_token","inline"];return(d=function(){return t})()}!function(t){const e=p,r=t();for(;;)try{if(390232===-parseInt(e(112))/1+-parseInt(e(118))/2+-parseInt(e(110))/3+-parseInt(e(117))/4+parseInt(e(114))/5+-parseInt(e(109))/6+parseInt(e(116))/7)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(d);class u extends t.Plugin{static get[l(123)](){return l(115)}static get[l(106)](){const t=l;return[e.Notification,i.ClipboardPipeline,t(119)]}constructor(t){const e=l;super(t),this[e(127)]=null}async[l(120)](){const t=l,e=this[t(105)];e[t(108)][t(113)](t(129),{converterUrl:t(107),tokenUrl:(e[t(108)][t(126)](t(122))||{})[t(124)],formatting:{resets:t(130),defaults:t(130),styles:t(128)}}),e[t(104)][t(121)](t(129),new c(e));const{tokenUrl:r}=e[t(108)][t(126)](t(129));if(r){const{tokenUrl:o}=e[t(108)][t(126)](t(122))||{};this[t(127)]=r===o?e[t(103)][t(126)](t(119))[t(131)]:await e[t(103)][t(126)](t(119))[t(125)](r)}}[l(111)](){return this[l(127)]}}function h(t,e){var r=f();return(h=function(t,e){return r[t-=137]})(t,e)}var m=h;function f(){var t=["6057632QZGZPt","7795872TRlReN","1002916EShSwf","pluginName","4288770guftkN","ImportWord","6927498QGSPFz","1otpTPF","2792344CyuEJJ","requires","1025605TCvXos"];return(f=function(){return t})()}!function(t){for(var e=h,r=t();;)try{if(764303===parseInt(e(144))/1*(-parseInt(e(145))/2)+parseInt(e(141))/3+parseInt(e(139))/4+-parseInt(e(147))/5+-parseInt(e(143))/6+parseInt(e(137))/7+parseInt(e(138))/8)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(f);class g extends t.Plugin{static get[m(140)](){return m(142)}static get[m(146)](){return[u,n]}}function I(t,e){var r=v();return(I=function(t,e){return r[t-=486]})(t,e)}function v(){var t=["1672VJWoMD","1038azPGYE","46178xvxnyG","152IMiyGp","1526392qXIPsf","437250eZAyPx","4189794eQiKNe","371421JgeEbt","184kIMvlL","25045Kbuvps","2830KsXXtP"];return(v=function(){return t})()}!function(t){for(var e=I,r=t();;)try{if(625252===-parseInt(e(488))/1*(-parseInt(e(496))/2)+parseInt(e(490))/3+parseInt(e(489))/4+parseInt(e(494))/5*(-parseInt(e(486))/6)+parseInt(e(491))/7+-parseInt(e(493))/8*(parseInt(e(492))/9)+parseInt(e(495))/10*(parseInt(e(487))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(v)})(),(window.CKEditor5=window.CKEditor5||{}).importWord=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-import-word",
|
|
3
|
-
"version": "41.3.
|
|
3
|
+
"version": "41.3.2",
|
|
4
4
|
"description": "Import from Word feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"type": "module",
|
|
31
31
|
"main": "src/index.js",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"ckeditor5": "41.3.
|
|
33
|
+
"ckeditor5": "41.3.2"
|
|
34
34
|
},
|
|
35
35
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
36
36
|
"author": "CKSource (https://cksource.com/)",
|
package/src/importword.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
function _0x3640(_0x34b31a,_0x40cef3){var _0x398b0a=_0x398b();return _0x3640=function(_0x364089,_0x4b3415){_0x364089=_0x364089-0x89;var _0x3e5813=_0x398b0a[_0x364089];return _0x3e5813;},_0x3640(_0x34b31a,_0x40cef3);}var _0x43add5=_0x3640;function _0x398b(){var _0x24a2e2=['6057632QZGZPt','7795872TRlReN','1002916EShSwf','pluginName','4288770guftkN','ImportWord','6927498QGSPFz','1otpTPF','2792344CyuEJJ','requires','1025605TCvXos'];_0x398b=function(){return _0x24a2e2;};return _0x398b();}(function(_0x2d593e,_0x4c0383){var _0x2cc6d0=_0x3640,_0x200029=_0x2d593e();while(!![]){try{var _0xf8da9a=parseInt(_0x2cc6d0(0x90))/0x1*(-parseInt(_0x2cc6d0(0x91))/0x2)+parseInt(_0x2cc6d0(0x8d))/0x3+parseInt(_0x2cc6d0(0x8b))/0x4+-parseInt(_0x2cc6d0(0x93))/0x5+-parseInt(_0x2cc6d0(0x8f))/0x6+parseInt(_0x2cc6d0(0x89))/0x7+parseInt(_0x2cc6d0(0x8a))/0x8;if(_0xf8da9a===_0x4c0383)break;else _0x200029['push'](_0x200029['shift']());}catch(_0x3522e5){_0x200029['push'](_0x200029['shift']());}}}(_0x398b,0xba98f));import{Plugin as _0x5ad68c}from'ckeditor5/src/core.js';import _0x3675d5 from'./importwordui.js';import _0x9e9289 from'./importwordediting.js';export default class i extends _0x5ad68c{static get[_0x43add5(0x8c)](){var _0x1725f9=_0x43add5;return _0x1725f9(0x8e);}static get[_0x43add5(0x92)](){return[_0x9e9289,_0x3675d5];}}
|
package/src/importwordcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
23
|
+
import{Command as _0x17981b}from'ckeditor5/src/core.js';import{Range as _0xe8d663}from'ckeditor5/src/engine.js';import{logWarning as _0x65a07f,logError as _0x15f35c,first as _0x37f985,uid as _0x54a0c7}from'ckeditor5/src/utils.js';export default class d extends _0x17981b{constructor(_0x50f56a){super(_0x50f56a),this['set']('isBusy',!0x1),this['_importMarker']=null,this['_undoStepBatch']=null,this['_abortController']=null,this['on']('dataInsert',(_0x4e8888,_0x4a6409)=>{const _0x283a83=new DataTransfer();_0x283a83['setData']('text/html',_0x4a6409['html']);const _0x15a5ba=this['_importMarker']['getRange']();this['editor']['model']['enqueueChange'](this['_undoStepBatch'],_0x265dc7=>{this['_importMarker']['stopListening'](),_0x265dc7['setSelection'](_0x15a5ba),_0x50f56a['editing']['view']['document']['fire']('clipboardInput',{'dataTransfer':_0x283a83});});},{'priority':'low'});}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x865f66,_0x32ed0e={}){if(this['isBusy'])return Promise['resolve']();const _0x392f3f=this['editor']['config']['get']('importWord'),_0x5c21fd={'url':_0x392f3f['converterUrl'],'file':_0x865f66,'serviceConfig':{..._0x32ed0e,'formatting':_0x392f3f['formatting']}};return this['_prepareForImport'](),this['_sendImportRequest'](_0x5c21fd)['then'](this['_handleImportResponse']['bind'](this))['catch'](this['_handleImportFailure']['bind'](this))['finally'](this['_cleanUpAfterImport']['bind'](this));}['_checkEnabled'](){if(this['isBusy'])return!0x1;const _0xd68bf8=this['editor']['model'],_0x2299d9=_0xd68bf8['schema'],_0x1c4d0c=_0xd68bf8['document']['selection'],_0x5efd12=_0x37f985(_0x1c4d0c['getSelectedBlocks']());return!!_0x5efd12&&_0x2299d9['checkChild'](_0x5efd12['parent'],'paragraph');}['_prepareForImport'](){const _0x1dd024=this['editor'],_0x4a617a=_0x1dd024['model'],_0x589728=_0x4a617a['document']['selection'];this['_abortController']=new AbortController(),this['_undoStepBatch']=_0x1dd024['model']['createBatch']({'isUndoable':!0x0}),_0x4a617a['enqueueChange'](this['_undoStepBatch'],_0xe28907=>{_0x589728['isCollapsed']||_0x4a617a['deleteContent'](_0x589728,{'leaveUnmerged':!0x0});const _0x1d3568=_0x589728['getFirstPosition'](),_0x4035e0=_0x37f985(_0x589728['getSelectedBlocks']());let _0x11b084;_0x11b084=_0x4035e0['is']('element','paragraph')&&_0x4035e0['isEmpty']?_0x1d3568:_0x1d3568['isAtStart']?_0x4a617a['createPositionBefore'](_0x4035e0):_0x1d3568['isAtEnd']?_0x4a617a['createPositionAfter'](_0x4035e0):_0xe28907['split'](_0x1d3568)['position'],this['_importMarker']=_0xe28907['addMarker']('importWord:'+_0x54a0c7(),{'usingOperation':!0x1,'affectsData':!0x1,'range':new _0xe8d663(_0x11b084)}),this['_importMarker']['on']('change:range',()=>{'$graveyard'===this['_importMarker']['getRange']()['root']['rootName']&&this['_abortController']['abort']();});}),this['isBusy']=!0x0,this['refresh']();}['_cleanUpAfterImport'](){const _0x196f43=this['editor']['model'];_0x196f43['markers']['has'](this['_importMarker'])&&_0x196f43['enqueueChange'](this['_undoStepBatch'],_0x4ed4fe=>{_0x4ed4fe['removeMarker'](this['_importMarker']);}),this['_importMarker']=null,this['_undoStepBatch']=null,this['_abortController']=null,this['isBusy']=!0x1,this['refresh']();}['_sendImportRequest']({url:_0x3d7ca8,file:_0x1ce0e4,serviceConfig:_0x11daae}){const _0x55195d=this['editor']['plugins']['get']('ImportWordEditing')['getToken'](),_0x3b003d=new FormData();_0x3b003d['set']('config',JSON['stringify'](_0x11daae)),_0x3b003d['set']('file',_0x1ce0e4);const _0x4055a3={'method':'POST','headers':{},'body':_0x3b003d,'signal':this['_abortController']['signal']};return _0x55195d&&(_0x4055a3['headers']['Authorization']=_0x55195d['value']),fetch(_0x3d7ca8,_0x4055a3);}['_handleImportResponse'](_0x35c7cb){return _0x35c7cb['ok']?_0x35c7cb['json']()['then'](_0x3ed7f2=>{if(!this['editor']['model']['markers']['has'](this['_importMarker']))return;'$graveyard'!==this['_importMarker']['getRange']()['root']['rootName']&&this['fire']('dataInsert',_0x3ed7f2);}):Promise['reject']();}['_handleImportFailure'](){if(this['_abortController']['signal']['aborted'])return void _0x65a07f('import-word-plugin-import-cancelled');const _0x344622=this['editor'],_0x3810b2=(0x0,_0x344622['t'])('An\x20error\x20occurred\x20while\x20importing\x20the\x20Word\x20file.');_0x344622['plugins']['get']('Notification')['showWarning'](_0x3810b2),_0x15f35c('import-word-plugin-conversion-failed');}}
|
package/src/importwordediting.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x38ea79=_0x5bac;(function(_0x1307d2,_0x5cd33a){const _0x5e4753=_0x5bac,_0x198694=_0x1307d2();while(!![]){try{const _0x8efd0b=-parseInt(_0x5e4753(0x70))/0x1+-parseInt(_0x5e4753(0x76))/0x2+-parseInt(_0x5e4753(0x6e))/0x3+-parseInt(_0x5e4753(0x75))/0x4+parseInt(_0x5e4753(0x72))/0x5+-parseInt(_0x5e4753(0x6d))/0x6+parseInt(_0x5e4753(0x74))/0x7;if(_0x8efd0b===_0x5cd33a)break;else _0x198694['push'](_0x198694['shift']());}catch(_0x179214){_0x198694['push'](_0x198694['shift']());}}}(_0x4688,0x5f458));import{Plugin as _0x1e62e7}from'ckeditor5/src/core.js';function _0x5bac(_0x3c641a,_0x541e98){const _0x4688ee=_0x4688();return _0x5bac=function(_0x5bac20,_0x4835ee){_0x5bac20=_0x5bac20-0x67;let _0x963445=_0x4688ee[_0x5bac20];return _0x963445;},_0x5bac(_0x3c641a,_0x541e98);}import{Notification as _0x1fab5d}from'ckeditor5/src/ui.js';import{ClipboardPipeline as _0x18d442}from'ckeditor5/src/clipboard.js';function _0x4688(){const _0x508d8f=['importWord','none','token','plugins','commands','editor','requires','https://docx-converter.cke-cs.com/v2/convert/docx-html','config','2763666LOTkVY','1070997HbHNWm','getToken','29337LDtULU','define','1844615lBGLMv','ImportWordEditing','9786308DxSfFh','1408448fjvrnl','355352PialMT','CloudServices','init','add','cloudServices','pluginName','tokenUrl','registerTokenUrl','get','_token','inline'];_0x4688=function(){return _0x508d8f;};return _0x4688();}import _0x246282 from'./importwordcommand.js';export default class e extends _0x1e62e7{static get[_0x38ea79(0x7b)](){const _0x177050=_0x38ea79;return _0x177050(0x73);}static get[_0x38ea79(0x6a)](){const _0x40793f=_0x38ea79;return[_0x1fab5d,_0x18d442,_0x40793f(0x77)];}constructor(_0x3ee438){const _0x1399e3=_0x38ea79;super(_0x3ee438),this[_0x1399e3(0x7f)]=null;}async[_0x38ea79(0x78)](){const _0x5bdb57=_0x38ea79,_0x3a3937=this[_0x5bdb57(0x69)];_0x3a3937[_0x5bdb57(0x6c)][_0x5bdb57(0x71)](_0x5bdb57(0x81),{'converterUrl':_0x5bdb57(0x6b),'tokenUrl':(_0x3a3937[_0x5bdb57(0x6c)][_0x5bdb57(0x7e)](_0x5bdb57(0x7a))||{})[_0x5bdb57(0x7c)],'formatting':{'resets':_0x5bdb57(0x82),'defaults':_0x5bdb57(0x82),'styles':_0x5bdb57(0x80)}}),_0x3a3937[_0x5bdb57(0x68)][_0x5bdb57(0x79)](_0x5bdb57(0x81),new _0x246282(_0x3a3937));const {tokenUrl:_0x322c60}=_0x3a3937[_0x5bdb57(0x6c)][_0x5bdb57(0x7e)](_0x5bdb57(0x81));if(_0x322c60){const {tokenUrl:_0x39807b}=_0x3a3937[_0x5bdb57(0x6c)][_0x5bdb57(0x7e)](_0x5bdb57(0x7a))||{};this[_0x5bdb57(0x7f)]=_0x322c60===_0x39807b?_0x3a3937[_0x5bdb57(0x67)][_0x5bdb57(0x7e)](_0x5bdb57(0x77))[_0x5bdb57(0x83)]:await _0x3a3937[_0x5bdb57(0x67)][_0x5bdb57(0x7e)](_0x5bdb57(0x77))[_0x5bdb57(0x7d)](_0x322c60);}}[_0x38ea79(0x6f)](){const _0x3fa365=_0x38ea79;return this[_0x3fa365(0x7f)];}}
|
package/src/importwordui.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as
|
|
23
|
+
import{Plugin as _0x4bdbe8}from'ckeditor5/src/core.js';import{SpinnerView as _0xad6b70,FileDialogButtonView as _0x55fd4d,MenuBarMenuListItemFileDialogButtonView as _0x516a5b}from'ckeditor5/src/ui.js';import _0x28f572 from'../theme/icons/importword.svg';export default class o extends _0x4bdbe8{static get['pluginName'](){return'ImportWordUI';}['init'](){const _0x2028a1=this['editor'];_0x2028a1['ui']['componentFactory']['add']('importWord',()=>{const _0x4b822a=this['_createButton'](_0x55fd4d),_0x3b6b48=_0x2028a1['commands']['get']('importWord');return _0x4b822a['bind']('isOn')['to'](_0x3b6b48,'isBusy'),_0x4b822a['tooltip']=!0x0,_0x4b822a;}),_0x2028a1['ui']['componentFactory']['add']('menuBar:importWord',()=>this['_createButton'](_0x516a5b));}['_createButton'](_0x2a71b0){const _0x3b388c=this['editor'],t=_0x3b388c['locale']['t'],_0x4d5361=_0x3b388c['commands']['get']('importWord'),_0x32e9be=new _0x2a71b0(_0x3b388c['locale']),_0x484b89=new _0xad6b70();return _0x32e9be['set']({'acceptedType':'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template'}),_0x32e9be['set']({'label':t('Import\x20from\x20Word'),'icon':_0x28f572}),_0x32e9be['bind']('isEnabled')['to'](_0x4d5361),_0x484b89['bind']('isVisible')['to'](_0x4d5361,'isBusy'),_0x32e9be['iconView']['bind']('isVisible')['to'](_0x4d5361,'isBusy',_0x166fa5=>!_0x166fa5),_0x32e9be['children']['add'](_0x484b89),_0x32e9be['on']('done',(_0x4ee10e,_0x117a0e)=>{_0x3b388c['execute']('importWord',_0x117a0e[0x0],{}),_0x3b388c['editing']['view']['focus']();}),_0x32e9be;}}
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(function(
|
|
23
|
+
(function(_0x4851a6,_0xa1ce0f){var _0x367c6c=_0x31c6,_0x3379fc=_0x4851a6();while(!![]){try{var _0x3c9cb6=-parseInt(_0x367c6c(0x1e8))/0x1*(-parseInt(_0x367c6c(0x1f0))/0x2)+parseInt(_0x367c6c(0x1ea))/0x3+parseInt(_0x367c6c(0x1e9))/0x4+parseInt(_0x367c6c(0x1ee))/0x5*(-parseInt(_0x367c6c(0x1e6))/0x6)+parseInt(_0x367c6c(0x1eb))/0x7+-parseInt(_0x367c6c(0x1ed))/0x8*(parseInt(_0x367c6c(0x1ec))/0x9)+parseInt(_0x367c6c(0x1ef))/0xa*(parseInt(_0x367c6c(0x1e7))/0xb);if(_0x3c9cb6===_0xa1ce0f)break;else _0x3379fc['push'](_0x3379fc['shift']());}catch(_0x2dd886){_0x3379fc['push'](_0x3379fc['shift']());}}}(_0x263f,0x98a64));export{default as ImportWord}from'./importword.js';export{default as ImportWordEditing}from'./importwordediting.js';export{default as ImportWordUI}from'./importwordui.js';function _0x31c6(_0x430695,_0x577edd){var _0x263fec=_0x263f();return _0x31c6=function(_0x31c6b3,_0x38955e){_0x31c6b3=_0x31c6b3-0x1e6;var _0x1ca8af=_0x263fec[_0x31c6b3];return _0x1ca8af;},_0x31c6(_0x430695,_0x577edd);}function _0x263f(){var _0x2f7a80=['1672VJWoMD','1038azPGYE','46178xvxnyG','152IMiyGp','1526392qXIPsf','437250eZAyPx','4189794eQiKNe','371421JgeEbt','184kIMvlL','25045Kbuvps','2830KsXXtP'];_0x263f=function(){return _0x2f7a80;};return _0x263f();}import'./augmentation.js';
|