@ckeditor/ckeditor5-export-word 0.0.0-nightly-20231107.0 → 0.0.0-nightly-20231108.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-2023, 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=["has","authorId","TrackChanges","from","createdAt",":root","CommentsRepository","indexOf","plugins","keys","cssRules","name","timezone","timeZone","map","comments","then","join","push","all","get","content","length","EDITOR_STYLES","trim","warn","Users","suggestions","isResolved","getCommentThreads","data-cke","cssText"];var i,s;i=r,s=102,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("0x1d")](document.styleSheets))if(o.ownerNode.hasAttribute(c("0x18")))for(const n of Array[c("0x1d")](o[c("0x4")]))-1!==n.cssText[c("0x1")](".ck-content")?t.push(n[c("0x19")]):-1!==n.cssText[c("0x1")](c("0x1f"))&&e[c("0xc")](n[c("0x19")]);return t[c("0x10")]||console[c("0x13")]("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."),[...e,...t].join(" ")[c("0x12")]()}function d(t){const e=t[c("0x2")].has("Users"),o=t[c("0x2")][c("0x1a")](c("0x0")),n=t[c("0x2")][c("0x1a")](c("0x1c")),r={};if(e&&o){const e=function(t){const e={};if(!t.length)return e;for(const o of t)o[c("0x9")][c("0x8")]((t=>{void 0===e[o.id]&&(e[o.id]=[]),e[o.id][c("0xc")]({author:t.author[c("0x5")],content:t[c("0xf")],created:t[c("0x1e")],is_resolved:o[c("0x16")]})}));return e}(t[c("0x2")][c("0xe")]("CommentsRepository")[c("0x17")]({skipNotAttached:!0,skipEmpty:!0}));Object[c("0x3")](e).length&&(r.comments=e)}if(e&&n){const e=t.plugins[c("0xe")]("TrackChanges"),o=t[c("0x2")][c("0xe")](c("0x14")),n=function(t,e){const o={};if(!t.length||!e[c("0x10")])return o;for(const n of t)o[n.id]={author:e[c("0xe")](n[c("0x1b")])[c("0x5")],created:n.createdAt};return o}(e.getSuggestions({toJSON:!0}),o.users);Object[c("0x3")](n)[c("0x10")]&&(r[c("0x15")]=n)}return(r[c("0x15")]||r[c("0x9")])&&(r[c("0x6")]=(new Intl.DateTimeFormat).resolvedOptions()[c("0x7")]),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)c("0x11")!==o?e[c("0xc")](window.fetch(o)[c("0xa")]((t=>t.text()))):e[c("0xc")](a());return Promise[c("0xd")](e).then((t=>t[c("0xb")](" ").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 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=["content","getCommentThreads",":root","all","text","DateTimeFormat","warn","get","suggestions","timezone","data-cke","from","ownerNode","cssRules","CommentsRepository","plugins","comments","Users","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.","author","trim","TrackChanges","getSuggestions","createdAt","users","resolvedOptions",".ck-content","push","cssText","hasAttribute","length","name","then","keys","authorId","timeZone","join"];var i,s;i=r,s=189,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("0x7")](document.styleSheets))if(o[c("0x8")][c("0x19")](c("0x6")))for(const n of Array[c("0x7")](o[c("0x9")]))-1!==n[c("0x18")].indexOf(c("0x16"))?t[c("0x17")](n[c("0x18")]):-1!==n.cssText.indexOf(c("0x23"))&&e.push(n[c("0x18")]);return t.length||console[c("0x2")](c("0xe")),[...e,...t].join(" ")[c("0x10")]()}function d(t){const e=t.plugins.has(c("0xd")),o=t[c("0xb")].has(c("0xa")),n=t[c("0xb")].has(c("0x11")),r={};if(e&&o){const e=function(t){const e={};if(!t.length)return e;for(const o of t)o[c("0xc")].map((t=>{void 0===e[o.id]&&(e[o.id]=[]),e[o.id][c("0x17")]({author:t[c("0xf")][c("0x1b")],content:t[c("0x21")],created:t[c("0x13")],is_resolved:o.isResolved})}));return e}(t[c("0xb")][c("0x3")]("CommentsRepository")[c("0x22")]({skipNotAttached:!0,skipEmpty:!0}));Object.keys(e)[c("0x1a")]&&(r[c("0xc")]=e)}if(e&&n){const e=t[c("0xb")].get(c("0x11")),o=t.plugins[c("0x3")]("Users"),n=function(t,e){const o={};if(!t[c("0x1a")]||!e.length)return o;for(const n of t)o[n.id]={author:e.get(n[c("0x1e")])[c("0x1b")],created:n[c("0x13")]};return o}(e[c("0x12")]({toJSON:!0}),o[c("0x14")]);Object[c("0x1d")](n)[c("0x1a")]&&(r[c("0x4")]=n)}return(r[c("0x4")]||r[c("0xc")])&&(r[c("0x5")]=(new(Intl[c("0x1")]))[c("0x15")]()[c("0x1f")]),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("0x17")](window.fetch(o).then((t=>t[c("0x0")]()))):e[c("0x17")](a());return Promise[c("0x24")](e)[c("0x1c")]((t=>t[c("0x20")](" ")[c("0x10")]()))}(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})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-export-word",
3
- "version": "0.0.0-nightly-20231107.0",
3
+ "version": "0.0.0-nightly-20231108.0",
4
4
  "description": "Export to Word feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "main": "src/index.js",
