@ckeditor/ckeditor5-export-word 0.0.0-nightly-20240117.0 → 0.0.0-nightly-20240119.0

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.
@@ -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={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,o),i.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{ExportWord:()=>u});var t=o(704),e=o(273);const r=["trim","push","fetch","length","suggestions","hasAttribute","CommentsRepository","data-cke","author","name","Users","users","styleSheets","get","createdAt","comments","warn","DateTimeFormat","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.","plugins","cssText","isResolved","map","authorId","timeZone","ownerNode","getSuggestions","has","keys","from","then","getCommentThreads","resolvedOptions","indexOf","TrackChanges","timezone","join"];var i,s;i=r,s=449,function(t){for(;--t;)i.push(i.shift())}(++s);const c=function(t,e){return r[t-=0]};function a(){const t=[],e=[];for(const o of Array[c("0x18")](document[c("0x7")]))if(o[c("0x14")][c("0x0")](c("0x2")))for(const n of Array[c("0x18")](o.cssRules))-1!==n[c("0xf")][c("0x1c")](".ck-content")?t[c("0x21")](n[c("0xf")]):-1!==n.cssText[c("0x1c")](":root")&&e[c("0x21")](n.cssText);return t[c("0x23")]||console[c("0xb")](c("0xd")),[...e,...t][c("0x1f")](" ")[c("0x20")]()}function d(t){const e=t.plugins[c("0x16")](c("0x5")),o=t.plugins[c("0x16")](c("0x1")),n=t[c("0xe")][c("0x16")]("TrackChanges"),r={};if(e&&o){const e=function(t){const e={};if(!t[c("0x23")])return e;for(const o of t)o.comments[c("0x11")]((t=>{void 0===e[o.id]&&(e[o.id]=[]),e[o.id][c("0x21")]({author:t[c("0x3")][c("0x4")],content:t.content,created:t[c("0x9")],is_resolved:o[c("0x10")]})}));return e}(t[c("0xe")][c("0x8")](c("0x1"))[c("0x1a")]({skipNotAttached:!0,skipEmpty:!0}));Object[c("0x17")](e)[c("0x23")]&&(r[c("0xa")]=e)}if(e&&n){const e=t[c("0xe")][c("0x8")](c("0x1d")),o=t[c("0xe")][c("0x8")](c("0x5")),n=function(t,e){const o={};if(!t.length||!e[c("0x23")])return o;for(const n of t)o[n.id]={author:e[c("0x8")](n[c("0x12")])[c("0x4")],created:n.createdAt};return o}(e[c("0x15")]({toJSON:!0}),o[c("0x6")]);Object[c("0x17")](n)[c("0x23")]&&(r[c("0x24")]=n)}return(r.suggestions||r[c("0xa")])&&(r[c("0x1e")]=(new(Intl[c("0xc")]))[c("0x1b")]()[c("0x13")]),r}class l extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,o=e.t,n=t.converterUrl||"https://docx-converter.cke-cs.com/v1/convert",r=t.converterOptions||{},i=e.plugins.get("ExportWord"),s=t.token||i._token,l=!1!==r.auto_pagination,u=t.dataCallback||(t=>t.data.get({pagination:l}));return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const o of t)"EDITOR_STYLES"!==o?e[c("0x21")](window[c("0x22")](o)[c("0x19")]((t=>t.text()))):e[c("0x21")](a());return Promise.all(e)[c("0x19")]((t=>t.join(" ").trim()))}(t.stylesheets||["EDITOR_STYLES"]).then((async o=>{const i=await u(e),c={html:'<div class="ck-content" dir="'+e.locale.contentLanguageDirection+'">'+i+"</div>",css:o,options:{...r,...d(e)}},a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/docx",...s?{Authorization:s.value}:null},body:JSON.stringify(c)};return window.fetch(n,a).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const o="function"==typeof t.fileName?t.fileName():t.fileName;this._downloadFile(e,o||"document.docx")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(o("An error occurred while generating the Word file.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}_downloadFile(t,e){const o=document.createElement("a");o.href=window.URL.createObjectURL(t),o.download=e,o.click(),o.remove()}}class u extends t.Plugin{static get pluginName(){return"ExportWord"}static get requires(){return["CloudServices",e.Notification]}init(){const t=this.editor,o=t.t,n=t.config.get("exportWord")||{};t.commands.add("exportWord",new l(t)),t.ui.componentFactory.add("exportWord",(r=>{const i=t.commands.get("exportWord"),s=new e.ButtonView(r),c=new e.SpinnerView;return s.set({label:o("Export to Word"),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',tooltip:!0}),s.children.add(c),s.bind("isOn","isEnabled").to(i,"isBusy","isEnabled"),c.bind("isVisible").to(i,"isBusy"),s.iconView.bind("isVisible").to(i,"isBusy",(t=>!t)),this.listenTo(s,"execute",(()=>{t.execute("exportWord",n),t.editing.view.focus()})),s}));const r=t.plugins.get("CloudServices");!1===n.tokenUrl?this._token=null:n.tokenUrl?r.registerTokenUrl(n.tokenUrl).then((t=>{this._token=t})):this._token=r.token}}})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=n})();
5
+ */(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,o),s.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{ExportWord:()=>u});var t=o(704),e=o(273);const r=["plugins","users","comments","fetch","isResolved",".ck-content","length","map","content","CommentsRepository","getSuggestions","The editor stylesheet could not be found in the document. Check your webpack config – style-loader should use data-cke=true attribute for the editor stylesheet.","suggestions","name","trim","all","get","then",":root","push","join","authorId","warn","createdAt","keys","from","has","cssText","EDITOR_STYLES","indexOf","text","hasAttribute"];var s,i;s=r,i=158,function(t){for(;--t;)s.push(s.shift())}(++i);const c=function(t,e){return r[t-=0]};function a(){const t=[],e=[];for(const o of Array[c("0x1b")](document.styleSheets))if(o.ownerNode[c("0x1")]("data-cke"))for(const n of Array[c("0x1b")](o.cssRules))-1!==n[c("0x1d")][c("0x1f")](c("0x7"))?t[c("0x15")](n.cssText):-1!==n.cssText[c("0x1f")](c("0x14"))&&e.push(n[c("0x1d")]);return t[c("0x8")]||console[c("0x18")](c("0xd")),[...e,...t].join(" ")[c("0x10")]()}function d(t){const e=t[c("0x2")][c("0x1c")]("Users"),o=t[c("0x2")].has(c("0xb")),n=t[c("0x2")][c("0x1c")]("TrackChanges"),r={};if(e&&o){const e=function(t){const e={};if(!t[c("0x8")])return e;for(const o of t)o[c("0x4")][c("0x9")]((t=>{void 0===e[o.id]&&(e[o.id]=[]),e[o.id].push({author:t.author.name,content:t[c("0xa")],created:t[c("0x19")],is_resolved:o[c("0x6")]})}));return e}(t[c("0x2")].get(c("0xb")).getCommentThreads({skipNotAttached:!0,skipEmpty:!0}));Object[c("0x1a")](e)[c("0x8")]&&(r.comments=e)}if(e&&n){const e=t[c("0x2")][c("0x12")]("TrackChanges"),o=t[c("0x2")].get("Users"),n=function(t,e){const o={};if(!t[c("0x8")]||!e[c("0x8")])return o;for(const n of t)o[n.id]={author:e.get(n[c("0x17")])[c("0xf")],created:n.createdAt};return o}(e[c("0xc")]({toJSON:!0}),o[c("0x3")]);Object.keys(n)[c("0x8")]&&(r[c("0xe")]=n)}return(r[c("0xe")]||r[c("0x4")])&&(r.timezone=(new Intl.DateTimeFormat).resolvedOptions().timeZone),r}class l extends t.Command{constructor(t){super(t),this.set("isBusy",!1),this.affectsData=!1}refresh(){this.isEnabled=!this.isBusy,this.value=this.isBusy?"pending":void 0}execute(t={}){const e=this.editor,o=e.t,n=t.converterUrl||"https://docx-converter.cke-cs.com/v1/convert",r=t.converterOptions||{},s=e.plugins.get("ExportWord"),i=t.token||s._token,l=!1!==r.auto_pagination,u=t.dataCallback||(t=>t.data.get({pagination:l}));return this.isBusy=!0,this.refresh(),function(t){if(!t)return new Promise((t=>t("")));const e=[];for(const o of t)c("0x1e")!==o?e[c("0x15")](window[c("0x5")](o)[c("0x13")]((t=>t[c("0x0")]()))):e[c("0x15")](a());return Promise[c("0x11")](e).then((t=>t[c("0x16")](" ")[c("0x10")]()))}(t.stylesheets||["EDITOR_STYLES"]).then((async o=>{const s=await u(e),c={html:'<div class="ck-content" dir="'+e.locale.contentLanguageDirection+'">'+s+"</div>",css:o,options:{...r,...d(e)}},a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/docx",...i?{Authorization:i.value}:null},body:JSON.stringify(c)};return window.fetch(n,a).then((t=>{if(200!==t.status)throw t;return t.blob()})).then((e=>{const o="function"==typeof t.fileName?t.fileName():t.fileName;this._downloadFile(e,o||"document.docx")}))})).catch((t=>{throw e.plugins.get("Notification").showWarning(o("An error occurred while generating the Word file.")),t})).finally((()=>{this.isBusy=!1,this.refresh()}))}_downloadFile(t,e){const o=document.createElement("a");o.href=window.URL.createObjectURL(t),o.download=e,o.click(),o.remove()}}class u extends t.Plugin{static get pluginName(){return"ExportWord"}static get requires(){return["CloudServices",e.Notification]}init(){const t=this.editor,o=t.t,n=t.config.get("exportWord")||{};t.commands.add("exportWord",new l(t)),t.ui.componentFactory.add("exportWord",(r=>{const s=t.commands.get("exportWord"),i=new e.ButtonView(r),c=new e.SpinnerView;return i.set({label:o("Export to Word"),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',tooltip:!0}),i.children.add(c),i.bind("isOn","isEnabled").to(s,"isBusy","isEnabled"),c.bind("isVisible").to(s,"isBusy"),i.iconView.bind("isVisible").to(s,"isBusy",(t=>!t)),this.listenTo(i,"execute",(()=>{t.execute("exportWord",n),t.editing.view.focus()})),i}));const r=t.plugins.get("CloudServices");!1===n.tokenUrl?this._token=null:n.tokenUrl?r.registerTokenUrl(n.tokenUrl).then((t=>{this._token=t})):this._token=r.token}}})(),(window.CKEditor5=window.CKEditor5||{}).exportWord=n})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-export-word",
3
- "version": "0.0.0-nightly-20240117.0",
3
+ "version": "0.0.0-nightly-20240119.0",
4
4
  "description": "Export to 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": "0.0.0-nightly-20240117.0"
33
+ "ckeditor5": "0.0.0-nightly-20240119.0"
34
34
  },
35
35
  "license": "SEE LICENSE IN LICENSE.md",
36
36
  "author": "CKSource (https://cksource.com/)",
package/src/exportword.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x49c541}from'ckeditor5/src/core.js';import{ButtonView as _0x334171,Notification as _0x38a751,SpinnerView as _0x35ea07}from'ckeditor5/src/ui.js';import _0xe52597 from'./exportwordcommand.js';import _0x5b6ab7 from'../theme/icons/exportword.svg';export default class d extends _0x49c541{static get['pluginName'](){return'ExportWord';}static get['requires'](){return['CloudServices',_0x38a751];}['init'](){const _0x23411b=this['editor'],t=_0x23411b['t'],_0x1e94be=_0x23411b['config']['get']('exportWord')||{};_0x23411b['commands']['add']('exportWord',new _0xe52597(_0x23411b)),_0x23411b['ui']['componentFactory']['add']('exportWord',_0x2f8ba8=>{const _0x486481=_0x23411b['commands']['get']('exportWord'),_0x4ca2b2=new _0x334171(_0x2f8ba8),_0x46d3d1=new _0x35ea07();return _0x4ca2b2['set']({'label':t('Export\x20to\x20Word'),'icon':_0x5b6ab7,'tooltip':!0x0}),_0x4ca2b2['children']['add'](_0x46d3d1),_0x4ca2b2['bind']('isOn','isEnabled')['to'](_0x486481,'isBusy','isEnabled'),_0x46d3d1['bind']('isVisible')['to'](_0x486481,'isBusy'),_0x4ca2b2['iconView']['bind']('isVisible')['to'](_0x486481,'isBusy',_0x4aa283=>!_0x4aa283),this['listenTo'](_0x4ca2b2,'execute',()=>{_0x23411b['execute']('exportWord',_0x1e94be),_0x23411b['editing']['view']['focus']();}),_0x4ca2b2;});const _0x154945=_0x23411b['plugins']['get']('CloudServices');!0x1===_0x1e94be['tokenUrl']?this['_token']=null:_0x1e94be['tokenUrl']?_0x154945['registerTokenUrl'](_0x1e94be['tokenUrl'])['then'](_0x312323=>{this['_token']=_0x312323;}):this['_token']=_0x154945['token'];}}
23
+ import{Plugin as _0x169e1f}from'ckeditor5/src/core.js';import{ButtonView as _0xc02374,Notification as _0x3ed8e2,SpinnerView as _0x55010f}from'ckeditor5/src/ui.js';import _0x100723 from'./exportwordcommand.js';import _0x3e8041 from'../theme/icons/exportword.svg';export default class d extends _0x169e1f{static get['pluginName'](){return'ExportWord';}static get['requires'](){return['CloudServices',_0x3ed8e2];}['init'](){const _0x18c8cf=this['editor'],t=_0x18c8cf['t'],_0x2101fa=_0x18c8cf['config']['get']('exportWord')||{};_0x18c8cf['commands']['add']('exportWord',new _0x100723(_0x18c8cf)),_0x18c8cf['ui']['componentFactory']['add']('exportWord',_0x2ebcea=>{const _0x3cc04f=_0x18c8cf['commands']['get']('exportWord'),_0x371e6c=new _0xc02374(_0x2ebcea),_0x43eed2=new _0x55010f();return _0x371e6c['set']({'label':t('Export\x20to\x20Word'),'icon':_0x3e8041,'tooltip':!0x0}),_0x371e6c['children']['add'](_0x43eed2),_0x371e6c['bind']('isOn','isEnabled')['to'](_0x3cc04f,'isBusy','isEnabled'),_0x43eed2['bind']('isVisible')['to'](_0x3cc04f,'isBusy'),_0x371e6c['iconView']['bind']('isVisible')['to'](_0x3cc04f,'isBusy',_0x10e8f3=>!_0x10e8f3),this['listenTo'](_0x371e6c,'execute',()=>{_0x18c8cf['execute']('exportWord',_0x2101fa),_0x18c8cf['editing']['view']['focus']();}),_0x371e6c;});const _0x3c9825=_0x18c8cf['plugins']['get']('CloudServices');!0x1===_0x2101fa['tokenUrl']?this['_token']=null:_0x2101fa['tokenUrl']?_0x3c9825['registerTokenUrl'](_0x2101fa['tokenUrl'])['then'](_0x464044=>{this['_token']=_0x464044;}):this['_token']=_0x3c9825['token'];}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x1ebf51}from'ckeditor5/src/core.js';import{getStyles as _0x8ef66d,getConverterOptions as _0x8b7584}from'./utils.js';export default class i extends _0x1ebf51{constructor(_0x30e990){super(_0x30e990),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x222510={}){const _0x132098=this['editor'],t=_0x132098['t'],_0x1a2bc0=_0x222510['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x53a3cd=_0x222510['converterOptions']||{},_0x1ae057=_0x132098['plugins']['get']('ExportWord'),_0x484dd9=_0x222510['token']||_0x1ae057['_token'],_0x54c816=!0x1!==_0x53a3cd['auto_pagination'],_0x49425b=_0x222510['dataCallback']||(_0x1a23c8=>_0x1a23c8['data']['get']({'pagination':_0x54c816}));return this['isBusy']=!0x0,this['refresh'](),_0x8ef66d(_0x222510['stylesheets']||['EDITOR_STYLES'])['then'](async _0xecb87e=>{const _0x118877=await _0x49425b(_0x132098),_0x1f12ec={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x132098['locale']['contentLanguageDirection']+'\x22>'+_0x118877+'</div>','css':_0xecb87e,'options':{..._0x53a3cd,..._0x8b7584(_0x132098)}},_0x2342a4={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x484dd9?{'Authorization':_0x484dd9['value']}:null},'body':JSON['stringify'](_0x1f12ec)};return window['fetch'](_0x1a2bc0,_0x2342a4)['then'](_0x3e277c=>{if(0xc8!==_0x3e277c['status'])throw _0x3e277c;return _0x3e277c['blob']();})['then'](_0x118a93=>{const _0x422399='function'==typeof _0x222510['fileName']?_0x222510['fileName']():_0x222510['fileName'];this['_downloadFile'](_0x118a93,_0x422399||'document.docx');});})['catch'](_0x470b2c=>{throw _0x132098['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x470b2c;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x2a0ef4,_0x5859d7){const _0x438230=document['createElement']('a');_0x438230['href']=window['URL']['createObjectURL'](_0x2a0ef4),_0x438230['download']=_0x5859d7,_0x438230['click'](),_0x438230['remove']();}}
23
+ import{Command as _0x562667}from'ckeditor5/src/core.js';import{getStyles as _0x1e86d8,getConverterOptions as _0x5d52de}from'./utils.js';export default class i extends _0x562667{constructor(_0x4920c3){super(_0x4920c3),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x45a871={}){const _0x20c511=this['editor'],t=_0x20c511['t'],_0x54d76e=_0x45a871['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x55a7e1=_0x45a871['converterOptions']||{},_0x774fde=_0x20c511['plugins']['get']('ExportWord'),_0x18366f=_0x45a871['token']||_0x774fde['_token'],_0xe5df8b=!0x1!==_0x55a7e1['auto_pagination'],_0x204830=_0x45a871['dataCallback']||(_0x33573c=>_0x33573c['data']['get']({'pagination':_0xe5df8b}));return this['isBusy']=!0x0,this['refresh'](),_0x1e86d8(_0x45a871['stylesheets']||['EDITOR_STYLES'])['then'](async _0x4f611e=>{const _0x26cc4a=await _0x204830(_0x20c511),_0x263ea2={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x20c511['locale']['contentLanguageDirection']+'\x22>'+_0x26cc4a+'</div>','css':_0x4f611e,'options':{..._0x55a7e1,..._0x5d52de(_0x20c511)}},_0xd1d529={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x18366f?{'Authorization':_0x18366f['value']}:null},'body':JSON['stringify'](_0x263ea2)};return window['fetch'](_0x54d76e,_0xd1d529)['then'](_0xcca859=>{if(0xc8!==_0xcca859['status'])throw _0xcca859;return _0xcca859['blob']();})['then'](_0x55b60c=>{const _0x582373='function'==typeof _0x45a871['fileName']?_0x45a871['fileName']():_0x45a871['fileName'];this['_downloadFile'](_0x55b60c,_0x582373||'document.docx');});})['catch'](_0x1b2631=>{throw _0x20c511['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x1b2631;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x37d156,_0x11c2bb){const _0x172c61=document['createElement']('a');_0x172c61['href']=window['URL']['createObjectURL'](_0x37d156),_0x172c61['download']=_0x11c2bb,_0x172c61['click'](),_0x172c61['remove']();}}
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2a1d=['trim','push','fetch','length','suggestions','hasAttribute','CommentsRepository','data-cke','author','name','Users','users','styleSheets','get','createdAt','comments','warn','DateTimeFormat','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.','plugins','cssText','isResolved','map','authorId','timeZone','ownerNode','getSuggestions','has','keys','from','then','getCommentThreads','resolvedOptions','indexOf','TrackChanges','timezone','join'];(function(_0x533cad,_0x2a1dc2){const _0x17829b=function(_0x4749ab){while(--_0x4749ab){_0x533cad['push'](_0x533cad['shift']());}};_0x17829b(++_0x2a1dc2);}(_0x2a1d,0x1c1));const _0x1782=function(_0x533cad,_0x2a1dc2){_0x533cad=_0x533cad-0x0;let _0x17829b=_0x2a1d[_0x533cad];return _0x17829b;};export function getStyles(_0x280036){if(!_0x280036)return new Promise(_0x1a6910=>_0x1a6910(''));const _0x5b30e5=[];for(const _0x1698c9 of _0x280036)'EDITOR_STYLES'!==_0x1698c9?_0x5b30e5[_0x1782('0x21')](window[_0x1782('0x22')](_0x1698c9)[_0x1782('0x19')](_0x2a2343=>_0x2a2343['text']())):_0x5b30e5[_0x1782('0x21')](u());return Promise['all'](_0x5b30e5)[_0x1782('0x19')](_0x52a70a=>_0x52a70a['join']('\x20')['trim']());}function u(){const _0x589d15=[],_0x761c3c=[];for(const _0xf3ba62 of Array[_0x1782('0x18')](document[_0x1782('0x7')])){if(_0xf3ba62[_0x1782('0x14')][_0x1782('0x0')](_0x1782('0x2')))for(const _0x3def4d of Array[_0x1782('0x18')](_0xf3ba62['cssRules']))-0x1!==_0x3def4d[_0x1782('0xf')][_0x1782('0x1c')]('.ck-content')?_0x589d15[_0x1782('0x21')](_0x3def4d[_0x1782('0xf')]):-0x1!==_0x3def4d['cssText'][_0x1782('0x1c')](':root')&&_0x761c3c[_0x1782('0x21')](_0x3def4d['cssText']);}return _0x589d15[_0x1782('0x23')]||console[_0x1782('0xb')](_0x1782('0xd')),[..._0x761c3c,..._0x589d15][_0x1782('0x1f')]('\x20')[_0x1782('0x20')]();}export function getConverterOptions(_0x275185){const _0x288501=_0x275185['plugins'][_0x1782('0x16')](_0x1782('0x5')),_0x5ee2ad=_0x275185['plugins'][_0x1782('0x16')](_0x1782('0x1')),_0x5d9828=_0x275185[_0x1782('0xe')][_0x1782('0x16')]('TrackChanges'),_0x37baec={};if(_0x288501&&_0x5ee2ad){const _0x1b99dc=getComments(_0x275185[_0x1782('0xe')][_0x1782('0x8')](_0x1782('0x1'))[_0x1782('0x1a')]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x1782('0x17')](_0x1b99dc)[_0x1782('0x23')]&&(_0x37baec[_0x1782('0xa')]=_0x1b99dc);}if(_0x288501&&_0x5d9828){const _0x2a9857=_0x275185[_0x1782('0xe')][_0x1782('0x8')](_0x1782('0x1d')),_0x1a8a61=_0x275185[_0x1782('0xe')][_0x1782('0x8')](_0x1782('0x5')),_0x334538=getSuggestions(_0x2a9857[_0x1782('0x15')]({'toJSON':!0x0}),_0x1a8a61[_0x1782('0x6')]);Object[_0x1782('0x17')](_0x334538)[_0x1782('0x23')]&&(_0x37baec[_0x1782('0x24')]=_0x334538);}return(_0x37baec['suggestions']||_0x37baec[_0x1782('0xa')])&&(_0x37baec[_0x1782('0x1e')]=new Intl[(_0x1782('0xc'))]()[_0x1782('0x1b')]()[_0x1782('0x13')]),_0x37baec;}export function getComments(_0x30e01d){const _0x333a0b={};if(!_0x30e01d[_0x1782('0x23')])return _0x333a0b;for(const _0x5a3ef2 of _0x30e01d)_0x5a3ef2['comments'][_0x1782('0x11')](_0x45e9ea=>{void 0x0===_0x333a0b[_0x5a3ef2['id']]&&(_0x333a0b[_0x5a3ef2['id']]=[]),_0x333a0b[_0x5a3ef2['id']][_0x1782('0x21')]({'author':_0x45e9ea[_0x1782('0x3')][_0x1782('0x4')],'content':_0x45e9ea['content'],'created':_0x45e9ea[_0x1782('0x9')],'is_resolved':_0x5a3ef2[_0x1782('0x10')]});});return _0x333a0b;}export function getSuggestions(_0x240a93,_0x1943d4){const _0x524ffc={};if(!_0x240a93['length']||!_0x1943d4[_0x1782('0x23')])return _0x524ffc;for(const _0x558e64 of _0x240a93)_0x524ffc[_0x558e64['id']]={'author':_0x1943d4[_0x1782('0x8')](_0x558e64[_0x1782('0x12')])[_0x1782('0x4')],'created':_0x558e64['createdAt']};return _0x524ffc;}
23
+ const _0x1564=['plugins','users','comments','fetch','isResolved','.ck-content','length','map','content','CommentsRepository','getSuggestions','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.','suggestions','name','trim','all','get','then',':root','push','join','authorId','warn','createdAt','keys','from','has','cssText','EDITOR_STYLES','indexOf','text','hasAttribute'];(function(_0xdcf565,_0x156423){const _0x1403d3=function(_0x1fb959){while(--_0x1fb959){_0xdcf565['push'](_0xdcf565['shift']());}};_0x1403d3(++_0x156423);}(_0x1564,0x9e));const _0x1403=function(_0xdcf565,_0x156423){_0xdcf565=_0xdcf565-0x0;let _0x1403d3=_0x1564[_0xdcf565];return _0x1403d3;};export function getStyles(_0x8c0254){if(!_0x8c0254)return new Promise(_0x5c755b=>_0x5c755b(''));const _0x31c782=[];for(const _0x3e6f19 of _0x8c0254)_0x1403('0x1e')!==_0x3e6f19?_0x31c782[_0x1403('0x15')](window[_0x1403('0x5')](_0x3e6f19)[_0x1403('0x13')](_0x5e5cc0=>_0x5e5cc0[_0x1403('0x0')]())):_0x31c782[_0x1403('0x15')](u());return Promise[_0x1403('0x11')](_0x31c782)['then'](_0x206114=>_0x206114[_0x1403('0x16')]('\x20')[_0x1403('0x10')]());}function u(){const _0x6f284a=[],_0x2fc3b3=[];for(const _0x595151 of Array[_0x1403('0x1b')](document['styleSheets'])){if(_0x595151['ownerNode'][_0x1403('0x1')]('data-cke'))for(const _0x5d7e37 of Array[_0x1403('0x1b')](_0x595151['cssRules']))-0x1!==_0x5d7e37[_0x1403('0x1d')][_0x1403('0x1f')](_0x1403('0x7'))?_0x6f284a[_0x1403('0x15')](_0x5d7e37['cssText']):-0x1!==_0x5d7e37['cssText'][_0x1403('0x1f')](_0x1403('0x14'))&&_0x2fc3b3['push'](_0x5d7e37[_0x1403('0x1d')]);}return _0x6f284a[_0x1403('0x8')]||console[_0x1403('0x18')](_0x1403('0xd')),[..._0x2fc3b3,..._0x6f284a]['join']('\x20')[_0x1403('0x10')]();}export function getConverterOptions(_0x3283ba){const _0x10fa97=_0x3283ba[_0x1403('0x2')][_0x1403('0x1c')]('Users'),_0x252789=_0x3283ba[_0x1403('0x2')]['has'](_0x1403('0xb')),_0x2ec2c0=_0x3283ba[_0x1403('0x2')][_0x1403('0x1c')]('TrackChanges'),_0x18920e={};if(_0x10fa97&&_0x252789){const _0x326bd5=getComments(_0x3283ba[_0x1403('0x2')]['get'](_0x1403('0xb'))['getCommentThreads']({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x1403('0x1a')](_0x326bd5)[_0x1403('0x8')]&&(_0x18920e['comments']=_0x326bd5);}if(_0x10fa97&&_0x2ec2c0){const _0x1c835a=_0x3283ba[_0x1403('0x2')][_0x1403('0x12')]('TrackChanges'),_0x47e233=_0x3283ba[_0x1403('0x2')]['get']('Users'),_0xf2072d=getSuggestions(_0x1c835a[_0x1403('0xc')]({'toJSON':!0x0}),_0x47e233[_0x1403('0x3')]);Object['keys'](_0xf2072d)[_0x1403('0x8')]&&(_0x18920e[_0x1403('0xe')]=_0xf2072d);}return(_0x18920e[_0x1403('0xe')]||_0x18920e[_0x1403('0x4')])&&(_0x18920e['timezone']=new Intl['DateTimeFormat']()['resolvedOptions']()['timeZone']),_0x18920e;}export function getComments(_0x59364b){const _0x552479={};if(!_0x59364b[_0x1403('0x8')])return _0x552479;for(const _0xd916ac of _0x59364b)_0xd916ac[_0x1403('0x4')][_0x1403('0x9')](_0x100acb=>{void 0x0===_0x552479[_0xd916ac['id']]&&(_0x552479[_0xd916ac['id']]=[]),_0x552479[_0xd916ac['id']]['push']({'author':_0x100acb['author']['name'],'content':_0x100acb[_0x1403('0xa')],'created':_0x100acb[_0x1403('0x19')],'is_resolved':_0xd916ac[_0x1403('0x6')]});});return _0x552479;}export function getSuggestions(_0x2ddf9a,_0x375ee6){const _0x28fbba={};if(!_0x2ddf9a[_0x1403('0x8')]||!_0x375ee6[_0x1403('0x8')])return _0x28fbba;for(const _0x51f6d4 of _0x2ddf9a)_0x28fbba[_0x51f6d4['id']]={'author':_0x375ee6['get'](_0x51f6d4[_0x1403('0x17')])[_0x1403('0xf')],'created':_0x51f6d4['createdAt']};return _0x28fbba;}