@ckeditor/ckeditor5-track-changes 39.0.2 → 40.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/LICENSE.md +3 -3
- package/README.md +1 -1
- package/build/track-changes.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +20 -1
- package/lang/translations/ar.po +76 -0
- package/lang/translations/az.po +76 -0
- package/lang/translations/bg.po +76 -0
- package/lang/translations/bn.po +76 -0
- package/lang/translations/ca.po +76 -0
- package/lang/translations/cs.po +76 -0
- package/lang/translations/da.po +76 -0
- package/lang/translations/de.po +76 -0
- package/lang/translations/el.po +76 -0
- package/lang/translations/en-au.po +76 -0
- package/lang/translations/en.po +76 -0
- package/lang/translations/es.po +76 -0
- package/lang/translations/et.po +76 -0
- package/lang/translations/fi.po +76 -0
- package/lang/translations/fr.po +76 -0
- package/lang/translations/gl.po +76 -0
- package/lang/translations/he.po +76 -0
- package/lang/translations/hi.po +76 -0
- package/lang/translations/hr.po +76 -0
- package/lang/translations/hu.po +76 -0
- package/lang/translations/id.po +76 -0
- package/lang/translations/it.po +76 -0
- package/lang/translations/ja.po +76 -0
- package/lang/translations/ko.po +76 -0
- package/lang/translations/lt.po +76 -0
- package/lang/translations/lv.po +76 -0
- package/lang/translations/ms.po +76 -0
- package/lang/translations/nl.po +76 -0
- package/lang/translations/no.po +76 -0
- package/lang/translations/pl.po +76 -0
- package/lang/translations/pt-br.po +94 -18
- package/lang/translations/pt.po +76 -0
- package/lang/translations/ro.po +76 -0
- package/lang/translations/ru.po +76 -0
- package/lang/translations/sk.po +76 -0
- package/lang/translations/sq.po +76 -0
- package/lang/translations/sr-latn.po +76 -0
- package/lang/translations/sr.po +76 -0
- package/lang/translations/sv.po +76 -0
- package/lang/translations/th.po +76 -0
- package/lang/translations/tk.po +76 -0
- package/lang/translations/tr.po +76 -0
- package/lang/translations/tt.po +76 -0
- package/lang/translations/uk.po +76 -0
- package/lang/translations/ur.po +76 -0
- package/lang/translations/vi.po +76 -0
- package/lang/translations/zh-cn.po +76 -0
- package/lang/translations/zh.po +76 -0
- package/package.json +3 -3
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/integrations/aiassistant.d.ts +17 -0
- package/src/integrations/aiassistant.js +23 -0
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +1 -1
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.js +1 -1
- package/src/integrations/formatpainter.js +1 -1
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +0 -6
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/imagestyle.d.ts +17 -0
- package/src/integrations/imagestyle.js +23 -0
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +0 -1
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableofcontents.js +1 -1
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/template.js +1 -1
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +26 -11
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +25 -5
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +5 -69
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +22 -19
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +59 -2
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +1 -1
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.js +1 -1
- package/theme/icons/track-changes-accept.svg +1 -1
- package/theme/icons/track-changes-discard.svg +1 -1
- package/theme/icons/track-changes.svg +1 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x158f=['getFirstPosition','registerDescriptionCallback','change','get','tableBorderStyle','commandParams','getSuggestionCallback','tableBorderWidth','*Format:*\x20change\x20table\x20properties','_handlePropertyChange','findAncestor','handleSuggestionDescription','tableCellVerticalAlignment','_getSuggestion','getAttribute','start','tableCellBorderStyle','getSelectionAffectedTableCells','format','tableCellWidth','plugins','tableCellBorderColor','discard','nodeAfter','tableHeight','tableBorderColor','tableCellBorderWidth','setAttribute','markBlockFormat','subType','enqueueChange','TablePropertiesEditing','table','model','document','getSuggestions','data','editor','formatBlock','_suggestionFactory','tableBackgroundColor','getContainedElement','registerCustomCallback','accept','TrackChangesEditing','tableCellBackgroundColor','tableAlignment','selection','tableCellHeight','handleDiscardAction','tableCellProperties','TrackChangesTableProperties','*Format:*\x20change\x20table\x20cell\x20properties','tableWidth','tableProperties','pluginName','_descriptionFactory','tableCellPadding'];(function(_0x2a9d3d,_0x158f0a){const _0xf30c6b=function(_0xe87d90){while(--_0xe87d90){_0x2a9d3d['push'](_0x2a9d3d['shift']());}};_0xf30c6b(++_0x158f0a);}(_0x158f,0x117));const _0xf30c=function(_0x2a9d3d,_0x158f0a){_0x2a9d3d=_0x2a9d3d-0x0;let _0xf30c6b=_0x158f[_0x2a9d3d];return _0xf30c6b;};import{Plugin as _0x5ca2df}from'ckeditor5/src/core';import{getTranslation as _0x827c9}from'../utils/common-translations';export default class Mt extends _0x5ca2df{constructor(_0x3c0f0e){super(_0x3c0f0e),this[_0xf30c('0x7')]=[_0xf30c('0x24'),_0xf30c('0xf'),_0xf30c('0x12'),_0xf30c('0x39'),_0xf30c('0x6'),_0xf30c('0x23'),_0xf30c('0x33')],this[_0xf30c('0x3')]=[_0xf30c('0x20'),_0xf30c('0x1b'),_0xf30c('0x25'),_0xf30c('0xa'),_0xf30c('0x1e'),_0xf30c('0x1'),_0xf30c('0x38'),'tableCellHorizontalAlignment',_0xf30c('0x17')];}static get[_0xf30c('0x8')](){return _0xf30c('0x4');}['afterInit'](){const _0x3ee3e1=this[_0xf30c('0x30')]['plugins']['get'](_0xf30c('0x37'));if(this[_0xf30c('0x30')][_0xf30c('0x1f')]['has'](_0xf30c('0x2a'))){for(const _0x233517 of this[_0xf30c('0x7')])_0x3ee3e1['enableCommand'](_0x233517,(_0x7259e3,_0x340433)=>{const _0x45d055=this['editor'][_0xf30c('0x2c')][_0xf30c('0x2d')][_0xf30c('0x0')][_0xf30c('0xb')]()[_0xf30c('0x15')](_0xf30c('0x2b'));this[_0xf30c('0x14')](_0x233517,[_0x45d055],this['tableProperties'],_0xf30c('0x7'),_0x7259e3,_0x340433);});_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x35')](_0xf30c('0x31'),_0xf30c('0x7'),_0xf30c('0x36'),_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x11')]('formatBlock',null,_0xf30c('0x21'))),_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x35')](_0xf30c('0x31'),_0xf30c('0x7'),_0xf30c('0x21'),(_0x1d8bb2,_0x5c9f7e)=>this['handleDiscardAction'](this[_0xf30c('0x7')],_0x1d8bb2,_0x5c9f7e)),_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x35')](_0xf30c('0x31'),'tableProperties','join',()=>!0x1);}if(this[_0xf30c('0x30')]['plugins']['has']('TableCellPropertiesEditing')){for(const _0x48d5a8 of this[_0xf30c('0x3')])_0x3ee3e1['enableCommand'](_0x48d5a8,(_0x179feb,_0x935e0e)=>{const _0x3bfed0=this['editor'][_0xf30c('0x1f')][_0xf30c('0xe')]('TableUtils')[_0xf30c('0x1c')](this[_0xf30c('0x30')][_0xf30c('0x2c')]['document'][_0xf30c('0x0')]);this[_0xf30c('0x14')](_0x48d5a8,_0x3bfed0,this[_0xf30c('0x3')],'tableCellProperties',_0x179feb,_0x935e0e);});_0x3ee3e1['_suggestionFactory'][_0xf30c('0x35')](_0xf30c('0x31'),_0xf30c('0x3'),_0xf30c('0x36'),_0x3ee3e1[_0xf30c('0x32')]['getSuggestionCallback'](_0xf30c('0x31'),null,_0xf30c('0x21'))),_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x35')](_0xf30c('0x31'),_0xf30c('0x3'),_0xf30c('0x21'),(_0x41a8df,_0x4bc742)=>this['handleDiscardAction'](this['tableCellProperties'],_0x41a8df,_0x4bc742)),_0x3ee3e1[_0xf30c('0x32')][_0xf30c('0x35')]('formatBlock',_0xf30c('0x3'),'join',()=>!0x1);}_0x3ee3e1[_0xf30c('0x9')][_0xf30c('0xc')](_0x5320f3=>this[_0xf30c('0x16')](_0x5320f3));}[_0xf30c('0x14')](_0xf1448f,_0x2e5e95,_0x46286c,_0x1aa1ce,_0x370ca1,_0x44305c){const _0x4a20d8=this[_0xf30c('0x30')][_0xf30c('0x1f')][_0xf30c('0xe')](_0xf30c('0x37'));this[_0xf30c('0x30')][_0xf30c('0x2c')][_0xf30c('0x29')](_0x44305c['batch'],()=>{for(const _0xf9ed78 of _0x2e5e95){if(this[_0xf30c('0x18')](_0xf9ed78,_0x1aa1ce))_0x370ca1(_0x44305c);else{const _0x2b06a3={};for(const _0x2402b0 of _0x46286c){const _0xb7ecc2=_0xf9ed78[_0xf30c('0x19')](_0x2402b0);void 0x0!==_0xb7ecc2&&(_0x2b06a3[_0x2402b0]=_0xb7ecc2);}_0x370ca1(_0x44305c),_0x4a20d8[_0xf30c('0x27')](_0xf9ed78,{'commandParams':[_0x2b06a3]},[],_0x1aa1ce);}}});}[_0xf30c('0x2')](_0x2c8240,_0x4b51b6,_0x320ea9){const _0x1d1a16=_0x4b51b6[0x0][_0xf30c('0x1a')][_0xf30c('0x22')],_0xcc878=_0x320ea9[_0xf30c('0x10')][0x0];this['editor'][_0xf30c('0x2c')][_0xf30c('0xd')](_0x545ec6=>{for(const _0x4c8e56 of _0x2c8240)void 0x0!==_0xcc878[_0x4c8e56]?_0x545ec6[_0xf30c('0x26')](_0x4c8e56,_0xcc878[_0x4c8e56],_0x1d1a16):_0x545ec6['removeAttribute'](_0x4c8e56,_0x1d1a16);});}[_0xf30c('0x16')](_0x502b50){if(_0x502b50[_0xf30c('0x2f')])switch(_0x502b50[_0xf30c('0x28')]){case _0xf30c('0x7'):return{'type':_0xf30c('0x1d'),'content':_0x827c9(this['editor']['locale'],_0xf30c('0x13'))};case'tableCellProperties':return{'type':_0xf30c('0x1d'),'content':_0x827c9(this[_0xf30c('0x30')]['locale'],_0xf30c('0x5'))};}}[_0xf30c('0x18')](_0x415c82,_0x4ef727){const _0x3371c6=this[_0xf30c('0x30')][_0xf30c('0x1f')][_0xf30c('0xe')](_0xf30c('0x37'));for(const _0x57ffc7 of _0x3371c6[_0xf30c('0x2e')]({'skipNotAttached':!0x0})){const _0x27d790=_0x57ffc7[_0xf30c('0x34')]();if(_0x57ffc7[_0xf30c('0x28')]===_0x4ef727&&_0x27d790===_0x415c82)return _0x57ffc7;}return null;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x533a=['editor','Template','plugins','TrackChangesEditing','afterInit','has','insertTemplate'];(function(_0x5cbdb0,_0x533a73){const _0x1c08e1=function(_0x4662fc){while(--_0x4662fc){_0x5cbdb0['push'](_0x5cbdb0['shift']());}};_0x1c08e1(++_0x533a73);}(_0x533a,0x1e9));const _0x1c08=function(_0x5cbdb0,_0x533a73){_0x5cbdb0=_0x5cbdb0-0x0;let _0x1c08e1=_0x533a[_0x5cbdb0];return _0x1c08e1;};import{Plugin as _0x42402b}from'ckeditor5/src/core';export default class vt extends _0x42402b{[_0x1c08('0x5')](){const _0x546c30=this[_0x1c08('0x1')];_0x546c30[_0x1c08('0x3')][_0x1c08('0x6')](_0x1c08('0x2'))&&_0x546c30[_0x1c08('0x3')]['get'](_0x1c08('0x4'))['enableCommand'](_0x1c08('0x0'));}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2f51=['locale','afterInit','plugins','editor','schema','get','isTouching','getChangedMarkers','document','element','title-content','end','from','updateMarker','getNearestSelectionRange','start','model','ELEMENT_TITLE','isCollapsed','removeMarker','nodeBefore'];(function(_0x3eb0e6,_0x2f5165){const _0x7ee46f=function(_0x5df858){while(--_0x5df858){_0x3eb0e6['push'](_0x3eb0e6['shift']());}};_0x7ee46f(++_0x2f5165);}(_0x2f51,0x16b));const _0x7ee4=function(_0x3eb0e6,_0x2f5165){_0x3eb0e6=_0x3eb0e6-0x0;let _0x7ee46f=_0x2f51[_0x3eb0e6];return _0x7ee46f;};import{Plugin as _0x4ea089}from'ckeditor5/src/core';import{getTranslation as _0x2d599b}from'../utils/common-translations';export default class Ct extends _0x4ea089{[_0x7ee4('0x10')](){const _0xab3a30=this[_0x7ee4('0x12')];if(!_0xab3a30[_0x7ee4('0x11')]['has']('Title'))return;const _0x50ec56=_0xab3a30[_0x7ee4('0x11')][_0x7ee4('0x14')]('TrackChangesEditing');_0x50ec56['_descriptionFactory']['registerElementLabel'](_0x7ee4('0x4'),()=>_0x2d599b(_0xab3a30[_0x7ee4('0xf')],_0x7ee4('0xb'))),_0xab3a30[_0x7ee4('0xa')]['document']['registerPostFixer'](_0x1dfabe=>{let _0x2c0c11=!0x1;const _0x2cae20=Array[_0x7ee4('0x6')](_0xab3a30[_0x7ee4('0xa')][_0x7ee4('0x2')]['differ'][_0x7ee4('0x1')]());for(const {name:_0x1142ae,data:_0x83abc8}of _0x2cae20){const {group:_0x39d16d}=_0x50ec56['_splitMarkerName'](_0x1142ae);if('suggestion'!==_0x39d16d||!_0x83abc8['newRange'])continue;const _0xa2b14e=_0x83abc8['newRange'],_0x4fe25f=_0xa2b14e[_0x7ee4('0x5')][_0x7ee4('0xe')];if(!_0x4fe25f||!_0x4fe25f['is'](_0x7ee4('0x3'),_0x7ee4('0x4')))continue;if(!_0xa2b14e[_0x7ee4('0x9')][_0x7ee4('0x0')](_0xa2b14e[_0x7ee4('0x5')]))continue;const _0x7d1f40=_0xab3a30[_0x7ee4('0xa')][_0x7ee4('0x13')][_0x7ee4('0x8')](_0xa2b14e[_0x7ee4('0x5')],'forward');if(_0x7d1f40&&_0x7d1f40[_0x7ee4('0xc')]){const _0x4cc846=_0x1dfabe['createRange'](_0xa2b14e['start'],_0x7d1f40[_0x7ee4('0x9')]);_0x4cc846['isEqual'](_0xa2b14e)||(_0x1dfabe[_0x7ee4('0x7')](_0x1142ae,{'range':_0x4cc846}),_0x2c0c11=!0x0);}_0x2c0c11||(_0x1dfabe[_0x7ee4('0xd')](_0x1142ae),_0x2c0c11=!0x0);}return _0x2c0c11;});}}
|
package/src/integrations/undo.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x19b9=['TrackChangesEditing','enableCommand','UndoEditing','plugins','afterInit','undo','editor'];(function(_0xbbc9e5,_0x19b9d8){const _0x2ad167=function(_0x1dd8b7){while(--_0x1dd8b7){_0xbbc9e5['push'](_0xbbc9e5['shift']());}};_0x2ad167(++_0x19b9d8);}(_0x19b9,0x95));const _0x2ad1=function(_0xbbc9e5,_0x19b9d8){_0xbbc9e5=_0xbbc9e5-0x0;let _0x2ad167=_0x19b9[_0xbbc9e5];return _0x2ad167;};import{Plugin as _0xdc75af}from'ckeditor5/src/core';export default class Dt extends _0xdc75af{[_0x2ad1('0x2')](){const _0xc66ae3=this[_0x2ad1('0x4')],_0x2291b8=_0xc66ae3[_0x2ad1('0x1')]['get'](_0x2ad1('0x5'));_0xc66ae3[_0x2ad1('0x1')]['has'](_0x2ad1('0x0'))&&(_0x2291b8[_0x2ad1('0x6')](_0x2ad1('0x3')),_0x2291b8[_0x2ad1('0x6')]('redo'));}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2b52=['getWalker','writer','item','isAtEnd','ck-suggestion-marker-','addClass','start','consumable','model','ck-suggestion-marker--active','hasAttribute','isBlock','addHighlight','mapper','name','plugins','getCustomProperty','getAttribute','elementEnd','nextSibling','listItem','element','createUIElement','type','span','toViewPosition','get','markerName','isLimit','bindElementToMarker','schema','previousPosition','markerRange','test','includes','push'];(function(_0x368c60,_0x2b5266){const _0x1924b6=function(_0x4c5491){while(--_0x4c5491){_0x368c60['push'](_0x368c60['shift']());}};_0x1924b6(++_0x2b5266);}(_0x2b52,0x149));const _0x1924=function(_0x368c60,_0x2b5266){_0x368c60=_0x368c60-0x0;let _0x1924b6=_0x2b52[_0x368c60];return _0x1924b6;};export function getRangesWithAttribute(_0x5286f4,_0x4d47a6,_0x597b45){const _0xaf8299=[];for(const _0x29901a of _0x4d47a6['getItems']())_0x29901a[_0x1924('0x5')](_0x5286f4)&&_0xaf8299[_0x1924('0x1e')](_0x597b45['createRangeOn'](_0x29901a));return _0xaf8299;}export function getElementsAffectedByListItemRename(_0x106c80){const _0x31e6f0=[];if(_0x106c80['is'](_0x1924('0x10'),_0x1924('0xf'))){let _0x1e3d5f=_0x106c80[_0x1924('0xe')];for(;_0x1e3d5f&&_0x1e3d5f['is'](_0x1924('0x10'),_0x1924('0xf'))&&_0x1e3d5f[_0x1924('0xc')]('listIndent')>0x0;)_0x31e6f0[_0x1924('0x1e')](_0x1e3d5f),_0x1e3d5f=_0x1e3d5f[_0x1924('0xe')];}return _0x31e6f0;}export function downcastSplitMergeMarker(_0xa34aa8,_0x1a85f8,{showActiveMarker:_0x41e117=!0x0}={}){const _0x141666=_0xa34aa8[_0x1924('0xa')][_0x1924('0x15')]('TrackChangesEditing');return(_0x20d7de,_0x243bf7,_0x205f25)=>{if(!_0x205f25[_0x1924('0x2')][_0x1924('0x1c')](_0x243bf7[_0x1924('0x1b')],_0x20d7de[_0x1924('0x9')]))return;const _0x12641a=_0x243bf7[_0x1924('0x1b')][_0x1924('0x1f')](),_0x202716=_0x243bf7['markerRange'][_0x1924('0x1')],_0x5e777a=_0xa34aa8[_0x1924('0x3')][_0x1924('0x19')];let _0x63b2f7=null,_0x32257f=null,_0x2eafc3=!0x1,_0x59f49a=!0x1;for(const _0x130365 of _0x12641a){const _0x1c8568=_0x130365[_0x1924('0x21')];_0x2eafc3=_0x2eafc3||_0x5e777a['isContent'](_0x1c8568);const _0x41b830=_0x205f25[_0x1924('0x8')]['toViewElement'](_0x1c8568);if(_0x41b830&&_0x41b830[_0x1924('0xb')](_0x1924('0x7')))return;_0x1924('0xd')==_0x130365[_0x1924('0x12')]&&(_0x5e777a[_0x1924('0x6')](_0x1c8568)&&!_0x5e777a[_0x1924('0x17')](_0x1c8568)&&(_0x1c8568[_0x1924('0xe')]||_0x202716[_0x1924('0x22')]?_0x63b2f7&&_0x63b2f7['parent']==_0x1c8568||(_0x63b2f7=_0x1c8568,_0x3ced0a(_0x130365[_0x1924('0x1a')]),_0x59f49a=!0x0):_0x32257f=_0x32257f||_0x130365[_0x1924('0x1a')]));}function _0x3ced0a(_0x308e50){const _0x4c143d=_0x205f25[_0x1924('0x20')][_0x1924('0x11')](_0x1924('0x13'),{'class':_0x1924('0x23')+_0x1a85f8}),_0x575364=_0x205f25[_0x1924('0x8')][_0x1924('0x14')](_0x308e50);_0x41e117&&_0x141666['activeMarkers'][_0x1924('0x1d')](_0x243bf7[_0x1924('0x16')])&&_0x205f25['writer'][_0x1924('0x0')](_0x1924('0x4'),_0x4c143d),_0x205f25[_0x1924('0x20')]['insert'](_0x575364,_0x4c143d),_0x205f25['mapper'][_0x1924('0x18')](_0x4c143d,_0x243bf7[_0x1924('0x16')]);}_0x2eafc3||_0x59f49a||!_0x32257f||_0x3ced0a(_0x32257f);};}
|
package/src/suggestion.d.ts
CHANGED
|
@@ -9,16 +9,10 @@
|
|
|
9
9
|
import { Element, type Marker, type Model, type Range, type Item } from 'ckeditor5/src/engine';
|
|
10
10
|
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
11
11
|
import type { CommentThread } from '@ckeditor/ckeditor5-comments';
|
|
12
|
-
import type { FormatData } from './trackchangesediting';
|
|
12
|
+
import type { FormatData, AttributeData } from './trackchangesediting';
|
|
13
13
|
declare const Suggestion_base: {
|
|
14
14
|
new (): import("ckeditor5/src/utils").Observable;
|
|
15
|
-
prototype: import("ckeditor5/src/utils").Observable;
|
|
16
|
-
* Previous suggestion in suggestions chain.
|
|
17
|
-
*
|
|
18
|
-
* Chained suggestions should be handled as one entity.
|
|
19
|
-
*
|
|
20
|
-
* @observable
|
|
21
|
-
*/
|
|
15
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
22
16
|
};
|
|
23
17
|
/**
|
|
24
18
|
* Represents a singular suggestion that is tracked by track changes plugin.
|
|
@@ -63,7 +57,7 @@ export default class Suggestion extends Suggestion_base {
|
|
|
63
57
|
/**
|
|
64
58
|
* Additional suggestion data.
|
|
65
59
|
*/
|
|
66
|
-
data: FormatData | null;
|
|
60
|
+
data: FormatData | AttributeData | null;
|
|
67
61
|
/**
|
|
68
62
|
* Date when the suggestion was saved in the database.
|
|
69
63
|
*/
|
|
@@ -262,15 +256,36 @@ export interface SuggestionOptions {
|
|
|
262
256
|
onAttributesChange: Function;
|
|
263
257
|
}
|
|
264
258
|
export interface SuggestionJSON {
|
|
259
|
+
/**
|
|
260
|
+
* Suggestion ID.
|
|
261
|
+
*/
|
|
265
262
|
id: string;
|
|
263
|
+
/**
|
|
264
|
+
* Contains the information about the type and subtype of the suggestion.
|
|
265
|
+
*/
|
|
266
266
|
type: string;
|
|
267
|
+
/**
|
|
268
|
+
* The ID of the author.
|
|
269
|
+
*/
|
|
267
270
|
authorId: string;
|
|
271
|
+
/**
|
|
272
|
+
* Date when the suggestion was saved in the database.
|
|
273
|
+
*/
|
|
268
274
|
createdAt: Date | null;
|
|
275
|
+
/**
|
|
276
|
+
* Informs whether suggestion has at least one comment.
|
|
277
|
+
*/
|
|
269
278
|
hasComments?: boolean;
|
|
270
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Additional suggestion data.
|
|
281
|
+
*/
|
|
282
|
+
data?: FormatData | AttributeData | null;
|
|
283
|
+
/**
|
|
284
|
+
* Custom suggestion attributes.
|
|
285
|
+
*/
|
|
271
286
|
attributes: {
|
|
272
287
|
[k: string]: unknown;
|
|
273
288
|
};
|
|
274
289
|
}
|
|
275
|
-
export type SuggestionType = 'insertion' | 'deletion' | 'formatInline' | 'formatBlock';
|
|
290
|
+
export type SuggestionType = 'insertion' | 'deletion' | 'formatInline' | 'formatBlock' | 'attribute';
|
|
276
291
|
export {};
|
package/src/suggestion.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5e57=['_saved','onAttributesChange','markers','nodeBefore','reduce','addMarkerName','_onDiscard','author','nodeAfter','start','change','addRange','getRange','_model','add','get','isIntersecting','getFirstMarker','previous','substr','creator','commentThread','type','decorate','attributes','getRanges','hasComments','onDiscard','set','clear','_markerNames','data','_onAttributesChange','head','_onAccept','toJSON','push','getAllAdjacentSuggestions','end','getFirstRange','split','addMarker','next','_isDataLoaded','getMarkers','map','setAttribute','@external','delete','length','getItems','removeMarkers','removeAttribute','isIntersectingWithRange','getMarkerNames','subType','accept','createdAt','from','onAccept','getMultiRangeId','filter'];(function(_0x5f3d46,_0x5e57a8){const _0x462864=function(_0x547630){while(--_0x547630){_0x5f3d46['push'](_0x5f3d46['shift']());}};_0x462864(++_0x5e57a8);}(_0x5e57,0x1f4));const _0x4628=function(_0x5f3d46,_0x5e57a8){_0x5f3d46=_0x5f3d46-0x0;let _0x462864=_0x5e57[_0x5f3d46];return _0x462864;};import{Element as _0x537a7d}from'ckeditor5/src/engine';import{ObservableMixin as _0x274390,uid as _0x116f45}from'ckeditor5/src/utils';import{cloneDeep as _0x1bb168,isEqual as _0x26ed56,set as _0x53c8a7,unset as _0x27ae5f}from'lodash-es';export default class u extends _0x274390(){constructor(_0x5be231,_0x4b3103){super(),this[_0x4628('0x27')]=!0x1,this['id']=_0x4b3103['id'],this[_0x4628('0x12')]=_0x4b3103[_0x4628('0x12')],this[_0x4628('0x33')]=_0x4b3103[_0x4628('0x33')]||null,this[_0x4628('0x3')]=_0x4b3103[_0x4628('0x3')],this[_0x4628('0x10')]=_0x4b3103[_0x4628('0x10')]||_0x4b3103[_0x4628('0x3')],this['isExternal']=Boolean(_0x4b3103[_0x4628('0x14')]&&_0x4b3103[_0x4628('0x14')][_0x4628('0x2b')]),this[_0x4628('0x1b')]=null,this['_model']=_0x5be231,this[_0x4628('0x1e')]=_0x4b3103[_0x4628('0x37')],this[_0x4628('0x2')]=_0x4b3103[_0x4628('0x17')],this['_onAttributesChange']=_0x4b3103[_0x4628('0x3b')],this['_markerNames']=new Set(),this[_0x4628('0x35')]=null,this[_0x4628('0x18')]('authoredAt',null),this[_0x4628('0x18')](_0x4628('0x14'),_0x4b3103[_0x4628('0x14')]||{}),this[_0x4628('0x18')](_0x4628('0xe'),null),this[_0x4628('0x18')]('next',null),this[_0x4628('0x18')]('commentThread',null),this[_0x4628('0x18')](_0x4628('0x3a'),!0x1),this[_0x4628('0x13')](_0x4628('0x34')),this[_0x4628('0x13')]('discard');}get[_0x4628('0x1d')](){let _0x318faa=this;for(;_0x318faa['previous'];)_0x318faa=_0x318faa[_0x4628('0xe')];return _0x318faa;}get[_0x4628('0x16')](){return!!this[_0x4628('0x11')]&&this[_0x4628('0x11')][_0x4628('0x2d')]>0x0;}get['isMultiRange'](){if(0x0==this[_0x4628('0x1a')]['size'])return!0x1;return 0x6==Array['from'](this[_0x4628('0x1a')])[0x0][_0x4628('0x24')](':')[_0x4628('0x2d')];}get['isInContent'](){return null!==this[_0x4628('0xd')]();}[_0x4628('0x1')](_0x20d94a){this[_0x4628('0x1a')][_0x4628('0xa')](_0x20d94a);}[_0x4628('0x32')](){return Array[_0x4628('0x36')](this['_markerNames']);}['getMarkers'](){return this[_0x4628('0x32')]()[_0x4628('0x29')](_0x5ceda4=>this['_model'][_0x4628('0x3c')][_0x4628('0xb')](_0x5ceda4))[_0x4628('0x39')](_0x1d91e5=>_0x1d91e5);}[_0x4628('0xd')](){return this[_0x4628('0x28')]()[0x0]||null;}[_0x4628('0x2f')](){this[_0x4628('0x9')][_0x4628('0x6')](_0x471123=>{for(const _0x34e737 of this[_0x4628('0x28')]())_0x471123['removeMarker'](_0x34e737);}),this[_0x4628('0x1a')][_0x4628('0x19')]();}['removeMarker'](_0x24a82b){this[_0x4628('0x9')][_0x4628('0x6')](_0x40f9e0=>{_0x40f9e0['removeMarker'](_0x24a82b);}),this[_0x4628('0x1a')][_0x4628('0x2c')](_0x24a82b);}[_0x4628('0x7')](_0x1fd0a3){const _0x223dc1='suggestion:'+this[_0x4628('0x12')]+':'+this[_0x4628('0x33')]+':'+this['id']+':'+this[_0x4628('0x10')]['id']+':'+u[_0x4628('0x38')]();this[_0x4628('0x1')](_0x223dc1),this[_0x4628('0x9')][_0x4628('0x6')](_0x454f05=>{_0x454f05[_0x4628('0x25')](_0x223dc1,{'range':_0x1fd0a3,'usingOperation':!0x0,'affectsData':!0x0});});}[_0x4628('0x31')](_0x18db33){for(const _0x4241b6 of this[_0x4628('0x15')]())if(_0x4241b6[_0x4628('0xc')](_0x18db33))return!0x0;return!0x1;}[_0x4628('0x15')](){return this[_0x4628('0x28')]()[_0x4628('0x29')](_0x156f38=>_0x156f38[_0x4628('0x8')]());}[_0x4628('0x2e')](){return this[_0x4628('0x15')]()[_0x4628('0x0')]((_0x5e6d4b,_0x2cf422)=>[..._0x5e6d4b,..._0x2cf422[_0x4628('0x2e')]()],[]);}[_0x4628('0x23')](){var _0x27f450;return(null===(_0x27f450=this[_0x4628('0xd')]())||void 0x0===_0x27f450?void 0x0:_0x27f450['getRange']())||null;}['getContainedElement'](){const _0x162da7=this[_0x4628('0x15')]();if(0x1!=_0x162da7[_0x4628('0x2d')])return null;const _0x14ae7f=_0x162da7[0x0],_0x21d0a6=_0x14ae7f[_0x4628('0x5')][_0x4628('0x4')],_0x22231e=_0x14ae7f[_0x4628('0x22')][_0x4628('0x3d')];return _0x21d0a6 instanceof _0x537a7d?_0x21d0a6!=_0x22231e?null:_0x21d0a6:null;}[_0x4628('0x34')](){this['_onAccept'](this[_0x4628('0x15')](),this[_0x4628('0x1b')],this[_0x4628('0x14')]),this[_0x4628('0x2f')]();}['discard'](){this[_0x4628('0x2')](this[_0x4628('0x15')](),this[_0x4628('0x1b')],this[_0x4628('0x14')]),this[_0x4628('0x2f')]();}[_0x4628('0x21')](){const _0x138b77=[];let _0x53e888=this[_0x4628('0x1d')];for(;_0x53e888;)_0x138b77[_0x4628('0x20')](_0x53e888),_0x53e888=_0x53e888[_0x4628('0x26')];return _0x138b77;}[_0x4628('0x2a')](_0x8159c,_0x5c4e39){const _0xb27e3e=_0x1bb168(this[_0x4628('0x14')]);_0x53c8a7(_0xb27e3e,_0x8159c,_0x5c4e39),_0x26ed56(_0xb27e3e,this[_0x4628('0x14')])||(this[_0x4628('0x14')]=_0xb27e3e,this[_0x4628('0x1c')](_0xb27e3e));}[_0x4628('0x30')](_0x191d65){const _0x2a94f1=_0x1bb168(this[_0x4628('0x14')]);_0x27ae5f(_0x2a94f1,_0x191d65),_0x26ed56(_0x2a94f1,this[_0x4628('0x14')])||(this[_0x4628('0x14')]=_0x2a94f1,this[_0x4628('0x1c')](this[_0x4628('0x14')]));}[_0x4628('0x1f')](){return{'id':this['id'],'type':this[_0x4628('0x33')]?this[_0x4628('0x12')]+':'+this['subType']:this['type'],'authorId':this[_0x4628('0x10')]['id'],'createdAt':this['createdAt'],'hasComments':this[_0x4628('0x16')],'data':this['data'],'attributes':this['attributes']};}static[_0x4628('0x38')](){return _0x116f45()[_0x4628('0xf')](0x1,0x5);}}
|
|
@@ -6,11 +6,14 @@ import { type Locale, type PriorityString } from 'ckeditor5/src/utils';
|
|
|
6
6
|
import type { Schema, Element } from 'ckeditor5/src/engine';
|
|
7
7
|
import type Suggestion from './suggestion';
|
|
8
8
|
/**
|
|
9
|
-
* Creates descriptions for
|
|
9
|
+
* Creates descriptions for suggestions and suggestions chains.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* The class manages everything related to generating descriptions for suggestions. Here, you register labels for elements,
|
|
12
|
+
* attributes, or custom callback for non-regular cases.
|
|
13
|
+
*
|
|
14
|
+
* One or more suggestions that are grouped together (based ond various conditions) create "suggestion chain".
|
|
15
|
+
* In such chain one suggestion may impact other suggestion when it comes to the description of the whole chain.
|
|
16
|
+
* For example, insertion next to deletion results in "Replaced" description.
|
|
14
17
|
*/
|
|
15
18
|
export default class SuggestionDescriptionFactory {
|
|
16
19
|
constructor(schema: Schema, locale: Locale);
|
|
@@ -98,6 +101,22 @@ export default class SuggestionDescriptionFactory {
|
|
|
98
101
|
* ```
|
|
99
102
|
*/
|
|
100
103
|
registerElementLabel(elementNameOrCallback: string | Function, labelCallback: LabelCallback, priority?: PriorityString): void;
|
|
104
|
+
/**
|
|
105
|
+
* For given `attributeName` registers how this attribute will be labeled in a description (for example when it is added
|
|
106
|
+
* or removed).
|
|
107
|
+
*
|
|
108
|
+
* Example usage with internationalization:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* const t = editor.locale.t; // Remember that you have to use function named `t`.
|
|
112
|
+
*
|
|
113
|
+
* suggestionDescriptionFactory.registerAttributeLabel(
|
|
114
|
+
* 'bold',
|
|
115
|
+
* t( 'bold' )
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
registerAttributeLabel(attributeName: string, attributeLabel: string): void;
|
|
101
120
|
/**
|
|
102
121
|
* Returns label registered for given element or the element name if there is no label registered for it.
|
|
103
122
|
*/
|
|
@@ -154,10 +173,11 @@ export interface LabelCallbackObject {
|
|
|
154
173
|
* ranges are traversed.
|
|
155
174
|
*/
|
|
156
175
|
interface DescriptionItem {
|
|
157
|
-
type: 'text' | 'addEmptyContainer' | 'addObject' | 'removeEmptyContainer' | 'removeObject' | 'addContainer' | 'removeContainer';
|
|
176
|
+
type: 'text' | 'addEmptyContainer' | 'addObject' | 'removeEmptyContainer' | 'removeObject' | 'addContainer' | 'removeContainer' | 'addFormat' | 'removeFormat';
|
|
158
177
|
add?: string;
|
|
159
178
|
remove?: string;
|
|
160
179
|
element?: Element;
|
|
161
180
|
quantity?: number;
|
|
181
|
+
key?: string;
|
|
162
182
|
}
|
|
163
183
|
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x3ba2=['previousSibling','registerDescriptionCallback','pop','quantity','Object','add','push','function','_resolveDescriptionItems','_itemLabelsCallbacks','$1\x20$2','text','getFirstRange','Container','*Merge:*\x20%0','replace','deletion','isEqual','addEmptyContainer','removeEmptyContainer','_schema','type','data','checkChild','name','remove','matchingCallback','_itemLabels','nextSibling','addContainer','isEmpty','elementEnd','_addDescriptionItems','insertion','isInContent','_customCallbacks','label','normal','getItemLabel','registerElementLabel','get','softBreak','isObject','elementStart','*Insert:*\x20%0','EmptyContainer','length','*Remove:*\x20%0','end','*Split:*\x20%0','start','ELEMENT_SPACE','match','indexOf','element','_locale'];(function(_0x3fcb39,_0x3ba227){const _0x322b00=function(_0x4a9913){while(--_0x4a9913){_0x3fcb39['push'](_0x3fcb39['shift']());}};_0x322b00(++_0x3ba227);}(_0x3ba2,0x170));const _0x322b=function(_0x3fcb39,_0x3ba227){_0x3fcb39=_0x3fcb39-0x0;let _0x322b00=_0x3ba2[_0x3fcb39];return _0x322b00;};import{getTranslation as _0x3b225d}from'./utils/common-translations';import{priorities as _0x51e3da,insertToPriorityArray as _0x50678a}from'ckeditor5/src/utils';export default class m{constructor(_0x4f182a,_0x47632d){this[_0x322b('0x3')]=[],this[_0x322b('0x33')]=new Map(),this['_itemLabelsCallbacks']=[],this[_0x322b('0x2c')]=_0x4f182a,this[_0x322b('0x17')]=_0x47632d;}['getDescriptions'](_0x36f7e1){const _0x4829e2=[];for(let _0x183e96=0x0;_0x183e96<_0x36f7e1[_0x322b('0xe')];_0x183e96++){const _0x31deb3=_0x36f7e1[_0x183e96];if(!_0x31deb3[_0x322b('0x2')])continue;let _0x1ded54=!0x1;for(const _0x83374a of this[_0x322b('0x3')]){const _0x57159c=_0x83374a(_0x31deb3);if(_0x57159c){_0x322b('0x2d')in _0x57159c&&_0x4829e2[_0x322b('0x1e')](_0x57159c),_0x1ded54=!0x0;break;}}if(!_0x1ded54){this[_0x322b('0x0')](_0x4829e2,_0x31deb3);const _0x5cdc17=_0x36f7e1[_0x183e96+0x1];if(_0x5cdc17&&!_0x31deb3[_0x322b('0x24')]()[_0x322b('0x10')][_0x322b('0x29')](_0x5cdc17[_0x322b('0x24')]()[_0x322b('0x12')])){const _0x465a8e=_0x4829e2[_0x4829e2['length']-0x1],_0x8d2766=_0x322b('0x1')==_0x31deb3['type']?_0x322b('0x1d'):'remove';_0x465a8e&&_0x322b('0x23')==_0x465a8e[_0x322b('0x2d')]&&(_0x465a8e[_0x8d2766]+='\x0a');}}}return this[_0x322b('0x20')](_0x4829e2);}[_0x322b('0x19')](_0x570019){this[_0x322b('0x3')][_0x322b('0x1e')](_0x570019);}[_0x322b('0x7')](_0x160fe,_0x51b9f5,_0x541b57=_0x51e3da[_0x322b('0x5')]){_0x322b('0x1f')==typeof _0x160fe?_0x50678a(this['_itemLabelsCallbacks'],{'matchingCallback':_0x160fe,'label':_0x51b9f5,'priority':_0x541b57}):this[_0x322b('0x33')]['set'](_0x160fe,_0x51b9f5);}[_0x322b('0x6')](_0x156505,_0x3ba74c=0x1){let _0x514952;for(const _0x792dc8 of this[_0x322b('0x21')])if(_0x792dc8[_0x322b('0x32')](_0x156505)){_0x514952=_0x792dc8[_0x322b('0x4')];break;}return _0x514952||(_0x514952=this[_0x322b('0x33')][_0x322b('0x8')](_0x156505['name'])),_0x514952?_0x514952(_0x3ba74c):0x1!==_0x3ba74c?_0x3ba74c+'\x20'+_0x156505['name']+'s':''+_0x156505[_0x322b('0x30')];}[_0x322b('0x0')](_0x56113c,_0x36b72a){const _0x3744f4=_0x36b72a['getFirstRange']()['getWalker'](),_0x59bc60=_0x322b('0x1')==_0x36b72a[_0x322b('0x2d')]?_0x322b('0x1d'):'remove';for(const _0x32362d of _0x3744f4){const _0x371263=_0x32362d['item'],_0x1233f5=_0x56113c[_0x56113c[_0x322b('0xe')]-0x1];if(_0x371263['is']('$textProxy'))_0x1233f5&&_0x1233f5[_0x322b('0x2d')][_0x322b('0x15')]('Container')>-0x1&&_0x56113c[_0x322b('0x1a')](),_0x1233f5&&_0x322b('0x23')==_0x1233f5[_0x322b('0x2d')]?_0x1233f5[_0x59bc60]+=_0x371263[_0x322b('0x2e')]:_0x56113c['push']({'type':_0x322b('0x23'),'add':_0x322b('0x1d')==_0x59bc60?_0x371263['data']:'','remove':_0x322b('0x31')==_0x59bc60?_0x371263['data']:''});else{if(this[_0x322b('0x2c')][_0x322b('0xa')](_0x371263)){const _0xb90fda=_0x371263;if(_0x1233f5&&_0x1233f5[_0x322b('0x2d')][_0x322b('0x15')](_0x322b('0x25'))>-0x1&&_0x56113c[_0x322b('0x1a')](),_0x322b('0x37')==_0x32362d[_0x322b('0x2d')])continue;_0x1233f5&&_0x1233f5[_0x322b('0x2d')]==_0x59bc60+'Object'&&_0x1233f5[_0x322b('0x16')]['name']==_0xb90fda[_0x322b('0x30')]?_0x1233f5[_0x322b('0x1b')]++:_0x56113c[_0x322b('0x1e')]({'type':_0x59bc60+_0x322b('0x1c'),'element':_0xb90fda,'quantity':0x1}),_0x3744f4['skip'](_0x2a6932=>!('elementEnd'==_0x2a6932['type']&&_0x2a6932['item']==_0x371263));}else{if(this['_schema'][_0x322b('0x2f')](_0x371263,'$text')||_0x371263['is'](_0x322b('0x16'),_0x322b('0x9'))){const _0xacd1f=_0x371263;if(_0x322b('0x1d')==_0x59bc60&&_0x322b('0xb')==_0x32362d[_0x322b('0x2d')]||_0x322b('0x31')==_0x59bc60&&_0x322b('0x37')==_0x32362d[_0x322b('0x2d')])continue;if(_0x1233f5&&-0x1==_0x1233f5[_0x322b('0x2d')][_0x322b('0x15')]('Container')){_0x322b('0x23')==_0x1233f5[_0x322b('0x2d')]&&(_0x1233f5[_0x59bc60]+='\x0a');continue;}let _0xadb7cc;if(_0xadb7cc=_0x322b('0x1d')==_0x59bc60?_0xacd1f['nextSibling']&&!this[_0x322b('0x2c')][_0x322b('0xa')](_0xacd1f[_0x322b('0x34')])?_0xacd1f['nextSibling']:null:_0xacd1f[_0x322b('0x18')]&&!this[_0x322b('0x2c')]['isObject'](_0xacd1f[_0x322b('0x18')])?_0xacd1f['previousSibling']:null,_0xacd1f[_0x322b('0x36')]||_0xadb7cc&&_0xadb7cc['isEmpty']){const _0x111759=_0xadb7cc&&_0xadb7cc[_0x322b('0x36')]?_0xadb7cc:_0xacd1f;_0x1233f5&&_0x1233f5[_0x322b('0x2d')]==_0x59bc60+_0x322b('0xd')&&_0x1233f5[_0x322b('0x16')][_0x322b('0x30')]==_0x111759[_0x322b('0x30')]?_0x1233f5[_0x322b('0x1b')]++:_0x56113c[_0x322b('0x1e')]({'type':_0x59bc60+_0x322b('0xd'),'element':_0x111759,'quantity':0x1});}else _0x56113c[_0x322b('0x1e')]({'type':_0x59bc60+'Container','element':_0xacd1f});}}}}}[_0x322b('0x20')](_0x4dea54){const _0x4e07e1=this[_0x322b('0x17')],_0x2d5b62=[];for(const _0x3bc475 of _0x4dea54){switch(_0x3bc475['type']){case _0x322b('0x23'):if(_0x3bc475[_0x322b('0x1d')]=_0x3bc475[_0x322b('0x1d')]['replace'](/(\S)\u000A+(\S)/g,_0x322b('0x22'))[_0x322b('0x27')](/\u000A/g,''),_0x3bc475[_0x322b('0x31')]=_0x3bc475[_0x322b('0x31')]['replace'](/(\S)\u000A+(\S)/g,_0x322b('0x22'))[_0x322b('0x27')](/\u000A/g,''),''!=_0x3bc475[_0x322b('0x1d')]&&''!=_0x3bc475[_0x322b('0x31')]){_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x27'),'content':_0x3b225d(_0x4e07e1,'REPLACE_TEXT',['\x22'+_0x3bc475[_0x322b('0x31')]+'\x22','\x22'+_0x3bc475[_0x322b('0x1d')]+'\x22'])});continue;}if(null!=_0x3bc475[_0x322b('0x1d')][_0x322b('0x14')](/^ +$/)){_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x1'),'content':_0x3b225d(_0x4e07e1,_0x322b('0xc'),_0x3b225d(_0x4e07e1,_0x322b('0x13'),_0x3bc475[_0x322b('0x1d')][_0x322b('0xe')]))});continue;}if(null!=_0x3bc475[_0x322b('0x31')][_0x322b('0x14')](/^ +$/)){_0x2d5b62[_0x322b('0x1e')]({'type':'deletion','content':_0x3b225d(_0x4e07e1,_0x322b('0xf'),_0x3b225d(_0x4e07e1,_0x322b('0x13'),_0x3bc475[_0x322b('0x31')]['length']))});continue;}if(''!=_0x3bc475[_0x322b('0x1d')]){_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x1'),'content':_0x3b225d(_0x4e07e1,_0x322b('0xc'),'\x22'+_0x3bc475['add']+'\x22')});continue;}_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x28'),'content':_0x3b225d(_0x4e07e1,_0x322b('0xf'),'\x22'+_0x3bc475[_0x322b('0x31')]+'\x22')});continue;case _0x322b('0x2a'):case'addObject':_0x2d5b62['push']({'type':_0x322b('0x1'),'content':_0x3b225d(_0x4e07e1,'*Insert:*\x20%0',this[_0x322b('0x6')](_0x3bc475[_0x322b('0x16')],_0x3bc475[_0x322b('0x1b')]))});continue;case _0x322b('0x2b'):case'removeObject':_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x28'),'content':_0x3b225d(_0x4e07e1,'*Remove:*\x20%0',this[_0x322b('0x6')](_0x3bc475['element'],_0x3bc475['quantity']))});continue;case _0x322b('0x35'):_0x2d5b62[_0x322b('0x1e')]({'type':_0x322b('0x1'),'content':_0x3b225d(_0x4e07e1,_0x322b('0x11'),this[_0x322b('0x6')](_0x3bc475[_0x322b('0x16')],_0x3bc475[_0x322b('0x1b')]))});continue;case'removeContainer':_0x2d5b62['push']({'type':'deletion','content':_0x3b225d(_0x4e07e1,_0x322b('0x26'),this[_0x322b('0x6')](_0x3bc475[_0x322b('0x16')],_0x3bc475[_0x322b('0x1b')]))});continue;}_0x2d5b62[_0x322b('0x1e')](_0x3bc475);}return _0x2d5b62;}}
|
|
23
|
+
const _0x2bad=['length','_customCallbacks','end','*Change\x20to:*\x20%0','skip','add','key','_itemLabels','data','start','_handleInsertRemoveSuggestionDescription','Object','addFormat','_itemLabelsCallbacks','format','function','quantity','elementEnd','Container','removeFormat','_handleCustomCallbackDescription','EmptyContainer','_handleAttributeSuggestionDescription','_locale','getDescriptions','*Merge:*\x20%0','push','*Split:*\x20%0','_attributeLabels','getWalker','text','name','removeObject','item','previousSibling','map','isEqual','insertion','normal','isEmpty','getItemLabel','element','*Insert:*\x20%0','pop','isInContent','set','replace','match','nodeAfter','attribute','subType','isObject','indexOf','registerDescriptionCallback','join','_handleRenameSuggestionDescription','get','remove','removeEmptyContainer','*Set\x20format:*\x20%0','_addDescriptionItems','_schema','has','$1\x20$2','deletion','$textProxy','*Remove:*\x20%0','type','$text','ELEMENT_SPACE','getFirstRange'];(function(_0x49d925,_0x2bad40){const _0x4e2a79=function(_0x1ac116){while(--_0x1ac116){_0x49d925['push'](_0x49d925['shift']());}};_0x4e2a79(++_0x2bad40);}(_0x2bad,0x19a));const _0x4e2a=function(_0x49d925,_0x2bad40){_0x49d925=_0x49d925-0x0;let _0x4e2a79=_0x2bad[_0x49d925];return _0x4e2a79;};import{getTranslation as _0x3f1024}from'./utils/common-translations';import{priorities as _0x474877,insertToPriorityArray as _0x449b84}from'ckeditor5/src/utils';import{renameAttributeKey as _0x4b3d76}from'./trackchangesediting';export default class f{constructor(_0x4243d0,_0x201635){this[_0x4e2a('0x11')]=[],this[_0x4e2a('0x17')]=new Map(),this[_0x4e2a('0x1d')]=[],this[_0x4e2a('0x2c')]=new Map(),this[_0x4e2a('0x6')]=_0x4243d0,this[_0x4e2a('0x27')]=_0x201635;}[_0x4e2a('0x28')](_0x1c392f){const _0x294b6b=[],_0x5e1c88=new Set(),_0x5d90cf=new Set();for(let _0x5a00bf=0x0;_0x5a00bf<_0x1c392f['length'];_0x5a00bf++){const _0x2c556c=_0x1c392f[_0x5a00bf];if(!_0x2c556c[_0x4e2a('0x3c')])continue;const _0x111d1f=this[_0x4e2a('0x24')](_0x2c556c);if(_0x111d1f){if(null!=_0x2c556c[_0x4e2a('0x42')]){if(_0x5e1c88['has'](_0x2c556c[_0x4e2a('0x42')]))continue;_0x5e1c88[_0x4e2a('0x15')](_0x2c556c[_0x4e2a('0x42')]);}_0x294b6b['push'](_0x111d1f);}else{if(_0x4e2a('0x41')!=_0x2c556c['type'])_0x4e2a('0x35')!=_0x2c556c[_0x4e2a('0xc')]&&'deletion'!=_0x2c556c[_0x4e2a('0xc')]||this[_0x4e2a('0x1a')](_0x294b6b,_0x2c556c,_0x1c392f[_0x5a00bf+0x1]);else{const _0x2e4211=_0x2c556c[_0x4e2a('0x18')][_0x4e2a('0x16')];if(_0x5d90cf[_0x4e2a('0x7')](_0x2e4211))continue;_0x5d90cf[_0x4e2a('0x15')](_0x2c556c[_0x4e2a('0x18')][_0x4e2a('0x16')]),_0x2e4211==_0x4b3d76?this['_handleRenameSuggestionDescription'](_0x294b6b,_0x2c556c):this[_0x4e2a('0x26')](_0x294b6b,_0x2c556c);}}}return this['_resolveDescriptionItems'](_0x294b6b);}[_0x4e2a('0x45')](_0x1db3a9){this['_customCallbacks']['push'](_0x1db3a9);}['registerElementLabel'](_0x1ef336,_0x4e920b,_0x5d5458=_0x474877[_0x4e2a('0x36')]){_0x4e2a('0x1f')==typeof _0x1ef336?_0x449b84(this['_itemLabelsCallbacks'],{'matchingCallback':_0x1ef336,'label':_0x4e920b,'priority':_0x5d5458}):this[_0x4e2a('0x17')][_0x4e2a('0x3d')](_0x1ef336,_0x4e920b);}['registerAttributeLabel'](_0x492255,_0x5ddaf1){this['_attributeLabels'][_0x4e2a('0x3d')](_0x492255,_0x5ddaf1);}[_0x4e2a('0x38')](_0x4a2b07,_0x46ce56=0x1){let _0x115204;for(const _0x4060db of this[_0x4e2a('0x1d')])if(_0x4060db['matchingCallback'](_0x4a2b07)){_0x115204=_0x4060db['label'];break;}return _0x115204||(_0x115204=this['_itemLabels'][_0x4e2a('0x1')](_0x4a2b07[_0x4e2a('0x2f')])),_0x115204?_0x115204(_0x46ce56):0x1!==_0x46ce56?_0x46ce56+'\x20'+_0x4a2b07[_0x4e2a('0x2f')]+'s':''+_0x4a2b07[_0x4e2a('0x2f')];}[_0x4e2a('0x5')](_0x1e88bb,_0x5b553a){const _0x4b13c0=_0x5b553a[_0x4e2a('0xf')]()[_0x4e2a('0x2d')](),_0x17733d=_0x4e2a('0x35')==_0x5b553a['type']?_0x4e2a('0x15'):_0x4e2a('0x2');for(const _0x772dc6 of _0x4b13c0){const _0x5f4b7f=_0x772dc6[_0x4e2a('0x31')],_0x29c19d=_0x1e88bb[_0x1e88bb[_0x4e2a('0x10')]-0x1];if(_0x5f4b7f['is'](_0x4e2a('0xa')))_0x29c19d&&_0x29c19d[_0x4e2a('0xc')][_0x4e2a('0x44')](_0x4e2a('0x22'))>-0x1&&_0x1e88bb['pop'](),_0x29c19d&&_0x4e2a('0x2e')==_0x29c19d[_0x4e2a('0xc')]?_0x29c19d[_0x17733d]+=_0x5f4b7f['data']:_0x1e88bb[_0x4e2a('0x2a')]({'type':'text','add':_0x4e2a('0x15')==_0x17733d?_0x5f4b7f[_0x4e2a('0x18')]:'','remove':_0x4e2a('0x2')==_0x17733d?_0x5f4b7f[_0x4e2a('0x18')]:''});else{if(this[_0x4e2a('0x6')][_0x4e2a('0x43')](_0x5f4b7f)){const _0x50ab65=_0x5f4b7f;if(_0x29c19d&&_0x29c19d[_0x4e2a('0xc')][_0x4e2a('0x44')](_0x4e2a('0x22'))>-0x1&&_0x1e88bb[_0x4e2a('0x3b')](),_0x4e2a('0x21')==_0x772dc6[_0x4e2a('0xc')])continue;_0x29c19d&&_0x29c19d[_0x4e2a('0xc')]==_0x17733d+_0x4e2a('0x1b')&&_0x29c19d[_0x4e2a('0x39')][_0x4e2a('0x2f')]==_0x50ab65['name']?_0x29c19d[_0x4e2a('0x20')]++:_0x1e88bb['push']({'type':_0x17733d+_0x4e2a('0x1b'),'element':_0x50ab65,'quantity':0x1}),_0x4b13c0[_0x4e2a('0x14')](_0x425582=>!(_0x4e2a('0x21')==_0x425582['type']&&_0x425582[_0x4e2a('0x31')]==_0x5f4b7f));}else{if(this[_0x4e2a('0x6')]['checkChild'](_0x5f4b7f,_0x4e2a('0xd'))||_0x5f4b7f['is'](_0x4e2a('0x39'),'softBreak')){const _0x137d11=_0x5f4b7f;if(_0x4e2a('0x15')==_0x17733d&&'elementStart'==_0x772dc6['type']||'remove'==_0x17733d&&'elementEnd'==_0x772dc6[_0x4e2a('0xc')])continue;if(_0x29c19d&&-0x1==_0x29c19d[_0x4e2a('0xc')][_0x4e2a('0x44')]('Container')){_0x4e2a('0x2e')==_0x29c19d[_0x4e2a('0xc')]&&(_0x29c19d[_0x17733d]+='\x0a');continue;}let _0x2ff14e;if(_0x2ff14e=_0x4e2a('0x15')==_0x17733d?_0x137d11['nextSibling']&&!this[_0x4e2a('0x6')][_0x4e2a('0x43')](_0x137d11['nextSibling'])?_0x137d11['nextSibling']:null:_0x137d11['previousSibling']&&!this[_0x4e2a('0x6')][_0x4e2a('0x43')](_0x137d11['previousSibling'])?_0x137d11[_0x4e2a('0x32')]:null,_0x137d11['isEmpty']||_0x2ff14e&&_0x2ff14e[_0x4e2a('0x37')]){const _0x10cb75=_0x2ff14e&&_0x2ff14e['isEmpty']?_0x2ff14e:_0x137d11;_0x29c19d&&_0x29c19d[_0x4e2a('0xc')]==_0x17733d+_0x4e2a('0x25')&&_0x29c19d['element']['name']==_0x10cb75[_0x4e2a('0x2f')]?_0x29c19d[_0x4e2a('0x20')]++:_0x1e88bb[_0x4e2a('0x2a')]({'type':_0x17733d+_0x4e2a('0x25'),'element':_0x10cb75,'quantity':0x1});}else _0x1e88bb[_0x4e2a('0x2a')]({'type':_0x17733d+_0x4e2a('0x22'),'element':_0x137d11});}}}}}['_resolveDescriptionItems'](_0xc5edde){const _0x3e4024=this[_0x4e2a('0x27')],_0x418d32=[],_0x3b5c37=[],_0x370f5b=[];for(const _0x26791a of _0xc5edde)switch(_0x26791a[_0x4e2a('0xc')]){case _0x4e2a('0x2e'):if(_0x26791a['add']=_0x26791a[_0x4e2a('0x15')][_0x4e2a('0x3e')](/(\S)\u000A+(\S)/g,_0x4e2a('0x8'))[_0x4e2a('0x3e')](/\u000A/g,''),_0x26791a[_0x4e2a('0x2')]=_0x26791a[_0x4e2a('0x2')][_0x4e2a('0x3e')](/(\S)\u000A+(\S)/g,_0x4e2a('0x8'))['replace'](/\u000A/g,''),''!=_0x26791a[_0x4e2a('0x15')]&&''!=_0x26791a[_0x4e2a('0x2')]){_0x418d32[_0x4e2a('0x2a')]({'type':_0x4e2a('0x3e'),'content':_0x3f1024(_0x3e4024,'REPLACE_TEXT',['\x22'+_0x26791a[_0x4e2a('0x2')]+'\x22','\x22'+_0x26791a['add']+'\x22'])});continue;}if(null!=_0x26791a[_0x4e2a('0x15')][_0x4e2a('0x3f')](/^ +$/)){_0x418d32[_0x4e2a('0x2a')]({'type':_0x4e2a('0x35'),'content':_0x3f1024(_0x3e4024,_0x4e2a('0x3a'),_0x3f1024(_0x3e4024,_0x4e2a('0xe'),_0x26791a['add'][_0x4e2a('0x10')]))});continue;}if(null!=_0x26791a[_0x4e2a('0x2')][_0x4e2a('0x3f')](/^ +$/)){_0x418d32[_0x4e2a('0x2a')]({'type':_0x4e2a('0x9'),'content':_0x3f1024(_0x3e4024,_0x4e2a('0xb'),_0x3f1024(_0x3e4024,_0x4e2a('0xe'),_0x26791a[_0x4e2a('0x2')][_0x4e2a('0x10')]))});continue;}if(''!=_0x26791a['add']){_0x418d32[_0x4e2a('0x2a')]({'type':'insertion','content':_0x3f1024(_0x3e4024,'*Insert:*\x20%0','\x22'+_0x26791a['add']+'\x22')});continue;}_0x418d32[_0x4e2a('0x2a')]({'type':'deletion','content':_0x3f1024(_0x3e4024,_0x4e2a('0xb'),'\x22'+_0x26791a[_0x4e2a('0x2')]+'\x22')});continue;case'addEmptyContainer':case'addObject':_0x418d32[_0x4e2a('0x2a')]({'type':'insertion','content':_0x3f1024(_0x3e4024,_0x4e2a('0x3a'),this[_0x4e2a('0x38')](_0x26791a[_0x4e2a('0x39')],_0x26791a[_0x4e2a('0x20')]))});continue;case _0x4e2a('0x3'):case _0x4e2a('0x30'):_0x418d32[_0x4e2a('0x2a')]({'type':_0x4e2a('0x9'),'content':_0x3f1024(_0x3e4024,_0x4e2a('0xb'),this[_0x4e2a('0x38')](_0x26791a['element'],_0x26791a[_0x4e2a('0x20')]))});continue;case'addContainer':_0x418d32[_0x4e2a('0x2a')]({'type':'insertion','content':_0x3f1024(_0x3e4024,_0x4e2a('0x2b'),this[_0x4e2a('0x38')](_0x26791a[_0x4e2a('0x39')],_0x26791a[_0x4e2a('0x20')]))});continue;case'removeContainer':_0x418d32[_0x4e2a('0x2a')]({'type':'deletion','content':_0x3f1024(_0x3e4024,_0x4e2a('0x29'),this[_0x4e2a('0x38')](_0x26791a['element'],_0x26791a[_0x4e2a('0x20')]))});continue;case'addFormat':_0x3b5c37['push'](_0x26791a[_0x4e2a('0x16')]);continue;case _0x4e2a('0x23'):_0x370f5b[_0x4e2a('0x2a')](_0x26791a['key']);continue;default:_0x418d32[_0x4e2a('0x2a')](_0x26791a);}if(_0x3b5c37[_0x4e2a('0x10')]){const _0x404951=_0x3b5c37[_0x4e2a('0x33')](_0x549952=>this[_0x4e2a('0x2c')][_0x4e2a('0x7')](_0x549952)?this[_0x4e2a('0x2c')][_0x4e2a('0x1')](_0x549952):_0x549952)[_0x4e2a('0x46')](',\x20');_0x418d32[_0x4e2a('0x2a')]({'type':_0x4e2a('0x1e'),'content':_0x3f1024(this[_0x4e2a('0x27')],_0x4e2a('0x4'),_0x404951)});}if(_0x370f5b[_0x4e2a('0x10')]){const _0x5494a0=_0x370f5b[_0x4e2a('0x33')](_0x4a57de=>this[_0x4e2a('0x2c')][_0x4e2a('0x7')](_0x4a57de)?this[_0x4e2a('0x2c')][_0x4e2a('0x1')](_0x4a57de):_0x4a57de)['join'](',\x20');_0x418d32[_0x4e2a('0x2a')]({'type':'format','content':_0x3f1024(this[_0x4e2a('0x27')],'*Remove\x20format:*\x20%0',_0x5494a0)});}return _0x418d32;}[_0x4e2a('0x24')](_0x258c4d){for(const _0x4265f8 of this[_0x4e2a('0x11')]){const _0x342d28=_0x4265f8(_0x258c4d);if(_0x342d28&&_0x4e2a('0xc')in _0x342d28)return _0x342d28;}}['_handleAttributeSuggestionDescription'](_0x20623e,_0x12af96){const _0x5b920f=_0x12af96[_0x4e2a('0x18')],_0xd435eb=void 0x0===_0x5b920f['newValue']?_0x4e2a('0x23'):_0x4e2a('0x1c');_0x20623e[_0x4e2a('0x2a')]({'type':_0xd435eb,'key':_0x5b920f[_0x4e2a('0x16')]});}[_0x4e2a('0x0')](_0x497cfc,_0x5a416b){_0x497cfc[_0x4e2a('0x2a')]({'type':_0x4e2a('0x1e'),'content':_0x3f1024(this[_0x4e2a('0x27')],_0x4e2a('0x13'),this[_0x4e2a('0x38')](_0x5a416b[_0x4e2a('0xf')]()[_0x4e2a('0x19')][_0x4e2a('0x40')],0x1))});}[_0x4e2a('0x1a')](_0x75c24f,_0x296d28,_0x300b6b){if(this['_addDescriptionItems'](_0x75c24f,_0x296d28),_0x300b6b&&_0x300b6b[_0x4e2a('0xf')]()&&!_0x296d28[_0x4e2a('0xf')]()[_0x4e2a('0x12')][_0x4e2a('0x34')](_0x300b6b[_0x4e2a('0xf')]()['start'])){const _0x1463ce=_0x75c24f[_0x75c24f[_0x4e2a('0x10')]-0x1],_0x53acc0=_0x4e2a('0x35')==_0x296d28[_0x4e2a('0xc')]?_0x4e2a('0x15'):'remove';_0x1463ce&&'text'==_0x1463ce[_0x4e2a('0xc')]&&(_0x1463ce[_0x53acc0]+='\x0a');}}}
|
package/src/trackchanges.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ import TrackChangesUI from './trackchangesui';
|
|
|
11
11
|
import TrackChangesEditing from './trackchangesediting';
|
|
12
12
|
import 'ckeditor5-collaboration/src/collaboration-core';
|
|
13
13
|
import type { default as Suggestion, SuggestionJSON } from './suggestion';
|
|
14
|
-
import type SuggestionThreadView from './ui/view/suggestionthreadview';
|
|
15
14
|
/**
|
|
16
15
|
* A plugin that provides track changes mode for the editor. In track changes mode, all insertions are visually marked and all deletions
|
|
17
16
|
* are not deleted but also visually marked. Unsupported commands are disabled when the editor is in the track changes mode.
|
|
@@ -104,72 +103,6 @@ export default class TrackChanges extends Plugin {
|
|
|
104
103
|
*/
|
|
105
104
|
getSuggestion(id: string): Suggestion;
|
|
106
105
|
}
|
|
107
|
-
/**
|
|
108
|
-
* The configuration of the track changes feature.
|
|
109
|
-
*
|
|
110
|
-
* Example:
|
|
111
|
-
*
|
|
112
|
-
* ```ts
|
|
113
|
-
* ClassicEditor
|
|
114
|
-
* .create( {
|
|
115
|
-
* // Track changes feature configuration.
|
|
116
|
-
* trackChanges: {
|
|
117
|
-
* // Do not allow users to comment suggestions (default is `false`).
|
|
118
|
-
* disableComments: true,
|
|
119
|
-
* // Do not track styling and formatting changes (default is `default`).
|
|
120
|
-
* trackFormatChanges: 'never',
|
|
121
|
-
* // Merges suggestion changes inside a block. (default is `true`).
|
|
122
|
-
* mergeNestedSuggestions: true
|
|
123
|
-
* }
|
|
124
|
-
* } )
|
|
125
|
-
* .then( ... )
|
|
126
|
-
* .catch( ... );
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
130
|
-
*/
|
|
131
|
-
export interface TrackChangesConfig {
|
|
132
|
-
/**
|
|
133
|
-
* A property that specifies if the comments for suggestions are enabled or disabled.
|
|
134
|
-
* When the option is set to `true`, the comment thread UI for suggestions will be hidden
|
|
135
|
-
* and commenting suggestions will be disabled.
|
|
136
|
-
*
|
|
137
|
-
* Suggestion thread views will be marked with the additional `ck-suggestion--disabled-comments` class when the suggestion comments
|
|
138
|
-
* are disabled.
|
|
139
|
-
*/
|
|
140
|
-
disableComments: boolean;
|
|
141
|
-
/**
|
|
142
|
-
* A property that specifies whether format changes should be tracked.
|
|
143
|
-
*
|
|
144
|
-
* Format changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
|
|
145
|
-
*
|
|
146
|
-
* Possible values are:
|
|
147
|
-
*
|
|
148
|
-
* * `'always'` - all changes are going to be tracked independently (without merging).
|
|
149
|
-
* * `'default'` - format changes made inside your own insertion suggestion will be merged with it.
|
|
150
|
-
* * `'never'` - format changes will not be tracked.
|
|
151
|
-
*
|
|
152
|
-
* Defaults to `'default'`.
|
|
153
|
-
*/
|
|
154
|
-
trackFormatChanges: 'never' | 'default' | 'always';
|
|
155
|
-
/**
|
|
156
|
-
* Specifies whether suggestions on an object (e.g. image, table) should be automatically merged
|
|
157
|
-
* with suggestions inside the object (e.g. image caption, table cell).
|
|
158
|
-
*
|
|
159
|
-
* For example, when set to `true`, creating a table and writing some text inside the table will result in one suggestion.
|
|
160
|
-
* When set to `false`, it will be two separate suggestions, one for the inserted table and one for the inserted text.
|
|
161
|
-
*
|
|
162
|
-
* Keep in mind that only suggestions from the same author and of the same type are merged this way.
|
|
163
|
-
*/
|
|
164
|
-
mergeNestedSuggestions: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* A view class to be used to create suggestion thread views.
|
|
167
|
-
*
|
|
168
|
-
* {@link module:track-changes/ui/view/suggestionthreadview~SuggestionThreadView} is used by default
|
|
169
|
-
* when this property is not set.
|
|
170
|
-
*/
|
|
171
|
-
SuggestionThreadView?: typeof SuggestionThreadView;
|
|
172
|
-
}
|
|
173
106
|
/**
|
|
174
107
|
* Track changes adapter.
|
|
175
108
|
*
|
|
@@ -235,9 +168,12 @@ export interface TrackChangesAdapter {
|
|
|
235
168
|
*/
|
|
236
169
|
updateSuggestion(id: string, suggestionData: UpdateSuggestionInput): Promise<void>;
|
|
237
170
|
}
|
|
238
|
-
export
|
|
171
|
+
export interface SuggestionData extends SuggestionJSON {
|
|
172
|
+
/**
|
|
173
|
+
* Original suggestion ID from which the current one was split.
|
|
174
|
+
*/
|
|
239
175
|
originalSuggestionId?: string | null;
|
|
240
|
-
}
|
|
176
|
+
}
|
|
241
177
|
export type AddSuggestionInput = Omit<SuggestionData, 'authorId' | 'createdAt'>;
|
|
242
178
|
export type UpdateSuggestionInput = Partial<Pick<SuggestionJSON, 'hasComments' | 'attributes'>> & {
|
|
243
179
|
state?: 'open' | 'accepted' | 'rejected';
|
package/src/trackchanges.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x5cc4=['getSuggestion','addSuggestionData','getSuggestions','editor','Comments','addSuggestion','get','adapter','plugins','TrackChanges'];(function(_0x1c4016,_0x5cc4ab){var _0x52c1b4=function(_0x4da4d3){while(--_0x4da4d3){_0x1c4016['push'](_0x1c4016['shift']());}};_0x52c1b4(++_0x5cc4ab);}(_0x5cc4,0xda));var _0x52c1=function(_0x1c4016,_0x5cc4ab){_0x1c4016=_0x1c4016-0x0;var _0x52c1b4=_0x5cc4[_0x1c4016];return _0x52c1b4;};import{Plugin as _0x25f2e4}from'ckeditor5/src/core';import _0x3ac2f1 from'./trackchangesui';import _0x5eae06 from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0x25f2e4{static get['requires'](){return[_0x5eae06,_0x3ac2f1,_0x52c1('0x6')];}static get['pluginName'](){return _0x52c1('0x1');}set[_0x52c1('0x9')](_0x40ab1a){this[_0x52c1('0x5')]['plugins'][_0x52c1('0x8')](_0x5eae06)['adapter']=_0x40ab1a;}get[_0x52c1('0x9')](){return this['editor'][_0x52c1('0x0')][_0x52c1('0x8')](_0x5eae06)['adapter'];}[_0x52c1('0x7')](_0x43fa56){return this[_0x52c1('0x5')][_0x52c1('0x0')][_0x52c1('0x8')](_0x5eae06)[_0x52c1('0x3')](_0x43fa56);}[_0x52c1('0x4')]({skipNotAttached:_0xb91128=!0x1,toJSON:_0x1f2c51=!0x1}={}){return this[_0x52c1('0x5')]['plugins'][_0x52c1('0x8')](_0x5eae06)[_0x52c1('0x4')]({'skipNotAttached':_0xb91128,'toJSON':_0x1f2c51});}['getSuggestion'](_0xd0ad59){return this[_0x52c1('0x5')][_0x52c1('0x0')][_0x52c1('0x8')](_0x5eae06)[_0x52c1('0x2')](_0xd0ad59);}}
|
|
@@ -13,20 +13,20 @@ import type SuggestionThreadView from './ui/view/suggestionthreadview';
|
|
|
13
13
|
* Example:
|
|
14
14
|
*
|
|
15
15
|
* ```ts
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
16
|
+
* ClassicEditor
|
|
17
|
+
* .create( {
|
|
18
|
+
* // Track changes feature configuration.
|
|
19
|
+
* trackChanges: {
|
|
20
|
+
* // Do not allow users to comment suggestions (default is `false`).
|
|
21
|
+
* disableComments: true,
|
|
22
|
+
* // Do not track styling and formatting changes (default is `default`).
|
|
23
|
+
* trackFormatChanges: 'never',
|
|
24
|
+
* // Merges suggestion changes inside a block. (default is `true`).
|
|
25
|
+
* mergeNestedSuggestions: true
|
|
26
|
+
* }
|
|
27
|
+
* } )
|
|
28
|
+
* .then( ... )
|
|
29
|
+
* .catch( ... );
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
@@ -42,15 +42,18 @@ export interface TrackChangesConfig {
|
|
|
42
42
|
*/
|
|
43
43
|
disableComments: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* A property that specifies whether
|
|
45
|
+
* A property that specifies whether formatting changes should be tracked.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
47
|
+
* Formatting changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
|
|
48
|
+
*
|
|
49
|
+
* By default, formatting changes are tracked. However, if you make a formatting change inside your own insertion suggestion, it
|
|
50
|
+
* is immediately applied, without creating a suggestion.
|
|
48
51
|
*
|
|
49
52
|
* Possible values are:
|
|
50
53
|
*
|
|
51
|
-
* * `'
|
|
52
|
-
* * `'
|
|
53
|
-
* * `'never'` - format changes will not be
|
|
54
|
+
* * `'default'` - format changes are tracked, but when made inside your own insertion suggestion, they will be immediately applied.
|
|
55
|
+
* * `'always'` - format changes will always be tracked, even inside your own insertion suggestion.
|
|
56
|
+
* * `'never'` - format changes will never be tracked (suggestions for such changes will not be created).
|
|
54
57
|
*
|
|
55
58
|
* Defaults to `'default'`.
|
|
56
59
|
*/
|