@kritzel/editor 0.4.31 → 0.4.33
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/LICENSE.md +50 -50
- package/README.md +5 -5
- package/dist/cjs/{index-B92VHWr4.js → index-BAdxtEc7.js} +27 -9
- package/dist/cjs/kritzel-active-users_46.cjs.entry.js +1029 -366
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
- package/dist/cjs/kritzel-editor.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/kritzel-active-users/kritzel-active-users.css +65 -65
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.css +58 -58
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.css +42 -42
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.js +3 -3
- package/dist/collection/components/kritzel-button/kritzel-button.css +73 -73
- package/dist/collection/components/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/kritzel-color/kritzel-color.css +24 -24
- package/dist/collection/components/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.css +46 -46
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.css +113 -112
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.js +1 -1
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.css +11 -11
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/kritzel-dialog/kritzel-dialog.css +209 -209
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.css +190 -190
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.js +2 -2
- package/dist/collection/components/kritzel-editor/kritzel-editor.css +160 -160
- package/dist/collection/components/kritzel-editor/kritzel-editor.js +72 -46
- package/dist/collection/components/kritzel-export/kritzel-export.css +89 -89
- package/dist/collection/components/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/kritzel-font/kritzel-font.css +10 -10
- package/dist/collection/components/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.css +48 -48
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.js +2 -2
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.css +30 -30
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/kritzel-input/kritzel-input.css +69 -69
- package/dist/collection/components/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.css +60 -60
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.js +3 -3
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.css +54 -54
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.css +190 -190
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/kritzel-menu/kritzel-menu.css +35 -34
- package/dist/collection/components/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.css +166 -166
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.js +3 -3
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.css +58 -58
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.js +4 -4
- package/dist/collection/components/kritzel-notification-card/kritzel-notification-card.css +101 -101
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
- package/dist/collection/components/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/kritzel-settings/kritzel-settings.css +137 -137
- package/dist/collection/components/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.css +78 -78
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.js +3 -3
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.css +38 -38
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.js +1 -1
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.css +347 -347
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.js +12 -16
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.css +18 -18
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.js +1 -1
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-brush-style.js +4 -4
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dialog.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +108 -81
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.js +1 -1
- package/dist/components/kritzel-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-notification-card.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-toolbar.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-CrIEmItB.js → p-2DAZSvN6.js} +5 -5
- package/dist/components/{p-CmjXRLdr.js → p-2gylYpXk.js} +7 -7
- package/dist/components/{p-BN8VWPlq.js → p-B-Divd0Q.js} +7 -7
- package/dist/components/{p-R1D8Sr0l.js → p-B-U13Ew1.js} +3 -3
- package/dist/components/{p-BZ_KnHdR.js → p-B1rmcPZr.js} +7 -7
- package/dist/components/{p-B_gT0lCn.js → p-B2-SxV8E.js} +3 -3
- package/dist/components/p-B6Z_VKKH.js +214 -0
- package/dist/components/{p-CVxGF4bJ.js → p-B8tHdknP.js} +5 -5
- package/dist/components/{p-CoNexfpB.js → p-BDsuJNT_.js} +3 -3
- package/dist/components/{p-BvG3JO85.js → p-BMi-i7sC.js} +3 -3
- package/dist/components/{p-Cy_cLtOP.js → p-BZ0ReYAA.js} +18 -14
- package/dist/components/{p-DZsSiMnA.js → p-BeCy6w6M.js} +770 -173
- package/dist/components/{p-4-qLegHb.js → p-Bipc1XvF.js} +4 -4
- package/dist/components/{p-CS3YZVYE.js → p-BmFJelgk.js} +2 -2
- package/dist/components/{p-DqOC_Yck.js → p-BpvSYxxN.js} +6 -6
- package/dist/components/{p-peZjvnkK.js → p-C0ns8IPO.js} +2 -2
- package/dist/components/{p-ClfOtiNp.js → p-C1_r9nJU.js} +3 -3
- package/dist/components/{p-GbCxpbQ6.js → p-C2ySiAXO.js} +3 -3
- package/dist/components/{p-B3Tqoyl9.js → p-C3KlONnT.js} +3 -3
- package/dist/components/{p-B5xYV1o3.js → p-C68YXjuL.js} +2 -2
- package/dist/components/{p-DJxgPPfs.js → p-CCuNN278.js} +3 -3
- package/dist/components/{p-Ds0uNtwQ.js → p-CNH7N3Aq.js} +4 -4
- package/dist/components/{p-DVv8ChhE.js → p-CO1cJlfg.js} +4 -4
- package/dist/components/{p-Cp4e4oTE.js → p-CqHKGLYE.js} +2 -2
- package/dist/components/{p-Blq9a1ni.js → p-CrEWqua9.js} +6 -6
- package/dist/components/{p-CvaxFYS0.js → p-Cv2nqOL8.js} +8 -8
- package/dist/components/{p-CzUeIini.js → p-D-1ixLxq.js} +13 -13
- package/dist/components/{p-BfMlwIcG.js → p-DF8p-DxR.js} +3 -3
- package/dist/components/{p-QEue33R5.js → p-DQ3VKzAS.js} +3 -3
- package/dist/components/{p-Ckqh1tqY.js → p-DRe-rTlX.js} +27 -31
- package/dist/components/{p-McY5wZ0h.js → p-DSyb29RF.js} +2 -2
- package/dist/components/{p-D0tPTPkR.js → p-DYDruZIw.js} +3 -3
- package/dist/components/{p-kOINnzaR.js → p-D_JxJxQ6.js} +7 -7
- package/dist/components/{p-BDjRSoAc.js → p-Dko_6jIh.js} +2 -2
- package/dist/components/{p-BjFrt1q0.js → p-DnHvqeyr.js} +3 -3
- package/dist/components/{p-BrGJIoGK.js → p-DqMikMrS.js} +3 -3
- package/dist/components/p-DsnHq8en.js +55 -0
- package/dist/components/{p-DXZBWJBt.js → p-DxFNLy9X.js} +4 -4
- package/dist/components/{p-5qkOM1RJ.js → p-Dzr6X2aj.js} +16 -4
- package/dist/components/{p-DXuf225S.js → p-HbHo7awi.js} +3 -3
- package/dist/components/{p-CwBxnzYu.js → p-Qbk7xE91.js} +3 -3
- package/dist/components/{p-h_uh_Njf.js → p-VYGV0cr3.js} +3 -3
- package/dist/components/{p-DyRJFg4w.js → p-YGBl60lb.js} +2 -2
- package/dist/components/{p-hQwVRh0t.js → p-clFfXKKn.js} +7 -7
- package/dist/components/{p-SLnqczCS.js → p-dUcCDLDF.js} +3 -3
- package/dist/components/{p-B6UJztrf.js → p-kXnNX65j.js} +4 -4
- package/dist/esm/{index-OjbYJz-P.js → index-YR-6hzAW.js} +27 -10
- package/dist/esm/kritzel-active-users_46.entry.js +1029 -366
- package/dist/esm/kritzel-brush-style.entry.js +2 -2
- package/dist/esm/kritzel-editor.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/kritzel-editor/kritzel-editor.esm.js +4 -4
- package/dist/kritzel-editor/{p-501047d8.entry.js → p-3a0f60b0.entry.js} +2 -2
- package/dist/kritzel-editor/{p-OjbYJz-P.js → p-YR-6hzAW.js} +27 -10
- package/dist/kritzel-editor/{p-60319edb.entry.js → p-adc45d46.entry.js} +1029 -366
- package/dist/types/components/kritzel-editor/kritzel-editor.d.ts +9 -2
- package/dist/types/components.d.ts +15 -15
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/package.json +3 -3
- package/dist/components/p-BGmTmdLe.js +0 -167
- package/dist/components/p-DOJCDPVD.js +0 -55
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './p-
|
|
1
|
+
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement, f as forceUpdate } from './p-YR-6hzAW.js';
|
|
2
2
|
import { KritzelColorHelper as KritzelColorHelper$1, KritzelHTMLHelper as KritzelHTMLHelper$1, ABSOLUTE_SCALE_MAX as ABSOLUTE_SCALE_MAX$1, ABSOLUTE_SCALE_MIN as ABSOLUTE_SCALE_MIN$1, KritzelSelectionTool as KritzelSelectionTool$1, DEFAULT_BRUSH_CONFIG, KritzelBrushTool as KritzelBrushTool$1, KritzelEraserTool as KritzelEraserTool$1, DEFAULT_LINE_TOOL_CONFIG, KritzelLineTool as KritzelLineTool$1, ShapeType as ShapeType$1, DEFAULT_SHAPE_CONFIG, KritzelShapeTool as KritzelShapeTool$1, DEFAULT_TEXT_CONFIG, KritzelTextTool as KritzelTextTool$1, KritzelImageTool as KritzelImageTool$1, KritzelAlignment as KritzelAlignment$1, hasRemoteSyncProvider, DEFAULT_SYNC_CONFIG as DEFAULT_SYNC_CONFIG$1, DEFAULT_ASSET_STORAGE_CONFIG, ObjectHelper as ObjectHelper$1, resolveTextToolAvailableFonts as resolveTextToolAvailableFonts$1, ThemeHelper as ThemeHelper$1, darkTheme as darkTheme$1, lightTheme as lightTheme$1, KritzelSelectionGroup as KritzelSelectionGroup$1, KritzelSelectionBox as KritzelSelectionBox$1, KritzelIconRegistry as KritzelIconRegistry$1, KritzelFontRegistry as KritzelFontRegistry$1, KritzelKeyboardHelper as KritzelKeyboardHelper$1, KritzelDevicesHelper as KritzelDevicesHelper$1, KRITZEL_VERSION, CURRENT_APP_STATE_SCHEMA_VERSION as CURRENT_APP_STATE_SCHEMA_VERSION$1, CURRENT_WORKSPACE_SCHEMA_VERSION as CURRENT_WORKSPACE_SCHEMA_VERSION$1, KritzelToolConfigHelper, KritzelWorkspace as KritzelWorkspace$1 } from '@kritzel/engine';
|
|
3
3
|
|
|
4
|
-
const kritzelActiveUsersCss = () => `:host{display:inline-flex;align-items:center}.avatars{display:flex;align-items:center}.avatar-wrapper{position:relative;transition:margin-left 200ms ease}.avatar-wrapper kritzel-avatar{border-radius:50%;box-shadow:0 0 0 2px var(--kritzel-active-users-avatar-border-color, #ffffff)}.avatars:hover .avatar-wrapper{margin-left:-6px !important}.avatar-tooltip{position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:12px;padding:4px 8px;background-color:var(--kritzel-active-users-tooltip-background, #333333);color:var(--kritzel-active-users-tooltip-color, #ffffff);font-family:sans-serif;font-size:12px;font-weight:500;border-radius:4px;white-space:nowrap;width:max-content;pointer-events:none;opacity:0;transition:opacity 150ms ease}.avatar-wrapper:hover .avatar-tooltip,.overflow-count:hover .avatar-tooltip{opacity:1}.overflow-count{position:relative;margin-left:8px;font-family:sans-serif;font-size:var(--kritzel-active-users-overflow-font-size, 14px);font-weight:500;color:var(--kritzel-active-users-overflow-color, #666666);white-space:nowrap;cursor:default}.overflow-count .avatar-tooltip{white-space:nowrap;text-align:left;margin-top:20px}`;
|
|
4
|
+
const kritzelActiveUsersCss = () => `:host{display:inline-flex;align-items:center}.avatars{display:flex;align-items:center}.avatar-wrapper{position:relative;transition:margin-left 200ms ease}.avatar-wrapper kritzel-avatar{border-radius:50%;box-shadow:0 0 0 2px var(--kritzel-active-users-avatar-border-color, #ffffff)}.avatars:hover .avatar-wrapper{margin-left:-6px !important}.avatar-tooltip{position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:12px;padding:4px 8px;background-color:var(--kritzel-active-users-tooltip-background, #333333);color:var(--kritzel-active-users-tooltip-color, #ffffff);font-family:var(--kritzel-active-users-font-family, var(--kritzel-global-font-family, sans-serif));font-size:12px;font-weight:500;border-radius:4px;white-space:nowrap;width:max-content;pointer-events:none;opacity:0;transition:opacity 150ms ease}.avatar-wrapper:hover .avatar-tooltip,.overflow-count:hover .avatar-tooltip{opacity:1}.overflow-count{position:relative;margin-left:8px;font-family:var(--kritzel-active-users-font-family, var(--kritzel-global-font-family, sans-serif));font-size:var(--kritzel-active-users-overflow-font-size, 14px);font-weight:500;color:var(--kritzel-active-users-overflow-color, #666666);white-space:nowrap;cursor:default}.overflow-count .avatar-tooltip{white-space:nowrap;text-align:left;margin-top:20px}`;
|
|
5
5
|
|
|
6
6
|
const KritzelActiveUsers = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -127,16 +127,16 @@ const KritzelAvatar = class {
|
|
|
127
127
|
height: `${this.size}px`,
|
|
128
128
|
fontSize: `${Math.round(this.size * 0.4)}px`,
|
|
129
129
|
};
|
|
130
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: 'd66c2ec474fed4b7b07687f1a02d0d97f893b689', style: containerStyles, class: {
|
|
131
131
|
'has-image': !!showImage,
|
|
132
132
|
'has-initials': !!showInitials,
|
|
133
133
|
'has-default': !!showDefaultIcon,
|
|
134
|
-
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '
|
|
134
|
+
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: 'd2aefda3897b2278c0d640c75084335f6786bd3b', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
|
|
135
135
|
if (el) {
|
|
136
136
|
el.referrerPolicy = 'no-referrer';
|
|
137
137
|
el.crossOrigin = 'anonymous';
|
|
138
138
|
}
|
|
139
|
-
}, onError: this.handleImageError })), showInitials && (h("span", { key: '
|
|
139
|
+
}, onError: this.handleImageError })), showInitials && (h("span", { key: '1837201e58bcb96877981f0970edcc39ba6058e6', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: '9578696c0b5ca200ccf82586e49e42ab57909aee', class: "avatar-default" }, h("svg", { key: 'cf521d25aa25a6f8af921d6179a99077a42752ef', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: 'cbf16a181e4ba351c6337355b067ecd1d7787f28', 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" }))))));
|
|
140
140
|
}
|
|
141
141
|
static get watchers() { return {
|
|
142
142
|
"user": [{
|
|
@@ -197,6 +197,19 @@ class ObjectHelper {
|
|
|
197
197
|
static isClass(object, className) {
|
|
198
198
|
return !!object && object.__class__ === className;
|
|
199
199
|
}
|
|
200
|
+
static isKritzelEmbeddedObject(object) {
|
|
201
|
+
if (!object || typeof object !== 'object') {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
const candidate = object;
|
|
205
|
+
return (typeof candidate.isInteractive === 'boolean' &&
|
|
206
|
+
typeof candidate.isSelected === 'boolean' &&
|
|
207
|
+
typeof candidate.mount === 'function' &&
|
|
208
|
+
typeof candidate.unmount === 'function' &&
|
|
209
|
+
typeof candidate.setIsInteractive === 'function' &&
|
|
210
|
+
typeof candidate.hasFocusedInputElement === 'function' &&
|
|
211
|
+
typeof candidate.getEmbeddedContentRoots === 'function');
|
|
212
|
+
}
|
|
200
213
|
static isKritzelExportable(object) {
|
|
201
214
|
if (!object || typeof object !== 'object') {
|
|
202
215
|
return false;
|
|
@@ -1446,6 +1459,7 @@ const lightTheme = {
|
|
|
1446
1459
|
dividerColor: '#e0e0e0',
|
|
1447
1460
|
focusColor: '#333333',
|
|
1448
1461
|
focusRingColor: '#333333',
|
|
1462
|
+
fontFamily: 'sans-serif',
|
|
1449
1463
|
iconColor: 'currentColor',
|
|
1450
1464
|
scrollbarThumbColor: '#ebebeb',
|
|
1451
1465
|
textPrimary: '#000000',
|
|
@@ -1534,7 +1548,6 @@ const lightTheme = {
|
|
|
1534
1548
|
closeButtonColor: '#333333',
|
|
1535
1549
|
closeButtonHoverBackground: 'hsl(0, 0%, 0%, 4.3%)',
|
|
1536
1550
|
closeButtonHoverColor: '#000000',
|
|
1537
|
-
fontFamily: 'inherit',
|
|
1538
1551
|
footerBorder: '1px solid #ebebeb',
|
|
1539
1552
|
headerBorder: '1px solid #ebebeb',
|
|
1540
1553
|
titleColor: '#000000',
|
|
@@ -1569,11 +1582,6 @@ const lightTheme = {
|
|
|
1569
1582
|
loadingOverlayColor: '#333333',
|
|
1570
1583
|
loadingOverlaySpinnerActiveColor: '#333333',
|
|
1571
1584
|
loadingOverlaySpinnerColor: '#cccccc',
|
|
1572
|
-
syncIndicatorBackground: 'rgba(255, 255, 255, 0.92)',
|
|
1573
|
-
syncIndicatorColor: '#334155',
|
|
1574
|
-
syncIndicatorSpinnerColor: '#007AFF',
|
|
1575
|
-
syncIndicatorSpinnerTrack: 'rgba(148, 163, 184, 0.35)',
|
|
1576
|
-
syncIndicatorZIndex: '10001',
|
|
1577
1585
|
},
|
|
1578
1586
|
snap: {
|
|
1579
1587
|
indicatorFill: 'rgba(59, 130, 246, 0.3)',
|
|
@@ -1793,6 +1801,7 @@ const darkTheme = {
|
|
|
1793
1801
|
dividerColor: '#3a3a3a',
|
|
1794
1802
|
focusColor: '#ffffff',
|
|
1795
1803
|
focusRingColor: '#ffffff',
|
|
1804
|
+
fontFamily: 'sans-serif',
|
|
1796
1805
|
iconColor: 'currentColor',
|
|
1797
1806
|
scrollbarThumbColor: '#555555',
|
|
1798
1807
|
textPrimary: '#ffffff',
|
|
@@ -1915,11 +1924,6 @@ const darkTheme = {
|
|
|
1915
1924
|
loadingOverlayColor: '#e0e0e0',
|
|
1916
1925
|
loadingOverlaySpinnerActiveColor: '#e0e0e0',
|
|
1917
1926
|
loadingOverlaySpinnerColor: '#555555',
|
|
1918
|
-
syncIndicatorBackground: 'rgba(30, 30, 30, 0.95)',
|
|
1919
|
-
syncIndicatorColor: '#e0e0e0',
|
|
1920
|
-
syncIndicatorSpinnerColor: '#0A84FF',
|
|
1921
|
-
syncIndicatorSpinnerTrack: 'rgba(160, 160, 160, 0.3)',
|
|
1922
|
-
syncIndicatorZIndex: '10001',
|
|
1923
1927
|
},
|
|
1924
1928
|
snap: {
|
|
1925
1929
|
indicatorFill: 'rgba(10, 132, 255, 0.35)',
|
|
@@ -3296,7 +3300,7 @@ class KritzelLine extends KritzelBaseObject {
|
|
|
3296
3300
|
}
|
|
3297
3301
|
}
|
|
3298
3302
|
|
|
3299
|
-
const kritzelAwarenessCursorsCss = () => `:host{display:block;position:fixed;top:0;left:0;width:100vw;height:100vh;pointer-events:none;z-index:1}.awareness-cursor{position:absolute;top:0;left:0;transition:transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out,
|
|
3303
|
+
const kritzelAwarenessCursorsCss = () => `:host{display:block;position:fixed;top:0;left:0;width:100vw;height:100vh;pointer-events:none;z-index:1}.awareness-cursor{position:absolute;top:0;left:0;transition:transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out, opacity 300ms ease;will-change:transform}.awareness-cursor.stale{opacity:0}.awareness-cursor.tracking-object{transition-duration:0ms}.cursor-arrow{filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3))}.cursor-label{position:absolute;left:16px;top:16px;white-space:nowrap;font-family:var(--kritzel-awareness-font-family, var(--kritzel-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif));font-size:var(--kritzel-awareness-cursor-label-font-size, 12px);color:var(--kritzel-awareness-cursor-label-text-color, #ffffff);padding:2px 8px;border-radius:4px;line-height:1.4;font-weight:500;pointer-events:none;user-select:none}.edge-indicator{position:absolute;top:-12px;left:-12px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;transition:transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out, opacity 300ms ease;will-change:transform;pointer-events:auto;user-select:none;cursor:pointer}.edge-indicator.stale{opacity:0}.edge-indicator.tracking-object{transition-duration:0ms}.edge-arrow{position:absolute;filter:drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));transition:opacity 300ms ease}.edge-arrow.stale{opacity:0}.edge-label{position:absolute;white-space:nowrap;font-family:var(--kritzel-awareness-font-family, var(--kritzel-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif));font-size:var(--kritzel-awareness-cursor-label-font-size, 12px);color:var(--kritzel-awareness-cursor-label-text-color, #ffffff);padding:2px 8px;border-radius:4px;line-height:1.4;font-weight:500;pointer-events:none;opacity:0;transform-origin:center;transition:opacity 150ms ease}.edge-indicator:hover .edge-label{opacity:1}.remote-selection-box{position:absolute;top:0;left:0;border-width:2px;border-style:solid;pointer-events:none;will-change:transform, width, height;transition:transform var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out, width var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out, height var(--kritzel-awareness-cursor-transition-duration, 100ms) ease-out}`;
|
|
3300
3304
|
|
|
3301
3305
|
const STALE_THRESHOLD_MS = 10_000;
|
|
3302
3306
|
const REMOVE_THRESHOLD_MS = 30_000;
|
|
@@ -3501,7 +3505,7 @@ const KritzelAwarenessCursors = class {
|
|
|
3501
3505
|
}
|
|
3502
3506
|
render() {
|
|
3503
3507
|
const cursors = Array.from(this.remoteCursors.values());
|
|
3504
|
-
return (h(Host, { key: '
|
|
3508
|
+
return (h(Host, { key: '2021875ea3e430c04da438dc5b7a2c22f119ea67' }, cursors.map(remoteCursor => {
|
|
3505
3509
|
if (!remoteCursor.cursor)
|
|
3506
3510
|
return null;
|
|
3507
3511
|
// When a remote user is actively drawing, derive cursor position from
|
|
@@ -3608,12 +3612,12 @@ const KritzelBackToContent = class {
|
|
|
3608
3612
|
this.backToContent.emit();
|
|
3609
3613
|
};
|
|
3610
3614
|
render() {
|
|
3611
|
-
return (h(Host, { key: '
|
|
3615
|
+
return (h(Host, { key: '335205a7ec6430235c54941828b7491d75472778' }, h("button", { key: '176e473183c4d58607a697c924035baec67c138d', class: { 'back-to-content-button': true, visible: this.visible }, onClick: this.handleClick, "aria-label": this.text }, h("kritzel-icon", { key: '44ad49916d1ee99fed8e635de65f7ae337235ecb', name: "chevronsLeft" }))));
|
|
3612
3616
|
}
|
|
3613
3617
|
};
|
|
3614
3618
|
KritzelBackToContent.style = kritzelBackToContentCss();
|
|
3615
3619
|
|
|
3616
|
-
const kritzelButtonCss = () => `:host{display:inline-block;font-family:sans-serif}button{border:none;background-color:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:var(--kritzel-global-pointer-cursor, pointer);display:inline-flex;width:var(--kritzel-button-width, auto);align-items:center;justify-content:center;gap:6px;border-radius:var(--kritzel-button-border-radius, 8px);padding:var(--kritzel-button-padding, 12px 20px);font-size:var(--kritzel-button-font-size, 14px);font-weight:var(--kritzel-button-font-weight, 500);transition:background-color 0.15s ease, opacity 0.15s ease;-webkit-tap-highlight-color:transparent}button.primary{background-color:var(--kritzel-button-primary-background-color, #007AFF);color:var(--kritzel-button-primary-color, #ffffff)}button.primary:hover{background-color:var(--kritzel-button-primary-hover-background-color, #006ae6)}button.primary:active{background-color:var(--kritzel-button-primary-active-background-color, #005bbf)}button.secondary{background-color:var(--kritzel-button-secondary-background-color, #f0f0f0);color:var(--kritzel-button-secondary-color, #333333)}button.secondary:hover{background-color:var(--kritzel-button-secondary-hover-background-color, #e0e0e0)}button.secondary:active{background-color:var(--kritzel-button-secondary-active-background-color, #d0d0d0)}button.text{background-color:transparent;color:var(--kritzel-button-text-color, #007AFF)}button.text:hover{background-color:var(--kritzel-button-text-hover-background-color, rgba(0, 122, 255, 0.08))}button.text:active{background-color:var(--kritzel-button-text-active-background-color, rgba(0, 122, 255, 0.15))}button.disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}`;
|
|
3620
|
+
const kritzelButtonCss = () => `:host{display:inline-block;font-family:var(--kritzel-button-font-family, var(--kritzel-global-font-family, sans-serif))}button{border:none;background-color:transparent;padding:0;margin:0;font-family:inherit;font-size:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:var(--kritzel-global-pointer-cursor, pointer);display:inline-flex;width:var(--kritzel-button-width, auto);align-items:center;justify-content:center;gap:6px;border-radius:var(--kritzel-button-border-radius, 8px);padding:var(--kritzel-button-padding, 12px 20px);font-size:var(--kritzel-button-font-size, 14px);font-weight:var(--kritzel-button-font-weight, 500);transition:background-color 0.15s ease, opacity 0.15s ease;-webkit-tap-highlight-color:transparent}button.primary{background-color:var(--kritzel-button-primary-background-color, #007AFF);color:var(--kritzel-button-primary-color, #ffffff)}button.primary:hover{background-color:var(--kritzel-button-primary-hover-background-color, #006ae6)}button.primary:active{background-color:var(--kritzel-button-primary-active-background-color, #005bbf)}button.secondary{background-color:var(--kritzel-button-secondary-background-color, #f0f0f0);color:var(--kritzel-button-secondary-color, #333333)}button.secondary:hover{background-color:var(--kritzel-button-secondary-hover-background-color, #e0e0e0)}button.secondary:active{background-color:var(--kritzel-button-secondary-active-background-color, #d0d0d0)}button.text{background-color:transparent;color:var(--kritzel-button-text-color, #007AFF)}button.text:hover{background-color:var(--kritzel-button-text-hover-background-color, rgba(0, 122, 255, 0.08))}button.text:active{background-color:var(--kritzel-button-text-active-background-color, rgba(0, 122, 255, 0.15))}button.disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}`;
|
|
3617
3621
|
|
|
3618
3622
|
const KritzelButton = class {
|
|
3619
3623
|
constructor(hostRef) {
|
|
@@ -3635,16 +3639,16 @@ const KritzelButton = class {
|
|
|
3635
3639
|
this.buttonClick.emit();
|
|
3636
3640
|
};
|
|
3637
3641
|
render() {
|
|
3638
|
-
return (h(Host, { key: '
|
|
3642
|
+
return (h(Host, { key: 'e88abc53a52cd32846b389f9de239d3f98b7230f' }, h("button", { key: 'de77c4ac750f35766b9657276addf78068be1575', type: this.type, class: {
|
|
3639
3643
|
'kritzel-button': true,
|
|
3640
3644
|
[this.variant]: true,
|
|
3641
3645
|
'disabled': this.disabled,
|
|
3642
|
-
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '
|
|
3646
|
+
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: 'bdd2227879415dccc23676cf219ef17b1dd104fe' }))));
|
|
3643
3647
|
}
|
|
3644
3648
|
};
|
|
3645
3649
|
KritzelButton.style = kritzelButtonCss();
|
|
3646
3650
|
|
|
3647
|
-
const kritzelColorCss = () => `:host{display:flex}.checkerboard-bg{background:repeating-conic-gradient(
|
|
3651
|
+
const kritzelColorCss = () => `:host{display:flex}.checkerboard-bg{background:repeating-conic-gradient( var(--kritzel-checkerboard-color-dark, #ccc) 0% 25%, var(--kritzel-checkerboard-color-light, #fff) 0% 50% ) 50% / 8px 8px;position:relative;overflow:hidden}.color-circle{width:24px;height:24px;border-radius:50%;box-sizing:border-box;display:block}.color-circle.white{border:1px solid var(--kritzel-color-palette-circle-border-color, #dddcdc)}`;
|
|
3648
3652
|
|
|
3649
3653
|
const KritzelColorComponent = class {
|
|
3650
3654
|
constructor(hostRef) {
|
|
@@ -3687,13 +3691,13 @@ const KritzelColorComponent = class {
|
|
|
3687
3691
|
render() {
|
|
3688
3692
|
const resolvedColor = this.resolveColor();
|
|
3689
3693
|
const isColorVeryLight = this.isLightColor(resolvedColor);
|
|
3690
|
-
return (h(Host, { key: '
|
|
3694
|
+
return (h(Host, { key: 'b75cfa0ca9d5927fe9cb1331f7e4163abc34c0c1' }, h("div", { key: '197ec4d1daaf5804b69907b8de074784686face4', class: "checkerboard-bg", style: {
|
|
3691
3695
|
width: `${this.size}px`,
|
|
3692
3696
|
height: `${this.size}px`,
|
|
3693
3697
|
borderRadius: '50%',
|
|
3694
3698
|
display: 'inline-block',
|
|
3695
3699
|
position: 'relative',
|
|
3696
|
-
} }, h("div", { key: '
|
|
3700
|
+
} }, h("div", { key: 'ed8b7dc412569d05c747014a32948930c392b980', class: {
|
|
3697
3701
|
'color-circle': true,
|
|
3698
3702
|
'white': isColorVeryLight,
|
|
3699
3703
|
}, style: {
|
|
@@ -3749,7 +3753,7 @@ const KritzelColorPalette = class {
|
|
|
3749
3753
|
render() {
|
|
3750
3754
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
3751
3755
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
3752
|
-
return (h(Host, { key: '
|
|
3756
|
+
return (h(Host, { key: 'cfdd5136f512aed23198d4a55c628ccd675f08c9' }, h("div", { key: 'bb5445f68b9d17268c6def7cfc4a2dd1fb971c53', class: {
|
|
3753
3757
|
'color-grid': true,
|
|
3754
3758
|
'expanded': this.isExpanded,
|
|
3755
3759
|
}, style: {
|
|
@@ -3764,7 +3768,7 @@ const KritzelColorPalette = class {
|
|
|
3764
3768
|
};
|
|
3765
3769
|
KritzelColorPalette.style = kritzelColorPaletteCss();
|
|
3766
3770
|
|
|
3767
|
-
const kritzelContextMenuCss = () => `:host{display:block}.menu-container{position:relative;z-index:1;display:flex;flex-direction:column;gap:var(--kritzel-context-menu-item-spacing, 2px);background-color:var(--kritzel-context-menu-background-color, #ffffff);border-radius:var(--kritzel-context-menu-border-radius, 12px);box-shadow:var(--kritzel-context-menu-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12));border:var(--kritzel-context-menu-border, 1px solid #ebebeb);padding:var(--kritzel-context-menu-padding, 4px);min-width:var(--kritzel-context-menu-min-width, 140px)}.menu-item-wrapper{position:relative}.menu-item{display:flex;align-items:center;gap:var(--kritzel-context-menu-item-gap, 8px);background:none;border:none;text-align:left;padding:var(--kritzel-context-menu-item-padding, 8px);border-radius:var(--kritzel-context-menu-item-border-radius, 12px);cursor:var(--kritzel-global-pointer-cursor, pointer);font-size:var(--kritzel-context-menu-item-font-size, 14px);color:var(--kritzel-context-menu-item-color, #333333);white-space:nowrap;-webkit-tap-highlight-color:transparent;width:100%;min-width:0}.menu-item:not(.disabled):hover,.menu-item.submenu-open{background-color:var(--kritzel-context-menu-item-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.menu-item:not(.disabled):active{background-color:var(--kritzel-context-menu-item-active-background-color, hsl(0, 0%, 0%, 8.6%))}.menu-item.disabled{color:var(--kritzel-context-menu-item-disabled-color, #aaaaaa)}.menu-item.has-children.disabled{cursor:var(--kritzel-global-pointer-cursor, pointer);color:var(--kritzel-context-menu-item-color, #333333)}.menu-item kritzel-icon{opacity:0.8;flex-shrink:0}.menu-item.disabled kritzel-icon{opacity:0.4}.menu-item.has-children.disabled kritzel-icon{opacity:0.8}.label{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.submenu-arrow{margin-left:auto;opacity:0.5}.menu-divider{height:1px;background-color:var(--kritzel-context-menu-divider-color, rgba(0, 0, 0, 0.1));margin:var(--kritzel-context-menu-divider-margin, 4px 8px)}.submenu-container{position:absolute;top:0;left:100%;z-index:2;margin-left:4px;display:flex;flex-direction:column;gap:var(--kritzel-context-menu-item-spacing, 2px);background-color:var(--kritzel-context-menu-background-color, #ffffff);border-radius:var(--kritzel-context-menu-border-radius, 12px);box-shadow:var(--kritzel-context-menu-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12));border:var(--kritzel-context-menu-border, 1px solid #ebebeb);padding:var(--kritzel-context-menu-padding, 4px);min-width:120px}.submenu-container.position-left{left:auto;right:100%;margin-left:0;margin-right:4px}`;
|
|
3771
|
+
const kritzelContextMenuCss = () => `:host{display:block}.menu-container{position:relative;z-index:1;display:flex;flex-direction:column;gap:var(--kritzel-context-menu-item-spacing, 2px);background-color:var(--kritzel-context-menu-background-color, #ffffff);border-radius:var(--kritzel-context-menu-border-radius, 12px);box-shadow:var(--kritzel-context-menu-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12));border:var(--kritzel-context-menu-border, 1px solid #ebebeb);padding:var(--kritzel-context-menu-padding, 4px);min-width:var(--kritzel-context-menu-min-width, 140px)}.menu-item-wrapper{position:relative}.menu-item{display:flex;align-items:center;gap:var(--kritzel-context-menu-item-gap, 8px);font-family:var(--kritzel-context-menu-font-family, var(--kritzel-global-font-family, sans-serif));background:none;border:none;text-align:left;padding:var(--kritzel-context-menu-item-padding, 8px);border-radius:var(--kritzel-context-menu-item-border-radius, 12px);cursor:var(--kritzel-global-pointer-cursor, pointer);font-size:var(--kritzel-context-menu-item-font-size, 14px);color:var(--kritzel-context-menu-item-color, #333333);white-space:nowrap;-webkit-tap-highlight-color:transparent;width:100%;min-width:0}.menu-item:not(.disabled):hover,.menu-item.submenu-open{background-color:var(--kritzel-context-menu-item-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.menu-item:not(.disabled):active{background-color:var(--kritzel-context-menu-item-active-background-color, hsl(0, 0%, 0%, 8.6%))}.menu-item.disabled{color:var(--kritzel-context-menu-item-disabled-color, #aaaaaa)}.menu-item.has-children.disabled{cursor:var(--kritzel-global-pointer-cursor, pointer);color:var(--kritzel-context-menu-item-color, #333333)}.menu-item kritzel-icon{opacity:0.8;flex-shrink:0}.menu-item.disabled kritzel-icon{opacity:0.4}.menu-item.has-children.disabled kritzel-icon{opacity:0.8}.label{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.submenu-arrow{margin-left:auto;opacity:0.5}.menu-divider{height:1px;background-color:var(--kritzel-context-menu-divider-color, rgba(0, 0, 0, 0.1));margin:var(--kritzel-context-menu-divider-margin, 4px 8px)}.submenu-container{position:absolute;top:0;left:100%;z-index:2;margin-left:4px;display:flex;flex-direction:column;gap:var(--kritzel-context-menu-item-spacing, 2px);background-color:var(--kritzel-context-menu-background-color, #ffffff);border-radius:var(--kritzel-context-menu-border-radius, 12px);box-shadow:var(--kritzel-context-menu-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12));border:var(--kritzel-context-menu-border, 1px solid #ebebeb);padding:var(--kritzel-context-menu-padding, 4px);min-width:120px}.submenu-container.position-left{left:auto;right:100%;margin-left:0;margin-right:4px}`;
|
|
3768
3772
|
|
|
3769
3773
|
const VIEWPORT_PADDING = 8;
|
|
3770
3774
|
const SUBMENU_DELAY = 150;
|
|
@@ -3995,7 +3999,7 @@ const KritzelContextMenu = class {
|
|
|
3995
3999
|
const submenuOpen = hasChildren && this.isSubmenuOpen(path);
|
|
3996
4000
|
return [
|
|
3997
4001
|
showDivider && h("div", { class: "menu-divider", key: `divider-${path}` }),
|
|
3998
|
-
h("div", { class: "menu-item-wrapper", key: `wrapper-${path}`, ref: el => el && this.menuItemWrapperRefs.set(path, el), onMouseEnter: () => this.handleItemMouseEnter(path, hasChildren) }, h("button", { key: `${item.label}-${path}`, class: { 'menu-item': true, 'disabled': isDisabled, 'has-children': hasChildren, 'submenu-open': submenuOpen }, onClick: () => this.handleItemClick(item, isDisabled, hasChildren), disabled: isDisabled && !hasChildren }, item.icon && h("kritzel-icon", { name: item.icon, size: 16 }), h("span", { class: "label" }, item.label), hasChildren && h("kritzel-icon", { name: "
|
|
4002
|
+
h("div", { class: "menu-item-wrapper", key: `wrapper-${path}`, ref: el => el && this.menuItemWrapperRefs.set(path, el), onMouseEnter: () => this.handleItemMouseEnter(path, hasChildren) }, h("button", { key: `${item.label}-${path}`, class: { 'menu-item': true, 'disabled': isDisabled, 'has-children': hasChildren, 'submenu-open': submenuOpen }, onClick: () => this.handleItemClick(item, isDisabled, hasChildren), disabled: isDisabled && !hasChildren }, item.icon && h("kritzel-icon", { name: item.icon, size: 16 }), h("span", { class: "label" }, item.label), hasChildren && h("kritzel-icon", { name: "chevronRight", size: 12, class: "submenu-arrow" })), hasChildren && submenuOpen && this.renderSubmenu(processedChildren, path)),
|
|
3999
4003
|
];
|
|
4000
4004
|
});
|
|
4001
4005
|
}
|
|
@@ -4035,7 +4039,7 @@ const KritzelCurrentUser = class {
|
|
|
4035
4039
|
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
4036
4040
|
terms = {};
|
|
4037
4041
|
render() {
|
|
4038
|
-
return (h(Host, { key: '
|
|
4042
|
+
return (h(Host, { key: 'e6b56d76dd339fd10216a4d788d56de1fdd20fc6' }, h("kritzel-avatar", { key: '03445e8fe4c43aa4015b6ec124ac731baec03a22', user: this.user, size: this.avatarSize })));
|
|
4039
4043
|
}
|
|
4040
4044
|
};
|
|
4041
4045
|
KritzelCurrentUser.style = kritzelCurrentUserCss();
|
|
@@ -4076,7 +4080,7 @@ const KritzelCurrentUserDialog = class {
|
|
|
4076
4080
|
}
|
|
4077
4081
|
render() {
|
|
4078
4082
|
const displayName = this.getDisplayName();
|
|
4079
|
-
return (h(Host, { key: '
|
|
4083
|
+
return (h(Host, { key: '267ed65fe03d4de50880b5957c717c47fd2ec0c9' }, h("kritzel-dialog", { key: '7c5ef6bb8b29f04cc194cde990658869a0919015', dialogTitle: this.terms['currentUser.dialogTitle'] ?? 'Account', isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: '734e5f893425d5d89631ad7c3e95697edd751837', class: "user-info" }, h("kritzel-avatar", { key: '926a957b6d7f78184a98f4ad96480b29210e6184', user: this.user, size: 80 }), displayName && h("div", { key: '054d3a724d0785d2a161fdcba23ca33c07dc18e2', class: "user-name" }, displayName), this.user?.email && h("div", { key: 'a401b8f48d9dcd4ec990072f63a27111c476c224', class: "user-email" }, this.user.email), h("kritzel-button", { key: 'b1e8757279910a71dbee12be19635b4aa55bd23e', class: "logout-button", variant: "primary", onButtonClick: this.handleLogout }, this.terms['menu.logout'] ?? 'Logout')))));
|
|
4080
4084
|
}
|
|
4081
4085
|
};
|
|
4082
4086
|
KritzelCurrentUserDialog.style = kritzelCurrentUserDialogCss();
|
|
@@ -4156,7 +4160,7 @@ const KritzelCursorTrail = class {
|
|
|
4156
4160
|
}
|
|
4157
4161
|
}
|
|
4158
4162
|
render() {
|
|
4159
|
-
return (h(Host, { key: '
|
|
4163
|
+
return (h(Host, { key: '39d026a0d4c444564f146a90ea1a51181d0652b7' }, this.cursorTrailPoints.length > 1 && (h("svg", { key: '927e52cd0828a548ba58e0e783b1d148a40c968c', class: "cursor-trail-svg", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
4160
4164
|
position: 'absolute',
|
|
4161
4165
|
left: '0',
|
|
4162
4166
|
top: '0',
|
|
@@ -4179,7 +4183,7 @@ const KritzelCursorTrail = class {
|
|
|
4179
4183
|
};
|
|
4180
4184
|
KritzelCursorTrail.style = kritzelCursorTrailCss();
|
|
4181
4185
|
|
|
4182
|
-
const kritzelDialogCss = () => `:host{display:contents}.dialog-content{text-align:start;line-height:normal}.backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10002;display:flex;align-items:center;justify-content:center;background-color:var(--kritzel-dialog-backdrop-color, rgba(0, 0, 0, 0.5));opacity:1;transition:opacity 150ms ease-out}.backdrop.is-animating{opacity:0}.dialog-content{position:relative;display:flex;flex-direction:column;background-color:var(--kritzel-dialog-background-color, #ffffff);border-radius:var(--kritzel-dialog-border-radius, 12px);box-shadow:var(--kritzel-dialog-box-shadow, 0 4px 20px rgba(0, 0, 0, 0.15));border:var(--kritzel-dialog-border, 1px solid #ebebeb);max-height:var(--kritzel-dialog-max-height, 90vh);max-width:var(--kritzel-dialog-max-width, 90vw);overflow:hidden;transform:scale(1);opacity:1;transition:transform 200ms ease-out,
|
|
4186
|
+
const kritzelDialogCss = () => `:host{display:contents}.dialog-content{text-align:start;line-height:normal}.backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10002;display:flex;align-items:center;justify-content:center;background-color:var(--kritzel-dialog-backdrop-color, rgba(0, 0, 0, 0.5));opacity:1;transition:opacity 150ms ease-out}.backdrop.is-animating{opacity:0}.dialog-content{position:relative;display:flex;flex-direction:column;background-color:var(--kritzel-dialog-background-color, #ffffff);border-radius:var(--kritzel-dialog-border-radius, 12px);box-shadow:var(--kritzel-dialog-box-shadow, 0 4px 20px rgba(0, 0, 0, 0.15));border:var(--kritzel-dialog-border, 1px solid #ebebeb);max-height:var(--kritzel-dialog-max-height, 90vh);max-width:var(--kritzel-dialog-max-width, 90vw);overflow:hidden;transform:scale(1);opacity:1;transition:transform 200ms ease-out, opacity 200ms ease-out;font-family:var(--kritzel-dialog-font-family, var(--kritzel-global-font-family, sans-serif))}.dialog-content.is-animating{transform:scale(0.95);opacity:0}.dialog-content.size-small{width:var(--kritzel-dialog-width-small, 320px);height:var(--kritzel-dialog-height-small, auto)}.dialog-content.size-medium{width:var(--kritzel-dialog-width-medium, 480px);height:var(--kritzel-dialog-height-medium, auto)}.dialog-content.size-large{width:var(--kritzel-dialog-width-large, 640px);height:var(--kritzel-dialog-height-large, auto)}.dialog-content.size-fullscreen{width:100vw;height:100vh;height:100dvh;max-width:100vw;max-height:100vh;max-height:100dvh;border-radius:0}.backdrop.contained-fullscreen{background-color:transparent}.dialog-content.contained-fullscreen{border-radius:0}.dialog-content.contained-fullscreen .dialog-body{display:flex;flex-direction:column}.dialog-content.contained-fullscreen .dialog-body ::slotted(*){flex:1;min-height:0}@media (max-width: 576px), (max-height: 576px) and (orientation: landscape){.backdrop:has(.fullscreen-on-mobile){background-color:transparent}.dialog-content.fullscreen-on-mobile{width:100vw;height:100vh;height:100dvh;max-width:100vw;max-height:100vh;max-height:100dvh;border-radius:0}.dialog-content.fullscreen-on-mobile .dialog-body{display:flex;flex-direction:column}.dialog-content.fullscreen-on-mobile .dialog-body ::slotted(*){flex:1;min-height:0}}.dialog-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kritzel-dialog-header-padding, 16px 20px);border-bottom:var(--kritzel-dialog-header-border, 1px solid #ebebeb);gap:12px}.dialog-title{margin:0;font-size:var(--kritzel-dialog-title-font-size, 18px);font-weight:var(--kritzel-dialog-title-font-weight, 600);color:var(--kritzel-dialog-title-color, #1a1a1a);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.close-button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:var(--kritzel-dialog-close-button-border-radius, 6px);background-color:var(--kritzel-dialog-close-button-background, transparent);color:var(--kritzel-dialog-close-button-color, #666666);cursor:var(--kritzel-global-pointer-cursor, pointer);transition:background-color 150ms ease, color 150ms ease;flex-shrink:0;-webkit-tap-highlight-color:transparent}.close-button:hover{background-color:var(--kritzel-dialog-close-button-hover-background, #f5f5f5);color:var(--kritzel-dialog-close-button-hover-color, #1a1a1a)}.close-button:active{background-color:var(--kritzel-dialog-close-button-active-background, #ebebeb)}.close-button:focus-visible{outline:revert;outline-offset:revert}.dialog-body{padding:var(--kritzel-dialog-body-padding, 20px);overflow-y:auto;flex:1;min-height:0;scrollbar-color:var(--kritzel-global-scrollbar-thumb-color, #ebebeb) transparent;scrollbar-width:thin}.dialog-footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--kritzel-dialog-footer-gap, 8px);padding:var(--kritzel-dialog-footer-padding, 16px 20px);border-top:var(--kritzel-dialog-footer-border, 1px solid #ebebeb)}::slotted([slot='header']){flex:1}::slotted([slot='footer']){display:contents}`;
|
|
4183
4187
|
|
|
4184
4188
|
const KritzelDialog = class {
|
|
4185
4189
|
constructor(hostRef) {
|
|
@@ -4622,7 +4626,7 @@ const KritzelDialog = class {
|
|
|
4622
4626
|
};
|
|
4623
4627
|
KritzelDialog.style = kritzelDialogCss();
|
|
4624
4628
|
|
|
4625
|
-
const kritzelDropdownCss = () => `:host{display:inline-flex;vertical-align:middle;width:100%;position:relative}.dropdown-wrapper{display:flex;align-items:center;border:1px solid var(--kritzel-dropdown-border-color, #ebebeb);border-radius:var(--kritzel-dropdown-border-radius, 6px);overflow:visible;height:38px;width:100%;position:relative}.dropdown-wrapper:hover:not(:focus-within){border-color:var(--kritzel-dropdown-hover-border-color, #cccccc)}.dropdown-container{flex:1;height:100%;min-width:0}.dropdown-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px;height:100%;width:100%;box-sizing:border-box;border-radius:var(--kritzel-dropdown-border-radius, 6px);border:none;background-color:var(--kritzel-dropdown-background, #ffffff);cursor:var(--kritzel-global-pointer-cursor, pointer);outline:none;font-size:inherit;font-family:inherit;color:var(--kritzel-dropdown-text-color, #333333);-webkit-tap-highlight-color:transparent;text-align:left}.dropdown-trigger:focus-visible{outline:revert}.dropdown-trigger.has-suffix-border{border-right:1px solid var(--kritzel-global-border-color, #ebebeb);border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-trigger.has-prefix-border{border-left:1px solid var(--kritzel-global-border-color, #ebebeb);border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-trigger-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.dropdown-trigger-arrow{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;transition:transform 0.2s ease}.dropdown-trigger-arrow svg{width:100%;height:100%}.dropdown-trigger.is-open .dropdown-trigger-arrow{transform:rotate(180deg)}.dropdown-trigger.is-open.open-up .dropdown-trigger-arrow{transform:rotate(0deg)}.dropdown-menu{position:absolute;left:0;right:0;margin:0;padding:4px 0;list-style:none;background-color:var(--kritzel-dropdown-background, #ffffff);border:1px solid var(--kritzel-global-border-color, #ebebeb);border-radius:var(--kritzel-dropdown-menu-border-radius, var(--kritzel-dropdown-border-radius, 6px));box-shadow:var(--kritzel-toolbar-box-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));z-index:1000;max-height:240px;overflow-y:auto;opacity:0;visibility:hidden;transition:opacity 0.15s ease,
|
|
4629
|
+
const kritzelDropdownCss = () => `:host{display:inline-flex;vertical-align:middle;width:100%;position:relative}.dropdown-wrapper{display:flex;align-items:center;border:1px solid var(--kritzel-dropdown-border-color, #ebebeb);border-radius:var(--kritzel-dropdown-border-radius, 6px);overflow:visible;height:38px;width:100%;position:relative}.dropdown-wrapper:hover:not(:focus-within){border-color:var(--kritzel-dropdown-hover-border-color, #cccccc)}.dropdown-container{flex:1;height:100%;min-width:0}.dropdown-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px;height:100%;width:100%;box-sizing:border-box;border-radius:var(--kritzel-dropdown-border-radius, 6px);border:none;background-color:var(--kritzel-dropdown-background, #ffffff);cursor:var(--kritzel-global-pointer-cursor, pointer);outline:none;font-size:inherit;font-family:inherit;color:var(--kritzel-dropdown-text-color, #333333);-webkit-tap-highlight-color:transparent;text-align:left}.dropdown-trigger:focus-visible{outline:revert}.dropdown-trigger.has-suffix-border{border-right:1px solid var(--kritzel-global-border-color, #ebebeb);border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-trigger.has-prefix-border{border-left:1px solid var(--kritzel-global-border-color, #ebebeb);border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-trigger-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.dropdown-trigger-arrow{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;transition:transform 0.2s ease}.dropdown-trigger-arrow svg{width:100%;height:100%}.dropdown-trigger.is-open .dropdown-trigger-arrow{transform:rotate(180deg)}.dropdown-trigger.is-open.open-up .dropdown-trigger-arrow{transform:rotate(0deg)}.dropdown-menu{position:absolute;left:0;right:0;margin:0;padding:4px 0;list-style:none;background-color:var(--kritzel-dropdown-background, #ffffff);border:1px solid var(--kritzel-global-border-color, #ebebeb);border-radius:var(--kritzel-dropdown-menu-border-radius, var(--kritzel-dropdown-border-radius, 6px));box-shadow:var(--kritzel-toolbar-box-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));z-index:1000;max-height:240px;overflow-y:auto;opacity:0;visibility:hidden;transition:opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;outline:none}.dropdown-menu.open-down{top:calc(100% + 4px);bottom:auto;transform:translateY(-8px)}.dropdown-menu.open-up{bottom:calc(100% + 4px);top:auto;transform:translateY(8px)}.dropdown-menu.is-open{opacity:1;visibility:inherit;transform:translateY(0)}.dropdown-menu.open-up{box-shadow:var(--kritzel-toolbar-box-shadow, 0 -4px 12px rgba(0, 0, 0, 0.15))}.dropdown-option{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;cursor:var(--kritzel-global-pointer-cursor, pointer);color:var(--kritzel-dropdown-text-color, #333333);transition:background-color 0.1s ease;-webkit-tap-highlight-color:transparent}.dropdown-option.is-focused{background-color:var(--kritzel-dropdown-hover-background-color, #f0f0f0)}.dropdown-option.is-selected{font-weight:600;background-color:var(--kritzel-dropdown-selected-background-color, #007bff1a)}.dropdown-option-check{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:var(--kritzel-dropdown-accent-color, #007bff)}.dropdown-option-check svg{width:100%;height:100%}.dropdown-menu{scrollbar-color:var(--kritzel-global-scrollbar-thumb-color, #ebebeb) transparent;scrollbar-width:thin}::slotted(*){height:100%;box-sizing:border-box}`;
|
|
4626
4630
|
|
|
4627
4631
|
const KritzelDropdown = class {
|
|
4628
4632
|
constructor(hostRef) {
|
|
@@ -4860,7 +4864,7 @@ const KritzelDropdown = class {
|
|
|
4860
4864
|
'open-up': this.openDirection === 'up',
|
|
4861
4865
|
'open-down': this.openDirection === 'down',
|
|
4862
4866
|
};
|
|
4863
|
-
return (h(Host, { key: '
|
|
4867
|
+
return (h(Host, { key: 'c606b338e55dc66396105fa7b4fbdf372f3866e6' }, h("div", { key: 'aa32b73cac337fa4142ecc124cf039a59e3b3118', class: "dropdown-wrapper", ref: el => (this.wrapperElement = el) }, h("slot", { key: '2cd8e9ef246a24c49d58f76f227f36aed4786178', name: "prefix", ref: el => (this.prefixSlotElement = el), onSlotchange: this.evaluatePrefixContent }), h("div", { key: '80df8155e1907017d508e92f155bab5ae12dffab', class: "dropdown-container", style: { width: this.width } }, h("button", { key: 'd86463de7ec58248f1611d6b5d46f0eafc117f36', type: "button", class: triggerClasses, style: { ...this.selectStyles, ...this.getSelectedStyle() }, onClick: this.toggleMenu, onKeyDown: this.handleTriggerKeyDown, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', ref: el => (this.triggerElement = el) }, h("span", { key: '4ef6a997f7a781fb409e97ed5bd6843d0eaff0bb', class: "dropdown-trigger-label" }, this.getSelectedLabel()), h("span", { key: '6601efcd69d84af1f022d14ede628bac743cc1f1', class: "dropdown-trigger-arrow", "aria-hidden": "true" }, h("svg", { key: '6cb2efe7b4ca890562c10b0e24eb1dfdad90ec24', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { key: 'a340af5a61dccf5bc29c8a473726b58055c2e9db', points: "6 9 12 15 18 9" }))))), h("slot", { key: '5bd4e5ad4cc4642c7769ecac2106ba82bae626f2', name: "suffix", ref: el => (this.suffixSlotElement = el), onSlotchange: this.evaluateSuffixContent }), h("ul", { key: 'e7a2be8ac261bc5fa1450940e2a57090d6be3315', class: menuClasses, role: "listbox", tabindex: "-1", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElement = el) }, this.options.map((option, index) => {
|
|
4864
4868
|
const isSelected = option.value === this.internalValue;
|
|
4865
4869
|
const isFocused = index === this.focusedIndex;
|
|
4866
4870
|
const optionClasses = {
|
|
@@ -4882,7 +4886,7 @@ const KritzelDropdown = class {
|
|
|
4882
4886
|
};
|
|
4883
4887
|
KritzelDropdown.style = kritzelDropdownCss();
|
|
4884
4888
|
|
|
4885
|
-
const kritzelEditorCss = () => `kritzel-editor{display:flex;margin:0;position:relative;container-type:inline-size;overflow:hidden;width:100%;height:100%;align-items:center;justify-content:center;touch-action:manipulation;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:start;line-height:normal}.editor-content{position:absolute;inset:0}.editor-content>kritzel-engine{position:absolute;inset:0;z-index:0}kritzel-toolbar{position:absolute;z-index:2;left:0;right:0;margin-inline:auto;width:max-content;max-width:calc(100% - 16px);bottom:var(--kritzel-editor-toolbar-bottom, 14px);transition:transform var(--kritzel-editor-toolbar-transition-duration, 0.1s) var(--kritzel-editor-toolbar-transition, ease-in-out)}kritzel-toolbar.keyboard-open{transform:var(--kritzel-editor-toolbar-transform, translateY(300%))}.top-left-buttons{position:absolute;z-index:2;top:var(--kritzel-editor-top-left-buttons-top, 14px);left:var(--kritzel-editor-top-left-buttons-left, 14px);display:flex;align-items:flex-start;gap:8px}.top-center-notification-layer{position:absolute;top:var(--kritzel-editor-top-center-notification-top, 14px);left:0;right:0;z-index:var(--kritzel-editor-top-center-notification-z-index, 10001);display:flex;justify-content:center;pointer-events:none}.top-center-notification-container{width:min(90vw, 420px);pointer-events:auto;animation:kritzel-notification-slide-in var(--kritzel-editor-notification-animation-duration, 220ms)
|
|
4889
|
+
const kritzelEditorCss = () => `kritzel-editor{display:flex;margin:0;position:relative;container-type:inline-size;overflow:hidden;width:100%;height:100%;align-items:center;justify-content:center;touch-action:manipulation;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:start;line-height:normal}.editor-content{position:absolute;inset:0}.editor-content>kritzel-engine{position:absolute;inset:0;z-index:0}kritzel-toolbar{position:absolute;z-index:2;left:0;right:0;margin-inline:auto;width:max-content;max-width:calc(100% - 16px);bottom:var(--kritzel-editor-toolbar-bottom, 14px);transition:transform var(--kritzel-editor-toolbar-transition-duration, 0.1s) var(--kritzel-editor-toolbar-transition, ease-in-out)}kritzel-toolbar.keyboard-open{transform:var(--kritzel-editor-toolbar-transform, translateY(300%))}.top-left-buttons{position:absolute;z-index:2;top:var(--kritzel-editor-top-left-buttons-top, 14px);left:var(--kritzel-editor-top-left-buttons-left, 14px);display:flex;align-items:flex-start;gap:8px}.top-center-notification-layer{position:absolute;top:var(--kritzel-editor-top-center-notification-top, 14px);left:0;right:0;z-index:var(--kritzel-editor-top-center-notification-z-index, 10001);display:flex;justify-content:center;pointer-events:none}.top-center-notification-container{width:min(90vw, 420px);pointer-events:auto;animation:kritzel-notification-slide-in var(--kritzel-editor-notification-animation-duration, 220ms) var(--kritzel-editor-notification-animation-easing, cubic-bezier(0.22, 1, 0.36, 1))}.top-center-notification-container.is-dismissing{animation:kritzel-notification-fade-out var(--kritzel-editor-notification-dismiss-animation-duration, 180ms) var(--kritzel-editor-notification-dismiss-animation-easing, ease-in) forwards}@keyframes kritzel-notification-slide-in{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes kritzel-notification-fade-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-6px)}}@media (prefers-reduced-motion: reduce){.top-center-notification-container{animation:none}}.top-right-buttons{position:absolute;z-index:2;top:var(--kritzel-editor-top-right-buttons-top, 14px);right:var(--kritzel-editor-top-right-buttons-right, 14px);display:flex;align-items:center;gap:8px}.bottom-left-buttons{position:absolute;z-index:2;left:var(--kritzel-editor-top-left-buttons-left, 14px);bottom:var(--kritzel-editor-toolbar-bottom, 14px);display:flex;align-items:flex-end}@container (max-width: 767px){.bottom-left-buttons{display:none}}.top-right-button{display:flex;align-items:center;justify-content:center;width:50px;height:50px;padding:0;border:var(--kritzel-split-button-border, 1px solid #ebebeb);border-radius:var(--kritzel-split-button-border-radius, 12px);background-color:var(--kritzel-split-button-background-color, #ffffff);cursor:var(--kritzel-global-pointer-cursor, pointer);box-shadow:var(--kritzel-split-button-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));transition:background-color 150ms ease;-webkit-tap-highlight-color:transparent}.top-right-button:hover{background-color:#f5f5f5}.top-right-button:active{background-color:#ebebeb}`;
|
|
4886
4890
|
|
|
4887
4891
|
const KritzelEditor = class {
|
|
4888
4892
|
constructor(hostRef) {
|
|
@@ -4952,12 +4956,12 @@ const KritzelEditor = class {
|
|
|
4952
4956
|
name: 'shape',
|
|
4953
4957
|
type: 'tool',
|
|
4954
4958
|
tool: KritzelShapeTool$1,
|
|
4955
|
-
icon: '
|
|
4959
|
+
icon: 'shapeRectangle',
|
|
4956
4960
|
config: DEFAULT_SHAPE_CONFIG,
|
|
4957
4961
|
subOptions: [
|
|
4958
|
-
{ id: 'rectangle', icon: '
|
|
4959
|
-
{ id: 'ellipse', icon: '
|
|
4960
|
-
{ id: 'triangle', icon: '
|
|
4962
|
+
{ id: 'rectangle', icon: 'shapeRectangle', label: 'Rectangle', value: ShapeType$1.Rectangle, toolProperty: 'shapeType' },
|
|
4963
|
+
{ id: 'ellipse', icon: 'shapeEllipse', label: 'Ellipse', value: ShapeType$1.Ellipse, toolProperty: 'shapeType' },
|
|
4964
|
+
{ id: 'triangle', icon: 'shapeTriangle', label: 'Triangle', value: ShapeType$1.Triangle, toolProperty: 'shapeType' },
|
|
4961
4965
|
],
|
|
4962
4966
|
},
|
|
4963
4967
|
{
|
|
@@ -4986,7 +4990,7 @@ const KritzelEditor = class {
|
|
|
4986
4990
|
},
|
|
4987
4991
|
{
|
|
4988
4992
|
label: 'menu.selectAll',
|
|
4989
|
-
icon: '
|
|
4993
|
+
icon: 'selectAll',
|
|
4990
4994
|
action: () => this.selectAllObjectsInViewport(),
|
|
4991
4995
|
},
|
|
4992
4996
|
];
|
|
@@ -5017,10 +5021,10 @@ const KritzelEditor = class {
|
|
|
5017
5021
|
icon: 'ordering',
|
|
5018
5022
|
group: 'other',
|
|
5019
5023
|
children: [
|
|
5020
|
-
{ label: 'menu.bringToFront', icon: '
|
|
5021
|
-
{ label: 'menu.sendToBack', icon: '
|
|
5022
|
-
{ label: 'menu.moveUp', icon: '
|
|
5023
|
-
{ label: 'menu.moveDown', icon: '
|
|
5024
|
+
{ label: 'menu.bringToFront', icon: 'bringToFront', action: () => this.engineRef.bringToFront() },
|
|
5025
|
+
{ label: 'menu.sendToBack', icon: 'sendToBack', action: () => this.engineRef.sendToBack() },
|
|
5026
|
+
{ label: 'menu.moveUp', icon: 'arrowUpFromDot', action: () => this.engineRef.bringForward() },
|
|
5027
|
+
{ label: 'menu.moveDown', icon: 'arrowDownFromDot', action: () => this.engineRef.sendBackward() },
|
|
5024
5028
|
],
|
|
5025
5029
|
},
|
|
5026
5030
|
{
|
|
@@ -5028,12 +5032,12 @@ const KritzelEditor = class {
|
|
|
5028
5032
|
icon: 'align',
|
|
5029
5033
|
group: 'other',
|
|
5030
5034
|
children: [
|
|
5031
|
-
{ label: 'menu.alignLeft', icon: '
|
|
5032
|
-
{ label: 'menu.alignCenterHorizontal', icon: '
|
|
5033
|
-
{ label: 'menu.alignRight', icon: '
|
|
5034
|
-
{ label: 'menu.alignTop', icon: '
|
|
5035
|
-
{ label: 'menu.alignCenterVertical', icon: '
|
|
5036
|
-
{ label: 'menu.alignBottom', icon: '
|
|
5035
|
+
{ label: 'menu.alignLeft', icon: 'alignStartVertical', action: () => this.engineRef.alignObjects(KritzelAlignment$1.StartHorizontal) },
|
|
5036
|
+
{ label: 'menu.alignCenterHorizontal', icon: 'alignCenterHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment$1.CenterHorizontal) },
|
|
5037
|
+
{ label: 'menu.alignRight', icon: 'alignEndVertical', action: () => this.engineRef.alignObjects(KritzelAlignment$1.EndHorizontal) },
|
|
5038
|
+
{ label: 'menu.alignTop', icon: 'alignStartHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment$1.StartVertical) },
|
|
5039
|
+
{ label: 'menu.alignCenterVertical', icon: 'alignCenterVertical', action: () => this.engineRef.alignObjects(KritzelAlignment$1.CenterVertical) },
|
|
5040
|
+
{ label: 'menu.alignBottom', icon: 'alignEndHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment$1.EndVertical) },
|
|
5037
5041
|
],
|
|
5038
5042
|
},
|
|
5039
5043
|
{
|
|
@@ -5206,6 +5210,9 @@ const KritzelEditor = class {
|
|
|
5206
5210
|
onCustomFontsChange(newValue) {
|
|
5207
5211
|
void this.registerCustomFonts(newValue);
|
|
5208
5212
|
}
|
|
5213
|
+
onCustomSvgIconsChange(newValue) {
|
|
5214
|
+
this.registerCustomSvgIcons(newValue);
|
|
5215
|
+
}
|
|
5209
5216
|
onMoreMenuItemsChange() {
|
|
5210
5217
|
this.recomputeMoreMenuItems();
|
|
5211
5218
|
}
|
|
@@ -5378,12 +5385,11 @@ const KritzelEditor = class {
|
|
|
5378
5385
|
async reinitSync() {
|
|
5379
5386
|
return this.engineRef.reinitSync();
|
|
5380
5387
|
}
|
|
5381
|
-
// ── Tool management ─────────────────────────────────────────────────
|
|
5382
5388
|
async registerTool(toolName, toolClass, toolConfig) {
|
|
5383
5389
|
return this.engineRef.registerTool(toolName, toolClass, toolConfig);
|
|
5384
5390
|
}
|
|
5385
|
-
async
|
|
5386
|
-
return this.engineRef.
|
|
5391
|
+
async setActiveTool(toolName) {
|
|
5392
|
+
return this.engineRef.setActiveTool(toolName);
|
|
5387
5393
|
}
|
|
5388
5394
|
async disable() {
|
|
5389
5395
|
return this.engineRef.disable();
|
|
@@ -5622,15 +5628,21 @@ const KritzelEditor = class {
|
|
|
5622
5628
|
loginDialogRef;
|
|
5623
5629
|
currentUserDialogRef;
|
|
5624
5630
|
componentWillLoad() {
|
|
5631
|
+
this.registerCustomSvgIcons(this.customSvgIcons);
|
|
5625
5632
|
this.recomputeMoreMenuItems();
|
|
5626
5633
|
this.loadSettingsFromStorage();
|
|
5627
5634
|
this.applyTheme();
|
|
5628
5635
|
}
|
|
5636
|
+
componentWillRender() {
|
|
5637
|
+
this.registerCustomSvgIcons(this.customSvgIcons);
|
|
5638
|
+
}
|
|
5629
5639
|
isTextToolConfig(config) {
|
|
5630
5640
|
return !!config && 'fontFamily' in config && 'size' in config && 'color' in config;
|
|
5631
5641
|
}
|
|
5632
5642
|
lastToolbarItemsRef = null;
|
|
5633
5643
|
lastNormalizedToolbarItems = [];
|
|
5644
|
+
lastToolsSource = null;
|
|
5645
|
+
lastTools = [];
|
|
5634
5646
|
getNormalizedToolbarItems() {
|
|
5635
5647
|
if (this.toolbarItems !== this.lastToolbarItemsRef) {
|
|
5636
5648
|
this.lastToolbarItemsRef = this.toolbarItems;
|
|
@@ -5638,6 +5650,16 @@ const KritzelEditor = class {
|
|
|
5638
5650
|
}
|
|
5639
5651
|
return this.lastNormalizedToolbarItems;
|
|
5640
5652
|
}
|
|
5653
|
+
getTools() {
|
|
5654
|
+
const normalizedToolbarItems = this.getNormalizedToolbarItems();
|
|
5655
|
+
if (normalizedToolbarItems !== this.lastToolsSource) {
|
|
5656
|
+
this.lastToolsSource = normalizedToolbarItems;
|
|
5657
|
+
this.lastTools = normalizedToolbarItems
|
|
5658
|
+
.filter(item => item.type === 'tool' && !!item.tool)
|
|
5659
|
+
.map(item => ({ name: item.name, tool: item.tool, config: item.config }));
|
|
5660
|
+
}
|
|
5661
|
+
return this.lastTools;
|
|
5662
|
+
}
|
|
5641
5663
|
normalizeToolbar(toolbarItems) {
|
|
5642
5664
|
return toolbarItems.map(control => {
|
|
5643
5665
|
if (!this.isTextToolConfig(control.config)) {
|
|
@@ -5666,7 +5688,6 @@ const KritzelEditor = class {
|
|
|
5666
5688
|
return this.themes?.find(t => t.name === this.theme) ?? (this.theme === 'dark' ? darkTheme$1 : lightTheme$1);
|
|
5667
5689
|
}
|
|
5668
5690
|
componentDidLoad() {
|
|
5669
|
-
this.registerCustomSvgIcons();
|
|
5670
5691
|
this.registerCustomFonts();
|
|
5671
5692
|
this.listenForMobileKeyboard();
|
|
5672
5693
|
this.setOsSpecificCssVariables();
|
|
@@ -6032,10 +6053,13 @@ const KritzelEditor = class {
|
|
|
6032
6053
|
getContentObjects(objects) {
|
|
6033
6054
|
return objects.filter(obj => !(obj instanceof KritzelSelectionGroup$1) && !(obj instanceof KritzelSelectionBox$1));
|
|
6034
6055
|
}
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6056
|
+
lastCustomSvgIcons;
|
|
6057
|
+
registerCustomSvgIcons(icons) {
|
|
6058
|
+
if (icons === this.lastCustomSvgIcons) {
|
|
6059
|
+
return;
|
|
6038
6060
|
}
|
|
6061
|
+
this.lastCustomSvgIcons = icons;
|
|
6062
|
+
KritzelIconRegistry$1.registerIcons(icons ?? {});
|
|
6039
6063
|
}
|
|
6040
6064
|
async registerCustomFonts(fonts = this.customFonts) {
|
|
6041
6065
|
KritzelFontRegistry$1.registerFonts(fonts);
|
|
@@ -6095,48 +6119,49 @@ const KritzelEditor = class {
|
|
|
6095
6119
|
const shouldShowCurrentUser = isLoggedIn;
|
|
6096
6120
|
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
6097
6121
|
const normalizedToolbarItems = this.getNormalizedToolbarItems();
|
|
6098
|
-
|
|
6122
|
+
const tools = this.getTools();
|
|
6123
|
+
return (h(Host, { key: '939e4336009f65e1d1a3ec9b756de38a5fa942d6' }, h("div", { key: 'c216ac3097a8472ba74532b2c6c300efd90134cf', class: "editor-content", style: {
|
|
6099
6124
|
opacity: this.isEditorVisible ? '1' : '0',
|
|
6100
6125
|
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
6101
6126
|
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
6102
|
-
} }, h("div", { key: '
|
|
6127
|
+
} }, h("div", { key: '6796a763912435553cde891847302746491f493b', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'e13510ec3f76f8aab2c3b0771c3363d92d93cc6a', ref: el => {
|
|
6103
6128
|
if (el) {
|
|
6104
6129
|
this.workspaceManagerRef = el;
|
|
6105
6130
|
}
|
|
6106
|
-
}, visible: this.isWorkspaceManagerVisible, workspaces: this.availableWorkspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => this.handleWorkspaceManagerChange(event), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '
|
|
6131
|
+
}, visible: this.isWorkspaceManagerVisible, workspaces: this.availableWorkspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => this.handleWorkspaceManagerChange(event), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '9115ee23e578a66f46b202623c241277ef092544', visible: this.isBackToContentButtonVisible, text: this.resolvedTerms['backToContent.label'] ?? 'Back to content', onBackToContent: () => this.backToContent() })), this.activeNotification && (h("div", { key: 'd4379f4d0e4f8b3cf2693f34304b03b1e5a75255', class: "top-center-notification-layer", role: "presentation" }, h("div", { key: '01151742b1338423e669d2382ebe9ad55322c43b', class: { 'top-center-notification-container': true, 'is-dismissing': this.isNotificationDismissing }, role: "presentation" }, h("kritzel-notification-card", { key: 'e802c494bab6b2eae72d8fd4997d362006e63142', 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: '8141865c0beb036f28c135bc41054a68a7b05d01', class: "context-menu", items: this.contextMenuState.items, objects: this.contextMenuState.objects, style: {
|
|
6107
6132
|
position: 'absolute',
|
|
6108
6133
|
left: `${this.contextMenuState.position.x}px`,
|
|
6109
6134
|
top: `${this.contextMenuState.position.y}px`,
|
|
6110
6135
|
zIndex: '10002',
|
|
6111
|
-
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-loading-overlay", { key: '
|
|
6136
|
+
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-loading-overlay", { key: 'a4b6a7389387641c0fe0fe44b7c0948c66d8cdfc', visible: this.isLoadingOverlayVisible, text: this.resolvedTerms['editor.loading'] ?? 'Loading...' }), h("kritzel-engine", { key: '0b3e551a97e2c40548d7dc479fca5f408035a8f4', ref: el => {
|
|
6112
6137
|
if (el) {
|
|
6113
6138
|
this.engineRef = el;
|
|
6114
6139
|
}
|
|
6115
|
-
}, workspaces: this.workspaces, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, 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), onObjectsSelectionChange: event => this.handleObjectsSelectionChange(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), onIsLoadingChange: event => this.handleIsLoadingChange(event) }), h("kritzel-toolbar", { key: '
|
|
6140
|
+
}, workspaces: this.workspaces, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, 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, tools: tools, 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), onObjectsSelectionChange: event => this.handleObjectsSelectionChange(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), onIsLoadingChange: event => this.handleIsLoadingChange(event) }), h("kritzel-toolbar", { key: '3240c2481021aa017a26e1e3e3618d346a3bf1b9', visible: this.isToolbarVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
|
|
6116
6141
|
if (el) {
|
|
6117
6142
|
this.toolbarRef = el;
|
|
6118
6143
|
}
|
|
6119
|
-
}, toolbarItems: normalizedToolbarItems, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsToolbarReady: () => (this.isToolbarReady = true) }), h("div", { key: '
|
|
6144
|
+
}, toolbarItems: normalizedToolbarItems, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsToolbarReady: () => (this.isToolbarReady = true) }), h("div", { key: 'ba83e4189b6ee8a6e060f3d26b4863ff1d5768d2', class: "bottom-left-buttons" }, h("kritzel-zoom-panel", { key: '7725ee71671d68411c5f6bb5da6e2737338880f0', visible: this.isZoomPanelVisible, zoomPercent: this.currentZoomPercent, terms: this.resolvedTerms, onZoomIn: () => this.zoomIn(), onZoomOut: () => this.zoomOut() })), h("div", { key: '1a4f0c9f1c8acf2703e0d101d6e6288f976af7f7', class: "top-right-buttons" }, h("kritzel-settings", { key: 'd14c088c5ed85d4e63b7b478a742e4b01921dec9', ref: el => {
|
|
6120
6145
|
if (el) {
|
|
6121
6146
|
this.settingsRef = el;
|
|
6122
6147
|
}
|
|
6123
|
-
}, 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: '
|
|
6148
|
+
}, 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: '22b5848fd3c395c9c06f67f13b2de5ebe7f20ffe', ref: el => {
|
|
6124
6149
|
if (el) {
|
|
6125
6150
|
this.exportRef = el;
|
|
6126
6151
|
}
|
|
6127
|
-
}, 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: '
|
|
6152
|
+
}, 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: '7c60a610eb996640663331666691acec691128f0', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: 'aa53b3739c92cb01580a61e355ff22d4777ba11e', user: this.user, terms: this.resolvedTerms, onClick: () => this.currentUserDialogRef?.open() }), shouldShowCurrentUser && (h("kritzel-current-user-dialog", { key: 'c709f948752f62122150ecef70788a527edd610e', ref: el => {
|
|
6128
6153
|
if (el) {
|
|
6129
6154
|
this.currentUserDialogRef = el;
|
|
6130
6155
|
}
|
|
6131
|
-
}, user: this.user, terms: this.resolvedTerms, onLogoutRequest: this.handleCurrentUserLogout })), shouldShowLoginButton && h("kritzel-button", { key: '
|
|
6156
|
+
}, user: this.user, terms: this.resolvedTerms, onLogoutRequest: this.handleCurrentUserLogout })), shouldShowLoginButton && h("kritzel-button", { key: 'ed095c276f2a48e74c7c899d216891d2b1130759', onButtonClick: () => this.loginDialogRef?.open() }, this.resolvedTerms['login.dialogTitle'] ?? 'Sign in'), h("kritzel-more-menu", { key: 'cdd22f54afc7acdfd783afbcfa16813ac39f4352', ref: el => {
|
|
6132
6157
|
if (el) {
|
|
6133
6158
|
this.moreMenuRef = el;
|
|
6134
6159
|
}
|
|
6135
|
-
}, items: this.resolvedMoreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '
|
|
6160
|
+
}, items: this.resolvedMoreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '00d09340a36334aa29dde0e306598bb48b8360fc', ref: el => {
|
|
6136
6161
|
if (el) {
|
|
6137
6162
|
this.shareDialogRef = el;
|
|
6138
6163
|
}
|
|
6139
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '
|
|
6164
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '1e4c79482b155a0da9dc664ae1f421773c6a452c', ref: el => {
|
|
6140
6165
|
if (el) {
|
|
6141
6166
|
this.loginDialogRef = el;
|
|
6142
6167
|
}
|
|
@@ -6158,6 +6183,9 @@ const KritzelEditor = class {
|
|
|
6158
6183
|
"customFonts": [{
|
|
6159
6184
|
"onCustomFontsChange": 0
|
|
6160
6185
|
}],
|
|
6186
|
+
"customSvgIcons": [{
|
|
6187
|
+
"onCustomSvgIconsChange": 0
|
|
6188
|
+
}],
|
|
6161
6189
|
"moreMenuItems": [{
|
|
6162
6190
|
"onMoreMenuItemsChange": 0
|
|
6163
6191
|
}],
|
|
@@ -28349,7 +28377,6 @@ class Mark {
|
|
|
28349
28377
|
if (!type)
|
|
28350
28378
|
throw new RangeError(`There is no mark type ${json.type} in this schema`);
|
|
28351
28379
|
let mark = type.create(json.attrs);
|
|
28352
|
-
type.checkAttrs(mark.attrs);
|
|
28353
28380
|
return mark;
|
|
28354
28381
|
}
|
|
28355
28382
|
/**
|
|
@@ -29329,11 +29356,11 @@ class Node {
|
|
|
29329
29356
|
*/
|
|
29330
29357
|
check() {
|
|
29331
29358
|
this.type.checkContent(this.content);
|
|
29332
|
-
this.type.
|
|
29359
|
+
checkAttrs(this.type.attrs, this.attrs, "node", this.type.name);
|
|
29333
29360
|
let copy = Mark.none;
|
|
29334
29361
|
for (let i = 0; i < this.marks.length; i++) {
|
|
29335
29362
|
let mark = this.marks[i];
|
|
29336
|
-
mark.type.
|
|
29363
|
+
checkAttrs(mark.type.attrs, mark.attrs, "mark", mark.type.name);
|
|
29337
29364
|
copy = mark.addToSet(copy);
|
|
29338
29365
|
}
|
|
29339
29366
|
if (!Mark.sameSet(copy, this.marks))
|
|
@@ -29374,7 +29401,6 @@ class Node {
|
|
|
29374
29401
|
}
|
|
29375
29402
|
let content = Fragment.fromJSON(schema, json.content);
|
|
29376
29403
|
let node = schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
29377
|
-
node.type.checkAttrs(node.attrs);
|
|
29378
29404
|
return node;
|
|
29379
29405
|
}
|
|
29380
29406
|
}
|
|
@@ -29424,6 +29450,15 @@ function wrapMarks(marks, str) {
|
|
|
29424
29450
|
str = marks[i].type.name + "(" + str + ")";
|
|
29425
29451
|
return str;
|
|
29426
29452
|
}
|
|
29453
|
+
function checkAttrs(attrs, values, type, name) {
|
|
29454
|
+
for (let attr in values)
|
|
29455
|
+
if (!(attr in attrs))
|
|
29456
|
+
throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
29457
|
+
for (let attr in attrs) {
|
|
29458
|
+
if (attrs[attr].validate)
|
|
29459
|
+
attrs[attr].validate(values[attr]);
|
|
29460
|
+
}
|
|
29461
|
+
}
|
|
29427
29462
|
|
|
29428
29463
|
/**
|
|
29429
29464
|
Instances of this class represent a match state of a node type's
|
|
@@ -29878,27 +29913,21 @@ function defaultAttrs(attrs) {
|
|
|
29878
29913
|
function computeAttrs(attrs, value) {
|
|
29879
29914
|
let built = Object.create(null);
|
|
29880
29915
|
for (let name in attrs) {
|
|
29916
|
+
let attr = attrs[name];
|
|
29881
29917
|
let given = value && value[name];
|
|
29882
29918
|
if (given === undefined) {
|
|
29883
|
-
let attr = attrs[name];
|
|
29884
29919
|
if (attr.hasDefault)
|
|
29885
29920
|
given = attr.default;
|
|
29886
29921
|
else
|
|
29887
29922
|
throw new RangeError("No value supplied for attribute " + name);
|
|
29888
29923
|
}
|
|
29924
|
+
else if (attr.validate) {
|
|
29925
|
+
attr.validate(given);
|
|
29926
|
+
}
|
|
29889
29927
|
built[name] = given;
|
|
29890
29928
|
}
|
|
29891
29929
|
return built;
|
|
29892
29930
|
}
|
|
29893
|
-
function checkAttrs(attrs, values, type, name) {
|
|
29894
|
-
for (let attr in values)
|
|
29895
|
-
if (!(attr in attrs))
|
|
29896
|
-
throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
29897
|
-
for (let attr in attrs) {
|
|
29898
|
-
if (attrs[attr].validate)
|
|
29899
|
-
attrs[attr].validate(values[attr]);
|
|
29900
|
-
}
|
|
29901
|
-
}
|
|
29902
29931
|
function initAttrs(typeName, attrs) {
|
|
29903
29932
|
let result = Object.create(null);
|
|
29904
29933
|
if (attrs)
|
|
@@ -30070,11 +30099,9 @@ let NodeType$1 = class NodeType {
|
|
|
30070
30099
|
throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);
|
|
30071
30100
|
}
|
|
30072
30101
|
/**
|
|
30073
|
-
@internal
|
|
30102
|
+
@internal no longer useful, but called by old prosemirror-view versions
|
|
30074
30103
|
*/
|
|
30075
|
-
checkAttrs(attrs) {
|
|
30076
|
-
checkAttrs(this.attrs, attrs, "node", this.name);
|
|
30077
|
-
}
|
|
30104
|
+
checkAttrs(attrs) { }
|
|
30078
30105
|
/**
|
|
30079
30106
|
Check whether the given mark type is allowed in this node.
|
|
30080
30107
|
*/
|
|
@@ -30221,12 +30248,6 @@ class MarkType {
|
|
|
30221
30248
|
return set[i];
|
|
30222
30249
|
}
|
|
30223
30250
|
/**
|
|
30224
|
-
@internal
|
|
30225
|
-
*/
|
|
30226
|
-
checkAttrs(attrs) {
|
|
30227
|
-
checkAttrs(this.attrs, attrs, "mark", this.name);
|
|
30228
|
-
}
|
|
30229
|
-
/**
|
|
30230
30251
|
Queries whether a given mark type is
|
|
30231
30252
|
[excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
|
|
30232
30253
|
*/
|
|
@@ -36918,7 +36939,8 @@ function nodeLen(node) {
|
|
|
36918
36939
|
}
|
|
36919
36940
|
function isIgnorable(dom, dir) {
|
|
36920
36941
|
let desc = dom.pmViewDesc;
|
|
36921
|
-
return desc
|
|
36942
|
+
return desc ? desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR")
|
|
36943
|
+
: dom.nodeType == 1 && dom.contentEditable == "false";
|
|
36922
36944
|
}
|
|
36923
36945
|
function skipIgnoredNodes(view, dir) {
|
|
36924
36946
|
return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);
|
|
@@ -37507,12 +37529,11 @@ function addContext(slice, context) {
|
|
|
37507
37529
|
if (!type || type.hasRequiredAttrs())
|
|
37508
37530
|
break;
|
|
37509
37531
|
try {
|
|
37510
|
-
type.
|
|
37532
|
+
content = Fragment.from(type.create(array[i + 1], content));
|
|
37511
37533
|
}
|
|
37512
37534
|
catch (e) {
|
|
37513
37535
|
break;
|
|
37514
37536
|
}
|
|
37515
|
-
content = Fragment.from(type.create(array[i + 1], content));
|
|
37516
37537
|
openStart++;
|
|
37517
37538
|
openEnd++;
|
|
37518
37539
|
}
|
|
@@ -37992,7 +38013,7 @@ editHandlers.compositionstart = editHandlers.compositionupdate = view => {
|
|
|
37992
38013
|
if (!view.composing) {
|
|
37993
38014
|
view.domObserver.flush();
|
|
37994
38015
|
let { state } = view, $pos = state.selection.$to;
|
|
37995
|
-
if (state.selection instanceof TextSelection &&
|
|
38016
|
+
if (state.selection instanceof TextSelection && state.selection.empty &&
|
|
37996
38017
|
(state.storedMarks ||
|
|
37997
38018
|
(!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(m => m.type.spec.inclusive === false)) ||
|
|
37998
38019
|
chrome && windows$1 && selectionBeforeUneditable(view))) { // Issue #1500
|
|
@@ -39629,9 +39650,7 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
39629
39650
|
// as being an iOS enter press), just dispatch an Enter key instead.
|
|
39630
39651
|
if (((ios && view.input.lastIOSEnter > Date.now() - 225 &&
|
|
39631
39652
|
(!inlineChange || addedNodes.some(n => n.nodeName == "DIV" || n.nodeName == "P"))) ||
|
|
39632
|
-
(!inlineChange && $from.pos
|
|
39633
|
-
(!$from.sameParent($to) || !$from.parent.inlineContent) &&
|
|
39634
|
-
$from.pos < $to.pos && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", "")))) &&
|
|
39653
|
+
(!inlineChange && looksLikeEnter(parse.doc, $from.pos, $to.pos))) &&
|
|
39635
39654
|
view.someProp("handleKeyDown", f => f(view, keyEvent(13, "Enter")))) {
|
|
39636
39655
|
view.input.lastIOSEnter = 0;
|
|
39637
39656
|
return;
|
|
@@ -39782,6 +39801,16 @@ function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
|
39782
39801
|
// The fragments after the join point must match
|
|
39783
39802
|
return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);
|
|
39784
39803
|
}
|
|
39804
|
+
function looksLikeEnter(content, from, to) {
|
|
39805
|
+
let newTextlines = 0, newLeaves = 0;
|
|
39806
|
+
content.nodesBetween(from, to, (node, pos) => {
|
|
39807
|
+
if (node.isTextblock && pos >= from && pos < to)
|
|
39808
|
+
newTextlines++;
|
|
39809
|
+
else if (node.isText ? /\S/.test(node.text.slice(Math.max(0, from - pos), Math.min(node.nodeSize, to - pos))) : node.isLeaf)
|
|
39810
|
+
newLeaves++;
|
|
39811
|
+
});
|
|
39812
|
+
return newLeaves == 0 && newTextlines == 1;
|
|
39813
|
+
}
|
|
39785
39814
|
function skipClosingAndOpening($pos, fromEnd, mayOpen) {
|
|
39786
39815
|
let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;
|
|
39787
39816
|
while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {
|
|
@@ -42009,7 +42038,7 @@ class KritzelShape extends KritzelBaseObject {
|
|
|
42009
42038
|
|
|
42010
42039
|
const KRITZEL_FONT_REGISTRY_KEY = '__kritzelFontRegistry__';
|
|
42011
42040
|
const KRITZEL_FONT_REGISTRY_EVENT = 'kritzel-font-registry-change';
|
|
42012
|
-
const getGlobalRegistryStore$
|
|
42041
|
+
const getGlobalRegistryStore$2 = () => {
|
|
42013
42042
|
const globalScope = globalThis;
|
|
42014
42043
|
const existing = globalScope[KRITZEL_FONT_REGISTRY_KEY];
|
|
42015
42044
|
if (existing) {
|
|
@@ -42042,7 +42071,7 @@ const normalizeKey = (value) => value.trim().toLocaleLowerCase();
|
|
|
42042
42071
|
const normalizeFamily = (value) => value.trim().toLocaleLowerCase();
|
|
42043
42072
|
class KritzelFontRegistry {
|
|
42044
42073
|
static get _fonts() {
|
|
42045
|
-
return getGlobalRegistryStore$
|
|
42074
|
+
return getGlobalRegistryStore$2().fonts;
|
|
42046
42075
|
}
|
|
42047
42076
|
static getFontFaceSet() {
|
|
42048
42077
|
if (typeof document === 'undefined' || !document.fonts) {
|
|
@@ -44251,9 +44280,8 @@ class KritzelSelectionTool extends KritzelBaseTool {
|
|
|
44251
44280
|
}
|
|
44252
44281
|
if (selectedObject && selectedObject.isSelected === false && selectedObject?.objects.length === 1) {
|
|
44253
44282
|
const firstObj = selectedObject.objects[0];
|
|
44254
|
-
if (
|
|
44255
|
-
// Selected
|
|
44256
|
-
// embedded DOM content. Unselected dynamic objects remain selectable.
|
|
44283
|
+
if (ObjectHelper.isKritzelEmbeddedObject(firstObj)) {
|
|
44284
|
+
// Selected embedded objects hand pointer interaction to their content.
|
|
44257
44285
|
if (firstObj.isSelected && this._core.store.selectionGroup?.objects.length === 1)
|
|
44258
44286
|
return;
|
|
44259
44287
|
}
|
|
@@ -46134,7 +46162,7 @@ class KritzelWorkspace {
|
|
|
46134
46162
|
}
|
|
46135
46163
|
|
|
46136
46164
|
const KRITZEL_RENDERER_REGISTRY_KEY = '__kritzelDynamicObjectRendererRegistry__';
|
|
46137
|
-
const getGlobalRegistryStore = () => {
|
|
46165
|
+
const getGlobalRegistryStore$1 = () => {
|
|
46138
46166
|
const globalScope = globalThis;
|
|
46139
46167
|
const existing = globalScope[KRITZEL_RENDERER_REGISTRY_KEY];
|
|
46140
46168
|
if (existing) {
|
|
@@ -46158,7 +46186,7 @@ const getGlobalRegistryStore = () => {
|
|
|
46158
46186
|
*/
|
|
46159
46187
|
class KritzelDynamicObjectRendererRegistry {
|
|
46160
46188
|
static get _renderers() {
|
|
46161
|
-
return getGlobalRegistryStore().renderers;
|
|
46189
|
+
return getGlobalRegistryStore$1().renderers;
|
|
46162
46190
|
}
|
|
46163
46191
|
/**
|
|
46164
46192
|
* Registers a renderer implementation for a given key.
|
|
@@ -46427,7 +46455,7 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46427
46455
|
}
|
|
46428
46456
|
applyInteractiveState() {
|
|
46429
46457
|
const pointerEvents = this.isInteractive ? 'auto' : 'none';
|
|
46430
|
-
const contentCursor = this.isInteractive ? 'auto' : '';
|
|
46458
|
+
const contentCursor = this.isInteractive ? 'var(--kritzel-global-default-cursor, auto)' : '';
|
|
46431
46459
|
if (this.element) {
|
|
46432
46460
|
this.element.style.pointerEvents = pointerEvents;
|
|
46433
46461
|
this.element.style.cursor = contentCursor;
|
|
@@ -46463,7 +46491,7 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46463
46491
|
if (!this.isInteractive) {
|
|
46464
46492
|
return false;
|
|
46465
46493
|
}
|
|
46466
|
-
const focusHosts = this.
|
|
46494
|
+
const focusHosts = this.getEmbeddedContentRoots();
|
|
46467
46495
|
// Primary path: locate the focused input-like element by walking from each host through
|
|
46468
46496
|
// `:focus` (piercing open shadow roots). This works in real browsers even when the engine
|
|
46469
46497
|
// and editor are nested web components, because it never relies on the document-level
|
|
@@ -46480,7 +46508,7 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46480
46508
|
}
|
|
46481
46509
|
return false;
|
|
46482
46510
|
}
|
|
46483
|
-
|
|
46511
|
+
getEmbeddedContentRoots() {
|
|
46484
46512
|
const hosts = [];
|
|
46485
46513
|
if (this.element) {
|
|
46486
46514
|
hosts.push(this.element);
|
|
@@ -46693,11 +46721,11 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46693
46721
|
* @returns A serializable object with htmlString and dimension snapshots
|
|
46694
46722
|
*/
|
|
46695
46723
|
serialize() {
|
|
46696
|
-
const { _core, _elementRef, element, totalWidth, totalHeight, isSelected, isHovered, isMounted, isInteractive, resizing, markedForRemoval, isVisible, ...props } = this;
|
|
46724
|
+
const { _core, _elementRef, element, totalWidth, totalHeight, isSelected, isHovered, isMounted, isInteractive, resizing, markedForRemoval, isVisible, rendererData, ...props } = this;
|
|
46697
46725
|
const cloned = structuredClone(props);
|
|
46698
46726
|
// Include rendererKey and rendererData for lifecycle-driven rendering
|
|
46699
46727
|
cloned.rendererKey = this.rendererKey;
|
|
46700
|
-
cloned.rendererData = this.
|
|
46728
|
+
cloned.rendererData = this.serializeRendererData();
|
|
46701
46729
|
// Store HTML as string for fallback/compatibility when renderer is unavailable
|
|
46702
46730
|
cloned.htmlString = element ? element.outerHTML : '';
|
|
46703
46731
|
// Capture dimension snapshot at serialization time
|
|
@@ -46705,6 +46733,19 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46705
46733
|
cloned.serializedHeight = this.height;
|
|
46706
46734
|
return cloned;
|
|
46707
46735
|
}
|
|
46736
|
+
serializeRendererData() {
|
|
46737
|
+
if (this.rendererKey) {
|
|
46738
|
+
const renderer = KritzelDynamicObjectRendererRegistry.get(this.rendererKey);
|
|
46739
|
+
if (renderer?.onSerialize) {
|
|
46740
|
+
return structuredClone(renderer.onSerialize({
|
|
46741
|
+
object: this,
|
|
46742
|
+
container: this.isMounted && this.elementRef instanceof HTMLElement ? this.elementRef : null,
|
|
46743
|
+
data: this.rendererData,
|
|
46744
|
+
}));
|
|
46745
|
+
}
|
|
46746
|
+
}
|
|
46747
|
+
return structuredClone(this.rendererData);
|
|
46748
|
+
}
|
|
46708
46749
|
/**
|
|
46709
46750
|
* Deserializes the dynamic object from a plain object.
|
|
46710
46751
|
* Reconstructs the element from stored HTML string with fallback to placeholder.
|
|
@@ -46737,6 +46778,452 @@ class KritzelDynamicObject extends KritzelBaseObject {
|
|
|
46737
46778
|
}
|
|
46738
46779
|
}
|
|
46739
46780
|
|
|
46781
|
+
const IFRAME_STATE_MESSAGE = 'kritzel-iframe-state';
|
|
46782
|
+
const IFRAME_PARENT_STATE_MESSAGE = 'kritzel-iframe-parent-state';
|
|
46783
|
+
const IFRAME_POINTER_MESSAGE = 'kritzel-iframe-pointer';
|
|
46784
|
+
const IFRAME_CONTEXT_MENU_MESSAGE = 'kritzel-iframe-contextmenu';
|
|
46785
|
+
const SUPPORTED_SANDBOX_TOKENS = new Set([
|
|
46786
|
+
'allow-downloads',
|
|
46787
|
+
'allow-forms',
|
|
46788
|
+
'allow-modals',
|
|
46789
|
+
'allow-orientation-lock',
|
|
46790
|
+
'allow-pointer-lock',
|
|
46791
|
+
'allow-popups',
|
|
46792
|
+
'allow-popups-to-escape-sandbox',
|
|
46793
|
+
'allow-presentation',
|
|
46794
|
+
'allow-same-origin',
|
|
46795
|
+
'allow-scripts',
|
|
46796
|
+
'allow-top-navigation-by-user-activation',
|
|
46797
|
+
]);
|
|
46798
|
+
const iframePointerBridgeStarts = new WeakMap();
|
|
46799
|
+
class KritzelIframeObject extends KritzelBaseObject {
|
|
46800
|
+
__class__ = 'KritzelIframeObject';
|
|
46801
|
+
content = { html: '', css: '', script: '' };
|
|
46802
|
+
loadingContent;
|
|
46803
|
+
isLoading = false;
|
|
46804
|
+
state = {};
|
|
46805
|
+
title = 'Embedded content';
|
|
46806
|
+
sandbox = ['allow-scripts'];
|
|
46807
|
+
borderRadius;
|
|
46808
|
+
boxShadow;
|
|
46809
|
+
get html() { return this.content.html; }
|
|
46810
|
+
set html(value) { this.content = { ...this.content, html: value }; }
|
|
46811
|
+
get css() { return this.content.css; }
|
|
46812
|
+
set css(value) { this.content = { ...this.content, css: value }; }
|
|
46813
|
+
get script() { return this.content.script; }
|
|
46814
|
+
set script(value) { this.content = { ...this.content, script: value }; }
|
|
46815
|
+
messageListener = null;
|
|
46816
|
+
constructor(config) {
|
|
46817
|
+
super();
|
|
46818
|
+
this.content = {
|
|
46819
|
+
html: config?.content?.html ?? config?.html ?? '',
|
|
46820
|
+
css: config?.content?.css ?? config?.css ?? '',
|
|
46821
|
+
script: config?.content?.script ?? config?.script ?? '',
|
|
46822
|
+
};
|
|
46823
|
+
this.loadingContent = config?.loadingContent ? {
|
|
46824
|
+
html: config.loadingContent.html ?? '',
|
|
46825
|
+
css: config.loadingContent.css ?? '',
|
|
46826
|
+
script: config.loadingContent.script ?? '',
|
|
46827
|
+
} : undefined;
|
|
46828
|
+
this.isLoading = config?.isLoading ?? false;
|
|
46829
|
+
this.state = structuredClone(config?.state ?? {});
|
|
46830
|
+
this.title = config?.title ?? 'Embedded content';
|
|
46831
|
+
this.sandbox = this.normalizeSandbox(config?.sandbox);
|
|
46832
|
+
this.borderRadius = config?.borderRadius;
|
|
46833
|
+
this.boxShadow = config?.boxShadow;
|
|
46834
|
+
this.translateX = config?.translateX ?? 0;
|
|
46835
|
+
this.translateY = config?.translateY ?? 0;
|
|
46836
|
+
this.rotation = KritzelMathHelper.degreesToRadians(config?.rotation ?? 0);
|
|
46837
|
+
this.scale = config?.scale ?? 1;
|
|
46838
|
+
this.width = config?.width ?? 0;
|
|
46839
|
+
this.height = config?.height ?? 0;
|
|
46840
|
+
}
|
|
46841
|
+
static create(core, config) {
|
|
46842
|
+
const object = new KritzelIframeObject(config);
|
|
46843
|
+
object._core = core;
|
|
46844
|
+
object.id = object.generateId();
|
|
46845
|
+
object.workspaceId = core.store.state.activeWorkspace.id;
|
|
46846
|
+
object.userId = core.user?.id;
|
|
46847
|
+
object.scale = config?.scale ?? core.store.state.scale;
|
|
46848
|
+
object.zIndex = core.store.currentZIndex;
|
|
46849
|
+
return object;
|
|
46850
|
+
}
|
|
46851
|
+
get sandboxAttribute() {
|
|
46852
|
+
return this.sandbox.join(' ');
|
|
46853
|
+
}
|
|
46854
|
+
mount(iframe) {
|
|
46855
|
+
if (this.isMounted && this.elementRef === iframe) {
|
|
46856
|
+
return;
|
|
46857
|
+
}
|
|
46858
|
+
if (this.isMounted) {
|
|
46859
|
+
this.unmount();
|
|
46860
|
+
}
|
|
46861
|
+
this.elementRef = iframe;
|
|
46862
|
+
this.isMounted = true;
|
|
46863
|
+
iframe.title = this.title;
|
|
46864
|
+
iframe.setAttribute('sandbox', this.sandboxAttribute);
|
|
46865
|
+
iframe.style.pointerEvents = this.isInteractive ? 'auto' : 'none';
|
|
46866
|
+
this.messageListener = event => this.handleMessage(event);
|
|
46867
|
+
window.addEventListener('message', this.messageListener);
|
|
46868
|
+
iframe.srcdoc = this.createSourceDocument();
|
|
46869
|
+
this.onMount(this.createLifecycleContext());
|
|
46870
|
+
}
|
|
46871
|
+
unmount() {
|
|
46872
|
+
if (!this.isMounted) {
|
|
46873
|
+
return;
|
|
46874
|
+
}
|
|
46875
|
+
const nextState = this.onUnmount(this.createLifecycleContext());
|
|
46876
|
+
if (nextState !== undefined) {
|
|
46877
|
+
this.state = structuredClone(nextState);
|
|
46878
|
+
}
|
|
46879
|
+
if (this.messageListener) {
|
|
46880
|
+
window.removeEventListener('message', this.messageListener);
|
|
46881
|
+
this.messageListener = null;
|
|
46882
|
+
}
|
|
46883
|
+
this.isMounted = false;
|
|
46884
|
+
this._elementRef = null;
|
|
46885
|
+
}
|
|
46886
|
+
setContent(content) {
|
|
46887
|
+
this.content = {
|
|
46888
|
+
html: content.html ?? this.content.html,
|
|
46889
|
+
css: content.css ?? this.content.css,
|
|
46890
|
+
script: content.script ?? this.content.script,
|
|
46891
|
+
};
|
|
46892
|
+
this.refreshDocument();
|
|
46893
|
+
this.persistUpdate();
|
|
46894
|
+
}
|
|
46895
|
+
setLoadingContent(content) {
|
|
46896
|
+
this.loadingContent = {
|
|
46897
|
+
html: content.html ?? this.loadingContent?.html ?? '',
|
|
46898
|
+
css: content.css ?? this.loadingContent?.css ?? '',
|
|
46899
|
+
script: content.script ?? this.loadingContent?.script ?? '',
|
|
46900
|
+
};
|
|
46901
|
+
this.refreshDocument();
|
|
46902
|
+
this.persistUpdate();
|
|
46903
|
+
}
|
|
46904
|
+
setLoading(isLoading) {
|
|
46905
|
+
this.isLoading = isLoading;
|
|
46906
|
+
this.refreshDocument();
|
|
46907
|
+
this.persistUpdate();
|
|
46908
|
+
}
|
|
46909
|
+
getActiveContent() {
|
|
46910
|
+
const activeLoadingContent = this.isLoading ? this.loadingContent : undefined;
|
|
46911
|
+
return {
|
|
46912
|
+
html: activeLoadingContent?.html ?? this.content.html,
|
|
46913
|
+
css: activeLoadingContent?.css ?? this.content.css,
|
|
46914
|
+
script: activeLoadingContent?.script ?? this.content.script,
|
|
46915
|
+
};
|
|
46916
|
+
}
|
|
46917
|
+
setState(state) {
|
|
46918
|
+
this.state = structuredClone(state);
|
|
46919
|
+
this.elementRef?.contentWindow?.postMessage({ type: IFRAME_PARENT_STATE_MESSAGE, state: this.state }, '*');
|
|
46920
|
+
this.persistUpdate();
|
|
46921
|
+
}
|
|
46922
|
+
setIsInteractive(isInteractive) {
|
|
46923
|
+
this.isInteractive = isInteractive;
|
|
46924
|
+
if (this.isMounted && this.elementRef) {
|
|
46925
|
+
this.elementRef.style.pointerEvents = isInteractive ? 'auto' : 'none';
|
|
46926
|
+
if (!isInteractive) {
|
|
46927
|
+
this.elementRef.blur();
|
|
46928
|
+
}
|
|
46929
|
+
}
|
|
46930
|
+
}
|
|
46931
|
+
hasFocusedInputElement() {
|
|
46932
|
+
return this.isInteractive && this.isMounted && document.activeElement === this.elementRef;
|
|
46933
|
+
}
|
|
46934
|
+
getEmbeddedContentRoots() {
|
|
46935
|
+
return this.isMounted && this.elementRef instanceof HTMLElement && this.elementRef.tagName === 'IFRAME' ? [this.elementRef] : [];
|
|
46936
|
+
}
|
|
46937
|
+
onMount(_context) { }
|
|
46938
|
+
onSerialize(context) {
|
|
46939
|
+
return context.state;
|
|
46940
|
+
}
|
|
46941
|
+
onUnmount(context) {
|
|
46942
|
+
return context.state;
|
|
46943
|
+
}
|
|
46944
|
+
serialize() {
|
|
46945
|
+
const nextState = this.onSerialize(this.createLifecycleContext());
|
|
46946
|
+
this.state = structuredClone(nextState);
|
|
46947
|
+
const messageListener = this.messageListener;
|
|
46948
|
+
this.messageListener = null;
|
|
46949
|
+
try {
|
|
46950
|
+
const serialized = super.serialize();
|
|
46951
|
+
delete serialized.messageListener;
|
|
46952
|
+
return serialized;
|
|
46953
|
+
}
|
|
46954
|
+
finally {
|
|
46955
|
+
this.messageListener = messageListener;
|
|
46956
|
+
}
|
|
46957
|
+
}
|
|
46958
|
+
deserialize(object) {
|
|
46959
|
+
super.deserialize(object);
|
|
46960
|
+
const nextContent = object.content && typeof object.content === 'object' ? object.content : {};
|
|
46961
|
+
const nextLoadingContent = object.loadingContent && typeof object.loadingContent === 'object' ? object.loadingContent : undefined;
|
|
46962
|
+
this.content = {
|
|
46963
|
+
html: typeof nextContent.html === 'string' ? nextContent.html : typeof object.html === 'string' ? object.html : '',
|
|
46964
|
+
css: typeof nextContent.css === 'string' ? nextContent.css : typeof object.css === 'string' ? object.css : '',
|
|
46965
|
+
script: typeof nextContent.script === 'string' ? nextContent.script : typeof object.script === 'string' ? object.script : '',
|
|
46966
|
+
};
|
|
46967
|
+
this.loadingContent = nextLoadingContent ? {
|
|
46968
|
+
html: typeof nextLoadingContent.html === 'string' ? nextLoadingContent.html : '',
|
|
46969
|
+
css: typeof nextLoadingContent.css === 'string' ? nextLoadingContent.css : '',
|
|
46970
|
+
script: typeof nextLoadingContent.script === 'string' ? nextLoadingContent.script : '',
|
|
46971
|
+
} : undefined;
|
|
46972
|
+
this.isLoading = typeof object.isLoading === 'boolean' ? object.isLoading : false;
|
|
46973
|
+
this.state = object.state && typeof object.state === 'object' ? structuredClone(object.state) : {};
|
|
46974
|
+
this.title = typeof object.title === 'string' ? object.title : 'Embedded content';
|
|
46975
|
+
this.sandbox = this.normalizeSandbox(Array.isArray(object.sandbox) ? object.sandbox.filter((token) => typeof token === 'string') : undefined);
|
|
46976
|
+
this.borderRadius = (typeof object.borderRadius === 'number' || typeof object.borderRadius === 'string') ? object.borderRadius : undefined;
|
|
46977
|
+
this.boxShadow = typeof object.boxShadow === 'string' ? object.boxShadow : undefined;
|
|
46978
|
+
this.messageListener = null;
|
|
46979
|
+
return this;
|
|
46980
|
+
}
|
|
46981
|
+
copy() {
|
|
46982
|
+
const copiedObject = super.copy();
|
|
46983
|
+
copiedObject.content = { ...this.content };
|
|
46984
|
+
copiedObject.loadingContent = this.loadingContent ? { ...this.loadingContent } : undefined;
|
|
46985
|
+
copiedObject.isLoading = this.isLoading;
|
|
46986
|
+
copiedObject.state = structuredClone(this.state);
|
|
46987
|
+
copiedObject.sandbox = [...this.sandbox];
|
|
46988
|
+
copiedObject.borderRadius = this.borderRadius;
|
|
46989
|
+
copiedObject.boxShadow = this.boxShadow;
|
|
46990
|
+
copiedObject.messageListener = null;
|
|
46991
|
+
copiedObject._elementRef = null;
|
|
46992
|
+
return copiedObject;
|
|
46993
|
+
}
|
|
46994
|
+
clone() {
|
|
46995
|
+
const clonedObject = super.clone();
|
|
46996
|
+
clonedObject.content = { ...this.content };
|
|
46997
|
+
clonedObject.loadingContent = this.loadingContent ? { ...this.loadingContent } : undefined;
|
|
46998
|
+
clonedObject.isLoading = this.isLoading;
|
|
46999
|
+
clonedObject.state = structuredClone(this.state);
|
|
47000
|
+
clonedObject.sandbox = [...this.sandbox];
|
|
47001
|
+
clonedObject.borderRadius = this.borderRadius;
|
|
47002
|
+
clonedObject.boxShadow = this.boxShadow;
|
|
47003
|
+
clonedObject.messageListener = null;
|
|
47004
|
+
clonedObject.isMounted = false;
|
|
47005
|
+
clonedObject._elementRef = null;
|
|
47006
|
+
return clonedObject;
|
|
47007
|
+
}
|
|
47008
|
+
adoptTransientStateFrom(previous) {
|
|
47009
|
+
if (!(previous instanceof KritzelIframeObject)) {
|
|
47010
|
+
return;
|
|
47011
|
+
}
|
|
47012
|
+
this.isInteractive = previous.isInteractive;
|
|
47013
|
+
this.isSelected = previous.isSelected;
|
|
47014
|
+
this.isHovered = previous.isHovered;
|
|
47015
|
+
if (!previous.isMounted || !(previous.elementRef instanceof HTMLElement) || previous.elementRef.tagName !== 'IFRAME') {
|
|
47016
|
+
return;
|
|
47017
|
+
}
|
|
47018
|
+
if (previous.messageListener) {
|
|
47019
|
+
window.removeEventListener('message', previous.messageListener);
|
|
47020
|
+
}
|
|
47021
|
+
this._elementRef = previous.elementRef;
|
|
47022
|
+
this.isMounted = true;
|
|
47023
|
+
this.messageListener = event => this.handleMessage(event);
|
|
47024
|
+
window.addEventListener('message', this.messageListener);
|
|
47025
|
+
this.elementRef.style.pointerEvents = this.isInteractive ? 'auto' : 'none';
|
|
47026
|
+
previous.messageListener = null;
|
|
47027
|
+
previous.isMounted = false;
|
|
47028
|
+
previous._elementRef = null;
|
|
47029
|
+
}
|
|
47030
|
+
createLifecycleContext() {
|
|
47031
|
+
return {
|
|
47032
|
+
object: this,
|
|
47033
|
+
iframe: this.isMounted ? this.elementRef : null,
|
|
47034
|
+
state: structuredClone(this.state),
|
|
47035
|
+
};
|
|
47036
|
+
}
|
|
47037
|
+
normalizeSandbox(tokens) {
|
|
47038
|
+
const requestedTokens = tokens ?? ['allow-scripts'];
|
|
47039
|
+
const normalized = requestedTokens.filter(token => SUPPORTED_SANDBOX_TOKENS.has(token));
|
|
47040
|
+
return [...new Set(normalized.length > 0 ? normalized : ['allow-scripts'])];
|
|
47041
|
+
}
|
|
47042
|
+
createSourceDocument() {
|
|
47043
|
+
const activeContent = this.getActiveContent();
|
|
47044
|
+
const state = JSON.stringify(this.state).replace(/</g, '\\u003c');
|
|
47045
|
+
const css = activeContent.css.replace(/<\/style/gi, '<\\/style');
|
|
47046
|
+
const script = activeContent.script.replace(/<\/script/gi, '<\\/script');
|
|
47047
|
+
const computedStyle = this.isMounted ? getComputedStyle(this.elementRef) : null;
|
|
47048
|
+
const defaultCursor = computedStyle?.getPropertyValue('--kritzel-global-default-cursor').trim() || 'auto';
|
|
47049
|
+
const pointerCursor = computedStyle?.getPropertyValue('--kritzel-global-pointer-cursor').trim() || defaultCursor;
|
|
47050
|
+
return `<!doctype html>
|
|
47051
|
+
<html>
|
|
47052
|
+
<head>
|
|
47053
|
+
<meta charset="utf-8">
|
|
47054
|
+
<style>
|
|
47055
|
+
:root {
|
|
47056
|
+
--kritzel-iframe-default-cursor: ${defaultCursor};
|
|
47057
|
+
--kritzel-iframe-pointer-cursor: ${pointerCursor};
|
|
47058
|
+
}
|
|
47059
|
+
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; cursor: var(--kritzel-iframe-default-cursor); }
|
|
47060
|
+
button, button *, a, a *, input, textarea, select { cursor: var(--kritzel-iframe-pointer-cursor) !important; }
|
|
47061
|
+
${css}
|
|
47062
|
+
</style>
|
|
47063
|
+
</head>
|
|
47064
|
+
<body>
|
|
47065
|
+
${activeContent.html}
|
|
47066
|
+
<script>
|
|
47067
|
+
const kritzel = globalThis.kritzel = {
|
|
47068
|
+
state: ${state},
|
|
47069
|
+
setState(nextState) {
|
|
47070
|
+
this.state = nextState;
|
|
47071
|
+
parent.postMessage({ type: '${IFRAME_STATE_MESSAGE}', state: nextState }, '*');
|
|
47072
|
+
},
|
|
47073
|
+
};
|
|
47074
|
+
globalThis.addEventListener('message', event => {
|
|
47075
|
+
if (event.data?.type === '${IFRAME_PARENT_STATE_MESSAGE}' && event.data.state && typeof event.data.state === 'object') {
|
|
47076
|
+
kritzel.state = event.data.state;
|
|
47077
|
+
globalThis.dispatchEvent(new CustomEvent('kritzelstatechange', { detail: kritzel.state }));
|
|
47078
|
+
}
|
|
47079
|
+
});
|
|
47080
|
+
let bridgedPointerId = null;
|
|
47081
|
+
const interactiveSelector = 'button, input, textarea, select, a[href], [contenteditable="true"], [contenteditable=""]';
|
|
47082
|
+
const bridgePointerEvent = event => parent.postMessage({
|
|
47083
|
+
type: '${IFRAME_POINTER_MESSAGE}',
|
|
47084
|
+
eventType: event.type,
|
|
47085
|
+
pointerId: event.pointerId,
|
|
47086
|
+
pointerType: event.pointerType,
|
|
47087
|
+
clientX: event.clientX,
|
|
47088
|
+
clientY: event.clientY,
|
|
47089
|
+
screenX: event.screenX,
|
|
47090
|
+
screenY: event.screenY,
|
|
47091
|
+
button: event.button,
|
|
47092
|
+
buttons: event.buttons,
|
|
47093
|
+
shiftKey: event.shiftKey,
|
|
47094
|
+
ctrlKey: event.ctrlKey,
|
|
47095
|
+
altKey: event.altKey,
|
|
47096
|
+
metaKey: event.metaKey,
|
|
47097
|
+
}, '*');
|
|
47098
|
+
document.addEventListener('pointerdown', event => {
|
|
47099
|
+
if (event.target instanceof Element && event.target.closest(interactiveSelector)) return;
|
|
47100
|
+
bridgedPointerId = event.pointerId;
|
|
47101
|
+
event.preventDefault();
|
|
47102
|
+
bridgePointerEvent(event);
|
|
47103
|
+
});
|
|
47104
|
+
document.addEventListener('pointermove', event => {
|
|
47105
|
+
if (event.pointerId !== bridgedPointerId) return;
|
|
47106
|
+
event.preventDefault();
|
|
47107
|
+
bridgePointerEvent(event);
|
|
47108
|
+
});
|
|
47109
|
+
const finishPointerBridge = event => {
|
|
47110
|
+
if (event.pointerId !== bridgedPointerId) return;
|
|
47111
|
+
event.preventDefault();
|
|
47112
|
+
bridgePointerEvent(event);
|
|
47113
|
+
bridgedPointerId = null;
|
|
47114
|
+
};
|
|
47115
|
+
document.addEventListener('pointerup', finishPointerBridge);
|
|
47116
|
+
document.addEventListener('pointercancel', finishPointerBridge);
|
|
47117
|
+
document.addEventListener('contextmenu', event => {
|
|
47118
|
+
event.preventDefault();
|
|
47119
|
+
parent.postMessage({
|
|
47120
|
+
type: '${IFRAME_CONTEXT_MENU_MESSAGE}',
|
|
47121
|
+
clientX: event.clientX,
|
|
47122
|
+
clientY: event.clientY,
|
|
47123
|
+
button: event.button,
|
|
47124
|
+
shiftKey: event.shiftKey,
|
|
47125
|
+
ctrlKey: event.ctrlKey,
|
|
47126
|
+
altKey: event.altKey,
|
|
47127
|
+
metaKey: event.metaKey,
|
|
47128
|
+
}, '*');
|
|
47129
|
+
});
|
|
47130
|
+
${script}
|
|
47131
|
+
<\/script>
|
|
47132
|
+
</body>
|
|
47133
|
+
</html>`;
|
|
47134
|
+
}
|
|
47135
|
+
handleMessage(event) {
|
|
47136
|
+
if (event.source !== this.elementRef?.contentWindow || !event.data || typeof event.data !== 'object') {
|
|
47137
|
+
return;
|
|
47138
|
+
}
|
|
47139
|
+
const message = event.data;
|
|
47140
|
+
if (message.type === IFRAME_POINTER_MESSAGE) {
|
|
47141
|
+
this.dispatchPointerMessage(event.data);
|
|
47142
|
+
return;
|
|
47143
|
+
}
|
|
47144
|
+
if (message.type === IFRAME_CONTEXT_MENU_MESSAGE) {
|
|
47145
|
+
this.dispatchContextMenuMessage(event.data);
|
|
47146
|
+
return;
|
|
47147
|
+
}
|
|
47148
|
+
if (message.type !== IFRAME_STATE_MESSAGE || !message.state || typeof message.state !== 'object') {
|
|
47149
|
+
return;
|
|
47150
|
+
}
|
|
47151
|
+
this.state = structuredClone(message.state);
|
|
47152
|
+
this.persistUpdate();
|
|
47153
|
+
}
|
|
47154
|
+
dispatchPointerMessage(message) {
|
|
47155
|
+
if (!this.isMounted || !this.elementRef || !['pointerdown', 'pointermove', 'pointerup', 'pointercancel'].includes(message.eventType)) {
|
|
47156
|
+
return;
|
|
47157
|
+
}
|
|
47158
|
+
const iframeRect = this.elementRef.getBoundingClientRect();
|
|
47159
|
+
if (message.eventType === 'pointerdown') {
|
|
47160
|
+
const scaleX = this.elementRef.offsetWidth > 0 ? iframeRect.width / this.elementRef.offsetWidth : 1;
|
|
47161
|
+
const scaleY = this.elementRef.offsetHeight > 0 ? iframeRect.height / this.elementRef.offsetHeight : 1;
|
|
47162
|
+
iframePointerBridgeStarts.set(this.elementRef, {
|
|
47163
|
+
pointerId: message.pointerId,
|
|
47164
|
+
clientX: iframeRect.left + message.clientX * scaleX,
|
|
47165
|
+
clientY: iframeRect.top + message.clientY * scaleY,
|
|
47166
|
+
screenX: message.screenX,
|
|
47167
|
+
screenY: message.screenY,
|
|
47168
|
+
});
|
|
47169
|
+
}
|
|
47170
|
+
const bridgeStart = iframePointerBridgeStarts.get(this.elementRef);
|
|
47171
|
+
const hasBridgeStart = bridgeStart?.pointerId === message.pointerId;
|
|
47172
|
+
const clientX = hasBridgeStart ? bridgeStart.clientX + message.screenX - bridgeStart.screenX : iframeRect.left + message.clientX;
|
|
47173
|
+
const clientY = hasBridgeStart ? bridgeStart.clientY + message.screenY - bridgeStart.screenY : iframeRect.top + message.clientY;
|
|
47174
|
+
this.elementRef.dispatchEvent(new PointerEvent(message.eventType, {
|
|
47175
|
+
bubbles: true,
|
|
47176
|
+
composed: true,
|
|
47177
|
+
cancelable: true,
|
|
47178
|
+
pointerId: message.pointerId,
|
|
47179
|
+
pointerType: message.pointerType,
|
|
47180
|
+
clientX,
|
|
47181
|
+
clientY,
|
|
47182
|
+
screenX: message.screenX,
|
|
47183
|
+
screenY: message.screenY,
|
|
47184
|
+
button: message.button,
|
|
47185
|
+
buttons: message.buttons,
|
|
47186
|
+
shiftKey: message.shiftKey,
|
|
47187
|
+
ctrlKey: message.ctrlKey,
|
|
47188
|
+
altKey: message.altKey,
|
|
47189
|
+
metaKey: message.metaKey,
|
|
47190
|
+
}));
|
|
47191
|
+
if (message.eventType === 'pointerup' || message.eventType === 'pointercancel') {
|
|
47192
|
+
iframePointerBridgeStarts.delete(this.elementRef);
|
|
47193
|
+
}
|
|
47194
|
+
}
|
|
47195
|
+
dispatchContextMenuMessage(message) {
|
|
47196
|
+
if (!this.isMounted || !this.elementRef) {
|
|
47197
|
+
return;
|
|
47198
|
+
}
|
|
47199
|
+
const iframeRect = this.elementRef.getBoundingClientRect();
|
|
47200
|
+
// Dispatched as a MouseEvent (not PointerEvent) to mirror how browsers
|
|
47201
|
+
// natively raise 'contextmenu' for both mouse right-click and touch long-press.
|
|
47202
|
+
this.elementRef.dispatchEvent(new MouseEvent('contextmenu', {
|
|
47203
|
+
bubbles: true,
|
|
47204
|
+
composed: true,
|
|
47205
|
+
cancelable: true,
|
|
47206
|
+
clientX: iframeRect.left + message.clientX,
|
|
47207
|
+
clientY: iframeRect.top + message.clientY,
|
|
47208
|
+
button: message.button,
|
|
47209
|
+
shiftKey: message.shiftKey,
|
|
47210
|
+
ctrlKey: message.ctrlKey,
|
|
47211
|
+
altKey: message.altKey,
|
|
47212
|
+
metaKey: message.metaKey,
|
|
47213
|
+
}));
|
|
47214
|
+
}
|
|
47215
|
+
refreshDocument() {
|
|
47216
|
+
if (this.isMounted && this.elementRef) {
|
|
47217
|
+
this.elementRef.srcdoc = this.createSourceDocument();
|
|
47218
|
+
}
|
|
47219
|
+
}
|
|
47220
|
+
persistUpdate() {
|
|
47221
|
+
if (this._core?.store?.objects) {
|
|
47222
|
+
this.update();
|
|
47223
|
+
}
|
|
47224
|
+
}
|
|
47225
|
+
}
|
|
47226
|
+
|
|
46740
47227
|
/**
|
|
46741
47228
|
* Handles deserialization/revival of Kritzel objects from plain JavaScript objects.
|
|
46742
47229
|
* This class uses a pattern similar to JSON.parse reviver to reconstruct class instances
|
|
@@ -46799,6 +47286,9 @@ class KritzelReviver {
|
|
|
46799
47286
|
case 'KritzelDynamicObject':
|
|
46800
47287
|
revivedObj = KritzelDynamicObject.create(this._core).deserialize(obj);
|
|
46801
47288
|
break;
|
|
47289
|
+
case 'KritzelIframeObject':
|
|
47290
|
+
revivedObj = KritzelIframeObject.create(this._core).deserialize(obj);
|
|
47291
|
+
break;
|
|
46802
47292
|
case 'KritzelSelectionGroup':
|
|
46803
47293
|
revivedObj = KritzelSelectionGroup.create(this._core).deserialize(obj);
|
|
46804
47294
|
break;
|
|
@@ -51723,20 +52213,22 @@ const cleanupTransactions = (transactionCleanups, i) => {
|
|
|
51723
52213
|
// We need to think about the possibility that the user transforms the
|
|
51724
52214
|
// Y.Doc in the event.
|
|
51725
52215
|
if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {
|
|
51726
|
-
events = events
|
|
51727
|
-
.filter(event =>
|
|
51728
|
-
event.target._item === null || !event.target._item.deleted
|
|
51729
|
-
);
|
|
51730
|
-
events
|
|
51731
|
-
.forEach(event => {
|
|
51732
|
-
event.currentTarget = type;
|
|
51733
|
-
// path is relative to the current target
|
|
51734
|
-
event._path = null;
|
|
51735
|
-
});
|
|
51736
|
-
// sort events by path length so that top-level events are fired first.
|
|
51737
|
-
events
|
|
51738
|
-
.sort((event1, event2) => event1.path.length - event2.path.length);
|
|
51739
52216
|
fs.push(() => {
|
|
52217
|
+
// The same event instance is shared by all parent types. Hence, we must set
|
|
52218
|
+
// currentTarget right before calling the handlers (see #768).
|
|
52219
|
+
events = events
|
|
52220
|
+
.filter(event =>
|
|
52221
|
+
event.target._item === null || !event.target._item.deleted
|
|
52222
|
+
);
|
|
52223
|
+
events
|
|
52224
|
+
.forEach(event => {
|
|
52225
|
+
event.currentTarget = type;
|
|
52226
|
+
// path is relative to the current target
|
|
52227
|
+
event._path = null;
|
|
52228
|
+
});
|
|
52229
|
+
// sort events by path length so that top-level events are fired first.
|
|
52230
|
+
events
|
|
52231
|
+
.sort((event1, event2) => event1.path.length - event2.path.length);
|
|
51740
52232
|
// We don't need to check for events.length
|
|
51741
52233
|
// because we know it has at least one element
|
|
51742
52234
|
callEventHandlerListeners(type._dEH, events, transaction);
|
|
@@ -51750,6 +52242,7 @@ const cleanupTransactions = (transactionCleanups, i) => {
|
|
|
51750
52242
|
}
|
|
51751
52243
|
});
|
|
51752
52244
|
});
|
|
52245
|
+
// note the nested fs calls, must not modify fs at this point
|
|
51753
52246
|
callAll(fs, []);
|
|
51754
52247
|
} finally {
|
|
51755
52248
|
// Replace deleted items with ItemDeleted / GC.
|
|
@@ -59160,9 +59653,16 @@ class KritzelStore {
|
|
|
59160
59653
|
* Gets the currently selected dynamic object whose focused descendant is an input-like element.
|
|
59161
59654
|
* @returns The interactive dynamic object with focused input-like content, or null if none matches
|
|
59162
59655
|
*/
|
|
59656
|
+
get activeInteractiveEmbeddedObject() {
|
|
59657
|
+
for (const object of this.selectedObjects) {
|
|
59658
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object) && object.hasFocusedInputElement()) {
|
|
59659
|
+
return object;
|
|
59660
|
+
}
|
|
59661
|
+
}
|
|
59662
|
+
return null;
|
|
59663
|
+
}
|
|
59163
59664
|
get activeInteractiveDynamicObject() {
|
|
59164
|
-
|
|
59165
|
-
return interactiveDynamicObject ?? null;
|
|
59665
|
+
return this.activeInteractiveEmbeddedObject;
|
|
59166
59666
|
}
|
|
59167
59667
|
/**
|
|
59168
59668
|
* Gets the path currently being drawn (not yet completed).
|
|
@@ -61245,13 +61745,38 @@ class KritzelAnchorManager {
|
|
|
61245
61745
|
}
|
|
61246
61746
|
}
|
|
61247
61747
|
|
|
61748
|
+
const KRITZEL_ICON_REGISTRY_KEY = '__kritzelIconRegistry__';
|
|
61749
|
+
const getGlobalRegistryStore = () => {
|
|
61750
|
+
const globalScope = globalThis;
|
|
61751
|
+
const existing = globalScope[KRITZEL_ICON_REGISTRY_KEY];
|
|
61752
|
+
if (existing) {
|
|
61753
|
+
return existing;
|
|
61754
|
+
}
|
|
61755
|
+
const created = {
|
|
61756
|
+
icons: new Map(),
|
|
61757
|
+
listeners: new Set(),
|
|
61758
|
+
};
|
|
61759
|
+
globalScope[KRITZEL_ICON_REGISTRY_KEY] = created;
|
|
61760
|
+
return created;
|
|
61761
|
+
};
|
|
61248
61762
|
/**
|
|
61249
61763
|
* A static registry for managing SVG icons throughout the Kritzel library.
|
|
61250
61764
|
* Icons are stored as name-to-SVG-content mappings and can be retrieved by name.
|
|
61251
61765
|
*/
|
|
61252
61766
|
class KritzelIconRegistry {
|
|
61253
61767
|
/** Internal storage for registered icons, mapping icon names to their SVG content. */
|
|
61254
|
-
static registry
|
|
61768
|
+
static get registry() {
|
|
61769
|
+
return getGlobalRegistryStore().icons;
|
|
61770
|
+
}
|
|
61771
|
+
static get listeners() {
|
|
61772
|
+
return getGlobalRegistryStore().listeners;
|
|
61773
|
+
}
|
|
61774
|
+
static subscribe(listener) {
|
|
61775
|
+
this.listeners.add(listener);
|
|
61776
|
+
return () => {
|
|
61777
|
+
this.listeners.delete(listener);
|
|
61778
|
+
};
|
|
61779
|
+
}
|
|
61255
61780
|
/**
|
|
61256
61781
|
* Registers a single icon with the given name and SVG content.
|
|
61257
61782
|
* If an icon with the same name already exists, it will be overwritten and a warning will be logged.
|
|
@@ -61264,6 +61789,9 @@ class KritzelIconRegistry {
|
|
|
61264
61789
|
console.warn(`[IconRegistry] Icon "${name}" is already registered. It will be overwritten.`);
|
|
61265
61790
|
}
|
|
61266
61791
|
this.registry.set(name, svgContent);
|
|
61792
|
+
for (const listener of this.listeners) {
|
|
61793
|
+
listener(name);
|
|
61794
|
+
}
|
|
61267
61795
|
}
|
|
61268
61796
|
/**
|
|
61269
61797
|
* Retrieves the SVG content for a registered icon by its name.
|
|
@@ -61297,72 +61825,77 @@ class KritzelIconRegistry {
|
|
|
61297
61825
|
return this.registry.has(name);
|
|
61298
61826
|
}
|
|
61299
61827
|
}
|
|
61300
|
-
|
|
61301
|
-
|
|
61302
|
-
|
|
61303
|
-
|
|
61304
|
-
|
|
61305
|
-
|
|
61306
|
-
|
|
61307
|
-
|
|
61308
|
-
|
|
61309
|
-
|
|
61310
|
-
|
|
61311
|
-
|
|
61312
|
-
|
|
61313
|
-
|
|
61314
|
-
|
|
61315
|
-
|
|
61316
|
-
|
|
61317
|
-
|
|
61318
|
-
|
|
61319
|
-
|
|
61320
|
-
|
|
61321
|
-
|
|
61322
|
-
|
|
61323
|
-
|
|
61324
|
-
|
|
61325
|
-
|
|
61326
|
-
|
|
61327
|
-
|
|
61328
|
-
|
|
61329
|
-
|
|
61330
|
-
|
|
61331
|
-
|
|
61332
|
-
|
|
61333
|
-
|
|
61334
|
-
|
|
61335
|
-
|
|
61336
|
-
|
|
61337
|
-
|
|
61338
|
-
|
|
61339
|
-
|
|
61340
|
-
|
|
61341
|
-
|
|
61342
|
-
|
|
61343
|
-
|
|
61344
|
-
|
|
61345
|
-
|
|
61346
|
-
|
|
61347
|
-
|
|
61348
|
-
|
|
61349
|
-
|
|
61350
|
-
|
|
61351
|
-
|
|
61352
|
-
|
|
61353
|
-
|
|
61354
|
-
|
|
61355
|
-
|
|
61356
|
-
|
|
61357
|
-
|
|
61358
|
-
|
|
61359
|
-
|
|
61360
|
-
|
|
61361
|
-
|
|
61362
|
-
|
|
61363
|
-
|
|
61364
|
-
|
|
61365
|
-
}
|
|
61828
|
+
const defaultIcons = {
|
|
61829
|
+
cursor: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"/></svg>',
|
|
61830
|
+
pen: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/></svg>',
|
|
61831
|
+
arrow: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="19" x2="19" y2="5"/><path d="M15 5h4v4"/></svg>',
|
|
61832
|
+
arrowUpFromDot: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-from-dot-icon lucide-arrow-up-from-dot"><path d="m5 9 7-7 7 7"/><path d="M12 16V2"/><circle cx="12" cy="21" r="1"/></svg>',
|
|
61833
|
+
arrowDownFromDot: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-from-dot-icon lucide-arrow-down-from-dot" transform="rotate(180)"><path d="m5 9 7-7 7 7"/><path d="M12 16V2"/><circle cx="12" cy="21" r="1"/></svg>',
|
|
61834
|
+
highlighter: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-highlighter-icon lucide-highlighter"><path d="m9 11-6 6v3h9l3-3"/><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"/></svg>',
|
|
61835
|
+
eraser: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg>',
|
|
61836
|
+
type: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
|
61837
|
+
shapes: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z"/><rect x="3" y="14" width="7" height="7" rx="1"/><circle cx="17.5" cy="17.5" r="3.5"/></svg>',
|
|
61838
|
+
shapeRectangle: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',
|
|
61839
|
+
shapeEllipse: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="12" rx="10" ry="8"/></svg>',
|
|
61840
|
+
shapeTriangle: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3L22 21H2L12 3Z"/></svg>',
|
|
61841
|
+
image: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
|
61842
|
+
imageOff: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-off-icon lucide-image-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M10.41 10.41a2 2 0 1 1-2.83-2.83"/><line x1="13.5" x2="6" y1="13.5" y2="21"/><line x1="18" x2="21" y1="12" y2="15"/><path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"/><path d="M21 15V5a2 2 0 0 0-2-2H9"/></svg>',
|
|
61843
|
+
chevronDown: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>',
|
|
61844
|
+
chevronUp: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>',
|
|
61845
|
+
chevronLeft: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left-icon lucide-chevron-left"><path d="m15 18-6-6 6-6"/></svg>',
|
|
61846
|
+
chevronRight: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right-icon lucide-chevron-right"><path d="m9 18 6-6-6-6"/></svg>',
|
|
61847
|
+
chevronsLeft: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-left-icon lucide-chevrons-left"><path d="m11 17-5-5 5-5"/><path d="m18 17-5-5 5-5"/></svg>',
|
|
61848
|
+
copy: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',
|
|
61849
|
+
paste: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard-paste-icon lucide-clipboard-paste"><path d="M11 14h10"/><path d="M16 4h2a2 2 0 0 1 2 2v1.344"/><path d="m17 18 4-4-4-4"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113"/><rect x="8" y="2" width="8" height="4" rx="1"/></svg>',
|
|
61850
|
+
cut: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-scissors-icon lucide-scissors"><circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/></svg>',
|
|
61851
|
+
delete: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash2-icon lucide-trash-2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg>',
|
|
61852
|
+
bringToFront: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-to-line-icon lucide-arrow-up-to-line"><path d="M5 3h14"/><path d="m18 13-6-6-6 6"/><path d="M12 7v14"/></svg>',
|
|
61853
|
+
sendToBack: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-to-line-icon lucide-arrow-down-to-line"><path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/></svg>',
|
|
61854
|
+
selectAll: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-mouse-pointer-icon lucide-square-mouse-pointer"><path d="M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"/><path d="M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"/></svg>',
|
|
61855
|
+
download: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download-icon lucide-download"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>',
|
|
61856
|
+
upload: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-upload-icon lucide-upload"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" x2="12" y1="3" y2="15"/></svg>',
|
|
61857
|
+
undo: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-undo-icon lucide-undo"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>',
|
|
61858
|
+
redo: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-redo-icon lucide-redo"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/></svg>',
|
|
61859
|
+
plus: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus-icon lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>',
|
|
61860
|
+
minus: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-minus-icon lucide-minus"><path d="M5 12h14"/></svg>',
|
|
61861
|
+
ellipsisVertical: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis-vertical-icon lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>',
|
|
61862
|
+
x: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x-icon lucide-x"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',
|
|
61863
|
+
check: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check-icon lucide-check"><path d="M20 6 9 17l-5-5"/></svg>',
|
|
61864
|
+
group: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-group-icon lucide-group"><path d="M3 7V5c0-1.1.9-2 2-2h2"/><path d="M17 3h2c1.1 0 2 .9 2 2v2"/><path d="M21 17v2c0 1.1-.9 2-2 2h-2"/><path d="M7 21H5c-1.1 0-2-.9-2-2v-2"/><rect width="7" height="5" x="7" y="7" rx="1"/><rect width="7" height="5" x="10" y="12" rx="1"/></svg>',
|
|
61865
|
+
ungroup: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ungroup-icon lucide-ungroup"><rect width="8" height="6" x="5" y="4" rx="1"/><rect width="8" height="6" x="11" y="14" rx="1"/></svg>',
|
|
61866
|
+
moveVertical: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-move-vertical-icon lucide-move-vertical" version="1.1" id="svg3"> <defs id="defs3" /> <path d="M12 2v20" id="path1" /> <path style="fill:#ffffff;stroke-width:2.5;stroke-dasharray:none;stroke-linejoin:round;paint-order:stroke fill markers" d="m 11.735575,22.661865 c -0.09259,-0.02798 -0.204674,-0.07661 -0.249076,-0.108068 -0.04441,-0.03147 -1.167275,-0.979853 -2.4952713,-2.10755 -1.8557024,-1.57581 -2.4300904,-2.079639 -2.4817336,-2.17687 -0.086514,-0.162885 -0.089504,-0.422449 -0.00664,-0.576334 0.1483053,-0.275409 0.437667,-0.436207 0.7830634,-0.435147 0.3692925,0.0011 0.3517326,-0.01122 2.168748,1.525599 L 11.12348,20.194964 V 11.999996 3.8050256 L 9.4546663,5.2164943 C 7.6376509,6.7533118 7.6552109,6.7409594 7.2859184,6.7420935 6.6681409,6.7439906 6.253658,6.1955854 6.5159903,5.723396 6.5738626,5.6192278 7.1368766,5.1267427 9.0629381,3.4955044 11.738128,1.2298067 11.640395,1.3026868 12.00355,1.3026868 c 0.363154,0 0.265421,-0.07288 2.940611,2.1928176 1.926062,1.6312383 2.489076,2.1237234 2.546948,2.2278916 0.262332,0.4721894 -0.15215,1.0205946 -0.769928,1.0186975 -0.369293,-0.00114 -0.351733,0.011218 -2.168748,-1.5255992 L 12.88362,3.8050256 v 8.1949704 8.194968 l 1.668813,-1.411469 c 1.817015,-1.536817 1.799455,-1.524464 2.168748,-1.525599 0.617772,-0.0019 1.032269,0.546521 0.769928,1.018687 -0.103474,0.18623 -4.919006,4.273935 -5.130582,4.355136 -0.20796,0.07981 -0.425829,0.09033 -0.624952,0.03014 z" id="path4" /> </svg>',
|
|
61867
|
+
hand: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hand-icon lucide-hand" version="1.1" id="svg4"> <defs id="defs4" /> <path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2" id="path1" /> <path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" id="path2" /> <path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8" id="path3" /> <path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" id="path4" /> <path style="fill:#ffffff;stroke-width:0.0423032" d="M 11.478261,21.222477 C 9.6854059,21.139331 8.3341788,20.647346 7.1297169,19.639159 6.9698298,19.505327 5.949644,18.508708 4.8626374,17.42445 3.0780314,15.644357 2.8775851,15.435367 2.7968392,15.270602 2.5896561,14.847836 2.616354,14.436649 2.8771894,14.033085 c 0.136522,-0.211226 0.3837159,-0.398688 0.6367632,-0.482897 0.1529977,-0.05091 0.2326803,-0.05992 0.4470908,-0.05054 0.2250407,0.0098 0.2876577,0.02439 0.4554568,0.105827 0.1747854,0.08483 0.2933718,0.192702 1.1675186,1.062064 0.7182021,0.714271 1.0062041,0.982633 1.0998825,1.024878 0.1680197,0.07577 0.4756439,0.07817 0.6368269,0.005 0.1370772,-0.06226 0.2976691,-0.220818 0.3691296,-0.364463 0.072561,-0.145855 0.071573,-0.543545 -0.00169,-0.681911 -0.028747,-0.05429 -0.2476439,-0.296131 -0.4864385,-0.537426 l -0.4341716,-0.438718 0.00753,-3.989014 0.00753,-3.9890137 0.089246,-0.1883791 c 0.244787,-0.516692 0.7711718,-0.809716 1.3059705,-0.7269981 0.3973687,0.061462 0.7569953,0.3284904 0.9363122,0.6952277 l 0.093853,0.1919473 0.014101,2.4958872 0.014101,2.4958877 0.067385,0.149123 c 0.1186861,0.262654 0.4140438,0.457222 0.6940724,0.457222 0.2764172,0 0.5690532,-0.187563 0.6965992,-0.446482 l 0.06486,-0.131661 0.0141,-3.4970626 0.0141,-3.4970623 0.08982,-0.1896121 C 11.096301,3.0422103 11.506844,2.7755634 12,2.7755634 c 0.493156,0 0.903699,0.2666469 1.122868,0.7293016 l 0.08982,0.1896121 0.0141,3.2432432 c 0.01405,3.2315947 0.01432,3.2437077 0.07397,3.3726737 0.124721,0.269649 0.355908,0.424566 0.661411,0.443206 0.237954,0.01452 0.429018,-0.0627 0.591626,-0.239109 0.223655,-0.242637 0.208338,-0.06565 0.224113,-2.5896966 l 0.0141,-2.2561693 0.09385,-0.1919473 c 0.179317,-0.3667373 0.538944,-0.6337662 0.936313,-0.6952277 0.609359,-0.09425 1.208067,0.3054956 1.370981,0.9153772 0.03013,0.1127929 0.03773,0.6662436 0.038,2.7657391 3.74e-4,2.9328416 -0.008,2.8034316 0.197044,3.0364016 0.234927,0.266892 0.603828,0.337117 0.920407,0.175213 0.181933,-0.09304 0.329759,-0.261686 0.376309,-0.4293 0.01848,-0.06654 0.02929,-0.683932 0.0295,-1.684364 1.78e-4,-0.8783075 0.01239,-1.6530128 0.02751,-1.745346 0.08579,-0.5238478 0.505382,-0.9420803 1.039546,-1.0361716 0.607538,-0.1070155 1.25615,0.3485846 1.385876,0.973471 0.02211,0.1064847 0.02843,1.1397236 0.02169,3.5455556 -0.0093,3.324725 -0.01078,3.403075 -0.07062,3.770606 -0.126399,0.776213 -0.328814,1.41352 -0.669031,2.106456 -0.36657,0.746612 -0.72118,1.250303 -1.297841,1.843464 -1.185731,1.21966 -2.604527,1.933174 -4.300822,2.162889 -0.38234,0.05178 -2.604621,0.0785 -3.412456,0.04104 z" id="path16" /> </svg>',
|
|
61868
|
+
handGrab: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hand-grab-icon lucide-hand-grab" version="1.1" id="svg5"> <defs id="defs5" /> <path d="M18 11.5V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4" id="path1" /> <path d="M14 10V8a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" id="path2" /> <path d="M10 9.9V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v5" id="path3" /> <path d="M6 14a2 2 0 0 0-2-2a2 2 0 0 0-2 2" id="path4" /> <path d="M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8 2 2 0 1 1 4 0" id="path5" /> <path style="fill:#ffffff;stroke-width:0.0423032" d="M 9.5887192,21.221364 C 8.0526856,21.128375 6.6533474,20.587008 5.4571093,19.622953 5.3019976,19.497947 5.0101058,19.225967 4.8084606,19.018552 4.2300382,18.423579 3.8474097,17.879011 3.4960953,17.150756 3.1017715,16.333345 2.9014937,15.633198 2.8052391,14.735605 c -0.097577,-0.909922 -0.019834,-1.263323 0.3569794,-1.622742 0.753018,-0.718257 1.9463784,-0.256949 2.0619296,0.797066 0.037839,0.345154 0.089701,0.477674 0.2472582,0.631806 0.2464521,0.241095 0.5958008,0.287445 0.9036474,0.119894 0.1478567,-0.08047 0.2303871,-0.16866 0.3266699,-0.349056 0.050118,-0.0939 0.05337,-0.2326 0.066784,-2.848413 L 6.7826087,8.7144536 6.8458627,8.559342 C 6.9736603,8.2459558 7.2463773,7.9734987 7.5581669,7.8477164 c 0.1253804,-0.050581 0.2118709,-0.062705 0.4512338,-0.063254 0.275392,-6.312e-4 0.3094658,0.00564 0.4867271,0.089609 0.264676,0.1253746 0.4771417,0.334346 0.6070085,0.5970252 l 0.1048543,0.212087 0.017338,0.7488899 c 0.019395,0.8377165 0.026343,0.8713745 0.2242006,1.0860245 0.1591067,0.172611 0.3522021,0.249908 0.5883018,0.235502 0.305503,-0.01864 0.53669,-0.173557 0.661411,-0.443206 0.05734,-0.123963 0.0605,-0.181852 0.07486,-1.3703236 0.01626,-1.3456629 0.0141,-1.3267758 0.182667,-1.5938092 0.257891,-0.4085268 0.77099,-0.6442307 1.228943,-0.5645435 0.471012,0.08196 0.850379,0.4102836 0.989676,0.8565175 0.04663,0.149383 0.0514,0.2860903 0.0514,1.4721724 0,0.8344844 0.01108,1.3591794 0.03064,1.4503554 0.04109,0.191585 0.179844,0.390224 0.342505,0.490321 0.27721,0.170587 0.693425,0.126085 0.92529,-0.09893 0.228986,-0.222224 0.234357,-0.25046 0.251582,-1.3227071 l 0.0152,-0.9463484 0.104855,-0.2120434 c 0.129872,-0.2626357 0.342372,-0.471626 0.607008,-0.5969817 0.177262,-0.083967 0.211335,-0.09024 0.486727,-0.089609 0.239363,5.486e-4 0.325854,0.012673 0.451234,0.063254 0.31179,0.1257823 0.584507,0.3982394 0.712304,0.7116256 0.0621,0.1522783 0.06351,0.1824139 0.07736,1.649824 0.01408,1.492435 0.0142,1.494914 0.07947,1.627432 0.0771,0.156535 0.2216,0.291061 0.395058,0.367789 0.09695,0.04289 0.169789,0.05275 0.325757,0.04411 0.230544,-0.01277 0.363779,-0.06826 0.506411,-0.21089 0.177062,-0.177061 0.198302,-0.25307 0.219359,-0.784959 0.02002,-0.505773 0.05012,-0.6549 0.175297,-0.868492 0.498409,-0.850471 1.728484,-0.8041941 2.173478,0.08177 0.131751,0.262312 0.134447,0.313526 0.122615,2.328965 -0.0104,1.771638 -0.01517,1.923481 -0.0714,2.273746 -0.123689,0.770512 -0.327108,1.411813 -0.668163,2.106456 -0.36657,0.746612 -0.72118,1.250303 -1.297841,1.843464 -1.180268,1.214041 -2.600612,1.930754 -4.287083,2.163284 -0.28697,0.03957 -0.685446,0.04782 -2.636536,0.05459 -1.26416,0.0044 -2.4698005,-0.0024 -2.6792012,-0.01507 z" id="path6" /> </svg>',
|
|
61869
|
+
mousePointer: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2" version="1.1" id="svg1"> <defs id="defs1" /> <path d="M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z" id="path1" /> <path style="fill:#ffffff;stroke-width:0.0972651;stroke-linejoin:round;paint-order:stroke fill markers" d="M 7.8509196,12.314844 C 6.127071,8.1920568 4.7235325,4.8125504 4.7319449,4.8048299 c 0.01847,-0.016951 15.4787861,6.0801241 15.4610371,6.0973581 -0.0069,0.0067 -1.32633,0.341226 -2.93219,0.743509 -1.858829,0.465652 -3.011462,0.772855 -3.172161,0.845453 -0.688426,0.310999 -1.245788,0.879167 -1.498145,1.527185 -0.06251,0.160512 -0.440389,1.529576 -0.839733,3.042364 -0.399346,1.512788 -0.734966,2.750433 -0.745822,2.750322 -0.01086,-1.09e-4 -1.430163,-3.373391 -3.1540114,-7.496177 z" id="path2" /> <path style="fill:#ffffff;stroke-width:0.0705053;stroke-linejoin:round;paint-order:stroke fill markers" d="M 10.777831,19.240865 C 9.3899089,15.977493 4.7567738,4.8648478 4.7760705,4.8455511 c 0.013084,-0.013084 4.7618079,1.8507077 10.7773965,4.2299406 4.467495,1.7669453 4.558837,1.8037523 4.533848,1.8269883 -0.01183,0.011 -0.96064,0.257045 -2.108467,0.546768 -3.445281,0.869623 -3.777157,0.960825 -4.075205,1.119907 -0.597122,0.31871 -1.103666,0.864485 -1.309236,1.410635 -0.09642,0.256167 -0.312339,1.032806 -0.943226,3.392713 -0.641066,2.39798 -0.629171,2.354884 -0.649929,2.354849 -0.0091,-1.5e-5 -0.10963,-0.218934 -0.223421,-0.486487 z" id="path6" /> </svg>',
|
|
61870
|
+
pointer: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pointer-icon lucide-pointer" version="1.1" id="svg5"> <defs id="defs5" /> <path d="M22 14a8 8 0 0 1-8 8" id="path1" /> <path d="M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2" id="path2" /> <path d="M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1" id="path3" /> <path d="M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10" id="path4" /> <path d="M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" id="path5" /> <path style="fill:#ffffff;stroke-width:0.0930233;stroke-linejoin:round;paint-order:stroke fill markers" d="M 11.2,21.203517 C 9.5092536,21.041493 8.4838422,20.667261 7.3116279,19.784423 7.1888372,19.691945 6.139155,18.670017 4.9790008,17.513473 2.5649891,15.106974 2.6562686,15.220427 2.6869266,14.664621 c 0.020277,-0.367608 0.1272548,-0.601802 0.3822766,-0.836873 0.2609241,-0.240511 0.4631523,-0.319555 0.8191689,-0.320185 0.509345,-9.02e-4 0.5815472,0.04845 1.7102825,1.168976 0.532833,0.528958 1.0223742,0.98871 1.0878697,1.021671 0.1699959,0.08555 0.4741793,0.07658 0.6733897,-0.01985 0.303161,-0.146758 0.4720469,-0.543298 0.3791811,-0.890307 -0.036373,-0.135913 -0.1250717,-0.246717 -0.506083,-0.632208 l -0.4619807,-0.467411 0.00983,-5.002356 0.00983,-5.0023561 0.080405,-0.1739784 C 6.9849846,3.2633288 7.2288893,3.0140593 7.4738043,2.8937849 7.6531903,2.8056908 7.7297209,2.7906977 8,2.7906977 c 0.2702791,0 0.3468097,0.014993 0.5261957,0.1030872 0.244915,0.1202744 0.4888197,0.3695439 0.6027014,0.6159576 0.079998,0.1730976 0.080499,0.1905559 0.09901,3.448397 0.020472,3.6031325 0.00418,3.3665775 0.2478407,3.5980265 0.2810043,0.266918 0.6822132,0.283308 1.0083162,0.04119 0.232339,-0.172501 0.25913,-0.280173 0.275933,-1.1089849 0.01456,-0.7180841 0.01869,-0.7520168 0.117805,-0.9674419 0.454637,-0.9881395 1.789759,-0.9881395 2.244396,0 0.09912,0.2154251 0.103248,0.2493578 0.117805,0.9674419 0.0168,0.8288119 0.04359,0.9364839 0.275933,1.1089849 0.326103,0.242117 0.727312,0.225727 1.008316,-0.04119 0.160426,-0.152384 0.218977,-0.294978 0.250819,-0.610832 C 14.845142,9.2502593 15.336916,8.7840275 16,8.7840275 c 0.478554,0 0.847992,0.2240614 1.082489,0.6565225 l 0.126813,0.2338686 0.01869,0.7813954 c 0.02069,0.865066 0.03258,0.913549 0.276595,1.127795 0.239244,0.210059 0.56665,0.239738 0.88018,0.07979 0.219744,-0.112104 0.324993,-0.301479 0.383515,-0.690054 0.06437,-0.427406 0.125794,-0.56694 0.357358,-0.811785 C 19.38604,9.8862229 19.614832,9.7882106 20,9.7869898 c 0.380153,-0.0012 0.636641,0.1145641 0.905451,0.4086842 0.318537,0.348531 0.317259,0.340596 0.332734,2.064791 0.02055,2.290001 -0.04576,2.983129 -0.383655,4.009983 -0.878739,2.670467 -3.284504,4.613238 -6.090273,4.918188 -0.322415,0.03504 -3.227312,0.04717 -3.564257,0.01488 z" id="path6" /> <path style="fill:#ffffff;stroke-width:0.0705053;stroke-linejoin:round;paint-order:stroke fill markers" d="m 11.942854,21.190957 c -1.015003,-0.01704 -1.131723,-0.02688 -1.806535,-0.1522 C 9.5352183,20.927122 8.8225664,20.681951 8.319624,20.413766 7.7570149,20.113766 7.3758537,19.827607 6.7836127,19.260598 5.774345,18.294328 3.1746828,15.68636 2.994305,15.459184 2.7288345,15.124838 2.6970674,15.049109 2.7026798,14.763988 c 0.00827,-0.420163 0.1162058,-0.679868 0.3844475,-0.925026 0.2382303,-0.217729 0.416008,-0.293073 0.7303102,-0.309513 0.5101451,-0.02668 0.6329728,0.04799 1.5378542,0.934977 0.8479274,0.831158 1.2429087,1.199656 1.342282,1.252283 0.11819,0.06259 0.4442817,0.06081 0.6122724,-0.0033 0.1482348,-0.05661 0.3410696,-0.248342 0.4107195,-0.408368 0.063024,-0.144802 0.06179,-0.498 -0.00216,-0.618376 C 7.6917315,14.63641 7.4736023,14.388937 7.2336742,14.136678 L 6.797441,13.678026 6.7970753,8.6903755 6.7967098,3.7027253 6.9021002,3.502167 C 7.0320375,3.2548956 7.2343175,3.0487286 7.4743519,2.9189189 c 0.1797064,-0.097185 0.1877434,-0.098707 0.5209477,-0.098707 0.3169743,0 0.349151,0.00524 0.5076381,0.082665 0.2190605,0.1070166 0.4871239,0.3748528 0.5931342,0.592632 l 0.081613,0.1676584 0.019992,1.3834579 c 0.010995,0.7609018 0.021403,2.0560783 0.023128,2.87817 0.00341,1.6233162 0.028863,2.2876938 0.093598,2.4426258 0.089047,0.213119 0.4255042,0.419889 0.683247,0.419889 0.1563141,0 0.3731941,-0.08265 0.5187231,-0.197689 0.205546,-0.162474 0.225694,-0.250142 0.256177,-1.1146856 C 10.79418,8.8613623 10.8052,8.7492253 10.85668,8.6186115 11.053264,8.1198873 11.50183,7.7978848 12,7.7978848 c 0.49817,0 0.946736,0.3220025 1.143315,0.8207259 0.05148,0.1306138 0.0625,0.2427508 0.08413,0.8563239 0.02897,0.8216044 0.05497,0.9507864 0.218548,1.0859664 0.341252,0.282005 0.756809,0.293493 1.057036,0.02922 0.169206,-0.148941 0.234219,-0.2921 0.288276,-0.6347773 0.103115,-0.6536616 0.472737,-1.0621772 1.030077,-1.1384664 0.547738,-0.074975 0.986339,0.1608863 1.276145,0.6862578 l 0.105758,0.1917223 7.68e-4,0.3699606 c 0.0011,0.553623 0.04553,1.179579 0.09141,1.289176 0.04428,0.105777 0.219161,0.276182 0.364423,0.355092 0.06913,0.03755 0.155512,0.05067 0.333059,0.05055 0.204058,-1.3e-4 0.260695,-0.01118 0.380729,-0.07426 0.239564,-0.12591 0.320531,-0.265583 0.407786,-0.703455 0.08382,-0.420648 0.125337,-0.527172 0.279883,-0.718174 0.321102,-0.3968443 0.77117,-0.5469022 1.259123,-0.4198065 0.21344,0.055594 0.39756,0.1739295 0.578279,0.3716645 0.286251,0.313205 0.299377,0.389392 0.324444,1.883099 0.02888,1.721047 -0.03379,2.808669 -0.20314,3.525265 -0.307591,1.301561 -0.970113,2.493177 -1.91312,3.440943 -1.060413,1.065767 -2.34115,1.742909 -3.849589,2.035329 -0.348478,0.06755 -0.462014,0.07524 -1.340342,0.09078 -0.527787,0.0093 -1.416154,0.0093 -1.974148,-6.4e-5 z" id="path7" /> </svg>',
|
|
61871
|
+
settings: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings-icon lucide-settings"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"/><circle cx="12" cy="12" r="3"/></svg>',
|
|
61872
|
+
share: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-share2-icon lucide-share-2"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" x2="15.42" y1="13.51" y2="17.49"/><line x1="15.41" x2="8.59" y1="6.51" y2="10.49"/></svg>',
|
|
61873
|
+
palette: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-palette-icon lucide-palette"><path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"/><circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/></svg>',
|
|
61874
|
+
command: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-command-icon lucide-command"><path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"/></svg>',
|
|
61875
|
+
info: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info-icon lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>',
|
|
61876
|
+
ordering: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bring-to-front-icon lucide-bring-to-front"><rect x="8" y="8" width="8" height="8" rx="2"/><path d="M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2"/><path d="M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2"/></svg>',
|
|
61877
|
+
layoutTemplate: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-template-icon lucide-layout-template"><rect width="18" height="7" x="3" y="3" rx="1"/><rect width="9" height="7" x="3" y="14" rx="1"/><rect width="5" height="7" x="16" y="14" rx="1"/></svg>',
|
|
61878
|
+
align: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="21" x2="3" y1="10" y2="10"/><line x1="21" x2="3" y1="6" y2="6"/><line x1="21" x2="3" y1="14" y2="14"/><line x1="21" x2="3" y1="18" y2="18"/></svg>',
|
|
61879
|
+
alignStartHorizontal: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-start-horizontal-icon lucide-align-start-horizontal"><rect width="6" height="16" x="4" y="6" rx="2"/><rect width="6" height="9" x="14" y="6" rx="2"/><path d="M22 2H2"/></svg>',
|
|
61880
|
+
alignCenterHorizontal: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-center-horizontal-icon lucide-align-center-horizontal"><path d="M2 12h20"/><path d="M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4"/><path d="M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4"/><path d="M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1"/><path d="M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1"/></svg>',
|
|
61881
|
+
alignEndHorizontal: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-end-horizontal-icon lucide-align-end-horizontal"><rect width="6" height="16" x="4" y="2" rx="2"/><rect width="6" height="9" x="14" y="9" rx="2"/><path d="M22 22H2"/></svg>',
|
|
61882
|
+
alignStartVertical: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-start-vertical-icon lucide-align-start-vertical"><rect width="9" height="6" x="6" y="14" rx="2"/><rect width="16" height="6" x="6" y="4" rx="2"/><path d="M2 2v20"/></svg>',
|
|
61883
|
+
alignCenterVertical: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-center-vertical-icon lucide-align-center-vertical"><path d="M12 2v20"/><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4"/><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4"/><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1"/><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1"/></svg>',
|
|
61884
|
+
alignEndVertical: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-align-end-vertical-icon lucide-align-end-vertical"><rect width="16" height="6" x="2" y="4" rx="2"/><rect width="9" height="6" x="9" y="14" rx="2"/><path d="M22 22V2"/></svg>',
|
|
61885
|
+
viewport: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize-icon lucide-maximize"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></svg>',
|
|
61886
|
+
logOut: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-log-out-icon lucide-log-out"><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>',
|
|
61887
|
+
usersRound: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-users-round-icon lucide-users-round"><path d="M18 21a8 8 0 0 0-16 0"/><circle cx="10" cy="8" r="5"/><path d="M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3"/></svg>',
|
|
61888
|
+
google: '<svg version="1.1" viewBox="0 0 48 48" style="display: block;"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"></path><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"></path><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"></path><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"></path><path fill="none" d="M0 0h48v48H0z"></path></svg>',
|
|
61889
|
+
facebook: '<svg version="1.1" id="svg9" width="666.66669" height="666.66718" viewBox="0 0 666.66668 666.66717"> <defs id="defs13"> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath25"> <path d="M 0,700 H 700 V 0 H 0 Z" id="path23" /> </clipPath> </defs> <g id="g17" transform="matrix(1.3333333,0,0,-1.3333333,-133.33333,799.99999)"> <g id="g19"> <g id="g21" clip-path="url(#clipPath25)"> <g id="g27" transform="translate(600,350)"> <path d="m 0,0 c 0,138.071 -111.929,250 -250,250 -138.071,0 -250,-111.929 -250,-250 0,-117.245 80.715,-215.622 189.606,-242.638 v 166.242 h -51.552 V 0 h 51.552 v 32.919 c 0,85.092 38.508,124.532 122.048,124.532 15.838,0 43.167,-3.105 54.347,-6.211 V 81.986 c -5.901,0.621 -16.149,0.932 -28.882,0.932 -40.993,0 -56.832,-15.528 -56.832,-55.9 V 0 h 81.659 l -14.028,-76.396 h -67.631 V -248.169 C -95.927,-233.218 0,-127.818 0,0" style="fill:#0866ff;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path29" /> </g> <g id="g31" transform="translate(447.9175,273.6036)"> <path d="M 0,0 14.029,76.396 H -67.63 v 27.019 c 0,40.372 15.838,55.899 56.831,55.899 12.733,0 22.981,-0.31 28.882,-0.931 v 69.253 c -11.18,3.106 -38.509,6.212 -54.347,6.212 -83.539,0 -122.048,-39.441 -122.048,-124.533 V 76.396 h -51.552 V 0 h 51.552 v -166.242 c 19.343,-4.798 39.568,-7.362 60.394,-7.362 10.254,0 20.358,0.632 30.288,1.831 L -67.63,0 Z" style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path33" /> </g> </g> </g> </g></svg>',
|
|
61890
|
+
github: '<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z" transform="scale(64)" fill="#1B1F23"/></svg>',
|
|
61891
|
+
braces: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-braces-icon lucide-braces"><path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/></svg>',
|
|
61892
|
+
heart: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heart-icon lucide-heart"><path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/></svg>'
|
|
61893
|
+
};
|
|
61894
|
+
for (const [name, svg] of Object.entries(defaultIcons)) {
|
|
61895
|
+
if (!KritzelIconRegistry.has(name)) {
|
|
61896
|
+
KritzelIconRegistry.register(name, svg);
|
|
61897
|
+
}
|
|
61898
|
+
}
|
|
61366
61899
|
|
|
61367
61900
|
class KritzelCursorHelper {
|
|
61368
61901
|
static _pointerCursor = null;
|
|
@@ -61381,7 +61914,7 @@ class KritzelCursorHelper {
|
|
|
61381
61914
|
* The icon is retrieved from the KritzelIconRegistry.
|
|
61382
61915
|
*/
|
|
61383
61916
|
static getCursor(options) {
|
|
61384
|
-
const iconName = options.iconName === 'default' ? '
|
|
61917
|
+
const iconName = options.iconName === 'default' ? 'mousePointer' : options.iconName;
|
|
61385
61918
|
const iconSvg = KritzelIconRegistry.get(iconName);
|
|
61386
61919
|
if (!iconSvg) {
|
|
61387
61920
|
console.warn(`Icon "${iconName}" not found in registry.`);
|
|
@@ -61390,7 +61923,7 @@ class KritzelCursorHelper {
|
|
|
61390
61923
|
const size = options.size || 24;
|
|
61391
61924
|
const rotation = options.rotation || 0;
|
|
61392
61925
|
const color = options.color || 'black';
|
|
61393
|
-
// Default cursor (
|
|
61926
|
+
// Default cursor (mousePointer) has hotspot at (4, 4), others at center
|
|
61394
61927
|
const hotspot = options.hotspot || (options.iconName === 'default' ? { x: 4, y: 4 } : { x: size / 2, y: size / 2 });
|
|
61395
61928
|
// Modify the SVG string to set size and color
|
|
61396
61929
|
// We replace width and height to match the requested size
|
|
@@ -61403,12 +61936,12 @@ class KritzelCursorHelper {
|
|
|
61403
61936
|
// We rotate around the center of the SVG canvas
|
|
61404
61937
|
const center = size / 2;
|
|
61405
61938
|
// We use a group to apply the rotation
|
|
61406
|
-
const svg = `
|
|
61407
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
61408
|
-
<g transform="rotate(${rotation} ${center} ${center})">
|
|
61409
|
-
${content}
|
|
61410
|
-
</g>
|
|
61411
|
-
</svg>
|
|
61939
|
+
const svg = `
|
|
61940
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
61941
|
+
<g transform="rotate(${rotation} ${center} ${center})">
|
|
61942
|
+
${content}
|
|
61943
|
+
</g>
|
|
61944
|
+
</svg>
|
|
61412
61945
|
`;
|
|
61413
61946
|
// Encode the SVG for use in a data URI
|
|
61414
61947
|
// We need to be careful with encoding to ensure it works across browsers
|
|
@@ -61446,11 +61979,13 @@ class KritzelCursorManager {
|
|
|
61446
61979
|
// Reset cursor on old target
|
|
61447
61980
|
if (this._targetElement) {
|
|
61448
61981
|
this._targetElement.style.cursor = '';
|
|
61982
|
+
this._targetElement.style.removeProperty('--kritzel-global-default-cursor');
|
|
61449
61983
|
this._targetElement.style.removeProperty('--kritzel-global-pointer-cursor');
|
|
61450
61984
|
}
|
|
61451
61985
|
this._targetElement = element;
|
|
61452
61986
|
// Set the pointer cursor CSS variable for child components to use
|
|
61453
61987
|
if (this._targetElement) {
|
|
61988
|
+
this._targetElement.style.setProperty('--kritzel-global-default-cursor', KritzelCursorHelper.getCursor({ iconName: 'default' }));
|
|
61454
61989
|
this._targetElement.style.setProperty('--kritzel-global-pointer-cursor', KritzelCursorHelper.getPointerCursor());
|
|
61455
61990
|
}
|
|
61456
61991
|
}
|
|
@@ -61495,8 +62030,10 @@ class KritzelCursorManager {
|
|
|
61495
62030
|
if (!this._shadowRoot)
|
|
61496
62031
|
return;
|
|
61497
62032
|
const elementsAtPoint = this._shadowRoot.elementsFromPoint(ev.clientX, ev.clientY);
|
|
61498
|
-
if (!elementsAtPoint || elementsAtPoint.length === 0)
|
|
62033
|
+
if (!elementsAtPoint || elementsAtPoint.length === 0) {
|
|
62034
|
+
this.resetToDefault();
|
|
61499
62035
|
return;
|
|
62036
|
+
}
|
|
61500
62037
|
// Check for resize handle overlays (selection group)
|
|
61501
62038
|
const resizeHandleOverlay = elementsAtPoint.find(el => el.classList.contains('resize-handle-overlay'));
|
|
61502
62039
|
if (resizeHandleOverlay) {
|
|
@@ -61506,19 +62043,19 @@ class KritzelCursorManager {
|
|
|
61506
62043
|
const isTopLeft = resizeHandleOverlay.classList.contains('top-left');
|
|
61507
62044
|
const isBottomRight = resizeHandleOverlay.classList.contains('bottom-right');
|
|
61508
62045
|
const rotationOffset = (isTopLeft || isBottomRight) ? -45 : 45;
|
|
61509
|
-
this._core.store.state.cursor = { icon: '
|
|
62046
|
+
this._core.store.state.cursor = { icon: 'moveVertical', rotation: rotationDegrees + rotationOffset };
|
|
61510
62047
|
return;
|
|
61511
62048
|
}
|
|
61512
62049
|
// Check for rotation handle overlay
|
|
61513
62050
|
const rotationHandleOverlay = elementsAtPoint.find(el => el.classList.contains('rotation-handle-overlay'));
|
|
61514
62051
|
if (rotationHandleOverlay) {
|
|
61515
|
-
this._core.store.state.cursor = { icon: 'hand', iconActive: '
|
|
62052
|
+
this._core.store.state.cursor = { icon: 'hand', iconActive: 'handGrab' };
|
|
61516
62053
|
return;
|
|
61517
62054
|
}
|
|
61518
62055
|
// Check for line handle overlays (selection line)
|
|
61519
62056
|
const lineHandleOverlay = elementsAtPoint.find(el => el.classList.contains('selection-line-handle-overlay'));
|
|
61520
62057
|
if (lineHandleOverlay) {
|
|
61521
|
-
this._core.store.state.cursor = { icon: 'hand', iconActive: '
|
|
62058
|
+
this._core.store.state.cursor = { icon: 'hand', iconActive: 'handGrab' };
|
|
61522
62059
|
return;
|
|
61523
62060
|
}
|
|
61524
62061
|
// Reset cursor if not hovering any handle
|
|
@@ -61553,7 +62090,8 @@ class KritzelCursorManager {
|
|
|
61553
62090
|
cleanup() {
|
|
61554
62091
|
if (this._targetElement) {
|
|
61555
62092
|
this._targetElement.style.cursor = '';
|
|
61556
|
-
this._targetElement.style.removeProperty('--kritzel-
|
|
62093
|
+
this._targetElement.style.removeProperty('--kritzel-global-default-cursor');
|
|
62094
|
+
this._targetElement.style.removeProperty('--kritzel-global-pointer-cursor');
|
|
61557
62095
|
}
|
|
61558
62096
|
this._targetElement = null;
|
|
61559
62097
|
this._shadowRoot = null;
|
|
@@ -63456,7 +63994,7 @@ class KritzelCore {
|
|
|
63456
63994
|
this._store.state.translateY = viewportHeight / 2 - (viewport.centerWorldY ?? 0) * scale;
|
|
63457
63995
|
this._store.state.scale = scale;
|
|
63458
63996
|
await objectsMap.initialize(this, activeWorkspace.id, this._syncConfig);
|
|
63459
|
-
this.seedWorkspaceObjects(activeWorkspace, objectsMap);
|
|
63997
|
+
await this.seedWorkspaceObjects(activeWorkspace, objectsMap);
|
|
63460
63998
|
// Set local user in awareness after object map is initialized
|
|
63461
63999
|
if (this._user) {
|
|
63462
64000
|
objectsMap.setLocalUser(this._user);
|
|
@@ -63470,15 +64008,21 @@ class KritzelCore {
|
|
|
63470
64008
|
this.engine.emitObjectsChange();
|
|
63471
64009
|
this.rerender();
|
|
63472
64010
|
}
|
|
63473
|
-
seedWorkspaceObjects(workspace, objectsMap) {
|
|
64011
|
+
async seedWorkspaceObjects(workspace, objectsMap) {
|
|
63474
64012
|
if (!workspace.objects?.length) {
|
|
63475
64013
|
return;
|
|
63476
64014
|
}
|
|
64015
|
+
const pendingObjects = workspace.objects.filter(object => !objectsMap.findById(object.id));
|
|
64016
|
+
// Mirrors engine.addObject()/addObjects(): image asset upload is async and must
|
|
64017
|
+
// happen before the (synchronous) Yjs transaction that inserts the objects.
|
|
64018
|
+
for (const object of pendingObjects) {
|
|
64019
|
+
object._core = this;
|
|
64020
|
+
if (KritzelClassHelper.isInstanceOf(object, 'KritzelImage')) {
|
|
64021
|
+
await object.prepareForInsert();
|
|
64022
|
+
}
|
|
64023
|
+
}
|
|
63477
64024
|
objectsMap.transaction(() => {
|
|
63478
|
-
for (const object of
|
|
63479
|
-
if (objectsMap.findById(object.id)) {
|
|
63480
|
-
continue;
|
|
63481
|
-
}
|
|
64025
|
+
for (const object of pendingObjects) {
|
|
63482
64026
|
this.prepareObjectForWorkspace(object, workspace.id, this._store.currentZIndex, this._store.state.scale);
|
|
63483
64027
|
objectsMap.insert(object);
|
|
63484
64028
|
}
|
|
@@ -63517,16 +64061,30 @@ class KritzelCore {
|
|
|
63517
64061
|
* @param scaleFallback - Scale applied to objects that do not define one
|
|
63518
64062
|
* @returns The objects that were added, updated and removed
|
|
63519
64063
|
*/
|
|
63520
|
-
reconcileWorkspaceObjects(objectsMap, workspaceId, desiredObjects, nextZIndex, scaleFallback) {
|
|
64064
|
+
async reconcileWorkspaceObjects(objectsMap, workspaceId, desiredObjects, nextZIndex, scaleFallback) {
|
|
63521
64065
|
const existingObjects = objectsMap.allObjects().filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KritzelSelectionBox));
|
|
63522
64066
|
const existingById = new Map(existingObjects.map(object => [object.id, object]));
|
|
63523
64067
|
const desiredIds = new Set();
|
|
63524
64068
|
const diff = { added: [], updated: [], removed: [] };
|
|
64069
|
+
// Assign IDs up front so the insert-vs-update lookup below is stable, and so the
|
|
64070
|
+
// async image-prepare pass and the (synchronous) transaction agree on identity.
|
|
64071
|
+
for (const object of desiredObjects) {
|
|
64072
|
+
if (!object.id) {
|
|
64073
|
+
object.id = object.generateId();
|
|
64074
|
+
}
|
|
64075
|
+
}
|
|
64076
|
+
// Mirrors engine.addObject()/addObjects(): image asset upload is async and must
|
|
64077
|
+
// happen before the (synchronous) Yjs transaction that inserts the objects.
|
|
64078
|
+
for (const object of desiredObjects) {
|
|
64079
|
+
const existingObject = existingById.get(object.id);
|
|
64080
|
+
const isNewOrReplaced = !existingObject || existingObject !== object;
|
|
64081
|
+
if (isNewOrReplaced && KritzelClassHelper.isInstanceOf(object, 'KritzelImage')) {
|
|
64082
|
+
object._core = this;
|
|
64083
|
+
await object.prepareForInsert();
|
|
64084
|
+
}
|
|
64085
|
+
}
|
|
63525
64086
|
objectsMap.transaction(() => {
|
|
63526
64087
|
for (const object of desiredObjects) {
|
|
63527
|
-
if (!object.id) {
|
|
63528
|
-
object.id = object.generateId();
|
|
63529
|
-
}
|
|
63530
64088
|
desiredIds.add(object.id);
|
|
63531
64089
|
const existingObject = existingById.get(object.id);
|
|
63532
64090
|
if (!existingObject) {
|
|
@@ -63564,7 +64122,7 @@ class KritzelCore {
|
|
|
63564
64122
|
* object set stays exactly what the caller declared.
|
|
63565
64123
|
*/
|
|
63566
64124
|
detachObject(object) {
|
|
63567
|
-
if (
|
|
64125
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
63568
64126
|
object.unmount();
|
|
63569
64127
|
}
|
|
63570
64128
|
object.isMounted = false;
|
|
@@ -63740,13 +64298,13 @@ class KritzelCore {
|
|
|
63740
64298
|
activeWorkspace.viewport = { centerWorldX, centerWorldY, scale };
|
|
63741
64299
|
}
|
|
63742
64300
|
}
|
|
63743
|
-
applyObjectsToActiveWorkspace(workspace, desiredObjects) {
|
|
64301
|
+
async applyObjectsToActiveWorkspace(workspace, desiredObjects) {
|
|
63744
64302
|
const objectsMap = this._store.objects;
|
|
63745
64303
|
if (!objectsMap) {
|
|
63746
64304
|
return null;
|
|
63747
64305
|
}
|
|
63748
64306
|
this.clearSelection();
|
|
63749
|
-
const diff = this.reconcileWorkspaceObjects(objectsMap, workspace.id, desiredObjects, () => this._store.currentZIndex, this._store.state.scale);
|
|
64307
|
+
const diff = await this.reconcileWorkspaceObjects(objectsMap, workspace.id, desiredObjects, () => this._store.currentZIndex, this._store.state.scale);
|
|
63750
64308
|
this._anchorManager.rebuildIndex();
|
|
63751
64309
|
this.rerender();
|
|
63752
64310
|
return diff;
|
|
@@ -63765,7 +64323,7 @@ class KritzelCore {
|
|
|
63765
64323
|
try {
|
|
63766
64324
|
await objectsMap.initialize(this, workspace.id, this._syncConfig, { headless: true, workspaceName: workspace.name });
|
|
63767
64325
|
await objectsMap.whenNetworkSynced();
|
|
63768
|
-
return this.reconcileWorkspaceObjects(objectsMap, workspace.id, desiredObjects, () => this.nextZIndexOf(objectsMap), this._store.state.scale);
|
|
64326
|
+
return await this.reconcileWorkspaceObjects(objectsMap, workspace.id, desiredObjects, () => this.nextZIndexOf(objectsMap), this._store.state.scale);
|
|
63769
64327
|
}
|
|
63770
64328
|
finally {
|
|
63771
64329
|
objectsMap.destroy();
|
|
@@ -63851,8 +64409,7 @@ class KritzelCore {
|
|
|
63851
64409
|
this.removeObject(child);
|
|
63852
64410
|
});
|
|
63853
64411
|
}
|
|
63854
|
-
|
|
63855
|
-
if (KritzelClassHelper.isInstanceOf(object, 'KritzelDynamicObject')) {
|
|
64412
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
63856
64413
|
object.unmount();
|
|
63857
64414
|
}
|
|
63858
64415
|
// Handle anchor cleanup
|
|
@@ -63898,14 +64455,8 @@ class KritzelCore {
|
|
|
63898
64455
|
this.removeLocalSelectionGroups();
|
|
63899
64456
|
this.removeSelectionBox();
|
|
63900
64457
|
for (const object of selectionGroup.objects ?? []) {
|
|
63901
|
-
if (
|
|
63902
|
-
|
|
63903
|
-
if (typeof dynamicObject.setIsInteractive === 'function') {
|
|
63904
|
-
dynamicObject.setIsInteractive(true);
|
|
63905
|
-
}
|
|
63906
|
-
else {
|
|
63907
|
-
dynamicObject.isInteractive = true;
|
|
63908
|
-
}
|
|
64458
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
64459
|
+
object.setIsInteractive(true);
|
|
63909
64460
|
}
|
|
63910
64461
|
}
|
|
63911
64462
|
this._store.objects.insert(selectionGroup);
|
|
@@ -63926,14 +64477,8 @@ class KritzelCore {
|
|
|
63926
64477
|
teardownSelectionGroup(selectionGroup) {
|
|
63927
64478
|
selectionGroup.deselectAllChildren?.();
|
|
63928
64479
|
for (const object of selectionGroup.objects ?? []) {
|
|
63929
|
-
if (
|
|
63930
|
-
|
|
63931
|
-
if (typeof dynamicObject.setIsInteractive === 'function') {
|
|
63932
|
-
dynamicObject.setIsInteractive(false);
|
|
63933
|
-
}
|
|
63934
|
-
else {
|
|
63935
|
-
dynamicObject.isInteractive = false;
|
|
63936
|
-
}
|
|
64480
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
64481
|
+
object.setIsInteractive(false);
|
|
63937
64482
|
}
|
|
63938
64483
|
}
|
|
63939
64484
|
}
|
|
@@ -65379,13 +65924,7 @@ class KritzelWheelHelper {
|
|
|
65379
65924
|
return this.canElementConsumeWheel(scrollContainer, ev.deltaX, ev.deltaY);
|
|
65380
65925
|
}
|
|
65381
65926
|
static getScrollableContainerFromEventPath(path, dynamicObject) {
|
|
65382
|
-
const potentialRoots =
|
|
65383
|
-
if (dynamicObject.element instanceof HTMLElement) {
|
|
65384
|
-
potentialRoots.push(dynamicObject.element);
|
|
65385
|
-
}
|
|
65386
|
-
if (dynamicObject.elementRef instanceof HTMLElement) {
|
|
65387
|
-
potentialRoots.push(dynamicObject.elementRef);
|
|
65388
|
-
}
|
|
65927
|
+
const potentialRoots = dynamicObject.getEmbeddedContentRoots();
|
|
65389
65928
|
const legacyElementRef = dynamicObject.elmeentRef;
|
|
65390
65929
|
if (legacyElementRef instanceof HTMLElement) {
|
|
65391
65930
|
potentialRoots.push(legacyElementRef);
|
|
@@ -65562,8 +66101,8 @@ class KritzelSvgExportHelper {
|
|
|
65562
66101
|
.join('\n ');
|
|
65563
66102
|
const xmlDecl = includeXmlDeclaration ? '<?xml version="1.0" encoding="UTF-8"?>\n' : '';
|
|
65564
66103
|
const defsContent = defs.length > 0 ? `\n <defs>\n ${defs.join('\n ')}\n </defs>` : '';
|
|
65565
|
-
return `${xmlDecl}<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}" width="${viewBoxWidth}" height="${viewBoxHeight}">${defsContent}
|
|
65566
|
-
${elements}
|
|
66104
|
+
return `${xmlDecl}<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}" width="${viewBoxWidth}" height="${viewBoxHeight}">${defsContent}
|
|
66105
|
+
${elements}
|
|
65567
66106
|
</svg>`;
|
|
65568
66107
|
}
|
|
65569
66108
|
/**
|
|
@@ -65715,8 +66254,8 @@ class KritzelSvgExportHelper {
|
|
|
65715
66254
|
const orient = end === 'start' ? 'auto-start-reverse' : 'auto';
|
|
65716
66255
|
const refX = 0;
|
|
65717
66256
|
const refY = size / 2;
|
|
65718
|
-
return `<marker id="${markerId}" markerWidth="${size}" markerHeight="${size}" refX="${refX}" refY="${refY}" orient="${orient}" markerUnits="userSpaceOnUse">
|
|
65719
|
-
<path d="${path}" fill="${fill}" transform="scale(${size / 10})"/>
|
|
66257
|
+
return `<marker id="${markerId}" markerWidth="${size}" markerHeight="${size}" refX="${refX}" refY="${refY}" orient="${orient}" markerUnits="userSpaceOnUse">
|
|
66258
|
+
<path d="${path}" fill="${fill}" transform="scale(${size / 10})"/>
|
|
65720
66259
|
</marker>`;
|
|
65721
66260
|
}
|
|
65722
66261
|
/**
|
|
@@ -65745,6 +66284,9 @@ class KritzelSvgExportHelper {
|
|
|
65745
66284
|
if (KritzelClassHelper.isInstanceOf(object, 'KritzelDynamicObject')) {
|
|
65746
66285
|
return this.dynamicObjectToSvg(object, rasterSafeForCanvas);
|
|
65747
66286
|
}
|
|
66287
|
+
if (KritzelClassHelper.isInstanceOf(object, 'KritzelIframeObject')) {
|
|
66288
|
+
return this.iframeObjectToSvg(object);
|
|
66289
|
+
}
|
|
65748
66290
|
if (KritzelClassHelper.isInstanceOf(object, 'KritzelGroup')) {
|
|
65749
66291
|
return this.groupToSvg(object, theme, imageDataUrls, rasterSafeForCanvas);
|
|
65750
66292
|
}
|
|
@@ -65763,10 +66305,10 @@ class KritzelSvgExportHelper {
|
|
|
65763
66305
|
const opacity = path.opacity !== 1 ? ` opacity="${path.opacity}"` : '';
|
|
65764
66306
|
const scale = this.getObjectScale(path);
|
|
65765
66307
|
// Path needs to be wrapped in a g with translation since path.d uses local coordinates
|
|
65766
|
-
return `<g transform="${transform}"${opacity}>
|
|
65767
|
-
<svg viewBox="${path.viewBox}" width="${path.totalWidth / scale}" height="${path.totalHeight / scale}" overflow="visible">
|
|
65768
|
-
<path d="${path.d}" fill="${fill || 'none'}" stroke="${stroke || 'none'}"${path.strokeWidth ? ` stroke-width="${path.strokeWidth}"` : ''}/>
|
|
65769
|
-
</svg>
|
|
66308
|
+
return `<g transform="${transform}"${opacity}>
|
|
66309
|
+
<svg viewBox="${path.viewBox}" width="${path.totalWidth / scale}" height="${path.totalHeight / scale}" overflow="visible">
|
|
66310
|
+
<path d="${path.d}" fill="${fill || 'none'}" stroke="${stroke || 'none'}"${path.strokeWidth ? ` stroke-width="${path.strokeWidth}"` : ''}/>
|
|
66311
|
+
</svg>
|
|
65770
66312
|
</g>`;
|
|
65771
66313
|
}
|
|
65772
66314
|
/**
|
|
@@ -65782,10 +66324,10 @@ class KritzelSvgExportHelper {
|
|
|
65782
66324
|
const scale = this.getObjectScale(line);
|
|
65783
66325
|
const markerStart = line.hasStartArrow ? ` marker-start="url(#${line.startMarkerId})"` : '';
|
|
65784
66326
|
const markerEnd = line.hasEndArrow ? ` marker-end="url(#${line.endMarkerId})"` : '';
|
|
65785
|
-
return `<g transform="${transform}"${opacity}>
|
|
65786
|
-
<svg viewBox="${line.viewBox}" width="${line.totalWidth / scale}" height="${line.totalHeight / scale}" overflow="visible">
|
|
65787
|
-
<path d="${line.d}" fill="none" stroke="${stroke}" stroke-width="${line.strokeWidth}" stroke-linecap="round"${markerStart}${markerEnd}/>
|
|
65788
|
-
</svg>
|
|
66327
|
+
return `<g transform="${transform}"${opacity}>
|
|
66328
|
+
<svg viewBox="${line.viewBox}" width="${line.totalWidth / scale}" height="${line.totalHeight / scale}" overflow="visible">
|
|
66329
|
+
<path d="${line.d}" fill="none" stroke="${stroke}" stroke-width="${line.strokeWidth}" stroke-linecap="round"${markerStart}${markerEnd}/>
|
|
66330
|
+
</svg>
|
|
65789
66331
|
</g>`;
|
|
65790
66332
|
}
|
|
65791
66333
|
/**
|
|
@@ -65809,18 +66351,18 @@ class KritzelSvgExportHelper {
|
|
|
65809
66351
|
const textHtml = this.prosemirrorToHtml(shape.content, shape, theme);
|
|
65810
66352
|
if (textHtml) {
|
|
65811
66353
|
const fontColor = KritzelColorHelper.resolveThemeColor(shape.fontColor, theme);
|
|
65812
|
-
textContent = `
|
|
65813
|
-
<foreignObject x="${shape.x}" y="${shape.y}" width="${shape.width}" height="${shape.height}">
|
|
65814
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: ${shape.fontFamily}; font-size: ${shape.fontSize}px; color: ${fontColor}; overflow: hidden;">
|
|
65815
|
-
${textHtml}
|
|
65816
|
-
</div>
|
|
66354
|
+
textContent = `
|
|
66355
|
+
<foreignObject x="${shape.x}" y="${shape.y}" width="${shape.width}" height="${shape.height}">
|
|
66356
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: ${shape.fontFamily}; font-size: ${shape.fontSize}px; color: ${fontColor}; overflow: hidden;">
|
|
66357
|
+
${textHtml}
|
|
66358
|
+
</div>
|
|
65817
66359
|
</foreignObject>`;
|
|
65818
66360
|
}
|
|
65819
66361
|
}
|
|
65820
|
-
return `<g transform="${transform}"${opacity}>
|
|
65821
|
-
<svg viewBox="${shape.viewBox}" width="${shape.totalWidth / scale}" height="${shape.totalHeight / scale}" overflow="visible" preserveAspectRatio="none">
|
|
65822
|
-
<path d="${pathD}" fill="${fill || 'transparent'}" stroke="${stroke}" stroke-width="${shape.strokeWidth}"/>${textContent}
|
|
65823
|
-
</svg>
|
|
66362
|
+
return `<g transform="${transform}"${opacity}>
|
|
66363
|
+
<svg viewBox="${shape.viewBox}" width="${shape.totalWidth / scale}" height="${shape.totalHeight / scale}" overflow="visible" preserveAspectRatio="none">
|
|
66364
|
+
<path d="${pathD}" fill="${fill || 'transparent'}" stroke="${stroke}" stroke-width="${shape.strokeWidth}"/>${textContent}
|
|
66365
|
+
</svg>
|
|
65824
66366
|
</g>`;
|
|
65825
66367
|
}
|
|
65826
66368
|
/**
|
|
@@ -65851,10 +66393,10 @@ class KritzelSvgExportHelper {
|
|
|
65851
66393
|
// adjusted font-size already accounts for it – keeping both would double-scale
|
|
65852
66394
|
// the content and overflow the foreignObject.
|
|
65853
66395
|
const svgFontSizePx = (text.fontSize * (4 / 3) * (text.scaleFactor || 1) / scale).toFixed(4);
|
|
65854
|
-
return `<g transform="${transform}"${opacity}>
|
|
65855
|
-
<foreignObject x="0" y="0" width="${width}" height="${height}" overflow="visible">
|
|
65856
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${svgFontSizePx}px; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; white-space: pre-wrap; word-wrap: break-word; width: 100%; margin: 0; padding: 0; box-sizing: border-box;">${htmlContent.trim()}</div>
|
|
65857
|
-
</foreignObject>
|
|
66396
|
+
return `<g transform="${transform}"${opacity}>
|
|
66397
|
+
<foreignObject x="0" y="0" width="${width}" height="${height}" overflow="visible">
|
|
66398
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${svgFontSizePx}px; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; white-space: pre-wrap; word-wrap: break-word; width: 100%; margin: 0; padding: 0; box-sizing: border-box;">${htmlContent.trim()}</div>
|
|
66399
|
+
</foreignObject>
|
|
65858
66400
|
</g>`;
|
|
65859
66401
|
}
|
|
65860
66402
|
/**
|
|
@@ -65888,9 +66430,9 @@ class KritzelSvgExportHelper {
|
|
|
65888
66430
|
return `<tspan x="0" y="${y}" xml:space="preserve">${this.escapeHtml(line)}</tspan>`;
|
|
65889
66431
|
})
|
|
65890
66432
|
.join('');
|
|
65891
|
-
return `<g transform="${transform}"${opacity}>
|
|
65892
|
-
${bgRect}
|
|
65893
|
-
<text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSizePx}" fill="${fontColor}">${tspans}</text>
|
|
66433
|
+
return `<g transform="${transform}"${opacity}>
|
|
66434
|
+
${bgRect}
|
|
66435
|
+
<text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSizePx}" fill="${fontColor}">${tspans}</text>
|
|
65894
66436
|
</g>`;
|
|
65895
66437
|
}
|
|
65896
66438
|
/**
|
|
@@ -65918,8 +66460,8 @@ class KritzelSvgExportHelper {
|
|
|
65918
66460
|
const width = image.totalWidth / scale;
|
|
65919
66461
|
const height = image.totalHeight / scale;
|
|
65920
66462
|
const href = imageDataUrls?.get(image.id) || image.resolvedSrc || image.src || '';
|
|
65921
|
-
return `<g transform="${transform}"${opacity}>
|
|
65922
|
-
<image href="${href}" x="0" y="0" width="${width}" height="${height}" preserveAspectRatio="xMidYMid meet"/>
|
|
66463
|
+
return `<g transform="${transform}"${opacity}>
|
|
66464
|
+
<image href="${href}" x="0" y="0" width="${width}" height="${height}" preserveAspectRatio="xMidYMid meet"/>
|
|
65923
66465
|
</g>`;
|
|
65924
66466
|
}
|
|
65925
66467
|
/**
|
|
@@ -65939,19 +66481,30 @@ class KritzelSvgExportHelper {
|
|
|
65939
66481
|
if (rasterSafeForCanvas) {
|
|
65940
66482
|
// PNG export: render placeholder rect (foreignObject doesn't rasterize to PNG well)
|
|
65941
66483
|
console.warn('[KritzelDynamicObject SVG Export] Dynamic objects do not serialize well to PNG. Use SVG export or screenshot instead.');
|
|
65942
|
-
return `<g transform="${transform}"${opacity}>
|
|
65943
|
-
<rect x="0" y="0" width="${width}" height="${height}" fill="#f0f0f0" stroke="#999" stroke-width="1" />
|
|
65944
|
-
<text x="${width / 2}" y="${height / 2}" text-anchor="middle" dominant-baseline="middle" font-size="12" fill="#999">[Dynamic Object]</text>
|
|
66484
|
+
return `<g transform="${transform}"${opacity}>
|
|
66485
|
+
<rect x="0" y="0" width="${width}" height="${height}" fill="#f0f0f0" stroke="#999" stroke-width="1" />
|
|
66486
|
+
<text x="${width / 2}" y="${height / 2}" text-anchor="middle" dominant-baseline="middle" font-size="12" fill="#999">[Dynamic Object]</text>
|
|
65945
66487
|
</g>`;
|
|
65946
66488
|
}
|
|
65947
66489
|
// SVG export: use foreignObject to embed HTML
|
|
65948
66490
|
const html = obj.element?.outerHTML || '<div style="border:1px dashed #ccc">Empty</div>';
|
|
65949
|
-
return `<g transform="${transform}"${opacity}>
|
|
65950
|
-
<foreignObject x="0" y="0" width="${width}" height="${height}">
|
|
65951
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden;">
|
|
65952
|
-
${html}
|
|
65953
|
-
</div>
|
|
65954
|
-
</foreignObject>
|
|
66491
|
+
return `<g transform="${transform}"${opacity}>
|
|
66492
|
+
<foreignObject x="0" y="0" width="${width}" height="${height}">
|
|
66493
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden;">
|
|
66494
|
+
${html}
|
|
66495
|
+
</div>
|
|
66496
|
+
</foreignObject>
|
|
66497
|
+
</g>`;
|
|
66498
|
+
}
|
|
66499
|
+
static iframeObjectToSvg(object) {
|
|
66500
|
+
const transform = this.buildTransform(object);
|
|
66501
|
+
const opacity = object.opacity !== 1 ? ` opacity="${object.opacity}"` : '';
|
|
66502
|
+
const scale = this.getObjectScale(object);
|
|
66503
|
+
const width = object.totalWidth / scale;
|
|
66504
|
+
const height = object.totalHeight / scale;
|
|
66505
|
+
return `<g transform="${transform}"${opacity}>
|
|
66506
|
+
<rect x="0" y="0" width="${width}" height="${height}" fill="#f0f0f0" stroke="#999" stroke-width="1" />
|
|
66507
|
+
<text x="${width / 2}" y="${height / 2}" text-anchor="middle" dominant-baseline="middle" font-size="12" fill="#999">[Iframe]</text>
|
|
65955
66508
|
</g>`;
|
|
65956
66509
|
}
|
|
65957
66510
|
/**
|
|
@@ -65971,8 +66524,8 @@ class KritzelSvgExportHelper {
|
|
|
65971
66524
|
return '';
|
|
65972
66525
|
}
|
|
65973
66526
|
const opacity = group.opacity !== 1 ? ` opacity="${group.opacity}"` : '';
|
|
65974
|
-
return `<g${opacity}>
|
|
65975
|
-
${children}
|
|
66527
|
+
return `<g${opacity}>
|
|
66528
|
+
${children}
|
|
65976
66529
|
</g>`;
|
|
65977
66530
|
}
|
|
65978
66531
|
/**
|
|
@@ -66157,12 +66710,26 @@ const KritzelEngine = class {
|
|
|
66157
66710
|
/** Authoritative workspace catalog for this engine instance. When provided, provider-only workspaces are hidden but not deleted. */
|
|
66158
66711
|
workspaces;
|
|
66159
66712
|
async onWorkspacesPropChange() {
|
|
66160
|
-
|
|
66713
|
+
this._workspacesRevision++;
|
|
66714
|
+
if (!this._isYjsInitialized || this._syncInitPromise) {
|
|
66161
66715
|
return;
|
|
66162
66716
|
}
|
|
66163
|
-
|
|
66164
|
-
|
|
66165
|
-
|
|
66717
|
+
const previousReconciliation = this._workspacePropReconciliationPromise;
|
|
66718
|
+
const reconciliationPromise = (async () => {
|
|
66719
|
+
await previousReconciliation;
|
|
66720
|
+
await this.reconcileProvidedWorkspaces();
|
|
66721
|
+
await this.ensureActiveWorkspaceIsVisible();
|
|
66722
|
+
this.workspacesChange.emit(this.getVisibleWorkspaces());
|
|
66723
|
+
})();
|
|
66724
|
+
this._workspacePropReconciliationPromise = reconciliationPromise;
|
|
66725
|
+
try {
|
|
66726
|
+
await reconciliationPromise;
|
|
66727
|
+
}
|
|
66728
|
+
finally {
|
|
66729
|
+
if (this._workspacePropReconciliationPromise === reconciliationPromise) {
|
|
66730
|
+
this._workspacePropReconciliationPromise = null;
|
|
66731
|
+
}
|
|
66732
|
+
}
|
|
66166
66733
|
}
|
|
66167
66734
|
/** Optional unique identifier for namespacing storage keys across multiple editor instances. */
|
|
66168
66735
|
editorId;
|
|
@@ -66216,6 +66783,12 @@ const KritzelEngine = class {
|
|
|
66216
66783
|
onUserChange(newValue) {
|
|
66217
66784
|
this.core.setUser(newValue);
|
|
66218
66785
|
}
|
|
66786
|
+
/** Tool definitions to register with this engine instance. */
|
|
66787
|
+
tools = [];
|
|
66788
|
+
onToolsChange() {
|
|
66789
|
+
this._toolsRevision++;
|
|
66790
|
+
void this.registerConfiguredTools();
|
|
66791
|
+
}
|
|
66219
66792
|
/** Context menu items shown when right-clicking the canvas background. */
|
|
66220
66793
|
globalContextMenuItems;
|
|
66221
66794
|
onGlobalContextMenuItemsChange(newValue) {
|
|
@@ -66406,7 +66979,7 @@ const KritzelEngine = class {
|
|
|
66406
66979
|
}
|
|
66407
66980
|
const hoveredObject = this.core.getObjectFromPointerEvent(ev);
|
|
66408
66981
|
if (hoveredObject &&
|
|
66409
|
-
ObjectHelper.
|
|
66982
|
+
ObjectHelper.isKritzelEmbeddedObject(hoveredObject) &&
|
|
66410
66983
|
KritzelWheelHelper.shouldKeepWheelInDynamicObject(ev, hoveredObject)) {
|
|
66411
66984
|
return;
|
|
66412
66985
|
}
|
|
@@ -66508,7 +67081,7 @@ const KritzelEngine = class {
|
|
|
66508
67081
|
return false;
|
|
66509
67082
|
}
|
|
66510
67083
|
const object = this.core.store.objects.findById(objectElement.id);
|
|
66511
|
-
if (!object || !
|
|
67084
|
+
if (!object || !ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
66512
67085
|
return false;
|
|
66513
67086
|
}
|
|
66514
67087
|
const isSelected = !!this.core.store.selectionGroup?.objects?.some(selectedObject => selectedObject.id === object.id);
|
|
@@ -66518,13 +67091,7 @@ const KritzelEngine = class {
|
|
|
66518
67091
|
if (object.isInteractive !== true) {
|
|
66519
67092
|
return false;
|
|
66520
67093
|
}
|
|
66521
|
-
const potentialRoots =
|
|
66522
|
-
if (object.element instanceof HTMLElement) {
|
|
66523
|
-
potentialRoots.push(object.element);
|
|
66524
|
-
}
|
|
66525
|
-
if (object.elementRef instanceof HTMLElement) {
|
|
66526
|
-
potentialRoots.push(object.elementRef);
|
|
66527
|
-
}
|
|
67094
|
+
const potentialRoots = object.getEmbeddedContentRoots();
|
|
66528
67095
|
if (potentialRoots.length === 0) {
|
|
66529
67096
|
return false;
|
|
66530
67097
|
}
|
|
@@ -66698,7 +67265,7 @@ const KritzelEngine = class {
|
|
|
66698
67265
|
* Switches the active drawing tool by its registered name.
|
|
66699
67266
|
* @param toolName - The name the tool was registered with (e.g., 'brush', 'eraser').
|
|
66700
67267
|
*/
|
|
66701
|
-
async
|
|
67268
|
+
async setActiveTool(toolName) {
|
|
66702
67269
|
const tool = this.core.toolRegistry.getTool(toolName);
|
|
66703
67270
|
if (!tool) {
|
|
66704
67271
|
console.warn(`[KritzelEngine] No tool registered with name: ${toolName}`);
|
|
@@ -68004,9 +68571,13 @@ const KritzelEngine = class {
|
|
|
68004
68571
|
_stateChangeListenersRegistered = false;
|
|
68005
68572
|
_workspaceInitializationPromise = null;
|
|
68006
68573
|
_workspaceInitializationTargetKey = null;
|
|
68574
|
+
_workspacePropReconciliationPromise = null;
|
|
68007
68575
|
_syncInitPromise = null;
|
|
68576
|
+
_toolsInitPromise = null;
|
|
68577
|
+
_toolsRevision = 0;
|
|
68008
68578
|
_syncConfigRevision = 0;
|
|
68009
68579
|
_assetStorageConfigRevision = 0;
|
|
68580
|
+
_workspacesRevision = 0;
|
|
68010
68581
|
_hasLoggedUnlicensedWelcomeBanner = false;
|
|
68011
68582
|
_previousVisibleDynamicObjects = new Set();
|
|
68012
68583
|
_revealedImageKeys = new Set();
|
|
@@ -68019,6 +68590,37 @@ const KritzelEngine = class {
|
|
|
68019
68590
|
undoStackSize: 0,
|
|
68020
68591
|
redoStackSize: 0,
|
|
68021
68592
|
};
|
|
68593
|
+
/** Returns a tool registered in this engine instance. */
|
|
68594
|
+
async getTool(toolName) {
|
|
68595
|
+
await this.registerConfiguredTools();
|
|
68596
|
+
return this.core.toolRegistry.getTool(toolName);
|
|
68597
|
+
}
|
|
68598
|
+
async registerConfiguredTools() {
|
|
68599
|
+
if (this._toolsInitPromise) {
|
|
68600
|
+
return this._toolsInitPromise;
|
|
68601
|
+
}
|
|
68602
|
+
this._toolsInitPromise = (async () => {
|
|
68603
|
+
do {
|
|
68604
|
+
const revision = this._toolsRevision;
|
|
68605
|
+
for (const definition of this.tools) {
|
|
68606
|
+
let toolClass = definition.tool;
|
|
68607
|
+
if (typeof toolClass !== 'function') {
|
|
68608
|
+
toolClass = toolClass.constructor;
|
|
68609
|
+
}
|
|
68610
|
+
await this.registerTool(definition.name, toolClass, definition.config);
|
|
68611
|
+
}
|
|
68612
|
+
if (revision === this._toolsRevision) {
|
|
68613
|
+
break;
|
|
68614
|
+
}
|
|
68615
|
+
} while (true);
|
|
68616
|
+
})();
|
|
68617
|
+
try {
|
|
68618
|
+
await this._toolsInitPromise;
|
|
68619
|
+
}
|
|
68620
|
+
finally {
|
|
68621
|
+
this._toolsInitPromise = null;
|
|
68622
|
+
}
|
|
68623
|
+
}
|
|
68022
68624
|
setLoadingState(isLoading) {
|
|
68023
68625
|
if (this.core.store.state.isLoading === isLoading) {
|
|
68024
68626
|
return;
|
|
@@ -68146,6 +68748,8 @@ const KritzelEngine = class {
|
|
|
68146
68748
|
this.core.licenseManager.destroy();
|
|
68147
68749
|
}
|
|
68148
68750
|
componentWillLoad() {
|
|
68751
|
+
this._toolsRevision++;
|
|
68752
|
+
void this.registerConfiguredTools();
|
|
68149
68753
|
this.core.setEditorId(this.editorId);
|
|
68150
68754
|
if (this.themes && this.themes.length > 0) {
|
|
68151
68755
|
this.core.themeManager.registerThemes(this.themes);
|
|
@@ -68185,7 +68789,9 @@ const KritzelEngine = class {
|
|
|
68185
68789
|
const editorElement = this.host.closest('kritzel-editor');
|
|
68186
68790
|
this.core.themeManager.setTargetElement(editorElement || this.host);
|
|
68187
68791
|
// Initialize sync config and Yjs
|
|
68792
|
+
await this.registerConfiguredTools();
|
|
68188
68793
|
await this.initializeSyncAndWorkspace();
|
|
68794
|
+
await this.waitForWorkspaceAndSceneReady();
|
|
68189
68795
|
if (this.core.store.state.isReady === false) {
|
|
68190
68796
|
this.core.store.state.isReady = true;
|
|
68191
68797
|
this.logUnlicensedWelcomeBanner();
|
|
@@ -68207,6 +68813,20 @@ const KritzelEngine = class {
|
|
|
68207
68813
|
this._syncInitPromise = null;
|
|
68208
68814
|
}
|
|
68209
68815
|
}
|
|
68816
|
+
async waitForSceneRender() {
|
|
68817
|
+
await new Promise(resolve => {
|
|
68818
|
+
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
|
|
68819
|
+
});
|
|
68820
|
+
}
|
|
68821
|
+
async waitForWorkspaceAndSceneReady() {
|
|
68822
|
+
let observedRevision;
|
|
68823
|
+
do {
|
|
68824
|
+
observedRevision = this._workspacesRevision;
|
|
68825
|
+
await this._workspacePropReconciliationPromise;
|
|
68826
|
+
await this.waitForSceneRender();
|
|
68827
|
+
} while (observedRevision !== this._workspacesRevision ||
|
|
68828
|
+
this._workspacePropReconciliationPromise);
|
|
68829
|
+
}
|
|
68210
68830
|
/**
|
|
68211
68831
|
* Initializes the asset storage layer with the latest config. Mirrors
|
|
68212
68832
|
* the in-flight replay logic of {@link doInitializeSyncAndWorkspace} for
|
|
@@ -68589,7 +69209,7 @@ const KritzelEngine = class {
|
|
|
68589
69209
|
if (!KritzelClassHelper.isInstanceOf(object, 'KritzelSelectionGroup')) {
|
|
68590
69210
|
return 'auto';
|
|
68591
69211
|
}
|
|
68592
|
-
if (object.objects.length === 1 &&
|
|
69212
|
+
if (object.objects.length === 1 && ObjectHelper.isKritzelEmbeddedObject(object.objects[0])) {
|
|
68593
69213
|
return 'none';
|
|
68594
69214
|
}
|
|
68595
69215
|
return 'auto';
|
|
@@ -68597,7 +69217,7 @@ const KritzelEngine = class {
|
|
|
68597
69217
|
// Track visible dynamic objects and unmount culled ones
|
|
68598
69218
|
const currentVisibleDynamicObjects = new Set();
|
|
68599
69219
|
visibleObjects.forEach(object => {
|
|
68600
|
-
if (
|
|
69220
|
+
if (ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
68601
69221
|
currentVisibleDynamicObjects.add(object.id);
|
|
68602
69222
|
}
|
|
68603
69223
|
});
|
|
@@ -68605,7 +69225,7 @@ const KritzelEngine = class {
|
|
|
68605
69225
|
this._previousVisibleDynamicObjects.forEach(id => {
|
|
68606
69226
|
if (!currentVisibleDynamicObjects.has(id)) {
|
|
68607
69227
|
const object = this.core.store.objects.findById(id);
|
|
68608
|
-
if (object &&
|
|
69228
|
+
if (object && ObjectHelper.isKritzelEmbeddedObject(object)) {
|
|
68609
69229
|
object.unmount();
|
|
68610
69230
|
}
|
|
68611
69231
|
}
|
|
@@ -68698,7 +69318,7 @@ const KritzelEngine = class {
|
|
|
68698
69318
|
display: 'flex',
|
|
68699
69319
|
alignItems: 'center',
|
|
68700
69320
|
justifyContent: 'center',
|
|
68701
|
-
} }, h("kritzel-icon", { name: object.loadState === 'error' ? '
|
|
69321
|
+
} }, h("kritzel-icon", { name: object.loadState === 'error' ? 'imageOff' : 'image', size: Math.max(16, Math.min(object.totalWidth, object.totalHeight) * 0.3), style: {
|
|
68702
69322
|
color: KritzelColorHelper.resolveThemeColor({ light: '#9ca3af', dark: '#6b7280' }, currentTheme),
|
|
68703
69323
|
} }))), KritzelClassHelper.isInstanceOf(object, 'KritzelDynamicObject') && (h("div", { ref: el => el && object.mount(el), style: {
|
|
68704
69324
|
position: 'absolute',
|
|
@@ -68717,7 +69337,37 @@ const KritzelEngine = class {
|
|
|
68717
69337
|
padding: object.padding + 'px',
|
|
68718
69338
|
overflow: 'visible',
|
|
68719
69339
|
display: 'block',
|
|
68720
|
-
} })), KritzelClassHelper.isInstanceOf(object, '
|
|
69340
|
+
} })), KritzelClassHelper.isInstanceOf(object, 'KritzelIframeObject') && (h("div", { style: {
|
|
69341
|
+
position: 'absolute',
|
|
69342
|
+
left: '0',
|
|
69343
|
+
top: '0',
|
|
69344
|
+
width: object.totalWidth + 'px',
|
|
69345
|
+
height: object.totalHeight + 'px',
|
|
69346
|
+
transform: object.rotationDegrees !== 0 ? `rotate(${object.rotationDegrees}deg)` : undefined,
|
|
69347
|
+
transformOrigin: object.rotationDegrees !== 0 ? `${object.totalWidth / 2}px ${object.totalHeight / 2}px` : undefined,
|
|
69348
|
+
opacity: effectiveOpacityString,
|
|
69349
|
+
backgroundColor: KritzelColorHelper.resolveThemeColor(object.backgroundColor, currentTheme),
|
|
69350
|
+
borderColor: KritzelColorHelper.resolveThemeColor(object.borderColor, currentTheme),
|
|
69351
|
+
borderWidth: object.borderWidth + 'px',
|
|
69352
|
+
borderStyle: 'solid',
|
|
69353
|
+
borderRadius: object.borderRadius !== undefined ? (typeof object.borderRadius === 'number' ? `${object.borderRadius}px` : object.borderRadius) : undefined,
|
|
69354
|
+
boxShadow: object.boxShadow,
|
|
69355
|
+
overflow: 'hidden',
|
|
69356
|
+
display: 'block',
|
|
69357
|
+
pointerEvents: object.markedForRemoval ? 'none' : 'auto',
|
|
69358
|
+
} }, h("iframe", { ref: element => element && object.mount(element), title: object.title, sandbox: object.sandboxAttribute, style: {
|
|
69359
|
+
display: 'block',
|
|
69360
|
+
width: '100%',
|
|
69361
|
+
height: '100%',
|
|
69362
|
+
border: '0',
|
|
69363
|
+
borderRadius: object.borderRadius !== undefined ? (typeof object.borderRadius === 'number' ? `${object.borderRadius}px` : object.borderRadius) : undefined,
|
|
69364
|
+
pointerEvents: object.isInteractive ? 'auto' : 'none',
|
|
69365
|
+
} }), h("div", { style: {
|
|
69366
|
+
position: 'absolute',
|
|
69367
|
+
inset: '0',
|
|
69368
|
+
borderRadius: object.borderRadius !== undefined ? (typeof object.borderRadius === 'number' ? `${object.borderRadius}px` : object.borderRadius) : undefined,
|
|
69369
|
+
pointerEvents: object.isInteractive ? 'none' : 'auto',
|
|
69370
|
+
} }))), KritzelClassHelper.isInstanceOf(object, 'KritzelSelectionGroup') && !this.core.displaySelectionLineUI(object) && (h("div", { ref: el => el && object.mount(el), style: {
|
|
68721
69371
|
position: 'absolute',
|
|
68722
69372
|
left: '0',
|
|
68723
69373
|
top: '0',
|
|
@@ -69075,6 +69725,9 @@ const KritzelEngine = class {
|
|
|
69075
69725
|
"user": [{
|
|
69076
69726
|
"onUserChange": 0
|
|
69077
69727
|
}],
|
|
69728
|
+
"tools": [{
|
|
69729
|
+
"onToolsChange": 0
|
|
69730
|
+
}],
|
|
69078
69731
|
"globalContextMenuItems": [{
|
|
69079
69732
|
"onGlobalContextMenuItemsChange": 0
|
|
69080
69733
|
}],
|
|
@@ -69211,7 +69864,7 @@ const KritzelExport = class {
|
|
|
69211
69864
|
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 })));
|
|
69212
69865
|
}
|
|
69213
69866
|
render() {
|
|
69214
|
-
return (h(Host, { key: '
|
|
69867
|
+
return (h(Host, { key: '94d55a7c75cdad6c8772180656016ef7a84ea937' }, h("kritzel-dialog", { key: '7564885a16e21f036e4943f9be923ef3db07ab77', isOpen: this.isDialogOpen, dialogTitle: this.terms['export.dialogTitle'] ?? 'Export', closable: true, contained: true, onDialogClose: this.closeDialog }, h("div", { key: '40fceeacffc79d70ecea2c397f19852e85756d50', class: "export-content" }, h("kritzel-pill-tabs", { key: 'a2bb5be3df21f940d8e3f7d27fa9fbc956f16a55', tabs: this.tabs, value: this.activeTab, onValueChange: this.handleTabChange }), this.activeTab === 'viewport' && this.renderViewportExport(), this.activeTab === 'workspace' && this.renderWorkspaceExport()), h("div", { key: '29a0fcb85755577655401c96643a1956aedfa27d', slot: "footer" }, h("button", { key: 'f003963d407005c67740b6620b8983dcf3c8977a', class: "export-primary-button", onClick: this.handleExport }, this.terms['export.exportButton'] ?? 'Export')))));
|
|
69215
69868
|
}
|
|
69216
69869
|
};
|
|
69217
69870
|
KritzelExport.style = kritzelExportCss();
|
|
@@ -69226,7 +69879,7 @@ const KritzelFont = class {
|
|
|
69226
69879
|
size = 24;
|
|
69227
69880
|
color = '#000000';
|
|
69228
69881
|
render() {
|
|
69229
|
-
return (h(Host, { key: '
|
|
69882
|
+
return (h(Host, { key: '7ee5e56528fd93c5b00c930e0404b55aa6ba29f7' }, h("div", { key: '54111872192f8f6aa4a523c81fdcbacacde5facf', class: "font-preview", style: {
|
|
69230
69883
|
fontFamily: this.fontFamily,
|
|
69231
69884
|
fontSize: `${this.size}px`,
|
|
69232
69885
|
color: this.color
|
|
@@ -69276,7 +69929,7 @@ const KritzelFontFamily = class {
|
|
|
69276
69929
|
label: option.label,
|
|
69277
69930
|
style: { fontFamily: option.cssFontFamily ?? option.value },
|
|
69278
69931
|
}));
|
|
69279
|
-
return (h(Host, { key: '
|
|
69932
|
+
return (h(Host, { key: '059350f34370f7a291f47a42721ca5d9bb82df49' }, h("kritzel-dropdown", { key: 'fbd8cf1ae463c7e9b76d0ac754a41de54397058e', options: dropdownOptions, value: this.selectedFontFamily, onValueChanged: this.handleDropdownValueChange, selectStyles: { fontFamily: selectedFontFamily } })));
|
|
69280
69933
|
}
|
|
69281
69934
|
static get watchers() { return {
|
|
69282
69935
|
"fontOptions": [{
|
|
@@ -69310,7 +69963,7 @@ const KritzelFontSize = class {
|
|
|
69310
69963
|
render() {
|
|
69311
69964
|
const color = 'var(--kritzel-global-text-primary)';
|
|
69312
69965
|
const sizes = this.sizes ?? [];
|
|
69313
|
-
return (h(Host, { key: '
|
|
69966
|
+
return (h(Host, { key: 'e8309800110db6b59eb1c43ede2e4e94d085f380' }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
69314
69967
|
'size-container': true,
|
|
69315
69968
|
'selected': this.selectedSize === size,
|
|
69316
69969
|
}, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
|
|
@@ -69327,6 +69980,20 @@ const KritzelIcon = class {
|
|
|
69327
69980
|
name;
|
|
69328
69981
|
label;
|
|
69329
69982
|
size = 24;
|
|
69983
|
+
unsubscribe;
|
|
69984
|
+
connectedCallback() {
|
|
69985
|
+
this.unsubscribe?.();
|
|
69986
|
+
this.unsubscribe = KritzelIconRegistry.subscribe(name => {
|
|
69987
|
+
if (name === this.name) {
|
|
69988
|
+
forceUpdate(this);
|
|
69989
|
+
}
|
|
69990
|
+
});
|
|
69991
|
+
forceUpdate(this);
|
|
69992
|
+
}
|
|
69993
|
+
disconnectedCallback() {
|
|
69994
|
+
this.unsubscribe?.();
|
|
69995
|
+
this.unsubscribe = undefined;
|
|
69996
|
+
}
|
|
69330
69997
|
render() {
|
|
69331
69998
|
const svgContent = KritzelIconRegistry.get(this.name);
|
|
69332
69999
|
if (!svgContent) {
|
|
@@ -69377,7 +70044,7 @@ const KritzelInput = class {
|
|
|
69377
70044
|
this.valueChange.emit(input.value);
|
|
69378
70045
|
};
|
|
69379
70046
|
render() {
|
|
69380
|
-
return (h(Host, { key: '
|
|
70047
|
+
return (h(Host, { key: '7294192b97df384f321825a8fa30c822f79b6f29' }, h("div", { key: 'c355a4ee26adf0ab71d27e1697eddc1f9533d665', class: "input-container" }, this.label && h("label", { key: '75ee613cdbd20acc6dbd16642bd4dac9058309aa', class: "input-label" }, this.label), h("div", { key: '0395860993deda5cd57d8a185df8b36a52742841', class: { 'input-wrapper': true, 'has-suffix': !!this.suffix } }, h("input", { key: 'a12d80b4d51bcd1526b49119fb2b20ad9343d71b', type: this.type, class: "text-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput }), this.suffix && h("span", { key: 'b682a1764795c2f9039b78e866be09609f7d0d80', class: "input-suffix" }, this.suffix)))));
|
|
69381
70048
|
}
|
|
69382
70049
|
static get watchers() { return {
|
|
69383
70050
|
"value": [{
|
|
@@ -69459,10 +70126,10 @@ const KritzelLineEndings = class {
|
|
|
69459
70126
|
render() {
|
|
69460
70127
|
const startEnding = this.getStartEnding();
|
|
69461
70128
|
const endEnding = this.getEndEnding();
|
|
69462
|
-
return (h(Host, { key: '
|
|
70129
|
+
return (h(Host, { key: '257d56ca7c191f2c0a7b4492ed29b029d271304c' }, h("div", { key: '294ca5f5006990ffec411eb9a67bf547a92af446', class: "endings-section" }, h("div", { key: 'bb3face6f0673d215ad820dfafdb8f5ba61390a9', class: "endings-row" }, this.styles.map(type => (h("button", { class: {
|
|
69463
70130
|
'ending-option': true,
|
|
69464
70131
|
'selected': startEnding === type,
|
|
69465
|
-
}, onClick: () => this.handleStartChange(type), title: type === 'none' ? 'No start arrow' : `${type} start arrow` }, this.renderEndingIcon(type, true)))))), h("div", { key: '
|
|
70132
|
+
}, onClick: () => this.handleStartChange(type), title: type === 'none' ? 'No start arrow' : `${type} start arrow` }, this.renderEndingIcon(type, true)))))), h("div", { key: 'dbc47b5b744e5bc3fac0fd099a2afe3a90e4bdc0', class: "endings-section" }, h("div", { key: '00a017c7f98a3347ed29b39003ae49b2782bae8f', class: "endings-row" }, this.styles.map(type => (h("button", { class: {
|
|
69466
70133
|
'ending-option': true,
|
|
69467
70134
|
'selected': endEnding === type,
|
|
69468
70135
|
}, onClick: () => this.handleEndChange(type), title: type === 'none' ? 'No end arrow' : `${type} end arrow` }, this.renderEndingIcon(type, false))))))));
|
|
@@ -69470,7 +70137,7 @@ const KritzelLineEndings = class {
|
|
|
69470
70137
|
};
|
|
69471
70138
|
KritzelLineEndings.style = kritzelLineEndingsCss();
|
|
69472
70139
|
|
|
69473
|
-
const kritzelLoadingOverlayCss = () => `:host{position:absolute;inset:0;z-index:var(--kritzel-editor-loading-overlay-z-index, 1);display:block;pointer-events:none}.loading-overlay{position:absolute;inset:0;z-index:0;display:flex;align-items:center;justify-content:center;gap:10px;background-color:var(--kritzel-editor-loading-overlay-background, rgba(255, 255, 255, 0.6));color:var(--kritzel-editor-loading-overlay-color, #333);font-family:var(--kritzel-font-family, sans-serif);font-size:1.25rem;opacity:0;pointer-events:none;visibility:hidden;transition:opacity 300ms ease,
|
|
70140
|
+
const kritzelLoadingOverlayCss = () => `:host{position:absolute;inset:0;z-index:var(--kritzel-editor-loading-overlay-z-index, 1);display:block;pointer-events:none}.loading-overlay{position:absolute;inset:0;z-index:0;display:flex;align-items:center;justify-content:center;gap:10px;background-color:var(--kritzel-editor-loading-overlay-background, rgba(255, 255, 255, 0.6));color:var(--kritzel-editor-loading-overlay-color, #333);font-family:var(--kritzel-global-font-family, sans-serif);font-size:1.25rem;opacity:0;pointer-events:none;visibility:hidden;transition:opacity 300ms ease, visibility 0s linear 300ms}.loading-overlay.visible{opacity:1;pointer-events:all;visibility:visible;transition:opacity 300ms ease, visibility 0s linear 0s}.loading-spinner{width:20px;height:20px;box-sizing:border-box;display:block;flex-shrink:0;border:2px solid var(--kritzel-editor-loading-overlay-spinner-color, #cccccc);border-top-color:var(--kritzel-editor-loading-overlay-spinner-active-color, #333333);border-radius:50%;animation:kritzel-loading-spin 0.6s linear infinite}@keyframes kritzel-loading-spin{to{transform:rotate(360deg)}}`;
|
|
69474
70141
|
|
|
69475
70142
|
const KritzelLoadingOverlay = class {
|
|
69476
70143
|
constructor(hostRef) {
|
|
@@ -69485,7 +70152,7 @@ const KritzelLoadingOverlay = class {
|
|
|
69485
70152
|
*/
|
|
69486
70153
|
text = 'Loading...';
|
|
69487
70154
|
render() {
|
|
69488
|
-
return (h(Host, { key: '
|
|
70155
|
+
return (h(Host, { key: '1d00fc91ac568b7472121a37abe353dcee3db25c' }, h("div", { key: '5a32738aa35b799249694ef3fdd7a59ed7f06fee', class: { 'loading-overlay': true, visible: this.visible }, "aria-hidden": this.visible ? 'false' : 'true' }, h("span", { key: '9cc309802bf617f02d02d7017e8194634393b870', class: "loading-spinner" }), this.text)));
|
|
69489
70156
|
}
|
|
69490
70157
|
};
|
|
69491
70158
|
KritzelLoadingOverlay.style = kritzelLoadingOverlayCss();
|
|
@@ -69537,7 +70204,7 @@ const KritzelLoginDialog = class {
|
|
|
69537
70204
|
this.dialogClosed.emit();
|
|
69538
70205
|
};
|
|
69539
70206
|
render() {
|
|
69540
|
-
return (h(Host, { key: '
|
|
70207
|
+
return (h(Host, { key: '68f2b90426d32b12ac1e03dbed2f0c6f5e34eb9e' }, h("kritzel-dialog", { key: '2f6b6134ac984237593e587b0480d71fbdc9789e', dialogTitle: this.dialogTitle, isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: 'd078c5cc1ef8465da47021b6562783a01d50f574', class: "login-content" }, this.subtitle && (h("p", { key: 'd42b498c43796703b2f92a5aaae2505113008e0e', class: "login-subtitle" }, this.subtitle)), h("div", { key: '1e6484c63e5bf6799ad566d753cc1e2bc4b518ff', class: "login-providers" }, this.providers.map(provider => (h("button", { key: provider.name, class: {
|
|
69541
70208
|
'provider-button': true,
|
|
69542
70209
|
'is-loading': this.loadingProvider === provider.name,
|
|
69543
70210
|
'is-disabled': this.loadingProvider !== null && this.loadingProvider !== provider.name,
|
|
@@ -69643,15 +70310,15 @@ const KritzelMasterDetail = class {
|
|
|
69643
70310
|
const selectedItem = this.items.find(item => item.id === this.selectedItemId);
|
|
69644
70311
|
const panelId = 'master-detail-panel';
|
|
69645
70312
|
const selectedTabId = selectedItem ? `tab-${selectedItem.id}` : undefined;
|
|
69646
|
-
return (h(Host, { key: '
|
|
70313
|
+
return (h(Host, { key: 'dfb5a1fcc9e7cdc1dc803a1ebad437fd125f0544' }, h("div", { key: '9f7dbadccd893ad5c60f4c51052805729144d09e', class: {
|
|
69647
70314
|
'master-detail-container': true,
|
|
69648
70315
|
'is-mobile-detail-visible': this.showMobileDetail,
|
|
69649
|
-
} }, h("nav", { key: '
|
|
70316
|
+
} }, h("nav", { key: '40e23f5e5c123a80b7bd62fecc0c0121d9f671f2', 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: {
|
|
69650
70317
|
'menu-item': true,
|
|
69651
70318
|
'is-selected': item.id === this.selectedItemId,
|
|
69652
70319
|
'is-disabled': !!item.disabled,
|
|
69653
70320
|
'is-focused': index === this.focusedIndex,
|
|
69654
|
-
}, 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: '
|
|
70321
|
+
}, 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: 'fe85069f67961b6f266fe602f17c130b5e554b1f', id: panelId, class: "detail-panel", role: "tabpanel", "aria-labelledby": selectedTabId }, h("button", { key: '33feba674e61adddd31457e4a5c22d7932071c01', class: "mobile-back-button", onClick: this.handleBackClick, "aria-label": "Back to menu" }, h("kritzel-icon", { key: 'c94f80d668dbf8689bb4f2c8d7c8d1fb7b650715', name: "chevronLeft", size: 20, class: "mobile-back-icon" }), "Back"), h("slot", { key: '8938f125f7597b13a64256400733de4cc5e1e7c4' })))));
|
|
69655
70322
|
}
|
|
69656
70323
|
static get watchers() { return {
|
|
69657
70324
|
"selectedItemId": [{
|
|
@@ -69661,7 +70328,7 @@ const KritzelMasterDetail = class {
|
|
|
69661
70328
|
};
|
|
69662
70329
|
KritzelMasterDetail.style = kritzelMasterDetailCss();
|
|
69663
70330
|
|
|
69664
|
-
const kritzelMenuCss = () => `:host{position:relative;display:flex;flex-direction:column;background-color:var(--kritzel-menu-background-color, #ffffff);width:var(--kritzel-menu-width, 200px);padding:var(--kritzel-menu-padding, 8px);border-radius:var(--kritzel-menu-border-radius, 12px);box-shadow:var(--kritzel-menu-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));border:var(--kritzel-menu-border, 1px solid #ebebeb);z-index:2;gap:var(--kritzel-menu-gap, 4px);overflow-y:auto;scrollbar-color:var(--kritzel-global-scrollbar-thumb-color, #ebebeb) transparent;scrollbar-width:thin;max-height:var(--kritzel-portal-max-height, 300px);box-sizing:border-box;-webkit-tap-highlight-color:transparent;outline:none;clip-path:inset(0 round var(--kritzel-menu-border-radius, 12px))}:host:focus-visible{outline:auto}.has-open-child-overlay{position:absolute;top:0;left:0;right:0;bottom:0;z-index:3}`;
|
|
70331
|
+
const kritzelMenuCss = () => `:host{position:relative;display:flex;flex-direction:column;font-family:var(--kritzel-menu-font-family, var(--kritzel-global-font-family, sans-serif));background-color:var(--kritzel-menu-background-color, #ffffff);width:var(--kritzel-menu-width, 200px);padding:var(--kritzel-menu-padding, 8px);border-radius:var(--kritzel-menu-border-radius, 12px);box-shadow:var(--kritzel-menu-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));border:var(--kritzel-menu-border, 1px solid #ebebeb);z-index:2;gap:var(--kritzel-menu-gap, 4px);overflow-y:auto;scrollbar-color:var(--kritzel-global-scrollbar-thumb-color, #ebebeb) transparent;scrollbar-width:thin;max-height:var(--kritzel-portal-max-height, 300px);box-sizing:border-box;-webkit-tap-highlight-color:transparent;outline:none;clip-path:inset(0 round var(--kritzel-menu-border-radius, 12px))}:host:focus-visible{outline:auto}.has-open-child-overlay{position:absolute;top:0;left:0;right:0;bottom:0;z-index:3}`;
|
|
69665
70332
|
|
|
69666
70333
|
const KritzelMenu = class {
|
|
69667
70334
|
constructor(hostRef) {
|
|
@@ -69724,12 +70391,12 @@ const KritzelMenu = class {
|
|
|
69724
70391
|
this.itemCloseChildMenu.emit(event.detail);
|
|
69725
70392
|
};
|
|
69726
70393
|
render() {
|
|
69727
|
-
return (h(Host, { key: '
|
|
70394
|
+
return (h(Host, { key: 'fc7816cfb7a4f88f95f5abe4c9dcbccd920ad6e7', tabIndex: 0, onClick: e => e.stopPropagation() }, this.openChildMenuItem && h("div", { key: 'fb36bc0122d79b4929356280fe5213dd00535eae', 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 })))));
|
|
69728
70395
|
}
|
|
69729
70396
|
};
|
|
69730
70397
|
KritzelMenu.style = kritzelMenuCss();
|
|
69731
70398
|
|
|
69732
|
-
const kritzelMenuItemCss = () => `:host{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--kritzel-menu-item-padding, 8px);box-sizing:border-box;gap:16px;height:var(--kritzel-menu-item-height, 40px);min-height:var(--kritzel-menu-item-min-height, 40px);font-family:sans-serif;font-size:var(--kritzel-menu-item-font-size, 14px);color:var(--kritzel-menu-item-color, #333333);border-radius:var(--kritzel-menu-item-border-radius, 12px);-webkit-tap-highlight-color:transparent}:host:focus:not(:focus-visible){outline:none}:host(:hover) .menu-item-overlay,:host(:focus-within) .menu-item-overlay{background-color:var(--kritzel-menu-item-overlay-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.selected){background-color:var(--kritzel-menu-item-selected-background-color, #007aff);color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected) .action-button{color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected.editing){background-color:var(--kritzel-menu-item-selected-background-color, #007aff)}:host(.selected) .edit-input{color:var(--kritzel-menu-item-selected-color, #ffffff);caret-color:var(--kritzel-menu-item-input-caret-color-on-selected, #ffffff);border-color:var(--kritzel-menu-item-input-border-color-on-selected, #ffffff)}:host(.selected) .action-button kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-selected-color, #ffffff)}kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-color, #333333)}:host(.selected) kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected) .edit-input::selection{background-color:var(--kritzel-menu-item-input-selection-color-on-selected, rgba(255, 255, 255, 0.3));color:var(--kritzel-menu-item-input-selection-text-color-on-selected, #ffffff)}:host(.editing){background-color:var(--kritzel-menu-item-editing-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.disabled){opacity:0.5;pointer-events:none !important}:host(.child-open){background-color:var(--kritzel-menu-item-child-open-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.child-open.selected){background-color:var(--kritzel-menu-item-selected-background-color, #007aff)}.menu-item-overlay{position:absolute;inset:0;background-color:transparent;z-index:0;pointer-events:none;border-radius:var(--kritzel-menu-item-border-radius, 12px)}.menu-item-content{display:flex;align-items:center;gap:8px;position:relative;z-index:1;height:100%}.menu-item-content span{display:flex;align-items:center;line-height:0}.left{justify-content:flex-start;flex:1;min-width:0}.left>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.right{justify-content:flex-end}.edit-input{flex:1;height:var(--kritzel-menu-item-input-height, 24px);padding:0;background-color:transparent;border-radius:0;border:none;border-bottom:var(--kritzel-menu-item-input-border, 1px solid #ccc);font-size:var(--kritzel-menu-item-font-size, 14px);width:100%;min-width:0;box-sizing:border-box;outline:none;color:inherit}.edit-input{caret-color:var(--kritzel-menu-item-input-caret-color, currentColor)}.edit-input::selection{background-color:var(--kritzel-menu-item-input-selection-color, #007bff);color:var(--kritzel-menu-item-input-selection-text-color, #ffffff)}.action-button{padding:4px;border-radius:8px;border:none;cursor:var(--kritzel-global-pointer-cursor, pointer);display:flex;align-items:center;justify-content:center;background-color:transparent;background:transparent;-webkit-tap-highlight-color:transparent}.action-button:hover,.action-button:focus{background-color:var(--kritzel-menu-item-button-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.action-button.disabled{pointer-events:none;opacity:0.5}`;
|
|
70399
|
+
const kritzelMenuItemCss = () => `:host{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--kritzel-menu-item-padding, 8px);box-sizing:border-box;gap:16px;height:var(--kritzel-menu-item-height, 40px);min-height:var(--kritzel-menu-item-min-height, 40px);font-family:var(--kritzel-menu-font-family, var(--kritzel-global-font-family, sans-serif));font-size:var(--kritzel-menu-item-font-size, 14px);color:var(--kritzel-menu-item-color, #333333);border-radius:var(--kritzel-menu-item-border-radius, 12px);-webkit-tap-highlight-color:transparent}:host:focus:not(:focus-visible){outline:none}:host(:hover) .menu-item-overlay,:host(:focus-within) .menu-item-overlay{background-color:var(--kritzel-menu-item-overlay-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.selected){background-color:var(--kritzel-menu-item-selected-background-color, #007aff);color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected) .action-button{color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected.editing){background-color:var(--kritzel-menu-item-selected-background-color, #007aff)}:host(.selected) .edit-input{color:var(--kritzel-menu-item-selected-color, #ffffff);caret-color:var(--kritzel-menu-item-input-caret-color-on-selected, #ffffff);border-color:var(--kritzel-menu-item-input-border-color-on-selected, #ffffff)}:host(.selected) .action-button kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-selected-color, #ffffff)}kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-color, #333333)}:host(.selected) kritzel-icon{--kritzel-icon-color:var(--kritzel-menu-item-selected-color, #ffffff)}:host(.selected) .edit-input::selection{background-color:var(--kritzel-menu-item-input-selection-color-on-selected, rgba(255, 255, 255, 0.3));color:var(--kritzel-menu-item-input-selection-text-color-on-selected, #ffffff)}:host(.editing){background-color:var(--kritzel-menu-item-editing-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.disabled){opacity:0.5;pointer-events:none !important}:host(.child-open){background-color:var(--kritzel-menu-item-child-open-background-color, hsl(0, 0%, 0%, 4.3%))}:host(.child-open.selected){background-color:var(--kritzel-menu-item-selected-background-color, #007aff)}.menu-item-overlay{position:absolute;inset:0;background-color:transparent;z-index:0;pointer-events:none;border-radius:var(--kritzel-menu-item-border-radius, 12px)}.menu-item-content{display:flex;align-items:center;gap:8px;position:relative;z-index:1;height:100%}.menu-item-content span{display:flex;align-items:center;line-height:0}.left{justify-content:flex-start;flex:1;min-width:0}.left>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.right{justify-content:flex-end}.edit-input{flex:1;height:var(--kritzel-menu-item-input-height, 24px);padding:0;background-color:transparent;border-radius:0;border:none;border-bottom:var(--kritzel-menu-item-input-border, 1px solid #ccc);font-size:var(--kritzel-menu-item-font-size, 14px);width:100%;min-width:0;box-sizing:border-box;outline:none;color:inherit}.edit-input{caret-color:var(--kritzel-menu-item-input-caret-color, currentColor)}.edit-input::selection{background-color:var(--kritzel-menu-item-input-selection-color, #007bff);color:var(--kritzel-menu-item-input-selection-text-color, #ffffff)}.action-button{padding:4px;border-radius:8px;border:none;cursor:var(--kritzel-global-pointer-cursor, pointer);display:flex;align-items:center;justify-content:center;background-color:transparent;background:transparent;-webkit-tap-highlight-color:transparent}.action-button:hover,.action-button:focus{background-color:var(--kritzel-menu-item-button-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.action-button.disabled{pointer-events:none;opacity:0.5}`;
|
|
69733
70400
|
|
|
69734
70401
|
const KritzelMenuItem = class {
|
|
69735
70402
|
constructor(hostRef) {
|
|
@@ -69818,7 +70485,7 @@ const KritzelMenuItem = class {
|
|
|
69818
70485
|
h("div", { class: "menu-item-content left" }, this.item.icon && (h("span", { title: this.item.iconTooltip }, h("kritzel-icon", { name: this.item.icon, size: 16, style: this.item.color ? { '--kritzel-icon-color': this.item.color } : undefined }))), h("div", { style: this.item.color ? { color: this.item.color } : undefined }, this.item.label)),
|
|
69819
70486
|
h("div", { class: "menu-item-content right" }, this.item.children &&
|
|
69820
70487
|
this.item.children.length > 0 && [
|
|
69821
|
-
h("button", { id: "child-menu-toggle", class: "action-button", onClick: this.handleMenuToggle, disabled: this.item.isDisabled }, h("kritzel-icon", { name: "
|
|
70488
|
+
h("button", { id: "child-menu-toggle", class: "action-button", onClick: this.handleMenuToggle, disabled: this.item.isDisabled }, h("kritzel-icon", { name: "ellipsisVertical", size: 16 })),
|
|
69822
70489
|
h("kritzel-portal", { anchor: this.item.childMenuAnchor, offsetY: 4, onClose: this.handleMenuClose }, h(childMenuTag, {
|
|
69823
70490
|
items: this.item.children,
|
|
69824
70491
|
parent: this.item,
|
|
@@ -69837,12 +70504,12 @@ const KritzelMenuItem = class {
|
|
|
69837
70504
|
];
|
|
69838
70505
|
}
|
|
69839
70506
|
render() {
|
|
69840
|
-
return (h(Host, { key: '
|
|
70507
|
+
return (h(Host, { key: '90064541474da10a040c49ba72be132a8317dbba', tabIndex: this.item.isDisabled ? -1 : 0, class: {
|
|
69841
70508
|
'selected': this.item.isSelected,
|
|
69842
70509
|
'editing': this.item.isEditing,
|
|
69843
70510
|
'disabled': this.item.isDisabled,
|
|
69844
70511
|
'child-open': this.item.isChildMenuOpen,
|
|
69845
|
-
}, onClick: this.handleItemSelect }, h("div", { key: '
|
|
70512
|
+
}, onClick: this.handleItemSelect }, h("div", { key: '73be9249dced01dcc40e06b045329f9f642f0cb9', class: "menu-item-overlay" }), this.item.isEditing ? this.renderEditMode() : this.renderViewMode()));
|
|
69846
70513
|
}
|
|
69847
70514
|
static get watchers() { return {
|
|
69848
70515
|
"item": [{
|
|
@@ -69873,7 +70540,7 @@ const KritzelMoreMenu = class {
|
|
|
69873
70540
|
/**
|
|
69874
70541
|
* The icon to display on the button
|
|
69875
70542
|
*/
|
|
69876
|
-
icon = '
|
|
70543
|
+
icon = 'ellipsisVertical';
|
|
69877
70544
|
/**
|
|
69878
70545
|
* The size of the icon
|
|
69879
70546
|
*/
|
|
@@ -70003,7 +70670,7 @@ const KritzelMoreMenu = class {
|
|
|
70003
70670
|
this.closeMenu();
|
|
70004
70671
|
};
|
|
70005
70672
|
render() {
|
|
70006
|
-
return (h(Host, { key: '
|
|
70673
|
+
return (h(Host, { key: '4474c94b4a72aa5692493de26f4379fa9602c0d4', class: { mobile: this.isTouchDevice }, style: { display: this.visible ? '' : 'none' } }, h("div", { key: 'd85da74f28b106b0b3634185825ed54ca6083879', class: { 'more-menu-wrapper': true, visible: this.visible } }, h("button", { key: '3d060d5bf5da7cadb06a0ed35b967147a9bc53ad', class: "more-menu-button", "data-testid": "more-menu-button", onClick: this.toggleMenu, "aria-label": this.terms['moreMenu.ariaLabel'] ?? 'More options' }, h("kritzel-icon", { key: '85bceb5f0eeacfed5e6b6c0f9043d845fd7ed03b', name: this.icon, size: this.iconSize })), h("kritzel-portal", { key: '7b42098250c1a50032a48d17743d32169f8870ca', anchor: this.menuAnchor, offsetY: this.offsetY, onClose: this.closeMenu }, h("kritzel-menu", { key: '764efaaa19161b8ee4bd3d4b606b6c1029ad7d2e', items: this.resolveMenuLabels(this.visibleItems), onItemSelect: this.handleMenuItemSelect })))));
|
|
70007
70674
|
}
|
|
70008
70675
|
static get watchers() { return {
|
|
70009
70676
|
"items": [{
|
|
@@ -70013,7 +70680,7 @@ const KritzelMoreMenu = class {
|
|
|
70013
70680
|
};
|
|
70014
70681
|
KritzelMoreMenu.style = kritzelMoreMenuCss();
|
|
70015
70682
|
|
|
70016
|
-
const kritzelNotificationCardCss = () => `:host{display:block}.card{box-sizing:border-box;width:100%;max-width:var(--kritzel-notification-card-max-width, 360px);margin-inline:auto;font-family:var(--kritzel-font-family, sans-serif);padding:var(--kritzel-notification-card-padding, 12px 14px);border:var(--kritzel-notification-card-border, 1px solid #e5e7eb);border-radius:var(--kritzel-notification-card-border-radius, 12px);background-color:var(--kritzel-notification-card-background-color, #ffffff);color:var(--kritzel-notification-card-color, #111827);box-shadow:var(--kritzel-notification-card-box-shadow, 0 8px 20px rgba(15, 23, 42, 0.08))}.card-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kritzel-notification-card-header-gap, 8px);margin-bottom:var(--kritzel-notification-card-header-margin-bottom, 8px)}.header-right{display:inline-flex;align-items:center;gap:var(--kritzel-notification-card-header-right-gap, 6px)}.type-pill{display:inline-flex;align-items:center;justify-content:center;min-height:var(--kritzel-notification-card-pill-height, 22px);padding:var(--kritzel-notification-card-pill-padding, 0 8px);border-radius:var(--kritzel-notification-card-pill-border-radius, 999px);background-color:var(--kritzel-notification-card-pill-background-color, #eff6ff);color:var(--kritzel-notification-card-pill-color, #1d4ed8);font-size:var(--kritzel-notification-card-pill-font-size, 12px);font-weight:var(--kritzel-notification-card-pill-font-weight, 600);line-height:1}.card.type-info .type-pill{background-color:var(--kritzel-notification-card-info-pill-background-color, #eff6ff);color:var(--kritzel-notification-card-info-pill-color, #1d4ed8)}.card.type-warning .type-pill{background-color:var(--kritzel-notification-card-warning-pill-background-color, #fff7ed);color:var(--kritzel-notification-card-warning-pill-color, #b45309)}.card.type-error .type-pill{background-color:var(--kritzel-notification-card-error-pill-background-color, #fef2f2);color:var(--kritzel-notification-card-error-pill-color, #b91c1c)}.timestamp{color:var(--kritzel-notification-card-timestamp-color, #6b7280);font-size:var(--kritzel-notification-card-timestamp-font-size, 12px);white-space:nowrap}.dismiss-button{display:inline-flex;align-items:center;justify-content:center;width:var(--kritzel-notification-card-dismiss-button-size, 24px);height:var(--kritzel-notification-card-dismiss-button-size, 24px);padding:0;border:none;border-radius:var(--kritzel-notification-card-dismiss-button-border-radius, 6px);background:var(--kritzel-notification-card-dismiss-button-background-color, transparent);color:var(--kritzel-notification-card-dismiss-button-color, #4b5563);cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent}.dismiss-button:hover{background:var(--kritzel-notification-card-dismiss-button-hover-background-color, #f3f4f6)}.dismiss-button:active{background:var(--kritzel-notification-card-dismiss-button-active-background-color, #e5e7eb)}.dismiss-button:focus-visible{outline:revert}.message{margin:0;color:var(--kritzel-notification-card-message-color, inherit);font-size:var(--kritzel-notification-card-message-font-size, 14px);line-height:var(--kritzel-notification-card-message-line-height, 1.45);word-break:break-word}`;
|
|
70683
|
+
const kritzelNotificationCardCss = () => `:host{display:block}.card{box-sizing:border-box;width:100%;max-width:var(--kritzel-notification-card-max-width, 360px);margin-inline:auto;font-family:var(--kritzel-global-font-family, sans-serif);padding:var(--kritzel-notification-card-padding, 12px 14px);border:var(--kritzel-notification-card-border, 1px solid #e5e7eb);border-radius:var(--kritzel-notification-card-border-radius, 12px);background-color:var(--kritzel-notification-card-background-color, #ffffff);color:var(--kritzel-notification-card-color, #111827);box-shadow:var(--kritzel-notification-card-box-shadow, 0 8px 20px rgba(15, 23, 42, 0.08))}.card-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kritzel-notification-card-header-gap, 8px);margin-bottom:var(--kritzel-notification-card-header-margin-bottom, 8px)}.header-right{display:inline-flex;align-items:center;gap:var(--kritzel-notification-card-header-right-gap, 6px)}.type-pill{display:inline-flex;align-items:center;justify-content:center;min-height:var(--kritzel-notification-card-pill-height, 22px);padding:var(--kritzel-notification-card-pill-padding, 0 8px);border-radius:var(--kritzel-notification-card-pill-border-radius, 999px);background-color:var(--kritzel-notification-card-pill-background-color, #eff6ff);color:var(--kritzel-notification-card-pill-color, #1d4ed8);font-size:var(--kritzel-notification-card-pill-font-size, 12px);font-weight:var(--kritzel-notification-card-pill-font-weight, 600);line-height:1}.card.type-info .type-pill{background-color:var(--kritzel-notification-card-info-pill-background-color, #eff6ff);color:var(--kritzel-notification-card-info-pill-color, #1d4ed8)}.card.type-warning .type-pill{background-color:var(--kritzel-notification-card-warning-pill-background-color, #fff7ed);color:var(--kritzel-notification-card-warning-pill-color, #b45309)}.card.type-error .type-pill{background-color:var(--kritzel-notification-card-error-pill-background-color, #fef2f2);color:var(--kritzel-notification-card-error-pill-color, #b91c1c)}.timestamp{color:var(--kritzel-notification-card-timestamp-color, #6b7280);font-size:var(--kritzel-notification-card-timestamp-font-size, 12px);white-space:nowrap}.dismiss-button{display:inline-flex;align-items:center;justify-content:center;width:var(--kritzel-notification-card-dismiss-button-size, 24px);height:var(--kritzel-notification-card-dismiss-button-size, 24px);padding:0;border:none;border-radius:var(--kritzel-notification-card-dismiss-button-border-radius, 6px);background:var(--kritzel-notification-card-dismiss-button-background-color, transparent);color:var(--kritzel-notification-card-dismiss-button-color, #4b5563);cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent}.dismiss-button:hover{background:var(--kritzel-notification-card-dismiss-button-hover-background-color, #f3f4f6)}.dismiss-button:active{background:var(--kritzel-notification-card-dismiss-button-active-background-color, #e5e7eb)}.dismiss-button:focus-visible{outline:revert}.message{margin:0;color:var(--kritzel-notification-card-message-color, inherit);font-size:var(--kritzel-notification-card-message-font-size, 14px);line-height:var(--kritzel-notification-card-message-line-height, 1.45);word-break:break-word}`;
|
|
70017
70684
|
|
|
70018
70685
|
const KritzelNotificationCard = class {
|
|
70019
70686
|
constructor(hostRef) {
|
|
@@ -70175,7 +70842,7 @@ const KritzelNumericInput = class {
|
|
|
70175
70842
|
this.valueChange.emit(newValue);
|
|
70176
70843
|
};
|
|
70177
70844
|
render() {
|
|
70178
|
-
return (h(Host, { key: '
|
|
70845
|
+
return (h(Host, { key: '4492b328055747be0df872965fe8f8a644c1b99f' }, h("div", { key: '8e35306939f4da96af77658c02ae3c4f2f9bd9c3', class: "input-container" }, this.label && h("label", { key: '00eef99018632f20e98f372b29ee23efd6855196', class: "input-label" }, this.label), h("div", { key: '41bed7ac6642a3cd52e5be1d95d1243d48e1249b', class: "input-wrapper" }, h("input", { key: 'fcb996947286814e01e15f01df89ff161926c8f3', 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: '0ff1a0d8306cf45d594413332c2977202ad402d3', class: "spinner-buttons" }, h("button", { key: '1f5b278dff3052fd03e65aa6758c289200574eae', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, h("svg", { key: '1722b868967111631dbf2442d33d2c9736b68c0c', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: '75655b2843c384ab448c5447fc3d3546c6f360d9', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: 'b81a65fefb49157a76f9dd5dc0ad785e167a61fe', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, h("svg", { key: 'dc1cc93cb3bb8593a50682a49018bd4ca27b3a30', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'db9138181002c73da50fb3ab369a36912a7874f5', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
70179
70846
|
}
|
|
70180
70847
|
static get watchers() { return {
|
|
70181
70848
|
"value": [{
|
|
@@ -70185,7 +70852,7 @@ const KritzelNumericInput = class {
|
|
|
70185
70852
|
};
|
|
70186
70853
|
KritzelNumericInput.style = kritzelNumericInputCss();
|
|
70187
70854
|
|
|
70188
|
-
const kritzelOpacitySliderCss = () => `:host{display:flex;flex-direction:column;padding:0;box-sizing:border-box}.opacity-container{display:flex;align-items:center;width:232px}.slider-wrapper{flex:1;display:flex;align-items:center}.opacity-slider{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:3px;background:linear-gradient(
|
|
70855
|
+
const kritzelOpacitySliderCss = () => `:host{display:flex;flex-direction:column;padding:0;box-sizing:border-box}.opacity-container{display:flex;align-items:center;width:232px}.slider-wrapper{flex:1;display:flex;align-items:center}.opacity-slider{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:3px;background:linear-gradient( to right, var(--kritzel-opacity-slider-active-color, #007AFF) 0%, var(--kritzel-opacity-slider-active-color, #007AFF) var(--slider-progress, 100%), var(--kritzel-opacity-slider-track-color, #e0e0e0) var(--slider-progress, 100%), var(--kritzel-opacity-slider-track-color, #e0e0e0) 100% );outline:none;cursor:var(--kritzel-global-pointer-cursor, pointer)}.opacity-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--kritzel-opacity-slider-thumb-color, #ffffff);border:2px solid var(--kritzel-opacity-slider-thumb-border-color, #007AFF);cursor:var(--kritzel-global-pointer-cursor, pointer);box-shadow:0 1px 3px rgba(0, 0, 0, 0.2);transition:transform 0.1s ease}.opacity-slider::-webkit-slider-thumb:hover{transform:scale(1.1)}.opacity-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--kritzel-opacity-slider-thumb-color, #ffffff);border:2px solid var(--kritzel-opacity-slider-thumb-border-color, #007AFF);cursor:var(--kritzel-global-pointer-cursor, pointer);box-shadow:0 1px 3px rgba(0, 0, 0, 0.2);transition:transform 0.1s ease}.opacity-slider::-moz-range-thumb:hover{transform:scale(1.1)}.opacity-slider::-moz-range-track{height:6px;border-radius:3px;background:transparent}.opacity-slider:focus{outline:none}.opacity-slider:focus::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}.opacity-slider:focus::-moz-range-thumb{box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}`;
|
|
70189
70856
|
|
|
70190
70857
|
const KritzelOpacitySlider = class {
|
|
70191
70858
|
constructor(hostRef) {
|
|
@@ -70214,7 +70881,7 @@ const KritzelOpacitySlider = class {
|
|
|
70214
70881
|
}
|
|
70215
70882
|
render() {
|
|
70216
70883
|
const percentage = this.getPercentage();
|
|
70217
|
-
return (h(Host, { key: '
|
|
70884
|
+
return (h(Host, { key: 'bb0e9f56f5ede377700710940c29cc05c767549a' }, h("div", { key: 'aea9ee85b87ff8a91b4119f5ff008dd6d838c05b', class: "opacity-container" }, h("div", { key: '45e6e8b7f6ec871935143ef45996114ead9d9018', class: "slider-wrapper" }, h("input", { key: '7e3d4877bf04110784c20d2b4633b7c489d54a82', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
70218
70885
|
'--slider-progress': `${percentage}%`,
|
|
70219
70886
|
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
70220
70887
|
} })))));
|
|
@@ -70279,7 +70946,7 @@ const KritzelPillTabs = class {
|
|
|
70279
70946
|
buttons?.[newIndex]?.focus();
|
|
70280
70947
|
}
|
|
70281
70948
|
render() {
|
|
70282
|
-
return (h(Host, { key: '
|
|
70949
|
+
return (h(Host, { key: 'f02f93ada5ec002695b62f511c847de201a8cbe4' }, h("div", { key: 'bb08ae773f1b993cb330556a5778d71fc5e91ce1', class: "pill-tabs-container", role: "tablist" }, this.tabs.map((tab, index) => (h("button", { key: tab.id, class: {
|
|
70283
70950
|
'pill-tab': true,
|
|
70284
70951
|
'selected': this.value === tab.id,
|
|
70285
70952
|
}, role: "tab", "aria-selected": this.value === tab.id ? 'true' : 'false', tabIndex: this.value === tab.id ? 0 : -1, onClick: () => this.handleTabClick(tab.id), onKeyDown: (e) => this.handleKeyDown(e, index) }, tab.icon && h("kritzel-icon", { name: tab.icon, size: 16 }), h("span", { class: "pill-tab-label" }, tab.label)))))));
|
|
@@ -70567,7 +71234,7 @@ const KritzelPortal = class {
|
|
|
70567
71234
|
this.portal.style.visibility = 'visible';
|
|
70568
71235
|
}
|
|
70569
71236
|
render() {
|
|
70570
|
-
return (h(Host, { key: '
|
|
71237
|
+
return (h(Host, { key: 'e37e3fb0de2910fabd9379f372e477ecac929d1d', style: { display: this.anchor ? 'block' : 'none' } }, h("slot", { key: '86f8720d298201b66efea2475634ec7506b33d9c' })));
|
|
70571
71238
|
}
|
|
70572
71239
|
static get watchers() { return {
|
|
70573
71240
|
"anchor": [{
|
|
@@ -70789,7 +71456,7 @@ const KritzelSettings = class {
|
|
|
70789
71456
|
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$1), h("p", { class: "version-info" }, "Workspace Schema v", CURRENT_WORKSPACE_SCHEMA_VERSION$1)))));
|
|
70790
71457
|
}
|
|
70791
71458
|
render() {
|
|
70792
|
-
return (h(Host, { key: '
|
|
71459
|
+
return (h(Host, { key: 'a3b62913565f4823bd379da67d81545c58c49d20' }, h("kritzel-dialog", { key: 'e688b2d81f985905f65b756becb336b7d14ca8f5', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: '1f6db30412514bee5b087d8365eca91d76002ef8', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
|
|
70793
71460
|
}
|
|
70794
71461
|
static get watchers() { return {
|
|
70795
71462
|
"settings": [{
|
|
@@ -70822,10 +71489,10 @@ const KritzelShapeFill = class {
|
|
|
70822
71489
|
return (h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: strokeColor, stroke: strokeColor, "stroke-width": "2" })));
|
|
70823
71490
|
}
|
|
70824
71491
|
render() {
|
|
70825
|
-
return (h(Host, { key: '
|
|
71492
|
+
return (h(Host, { key: '6d38a9af2e4c4c7f86ab994c63fc074007c86b48' }, h("div", { key: 'cf58f26cb0e56e274873d11024209c6908d317bb', class: "fill-row" }, h("button", { key: 'c75eed70fe0c2fcbf0fd136bb6fce75b2dbfb45d', class: {
|
|
70826
71493
|
'fill-option': true,
|
|
70827
71494
|
'selected': this.value === 'transparent',
|
|
70828
|
-
}, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), h("button", { key: '
|
|
71495
|
+
}, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), h("button", { key: '5d6ede439b5d5e55598cd8c20b5851fb9f210463', class: {
|
|
70829
71496
|
'fill-option': true,
|
|
70830
71497
|
'selected': this.value === 'filled',
|
|
70831
71498
|
}, onClick: () => this.handleFillChange('filled'), title: "Filled background" }, this.renderFillIcon('filled')))));
|
|
@@ -74029,9 +74696,9 @@ const KritzelShareDialog = class {
|
|
|
74029
74696
|
this.dialogClosed.emit();
|
|
74030
74697
|
};
|
|
74031
74698
|
render() {
|
|
74032
|
-
return (h(Host, { key: '
|
|
74699
|
+
return (h(Host, { key: 'b7a8be6921198400c95003928dfed03acd3866b6' }, h("kritzel-dialog", { key: '742e50d49ee54ba135279d6d34c78fa05645744e', dialogTitle: this.terms['share.dialogTitle'] ?? 'Share Workspace', size: "small", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, contained: true }, h("div", { key: 'e16420d7eea180e42c5491f8314ba0106b1b572a', class: "share-content" }, h("div", { key: '0cc6522bcb123d722e29420ba8462af21e933fb7', class: "share-section" }, h("div", { key: 'da9c8954fca7b9c6a73776a702e917d517229cc8', class: "share-row" }, h("div", { key: '40760b33ca59a51d746ed76673219a26126ae60c', class: "share-label-group" }, h("label", { key: 'de6b6409a3c487560e3491e1f3c87cb66c34fa61', class: "share-label" }, this.terms['share.linkSharing.label'] ?? 'Link sharing'), h("p", { key: '6c0db50f81c1de442eb87322e5d562868819adac', class: "share-description" }, this.internalIsPublic
|
|
74033
74700
|
? (this.terms['share.linkSharing.enabledDescription'] ?? 'Anyone with the link can access this workspace.')
|
|
74034
|
-
: (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: '
|
|
74701
|
+
: (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: '57492b1e6576c2b842809ac8b29c67ad4bcb66f1', checked: this.internalIsPublic, onCheckedChange: this.handleToggleChange, label: this.terms['share.linkSharing.toggleLabel'] ?? 'Enable link sharing' }))), this.internalIsPublic && (h("div", { key: '9a6be392c660e13c6add3b671509f169a4ccb52e', class: "share-section" }, h("div", { key: '8ff6565cca2cf53ea7568ef4d2a1a0705daa8fa3', class: "share-url-container" }, h("input", { key: '3f8dffdf23a5b6f0744b63b5ceb9c488904b6c11', type: "text", class: "share-url-input", value: this.getShareUrl(), readOnly: true, onClick: (e) => e.target.select() }), h("button", { key: 'c6a629ef64ddfe2f7fa15dbbcaf344573e8085b9', 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: 'b748074ec82f1d97d0b0ea03366ee0353900512c', name: this.copySuccess ? 'check' : 'copy', size: 18 }))), this.qrCodeDataUrl && (h("div", { key: '444f8d53ea5ba95b35bd0882e0e91dba2edfdbc6', class: "share-qr-container" }, h("img", { key: 'a11e1dc20306392266794f765bb709f05f17d4a0', class: "share-qr-image", src: this.qrCodeDataUrl, alt: "QR code for share link" })))))))));
|
|
74035
74702
|
}
|
|
74036
74703
|
static get watchers() { return {
|
|
74037
74704
|
"isPublic": [{
|
|
@@ -74072,7 +74739,7 @@ const KritzelSlideToggle = class {
|
|
|
74072
74739
|
}
|
|
74073
74740
|
};
|
|
74074
74741
|
render() {
|
|
74075
|
-
return (h(Host, { key: '
|
|
74742
|
+
return (h(Host, { key: '21474507cafab44ac713e7732d2bb3b1323951e1', 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: '9d973f03b674ae90c0f3dc78680feffb5e74e2f0', class: "toggle-track" }, h("div", { key: '3988d20da458ace01a0bb1af196d28c8fd290042', class: "toggle-thumb" }))));
|
|
74076
74743
|
}
|
|
74077
74744
|
};
|
|
74078
74745
|
KritzelSlideToggle.style = kritzelSlideToggleCss();
|
|
@@ -74093,7 +74760,7 @@ const KritzelSplitButton = class {
|
|
|
74093
74760
|
}
|
|
74094
74761
|
get host() { return getElement(this); }
|
|
74095
74762
|
buttonIcon = 'plus';
|
|
74096
|
-
dropdownIcon = '
|
|
74763
|
+
dropdownIcon = 'chevronDown';
|
|
74097
74764
|
items = [];
|
|
74098
74765
|
mainButtonDisabled = false;
|
|
74099
74766
|
menuButtonDisabled = false;
|
|
@@ -74175,7 +74842,7 @@ const KritzelSplitButton = class {
|
|
|
74175
74842
|
this.menuScrollTop = event.target.scrollTop;
|
|
74176
74843
|
};
|
|
74177
74844
|
render() {
|
|
74178
|
-
return (h(Host, { key: '
|
|
74845
|
+
return (h(Host, { key: 'fd367561351219e18883cf7bf72a1fd488b1d3e9', class: { mobile: this.isTouchDevice } }, h("button", { key: 'f9edff7ca0c77f2502947a98ab4bb64ed68d6437', class: "split-main-button", tabIndex: 0, onClick: this.handleButtonClick, disabled: this.mainButtonDisabled, "aria-label": "Main action" }, this.buttonIcon && h("kritzel-icon", { key: '31f8dc17a94d015d5881ca2475b4933a6183cafa', name: this.buttonIcon })), h("div", { key: '3620329f4b911cee3f4cbae4498c28c20e19f953', class: "split-divider" }), h("button", { key: 'cda9b17a019df40107f01d9bb644e5545218e891', 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: '03f04eb20ef66cc6ea8ed4104f26dc062afba680', name: this.dropdownIcon })), h("kritzel-portal", { key: 'e02bc799b56ad731db06719ae77b65b872e0a368', anchor: this.anchorElement, offsetY: 4, onClose: this.closeMenu }, h("kritzel-menu", { key: '694b82e1c05411ea119fdb07aec0b747c6e3d6f4', 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 }))));
|
|
74179
74846
|
}
|
|
74180
74847
|
};
|
|
74181
74848
|
KritzelSplitButton.style = kritzelSplitButtonCss();
|
|
@@ -74196,7 +74863,7 @@ const KritzelStrokeSize = class {
|
|
|
74196
74863
|
}
|
|
74197
74864
|
render() {
|
|
74198
74865
|
const sizes = this.sizes ?? [];
|
|
74199
|
-
return (h(Host, { key: '
|
|
74866
|
+
return (h(Host, { key: 'dcb655ac6ec2eea1ee38b9d267dd11c6d1f21f4a' }, h("div", { key: '50c3ecaddb26cebb943c24685386401b5fdac54c', class: "size-grid" }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
74200
74867
|
'size-container': true,
|
|
74201
74868
|
'selected': this.selectedSize === size,
|
|
74202
74869
|
}, onClick: () => this.handleSizeClick(size) }, h("kritzel-color", { value: 'var(--kritzel-global-text-primary)', size: size })))))));
|
|
@@ -74461,7 +75128,7 @@ const KritzelToolConfig = class {
|
|
|
74461
75128
|
])), shouldShowExpandButton && (h("div", { style: {
|
|
74462
75129
|
display: 'flex',
|
|
74463
75130
|
alignItems: 'flex-start',
|
|
74464
|
-
} }, h("button", { class: "expand-toggle", onClick: this.handleToggleExpand, title: this.isExpanded ? (this.terms['toolConfig.collapse'] ?? 'Collapse') : (this.terms['toolConfig.expand'] ?? 'Expand') }, h("kritzel-icon", { name: this.isExpanded ? '
|
|
75131
|
+
} }, h("button", { class: "expand-toggle", onClick: this.handleToggleExpand, title: this.isExpanded ? (this.terms['toolConfig.collapse'] ?? 'Collapse') : (this.terms['toolConfig.expand'] ?? 'Expand') }, h("kritzel-icon", { name: this.isExpanded ? 'chevronUp' : 'chevronDown' })))))));
|
|
74465
75132
|
}
|
|
74466
75133
|
static get watchers() { return {
|
|
74467
75134
|
"tool": [{
|
|
@@ -74635,17 +75302,13 @@ const KritzelToolbar = class {
|
|
|
74635
75302
|
await this.resolveDisabledStates(newToolbar);
|
|
74636
75303
|
for (const c of newToolbar) {
|
|
74637
75304
|
if (c.type === 'tool' && c.tool) {
|
|
74638
|
-
|
|
74639
|
-
if (typeof toolConstructor !== 'function') {
|
|
74640
|
-
toolConstructor = toolConstructor.constructor;
|
|
74641
|
-
}
|
|
74642
|
-
const registered = await this.kritzelEngine.registerTool(c.name, toolConstructor, c.config);
|
|
75305
|
+
const registered = await this.kritzelEngine.getTool(c.name);
|
|
74643
75306
|
if (registered) {
|
|
74644
75307
|
c.tool = registered;
|
|
74645
75308
|
}
|
|
74646
75309
|
}
|
|
74647
75310
|
if (c.type === 'tool' && c.isDefault && !this.isControlDisabled(c) && c.tool) {
|
|
74648
|
-
await this.kritzelEngine.
|
|
75311
|
+
await this.kritzelEngine.setActiveTool(c.name);
|
|
74649
75312
|
this.activeControl = c;
|
|
74650
75313
|
this.updateDisplayValues(c.tool);
|
|
74651
75314
|
hasDefault = true;
|
|
@@ -74664,7 +75327,7 @@ const KritzelToolbar = class {
|
|
|
74664
75327
|
if (!hasDefault) {
|
|
74665
75328
|
const firstTool = this.internalToolbar.find(c => c.type === 'tool' && c.tool && !this.isControlDisabled(c));
|
|
74666
75329
|
if (firstTool) {
|
|
74667
|
-
await this.kritzelEngine.
|
|
75330
|
+
await this.kritzelEngine.setActiveTool(firstTool.name);
|
|
74668
75331
|
this.activeControl = firstTool;
|
|
74669
75332
|
this.updateDisplayValues(firstTool.tool);
|
|
74670
75333
|
}
|
|
@@ -74700,12 +75363,12 @@ const KritzelToolbar = class {
|
|
|
74700
75363
|
this.activeControl = control;
|
|
74701
75364
|
if (this.activeControl.type === 'tool') {
|
|
74702
75365
|
this.updateDisplayValues(this.activeControl.tool);
|
|
74703
|
-
await this.kritzelEngine.
|
|
75366
|
+
await this.kritzelEngine.setActiveTool(this.activeControl.name);
|
|
74704
75367
|
}
|
|
74705
75368
|
}
|
|
74706
75369
|
async handleToolChange(event) {
|
|
74707
75370
|
this.activeControl = { ...this.activeControl, tool: event.detail };
|
|
74708
|
-
await this.kritzelEngine.
|
|
75371
|
+
await this.kritzelEngine.setActiveTool(this.activeControl.name);
|
|
74709
75372
|
}
|
|
74710
75373
|
/**
|
|
74711
75374
|
* Get the currently selected sub-option for a control.
|
|
@@ -74744,13 +75407,13 @@ const KritzelToolbar = class {
|
|
|
74744
75407
|
// Separate tool controls from config control
|
|
74745
75408
|
const toolControls = this.internalToolbar.filter(c => c.type === 'tool' || c.type === 'separator');
|
|
74746
75409
|
const configControl = this.internalToolbar.find(c => c.type === 'config' && c.name === this.firstConfig?.name);
|
|
74747
|
-
return (h(Host, { key: '
|
|
75410
|
+
return (h(Host, { key: 'e4f662409cdd76fafa8753a47d4c4670968a9e7a', style: { display: this.visible ? '' : 'none' }, class: {
|
|
74748
75411
|
mobile: this.isTouchDevice,
|
|
74749
|
-
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: '
|
|
75412
|
+
} }, this.isUtilityPanelVisible && (h("kritzel-utility-panel", { key: 'c3c864e0e818ccf92d4c9b43f183775fa919cf4c', style: {
|
|
74750
75413
|
position: 'absolute',
|
|
74751
75414
|
bottom: '56px',
|
|
74752
75415
|
left: '12px',
|
|
74753
|
-
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: '
|
|
75416
|
+
}, undoState: this.undoState, terms: this.terms, onUndo: () => this.kritzelEngine?.undo(), onRedo: () => this.kritzelEngine?.redo(), onDelete: () => this.kritzelEngine?.delete() })), h("div", { key: '4d59605d66ee7277af8fc56002947f943f8a5b14', class: "kritzel-toolbar" }, h("div", { key: '7c36b7ad02470bafc9efcb426f667376e28953e8', class: { 'scroll-indicator-left': true, 'visible': this.canScrollLeft } }), h("div", { key: 'd29be9bca631077fad2fe709219c8897735bc6a6', class: "kritzel-tools-scroll", ref: el => (this.toolsScrollRef = el), onScroll: this.handleToolsScroll }, toolControls.map(control => {
|
|
74754
75417
|
// Check if this control has sub-options (split-button)
|
|
74755
75418
|
if (control.subOptions?.length) {
|
|
74756
75419
|
const selectedSubOption = this.getSelectedSubOption(control);
|
|
@@ -74772,7 +75435,7 @@ const KritzelToolbar = class {
|
|
|
74772
75435
|
}, disabled: isDisabled, ref: el => {
|
|
74773
75436
|
if (el)
|
|
74774
75437
|
control._triggerRef = el;
|
|
74775
|
-
}, "aria-label": `Select ${control.name} options`, "aria-disabled": isDisabled, "data-testid": `tool-${control.name}-dropdown`, tabIndex: isActive ? 0 : -1 }, h("kritzel-icon", { name: "
|
|
75438
|
+
}, "aria-label": `Select ${control.name} options`, "aria-disabled": isDisabled, "data-testid": `tool-${control.name}-dropdown`, tabIndex: isActive ? 0 : -1 }, h("kritzel-icon", { name: "chevronDown", size: 12 })), h("kritzel-tooltip", { anchorElement: control._anchorRef, triggerElement: control._triggerRef }, h("div", { class: "kritzel-submenu-content" }, control.subOptions.map(option => (h("button", { class: {
|
|
74776
75439
|
'kritzel-submenu-item': true,
|
|
74777
75440
|
'active': option.id === selectedSubOption?.id,
|
|
74778
75441
|
}, key: option.id, "data-testid": `suboption-${option.id}`, onClick: () => this.selectSubOption(control, option) }, h("kritzel-icon", { name: option.icon, size: 20 }), h("span", null, option.label))))))));
|
|
@@ -74786,10 +75449,10 @@ const KritzelToolbar = class {
|
|
|
74786
75449
|
'selected': this.activeControl?.name === control?.name,
|
|
74787
75450
|
'disabled': this.isControlDisabled(control),
|
|
74788
75451
|
}, disabled: this.isControlDisabled(control), key: control.name, "data-testid": `tool-${control.name}`, onClick: _event => this.handleControlClick?.(control), "aria-label": control.name.charAt(0).toUpperCase() + control.name.slice(1), "aria-disabled": this.isControlDisabled(control) }, h("kritzel-icon", { name: control.icon })));
|
|
74789
|
-
})), h("div", { key: '
|
|
75452
|
+
})), h("div", { key: '8cb7ae1d0b77f6bac9c6ddf34699c2653b1cfa68', class: { 'scroll-indicator-right': true, 'visible': this.canScrollRight && !(configControl && this.activeControl && hasConfigUI) } }), configControl && this.activeControl && (h("div", { class: {
|
|
74790
75453
|
'kritzel-config-container': true,
|
|
74791
75454
|
'visible': hasConfigUI,
|
|
74792
|
-
}, key: configControl.name }, h("div", { key: '
|
|
75455
|
+
}, key: configControl.name }, h("div", { key: '764230be2ef0ca45f94ca2a7bf6e2b5df7bdf7b2', class: { 'config-gradient-left': true, 'visible': this.needsScrolling } }), h("kritzel-tooltip", { key: '7b6c2cae55b9ca6f723e2209f98d921b388e8159', anchorElement: this.host.shadowRoot?.querySelector('.kritzel-config-container'), triggerElement: this.configTriggerRef }, h("kritzel-tool-config", { key: '222a7eb3c5a0ad3589e62b43618dcf56bce01418', 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: '90455ca7c55240645445f3d92ccec54ffc1e3572', tabIndex: hasConfigUI ? 0 : -1, class: "kritzel-config", "data-testid": "tool-config", ref: el => {
|
|
74793
75456
|
if (el)
|
|
74794
75457
|
this.configTriggerRef = el;
|
|
74795
75458
|
}, onKeyDown: event => {
|
|
@@ -74798,7 +75461,7 @@ const KritzelToolbar = class {
|
|
|
74798
75461
|
}
|
|
74799
75462
|
}, style: {
|
|
74800
75463
|
cursor: 'pointer',
|
|
74801
|
-
} }, this.displayValues && (h("div", { key: '
|
|
75464
|
+
} }, this.displayValues && (h("div", { key: 'ef0c11f630b70dadf5c9b7688c0f1b93cf9cf030', class: "color-container" }, h("kritzel-color", { key: 'd14a7837fef6d3777ee92d219d22915c5f21e541', value: this.displayValues.color, theme: this.theme, size: 18, style: {
|
|
74802
75465
|
borderRadius: '50%',
|
|
74803
75466
|
border: 'none',
|
|
74804
75467
|
} })))))))));
|
|
@@ -74950,14 +75613,14 @@ const KritzelTooltip = class {
|
|
|
74950
75613
|
}
|
|
74951
75614
|
}
|
|
74952
75615
|
render() {
|
|
74953
|
-
return (h(Host, { key: '
|
|
75616
|
+
return (h(Host, { key: '9c80a8831cdc03e08b4fe19c8c0aabd036fd5a23', style: {
|
|
74954
75617
|
position: 'fixed',
|
|
74955
75618
|
zIndex: '9999',
|
|
74956
75619
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
74957
75620
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
74958
75621
|
left: `${this.positionX}px`,
|
|
74959
75622
|
bottom: `${this.positionY}px`,
|
|
74960
|
-
} }, h("div", { key: '
|
|
75623
|
+
} }, h("div", { key: '0f5907b4bf740e6242a07e00790685265ee7767b', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, h("slot", { key: 'e1074787847d96b7a725fcb04902ccc7e6827984' }))));
|
|
74961
75624
|
}
|
|
74962
75625
|
static get watchers() { return {
|
|
74963
75626
|
"triggerElement": [{
|
|
@@ -74998,12 +75661,12 @@ const KritzelUtilityPanel = class {
|
|
|
74998
75661
|
this.redo.emit();
|
|
74999
75662
|
}
|
|
75000
75663
|
render() {
|
|
75001
|
-
return (h(Host, { key: '
|
|
75664
|
+
return (h(Host, { key: '1ec661383d53b4c34308152d745a8de1cb5809e0' }, h("button", { key: '69ff640842779f8b03709040feb3dbfe2f5f0f05', 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: '49be69476a559136b1199f7d20144d0dc0aa402b', name: "undo" })), h("button", { key: 'f9a14d78e14e66f0ebfb3762a7de748097c297e1', 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: 'e559abf9a2a0471d2524f65264adbc28d8fa0449', name: "redo" })), h("div", { key: '19fe0895816459d7e9241307c9f0642c055774b6', class: "utility-separator" }), h("button", { key: '3672bbcad7e22b023dc203ee098ba1538836b0ee', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": this.terms['utility.delete'] ?? 'Delete selected items' }, h("kritzel-icon", { key: 'aadbff86ca2938e28a74c4ad1c0ac6330d20e529', name: "delete" }))));
|
|
75002
75665
|
}
|
|
75003
75666
|
};
|
|
75004
75667
|
KritzelUtilityPanel.style = kritzelUtilityPanelCss();
|
|
75005
75668
|
|
|
75006
|
-
const kritzelWatermarkCss = () => `:host{position:absolute;bottom:var(--kritzel-watermark-offset-bottom, 12px);right:var(--kritzel-watermark-offset-right, 12px);z-index:10000;pointer-events:none}.watermark-link{pointer-events:auto;display:inline-flex;align-items:center;padding:4px 8px;border-radius:var(--kritzel-watermark-border-radius, 6px);font-family:var(--kritzel-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);font-size:var(--kritzel-watermark-font-size, 11px);line-height:1;text-decoration:none;color:var(--kritzel-watermark-color, rgba(60, 60, 60, 0.75));background-color:var(--kritzel-watermark-background, rgba(255, 255, 255, 0.6));box-shadow:var(--kritzel-watermark-box-shadow, 0 1px 2px rgba(0, 0, 0, 0.12));opacity:var(--kritzel-watermark-opacity, 0.85);transition:opacity 150ms ease;user-select:none}.watermark-link:hover{opacity:1}`;
|
|
75669
|
+
const kritzelWatermarkCss = () => `:host{position:absolute;bottom:var(--kritzel-watermark-offset-bottom, 12px);right:var(--kritzel-watermark-offset-right, 12px);z-index:10000;pointer-events:none}.watermark-link{pointer-events:auto;display:inline-flex;align-items:center;padding:4px 8px;border-radius:var(--kritzel-watermark-border-radius, 6px);font-family:var(--kritzel-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);font-size:var(--kritzel-watermark-font-size, 11px);line-height:1;text-decoration:none;color:var(--kritzel-watermark-color, rgba(60, 60, 60, 0.75));background-color:var(--kritzel-watermark-background, rgba(255, 255, 255, 0.6));box-shadow:var(--kritzel-watermark-box-shadow, 0 1px 2px rgba(0, 0, 0, 0.12));opacity:var(--kritzel-watermark-opacity, 0.85);transition:opacity 150ms ease;user-select:none}.watermark-link:hover{opacity:1}`;
|
|
75007
75670
|
|
|
75008
75671
|
const KritzelWatermark = class {
|
|
75009
75672
|
constructor(hostRef) {
|
|
@@ -75019,7 +75682,7 @@ const KritzelWatermark = class {
|
|
|
75019
75682
|
label;
|
|
75020
75683
|
render() {
|
|
75021
75684
|
const label = this.label ?? this.core.localizationManager.translate('watermark.poweredBy');
|
|
75022
|
-
return (h(Host, { key: '
|
|
75685
|
+
return (h(Host, { key: '5bc76650ecd1f82f5ed283d4433b0e5fc8937cab' }, h("a", { key: 'b0828f36df618e461794772d2e8f55c0a8cb357e', class: "watermark-link", href: KRITZEL_WEBSITE_URL, target: "_blank", rel: "noopener noreferrer", part: "watermark", onPointerDown: (ev) => ev.stopPropagation(), onPointerUp: (ev) => ev.stopPropagation() }, label)));
|
|
75023
75686
|
}
|
|
75024
75687
|
};
|
|
75025
75688
|
KritzelWatermark.style = kritzelWatermarkCss();
|
|
@@ -75152,7 +75815,7 @@ const KritzelWorkspaceManager = class {
|
|
|
75152
75815
|
return {
|
|
75153
75816
|
id: ws.id,
|
|
75154
75817
|
label: ws.name,
|
|
75155
|
-
icon: ws.isPublic ? '
|
|
75818
|
+
icon: ws.isPublic ? 'usersRound' : undefined,
|
|
75156
75819
|
iconTooltip: ws.isPublic ? (this.terms['workspace.sharedTooltip'] ?? 'Shared workspace') : undefined,
|
|
75157
75820
|
value: ws,
|
|
75158
75821
|
isEditing: this.editingItemId === ws.id,
|
|
@@ -75182,7 +75845,7 @@ const KritzelWorkspaceManager = class {
|
|
|
75182
75845
|
};
|
|
75183
75846
|
KritzelWorkspaceManager.style = kritzelWorkspaceManagerCss();
|
|
75184
75847
|
|
|
75185
|
-
const kritzelZoomPanelCss = () => `:host{display:block;z-index:1}.panel{display:flex;flex-direction:row;align-items:center;gap:var(--kritzel-zoom-panel-gap, 4px);padding:var(--kritzel-zoom-panel-padding, 4px);border:var(--kritzel-zoom-panel-border, 1px solid #ebebeb);border-radius:var(--kritzel-zoom-panel-border-radius, 12px);background-color:var(--kritzel-zoom-panel-background-color, #ffffff);box-shadow:var(--kritzel-zoom-panel-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));opacity:0;pointer-events:none;transition:opacity 0.2s ease-out}.panel.visible{opacity:1;pointer-events:auto}.zoom-level{display:inline-flex;align-items:center;justify-content:center;min-width:46px;color:var(--kritzel-zoom-panel-icon-color, #000000);font-family:var(--kritzel-font-family, sans-serif);font-size:12px;font-weight:500;line-height:1;padding:0 4px;user-select:none}.zoom-button{display:flex;align-items:center;justify-content:center;width:var(--kritzel-zoom-panel-button-size, 32px);height:var(--kritzel-zoom-panel-button-size, 32px);padding:0;border:0;border-radius:var(--kritzel-zoom-panel-button-border-radius, 8px);background:transparent;background-color:transparent;color:var(--kritzel-zoom-panel-icon-color, #000000);--kritzel-icon-color:var(--kritzel-zoom-panel-icon-color, #000000);box-shadow:none;appearance:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent}.zoom-button:hover,.zoom-button:focus-visible{background-color:var(--kritzel-zoom-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.zoom-button:active{background-color:var(--kritzel-zoom-panel-button-active-background-color, hsl(0, 0%, 0%, 8.6%))}.zoom-button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}`;
|
|
75848
|
+
const kritzelZoomPanelCss = () => `:host{display:block;z-index:1}.panel{display:flex;flex-direction:row;align-items:center;gap:var(--kritzel-zoom-panel-gap, 4px);padding:var(--kritzel-zoom-panel-padding, 4px);border:var(--kritzel-zoom-panel-border, 1px solid #ebebeb);border-radius:var(--kritzel-zoom-panel-border-radius, 12px);background-color:var(--kritzel-zoom-panel-background-color, #ffffff);box-shadow:var(--kritzel-zoom-panel-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));opacity:0;pointer-events:none;transition:opacity 0.2s ease-out}.panel.visible{opacity:1;pointer-events:auto}.zoom-level{display:inline-flex;align-items:center;justify-content:center;min-width:46px;color:var(--kritzel-zoom-panel-icon-color, #000000);font-family:var(--kritzel-global-font-family, sans-serif);font-size:12px;font-weight:500;line-height:1;padding:0 4px;user-select:none}.zoom-button{display:flex;align-items:center;justify-content:center;width:var(--kritzel-zoom-panel-button-size, 32px);height:var(--kritzel-zoom-panel-button-size, 32px);padding:0;border:0;border-radius:var(--kritzel-zoom-panel-button-border-radius, 8px);background:transparent;background-color:transparent;color:var(--kritzel-zoom-panel-icon-color, #000000);--kritzel-icon-color:var(--kritzel-zoom-panel-icon-color, #000000);box-shadow:none;appearance:none;cursor:var(--kritzel-global-pointer-cursor, pointer);-webkit-tap-highlight-color:transparent}.zoom-button:hover,.zoom-button:focus-visible{background-color:var(--kritzel-zoom-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%))}.zoom-button:active{background-color:var(--kritzel-zoom-panel-button-active-background-color, hsl(0, 0%, 0%, 8.6%))}.zoom-button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}`;
|
|
75186
75849
|
|
|
75187
75850
|
const KritzelZoomPanel = class {
|
|
75188
75851
|
constructor(hostRef) {
|
|
@@ -75216,7 +75879,7 @@ const KritzelZoomPanel = class {
|
|
|
75216
75879
|
return Number.isFinite(this.zoomPercent) ? Math.max(1, Math.round(this.zoomPercent)) : 100;
|
|
75217
75880
|
}
|
|
75218
75881
|
render() {
|
|
75219
|
-
return (h(Host, { key: '
|
|
75882
|
+
return (h(Host, { key: '37bdf4f4025a64be94a2f743d73d2a83c4f9c478' }, h("div", { key: '5c897da0de9a15d91c4d488be923271f82d816c1', class: { panel: true, visible: this.visible } }, h("button", { key: '165fedd5f1c87140e1cbfd7c3a99344edea59d3e', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomOut'] ?? 'Zoom out', disabled: this.disabled, onClick: this.handleZoomOut }, h("kritzel-icon", { key: '4ac3e03e68166c9e9819c5a11ab1d8aac37b6eb1', name: "minus" })), h("span", { key: 'd124c60a92cde8afe9fac87c85b3654d18238343', class: "zoom-level", "aria-live": "polite" }, this.normalizedZoomPercent, "%"), h("button", { key: 'fe94bf21c0de5fc212524058c6fb5de90a89679e', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomIn'] ?? 'Zoom in', disabled: this.disabled, onClick: this.handleZoomIn }, h("kritzel-icon", { key: '84c8ebd09772c81946e65a5759376c501f050548', name: "plus" })))));
|
|
75220
75883
|
}
|
|
75221
75884
|
};
|
|
75222
75885
|
KritzelZoomPanel.style = kritzelZoomPanelCss();
|