@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.
- package/build/document-outline.js +1 -1
- package/build/document-outline.js.map +1 -0
- package/package.json +4 -3
- package/src/augmentation.d.ts +27 -27
- package/src/documentoutline/documentoutlineui.d.ts +39 -39
- package/src/documentoutline/documentoutlineui.js +1 -1
- package/src/documentoutline/documentoutlineutils.d.ts +66 -66
- package/src/documentoutline/documentoutlineutils.js +1 -1
- package/src/documentoutline/ui/documentoutlineitemview.d.ts +55 -55
- package/src/documentoutline/ui/documentoutlineitemview.js +1 -1
- package/src/documentoutline/ui/documentoutlineview.d.ts +44 -44
- package/src/documentoutline/ui/documentoutlineview.js +1 -1
- package/src/documentoutline/utils.d.ts +17 -17
- package/src/documentoutline/utils.js +1 -1
- package/src/documentoutline.d.ts +99 -99
- package/src/documentoutline.js +1 -1
- package/src/index.d.ts +19 -19
- package/src/index.js +1 -1
- package/src/tableofcontents/headingid.d.ts +18 -18
- package/src/tableofcontents/headingid.js +1 -1
- package/src/tableofcontents/tableofcontentscommand.d.ts +21 -21
- package/src/tableofcontents/tableofcontentscommand.js +1 -1
- package/src/tableofcontents/tableofcontentsediting.d.ts +37 -37
- package/src/tableofcontents/tableofcontentsediting.js +1 -1
- package/src/tableofcontents/tableofcontentsui.d.ts +27 -27
- package/src/tableofcontents/tableofcontentsui.js +1 -1
- package/src/tableofcontents.d.ts +26 -26
- package/src/tableofcontents.js +1 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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
|
|
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
|
|
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
|
|
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']:[];}
|
package/src/documentoutline.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/documentoutline.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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
|
|
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';
|