@kubex/zinc 1.0.119 → 1.1.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/dist/custom-elements.json +453 -20
- package/dist/vscode.html-custom-data.json +87 -11
- package/dist/web-types.json +168 -12
- package/dist/zn.d.ts +149 -25
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +911 -874
- package/docs/assets/styles/docs.css +1 -1
- package/docs/pages/components/button.md +25 -7
- package/docs/pages/components/chat-message.md +62 -0
- package/docs/pages/components/data-table-search.md +6 -6
- package/docs/pages/components/editor.md +1 -1
- package/docs/pages/components/file.md +1 -1
- package/docs/pages/components/form-group.md +1 -1
- package/docs/pages/components/icon.md +19 -2
- package/docs/pages/components/menu.md +23 -2
- package/docs/pages/components/select.md +2 -2
- package/docs/pages/components/tile-group.md +92 -0
- package/docs/pages/components/tile.md +80 -25
- package/package.json +1 -1
- package/scss/_root.scss +1 -1
- package/scss/mixins/_spacing-mixins.scss +20 -0
- package/scss/mixins/_typography-mixins.scss +22 -0
- package/scss/mixins/index.scss +2 -1
- package/scss/shared/_base.scss +18 -20
- package/scss/shared/_button.scss +5 -3
- package/scss/shared/_table.scss +4 -1
- package/scss/shared/layout.scss +2 -2
- package/scss/themes/_index.scss +2 -0
- package/scss/themes/_light.scss +22 -45
- package/scss/themes/_spacing.scss +44 -0
- package/scss/themes/_typography.scss +62 -0
- package/src/components/animated-button/README.md +1 -1
- package/src/components/button/button.component.ts +27 -5
- package/src/components/button/button.scss +86 -30
- package/src/components/button-menu/button-menu.component.ts +22 -9
- package/src/components/button-menu/button-menu.scss +1 -2
- package/src/components/button-menu/button-menu.test.ts +18 -0
- package/src/components/chat-message/chat-message.component.ts +73 -0
- package/src/components/chat-message/chat-message.scss +60 -0
- package/src/components/chat-message/index.ts +12 -0
- package/src/components/checkbox/checkbox.scss +2 -2
- package/src/components/chip/chip.component.ts +0 -5
- package/src/components/chip/chip.scss +14 -35
- package/src/components/content-block/content-block.component.ts +46 -45
- package/src/components/content-block/content-block.scss +58 -27
- package/src/components/data-table/data-table.scss +10 -7
- package/src/components/data-table-sort/data-table-sort.scss +1 -1
- package/src/components/dialog/dialog.component.ts +3 -3
- package/src/components/dialog/dialog.scss +2 -2
- package/src/components/dropdown/dropdown.component.ts +1 -0
- package/src/components/editor/editor.component.ts +3 -1
- package/src/components/editor/editor.scss +9 -2
- package/src/components/editor/modules/ai/panel/ai-panel.scss +2 -2
- package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +1 -1
- package/src/components/editor/modules/context-menu/context-menu.ts +20 -20
- package/src/components/editor/modules/dialog/dialog.component.ts +3 -4
- package/src/components/editor/modules/dialog/dialog.scss +2 -1
- package/src/components/editor/modules/dialog/dialog.ts +12 -8
- package/src/components/editor/modules/toolbar/tool/tool.component.ts +1 -5
- package/src/components/editor/modules/toolbar/toolbar.component.ts +54 -50
- package/src/components/editor/modules/toolbar/toolbar.scss +4 -29
- package/src/components/editor/modules/toolbar/toolbar.ts +15 -17
- package/src/components/expanding-action/expanding-action.component.ts +14 -7
- package/src/components/expanding-action/expanding-action.scss +44 -2
- package/src/components/file/file.scss +2 -2
- package/src/components/header/header.component.ts +1 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/hover-container/hover-container.scss +1 -1
- package/src/components/icon/icon.component.ts +6 -1
- package/src/components/icon/icon.scss +31 -0
- package/src/components/icon-picker/icon-picker.scss +3 -3
- package/src/components/input/input.scss +3 -3
- package/src/components/input-group/input-group.scss +16 -16
- package/src/components/markdown-editor/markdown-editor.scss +2 -2
- package/src/components/menu/menu.component.ts +32 -1
- package/src/components/menu/menu.scss +28 -5
- package/src/components/menu-item/menu-item.component.ts +6 -2
- package/src/components/menu-item/menu-item.scss +49 -5
- package/src/components/navbar/navbar.component.ts +7 -4
- package/src/components/navbar/navbar.scss +93 -21
- package/src/components/page/page.component.ts +1 -1
- package/src/components/page/page.scss +7 -26
- package/src/components/panel/panel.scss +5 -8
- package/src/components/priority-list/priority-list.scss +1 -1
- package/src/components/rating/rating.scss +1 -1
- package/src/components/scroll-container/scroll-container.scss +2 -1
- package/src/components/select/select.scss +1 -1
- package/src/components/settings-container/settings-container.scss +2 -2
- package/src/components/stat/stat.scss +8 -5
- package/src/components/tile/tile.component.ts +10 -2
- package/src/components/tile/tile.scss +108 -67
- package/src/components/tile-group/index.ts +12 -0
- package/src/components/tile-group/tile-group.component.ts +66 -0
- package/src/components/tile-group/tile-group.scss +23 -0
- package/src/form-control.scss +2 -1
- package/src/wc.scss +1 -0
- package/src/zinc.ts +2 -0
- package/src/components/editor/modules/toolbar/tool/tool.scss +0 -5
|
@@ -1,62 +1,94 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
|
+
display: block;
|
|
4
5
|
text-rendering: optimizeLegibility;
|
|
5
6
|
-webkit-font-smoothing: antialiased;
|
|
6
7
|
-moz-osx-font-smoothing: grayscale;
|
|
7
8
|
|
|
9
|
+
padding-inline: calc(var(--zn-gutter, 0) + var(--zn-base-gap, 0));
|
|
10
|
+
|
|
8
11
|
*, *::before, *::after {
|
|
9
12
|
box-sizing: border-box;
|
|
10
|
-
border-width: 0;
|
|
11
|
-
border-style: solid;
|
|
12
|
-
border-color: rgb(var(--zn-border-color));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
.content-block-header {
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
19
|
gap: 10px;
|
|
20
|
+
width: 100%;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
padding: var(--zn-base-gap) 0;
|
|
23
|
+
position: relative;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
.content-block--collapsible {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
.content-block--collapsible .content-block-header {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.content-block-header__icon {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
flex-shrink: 0;
|
|
26
34
|
}
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
.content-block-header__main {
|
|
37
|
+
display: flex;
|
|
29
38
|
flex-direction: row;
|
|
30
39
|
align-items: center;
|
|
31
40
|
gap: 10px;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
flex-grow: 1;
|
|
43
|
+
overflow: hidden;
|
|
32
44
|
}
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
.content-block-header__caption {
|
|
47
|
+
font-weight: var(--zn-text-h1-font-weight);
|
|
48
|
+
font-size: var(--zn-text-h1-font-size);
|
|
49
|
+
color: rgba(var(--zn-text-panel-title), 100%);
|
|
50
|
+
line-height: var(--zn-icon-size, 20px);
|
|
51
|
+
margin: 0;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: var(--zn-spacing-x-small);
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
text-overflow: ellipsis;
|
|
36
59
|
}
|
|
37
60
|
|
|
38
|
-
.content-block
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
.content-block-header__description {
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
font-size: var(--zn-font-size-medium);
|
|
65
|
+
color: rgb(var(--zn-text-muted));
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
display: none;
|
|
46
70
|
}
|
|
47
71
|
|
|
48
|
-
|
|
49
|
-
display:
|
|
72
|
+
.content-block-header__actions {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 10px;
|
|
76
|
+
margin-left: auto;
|
|
77
|
+
flex-shrink: 0;
|
|
50
78
|
}
|
|
51
79
|
|
|
52
|
-
|
|
53
|
-
|
|
80
|
+
.content-block--short {
|
|
81
|
+
zn-sp {
|
|
54
82
|
display: none;
|
|
55
83
|
}
|
|
56
|
-
}
|
|
57
84
|
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
.content-block-header__description {
|
|
86
|
+
display: block;
|
|
87
|
+
|
|
88
|
+
@include wc.container-query(null, ph) {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
.text-section {
|
|
@@ -94,7 +126,6 @@ li[data-list=checked] > .ql-ui, li[data-list=unchecked] > .ql-ui {
|
|
|
94
126
|
|
|
95
127
|
li {
|
|
96
128
|
list-style-type: none;
|
|
97
|
-
padding-left: 1em;
|
|
98
129
|
position: relative;
|
|
99
130
|
}
|
|
100
131
|
|
|
@@ -17,6 +17,9 @@ table {
|
|
|
17
17
|
max-width: 100%;
|
|
18
18
|
table-layout: auto;
|
|
19
19
|
text-align: left;
|
|
20
|
+
font-size: var(--zn-text-table-content-font-size);
|
|
21
|
+
line-height: var(--zn-text-table-content-line-height);
|
|
22
|
+
font-weight: var(--zn-text-table-content-font-weight);
|
|
20
23
|
|
|
21
24
|
tbody tr:nth-of-type(even) {
|
|
22
25
|
background-color: unset;
|
|
@@ -32,14 +35,14 @@ table {
|
|
|
32
35
|
|
|
33
36
|
&.table--standalone {
|
|
34
37
|
background-color: rgb(var(--zn-panel));
|
|
35
|
-
border-radius: var(--zn-border-radius
|
|
38
|
+
border-radius: var(--zn-border-radius);
|
|
36
39
|
border: 1px solid rgb(var(--zn-border-color));
|
|
37
40
|
overflow: hidden;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
thead {
|
|
41
44
|
color: rgb(var(--zn-text-heading));
|
|
42
|
-
font-weight:
|
|
45
|
+
font-weight: var(--zn-font-weight-medium);
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
thead tr th {
|
|
@@ -229,9 +232,9 @@ table {
|
|
|
229
232
|
}
|
|
230
233
|
|
|
231
234
|
.title {
|
|
232
|
-
font-weight:
|
|
235
|
+
font-weight: var(--zn-font-weight-semibold);
|
|
233
236
|
color: rgb(var(--zn-text-heading));
|
|
234
|
-
font-size:
|
|
237
|
+
font-size: var(--zn-text-table-content-font-size);
|
|
235
238
|
text-decoration: none;
|
|
236
239
|
}
|
|
237
240
|
|
|
@@ -349,7 +352,7 @@ table {
|
|
|
349
352
|
}
|
|
350
353
|
|
|
351
354
|
&__value {
|
|
352
|
-
font-size:
|
|
355
|
+
font-size: var(--zn-text-table-content-font-size);
|
|
353
356
|
}
|
|
354
357
|
}
|
|
355
358
|
}
|
|
@@ -399,11 +402,11 @@ table tbody tr.table__row--selected {
|
|
|
399
402
|
}
|
|
400
403
|
|
|
401
404
|
&:last-of-type td:first-of-type {
|
|
402
|
-
border-bottom-left-radius: var(--zn-border-radius
|
|
405
|
+
border-bottom-left-radius: var(--zn-border-radius);
|
|
403
406
|
}
|
|
404
407
|
|
|
405
408
|
&:last-of-type td:last-of-type {
|
|
406
|
-
border-bottom-right-radius: var(--zn-border-radius
|
|
409
|
+
border-bottom-right-radius: var(--zn-border-radius);
|
|
407
410
|
}
|
|
408
411
|
|
|
409
412
|
& + tr.table__row--selected td {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
&__dropdown {
|
|
10
10
|
background-color: rgb(var(--zn-panel));
|
|
11
11
|
border: solid 1px rgb(var(--zn-border-color));
|
|
12
|
-
border-radius: var(--zn-border-radius
|
|
12
|
+
border-radius: var(--zn-border-radius);
|
|
13
13
|
box-shadow: var(--zn-shadow-large);
|
|
14
14
|
padding: var(--zn-spacing-medium);
|
|
15
15
|
width: 300px;
|
|
@@ -229,10 +229,10 @@ export default class ZnDialog extends ZincElement {
|
|
|
229
229
|
part="close-button"
|
|
230
230
|
exportparts="base:close-button__base"
|
|
231
231
|
class="dialog__close"
|
|
232
|
-
icon="
|
|
232
|
+
icon="x@lu"
|
|
233
233
|
icon-size="24"
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
icon-button="small"
|
|
235
|
+
plain
|
|
236
236
|
@click="${() => this.requestClose('close-button')}"
|
|
237
237
|
></zn-button>
|
|
238
238
|
</div>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.dialog-container {
|
|
16
|
-
border-radius: var(--zn-border-radius
|
|
16
|
+
border-radius: var(--zn-border-radius);
|
|
17
17
|
background-color: var(--zn-panel-background-color);
|
|
18
18
|
margin: 2px;
|
|
19
19
|
overflow: auto;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
max-width: calc(100% - var(--zn-spacing-2x-large));
|
|
32
32
|
max-height: calc(100% - var(--zn-spacing-2x-large));
|
|
33
33
|
background-color: var(--zn-panel-background-color);
|
|
34
|
-
border-radius: var(--zn-border-radius
|
|
34
|
+
border-radius: var(--zn-border-radius);
|
|
35
35
|
box-shadow: var(--zn-shadow-x-large);
|
|
36
36
|
padding: 0;
|
|
37
37
|
margin: 10vh auto;
|
|
@@ -349,6 +349,7 @@ export default class ZnDropdown extends ZincElement {
|
|
|
349
349
|
exportparts="popup:base__popup"
|
|
350
350
|
id="dropdown"
|
|
351
351
|
placement=${this.placement}
|
|
352
|
+
distance=${this.distance}
|
|
352
353
|
skidding=${this.skidding}
|
|
353
354
|
strategy=${this.hoist ? 'fixed' : 'absolute'}
|
|
354
355
|
flip
|
|
@@ -423,7 +423,9 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
|
|
|
423
423
|
if (!target.hasAttribute('editor-mode')) return;
|
|
424
424
|
|
|
425
425
|
const editorMode = target.getAttribute('editor-mode');
|
|
426
|
-
if (
|
|
426
|
+
if (editorMode !== 'replace' && editorMode !== 'insert') return;
|
|
427
|
+
|
|
428
|
+
e.preventDefault();
|
|
427
429
|
|
|
428
430
|
const contentContainer = target.getAttribute('editor-content-id');
|
|
429
431
|
if (!contentContainer) return;
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
@use "../../../node_modules/quill/dist/quill.snow.css" as snow;
|
|
4
4
|
@use "../../wc";
|
|
5
5
|
|
|
6
|
+
@include wc.gutter;
|
|
7
|
+
|
|
6
8
|
:host, zn-editor {
|
|
9
|
+
--editor-gutter: calc(var(--zn-gutter, 0) + var(--zn-base-gap, 0));
|
|
10
|
+
|
|
7
11
|
width: 100%;
|
|
12
|
+
padding-inline: var(--editor-gutter);
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
:host {
|
|
@@ -13,6 +18,7 @@
|
|
|
13
18
|
-webkit-font-smoothing: antialiased;
|
|
14
19
|
-moz-osx-font-smoothing: grayscale;
|
|
15
20
|
min-height: 170px;
|
|
21
|
+
container-type: inline-size;
|
|
16
22
|
|
|
17
23
|
display: flex;
|
|
18
24
|
flex-direction: column;
|
|
@@ -62,7 +68,7 @@
|
|
|
62
68
|
color: rgb(var(--zn-text));
|
|
63
69
|
background-color: rgba(var(--zn-panel), var(--zn-panel-opacity));
|
|
64
70
|
font-size: 15px;
|
|
65
|
-
padding:
|
|
71
|
+
padding-inline: var(--editor-gutter);
|
|
66
72
|
|
|
67
73
|
img {
|
|
68
74
|
height: auto;
|
|
@@ -84,6 +90,7 @@
|
|
|
84
90
|
#toolbar-container, #action-container {
|
|
85
91
|
justify-content: space-between;
|
|
86
92
|
align-items: center;
|
|
93
|
+
padding-inline: var(--editor-gutter);
|
|
87
94
|
|
|
88
95
|
.wrap {
|
|
89
96
|
flex-grow: 1;
|
|
@@ -147,5 +154,5 @@
|
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
#toolbar {
|
|
150
|
-
padding:
|
|
157
|
+
padding-inline: var(--editor-gutter);
|
|
151
158
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
--zn-input-border-color-hover: var(--zn-input-border-color-hover);
|
|
39
39
|
--zn-input-text-color: var(--zn-input-text-color);
|
|
40
40
|
--zn-input-placeholder-color: var(--zn-input-placeholder-color);
|
|
41
|
-
--zn-input-border-radius: var(--zn-border-radius
|
|
41
|
+
--zn-input-border-radius: var(--zn-border-radius);
|
|
42
42
|
--zn-input-padding: 8px 12px;
|
|
43
43
|
--zn-input-font-size: 14px;
|
|
44
44
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&::part(textarea) {
|
|
54
|
-
border-radius: var(--zn-border-radius
|
|
54
|
+
border-radius: var(--zn-border-radius);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
background: var(--zn-panel-background-color);
|
|
20
20
|
border: 1px solid var(--zn-border-color);
|
|
21
|
-
border-radius: var(--zn-border-radius
|
|
21
|
+
border-radius: var(--zn-border-radius);
|
|
22
22
|
box-shadow: var(--zn-shadow-small);
|
|
23
23
|
|
|
24
24
|
&[aria-selected="true"],
|
|
@@ -262,45 +262,45 @@ class ContextMenu {
|
|
|
262
262
|
|
|
263
263
|
// 2) Built-in Actions (In order they should appear)
|
|
264
264
|
options.push(
|
|
265
|
-
{icon: '
|
|
266
|
-
{icon: '
|
|
267
|
-
{icon: '
|
|
268
|
-
{icon: '
|
|
269
|
-
{icon: '
|
|
265
|
+
{icon: 'bold@lu', label: 'Bold', format: 'bold', order: orderCounter++},
|
|
266
|
+
{icon: 'italic@lu', label: 'Italic', format: 'italic', order: orderCounter++},
|
|
267
|
+
{icon: 'underline@lu', label: 'Underline', format: 'underline', order: orderCounter++},
|
|
268
|
+
{icon: 'strikethrough@lu', label: 'Strikethrough', format: 'strike', order: orderCounter++},
|
|
269
|
+
{icon: 'text-quote@lu', label: 'Blockquote', format: 'blockquote', order: orderCounter++},
|
|
270
270
|
);
|
|
271
271
|
if (this._featureConfig.codeEnabled !== false) {
|
|
272
|
-
options.push({icon: 'code', label: 'Inline Code', format: 'code', order: orderCounter++});
|
|
272
|
+
options.push({icon: 'code@lu', label: 'Inline Code', format: 'code', order: orderCounter++});
|
|
273
273
|
}
|
|
274
274
|
if (this._featureConfig.codeBlocksEnabled !== false) {
|
|
275
|
-
options.push({icon: '
|
|
275
|
+
options.push({icon: 'square-code@lu', label: 'Code Block', format: 'code-block', order: orderCounter++});
|
|
276
276
|
}
|
|
277
277
|
options.push(
|
|
278
|
-
{icon: '
|
|
279
|
-
{icon: '
|
|
280
|
-
{icon: '
|
|
281
|
-
{icon: '
|
|
282
|
-
{icon: '
|
|
283
|
-
{icon: '
|
|
278
|
+
{icon: 'heading-1@lu', label: 'Heading 1', format: 'header', value: '1', order: orderCounter++},
|
|
279
|
+
{icon: 'heading-2@lu', label: 'Heading 2', format: 'header', value: '2', order: orderCounter++},
|
|
280
|
+
{icon: 'case-sensitive@lu', label: 'Normal Text', format: 'header', value: '', order: orderCounter++},
|
|
281
|
+
{icon: 'list@lu', label: 'Bulleted List', format: 'list', value: 'bullet', order: orderCounter++},
|
|
282
|
+
{icon: 'list-ordered@lu', label: 'Numbered List', format: 'list', value: 'ordered', order: orderCounter++},
|
|
283
|
+
{icon: 'list-todo@lu', label: 'Checklist', format: 'list', value: 'checked', order: orderCounter++}
|
|
284
284
|
);
|
|
285
285
|
if (this._featureConfig.linksEnabled !== false) {
|
|
286
|
-
options.push({icon: 'link', label: 'Link', format: 'link', value: true, order: orderCounter++});
|
|
286
|
+
options.push({icon: 'link@lu', label: 'Link', format: 'link', value: true, order: orderCounter++});
|
|
287
287
|
}
|
|
288
288
|
if (this._featureConfig.dividersEnabled !== false) {
|
|
289
|
-
options.push({icon: '
|
|
289
|
+
options.push({icon: 'minus@lu', label: 'Divider', format: 'divider', order: orderCounter++});
|
|
290
290
|
}
|
|
291
291
|
if (this._featureConfig.attachmentsEnabled !== false) {
|
|
292
|
-
options.push({icon: '
|
|
292
|
+
options.push({icon: 'paperclip@lu', label: 'Attachment', format: 'attachment', order: orderCounter++});
|
|
293
293
|
}
|
|
294
294
|
if (this._featureConfig.imagesEnabled !== false) {
|
|
295
|
-
options.push({icon: 'image', label: 'Image', format: 'image', order: orderCounter++});
|
|
295
|
+
options.push({icon: 'image@lu', label: 'Image', format: 'image', order: orderCounter++});
|
|
296
296
|
}
|
|
297
297
|
if (this._featureConfig.videosEnabled !== false) {
|
|
298
|
-
options.push({icon: '
|
|
298
|
+
options.push({icon: 'video@lu', label: 'Video', format: 'video', order: orderCounter++});
|
|
299
299
|
}
|
|
300
300
|
if (this._featureConfig.datesEnabled !== false) {
|
|
301
|
-
options.push({icon: '
|
|
301
|
+
options.push({icon: 'calendar@lu', label: 'Date', format: 'date', order: orderCounter++});
|
|
302
302
|
}
|
|
303
|
-
options.push({icon: '
|
|
303
|
+
options.push({icon: 'remove-formatting@lu', label: 'Clear Formatting', format: 'clean', order: orderCounter++});
|
|
304
304
|
|
|
305
305
|
// Sort options by order property
|
|
306
306
|
options.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
@@ -32,13 +32,12 @@ export default class DialogComponent extends ZincElement {
|
|
|
32
32
|
|
|
33
33
|
this.dialogEl.addEventListener("close", () => {
|
|
34
34
|
this.open = false;
|
|
35
|
+
this.innerHTML = '';
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
setContent(content: string) {
|
|
39
|
-
|
|
40
|
-
this.dialogEl.querySelector('.editor-dialog__content')!.innerHTML = content;
|
|
41
|
-
}
|
|
40
|
+
this.innerHTML = content;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
@watch('open', {waitUntilFirstUpdate: true})
|
|
@@ -104,7 +103,7 @@ export default class DialogComponent extends ZincElement {
|
|
|
104
103
|
@click="${() => this.dialogEl.close()}"
|
|
105
104
|
></zn-button>
|
|
106
105
|
<div class="editor-dialog__content">
|
|
107
|
-
|
|
106
|
+
<slot>${this._getLoadingState()}</slot>
|
|
108
107
|
</div>
|
|
109
108
|
</dialog>
|
|
110
109
|
`;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.editor-dialog {
|
|
15
15
|
background-color: rgb(var(--zn-panel));
|
|
16
16
|
border: 1px solid rgb(var(--zn-border-color));
|
|
17
|
-
border-radius: var(--zn-border-radius
|
|
17
|
+
border-radius: var(--zn-border-radius);
|
|
18
18
|
width: 100%;
|
|
19
19
|
max-width: 975px;
|
|
20
20
|
max-height: 650px;
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&__content {
|
|
40
|
+
min-height: min(500px, 70vh);
|
|
40
41
|
overflow: auto;
|
|
41
42
|
box-sizing: border-box;
|
|
42
43
|
}
|
|
@@ -17,17 +17,21 @@ class Dialog {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
private _initDialog() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this._component = existing;
|
|
23
|
-
} else {
|
|
24
|
-
this._component = this.createComponent()!;
|
|
25
|
-
this._document.body.appendChild(this._component);
|
|
26
|
-
}
|
|
27
|
-
|
|
20
|
+
this._component = this.createComponent()!;
|
|
21
|
+
this._mountPoint().appendChild(this._component);
|
|
28
22
|
this._component.editorId = this._editorId;
|
|
29
23
|
}
|
|
30
24
|
|
|
25
|
+
public get component(): DialogComponent {
|
|
26
|
+
return this._component;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private _mountPoint(): HTMLElement {
|
|
30
|
+
const root = this._quill.container.getRootNode();
|
|
31
|
+
const host = root instanceof ShadowRoot ? (root.host as HTMLElement) : null;
|
|
32
|
+
return host?.parentElement ?? this._document.body;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
private createComponent() {
|
|
32
36
|
const tpl = html`
|
|
33
37
|
<zn-editor-dialog></zn-editor-dialog>`;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {html} from "lit";
|
|
2
2
|
import {property} from "lit/decorators.js";
|
|
3
3
|
import ZincElement from "../../../../../internal/zinc-element";
|
|
4
4
|
|
|
5
|
-
import styles from './tool.scss';
|
|
6
|
-
|
|
7
5
|
export default class ZnEditorTool extends ZincElement {
|
|
8
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
9
|
-
|
|
10
6
|
@property() uri: string;
|
|
11
7
|
@property() label: string;
|
|
12
8
|
@property() key: string;
|