@ckeditor/ckeditor5-document-outline 39.0.1 → 40.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/LICENSE.md +5 -5
  3. package/README.md +7 -7
  4. package/build/document-outline.js +1 -1
  5. package/lang/translations/ar.po +1 -0
  6. package/lang/translations/bg.po +1 -0
  7. package/lang/translations/bn.po +1 -0
  8. package/lang/translations/ca.po +1 -0
  9. package/lang/translations/cs.po +1 -0
  10. package/lang/translations/da.po +1 -0
  11. package/lang/translations/de.po +1 -0
  12. package/lang/translations/el.po +1 -0
  13. package/lang/translations/en-au.po +1 -0
  14. package/lang/translations/en.po +1 -0
  15. package/lang/translations/es.po +1 -0
  16. package/lang/translations/et.po +1 -0
  17. package/lang/translations/fi.po +1 -0
  18. package/lang/translations/fr.po +1 -0
  19. package/lang/translations/gl.po +1 -0
  20. package/lang/translations/he.po +1 -0
  21. package/lang/translations/hi.po +1 -0
  22. package/lang/translations/hr.po +1 -0
  23. package/lang/translations/hu.po +1 -0
  24. package/lang/translations/id.po +1 -0
  25. package/lang/translations/it.po +1 -0
  26. package/lang/translations/ja.po +1 -0
  27. package/lang/translations/ko.po +1 -0
  28. package/lang/translations/lt.po +1 -0
  29. package/lang/translations/lv.po +1 -0
  30. package/lang/translations/ms.po +1 -0
  31. package/lang/translations/nl.po +1 -0
  32. package/lang/translations/no.po +1 -0
  33. package/lang/translations/pl.po +1 -0
  34. package/lang/translations/pt-br.po +1 -0
  35. package/lang/translations/pt.po +1 -0
  36. package/lang/translations/ro.po +1 -0
  37. package/lang/translations/ru.po +1 -0
  38. package/lang/translations/sk.po +1 -0
  39. package/lang/translations/sr.po +1 -0
  40. package/lang/translations/sv.po +1 -0
  41. package/lang/translations/th.po +1 -0
  42. package/lang/translations/tr.po +1 -0
  43. package/lang/translations/ug.po +1 -0
  44. package/lang/translations/uk.po +1 -0
  45. package/lang/translations/vi.po +1 -0
  46. package/lang/translations/zh-cn.po +1 -0
  47. package/lang/translations/zh.po +1 -0
  48. package/package.json +3 -7
  49. package/src/augmentation.d.ts +27 -27
  50. package/src/documentoutline/documentoutlineui.d.ts +40 -39
  51. package/src/documentoutline/documentoutlineui.js +1 -1
  52. package/src/documentoutline/documentoutlineutils.d.ts +66 -66
  53. package/src/documentoutline/documentoutlineutils.js +1 -1
  54. package/src/documentoutline/ui/documentoutlineitemview.d.ts +51 -51
  55. package/src/documentoutline/ui/documentoutlineitemview.js +1 -1
  56. package/src/documentoutline/ui/documentoutlineview.d.ts +52 -52
  57. package/src/documentoutline/ui/documentoutlineview.js +1 -1
  58. package/src/documentoutline/utils.d.ts +17 -17
  59. package/src/documentoutline/utils.js +1 -1
  60. package/src/documentoutline.d.ts +99 -99
  61. package/src/documentoutline.js +1 -1
  62. package/src/index.d.ts +19 -19
  63. package/src/index.js +1 -1
  64. package/src/tableofcontents/headingid.d.ts +18 -18
  65. package/src/tableofcontents/headingid.js +1 -1
  66. package/src/tableofcontents/tableofcontentscommand.d.ts +21 -21
  67. package/src/tableofcontents/tableofcontentscommand.js +1 -1
  68. package/src/tableofcontents/tableofcontentsediting.d.ts +37 -37
  69. package/src/tableofcontents/tableofcontentsediting.js +1 -1
  70. package/src/tableofcontents/tableofcontentsui.d.ts +27 -27
  71. package/src/tableofcontents/tableofcontentsui.js +1 -1
  72. package/src/tableofcontents.d.ts +26 -26
  73. package/src/tableofcontents.js +1 -1
  74. package/theme/documentoutline.css +4 -0
  75. package/theme/tableofcontents.css +4 -0
