@ckeditor/ckeditor5-document-outline 38.1.0 → 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.
- package/build/document-outline.js +1 -1
- package/package.json +3 -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
- package/build/document-outline.js.map +0 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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
|
|
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
|
|
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
|
|
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']:[];}
|
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';
|
|
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
|
+
}
|
package/src/documentoutline.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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 './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
|
|
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';
|
|
@@ -1,18 +1,18 @@
|
|
|
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
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
/**
|
|
7
|
-
* The heading ID plugin. It adds support for the ID attribute on the heading[1-6] (model) and h[1-6] (data/view) elements.
|
|
8
|
-
*/
|
|
9
|
-
export default class HeadingId extends Plugin {
|
|
10
|
-
/**
|
|
11
|
-
* @inheritDoc
|
|
12
|
-
*/
|
|
13
|
-
static get pluginName(): "HeadingId";
|
|
14
|
-
/**
|
|
15
|
-
* @inheritDoc
|
|
16
|
-
*/
|
|
17
|
-
afterInit(): void;
|
|
18
|
-
}
|
|
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
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
+
/**
|
|
7
|
+
* The heading ID plugin. It adds support for the ID attribute on the heading[1-6] (model) and h[1-6] (data/view) elements.
|
|
8
|
+
*/
|
|
9
|
+
export default class HeadingId extends Plugin {
|
|
10
|
+
/**
|
|
11
|
+
* @inheritDoc
|
|
12
|
+
*/
|
|
13
|
+
static get pluginName(): "HeadingId";
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
afterInit(): void;
|
|
18
|
+
}
|