kritzel-stencil 0.4.5 → 0.4.7
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/kritzel-active-users_47.cjs.entry.js +180 -92
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +4 -5
- package/dist/collection/classes/core/viewport.class.js +14 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +71 -8
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +133 -18
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +1 -1
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.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.css +8 -0
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +2 -15
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/context-menu-state.interface.js +1 -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-back-to-content.js +1 -1
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-editor.js +73 -42
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-loading-overlay.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-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-sync-indicator.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-watermark.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.js +1 -1
- package/dist/components/{p-Cymum41a.js → p-1nG2hxfJ.js} +2 -2
- package/dist/components/{p-B5oHmPJb.js → p-7Rt7ml3v.js} +1 -1
- package/dist/components/{p-BI2ng9I_.js → p-8xkoVMfO.js} +2 -2
- package/dist/components/{p-CwJwsRR3.js → p-BKOsmXB5.js} +4 -4
- package/dist/components/{p-Ca-igU1f.js → p-BLOPBDUF.js} +1 -1
- package/dist/components/{p-DUYmwrWV.js → p-BMRln59F.js} +3 -3
- package/dist/components/{p-DIazmg6w.js → p-BO9BvTtK.js} +2 -2
- package/dist/components/{p-D3y_Hauo.js → p-BU-FZuj0.js} +3 -3
- package/dist/components/{p-DgJ0ufzr.js → p-BVEGQLBD.js} +1 -1
- package/dist/components/{p-Dlp84thc.js → p-BYO6pz8T.js} +1 -1
- package/dist/components/{p-C38P-Vd0.js → p-BZxOukfY.js} +6 -6
- package/dist/components/{p-D82VaHce.js → p-Bm_BWQa4.js} +2 -2
- package/dist/components/{p-CWRSGYOE.js → p-BzJEwFtn.js} +1 -1
- package/dist/components/{p-B6t5q-V4.js → p-BzrxIesp.js} +1 -1
- package/dist/components/{p--Oazz-BP.js → p-C2yi85nc.js} +103 -34
- package/dist/components/{p-894OnDQV.js → p-CM1duewg.js} +1 -1
- package/dist/components/{p-e6Zpc9Vp.js → p-COjsYPir.js} +2 -2
- package/dist/components/{p-BsANVili.js → p-CVhcOiEA.js} +3 -3
- package/dist/components/{p-PSFAfAyd.js → p-CwuGA058.js} +1 -1
- package/dist/components/{p-U6uE85Qx.js → p-D0oplzU-.js} +8 -21
- package/dist/components/{p-Cr682JI_.js → p-D8TOEhPY.js} +3 -3
- package/dist/components/{p-ClFprFvz.js → p-DDbO5q-e.js} +3 -3
- package/dist/components/{p-BDzlx2hB.js → p-DIMNEOTW.js} +1 -1
- package/dist/components/{p-C4NrrUfN.js → p-DSOc0eIT.js} +1 -1
- package/dist/components/{p-D5jf8wAu.js → p-DXcjIb_a.js} +3 -3
- package/dist/components/{p-B8Xi4Clg.js → p-DgnK50xO.js} +1 -1
- package/dist/components/{p-JYj3Facr.js → p-DkH3hoLz.js} +15 -15
- package/dist/components/{p-D30zs0kA.js → p-DkY7pIg5.js} +3 -3
- package/dist/components/{p-BTzlrIxe.js → p-DrQRChp3.js} +2 -2
- package/dist/components/{p-CsvMgk_f.js → p-DwY5pghH.js} +1 -1
- package/dist/components/{p-DkUb2czk.js → p-OLfoATNk.js} +1 -1
- package/dist/components/{p-DEBwmRTC.js → p-oGAPPwAL.js} +2 -2
- package/dist/components/{p-DJ88BrIW.js → p-yD_3Z3K1.js} +1 -1
- package/dist/components/{p-CqLgB8JK.js → p-zd7zXld8.js} +2 -2
- package/dist/esm/kritzel-active-users_47.entry.js +180 -92
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/{p-4463dade.entry.js → p-472f2e90.entry.js} +180 -92
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/core.class.d.ts +2 -2
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +6 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +11 -1
- package/dist/types/components.d.ts +17 -0
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/context-menu-state.interface.d.ts +16 -0
- package/package.json +1 -1
- package/readme.md +3 -3
|
@@ -136,16 +136,16 @@ const KritzelAvatar = class {
|
|
|
136
136
|
height: `${this.size}px`,
|
|
137
137
|
fontSize: `${Math.round(this.size * 0.4)}px`,
|
|
138
138
|
};
|
|
139
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '116725d55e4443e80216b3b3251e957d2009b43e', style: containerStyles, class: {
|
|
140
140
|
'has-image': !!showImage,
|
|
141
141
|
'has-initials': !!showInitials,
|
|
142
142
|
'has-default': !!showDefaultIcon,
|
|
143
|
-
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '
|
|
143
|
+
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: 'd70ad4eb484404b18c13e066e8c10b3c86918ee5', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
|
|
144
144
|
if (el) {
|
|
145
145
|
el.referrerPolicy = 'no-referrer';
|
|
146
146
|
el.crossOrigin = 'anonymous';
|
|
147
147
|
}
|
|
148
|
-
}, onError: this.handleImageError })), showInitials && (h("span", { key: '
|
|
148
|
+
}, onError: this.handleImageError })), showInitials && (h("span", { key: '21a9022cffdb69e0c3626e513cb3c036a9d3a16d', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: '43e676af007bf254b1921f3efcbc7fff4e204359', class: "avatar-default" }, h("svg", { key: 'a7378795539a902e28ca644a80f1ca00cc9f818a', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: '31548a495a86f033325c98cfcc0ae398b6bb8281', 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" }))))));
|
|
149
149
|
}
|
|
150
150
|
static get watchers() { return {
|
|
151
151
|
"user": [{
|
|
@@ -470,7 +470,7 @@ const KritzelBackToContent = class {
|
|
|
470
470
|
this.backToContent.emit();
|
|
471
471
|
};
|
|
472
472
|
render() {
|
|
473
|
-
return (h(Host, { key: '
|
|
473
|
+
return (h(Host, { key: '86a94bdc5bb02977214f999b7b880ce3193b6d8f' }, h("button", { key: '6a07c13c9986ebef6100140f7e702a1dfb5c2033', class: { 'back-to-content-button': true, visible: this.visible }, onClick: this.handleClick, "aria-label": this.text }, h("kritzel-icon", { key: 'ebadc99b15f2f015ada8795fa05a3a64ccac9cb5', name: "chevrons-left" }))));
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
KritzelBackToContent.style = kritzelBackToContentCss();
|
|
@@ -497,11 +497,11 @@ const KritzelButton = class {
|
|
|
497
497
|
this.buttonClick.emit();
|
|
498
498
|
};
|
|
499
499
|
render() {
|
|
500
|
-
return (h(Host, { key: '
|
|
500
|
+
return (h(Host, { key: 'b9de2a1261ca0cb491f6980db6a596c48fa45b3a' }, h("button", { key: 'a9507ea0f6a1d9fcb19a7df16bea54cc0ead24f9', type: this.type, class: {
|
|
501
501
|
'kritzel-button': true,
|
|
502
502
|
[this.variant]: true,
|
|
503
503
|
'disabled': this.disabled,
|
|
504
|
-
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '
|
|
504
|
+
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '8449a26d4f9fe0226c6150a6639c522486b59780' }))));
|
|
505
505
|
}
|
|
506
506
|
};
|
|
507
507
|
KritzelButton.style = kritzelButtonCss();
|
|
@@ -549,13 +549,13 @@ const KritzelColorComponent = class {
|
|
|
549
549
|
render() {
|
|
550
550
|
const resolvedColor = this.resolveColor();
|
|
551
551
|
const isColorVeryLight = this.isLightColor(resolvedColor);
|
|
552
|
-
return (h(Host, { key: '
|
|
552
|
+
return (h(Host, { key: 'e39c77c55942b9c615e404efabf4939b2cf05a34' }, h("div", { key: 'ac343295592ea80ca7d3da61ca1244dd1aaa50db', class: "checkerboard-bg", style: {
|
|
553
553
|
width: `${this.size}px`,
|
|
554
554
|
height: `${this.size}px`,
|
|
555
555
|
borderRadius: '50%',
|
|
556
556
|
display: 'inline-block',
|
|
557
557
|
position: 'relative',
|
|
558
|
-
} }, h("div", { key: '
|
|
558
|
+
} }, h("div", { key: '4c87934b3febd4c41874cd290d86a9a9a557e3e5', class: {
|
|
559
559
|
'color-circle': true,
|
|
560
560
|
'white': isColorVeryLight,
|
|
561
561
|
}, style: {
|
|
@@ -611,7 +611,7 @@ const KritzelColorPalette = class {
|
|
|
611
611
|
render() {
|
|
612
612
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
613
613
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
614
|
-
return (h(Host, { key: '
|
|
614
|
+
return (h(Host, { key: '16aa405a43b3943473e577c5a6ab86adf4ae1ba9' }, h("div", { key: 'f65bb286889700dc1f0e8d84ff59721071b7b73a', class: {
|
|
615
615
|
'color-grid': true,
|
|
616
616
|
'expanded': this.isExpanded,
|
|
617
617
|
}, style: {
|
|
@@ -1180,13 +1180,13 @@ const KritzelControls = class {
|
|
|
1180
1180
|
// Separate tool controls from config control
|
|
1181
1181
|
const toolControls = this.internalControls.filter(c => c.type === 'tool' || c.type === 'separator');
|
|
1182
1182
|
const configControl = this.internalControls.find(c => c.type === 'config' && c.name === this.firstConfig?.name);
|
|
1183
|
-
return (h(Host, { key: '
|
|
1183
|
+
return (h(Host, { key: 'a72f9b1befd185b67d24f6d7a4987ebeb4d6742d', style: { display: this.visible ? '' : 'none' }, class: {
|
|
1184
1184
|
mobile: this.isTouchDevice,
|
|
1185
|
-
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: '
|
|
1185
|
+
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: '4e69324b23542878919119d10db98fc44b0dc536', style: {
|
|
1186
1186
|
position: 'absolute',
|
|
1187
1187
|
bottom: '56px',
|
|
1188
1188
|
left: '12px',
|
|
1189
|
-
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: '
|
|
1189
|
+
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: 'f4c7b461a433055512f5b6d397ab69d470531285', class: "kritzel-controls" }, h("div", { key: '53c27ef4ac2a9121f07ce91c82e63de5d7029de6', class: { 'scroll-indicator-left': true, 'visible': this.canScrollLeft } }), h("div", { key: '43d90c6031e164843dd43563d4fe75410b990278', class: "kritzel-tools-scroll", ref: el => (this.toolsScrollRef = el), onScroll: this.handleToolsScroll }, toolControls.map(control => {
|
|
1190
1190
|
// Check if this control has sub-options (split-button)
|
|
1191
1191
|
if (control.subOptions?.length) {
|
|
1192
1192
|
const selectedSubOption = this.getSelectedSubOption(control);
|
|
@@ -1216,10 +1216,10 @@ const KritzelControls = class {
|
|
|
1216
1216
|
'kritzel-control': true,
|
|
1217
1217
|
'selected': this.activeControl?.name === control?.name,
|
|
1218
1218
|
}, key: control.name, "data-testid": `tool-${control.name}`, onClick: _event => this.handleControlClick?.(control), "aria-label": control.name.charAt(0).toUpperCase() + control.name.slice(1) }, h("kritzel-icon", { name: control.icon })));
|
|
1219
|
-
})), h("div", { key: '
|
|
1219
|
+
})), h("div", { key: '9a8bd38a8266f1bb5feddcb4e396bb20c25512fa', class: { 'scroll-indicator-right': true, 'visible': this.canScrollRight && !(configControl && this.activeControl && hasConfigUI) } }), configControl && this.activeControl && (h("div", { class: {
|
|
1220
1220
|
'kritzel-config-container': true,
|
|
1221
1221
|
'visible': hasConfigUI,
|
|
1222
|
-
}, key: configControl.name }, h("div", { key: '
|
|
1222
|
+
}, key: configControl.name }, h("div", { key: 'c889744c924d29f1e65cf67263be9ff708916610', class: { 'config-gradient-left': true, 'visible': this.needsScrolling } }), h("kritzel-tooltip", { key: '9df35a6967a9738e24d328865b07b50328cef811', anchorElement: this.host.shadowRoot?.querySelector('.kritzel-config-container'), triggerElement: this.configTriggerRef }, h("kritzel-tool-config", { key: '6f0079c879dc2ca5910193a02d19f246068d09e6', tool: this.activeControl.tool, theme: this.theme, engine: this.kritzelEngine, terms: this.terms, onToolChange: event => this.handleToolChange?.(event), onDisplayValuesChange: this.handleDisplayValuesChange, style: { width: '100%', height: '100%' } })), h("div", { key: 'a6af0ad5cc2fd0bbef0ade522f82ead53b30f92b', tabIndex: hasConfigUI ? 0 : -1, class: "kritzel-config", "data-testid": "tool-config", ref: el => {
|
|
1223
1223
|
if (el)
|
|
1224
1224
|
this.configTriggerRef = el;
|
|
1225
1225
|
}, onKeyDown: event => {
|
|
@@ -1228,7 +1228,7 @@ const KritzelControls = class {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
}, style: {
|
|
1230
1230
|
cursor: 'pointer',
|
|
1231
|
-
} }, this.displayValues && (h("div", { key: '
|
|
1231
|
+
} }, this.displayValues && (h("div", { key: '07a7fb2e0dc5c53a389da7f742322fdf489e0bd7', class: "color-container" }, h("kritzel-color", { key: '2987b76ca66d58a12ee71dd4c7d82a9c42480690', value: this.displayValues.color, theme: this.theme, size: 18, style: {
|
|
1232
1232
|
borderRadius: '50%',
|
|
1233
1233
|
border: 'none',
|
|
1234
1234
|
} })))))))));
|
|
@@ -1262,7 +1262,7 @@ const KritzelCurrentUser = class {
|
|
|
1262
1262
|
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
1263
1263
|
terms = {};
|
|
1264
1264
|
render() {
|
|
1265
|
-
return (h(Host, { key: '
|
|
1265
|
+
return (h(Host, { key: '3c23677e98ba459144fafde994dc66a14068c5b1' }, h("kritzel-avatar", { key: 'e5c04bf871f7808ab0e380770a2a94ddab8eac83', user: this.user, size: this.avatarSize })));
|
|
1266
1266
|
}
|
|
1267
1267
|
};
|
|
1268
1268
|
KritzelCurrentUser.style = kritzelCurrentUserCss();
|
|
@@ -1303,7 +1303,7 @@ const KritzelCurrentUserDialog = class {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
render() {
|
|
1305
1305
|
const displayName = this.getDisplayName();
|
|
1306
|
-
return (h(Host, { key: '
|
|
1306
|
+
return (h(Host, { key: 'd5be0723f615c45bac897d4f2a2ebe5c67b4769c' }, h("kritzel-dialog", { key: '4de42a3df3d18f96ddfbc362c05e98ade4aeaaf8', dialogTitle: this.terms['currentUser.dialogTitle'] ?? 'Account', isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: '7908d833617b67a6663e41fd91599356ab66619b', class: "user-info" }, h("kritzel-avatar", { key: '93fd9ddb633ad9ad7e17a7c4292861b86ef132f1', user: this.user, size: 80 }), displayName && h("div", { key: 'dff873e3c8b643e7a52f212a3e00167adc301cf7', class: "user-name" }, displayName), this.user?.email && h("div", { key: '7b30a9930cd454ca040181cb11c1d000e408bfc8', class: "user-email" }, this.user.email), h("kritzel-button", { key: '04ea8cbadd90b149ee8f5bbac071040b74eb12b3', class: "logout-button", variant: "primary", onButtonClick: this.handleLogout }, this.terms['menu.logout'] ?? 'Logout')))));
|
|
1307
1307
|
}
|
|
1308
1308
|
};
|
|
1309
1309
|
KritzelCurrentUserDialog.style = kritzelCurrentUserDialogCss();
|
|
@@ -2363,6 +2363,7 @@ const KritzelEditor = class {
|
|
|
2363
2363
|
isEditorVisible = false;
|
|
2364
2364
|
activeNotification;
|
|
2365
2365
|
isNotificationDismissing = false;
|
|
2366
|
+
contextMenuState;
|
|
2366
2367
|
normalizedControls = [];
|
|
2367
2368
|
notificationDismissTimeout;
|
|
2368
2369
|
notificationDismissAnimationTimeout;
|
|
@@ -2651,6 +2652,12 @@ const KritzelEditor = class {
|
|
|
2651
2652
|
async triggerSelectionChange() {
|
|
2652
2653
|
return this.engineRef.triggerSelectionChange();
|
|
2653
2654
|
}
|
|
2655
|
+
async beginSceneBootstrap() {
|
|
2656
|
+
return this.engineRef.beginSceneBootstrap();
|
|
2657
|
+
}
|
|
2658
|
+
async endSceneBootstrap() {
|
|
2659
|
+
return this.engineRef.endSceneBootstrap();
|
|
2660
|
+
}
|
|
2654
2661
|
async getDisplayableShortcuts() {
|
|
2655
2662
|
return this.engineRef.getDisplayableShortcuts();
|
|
2656
2663
|
}
|
|
@@ -2826,6 +2833,22 @@ const KritzelEditor = class {
|
|
|
2826
2833
|
this.activeNotification = event.detail;
|
|
2827
2834
|
this.scheduleNotificationDismiss();
|
|
2828
2835
|
}
|
|
2836
|
+
handleContextMenuStateChange(event) {
|
|
2837
|
+
event.stopPropagation();
|
|
2838
|
+
this.contextMenuState = event.detail.isVisible ? event.detail : undefined;
|
|
2839
|
+
}
|
|
2840
|
+
handleContextMenuActionSelected(event) {
|
|
2841
|
+
const contextMenuState = this.contextMenuState;
|
|
2842
|
+
if (!contextMenuState || !event.detail.action) {
|
|
2843
|
+
void this.hideContextMenu();
|
|
2844
|
+
return;
|
|
2845
|
+
}
|
|
2846
|
+
event.detail.action({
|
|
2847
|
+
x: contextMenuState.worldPosition.x,
|
|
2848
|
+
y: contextMenuState.worldPosition.y,
|
|
2849
|
+
}, contextMenuState.objects);
|
|
2850
|
+
void this.hideContextMenu();
|
|
2851
|
+
}
|
|
2829
2852
|
handleNotificationHoverChange(event) {
|
|
2830
2853
|
event.stopPropagation();
|
|
2831
2854
|
this.isNotificationHovered = event.detail;
|
|
@@ -3130,36 +3153,41 @@ const KritzelEditor = class {
|
|
|
3130
3153
|
const isLoggedIn = this.isLoggedIn;
|
|
3131
3154
|
const shouldShowCurrentUser = isLoggedIn;
|
|
3132
3155
|
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
3133
|
-
return (h(Host, { key: '
|
|
3156
|
+
return (h(Host, { key: 'ab06876e3a07e97c3788113ffd0483bbb2819d5b' }, h("div", { key: 'e393eacfad2b224a720e5a97b047af8dd3ce97a5', class: "editor-content", style: {
|
|
3134
3157
|
opacity: this.isEditorVisible ? '1' : '0',
|
|
3135
3158
|
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
3136
3159
|
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
3137
|
-
} }, h("div", { key: '
|
|
3160
|
+
} }, h("div", { key: 'd9dcbd6859bea28d75c7f8b0cc26ea3ba58b2433', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: '945953a6c95520316c4e0f35503a824414bd3c7a', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '8b345bf6ce0ec33ca35f1f630af2050b95bc6b74', visible: this.isBackToContentButtonVisible, text: this.resolvedTerms['backToContent.label'] ?? 'Back to content', onBackToContent: () => this.backToContent() })), this.activeNotification && (h("div", { key: '1b965de38a7f1f40d5d91431801e873289416924', class: "top-center-notification-layer", role: "presentation" }, h("div", { key: 'f165dc7acc5e1bc7923fec217ebc16fe4a3f2ece', class: { 'top-center-notification-container': true, 'is-dismissing': this.isNotificationDismissing }, role: "presentation" }, h("kritzel-notification-card", { key: 'c5cf7edc1f921e35310c89449f5a043dda171a04', notification: this.activeNotification, locale: this.locale, onDismiss: this.dismissNotification, onHoverChange: event => this.handleNotificationHoverChange(event) })))), this.contextMenuState && this.contextMenuState.items.length > 0 && (h("kritzel-context-menu", { key: 'fc3417276f0034e7fc7e8360d3f3ce57106146b2', class: "context-menu", items: this.contextMenuState.items, objects: this.contextMenuState.objects, style: {
|
|
3161
|
+
position: 'absolute',
|
|
3162
|
+
left: `${this.contextMenuState.position.x}px`,
|
|
3163
|
+
top: `${this.contextMenuState.position.y}px`,
|
|
3164
|
+
zIndex: '10002',
|
|
3165
|
+
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-engine", { key: '0c9df0386d38a87f50d324cfc51307a1cb947a58', ref: el => {
|
|
3138
3166
|
if (el) {
|
|
3139
3167
|
this.engineRef = el;
|
|
3140
3168
|
}
|
|
3141
|
-
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, 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), onNotificationsChange: event => this.handleNotificationsChange(event) }), h("kritzel-controls", { key: '
|
|
3169
|
+
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, 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), onNotificationsChange: event => this.handleNotificationsChange(event), onContextMenuStateChange: event => this.handleContextMenuStateChange(event) }), h("kritzel-controls", { key: '46d8e9c45c7bed24fc02d17c8fef836d596088d7', visible: this.isControlsVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
|
|
3142
3170
|
if (el) {
|
|
3143
3171
|
this.controlsRef = el;
|
|
3144
3172
|
}
|
|
3145
|
-
}, controls: this.normalizedControls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: '
|
|
3173
|
+
}, controls: this.normalizedControls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: 'e3ef94509a82fe435f827b66cf1813969b7dec66', class: "bottom-left-buttons" }, h("kritzel-zoom-panel", { key: '4e6cbdf85f550e6e3037dce3b910c0582ea0320b', visible: this.isZoomPanelVisible, disabled: !this.isZoomingEnabled, zoomPercent: this.currentZoomPercent, terms: this.resolvedTerms, onZoomIn: () => this.zoomIn(), onZoomOut: () => this.zoomOut() })), h("div", { key: 'a62df7f8a68cbed728b701894a5284c2bff39e1e', class: "top-right-buttons" }, h("kritzel-settings", { key: '0b6daf9ff43551df9f86431d398a32913a845925', ref: el => {
|
|
3146
3174
|
if (el) {
|
|
3147
3175
|
this.settingsRef = el;
|
|
3148
3176
|
}
|
|
3149
|
-
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], availableLocales: this.availableLocaleOptions, settings: this.currentSettingsConfig, terms: this.resolvedTerms, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '
|
|
3177
|
+
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], availableLocales: this.availableLocaleOptions, settings: this.currentSettingsConfig, terms: this.resolvedTerms, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '29d02ffd3358fe91d27435cc3fdd5f8ac2ad7cf5', ref: el => {
|
|
3150
3178
|
if (el) {
|
|
3151
3179
|
this.exportRef = el;
|
|
3152
3180
|
}
|
|
3153
|
-
}, workspaceName: this.activeWorkspace?.name || 'workspace', terms: this.resolvedTerms, onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '
|
|
3181
|
+
}, workspaceName: this.activeWorkspace?.name || 'workspace', terms: this.resolvedTerms, onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '729ca599e46654bc1429b5d91ff73f26d9b6e7bb', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: '84c07268072418a82cf504f16803c59a1e37c0ae', user: this.user, terms: this.resolvedTerms, onClick: () => this.currentUserDialogRef?.open() }), shouldShowCurrentUser && (h("kritzel-current-user-dialog", { key: '55189e3da7899628b252e7995b20bc422fce2d5c', ref: el => {
|
|
3154
3182
|
if (el) {
|
|
3155
3183
|
this.currentUserDialogRef = el;
|
|
3156
3184
|
this.currentUserDialogRef.addEventListener('logoutRequest', this.handleCurrentUserLogout);
|
|
3157
3185
|
}
|
|
3158
|
-
}, user: this.user, terms: this.resolvedTerms })), shouldShowLoginButton && (h("kritzel-button", { key: '
|
|
3186
|
+
}, user: this.user, terms: this.resolvedTerms })), shouldShowLoginButton && (h("kritzel-button", { key: 'a55d85769bad635fcc7934f584bf1bf74c1e7ea6', onButtonClick: () => this.loginDialogRef?.open() }, this.resolvedTerms['login.dialogTitle'] ?? 'Sign in')), h("kritzel-more-menu", { key: '67dd879ec3c55c98e32f6112ca53d925f47b56b4', items: this.moreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '5f13130099110eb472022099219e15877ceceb57', ref: el => {
|
|
3159
3187
|
if (el) {
|
|
3160
3188
|
this.shareDialogRef = el;
|
|
3161
3189
|
}
|
|
3162
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '
|
|
3190
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: 'cda0fcdcad75de8730ce10bda425cc0fbe01429a', ref: el => {
|
|
3163
3191
|
if (el) {
|
|
3164
3192
|
this.loginDialogRef = el;
|
|
3165
3193
|
}
|
|
@@ -21107,6 +21135,18 @@ class KritzelViewport {
|
|
|
21107
21135
|
animateViewportTo(targetTranslateX, targetTranslateY, targetScale, duration = 150) {
|
|
21108
21136
|
// Cancel any existing animation
|
|
21109
21137
|
this.cancelViewportAnimation();
|
|
21138
|
+
if (duration <= 0) {
|
|
21139
|
+
// Apply immediately; interpolating with duration 0 divides by zero
|
|
21140
|
+
// (rAF timestamps can precede performance.now()), producing NaN state.
|
|
21141
|
+
this._core.store.state.scale = targetScale;
|
|
21142
|
+
const clamped = this.clampTranslate(targetTranslateX, targetTranslateY);
|
|
21143
|
+
this._core.store.state.translateX = clamped.translateX;
|
|
21144
|
+
this._core.store.state.translateY = clamped.translateY;
|
|
21145
|
+
this._core.store.state.hasViewportChanged = true;
|
|
21146
|
+
this._core.rerender();
|
|
21147
|
+
this._debounceUpdate();
|
|
21148
|
+
return;
|
|
21149
|
+
}
|
|
21110
21150
|
const startTranslateX = this._core.store.state.translateX;
|
|
21111
21151
|
const startTranslateY = this._core.store.state.translateY;
|
|
21112
21152
|
const startScale = this._core.store.state.scale;
|
|
@@ -21114,7 +21154,8 @@ class KritzelViewport {
|
|
|
21114
21154
|
this._core.store.state.isScaling = true;
|
|
21115
21155
|
const animate = (currentTime) => {
|
|
21116
21156
|
const elapsed = currentTime - startTime;
|
|
21117
|
-
|
|
21157
|
+
// Clamp to [0, 1]; rAF timestamps can precede startTime, yielding negative progress
|
|
21158
|
+
const progress = Math.min(Math.max(elapsed, 0) / duration, 1);
|
|
21118
21159
|
// easeOutCubic easing function
|
|
21119
21160
|
const eased = 1 - Math.pow(1 - progress, 3);
|
|
21120
21161
|
this._core.store.state.scale = startScale + (targetScale - startScale) * eased;
|
|
@@ -25598,13 +25639,13 @@ class KritzelCore {
|
|
|
25598
25639
|
}
|
|
25599
25640
|
/**
|
|
25600
25641
|
* Selects all objects in the workspace.
|
|
25601
|
-
* Excludes selection-related
|
|
25642
|
+
* Excludes selection-related objects.
|
|
25602
25643
|
* Switches to selection tool.
|
|
25603
25644
|
*/
|
|
25604
25645
|
selectAllObjects() {
|
|
25605
25646
|
const allObjects = this._store.objects
|
|
25606
25647
|
.allObjects()
|
|
25607
|
-
.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KritzelSelectionBox)
|
|
25648
|
+
.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KritzelSelectionBox));
|
|
25608
25649
|
if (allObjects.length > 0) {
|
|
25609
25650
|
const selectionGroup = KritzelSelectionGroup.create(this);
|
|
25610
25651
|
allObjects.forEach(obj => {
|
|
@@ -25623,7 +25664,7 @@ class KritzelCore {
|
|
|
25623
25664
|
}
|
|
25624
25665
|
/**
|
|
25625
25666
|
* Selects all objects currently visible in the viewport.
|
|
25626
|
-
* Excludes selection-related
|
|
25667
|
+
* Excludes selection-related objects.
|
|
25627
25668
|
* Switches to selection tool.
|
|
25628
25669
|
*/
|
|
25629
25670
|
selectAllObjectsInViewport() {
|
|
@@ -25638,7 +25679,7 @@ class KritzelCore {
|
|
|
25638
25679
|
const objectsInViewport = this._store.objects
|
|
25639
25680
|
.query(viewportBounds)
|
|
25640
25681
|
.filter(o => o.isInViewport())
|
|
25641
|
-
.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KritzelSelectionBox)
|
|
25682
|
+
.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KritzelSelectionBox));
|
|
25642
25683
|
if (objectsInViewport.length > 0) {
|
|
25643
25684
|
const selectionGroup = KritzelSelectionGroup.create(this);
|
|
25644
25685
|
objectsInViewport.forEach(obj => {
|
|
@@ -27739,6 +27780,8 @@ const KritzelEngine = class {
|
|
|
27739
27780
|
awarenessChange;
|
|
27740
27781
|
/** Emitted when notifications change. */
|
|
27741
27782
|
notificationsChange;
|
|
27783
|
+
/** Emitted when context-menu visibility, items, or position changes. */
|
|
27784
|
+
contextMenuStateChange;
|
|
27742
27785
|
/** Emitted when the combined loading state (external `isLoading` prop or internal workspace loading) changes. */
|
|
27743
27786
|
loadingChange;
|
|
27744
27787
|
/** Emitted when remote workspace synchronization is in progress. */
|
|
@@ -27749,6 +27792,31 @@ const KritzelEngine = class {
|
|
|
27749
27792
|
async triggerSelectionChange() {
|
|
27750
27793
|
this.objectsSelectionChange.emit();
|
|
27751
27794
|
}
|
|
27795
|
+
/** Starts a scene bootstrap phase by hiding the scene immediately. */
|
|
27796
|
+
async beginSceneBootstrap() {
|
|
27797
|
+
if (this._sceneBootstrapTransitionTimer !== null) {
|
|
27798
|
+
clearTimeout(this._sceneBootstrapTransitionTimer);
|
|
27799
|
+
this._sceneBootstrapTransitionTimer = null;
|
|
27800
|
+
}
|
|
27801
|
+
this._sceneBootstrapTransitionEnabled = false;
|
|
27802
|
+
this._sceneBootstrapOpacity = 0;
|
|
27803
|
+
this.core.rerender();
|
|
27804
|
+
}
|
|
27805
|
+
/** Ends a scene bootstrap phase by fading the scene back in. */
|
|
27806
|
+
async endSceneBootstrap() {
|
|
27807
|
+
if (this._sceneBootstrapTransitionTimer !== null) {
|
|
27808
|
+
clearTimeout(this._sceneBootstrapTransitionTimer);
|
|
27809
|
+
this._sceneBootstrapTransitionTimer = null;
|
|
27810
|
+
}
|
|
27811
|
+
this._sceneBootstrapTransitionEnabled = true;
|
|
27812
|
+
this._sceneBootstrapOpacity = 1;
|
|
27813
|
+
this.core.rerender();
|
|
27814
|
+
this._sceneBootstrapTransitionTimer = setTimeout(() => {
|
|
27815
|
+
this._sceneBootstrapTransitionEnabled = false;
|
|
27816
|
+
this._sceneBootstrapTransitionTimer = null;
|
|
27817
|
+
this.core.rerender();
|
|
27818
|
+
}, 220);
|
|
27819
|
+
}
|
|
27752
27820
|
handleWheel(ev) {
|
|
27753
27821
|
if (this.core.store.isDisabled) {
|
|
27754
27822
|
return;
|
|
@@ -27906,6 +27974,7 @@ const KritzelEngine = class {
|
|
|
27906
27974
|
}
|
|
27907
27975
|
handleLongPress(ev) {
|
|
27908
27976
|
this.contextMenuHandler.handleContextMenu(ev.detail);
|
|
27977
|
+
this.emitContextMenuStateChange();
|
|
27909
27978
|
}
|
|
27910
27979
|
handleContextMenu(ev) {
|
|
27911
27980
|
if (ev.cancelable) {
|
|
@@ -27918,6 +27987,7 @@ const KritzelEngine = class {
|
|
|
27918
27987
|
return;
|
|
27919
27988
|
}
|
|
27920
27989
|
this.contextMenuHandler.handleContextMenu(ev);
|
|
27990
|
+
this.emitContextMenuStateChange();
|
|
27921
27991
|
}
|
|
27922
27992
|
handleResize() {
|
|
27923
27993
|
this.viewport.handleResize();
|
|
@@ -28159,6 +28229,7 @@ const KritzelEngine = class {
|
|
|
28159
28229
|
this.core.store.objects?.clearLocalSelectionBox();
|
|
28160
28230
|
this.core.store.state.isSelecting = false;
|
|
28161
28231
|
this.core.store.state.isEnabled = true;
|
|
28232
|
+
this.emitContextMenuStateChange();
|
|
28162
28233
|
this.core.rerender();
|
|
28163
28234
|
}
|
|
28164
28235
|
/**
|
|
@@ -28172,6 +28243,7 @@ const KritzelEngine = class {
|
|
|
28172
28243
|
*/
|
|
28173
28244
|
async openContextMenu(options) {
|
|
28174
28245
|
this.contextMenuHandler.open(options);
|
|
28246
|
+
this.emitContextMenuStateChange();
|
|
28175
28247
|
}
|
|
28176
28248
|
/**
|
|
28177
28249
|
* Retrieves a canvas object by its unique ID.
|
|
@@ -28924,14 +28996,26 @@ const KritzelEngine = class {
|
|
|
28924
28996
|
// Revive and add objects to the current workspace
|
|
28925
28997
|
if (data.objects && Array.isArray(data.objects)) {
|
|
28926
28998
|
const reviver = new KritzelReviver(this.core);
|
|
28927
|
-
|
|
28928
|
-
|
|
28929
|
-
|
|
28999
|
+
const objectsMap = this.core.store.objects;
|
|
29000
|
+
const insertRevivedObjects = () => {
|
|
29001
|
+
for (const objData of data.objects) {
|
|
29002
|
+
const revivedObj = reviver.revive(objData);
|
|
29003
|
+
if (!revivedObj) {
|
|
29004
|
+
continue;
|
|
29005
|
+
}
|
|
28930
29006
|
// Update workspaceId to the current workspace's ID
|
|
28931
29007
|
revivedObj.workspaceId = currentWorkspaceId;
|
|
28932
29008
|
this.core.addObject(revivedObj);
|
|
28933
29009
|
loadedCount++;
|
|
28934
29010
|
}
|
|
29011
|
+
};
|
|
29012
|
+
if (objectsMap) {
|
|
29013
|
+
objectsMap.transaction(() => {
|
|
29014
|
+
insertRevivedObjects();
|
|
29015
|
+
});
|
|
29016
|
+
}
|
|
29017
|
+
else {
|
|
29018
|
+
insertRevivedObjects();
|
|
28935
29019
|
}
|
|
28936
29020
|
}
|
|
28937
29021
|
// Rerender to apply changes
|
|
@@ -29277,7 +29361,6 @@ const KritzelEngine = class {
|
|
|
29277
29361
|
viewport;
|
|
29278
29362
|
contextMenuHandler;
|
|
29279
29363
|
keyHandler;
|
|
29280
|
-
contextMenuElement = null;
|
|
29281
29364
|
_lastHadSelectionGroup = false;
|
|
29282
29365
|
_isViewportReady = false;
|
|
29283
29366
|
_isYjsInitialized = false;
|
|
@@ -29293,6 +29376,9 @@ const KritzelEngine = class {
|
|
|
29293
29376
|
_hasLoggedUnlicensedWelcomeBanner = false;
|
|
29294
29377
|
_previousVisibleCustomElements = new Set();
|
|
29295
29378
|
_revealedImageKeys = new Set();
|
|
29379
|
+
_sceneBootstrapOpacity = 1;
|
|
29380
|
+
_sceneBootstrapTransitionEnabled = false;
|
|
29381
|
+
_sceneBootstrapTransitionTimer = null;
|
|
29296
29382
|
_defaultUndoState = {
|
|
29297
29383
|
canUndo: false,
|
|
29298
29384
|
canRedo: false,
|
|
@@ -29313,6 +29399,22 @@ const KritzelEngine = class {
|
|
|
29313
29399
|
this.isSyncing = isSyncing;
|
|
29314
29400
|
this.syncingChange.emit(isSyncing);
|
|
29315
29401
|
}
|
|
29402
|
+
emitContextMenuStateChange() {
|
|
29403
|
+
this.contextMenuStateChange.emit({
|
|
29404
|
+
isVisible: this.core.store.state.isContextMenuVisible,
|
|
29405
|
+
isObjectMenu: !!this.core.store.selectionGroup,
|
|
29406
|
+
items: this.core.store.state.contextMenuItems,
|
|
29407
|
+
objects: this.core.store.selectionGroup?.objects || [],
|
|
29408
|
+
position: {
|
|
29409
|
+
x: this.core.store.state.contextMenuX,
|
|
29410
|
+
y: this.core.store.state.contextMenuY,
|
|
29411
|
+
},
|
|
29412
|
+
worldPosition: {
|
|
29413
|
+
x: this.core.store.state.contextMenuWorldX,
|
|
29414
|
+
y: this.core.store.state.contextMenuWorldY,
|
|
29415
|
+
},
|
|
29416
|
+
});
|
|
29417
|
+
}
|
|
29316
29418
|
applyToolConfig(tool, toolConfig) {
|
|
29317
29419
|
const normalizedToolConfig = this.normalizeToolConfig(toolConfig);
|
|
29318
29420
|
Object.entries(normalizedToolConfig).forEach(([key, value]) => {
|
|
@@ -29397,6 +29499,7 @@ const KritzelEngine = class {
|
|
|
29397
29499
|
this.viewportChange = createEvent(this, "viewportChange");
|
|
29398
29500
|
this.awarenessChange = createEvent(this, "awarenessChange");
|
|
29399
29501
|
this.notificationsChange = createEvent(this, "notificationsChange");
|
|
29502
|
+
this.contextMenuStateChange = createEvent(this, "contextMenuStateChange");
|
|
29400
29503
|
this.loadingChange = createEvent(this, "loadingChange");
|
|
29401
29504
|
this.syncingChange = createEvent(this, "syncingChange");
|
|
29402
29505
|
this.core = new KritzelCore(this);
|
|
@@ -29404,6 +29507,10 @@ const KritzelEngine = class {
|
|
|
29404
29507
|
disconnectedCallback() {
|
|
29405
29508
|
this.throttledPointerMoveMulti.cancel();
|
|
29406
29509
|
this._revealedImageKeys.clear();
|
|
29510
|
+
if (this._sceneBootstrapTransitionTimer !== null) {
|
|
29511
|
+
clearTimeout(this._sceneBootstrapTransitionTimer);
|
|
29512
|
+
this._sceneBootstrapTransitionTimer = null;
|
|
29513
|
+
}
|
|
29407
29514
|
// Unmount all remaining custom elements
|
|
29408
29515
|
if (this.core.store.allObjects) {
|
|
29409
29516
|
this.core.store.allObjects.forEach(object => {
|
|
@@ -29447,6 +29554,10 @@ const KritzelEngine = class {
|
|
|
29447
29554
|
this.core.store.state.viewportBoundaryRight = this.viewportBoundaryRight;
|
|
29448
29555
|
this.core.store.state.viewportBoundaryTop = this.viewportBoundaryTop;
|
|
29449
29556
|
this.core.store.state.viewportBoundaryBottom = this.viewportBoundaryBottom;
|
|
29557
|
+
if (this.debugInfo) {
|
|
29558
|
+
this.core.store.state.debugInfo = this.debugInfo;
|
|
29559
|
+
this.core.assetResolver.setShowInfo(this.debugInfo.showAssetResolverInfo);
|
|
29560
|
+
}
|
|
29450
29561
|
this._isWorkspaceLoading = true;
|
|
29451
29562
|
this.syncLoadingState();
|
|
29452
29563
|
}
|
|
@@ -29852,6 +29963,9 @@ const KritzelEngine = class {
|
|
|
29852
29963
|
}
|
|
29853
29964
|
return (h(Host, null, h("kritzel-loading-overlay", { visible: this.core.store.state.isLoading, text: this.core.localizationManager.translate('engine.loading') }), h("kritzel-sync-indicator", { visible: this.isSyncing, text: "Syncing..." }), this.core.store.state.debugInfo.showViewportInfo && (h("div", { class: "debug-panel" }, h("div", null, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), h("div", null, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), h("div", null, "TranslateX: ", this.core.store.state?.translateX), h("div", null, "TranslateY: ", this.core.store.state?.translateY), h("div", null, "ViewportWidth: ", this.core.store.state?.viewportWidth), h("div", null, "ViewportHeight: ", this.core.store.state?.viewportHeight), h("div", null, "PointerCount: ", this.core.store.state.pointers.size), h("div", null, "Scale: ", this.core.store.state?.scale), h("div", null, "ActiveTool: ", this.core.store.state?.activeTool?.name), h("div", null, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), h("div", null, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), h("div", null, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), h("div", null, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), h("div", null, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", null, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", null, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", null, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", null, "IsRotationHandleHovered: ", this.core.store.state.isRotationHandleHovered ? 'true' : 'false'), h("div", null, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), h("div", null, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), h("div", null, "IsPointerDown: ", this.core.store.isPointerDown ? 'true' : 'false'), h("div", null, "PointerX: ", this.core.store.state?.pointerX), h("div", null, "PointerY: ", this.core.store.state?.pointerY), h("div", null, "TotalObjects: ", this.core.store.totalObjectCount), h("div", null, "ObjectsInViewport: ", this.core.store.objectsInViewport.length), h("div", null, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), h("div", null, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), h("div", { id: "origin", class: "origin", style: {
|
|
29854
29965
|
transform: `matrix(${this.core.store.state?.scale}, 0, 0, ${this.core.store.state?.scale}, ${this.core.store.state?.translateX}, ${this.core.store.state?.translateY})`,
|
|
29966
|
+
opacity: this._sceneBootstrapOpacity.toString(),
|
|
29967
|
+
transition: this._sceneBootstrapTransitionEnabled ? 'opacity 220ms ease-out' : 'none',
|
|
29968
|
+
willChange: this._sceneBootstrapTransitionEnabled ? 'opacity' : undefined,
|
|
29855
29969
|
} }, visibleObjects?.map(object => {
|
|
29856
29970
|
const { multiplied: effectiveOpacity, overridden: effectiveOpacityString } = this.getObjectEffectiveOpacity(object, viewportScale);
|
|
29857
29971
|
return (h("div", { key: object.id, id: object.id, class: "object", style: {
|
|
@@ -30278,20 +30392,7 @@ const KritzelEngine = class {
|
|
|
30278
30392
|
stroke: 'var(--kritzel-snap-indicator-stroke, #007bff)',
|
|
30279
30393
|
strokeWidth: data.indicatorStrokeWidth,
|
|
30280
30394
|
} })))));
|
|
30281
|
-
})()), this.core.store.
|
|
30282
|
-
position: 'absolute',
|
|
30283
|
-
left: `${this.core.store.state.contextMenuX}px`,
|
|
30284
|
-
top: `${this.core.store.state.contextMenuY}px`,
|
|
30285
|
-
zIndex: '10002',
|
|
30286
|
-
}, onActionSelected: event => {
|
|
30287
|
-
if (event.detail.action) {
|
|
30288
|
-
event.detail.action({
|
|
30289
|
-
x: this.core.store.state.contextMenuWorldX,
|
|
30290
|
-
y: this.core.store.state.contextMenuWorldY,
|
|
30291
|
-
}, this.core.store.selectionGroup?.objects || []);
|
|
30292
|
-
}
|
|
30293
|
-
this.hideContextMenu();
|
|
30294
|
-
}, onClose: () => this.hideContextMenu() })), this.core.store.objects?.hasAwareness && h("kritzel-awareness-cursors", { core: this.core }), this.core.store.state?.activeTool?.toolType === 'eraser' && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { core: this.core }), !this.core.licenseManager.isLicensed && h("kritzel-watermark", { core: this.core, label: this.core.localizationManager.translate('watermark.poweredBy') })));
|
|
30395
|
+
})()), this.core.store.objects?.hasAwareness && h("kritzel-awareness-cursors", { core: this.core }), this.core.store.state?.activeTool?.toolType === 'eraser' && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { core: this.core }), !this.core.licenseManager.isLicensed && h("kritzel-watermark", { core: this.core, label: this.core.localizationManager.translate('watermark.poweredBy') })));
|
|
30295
30396
|
}
|
|
30296
30397
|
static get watchers() { return {
|
|
30297
30398
|
"workspace": [{
|
|
@@ -30448,7 +30549,7 @@ const KritzelExport = class {
|
|
|
30448
30549
|
return (h("div", { class: "export-tab-content" }, h("kritzel-input", { label: this.terms['export.filename.label'] ?? 'Filename', value: this.exportFilename, placeholder: this.terms['export.filename.placeholder'] ?? 'Enter filename', suffix: ".json", onValueChange: this.handleFilenameChange })));
|
|
30449
30550
|
}
|
|
30450
30551
|
render() {
|
|
30451
|
-
return (h(Host, { key: '
|
|
30552
|
+
return (h(Host, { key: '0bc45e80716be4a7b19ae12a6464a641b5bd4550' }, h("kritzel-dialog", { key: 'f336f8b1e4ae10954d48ca67da88504faf06b295', isOpen: this.isDialogOpen, dialogTitle: this.terms['export.dialogTitle'] ?? 'Export', closable: true, contained: true, onDialogClose: this.closeDialog }, h("div", { key: 'e2d1209652bb54fb7f623e50bc4bbbb703083b76', class: "export-content" }, h("kritzel-pill-tabs", { key: 'dd78430b78d1e8c4ac0a76e8a6a5d48bebf5e889', tabs: this.tabs, value: this.activeTab, onValueChange: this.handleTabChange }), this.activeTab === 'viewport' && this.renderViewportExport(), this.activeTab === 'workspace' && this.renderWorkspaceExport(), h("button", { key: 'e06564889d991afc7a4ac43bb1e5504e98c94c52', class: "export-primary-button", onClick: this.handleExport }, this.terms['export.exportButton'] ?? 'Export')))));
|
|
30452
30553
|
}
|
|
30453
30554
|
};
|
|
30454
30555
|
KritzelExport.style = kritzelExportCss();
|
|
@@ -30463,7 +30564,7 @@ const KritzelFont = class {
|
|
|
30463
30564
|
size = 24;
|
|
30464
30565
|
color = '#000000';
|
|
30465
30566
|
render() {
|
|
30466
|
-
return (h(Host, { key: '
|
|
30567
|
+
return (h(Host, { key: '054371cac30a2433611139a670406b0a1e3b99ff' }, h("div", { key: 'b4f2142b3cb31d067f39952a38b6f665f28f63bf', class: "font-preview", style: {
|
|
30467
30568
|
fontFamily: this.fontFamily,
|
|
30468
30569
|
fontSize: `${this.size}px`,
|
|
30469
30570
|
color: this.color
|
|
@@ -30547,7 +30648,7 @@ const KritzelFontSize = class {
|
|
|
30547
30648
|
render() {
|
|
30548
30649
|
const color = 'var(--kritzel-global-text-primary)';
|
|
30549
30650
|
const sizes = this.sizes ?? [];
|
|
30550
|
-
return (h(Host, { key: '
|
|
30651
|
+
return (h(Host, { key: '56eb19367abe312bac3b626cfcae3b1ff6e90d21' }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
30551
30652
|
'size-container': true,
|
|
30552
30653
|
'selected': this.selectedSize === size,
|
|
30553
30654
|
}, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
|
|
@@ -30614,7 +30715,7 @@ const KritzelInput = class {
|
|
|
30614
30715
|
this.valueChange.emit(input.value);
|
|
30615
30716
|
};
|
|
30616
30717
|
render() {
|
|
30617
|
-
return (h(Host, { key: '
|
|
30718
|
+
return (h(Host, { key: '46a0a48902a06ad85edcbaad3679ce3fe9ba850c' }, h("div", { key: 'a6beaf920614aa959d2fbd68b7268afba8637358', class: "input-container" }, this.label && h("label", { key: 'ca6d3fb3c22f1540795dbb0695ddd9b87cc05eee', class: "input-label" }, this.label), h("div", { key: '78d116e82531a9cca996d594792245449bcaf9c8', class: { 'input-wrapper': true, 'has-suffix': !!this.suffix } }, h("input", { key: '0d10d6356dea3a11338172bbe8c3c878eefcc708', type: this.type, class: "text-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput }), this.suffix && h("span", { key: '0e6166ba8728efc1035302d7fb048306efbe5a68', class: "input-suffix" }, this.suffix)))));
|
|
30618
30719
|
}
|
|
30619
30720
|
static get watchers() { return {
|
|
30620
30721
|
"value": [{
|
|
@@ -30722,7 +30823,7 @@ const KritzelLoadingOverlay = class {
|
|
|
30722
30823
|
*/
|
|
30723
30824
|
text = 'Loading...';
|
|
30724
30825
|
render() {
|
|
30725
|
-
return (h(Host, { key: '
|
|
30826
|
+
return (h(Host, { key: '331e4c9eb30e6f7b98023c23218b3caf5093c34b' }, h("div", { key: 'f994fec0db325a2bd687e5acc68263752e7a6acd', class: { 'loading-overlay': true, visible: this.visible }, "aria-hidden": this.visible ? 'false' : 'true' }, h("span", { key: 'b6087dc1e59845ab95946e654c7bb8e568b42dda', class: "loading-spinner" }), this.text)));
|
|
30726
30827
|
}
|
|
30727
30828
|
};
|
|
30728
30829
|
KritzelLoadingOverlay.style = kritzelLoadingOverlayCss();
|
|
@@ -30774,7 +30875,7 @@ const KritzelLoginDialog = class {
|
|
|
30774
30875
|
this.dialogClosed.emit();
|
|
30775
30876
|
};
|
|
30776
30877
|
render() {
|
|
30777
|
-
return (h(Host, { key: '
|
|
30878
|
+
return (h(Host, { key: 'bcd7f30bbfeb07bbca732c5f1034bcabbd5e4f80' }, h("kritzel-dialog", { key: '61b5c5054d43433894747f37c571e68ecf08fc4c', dialogTitle: this.dialogTitle, isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: '3ddcb858b6148e8be4bd121b2bd8ca38c66e0505', class: "login-content" }, this.subtitle && (h("p", { key: '6f10f890af9f6025a3aa2d69f8f4d916821fd653', class: "login-subtitle" }, this.subtitle)), h("div", { key: '0d043ac1ac751dc3d0a561bc16e52a2cfaffc578', class: "login-providers" }, this.providers.map(provider => (h("button", { key: provider.name, class: {
|
|
30778
30879
|
'provider-button': true,
|
|
30779
30880
|
'is-loading': this.loadingProvider === provider.name,
|
|
30780
30881
|
'is-disabled': this.loadingProvider !== null && this.loadingProvider !== provider.name,
|
|
@@ -30880,15 +30981,15 @@ const KritzelMasterDetail = class {
|
|
|
30880
30981
|
const selectedItem = this.items.find(item => item.id === this.selectedItemId);
|
|
30881
30982
|
const panelId = 'master-detail-panel';
|
|
30882
30983
|
const selectedTabId = selectedItem ? `tab-${selectedItem.id}` : undefined;
|
|
30883
|
-
return (h(Host, { key: '
|
|
30984
|
+
return (h(Host, { key: '0edf50b0b853633b88bf481f97f22aceba9e163e' }, h("div", { key: '21a0a3f81e5a60889ccd152c905cb41f52c3e037', class: {
|
|
30884
30985
|
'master-detail-container': true,
|
|
30885
30986
|
'is-mobile-detail-visible': this.showMobileDetail,
|
|
30886
|
-
} }, h("nav", { key: '
|
|
30987
|
+
} }, h("nav", { key: '41f88248cc372c8cae4cb50a19edf462a01e43f2', class: "master-menu", role: "tablist", "aria-orientation": "vertical", "aria-label": "Settings categories" }, this.items.map((item, index) => (h("button", { key: item.id, id: `tab-${item.id}`, ref: el => this.setTabRef(el, index), class: {
|
|
30887
30988
|
'menu-item': true,
|
|
30888
30989
|
'is-selected': item.id === this.selectedItemId,
|
|
30889
30990
|
'is-disabled': !!item.disabled,
|
|
30890
30991
|
'is-focused': index === this.focusedIndex,
|
|
30891
|
-
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: '
|
|
30992
|
+
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: 'f8447facf3dfdbd7772823654847e1b90b03f73e', id: panelId, class: "detail-panel", role: "tabpanel", "aria-labelledby": selectedTabId }, h("button", { key: '3edc9784267613e6b3a706739bbb537161e4c747', class: "mobile-back-button", onClick: this.handleBackClick, "aria-label": "Back to menu" }, h("kritzel-icon", { key: 'ec0b4691735578525e5863842271366e04b13fb7', name: "chevron-left", size: 20, class: "mobile-back-icon" }), "Back"), h("slot", { key: 'c21fbaff78f98859b9756427125b60504d4bb630' })))));
|
|
30892
30993
|
}
|
|
30893
30994
|
static get watchers() { return {
|
|
30894
30995
|
"selectedItemId": [{
|
|
@@ -30961,7 +31062,7 @@ const KritzelMenu = class {
|
|
|
30961
31062
|
this.itemCloseChildMenu.emit(event.detail);
|
|
30962
31063
|
};
|
|
30963
31064
|
render() {
|
|
30964
|
-
return (h(Host, { key: '
|
|
31065
|
+
return (h(Host, { key: '27a90a3a8549517a2d6e341a5da13496bf714970', tabIndex: 0, onClick: e => e.stopPropagation() }, this.openChildMenuItem && h("div", { key: 'c0c2351fac389f6676b38481eaacee553ca6867a', class: "has-open-child-overlay", onClick: this.onOverlayClick }), this.items.map(item => (h("kritzel-menu-item", { key: item.id, "data-testid": `menu-item-${item.id}`, item: item, parent: this.parent, style: { pointerEvents: this.editingMenuItem && !item.isEditing ? 'none' : 'auto' }, onItemSelect: this.handleItemSelect, onItemSave: this.handleSave, onItemCancel: this.handleCancel, onItemToggleChildMenu: this.handleToggleChildMenu, onItemCloseChildMenu: this.handleCloseChildMenu })))));
|
|
30965
31066
|
}
|
|
30966
31067
|
};
|
|
30967
31068
|
KritzelMenu.style = kritzelMenuCss();
|
|
@@ -31066,12 +31167,12 @@ const KritzelMenuItem = class {
|
|
|
31066
31167
|
];
|
|
31067
31168
|
}
|
|
31068
31169
|
render() {
|
|
31069
|
-
return (h(Host, { key: '
|
|
31170
|
+
return (h(Host, { key: '9d6653a630da5a3da38291d89d6d7d59d6994e02', tabIndex: this.item.isDisabled ? -1 : 0, class: {
|
|
31070
31171
|
'selected': this.item.isSelected,
|
|
31071
31172
|
'editing': this.item.isEditing,
|
|
31072
31173
|
'disabled': this.item.isDisabled,
|
|
31073
31174
|
'child-open': this.item.isChildMenuOpen,
|
|
31074
|
-
}, onClick: this.handleItemSelect }, h("div", { key: '
|
|
31175
|
+
}, onClick: this.handleItemSelect }, h("div", { key: '48a1678296e672c6c03fb3e1473c42d3a246d481', class: "menu-item-overlay" }), this.item.isEditing ? this.renderEditMode() : this.renderViewMode()));
|
|
31075
31176
|
}
|
|
31076
31177
|
static get watchers() { return {
|
|
31077
31178
|
"item": [{
|
|
@@ -31144,7 +31245,7 @@ const KritzelMoreMenu = class {
|
|
|
31144
31245
|
this.closeMenu();
|
|
31145
31246
|
};
|
|
31146
31247
|
render() {
|
|
31147
|
-
return (h(Host, { key: '
|
|
31248
|
+
return (h(Host, { key: '96451062021ac2ebcb44b65384a7e9be67f1563b', class: { mobile: this.isTouchDevice }, style: { display: this.visible ? '' : 'none' } }, h("div", { key: 'e776398742284ea6984925d4a5a99e732674d640', class: { 'more-menu-wrapper': true, visible: this.visible } }, h("button", { key: '4371b2e5cbf7d35fac09a06ee2e54cd49072929b', class: "more-menu-button", "data-testid": "more-menu-button", onClick: this.toggleMenu, "aria-label": this.terms['moreMenu.ariaLabel'] ?? 'More options' }, h("kritzel-icon", { key: '076513ce393222b6f604036ec646a8309bc3a3ac', name: this.icon, size: this.iconSize })), h("kritzel-portal", { key: 'fde8071b3199735cc7827a2d6f2eaf79d0e1b997', anchor: this.menuAnchor, offsetY: this.offsetY, onClose: this.closeMenu }, h("kritzel-menu", { key: '2d49ad8a228c4b55a34c388b794bfdf500fec3c8', items: this.visibleItems, onItemSelect: this.handleMenuItemSelect })))));
|
|
31148
31249
|
}
|
|
31149
31250
|
};
|
|
31150
31251
|
KritzelMoreMenu.style = kritzelMoreMenuCss();
|
|
@@ -31311,7 +31412,7 @@ const KritzelNumericInput = class {
|
|
|
31311
31412
|
this.valueChange.emit(newValue);
|
|
31312
31413
|
};
|
|
31313
31414
|
render() {
|
|
31314
|
-
return (h(Host, { key: '
|
|
31415
|
+
return (h(Host, { key: '8901e0b56ccbc344420483a4a56663f7cd74d9e8' }, h("div", { key: '5f3d6b5c56007e11383aa69f60f22031b0e8f332', class: "input-container" }, this.label && h("label", { key: '2cb102a5b6c16d068f4f304fbcc6241f79fc0ce8', class: "input-label" }, this.label), h("div", { key: '96441095acc3d9a8e77b6d2bac2ceda683c9c976', class: "input-wrapper" }, h("input", { key: '523a5485111077e20faded235df6362e5ea9cfd4', type: "number", class: "numeric-input", title: "", min: this.min === Number.MIN_SAFE_INTEGER ? undefined : this.min, max: this.max === Number.MAX_SAFE_INTEGER ? undefined : this.max, step: this.step, value: this.inputValue, placeholder: this.placeholder, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, onInvalid: this.handleInvalid }), h("div", { key: '2071e98125a8d014513e93052bd8c1fee17932a5', class: "spinner-buttons" }, h("button", { key: '12422e5285dfb532dbbb6eb1a36dbcb3de50f2bc', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, h("svg", { key: '49ad5625c80fae6706ba4ab91f47bd550481ef74', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'ff7d19b61baeb5ba58bb60f2cc629bcec6eb4411', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: 'e4fec28e4fc997e007127f2b30b00cc752433221', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, h("svg", { key: '27bf06cde8de11f4a97090911afd6b8993463112', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'ed7071dd79bfe509ebb319ce43ecb3e982dd4157', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
31315
31416
|
}
|
|
31316
31417
|
static get watchers() { return {
|
|
31317
31418
|
"value": [{
|
|
@@ -31350,7 +31451,7 @@ const KritzelOpacitySlider = class {
|
|
|
31350
31451
|
}
|
|
31351
31452
|
render() {
|
|
31352
31453
|
const percentage = this.getPercentage();
|
|
31353
|
-
return (h(Host, { key: '
|
|
31454
|
+
return (h(Host, { key: '2dadd8a7c4d1af748e91a6005433288ab231f2e8' }, h("div", { key: '65ae90d95bffff244d97329754cf0cb8f73331fa', class: "opacity-container" }, h("div", { key: '90e95347f7015882112f0653a25347e715233227', class: "slider-wrapper" }, h("input", { key: '15836bc089c1725062016677d3b95384d1958431', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
31354
31455
|
'--slider-progress': `${percentage}%`,
|
|
31355
31456
|
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
31356
31457
|
} })))));
|
|
@@ -31703,7 +31804,7 @@ const KritzelPortal = class {
|
|
|
31703
31804
|
this.portal.style.visibility = 'visible';
|
|
31704
31805
|
}
|
|
31705
31806
|
render() {
|
|
31706
|
-
return (h(Host, { key: '
|
|
31807
|
+
return (h(Host, { key: '72273b4c7811473072ee27668836a5ddddcfd618', style: { display: this.anchor ? 'block' : 'none' } }, h("slot", { key: 'b4f37ca27c47ab950a4639162fa31a3c2362d6f7' })));
|
|
31707
31808
|
}
|
|
31708
31809
|
static get watchers() { return {
|
|
31709
31810
|
"anchor": [{
|
|
@@ -31717,9 +31818,9 @@ const KritzelPortal = class {
|
|
|
31717
31818
|
* This file is auto-generated by the version bump scripts.
|
|
31718
31819
|
* Do not modify manually.
|
|
31719
31820
|
*/
|
|
31720
|
-
const KRITZEL_VERSION = '0.4.
|
|
31821
|
+
const KRITZEL_VERSION = '0.4.7';
|
|
31721
31822
|
|
|
31722
|
-
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)}`;
|
|
31823
|
+
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-tab-panel{display:none}.settings-tab-panel.is-active{display:block}.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)}`;
|
|
31723
31824
|
|
|
31724
31825
|
const DEFAULT_SCALE_MIN = 0.0001;
|
|
31725
31826
|
const DEFAULT_SCALE_MAX = 1000;
|
|
@@ -31926,23 +32027,10 @@ const KritzelSettings = class {
|
|
|
31926
32027
|
}));
|
|
31927
32028
|
}
|
|
31928
32029
|
renderCategoryContent() {
|
|
31929
|
-
|
|
31930
|
-
case 'general':
|
|
31931
|
-
return (h("div", { class: "settings-content" }, h("h3", null, this.t('settings.general.title', 'General Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.theme.label', 'Theme')), h("p", { class: "settings-description" }, this.t('settings.general.theme.description', 'Select a registered color theme for the editor interface.')), h("kritzel-dropdown", { options: this.availableThemes.map(t => ({ value: t, label: t })), value: this.theme, onValueChanged: this.handleThemeChange })), this.availableLocales.length > 0 && (h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.language.label', 'Language')), h("p", { class: "settings-description" }, this.t('settings.general.language.description', 'Select the display language for the editor interface.')), h("kritzel-dropdown", { options: this.availableLocales.map(l => ({ value: l.code, label: l.label })), value: this.locale, onValueChanged: this.handleLocaleChange }))), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale')), h("p", { class: "settings-description" }, this.t('settings.general.lockDrawingScale.description', 'When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.')), h("kritzel-slide-toggle", { checked: this.lockDrawingScale, label: this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale'), onCheckedChange: this.handleLockDrawingScaleChange })))));
|
|
31932
|
-
case 'viewport':
|
|
31933
|
-
return (h("div", { class: "settings-content" }, h("h3", null, this.t('settings.viewport.title', 'Viewport Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.minZoom.label', 'Minimum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.minZoom.description', 'Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.')), h("kritzel-numeric-input", { value: this.scaleMin, min: 0.0001, max: 1, step: 0.0001, onValueChange: this.handleScaleMinChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.maxZoom.label', 'Maximum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.maxZoom.description', 'Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.')), h("kritzel-numeric-input", { value: this.scaleMax, min: 1, max: 1000, step: 1, onValueChange: this.handleScaleMaxChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryLeft.label', 'Viewport Boundary Left')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryLeft.description', 'Left boundary in world coordinates. Set to limit how far left the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryLeft, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryLeftChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryRight.label', 'Viewport Boundary Right')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryRight.description', 'Right boundary in world coordinates. Set to limit how far right the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryRight, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryRightChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryTop.label', 'Viewport Boundary Top')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryTop.description', 'Top boundary in world coordinates. Set to limit how far up the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryTop, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryTopChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryBottom.label', 'Viewport Boundary Bottom')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryBottom.description', 'Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryBottom, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryBottomChange })))));
|
|
31934
|
-
case 'shortcuts':
|
|
31935
|
-
return (h("div", { class: "settings-content" }, h("h3", null, this.t('settings.shortcuts.title', 'Keyboard Shortcuts')), h("div", { class: "shortcuts-list" }, Array.from(this.groupShortcutsByCategory()).map(([category, shortcuts]) => (h("div", { class: "shortcuts-category", key: category }, h("h4", { class: "shortcuts-category-title" }, category), h("div", { class: "shortcuts-group" }, shortcuts.map(shortcut => (h("div", { class: "shortcut-item", key: shortcut.key + shortcut.label }, h("span", { class: "shortcut-label" }, shortcut.label), h("kbd", { class: "shortcut-key" }, this.formatKeyCombo(shortcut))))))))))));
|
|
31936
|
-
case 'developer':
|
|
31937
|
-
return (h("div", { class: "settings-content" }, h("h3", null, this.t('settings.developer.title', 'Developer Options')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showViewportInfo.description', 'Display viewport debug information such as position, zoom level, and boundaries.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showViewportInfo, label: this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info'), onCheckedChange: this.handleDebugInfoChange('showViewportInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showObjectInfo.label', 'Show Object Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showObjectInfo.description', 'Display debug information about objects on the canvas.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showObjectInfo, label: this.t('settings.developer.showObjectInfo.label', 'Show Object Info'), onCheckedChange: this.handleDebugInfoChange('showObjectInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showSyncProviderInfo.description', 'Display debug information about the sync provider connection status.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showSyncProviderInfo, label: this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info'), onCheckedChange: this.handleDebugInfoChange('showSyncProviderInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showMigrationInfo.description', 'Display debug information about data migrations.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showMigrationInfo, label: this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info'), onCheckedChange: this.handleDebugInfoChange('showMigrationInfo') })))));
|
|
31938
|
-
case 'about':
|
|
31939
|
-
return (h("div", { class: "settings-content" }, h("h3", null, this.t('settings.about.title', 'About')), h("p", null, this.t('settings.about.description', 'Kritzel - A drawing application')), h("p", { class: "version-info" }, "Version ", KRITZEL_VERSION), h("p", { class: "version-info" }, "App-State Schema v", CURRENT_APP_STATE_SCHEMA_VERSION), h("p", { class: "version-info" }, "Workspace Schema v", CURRENT_WORKSPACE_SCHEMA_VERSION)));
|
|
31940
|
-
default:
|
|
31941
|
-
return null;
|
|
31942
|
-
}
|
|
32030
|
+
return (h("div", { class: "settings-categories-wrapper" }, h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'general' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.general.title', 'General Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.theme.label', 'Theme')), h("p", { class: "settings-description" }, this.t('settings.general.theme.description', 'Select a registered color theme for the editor interface.')), h("kritzel-dropdown", { options: this.availableThemes.map(t => ({ value: t, label: t })), value: this.theme, onValueChanged: this.handleThemeChange })), this.availableLocales.length > 0 && (h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.language.label', 'Language')), h("p", { class: "settings-description" }, this.t('settings.general.language.description', 'Select the display language for the editor interface.')), h("kritzel-dropdown", { options: this.availableLocales.map(l => ({ value: l.code, label: l.label })), value: this.locale, onValueChanged: this.handleLocaleChange }))), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale')), h("p", { class: "settings-description" }, this.t('settings.general.lockDrawingScale.description', 'When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.')), h("kritzel-slide-toggle", { checked: this.lockDrawingScale, label: this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale'), onCheckedChange: this.handleLockDrawingScaleChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'viewport' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.viewport.title', 'Viewport Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.minZoom.label', 'Minimum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.minZoom.description', 'Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.')), h("kritzel-numeric-input", { value: this.scaleMin, min: 0.0001, max: 1, step: 0.0001, onValueChange: this.handleScaleMinChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.maxZoom.label', 'Maximum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.maxZoom.description', 'Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.')), h("kritzel-numeric-input", { value: this.scaleMax, min: 1, max: 1000, step: 1, onValueChange: this.handleScaleMaxChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryLeft.label', 'Viewport Boundary Left')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryLeft.description', 'Left boundary in world coordinates. Set to limit how far left the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryLeft, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryLeftChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryRight.label', 'Viewport Boundary Right')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryRight.description', 'Right boundary in world coordinates. Set to limit how far right the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryRight, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryRightChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryTop.label', 'Viewport Boundary Top')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryTop.description', 'Top boundary in world coordinates. Set to limit how far up the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryTop, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryTopChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryBottom.label', 'Viewport Boundary Bottom')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryBottom.description', 'Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryBottom, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryBottomChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'shortcuts' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.shortcuts.title', 'Keyboard Shortcuts')), h("div", { class: "shortcuts-list" }, Array.from(this.groupShortcutsByCategory()).map(([category, shortcuts]) => (h("div", { class: "shortcuts-category", key: category }, h("h4", { class: "shortcuts-category-title" }, category), h("div", { class: "shortcuts-group" }, shortcuts.map(shortcut => (h("div", { class: "shortcut-item", key: shortcut.key + shortcut.label }, h("span", { class: "shortcut-label" }, shortcut.label), h("kbd", { class: "shortcut-key" }, this.formatKeyCombo(shortcut)))))))))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'developer' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.developer.title', 'Developer Options')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showViewportInfo.description', 'Display viewport debug information such as position, zoom level, and boundaries.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showViewportInfo, label: this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info'), onCheckedChange: this.handleDebugInfoChange('showViewportInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showObjectInfo.label', 'Show Object Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showObjectInfo.description', 'Display debug information about objects on the canvas.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showObjectInfo, label: this.t('settings.developer.showObjectInfo.label', 'Show Object Info'), onCheckedChange: this.handleDebugInfoChange('showObjectInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showSyncProviderInfo.description', 'Display debug information about the sync provider connection status.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showSyncProviderInfo, label: this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info'), onCheckedChange: this.handleDebugInfoChange('showSyncProviderInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showMigrationInfo.description', 'Display debug information about data migrations.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showMigrationInfo, label: this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info'), onCheckedChange: this.handleDebugInfoChange('showMigrationInfo') }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'about' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.about.title', 'About')), h("p", null, this.t('settings.about.description', 'Kritzel - A drawing application')), h("p", { class: "version-info" }, "Version ", KRITZEL_VERSION), h("p", { class: "version-info" }, "App-State Schema v", CURRENT_APP_STATE_SCHEMA_VERSION), h("p", { class: "version-info" }, "Workspace Schema v", CURRENT_WORKSPACE_SCHEMA_VERSION)))));
|
|
31943
32031
|
}
|
|
31944
32032
|
render() {
|
|
31945
|
-
return (h(Host, { key: '
|
|
32033
|
+
return (h(Host, { key: '36bca8be04b34a37630d6aa5394595a8b394d180' }, h("kritzel-dialog", { key: '1e257904178fd9afa2bfbe4a758663fb366c8847', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: 'b7d9ad97d9b126ccf6e800e6c9032749635eb988', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
|
|
31946
32034
|
}
|
|
31947
32035
|
static get watchers() { return {
|
|
31948
32036
|
"settings": [{
|
|
@@ -35182,9 +35270,9 @@ const KritzelShareDialog = class {
|
|
|
35182
35270
|
this.dialogClosed.emit();
|
|
35183
35271
|
};
|
|
35184
35272
|
render() {
|
|
35185
|
-
return (h(Host, { key: '
|
|
35273
|
+
return (h(Host, { key: 'd30a468b9443f76731b207cb5caec1911f378c15' }, h("kritzel-dialog", { key: '4a4ec0a2becba58a49a87fc411a82e26557d8232', dialogTitle: this.terms['share.dialogTitle'] ?? 'Share Workspace', size: "small", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, contained: true }, h("div", { key: '0b2fec3db6c039752429768fb4bd6a2150a4345e', class: "share-content" }, h("div", { key: 'bd0b85f8418d0c46d14b718024ed62b9f72e4f52', class: "share-section" }, h("div", { key: 'bf62503a593454ffacd30d532fcd79dcbf938659', class: "share-row" }, h("div", { key: 'dfd9e83166b886d00fb5b097d0ccd77169c011bd', class: "share-label-group" }, h("label", { key: '67dba950ded47a08eb006c1628d14038b18171b5', class: "share-label" }, this.terms['share.linkSharing.label'] ?? 'Link sharing'), h("p", { key: '926f8670b35dab1e3e2a6496f44b5d6e0ee46417', class: "share-description" }, this.internalIsPublic
|
|
35186
35274
|
? (this.terms['share.linkSharing.enabledDescription'] ?? 'Anyone with the link can access this workspace.')
|
|
35187
|
-
: (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: '
|
|
35275
|
+
: (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: 'e42fabecb37fd21cc4907b966e2f50113b945eda', checked: this.internalIsPublic, onCheckedChange: this.handleToggleChange, label: this.terms['share.linkSharing.toggleLabel'] ?? 'Enable link sharing' }))), this.internalIsPublic && (h("div", { key: '40afacc81e0bbcf4c404ae32491e5142a32bca66', class: "share-section" }, h("div", { key: '57b6952670b1cbc789770362b573623035b50cf3', class: "share-url-container" }, h("input", { key: '0ee836655ca26c1e073d5d86014322939527c74b', type: "text", class: "share-url-input", value: this.getShareUrl(), readOnly: true, onClick: (e) => e.target.select() }), h("button", { key: '2d4661c1718bd8390dbe1146e8f9afe035934635', class: { 'copy-button': true, 'copy-success': this.copySuccess }, onClick: this.handleCopyUrl, title: this.copySuccess ? (this.terms['share.copyLink.copied'] ?? 'Copied!') : (this.terms['share.copyLink.title'] ?? 'Copy link') }, h("kritzel-icon", { key: 'b43bde94601c352b6065c89c026807d7efb3bcc3', name: this.copySuccess ? 'check' : 'copy', size: 18 }))), this.qrCodeDataUrl && (h("div", { key: 'f4d657aa918abbb3cf3ed039332d8c67247b83e8', class: "share-qr-container" }, h("img", { key: 'b165a446df3fba87918a19928734d39af1e6bfcf', class: "share-qr-image", src: this.qrCodeDataUrl, alt: "QR code for share link" })))))))));
|
|
35188
35276
|
}
|
|
35189
35277
|
static get watchers() { return {
|
|
35190
35278
|
"isPublic": [{
|
|
@@ -35225,7 +35313,7 @@ const KritzelSlideToggle = class {
|
|
|
35225
35313
|
}
|
|
35226
35314
|
};
|
|
35227
35315
|
render() {
|
|
35228
|
-
return (h(Host, { key: '
|
|
35316
|
+
return (h(Host, { key: '00160c9cfdafa0d53f3acfb1fb235b29abf2622a', class: { checked: this.checked, disabled: this.disabled }, tabIndex: this.disabled ? -1 : 0, role: "switch", "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.label, onClick: this.handleToggle, onKeyDown: this.handleKeyDown }, h("div", { key: '385008948ffbdc0f26249d2d833aae8f04eeb6a0', class: "toggle-track" }, h("div", { key: '43929e94335589feb24ee45f1c34a270653dd412', class: "toggle-thumb" }))));
|
|
35229
35317
|
}
|
|
35230
35318
|
};
|
|
35231
35319
|
KritzelSlideToggle.style = kritzelSlideToggleCss();
|
|
@@ -35325,7 +35413,7 @@ const KritzelSplitButton = class {
|
|
|
35325
35413
|
this.menuScrollTop = event.target.scrollTop;
|
|
35326
35414
|
};
|
|
35327
35415
|
render() {
|
|
35328
|
-
return (h(Host, { key: '
|
|
35416
|
+
return (h(Host, { key: 'fa22dc1185ef07d8127d9ee9f6dbe482d126f934', class: { mobile: this.isTouchDevice } }, h("button", { key: 'a48aba702b70e9b24ad5486dde61fa9f9c8f7cdc', class: "split-main-button", tabIndex: 0, onClick: this.handleButtonClick, disabled: this.mainButtonDisabled, "aria-label": "Main action" }, this.buttonIcon && h("kritzel-icon", { key: '0d1c9a3e9f744541dd6ebe491105f6ee65233543', name: this.buttonIcon })), h("div", { key: 'c9db29f0b9c9cf1974d78f4f60be9e1b0e26c5d2', class: "split-divider" }), h("button", { key: '57addfd5228b7c7668be902c53683d12c976b89b', ref: el => (this.splitMenuButtonRef = el), class: "split-menu-button", tabIndex: 0, onClick: this.toggleMenu, disabled: this.menuButtonDisabled, "aria-label": "Open menu" }, h("kritzel-icon", { key: 'd860cc503043425860b1234b5d34693bfdd1d5ab', name: this.dropdownIcon })), h("kritzel-portal", { key: 'cd6dda8869aea4205d922fc639073019bbd2b102', anchor: this.anchorElement, offsetY: 4, onClose: this.closeMenu }, h("kritzel-menu", { key: '1ef1c2b319662e7a2af15b46362addcc75bceb68', 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 }))));
|
|
35329
35417
|
}
|
|
35330
35418
|
};
|
|
35331
35419
|
KritzelSplitButton.style = kritzelSplitButtonCss();
|
|
@@ -35346,7 +35434,7 @@ const KritzelStrokeSize = class {
|
|
|
35346
35434
|
}
|
|
35347
35435
|
render() {
|
|
35348
35436
|
const sizes = this.sizes ?? [];
|
|
35349
|
-
return (h(Host, { key: '
|
|
35437
|
+
return (h(Host, { key: 'ba181d798d2bf7b60308746635d2077ce1353b83' }, h("div", { key: '048fc8934190359b9337747567844ca88925a6ce', class: "size-grid" }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
35350
35438
|
'size-container': true,
|
|
35351
35439
|
'selected': this.selectedSize === size,
|
|
35352
35440
|
}, onClick: () => this.handleSizeClick(size) }, h("kritzel-color", { value: 'var(--kritzel-global-text-primary)', size: size })))))));
|
|
@@ -35365,7 +35453,7 @@ const KritzelSyncIndicator = class {
|
|
|
35365
35453
|
/** The text displayed next to the spinner. */
|
|
35366
35454
|
text = 'Syncing...';
|
|
35367
35455
|
render() {
|
|
35368
|
-
return (h(Host, { key: '
|
|
35456
|
+
return (h(Host, { key: '585d5fd13116c093e5221164e36e6e986a63da58' }, h("div", { key: 'd4e0d9e51db002b8ea201a0564c22916809c346d', class: { indicator: true, visible: this.visible }, role: "status", "aria-live": "polite", "aria-label": "Synchronizing workspace" }, h("span", { key: 'b82f4c363ee31ae697e435fc8eb6ce0e2f3df1ab', class: "spinner", "aria-hidden": "true" }), h("span", { key: 'f39e04332aaf622dad69d0e5d6b6e90ee5df3ed1' }, this.text))));
|
|
35369
35457
|
}
|
|
35370
35458
|
};
|
|
35371
35459
|
KritzelSyncIndicator.style = kritzelSyncIndicatorCss();
|
|
@@ -35778,14 +35866,14 @@ const KritzelTooltip = class {
|
|
|
35778
35866
|
}
|
|
35779
35867
|
}
|
|
35780
35868
|
render() {
|
|
35781
|
-
return (h(Host, { key: '
|
|
35869
|
+
return (h(Host, { key: '227146703158aa65ecffcce348e568d559cee829', style: {
|
|
35782
35870
|
position: 'fixed',
|
|
35783
35871
|
zIndex: '9999',
|
|
35784
35872
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
35785
35873
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
35786
35874
|
left: `${this.positionX}px`,
|
|
35787
35875
|
bottom: `${this.positionY}px`,
|
|
35788
|
-
} }, h("div", { key: '
|
|
35876
|
+
} }, h("div", { key: '573e97ed81920066e8fbf50f790224c23b37ec21', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, h("slot", { key: 'c489b45928cf6720c6827df73b9eedf08bc9d5e2' }))));
|
|
35789
35877
|
}
|
|
35790
35878
|
static get watchers() { return {
|
|
35791
35879
|
"triggerElement": [{
|
|
@@ -35826,7 +35914,7 @@ const KritzelUtilityPanel = class {
|
|
|
35826
35914
|
this.redo.emit();
|
|
35827
35915
|
}
|
|
35828
35916
|
render() {
|
|
35829
|
-
return (h(Host, { key: '
|
|
35917
|
+
return (h(Host, { key: '3e86e2c4c480ab56f4646a4f288ad37a63e29642' }, h("button", { key: 'e5282e42994f2de061ec36bf892f4da3fc01d2e5', class: "utility-button", "data-testid": "utility-undo", disabled: !this.undoState?.canUndo, onClick: event => this.handleUndo(event), "aria-label": this.terms['utility.undo'] ?? 'Undo' }, h("kritzel-icon", { key: '5a2b903cc3e5f9c554928f11a1c3098d569cbc4d', name: "undo" })), h("button", { key: '466cdff71501f34f0236b4dc60263817966d7b4a', class: "utility-button", "data-testid": "utility-redo", disabled: !this.undoState?.canRedo, onClick: event => this.handleRedo(event), "aria-label": this.terms['utility.redo'] ?? 'Redo' }, h("kritzel-icon", { key: '19209a95787f4475eda9dc0712c2bf36a573c953', name: "redo" })), h("div", { key: '7a463d5ac1f78017fb728abcd2c33061d8545978', class: "utility-separator" }), h("button", { key: '155c2bb50d70223e4f4d5377bacced56ffda68ad', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": this.terms['utility.delete'] ?? 'Delete selected items' }, h("kritzel-icon", { key: '47bd8469b9efe395e9185b3e7375c7375811c0aa', name: "delete" }))));
|
|
35830
35918
|
}
|
|
35831
35919
|
};
|
|
35832
35920
|
KritzelUtilityPanel.style = kritzelUtilityPanelCss();
|
|
@@ -35847,7 +35935,7 @@ const KritzelWatermark = class {
|
|
|
35847
35935
|
label;
|
|
35848
35936
|
render() {
|
|
35849
35937
|
const label = this.label ?? this.core.localizationManager.translate('watermark.poweredBy');
|
|
35850
|
-
return (h(Host, { key: '
|
|
35938
|
+
return (h(Host, { key: '0eccc75e51c7ac199e23d8f3a871593f1fb65a17' }, h("a", { key: '2029f8b56ba8609ca621447eac0df9d30ebfbbbe', class: "watermark-link", href: KRITZEL_WEBSITE_URL, target: "_blank", rel: "noopener noreferrer", part: "watermark", onPointerDown: (ev) => ev.stopPropagation(), onPointerUp: (ev) => ev.stopPropagation() }, label)));
|
|
35851
35939
|
}
|
|
35852
35940
|
};
|
|
35853
35941
|
KritzelWatermark.style = kritzelWatermarkCss();
|
|
@@ -36035,7 +36123,7 @@ const KritzelZoomPanel = class {
|
|
|
36035
36123
|
return Number.isFinite(this.zoomPercent) ? Math.max(1, Math.round(this.zoomPercent)) : 100;
|
|
36036
36124
|
}
|
|
36037
36125
|
render() {
|
|
36038
|
-
return (h(Host, { key: '
|
|
36126
|
+
return (h(Host, { key: '054e24893ed609c29b02cf574a68cf9311a3f025' }, h("div", { key: '42ad21dca9486ae350d5814b949e0c577a6ed996', class: { panel: true, visible: this.visible } }, h("button", { key: 'e360884e5a2edaada46d232cae8121f2c5f45bb6', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomOut'] ?? 'Zoom out', disabled: this.disabled, onClick: this.handleZoomOut }, h("kritzel-icon", { key: '8c8bb23c4ec4b78fd04aee5c0edd3371c4d14125', name: "minus" })), h("span", { key: '42ab93551c2fbb6d8d4ef076d66405277ba941bf', class: "zoom-level", "aria-live": "polite" }, this.normalizedZoomPercent, "%"), h("button", { key: '232f0f74b748999c6892549978bbe085636ca189', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomIn'] ?? 'Zoom in', disabled: this.disabled, onClick: this.handleZoomIn }, h("kritzel-icon", { key: '6f9b8ddd4c666573d9716d7bc455c2a3b1035ede', name: "plus" })))));
|
|
36039
36127
|
}
|
|
36040
36128
|
};
|
|
36041
36129
|
KritzelZoomPanel.style = kritzelZoomPanelCss();
|