@ckeditor/ckeditor5-document-outline 38.1.1 → 38.2.0-alpha.1

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.
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xc873=['data','model','_getOutlineDefinitions','document','includes','getChildren','get','change','push','_deriveHeadingElementsFromConversion','pluginName','indexOf','_headingNames','getRootNames','_getActiveHeading','afterInit','length','createElement','fire','backward','editor','item','level','_getHeadingNames','text','toModel','domConverter','modelElement','getChild','selection','init','name','view','element'];(function(_0x386312,_0xc8734a){const _0x2408a2=function(_0x14e865){while(--_0x14e865){_0x386312['push'](_0x386312['shift']());}};_0x2408a2(++_0xc8734a);}(_0xc873,0x151));const _0x2408=function(_0x386312,_0xc8734a){_0x386312=_0x386312-0x0;let _0x2408a2=_0xc873[_0x386312];return _0x2408a2;};import{Plugin as _0x14c693}from'ckeditor5/src/core';import{debounce as _0xf03259}from'lodash-es';import{TreeWalker as _0x2c3077}from'ckeditor5/src/engine';import{getElementText as _0xa09c59,getDefaultFeatureHeadingNames as _0x6d99d3}from'./utils';import{diff as _0x260696,diffToChanges as _0x3c62c5}from'ckeditor5/src/utils';export default class n extends _0x14c693{constructor(){super(...arguments),this[_0x2408('0xf')]=[];}static get[_0x2408('0xd')](){return'DocumentOutlineUtils';}[_0x2408('0x21')](){const _0x207e7b=this['editor'];this[_0x2408('0xf')]=this[_0x2408('0x1a')]();let _0x498430=[];_0x207e7b[_0x2408('0x4')][_0x2408('0x6')]['on'](_0x2408('0xa'),_0xf03259(()=>{const _0x1fa2e7=_0x498430;_0x498430=this['_getOutlineDefinitions']();const _0x47fa0f=_0x260696(_0x1fa2e7,_0x498430,(_0x1e944d,_0x55327d)=>_0x1e944d[_0x2408('0x19')]===_0x55327d[_0x2408('0x19')]&&_0x1e944d[_0x2408('0x1b')]===_0x55327d['text']&&_0x1e944d[_0x2408('0x1e')]===_0x55327d[_0x2408('0x1e')]),_0x390acd=_0x3c62c5(_0x47fa0f,_0x498430),_0x2133cb=this[_0x2408('0x11')](),_0x34aca4=_0x498430['findIndex'](_0x2d050a=>_0x2d050a[_0x2408('0x1e')]===_0x2133cb);_0x390acd[_0x2408('0x13')]&&this[_0x2408('0x15')](_0x2408('0xa'),{'outlineDefinitions':_0x498430,'activeItemIndex':_0x34aca4,'outlineChanges':_0x390acd}),this[_0x2408('0x15')]('activeItemIndex',{'index':_0x34aca4});},0xfa,{'leading':!0x0,'trailing':!0x0}));}[_0x2408('0x12')](){this[_0x2408('0xf')][_0x2408('0x13')]||this[_0x2408('0xc')]();}[_0x2408('0x5')](){const _0x713817=this[_0x2408('0x17')],_0x73fd7e=[],_0x527f47=this[_0x2408('0xf')];for(const _0x2763de of _0x713817[_0x2408('0x4')][_0x2408('0x6')][_0x2408('0x10')]())_0x2d839c(_0x713817[_0x2408('0x4')][_0x2408('0x6')]['getRoot'](_0x2763de));function _0x2d839c(_0x50db75){for(const _0x112b81 of _0x50db75[_0x2408('0x8')]())_0x112b81['is'](_0x2408('0x2'))&&(_0x527f47['includes'](_0x112b81[_0x2408('0x0')])&&_0x73fd7e[_0x2408('0xb')]({'level':_0x527f47[_0x2408('0xe')](_0x112b81[_0x2408('0x0')])+0x1,'text':_0xa09c59(_0x112b81),'modelElement':_0x112b81}),_0x2d839c(_0x112b81));}return _0x73fd7e;}['_getActiveHeading'](){const _0x2a433f=this[_0x2408('0x17')][_0x2408('0x4')][_0x2408('0x6')][_0x2408('0x20')]['getFirstPosition'](),_0x3c246e=new _0x2c3077({'direction':_0x2408('0x16'),'startPosition':_0x2a433f});for(const _0x335df4 of _0x3c246e)if(_0x335df4[_0x2408('0x18')]['is'](_0x2408('0x2'))&&this[_0x2408('0xf')][_0x2408('0x7')](_0x335df4[_0x2408('0x18')][_0x2408('0x0')]))return _0x335df4['item'];}[_0x2408('0x1a')](){const _0x1bff0e=this[_0x2408('0x17')]['config'][_0x2408('0x9')]('documentOutline.headings');return _0x1bff0e||_0x6d99d3(this[_0x2408('0x17')]);}['_deriveHeadingElementsFromConversion'](){const _0x1f47ba=this[_0x2408('0x17')],_0x451ffc=['h1','h2','h3','h4','h5','h6'],_0x13f30a=[];for(const _0x4ed10b of _0x451ffc){const _0x5e793a=_0x1f47ba['editing'][_0x2408('0x1')][_0x2408('0x1d')]['domToView'](document[_0x2408('0x14')](_0x4ed10b)),_0x3d1996=_0x1f47ba[_0x2408('0x3')][_0x2408('0x1c')](_0x5e793a)[_0x2408('0x1f')](0x0);(null==_0x3d1996?void 0x0:_0x3d1996['is'](_0x2408('0x2')))&&_0x13f30a['push'](_0x3d1996[_0x2408('0x0')]);}this[_0x2408('0xf')]=_0x13f30a;}}
23
+ const _0x1003=['get','view','_getActiveHeading','domToView','documentOutline.headings','toModel','length','editing','text','indexOf','fire','change','findIndex','DocumentOutlineUtils','modelElement','data','push','element','domConverter','getRootNames','model','editor','_headingNames','selection','level','_deriveHeadingElementsFromConversion','createElement','name','_getOutlineDefinitions','item','pluginName','backward','getChild','document','getRoot','getChildren','activeItemIndex'];(function(_0xf19fbe,_0x10033d){const _0x326a58=function(_0x55cf1f){while(--_0x55cf1f){_0xf19fbe['push'](_0xf19fbe['shift']());}};_0x326a58(++_0x10033d);}(_0x1003,0xa3));const _0x326a=function(_0xf19fbe,_0x10033d){_0xf19fbe=_0xf19fbe-0x0;let _0x326a58=_0x1003[_0xf19fbe];return _0x326a58;};import{Plugin as _0x1914e1}from'ckeditor5/src/core.js';import{debounce as _0x25e557}from'lodash-es';import{TreeWalker as _0x5d0106}from'ckeditor5/src/engine.js';import{getElementText as _0x84b531,getDefaultFeatureHeadingNames as _0x3dff5a}from'./utils.js';import{diff as _0x1020cf,diffToChanges as _0x4bbedf}from'ckeditor5/src/utils.js';export default class n extends _0x1914e1{constructor(){super(...arguments),this['_headingNames']=[];}static get[_0x326a('0xf')](){return _0x326a('0x23');}['init'](){const _0xe993ef=this[_0x326a('0x6')];this[_0x326a('0x7')]=this['_getHeadingNames']();let _0x3b73fb=[];_0xe993ef[_0x326a('0x5')][_0x326a('0x12')]['on'](_0x326a('0x21'),_0x25e557(()=>{const _0x39e84d=_0x3b73fb;_0x3b73fb=this[_0x326a('0xd')]();const _0x86d580=_0x1020cf(_0x39e84d,_0x3b73fb,(_0xb64f81,_0x4d0220)=>_0xb64f81[_0x326a('0x9')]===_0x4d0220[_0x326a('0x9')]&&_0xb64f81[_0x326a('0x1e')]===_0x4d0220[_0x326a('0x1e')]&&_0xb64f81[_0x326a('0x24')]===_0x4d0220['modelElement']),_0x36de55=_0x4bbedf(_0x86d580,_0x3b73fb),_0x1c8991=this[_0x326a('0x18')](),_0xa8428b=_0x3b73fb[_0x326a('0x22')](_0x5a5e4a=>_0x5a5e4a[_0x326a('0x24')]===_0x1c8991);_0x36de55[_0x326a('0x1c')]&&this[_0x326a('0x20')](_0x326a('0x21'),{'outlineDefinitions':_0x3b73fb,'activeItemIndex':_0xa8428b,'outlineChanges':_0x36de55}),this[_0x326a('0x20')](_0x326a('0x15'),{'index':_0xa8428b});},0xfa,{'leading':!0x0,'trailing':!0x0}));}['afterInit'](){this[_0x326a('0x7')][_0x326a('0x1c')]||this[_0x326a('0xa')]();}[_0x326a('0xd')](){const _0x124e5a=this[_0x326a('0x6')],_0x3a8537=[],_0xe5e05f=this[_0x326a('0x7')];for(const _0x40d776 of _0x124e5a[_0x326a('0x5')][_0x326a('0x12')][_0x326a('0x4')]())_0x56a7d6(_0x124e5a['model'][_0x326a('0x12')][_0x326a('0x13')](_0x40d776));function _0x56a7d6(_0x281a74){for(const _0x59d728 of _0x281a74[_0x326a('0x14')]())_0x59d728['is'](_0x326a('0x2'))&&(_0xe5e05f['includes'](_0x59d728[_0x326a('0xc')])&&_0x3a8537[_0x326a('0x1')]({'level':_0xe5e05f[_0x326a('0x1f')](_0x59d728[_0x326a('0xc')])+0x1,'text':_0x84b531(_0x59d728),'modelElement':_0x59d728}),_0x56a7d6(_0x59d728));}return _0x3a8537;}[_0x326a('0x18')](){const _0x2e6111=this[_0x326a('0x6')][_0x326a('0x5')]['document'][_0x326a('0x8')]['getFirstPosition'](),_0x49b1cf=new _0x5d0106({'direction':_0x326a('0x10'),'startPosition':_0x2e6111});for(const _0x506d50 of _0x49b1cf)if(_0x506d50[_0x326a('0xe')]['is']('element')&&this[_0x326a('0x7')]['includes'](_0x506d50[_0x326a('0xe')][_0x326a('0xc')]))return _0x506d50[_0x326a('0xe')];}['_getHeadingNames'](){const _0x4d4674=this[_0x326a('0x6')]['config'][_0x326a('0x16')](_0x326a('0x1a'));return _0x4d4674||_0x3dff5a(this['editor']);}[_0x326a('0xa')](){const _0x2de340=this['editor'],_0x2bf054=['h1','h2','h3','h4','h5','h6'],_0x4a5f35=[];for(const _0x2d6e2b of _0x2bf054){const _0x5d3bf4=_0x2de340[_0x326a('0x1d')][_0x326a('0x17')][_0x326a('0x3')][_0x326a('0x19')](document[_0x326a('0xb')](_0x2d6e2b)),_0x52acbf=_0x2de340[_0x326a('0x0')][_0x326a('0x1b')](_0x5d3bf4)[_0x326a('0x11')](0x0);(null==_0x52acbf?void 0x0:_0x52acbf['is']('element'))&&_0x4a5f35[_0x326a('0x1')](_0x52acbf[_0x326a('0xc')]);}this[_0x326a('0x7')]=_0x4a5f35;}}
@@ -1,55 +1,55 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline/documentoutline/ui/documentoutlineitemview
7
- */
8
- import { View } from 'ckeditor5/src/ui';
9
- import { type Locale } from 'ckeditor5/src/utils';
10
- /**
11
- * An item of the document outline.
12
- */
13
- export default class DocumentOutlineItemView extends View {
14
- /**
15
- * The textual content of the item.
16
- *
17
- * @observable
18
- */
19
- text: string;
20
- /**
21
- * The level of heading nesting in the document.
22
- *
23
- * @observable
24
- */
25
- level: number;
26
- /**
27
- * Indicates whether the given item is currently active.
28
- *
29
- * @observable
30
- */
31
- isActive: boolean;
32
- /**
33
- * Indicates whether the heading doesn't have any text.
34
- *
35
- * @observable
36
- */
37
- isEmpty: boolean;
38
- /**
39
- * @inheritDoc
40
- */
41
- constructor(locale: Locale, showEmptyHeadingText?: boolean);
42
- /**
43
- * Scrolls to this item in the document.
44
- */
45
- scrollTo(): void;
46
- }
47
- /**
48
- * Fired whenever an item in the document outline is clicked.
49
- *
50
- * @eventName ~DocumentOutlineItemView#click
51
- */
52
- export type DocumentOutlineItemViewClickEvent = {
53
- name: 'click';
54
- args: [];
55
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline/documentoutline/ui/documentoutlineitemview
7
+ */
8
+ import { View } from 'ckeditor5/src/ui.js';
9
+ import { type Locale } from 'ckeditor5/src/utils.js';
10
+ /**
11
+ * An item of the document outline.
12
+ */
13
+ export default class DocumentOutlineItemView extends View {
14
+ /**
15
+ * The textual content of the item.
16
+ *
17
+ * @observable
18
+ */
19
+ text: string;
20
+ /**
21
+ * The level of heading nesting in the document.
22
+ *
23
+ * @observable
24
+ */
25
+ level: number;
26
+ /**
27
+ * Indicates whether the given item is currently active.
28
+ *
29
+ * @observable
30
+ */
31
+ isActive: boolean;
32
+ /**
33
+ * Indicates whether the heading doesn't have any text.
34
+ *
35
+ * @observable
36
+ */
37
+ isEmpty: boolean;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ constructor(locale: Locale, showEmptyHeadingText?: boolean);
42
+ /**
43
+ * Scrolls to this item in the document.
44
+ */
45
+ scrollTo(): void;
46
+ }
47
+ /**
48
+ * Fired whenever an item in the document outline is clicked.
49
+ *
50
+ * @eventName ~DocumentOutlineItemView#click
51
+ */
52
+ export type DocumentOutlineItemViewClickEvent = {
53
+ name: 'click';
54
+ args: [];
55
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{View as _0x54ebca}from'ckeditor5/src/ui';import{scrollAncestorsToShowTarget as _0x4dd23f}from'ckeditor5/src/utils';export default class j extends _0x54ebca{constructor(_0x34aca1,_0x3924ad=!0x1){super(_0x34aca1);const t=_0x34aca1['t'],_0xe20c39=this['bindTemplate'],_0x31156a=_0x3924ad?'['+t('Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0x28d7c6=>!_0x28d7c6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0xe20c39['to']('level',_0x13952b=>'ck-document-outline__item_level-'+_0x13952b),_0xe20c39['if']('isActive','ck-document-outline__item_active'),_0xe20c39['if']('isEmpty','ck-document-outline__item_empty')],'title':_0xe20c39['to']('text')},'children':[{'text':_0xe20c39['to']('text',_0x121710=>_0x121710||_0x31156a)}],'on':{'click':_0xe20c39['to']('click')}});}['scrollTo'](){_0x4dd23f(this['element'],0x14);}}
23
+ import{View as _0x427460}from'ckeditor5/src/ui.js';import{scrollAncestorsToShowTarget as _0x390ff2}from'ckeditor5/src/utils.js';export default class $ extends _0x427460{constructor(_0x4b2bcd,_0x191c9d=!0x1){super(_0x4b2bcd);const t=_0x4b2bcd['t'],_0xa6cce1=this['bindTemplate'],_0x203c0c=_0x191c9d?'['+t('Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0x18774a=>!_0x18774a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0xa6cce1['to']('level',_0x28aca5=>'ck-document-outline__item_level-'+_0x28aca5),_0xa6cce1['if']('isActive','ck-document-outline__item_active'),_0xa6cce1['if']('isEmpty','ck-document-outline__item_empty')],'title':_0xa6cce1['to']('text')},'children':[{'text':_0xa6cce1['to']('text',_0x2fd993=>_0x2fd993||_0x203c0c)}],'on':{'click':_0xa6cce1['to']('click')}});}['scrollTo'](){_0x390ff2(this['element'],0x14);}}
@@ -1,44 +1,44 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline/documentoutline/ui/documentoutlineview
7
- */
8
- import { View, type ViewCollection } from 'ckeditor5/src/ui';
9
- import { type Locale, type diffToChanges } from 'ckeditor5/src/utils';
10
- import type { OutlineItemDefinition } from '../documentoutlineutils';
11
- import DocumentOutlineItemView from './documentoutlineitemview';
12
- /**
13
- * The document outline panel.
14
- */
15
- export default class DocumentOutlineView extends View {
16
- /**
17
- * A collection of document outline items.
18
- */
19
- readonly items: ViewCollection<DocumentOutlineItemView>;
20
- /**
21
- * Indicates which item is active at the moment.
22
- *
23
- * @observable
24
- */
25
- activeItemIndex: number;
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(locale: Locale, showEmptyHeadingText?: boolean);
30
- /**
31
- * If a heading was added or deleted in the editor, insert or delete it in the document outline.
32
- */
33
- sync(changesInItems: ReturnType<typeof diffToChanges<OutlineItemDefinition>>): void;
34
- }
35
- /**
36
- * Fired whenever an item in the document outline is clicked.
37
- *
38
- * @eventName ~DocumentOutlineView#itemSelected
39
- * @param itemIndex Index of selected item.
40
- */
41
- export type DocumentOutlineViewItemSelectedEvent = {
42
- name: 'itemSelected';
43
- args: [itemIndex: number];
44
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline/documentoutline/ui/documentoutlineview
7
+ */
8
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
9
+ import { type Locale, type diffToChanges } from 'ckeditor5/src/utils.js';
10
+ import type { OutlineItemDefinition } from '../documentoutlineutils.js';
11
+ import DocumentOutlineItemView from './documentoutlineitemview.js';
12
+ /**
13
+ * The document outline panel.
14
+ */
15
+ export default class DocumentOutlineView extends View {
16
+ /**
17
+ * A collection of document outline items.
18
+ */
19
+ readonly items: ViewCollection<DocumentOutlineItemView>;
20
+ /**
21
+ * Indicates which item is active at the moment.
22
+ *
23
+ * @observable
24
+ */
25
+ activeItemIndex: number;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(locale: Locale, showEmptyHeadingText?: boolean);
30
+ /**
31
+ * If a heading was added or deleted in the editor, insert or delete it in the document outline.
32
+ */
33
+ sync(changesInItems: ReturnType<typeof diffToChanges<OutlineItemDefinition>>): void;
34
+ }
35
+ /**
36
+ * Fired whenever an item in the document outline is clicked.
37
+ *
38
+ * @eventName ~DocumentOutlineView#itemSelected
39
+ * @param itemIndex Index of selected item.
40
+ */
41
+ export type DocumentOutlineViewItemSelectedEvent = {
42
+ name: 'itemSelected';
43
+ args: [itemIndex: number];
44
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{View as _0x1e0413}from'ckeditor5/src/ui';import _0x506bda from'./documentoutlineitemview';export default class w extends _0x1e0413{constructor(_0x3fe8e6,_0x2b17e7=!0x1){super(_0x3fe8e6);const t=_0x3fe8e6['t'];this['showEmptyHeadingText']=_0x2b17e7,this['set']('activeItemIndex',-0x1),this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x2cf249,_0x432f25,_0x3717c4,_0x5bd7af)=>{this['_setActiveItem'](_0x5bd7af,_0x3717c4);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x3fe8e6['contentLanguageDirection'],'data-document-outline-empty-placeholder':t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x4720d9){_0x4720d9['forEach'](_0x5669e2=>{'insert'==_0x5669e2['type']?this['_insertItem'](_0x5669e2['index'],..._0x5669e2['values']):'delete'==_0x5669e2['type']&&this['_deleteItem'](_0x5669e2['index'],_0x5669e2['howMany']);});}['_setActiveItem'](_0x467a2,_0xdef60e){if(-0x1!==_0x467a2){const _0x50e750=this['items']['get'](_0x467a2);_0x50e750&&(_0x50e750['isActive']=!0x1);}-0x1!==_0xdef60e&&(this['items']['get'](_0xdef60e)['isActive']=!0x0,this['items']['get'](_0xdef60e)['scrollTo']());}['_insertItem'](_0x2000af,..._0x1bcc48){const _0x39feee=_0x1bcc48['map']((_0x195dc4,_0xd994a)=>{const _0x3e0d75=new _0x506bda(this['locale'],this['showEmptyHeadingText']);return _0x3e0d75['text']=_0x195dc4['text'],_0x3e0d75['level']=_0x195dc4['level'],_0x2000af+_0xd994a===this['activeItemIndex']&&(_0x3e0d75['isActive']=!0x0),_0x3e0d75;});this['items']['addMany'](_0x39feee,_0x2000af);}['_deleteItem'](_0x265bc0,_0x153015){do{this['items']['remove'](_0x265bc0);}while(--_0x153015);}['_handleItemClick'](_0x2df037){const _0x6002a8=this['items']['getIndex'](_0x2df037['source']);this['fire']('itemSelected',_0x6002a8);}}
23
+ import{View as _0x42d6eb}from'ckeditor5/src/ui.js';import _0x4be165 from'./documentoutlineitemview.js';export default class w extends _0x42d6eb{constructor(_0x31ed22,_0x56d469=!0x1){super(_0x31ed22);const t=_0x31ed22['t'];this['showEmptyHeadingText']=_0x56d469,this['set']('activeItemIndex',-0x1),this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x42b4a9,_0x1a99a2,_0x4681fd,_0x419e17)=>{this['_setActiveItem'](_0x419e17,_0x4681fd);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x31ed22['contentLanguageDirection'],'data-document-outline-empty-placeholder':t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0xdd10ab){_0xdd10ab['forEach'](_0x170b08=>{'insert'==_0x170b08['type']?this['_insertItem'](_0x170b08['index'],..._0x170b08['values']):'delete'==_0x170b08['type']&&this['_deleteItem'](_0x170b08['index'],_0x170b08['howMany']);});}['_setActiveItem'](_0x42f169,_0x4c5b4f){if(-0x1!==_0x42f169){const _0x132168=this['items']['get'](_0x42f169);_0x132168&&(_0x132168['isActive']=!0x1);}-0x1!==_0x4c5b4f&&(this['items']['get'](_0x4c5b4f)['isActive']=!0x0,this['items']['get'](_0x4c5b4f)['scrollTo']());}['_insertItem'](_0x46a03,..._0x37f2d5){const _0x4b2f03=_0x37f2d5['map']((_0x284ac8,_0x53bb44)=>{const _0x3f4840=new _0x4be165(this['locale'],this['showEmptyHeadingText']);return _0x3f4840['text']=_0x284ac8['text'],_0x3f4840['level']=_0x284ac8['level'],_0x46a03+_0x53bb44===this['activeItemIndex']&&(_0x3f4840['isActive']=!0x0),_0x3f4840;});this['items']['addMany'](_0x4b2f03,_0x46a03);}['_deleteItem'](_0x3c2882,_0x3e0dbf){do{this['items']['remove'](_0x3c2882);}while(--_0x3e0dbf);}['_handleItemClick'](_0x471782){const _0x26da77=this['items']['getIndex'](_0x471782['source']);this['fire']('itemSelected',_0x26da77);}}
@@ -1,17 +1,17 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline/documentoutline/utils
7
- */
8
- import { type Element } from 'ckeditor5/src/engine';
9
- import { type Editor } from 'ckeditor5/src/core';
10
- /**
11
- * Returns all text contents that are inside the given element and all its children.
12
- */
13
- export declare function getElementText(element: Element): string;
14
- /**
15
- * Returns a list of standard headings or GHS headings configured in the editor.
16
- */
17
- export declare function getDefaultFeatureHeadingNames(editor: Editor): Array<string>;
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline/documentoutline/utils
7
+ */
8
+ import { type Element } from 'ckeditor5/src/engine.js';
9
+ import { type Editor } from 'ckeditor5/src/core.js';
10
+ /**
11
+ * Returns all text contents that are inside the given element and all its children.
12
+ */
13
+ export declare function getElementText(element: Element): string;
14
+ /**
15
+ * Returns a list of standard headings or GHS headings configured in the editor.
16
+ */
17
+ export declare function getDefaultFeatureHeadingNames(editor: Editor): Array<string>;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x26c8=['heading.options','reduce','model','htmlH1','plugins','paragraph','GeneralHtmlSupport','data','getChildren','config','htmlH3','htmlH5'];(function(_0x1af8ba,_0x26c8ce){const _0x1834c1=function(_0x3efd33){while(--_0x3efd33){_0x1af8ba['push'](_0x1af8ba['shift']());}};_0x1834c1(++_0x26c8ce);}(_0x26c8,0xd5));const _0x1834=function(_0x1af8ba,_0x26c8ce){_0x1af8ba=_0x1af8ba-0x0;let _0x1834c1=_0x26c8[_0x1af8ba];return _0x1834c1;};import{Text as _0x40d73d}from'ckeditor5/src/engine';export function getElementText(_0x478263){let _0xf9c57f='';for(const _0x5f3dff of _0x478263[_0x1834('0xb')]())_0x5f3dff instanceof _0x40d73d&&(_0xf9c57f+=_0x5f3dff[_0x1834('0xa')]);return _0xf9c57f;}export function getDefaultFeatureHeadingNames(_0x54b83c){const _0x183e00=_0x54b83c[_0x1834('0x0')]['get'](_0x1834('0x3'));return _0x183e00?_0x183e00[_0x1834('0x4')]((_0x38c5bd,_0x3f421a)=>(_0x1834('0x8')!==_0x3f421a[_0x1834('0x5')]&&_0x38c5bd['push'](_0x3f421a[_0x1834('0x5')]),_0x38c5bd),[]):_0x54b83c[_0x1834('0x7')]['has'](_0x1834('0x9'))?[_0x1834('0x6'),'htmlH2',_0x1834('0x1'),'htmlH4',_0x1834('0x2'),'htmlH6']:[];}
23
+ const _0x1cf1=['plugins','paragraph','get','model','htmlH5','GeneralHtmlSupport','htmlH4','heading.options','getChildren','data','reduce','has'];(function(_0x335af0,_0x1cf15e){const _0x5563eb=function(_0x742e28){while(--_0x742e28){_0x335af0['push'](_0x335af0['shift']());}};_0x5563eb(++_0x1cf15e);}(_0x1cf1,0x71));const _0x5563=function(_0x335af0,_0x1cf15e){_0x335af0=_0x335af0-0x0;let _0x5563eb=_0x1cf1[_0x335af0];return _0x5563eb;};import{Text as _0x5be492}from'ckeditor5/src/engine.js';export function getElementText(_0x10d53d){let _0x157948='';for(const _0x375b4c of _0x10d53d[_0x5563('0x3')]())_0x375b4c instanceof _0x5be492&&(_0x157948+=_0x375b4c[_0x5563('0x4')]);return _0x157948;}export function getDefaultFeatureHeadingNames(_0x1752e8){const _0x29305b=_0x1752e8['config'][_0x5563('0x9')](_0x5563('0x2'));return _0x29305b?_0x29305b[_0x5563('0x5')]((_0x360090,_0xdd7480)=>(_0x5563('0x8')!==_0xdd7480[_0x5563('0xa')]&&_0x360090['push'](_0xdd7480[_0x5563('0xa')]),_0x360090),[]):_0x1752e8[_0x5563('0x7')][_0x5563('0x6')](_0x5563('0x0'))?['htmlH1','htmlH2','htmlH3',_0x5563('0x1'),_0x5563('0xb'),'htmlH6']:[];}
@@ -1,99 +1,99 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline/documentoutline
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import DocumentOutlineUtils from './documentoutline/documentoutlineutils';
11
- import DocumentOutlineUI from './documentoutline/documentoutlineui';
12
- /**
13
- * The document outline feature.
14
- * It allows for an easy access to a predefined list of headings in the document.
15
- */
16
- export default class DocumentOutline extends Plugin {
17
- licenseKey: string;
18
- /**
19
- * @inheritDoc
20
- */
21
- static get requires(): readonly [typeof DocumentOutlineUtils, typeof DocumentOutlineUI];
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "DocumentOutline";
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(editor: Editor);
30
- /**
31
- * @inheritDoc
32
- */
33
- init(): void;
34
- /**
35
- * @inheritDoc
36
- */
37
- destroy(): void;
38
- }
39
- /**
40
- * The configuration of the {@link module:document-outline/documentoutline~DocumentOutline document outline feature}.
41
- *
42
- * ```ts
43
- * ClassicEditor
44
- * .create( editorElement, {
45
- * documentOutline: ... // Document outline feature configuration.
46
- * } )
47
- * .then( /* ... *\/ )
48
- * .catch( /* ... *\/ );
49
- * ```
50
- *
51
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
52
- */
53
- export interface DocumentOutlineConfig {
54
- /**
55
- * The container element for the document outline to render. This should be a reference to an existing
56
- * container element in the DOM.
57
- */
58
- container?: HTMLElement;
59
- /**
60
- * An array of {@glink framework/architecture/editing-engine#model model} element names considered
61
- * as headings in the document outline.
62
- *
63
- * The index of the heading in the array reflects the heading nesting level. It can be used e.g. for reducing
64
- * the number of visible headings.
65
- *
66
- * ```ts
67
- * ClassicEditor
68
- * .create( editorElement, {
69
- * plugins: [ DocumentOutline, /* ... *\/ ],
70
- * documentOutline: {
71
- * headings: [ 'heading1', 'heading2', /* ... *\/ ],
72
- * // ...
73
- * }
74
- * } )
75
- * .then( /* ... *\/ )
76
- * .catch( /* ... *\/ );
77
- * ```
78
- *
79
- * If this configuration is not defined, the feature will use the following defaults instead:
80
- *
81
- * 1. If the {@glink features/headings Headings feature} is loaded, it equals
82
- * * {@link module:heading/headingconfig~HeadingConfig#options `config.heading.options`}.
83
- * * `[ 'heading1', 'heading2', 'heading3' ]` if `config.heading.options` is not defined.
84
- * 2. If the {@glink features/html/general-html-support General HTML Support} feature is loaded, it equals
85
- * `[ 'htmlH1', 'htmlH2', 'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6' ]`.
86
- *
87
- * **Note**: The Headings feature takes precedence over the General HTML Support feature when
88
- * both are loaded.
89
- */
90
- headings?: Array<string>;
91
- /**
92
- * Allows you to display a placeholder text: [Empty heading] for empty headings.
93
- *
94
- * By default, the display of a placeholder is disabled. To enable it, set this parameter to true.
95
- *
96
- * **Note**: This setting also affects Table of contents feature.
97
- */
98
- showEmptyHeadings?: boolean;
99
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline/documentoutline
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
10
+ import DocumentOutlineUtils from './documentoutline/documentoutlineutils.js';
11
+ import DocumentOutlineUI from './documentoutline/documentoutlineui.js';
12
+ /**
13
+ * The document outline feature.
14
+ * It allows for an easy access to a predefined list of headings in the document.
15
+ */
16
+ export default class DocumentOutline extends Plugin {
17
+ licenseKey: string;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get requires(): readonly [typeof DocumentOutlineUtils, typeof DocumentOutlineUI];
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "DocumentOutline";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(editor: Editor);
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ init(): void;
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ destroy(): void;
38
+ }
39
+ /**
40
+ * The configuration of the {@link module:document-outline/documentoutline~DocumentOutline document outline feature}.
41
+ *
42
+ * ```ts
43
+ * ClassicEditor
44
+ * .create( editorElement, {
45
+ * documentOutline: ... // Document outline feature configuration.
46
+ * } )
47
+ * .then( /* ... *\/ )
48
+ * .catch( /* ... *\/ );
49
+ * ```
50
+ *
51
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
52
+ */
53
+ export interface DocumentOutlineConfig {
54
+ /**
55
+ * The container element for the document outline to render. This should be a reference to an existing
56
+ * container element in the DOM.
57
+ */
58
+ container?: HTMLElement;
59
+ /**
60
+ * An array of {@glink framework/architecture/editing-engine#model model} element names considered
61
+ * as headings in the document outline.
62
+ *
63
+ * The index of the heading in the array reflects the heading nesting level. It can be used e.g. for reducing
64
+ * the number of visible headings.
65
+ *
66
+ * ```ts
67
+ * ClassicEditor
68
+ * .create( editorElement, {
69
+ * plugins: [ DocumentOutline, /* ... *\/ ],
70
+ * documentOutline: {
71
+ * headings: [ 'heading1', 'heading2', /* ... *\/ ],
72
+ * // ...
73
+ * }
74
+ * } )
75
+ * .then( /* ... *\/ )
76
+ * .catch( /* ... *\/ );
77
+ * ```
78
+ *
79
+ * If this configuration is not defined, the feature will use the following defaults instead:
80
+ *
81
+ * 1. If the {@glink features/headings Headings feature} is loaded, it equals
82
+ * * {@link module:heading/headingconfig~HeadingConfig#options `config.heading.options`}.
83
+ * * `[ 'heading1', 'heading2', 'heading3' ]` if `config.heading.options` is not defined.
84
+ * 2. If the {@glink features/html/general-html-support General HTML Support} feature is loaded, it equals
85
+ * `[ 'htmlH1', 'htmlH2', 'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6' ]`.
86
+ *
87
+ * **Note**: The Headings feature takes precedence over the General HTML Support feature when
88
+ * both are loaded.
89
+ */
90
+ headings?: Array<string>;
91
+ /**
92
+ * Allows you to display a placeholder text: [Empty heading] for empty headings.
93
+ *
94
+ * By default, the display of a placeholder is disabled. To enable it, set this parameter to true.
95
+ *
96
+ * **Note**: This setting also affects Table of contents feature.
97
+ */
98
+ showEmptyHeadings?: boolean;
99
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1019=['documentOutlineLicenseKeyInvalid','documentOutlineLicenseKeyTrial','documentOutlineLicenseKeyTrialLimit:operations','init','get','config','requires','DocumentOutline','_licenseKeyCheckInterval','documentOutlineLicenseKeyValid','licenseKey','info'];(function(_0x5dc540,_0x1019d2){const _0x5d95ac=function(_0x24803e){while(--_0x24803e){_0x5dc540['push'](_0x5dc540['shift']());}};_0x5d95ac(++_0x1019d2);}(_0x1019,0x1ee));const _0x5d95=function(_0x5dc540,_0x1019d2){_0x5dc540=_0x5dc540-0x0;let _0x5d95ac=_0x1019[_0x5dc540];return _0x5d95ac;};import{Plugin as _0x2e2c9b}from'ckeditor5/src/core';import{CKEditorError as _0x28572e}from'ckeditor5/src/utils';import _0x59ad4e from'./documentoutline/documentoutlineutils';import _0x584b9a from'./documentoutline/documentoutlineui';export default class l extends _0x2e2c9b{static get[_0x5d95('0x4')](){return[_0x59ad4e,_0x584b9a];}static get['pluginName'](){return _0x5d95('0x5');}constructor(_0x3f3dfa){super(_0x3f3dfa),this[_0x5d95('0x6')]=null;}[_0x5d95('0x1')](){const _0x476d25=this['editor'];this['licenseKey']=_0x476d25[_0x5d95('0x3')][_0x5d95('0x2')](_0x5d95('0x8'));const _0xfac9dc=this['editor'];this[_0x5d95('0x6')]=setInterval(()=>{let _0x1c5b51;for(const _0x228449 in _0xfac9dc){const _0x109674=_0x228449,_0x552dcf=_0xfac9dc[_0x109674];if(_0x5d95('0xb')===_0x552dcf||_0x5d95('0xa')===_0x552dcf||_0x5d95('0x7')===_0x552dcf||_0x5d95('0x0')===_0x552dcf){delete _0xfac9dc[_0x109674],_0x1c5b51=_0x552dcf;break;}}if(_0x5d95('0xa')===_0x1c5b51)throw clearInterval(this[_0x5d95('0x6')]),new _0x28572e('document-outline-invalid-license-key',null);if('documentOutlineLicenseKeyTrial'===_0x1c5b51&&console[_0x5d95('0x9')]('You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20document\x20outline\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.'),_0x5d95('0x0')===_0x1c5b51)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x28572e('document-outline-trial-license-key-reached-limit-changes',null);_0x5d95('0x7')===_0x1c5b51&&clearInterval(this[_0x5d95('0x6')]);},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this[_0x5d95('0x6')]);}}
23
+ const _0x2414=['init','get','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20document\x20outline\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','requires','pluginName','editor','destroy','documentOutlineLicenseKeyTrial','licenseKey','DocumentOutline','_licenseKeyCheckInterval','document-outline-trial-license-key-reached-limit-changes','documentOutlineLicenseKeyValid','documentOutlineLicenseKeyInvalid','info','document-outline-invalid-license-key'];(function(_0x18e05b,_0x241472){const _0x319346=function(_0x31df95){while(--_0x31df95){_0x18e05b['push'](_0x18e05b['shift']());}};_0x319346(++_0x241472);}(_0x2414,0xcc));const _0x3193=function(_0x18e05b,_0x241472){_0x18e05b=_0x18e05b-0x0;let _0x319346=_0x2414[_0x18e05b];return _0x319346;};import{Plugin as _0x2c2751}from'ckeditor5/src/core.js';import{CKEditorError as _0x14d66a}from'ckeditor5/src/utils.js';import _0x5b87ca from'./documentoutline/documentoutlineutils.js';import _0x496826 from'./documentoutline/documentoutlineui.js';export default class l extends _0x2c2751{static get[_0x3193('0x7')](){return[_0x5b87ca,_0x496826];}static get[_0x3193('0x8')](){return _0x3193('0xd');}constructor(_0x224402){super(_0x224402),this[_0x3193('0xe')]=null;}[_0x3193('0x4')](){const _0x439f7e=this[_0x3193('0x9')];this[_0x3193('0xc')]=_0x439f7e['config'][_0x3193('0x5')](_0x3193('0xc'));const _0x5c3dca=this[_0x3193('0x9')];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x120bca;for(const _0x26cf70 in _0x5c3dca){const _0x43a2ee=_0x26cf70,_0x12ddb7=_0x5c3dca[_0x43a2ee];if(_0x3193('0xb')===_0x12ddb7||_0x3193('0x1')===_0x12ddb7||_0x3193('0x0')===_0x12ddb7||'documentOutlineLicenseKeyTrialLimit:operations'===_0x12ddb7){delete _0x5c3dca[_0x43a2ee],_0x120bca=_0x12ddb7;break;}}if(_0x3193('0x1')===_0x120bca)throw clearInterval(this[_0x3193('0xe')]),new _0x14d66a(_0x3193('0x3'),null);if(_0x3193('0xb')===_0x120bca&&console[_0x3193('0x2')](_0x3193('0x6')),'documentOutlineLicenseKeyTrialLimit:operations'===_0x120bca)throw clearInterval(this[_0x3193('0xe')]),new _0x14d66a(_0x3193('0xf'),null);_0x3193('0x0')===_0x120bca&&clearInterval(this[_0x3193('0xe')]);},0x3e8);}[_0x3193('0xa')](){this['_licenseKeyCheckInterval']&&clearInterval(this[_0x3193('0xe')]);}}
package/src/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline
7
- */
8
- export { default as DocumentOutline, type DocumentOutlineConfig } from './documentoutline';
9
- export { default as DocumentOutlineUI } from './documentoutline/documentoutlineui';
10
- export { default as DocumentOutlineUtils } from './documentoutline/documentoutlineutils';
11
- export { default as TableOfContents } from './tableofcontents';
12
- export { default as TableOfContentsCommand } from './tableofcontents/tableofcontentscommand';
13
- export { default as TableOfContentsEditing } from './tableofcontents/tableofcontentsediting';
14
- export { default as TableOfContentsUI } from './tableofcontents/tableofcontentsui';
15
- export { default as HeadingId } from './tableofcontents/headingid';
16
- export declare const icons: {
17
- tableOfContentsIcon: string;
18
- };
19
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline
7
+ */
8
+ export { default as DocumentOutline, type DocumentOutlineConfig } from './documentoutline.js';
9
+ export { default as DocumentOutlineUI } from './documentoutline/documentoutlineui.js';
10
+ export { default as DocumentOutlineUtils } from './documentoutline/documentoutlineutils.js';
11
+ export { default as TableOfContents } from './tableofcontents.js';
12
+ export { default as TableOfContentsCommand } from './tableofcontents/tableofcontentscommand.js';
13
+ export { default as TableOfContentsEditing } from './tableofcontents/tableofcontentsediting.js';
14
+ export { default as TableOfContentsUI } from './tableofcontents/tableofcontentsui.js';
15
+ export { default as HeadingId } from './tableofcontents/headingid.js';
16
+ export declare const icons: {
17
+ tableOfContentsIcon: string;
18
+ };
19
+ import './augmentation.js';
package/src/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export{default as DocumentOutline}from'./documentoutline';export{default as DocumentOutlineUI}from'./documentoutline/documentoutlineui';export{default as DocumentOutlineUtils}from'./documentoutline/documentoutlineutils';import _0x3c79eb from'../theme/icons/table-of-contents.svg';export{default as TableOfContents}from'./tableofcontents';export{default as TableOfContentsCommand}from'./tableofcontents/tableofcontentscommand';export{default as TableOfContentsEditing}from'./tableofcontents/tableofcontentsediting';export{default as TableOfContentsUI}from'./tableofcontents/tableofcontentsui';export{default as HeadingId}from'./tableofcontents/headingid';export const icons={'tableOfContentsIcon':_0x3c79eb};import'./augmentation';
23
+ export{default as DocumentOutline}from'./documentoutline.js';export{default as DocumentOutlineUI}from'./documentoutline/documentoutlineui.js';export{default as DocumentOutlineUtils}from'./documentoutline/documentoutlineutils.js';import _0x5fabb2 from'../theme/icons/table-of-contents.svg';export{default as TableOfContents}from'./tableofcontents.js';export{default as TableOfContentsCommand}from'./tableofcontents/tableofcontentscommand.js';export{default as TableOfContentsEditing}from'./tableofcontents/tableofcontentsediting.js';export{default as TableOfContentsUI}from'./tableofcontents/tableofcontentsui.js';export{default as HeadingId}from'./tableofcontents/headingid.js';export const icons={'tableOfContentsIcon':_0x5fabb2};import'./augmentation.js';