31
31
  "dependencies": {
32
- "ckeditor5": "0.0.0-nightly-20231107.0"
32
+ "ckeditor5": "0.0.0-nightly-20231108.0"
33
33
  },
34
34
  "license": "SEE LICENSE IN LICENSE.md",
35
35
  "author": "CKSource (https://cksource.com/)",
package/src/exportword.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x158201}from'ckeditor5/src/core';import{ButtonView as _0x35685e,Notification as _0x516fd8,SpinnerView as _0x16d07c}from'ckeditor5/src/ui';import _0x22dc1e from'./exportwordcommand';import _0x12bcc8 from'../theme/icons/exportword.svg';export default class d extends _0x158201{static get['pluginName'](){return'ExportWord';}static get['requires'](){return['CloudServices',_0x516fd8];}['init'](){const _0x53e271=this['editor'],t=_0x53e271['t'],_0x280905=_0x53e271['config']['get']('exportWord')||{};_0x53e271['commands']['add']('exportWord',new _0x22dc1e(_0x53e271)),_0x53e271['ui']['componentFactory']['add']('exportWord',_0x351403=>{const _0x5df148=_0x53e271['commands']['get']('exportWord'),_0x2439ae=new _0x35685e(_0x351403),_0x68a016=new _0x16d07c();return _0x2439ae['set']({'label':t('Export\x20to\x20Word'),'icon':_0x12bcc8,'tooltip':!0x0}),_0x2439ae['children']['add'](_0x68a016),_0x2439ae['bind']('isOn','isEnabled')['to'](_0x5df148,'isBusy','isEnabled'),_0x68a016['bind']('isVisible')['to'](_0x5df148,'isBusy'),_0x2439ae['iconView']['bind']('isVisible')['to'](_0x5df148,'isBusy',_0x2fe100=>!_0x2fe100),this['listenTo'](_0x2439ae,'execute',()=>{_0x53e271['execute']('exportWord',_0x280905),_0x53e271['editing']['view']['focus']();}),_0x2439ae;});const _0x3785bf=_0x53e271['plugins']['get']('CloudServices');!0x1===_0x280905['tokenUrl']?this['_token']=null:_0x280905['tokenUrl']?_0x3785bf['registerTokenUrl'](_0x280905['tokenUrl'])['then'](_0x48a78c=>{this['_token']=_0x48a78c;}):this['_token']=_0x3785bf['token'];}}
23
+ import{Plugin as _0x4d1315}from'ckeditor5/src/core';import{ButtonView as _0x1f1816,Notification as _0x39c807,SpinnerView as _0x40512e}from'ckeditor5/src/ui';import _0x143b76 from'./exportwordcommand';import _0x4cc660 from'../theme/icons/exportword.svg';export default class d extends _0x4d1315{static get['pluginName'](){return'ExportWord';}static get['requires'](){return['CloudServices',_0x39c807];}['init'](){const _0x5acd95=this['editor'],t=_0x5acd95['t'],_0x23d212=_0x5acd95['config']['get']('exportWord')||{};_0x5acd95['commands']['add']('exportWord',new _0x143b76(_0x5acd95)),_0x5acd95['ui']['componentFactory']['add']('exportWord',_0x44d4d8=>{const _0x393882=_0x5acd95['commands']['get']('exportWord'),_0x43a609=new _0x1f1816(_0x44d4d8),_0x232958=new _0x40512e();return _0x43a609['set']({'label':t('Export\x20to\x20Word'),'icon':_0x4cc660,'tooltip':!0x0}),_0x43a609['children']['add'](_0x232958),_0x43a609['bind']('isOn','isEnabled')['to'](_0x393882,'isBusy','isEnabled'),_0x232958['bind']('isVisible')['to'](_0x393882,'isBusy'),_0x43a609['iconView']['bind']('isVisible')['to'](_0x393882,'isBusy',_0x54c995=>!_0x54c995),this['listenTo'](_0x43a609,'execute',()=>{_0x5acd95['execute']('exportWord',_0x23d212),_0x5acd95['editing']['view']['focus']();}),_0x43a609;});const _0x2315bf=_0x5acd95['plugins']['get']('CloudServices');!0x1===_0x23d212['tokenUrl']?this['_token']=null:_0x23d212['tokenUrl']?_0x2315bf['registerTokenUrl'](_0x23d212['tokenUrl'])['then'](_0x4d51d1=>{this['_token']=_0x4d51d1;}):this['_token']=_0x2315bf['token'];}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x5dad3a}from'ckeditor5/src/core';import{getStyles as _0x447afd,getConverterOptions as _0x30bdbd}from'./utils';export default class s extends _0x5dad3a{constructor(_0x345bba){super(_0x345bba),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x193849={}){const _0x305199=this['editor'],t=_0x305199['t'],_0x43d467=_0x193849['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x5165e5=_0x193849['converterOptions']||{},_0x4d88b4=_0x305199['plugins']['get']('ExportWord'),_0x476cff=_0x193849['token']||_0x4d88b4['_token'],_0x1d61d8=!0x1!==_0x5165e5['auto_pagination'],_0x283ee9=_0x193849['dataCallback']||(_0x1da1e3=>_0x1da1e3['data']['get']({'pagination':_0x1d61d8}));return this['isBusy']=!0x0,this['refresh'](),_0x447afd(_0x193849['stylesheets']||['EDITOR_STYLES'])['then'](async _0x3e7230=>{const _0x57b042=await _0x283ee9(_0x305199),_0xa48e4b={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x305199['locale']['contentLanguageDirection']+'\x22>'+_0x57b042+'</div>','css':_0x3e7230,'options':{..._0x5165e5,..._0x30bdbd(_0x305199)}},_0x555a2e={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x476cff?{'Authorization':_0x476cff['value']}:null},'body':JSON['stringify'](_0xa48e4b)};return window['fetch'](_0x43d467,_0x555a2e)['then'](_0x24c578=>{if(0xc8!==_0x24c578['status'])throw _0x24c578;return _0x24c578['blob']();})['then'](_0xc242a0=>{const _0x3488f5='function'==typeof _0x193849['fileName']?_0x193849['fileName']():_0x193849['fileName'];this['_downloadFile'](_0xc242a0,_0x3488f5||'document.docx');});})['catch'](_0x1d6099=>{throw _0x305199['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x1d6099;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x1f3d07,_0x582c12){const _0x47abce=document['createElement']('a');_0x47abce['href']=window['URL']['createObjectURL'](_0x1f3d07),_0x47abce['download']=_0x582c12,_0x47abce['click'](),_0x47abce['remove']();}}
23
+ import{Command as _0x1e0c4b}from'ckeditor5/src/core';import{getStyles as _0x44e11b,getConverterOptions as _0x4f5a9d}from'./utils';export default class s extends _0x1e0c4b{constructor(_0x1bd03c){super(_0x1bd03c),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x4ec9ac={}){const _0x5c269a=this['editor'],t=_0x5c269a['t'],_0x16c3b5=_0x4ec9ac['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x24f8ad=_0x4ec9ac['converterOptions']||{},_0x255ade=_0x5c269a['plugins']['get']('ExportWord'),_0xdf468e=_0x4ec9ac['token']||_0x255ade['_token'],_0x14b120=!0x1!==_0x24f8ad['auto_pagination'],_0x2abca0=_0x4ec9ac['dataCallback']||(_0x5052b7=>_0x5052b7['data']['get']({'pagination':_0x14b120}));return this['isBusy']=!0x0,this['refresh'](),_0x44e11b(_0x4ec9ac['stylesheets']||['EDITOR_STYLES'])['then'](async _0x2bf02e=>{const _0xa63ae9=await _0x2abca0(_0x5c269a),_0x56bf66={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x5c269a['locale']['contentLanguageDirection']+'\x22>'+_0xa63ae9+'</div>','css':_0x2bf02e,'options':{..._0x24f8ad,..._0x4f5a9d(_0x5c269a)}},_0x4d237c={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0xdf468e?{'Authorization':_0xdf468e['value']}:null},'body':JSON['stringify'](_0x56bf66)};return window['fetch'](_0x16c3b5,_0x4d237c)['then'](_0x26cb3d=>{if(0xc8!==_0x26cb3d['status'])throw _0x26cb3d;return _0x26cb3d['blob']();})['then'](_0x37f7ff=>{const _0x149270='function'==typeof _0x4ec9ac['fileName']?_0x4ec9ac['fileName']():_0x4ec9ac['fileName'];this['_downloadFile'](_0x37f7ff,_0x149270||'document.docx');});})['catch'](_0x29ac3f=>{throw _0x5c269a['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x29ac3f;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x4b21f7,_0x68fcde){const _0x59e3b9=document['createElement']('a');_0x59e3b9['href']=window['URL']['createObjectURL'](_0x4b21f7),_0x59e3b9['download']=_0x68fcde,_0x59e3b9['click'](),_0x59e3b9['remove']();}}
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4a3a=['has','authorId','TrackChanges','from','createdAt',':root','CommentsRepository','indexOf','plugins','keys','cssRules','name','timezone','timeZone','map','comments','then','join','push','all','get','content','length','EDITOR_STYLES','trim','warn','Users','suggestions','isResolved','getCommentThreads','data-cke','cssText'];(function(_0x7f53d,_0x4a3a0f){const _0x361561=function(_0x1c5f80){while(--_0x1c5f80){_0x7f53d['push'](_0x7f53d['shift']());}};_0x361561(++_0x4a3a0f);}(_0x4a3a,0x66));const _0x3615=function(_0x7f53d,_0x4a3a0f){_0x7f53d=_0x7f53d-0x0;let _0x361561=_0x4a3a[_0x7f53d];return _0x361561;};export function getStyles(_0x5d7a2f){if(!_0x5d7a2f)return new Promise(_0x3bc27c=>_0x3bc27c(''));const _0x2f6564=[];for(const _0x9a45f1 of _0x5d7a2f)_0x3615('0x11')!==_0x9a45f1?_0x2f6564[_0x3615('0xc')](window['fetch'](_0x9a45f1)[_0x3615('0xa')](_0x302a87=>_0x302a87['text']())):_0x2f6564[_0x3615('0xc')](u());return Promise[_0x3615('0xd')](_0x2f6564)['then'](_0x58afde=>_0x58afde[_0x3615('0xb')]('\x20')['trim']());}function u(){const _0x5a8561=[],_0x2b1d04=[];for(const _0x15b769 of Array[_0x3615('0x1d')](document['styleSheets'])){if(_0x15b769['ownerNode']['hasAttribute'](_0x3615('0x18')))for(const _0x252d40 of Array[_0x3615('0x1d')](_0x15b769[_0x3615('0x4')]))-0x1!==_0x252d40['cssText'][_0x3615('0x1')]('.ck-content')?_0x5a8561['push'](_0x252d40[_0x3615('0x19')]):-0x1!==_0x252d40['cssText'][_0x3615('0x1')](_0x3615('0x1f'))&&_0x2b1d04[_0x3615('0xc')](_0x252d40[_0x3615('0x19')]);}return _0x5a8561[_0x3615('0x10')]||console[_0x3615('0x13')]('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.'),[..._0x2b1d04,..._0x5a8561]['join']('\x20')[_0x3615('0x12')]();}export function getConverterOptions(_0xa65b95){const _0x44aa4c=_0xa65b95[_0x3615('0x2')]['has']('Users'),_0x486f49=_0xa65b95[_0x3615('0x2')][_0x3615('0x1a')](_0x3615('0x0')),_0x117dba=_0xa65b95[_0x3615('0x2')][_0x3615('0x1a')](_0x3615('0x1c')),_0x5e6c9b={};if(_0x44aa4c&&_0x486f49){const _0x393ce6=getComments(_0xa65b95[_0x3615('0x2')][_0x3615('0xe')]('CommentsRepository')[_0x3615('0x17')]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x3615('0x3')](_0x393ce6)['length']&&(_0x5e6c9b['comments']=_0x393ce6);}if(_0x44aa4c&&_0x117dba){const _0x5a329f=_0xa65b95['plugins'][_0x3615('0xe')]('TrackChanges'),_0x2ef8d3=_0xa65b95[_0x3615('0x2')][_0x3615('0xe')](_0x3615('0x14')),_0x199181=getSuggestions(_0x5a329f['getSuggestions']({'toJSON':!0x0}),_0x2ef8d3['users']);Object[_0x3615('0x3')](_0x199181)[_0x3615('0x10')]&&(_0x5e6c9b[_0x3615('0x15')]=_0x199181);}return(_0x5e6c9b[_0x3615('0x15')]||_0x5e6c9b[_0x3615('0x9')])&&(_0x5e6c9b[_0x3615('0x6')]=new Intl['DateTimeFormat']()['resolvedOptions']()[_0x3615('0x7')]),_0x5e6c9b;}export function getComments(_0x63e172){const _0x104ef0={};if(!_0x63e172['length'])return _0x104ef0;for(const _0x255feb of _0x63e172)_0x255feb[_0x3615('0x9')][_0x3615('0x8')](_0x39ce3d=>{void 0x0===_0x104ef0[_0x255feb['id']]&&(_0x104ef0[_0x255feb['id']]=[]),_0x104ef0[_0x255feb['id']][_0x3615('0xc')]({'author':_0x39ce3d['author'][_0x3615('0x5')],'content':_0x39ce3d[_0x3615('0xf')],'created':_0x39ce3d[_0x3615('0x1e')],'is_resolved':_0x255feb[_0x3615('0x16')]});});return _0x104ef0;}export function getSuggestions(_0x2647af,_0x2e0a23){const _0x217cf3={};if(!_0x2647af['length']||!_0x2e0a23[_0x3615('0x10')])return _0x217cf3;for(const _0x2a037e of _0x2647af)_0x217cf3[_0x2a037e['id']]={'author':_0x2e0a23[_0x3615('0xe')](_0x2a037e[_0x3615('0x1b')])[_0x3615('0x5')],'created':_0x2a037e['createdAt']};return _0x217cf3;}
23
+ const _0x5981=['content','getCommentThreads',':root','all','text','DateTimeFormat','warn','get','suggestions','timezone','data-cke','from','ownerNode','cssRules','CommentsRepository','plugins','comments','Users','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.','author','trim','TrackChanges','getSuggestions','createdAt','users','resolvedOptions','.ck-content','push','cssText','hasAttribute','length','name','then','keys','authorId','timeZone','join'];(function(_0x155e49,_0x5981ad){const _0x3b9f4a=function(_0x2d61e1){while(--_0x2d61e1){_0x155e49['push'](_0x155e49['shift']());}};_0x3b9f4a(++_0x5981ad);}(_0x5981,0xbd));const _0x3b9f=function(_0x155e49,_0x5981ad){_0x155e49=_0x155e49-0x0;let _0x3b9f4a=_0x5981[_0x155e49];return _0x3b9f4a;};export function getStyles(_0x314592){if(!_0x314592)return new Promise(_0x100a60=>_0x100a60(''));const _0x24476f=[];for(const _0x1859b9 of _0x314592)'EDITOR_STYLES'!==_0x1859b9?_0x24476f[_0x3b9f('0x17')](window['fetch'](_0x1859b9)['then'](_0x418635=>_0x418635[_0x3b9f('0x0')]())):_0x24476f[_0x3b9f('0x17')](u());return Promise[_0x3b9f('0x24')](_0x24476f)[_0x3b9f('0x1c')](_0x5ef0c6=>_0x5ef0c6[_0x3b9f('0x20')]('\x20')[_0x3b9f('0x10')]());}function u(){const _0x3d7d71=[],_0x5b32e9=[];for(const _0x4166e4 of Array[_0x3b9f('0x7')](document['styleSheets'])){if(_0x4166e4[_0x3b9f('0x8')][_0x3b9f('0x19')](_0x3b9f('0x6')))for(const _0x5bbfff of Array[_0x3b9f('0x7')](_0x4166e4[_0x3b9f('0x9')]))-0x1!==_0x5bbfff[_0x3b9f('0x18')]['indexOf'](_0x3b9f('0x16'))?_0x3d7d71[_0x3b9f('0x17')](_0x5bbfff[_0x3b9f('0x18')]):-0x1!==_0x5bbfff['cssText']['indexOf'](_0x3b9f('0x23'))&&_0x5b32e9['push'](_0x5bbfff[_0x3b9f('0x18')]);}return _0x3d7d71['length']||console[_0x3b9f('0x2')](_0x3b9f('0xe')),[..._0x5b32e9,..._0x3d7d71]['join']('\x20')[_0x3b9f('0x10')]();}export function getConverterOptions(_0x3c4e88){const _0x343786=_0x3c4e88['plugins']['has'](_0x3b9f('0xd')),_0x1abaca=_0x3c4e88[_0x3b9f('0xb')]['has'](_0x3b9f('0xa')),_0x21dbfd=_0x3c4e88[_0x3b9f('0xb')]['has'](_0x3b9f('0x11')),_0x19f360={};if(_0x343786&&_0x1abaca){const _0x2a7e80=getComments(_0x3c4e88[_0x3b9f('0xb')][_0x3b9f('0x3')]('CommentsRepository')[_0x3b9f('0x22')]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object['keys'](_0x2a7e80)[_0x3b9f('0x1a')]&&(_0x19f360[_0x3b9f('0xc')]=_0x2a7e80);}if(_0x343786&&_0x21dbfd){const _0x1f4a1b=_0x3c4e88[_0x3b9f('0xb')]['get'](_0x3b9f('0x11')),_0x3243ab=_0x3c4e88['plugins'][_0x3b9f('0x3')]('Users'),_0x5ddb28=getSuggestions(_0x1f4a1b[_0x3b9f('0x12')]({'toJSON':!0x0}),_0x3243ab[_0x3b9f('0x14')]);Object[_0x3b9f('0x1d')](_0x5ddb28)[_0x3b9f('0x1a')]&&(_0x19f360[_0x3b9f('0x4')]=_0x5ddb28);}return(_0x19f360[_0x3b9f('0x4')]||_0x19f360[_0x3b9f('0xc')])&&(_0x19f360[_0x3b9f('0x5')]=new Intl[(_0x3b9f('0x1'))]()[_0x3b9f('0x15')]()[_0x3b9f('0x1f')]),_0x19f360;}export function getComments(_0x30f261){const _0x313ee1={};if(!_0x30f261['length'])return _0x313ee1;for(const _0x45bda8 of _0x30f261)_0x45bda8[_0x3b9f('0xc')]['map'](_0x4e4c70=>{void 0x0===_0x313ee1[_0x45bda8['id']]&&(_0x313ee1[_0x45bda8['id']]=[]),_0x313ee1[_0x45bda8['id']][_0x3b9f('0x17')]({'author':_0x4e4c70[_0x3b9f('0xf')][_0x3b9f('0x1b')],'content':_0x4e4c70[_0x3b9f('0x21')],'created':_0x4e4c70[_0x3b9f('0x13')],'is_resolved':_0x45bda8['isResolved']});});return _0x313ee1;}export function getSuggestions(_0x39d8aa,_0x4f4d1f){const _0x1d1b19={};if(!_0x39d8aa[_0x3b9f('0x1a')]||!_0x4f4d1f['length'])return _0x1d1b19;for(const _0x4a9c80 of _0x39d8aa)_0x1d1b19[_0x4a9c80['id']]={'author':_0x4f4d1f['get'](_0x4a9c80[_0x3b9f('0x1e')])[_0x3b9f('0x1b')],'created':_0x4a9c80[_0x3b9f('0x13')]};return _0x1d1b19;}