kritzel-stencil 0.3.8 → 0.3.9
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.cjs.js +2 -1
- package/dist/cjs/kritzel-active-users_42.cjs.entry.js +232 -126
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-rCfWpcBV.js → schema.constants-BNMNpzvA.js} +77 -12
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +3 -0
- package/dist/collection/classes/managers/theme.manager.js +47 -5
- package/dist/collection/classes/objects/selection-box.class.js +2 -2
- package/dist/collection/classes/objects/selection-group.class.js +3 -3
- package/dist/collection/classes/objects/text.class.js +8 -0
- package/dist/collection/classes/registries/icon-registry.class.js +2 -1
- package/dist/collection/classes/tools/text-tool.class.js +2 -0
- package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +1 -1
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +144 -17
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +41 -1
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +1 -1
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +8 -8
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +7 -7
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +7 -7
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.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-line-endings/kritzel-line-endings.js +2 -2
- 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 +2 -1
- package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.js +1 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.js +2 -2
- 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-context-menu/kritzel-context-menu.js +94 -48
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +15 -14
- 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-settings/kritzel-settings.js +28 -9
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.js +6 -6
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/constants/color-palette.constants.js +4 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/index.js +2 -0
- package/dist/collection/themes/dark-theme.js +4 -0
- package/dist/collection/themes/light-theme.js +4 -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-brush-style.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-context-menu.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-cursor-trail.js +1 -1
- package/dist/components/kritzel-dropdown.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-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.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-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.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-workspace-manager.js +1 -1
- package/dist/components/{p-CJjwjpMH.js → p-BFgWBbpu.js} +1 -1
- package/dist/components/{p-CqAkznU_.js → p-BI_UUiTr.js} +1 -1
- package/dist/components/p-BPEn0_hr.js +1 -0
- package/dist/components/{p-Cz2gQKbL.js → p-B_JH91jB.js} +1 -1
- package/dist/components/{p-BV3EJRtU.js → p-Bp3kdH4l.js} +1 -1
- package/dist/components/p-C0wFAtT_.js +1 -0
- package/dist/components/p-C4GIF296.js +1 -0
- package/dist/components/p-C8ggg-5h.js +1 -0
- package/dist/components/{p-B638ZH7S.js → p-CARNM9pf.js} +1 -1
- package/dist/components/p-CB7ynHtI.js +1 -0
- package/dist/components/{p-W0nK9EQJ.js → p-CBk08ACS.js} +2 -2
- package/dist/components/{p-DDBaFNFi.js → p-CJ2V42sz.js} +1 -1
- package/dist/components/{p-A7Ult9iv.js → p-CJERvHdy.js} +1 -1
- package/dist/components/{p-CrSLn46K.js → p-CKY7AvGR.js} +1 -1
- package/dist/components/{p-C4vg_-vg.js → p-COIxq81R.js} +1 -1
- package/dist/components/{p-B5a3arJg.js → p-CWgI1dA0.js} +1 -1
- package/dist/components/{p-0cs6zQLB.js → p-CYR9wbJg.js} +1 -1
- package/dist/components/{p-CrmWVXea.js → p-Cr7xOsIZ.js} +1 -1
- package/dist/components/{p-qBqQhAmh.js → p-CxtTuKCy.js} +1 -1
- package/dist/components/{p-DEd2L0e3.js → p-D0aom7Yu.js} +1 -1
- package/dist/components/{p-DwHZN643.js → p-D15NO5kE.js} +1 -1
- package/dist/components/p-DH-H7om7.js +1 -0
- package/dist/components/{p-PMiFTdm6.js → p-DJLJfKY2.js} +1 -1
- package/dist/components/{p-DXO_ppUK.js → p-DRB3TZzI.js} +1 -1
- package/dist/components/{p-CaKSDRid.js → p-DXgUuzXW.js} +1 -1
- package/dist/components/{p-ihbmwmHg.js → p-DdmJquQr.js} +1 -1
- package/dist/components/{p-Czaea0WP.js → p-DfH7YY2C.js} +1 -1
- package/dist/components/{p-CTj2UdbS.js → p-DgtrNOWm.js} +1 -1
- package/dist/components/{p-D6KNaj_Y.js → p-DhAM4qeQ.js} +1 -1
- package/dist/components/{p-DMfU0hHe.js → p-DmTG0Y5h.js} +1 -1
- package/dist/components/{p-BMsKd6TF.js → p-Dov3qOAR.js} +1 -1
- package/dist/components/{p-CvCTQQcJ.js → p-Dw9sKOsb.js} +1 -1
- package/dist/components/{p-CSODtZrV.js → p-Dx_xz_El.js} +1 -1
- package/dist/components/{p-BVEYAGm1.js → p-IiG44Unz.js} +1 -1
- package/dist/components/{p-DsxW_miC.js → p-K7ySy791.js} +1 -1
- package/dist/components/{p-Bda1I4pR.js → p-KVG5rztB.js} +1 -1
- package/dist/components/{p-C_OSXZqJ.js → p-KjtNlFTl.js} +1 -1
- package/dist/components/{p-DVEfOb8T.js → p-RnuCSIt-.js} +1 -1
- package/dist/components/{p-Z9_amVdR.js → p-ZgZqbJ58.js} +1 -1
- package/dist/components/{p-C4bAtxyk.js → p-guqEWGgV.js} +1 -1
- package/dist/components/{p-DemKKw9U.js → p-u0b2RJAn.js} +1 -1
- package/dist/components/{p-BLjdzUzs.js → p-x38RbGJA.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-active-users_42.entry.js +232 -126
- package/dist/esm/kritzel-brush-style.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{schema.constants-cuIrI5X8.js → schema.constants-CqBoZbmA.js} +77 -13
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/{p-10c2b77c.entry.js → p-69298b5f.entry.js} +1 -1
- package/dist/stencil/p-CqBoZbmA.js +1 -0
- package/dist/stencil/p-d6f26808.entry.js +9 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/managers/theme.manager.d.ts +22 -2
- package/dist/types/classes/objects/text.class.d.ts +1 -0
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +9 -2
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +4 -1
- package/dist/types/components/shared/kritzel-color/kritzel-color.d.ts +3 -2
- package/dist/types/components/shared/kritzel-color-palette/kritzel-color-palette.d.ts +3 -2
- package/dist/types/components/ui/kritzel-context-menu/kritzel-context-menu.d.ts +9 -3
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +2 -2
- package/dist/types/components/ui/kritzel-settings/kritzel-settings.d.ts +2 -1
- package/dist/types/components/ui/kritzel-tool-config/kritzel-tool-config.d.ts +3 -2
- package/dist/types/components.d.ts +53 -18
- package/dist/types/constants/color-palette.constants.d.ts +4 -2
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/helpers/color.helper.d.ts +4 -3
- package/dist/types/helpers/svg-export.helper.d.ts +3 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interfaces/theme.interface.d.ts +7 -3
- package/package.json +1 -1
- package/dist/components/p-B8wX0-3H.js +0 -1
- package/dist/components/p-BvgGpgKP.js +0 -1
- package/dist/components/p-C-sJ1r3g.js +0 -1
- package/dist/components/p-CBTqCoUx.js +0 -1
- package/dist/components/p-DdlK75Kx.js +0 -1
- package/dist/components/p-DjAiIBXv.js +0 -1
- package/dist/stencil/p-9ce67a14.entry.js +0 -9
- package/dist/stencil/p-cuIrI5X8.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CFnj_FXt.js');
|
|
4
|
-
var schema_constants = require('./schema.constants-
|
|
4
|
+
var schema_constants = require('./schema.constants-BNMNpzvA.js');
|
|
5
5
|
var Y = require('yjs');
|
|
6
6
|
require('y-indexeddb');
|
|
7
7
|
require('y-websocket');
|
|
@@ -154,16 +154,16 @@ const KritzelAvatar = class {
|
|
|
154
154
|
height: `${this.size}px`,
|
|
155
155
|
fontSize: `${Math.round(this.size * 0.4)}px`,
|
|
156
156
|
};
|
|
157
|
-
return (index.h(index.Host, { key: '
|
|
157
|
+
return (index.h(index.Host, { key: '571bd5b92adc7c65b96ded37b8daf5ed79905361', style: containerStyles, class: {
|
|
158
158
|
'has-image': !!showImage,
|
|
159
159
|
'has-initials': !!showInitials,
|
|
160
160
|
'has-default': !!showDefaultIcon,
|
|
161
|
-
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (index.h("img", { key: '
|
|
161
|
+
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (index.h("img", { key: '1065850b4575fda4637ab61ce07c6dfc97f14a90', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
|
|
162
162
|
if (el) {
|
|
163
163
|
el.referrerPolicy = 'no-referrer';
|
|
164
164
|
el.crossOrigin = 'anonymous';
|
|
165
165
|
}
|
|
166
|
-
}, onError: this.handleImageError })), showInitials && (index.h("span", { key: '
|
|
166
|
+
}, onError: this.handleImageError })), showInitials && (index.h("span", { key: 'a6d9c9dd2eac6e44c731a878e2460017da7fb0b7', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (index.h("span", { key: '9e9d33cdd213649071b76cb0875008562b30f6a1', class: "avatar-default" }, index.h("svg", { key: '5d0be5c503a8944b45de239f08e6f40378c2dc5e', viewBox: "0 0 24 24", fill: "currentColor" }, index.h("path", { key: '9264549c9b8abbdea74cd707d6f77bcfdde6459d', d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }))))));
|
|
167
167
|
}
|
|
168
168
|
static get watchers() { return {
|
|
169
169
|
"user": [{
|
|
@@ -366,7 +366,7 @@ const KritzelAwarenessCursors = class {
|
|
|
366
366
|
}
|
|
367
367
|
render() {
|
|
368
368
|
const cursors = Array.from(this.remoteCursors.values());
|
|
369
|
-
return (index.h(index.Host, { key: '
|
|
369
|
+
return (index.h(index.Host, { key: '5c695e3c5a012767b31bb1b756ef03e2a174f46e' }, cursors.map(remoteCursor => {
|
|
370
370
|
if (!remoteCursor.cursor)
|
|
371
371
|
return null;
|
|
372
372
|
// When a remote user is actively drawing, derive cursor position from
|
|
@@ -473,7 +473,7 @@ const KritzelBackToContent = class {
|
|
|
473
473
|
this.backToContent.emit();
|
|
474
474
|
};
|
|
475
475
|
render() {
|
|
476
|
-
return (index.h(index.Host, { key: '
|
|
476
|
+
return (index.h(index.Host, { key: 'b623a9a4e4b8fce50346771488a59c3a646c289e' }, index.h("button", { key: 'b2f6b257975639d33362f1038b61e5147963f189', class: { 'back-to-content-button': true, visible: this.visible }, onClick: this.handleClick, "aria-label": this.text }, index.h("kritzel-icon", { key: '22f34fc201a865b6d9b21775a349d0e185727d48', name: "chevrons-left" }))));
|
|
477
477
|
}
|
|
478
478
|
};
|
|
479
479
|
KritzelBackToContent.style = kritzelBackToContentCss();
|
|
@@ -500,11 +500,11 @@ const KritzelButton = class {
|
|
|
500
500
|
this.buttonClick.emit();
|
|
501
501
|
};
|
|
502
502
|
render() {
|
|
503
|
-
return (index.h(index.Host, { key: '
|
|
503
|
+
return (index.h(index.Host, { key: 'c915db75630392741de404f07265a391330e54ca' }, index.h("button", { key: '50248ee1ed5862c9ea72b4f7cf7d564d03b5b14e', type: this.type, class: {
|
|
504
504
|
'kritzel-button': true,
|
|
505
505
|
[this.variant]: true,
|
|
506
506
|
'disabled': this.disabled,
|
|
507
|
-
}, disabled: this.disabled, onClick: this.handleClick }, index.h("slot", { key: '
|
|
507
|
+
}, disabled: this.disabled, onClick: this.handleClick }, index.h("slot", { key: 'd595cd819c7c0a3550e468ce65d4e2c28cc02164' }))));
|
|
508
508
|
}
|
|
509
509
|
};
|
|
510
510
|
KritzelButton.style = kritzelButtonCss();
|
|
@@ -552,13 +552,13 @@ const KritzelColorComponent = class {
|
|
|
552
552
|
render() {
|
|
553
553
|
const resolvedColor = this.resolveColor();
|
|
554
554
|
const isColorVeryLight = this.isLightColor(resolvedColor);
|
|
555
|
-
return (index.h(index.Host, { key: '
|
|
555
|
+
return (index.h(index.Host, { key: 'c4c1fe2559aca61557ff2e8154f4d46ce3511b30' }, index.h("div", { key: '158c243018763a9609e0a056229263864a5e4d13', class: "checkerboard-bg", style: {
|
|
556
556
|
width: `${this.size}px`,
|
|
557
557
|
height: `${this.size}px`,
|
|
558
558
|
borderRadius: '50%',
|
|
559
559
|
display: 'inline-block',
|
|
560
560
|
position: 'relative',
|
|
561
|
-
} }, index.h("div", { key: '
|
|
561
|
+
} }, index.h("div", { key: 'afa21c72b17ab5fb4b16521b91dbe7e9162d05f8', class: {
|
|
562
562
|
'color-circle': true,
|
|
563
563
|
'white': isColorVeryLight,
|
|
564
564
|
}, style: {
|
|
@@ -614,7 +614,7 @@ const KritzelColorPalette = class {
|
|
|
614
614
|
render() {
|
|
615
615
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
616
616
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
617
|
-
return (index.h(index.Host, { key: '
|
|
617
|
+
return (index.h(index.Host, { key: 'fc57d77d7c4cfd2aa2a02a70b8991858bb8cf61b' }, index.h("div", { key: '4fd10783609882f453ce95f5114acf799f21ec52', class: {
|
|
618
618
|
'color-grid': true,
|
|
619
619
|
'expanded': this.isExpanded,
|
|
620
620
|
}, style: {
|
|
@@ -649,8 +649,9 @@ const KritzelContextMenu = class {
|
|
|
649
649
|
actionSelected;
|
|
650
650
|
close;
|
|
651
651
|
processedItems = [];
|
|
652
|
-
|
|
653
|
-
|
|
652
|
+
/** Current open submenu path (e.g. '0.2.1'). Empty if none. */
|
|
653
|
+
openSubmenuPath = '';
|
|
654
|
+
submenuPositions = {};
|
|
654
655
|
submenuTimer = null;
|
|
655
656
|
submenuRefs = new Map();
|
|
656
657
|
menuItemWrapperRefs = new Map();
|
|
@@ -668,7 +669,8 @@ const KritzelContextMenu = class {
|
|
|
668
669
|
}
|
|
669
670
|
componentDidUpdate() {
|
|
670
671
|
this.adjustPositionToViewport();
|
|
671
|
-
this.
|
|
672
|
+
this.adjustSubmenuPositions();
|
|
673
|
+
this.pruneStaleRefs();
|
|
672
674
|
}
|
|
673
675
|
disconnectedCallback() {
|
|
674
676
|
if (this.submenuTimer) {
|
|
@@ -705,60 +707,102 @@ const KritzelContextMenu = class {
|
|
|
705
707
|
this.host.style.top = `${newTop}px`;
|
|
706
708
|
}
|
|
707
709
|
}
|
|
708
|
-
|
|
709
|
-
if (this.
|
|
710
|
+
adjustSubmenuPositions() {
|
|
711
|
+
if (!this.openSubmenuPath)
|
|
710
712
|
return;
|
|
711
|
-
const submenuEl = this.submenuRefs.get(this.openSubmenuIndex);
|
|
712
|
-
if (!submenuEl)
|
|
713
|
-
return;
|
|
714
|
-
const submenuRect = submenuEl.getBoundingClientRect();
|
|
715
713
|
const viewportHeight = window.innerHeight;
|
|
716
|
-
// Adjust
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
|
|
714
|
+
// Adjust every open submenu in the chain (every prefix of openSubmenuPath).
|
|
715
|
+
for (const path of this.getOpenSubmenuPaths()) {
|
|
716
|
+
const submenuEl = this.submenuRefs.get(path);
|
|
717
|
+
const wrapperEl = this.menuItemWrapperRefs.get(path);
|
|
718
|
+
if (!submenuEl || !wrapperEl)
|
|
719
|
+
continue;
|
|
720
|
+
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
721
|
+
const submenuHeight = submenuEl.offsetHeight; // Constant regardless of current top shift
|
|
722
|
+
const naturalBottom = wrapperRect.top + submenuHeight;
|
|
723
|
+
if (naturalBottom > viewportHeight - VIEWPORT_PADDING) {
|
|
724
|
+
let overflow = naturalBottom - (viewportHeight - VIEWPORT_PADDING);
|
|
725
|
+
// Don't shift up so far that the top goes above the viewport
|
|
726
|
+
if (wrapperRect.top - overflow < VIEWPORT_PADDING) {
|
|
727
|
+
overflow = wrapperRect.top - VIEWPORT_PADDING;
|
|
728
|
+
}
|
|
729
|
+
submenuEl.style.top = `${-overflow}px`;
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
submenuEl.style.top = '0px';
|
|
733
|
+
}
|
|
720
734
|
}
|
|
721
|
-
|
|
722
|
-
|
|
735
|
+
}
|
|
736
|
+
getOpenSubmenuPaths() {
|
|
737
|
+
if (!this.openSubmenuPath)
|
|
738
|
+
return [];
|
|
739
|
+
const parts = this.openSubmenuPath.split('.');
|
|
740
|
+
const paths = [];
|
|
741
|
+
for (let i = 1; i <= parts.length; i++) {
|
|
742
|
+
paths.push(parts.slice(0, i).join('.'));
|
|
743
|
+
}
|
|
744
|
+
return paths;
|
|
745
|
+
}
|
|
746
|
+
isSubmenuOpen(path) {
|
|
747
|
+
return this.openSubmenuPath === path || this.openSubmenuPath.startsWith(path + '.');
|
|
748
|
+
}
|
|
749
|
+
getParentPath(path) {
|
|
750
|
+
const idx = path.lastIndexOf('.');
|
|
751
|
+
return idx === -1 ? '' : path.substring(0, idx);
|
|
752
|
+
}
|
|
753
|
+
pruneStaleRefs() {
|
|
754
|
+
const openPaths = new Set(this.getOpenSubmenuPaths());
|
|
755
|
+
for (const key of Array.from(this.submenuRefs.keys())) {
|
|
756
|
+
if (!openPaths.has(key)) {
|
|
757
|
+
this.submenuRefs.delete(key);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
// Keep root-level wrapper refs (single-segment paths) always rendered; prune deeper
|
|
761
|
+
// wrappers whose parent submenu is no longer open.
|
|
762
|
+
for (const key of Array.from(this.menuItemWrapperRefs.keys())) {
|
|
763
|
+
const parent = this.getParentPath(key);
|
|
764
|
+
if (parent !== '' && !openPaths.has(parent)) {
|
|
765
|
+
this.menuItemWrapperRefs.delete(key);
|
|
766
|
+
}
|
|
723
767
|
}
|
|
724
768
|
}
|
|
725
769
|
handleItemClick(item, isDisabled, hasChildren) {
|
|
726
770
|
if (isDisabled)
|
|
727
771
|
return;
|
|
728
772
|
if (hasChildren) {
|
|
729
|
-
//
|
|
773
|
+
// Hover handles open/close; click on a parent is a no-op.
|
|
730
774
|
return;
|
|
731
775
|
}
|
|
732
776
|
if (item.action) {
|
|
733
777
|
this.actionSelected.emit(item);
|
|
734
778
|
}
|
|
735
779
|
}
|
|
736
|
-
handleItemMouseEnter(
|
|
780
|
+
handleItemMouseEnter(path, hasChildren) {
|
|
737
781
|
if (this.submenuTimer) {
|
|
738
782
|
clearTimeout(this.submenuTimer);
|
|
739
783
|
this.submenuTimer = null;
|
|
740
784
|
}
|
|
785
|
+
const parentPath = this.getParentPath(path);
|
|
741
786
|
if (hasChildren) {
|
|
742
787
|
this.submenuTimer = setTimeout(() => {
|
|
743
|
-
// Pre-calculate position before opening to avoid flicker
|
|
744
|
-
const wrapperEl = this.menuItemWrapperRefs.get(
|
|
788
|
+
// Pre-calculate horizontal position before opening to avoid flicker.
|
|
789
|
+
const wrapperEl = this.menuItemWrapperRefs.get(path);
|
|
790
|
+
let position = 'right';
|
|
745
791
|
if (wrapperEl) {
|
|
746
792
|
const rect = wrapperEl.getBoundingClientRect();
|
|
747
793
|
const viewportWidth = window.innerWidth;
|
|
748
|
-
// Check if opening to the right would overflow
|
|
749
794
|
const wouldOverflowRight = rect.right + ESTIMATED_SUBMENU_WIDTH > viewportWidth - VIEWPORT_PADDING;
|
|
750
|
-
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
this.submenuPosition = 'right';
|
|
795
|
+
position = wouldOverflowRight ? 'left' : 'right';
|
|
754
796
|
}
|
|
755
|
-
this.
|
|
797
|
+
this.submenuPositions = { ...this.submenuPositions, [path]: position };
|
|
798
|
+
this.openSubmenuPath = path;
|
|
756
799
|
}, SUBMENU_DELAY);
|
|
757
800
|
}
|
|
758
801
|
else {
|
|
759
|
-
//
|
|
802
|
+
// Hovering a sibling without children: collapse to the parent chain so any
|
|
803
|
+
// sibling-rooted submenu closes, but the ancestor chain stays open.
|
|
760
804
|
this.submenuTimer = setTimeout(() => {
|
|
761
|
-
this.
|
|
805
|
+
this.openSubmenuPath = parentPath;
|
|
762
806
|
}, SUBMENU_DELAY);
|
|
763
807
|
}
|
|
764
808
|
}
|
|
@@ -768,9 +812,11 @@ const KritzelContextMenu = class {
|
|
|
768
812
|
this.submenuTimer = null;
|
|
769
813
|
}
|
|
770
814
|
}
|
|
771
|
-
handleSubmenuMouseLeave() {
|
|
815
|
+
handleSubmenuMouseLeave(path) {
|
|
816
|
+
// Close this submenu (and any deeper levels) but keep the ancestor chain open.
|
|
817
|
+
const parentPath = this.getParentPath(path);
|
|
772
818
|
this.submenuTimer = setTimeout(() => {
|
|
773
|
-
this.
|
|
819
|
+
this.openSubmenuPath = parentPath;
|
|
774
820
|
}, SUBMENU_DELAY);
|
|
775
821
|
}
|
|
776
822
|
async updateMenuItems() {
|
|
@@ -800,28 +846,28 @@ const KritzelContextMenu = class {
|
|
|
800
846
|
}
|
|
801
847
|
return defaultValue;
|
|
802
848
|
}
|
|
803
|
-
|
|
804
|
-
return
|
|
805
|
-
const
|
|
849
|
+
renderItems(items, parentPath) {
|
|
850
|
+
return items.map(({ item, isDisabled, processedChildren }, index$1) => {
|
|
851
|
+
const path = parentPath === '' ? String(index$1) : `${parentPath}.${index$1}`;
|
|
852
|
+
const prevItem = index$1 > 0 ? items[index$1 - 1].item : null;
|
|
806
853
|
const showDivider = prevItem && prevItem.group !== item.group;
|
|
807
|
-
const hasChildren =
|
|
854
|
+
const hasChildren = !!processedChildren && processedChildren.length > 0;
|
|
855
|
+
const submenuOpen = hasChildren && this.isSubmenuOpen(path);
|
|
808
856
|
return [
|
|
809
|
-
showDivider && index.h("div", { class: "menu-divider", key: `
|
|
810
|
-
index.h("
|
|
857
|
+
showDivider && index.h("div", { class: "menu-divider", key: `divider-${path}` }),
|
|
858
|
+
index.h("div", { class: "menu-item-wrapper", key: `wrapper-${path}`, ref: el => el && this.menuItemWrapperRefs.set(path, el), onMouseEnter: () => this.handleItemMouseEnter(path, hasChildren) }, index.h("button", { key: `${item.label}-${path}`, class: { 'menu-item': true, 'disabled': isDisabled, 'has-children': hasChildren, 'submenu-open': submenuOpen }, onClick: () => this.handleItemClick(item, isDisabled, hasChildren), disabled: isDisabled && !hasChildren }, item.icon && index.h("kritzel-icon", { name: item.icon, size: 16 }), index.h("span", { class: "label" }, item.label), hasChildren && index.h("kritzel-icon", { name: "chevron-right", size: 12, class: "submenu-arrow" })), hasChildren && submenuOpen && this.renderSubmenu(processedChildren, path)),
|
|
811
859
|
];
|
|
812
|
-
})
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
renderSubmenu(processedChildren, path) {
|
|
863
|
+
const position = this.submenuPositions[path] === 'left' ? 'left' : 'right';
|
|
864
|
+
return (index.h("div", { class: { 'submenu-container': true, 'position-left': position === 'left' }, key: `submenu-${path}`, ref: el => el && this.submenuRefs.set(path, el), onMouseEnter: () => this.handleSubmenuMouseEnter(), onMouseLeave: () => this.handleSubmenuMouseLeave(path) }, this.renderItems(processedChildren, path)));
|
|
813
865
|
}
|
|
814
866
|
render() {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
const isSubmenuOpen = this.openSubmenuIndex === index$1;
|
|
820
|
-
return [
|
|
821
|
-
showDivider && index.h("div", { class: "menu-divider", key: `divider-${index$1}` }),
|
|
822
|
-
index.h("div", { class: "menu-item-wrapper", ref: el => el && this.menuItemWrapperRefs.set(index$1, el), onMouseEnter: () => this.handleItemMouseEnter(index$1, hasChildren) }, index.h("button", { key: `${item.label}-${index$1}`, class: { 'menu-item': true, 'disabled': isDisabled, 'has-children': hasChildren, 'submenu-open': isSubmenuOpen }, onClick: () => this.handleItemClick(item, isDisabled, hasChildren), disabled: isDisabled && !hasChildren }, item.icon && index.h("kritzel-icon", { name: item.icon, size: 16 }), index.h("span", { class: "label" }, item.label), hasChildren && index.h("kritzel-icon", { name: "chevron-right", size: 12, class: "submenu-arrow" })), hasChildren && isSubmenuOpen && this.renderSubmenu(processedChildren, index$1))
|
|
823
|
-
];
|
|
824
|
-
}))));
|
|
867
|
+
if (!this.processedItems || this.processedItems.length === 0) {
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
return (index.h(index.Host, null, index.h("div", { class: "menu-container" }, this.renderItems(this.processedItems, ''))));
|
|
825
871
|
}
|
|
826
872
|
static get watchers() { return {
|
|
827
873
|
"items": [{
|
|
@@ -897,7 +943,7 @@ class KritzelToolConfigHelper {
|
|
|
897
943
|
}
|
|
898
944
|
}
|
|
899
945
|
|
|
900
|
-
const kritzelControlsCss = () => `:host{display:flex;flex-direction:column;user-select:none;max-width:100%;z-index:1}:host(.mobile){--kritzel-controls-control-hover-background-color:transparent;--kritzel-controls-control-active-background-color:transparent}.kritzel-controls{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--kritzel-controls-gap, 8px);height:100%;padding:var(--kritzel-controls-padding, 8px);background-color:var(--kritzel-controls-background-color, #ffffff);border-radius:var(--kritzel-controls-border-radius, 16px);box-shadow:var(--kritzel-controls-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));border:var(--kritzel-controls-border, 1px solid #ebebeb);z-index:1;position:relative;max-width:100%;overflow:hidden}.kritzel-tools-scroll{display:flex;flex-direction:row;align-items:center;gap:var(--kritzel-controls-gap, 8px);overflow-x:auto;overflow-y:hidden;flex:1 1 auto;min-width:0;padding:4px;margin:-4px;scrollbar-width:none;-ms-overflow-style:none}.kritzel-tools-scroll::-webkit-scrollbar{display:none}.scroll-indicator-left,.scroll-indicator-right{position:absolute;top:0;bottom:0;width:32px;pointer-events:none;opacity:0;transition:opacity 0.2s ease-out;z-index:1}.scroll-indicator-left{left:0;background:linear-gradient(to right, var(--kritzel-controls-background-color, #ffffff), transparent);border-radius:var(--kritzel-controls-border-radius, 16px) 0 0 var(--kritzel-controls-border-radius, 16px)}.scroll-indicator-right{right:0;background:linear-gradient(to left, var(--kritzel-controls-background-color, #ffffff), transparent);border-radius:0 var(--kritzel-controls-border-radius, 16px) var(--kritzel-controls-border-radius, 16px) 0}.scroll-indicator-left.visible,.scroll-indicator-right.visible{opacity:1}.kritzel-control{display:flex;justify-content:center;align-items:center;color:var(--kritzel-controls-control-color, #000000);border-radius:var(--kritzel-controls-control-border-radius, 12px);padding:var(--kritzel-controls-control-padding, 8px);border:none;background:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent;font-weight:bold}.kritzel-control:focus,.kritzel-control:hover{background-color:var(--kritzel-controls-control-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.kritzel-control:active{background-color:var(--kritzel-controls-control-active-background-color, hsl(0, 0%, 0%, 8.6%))}.kritzel-control.selected,.kritzel-control.selected:hover,.kritzel-control.selected:active{background-color:var(--kritzel-controls-control-selected-background-color, #007AFF) !important;color:var(--kritzel-controls-control-selected-color, #ffffff) !important}.kritzel-control.selected:focus{background-color:var(--kritzel-controls-control-selected-background-color, #007bffe3) !important}.kritzel-control-separator{width:1px;height:24px;background-color:var(--kritzel-controls-
|
|
946
|
+
const kritzelControlsCss = () => `:host{display:flex;flex-direction:column;user-select:none;max-width:100%;z-index:1}:host(.mobile){--kritzel-controls-control-hover-background-color:transparent;--kritzel-controls-control-active-background-color:transparent}.kritzel-controls{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--kritzel-controls-gap, 8px);height:100%;padding:var(--kritzel-controls-padding, 8px);background-color:var(--kritzel-controls-background-color, #ffffff);border-radius:var(--kritzel-controls-border-radius, 16px);box-shadow:var(--kritzel-controls-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));border:var(--kritzel-controls-border, 1px solid #ebebeb);z-index:1;position:relative;max-width:100%;overflow:hidden}.kritzel-tools-scroll{display:flex;flex-direction:row;align-items:center;gap:var(--kritzel-controls-gap, 8px);overflow-x:auto;overflow-y:hidden;flex:1 1 auto;min-width:0;padding:4px;margin:-4px;scrollbar-width:none;-ms-overflow-style:none}.kritzel-tools-scroll::-webkit-scrollbar{display:none}.scroll-indicator-left,.scroll-indicator-right{position:absolute;top:0;bottom:0;width:32px;pointer-events:none;opacity:0;transition:opacity 0.2s ease-out;z-index:1}.scroll-indicator-left{left:0;background:linear-gradient(to right, var(--kritzel-controls-background-color, #ffffff), transparent);border-radius:var(--kritzel-controls-border-radius, 16px) 0 0 var(--kritzel-controls-border-radius, 16px)}.scroll-indicator-right{right:0;background:linear-gradient(to left, var(--kritzel-controls-background-color, #ffffff), transparent);border-radius:0 var(--kritzel-controls-border-radius, 16px) var(--kritzel-controls-border-radius, 16px) 0}.scroll-indicator-left.visible,.scroll-indicator-right.visible{opacity:1}.kritzel-control{display:flex;justify-content:center;align-items:center;color:var(--kritzel-controls-control-color, #000000);border-radius:var(--kritzel-controls-control-border-radius, 12px);padding:var(--kritzel-controls-control-padding, 8px);border:none;background:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent;font-weight:bold}.kritzel-control:focus,.kritzel-control:hover{background-color:var(--kritzel-controls-control-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.kritzel-control:active{background-color:var(--kritzel-controls-control-active-background-color, hsl(0, 0%, 0%, 8.6%))}.kritzel-control.selected,.kritzel-control.selected:hover,.kritzel-control.selected:active{background-color:var(--kritzel-controls-control-selected-background-color, #007AFF) !important;color:var(--kritzel-controls-control-selected-color, #ffffff) !important}.kritzel-control.selected:focus{background-color:var(--kritzel-controls-control-selected-background-color, #007bffe3) !important}.kritzel-control-separator{width:1px;height:24px;background-color:var(--kritzel-controls-separator-color, #ebebeb);margin:0 4px}.kritzel-control-split{position:relative;display:flex;align-items:center;border-radius:var(--kritzel-controls-control-border-radius, 12px);color:var(--kritzel-controls-control-color, #000000)}.kritzel-control-split .kritzel-control-main{display:flex;justify-content:center;align-items:center;padding:var(--kritzel-controls-control-padding, 8px);border:none;background:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent;border-radius:var(--kritzel-controls-control-border-radius, 12px);color:inherit}.kritzel-control-split.selected .kritzel-control-main{border-radius:var(--kritzel-controls-control-border-radius, 12px) 0 0 var(--kritzel-controls-control-border-radius, 12px)}.kritzel-control-split .kritzel-control-dropdown{display:flex;justify-content:center;align-items:center;align-self:stretch;border:none;background:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent;border-radius:0 var(--kritzel-controls-control-border-radius, 12px) var(--kritzel-controls-control-border-radius, 12px) 0;color:inherit;width:0;padding:0;opacity:0;overflow:hidden;pointer-events:none;transition:width 0.15s ease-out, padding 0.15s ease-out, opacity 0.15s ease-out}.kritzel-control-split .kritzel-control-dropdown.visible{width:auto;padding:0 6px;opacity:1;pointer-events:auto}.kritzel-control-split .kritzel-control-main:focus,.kritzel-control-split .kritzel-control-main:hover,.kritzel-control-split .kritzel-control-dropdown:focus,.kritzel-control-split .kritzel-control-dropdown:hover{background-color:var(--kritzel-controls-control-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.kritzel-control-split .kritzel-control-main:active,.kritzel-control-split .kritzel-control-dropdown:active{background-color:var(--kritzel-controls-control-active-background-color, hsl(0, 0%, 0%, 8.6%))}.kritzel-control-split.selected{background-color:var(--kritzel-controls-control-selected-background-color, #007AFF) !important;color:var(--kritzel-controls-control-selected-color, #ffffff) !important}.kritzel-control-split.selected .kritzel-control-main:hover,.kritzel-control-split.selected .kritzel-control-dropdown:hover{background-color:rgba(255, 255, 255, 0.15)}.kritzel-submenu-content{display:flex;flex-direction:column;gap:var(--kritzel-submenu-gap, 4px);min-width:140px}.kritzel-submenu-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:none;background:none;cursor:var(--kritzel-global-pointer-cursor, pointer);border-radius:8px;color:var(--kritzel-controls-control-color, #000000);font-size:14px;text-align:left;white-space:nowrap;-webkit-tap-highlight-color:transparent}.kritzel-submenu-item:hover{background-color:var(--kritzel-controls-control-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.kritzel-submenu-item.active{background-color:var(--kritzel-controls-control-selected-background-color, #007AFF);color:var(--kritzel-controls-control-selected-color, #ffffff)}.kritzel-submenu-item.active:hover{background-color:var(--kritzel-controls-control-selected-background-color, #007AFF)}.kritzel-config-container{position:relative;display:flex;justify-content:center;align-items:center;height:40px;box-sizing:border-box;-webkit-tap-highlight-color:transparent;flex-shrink:0;width:0;opacity:0;overflow:hidden;pointer-events:none;margin-left:calc(-1 * var(--kritzel-controls-gap, 8px));transition:width 0.2s ease-out, opacity 0.2s ease-out, margin-left 0.2s ease-out}.kritzel-config-container.visible{width:40px;opacity:1;pointer-events:auto;margin-left:0;overflow:visible}.config-gradient-left{position:absolute;top:0;bottom:0;left:-32px;width:32px;background:linear-gradient(to right, transparent, var(--kritzel-controls-background-color, #ffffff));pointer-events:none;z-index:1;opacity:0;transition:opacity 0.2s ease-out}.config-gradient-left.visible{opacity:1}.kritzel-config{display:flex;justify-content:center;align-items:center;cursor:var(--kritzel-global-pointer-cursor, pointer);border-radius:50%}.color-container{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:50%;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;background-color:var(--kritzel-color-palette-hover-background-color, #ebebeb)}.font-container{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:50%;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;background-color:var(--kritzel-color-palette-hover-background-color, #ebebeb)}.no-config{height:24px;width:24px;border-radius:50%;border:1px dashed gray}kritzel-tooltip{z-index:10001}`;
|
|
901
947
|
|
|
902
948
|
const KritzelControls = class {
|
|
903
949
|
constructor(hostRef) {
|
|
@@ -909,7 +955,7 @@ const KritzelControls = class {
|
|
|
909
955
|
activeControl = null;
|
|
910
956
|
isUtilityPanelVisible = true;
|
|
911
957
|
undoState = null;
|
|
912
|
-
theme;
|
|
958
|
+
theme = 'light';
|
|
913
959
|
isControlsReady;
|
|
914
960
|
firstConfig = null;
|
|
915
961
|
isTouchDevice = schema_constants.KritzelDevicesHelper.isTouchDevice();
|
|
@@ -1129,13 +1175,13 @@ const KritzelControls = class {
|
|
|
1129
1175
|
// Separate tool controls from config control
|
|
1130
1176
|
const toolControls = this.internalControls.filter(c => c.type === 'tool' || c.type === 'separator');
|
|
1131
1177
|
const configControl = this.internalControls.find(c => c.type === 'config' && c.name === this.firstConfig?.name);
|
|
1132
|
-
return (index.h(index.Host, { key: '
|
|
1178
|
+
return (index.h(index.Host, { key: 'b567aac7bca12cc5ffb0ee1eb9e6978636aa3c31', class: {
|
|
1133
1179
|
mobile: this.isTouchDevice,
|
|
1134
|
-
} }, this.isUtilityPanelVisible && (index.h("kritzel-utility-panel", { key: '
|
|
1180
|
+
} }, this.isUtilityPanelVisible && (index.h("kritzel-utility-panel", { key: '88e8ae9ae7429987724df70895b02a3f59216364', style: {
|
|
1135
1181
|
position: 'absolute',
|
|
1136
1182
|
bottom: '56px',
|
|
1137
1183
|
left: '12px',
|
|
1138
|
-
}, undoState: this.undoState, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), index.h("div", { key: '
|
|
1184
|
+
}, undoState: this.undoState, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), index.h("div", { key: '658e3d7b94e49a002d5057c1fb4fc199a371c48d', class: "kritzel-controls" }, index.h("div", { key: 'b54bb52a43e4a94ae1148cd4e75528bcaad681ef', class: { 'scroll-indicator-left': true, 'visible': this.canScrollLeft } }), index.h("div", { key: '36ce760357d3228141281a45c0ac7b0024b04795', class: "kritzel-tools-scroll", ref: el => (this.toolsScrollRef = el), onScroll: this.handleToolsScroll }, toolControls.map(control => {
|
|
1139
1185
|
// Check if this control has sub-options (split-button)
|
|
1140
1186
|
if (control.subOptions?.length) {
|
|
1141
1187
|
const selectedSubOption = this.getSelectedSubOption(control);
|
|
@@ -1165,10 +1211,10 @@ const KritzelControls = class {
|
|
|
1165
1211
|
'kritzel-control': true,
|
|
1166
1212
|
'selected': this.activeControl?.name === control?.name,
|
|
1167
1213
|
}, key: control.name, "data-testid": `tool-${control.name}`, onClick: _event => this.handleControlClick?.(control), "aria-label": control.name.charAt(0).toUpperCase() + control.name.slice(1) }, index.h("kritzel-icon", { name: control.icon })));
|
|
1168
|
-
})), index.h("div", { key: '
|
|
1214
|
+
})), index.h("div", { key: 'f0b1e0f74fe197f4d39e307e7dd8dd4819c4b183', class: { 'scroll-indicator-right': true, 'visible': this.canScrollRight && !(configControl && this.activeControl && hasConfigUI) } }), configControl && this.activeControl && (index.h("div", { class: {
|
|
1169
1215
|
'kritzel-config-container': true,
|
|
1170
1216
|
'visible': hasConfigUI,
|
|
1171
|
-
}, key: configControl.name }, index.h("div", { key: '
|
|
1217
|
+
}, key: configControl.name }, index.h("div", { key: '51cc3ebf13092e710048441ff64856edd4f53dfc', class: { 'config-gradient-left': true, 'visible': this.needsScrolling } }), index.h("kritzel-tooltip", { key: 'dcace186ae3ece1d7e943f51b48ed5094d847284', anchorElement: this.host.shadowRoot?.querySelector('.kritzel-config-container'), triggerElement: this.configTriggerRef }, index.h("kritzel-tool-config", { key: '9b16ac90f335fec3c043545fa0c5b363ab99924e', tool: this.activeControl.tool, theme: this.theme, engine: this.kritzelEngine, onToolChange: event => this.handleToolChange?.(event), onDisplayValuesChange: this.handleDisplayValuesChange, style: { width: '100%', height: '100%' } })), index.h("div", { key: '2425507968e27a01b66c1d7be79a40ebe77cd27d', tabIndex: hasConfigUI ? 0 : -1, class: "kritzel-config", "data-testid": "tool-config", ref: el => {
|
|
1172
1218
|
if (el)
|
|
1173
1219
|
this.configTriggerRef = el;
|
|
1174
1220
|
}, onKeyDown: event => {
|
|
@@ -1177,7 +1223,7 @@ const KritzelControls = class {
|
|
|
1177
1223
|
}
|
|
1178
1224
|
}, style: {
|
|
1179
1225
|
cursor: 'pointer',
|
|
1180
|
-
} }, this.displayValues && (index.h("div", { key: '
|
|
1226
|
+
} }, this.displayValues && (index.h("div", { key: 'd2499df3c0a90c101957f55664452739e0f1692b', class: "color-container" }, index.h("kritzel-color", { key: 'b7cfcd3a8579c63f508c2786eecace1223e88974', value: this.displayValues.color, theme: this.theme, size: 18, style: {
|
|
1181
1227
|
borderRadius: '50%',
|
|
1182
1228
|
border: 'none',
|
|
1183
1229
|
} })))))))));
|
|
@@ -1215,7 +1261,7 @@ const KritzelCurrentUser = class {
|
|
|
1215
1261
|
this.dialogRef?.open();
|
|
1216
1262
|
};
|
|
1217
1263
|
render() {
|
|
1218
|
-
return (index.h(index.Host, { key: '
|
|
1264
|
+
return (index.h(index.Host, { key: 'a735cb9f16f4898fde0b52573affa2d270a8f1de' }, index.h("kritzel-avatar", { key: 'd449a515182718ab4ef3b26b2277696bbc7ab46f', user: this.user, size: this.avatarSize, onClick: this.handleAvatarClick }), index.h("kritzel-current-user-dialog", { key: '3542f6df43c9924218e344f70bdc398c74a8eae6', ref: el => (this.dialogRef = el), user: this.user })));
|
|
1219
1265
|
}
|
|
1220
1266
|
};
|
|
1221
1267
|
KritzelCurrentUser.style = kritzelCurrentUserCss();
|
|
@@ -1247,7 +1293,7 @@ const KritzelCurrentUserDialog = class {
|
|
|
1247
1293
|
}
|
|
1248
1294
|
render() {
|
|
1249
1295
|
const displayName = this.getDisplayName();
|
|
1250
|
-
return (index.h(index.Host, { key: '
|
|
1296
|
+
return (index.h(index.Host, { key: '40c1a1bed0ddf02f9835199b5f7d2363e4d1902b' }, index.h("kritzel-dialog", { key: 'a83c09eac66ddf51155591a32245e3f15e34943e', dialogTitle: "Account", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, index.h("div", { key: '14f7100a881ee3c5ba6b672d509bf3a9161ccd62', class: "user-info" }, index.h("kritzel-avatar", { key: 'e3552a80db81db4c26f81c6cc699363afa6153ea', user: this.user, size: 80 }), displayName && index.h("div", { key: 'c54164be605ac2bd2fc8bac6bb4481f820119028', class: "user-name" }, displayName), this.user?.email && index.h("div", { key: 'e6af7c44e45443eb24be0777768de96b0e3d249e', class: "user-email" }, this.user.email)))));
|
|
1251
1297
|
}
|
|
1252
1298
|
};
|
|
1253
1299
|
KritzelCurrentUserDialog.style = kritzelCurrentUserDialogCss();
|
|
@@ -1320,7 +1366,7 @@ const KritzelCursorTrail = class {
|
|
|
1320
1366
|
}
|
|
1321
1367
|
}
|
|
1322
1368
|
render() {
|
|
1323
|
-
return (index.h(index.Host, { key: '
|
|
1369
|
+
return (index.h(index.Host, { key: 'b427550b19a3e172cb25d05e34635121b82a61c5' }, this.cursorTrailPoints.length > 1 && (index.h("svg", { key: '9685b563497e110f36c0feffbfde04ebeb38024b', class: "cursor-trail-svg", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
1324
1370
|
position: 'absolute',
|
|
1325
1371
|
left: '0',
|
|
1326
1372
|
top: '0',
|
|
@@ -1911,13 +1957,13 @@ const KritzelDropdown = class {
|
|
|
1911
1957
|
}
|
|
1912
1958
|
updateInternalValue(proposedValue, emitChange) {
|
|
1913
1959
|
let finalValue = proposedValue;
|
|
1914
|
-
if
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1960
|
+
// Only fall back to an option if the proposed value is completely missing.
|
|
1961
|
+
// We intentionally don't sanitize invalid values here, to allow for values
|
|
1962
|
+
// that might be added to options asynchronously later (preventing race conditions).
|
|
1963
|
+
if (!finalValue && this.options && this.options.length > 0) {
|
|
1964
|
+
finalValue = this.options[0].value;
|
|
1919
1965
|
}
|
|
1920
|
-
else {
|
|
1966
|
+
else if (!finalValue) {
|
|
1921
1967
|
finalValue = undefined;
|
|
1922
1968
|
}
|
|
1923
1969
|
if (this.internalValue !== finalValue) {
|
|
@@ -2089,7 +2135,7 @@ const KritzelDropdown = class {
|
|
|
2089
2135
|
'open-up': this.openDirection === 'up',
|
|
2090
2136
|
'open-down': this.openDirection === 'down',
|
|
2091
2137
|
};
|
|
2092
|
-
return (index.h(index.Host, { key: '
|
|
2138
|
+
return (index.h(index.Host, { key: 'c606b338e55dc66396105fa7b4fbdf372f3866e6' }, index.h("div", { key: 'aa32b73cac337fa4142ecc124cf039a59e3b3118', class: "dropdown-wrapper", ref: el => (this.wrapperElement = el) }, index.h("slot", { key: '2cd8e9ef246a24c49d58f76f227f36aed4786178', name: "prefix", ref: el => (this.prefixSlotElement = el), onSlotchange: this.evaluatePrefixContent }), index.h("div", { key: '80df8155e1907017d508e92f155bab5ae12dffab', class: "dropdown-container", style: { width: this.width } }, index.h("button", { key: 'd86463de7ec58248f1611d6b5d46f0eafc117f36', type: "button", class: triggerClasses, style: { ...this.selectStyles, ...this.getSelectedStyle() }, onClick: this.toggleMenu, onKeyDown: this.handleTriggerKeyDown, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', ref: el => (this.triggerElement = el) }, index.h("span", { key: '4ef6a997f7a781fb409e97ed5bd6843d0eaff0bb', class: "dropdown-trigger-label" }, this.getSelectedLabel()), index.h("span", { key: '6601efcd69d84af1f022d14ede628bac743cc1f1', class: "dropdown-trigger-arrow", "aria-hidden": "true" }, index.h("svg", { key: '6cb2efe7b4ca890562c10b0e24eb1dfdad90ec24', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("polyline", { key: 'a340af5a61dccf5bc29c8a473726b58055c2e9db', points: "6 9 12 15 18 9" }))))), index.h("slot", { key: '5bd4e5ad4cc4642c7769ecac2106ba82bae626f2', name: "suffix", ref: el => (this.suffixSlotElement = el), onSlotchange: this.evaluateSuffixContent }), index.h("ul", { key: 'e7a2be8ac261bc5fa1450940e2a57090d6be3315', class: menuClasses, role: "listbox", tabindex: "-1", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElement = el) }, this.options.map((option, index$1) => {
|
|
2093
2139
|
const isSelected = option.value === this.internalValue;
|
|
2094
2140
|
const isFocused = index$1 === this.focusedIndex;
|
|
2095
2141
|
const optionClasses = {
|
|
@@ -2311,6 +2357,8 @@ const KritzelEditor = class {
|
|
|
2311
2357
|
},
|
|
2312
2358
|
{ label: 'Delete', icon: 'delete', group: 'edit', action: () => this.engineRef.delete() },
|
|
2313
2359
|
];
|
|
2360
|
+
themes;
|
|
2361
|
+
theme = 'light';
|
|
2314
2362
|
customSvgIcons = {};
|
|
2315
2363
|
isControlsVisible = true;
|
|
2316
2364
|
isUtilityPanelVisible = true;
|
|
@@ -2357,9 +2405,9 @@ const KritzelEditor = class {
|
|
|
2357
2405
|
isVirtualKeyboardOpen = false;
|
|
2358
2406
|
undoState = null;
|
|
2359
2407
|
isBackToContentButtonVisible = false;
|
|
2360
|
-
currentTheme = 'light';
|
|
2361
2408
|
shortcuts = [];
|
|
2362
2409
|
currentIsPublic = false;
|
|
2410
|
+
isEditorVisible = false;
|
|
2363
2411
|
onIsEngineReady(newValue) {
|
|
2364
2412
|
if (newValue && this.isControlsReady) {
|
|
2365
2413
|
this.checkIsReady();
|
|
@@ -2411,11 +2459,15 @@ const KritzelEditor = class {
|
|
|
2411
2459
|
}
|
|
2412
2460
|
}
|
|
2413
2461
|
onCurrentThemeChange() {
|
|
2462
|
+
this.applyTheme();
|
|
2414
2463
|
setTimeout(() => this.setOsSpecificCssVariables(), 0);
|
|
2415
2464
|
if (this.engineRef) {
|
|
2416
2465
|
this.engineRef.saveSettings(this.currentSettingsConfig);
|
|
2417
2466
|
}
|
|
2418
2467
|
}
|
|
2468
|
+
onThemesChange() {
|
|
2469
|
+
this.applyTheme();
|
|
2470
|
+
}
|
|
2419
2471
|
onTouchStart(event) {
|
|
2420
2472
|
if (event.cancelable) {
|
|
2421
2473
|
event.preventDefault();
|
|
@@ -2557,6 +2609,12 @@ const KritzelEditor = class {
|
|
|
2557
2609
|
async exportViewportAsSvg() {
|
|
2558
2610
|
return this.engineRef.exportViewportAsSvg();
|
|
2559
2611
|
}
|
|
2612
|
+
async exportSelectedObjectsAsPng() {
|
|
2613
|
+
return this.engineRef.exportSelectedObjectsAsPng();
|
|
2614
|
+
}
|
|
2615
|
+
async exportSelectedObjectsAsSvg() {
|
|
2616
|
+
return this.engineRef.exportSelectedObjectsAsSvg();
|
|
2617
|
+
}
|
|
2560
2618
|
async downloadAsJson(filename) {
|
|
2561
2619
|
return this.engineRef.downloadAsJson(filename);
|
|
2562
2620
|
}
|
|
@@ -2599,6 +2657,15 @@ const KritzelEditor = class {
|
|
|
2599
2657
|
loginDialogRef;
|
|
2600
2658
|
componentWillLoad() {
|
|
2601
2659
|
this.loadSettingsFromStorage();
|
|
2660
|
+
this.applyTheme();
|
|
2661
|
+
}
|
|
2662
|
+
applyTheme() {
|
|
2663
|
+
const themeObj = this.resolveThemeObject();
|
|
2664
|
+
schema_constants.ThemeHelper.applyThemeToElement(this.host, themeObj);
|
|
2665
|
+
}
|
|
2666
|
+
resolveThemeObject() {
|
|
2667
|
+
return this.themes?.find(t => t.name === this.theme)
|
|
2668
|
+
?? (this.theme === 'dark' ? schema_constants.darkTheme : schema_constants.lightTheme);
|
|
2602
2669
|
}
|
|
2603
2670
|
componentDidLoad() {
|
|
2604
2671
|
this.registerCustomSvgIcons();
|
|
@@ -2613,6 +2680,7 @@ const KritzelEditor = class {
|
|
|
2613
2680
|
if (!this.isEngineReady || !this.isControlsReady || !this.isWorkspaceManagerReady || !this.activeWorkspace) {
|
|
2614
2681
|
return;
|
|
2615
2682
|
}
|
|
2683
|
+
this.isEditorVisible = true;
|
|
2616
2684
|
const { id, name, isPublic, createdAt, updatedAt } = this.activeWorkspace;
|
|
2617
2685
|
this.isReady.emit({
|
|
2618
2686
|
host: this.host,
|
|
@@ -2626,6 +2694,7 @@ const KritzelEditor = class {
|
|
|
2626
2694
|
syncConfig: this.syncConfig,
|
|
2627
2695
|
assetStorageConfig: this.assetStorageConfig,
|
|
2628
2696
|
loginConfig: this.loginConfig,
|
|
2697
|
+
theme: this.theme
|
|
2629
2698
|
});
|
|
2630
2699
|
}
|
|
2631
2700
|
async onEngineReady(event) {
|
|
@@ -2639,6 +2708,7 @@ const KritzelEditor = class {
|
|
|
2639
2708
|
this.loadShortcuts();
|
|
2640
2709
|
}
|
|
2641
2710
|
handleWorkspacesChange(event) {
|
|
2711
|
+
event.stopPropagation();
|
|
2642
2712
|
this.workspaces = event.detail;
|
|
2643
2713
|
}
|
|
2644
2714
|
handleActiveWorkspaceChange(event) {
|
|
@@ -2657,46 +2727,54 @@ const KritzelEditor = class {
|
|
|
2657
2727
|
});
|
|
2658
2728
|
}
|
|
2659
2729
|
handleObjectsChange(event) {
|
|
2730
|
+
event.stopPropagation();
|
|
2660
2731
|
this.objectsChange.emit(event.detail);
|
|
2661
2732
|
}
|
|
2662
2733
|
handleObjectsAdded(event) {
|
|
2734
|
+
event.stopPropagation();
|
|
2663
2735
|
this.objectsAdded.emit(event.detail);
|
|
2664
2736
|
}
|
|
2665
2737
|
handleObjectsRemoved(event) {
|
|
2738
|
+
event.stopPropagation();
|
|
2666
2739
|
this.objectsRemoved.emit(event.detail);
|
|
2667
2740
|
}
|
|
2668
2741
|
handleObjectsUpdated(event) {
|
|
2742
|
+
event.stopPropagation();
|
|
2669
2743
|
this.objectsUpdated.emit(event.detail);
|
|
2670
2744
|
}
|
|
2671
2745
|
handleUndoStateChange(event) {
|
|
2746
|
+
event.stopPropagation();
|
|
2672
2747
|
this.undoStateChange.emit(event.detail);
|
|
2673
2748
|
this.undoState = event.detail;
|
|
2674
2749
|
}
|
|
2675
2750
|
async handleObjectsInViewportChange(event) {
|
|
2751
|
+
event.stopPropagation();
|
|
2676
2752
|
const hasVisibleObjects = this.getContentObjects(event.detail).length > 0;
|
|
2677
2753
|
const hasAnyObjectsAtAll = this.getContentObjects(await this.engineRef.getAllObjects()).length > 0;
|
|
2678
2754
|
this.isBackToContentButtonVisible = !hasVisibleObjects && hasAnyObjectsAtAll;
|
|
2679
2755
|
}
|
|
2680
2756
|
handleViewportChange(event) {
|
|
2757
|
+
event.stopPropagation();
|
|
2681
2758
|
this.viewportChange.emit(event.detail);
|
|
2682
2759
|
}
|
|
2683
2760
|
handleAwarenessChange(event) {
|
|
2761
|
+
event.stopPropagation();
|
|
2684
2762
|
this.awarenessChange.emit(event.detail);
|
|
2685
2763
|
}
|
|
2686
2764
|
handleSettingsChange(event) {
|
|
2687
2765
|
this.scaleMin = event.detail.scaleMin;
|
|
2688
2766
|
this.scaleMax = event.detail.scaleMax;
|
|
2689
2767
|
this.lockDrawingScale = event.detail.lockDrawingScale;
|
|
2690
|
-
this.
|
|
2768
|
+
this.theme = event.detail.theme;
|
|
2691
2769
|
this.viewportBoundaryLeft = event.detail.viewportBoundaryLeft ?? -Infinity;
|
|
2692
2770
|
this.viewportBoundaryRight = event.detail.viewportBoundaryRight ?? Infinity;
|
|
2693
2771
|
this.viewportBoundaryTop = event.detail.viewportBoundaryTop ?? -Infinity;
|
|
2694
2772
|
this.viewportBoundaryBottom = event.detail.viewportBoundaryBottom ?? Infinity;
|
|
2695
2773
|
this.debugInfo = event.detail.debugInfo;
|
|
2696
|
-
this.themeChange.emit(event.detail.theme);
|
|
2697
2774
|
if (this.engineRef) {
|
|
2698
2775
|
this.engineRef.saveSettings(event.detail);
|
|
2699
2776
|
}
|
|
2777
|
+
this.themeChange.emit(event.detail.theme);
|
|
2700
2778
|
}
|
|
2701
2779
|
get moreMenuItems() {
|
|
2702
2780
|
return [
|
|
@@ -2792,8 +2870,8 @@ const KritzelEditor = class {
|
|
|
2792
2870
|
if (typeof parsed.lockDrawingScale === 'boolean') {
|
|
2793
2871
|
this.lockDrawingScale = parsed.lockDrawingScale;
|
|
2794
2872
|
}
|
|
2795
|
-
if (
|
|
2796
|
-
this.
|
|
2873
|
+
if (typeof parsed.theme === 'string') {
|
|
2874
|
+
this.theme = parsed.theme;
|
|
2797
2875
|
}
|
|
2798
2876
|
if (typeof parsed.viewportBoundaryLeft === 'number') {
|
|
2799
2877
|
this.viewportBoundaryLeft = parsed.viewportBoundaryLeft;
|
|
@@ -2824,7 +2902,7 @@ const KritzelEditor = class {
|
|
|
2824
2902
|
scaleMin: this.scaleMin,
|
|
2825
2903
|
scaleMax: this.scaleMax,
|
|
2826
2904
|
lockDrawingScale: this.lockDrawingScale,
|
|
2827
|
-
theme: this.
|
|
2905
|
+
theme: this.theme,
|
|
2828
2906
|
viewportBoundaryLeft: this.viewportBoundaryLeft,
|
|
2829
2907
|
viewportBoundaryRight: this.viewportBoundaryRight,
|
|
2830
2908
|
viewportBoundaryTop: this.viewportBoundaryTop,
|
|
@@ -2877,28 +2955,32 @@ const KritzelEditor = class {
|
|
|
2877
2955
|
render() {
|
|
2878
2956
|
const isLoggedIn = this.isLoggedIn;
|
|
2879
2957
|
const shouldShowCurrentUser = isLoggedIn;
|
|
2880
|
-
const shouldShowLoginButton = !!this.loginConfig && !isLoggedIn;
|
|
2881
|
-
return (index.h(index.Host, { key: '
|
|
2958
|
+
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
2959
|
+
return (index.h(index.Host, { key: '4f488368cbb771707582b9aee1fee17a0347bf0d', style: {
|
|
2960
|
+
opacity: this.isEditorVisible ? '1' : '0',
|
|
2961
|
+
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
2962
|
+
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
2963
|
+
} }, index.h("div", { key: '4f3b70f125c0f8dece135d456f0d50bc76a085d4', class: "top-left-buttons" }, index.h("kritzel-workspace-manager", { key: '48718fc00b68a43d414ff2d75dce616f2889ff11', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), index.h("kritzel-back-to-content", { key: 'e91f29092c60658cabe55475c582b7cd0697222c', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), index.h("kritzel-engine", { key: '328ac062fd1ac131d25c403ba1c98275b9e3da23', ref: el => {
|
|
2882
2964
|
if (el) {
|
|
2883
2965
|
this.engineRef = el;
|
|
2884
2966
|
}
|
|
2885
|
-
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.
|
|
2967
|
+
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.theme, themes: this.themes, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), index.h("kritzel-controls", { key: '8ebba84ece06c5b2465b19dc56f213eb41e4f332', class: { 'keyboard-open': this.isVirtualKeyboardOpen }, style: { display: this.isControlsVisible ? 'flex' : 'none' }, ref: el => {
|
|
2886
2968
|
if (el) {
|
|
2887
2969
|
this.controlsRef = el;
|
|
2888
2970
|
}
|
|
2889
|
-
}, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.
|
|
2971
|
+
}, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, onIsControlsReady: () => (this.isControlsReady = true) }), index.h("div", { key: 'ac7ce9c338587fb37dd80447b893cce632cffd6a', class: "top-right-buttons" }, index.h("kritzel-settings", { key: '8dabb851a07918b336e8f94ed2185df79b0fbeb1', ref: el => {
|
|
2890
2972
|
if (el) {
|
|
2891
2973
|
this.settingsRef = el;
|
|
2892
2974
|
}
|
|
2893
|
-
}, shortcuts: this.shortcuts, settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), index.h("kritzel-export", { key: '
|
|
2975
|
+
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), index.h("kritzel-export", { key: '3c175dd7f827a003ac8f8dc34ed81cd798c29ea9', ref: el => {
|
|
2894
2976
|
if (el) {
|
|
2895
2977
|
this.exportRef = el;
|
|
2896
2978
|
}
|
|
2897
|
-
}, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), index.h("kritzel-active-users", { key: '
|
|
2979
|
+
}, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), index.h("kritzel-active-users", { key: '2a6c16d0f9ab7172e519f3910a60997df546b917', users: this.activeUsers }), shouldShowCurrentUser && index.h("kritzel-current-user", { key: 'fed027a1eadc45328679f9bf11ec45eed873124f', user: this.user }), shouldShowLoginButton && (index.h("kritzel-button", { key: '73558d2622d35eaa01e41e2b707774d731be5cbb', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in")), index.h("kritzel-more-menu", { key: '0979d6f4b28bfd35f8a3f1583aaec588af2e486a', items: this.moreMenuItems, visible: this.isMoreMenuVisible }), index.h("kritzel-share-dialog", { key: '762434c41a2632596127b98426193031fb71b7f8', ref: el => {
|
|
2898
2980
|
if (el) {
|
|
2899
2981
|
this.shareDialogRef = el;
|
|
2900
2982
|
}
|
|
2901
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (index.h("kritzel-login-dialog", { key: '
|
|
2983
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (index.h("kritzel-login-dialog", { key: 'de42a1e416d4c6dacbdce104d0eeb9777cc99e29', ref: el => {
|
|
2902
2984
|
if (el) {
|
|
2903
2985
|
this.loginDialogRef = el;
|
|
2904
2986
|
}
|
|
@@ -2920,8 +3002,11 @@ const KritzelEditor = class {
|
|
|
2920
3002
|
"activeWorkspaceId": [{
|
|
2921
3003
|
"onActiveWorkspaceIdChange": 0
|
|
2922
3004
|
}],
|
|
2923
|
-
"
|
|
3005
|
+
"theme": [{
|
|
2924
3006
|
"onCurrentThemeChange": 0
|
|
3007
|
+
}],
|
|
3008
|
+
"themes": [{
|
|
3009
|
+
"onThemesChange": 0
|
|
2925
3010
|
}]
|
|
2926
3011
|
}; }
|
|
2927
3012
|
};
|
|
@@ -24458,6 +24543,7 @@ class KritzelCore {
|
|
|
24458
24543
|
});
|
|
24459
24544
|
group.finalize();
|
|
24460
24545
|
};
|
|
24546
|
+
const newlyAddedObjects = [];
|
|
24461
24547
|
// First add all copied objects to the objectsMap with updated positions
|
|
24462
24548
|
copiedObjects.forEach((obj, i) => {
|
|
24463
24549
|
// Update workspace if pasting to a different workspace
|
|
@@ -24474,9 +24560,11 @@ class KritzelCore {
|
|
|
24474
24560
|
}
|
|
24475
24561
|
// Add to objectsMap
|
|
24476
24562
|
this.addObject(obj);
|
|
24563
|
+
newlyAddedObjects.push(obj);
|
|
24477
24564
|
// Add to selection group
|
|
24478
24565
|
selectionGroup.addOrRemove(obj);
|
|
24479
24566
|
});
|
|
24567
|
+
this.engine.emitObjectsAdded(newlyAddedObjects);
|
|
24480
24568
|
// Update line anchors to point to the newly pasted objects
|
|
24481
24569
|
// Only remap if the anchor target was also part of the copied selection
|
|
24482
24570
|
copiedObjects.forEach(obj => {
|
|
@@ -26384,6 +26472,14 @@ const KritzelEngine = class {
|
|
|
26384
26472
|
onThemeChange(newValue) {
|
|
26385
26473
|
this.core.themeManager.setTheme(newValue);
|
|
26386
26474
|
}
|
|
26475
|
+
/** An array of available themes for the editor. */
|
|
26476
|
+
themes;
|
|
26477
|
+
onThemesChange(newValue) {
|
|
26478
|
+
if (newValue && newValue.length > 0) {
|
|
26479
|
+
this.core.themeManager.registerThemes(newValue);
|
|
26480
|
+
this.core.themeManager.applyTheme(this.core.themeManager.currentTheme);
|
|
26481
|
+
}
|
|
26482
|
+
}
|
|
26387
26483
|
/** Left boundary of the viewport in world coordinates. Objects beyond this X position cannot be panned to. */
|
|
26388
26484
|
viewportBoundaryLeft = -Infinity;
|
|
26389
26485
|
onViewportBoundaryLeftChange(newValue) {
|
|
@@ -27615,6 +27711,11 @@ const KritzelEngine = class {
|
|
|
27615
27711
|
}
|
|
27616
27712
|
componentWillLoad() {
|
|
27617
27713
|
this.core.setEditorId(this.editorId);
|
|
27714
|
+
if (this.themes && this.themes.length > 0) {
|
|
27715
|
+
this.core.themeManager.registerThemes(this.themes);
|
|
27716
|
+
}
|
|
27717
|
+
const editorElement = this.host.closest('kritzel-editor');
|
|
27718
|
+
this.core.themeManager.injectThemeEarly(editorElement || this.host);
|
|
27618
27719
|
this.core.setUser(this.user);
|
|
27619
27720
|
this.validateScaleMax(this.scaleMax);
|
|
27620
27721
|
this.validateScaleMin(this.scaleMin);
|
|
@@ -28347,6 +28448,9 @@ const KritzelEngine = class {
|
|
|
28347
28448
|
"theme": [{
|
|
28348
28449
|
"onThemeChange": 0
|
|
28349
28450
|
}],
|
|
28451
|
+
"themes": [{
|
|
28452
|
+
"onThemesChange": 0
|
|
28453
|
+
}],
|
|
28350
28454
|
"viewportBoundaryLeft": [{
|
|
28351
28455
|
"onViewportBoundaryLeftChange": 0
|
|
28352
28456
|
}],
|
|
@@ -28443,7 +28547,7 @@ const KritzelExport = class {
|
|
|
28443
28547
|
return (index.h("div", { class: "export-tab-content" }, index.h("kritzel-input", { label: "Filename", value: this.exportFilename, placeholder: "Enter filename", suffix: ".json", onValueChange: this.handleFilenameChange })));
|
|
28444
28548
|
}
|
|
28445
28549
|
render() {
|
|
28446
|
-
return (index.h(index.Host, { key: '
|
|
28550
|
+
return (index.h(index.Host, { key: 'efeea781325e672e3f4c1579a50da1c928dc88b5' }, index.h("kritzel-dialog", { key: '60e27233f484e70fd12bcc0f8a72b89d2f72d596', isOpen: this.isDialogOpen, dialogTitle: "Export", closable: true, contained: true, onDialogClose: this.closeDialog }, index.h("div", { key: 'e58e1d9804fdc8cb3d4c053ead641e2301b99ea5', class: "export-content" }, index.h("kritzel-pill-tabs", { key: '409f4c2d64f5477dc57c72a8e32ae0a12dfb7eda', tabs: this.tabs, value: this.activeTab, onValueChange: this.handleTabChange }), this.activeTab === 'viewport' && this.renderViewportExport(), this.activeTab === 'workspace' && this.renderWorkspaceExport(), index.h("button", { key: '7166aee26e0dbbdf6e7348428f7a740614948e5e', class: "export-primary-button", onClick: this.handleExport }, "Export")))));
|
|
28447
28551
|
}
|
|
28448
28552
|
};
|
|
28449
28553
|
KritzelExport.style = kritzelExportCss();
|
|
@@ -28458,7 +28562,7 @@ const KritzelFont = class {
|
|
|
28458
28562
|
size = 24;
|
|
28459
28563
|
color = '#000000';
|
|
28460
28564
|
render() {
|
|
28461
|
-
return (index.h(index.Host, { key: '
|
|
28565
|
+
return (index.h(index.Host, { key: '6eef9e7df004469faeeaf458d9b9967f94f8536d' }, index.h("div", { key: '9926c54a57245c40d605077e191f62cebf3700b1', class: "font-preview", style: {
|
|
28462
28566
|
fontFamily: this.fontFamily,
|
|
28463
28567
|
fontSize: `${this.size}px`,
|
|
28464
28568
|
color: this.color
|
|
@@ -28505,7 +28609,7 @@ const KritzelFontFamily = class {
|
|
|
28505
28609
|
label: option.label,
|
|
28506
28610
|
style: { fontFamily: option.value },
|
|
28507
28611
|
}));
|
|
28508
|
-
return (index.h(index.Host, { key: '
|
|
28612
|
+
return (index.h(index.Host, { key: '0123dbdff9b7051d2ebc9dcf8d1f9c7c4c161dc4' }, index.h("kritzel-dropdown", { key: '5d4e289161502ecc60cef3d0c6d546a64817a12a', options: dropdownOptions, value: this.selectedFontFamily, onValueChanged: this.handleDropdownValueChange, selectStyles: { fontFamily: this.selectedFontFamily } })));
|
|
28509
28613
|
}
|
|
28510
28614
|
};
|
|
28511
28615
|
KritzelFontFamily.style = kritzelFontFamilyCss();
|
|
@@ -28533,7 +28637,7 @@ const KritzelFontSize = class {
|
|
|
28533
28637
|
}
|
|
28534
28638
|
render() {
|
|
28535
28639
|
const color = 'var(--kritzel-global-text-primary)';
|
|
28536
|
-
return (index.h(index.Host, { key: '
|
|
28640
|
+
return (index.h(index.Host, { key: 'efb5ad516a0ebfea0fee5c78a1d3b4d0af4a6bc9' }, this.sizes.map(size => (index.h("div", { tabIndex: 0, class: {
|
|
28537
28641
|
'size-container': true,
|
|
28538
28642
|
'selected': this.selectedSize === size,
|
|
28539
28643
|
}, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, index.h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
|
|
@@ -28600,7 +28704,7 @@ const KritzelInput = class {
|
|
|
28600
28704
|
this.valueChange.emit(input.value);
|
|
28601
28705
|
};
|
|
28602
28706
|
render() {
|
|
28603
|
-
return (index.h(index.Host, { key: '
|
|
28707
|
+
return (index.h(index.Host, { key: '3fd1f42a3ad5edfac752c05f70558ef73bbfebc3' }, index.h("div", { key: '78468652ce95508090495fefa9381af175415be8', class: "input-container" }, this.label && index.h("label", { key: 'f368e0370df4848fa9448ed53382152ad8cc8816', class: "input-label" }, this.label), index.h("div", { key: 'c775c0c0a9f4b6c78ba83ced6237a744b7d3cf20', class: { 'input-wrapper': true, 'has-suffix': !!this.suffix } }, index.h("input", { key: 'aa5ce0bb5e3c56755bc6134a4328ce6294bda1ff', type: this.type, class: "text-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput }), this.suffix && index.h("span", { key: '687cec4294e4cd10247db88caf157b33a3f16290', class: "input-suffix" }, this.suffix)))));
|
|
28604
28708
|
}
|
|
28605
28709
|
static get watchers() { return {
|
|
28606
28710
|
"value": [{
|
|
@@ -28682,10 +28786,10 @@ const KritzelLineEndings = class {
|
|
|
28682
28786
|
render() {
|
|
28683
28787
|
const startEnding = this.getStartEnding();
|
|
28684
28788
|
const endEnding = this.getEndEnding();
|
|
28685
|
-
return (index.h(index.Host, { key: '
|
|
28789
|
+
return (index.h(index.Host, { key: '60115b8a2840ffe21e0846fdc2678c6ba24b22c0' }, index.h("div", { key: '3b63aa05ca78699172c645fdd404efdc55bc4536', class: "endings-section" }, index.h("div", { key: '9538369e8d2bb26600d6054ddbbc13d6c960bd56', class: "endings-row" }, this.styles.map(type => (index.h("button", { class: {
|
|
28686
28790
|
'ending-option': true,
|
|
28687
28791
|
'selected': startEnding === type,
|
|
28688
|
-
}, onClick: () => this.handleStartChange(type), title: type === 'none' ? 'No start arrow' : `${type} start arrow` }, this.renderEndingIcon(type, true)))))), index.h("div", { key: '
|
|
28792
|
+
}, onClick: () => this.handleStartChange(type), title: type === 'none' ? 'No start arrow' : `${type} start arrow` }, this.renderEndingIcon(type, true)))))), index.h("div", { key: 'ecec29740c09a61190938bab4955ccde6b84cfa2', class: "endings-section" }, index.h("div", { key: 'ea054597c3e3566e7921f2c04c07d74e4f4331a1', class: "endings-row" }, this.styles.map(type => (index.h("button", { class: {
|
|
28689
28793
|
'ending-option': true,
|
|
28690
28794
|
'selected': endEnding === type,
|
|
28691
28795
|
}, onClick: () => this.handleEndChange(type), title: type === 'none' ? 'No end arrow' : `${type} end arrow` }, this.renderEndingIcon(type, false))))))));
|
|
@@ -28740,7 +28844,7 @@ const KritzelLoginDialog = class {
|
|
|
28740
28844
|
this.dialogClosed.emit();
|
|
28741
28845
|
};
|
|
28742
28846
|
render() {
|
|
28743
|
-
return (index.h(index.Host, { key: '
|
|
28847
|
+
return (index.h(index.Host, { key: '8cac83db48fef2531f1669c3f601526b1e5cdefa' }, index.h("kritzel-dialog", { key: '34e7208c8c34550292c2b7503759bf103cfb49a6', dialogTitle: this.dialogTitle, isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, index.h("div", { key: 'b0a0d8e0f38adc8d9b9545a02c5fc879f64a24de', class: "login-content" }, this.subtitle && (index.h("p", { key: 'a51b5f0a8b402aaf979d4bf47c6f9c3ba7e14bfe', class: "login-subtitle" }, this.subtitle)), index.h("div", { key: 'b6d8f8748eadf1462dd4161f089130b7ded31b59', class: "login-providers" }, this.providers.map(provider => (index.h("button", { key: provider.name, class: {
|
|
28744
28848
|
'provider-button': true,
|
|
28745
28849
|
'is-loading': this.loadingProvider === provider.name,
|
|
28746
28850
|
'is-disabled': this.loadingProvider !== null && this.loadingProvider !== provider.name,
|
|
@@ -28846,15 +28950,15 @@ const KritzelMasterDetail = class {
|
|
|
28846
28950
|
const selectedItem = this.items.find(item => item.id === this.selectedItemId);
|
|
28847
28951
|
const panelId = 'master-detail-panel';
|
|
28848
28952
|
const selectedTabId = selectedItem ? `tab-${selectedItem.id}` : undefined;
|
|
28849
|
-
return (index.h(index.Host, { key: '
|
|
28953
|
+
return (index.h(index.Host, { key: '59479b50a3e79ee854c75d78e1a41c1cb0551dab' }, index.h("div", { key: '0fdfa2d5a28c8f5800b2eeb80c545bdfcd252f6b', class: {
|
|
28850
28954
|
'master-detail-container': true,
|
|
28851
28955
|
'is-mobile-detail-visible': this.showMobileDetail,
|
|
28852
|
-
} }, index.h("nav", { key: '
|
|
28956
|
+
} }, index.h("nav", { key: 'f055346bdaf528e27136dffc680a5e2c6ddb95a7', class: "master-menu", role: "tablist", "aria-orientation": "vertical", "aria-label": "Settings categories" }, this.items.map((item, index$1) => (index.h("button", { key: item.id, id: `tab-${item.id}`, ref: el => this.setTabRef(el, index$1), class: {
|
|
28853
28957
|
'menu-item': true,
|
|
28854
28958
|
'is-selected': item.id === this.selectedItemId,
|
|
28855
28959
|
'is-disabled': !!item.disabled,
|
|
28856
28960
|
'is-focused': index$1 === this.focusedIndex,
|
|
28857
|
-
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index$1), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index$1), onFocus: () => this.handleFocus(index$1), onBlur: this.handleBlur }, item.icon && (index.h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), index.h("span", { class: "menu-item-label" }, item.label), index.h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { d: "m9 18 6-6-6-6" }))))))), index.h("div", { key: '
|
|
28961
|
+
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index$1), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index$1), onFocus: () => this.handleFocus(index$1), onBlur: this.handleBlur }, item.icon && (index.h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), index.h("span", { class: "menu-item-label" }, item.label), index.h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { d: "m9 18 6-6-6-6" }))))))), index.h("div", { key: '296ff692092eae9b73c673def66539aa4eb36053', id: panelId, class: "detail-panel", role: "tabpanel", "aria-labelledby": selectedTabId }, index.h("button", { key: '72c65aa2825aa373daa3b1d6fd48d8dd84ab25f1', class: "mobile-back-button", onClick: this.handleBackClick, "aria-label": "Back to menu" }, index.h("kritzel-icon", { key: '2241991dc0da3f53f77dc415e61f026a5734ad48', name: "chevron-left", size: 20, class: "mobile-back-icon" }), "Back"), index.h("slot", { key: '6ecdc24e462faf0d95e295d5536b44ea2f9181c9' })))));
|
|
28858
28962
|
}
|
|
28859
28963
|
static get watchers() { return {
|
|
28860
28964
|
"selectedItemId": [{
|
|
@@ -28927,7 +29031,7 @@ const KritzelMenu = class {
|
|
|
28927
29031
|
this.itemCloseChildMenu.emit(event.detail);
|
|
28928
29032
|
};
|
|
28929
29033
|
render() {
|
|
28930
|
-
return (index.h(index.Host, { key: '
|
|
29034
|
+
return (index.h(index.Host, { key: '2d6d46fc8135133ed3e42d65399c8549bc5f6bb5', tabIndex: 0, onClick: e => e.stopPropagation() }, this.openChildMenuItem && index.h("div", { key: 'b5b3910cc82f7cb451730792fe6e3b3a254036f3', class: "has-open-child-overlay", onClick: this.onOverlayClick }), this.items.map(item => (index.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 })))));
|
|
28931
29035
|
}
|
|
28932
29036
|
};
|
|
28933
29037
|
KritzelMenu.style = kritzelMenuCss();
|
|
@@ -29032,12 +29136,12 @@ const KritzelMenuItem = class {
|
|
|
29032
29136
|
];
|
|
29033
29137
|
}
|
|
29034
29138
|
render() {
|
|
29035
|
-
return (index.h(index.Host, { key: '
|
|
29139
|
+
return (index.h(index.Host, { key: 'ae5057ce9101dc08e2365455c544914715be468e', tabIndex: this.item.isDisabled ? -1 : 0, class: {
|
|
29036
29140
|
'selected': this.item.isSelected,
|
|
29037
29141
|
'editing': this.item.isEditing,
|
|
29038
29142
|
'disabled': this.item.isDisabled,
|
|
29039
29143
|
'child-open': this.item.isChildMenuOpen,
|
|
29040
|
-
}, onClick: this.handleItemSelect }, index.h("div", { key: '
|
|
29144
|
+
}, onClick: this.handleItemSelect }, index.h("div", { key: '973fc68404ea95c2f0459565b8a3d124d31ae090', class: "menu-item-overlay" }), this.item.isEditing ? this.renderEditMode() : this.renderViewMode()));
|
|
29041
29145
|
}
|
|
29042
29146
|
static get watchers() { return {
|
|
29043
29147
|
"item": [{
|
|
@@ -29108,7 +29212,7 @@ const KritzelMoreMenu = class {
|
|
|
29108
29212
|
this.closeMenu();
|
|
29109
29213
|
};
|
|
29110
29214
|
render() {
|
|
29111
|
-
return (index.h(index.Host, { key: '
|
|
29215
|
+
return (index.h(index.Host, { key: '93bee9fc14d532a74f1b077098fb0a470655d2fe', class: { mobile: this.isTouchDevice }, style: { display: this.visible ? '' : 'none' } }, index.h("div", { key: '1783013acb533de9580698f29a7c8ae212b583fc', class: { 'more-menu-wrapper': true, visible: this.visible } }, index.h("button", { key: '8dc2f098377e78db0bf6efc05daaf02496cef527', class: "more-menu-button", "data-testid": "more-menu-button", onClick: this.toggleMenu, "aria-label": "More options" }, index.h("kritzel-icon", { key: '876a229226b0f79f1d5ef5d0b7793f362b884923', name: this.icon, size: this.iconSize })), index.h("kritzel-portal", { key: '57f7a69408b00c1bb9e5a08d22e224c6e6bcdea4', anchor: this.menuAnchor, offsetY: this.offsetY, onClose: this.closeMenu }, index.h("kritzel-menu", { key: '73a2aacd1b7c0ec79d7fa1695fbc02b1a0bde1b5', items: this.visibleItems, onItemSelect: this.handleMenuItemSelect })))));
|
|
29112
29216
|
}
|
|
29113
29217
|
};
|
|
29114
29218
|
KritzelMoreMenu.style = kritzelMoreMenuCss();
|
|
@@ -29206,7 +29310,7 @@ const KritzelNumericInput = class {
|
|
|
29206
29310
|
this.valueChange.emit(newValue);
|
|
29207
29311
|
};
|
|
29208
29312
|
render() {
|
|
29209
|
-
return (index.h(index.Host, { key: '
|
|
29313
|
+
return (index.h(index.Host, { key: '18cd66a764c334a78e2dccd444f448235b41c38c' }, index.h("div", { key: '73305950e3e840e51466d720a2ef4f834a16adc1', class: "input-container" }, this.label && index.h("label", { key: 'f9521cb0137f5f8c676ced5c76989d8d03256f68', class: "input-label" }, this.label), index.h("div", { key: '07581a242db247a833cfa879b90c6da5dd06b116', class: "input-wrapper" }, index.h("input", { key: '7faa7a9a2c8923e2b2a24c435bc47a03998ac8ad', 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 }), index.h("div", { key: 'd3920c978a4d97032f5aec550e6ca7e74c9c2e94', class: "spinner-buttons" }, index.h("button", { key: 'ae27375f0ba66a9ca6cf53fe4a05fa219bf47711', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, index.h("svg", { key: '8a6e40c12468bb44400c1ad015463c830d0af13e', viewBox: "0 0 10 6", class: "spinner-icon" }, index.h("path", { key: '70b8ee3cc3b00d7f83822078f73e0437e24a98aa', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("button", { key: 'e26968c85480cbf4cd0f3bd9d6db59f1d6ade88c', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, index.h("svg", { key: 'a8c72dd2909b89ceb3797d0a77e531d0b5374e1d', viewBox: "0 0 10 6", class: "spinner-icon" }, index.h("path", { key: '16c95c8cbc90c9d49d081745384c3920620591fb', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
29210
29314
|
}
|
|
29211
29315
|
static get watchers() { return {
|
|
29212
29316
|
"value": [{
|
|
@@ -29245,8 +29349,9 @@ const KritzelOpacitySlider = class {
|
|
|
29245
29349
|
}
|
|
29246
29350
|
render() {
|
|
29247
29351
|
const percentage = this.getPercentage();
|
|
29248
|
-
return (index.h(index.Host, { key: '
|
|
29352
|
+
return (index.h(index.Host, { key: '988ad7b9ee8d3825c8577d951c6f1d00efbb45eb' }, index.h("div", { key: '4dad6a7d422333fbcaff55b2b374550b496a3adc', class: "opacity-container" }, index.h("div", { key: '7a0ceedd10f2e939dbf189410cc7263c7df498db', class: "slider-wrapper" }, index.h("input", { key: '453e8fbae27023fcbf3c453445fcb8567cb5db00', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
29249
29353
|
'--slider-progress': `${percentage}%`,
|
|
29354
|
+
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
29250
29355
|
} })))));
|
|
29251
29356
|
}
|
|
29252
29357
|
};
|
|
@@ -29309,7 +29414,7 @@ const KritzelPillTabs = class {
|
|
|
29309
29414
|
buttons?.[newIndex]?.focus();
|
|
29310
29415
|
}
|
|
29311
29416
|
render() {
|
|
29312
|
-
return (index.h(index.Host, { key: '
|
|
29417
|
+
return (index.h(index.Host, { key: 'f02f93ada5ec002695b62f511c847de201a8cbe4' }, index.h("div", { key: 'bb08ae773f1b993cb330556a5778d71fc5e91ce1', class: "pill-tabs-container", role: "tablist" }, this.tabs.map((tab, index$1) => (index.h("button", { key: tab.id, class: {
|
|
29313
29418
|
'pill-tab': true,
|
|
29314
29419
|
'selected': this.value === tab.id,
|
|
29315
29420
|
}, role: "tab", "aria-selected": this.value === tab.id ? 'true' : 'false', tabIndex: this.value === tab.id ? 0 : -1, onClick: () => this.handleTabClick(tab.id), onKeyDown: (e) => this.handleKeyDown(e, index$1) }, tab.icon && index.h("kritzel-icon", { name: tab.icon, size: 16 }), index.h("span", { class: "pill-tab-label" }, tab.label)))))));
|
|
@@ -29597,7 +29702,7 @@ const KritzelPortal = class {
|
|
|
29597
29702
|
this.portal.style.visibility = 'visible';
|
|
29598
29703
|
}
|
|
29599
29704
|
render() {
|
|
29600
|
-
return (index.h(index.Host, { key: '
|
|
29705
|
+
return (index.h(index.Host, { key: 'ea4b3c0bdaeb94a1aa03714537c3b68c972ad9c5', style: { display: this.anchor ? 'block' : 'none' } }, index.h("slot", { key: 'cd9060be1fbb801e3b72546d465576d5d79b3c82' })));
|
|
29601
29706
|
}
|
|
29602
29707
|
static get watchers() { return {
|
|
29603
29708
|
"anchor": [{
|
|
@@ -29611,7 +29716,7 @@ const KritzelPortal = class {
|
|
|
29611
29716
|
* This file is auto-generated by the version bump scripts.
|
|
29612
29717
|
* Do not modify manually.
|
|
29613
29718
|
*/
|
|
29614
|
-
const KRITZEL_VERSION = '0.3.
|
|
29719
|
+
const KRITZEL_VERSION = '0.3.9';
|
|
29615
29720
|
|
|
29616
29721
|
const kritzelSettingsCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-body-padding:0;--kritzel-dialog-width-large:800px;--kritzel-dialog-height-large:500px}.footer-button{padding:8px 16px;border-radius:6px;cursor:pointer;font-size:14px}.cancel-button{border:1px solid #ebebeb;background:#fff;color:inherit}.cancel-button:hover{background:#f5f5f5}.settings-content{padding:0}.settings-content h3{margin:0 0 16px 0;font-size:18px;font-weight:600;color:var(--kritzel-settings-content-heading-color, #333333)}.settings-content p{margin:0;font-size:14px;color:var(--kritzel-settings-content-text-color, #666666);line-height:1.5}.settings-group{display:flex;flex-direction:column;gap:24px}.settings-item{display:flex;flex-direction:column;gap:8px}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.settings-label{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.settings-description{font-size:12px;color:var(--kritzel-settings-description-color, #888888);margin:0;line-height:1.4}.shortcuts-list{display:flex;flex-direction:column;gap:24px}.shortcuts-category{display:flex;flex-direction:column;gap:8px}.shortcuts-category-title{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.shortcuts-group{display:flex;flex-direction:column;gap:4px}.shortcut-item{display:flex;justify-content:space-between;align-items:center;padding:6px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-item-bg, rgba(0, 0, 0, 0.02))}.shortcut-label{font-size:14px;color:var(--kritzel-settings-content-text-color, #666666)}.shortcut-key{font-family:monospace;font-size:12px;padding:2px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-key-bg, #f0f0f0);color:var(--kritzel-settings-shortcut-key-color, #333333);border:1px solid var(--kritzel-settings-shortcut-key-border, #ddd)}`;
|
|
29617
29722
|
|
|
@@ -29642,6 +29747,7 @@ const KritzelSettings = class {
|
|
|
29642
29747
|
}
|
|
29643
29748
|
get host() { return index.getElement(this); }
|
|
29644
29749
|
/** Keyboard shortcuts to display in the settings dialog */
|
|
29750
|
+
availableThemes = ['light', 'dark'];
|
|
29645
29751
|
shortcuts = [];
|
|
29646
29752
|
/** Current settings values. Used to initialize and sync the component's internal state. */
|
|
29647
29753
|
settings;
|
|
@@ -29655,7 +29761,7 @@ const KritzelSettings = class {
|
|
|
29655
29761
|
scaleMin = DEFAULT_SCALE_MIN;
|
|
29656
29762
|
scaleMax = DEFAULT_SCALE_MAX;
|
|
29657
29763
|
lockDrawingScale = DEFAULT_LOCK_DRAWING_SCALE;
|
|
29658
|
-
|
|
29764
|
+
theme = 'light';
|
|
29659
29765
|
viewportBoundaryLeft = DEFAULT_VIEWPORT_BOUNDARY_LEFT;
|
|
29660
29766
|
viewportBoundaryRight = DEFAULT_VIEWPORT_BOUNDARY_RIGHT;
|
|
29661
29767
|
viewportBoundaryTop = DEFAULT_VIEWPORT_BOUNDARY_TOP;
|
|
@@ -29678,8 +29784,8 @@ const KritzelSettings = class {
|
|
|
29678
29784
|
if (typeof settings.lockDrawingScale === 'boolean') {
|
|
29679
29785
|
this.lockDrawingScale = settings.lockDrawingScale;
|
|
29680
29786
|
}
|
|
29681
|
-
if (
|
|
29682
|
-
this.
|
|
29787
|
+
if (typeof settings.theme === 'string') {
|
|
29788
|
+
this.theme = settings.theme;
|
|
29683
29789
|
}
|
|
29684
29790
|
if (typeof settings.viewportBoundaryLeft === 'number') {
|
|
29685
29791
|
this.viewportBoundaryLeft = settings.viewportBoundaryLeft;
|
|
@@ -29702,7 +29808,7 @@ const KritzelSettings = class {
|
|
|
29702
29808
|
scaleMin: this.scaleMin,
|
|
29703
29809
|
scaleMax: this.scaleMax,
|
|
29704
29810
|
lockDrawingScale: this.lockDrawingScale,
|
|
29705
|
-
theme: this.
|
|
29811
|
+
theme: this.theme,
|
|
29706
29812
|
viewportBoundaryLeft: this.viewportBoundaryLeft,
|
|
29707
29813
|
viewportBoundaryRight: this.viewportBoundaryRight,
|
|
29708
29814
|
viewportBoundaryTop: this.viewportBoundaryTop,
|
|
@@ -29724,7 +29830,7 @@ const KritzelSettings = class {
|
|
|
29724
29830
|
this.emitSettings();
|
|
29725
29831
|
};
|
|
29726
29832
|
handleThemeChange = (event) => {
|
|
29727
|
-
this.
|
|
29833
|
+
this.theme = event.detail;
|
|
29728
29834
|
this.emitSettings();
|
|
29729
29835
|
};
|
|
29730
29836
|
handleViewportBoundaryLeftChange = (event) => {
|
|
@@ -29785,7 +29891,7 @@ const KritzelSettings = class {
|
|
|
29785
29891
|
renderCategoryContent() {
|
|
29786
29892
|
switch (this.selectedCategoryId) {
|
|
29787
29893
|
case 'general':
|
|
29788
|
-
return (index.h("div", { class: "settings-content" }, index.h("h3", null, "General Settings"), index.h("div", { class: "settings-group" }, index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "
|
|
29894
|
+
return (index.h("div", { class: "settings-content" }, index.h("h3", null, "General Settings"), index.h("div", { class: "settings-group" }, index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Theme"), index.h("p", { class: "settings-description" }, "Select a registered color theme for the editor interface."), index.h("kritzel-dropdown", { options: this.availableThemes.map(t => ({ value: t, label: t })), value: this.theme, onValueChanged: this.handleThemeChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Lock Drawing Scale"), index.h("p", { class: "settings-description" }, "When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level."), index.h("kritzel-slide-toggle", { checked: this.lockDrawingScale, label: "Lock Drawing Scale", onCheckedChange: this.handleLockDrawingScaleChange })))));
|
|
29789
29895
|
case 'viewport':
|
|
29790
29896
|
return (index.h("div", { class: "settings-content" }, index.h("h3", null, "Viewport Settings"), index.h("div", { class: "settings-group" }, index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Minimum Zoom Level"), index.h("p", { class: "settings-description" }, "Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas."), index.h("kritzel-numeric-input", { value: this.scaleMin, min: 0.0001, max: 1, step: 0.0001, onValueChange: this.handleScaleMinChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Maximum Zoom Level"), index.h("p", { class: "settings-description" }, "Sets the maximum zoom level. Higher values allow zooming in closer for detailed work."), index.h("kritzel-numeric-input", { value: this.scaleMax, min: 1, max: 1000, step: 1, onValueChange: this.handleScaleMaxChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Viewport Boundary Left"), index.h("p", { class: "settings-description" }, "Left boundary in world coordinates. Set to limit how far left the viewport can pan."), index.h("kritzel-numeric-input", { value: this.viewportBoundaryLeft, step: 100, placeholder: "Infinite", onValueChange: this.handleViewportBoundaryLeftChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Viewport Boundary Right"), index.h("p", { class: "settings-description" }, "Right boundary in world coordinates. Set to limit how far right the viewport can pan."), index.h("kritzel-numeric-input", { value: this.viewportBoundaryRight, step: 100, placeholder: "Infinite", onValueChange: this.handleViewportBoundaryRightChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Viewport Boundary Top"), index.h("p", { class: "settings-description" }, "Top boundary in world coordinates. Set to limit how far up the viewport can pan."), index.h("kritzel-numeric-input", { value: this.viewportBoundaryTop, step: 100, placeholder: "Infinite", onValueChange: this.handleViewportBoundaryTopChange })), index.h("div", { class: "settings-item" }, index.h("label", { class: "settings-label" }, "Viewport Boundary Bottom"), index.h("p", { class: "settings-description" }, "Bottom boundary in world coordinates. Set to limit how far down the viewport can pan."), index.h("kritzel-numeric-input", { value: this.viewportBoundaryBottom, step: 100, placeholder: "Infinite", onValueChange: this.handleViewportBoundaryBottomChange })))));
|
|
29791
29897
|
case 'shortcuts':
|
|
@@ -29799,7 +29905,7 @@ const KritzelSettings = class {
|
|
|
29799
29905
|
}
|
|
29800
29906
|
}
|
|
29801
29907
|
render() {
|
|
29802
|
-
return (index.h(index.Host, { key: '
|
|
29908
|
+
return (index.h(index.Host, { key: '46c6792ae9cdd932d3dc71526862c9281c0cefc1' }, index.h("kritzel-dialog", { key: '1cd288cdf8b26bea378665c54bfc14577597fe49', isOpen: this.isDialogOpen, dialogTitle: "Settings", size: "large", contained: true, onDialogClose: this.closeDialog }, index.h("kritzel-master-detail", { key: '4d07e94ebb09035807356bab4bc7eaca57c36c6c', items: SETTINGS_CATEGORIES, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
|
|
29803
29909
|
}
|
|
29804
29910
|
static get watchers() { return {
|
|
29805
29911
|
"settings": [{
|
|
@@ -29832,10 +29938,10 @@ const KritzelShapeFill = class {
|
|
|
29832
29938
|
return (index.h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, index.h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: strokeColor, stroke: strokeColor, "stroke-width": "2" })));
|
|
29833
29939
|
}
|
|
29834
29940
|
render() {
|
|
29835
|
-
return (index.h(index.Host, { key: '
|
|
29941
|
+
return (index.h(index.Host, { key: '6d38a9af2e4c4c7f86ab994c63fc074007c86b48' }, index.h("div", { key: 'cf58f26cb0e56e274873d11024209c6908d317bb', class: "fill-row" }, index.h("button", { key: 'c75eed70fe0c2fcbf0fd136bb6fce75b2dbfb45d', class: {
|
|
29836
29942
|
'fill-option': true,
|
|
29837
29943
|
'selected': this.value === 'transparent',
|
|
29838
|
-
}, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), index.h("button", { key: '
|
|
29944
|
+
}, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), index.h("button", { key: '5d6ede439b5d5e55598cd8c20b5851fb9f210463', class: {
|
|
29839
29945
|
'fill-option': true,
|
|
29840
29946
|
'selected': this.value === 'filled',
|
|
29841
29947
|
}, onClick: () => this.handleFillChange('filled'), title: "Filled background" }, this.renderFillIcon('filled')))));
|
|
@@ -29930,9 +30036,9 @@ const KritzelShareDialog = class {
|
|
|
29930
30036
|
this.dialogClosed.emit();
|
|
29931
30037
|
};
|
|
29932
30038
|
render() {
|
|
29933
|
-
return (index.h(index.Host, { key: '
|
|
30039
|
+
return (index.h(index.Host, { key: 'a104c14b2492d97f3ada98c9eaaa845d63074063' }, index.h("kritzel-dialog", { key: '1b12b27504153e54aeb0cb4e6b1030a0d43b9735', dialogTitle: "Share Workspace", size: "small", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, contained: true }, index.h("div", { key: '652f23e37876be356beb6f93abf5930e91d82cea', class: "share-content" }, index.h("div", { key: 'aaf336f2ac86fe23cac79cef920a9d67681046e2', class: "share-section" }, index.h("div", { key: '8075a7b3fff47c4b924d3b2d92b1377641920939', class: "share-row" }, index.h("div", { key: '41e98a74a5d4aede50fd75a7de62cbef9b5a5a31', class: "share-label-group" }, index.h("label", { key: '8a4f53e13d5a81497dd31316a49971c7245d82a2', class: "share-label" }, "Link sharing"), index.h("p", { key: '907a59d50e595734f03067f70830cf96defdf8d8', class: "share-description" }, this.internalIsPublic
|
|
29934
30040
|
? 'Anyone with the link can access this workspace.'
|
|
29935
|
-
: 'Link sharing is disabled. Only you can access this workspace.')), index.h("kritzel-slide-toggle", { key: '
|
|
30041
|
+
: 'Link sharing is disabled. Only you can access this workspace.')), index.h("kritzel-slide-toggle", { key: '0d75cfeeb63c33d20380ffe9a7e4c27148548ef9', checked: this.internalIsPublic, onCheckedChange: this.handleToggleChange, label: "Enable link sharing" }))), this.internalIsPublic && (index.h("div", { key: 'a8a10c74fd326c5097e4a5f0ee165602c3606ade', class: "share-section" }, index.h("div", { key: '6261a9fc6cb2be2a50856fb8a990b9da3fee84bf', class: "share-url-container" }, index.h("input", { key: '26ee72eebfee88d06a50c338cccc9af296c8ba4c', type: "text", class: "share-url-input", value: this.getShareUrl(), readOnly: true, onClick: (e) => e.target.select() }), index.h("button", { key: '4b1ec06fa27c95d9d0bb93f8cbb851a02fdd52cc', class: { 'copy-button': true, 'copy-success': this.copySuccess }, onClick: this.handleCopyUrl, title: this.copySuccess ? 'Copied!' : 'Copy link' }, index.h("kritzel-icon", { key: 'd9eea56b3523fcc3557d9868f3da7f28449a9447', name: this.copySuccess ? 'check' : 'copy', size: 18 })))))))));
|
|
29936
30042
|
}
|
|
29937
30043
|
static get watchers() { return {
|
|
29938
30044
|
"isPublic": [{
|
|
@@ -29970,7 +30076,7 @@ const KritzelSlideToggle = class {
|
|
|
29970
30076
|
}
|
|
29971
30077
|
};
|
|
29972
30078
|
render() {
|
|
29973
|
-
return (index.h(index.Host, { key: '
|
|
30079
|
+
return (index.h(index.Host, { key: '8a1f816240f815905cc7def7cac92eb7ddac0df2', 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 }, index.h("div", { key: 'd5fa5091ad54032f81dad3879149c4d8ec7ea37b', class: "toggle-track" }, index.h("div", { key: 'cce0d61431ed65a26926b0a496a5c22eb4169577', class: "toggle-thumb" }))));
|
|
29974
30080
|
}
|
|
29975
30081
|
};
|
|
29976
30082
|
KritzelSlideToggle.style = kritzelSlideToggleCss();
|
|
@@ -30070,7 +30176,7 @@ const KritzelSplitButton = class {
|
|
|
30070
30176
|
this.menuScrollTop = event.target.scrollTop;
|
|
30071
30177
|
};
|
|
30072
30178
|
render() {
|
|
30073
|
-
return (index.h(index.Host, { key: '
|
|
30179
|
+
return (index.h(index.Host, { key: '794fdb5cb4d110d93b6b2cb060fe34241f29db57', class: { mobile: this.isTouchDevice } }, index.h("button", { key: '7202a40f05bf6fc256996a05db55bcfa3baba615', class: "split-main-button", tabIndex: 0, onClick: this.handleButtonClick, disabled: this.mainButtonDisabled, "aria-label": "Main action" }, this.buttonIcon && index.h("kritzel-icon", { key: '3156c6c4e757d9ebbd3f5e3719ee1bf9bf81f71b', name: this.buttonIcon })), index.h("div", { key: '4c5a3a9791ecfd00d36fc0eb885c1d227200cfc7', class: "split-divider" }), index.h("button", { key: 'fe0ee44d11ddb34f7719b986406905c47bc1f152', ref: el => (this.splitMenuButtonRef = el), class: "split-menu-button", tabIndex: 0, onClick: this.toggleMenu, disabled: this.menuButtonDisabled, "aria-label": "Open menu" }, index.h("kritzel-icon", { key: 'b3d84e4599dc408ccc8afe17e487b501cbde89a4', name: this.dropdownIcon })), index.h("kritzel-portal", { key: '6800329ebe3c94a661e9ad852b6bf256defc291f', anchor: this.anchorElement, offsetY: 4, onClose: this.closeMenu }, index.h("kritzel-menu", { key: '0c98abe2327e0cc3182a55caf50c89316b526049', 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 }))));
|
|
30074
30180
|
}
|
|
30075
30181
|
};
|
|
30076
30182
|
KritzelSplitButton.style = kritzelSplitButtonCss();
|
|
@@ -30090,7 +30196,7 @@ const KritzelStrokeSize = class {
|
|
|
30090
30196
|
this.sizeChange.emit(size);
|
|
30091
30197
|
}
|
|
30092
30198
|
render() {
|
|
30093
|
-
return (index.h(index.Host, { key: '
|
|
30199
|
+
return (index.h(index.Host, { key: '514d87732c9b15cddd5a905407ff7ce9069c06d7' }, index.h("div", { key: '170c9a8abfe8298116d8a269338da95fbc2aac7b', class: "size-grid" }, this.sizes.map(size => (index.h("div", { tabIndex: 0, class: {
|
|
30094
30200
|
'size-container': true,
|
|
30095
30201
|
'selected': this.selectedSize === size,
|
|
30096
30202
|
}, onClick: () => this.handleSizeClick(size) }, index.h("kritzel-color", { value: 'var(--kritzel-global-text-primary)', size: size })))))));
|
|
@@ -30469,14 +30575,14 @@ const KritzelTooltip = class {
|
|
|
30469
30575
|
}
|
|
30470
30576
|
}
|
|
30471
30577
|
render() {
|
|
30472
|
-
return (index.h(index.Host, { key: '
|
|
30578
|
+
return (index.h(index.Host, { key: '10bff4d14ff1f724d59463afc059f254e9485175', style: {
|
|
30473
30579
|
position: 'fixed',
|
|
30474
30580
|
zIndex: '9999',
|
|
30475
30581
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
30476
30582
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
30477
30583
|
left: `${this.positionX}px`,
|
|
30478
30584
|
bottom: `${this.positionY}px`,
|
|
30479
|
-
} }, index.h("div", { key: '
|
|
30585
|
+
} }, index.h("div", { key: '6bfc8f2fe731d758c74319abeb82c4b84616f8b6', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, index.h("slot", { key: '2a92ad23f4424b2d17035f86983be66a81fee81d' }))));
|
|
30480
30586
|
}
|
|
30481
30587
|
static get watchers() { return {
|
|
30482
30588
|
"triggerElement": [{
|
|
@@ -30515,7 +30621,7 @@ const KritzelUtilityPanel = class {
|
|
|
30515
30621
|
this.redo.emit();
|
|
30516
30622
|
}
|
|
30517
30623
|
render() {
|
|
30518
|
-
return (index.h(index.Host, { key: '
|
|
30624
|
+
return (index.h(index.Host, { key: 'b49f6db6c0e574dc8a5a733c749ecda6f24f9d25' }, index.h("button", { key: 'e6306e54c8f660c3e92d032527fad1ea45ca0cf8', class: "utility-button", "data-testid": "utility-undo", disabled: !this.undoState?.canUndo, onClick: event => this.handleUndo(event), "aria-label": "Undo" }, index.h("kritzel-icon", { key: '5bb1293049a1e3004504289d92ccc79958786f3f', name: "undo" })), index.h("button", { key: '8102b0403d7f328ce4bfeb79767d5bd99d879013', class: "utility-button", "data-testid": "utility-redo", disabled: !this.undoState?.canRedo, onClick: event => this.handleRedo(event), "aria-label": "Redo" }, index.h("kritzel-icon", { key: '5db3047bec5d8ab695a2dc67780a5dbecbae64d2', name: "redo" })), index.h("div", { key: 'e894d9f2aaa2cad7aa980d3b839eca05a8d9c9df', class: "utility-separator" }), index.h("button", { key: 'f0a7de5ab91f82a2e5e8df75cc1903ec647abdac', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": "Delete selected items" }, index.h("kritzel-icon", { key: '5b146375394299bae946a95545c3c42c2bf36766', name: "delete" }))));
|
|
30519
30625
|
}
|
|
30520
30626
|
};
|
|
30521
30627
|
KritzelUtilityPanel.style = kritzelUtilityPanelCss();
|