@ckeditor/ckeditor5-document-outline 0.0.0-nightly-20230629.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.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +22 -0
- package/README.md +39 -0
- package/build/document-outline.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +45 -0
- package/lang/contexts.json +6 -0
- package/lang/translations/ar.po +33 -0
- package/lang/translations/bg.po +33 -0
- package/lang/translations/bn.po +33 -0
- package/lang/translations/ca.po +33 -0
- package/lang/translations/cs.po +33 -0
- package/lang/translations/da.po +33 -0
- package/lang/translations/de.po +33 -0
- package/lang/translations/el.po +33 -0
- package/lang/translations/en-au.po +33 -0
- package/lang/translations/en.po +33 -0
- package/lang/translations/es.po +33 -0
- package/lang/translations/et.po +33 -0
- package/lang/translations/fi.po +33 -0
- package/lang/translations/fr.po +33 -0
- package/lang/translations/he.po +33 -0
- package/lang/translations/hi.po +33 -0
- package/lang/translations/hr.po +33 -0
- package/lang/translations/hu.po +33 -0
- package/lang/translations/id.po +33 -0
- package/lang/translations/it.po +33 -0
- package/lang/translations/ja.po +33 -0
- package/lang/translations/ko.po +33 -0
- package/lang/translations/lt.po +33 -0
- package/lang/translations/lv.po +33 -0
- package/lang/translations/ms.po +33 -0
- package/lang/translations/nl.po +33 -0
- package/lang/translations/no.po +33 -0
- package/lang/translations/pl.po +33 -0
- package/lang/translations/pt-br.po +33 -0
- package/lang/translations/pt.po +33 -0
- package/lang/translations/ro.po +33 -0
- package/lang/translations/ru.po +33 -0
- package/lang/translations/sk.po +33 -0
- package/lang/translations/sr.po +33 -0
- package/lang/translations/sv.po +33 -0
- package/lang/translations/th.po +33 -0
- package/lang/translations/tr.po +33 -0
- package/lang/translations/uk.po +33 -0
- package/lang/translations/vi.po +33 -0
- package/lang/translations/zh-cn.po +33 -0
- package/lang/translations/zh.po +33 -0
- package/package.json +38 -0
- package/src/augmentation.d.ts +27 -0
- package/src/augmentation.js +23 -0
- package/src/documentoutline/documentoutlineui.d.ts +39 -0
- package/src/documentoutline/documentoutlineui.js +23 -0
- package/src/documentoutline/documentoutlineutils.d.ts +66 -0
- package/src/documentoutline/documentoutlineutils.js +23 -0
- package/src/documentoutline/ui/documentoutlineitemview.d.ts +55 -0
- package/src/documentoutline/ui/documentoutlineitemview.js +23 -0
- package/src/documentoutline/ui/documentoutlineview.d.ts +44 -0
- package/src/documentoutline/ui/documentoutlineview.js +23 -0
- package/src/documentoutline/utils.d.ts +17 -0
- package/src/documentoutline/utils.js +23 -0
- package/src/documentoutline.d.ts +99 -0
- package/src/documentoutline.js +23 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +23 -0
- package/src/tableofcontents/headingid.d.ts +18 -0
- package/src/tableofcontents/headingid.js +23 -0
- package/src/tableofcontents/tableofcontentscommand.d.ts +21 -0
- package/src/tableofcontents/tableofcontentscommand.js +23 -0
- package/src/tableofcontents/tableofcontentsediting.d.ts +37 -0
- package/src/tableofcontents/tableofcontentsediting.js +23 -0
- package/src/tableofcontents/tableofcontentsui.d.ts +27 -0
- package/src/tableofcontents/tableofcontentsui.js +23 -0
- package/src/tableofcontents.d.ts +26 -0
- package/src/tableofcontents.js +23 -0
- package/theme/documentoutline.css +100 -0
- package/theme/icons/table-of-contents.svg +1 -0
- package/theme/tableofcontents.css +83 -0
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
+
import TableOfContentsEditing from './tableofcontents/tableofcontentsediting';
|
|
11
|
+
import TableOfContentsUI from './tableofcontents/tableofcontentsui';
|
|
12
|
+
/**
|
|
13
|
+
* The table of contents feature.
|
|
14
|
+
*
|
|
15
|
+
* For a detailed overview, check the {@glink features/table-of-contents Table of contents} feature documentation.
|
|
16
|
+
*/
|
|
17
|
+
export default class TableOfContents extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof TableOfContentsEditing, typeof TableOfContentsUI];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "TableOfContents";
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
var _0x5983=['pluginName','requires','TableOfContents'];(function(_0x445abb,_0x598324){var _0x38c8e4=function(_0x138e2b){while(--_0x138e2b){_0x445abb['push'](_0x445abb['shift']());}};_0x38c8e4(++_0x598324);}(_0x5983,0x183));var _0x38c8=function(_0x445abb,_0x598324){_0x445abb=_0x445abb-0x0;var _0x38c8e4=_0x5983[_0x445abb];return _0x38c8e4;};import{Plugin as _0x5afcbc}from'ckeditor5/src/core';import _0x3df495 from'./tableofcontents/tableofcontentsediting';import _0x5af7e0 from'./tableofcontents/tableofcontentsui';export default class c extends _0x5afcbc{static get[_0x38c8('0x1')](){return[_0x3df495,_0x5af7e0];}static get[_0x38c8('0x0')](){return _0x38c8('0x2');}}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 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
|
+
:root {
|
|
7
|
+
--ck-document-outline-padding: var(--ck-spacing-large);
|
|
8
|
+
--ck-document-outline-base-font-size: .875em;
|
|
9
|
+
--ck-document-outline-placeholder-color: var(--ck-color-engine-placeholder-text);
|
|
10
|
+
|
|
11
|
+
--ck-document-outline-indent-level-1: 0;
|
|
12
|
+
--ck-document-outline-indent-level-2: 1.5em;
|
|
13
|
+
--ck-document-outline-indent-level-3: 3em;
|
|
14
|
+
--ck-document-outline-indent-level-4: 4.5em;
|
|
15
|
+
--ck-document-outline-indent-level-5: 6em;
|
|
16
|
+
--ck-document-outline-indent-level-6: 7.5em;
|
|
17
|
+
|
|
18
|
+
--ck-document-outline-item-padding: var(--ck-spacing-small);
|
|
19
|
+
--ck-document-outline-item-active-color: var(--ck-color-base-active);
|
|
20
|
+
--ck-document-outline-item-default-color: hsl(0, 0%, 26%);
|
|
21
|
+
--ck-document-outline-item-hover-state-color: var(--ck-color-base-text);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ck.ck-document-outline {
|
|
25
|
+
padding: var(--ck-document-outline-padding);
|
|
26
|
+
font-size: var(--ck-document-outline-base-font-size);
|
|
27
|
+
user-select: none;
|
|
28
|
+
|
|
29
|
+
&:empty::before {
|
|
30
|
+
content: attr(data-document-outline-empty-placeholder);
|
|
31
|
+
display: inline-block;
|
|
32
|
+
color: var(--ck-document-outline-placeholder-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
& .ck-document-outline__item {
|
|
36
|
+
padding: var(--ck-document-outline-item-padding);
|
|
37
|
+
color: var(--ck-document-outline-item-default-color);
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
|
|
43
|
+
&.ck-document-outline__item_empty {
|
|
44
|
+
font-style: italic;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.ck-document-outline__item_empty:hover,
|
|
48
|
+
&:hover {
|
|
49
|
+
color: var(--ck-document-outline-item-hover-state-color);
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.ck-document-outline__item_active {
|
|
54
|
+
color: var(--ck-document-outline-item-active-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.ck-document-outline__item_level-1 {
|
|
58
|
+
font-size: 1.1em;
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[dir="ltr"] {
|
|
64
|
+
& .ck-document-outline__item {
|
|
65
|
+
@mixin document-outline-level-indents padding-left;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[dir="rtl"] {
|
|
70
|
+
& .ck-document-outline__item {
|
|
71
|
+
@mixin document-outline-level-indents padding-right;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@define-mixin document-outline-level-indents $padding-property {
|
|
77
|
+
&.ck-document-outline__item_level-1 {
|
|
78
|
+
$(padding-property): var(--ck-document-outline-indent-level-1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.ck-document-outline__item_level-2 {
|
|
82
|
+
$(padding-property): var(--ck-document-outline-indent-level-2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.ck-document-outline__item_level-3 {
|
|
86
|
+
$(padding-property): var(--ck-document-outline-indent-level-3);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.ck-document-outline__item_level-4 {
|
|
90
|
+
$(padding-property): var(--ck-document-outline-indent-level-4);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.ck-document-outline__item_level-5 {
|
|
94
|
+
$(padding-property): var(--ck-document-outline-indent-level-5);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.ck-document-outline__item_level-6 {
|
|
98
|
+
$(padding-property): var(--ck-document-outline-indent-level-6);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 19a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v8.022a6.47 6.47 0 0 0-1.5-.709V2a.5.5 0 0 0-.5-.5H3a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h6.313c.173.534.412 1.037.709 1.5H3Z"/><path d="M9.174 14a6.489 6.489 0 0 0-.155 1H6v-1h3.174Z"/><path d="M10.022 12c-.202.316-.378.65-.524 1H4v-1h6.022Z"/><path d="M12.034 10c-.448.283-.86.62-1.224 1H6v-1h6.034Z"/><path d="M12 4v1H4V4h8Z"/><path d="M14 7V6H6v1h8Z"/><path d="M15 9V8H7v1h8Z"/><path clip-rule="evenodd" d="M20 15.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM15.5 13a.5.5 0 0 0-.5.5V15h-1.5a.5.5 0 0 0 0 1H15v1.5a.5.5 0 0 0 1 0V16h1.5a.5.5 0 0 0 0-1H16v-1.5a.5.5 0 0 0-.5-.5Z"/></svg>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 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
|
+
@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
--ck-table-of-contents-padding: 1em;
|
|
10
|
+
--ck-table-of-contents-line-height: 1.5;
|
|
11
|
+
--ck-table-of-contents-items-start-padding: 24px;
|
|
12
|
+
--ck-table-of-contents-border-color: var(--ck-color-base-border);
|
|
13
|
+
--ck-table-of-contents-label-background-color: hsl(0, 0%, 46%);
|
|
14
|
+
--ck-table-of-contents-background-color: var(--ck-color-base-foreground);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ck-content {
|
|
18
|
+
& .table-of-contents {
|
|
19
|
+
margin: 0.9em auto;
|
|
20
|
+
|
|
21
|
+
&.table-of-contents_empty {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& .table-of-contents__placeholder {
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: var(--ck-table-of-contents-padding);
|
|
28
|
+
font-style: italic;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
& > ol {
|
|
32
|
+
padding: var(--ck-table-of-contents-padding);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
& ol {
|
|
36
|
+
margin: 0;
|
|
37
|
+
line-height: var(--ck-table-of-contents-line-height);
|
|
38
|
+
list-style-type: none;
|
|
39
|
+
|
|
40
|
+
& ol {
|
|
41
|
+
padding-inline-start: var(--ck-table-of-contents-items-start-padding);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& li {
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
cursor: default;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ck-editor__editable .ck-widget.table-of-contents {
|
|
55
|
+
position: relative;
|
|
56
|
+
background-color: var(--ck-table-of-contents-background-color);
|
|
57
|
+
border: 1px solid var(--ck-table-of-contents-border-color);
|
|
58
|
+
|
|
59
|
+
&.table-of-contents_empty {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[data-table-of-contents-label]::after {
|
|
64
|
+
content: attr(data-table-of-contents-label);
|
|
65
|
+
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: -1px;
|
|
68
|
+
right: 10px;
|
|
69
|
+
padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
|
|
70
|
+
background-color: var(--ck-table-of-contents-label-background-color);
|
|
71
|
+
|
|
72
|
+
font-size: 10px;
|
|
73
|
+
font-family: var(--ck-font-face);
|
|
74
|
+
line-height: 16px;
|
|
75
|
+
color: hsl(0, 0%, 100%);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
|
|
78
|
+
@mixin ck-dir rtl {
|
|
79
|
+
left: 10px;
|
|
80
|
+
right: auto;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|