kritzel-stencil 0.3.18 → 0.3.20
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/cjs/index-Xav9JFHg.js +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{kritzel-active-users_44.cjs.entry.js → kritzel-active-users_45.cjs.entry.js} +739 -310
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-DrHO_CYF.js → schema.constants-IBG5VW_J.js} +116 -59
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +22 -210
- package/dist/collection/classes/handlers/key.handler.js +1 -22
- package/dist/collection/classes/managers/browser-permission.manager.js +64 -0
- package/dist/collection/classes/managers/clipboard.manager.js +401 -0
- package/dist/collection/classes/objects/image.class.js +42 -0
- package/dist/collection/classes/tools/image-tool.class.js +1 -59
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +53 -0
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +133 -53
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +101 -43
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +1 -1
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +1 -1
- package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -0
- package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.js +173 -0
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/configs/default-engine-config.js +0 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/interfaces/notification.interface.js +1 -0
- package/dist/collection/themes/dark-theme.js +36 -0
- package/dist/collection/themes/light-theme.js +36 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-notification-card.d.ts +11 -0
- package/dist/components/kritzel-notification-card.js +1 -0
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-watermark.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.js +1 -1
- package/dist/components/{p-BvRrA4hN.js → p-6Ca7Eolf.js} +1 -1
- package/dist/components/{p-BpnIvNvq.js → p-BO1CnEOT.js} +1 -1
- package/dist/components/{p-CyqRcqsO.js → p-BPoDE87Q.js} +1 -1
- package/dist/components/p-BX-nQAyH.js +1 -0
- package/dist/components/{p-DNdXJp8F.js → p-Bg0xIZiR.js} +1 -1
- package/dist/components/{p-DmWSRsjK.js → p-BhODnvMO.js} +1 -1
- package/dist/components/{p-mz3pUWW4.js → p-Bm0aKWPw.js} +1 -1
- package/dist/components/{p-3HxnBrCM.js → p-BrAeYciD.js} +1 -1
- package/dist/components/{p-f8aW1ye7.js → p-BwuemYET.js} +1 -1
- package/dist/components/{p-U4oawa1x.js → p-C-RiEw9X.js} +1 -1
- package/dist/components/{p-DdH1cKED.js → p-C1jg5IQi.js} +1 -1
- package/dist/components/{p-SDZNC8GF.js → p-C4-Som48.js} +1 -1
- package/dist/components/{p-C9HGoDHE.js → p-C5TZjIE1.js} +1 -1
- package/dist/components/{p-7NsK0uHu.js → p-CC0J_kEP.js} +1 -1
- package/dist/components/{p-CIcLzcfA.js → p-CJEIUs0x.js} +1 -1
- package/dist/components/{p-Bzv9Px8v.js → p-CO0eEzos.js} +1 -1
- package/dist/components/{p-DDkmsPpV.js → p-COdwK_mi.js} +1 -1
- package/dist/components/{p-CPtDfadX.js → p-COj8EVzL.js} +1 -1
- package/dist/components/{p-CEnEDaix.js → p-CVV-HzFR.js} +1 -1
- package/dist/components/{p-6RjeGuvH.js → p-Cb5YwXbC.js} +1 -1
- package/dist/components/{p-DX5K8xnh.js → p-CbMLbDou.js} +1 -1
- package/dist/components/{p-DZdgXCAx.js → p-CdkNxxut.js} +1 -1
- package/dist/components/{p-BKJSh8qQ.js → p-CpR9lc-o.js} +1 -1
- package/dist/components/p-CpzicliK.js +1 -0
- package/dist/components/{p-IpoC5EEY.js → p-D0RYktBV.js} +1 -1
- package/dist/components/{p-DI4vQRE3.js → p-D0v9WP5w.js} +1 -1
- package/dist/components/{p-DgmtCdnL.js → p-D28ZylHn.js} +1 -1
- package/dist/components/{p-F5_X4dZG.js → p-DEpnJBA3.js} +1 -1
- package/dist/components/{p-BCNyR5Sw.js → p-DRsD38Nl.js} +1 -1
- package/dist/components/p-DWhWFDcC.js +9 -0
- package/dist/components/{p-Dz-Ti24X.js → p-DeqALrzV.js} +1 -1
- package/dist/components/{p-BKvHg9cv.js → p-Ndib1Jb3.js} +1 -1
- package/dist/components/{p-vAeiXe6c.js → p-NwN6r0N0.js} +1 -1
- package/dist/components/{p-NuLP1xHe.js → p-W1ZwImdd.js} +1 -1
- package/dist/components/{p-Jn6TNdfe.js → p-YFR180v-.js} +1 -1
- package/dist/components/p-pagW8YF7.js +1 -0
- package/dist/components/{p-v7dxxrL5.js → p-vf28uSsc.js} +1 -1
- package/dist/esm/index-Dhio9uis.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/{kritzel-active-users_44.entry.js → kritzel-active-users_45.entry.js} +739 -311
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{schema.constants-DchTXG3V.js → schema.constants-D35cwCYd.js} +116 -60
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-D35cwCYd.js +1 -0
- package/dist/stencil/p-e8e69a16.entry.js +9 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/core.class.d.ts +16 -19
- package/dist/types/classes/handlers/key.handler.d.ts +1 -1
- package/dist/types/classes/managers/browser-permission.manager.d.ts +41 -0
- package/dist/types/classes/managers/clipboard.manager.d.ts +86 -0
- package/dist/types/classes/objects/image.class.d.ts +10 -0
- package/dist/types/classes/tools/image-tool.class.d.ts +0 -14
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +20 -1
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +8 -4
- package/dist/types/components/ui/kritzel-notification-card/kritzel-notification-card.d.ts +22 -0
- package/dist/types/components.d.ts +83 -9
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/engine-state.interface.d.ts +0 -3
- package/dist/types/interfaces/notification.interface.d.ts +10 -0
- package/dist/types/interfaces/theme.interface.d.ts +43 -0
- package/package.json +8 -2
- package/readme.md +7 -111
- package/dist/components/p-Bc55X65h.js +0 -1
- package/dist/components/p-C_fKgKHu.js +0 -9
- package/dist/components/p-Cu9KYyoq.js +0 -1
- package/dist/stencil/p-86348986.entry.js +0 -9
- package/dist/stencil/p-DchTXG3V.js +0 -1
|
@@ -33,7 +33,7 @@ export class KritzelColorPalette {
|
|
|
33
33
|
render() {
|
|
34
34
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
35
35
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '6d003ec5b92f586532782144c25ca5a733741f20' }, h("div", { key: '031838b45da4916aa91d87c066ac950cfe3a1ddc', class: {
|
|
37
37
|
'color-grid': true,
|
|
38
38
|
'expanded': this.isExpanded,
|
|
39
39
|
}, style: {
|
|
@@ -4,7 +4,7 @@ export class KritzelFont {
|
|
|
4
4
|
size = 24;
|
|
5
5
|
color = '#000000';
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: 'e37350dd092fb7c81a5624bfdc39c3b9af66b894' }, h("div", { key: 'a962ccc23a48f62b86d49ae41b1c9c27bdc9a5b9', class: "font-preview", style: {
|
|
8
8
|
fontFamily: this.fontFamily,
|
|
9
9
|
fontSize: `${this.size}px`,
|
|
10
10
|
color: this.color
|
|
@@ -17,7 +17,7 @@ export class KritzelFontSize {
|
|
|
17
17
|
render() {
|
|
18
18
|
const color = 'var(--kritzel-global-text-primary)';
|
|
19
19
|
const sizes = this.sizes ?? [];
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: 'a314e990b56cb4e819c4d83a139016b1658606b8' }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
21
21
|
'size-container': true,
|
|
22
22
|
'selected': this.selectedSize === size,
|
|
23
23
|
}, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
|
|
@@ -28,7 +28,7 @@ export class KritzelInput {
|
|
|
28
28
|
this.valueChange.emit(input.value);
|
|
29
29
|
};
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '7e16272802a5485207721f4f01ddf8e956b56dac' }, h("div", { key: 'ab60dacd08c6199db507d896c00cd0c788ecf7fa', class: "input-container" }, this.label && h("label", { key: 'e2e5769ca2954442da5a0f2a2abb07847986eac8', class: "input-label" }, this.label), h("div", { key: 'e7131f6d1a770cf71de9f7086e3a8a092296b80e', class: { 'input-wrapper': true, 'has-suffix': !!this.suffix } }, h("input", { key: '565cb30ed36818badc148475c596b468cdd2a65b', type: this.type, class: "text-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput }), this.suffix && h("span", { key: 'ec4afb63443b6c89a829e515df7d33066f0f8def', class: "input-suffix" }, this.suffix)))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "kritzel-input"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,15 +90,15 @@ export class KritzelMasterDetail {
|
|
|
90
90
|
const selectedItem = this.items.find(item => item.id === this.selectedItemId);
|
|
91
91
|
const panelId = 'master-detail-panel';
|
|
92
92
|
const selectedTabId = selectedItem ? `tab-${selectedItem.id}` : undefined;
|
|
93
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: 'e094bc3df0e0d1598e84c9a17a033079b1db33f6' }, h("div", { key: '79509ba5d63703fe36650b07b5172f77bd6eafde', class: {
|
|
94
94
|
'master-detail-container': true,
|
|
95
95
|
'is-mobile-detail-visible': this.showMobileDetail,
|
|
96
|
-
} }, h("nav", { key: '
|
|
96
|
+
} }, h("nav", { key: '79d200d8c2e54789a33fc88b07c48f034de140ad', class: "master-menu", role: "tablist", "aria-orientation": "vertical", "aria-label": "Settings categories" }, this.items.map((item, index) => (h("button", { key: item.id, id: `tab-${item.id}`, ref: el => this.setTabRef(el, index), class: {
|
|
97
97
|
'menu-item': true,
|
|
98
98
|
'is-selected': item.id === this.selectedItemId,
|
|
99
99
|
'is-disabled': !!item.disabled,
|
|
100
100
|
'is-focused': index === this.focusedIndex,
|
|
101
|
-
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: '
|
|
101
|
+
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: '642b65781509d192330bb2602dd081585d16f76d', id: panelId, class: "detail-panel", role: "tabpanel", "aria-labelledby": selectedTabId }, h("button", { key: '18a922dbaad63f05bc3ca7de176de4996b5d7fcb', class: "mobile-back-button", onClick: this.handleBackClick, "aria-label": "Back to menu" }, h("kritzel-icon", { key: 'b31732cef2ffdb78e67be7ab793aaaf60e373763', name: "chevron-left", size: 20, class: "mobile-back-icon" }), "Back"), h("slot", { key: '48fe4ae631a8c0b2db9e4a232edb6300d603562c' })))));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "kritzel-master-detail"; }
|
|
104
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,7 +51,7 @@ export class KritzelMenu {
|
|
|
51
51
|
this.itemCloseChildMenu.emit(event.detail);
|
|
52
52
|
};
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: '6dfdc7928ae69aa191b2c64f9db79801e6978e92', tabIndex: 0, onClick: e => e.stopPropagation() }, this.openChildMenuItem && h("div", { key: 'ab8fa25f1b6ee0b7960cb0df84c40b1a7648c4e9', class: "has-open-child-overlay", onClick: this.onOverlayClick }), this.items.map(item => (h("kritzel-menu-item", { key: item.id, "data-testid": `menu-item-${item.id}`, item: item, parent: this.parent, style: { pointerEvents: this.editingMenuItem && !item.isEditing ? 'none' : 'auto' }, onItemSelect: this.handleItemSelect, onItemSave: this.handleSave, onItemCancel: this.handleCancel, onItemToggleChildMenu: this.handleToggleChildMenu, onItemCloseChildMenu: this.handleCloseChildMenu })))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "kritzel-menu"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,12 +90,12 @@ export class KritzelMenuItem {
|
|
|
90
90
|
];
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: 'dbdcfcee7fd36fe0b9c405dd3d1641aa62465e53', tabIndex: this.item.isDisabled ? -1 : 0, class: {
|
|
94
94
|
'selected': this.item.isSelected,
|
|
95
95
|
'editing': this.item.isEditing,
|
|
96
96
|
'disabled': this.item.isDisabled,
|
|
97
97
|
'child-open': this.item.isChildMenuOpen,
|
|
98
|
-
}, onClick: this.handleItemSelect }, h("div", { key: '
|
|
98
|
+
}, onClick: this.handleItemSelect }, h("div", { key: 'ef97c7cf48190c1bbdde0dd9011cc1d5674b7c94', class: "menu-item-overlay" }), this.item.isEditing ? this.renderEditMode() : this.renderViewMode()));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "kritzel-menu-item"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -86,7 +86,7 @@ export class KritzelNumericInput {
|
|
|
86
86
|
this.valueChange.emit(newValue);
|
|
87
87
|
};
|
|
88
88
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: '008f18fc5ab81adcd82364706ca7d4c39ea39d77' }, h("div", { key: '5d91b2ec6e0458d186d923c422e8f6461ac7c51a', class: "input-container" }, this.label && h("label", { key: '45c911f1e11ff8289ab876192511f506eb65c940', class: "input-label" }, this.label), h("div", { key: 'f5e0bd1610a4085a291cc1d32787b68066757c69', class: "input-wrapper" }, h("input", { key: '897b1af7725f59df86a530836dda802e8cb04038', type: "number", class: "numeric-input", title: "", min: this.min === Number.MIN_SAFE_INTEGER ? undefined : this.min, max: this.max === Number.MAX_SAFE_INTEGER ? undefined : this.max, step: this.step, value: this.inputValue, placeholder: this.placeholder, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, onInvalid: this.handleInvalid }), h("div", { key: '1acab70c82ff7431f916685084a6e5dd827cdca3', class: "spinner-buttons" }, h("button", { key: 'd93c4bec338d49ead87897baf61d2e036999a035', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, h("svg", { key: '1e52d43c1eb1e9a43025302a7cd1f3d74c038c36', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: '2a96516390bd9caf5b6a3617d07f7b10e2b42451', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: '038cf61f4b8982a17bf5c279d78556872a03efea', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, h("svg", { key: '30110c2ad975b51049a902953c52be66c1b7b0af', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: '5abe735234debfa80a983d2fb60eeeaedb1dbf9b', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "kritzel-numeric-input"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,7 +22,7 @@ export class KritzelOpacitySlider {
|
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
24
|
const percentage = this.getPercentage();
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: 'e3a18981e5193ecd1ffaae5c807bdf6fa67e9695' }, h("div", { key: 'ee5ff0bb1355ca4f7e5d727ab8861933259c1a82', class: "opacity-container" }, h("div", { key: '6362fb3dba6910c55f5fe3b2a4245bcbb33dcdbb', class: "slider-wrapper" }, h("input", { key: 'f435f00fff7cc17ccdc181f39b29e032f6c5bf8d', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
26
26
|
'--slider-progress': `${percentage}%`,
|
|
27
27
|
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
28
28
|
} })))));
|
|
@@ -277,7 +277,7 @@ export class KritzelPortal {
|
|
|
277
277
|
this.portal.style.visibility = 'visible';
|
|
278
278
|
}
|
|
279
279
|
render() {
|
|
280
|
-
return (h(Host, { key: '
|
|
280
|
+
return (h(Host, { key: '95fbfde070f33a7f1b59026de7c687a2f6d0119c', style: { display: this.anchor ? 'block' : 'none' } }, h("slot", { key: '14af59a35c5caf71079f7afb5ea6f4c5f13b05f8' })));
|
|
281
281
|
}
|
|
282
282
|
static get is() { return "kritzel-portal"; }
|
|
283
283
|
static get encapsulation() { return "shadow"; }
|
|
@@ -21,7 +21,7 @@ export class KritzelSlideToggle {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '5850c758ccf3263b21c397219bf2301fa088087d', class: { checked: this.checked, disabled: this.disabled }, tabIndex: this.disabled ? -1 : 0, role: "switch", "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.label, onClick: this.handleToggle, onKeyDown: this.handleKeyDown }, h("div", { key: 'df0adeca0447a13d5499219ac9d27b526252fdbe', class: "toggle-track" }, h("div", { key: '3938239bbdca29e62ed72229dfcf1904fcbaa983', class: "toggle-thumb" }))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "kritzel-slide-toggle"; }
|
|
27
27
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +82,7 @@ export class KritzelSplitButton {
|
|
|
82
82
|
this.menuScrollTop = event.target.scrollTop;
|
|
83
83
|
};
|
|
84
84
|
render() {
|
|
85
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: 'd6856a86b3be4d9a22c5e78df1bda19113cb988b', class: { mobile: this.isTouchDevice } }, h("button", { key: 'd26026af275a8bd5717254223d5829e3d7f02bcb', class: "split-main-button", tabIndex: 0, onClick: this.handleButtonClick, disabled: this.mainButtonDisabled, "aria-label": "Main action" }, this.buttonIcon && h("kritzel-icon", { key: '1b3e2f4c2f8245b281d0f85458fd6bcc0cc73c59', name: this.buttonIcon })), h("div", { key: 'b002b904e168d62075fa086c88df72e36cc8e8c2', class: "split-divider" }), h("button", { key: 'd39084da6775613f2c896f3fa1ae4e216505bacc', ref: el => (this.splitMenuButtonRef = el), class: "split-menu-button", tabIndex: 0, onClick: this.toggleMenu, disabled: this.menuButtonDisabled, "aria-label": "Open menu" }, h("kritzel-icon", { key: 'b1bc427b0d7cd26a283dbeb772dee0a6d2ca172c', name: this.dropdownIcon })), h("kritzel-portal", { key: 'e76300f48a23772a5923ea2cbd0824590302e7e7', anchor: this.anchorElement, offsetY: 4, onClose: this.closeMenu }, h("kritzel-menu", { key: 'f110b9315ec63dca9bb1b615136b2d3e284567ba', ref: el => (this.menuRef = el), items: this.items, onItemSelect: this.handleItemSelect, onItemSave: this.handleItemSave, onItemCancel: this.handleItemCancel, onItemToggleChildMenu: this.handleItemToggleChildMenu, onItemCloseChildMenu: this.handleItemCloseChildMenu, onClose: this.closeMenu, onScroll: this.handleScroll }))));
|
|
86
86
|
}
|
|
87
87
|
static get is() { return "kritzel-split-button"; }
|
|
88
88
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,7 +9,7 @@ export class KritzelStrokeSize {
|
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
11
|
const sizes = this.sizes ?? [];
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'bde2cc986aebbe869a3eea026654229dee0d3e0e' }, h("div", { key: 'f84c4b844b865080f4e0e245bbccc6d77ac3f049', class: "size-grid" }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
13
13
|
'size-container': true,
|
|
14
14
|
'selected': this.selectedSize === size,
|
|
15
15
|
}, onClick: () => this.handleSizeClick(size) }, h("kritzel-color", { value: 'var(--kritzel-global-text-primary)', size: size })))))));
|
|
@@ -128,14 +128,14 @@ export class KritzelTooltip {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
render() {
|
|
131
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: 'ba4d13171aa25acac6c615ee12f35eab96d0aad6', style: {
|
|
132
132
|
position: 'fixed',
|
|
133
133
|
zIndex: '9999',
|
|
134
134
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
135
135
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
136
136
|
left: `${this.positionX}px`,
|
|
137
137
|
bottom: `${this.positionY}px`,
|
|
138
|
-
} }, h("div", { key: '
|
|
138
|
+
} }, h("div", { key: '923168164a018b08eac4246d88c7f8648b71d078', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, h("slot", { key: 'aafad8ab026d591ebb9e2aeffa15d07718eba261' }))));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "kritzel-tooltip"; }
|
|
141
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,7 +16,7 @@ export class KritzelBackToContent {
|
|
|
16
16
|
this.backToContent.emit();
|
|
17
17
|
};
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'a7d52616642f45a0c0e7b76deb3cc5994184b968' }, h("button", { key: '9e7acae2b62f7f66ee0127545ee8ab115f9d340e', class: { 'back-to-content-button': true, visible: this.visible }, onClick: this.handleClick, "aria-label": this.text }, h("kritzel-icon", { key: '6c404376643554cdb86c33957c066dd4580f19f1', name: "chevrons-left" }))));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "kritzel-back-to-content"; }
|
|
22
22
|
static get encapsulation() { return "shadow"; }
|
|
@@ -233,13 +233,13 @@ export class KritzelControls {
|
|
|
233
233
|
// Separate tool controls from config control
|
|
234
234
|
const toolControls = this.internalControls.filter(c => c.type === 'tool' || c.type === 'separator');
|
|
235
235
|
const configControl = this.internalControls.find(c => c.type === 'config' && c.name === this.firstConfig?.name);
|
|
236
|
-
return (h(Host, { key: '
|
|
236
|
+
return (h(Host, { key: '266e38cdeffb8c22a7f778e865e5fab6b461f5b6', style: { display: this.visible ? '' : 'none' }, class: {
|
|
237
237
|
mobile: this.isTouchDevice,
|
|
238
|
-
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: '
|
|
238
|
+
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: '5e75ece000ac02675d3d226461b7f522dcf5ead9', style: {
|
|
239
239
|
position: 'absolute',
|
|
240
240
|
bottom: '56px',
|
|
241
241
|
left: '12px',
|
|
242
|
-
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: '
|
|
242
|
+
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: 'fc98b1675afe1abb6a8d391c4ace34c7f0e46677', class: "kritzel-controls" }, h("div", { key: 'b17bc9e9a65646735c56f78a326a281229fa9790', class: { 'scroll-indicator-left': true, 'visible': this.canScrollLeft } }), h("div", { key: '9ab9d5c44e515551d75f27c31875de72e9d3407c', class: "kritzel-tools-scroll", ref: el => (this.toolsScrollRef = el), onScroll: this.handleToolsScroll }, toolControls.map(control => {
|
|
243
243
|
// Check if this control has sub-options (split-button)
|
|
244
244
|
if (control.subOptions?.length) {
|
|
245
245
|
const selectedSubOption = this.getSelectedSubOption(control);
|
|
@@ -269,10 +269,10 @@ export class KritzelControls {
|
|
|
269
269
|
'kritzel-control': true,
|
|
270
270
|
'selected': this.activeControl?.name === control?.name,
|
|
271
271
|
}, key: control.name, "data-testid": `tool-${control.name}`, onClick: _event => this.handleControlClick?.(control), "aria-label": control.name.charAt(0).toUpperCase() + control.name.slice(1) }, h("kritzel-icon", { name: control.icon })));
|
|
272
|
-
})), h("div", { key: '
|
|
272
|
+
})), h("div", { key: 'fad7512f5d1aa68905a56b8f22d498380f166f9f', class: { 'scroll-indicator-right': true, 'visible': this.canScrollRight && !(configControl && this.activeControl && hasConfigUI) } }), configControl && this.activeControl && (h("div", { class: {
|
|
273
273
|
'kritzel-config-container': true,
|
|
274
274
|
'visible': hasConfigUI,
|
|
275
|
-
}, key: configControl.name }, h("div", { key: '
|
|
275
|
+
}, key: configControl.name }, h("div", { key: '2ff7cb3ad18608102f3d8188b5936cf00b00451f', class: { 'config-gradient-left': true, 'visible': this.needsScrolling } }), h("kritzel-tooltip", { key: '10f15f717c8573cbad6ea53b412ad56254099ad1', anchorElement: this.host.shadowRoot?.querySelector('.kritzel-config-container'), triggerElement: this.configTriggerRef }, h("kritzel-tool-config", { key: 'a1b0ed8ecc2696a591e32add642a3d5cb2bf7f4a', tool: this.activeControl.tool, theme: this.theme, engine: this.kritzelEngine, terms: this.terms, onToolChange: event => this.handleToolChange?.(event), onDisplayValuesChange: this.handleDisplayValuesChange, style: { width: '100%', height: '100%' } })), h("div", { key: '7ac8214a3dbad5323a38cad3ff7324b57f9dbfb5', tabIndex: hasConfigUI ? 0 : -1, class: "kritzel-config", "data-testid": "tool-config", ref: el => {
|
|
276
276
|
if (el)
|
|
277
277
|
this.configTriggerRef = el;
|
|
278
278
|
}, onKeyDown: event => {
|
|
@@ -281,7 +281,7 @@ export class KritzelControls {
|
|
|
281
281
|
}
|
|
282
282
|
}, style: {
|
|
283
283
|
cursor: 'pointer',
|
|
284
|
-
} }, this.displayValues && (h("div", { key: '
|
|
284
|
+
} }, this.displayValues && (h("div", { key: '7e64f79859f7f2b03d72bb7a93fb295e7d2b2ac0', class: "color-container" }, h("kritzel-color", { key: 'b87d9861949379d84954ef1ecb554e13317b3287', value: this.displayValues.color, theme: this.theme, size: 18, style: {
|
|
285
285
|
borderRadius: '50%',
|
|
286
286
|
border: 'none',
|
|
287
287
|
} })))))))));
|
|
@@ -17,7 +17,7 @@ export class KritzelCurrentUser {
|
|
|
17
17
|
this.dialogRef?.open();
|
|
18
18
|
};
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: 'bdee6b71c08d6ea22aec40e88ba56077882b301d' }, h("kritzel-avatar", { key: '97bcaaa6b683c0d26d547ac5cbd9df7814f0cd80', user: this.user, size: this.avatarSize, onClick: this.handleAvatarClick }), h("kritzel-current-user-dialog", { key: 'c984ea1803bcf2b06569fd66d12e4e7054235225', ref: el => (this.dialogRef = el), user: this.user, terms: this.terms })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "kritzel-current-user"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js
CHANGED
|
@@ -23,7 +23,7 @@ export class KritzelCurrentUserDialog {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
const displayName = this.getDisplayName();
|
|
26
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: '042455d68a432e0e218d5b8750fb1d22b0d202fc' }, h("kritzel-dialog", { key: '058abbc8e1c38c647cc02e85c272e89693cab22a', dialogTitle: this.terms['currentUser.dialogTitle'] ?? 'Account', isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: 'ee141b2e91f093527e2d8f6649bade8e1a14f130', class: "user-info" }, h("kritzel-avatar", { key: '2734bb0d3c69df14d26c204eeaf726174afaabc0', user: this.user, size: 80 }), displayName && h("div", { key: '56cbad7a51264ebada0cb029e6455aabb9cb4ae9', class: "user-name" }, displayName), this.user?.email && h("div", { key: 'ef9075dfdeb52ce6f90bb41d1348fbdf7dbb93ee', class: "user-email" }, this.user.email)))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "kritzel-current-user-dialog"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,7 +69,7 @@ export class KritzelExport {
|
|
|
69
69
|
return (h("div", { class: "export-tab-content" }, h("kritzel-input", { label: this.terms['export.filename.label'] ?? 'Filename', value: this.exportFilename, placeholder: this.terms['export.filename.placeholder'] ?? 'Enter filename', suffix: ".json", onValueChange: this.handleFilenameChange })));
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
return (h(Host, { key: '
|
|
72
|
+
return (h(Host, { key: 'fd219fffd4d8bb528e6a90055c2b43a5f5a73060' }, h("kritzel-dialog", { key: '9f4ba5b05f5ad31084aab457386a86cbc6d4f2bc', isOpen: this.isDialogOpen, dialogTitle: this.terms['export.dialogTitle'] ?? 'Export', closable: true, contained: true, onDialogClose: this.closeDialog }, h("div", { key: '920bb8f20b42897680084bde47270b3812e2f3e4', class: "export-content" }, h("kritzel-pill-tabs", { key: '7090bd0a371457adceaa4bd7461a616839a66349', tabs: this.tabs, value: this.activeTab, onValueChange: this.handleTabChange }), this.activeTab === 'viewport' && this.renderViewportExport(), this.activeTab === 'workspace' && this.renderWorkspaceExport(), h("button", { key: 'ddf36c1e7cb81409c2cecfa6585e0f1dd7aca2c3', class: "export-primary-button", onClick: this.handleExport }, this.terms['export.exportButton'] ?? 'Export')))));
|
|
73
73
|
}
|
|
74
74
|
static get is() { return "kritzel-export"; }
|
|
75
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,7 +44,7 @@ export class KritzelLoginDialog {
|
|
|
44
44
|
this.dialogClosed.emit();
|
|
45
45
|
};
|
|
46
46
|
render() {
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: '6ef65077c95d32fee8da4b70ad2e832ad1bb78f7' }, h("kritzel-dialog", { key: '04f3d3350393475c7267d8ca90c0b3f0fce10c38', dialogTitle: this.dialogTitle, isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: 'c2ed4e339d86dcea23b4a0778b8966a6ae36107a', class: "login-content" }, this.subtitle && (h("p", { key: 'ae46baa70526d057b3427459903287489e645e08', class: "login-subtitle" }, this.subtitle)), h("div", { key: '1055d5861e5281be234094a3c5c86a6aaf58935f', class: "login-providers" }, this.providers.map(provider => (h("button", { key: provider.name, class: {
|
|
48
48
|
'provider-button': true,
|
|
49
49
|
'is-loading': this.loadingProvider === provider.name,
|
|
50
50
|
'is-disabled': this.loadingProvider !== null && this.loadingProvider !== provider.name,
|
|
@@ -57,7 +57,7 @@ export class KritzelMoreMenu {
|
|
|
57
57
|
this.closeMenu();
|
|
58
58
|
};
|
|
59
59
|
render() {
|
|
60
|
-
return (h(Host, { key: '
|
|
60
|
+
return (h(Host, { key: '3e7179c87713cb0087d2d2053f97db8f603f7321', class: { mobile: this.isTouchDevice }, style: { display: this.visible ? '' : 'none' } }, h("div", { key: '23d6be1ec2c25cd0335c1134f18aad7d5be25c85', class: { 'more-menu-wrapper': true, visible: this.visible } }, h("button", { key: 'e3064ba3f7b4c20e8447e16327b73d0f47f3842b', class: "more-menu-button", "data-testid": "more-menu-button", onClick: this.toggleMenu, "aria-label": this.terms['moreMenu.ariaLabel'] ?? 'More options' }, h("kritzel-icon", { key: 'feed090efe4f80c62a29c8146c2d7d8041624381', name: this.icon, size: this.iconSize })), h("kritzel-portal", { key: '7b1a5db932c7bfb5ea8f4d666571c4f7fbbcd238', anchor: this.menuAnchor, offsetY: this.offsetY, onClose: this.closeMenu }, h("kritzel-menu", { key: '65b1225b15a494d49712ad1d2d108e90f09507e9', items: this.visibleItems, onItemSelect: this.handleMenuItemSelect })))));
|
|
61
61
|
}
|
|
62
62
|
static get is() { return "kritzel-more-menu"; }
|
|
63
63
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.card {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
width: 100%;
|
|
8
|
+
max-width: var(--kritzel-notification-card-max-width, 360px);
|
|
9
|
+
margin-inline: auto;
|
|
10
|
+
font-family: var(--kritzel-font-family, sans-serif);
|
|
11
|
+
padding: var(--kritzel-notification-card-padding, 12px 14px);
|
|
12
|
+
border: var(--kritzel-notification-card-border, 1px solid #e5e7eb);
|
|
13
|
+
border-radius: var(--kritzel-notification-card-border-radius, 12px);
|
|
14
|
+
background-color: var(--kritzel-notification-card-background-color, #ffffff);
|
|
15
|
+
color: var(--kritzel-notification-card-color, #111827);
|
|
16
|
+
box-shadow: var(--kritzel-notification-card-box-shadow, 0 8px 20px rgba(15, 23, 42, 0.08));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.card-header {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
gap: var(--kritzel-notification-card-header-gap, 8px);
|
|
24
|
+
margin-bottom: var(--kritzel-notification-card-header-margin-bottom, 8px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.header-right {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--kritzel-notification-card-header-right-gap, 6px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.type-pill {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
min-height: var(--kritzel-notification-card-pill-height, 22px);
|
|
38
|
+
padding: var(--kritzel-notification-card-pill-padding, 0 8px);
|
|
39
|
+
border-radius: var(--kritzel-notification-card-pill-border-radius, 999px);
|
|
40
|
+
background-color: var(--kritzel-notification-card-pill-background-color, #eff6ff);
|
|
41
|
+
color: var(--kritzel-notification-card-pill-color, #1d4ed8);
|
|
42
|
+
font-size: var(--kritzel-notification-card-pill-font-size, 12px);
|
|
43
|
+
font-weight: var(--kritzel-notification-card-pill-font-weight, 600);
|
|
44
|
+
line-height: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.card.type-info .type-pill {
|
|
48
|
+
background-color: var(--kritzel-notification-card-info-pill-background-color, #eff6ff);
|
|
49
|
+
color: var(--kritzel-notification-card-info-pill-color, #1d4ed8);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.card.type-warning .type-pill {
|
|
53
|
+
background-color: var(--kritzel-notification-card-warning-pill-background-color, #fff7ed);
|
|
54
|
+
color: var(--kritzel-notification-card-warning-pill-color, #b45309);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card.type-error .type-pill {
|
|
58
|
+
background-color: var(--kritzel-notification-card-error-pill-background-color, #fef2f2);
|
|
59
|
+
color: var(--kritzel-notification-card-error-pill-color, #b91c1c);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.timestamp {
|
|
63
|
+
color: var(--kritzel-notification-card-timestamp-color, #6b7280);
|
|
64
|
+
font-size: var(--kritzel-notification-card-timestamp-font-size, 12px);
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.dismiss-button {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
width: var(--kritzel-notification-card-dismiss-button-size, 24px);
|
|
73
|
+
height: var(--kritzel-notification-card-dismiss-button-size, 24px);
|
|
74
|
+
padding: 0;
|
|
75
|
+
border: none;
|
|
76
|
+
border-radius: var(--kritzel-notification-card-dismiss-button-border-radius, 6px);
|
|
77
|
+
background: var(--kritzel-notification-card-dismiss-button-background-color, transparent);
|
|
78
|
+
color: var(--kritzel-notification-card-dismiss-button-color, #4b5563);
|
|
79
|
+
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
80
|
+
-webkit-tap-highlight-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.dismiss-button:hover {
|
|
84
|
+
background: var(--kritzel-notification-card-dismiss-button-hover-background-color, #f3f4f6);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.dismiss-button:active {
|
|
88
|
+
background: var(--kritzel-notification-card-dismiss-button-active-background-color, #e5e7eb);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dismiss-button:focus-visible {
|
|
92
|
+
outline: revert;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.message {
|
|
96
|
+
margin: 0;
|
|
97
|
+
color: var(--kritzel-notification-card-message-color, inherit);
|
|
98
|
+
font-size: var(--kritzel-notification-card-message-font-size, 14px);
|
|
99
|
+
line-height: var(--kritzel-notification-card-message-line-height, 1.45);
|
|
100
|
+
word-break: break-word;
|
|
101
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class KritzelNotificationCard {
|
|
3
|
+
/** Notification data rendered by this card. */
|
|
4
|
+
notification;
|
|
5
|
+
/** Whether a formatted timestamp should be displayed when available. */
|
|
6
|
+
showTimestamp = true;
|
|
7
|
+
/** Locale used for formatting the timestamp. */
|
|
8
|
+
locale;
|
|
9
|
+
/** Emitted when the notification should be dismissed manually. */
|
|
10
|
+
dismiss;
|
|
11
|
+
/** Emitted when pointer hover state changes. */
|
|
12
|
+
hoverChange;
|
|
13
|
+
handleDismissClick = (event) => {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
this.dismiss.emit();
|
|
16
|
+
};
|
|
17
|
+
handleMouseEnter = () => {
|
|
18
|
+
this.hoverChange.emit(true);
|
|
19
|
+
};
|
|
20
|
+
handleMouseLeave = () => {
|
|
21
|
+
this.hoverChange.emit(false);
|
|
22
|
+
};
|
|
23
|
+
get type() {
|
|
24
|
+
return this.notification?.type ?? 'info';
|
|
25
|
+
}
|
|
26
|
+
get role() {
|
|
27
|
+
return this.type === 'error' ? 'alert' : 'status';
|
|
28
|
+
}
|
|
29
|
+
getTypeLabel(type) {
|
|
30
|
+
switch (type) {
|
|
31
|
+
case 'warning':
|
|
32
|
+
return 'Warning';
|
|
33
|
+
case 'error':
|
|
34
|
+
return 'Error';
|
|
35
|
+
default:
|
|
36
|
+
return 'Info';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
formatTimestamp(timestamp) {
|
|
40
|
+
if (!timestamp || !this.showTimestamp) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const date = timestamp instanceof Date ? timestamp : new Date(timestamp);
|
|
44
|
+
if (Number.isNaN(date.getTime())) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return new Intl.DateTimeFormat(this.locale, {
|
|
48
|
+
dateStyle: 'medium',
|
|
49
|
+
timeStyle: 'short',
|
|
50
|
+
}).format(date);
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const notification = this.notification;
|
|
54
|
+
if (!notification) {
|
|
55
|
+
return h(Host, null);
|
|
56
|
+
}
|
|
57
|
+
const type = this.type;
|
|
58
|
+
const timestamp = this.formatTimestamp(notification.timestamp);
|
|
59
|
+
return (h(Host, null, h("article", { class: { card: true, [`type-${type}`]: true }, role: this.role, "aria-live": "polite", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, h("header", { class: "card-header" }, h("span", { class: "type-pill" }, this.getTypeLabel(type)), h("div", { class: "header-right" }, timestamp && (h("time", { class: "timestamp", dateTime: notification.timestamp?.toISOString() }, timestamp)), h("button", { class: "dismiss-button", type: "button", "aria-label": "Dismiss notification", onClick: this.handleDismissClick }, h("kritzel-icon", { name: "x", size: 16 })))), h("p", { class: "message" }, notification.message))));
|
|
60
|
+
}
|
|
61
|
+
static get is() { return "kritzel-notification-card"; }
|
|
62
|
+
static get encapsulation() { return "shadow"; }
|
|
63
|
+
static get originalStyleUrls() {
|
|
64
|
+
return {
|
|
65
|
+
"$": ["kritzel-notification-card.css"]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
static get styleUrls() {
|
|
69
|
+
return {
|
|
70
|
+
"$": ["kritzel-notification-card.css"]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get properties() {
|
|
74
|
+
return {
|
|
75
|
+
"notification": {
|
|
76
|
+
"type": "unknown",
|
|
77
|
+
"mutable": false,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "KritzelNotification",
|
|
80
|
+
"resolved": "KritzelNotification",
|
|
81
|
+
"references": {
|
|
82
|
+
"KritzelNotification": {
|
|
83
|
+
"location": "import",
|
|
84
|
+
"path": "../../../interfaces/notification.interface",
|
|
85
|
+
"id": "src/interfaces/notification.interface.ts::KritzelNotification",
|
|
86
|
+
"referenceLocation": "KritzelNotification"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": true,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Notification data rendered by this card."
|
|
95
|
+
},
|
|
96
|
+
"getter": false,
|
|
97
|
+
"setter": false
|
|
98
|
+
},
|
|
99
|
+
"showTimestamp": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "boolean",
|
|
104
|
+
"resolved": "boolean",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Whether a formatted timestamp should be displayed when available."
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false,
|
|
115
|
+
"reflect": false,
|
|
116
|
+
"attribute": "show-timestamp",
|
|
117
|
+
"defaultValue": "true"
|
|
118
|
+
},
|
|
119
|
+
"locale": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": true,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Locale used for formatting the timestamp."
|
|
132
|
+
},
|
|
133
|
+
"getter": false,
|
|
134
|
+
"setter": false,
|
|
135
|
+
"reflect": false,
|
|
136
|
+
"attribute": "locale"
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
static get events() {
|
|
141
|
+
return [{
|
|
142
|
+
"method": "dismiss",
|
|
143
|
+
"name": "dismiss",
|
|
144
|
+
"bubbles": true,
|
|
145
|
+
"cancelable": true,
|
|
146
|
+
"composed": true,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": "Emitted when the notification should be dismissed manually."
|
|
150
|
+
},
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "void",
|
|
153
|
+
"resolved": "void",
|
|
154
|
+
"references": {}
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
"method": "hoverChange",
|
|
158
|
+
"name": "hoverChange",
|
|
159
|
+
"bubbles": true,
|
|
160
|
+
"cancelable": true,
|
|
161
|
+
"composed": true,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Emitted when pointer hover state changes."
|
|
165
|
+
},
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "boolean",
|
|
168
|
+
"resolved": "boolean",
|
|
169
|
+
"references": {}
|
|
170
|
+
}
|
|
171
|
+
}];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -217,7 +217,7 @@ export class KritzelSettings {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
render() {
|
|
220
|
-
return (h(Host, { key: '
|
|
220
|
+
return (h(Host, { key: '6f26bd23bf7bb51653f09b96bafef221c51c2bfa' }, h("kritzel-dialog", { key: '49ffda0a422ae1c2c9c8e6e608bce532e7d4099e', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: 'ab5dc7952e555cae6f841ef4de2ab50d7039279b', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
|
|
221
221
|
}
|
|
222
222
|
static get is() { return "kritzel-settings"; }
|
|
223
223
|
static get encapsulation() { return "shadow"; }
|