@ckeditor/ckeditor5-export-word 29.1.0 → 31.1.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.
- package/package.json +3 -2
- package/src/exportword.js +1 -1
- package/src/exportwordcommand.js +1 -1
- package/src/index.js +1 -1
- package/src/utils.js +1 -1
- package/theme/icons/exportword.svg +1 -1
- package/CHANGELOG.md +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-export-word",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.1.0",
|
|
4
4
|
"description": "Export to Word feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"@ckeditor/ckeditor5-collaboration-core": ">=25.0.0",
|
|
40
40
|
"@ckeditor/ckeditor5-comments": ">=25.0.0",
|
|
41
41
|
"@ckeditor/ckeditor5-core": ">=25.0.0",
|
|
42
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
42
|
+
"@ckeditor/ckeditor5-dev-utils": "^26.0.0",
|
|
43
|
+
"@ckeditor/ckeditor5-easy-image": ">=25.0.0",
|
|
43
44
|
"@ckeditor/ckeditor5-editor-decoupled": ">=25.0.0",
|
|
44
45
|
"@ckeditor/ckeditor5-font": ">=25.0.0",
|
|
45
46
|
"@ckeditor/ckeditor5-heading": ">=25.0.0",
|
package/src/exportword.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as
|
|
23
|
+
import{Plugin as _0x2486a8}from'ckeditor5/src/core';import{ButtonView as _0x24e31f,View as _0x12fdc1,Notification as _0x38d510}from'ckeditor5/src/ui';import _0x49e817 from'./exportwordcommand';import _0x2c6463 from'../theme/icons/exportword.svg';import'../theme/exportword.css';export default class c extends _0x2486a8{static get['pluginName'](){return'ExportWord';}static get['requires'](){return['CloudServices',_0x38d510];}['init'](){const _0x149be1=this['editor'],t=_0x149be1['t'],_0x3d4de4=_0x149be1['config']['get']('exportWord')||{};_0x149be1['commands']['add']('exportWord',new _0x49e817(_0x149be1)),_0x149be1['ui']['componentFactory']['add']('exportWord',_0x34634c=>{const _0x5a9706=_0x149be1['commands']['get']('exportWord'),_0x428e62=new _0x24e31f(_0x34634c);_0x428e62['set']({'label':t('Export\x20to\x20Word'),'icon':_0x2c6463,'tooltip':!0x0}),_0x428e62['bind']('isOn','isEnabled')['to'](_0x5a9706,'isBusy','isEnabled'),_0x428e62['extendTemplate']({'attributes':{'class':[_0x428e62['bindTemplate']['if']('isOn','ck-exportword_status-pending')]}});const _0x457c6a=new _0x12fdc1();return _0x457c6a['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportword__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportword__spinner']}}]}),_0x428e62['children']['add'](_0x457c6a),this['listenTo'](_0x428e62,'execute',()=>{_0x149be1['execute']('exportWord',_0x3d4de4),_0x149be1['editing']['view']['focus']();}),_0x428e62;});const _0x31288b=_0x149be1['plugins']['get']('CloudServices');if(!0x1===_0x3d4de4['tokenUrl'])this['_token']=null;else{if(_0x3d4de4['tokenUrl'])return _0x31288b['registerTokenUrl'](_0x3d4de4['tokenUrl'])['then'](_0x44cc35=>{this['_token']=_0x44cc35;});this['_token']=_0x31288b['token'];}}}
|
package/src/exportwordcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
23
|
+
import{Command as _0x3be862}from'ckeditor5/src/core';import{getStyles as _0x52ae66,getConverterOptions as _0x5cb895}from'./utils';export default class i extends _0x3be862{constructor(_0x323573){super(_0x323573),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x35e3dc={}){const _0x595f01=this['editor'],t=_0x595f01['t'],_0x17d4d7=_0x35e3dc['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x3ab908=_0x35e3dc['converterOptions']||{},_0x527a04=_0x595f01['plugins']['get']('ExportWord'),_0xa49c8=_0x35e3dc['token']||_0x527a04['_token'],_0x1a825d=!0x1!==_0x3ab908['auto_pagination'],_0x30276d=_0x35e3dc['dataCallback']||(_0x91042e=>_0x91042e['getData']({'pagination':_0x1a825d}));return this['isBusy']=!0x0,this['refresh'](),_0x52ae66(_0x35e3dc['stylesheets']||['EDITOR_STYLES'])['then'](_0x45de5c=>{const _0x23ecc9=_0x30276d(_0x595f01),_0xac22dd={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x595f01['locale']['contentLanguageDirection']+'\x22>'+_0x23ecc9+'</div>','css':_0x45de5c,'options':{..._0x3ab908,..._0x5cb895(_0x595f01)}},_0x2a28b3={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0xa49c8?{'Authorization':_0xa49c8['value']}:null},'body':JSON['stringify'](_0xac22dd)};return window['fetch'](_0x17d4d7,_0x2a28b3)['then'](_0x28efce=>{if(0xc8!==_0x28efce['status'])throw _0x28efce;return _0x28efce['blob']();})['then'](_0x200022=>{this['o'](_0x200022,_0x35e3dc['fileName']||'document.docx');});})['catch'](_0x2d85cf=>{throw _0x595f01['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x2d85cf;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x51d55c,_0x2b62e6){const _0x25f107=document['createElement']('a');_0x25f107['href']=window['URL']['createObjectURL'](_0x51d55c),_0x25f107['download']=_0x2b62e6,_0x25f107['click'](),_0x25f107['remove']();}}
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export{default as ExportWord}
|
|
23
|
+
var _0xff72=['./exportword'];(function(_0x3c1764,_0xff72e1){var _0x5cb3cb=function(_0x1cb16b){while(--_0x1cb16b){_0x3c1764['push'](_0x3c1764['shift']());}};_0x5cb3cb(++_0xff72e1);}(_0xff72,0x73));var _0x5cb3=function(_0x3c1764,_0xff72e1){_0x3c1764=_0x3c1764-0x0;var _0x5cb3cb=_0xff72[_0x3c1764];return _0x5cb3cb;};export{default as ExportWord}from_0x5cb3('0x0');
|
package/src/utils.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x356c=['cssRules','text','timezone','getCommentThreads','styleSheets','map','authorId','suggestions','length','has','keys','fetch','join','all','comments','CommentsRepository','trim','get','ownerNode','plugins','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.','then','users','timeZone','.ck-content','EDITOR_STYLES','hasAttribute','content','indexOf','createdAt','name',':root','cssText','push','Users','getSuggestions'];(function(_0xa6b211,_0x356c55){const _0x2b5c6e=function(_0x405cd3){while(--_0x405cd3){_0xa6b211['push'](_0xa6b211['shift']());}};_0x2b5c6e(++_0x356c55);}(_0x356c,0x8f));const _0x2b5c=function(_0xa6b211,_0x356c55){_0xa6b211=_0xa6b211-0x0;let _0x2b5c6e=_0x356c[_0xa6b211];return _0x2b5c6e;};export function getStyles(_0x351b49){if(!_0x351b49)return new Promise(_0x3f431d=>_0x3f431d(''));const _0x37cd2b=[];for(const _0x3292d0 of _0x351b49)_0x2b5c('0x1a')!==_0x3292d0?_0x37cd2b['push'](window[_0x2b5c('0xc')](_0x3292d0)['then'](_0x32dbee=>_0x32dbee[_0x2b5c('0x2')]())):_0x37cd2b[_0x2b5c('0x22')](u());return Promise[_0x2b5c('0xe')](_0x37cd2b)[_0x2b5c('0x16')](_0x2d856f=>_0x2d856f[_0x2b5c('0xd')]('\x20')[_0x2b5c('0x11')]());}function u(){const _0x24057b=[],_0xa530bb=[];for(const _0x2949e8 of document[_0x2b5c('0x5')])if(_0x2949e8[_0x2b5c('0x13')][_0x2b5c('0x1b')]('data-cke'))for(const _0x242e4e of _0x2949e8[_0x2b5c('0x1')])-0x1!==_0x242e4e['cssText']['indexOf'](_0x2b5c('0x19'))?_0x24057b['push'](_0x242e4e[_0x2b5c('0x21')]):-0x1!==_0x242e4e[_0x2b5c('0x21')][_0x2b5c('0x1d')](_0x2b5c('0x20'))&&_0xa530bb['push'](_0x242e4e[_0x2b5c('0x21')]);return _0x24057b[_0x2b5c('0x9')]||console['warn'](_0x2b5c('0x15')),[..._0xa530bb,..._0x24057b][_0x2b5c('0xd')]('\x20')['trim']();}export function getConverterOptions(_0x1b8a8b){const _0x4170d7=_0x1b8a8b[_0x2b5c('0x14')][_0x2b5c('0xa')]('Users'),_0x24f4d0=_0x1b8a8b[_0x2b5c('0x14')]['has'](_0x2b5c('0x10')),_0x850172=_0x1b8a8b['plugins'][_0x2b5c('0xa')]('TrackChanges'),_0x42b25e={};if(_0x4170d7&&_0x24f4d0){const _0x1cc4b1=getComments(_0x1b8a8b[_0x2b5c('0x14')][_0x2b5c('0x12')](_0x2b5c('0x10'))[_0x2b5c('0x4')]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x2b5c('0xb')](_0x1cc4b1)['length']&&(_0x42b25e[_0x2b5c('0xf')]=_0x1cc4b1);}if(_0x4170d7&&_0x850172){const _0x2dbf2c=_0x1b8a8b[_0x2b5c('0x14')][_0x2b5c('0x12')]('TrackChanges'),_0x1a2d07=_0x1b8a8b['plugins'][_0x2b5c('0x12')](_0x2b5c('0x23')),_0x5f20ae=getSuggestions(_0x2dbf2c[_0x2b5c('0x0')]({'toJSON':!0x0}),_0x1a2d07[_0x2b5c('0x17')]);Object[_0x2b5c('0xb')](_0x5f20ae)[_0x2b5c('0x9')]&&(_0x42b25e[_0x2b5c('0x8')]=_0x5f20ae);}return(_0x42b25e['suggestions']||_0x42b25e[_0x2b5c('0xf')])&&(_0x42b25e[_0x2b5c('0x3')]=new Intl['DateTimeFormat']()['resolvedOptions']()[_0x2b5c('0x18')]),_0x42b25e;}export function getComments(_0x50a0ed){const _0x528d77={};if(!_0x50a0ed[_0x2b5c('0x9')])return _0x528d77;for(const _0x4dfe04 of _0x50a0ed)_0x4dfe04[_0x2b5c('0xf')][_0x2b5c('0x6')](_0x5c014b=>{void 0x0===_0x528d77[_0x4dfe04['id']]&&(_0x528d77[_0x4dfe04['id']]=[]),_0x528d77[_0x4dfe04['id']]['push']({'author':_0x5c014b['author']['name'],'content':_0x5c014b[_0x2b5c('0x1c')],'created':_0x5c014b[_0x2b5c('0x1e')]});});return _0x528d77;}export function getSuggestions(_0xd059a6,_0x4cc47a){const _0x4e95b1={};if(!_0xd059a6[_0x2b5c('0x9')]||!_0x4cc47a[_0x2b5c('0x9')])return _0x4e95b1;for(const _0x27c100 of _0xd059a6)_0x4e95b1[_0x27c100['id']]={'author':_0x4cc47a['get'](_0x27c100[_0x2b5c('0x7')])[_0x2b5c('0x1f')],'created':_0x27c100[_0x2b5c('0x1e')]};return _0x4e95b1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14 0 5 4.5V20H3v-1.5h14.5v-12h-5v-5h-8v4H3V0h11ZM8.5 7a1.5 1.5 0 0 1 1.493 1.356L10 8.5v7a1.5 1.5 0 0 1-1.356 1.493L8.5 17h-7a1.5 1.5 0 0 1-1.493-1.356L0 15.5v-7a1.5 1.5 0 0 1 1.356-1.493L1.5 7h7ZM7.483 9.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.601.601 0 0 0 1.041-.01l.041-.092.88-2.458.925 2.467.046.096a.601.601 0 0 0 1.032 0l.043-.09 1.554-4 .028-.093a.6.6 0 0 0-1.104-.43ZM14 2v3h3.3L14 2Z"/></svg>
|
package/CHANGELOG.md
DELETED