kritzel-stencil 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +140 -101
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-C8hqt--r.js → schema.constants-gDeS7USU.js} +75 -7
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +4 -5
- package/dist/collection/classes/handlers/line-handle.handler.js +1 -1
- package/dist/collection/classes/managers/license.manager.js +56 -0
- package/dist/collection/classes/objects/line.class.js +1 -1
- package/dist/collection/classes/objects/shape.class.js +3 -3
- package/dist/collection/classes/objects/text.class.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +31 -8
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +59 -18
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +1 -1
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +1 -1
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.css +8 -0
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +2 -15
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/constants/license.constants.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/svg-export.helper.js +19 -9
- package/dist/collection/helpers/theme.helper.js +8 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/context-menu-state.interface.js +1 -0
- package/dist/collection/themes/dark-theme.js +2 -0
- package/dist/collection/themes/light-theme.js +2 -0
- package/dist/components/index.js +3 -3
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-editor.js +67 -44
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-loading-overlay.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-sync-indicator.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-watermark.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.js +1 -1
- package/dist/components/{p-Ka7OWbnk.js → p-0H4HOJjy.js} +2 -2
- package/dist/components/{p-B5oHmPJb.js → p-7Rt7ml3v.js} +1 -1
- package/dist/components/{p-BI2ng9I_.js → p-8xkoVMfO.js} +2 -2
- package/dist/components/{p-Cymum41a.js → p-9m1cAVwG.js} +3 -3
- package/dist/components/{p-CwJwsRR3.js → p-BKOsmXB5.js} +4 -4
- package/dist/components/{p-Ca-igU1f.js → p-BLOPBDUF.js} +1 -1
- package/dist/components/{p-DUYmwrWV.js → p-BMRln59F.js} +3 -3
- package/dist/components/{p-DIazmg6w.js → p-BO9BvTtK.js} +2 -2
- package/dist/components/{p-D3y_Hauo.js → p-BU-FZuj0.js} +3 -3
- package/dist/components/{p-DgJ0ufzr.js → p-BVEGQLBD.js} +1 -1
- package/dist/components/{p-Dlp84thc.js → p-BYO6pz8T.js} +1 -1
- package/dist/components/{p-JYj3Facr.js → p-BknTMcbz.js} +16 -16
- package/dist/components/{p-CWRSGYOE.js → p-BzJEwFtn.js} +1 -1
- package/dist/components/{p-B6t5q-V4.js → p-BzrxIesp.js} +1 -1
- package/dist/components/{p-894OnDQV.js → p-CM1duewg.js} +1 -1
- package/dist/components/{p-CqLgB8JK.js → p-CMZ09rB1.js} +3 -3
- package/dist/components/{p-e6Zpc9Vp.js → p-COjsYPir.js} +2 -2
- package/dist/components/{p-BmyTdQGy.js → p-CURiiQfq.js} +12 -0
- package/dist/components/{p-BsANVili.js → p-CVhcOiEA.js} +3 -3
- package/dist/components/{p-D82VaHce.js → p-Ckm1Aq0V.js} +2 -2
- package/dist/components/{p-C38P-Vd0.js → p-Cr2z2UBL.js} +7 -7
- package/dist/components/{p-PSFAfAyd.js → p-CwuGA058.js} +1 -1
- package/dist/components/{p-Cr682JI_.js → p-D8TOEhPY.js} +3 -3
- package/dist/components/{p-BBmP8lVY.js → p-D8bHNNEm.js} +129 -49
- package/dist/components/{p-ClFprFvz.js → p-DDbO5q-e.js} +3 -3
- package/dist/components/{p-BDzlx2hB.js → p-DIMNEOTW.js} +1 -1
- package/dist/components/{p-C4NrrUfN.js → p-DSOc0eIT.js} +1 -1
- package/dist/components/{p-D5jf8wAu.js → p-DXcjIb_a.js} +3 -3
- package/dist/components/{p-Ch42cOeY.js → p-DgA865Tp.js} +8 -21
- package/dist/components/{p-B8Xi4Clg.js → p-DgnK50xO.js} +1 -1
- package/dist/components/{p-D30zs0kA.js → p-DkY7pIg5.js} +3 -3
- package/dist/components/{p-BTzlrIxe.js → p-DrQRChp3.js} +2 -2
- package/dist/components/{p-CsvMgk_f.js → p-DwY5pghH.js} +1 -1
- package/dist/components/{p-DkUb2czk.js → p-OLfoATNk.js} +1 -1
- package/dist/components/{p-DEBwmRTC.js → p-oGAPPwAL.js} +2 -2
- package/dist/components/{p-DJ88BrIW.js → p-yD_3Z3K1.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-active-users_47.entry.js +140 -101
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{schema.constants-uC7_X6yr.js → schema.constants-Rpm1NA9u.js} +75 -7
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +2 -2
- package/dist/stencil/{p-5b969a42.entry.js → p-8c1b7b08.entry.js} +140 -101
- package/dist/stencil/{p-uC7_X6yr.js → p-Rpm1NA9u.js} +75 -7
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/core.class.d.ts +2 -2
- package/dist/types/classes/managers/license.manager.d.ts +6 -0
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +4 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +4 -1
- package/dist/types/components.d.ts +7 -0
- package/dist/types/constants/license.constants.d.ts +1 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/helpers/theme.helper.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/context-menu-state.interface.d.ts +16 -0
- package/dist/types/interfaces/theme.interface.d.ts +2 -0
- package/package.json +1 -1
- package/readme.md +3 -3
|
@@ -243,6 +243,7 @@ export class KritzelEditor {
|
|
|
243
243
|
isEditorVisible = false;
|
|
244
244
|
activeNotification;
|
|
245
245
|
isNotificationDismissing = false;
|
|
246
|
+
contextMenuState;
|
|
246
247
|
normalizedControls = [];
|
|
247
248
|
notificationDismissTimeout;
|
|
248
249
|
notificationDismissAnimationTimeout;
|
|
@@ -712,6 +713,22 @@ export class KritzelEditor {
|
|
|
712
713
|
this.activeNotification = event.detail;
|
|
713
714
|
this.scheduleNotificationDismiss();
|
|
714
715
|
}
|
|
716
|
+
handleContextMenuStateChange(event) {
|
|
717
|
+
event.stopPropagation();
|
|
718
|
+
this.contextMenuState = event.detail.isVisible ? event.detail : undefined;
|
|
719
|
+
}
|
|
720
|
+
handleContextMenuActionSelected(event) {
|
|
721
|
+
const contextMenuState = this.contextMenuState;
|
|
722
|
+
if (!contextMenuState || !event.detail.action) {
|
|
723
|
+
void this.hideContextMenu();
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
event.detail.action({
|
|
727
|
+
x: contextMenuState.worldPosition.x,
|
|
728
|
+
y: contextMenuState.worldPosition.y,
|
|
729
|
+
}, contextMenuState.objects);
|
|
730
|
+
void this.hideContextMenu();
|
|
731
|
+
}
|
|
715
732
|
handleNotificationHoverChange(event) {
|
|
716
733
|
event.stopPropagation();
|
|
717
734
|
this.isNotificationHovered = event.detail;
|
|
@@ -1016,36 +1033,41 @@ export class KritzelEditor {
|
|
|
1016
1033
|
const isLoggedIn = this.isLoggedIn;
|
|
1017
1034
|
const shouldShowCurrentUser = isLoggedIn;
|
|
1018
1035
|
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
1019
|
-
return (h(Host, { key: '
|
|
1036
|
+
return (h(Host, { key: 'ab06876e3a07e97c3788113ffd0483bbb2819d5b' }, h("div", { key: 'e393eacfad2b224a720e5a97b047af8dd3ce97a5', class: "editor-content", style: {
|
|
1020
1037
|
opacity: this.isEditorVisible ? '1' : '0',
|
|
1021
1038
|
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
1022
1039
|
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
1023
|
-
} }, h("div", { key: '
|
|
1040
|
+
} }, h("div", { key: 'd9dcbd6859bea28d75c7f8b0cc26ea3ba58b2433', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: '945953a6c95520316c4e0f35503a824414bd3c7a', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '8b345bf6ce0ec33ca35f1f630af2050b95bc6b74', visible: this.isBackToContentButtonVisible, text: this.resolvedTerms['backToContent.label'] ?? 'Back to content', onBackToContent: () => this.backToContent() })), this.activeNotification && (h("div", { key: '1b965de38a7f1f40d5d91431801e873289416924', class: "top-center-notification-layer", role: "presentation" }, h("div", { key: 'f165dc7acc5e1bc7923fec217ebc16fe4a3f2ece', class: { 'top-center-notification-container': true, 'is-dismissing': this.isNotificationDismissing }, role: "presentation" }, h("kritzel-notification-card", { key: 'c5cf7edc1f921e35310c89449f5a043dda171a04', notification: this.activeNotification, locale: this.locale, onDismiss: this.dismissNotification, onHoverChange: event => this.handleNotificationHoverChange(event) })))), this.contextMenuState && this.contextMenuState.items.length > 0 && (h("kritzel-context-menu", { key: 'fc3417276f0034e7fc7e8360d3f3ce57106146b2', class: "context-menu", items: this.contextMenuState.items, objects: this.contextMenuState.objects, style: {
|
|
1041
|
+
position: 'absolute',
|
|
1042
|
+
left: `${this.contextMenuState.position.x}px`,
|
|
1043
|
+
top: `${this.contextMenuState.position.y}px`,
|
|
1044
|
+
zIndex: '10002',
|
|
1045
|
+
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-engine", { key: '0c9df0386d38a87f50d324cfc51307a1cb947a58', ref: el => {
|
|
1024
1046
|
if (el) {
|
|
1025
1047
|
this.engineRef = el;
|
|
1026
1048
|
}
|
|
1027
|
-
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event), onNotificationsChange: event => this.handleNotificationsChange(event) }), h("kritzel-controls", { key: '
|
|
1049
|
+
}, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event), onNotificationsChange: event => this.handleNotificationsChange(event), onContextMenuStateChange: event => this.handleContextMenuStateChange(event) }), h("kritzel-controls", { key: '46d8e9c45c7bed24fc02d17c8fef836d596088d7', visible: this.isControlsVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
|
|
1028
1050
|
if (el) {
|
|
1029
1051
|
this.controlsRef = el;
|
|
1030
1052
|
}
|
|
1031
|
-
}, controls: this.normalizedControls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: '
|
|
1053
|
+
}, controls: this.normalizedControls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: 'e3ef94509a82fe435f827b66cf1813969b7dec66', class: "bottom-left-buttons" }, h("kritzel-zoom-panel", { key: '4e6cbdf85f550e6e3037dce3b910c0582ea0320b', visible: this.isZoomPanelVisible, disabled: !this.isZoomingEnabled, zoomPercent: this.currentZoomPercent, terms: this.resolvedTerms, onZoomIn: () => this.zoomIn(), onZoomOut: () => this.zoomOut() })), h("div", { key: 'a62df7f8a68cbed728b701894a5284c2bff39e1e', class: "top-right-buttons" }, h("kritzel-settings", { key: '0b6daf9ff43551df9f86431d398a32913a845925', ref: el => {
|
|
1032
1054
|
if (el) {
|
|
1033
1055
|
this.settingsRef = el;
|
|
1034
1056
|
}
|
|
1035
|
-
}, 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: '
|
|
1057
|
+
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], availableLocales: this.availableLocaleOptions, settings: this.currentSettingsConfig, terms: this.resolvedTerms, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '29d02ffd3358fe91d27435cc3fdd5f8ac2ad7cf5', ref: el => {
|
|
1036
1058
|
if (el) {
|
|
1037
1059
|
this.exportRef = el;
|
|
1038
1060
|
}
|
|
1039
|
-
}, 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: '
|
|
1061
|
+
}, workspaceName: this.activeWorkspace?.name || 'workspace', terms: this.resolvedTerms, onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '729ca599e46654bc1429b5d91ff73f26d9b6e7bb', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: '84c07268072418a82cf504f16803c59a1e37c0ae', user: this.user, terms: this.resolvedTerms, onClick: () => this.currentUserDialogRef?.open() }), shouldShowCurrentUser && (h("kritzel-current-user-dialog", { key: '55189e3da7899628b252e7995b20bc422fce2d5c', ref: el => {
|
|
1040
1062
|
if (el) {
|
|
1041
1063
|
this.currentUserDialogRef = el;
|
|
1042
1064
|
this.currentUserDialogRef.addEventListener('logoutRequest', this.handleCurrentUserLogout);
|
|
1043
1065
|
}
|
|
1044
|
-
}, user: this.user, terms: this.resolvedTerms })), shouldShowLoginButton && (h("kritzel-button", { key: '
|
|
1066
|
+
}, user: this.user, terms: this.resolvedTerms })), shouldShowLoginButton && (h("kritzel-button", { key: 'a55d85769bad635fcc7934f584bf1bf74c1e7ea6', onButtonClick: () => this.loginDialogRef?.open() }, this.resolvedTerms['login.dialogTitle'] ?? 'Sign in')), h("kritzel-more-menu", { key: '67dd879ec3c55c98e32f6112ca53d925f47b56b4', items: this.moreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '5f13130099110eb472022099219e15877ceceb57', ref: el => {
|
|
1045
1067
|
if (el) {
|
|
1046
1068
|
this.shareDialogRef = el;
|
|
1047
1069
|
}
|
|
1048
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '
|
|
1070
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: 'cda0fcdcad75de8730ce10bda425cc0fbe01429a', ref: el => {
|
|
1049
1071
|
if (el) {
|
|
1050
1072
|
this.loginDialogRef = el;
|
|
1051
1073
|
}
|
|
@@ -1882,6 +1904,7 @@ export class KritzelEditor {
|
|
|
1882
1904
|
"isEditorVisible": {},
|
|
1883
1905
|
"activeNotification": {},
|
|
1884
1906
|
"isNotificationDismissing": {},
|
|
1907
|
+
"contextMenuState": {},
|
|
1885
1908
|
"normalizedControls": {}
|
|
1886
1909
|
};
|
|
1887
1910
|
}
|
|
@@ -254,6 +254,8 @@ export class KritzelEngine {
|
|
|
254
254
|
awarenessChange;
|
|
255
255
|
/** Emitted when notifications change. */
|
|
256
256
|
notificationsChange;
|
|
257
|
+
/** Emitted when context-menu visibility, items, or position changes. */
|
|
258
|
+
contextMenuStateChange;
|
|
257
259
|
/** Emitted when the combined loading state (external `isLoading` prop or internal workspace loading) changes. */
|
|
258
260
|
loadingChange;
|
|
259
261
|
/** Emitted when remote workspace synchronization is in progress. */
|
|
@@ -446,6 +448,7 @@ export class KritzelEngine {
|
|
|
446
448
|
}
|
|
447
449
|
handleLongPress(ev) {
|
|
448
450
|
this.contextMenuHandler.handleContextMenu(ev.detail);
|
|
451
|
+
this.emitContextMenuStateChange();
|
|
449
452
|
}
|
|
450
453
|
handleContextMenu(ev) {
|
|
451
454
|
if (ev.cancelable) {
|
|
@@ -458,6 +461,7 @@ export class KritzelEngine {
|
|
|
458
461
|
return;
|
|
459
462
|
}
|
|
460
463
|
this.contextMenuHandler.handleContextMenu(ev);
|
|
464
|
+
this.emitContextMenuStateChange();
|
|
461
465
|
}
|
|
462
466
|
handleResize() {
|
|
463
467
|
this.viewport.handleResize();
|
|
@@ -699,6 +703,7 @@ export class KritzelEngine {
|
|
|
699
703
|
this.core.store.objects?.clearLocalSelectionBox();
|
|
700
704
|
this.core.store.state.isSelecting = false;
|
|
701
705
|
this.core.store.state.isEnabled = true;
|
|
706
|
+
this.emitContextMenuStateChange();
|
|
702
707
|
this.core.rerender();
|
|
703
708
|
}
|
|
704
709
|
/**
|
|
@@ -712,6 +717,7 @@ export class KritzelEngine {
|
|
|
712
717
|
*/
|
|
713
718
|
async openContextMenu(options) {
|
|
714
719
|
this.contextMenuHandler.open(options);
|
|
720
|
+
this.emitContextMenuStateChange();
|
|
715
721
|
}
|
|
716
722
|
/**
|
|
717
723
|
* Retrieves a canvas object by its unique ID.
|
|
@@ -1829,7 +1835,6 @@ export class KritzelEngine {
|
|
|
1829
1835
|
viewport;
|
|
1830
1836
|
contextMenuHandler;
|
|
1831
1837
|
keyHandler;
|
|
1832
|
-
contextMenuElement = null;
|
|
1833
1838
|
_lastHadSelectionGroup = false;
|
|
1834
1839
|
_isViewportReady = false;
|
|
1835
1840
|
_isYjsInitialized = false;
|
|
@@ -1868,6 +1873,22 @@ export class KritzelEngine {
|
|
|
1868
1873
|
this.isSyncing = isSyncing;
|
|
1869
1874
|
this.syncingChange.emit(isSyncing);
|
|
1870
1875
|
}
|
|
1876
|
+
emitContextMenuStateChange() {
|
|
1877
|
+
this.contextMenuStateChange.emit({
|
|
1878
|
+
isVisible: this.core.store.state.isContextMenuVisible,
|
|
1879
|
+
isObjectMenu: !!this.core.store.selectionGroup,
|
|
1880
|
+
items: this.core.store.state.contextMenuItems,
|
|
1881
|
+
objects: this.core.store.selectionGroup?.objects || [],
|
|
1882
|
+
position: {
|
|
1883
|
+
x: this.core.store.state.contextMenuX,
|
|
1884
|
+
y: this.core.store.state.contextMenuY,
|
|
1885
|
+
},
|
|
1886
|
+
worldPosition: {
|
|
1887
|
+
x: this.core.store.state.contextMenuWorldX,
|
|
1888
|
+
y: this.core.store.state.contextMenuWorldY,
|
|
1889
|
+
},
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1871
1892
|
applyToolConfig(tool, toolConfig) {
|
|
1872
1893
|
const normalizedToolConfig = this.normalizeToolConfig(toolConfig);
|
|
1873
1894
|
Object.entries(normalizedToolConfig).forEach(([key, value]) => {
|
|
@@ -1988,6 +2009,10 @@ export class KritzelEngine {
|
|
|
1988
2009
|
this.core.store.state.viewportBoundaryRight = this.viewportBoundaryRight;
|
|
1989
2010
|
this.core.store.state.viewportBoundaryTop = this.viewportBoundaryTop;
|
|
1990
2011
|
this.core.store.state.viewportBoundaryBottom = this.viewportBoundaryBottom;
|
|
2012
|
+
if (this.debugInfo) {
|
|
2013
|
+
this.core.store.state.debugInfo = this.debugInfo;
|
|
2014
|
+
this.core.assetResolver.setShowInfo(this.debugInfo.showAssetResolverInfo);
|
|
2015
|
+
}
|
|
1991
2016
|
this._isWorkspaceLoading = true;
|
|
1992
2017
|
this.syncLoadingState();
|
|
1993
2018
|
}
|
|
@@ -2391,7 +2416,9 @@ export class KritzelEngine {
|
|
|
2391
2416
|
this.emitObjectsInViewportChange();
|
|
2392
2417
|
}
|
|
2393
2418
|
}
|
|
2394
|
-
return (h(Host, null, h("kritzel-loading-overlay", { visible: this.core.store.state.isLoading, text: this.core.localizationManager.translate('engine.loading') }), h("kritzel-sync-indicator", { visible: this.isSyncing, text: "Syncing..." }), this.core.store.state.debugInfo.showViewportInfo && (h("div", { class: "debug-panel"
|
|
2419
|
+
return (h(Host, null, h("kritzel-loading-overlay", { visible: this.core.store.state.isLoading, text: this.core.localizationManager.translate('engine.loading') }), h("kritzel-sync-indicator", { visible: this.isSyncing, text: "Syncing..." }), this.core.store.state.debugInfo.showViewportInfo && (h("div", { class: "debug-panel", style: {
|
|
2420
|
+
color: 'var(--kritzel-global-text-primary)',
|
|
2421
|
+
} }, h("div", null, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), h("div", null, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), h("div", null, "TranslateX: ", this.core.store.state?.translateX), h("div", null, "TranslateY: ", this.core.store.state?.translateY), h("div", null, "ViewportWidth: ", this.core.store.state?.viewportWidth), h("div", null, "ViewportHeight: ", this.core.store.state?.viewportHeight), h("div", null, "PointerCount: ", this.core.store.state.pointers.size), h("div", null, "Scale: ", this.core.store.state?.scale), h("div", null, "ActiveTool: ", this.core.store.state?.activeTool?.name), h("div", null, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), h("div", null, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), h("div", null, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), h("div", null, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), h("div", null, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", null, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", null, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", null, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", null, "IsRotationHandleHovered: ", this.core.store.state.isRotationHandleHovered ? 'true' : 'false'), h("div", null, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), h("div", null, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), h("div", null, "IsPointerDown: ", this.core.store.isPointerDown ? 'true' : 'false'), h("div", null, "PointerX: ", this.core.store.state?.pointerX), h("div", null, "PointerY: ", this.core.store.state?.pointerY), h("div", null, "TotalObjects: ", this.core.store.totalObjectCount), h("div", null, "ObjectsInViewport: ", this.core.store.objectsInViewport.length), h("div", null, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), h("div", null, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), h("div", { id: "origin", class: "origin", style: {
|
|
2395
2422
|
transform: `matrix(${this.core.store.state?.scale}, 0, 0, ${this.core.store.state?.scale}, ${this.core.store.state?.translateX}, ${this.core.store.state?.translateY})`,
|
|
2396
2423
|
opacity: this._sceneBootstrapOpacity.toString(),
|
|
2397
2424
|
transition: this._sceneBootstrapTransitionEnabled ? 'opacity 220ms ease-out' : 'none',
|
|
@@ -2574,6 +2601,7 @@ export class KritzelEngine {
|
|
|
2574
2601
|
left: `${object.totalWidth}px`,
|
|
2575
2602
|
top: '0',
|
|
2576
2603
|
zIndex: (object.zIndex + 2).toString(),
|
|
2604
|
+
color: 'var(--kritzel-global-text-primary)',
|
|
2577
2605
|
} }, h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "Id: ", object.id), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "userId: ", object.userId), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "rotationDegrees: ", object.rotationDegrees), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "isSelected: ", object.isSelected ? 'true' : 'false'), KritzelClassHelper.isInstanceOf(object, 'KritzelCustomElement') && (h("div", null, h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "isInteractive: ", object.isInteractive ? 'true' : 'false'))), KritzelClassHelper.isInstanceOf(object, 'KritzelImage') && (h("div", null, h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "assetId: ", object.assetId), h("div", { style: { whiteSpace: 'nowrap', fontSize: '10px' } }, "mimeType: ", object.mimeType))))), (this.core.displaySelectionGroupUI(object) || this.core.displaySelectionLineUI(object)) &&
|
|
2578
2606
|
(() => {
|
|
2579
2607
|
const isSelectionGroup = KritzelClassHelper.isInstanceOf(object, 'KritzelSelectionGroup');
|
|
@@ -2774,8 +2802,12 @@ export class KritzelEngine {
|
|
|
2774
2802
|
strokeDasharray: data.dashArray,
|
|
2775
2803
|
strokeLinecap: 'round',
|
|
2776
2804
|
} }))), h("circle", { cx: data.centerX, cy: data.centerY, r: data.indicatorRadius, style: {
|
|
2777
|
-
fill: isActiveSnap
|
|
2778
|
-
|
|
2805
|
+
fill: isActiveSnap
|
|
2806
|
+
? 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))'
|
|
2807
|
+
: 'var(--kritzel-snap-indicator-fill-inactive, var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.18)))',
|
|
2808
|
+
stroke: isActiveSnap
|
|
2809
|
+
? 'var(--kritzel-snap-indicator-stroke, #007bff)'
|
|
2810
|
+
: 'var(--kritzel-snap-indicator-stroke-inactive, var(--kritzel-snap-indicator-stroke, rgba(59, 130, 246, 0.5)))',
|
|
2779
2811
|
strokeWidth: data.indicatorStrokeWidth,
|
|
2780
2812
|
} }))));
|
|
2781
2813
|
})(), (() => {
|
|
@@ -2822,20 +2854,7 @@ export class KritzelEngine {
|
|
|
2822
2854
|
stroke: 'var(--kritzel-snap-indicator-stroke, #007bff)',
|
|
2823
2855
|
strokeWidth: data.indicatorStrokeWidth,
|
|
2824
2856
|
} })))));
|
|
2825
|
-
})()), this.core.store.
|
|
2826
|
-
position: 'absolute',
|
|
2827
|
-
left: `${this.core.store.state.contextMenuX}px`,
|
|
2828
|
-
top: `${this.core.store.state.contextMenuY}px`,
|
|
2829
|
-
zIndex: '10002',
|
|
2830
|
-
}, onActionSelected: event => {
|
|
2831
|
-
if (event.detail.action) {
|
|
2832
|
-
event.detail.action({
|
|
2833
|
-
x: this.core.store.state.contextMenuWorldX,
|
|
2834
|
-
y: this.core.store.state.contextMenuWorldY,
|
|
2835
|
-
}, this.core.store.selectionGroup?.objects || []);
|
|
2836
|
-
}
|
|
2837
|
-
this.hideContextMenu();
|
|
2838
|
-
}, onClose: () => this.hideContextMenu() })), this.core.store.objects?.hasAwareness && h("kritzel-awareness-cursors", { core: this.core }), this.core.store.state?.activeTool?.toolType === 'eraser' && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { core: this.core }), !this.core.licenseManager.isLicensed && h("kritzel-watermark", { core: this.core, label: this.core.localizationManager.translate('watermark.poweredBy') })));
|
|
2857
|
+
})()), this.core.store.objects?.hasAwareness && h("kritzel-awareness-cursors", { core: this.core }), this.core.store.state?.activeTool?.toolType === 'eraser' && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { core: this.core }), !this.core.licenseManager.isLicensed && h("kritzel-watermark", { core: this.core, label: this.core.localizationManager.translate('watermark.poweredBy') })));
|
|
2839
2858
|
}
|
|
2840
2859
|
static get is() { return "kritzel-engine"; }
|
|
2841
2860
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3779,6 +3798,28 @@ export class KritzelEngine {
|
|
|
3779
3798
|
}
|
|
3780
3799
|
}
|
|
3781
3800
|
}
|
|
3801
|
+
}, {
|
|
3802
|
+
"method": "contextMenuStateChange",
|
|
3803
|
+
"name": "contextMenuStateChange",
|
|
3804
|
+
"bubbles": true,
|
|
3805
|
+
"cancelable": true,
|
|
3806
|
+
"composed": true,
|
|
3807
|
+
"docs": {
|
|
3808
|
+
"tags": [],
|
|
3809
|
+
"text": "Emitted when context-menu visibility, items, or position changes."
|
|
3810
|
+
},
|
|
3811
|
+
"complexType": {
|
|
3812
|
+
"original": "KritzelContextMenuState",
|
|
3813
|
+
"resolved": "KritzelContextMenuState",
|
|
3814
|
+
"references": {
|
|
3815
|
+
"KritzelContextMenuState": {
|
|
3816
|
+
"location": "import",
|
|
3817
|
+
"path": "../../../interfaces/context-menu-state.interface",
|
|
3818
|
+
"id": "src/interfaces/context-menu-state.interface.ts::KritzelContextMenuState",
|
|
3819
|
+
"referenceLocation": "KritzelContextMenuState"
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
}
|
|
3782
3823
|
}, {
|
|
3783
3824
|
"method": "loadingChange",
|
|
3784
3825
|
"name": "loadingChange",
|
|
@@ -19,7 +19,7 @@ export class KritzelWatermark {
|
|
|
19
19
|
label;
|
|
20
20
|
render() {
|
|
21
21
|
const label = this.label ?? this.core.localizationManager.translate('watermark.poweredBy');
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '0eccc75e51c7ac199e23d8f3a871593f1fb65a17' }, h("a", { key: '2029f8b56ba8609ca621447eac0df9d30ebfbbbe', class: "watermark-link", href: KRITZEL_WEBSITE_URL, target: "_blank", rel: "noopener noreferrer", part: "watermark", onPointerDown: (ev) => ev.stopPropagation(), onPointerUp: (ev) => ev.stopPropagation() }, label)));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "kritzel-watermark"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -81,16 +81,16 @@ export class KritzelAvatar {
|
|
|
81
81
|
height: `${this.size}px`,
|
|
82
82
|
fontSize: `${Math.round(this.size * 0.4)}px`,
|
|
83
83
|
};
|
|
84
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: '116725d55e4443e80216b3b3251e957d2009b43e', style: containerStyles, class: {
|
|
85
85
|
'has-image': !!showImage,
|
|
86
86
|
'has-initials': !!showInitials,
|
|
87
87
|
'has-default': !!showDefaultIcon,
|
|
88
|
-
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '
|
|
88
|
+
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: 'd70ad4eb484404b18c13e066e8c10b3c86918ee5', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
|
|
89
89
|
if (el) {
|
|
90
90
|
el.referrerPolicy = 'no-referrer';
|
|
91
91
|
el.crossOrigin = 'anonymous';
|
|
92
92
|
}
|
|
93
|
-
}, onError: this.handleImageError })), showInitials && (h("span", { key: '
|
|
93
|
+
}, onError: this.handleImageError })), showInitials && (h("span", { key: '21a9022cffdb69e0c3626e513cb3c036a9d3a16d', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: '43e676af007bf254b1921f3efcbc7fff4e204359', class: "avatar-default" }, h("svg", { key: 'a7378795539a902e28ca644a80f1ca00cc9f818a', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: '31548a495a86f033325c98cfcc0ae398b6bb8281', d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }))))));
|
|
94
94
|
}
|
|
95
95
|
static get is() { return "kritzel-avatar"; }
|
|
96
96
|
static get encapsulation() { return "shadow"; }
|
|
@@ -15,11 +15,11 @@ export class KritzelButton {
|
|
|
15
15
|
this.buttonClick.emit();
|
|
16
16
|
};
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: 'b9de2a1261ca0cb491f6980db6a596c48fa45b3a' }, h("button", { key: 'a9507ea0f6a1d9fcb19a7df16bea54cc0ead24f9', type: this.type, class: {
|
|
19
19
|
'kritzel-button': true,
|
|
20
20
|
[this.variant]: true,
|
|
21
21
|
'disabled': this.disabled,
|
|
22
|
-
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '
|
|
22
|
+
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '8449a26d4f9fe0226c6150a6639c522486b59780' }))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "kritzel-button"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -38,13 +38,13 @@ export class KritzelColorComponent {
|
|
|
38
38
|
render() {
|
|
39
39
|
const resolvedColor = this.resolveColor();
|
|
40
40
|
const isColorVeryLight = this.isLightColor(resolvedColor);
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: 'e39c77c55942b9c615e404efabf4939b2cf05a34' }, h("div", { key: 'ac343295592ea80ca7d3da61ca1244dd1aaa50db', class: "checkerboard-bg", style: {
|
|
42
42
|
width: `${this.size}px`,
|
|
43
43
|
height: `${this.size}px`,
|
|
44
44
|
borderRadius: '50%',
|
|
45
45
|
display: 'inline-block',
|
|
46
46
|
position: 'relative',
|
|
47
|
-
} }, h("div", { key: '
|
|
47
|
+
} }, h("div", { key: '4c87934b3febd4c41874cd290d86a9a9a557e3e5', class: {
|
|
48
48
|
'color-circle': true,
|
|
49
49
|
'white': isColorVeryLight,
|
|
50
50
|
}, style: {
|
|
@@ -33,7 +33,7 @@ export class KritzelColorPalette {
|
|
|
33
33
|
render() {
|
|
34
34
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
35
35
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '16aa405a43b3943473e577c5a6ab86adf4ae1ba9' }, h("div", { key: 'f65bb286889700dc1f0e8d84ff59721071b7b73a', class: {
|
|
37
37
|
'color-grid': true,
|
|
38
38
|
'expanded': this.isExpanded,
|
|
39
39
|
}, style: {
|
|
@@ -4,7 +4,7 @@ export class KritzelFont {
|
|
|
4
4
|
size = 24;
|
|
5
5
|
color = '#000000';
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '054371cac30a2433611139a670406b0a1e3b99ff' }, h("div", { key: 'b4f2142b3cb31d067f39952a38b6f665f28f63bf', class: "font-preview", style: {
|
|
8
8
|
fontFamily: this.fontFamily,
|
|
9
9
|
fontSize: `${this.size}px`,
|
|
10
10
|
color: this.color
|
|
@@ -17,7 +17,7 @@ export class KritzelFontSize {
|
|
|
17
17
|
render() {
|
|
18
18
|
const color = 'var(--kritzel-global-text-primary)';
|
|
19
19
|
const sizes = this.sizes ?? [];
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '56eb19367abe312bac3b626cfcae3b1ff6e90d21' }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
21
21
|
'size-container': true,
|
|
22
22
|
'selected': this.selectedSize === size,
|
|
23
23
|
}, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
|
|
@@ -28,7 +28,7 @@ export class KritzelInput {
|
|
|
28
28
|
this.valueChange.emit(input.value);
|
|
29
29
|
};
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '46a0a48902a06ad85edcbaad3679ce3fe9ba850c' }, h("div", { key: 'a6beaf920614aa959d2fbd68b7268afba8637358', class: "input-container" }, this.label && h("label", { key: 'ca6d3fb3c22f1540795dbb0695ddd9b87cc05eee', class: "input-label" }, this.label), h("div", { key: '78d116e82531a9cca996d594792245449bcaf9c8', class: { 'input-wrapper': true, 'has-suffix': !!this.suffix } }, h("input", { key: '0d10d6356dea3a11338172bbe8c3c878eefcc708', type: this.type, class: "text-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput }), this.suffix && h("span", { key: '0e6166ba8728efc1035302d7fb048306efbe5a68', class: "input-suffix" }, this.suffix)))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "kritzel-input"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,15 +90,15 @@ export class KritzelMasterDetail {
|
|
|
90
90
|
const selectedItem = this.items.find(item => item.id === this.selectedItemId);
|
|
91
91
|
const panelId = 'master-detail-panel';
|
|
92
92
|
const selectedTabId = selectedItem ? `tab-${selectedItem.id}` : undefined;
|
|
93
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: '0edf50b0b853633b88bf481f97f22aceba9e163e' }, h("div", { key: '21a0a3f81e5a60889ccd152c905cb41f52c3e037', class: {
|
|
94
94
|
'master-detail-container': true,
|
|
95
95
|
'is-mobile-detail-visible': this.showMobileDetail,
|
|
96
|
-
} }, h("nav", { key: '
|
|
96
|
+
} }, h("nav", { key: '41f88248cc372c8cae4cb50a19edf462a01e43f2', class: "master-menu", role: "tablist", "aria-orientation": "vertical", "aria-label": "Settings categories" }, this.items.map((item, index) => (h("button", { key: item.id, id: `tab-${item.id}`, ref: el => this.setTabRef(el, index), class: {
|
|
97
97
|
'menu-item': true,
|
|
98
98
|
'is-selected': item.id === this.selectedItemId,
|
|
99
99
|
'is-disabled': !!item.disabled,
|
|
100
100
|
'is-focused': index === this.focusedIndex,
|
|
101
|
-
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: '
|
|
101
|
+
}, role: "tab", "aria-selected": item.id === this.selectedItemId ? 'true' : 'false', "aria-controls": panelId, "aria-disabled": item.disabled ? 'true' : undefined, tabIndex: this.getTabIndex(item, index), disabled: item.disabled, onClick: () => this.handleItemClick(item), onKeyDown: e => this.handleKeyDown(e, item, index), onFocus: () => this.handleFocus(index), onBlur: this.handleBlur }, item.icon && (h("kritzel-icon", { name: item.icon, size: 20, class: "menu-item-icon" })), h("span", { class: "menu-item-label" }, item.label), h("span", { class: "menu-item-chevron", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "m9 18 6-6-6-6" }))))))), h("div", { key: 'f8447facf3dfdbd7772823654847e1b90b03f73e', id: panelId, class: "detail-panel", role: "tabpanel", "aria-labelledby": selectedTabId }, h("button", { key: '3edc9784267613e6b3a706739bbb537161e4c747', class: "mobile-back-button", onClick: this.handleBackClick, "aria-label": "Back to menu" }, h("kritzel-icon", { key: 'ec0b4691735578525e5863842271366e04b13fb7', name: "chevron-left", size: 20, class: "mobile-back-icon" }), "Back"), h("slot", { key: 'c21fbaff78f98859b9756427125b60504d4bb630' })))));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "kritzel-master-detail"; }
|
|
104
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,7 +51,7 @@ export class KritzelMenu {
|
|
|
51
51
|
this.itemCloseChildMenu.emit(event.detail);
|
|
52
52
|
};
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: '27a90a3a8549517a2d6e341a5da13496bf714970', tabIndex: 0, onClick: e => e.stopPropagation() }, this.openChildMenuItem && h("div", { key: 'c0c2351fac389f6676b38481eaacee553ca6867a', class: "has-open-child-overlay", onClick: this.onOverlayClick }), this.items.map(item => (h("kritzel-menu-item", { key: item.id, "data-testid": `menu-item-${item.id}`, item: item, parent: this.parent, style: { pointerEvents: this.editingMenuItem && !item.isEditing ? 'none' : 'auto' }, onItemSelect: this.handleItemSelect, onItemSave: this.handleSave, onItemCancel: this.handleCancel, onItemToggleChildMenu: this.handleToggleChildMenu, onItemCloseChildMenu: this.handleCloseChildMenu })))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "kritzel-menu"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,12 +90,12 @@ export class KritzelMenuItem {
|
|
|
90
90
|
];
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: '9d6653a630da5a3da38291d89d6d7d59d6994e02', tabIndex: this.item.isDisabled ? -1 : 0, class: {
|
|
94
94
|
'selected': this.item.isSelected,
|
|
95
95
|
'editing': this.item.isEditing,
|
|
96
96
|
'disabled': this.item.isDisabled,
|
|
97
97
|
'child-open': this.item.isChildMenuOpen,
|
|
98
|
-
}, onClick: this.handleItemSelect }, h("div", { key: '
|
|
98
|
+
}, onClick: this.handleItemSelect }, h("div", { key: '48a1678296e672c6c03fb3e1473c42d3a246d481', class: "menu-item-overlay" }), this.item.isEditing ? this.renderEditMode() : this.renderViewMode()));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "kritzel-menu-item"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -86,7 +86,7 @@ export class KritzelNumericInput {
|
|
|
86
86
|
this.valueChange.emit(newValue);
|
|
87
87
|
};
|
|
88
88
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: '8901e0b56ccbc344420483a4a56663f7cd74d9e8' }, h("div", { key: '5f3d6b5c56007e11383aa69f60f22031b0e8f332', class: "input-container" }, this.label && h("label", { key: '2cb102a5b6c16d068f4f304fbcc6241f79fc0ce8', class: "input-label" }, this.label), h("div", { key: '96441095acc3d9a8e77b6d2bac2ceda683c9c976', class: "input-wrapper" }, h("input", { key: '523a5485111077e20faded235df6362e5ea9cfd4', type: "number", class: "numeric-input", title: "", min: this.min === Number.MIN_SAFE_INTEGER ? undefined : this.min, max: this.max === Number.MAX_SAFE_INTEGER ? undefined : this.max, step: this.step, value: this.inputValue, placeholder: this.placeholder, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, onInvalid: this.handleInvalid }), h("div", { key: '2071e98125a8d014513e93052bd8c1fee17932a5', class: "spinner-buttons" }, h("button", { key: '12422e5285dfb532dbbb6eb1a36dbcb3de50f2bc', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, h("svg", { key: '49ad5625c80fae6706ba4ab91f47bd550481ef74', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'ff7d19b61baeb5ba58bb60f2cc629bcec6eb4411', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: 'e4fec28e4fc997e007127f2b30b00cc752433221', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, h("svg", { key: '27bf06cde8de11f4a97090911afd6b8993463112', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'ed7071dd79bfe509ebb319ce43ecb3e982dd4157', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "kritzel-numeric-input"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,7 +22,7 @@ export class KritzelOpacitySlider {
|
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
24
|
const percentage = this.getPercentage();
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '2dadd8a7c4d1af748e91a6005433288ab231f2e8' }, h("div", { key: '65ae90d95bffff244d97329754cf0cb8f73331fa', class: "opacity-container" }, h("div", { key: '90e95347f7015882112f0653a25347e715233227', class: "slider-wrapper" }, h("input", { key: '15836bc089c1725062016677d3b95384d1958431', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
26
26
|
'--slider-progress': `${percentage}%`,
|
|
27
27
|
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
28
28
|
} })))));
|
|
@@ -277,7 +277,7 @@ export class KritzelPortal {
|
|
|
277
277
|
this.portal.style.visibility = 'visible';
|
|
278
278
|
}
|
|
279
279
|
render() {
|
|
280
|
-
return (h(Host, { key: '
|
|
280
|
+
return (h(Host, { key: '72273b4c7811473072ee27668836a5ddddcfd618', style: { display: this.anchor ? 'block' : 'none' } }, h("slot", { key: 'b4f37ca27c47ab950a4639162fa31a3c2362d6f7' })));
|
|
281
281
|
}
|
|
282
282
|
static get is() { return "kritzel-portal"; }
|
|
283
283
|
static get encapsulation() { return "shadow"; }
|
|
@@ -21,7 +21,7 @@ export class KritzelSlideToggle {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '00160c9cfdafa0d53f3acfb1fb235b29abf2622a', class: { checked: this.checked, disabled: this.disabled }, tabIndex: this.disabled ? -1 : 0, role: "switch", "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.label, onClick: this.handleToggle, onKeyDown: this.handleKeyDown }, h("div", { key: '385008948ffbdc0f26249d2d833aae8f04eeb6a0', class: "toggle-track" }, h("div", { key: '43929e94335589feb24ee45f1c34a270653dd412', class: "toggle-thumb" }))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "kritzel-slide-toggle"; }
|
|
27
27
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +82,7 @@ export class KritzelSplitButton {
|
|
|
82
82
|
this.menuScrollTop = event.target.scrollTop;
|
|
83
83
|
};
|
|
84
84
|
render() {
|
|
85
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: 'fa22dc1185ef07d8127d9ee9f6dbe482d126f934', class: { mobile: this.isTouchDevice } }, h("button", { key: 'a48aba702b70e9b24ad5486dde61fa9f9c8f7cdc', class: "split-main-button", tabIndex: 0, onClick: this.handleButtonClick, disabled: this.mainButtonDisabled, "aria-label": "Main action" }, this.buttonIcon && h("kritzel-icon", { key: '0d1c9a3e9f744541dd6ebe491105f6ee65233543', name: this.buttonIcon })), h("div", { key: 'c9db29f0b9c9cf1974d78f4f60be9e1b0e26c5d2', class: "split-divider" }), h("button", { key: '57addfd5228b7c7668be902c53683d12c976b89b', ref: el => (this.splitMenuButtonRef = el), class: "split-menu-button", tabIndex: 0, onClick: this.toggleMenu, disabled: this.menuButtonDisabled, "aria-label": "Open menu" }, h("kritzel-icon", { key: 'd860cc503043425860b1234b5d34693bfdd1d5ab', name: this.dropdownIcon })), h("kritzel-portal", { key: 'cd6dda8869aea4205d922fc639073019bbd2b102', anchor: this.anchorElement, offsetY: 4, onClose: this.closeMenu }, h("kritzel-menu", { key: '1ef1c2b319662e7a2af15b46362addcc75bceb68', ref: el => (this.menuRef = el), items: this.items, onItemSelect: this.handleItemSelect, onItemSave: this.handleItemSave, onItemCancel: this.handleItemCancel, onItemToggleChildMenu: this.handleItemToggleChildMenu, onItemCloseChildMenu: this.handleItemCloseChildMenu, onClose: this.closeMenu, onScroll: this.handleScroll }))));
|
|
86
86
|
}
|
|
87
87
|
static get is() { return "kritzel-split-button"; }
|
|
88
88
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,7 +9,7 @@ export class KritzelStrokeSize {
|
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
11
|
const sizes = this.sizes ?? [];
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'ba181d798d2bf7b60308746635d2077ce1353b83' }, h("div", { key: '048fc8934190359b9337747567844ca88925a6ce', class: "size-grid" }, sizes.map(size => (h("div", { tabIndex: 0, class: {
|
|
13
13
|
'size-container': true,
|
|
14
14
|
'selected': this.selectedSize === size,
|
|
15
15
|
}, onClick: () => this.handleSizeClick(size) }, h("kritzel-color", { value: 'var(--kritzel-global-text-primary)', size: size })))))));
|
|
@@ -5,7 +5,7 @@ export class KritzelSyncIndicator {
|
|
|
5
5
|
/** The text displayed next to the spinner. */
|
|
6
6
|
text = 'Syncing...';
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '585d5fd13116c093e5221164e36e6e986a63da58' }, h("div", { key: 'd4e0d9e51db002b8ea201a0564c22916809c346d', class: { indicator: true, visible: this.visible }, role: "status", "aria-live": "polite", "aria-label": "Synchronizing workspace" }, h("span", { key: 'b82f4c363ee31ae697e435fc8eb6ce0e2f3df1ab', class: "spinner", "aria-hidden": "true" }), h("span", { key: 'f39e04332aaf622dad69d0e5d6b6e90ee5df3ed1' }, this.text))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "kritzel-sync-indicator"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -128,14 +128,14 @@ export class KritzelTooltip {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
render() {
|
|
131
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: '227146703158aa65ecffcce348e568d559cee829', style: {
|
|
132
132
|
position: 'fixed',
|
|
133
133
|
zIndex: '9999',
|
|
134
134
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
135
135
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
136
136
|
left: `${this.positionX}px`,
|
|
137
137
|
bottom: `${this.positionY}px`,
|
|
138
|
-
} }, h("div", { key: '
|
|
138
|
+
} }, h("div", { key: '573e97ed81920066e8fbf50f790224c23b37ec21', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, h("slot", { key: 'c489b45928cf6720c6827df73b9eedf08bc9d5e2' }))));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "kritzel-tooltip"; }
|
|
141
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,7 +16,7 @@ export class KritzelBackToContent {
|
|
|
16
16
|
this.backToContent.emit();
|
|
17
17
|
};
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '86a94bdc5bb02977214f999b7b880ce3193b6d8f' }, h("button", { key: '6a07c13c9986ebef6100140f7e702a1dfb5c2033', class: { 'back-to-content-button': true, visible: this.visible }, onClick: this.handleClick, "aria-label": this.text }, h("kritzel-icon", { key: 'ebadc99b15f2f015ada8795fa05a3a64ccac9cb5', name: "chevrons-left" }))));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "kritzel-back-to-content"; }
|
|
22
22
|
static get encapsulation() { return "shadow"; }
|