@ckeditor/ckeditor5-document-outline 38.0.1 → 38.1.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 _0x1c37=['selection','createElement','init','text','afterInit','document','_deriveHeadingElementsFromConversion','editing','_getOutlineDefinitions','_getHeadingNames','name','toModel','change','fire','getRootNames','config','domToView','DocumentOutlineUtils','pluginName','editor','_getActiveHeading','element','model','includes','item','data','length','getChildren','_headingNames','level','getRoot','documentOutline.headings','push','findIndex','modelElement'];(function(_0x4bf005,_0x1c375f){const _0x281b24=function(_0x15a0ca){while(--_0x15a0ca){_0x4bf005['push'](_0x4bf005['shift']());}};_0x281b24(++_0x1c375f);}(_0x1c37,0x1a3));const _0x281b=function(_0x4bf005,_0x1c375f){_0x4bf005=_0x4bf005-0x0;let _0x281b24=_0x1c37[_0x4bf005];return _0x281b24;};import{Plugin as _0xd4bc79}from'ckeditor5/src/core';import{debounce as _0x39d644}from'lodash-es';import{TreeWalker as _0x5c3039}from'ckeditor5/src/engine';import{getElementText as _0x2ba90d,getDefaultFeatureHeadingNames as _0x43fa54}from'./utils';import{diff as _0x4104b8,diffToChanges as _0x31f930}from'ckeditor5/src/utils';export default class n extends _0xd4bc79{constructor(){super(...arguments),this[_0x281b('0x1d')]=[];}static get[_0x281b('0x13')](){return _0x281b('0x12');}[_0x281b('0x3')](){const _0x90e636=this[_0x281b('0x14')];this[_0x281b('0x1d')]=this[_0x281b('0xa')]();let _0x13f1d5=[];_0x90e636[_0x281b('0x17')][_0x281b('0x6')]['on'](_0x281b('0xd'),_0x39d644(()=>{const _0x5b7fd1=_0x13f1d5;_0x13f1d5=this[_0x281b('0x9')]();const _0x2ad5ea=_0x4104b8(_0x5b7fd1,_0x13f1d5,(_0x33857a,_0x229f8e)=>_0x33857a['level']===_0x229f8e[_0x281b('0x1e')]&&_0x33857a[_0x281b('0x4')]===_0x229f8e[_0x281b('0x4')]&&_0x33857a[_0x281b('0x0')]===_0x229f8e[_0x281b('0x0')]),_0x43ef9d=_0x31f930(_0x2ad5ea,_0x13f1d5),_0x578b7b=this[_0x281b('0x15')](),_0x123883=_0x13f1d5[_0x281b('0x22')](_0x44a591=>_0x44a591[_0x281b('0x0')]===_0x578b7b);_0x43ef9d[_0x281b('0x1b')]&&this[_0x281b('0xe')](_0x281b('0xd'),{'outlineDefinitions':_0x13f1d5,'activeItemIndex':_0x123883,'outlineChanges':_0x43ef9d}),this['fire']('activeItemIndex',{'index':_0x123883});},0xfa,{'leading':!0x0,'trailing':!0x0}));}[_0x281b('0x5')](){this[_0x281b('0x1d')][_0x281b('0x1b')]||this[_0x281b('0x7')]();}['_getOutlineDefinitions'](){const _0x4fbd5f=this[_0x281b('0x14')],_0x921026=[],_0x383b63=this[_0x281b('0x1d')];for(const _0x11cda5 of _0x4fbd5f[_0x281b('0x17')][_0x281b('0x6')][_0x281b('0xf')]())_0x3da592(_0x4fbd5f[_0x281b('0x17')][_0x281b('0x6')][_0x281b('0x1f')](_0x11cda5));function _0x3da592(_0x276c1c){for(const _0x3c5f06 of _0x276c1c[_0x281b('0x1c')]())_0x3c5f06['is']('element')&&(_0x383b63[_0x281b('0x18')](_0x3c5f06[_0x281b('0xb')])&&_0x921026[_0x281b('0x21')]({'level':_0x383b63['indexOf'](_0x3c5f06['name'])+0x1,'text':_0x2ba90d(_0x3c5f06),'modelElement':_0x3c5f06}),_0x3da592(_0x3c5f06));}return _0x921026;}[_0x281b('0x15')](){const _0x59f0a7=this[_0x281b('0x14')][_0x281b('0x17')][_0x281b('0x6')][_0x281b('0x1')]['getFirstPosition'](),_0x31604a=new _0x5c3039({'direction':'backward','startPosition':_0x59f0a7});for(const _0x6e4e91 of _0x31604a)if(_0x6e4e91[_0x281b('0x19')]['is'](_0x281b('0x16'))&&this[_0x281b('0x1d')][_0x281b('0x18')](_0x6e4e91[_0x281b('0x19')][_0x281b('0xb')]))return _0x6e4e91['item'];}[_0x281b('0xa')](){const _0xa35e3c=this[_0x281b('0x14')][_0x281b('0x10')]['get'](_0x281b('0x20'));return _0xa35e3c||_0x43fa54(this[_0x281b('0x14')]);}[_0x281b('0x7')](){const _0x245c76=this['editor'],_0x2c3acd=['h1','h2','h3','h4','h5','h6'],_0x2b7e55=[];for(const _0x561fab of _0x2c3acd){const _0x255867=_0x245c76[_0x281b('0x8')]['view']['domConverter'][_0x281b('0x11')](document[_0x281b('0x2')](_0x561fab)),_0x32e50e=_0x245c76[_0x281b('0x1a')][_0x281b('0xc')](_0x255867)['getChild'](0x0);(null==_0x32e50e?void 0x0:_0x32e50e['is']('element'))&&_0x2b7e55[_0x281b('0x21')](_0x32e50e[_0x281b('0xb')]);}this[_0x281b('0x1d')]=_0x2b7e55;}}
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;}}
@@ -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';
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
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{View as _0x478cfb}from'ckeditor5/src/ui';import{scrollAncestorsToShowTarget as _0x5c14b6}from'ckeditor5/src/utils';export default class j extends _0x478cfb{constructor(_0x30fe79,_0x2c74dc=!0x1){super(_0x30fe79);const t=_0x30fe79['t'],_0x16210a=this['bindTemplate'],_0x37dd0b=_0x2c74dc?'['+t('Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0x301782=>!_0x301782),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0x16210a['to']('level',_0x283d2b=>'ck-document-outline__item_level-'+_0x283d2b),_0x16210a['if']('isActive','ck-document-outline__item_active'),_0x16210a['if']('isEmpty','ck-document-outline__item_empty')],'title':_0x16210a['to']('text')},'children':[{'text':_0x16210a['to']('text',_0x1aabdd=>_0x1aabdd||_0x37dd0b)}],'on':{'click':_0x16210a['to']('click')}});}['scrollTo'](){_0x5c14b6(this['element'],0x14);}}
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);}}
@@ -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';
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
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{View as _0x4bd7a1}from'ckeditor5/src/ui';import _0x213671 from'./documentoutlineitemview';export default class w extends _0x4bd7a1{constructor(_0x307ff6,_0x1a3c38=!0x1){super(_0x307ff6);const t=_0x307ff6['t'];this['showEmptyHeadingText']=_0x1a3c38,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',(_0x29b9ab,_0x21700d,_0x367ca0,_0x151363)=>{this['_setActiveItem'](_0x151363,_0x367ca0);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x307ff6['contentLanguageDirection'],'data-document-outline-empty-placeholder':t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.')},'children':this['items']});}['sync'](_0x2afa15){_0x2afa15['forEach'](_0x1b7a89=>{'insert'==_0x1b7a89['type']?this['_insertItem'](_0x1b7a89['index'],..._0x1b7a89['values']):'delete'==_0x1b7a89['type']&&this['_deleteItem'](_0x1b7a89['index'],_0x1b7a89['howMany']);});}['_setActiveItem'](_0x4852cf,_0x438098){if(-0x1!==_0x4852cf){const _0x5e9929=this['items']['get'](_0x4852cf);_0x5e9929&&(_0x5e9929['isActive']=!0x1);}-0x1!==_0x438098&&(this['items']['get'](_0x438098)['isActive']=!0x0,this['items']['get'](_0x438098)['scrollTo']());}['_insertItem'](_0x4c9d4f,..._0x397b50){const _0x9b9144=_0x397b50['map']((_0x12d00d,_0x35dc30)=>{const _0x2d7454=new _0x213671(this['locale'],this['showEmptyHeadingText']);return _0x2d7454['text']=_0x12d00d['text'],_0x2d7454['level']=_0x12d00d['level'],_0x4c9d4f+_0x35dc30===this['activeItemIndex']&&(_0x2d7454['isActive']=!0x0),_0x2d7454;});this['items']['addMany'](_0x9b9144,_0x4c9d4f);}['_deleteItem'](_0x4fa8a0,_0x2cd160){do{this['items']['remove'](_0x4fa8a0);}while(--_0x2cd160);}['_handleItemClick'](_0x4b0a2a){const _0x2da9a=this['items']['getIndex'](_0x4b0a2a['source']);this['fire']('itemSelected',_0x2da9a);}}
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);}}
@@ -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';
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>;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5f53=['data','htmlH2','paragraph','htmlH6','config','htmlH4','model','htmlH3','has','htmlH5','GeneralHtmlSupport','getChildren','push'];(function(_0x4d3011,_0x5f539a){const _0x1e8390=function(_0x5ad72b){while(--_0x5ad72b){_0x4d3011['push'](_0x4d3011['shift']());}};_0x1e8390(++_0x5f539a);}(_0x5f53,0x1a8));const _0x1e83=function(_0x4d3011,_0x5f539a){_0x4d3011=_0x4d3011-0x0;let _0x1e8390=_0x5f53[_0x4d3011];return _0x1e8390;};import{Text as _0x140609}from'ckeditor5/src/engine';export function getElementText(_0x790fa3){let _0x299e52='';for(const _0x3fb44e of _0x790fa3[_0x1e83('0x3')]())_0x3fb44e instanceof _0x140609&&(_0x299e52+=_0x3fb44e[_0x1e83('0x5')]);return _0x299e52;}export function getDefaultFeatureHeadingNames(_0x4da378){const _0x3c8e35=_0x4da378[_0x1e83('0x9')]['get']('heading.options');return _0x3c8e35?_0x3c8e35['reduce']((_0x473706,_0x3d341b)=>(_0x1e83('0x7')!==_0x3d341b[_0x1e83('0xb')]&&_0x473706[_0x1e83('0x4')](_0x3d341b[_0x1e83('0xb')]),_0x473706),[]):_0x4da378['plugins'][_0x1e83('0x0')](_0x1e83('0x2'))?['htmlH1',_0x1e83('0x6'),_0x1e83('0xc'),_0x1e83('0xa'),_0x1e83('0x1'),_0x1e83('0x8')]:[];}
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']:[];}
@@ -1,95 +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(): (typeof DocumentOutlineUI | typeof DocumentOutlineUtils)[];
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
- /**
36
- * The configuration of the {@link module:document-outline/documentoutline~DocumentOutline document outline feature}.
37
- *
38
- * ```ts
39
- * ClassicEditor
40
- * .create( editorElement, {
41
- * documentOutline: ... // Document outline feature configuration.
42
- * } )
43
- * .then( /* ... *\/ )
44
- * .catch( /* ... *\/ );
45
- * ```
46
- *
47
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
48
- */
49
- export interface DocumentOutlineConfig {
50
- /**
51
- * The container element for the document outline to render. This should be a reference to an existing
52
- * container element in the DOM.
53
- */
54
- container?: HTMLElement;
55
- /**
56
- * An array of {@glink framework/architecture/editing-engine#model model} element names considered
57
- * as headings in the document outline.
58
- *
59
- * The index of the heading in the array reflects the heading nesting level. It can be used e.g. for reducing
60
- * the number of visible headings.
61
- *
62
- * ```ts
63
- * ClassicEditor
64
- * .create( editorElement, {
65
- * plugins: [ DocumentOutline, /* ... *\/ ],
66
- * documentOutline: {
67
- * headings: [ 'heading1', 'heading2', /* ... *\/ ],
68
- * // ...
69
- * }
70
- * } )
71
- * .then( /* ... *\/ )
72
- * .catch( /* ... *\/ );
73
- * ```
74
- *
75
- * If this configuration is not defined, the feature will use the following defaults instead:
76
- *
77
- * 1. If the {@glink features/headings Headings feature} is loaded, it equals
78
- * * {@link module:heading/headingconfig~HeadingConfig#options `config.heading.options`}.
79
- * * `[ 'heading1', 'heading2', 'heading3' ]` if `config.heading.options` is not defined.
80
- * 2. If the {@glink features/html/general-html-support General HTML Support} feature is loaded, it equals
81
- * `[ 'htmlH1', 'htmlH2', 'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6' ]`.
82
- *
83
- * **Note**: The Headings feature takes precedence over the General HTML Support feature when
84
- * both are loaded.
85
- */
86
- headings?: Array<string>;
87
- /**
88
- * Allows you to display a placeholder text: [Empty heading] for empty headings.
89
- *
90
- * By default, the display of a placeholder is disabled. To enable it, set this parameter to true.
91
- *
92
- * **Note**: This setting also affects Table of contents feature.
93
- */
94
- showEmptyHeadings?: boolean;
95
- }
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
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x104c=['document-outline-invalid-license-key','licenseKey','document-outline-trial-license-key-reached-limit-changes','documentOutlineLicenseKeyInvalid','requires','editor','_licenseKeyCheckInterval','documentOutlineLicenseKeyTrialLimit:operations','documentOutlineLicenseKeyTrial','documentOutlineLicenseKeyValid','config','init','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.','DocumentOutline'];(function(_0x49e894,_0x104ced){const _0x5955d1=function(_0x4feb72){while(--_0x4feb72){_0x49e894['push'](_0x49e894['shift']());}};_0x5955d1(++_0x104ced);}(_0x104c,0x19a));const _0x5955=function(_0x49e894,_0x104ced){_0x49e894=_0x49e894-0x0;let _0x5955d1=_0x104c[_0x49e894];return _0x5955d1;};import{Plugin as _0xd41488}from'ckeditor5/src/core';import{CKEditorError as _0x18f9c9}from'ckeditor5/src/utils';import _0x51e245 from'./documentoutline/documentoutlineutils';import _0x62aaf0 from'./documentoutline/documentoutlineui';export default class l extends _0xd41488{static get[_0x5955('0x0')](){return[_0x51e245,_0x62aaf0];}static get['pluginName'](){return _0x5955('0x9');}constructor(_0x289ef7){super(_0x289ef7),this[_0x5955('0x2')]=null;}[_0x5955('0x7')](){const _0x2459df=this[_0x5955('0x1')];this[_0x5955('0xb')]=_0x2459df[_0x5955('0x6')]['get']('licenseKey');const _0x517da5=this[_0x5955('0x1')];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2e6790;for(const _0x4c679c in _0x517da5){const _0x20e39c=_0x4c679c,_0x29d125=_0x517da5[_0x20e39c];if(_0x5955('0x4')===_0x29d125||'documentOutlineLicenseKeyInvalid'===_0x29d125||_0x5955('0x5')===_0x29d125||_0x5955('0x3')===_0x29d125){delete _0x517da5[_0x20e39c],_0x2e6790=_0x29d125;break;}}if(_0x5955('0xd')===_0x2e6790)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x18f9c9(_0x5955('0xa'),null);if(_0x5955('0x4')===_0x2e6790&&console['info'](_0x5955('0x8')),'documentOutlineLicenseKeyTrialLimit:operations'===_0x2e6790)throw clearInterval(this[_0x5955('0x2')]),new _0x18f9c9(_0x5955('0xc'),null);_0x5955('0x5')===_0x2e6790&&clearInterval(this[_0x5955('0x2')]);},0x3e8);}}
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')]);}}
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 '@ckeditor/ckeditor5-document-outline/src/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';
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';
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 _0x4024ef 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'@ckeditor/ckeditor5-document-outline/src/tableofcontents/headingid';export const icons={'tableOfContentsIcon':_0x4024ef};import'./augmentation';
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';