@kubex/zinc 1.0.119 → 1.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/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 +153 -27
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +904 -867
- 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/collapsible/collapsible.scss +4 -0
- 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/internal/zinc-element.ts +6 -1
- package/src/wc.scss +1 -0
- package/src/zinc.ts +2 -0
- package/src/components/editor/modules/toolbar/tool/tool.scss +0 -5
|
@@ -322,7 +322,10 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
322
322
|
const getDropdownIcon = (dropdown: HTMLElement) => {
|
|
323
323
|
const triggerBtn = dropdown.querySelector('zn-button[slot="trigger"]') as ZnButton | undefined;
|
|
324
324
|
const iconEl = triggerBtn?.querySelector('zn-icon') as HTMLElement | null;
|
|
325
|
-
|
|
325
|
+
const src = iconEl?.getAttribute('src');
|
|
326
|
+
if (!src) return src ?? undefined;
|
|
327
|
+
const library = iconEl?.getAttribute('library');
|
|
328
|
+
return library ? `${src}@${library}` : src;
|
|
326
329
|
};
|
|
327
330
|
|
|
328
331
|
const buttonLabelMap: Record<string, string> = {
|
|
@@ -366,6 +369,7 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
366
369
|
}
|
|
367
370
|
const submenu = document.createElement('zn-menu');
|
|
368
371
|
submenu.setAttribute('slot', 'submenu');
|
|
372
|
+
submenu.setAttribute('variant', 'shell');
|
|
369
373
|
|
|
370
374
|
const items = dropdown.querySelectorAll<ZnMenuItem>('zn-menu-item');
|
|
371
375
|
if (items.length) {
|
|
@@ -486,10 +490,10 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
486
490
|
<zn-button slot="trigger"
|
|
487
491
|
class="toolbar__overflow-trigger"
|
|
488
492
|
color="transparent"
|
|
489
|
-
icon="
|
|
493
|
+
icon="ellipsis@lu"
|
|
490
494
|
icon-size="18"
|
|
491
495
|
icon-position="right"></zn-button>
|
|
492
|
-
<zn-menu class="toolbar__overflow-menu"></zn-menu>
|
|
496
|
+
<zn-menu class="toolbar__overflow-menu" variant="shell"></zn-menu>
|
|
493
497
|
</zn-dropdown>
|
|
494
498
|
</div>
|
|
495
499
|
</div>
|
|
@@ -502,35 +506,35 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
502
506
|
<zn-button slot="trigger"
|
|
503
507
|
class="toolbar__dropdown-trigger toolbar__header-dropdown-trigger"
|
|
504
508
|
color="transparent"
|
|
505
|
-
icon="
|
|
509
|
+
icon="chevron-down@lu"
|
|
506
510
|
icon-size="18"
|
|
507
511
|
icon-position="right">
|
|
508
|
-
<zn-icon src="
|
|
512
|
+
<zn-icon src="case-sensitive@lu" size="18" color="primary"></zn-icon>
|
|
509
513
|
</zn-button>
|
|
510
|
-
<zn-menu>
|
|
514
|
+
<zn-menu variant="shell">
|
|
511
515
|
<zn-menu-item type="checkbox"
|
|
512
516
|
checked-position="right"
|
|
513
517
|
data-format="header"
|
|
514
518
|
data-format-type="1"
|
|
515
|
-
data-icon="
|
|
516
|
-
<zn-icon src="
|
|
519
|
+
data-icon="heading-1@lu">
|
|
520
|
+
<zn-icon src="heading-1@lu" size="18" slot="prefix"></zn-icon>
|
|
517
521
|
Heading 1
|
|
518
522
|
</zn-menu-item>
|
|
519
523
|
<zn-menu-item type="checkbox"
|
|
520
524
|
checked-position="right"
|
|
521
525
|
data-format="header"
|
|
522
526
|
data-format-type="2"
|
|
523
|
-
data-icon="
|
|
524
|
-
<zn-icon src="
|
|
527
|
+
data-icon="heading-2@lu">
|
|
528
|
+
<zn-icon src="heading-2@lu" size="18" slot="prefix"></zn-icon>
|
|
525
529
|
Heading 2
|
|
526
530
|
</zn-menu-item>
|
|
527
531
|
<zn-menu-item type="checkbox"
|
|
528
532
|
checked-position="right"
|
|
529
533
|
data-format="header"
|
|
530
534
|
data-format-type=""
|
|
531
|
-
data-icon="
|
|
535
|
+
data-icon="case-sensitive@lu"
|
|
532
536
|
checked>
|
|
533
|
-
<zn-icon src="
|
|
537
|
+
<zn-icon src="case-sensitive@lu" size="18" slot="prefix"></zn-icon>
|
|
534
538
|
Normal
|
|
535
539
|
</zn-menu-item>
|
|
536
540
|
</zn-menu>
|
|
@@ -545,34 +549,34 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
545
549
|
<zn-button slot="trigger"
|
|
546
550
|
class="toolbar__dropdown-trigger toolbar__format-dropdown-trigger"
|
|
547
551
|
color="transparent"
|
|
548
|
-
icon="
|
|
552
|
+
icon="chevron-down@lu"
|
|
549
553
|
icon-size="18"
|
|
550
554
|
icon-position="right">
|
|
551
|
-
<zn-icon src="
|
|
555
|
+
<zn-icon src="type@lu" size="18"></zn-icon>
|
|
552
556
|
</zn-button>
|
|
553
|
-
<zn-menu>
|
|
557
|
+
<zn-menu variant="shell">
|
|
554
558
|
<zn-menu-item type="checkbox" checked-position="right" data-format="strike">
|
|
555
|
-
<zn-icon src="
|
|
559
|
+
<zn-icon src="strikethrough@lu" size="18" slot="prefix"></zn-icon>
|
|
556
560
|
Strikethrough
|
|
557
561
|
</zn-menu-item>
|
|
558
562
|
<zn-menu-item type="checkbox" checked-position="right" data-format="blockquote">
|
|
559
|
-
<zn-icon src="
|
|
563
|
+
<zn-icon src="text-quote@lu" size="18" slot="prefix"></zn-icon>
|
|
560
564
|
Quote
|
|
561
565
|
</zn-menu-item>
|
|
562
566
|
${this._featureConfig.codeEnabled ? html`
|
|
563
567
|
<zn-menu-item type="checkbox" checked-position="right" data-format="code">
|
|
564
|
-
<zn-icon src="code" size="18" slot="prefix"></zn-icon>
|
|
568
|
+
<zn-icon src="code@lu" size="18" slot="prefix"></zn-icon>
|
|
565
569
|
Code
|
|
566
570
|
</zn-menu-item>
|
|
567
571
|
` : ''}
|
|
568
572
|
${this._featureConfig.codeBlocksEnabled ? html`
|
|
569
573
|
<zn-menu-item type="checkbox" checked-position="right" data-format="code-block">
|
|
570
|
-
<zn-icon src="
|
|
574
|
+
<zn-icon src="square-code@lu" size="18" slot="prefix"></zn-icon>
|
|
571
575
|
Code Block
|
|
572
576
|
</zn-menu-item>
|
|
573
577
|
` : ''}
|
|
574
578
|
<zn-menu-item data-format="clean">
|
|
575
|
-
<zn-icon src="
|
|
579
|
+
<zn-icon src="remove-formatting@lu" size="18" slot="prefix"></zn-icon>
|
|
576
580
|
Clear Formatting
|
|
577
581
|
</zn-menu-item>
|
|
578
582
|
</zn-menu>
|
|
@@ -583,17 +587,17 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
583
587
|
return html`
|
|
584
588
|
<zn-button class="toolbar__format-button"
|
|
585
589
|
color="transparent"
|
|
586
|
-
icon="
|
|
590
|
+
icon="bold@lu"
|
|
587
591
|
icon-size="18"
|
|
588
592
|
data-format="bold"></zn-button>
|
|
589
593
|
<zn-button class="toolbar__format-button"
|
|
590
594
|
color="transparent"
|
|
591
|
-
icon="
|
|
595
|
+
icon="italic@lu"
|
|
592
596
|
icon-size="18"
|
|
593
597
|
data-format="italic"></zn-button>
|
|
594
598
|
<zn-button class="toolbar__format-button"
|
|
595
599
|
color="transparent"
|
|
596
|
-
icon="
|
|
600
|
+
icon="underline@lu"
|
|
597
601
|
icon-size="18"
|
|
598
602
|
data-format="underline"></zn-button>`;
|
|
599
603
|
}
|
|
@@ -602,12 +606,12 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
602
606
|
return html`
|
|
603
607
|
<zn-button class="toolbar__format-button"
|
|
604
608
|
color="transparent"
|
|
605
|
-
icon="undo"
|
|
609
|
+
icon="undo@lu"
|
|
606
610
|
icon-size="18"
|
|
607
611
|
data-format="undo"></zn-button>
|
|
608
612
|
<zn-button class="toolbar__format-button"
|
|
609
613
|
color="transparent"
|
|
610
|
-
icon="redo"
|
|
614
|
+
icon="redo@lu"
|
|
611
615
|
icon-size="18"
|
|
612
616
|
data-format="redo"></zn-button>`;
|
|
613
617
|
}
|
|
@@ -618,14 +622,14 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
618
622
|
<zn-button slot="trigger"
|
|
619
623
|
class="toolbar__dropdown-trigger toolbar__color-dropdown-trigger"
|
|
620
624
|
color="transparent"
|
|
621
|
-
icon="
|
|
625
|
+
icon="chevron-down@lu"
|
|
622
626
|
icon-size="18"
|
|
623
627
|
icon-position="right">
|
|
624
|
-
<zn-icon src="
|
|
628
|
+
<zn-icon src="palette@lu" size="18"></zn-icon>
|
|
625
629
|
</zn-button>
|
|
626
|
-
<zn-menu>
|
|
630
|
+
<zn-menu variant="shell">
|
|
627
631
|
<zn-menu-item data-format="color" data-format-type="">
|
|
628
|
-
<zn-icon slot="prefix" class="color-icon--unset" src="
|
|
632
|
+
<zn-icon slot="prefix" class="color-icon--unset" src="brush-cleaning@lu" size="18"></zn-icon>
|
|
629
633
|
Unset
|
|
630
634
|
</zn-menu-item>
|
|
631
635
|
${colorDataProvider.getData.map((opt) => html`
|
|
@@ -644,19 +648,19 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
644
648
|
<zn-button slot="trigger"
|
|
645
649
|
class="toolbar__dropdown-trigger toolbar__list-dropdown-trigger"
|
|
646
650
|
color="transparent"
|
|
647
|
-
icon="
|
|
651
|
+
icon="chevron-down@lu"
|
|
648
652
|
icon-size="18"
|
|
649
653
|
icon-position="right">
|
|
650
|
-
<zn-icon src="
|
|
654
|
+
<zn-icon src="list-plus@lu" size="18"></zn-icon>
|
|
651
655
|
</zn-button>
|
|
652
|
-
<zn-menu>
|
|
656
|
+
<zn-menu variant="shell">
|
|
653
657
|
<zn-menu-item type="checkbox"
|
|
654
658
|
checked-position="right"
|
|
655
659
|
data-format="list"
|
|
656
660
|
data-format-type="bullet"
|
|
657
661
|
data-text="Bulleted List"
|
|
658
|
-
data-icon="
|
|
659
|
-
<zn-icon src="
|
|
662
|
+
data-icon="list@lu">
|
|
663
|
+
<zn-icon src="list@lu" size="18" slot="prefix"></zn-icon>
|
|
660
664
|
Bulleted
|
|
661
665
|
</zn-menu-item>
|
|
662
666
|
<zn-menu-item type="checkbox"
|
|
@@ -664,8 +668,8 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
664
668
|
data-format="list"
|
|
665
669
|
data-format-type="ordered"
|
|
666
670
|
data-text="Numbered List"
|
|
667
|
-
data-icon="
|
|
668
|
-
<zn-icon src="
|
|
671
|
+
data-icon="list-ordered@lu">
|
|
672
|
+
<zn-icon src="list-ordered@lu" size="18" slot="prefix"></zn-icon>
|
|
669
673
|
Numbered
|
|
670
674
|
</zn-menu-item>
|
|
671
675
|
<zn-menu-item type="checkbox"
|
|
@@ -673,8 +677,8 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
673
677
|
data-format="list"
|
|
674
678
|
data-format-type="checked"
|
|
675
679
|
data-text="Checked List"
|
|
676
|
-
data-icon="
|
|
677
|
-
<zn-icon src="
|
|
680
|
+
data-icon="list-todo@lu">
|
|
681
|
+
<zn-icon src="list-todo@lu" size="18" slot="prefix"></zn-icon>
|
|
678
682
|
Checked
|
|
679
683
|
</zn-menu-item>
|
|
680
684
|
</zn-menu>
|
|
@@ -687,39 +691,39 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
687
691
|
<zn-button slot="trigger"
|
|
688
692
|
class="toolbar__dropdown-trigger toolbar__file-dropdown-trigger"
|
|
689
693
|
color="transparent"
|
|
690
|
-
icon="
|
|
694
|
+
icon="chevron-down@lu"
|
|
691
695
|
icon-size="18"
|
|
692
696
|
icon-position="right">
|
|
693
|
-
<zn-icon src="
|
|
697
|
+
<zn-icon src="plus@lu" size="18"></zn-icon>
|
|
694
698
|
</zn-button>
|
|
695
|
-
<zn-menu>
|
|
699
|
+
<zn-menu variant="shell">
|
|
696
700
|
${this._featureConfig.dividersEnabled ? html`
|
|
697
701
|
<zn-menu-item checked-position="right" data-format="divider">
|
|
698
|
-
<zn-icon src="
|
|
702
|
+
<zn-icon src="minus@lu" size="18" slot="prefix"></zn-icon>
|
|
699
703
|
Divider
|
|
700
704
|
</zn-menu-item>
|
|
701
705
|
` : ''}
|
|
702
706
|
${this._featureConfig.linksEnabled ? html`
|
|
703
707
|
<zn-menu-item checked-position="right" data-format="link">
|
|
704
|
-
<zn-icon src="link" size="18" slot="prefix"></zn-icon>
|
|
708
|
+
<zn-icon src="link@lu" size="18" slot="prefix"></zn-icon>
|
|
705
709
|
Link
|
|
706
710
|
</zn-menu-item>
|
|
707
711
|
` : ''}
|
|
708
712
|
${this._featureConfig.attachmentsEnabled ? html`
|
|
709
713
|
<zn-menu-item checked-position="right" data-format="attachment">
|
|
710
|
-
<zn-icon src="
|
|
714
|
+
<zn-icon src="paperclip@lu" size="18" slot="prefix"></zn-icon>
|
|
711
715
|
Attachment
|
|
712
716
|
</zn-menu-item>
|
|
713
717
|
` : ''}
|
|
714
718
|
${this._featureConfig.imagesEnabled ? html`
|
|
715
719
|
<zn-menu-item checked-position="right" data-format="image">
|
|
716
|
-
<zn-icon src="image" size="18" slot="prefix"></zn-icon>
|
|
720
|
+
<zn-icon src="image@lu" size="18" slot="prefix"></zn-icon>
|
|
717
721
|
Image
|
|
718
722
|
</zn-menu-item>
|
|
719
723
|
` : ''}
|
|
720
724
|
${this._featureConfig.videosEnabled ? html`
|
|
721
725
|
<zn-menu-item checked-position="right" data-format="video">
|
|
722
|
-
<zn-icon src="
|
|
726
|
+
<zn-icon src="video@lu" size="18" slot="prefix"></zn-icon>
|
|
723
727
|
Video
|
|
724
728
|
</zn-menu-item>
|
|
725
729
|
` : ''}
|
|
@@ -733,10 +737,10 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
733
737
|
<zn-button slot="trigger"
|
|
734
738
|
class="toolbar__dropdown-trigger toolbar__emoji-dropdown-trigger"
|
|
735
739
|
color="transparent"
|
|
736
|
-
icon="
|
|
740
|
+
icon="chevron-down@lu"
|
|
737
741
|
icon-size="18"
|
|
738
742
|
icon-position="right">
|
|
739
|
-
<zn-icon src="
|
|
743
|
+
<zn-icon src="smile-plus@lu" size="18"></zn-icon>
|
|
740
744
|
</zn-button>
|
|
741
745
|
<div class="emoji-picker"></div>
|
|
742
746
|
</zn-dropdown>`;
|
|
@@ -748,10 +752,10 @@ export default class ToolbarComponent extends ZincElement {
|
|
|
748
752
|
<zn-button slot="trigger"
|
|
749
753
|
class="toolbar__dropdown-trigger toolbar__date-dropdown-trigger"
|
|
750
754
|
color="transparent"
|
|
751
|
-
icon="
|
|
755
|
+
icon="chevron-down@lu"
|
|
752
756
|
icon-size="18"
|
|
753
757
|
icon-position="right">
|
|
754
|
-
<zn-icon src="
|
|
758
|
+
<zn-icon src="calendar@lu" size="18"></zn-icon>
|
|
755
759
|
</zn-button>
|
|
756
760
|
<div class="date-picker"></div>
|
|
757
761
|
</zn-dropdown>`;
|
|
@@ -43,34 +43,14 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
&__dropdown-trigger {
|
|
47
|
-
|
|
48
|
-
height: 28px;
|
|
49
|
-
margin: 3px 2px;
|
|
50
|
-
|
|
51
|
-
&::part(icon) {
|
|
52
|
-
margin-left: 4px;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&__format-button,
|
|
57
|
-
&__action-button,
|
|
58
|
-
&__overflow-trigger {
|
|
59
|
-
width: 28px;
|
|
60
|
-
height: 28px;
|
|
61
|
-
margin: 3px 2px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Move underline icon down a bit */
|
|
65
|
-
&__format-button[icon="format_underlined"]::part(base) {
|
|
66
|
-
position: relative;
|
|
67
|
-
top: 1px;
|
|
46
|
+
&__dropdown-trigger::part(icon) {
|
|
47
|
+
margin-left: 4px;
|
|
68
48
|
}
|
|
69
49
|
}
|
|
70
50
|
|
|
71
51
|
.color-icon {
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
52
|
+
width: 18px;
|
|
53
|
+
height: 18px;
|
|
74
54
|
display: block;
|
|
75
55
|
border-radius: 100%;
|
|
76
56
|
flex-shrink: 0;
|
|
@@ -91,8 +71,3 @@
|
|
|
91
71
|
}
|
|
92
72
|
}
|
|
93
73
|
}
|
|
94
|
-
|
|
95
|
-
/* Line up unset value with color chips */
|
|
96
|
-
.color-icon--unset {
|
|
97
|
-
margin-inline-end: var(--zn-spacing-x-small);
|
|
98
|
-
}
|
|
@@ -3,7 +3,7 @@ import Quill from "quill";
|
|
|
3
3
|
import QuillToolbar from "quill/modules/toolbar";
|
|
4
4
|
import type {EditorFeatureConfig} from "../../editor.component";
|
|
5
5
|
import type Attachment from "../attachment/attachment";
|
|
6
|
-
import type
|
|
6
|
+
import type Dialog from "../dialog/dialog";
|
|
7
7
|
import type Emoji from "../emoji/emoji";
|
|
8
8
|
import type ToolbarComponent from "./toolbar.component";
|
|
9
9
|
import type ZnDropdown from "../../../dropdown";
|
|
@@ -12,7 +12,6 @@ import type ZnMenuItem from "../../../menu-item";
|
|
|
12
12
|
class Toolbar extends QuillToolbar {
|
|
13
13
|
private readonly _quill: Quill;
|
|
14
14
|
private readonly _component: ToolbarComponent;
|
|
15
|
-
private _lastDialogUri?: string;
|
|
16
15
|
private _formatters: Element[] = [];
|
|
17
16
|
|
|
18
17
|
constructor(quill: Quill, options: {
|
|
@@ -168,17 +167,17 @@ class Toolbar extends QuillToolbar {
|
|
|
168
167
|
const formats: Record<string, any> = this._quill.getFormat(range);
|
|
169
168
|
if (!formats) return;
|
|
170
169
|
|
|
171
|
-
this._syncButtonState('
|
|
172
|
-
this._syncButtonState('
|
|
173
|
-
this._syncButtonState('
|
|
170
|
+
this._syncButtonState('bold@lu', !!formats.bold);
|
|
171
|
+
this._syncButtonState('italic@lu', !!formats.italic);
|
|
172
|
+
this._syncButtonState('underline@lu', !!formats.underline);
|
|
174
173
|
|
|
175
174
|
this._updateHeadingFormatMenu(formats);
|
|
176
175
|
this._updateListFormatMenu(formats);
|
|
177
176
|
this._updateTextFormatMenu(formats);
|
|
178
177
|
this._updateColorFormatMenu(formats);
|
|
179
178
|
|
|
180
|
-
this._updateDropdownTrigger('zn-dropdown.toolbar__header-dropdown', '
|
|
181
|
-
this._updateDropdownTrigger('zn-dropdown.toolbar__list-dropdown', '
|
|
179
|
+
this._updateDropdownTrigger('zn-dropdown.toolbar__header-dropdown', 'case-sensitive@lu');
|
|
180
|
+
this._updateDropdownTrigger('zn-dropdown.toolbar__list-dropdown', 'list-plus@lu');
|
|
182
181
|
}
|
|
183
182
|
|
|
184
183
|
private _updateHeadingFormatMenu(formats: Record<string, any>) {
|
|
@@ -248,19 +247,25 @@ class Toolbar extends QuillToolbar {
|
|
|
248
247
|
const items = menu?.querySelectorAll('zn-menu-item') as NodeListOf<ZnMenuItem> | undefined;
|
|
249
248
|
|
|
250
249
|
let iconSrc = defaultIconSrc;
|
|
250
|
+
let iconLibrary = '';
|
|
251
251
|
let iconColor = 'default';
|
|
252
252
|
if (items?.length) {
|
|
253
253
|
items.forEach((item: ZnMenuItem) => {
|
|
254
254
|
const checked = item.checked ?? (item.hasAttribute('checked'));
|
|
255
255
|
if (checked) {
|
|
256
256
|
const icon = item.querySelector('zn-icon')!;
|
|
257
|
+
// zn-icon strips the `@library` suffix off `src` and stores it on the
|
|
258
|
+
// reflected `library` attribute, so carry both across — otherwise the
|
|
259
|
+
// rebuilt trigger loses the library and falls back to material.
|
|
257
260
|
iconSrc = icon?.getAttribute('src') ?? iconSrc;
|
|
261
|
+
iconLibrary = icon?.getAttribute('library') ?? '';
|
|
258
262
|
iconColor = 'primary';
|
|
259
263
|
}
|
|
260
264
|
});
|
|
261
265
|
}
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
const libraryAttr = iconLibrary ? ` library="${iconLibrary}"` : '';
|
|
268
|
+
trigger.innerHTML = `<zn-icon src="${iconSrc}"${libraryAttr} color="${iconColor}" size="18"></zn-icon>`;
|
|
264
269
|
}
|
|
265
270
|
|
|
266
271
|
private _syncButtonState(icon: string, active: boolean) {
|
|
@@ -322,18 +327,11 @@ class Toolbar extends QuillToolbar {
|
|
|
322
327
|
}
|
|
323
328
|
|
|
324
329
|
private _openDialog(uri: string) {
|
|
325
|
-
|
|
326
|
-
const dialog = document.querySelector(`zn-editor-dialog`) as DialogComponent | null;
|
|
327
|
-
if (!dialog) return;
|
|
328
|
-
|
|
329
|
-
dialog.dialogEl.showModal();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
const dialog = document.querySelector(`zn-editor-dialog`) as DialogComponent | null;
|
|
330
|
+
const dialog = (this._quill.getModule('dialog') as Dialog | undefined)?.component;
|
|
333
331
|
if (!dialog) return;
|
|
334
332
|
|
|
335
333
|
dialog.dialogEl.showModal();
|
|
336
|
-
dialog.setContent(`<app-space id="app-editor-modal" allow-scripts auto-load uri="${uri}"></app-space>`);
|
|
334
|
+
dialog.setContent(`<app-space id="app-editor-modal" allow-scripts auto-load loading-text="Loading, please wait..." uri="${uri}"></app-space>`);
|
|
337
335
|
}
|
|
338
336
|
|
|
339
337
|
private _handleOverflowUpdate = () => {
|
|
@@ -244,12 +244,13 @@ export default class ZnExpandingAction extends ZincElement {
|
|
|
244
244
|
render() {
|
|
245
245
|
return html`
|
|
246
246
|
${this.method === 'fill' ? html`
|
|
247
|
-
<zn-button
|
|
248
|
-
class="expanding-action__button"
|
|
247
|
+
<zn-button class="expanding-action__button"
|
|
249
248
|
@click="${this.handleIconClicked}"
|
|
250
249
|
icon="${this.icon}"
|
|
251
250
|
icon-color="${this.color}"
|
|
252
|
-
icon-size="20"
|
|
251
|
+
icon-size="20"
|
|
252
|
+
icon-button="small"
|
|
253
|
+
plain>
|
|
253
254
|
</zn-button>` : nothing}
|
|
254
255
|
<div
|
|
255
256
|
class="${classMap({
|
|
@@ -270,15 +271,21 @@ export default class ZnExpandingAction extends ZincElement {
|
|
|
270
271
|
protected renderDropdown() {
|
|
271
272
|
return html`
|
|
272
273
|
<zn-dropdown class="expanding-action__dropdown"
|
|
273
|
-
placement="bottom-end"
|
|
274
|
+
placement="bottom-end"
|
|
275
|
+
@zn-show="${() => {
|
|
276
|
+
this.open = true;
|
|
277
|
+
}}"
|
|
278
|
+
@zn-hide="${() => {
|
|
279
|
+
this.open = false;
|
|
280
|
+
}}">
|
|
274
281
|
<zn-button slot="trigger"
|
|
275
282
|
class="expanding-action__button"
|
|
276
|
-
color="transparent"
|
|
277
283
|
icon="${this.icon}"
|
|
278
284
|
icon-color="${this.color}"
|
|
279
285
|
icon-size="20"
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
icon-button="small"
|
|
287
|
+
plain
|
|
288
|
+
notification="${this.count || nothing}">
|
|
282
289
|
</zn-button>
|
|
283
290
|
<div id="content" class="expanding-action__content">
|
|
284
291
|
<slot></slot>
|
|
@@ -66,17 +66,59 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
.expanding-action--drop,
|
|
70
|
+
.expanding-action--drop .expanding-action__dropdown,
|
|
71
|
+
.expanding-action--drop .expanding-action__dropdown zn-button[slot="trigger"] {
|
|
72
|
+
height: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
69
75
|
.expanding-action--drop .expanding-action__content {
|
|
76
|
+
--expanding-action-trigger-width: 36px;
|
|
77
|
+
|
|
78
|
+
position: relative;
|
|
70
79
|
min-width: 300px;
|
|
71
80
|
width: var(--expanding-action-basis, var(--zn-container-smp, 320px));
|
|
72
81
|
max-width: 80vw;
|
|
73
82
|
max-height: min(60vh, var(--expanding-action-max-height, var(--auto-size-available-height, 50vh)));
|
|
74
|
-
box-shadow: 5px 5px 8px 3px rgba(0, 0, 0, 0.2);
|
|
75
83
|
background-color: rgb(var(--zn-panel));
|
|
84
|
+
box-shadow: 0 8px 16px -6px rgba(33, 33, 33, 0.18);
|
|
76
85
|
border: solid 1px rgb(var(--zn-border-color));
|
|
77
|
-
border-
|
|
86
|
+
border-top: 0;
|
|
87
|
+
border-radius: 0 0 var(--zn-border-radius) var(--zn-border-radius);
|
|
78
88
|
padding: 0;
|
|
79
89
|
height: 100%;
|
|
80
90
|
overflow: hidden;
|
|
81
91
|
overflow-y: auto;
|
|
92
|
+
|
|
93
|
+
&::before {
|
|
94
|
+
content: "";
|
|
95
|
+
position: absolute;
|
|
96
|
+
inset: 0 calc(var(--expanding-action-trigger-width) - 2px) auto 0;
|
|
97
|
+
z-index: 2;
|
|
98
|
+
height: 1px;
|
|
99
|
+
background: rgb(var(--zn-border-color));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([open]) .expanding-action__dropdown zn-button[slot="trigger"] {
|
|
104
|
+
position: relative;
|
|
105
|
+
z-index: calc(var(--zn-z-index-dropdown) + 1);
|
|
106
|
+
|
|
107
|
+
&::before {
|
|
108
|
+
content: "";
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
z-index: -1;
|
|
112
|
+
background: rgb(var(--zn-panel));
|
|
113
|
+
border: solid 1px rgb(var(--zn-border-color));
|
|
114
|
+
border-bottom-color: rgb(var(--zn-panel));
|
|
115
|
+
border-radius: var(--zn-border-radius) var(--zn-border-radius) 0 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([open]) .expanding-action__dropdown zn-button[slot="trigger"]::part(base) {
|
|
120
|
+
&:hover,
|
|
121
|
+
&:active {
|
|
122
|
+
background: transparent;
|
|
123
|
+
}
|
|
82
124
|
}
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
position: relative;
|
|
103
103
|
border: 1px solid var(--zn-input-border-color);
|
|
104
|
-
border-radius: var(--zn-border-radius
|
|
104
|
+
border-radius: var(--zn-border-radius);
|
|
105
105
|
font: var(--zn-font-size-medium);
|
|
106
106
|
min-height: 180px;
|
|
107
107
|
transition: var(--zn-transition-medium) background,
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
0 calc(var(--zn-droparea-checker-size) / 2),
|
|
165
165
|
calc(var(--zn-droparea-checker-size) / 2) calc(var(--zn-droparea-checker-size) / -2),
|
|
166
166
|
calc(var(--zn-droparea-checker-size) / -2) 0;
|
|
167
|
-
border-radius: calc(var(--zn-border-radius
|
|
167
|
+
border-radius: calc(var(--zn-border-radius) - 1px);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.droparea__preview {
|
|
@@ -140,7 +140,7 @@ export default class ZnHeader extends ZincElement {
|
|
|
140
140
|
${hasPreviousPath ? html`
|
|
141
141
|
<a href="${this.previousPath}" class="caption__back"
|
|
142
142
|
data-target="${this.previousTarget ? this.previousTarget : ''}">
|
|
143
|
-
<zn-button icon="
|
|
143
|
+
<zn-button icon="arrow-left@lu" icon-size="20" icon-button="small" plain></zn-button>
|
|
144
144
|
</a>` : null}
|
|
145
145
|
|
|
146
146
|
${hasDefaultSlot ? html`
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&__caption {
|
|
18
|
-
font-weight: var(--zn-font-weight
|
|
19
|
-
font-size: var(--zn-font-size
|
|
18
|
+
font-weight: var(--zn-text-h1-font-weight);
|
|
19
|
+
font-size: var(--zn-text-h1-font-size);
|
|
20
20
|
color: rgba(var(--zn-text-panel-title), 100%);
|
|
21
21
|
line-height: var(--zn-icon-size, 20px);
|
|
22
22
|
margin: 0;
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
display: flex;
|
|
215
215
|
align-items: center;
|
|
216
216
|
flex-wrap: wrap;
|
|
217
|
-
gap: var(--zn-spacing-
|
|
217
|
+
gap: var(--zn-spacing-small);
|
|
218
218
|
word-break: break-word;
|
|
219
219
|
}
|
|
220
220
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
flex-direction: column;
|
|
37
37
|
z-index: 2;
|
|
38
38
|
background-color: var(--zn-panel-background-color);
|
|
39
|
-
border-radius: var(--zn-border-radius
|
|
39
|
+
border-radius: var(--zn-border-radius);
|
|
40
40
|
border: 1px solid rgb(var(--zn-border-color));
|
|
41
41
|
box-shadow: var(--zn-shadow-x-large);
|
|
42
42
|
width: var(--width);
|
|
@@ -11,7 +11,7 @@ import type {IconNode, SVGProps} from 'lucide';
|
|
|
11
11
|
|
|
12
12
|
import styles from './icon.scss';
|
|
13
13
|
|
|
14
|
-
type IconLibrary = "src" | "material" | "material-outlined" | "material-round" | "material-sharp" |
|
|
14
|
+
export type IconLibrary = "src" | "material" | "material-outlined" | "material-round" | "material-sharp" |
|
|
15
15
|
"material-two-tone" | "material-symbols-outlined" | "gravatar" | "libravatar" | "avatar" | "brands" | "line" |
|
|
16
16
|
"lucide";
|
|
17
17
|
|
|
@@ -70,6 +70,8 @@ export default class ZnIcon extends ZincElement {
|
|
|
70
70
|
|
|
71
71
|
@property({reflect: true}) color: IconColor;
|
|
72
72
|
|
|
73
|
+
@property({reflect: true}) fill: IconColor;
|
|
74
|
+
|
|
73
75
|
@property({type: Boolean}) padded: boolean = false;
|
|
74
76
|
@property({type: Boolean}) blink: boolean = false;
|
|
75
77
|
|
|
@@ -244,9 +246,12 @@ export default class ZnIcon extends ZincElement {
|
|
|
244
246
|
'icon--padded': this.padded,
|
|
245
247
|
'icon--blink': this.blink,
|
|
246
248
|
'icon--squared': this.squared,
|
|
249
|
+
'icon--filled': this.fill !== undefined && this.fill !== null,
|
|
250
|
+
[`icon--fill-${this.fill}`]: Boolean(this.fill) && this.isPresetColor(this.fill),
|
|
247
251
|
})}" style="${styleMap({
|
|
248
252
|
'--icon-size': this.size + "px",
|
|
249
253
|
'--icon-color': (this.color && !this.isPresetColor(this.color)) ? this.color : null,
|
|
254
|
+
'--icon-fill': (this.fill && !this.isPresetColor(this.fill)) ? this.fill : null,
|
|
250
255
|
'--avatar-color': this.color ? null : (this.library === 'avatar' ? this.getColorForAvatar(this.getAvatarInitials(this.src)) : null)
|
|
251
256
|
})}">
|
|
252
257
|
${this.library && this.library !== "src" ? html`
|