@@ -1,52 +1,52 @@
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
- * Creates an instance of the {@link module:documentoutline/ui/documentoutlineview~DocumentOutlineView} class.
28
- *
29
- * @param locale The localization services instance.
30
- * @param showEmptyHeadingText Indicates whether the display of a placeholder for empty heading is enabled in the editor.
31
- * @param containerElement The element that contains the document outline.
32
- */
33
- constructor(locale: Locale, showEmptyHeadingText?: boolean, containerElement?: HTMLElement);
34
- /**
35
- * If a heading was added or deleted in the editor, insert or delete it in the document outline.
36
- */
37
- sync(changesInItems: ReturnType<typeof diffToChanges<OutlineItemDefinition>>): void;
38
- /**
39
- * @inheritDoc
40
- */
41
- destroy(): void;
42
- }
43
- /**
44
- * Fired whenever an item in the document outline is clicked.
45
- *
46
- * @eventName ~DocumentOutlineView#itemSelected
47
- * @param itemIndex Index of selected item.
48
- */
49
- export type DocumentOutlineViewItemSelectedEvent = {
50
- name: 'itemSelected';
51
- args: [itemIndex: number];
52
- };
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
+ * Creates an instance of the {@link module:documentoutline/ui/documentoutlineview~DocumentOutlineView} class.
28
+ *
29
+ * @param locale The localization services instance.
30
+ * @param showEmptyHeadingText Indicates whether the display of a placeholder for empty heading is enabled in the editor.
31
+ * @param containerElement The element that contains the document outline.
32
+ */
33
+ constructor(locale: Locale, showEmptyHeadingText?: boolean, containerElement?: HTMLElement);
34
+ /**
35
+ * If a heading was added or deleted in the editor, insert or delete it in the document outline.
36
+ */
37
+ sync(changesInItems: ReturnType<typeof diffToChanges<OutlineItemDefinition>>): void;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ destroy(): void;
42
+ }
43
+ /**
44
+ * Fired whenever an item in the document outline is clicked.
45
+ *
46
+ * @eventName ~DocumentOutlineView#itemSelected
47
+ * @param itemIndex Index of selected item.
48
+ */
49
+ export type DocumentOutlineViewItemSelectedEvent = {
50
+ name: 'itemSelected';
51
+ args: [itemIndex: number];
52
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{View as _0x5c8531}from'ckeditor5/src/ui';import{scrollAncestorsToShowTarget as _0x27f198}from'ckeditor5/src/utils';import _0x5b0003 from'./documentoutlineitemview';export default class d extends _0x5c8531{constructor(_0x238755,_0x3c609b=!0x1,_0x1fe1f9){super(_0x238755);const t=_0x238755['t'];this['showEmptyHeadingText']=_0x3c609b,this['set']('activeItemIndex',-0x1),this['_documentOutlineContainer']=_0x1fe1f9,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x2214aa,_0x7c82cd,_0x12ff87,_0x2b6acd)=>{this['_setActiveItem'](_0x2b6acd,_0x12ff87);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x238755['contentLanguageDirection'],'data-document-outline-empty-placeholder':t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x17acdf){_0x17acdf['forEach'](_0xe13a22=>{'insert'==_0xe13a22['type']?this['_insertItem'](_0xe13a22['index'],..._0xe13a22['values']):'delete'==_0xe13a22['type']&&this['_deleteItem'](_0xe13a22['index'],_0xe13a22['howMany']);});}['_setActiveItem'](_0x1d1ab0,_0x396bfd){if(-0x1!==_0x1d1ab0){const _0x1f1188=this['items']['get'](_0x1d1ab0);_0x1f1188&&(_0x1f1188['isActive']=!0x1);}-0x1!==_0x396bfd&&(this['items']['get'](_0x396bfd)['isActive']=!0x0,this['_scrollToItem'](_0x396bfd));}['_insertItem'](_0x175503,..._0xc0231){const _0x2b1a5f=_0xc0231['map']((_0x1eac3e,_0x5d52a4)=>{const _0x15c261=new _0x5b0003(this['locale'],this['showEmptyHeadingText']);return _0x15c261['text']=_0x1eac3e['text'],_0x15c261['level']=_0x1eac3e['level'],_0x175503+_0x5d52a4===this['activeItemIndex']&&(_0x15c261['isActive']=!0x0),_0x15c261;});this['items']['addMany'](_0x2b1a5f,_0x175503);}['_deleteItem'](_0x193e83,_0x35e8e0){do{this['items']['remove'](_0x193e83);}while(--_0x35e8e0);}['_handleItemClick'](_0x51cfa5){const _0x2a47cf=this['items']['getIndex'](_0x51cfa5['source']);this['fire']('itemSelected',_0x2a47cf);}['_scrollToItem'](_0x584b17){_0x27f198(this['items']['get'](_0x584b17)['element'],0x14,this['_documentOutlineContainer']);}['destroy'](){super['destroy'](),this['element']['remove']();}}
23
+ import{View as _0x427d85}from'ckeditor5/src/ui';import{scrollAncestorsToShowTarget as _0x7c39c2}from'ckeditor5/src/utils';import _0x302be6 from'./documentoutlineitemview';export default class d extends _0x427d85{constructor(_0x3fdf20,_0x5ae982=!0x1,_0x203b14){super(_0x3fdf20);const t=_0x3fdf20['t'];this['showEmptyHeadingText']=_0x5ae982,this['set']('activeItemIndex',-0x1),this['_documentOutlineContainer']=_0x203b14,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x465ac2,_0xf2d3eb,_0x2e8fee,_0x5c1413)=>{this['_setActiveItem'](_0x5c1413,_0x2e8fee);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x3fdf20['contentLanguageDirection'],'data-document-outline-empty-placeholder':t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x576afb){_0x576afb['forEach'](_0x5caa08=>{'insert'==_0x5caa08['type']?this['_insertItem'](_0x5caa08['index'],..._0x5caa08['values']):'delete'==_0x5caa08['type']&&this['_deleteItem'](_0x5caa08['index'],_0x5caa08['howMany']);});}['_setActiveItem'](_0x4c73f2,_0x217b43){if(-0x1!==_0x4c73f2){const _0x16519a=this['items']['get'](_0x4c73f2);_0x16519a&&(_0x16519a['isActive']=!0x1);}-0x1!==_0x217b43&&(this['items']['get'](_0x217b43)['isActive']=!0x0,this['_scrollToItem'](_0x217b43));}['_insertItem'](_0x4aaa6b,..._0x3bc51a){const _0xf35d50=_0x3bc51a['map']((_0x1b97c4,_0x1142bf)=>{const _0x23425c=new _0x302be6(this['locale'],this['showEmptyHeadingText']);return _0x23425c['text']=_0x1b97c4['text'],_0x23425c['level']=_0x1b97c4['level'],_0x4aaa6b+_0x1142bf===this['activeItemIndex']&&(_0x23425c['isActive']=!0x0),_0x23425c;});this['items']['addMany'](_0xf35d50,_0x4aaa6b);}['_deleteItem'](_0x2212cb,_0xc1d88f){do{this['items']['remove'](_0x2212cb);}while(--_0xc1d88f);}['_handleItemClick'](_0x2ac01b){const _0x1ff9b7=this['items']['getIndex'](_0x2ac01b['source']);this['fire']('itemSelected',_0x1ff9b7);}['_scrollToItem'](_0x19d9c3){_0x7c39c2(this['items']['get'](_0x19d9c3)['element'],0x14,this['_documentOutlineContainer']);}['destroy'](){super['destroy'](),this['element']['remove']();}}
@@ -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 _0x15fc=['GeneralHtmlSupport','has','htmlH3','getChildren','heading.options','plugins','htmlH6','htmlH2','reduce','get','config','model','htmlH4','push','htmlH5'];(function(_0x1072ef,_0x15fc6b){const _0x239f01=function(_0x393338){while(--_0x393338){_0x1072ef['push'](_0x1072ef['shift']());}};_0x239f01(++_0x15fc6b);}(_0x15fc,0xa9));const _0x239f=function(_0x1072ef,_0x15fc6b){_0x1072ef=_0x1072ef-0x0;let _0x239f01=_0x15fc[_0x1072ef];return _0x239f01;};import{Text as _0x21fe8a}from'ckeditor5/src/engine';export function getElementText(_0xe95477){let _0x4e3751='';for(const _0x1594d5 of _0xe95477[_0x239f('0xe')]())_0x1594d5 instanceof _0x21fe8a&&(_0x4e3751+=_0x1594d5['data']);return _0x4e3751;}export function getDefaultFeatureHeadingNames(_0x4ed676){const _0x13b4a5=_0x4ed676[_0x239f('0x6')][_0x239f('0x5')](_0x239f('0x0'));return _0x13b4a5?_0x13b4a5[_0x239f('0x4')]((_0x39d74d,_0x256033)=>('paragraph'!==_0x256033[_0x239f('0x7')]&&_0x39d74d[_0x239f('0x9')](_0x256033['model']),_0x39d74d),[]):_0x4ed676[_0x239f('0x1')][_0x239f('0xc')](_0x239f('0xb'))?['htmlH1',_0x239f('0x3'),_0x239f('0xd'),_0x239f('0x8'),_0x239f('0xa'),_0x239f('0x2')]:[];}
23
+ const _0x105c=['paragraph','htmlH2','htmlH5','reduce','data','has','get','push','heading.options','getChildren','model','config','plugins'];(function(_0x394506,_0x105c0c){const _0x1c8d26=function(_0x13ebb6){while(--_0x13ebb6){_0x394506['push'](_0x394506['shift']());}};_0x1c8d26(++_0x105c0c);}(_0x105c,0x154));const _0x1c8d=function(_0x394506,_0x105c0c){_0x394506=_0x394506-0x0;let _0x1c8d26=_0x105c[_0x394506];return _0x1c8d26;};import{Text as _0x3ca39f}from'ckeditor5/src/engine';export function getElementText(_0x3f6721){let _0x2fd63c='';for(const _0x160f6a of _0x3f6721[_0x1c8d('0x7')]())_0x160f6a instanceof _0x3ca39f&&(_0x2fd63c+=_0x160f6a[_0x1c8d('0x2')]);return _0x2fd63c;}export function getDefaultFeatureHeadingNames(_0x17a0a5){const _0x36ab70=_0x17a0a5[_0x1c8d('0x9')][_0x1c8d('0x4')](_0x1c8d('0x6'));return _0x36ab70?_0x36ab70[_0x1c8d('0x1')]((_0x4c39dc,_0x529e73)=>(_0x1c8d('0xb')!==_0x529e73[_0x1c8d('0x8')]&&_0x4c39dc[_0x1c8d('0x5')](_0x529e73[_0x1c8d('0x8')]),_0x4c39dc),[]):_0x17a0a5[_0x1c8d('0xa')][_0x1c8d('0x3')]('GeneralHtmlSupport')?['htmlH1',_0x1c8d('0xc'),'htmlH3','htmlH4',_0x1c8d('0x0'),'htmlH6']:[];}
@@ -1,99 +1,99 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module document-outline/documentoutline
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import DocumentOutlineUtils from './documentoutline/documentoutlineutils';
11
- import DocumentOutlineUI from './documentoutline/documentoutlineui';
12
- /**
13
- * The document outline feature.
14
- * It allows for an easy access to a predefined list of headings in the document.
15
- */
16
- export default class DocumentOutline extends Plugin {
17
- licenseKey: string;
18
- /**
19
- * @inheritDoc
20
- */
21
- static get requires(): readonly [typeof DocumentOutlineUtils, typeof DocumentOutlineUI];
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "DocumentOutline";
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(editor: Editor);
30
- /**
31
- * @inheritDoc
32
- */
33
- init(): void;
34
- /**
35
- * @inheritDoc
36
- */
37
- destroy(): void;
38
- }
39
- /**
40
- * The configuration of the {@link module:document-outline/documentoutline~DocumentOutline document outline feature}.
41
- *
42
- * ```ts
43
- * ClassicEditor
44
- * .create( editorElement, {
45
- * documentOutline: ... // Document outline feature configuration.
46
- * } )
47
- * .then( /* ... *\/ )
48
- * .catch( /* ... *\/ );
49
- * ```
50
- *
51
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
52
- */
53
- export interface DocumentOutlineConfig {
54
- /**
55
- * The container element for the document outline to render. This should be a reference to an existing
56
- * container element in the DOM.
57
- */
58
- container?: HTMLElement;
59
- /**
60
- * An array of {@glink framework/architecture/editing-engine#model model} element names considered
61
- * as headings in the document outline.
62
- *
63
- * The index of the heading in the array reflects the heading nesting level. It can be used e.g. for reducing
64
- * the number of visible headings.
65
- *
66
- * ```ts
67
- * ClassicEditor
68
- * .create( editorElement, {
69
- * plugins: [ DocumentOutline, /* ... *\/ ],
70
- * documentOutline: {
71
- * headings: [ 'heading1', 'heading2', /* ... *\/ ],
72
- * // ...
73
- * }
74
- * } )
75
- * .then( /* ... *\/ )
76
- * .catch( /* ... *\/ );
77
- * ```
78
- *
79
- * If this configuration is not defined, the feature will use the following defaults instead:
80
- *
81
- * 1. If the {@glink features/headings Headings feature} is loaded, it equals
82
- * * {@link module:heading/headingconfig~HeadingConfig#options `config.heading.options`}.
83
- * * `[ 'heading1', 'heading2', 'heading3' ]` if `config.heading.options` is not defined.
84
- * 2. If the {@glink features/html/general-html-support General HTML Support} feature is loaded, it equals
85
- * `[ 'htmlH1', 'htmlH2', 'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6' ]`.
86
- *
87
- * **Note**: The Headings feature takes precedence over the General HTML Support feature when
88
- * both are loaded.
89
- */
90
- headings?: Array<string>;
91
- /**
92
- * Allows you to display a placeholder text: [Empty heading] for empty headings.
93
- *
94
- * By default, the display of a placeholder is disabled. To enable it, set this parameter to true.
95
- *
96
- * **Note**: This setting also affects Table of contents feature.
97
- */
98
- showEmptyHeadings?: boolean;
99
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module document-outline/documentoutline
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
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 _0x8513=['document-outline-trial-license-key-reached-limit-changes','config','documentOutlineLicenseKeyTrialLimit:operations','documentOutlineLicenseKeyTrial','destroy','get','documentOutlineLicenseKeyValid','pluginName','licenseKey','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.','_licenseKeyCheckInterval','requires','init','documentOutlineLicenseKeyInvalid','info','editor'];(function(_0x3c4ffe,_0x85135c){const _0x2de271=function(_0x2a90e3){while(--_0x2a90e3){_0x3c4ffe['push'](_0x3c4ffe['shift']());}};_0x2de271(++_0x85135c);}(_0x8513,0x161));const _0x2de2=function(_0x3c4ffe,_0x85135c){_0x3c4ffe=_0x3c4ffe-0x0;let _0x2de271=_0x8513[_0x3c4ffe];return _0x2de271;};import{Plugin as _0x1b2521}from'ckeditor5/src/core';import{CKEditorError as _0x49f7c1}from'ckeditor5/src/utils';import _0x37993c from'./documentoutline/documentoutlineutils';import _0x310a0f from'./documentoutline/documentoutlineui';export default class l extends _0x1b2521{static get[_0x2de2('0xa')](){return[_0x37993c,_0x310a0f];}static get[_0x2de2('0x6')](){return'DocumentOutline';}constructor(_0x2107e7){super(_0x2107e7),this[_0x2de2('0x9')]=null;}[_0x2de2('0xb')](){const _0x522ca7=this[_0x2de2('0xe')];this[_0x2de2('0x7')]=_0x522ca7[_0x2de2('0x0')][_0x2de2('0x4')](_0x2de2('0x7'));const _0x536588=this[_0x2de2('0xe')];this[_0x2de2('0x9')]=setInterval(()=>{let _0x46ba88;for(const _0x4a12ef in _0x536588){const _0x499861=_0x4a12ef,_0x2970a0=_0x536588[_0x499861];if('documentOutlineLicenseKeyTrial'===_0x2970a0||_0x2de2('0xc')===_0x2970a0||_0x2de2('0x5')===_0x2970a0||_0x2de2('0x1')===_0x2970a0){delete _0x536588[_0x499861],_0x46ba88=_0x2970a0;break;}}if(_0x2de2('0xc')===_0x46ba88)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x49f7c1('document-outline-invalid-license-key',null);if(_0x2de2('0x2')===_0x46ba88&&console[_0x2de2('0xd')](_0x2de2('0x8')),'documentOutlineLicenseKeyTrialLimit:operations'===_0x46ba88)throw clearInterval(this[_0x2de2('0x9')]),new _0x49f7c1(_0x2de2('0xf'),null);_0x2de2('0x5')===_0x46ba88&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}[_0x2de2('0x3')](){this[_0x2de2('0x9')]&&clearInterval(this[_0x2de2('0x9')]);}}
23
+ const _0x47f4=['get','pluginName','document-outline-trial-license-key-reached-limit-changes','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.','documentOutlineLicenseKeyTrial','requires','licenseKey','document-outline-invalid-license-key','documentOutlineLicenseKeyInvalid','init','_licenseKeyCheckInterval','editor','DocumentOutline','config','documentOutlineLicenseKeyValid'];(function(_0x5ed45d,_0x47f457){const _0x3acb9a=function(_0x445c15){while(--_0x445c15){_0x5ed45d['push'](_0x5ed45d['shift']());}};_0x3acb9a(++_0x47f457);}(_0x47f4,0x1f2));const _0x3acb=function(_0x5ed45d,_0x47f457){_0x5ed45d=_0x5ed45d-0x0;let _0x3acb9a=_0x47f4[_0x5ed45d];return _0x3acb9a;};import{Plugin as _0x41791e}from'ckeditor5/src/core';import{CKEditorError as _0x1b19f9}from'ckeditor5/src/utils';import _0x598dc5 from'./documentoutline/documentoutlineutils';import _0x4ee4f5 from'./documentoutline/documentoutlineui';export default class l extends _0x41791e{static get[_0x3acb('0x2')](){return[_0x598dc5,_0x4ee4f5];}static get[_0x3acb('0xd')](){return _0x3acb('0x9');}constructor(_0x515352){super(_0x515352),this[_0x3acb('0x7')]=null;}[_0x3acb('0x6')](){const _0x1e72a3=this[_0x3acb('0x8')];this[_0x3acb('0x3')]=_0x1e72a3[_0x3acb('0xa')][_0x3acb('0xc')](_0x3acb('0x3'));const _0x503ff8=this[_0x3acb('0x8')];this[_0x3acb('0x7')]=setInterval(()=>{let _0x373daa;for(const _0x40004d in _0x503ff8){const _0x343305=_0x40004d,_0x1628ec=_0x503ff8[_0x343305];if(_0x3acb('0x1')===_0x1628ec||_0x3acb('0x5')===_0x1628ec||_0x3acb('0xb')===_0x1628ec||'documentOutlineLicenseKeyTrialLimit:operations'===_0x1628ec){delete _0x503ff8[_0x343305],_0x373daa=_0x1628ec;break;}}if('documentOutlineLicenseKeyInvalid'===_0x373daa)throw clearInterval(this[_0x3acb('0x7')]),new _0x1b19f9(_0x3acb('0x4'),null);if('documentOutlineLicenseKeyTrial'===_0x373daa&&console['info'](_0x3acb('0x0')),'documentOutlineLicenseKeyTrialLimit:operations'===_0x373daa)throw clearInterval(this[_0x3acb('0x7')]),new _0x1b19f9(_0x3acb('0xe'),null);_0x3acb('0xb')===_0x373daa&&clearInterval(this[_0x3acb('0x7')]);},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this[_0x3acb('0x7')]);}}
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 _0xc64c35 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':_0xc64c35};import'./augmentation';
23
+ export{default as DocumentOutline}from'./documentoutline';export{default as DocumentOutlineUI}from'./documentoutline/documentoutlineui';export{default as DocumentOutlineUtils}from'./documentoutline/documentoutlineutils';import _0xbde7ed 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':_0xbde7ed};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
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5996=['data','headingId.modelAttributeName','item','nodeAfter','writer','delete','headingId','isRegistered','afterInit','add','mapper','string','change','modelRange','has','HeadingId','getContainedElement','toViewElement','name','config','_registerHeadingIdAttributePostfixer','pluginName','setAttribute','clear','length','low','insert','attributes','upcastDispatcher','position','_customDataDowncastHeadingsConversion','getAttribute','viewItem','document','downcast','remove','set','get','getChanges','heading1','consume','for','forEach','model','editor','registerPostFixer','_customUpcastHeadingsConversion','type','paragraph','schema','differ'];(function(_0x5f5340,_0x5996b2){const _0x266b73=function(_0x730075){while(--_0x730075){_0x5f5340['push'](_0x5f5340['shift']());}};_0x266b73(++_0x5996b2);}(_0x5996,0x1f4));const _0x266b=function(_0x5f5340,_0x5996b2){_0x5f5340=_0x5f5340-0x0;let _0x266b73=_0x5996[_0x5f5340];return _0x266b73;};import{Plugin as _0x77a7ff}from'ckeditor5/src/core';import{uid as _0x3ce4d,priorities as _0x54401e}from'ckeditor5/src/utils';export default class A extends _0x77a7ff{static get[_0x266b('0x1f')](){return _0x266b('0x19');}[_0x266b('0x12')](){const _0x5bb823=this[_0x266b('0x3')];if(_0x5bb823[_0x266b('0x1d')][_0x266b('0x2f')](_0x266b('0xb')))return;(function(_0x4bf782){const _0x57dd46=new Map();if(_0x4bf782)return _0x4bf782[_0x266b('0x1')](_0x445a29=>{_0x266b('0x7')!==_0x445a29[_0x266b('0x2')]&&_0x57dd46['set'](_0x445a29['view'],_0x445a29[_0x266b('0x2')]);}),_0x57dd46[_0x266b('0x2f')]('h1')||_0x57dd46[_0x266b('0x2e')]('h1',_0x266b('0x31')),_0x57dd46;return _0x57dd46;}(this[_0x266b('0x3')][_0x266b('0x1d')][_0x266b('0x2f')]('heading.options'))[_0x266b('0x1')]((_0x4db317,_0x40a85d)=>{this[_0x266b('0x5')](_0x40a85d),this['_customDataDowncastHeadingsConversion'](_0x4db317),_0x5bb823[_0x266b('0x2')][_0x266b('0x8')][_0x266b('0x11')](_0x4db317)&&_0x5bb823[_0x266b('0x2')][_0x266b('0x8')]['extend'](_0x4db317,{'allowAttributes':_0x266b('0x10')});}),this[_0x266b('0x1e')]());}['_customUpcastHeadingsConversion'](_0x53ad22){this[_0x266b('0x3')][_0x266b('0xa')][_0x266b('0x26')]['on']('element:'+_0x53ad22,(_0x43cbd0,_0x5c40b1,_0x42428e)=>{const {consumable:_0x40ed28,writer:_0xe69d08}=_0x42428e,_0x40f8fe=_0x5c40b1[_0x266b('0x2a')]['getAttribute']('id'),_0x27658e=_0x5c40b1[_0x266b('0x17')][_0x266b('0x1a')]();if(!(_0x40f8fe&&_0x40f8fe[_0x266b('0x22')]||_0x27658e['hasAttribute'](_0x266b('0x10'))))return _0x40ed28[_0x266b('0x32')](_0x5c40b1[_0x266b('0x2a')],{'attributes':['id']}),void _0xe69d08[_0x266b('0x20')]('headingId',_0x3ce4d(),_0x27658e);_0x40ed28[_0x266b('0x32')](_0x5c40b1['viewItem'],{'attributes':['id']})&&_0xe69d08[_0x266b('0x20')](_0x266b('0x10'),_0x40f8fe,_0x27658e);},{'priority':_0x54401e[_0x266b('0x2f')](_0x266b('0x23'))+0.5});}[_0x266b('0x28')](_0x4ae3bb){this[_0x266b('0x3')]['conversion'][_0x266b('0x0')](_0x266b('0x2c'))[_0x266b('0x13')](_0x77c2da=>_0x77c2da['on']('attribute:headingId:'+_0x4ae3bb,(_0x1c1838,_0x46ea9b,_0x49c6d5)=>{if(!_0x49c6d5['consumable']['consume'](_0x46ea9b[_0x266b('0xc')],_0x1c1838[_0x266b('0x1c')]))return;const _0x39a966=_0x46ea9b[_0x266b('0xc')][_0x266b('0x29')](_0x266b('0x10')),_0x5a4d45=_0x49c6d5[_0x266b('0x14')][_0x266b('0x1b')](_0x46ea9b['item']);_0x49c6d5[_0x266b('0xe')][_0x266b('0x20')]('id',_0x39a966,_0x5a4d45);}));}[_0x266b('0x1e')](){const _0xce7fb7=this[_0x266b('0x3')],_0x4c27cf=new Set(),_0x227d23=new Set();function _0x5797bd(_0x3d8b5c,_0x23edf3){const _0x5ab199=_0x3ce4d();return _0x227d23[_0x266b('0x13')](_0x5ab199),_0x3d8b5c[_0x266b('0x20')]('headingId',_0x5ab199,_0x23edf3),_0x5ab199;}function _0x2876be(_0x369238,_0x19e00d){_0x369238['removeAttribute'](_0x266b('0x10'),_0x19e00d);}_0xce7fb7['model']['document'][_0x266b('0x4')](_0x28c193=>{const _0x309c3f=_0xce7fb7[_0x266b('0x2')][_0x266b('0x2b')][_0x266b('0x9')][_0x266b('0x30')]();let _0x1685e1=!0x1;for(const _0xe599bb of _0x309c3f)if(_0x266b('0x24')==_0xe599bb[_0x266b('0x6')]&&_0xe599bb[_0x266b('0x1c')]){if(_0xe599bb[_0x266b('0x1c')]['match'](/heading\d/)){const _0x8e0eb=_0xe599bb['attributes']['get'](_0x266b('0x10'));_0x266b('0x15')==typeof _0x8e0eb?_0x4c27cf[_0x266b('0x18')](_0x8e0eb)?(_0x5797bd(_0x28c193,_0xe599bb[_0x266b('0x27')][_0x266b('0xd')]),_0x1685e1=!0x0):_0x227d23[_0x266b('0x13')](_0x8e0eb):(_0x5797bd(_0x28c193,_0xe599bb[_0x266b('0x27')]['nodeAfter']),_0x1685e1=!0x0);}else _0x266b('0x15')==typeof _0xe599bb[_0x266b('0x25')][_0x266b('0x2f')]('headingId')&&(_0x2876be(_0x28c193,_0xe599bb['position'][_0x266b('0xd')]),_0x1685e1=!0x0);}else{if(_0x266b('0x2d')==_0xe599bb['type']){const _0x503a6c=_0xe599bb['attributes'][_0x266b('0x2f')](_0x266b('0x10'));_0x266b('0x15')==typeof _0x503a6c&&_0x4c27cf[_0x266b('0xf')](_0x503a6c);}}return _0x1685e1;}),_0xce7fb7[_0x266b('0x2')][_0x266b('0x2b')]['on'](_0x266b('0x16'),()=>{_0x227d23[_0x266b('0x1')](_0x3f8d8c=>_0x4c27cf['add'](_0x3f8d8c)),_0x227d23[_0x266b('0x21')]();});}}
23
+ const _0x16c7=['name','consume','registerPostFixer','attributes','getChanges','editor','consumable','has','document','get','attribute:headingId:','hasAttribute','nodeAfter','heading.options','item','set','type','forEach','isRegistered','element:','_customDataDowncastHeadingsConversion','headingId','remove','for','data','heading1','getAttribute','add','conversion','match','getContainedElement','upcastDispatcher','_registerHeadingIdAttributePostfixer','view','model','position','config','differ','insert','length','setAttribute','mapper','toViewElement','_customUpcastHeadingsConversion','modelRange','HeadingId','change','afterInit','string','viewItem','extend'];(function(_0x179bcf,_0x16c7a1){const _0x3144f4=function(_0x27098c){while(--_0x27098c){_0x179bcf['push'](_0x179bcf['shift']());}};_0x3144f4(++_0x16c7a1);}(_0x16c7,0xc7));const _0x3144=function(_0x179bcf,_0x16c7a1){_0x179bcf=_0x179bcf-0x0;let _0x3144f4=_0x16c7[_0x179bcf];return _0x3144f4;};import{Plugin as _0xe812ee}from'ckeditor5/src/core';import{uid as _0x3890f9,priorities as _0xc30553}from'ckeditor5/src/utils';export default class A extends _0xe812ee{static get['pluginName'](){return _0x3144('0x32');}[_0x3144('0x1')](){const _0x1b1917=this[_0x3144('0xa')];if(_0x1b1917[_0x3144('0x29')][_0x3144('0xe')]('headingId.modelAttributeName'))return;(function(_0x5611b1){const _0xb34197=new Map();if(_0x5611b1)return _0x5611b1['forEach'](_0x27fab7=>{'paragraph'!==_0x27fab7[_0x3144('0x27')]&&_0xb34197[_0x3144('0x14')](_0x27fab7[_0x3144('0x26')],_0x27fab7[_0x3144('0x27')]);}),_0xb34197[_0x3144('0xe')]('h1')||_0xb34197[_0x3144('0x14')]('h1',_0x3144('0x1e')),_0xb34197;return _0xb34197;}(this['editor'][_0x3144('0x29')][_0x3144('0xe')](_0x3144('0x12')))['forEach']((_0x18dd48,_0x26b1e5)=>{this[_0x3144('0x30')](_0x26b1e5),this[_0x3144('0x19')](_0x18dd48),_0x1b1917[_0x3144('0x27')]['schema'][_0x3144('0x17')](_0x18dd48)&&_0x1b1917['model']['schema'][_0x3144('0x4')](_0x18dd48,{'allowAttributes':_0x3144('0x1a')});}),this[_0x3144('0x25')]());}[_0x3144('0x30')](_0x32aaf4){this['editor'][_0x3144('0x1d')][_0x3144('0x24')]['on'](_0x3144('0x18')+_0x32aaf4,(_0x378475,_0x564b1d,_0x22164c)=>{const {consumable:_0x3d8112,writer:_0xf9cd54}=_0x22164c,_0x1b68d9=_0x564b1d['viewItem'][_0x3144('0x1f')]('id'),_0x382af8=_0x564b1d[_0x3144('0x31')][_0x3144('0x23')]();if(!(_0x1b68d9&&_0x1b68d9[_0x3144('0x2c')]||_0x382af8[_0x3144('0x10')](_0x3144('0x1a'))))return _0x3d8112[_0x3144('0x6')](_0x564b1d[_0x3144('0x3')],{'attributes':['id']}),void _0xf9cd54['setAttribute'](_0x3144('0x1a'),_0x3890f9(),_0x382af8);_0x3d8112[_0x3144('0x6')](_0x564b1d[_0x3144('0x3')],{'attributes':['id']})&&_0xf9cd54[_0x3144('0x2d')](_0x3144('0x1a'),_0x1b68d9,_0x382af8);},{'priority':_0xc30553[_0x3144('0xe')]('low')+0.5});}['_customDataDowncastHeadingsConversion'](_0x34a90e){this['editor'][_0x3144('0x21')][_0x3144('0x1c')]('downcast')[_0x3144('0x20')](_0x2de5df=>_0x2de5df['on'](_0x3144('0xf')+_0x34a90e,(_0x3a94ad,_0x278e59,_0x2981b1)=>{if(!_0x2981b1[_0x3144('0xb')][_0x3144('0x6')](_0x278e59[_0x3144('0x13')],_0x3a94ad[_0x3144('0x5')]))return;const _0x2a1f78=_0x278e59[_0x3144('0x13')]['getAttribute'](_0x3144('0x1a')),_0x48d72b=_0x2981b1[_0x3144('0x2e')][_0x3144('0x2f')](_0x278e59[_0x3144('0x13')]);_0x2981b1['writer'][_0x3144('0x2d')]('id',_0x2a1f78,_0x48d72b);}));}[_0x3144('0x25')](){const _0x321a24=this[_0x3144('0xa')],_0x1a6e61=new Set(),_0x2d70a2=new Set();function _0x2a4bf9(_0x31657e,_0x2e35c7){const _0x3a95c2=_0x3890f9();return _0x2d70a2[_0x3144('0x20')](_0x3a95c2),_0x31657e[_0x3144('0x2d')](_0x3144('0x1a'),_0x3a95c2,_0x2e35c7),_0x3a95c2;}function _0x4a9a93(_0x331892,_0x2d07c6){_0x331892['removeAttribute'](_0x3144('0x1a'),_0x2d07c6);}_0x321a24[_0x3144('0x27')][_0x3144('0xd')][_0x3144('0x7')](_0x399e6d=>{const _0x3bb2e4=_0x321a24[_0x3144('0x27')][_0x3144('0xd')][_0x3144('0x2a')][_0x3144('0x9')]();let _0x309203=!0x1;for(const _0x11f8ca of _0x3bb2e4)if(_0x3144('0x2b')==_0x11f8ca[_0x3144('0x15')]&&_0x11f8ca[_0x3144('0x5')]){if(_0x11f8ca[_0x3144('0x5')][_0x3144('0x22')](/heading\d/)){const _0x5d0077=_0x11f8ca[_0x3144('0x8')][_0x3144('0xe')](_0x3144('0x1a'));'string'==typeof _0x5d0077?_0x1a6e61[_0x3144('0xc')](_0x5d0077)?(_0x2a4bf9(_0x399e6d,_0x11f8ca[_0x3144('0x28')][_0x3144('0x11')]),_0x309203=!0x0):_0x2d70a2[_0x3144('0x20')](_0x5d0077):(_0x2a4bf9(_0x399e6d,_0x11f8ca['position'][_0x3144('0x11')]),_0x309203=!0x0);}else _0x3144('0x2')==typeof _0x11f8ca[_0x3144('0x8')][_0x3144('0xe')](_0x3144('0x1a'))&&(_0x4a9a93(_0x399e6d,_0x11f8ca[_0x3144('0x28')][_0x3144('0x11')]),_0x309203=!0x0);}else{if(_0x3144('0x1b')==_0x11f8ca[_0x3144('0x15')]){const _0x23152d=_0x11f8ca[_0x3144('0x8')]['get'](_0x3144('0x1a'));_0x3144('0x2')==typeof _0x23152d&&_0x1a6e61['delete'](_0x23152d);}}return _0x309203;}),_0x321a24[_0x3144('0x27')][_0x3144('0xd')]['on'](_0x3144('0x0'),()=>{_0x2d70a2[_0x3144('0x16')](_0x46c033=>_0x1a6e61['add'](_0x46c033)),_0x2d70a2['clear']();});}}
@@ -1,21 +1,21 @@
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/tableofcontents/tableofcontentscommand
7
- * @publicApi
8
- */
9
- import { Command } from 'ckeditor5/src/core';
10
- export default class TableOfContentsCommand extends Command {
11
- /**
12
- * Executes the command. Inserts the table of content into the model.
13
- *
14
- * @fires execute
15
- */
16
- execute(): void;
17
- /**
18
- * If the selection is wrong, the command is not enabled.
19
- */
20
- refresh(): void;
21
- }
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/tableofcontents/tableofcontentscommand
7
+ * @publicApi
8
+ */
9
+ import { Command } from 'ckeditor5/src/core';
10
+ export default class TableOfContentsCommand extends Command {
11
+ /**
12
+ * Executes the command. Inserts the table of content into the model.
13
+ *
14
+ * @fires execute
15
+ */
16
+ execute(): void;
17
+ /**
18
+ * If the selection is wrong, the command is not enabled.
19
+ */
20
+ refresh(): void;
21
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xd1e7=['insertObject','isEnabled','change','model','getFirstPosition','document','selection','editor','tableOfContents'];(function(_0x4daffe,_0xd1e7ca){const _0x16ab1c=function(_0x4af37d){while(--_0x4af37d){_0x4daffe['push'](_0x4daffe['shift']());}};_0x16ab1c(++_0xd1e7ca);}(_0xd1e7,0x1aa));const _0x16ab=function(_0x4daffe,_0xd1e7ca){_0x4daffe=_0x4daffe-0x0;let _0x16ab1c=_0xd1e7[_0x4daffe];return _0x16ab1c;};import{Command as _0x534dc1}from'ckeditor5/src/core';export default class O extends _0x534dc1{['execute'](){this[_0x16ab('0x4')]['model'][_0x16ab('0x8')](_0x796dd6=>{this[_0x16ab('0x4')][_0x16ab('0x0')][_0x16ab('0x6')](_0x796dd6['createElement'](_0x16ab('0x5')));});}['refresh'](){const _0x35eaa4=this['editor'][_0x16ab('0x0')],_0x4cdabc=_0x35eaa4[_0x16ab('0x2')][_0x16ab('0x3')][_0x16ab('0x1')]();this[_0x16ab('0x7')]=null!==(_0x4cdabc&&_0x35eaa4['schema']['findAllowedParent'](_0x4cdabc,_0x16ab('0x5')));}}
23
+ const _0xf532=['model','document','editor','selection','isEnabled','refresh','tableOfContents','execute','createElement','schema','getFirstPosition','findAllowedParent'];(function(_0x5e1d85,_0xf532d6){const _0x2a36f9=function(_0x1fa78d){while(--_0x1fa78d){_0x5e1d85['push'](_0x5e1d85['shift']());}};_0x2a36f9(++_0xf532d6);}(_0xf532,0x1ef));const _0x2a36=function(_0x5e1d85,_0xf532d6){_0x5e1d85=_0x5e1d85-0x0;let _0x2a36f9=_0xf532[_0x5e1d85];return _0x2a36f9;};import{Command as _0xd75cb4}from'ckeditor5/src/core';export default class O extends _0xd75cb4{[_0x2a36('0x4')](){this[_0x2a36('0xb')][_0x2a36('0x9')]['change'](_0x41a1f8=>{this['editor'][_0x2a36('0x9')]['insertObject'](_0x41a1f8[_0x2a36('0x5')](_0x2a36('0x3')));});}[_0x2a36('0x2')](){const _0x55a27b=this[_0x2a36('0xb')]['model'],_0x2f2a4c=_0x55a27b[_0x2a36('0xa')][_0x2a36('0x0')][_0x2a36('0x7')]();this[_0x2a36('0x1')]=null!==(_0x2f2a4c&&_0x55a27b[_0x2a36('0x6')][_0x2a36('0x8')](_0x2f2a4c,'tableOfContents'));}}