kritzel-stencil 0.3.12 → 0.3.13
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-CFnj_FXt.js → index-Xav9JFHg.js} +1 -1
- package/dist/cjs/index.cjs.js +41 -3
- package/dist/cjs/kritzel-active-users_42.cjs.entry.js +139 -97
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{schema.constants-CzfoUWxF.js → schema.constants-CMFOYyBj.js} +22 -42
- package/dist/cjs/stencil.cjs.js +3 -3
- package/dist/collection/classes/core/viewport.class.js +16 -8
- package/dist/collection/classes/objects/shape.class.js +2 -1
- package/dist/collection/classes/tools/base-tool.class.js +2 -0
- package/dist/collection/classes/tools/brush-tool.class.js +1 -0
- package/dist/collection/classes/tools/eraser-tool.class.js +1 -0
- package/dist/collection/classes/tools/image-tool.class.js +1 -0
- package/dist/collection/classes/tools/line-tool.class.js +1 -0
- package/dist/collection/classes/tools/selection-tool.class.js +1 -0
- package/dist/collection/classes/tools/shape-tool.class.js +1 -0
- package/dist/collection/classes/tools/text-tool.class.js +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +77 -22
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +106 -2
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +3 -3
- package/dist/collection/components/shared/kritzel-input/kritzel-input.css +1 -1
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +2 -2
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +7 -0
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +7 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.css +1 -1
- package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.js +2 -2
- package/dist/collection/configs/default-asset-storage.config.js +1 -2
- package/dist/collection/configs/default-sync.config.js +2 -5
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/tool-config.helper.js +58 -65
- package/dist/collection/interfaces/tool-type.interface.js +1 -0
- package/dist/collection/themes/dark-theme.js +5 -0
- package/dist/collection/themes/light-theme.js +5 -0
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-brush-style.js +1 -1
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dialog.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/p-2xYAGd0I.js +1 -0
- package/dist/components/{p-DdmJquQr.js → p-B2Os1ya_.js} +1 -1
- package/dist/components/p-B2w8X7vn.js +1 -0
- package/dist/components/{p-DRB3TZzI.js → p-B4b6TDxp.js} +1 -1
- package/dist/components/p-B5xxfwKF.js +1 -0
- package/dist/components/p-B9hLySCl.js +1 -0
- package/dist/components/{p-D0aom7Yu.js → p-BFYtCsZu.js} +1 -1
- package/dist/components/{p-CARNM9pf.js → p-BFoK4W--.js} +1 -1
- package/dist/components/{p-x38RbGJA.js → p-BYmp9Ovv.js} +1 -1
- package/dist/components/{p-KVG5rztB.js → p-BbactVA0.js} +1 -1
- package/dist/components/{p-B_JH91jB.js → p-BfNHpqQ8.js} +1 -1
- package/dist/components/{p-DXgUuzXW.js → p-BiG1dxPS.js} +1 -1
- package/dist/components/{p-Dov3qOAR.js → p-Bj2laX89.js} +1 -1
- package/dist/components/{p-Cr7xOsIZ.js → p-BqwqGFQY.js} +1 -1
- package/dist/components/{p-DmTG0Y5h.js → p-BzYU3-MJ.js} +1 -1
- package/dist/components/p-C-aFOO5p.js +1 -0
- package/dist/components/p-C0TN5IAi.js +1 -0
- package/dist/components/{p-RnuCSIt-.js → p-C2SX-XRr.js} +1 -1
- package/dist/components/{p-guqEWGgV.js → p-CFgkUYoO.js} +1 -1
- package/dist/components/{p-BTSOqHMI.js → p-CHrSFOSI.js} +1 -1
- package/dist/components/p-CJOhfMU5.js +1 -0
- package/dist/components/{p-DJLJfKY2.js → p-COLHjboZ.js} +1 -1
- package/dist/components/{p-CKY7AvGR.js → p-COgo9OWy.js} +1 -1
- package/dist/components/{p-Do4UlU4e.js → p-CVzH1Oil.js} +1 -1
- package/dist/components/{p-DhAM4qeQ.js → p-CXpv9Rxe.js} +1 -1
- package/dist/components/{p-Bp3kdH4l.js → p-CcyIAi9S.js} +1 -1
- package/dist/components/{p-COIxq81R.js → p-CmuNn1Tc.js} +1 -1
- package/dist/components/{p-DfH7YY2C.js → p-D-sRVAbQ.js} +1 -1
- package/dist/components/{p-ZgZqbJ58.js → p-DDYoDSrm.js} +1 -1
- package/dist/components/{p-u0b2RJAn.js → p-DEy7zJCe.js} +1 -1
- package/dist/components/{p-BPEn0_hr.js → p-DM11KXUT.js} +1 -1
- package/dist/components/{p-CJERvHdy.js → p-DbB730vO.js} +1 -1
- package/dist/components/{p-C8ggg-5h.js → p-Df3BwVGy.js} +1 -1
- package/dist/components/{p-Dx_xz_El.js → p-DlwYHzSj.js} +1 -1
- package/dist/components/p-DplAQ6jk.js +9 -0
- package/dist/components/{p-CJ2V42sz.js → p-FK7b3BGt.js} +1 -1
- package/dist/components/{p-CxtTuKCy.js → p-JhOYwUOj.js} +1 -1
- package/dist/components/{p-Dw9sKOsb.js → p-SptaSMno.js} +1 -1
- package/dist/components/{p-KjtNlFTl.js → p-UoPj5QjH.js} +1 -1
- package/dist/components/{p-CYR9wbJg.js → p-dcAernE1.js} +1 -1
- package/dist/components/{p-EFyZdR89.js → p-ijIqLY9g.js} +1 -1
- package/dist/components/{p-BI_UUiTr.js → p-skWUIStn.js} +1 -1
- package/dist/components/{p-DgtrNOWm.js → p-x6doYeiI.js} +1 -1
- package/dist/esm/{index-D9HaikfQ.js → index-Dhio9uis.js} +1 -1
- package/dist/esm/index.js +42 -4
- package/dist/esm/kritzel-active-users_42.entry.js +139 -97
- package/dist/esm/kritzel-brush-style.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{schema.constants-BcT1vV4J.js → schema.constants-NrtFvKER.js} +23 -42
- package/dist/esm/stencil.js +4 -4
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-9adee165.entry.js +9 -0
- package/dist/stencil/p-NrtFvKER.js +1 -0
- package/dist/stencil/{p-69298b5f.entry.js → p-fb32cd8f.entry.js} +1 -1
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/viewport.class.d.ts +8 -0
- package/dist/types/classes/tools/base-tool.class.d.ts +3 -0
- package/dist/types/classes/tools/brush-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/eraser-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/image-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/line-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/selection-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/shape-tool.class.d.ts +1 -0
- package/dist/types/classes/tools/text-tool.class.d.ts +1 -0
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +2 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +16 -0
- package/dist/types/components/ui/kritzel-context-menu/kritzel-context-menu.d.ts +1 -0
- package/dist/types/components.d.ts +26 -14
- package/dist/types/configs/default-asset-storage.config.d.ts +1 -1
- package/dist/types/configs/default-sync.config.d.ts +1 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/theme.interface.d.ts +8 -3
- package/dist/types/interfaces/tool-config.interface.d.ts +3 -6
- package/dist/types/interfaces/tool-type.interface.d.ts +1 -0
- package/dist/types/interfaces/tool.interface.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-C0wFAtT_.js +0 -1
- package/dist/components/p-CWgI1dA0.js +0 -1
- package/dist/components/p-DH-H7om7.js +0 -1
- package/dist/components/p-DIiGd0LS.js +0 -1
- package/dist/components/p-DLh8x1jK.js +0 -9
- package/dist/components/p-Dqjil3Hm.js +0 -1
- package/dist/components/p-IiG44Unz.js +0 -1
- package/dist/components/p-K7ySy791.js +0 -1
- package/dist/stencil/p-0c95e585.entry.js +0 -9
- package/dist/stencil/p-BcT1vV4J.js +0 -1
- /package/dist/components/{p-BWj1eE2b.js → p-B43upypT.js} +0 -0
- /package/dist/stencil/{p-D9HaikfQ.js → p-Dhio9uis.js} +0 -0
|
@@ -194,15 +194,7 @@ export class KritzelEditor {
|
|
|
194
194
|
/** The element to use as the target for the cursor. Defaults to the editor container if not set. */
|
|
195
195
|
cursorTarget;
|
|
196
196
|
/** Optional login configuration. When provided, a "Sign in" button is shown that opens a login dialog with the configured providers. */
|
|
197
|
-
loginConfig
|
|
198
|
-
providers: [
|
|
199
|
-
{
|
|
200
|
-
label: 'Sign in with Google',
|
|
201
|
-
icon: 'google',
|
|
202
|
-
name: 'Google',
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
};
|
|
197
|
+
loginConfig;
|
|
206
198
|
/** Whether the editor is in a loading state. When true, a loading overlay is displayed. */
|
|
207
199
|
isLoading = false;
|
|
208
200
|
/** Optional unique identifier for namespacing storage keys across multiple editor instances. */
|
|
@@ -331,12 +323,18 @@ export class KritzelEditor {
|
|
|
331
323
|
async centerObjectInViewport(object) {
|
|
332
324
|
return this.engineRef.centerObjectInViewport(object);
|
|
333
325
|
}
|
|
326
|
+
async panToObject(object) {
|
|
327
|
+
return this.engineRef.panToObject(object);
|
|
328
|
+
}
|
|
334
329
|
async backToContent() {
|
|
335
330
|
return this.engineRef.backToContent();
|
|
336
331
|
}
|
|
337
332
|
async centerAllObjects(animate = true) {
|
|
338
333
|
return this.engineRef.centerAllObjects(animate);
|
|
339
334
|
}
|
|
335
|
+
async centerObjects(objects, animate = true) {
|
|
336
|
+
return this.engineRef.centerObjects(objects, animate);
|
|
337
|
+
}
|
|
340
338
|
async setViewport(x, y, scale) {
|
|
341
339
|
return this.engineRef.setViewport(x, y, scale);
|
|
342
340
|
}
|
|
@@ -790,31 +788,31 @@ export class KritzelEditor {
|
|
|
790
788
|
const isLoggedIn = this.isLoggedIn;
|
|
791
789
|
const shouldShowCurrentUser = isLoggedIn;
|
|
792
790
|
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
793
|
-
return (h(Host, { key: '
|
|
791
|
+
return (h(Host, { key: '673bfb4d2d5224c3c3a11bada8afb1c3b90aa03d', style: {
|
|
794
792
|
opacity: this.isEditorVisible ? '1' : '0',
|
|
795
793
|
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
796
794
|
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
797
|
-
} }, h("div", { key: '
|
|
795
|
+
} }, h("div", { key: 'cee9075de7a44953b3d017c334b19151ab7bb926', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'a7a6c246dabe3ddbab3d807a9f0c275bc621363f', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: 'b5452a22f7fd434b8816bdaa117d457b2f1879f3', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), h("kritzel-engine", { key: 'a08648ec91f678724171238735b1073ffb53ca73', ref: el => {
|
|
798
796
|
if (el) {
|
|
799
797
|
this.engineRef = el;
|
|
800
798
|
}
|
|
801
|
-
}, 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, wheelEnabled: this.wheelEnabled, theme: this.theme, themes: this.themes, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), h("kritzel-controls", { key: '
|
|
799
|
+
}, 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, wheelEnabled: this.wheelEnabled, theme: this.theme, themes: this.themes, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), h("kritzel-controls", { key: 'a7b78a31bda3fe2fe1def6be339894b83ea3ee38', visible: this.isControlsVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
|
|
802
800
|
if (el) {
|
|
803
801
|
this.controlsRef = el;
|
|
804
802
|
}
|
|
805
|
-
}, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: '
|
|
803
|
+
}, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: '0b3f4879c44864661a5bf5f126da3a869fa808f5', class: "top-right-buttons" }, h("kritzel-settings", { key: '7da7fb709f2e4a31a6df1f7382a91f4d78dc6e35', ref: el => {
|
|
806
804
|
if (el) {
|
|
807
805
|
this.settingsRef = el;
|
|
808
806
|
}
|
|
809
|
-
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '
|
|
807
|
+
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: 'f362b0181231da30efc927cbebd818a9a64991b0', ref: el => {
|
|
810
808
|
if (el) {
|
|
811
809
|
this.exportRef = el;
|
|
812
810
|
}
|
|
813
|
-
}, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '
|
|
811
|
+
}, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '1cf065fed9b27ffb19a3695425c797a3bc29fa51', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: '7d6e8e227f36164daed7303645bdd490b362b4d0', user: this.user }), shouldShowLoginButton && (h("kritzel-button", { key: '1dcf1f5ae547f4c2c5b7ec88b34bcad0a2a4da28', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in")), h("kritzel-more-menu", { key: 'cb80dea4bb9861b6d627399c9aad64075cb8944b', items: this.moreMenuItems, visible: this.isMoreMenuVisible }), h("kritzel-share-dialog", { key: 'd12bc96d7af23941e4e054dadfddcf6429de6208', ref: el => {
|
|
814
812
|
if (el) {
|
|
815
813
|
this.shareDialogRef = el;
|
|
816
814
|
}
|
|
817
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '
|
|
815
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '6c29a13069cd74972e94bbc245f26375fa95f4cc', ref: el => {
|
|
818
816
|
if (el) {
|
|
819
817
|
this.loginDialogRef = el;
|
|
820
818
|
}
|
|
@@ -851,7 +849,7 @@ export class KritzelEditor {
|
|
|
851
849
|
"setter": false,
|
|
852
850
|
"reflect": false,
|
|
853
851
|
"attribute": "scale-max",
|
|
854
|
-
"defaultValue": "
|
|
852
|
+
"defaultValue": "1000"
|
|
855
853
|
},
|
|
856
854
|
"scaleMin": {
|
|
857
855
|
"type": "number",
|
|
@@ -871,7 +869,7 @@ export class KritzelEditor {
|
|
|
871
869
|
"setter": false,
|
|
872
870
|
"reflect": false,
|
|
873
871
|
"attribute": "scale-min",
|
|
874
|
-
"defaultValue": "
|
|
872
|
+
"defaultValue": "0.0001"
|
|
875
873
|
},
|
|
876
874
|
"lockDrawingScale": {
|
|
877
875
|
"type": "boolean",
|
|
@@ -1338,7 +1336,7 @@ export class KritzelEditor {
|
|
|
1338
1336
|
},
|
|
1339
1337
|
"getter": false,
|
|
1340
1338
|
"setter": false,
|
|
1341
|
-
"defaultValue": "
|
|
1339
|
+
"defaultValue": "{\n providers: [],\n}"
|
|
1342
1340
|
},
|
|
1343
1341
|
"assetStorageConfig": {
|
|
1344
1342
|
"type": "unknown",
|
|
@@ -1363,7 +1361,7 @@ export class KritzelEditor {
|
|
|
1363
1361
|
},
|
|
1364
1362
|
"getter": false,
|
|
1365
1363
|
"setter": false,
|
|
1366
|
-
"defaultValue": "
|
|
1364
|
+
"defaultValue": "{\n providers: [],\n}"
|
|
1367
1365
|
},
|
|
1368
1366
|
"cursorTarget": {
|
|
1369
1367
|
"type": "unknown",
|
|
@@ -1409,8 +1407,7 @@ export class KritzelEditor {
|
|
|
1409
1407
|
"text": "Optional login configuration. When provided, a \"Sign in\" button is shown that opens a login dialog with the configured providers."
|
|
1410
1408
|
},
|
|
1411
1409
|
"getter": false,
|
|
1412
|
-
"setter": false
|
|
1413
|
-
"defaultValue": "{\n providers: [\n {\n label: 'Sign in with Google',\n icon: 'google',\n name: 'Google',\n },\n ],\n }"
|
|
1410
|
+
"setter": false
|
|
1414
1411
|
},
|
|
1415
1412
|
"isLoading": {
|
|
1416
1413
|
"type": "boolean",
|
|
@@ -2094,6 +2091,33 @@ export class KritzelEditor {
|
|
|
2094
2091
|
"tags": []
|
|
2095
2092
|
}
|
|
2096
2093
|
},
|
|
2094
|
+
"panToObject": {
|
|
2095
|
+
"complexType": {
|
|
2096
|
+
"signature": "(object: KritzelBaseObject) => Promise<void>",
|
|
2097
|
+
"parameters": [{
|
|
2098
|
+
"name": "object",
|
|
2099
|
+
"type": "KritzelBaseObject<HTMLElement | SVGElement>",
|
|
2100
|
+
"docs": ""
|
|
2101
|
+
}],
|
|
2102
|
+
"references": {
|
|
2103
|
+
"Promise": {
|
|
2104
|
+
"location": "global",
|
|
2105
|
+
"id": "global::Promise"
|
|
2106
|
+
},
|
|
2107
|
+
"KritzelBaseObject": {
|
|
2108
|
+
"location": "import",
|
|
2109
|
+
"path": "../../../classes/objects/base-object.class",
|
|
2110
|
+
"id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
|
|
2111
|
+
"referenceLocation": "KritzelBaseObject"
|
|
2112
|
+
}
|
|
2113
|
+
},
|
|
2114
|
+
"return": "Promise<void>"
|
|
2115
|
+
},
|
|
2116
|
+
"docs": {
|
|
2117
|
+
"text": "",
|
|
2118
|
+
"tags": []
|
|
2119
|
+
}
|
|
2120
|
+
},
|
|
2097
2121
|
"backToContent": {
|
|
2098
2122
|
"complexType": {
|
|
2099
2123
|
"signature": "() => Promise<boolean>",
|
|
@@ -2132,6 +2156,37 @@ export class KritzelEditor {
|
|
|
2132
2156
|
"tags": []
|
|
2133
2157
|
}
|
|
2134
2158
|
},
|
|
2159
|
+
"centerObjects": {
|
|
2160
|
+
"complexType": {
|
|
2161
|
+
"signature": "(objects: KritzelBaseObject[], animate?: boolean) => Promise<boolean>",
|
|
2162
|
+
"parameters": [{
|
|
2163
|
+
"name": "objects",
|
|
2164
|
+
"type": "KritzelBaseObject<HTMLElement | SVGElement>[]",
|
|
2165
|
+
"docs": ""
|
|
2166
|
+
}, {
|
|
2167
|
+
"name": "animate",
|
|
2168
|
+
"type": "boolean",
|
|
2169
|
+
"docs": ""
|
|
2170
|
+
}],
|
|
2171
|
+
"references": {
|
|
2172
|
+
"Promise": {
|
|
2173
|
+
"location": "global",
|
|
2174
|
+
"id": "global::Promise"
|
|
2175
|
+
},
|
|
2176
|
+
"KritzelBaseObject": {
|
|
2177
|
+
"location": "import",
|
|
2178
|
+
"path": "../../../classes/objects/base-object.class",
|
|
2179
|
+
"id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
|
|
2180
|
+
"referenceLocation": "KritzelBaseObject"
|
|
2181
|
+
}
|
|
2182
|
+
},
|
|
2183
|
+
"return": "Promise<boolean>"
|
|
2184
|
+
},
|
|
2185
|
+
"docs": {
|
|
2186
|
+
"text": "",
|
|
2187
|
+
"tags": []
|
|
2188
|
+
}
|
|
2189
|
+
},
|
|
2135
2190
|
"setViewport": {
|
|
2136
2191
|
"complexType": {
|
|
2137
2192
|
"signature": "(x: number, y: number, scale: number) => Promise<void>",
|
|
@@ -93,8 +93,18 @@ export class KritzelEngine {
|
|
|
93
93
|
}
|
|
94
94
|
/** Context menu items shown when right-clicking the canvas background. */
|
|
95
95
|
globalContextMenuItems;
|
|
96
|
+
onGlobalContextMenuItemsChange(newValue) {
|
|
97
|
+
if (this.contextMenuHandler) {
|
|
98
|
+
this.contextMenuHandler.globalContextMenuItems = newValue ?? [];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
96
101
|
/** Context menu items shown when right-clicking a selected object. */
|
|
97
102
|
objectContextMenuItems;
|
|
103
|
+
onObjectContextMenuItemsChange(newValue) {
|
|
104
|
+
if (this.contextMenuHandler) {
|
|
105
|
+
this.contextMenuHandler.objectContextMenuItems = newValue ?? [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
98
108
|
/** Maximum zoom scale allowed. Clamped to the absolute maximum defined by the engine. */
|
|
99
109
|
scaleMax = ABSOLUTE_SCALE_MAX;
|
|
100
110
|
validateScaleMax(newValue) {
|
|
@@ -819,6 +829,14 @@ export class KritzelEngine {
|
|
|
819
829
|
this.core.rerender();
|
|
820
830
|
return object;
|
|
821
831
|
}
|
|
832
|
+
/**
|
|
833
|
+
* Pans the viewport to center on the given object without changing the zoom level.
|
|
834
|
+
* Unlike `centerObjectInViewport`, this moves the camera — not the object.
|
|
835
|
+
* @param object - The object whose center the viewport should pan to.
|
|
836
|
+
*/
|
|
837
|
+
async panToObject(object) {
|
|
838
|
+
this.viewport.panTo(object.centerX, object.centerY);
|
|
839
|
+
}
|
|
822
840
|
/**
|
|
823
841
|
* Pans and zooms the viewport to fit the nearest content, with padding.
|
|
824
842
|
* Useful when the user has panned away from all objects.
|
|
@@ -836,6 +854,16 @@ export class KritzelEngine {
|
|
|
836
854
|
async centerAllObjects(animate = true) {
|
|
837
855
|
return this.viewport.centerFitAllObjects(animate);
|
|
838
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Pans and zooms the viewport to fit the provided objects.
|
|
859
|
+
* Calculates the combined bounding box of the given objects and centers the viewport to show them.
|
|
860
|
+
* @param objects - The objects to center and fit in the viewport.
|
|
861
|
+
* @param animate - Whether to animate the viewport transition (default: true).
|
|
862
|
+
* @returns `true` if objects were provided and the viewport was adjusted, `false` otherwise.
|
|
863
|
+
*/
|
|
864
|
+
async centerObjects(objects, animate = true) {
|
|
865
|
+
return this.viewport.centerFitObjects(objects, animate);
|
|
866
|
+
}
|
|
839
867
|
/**
|
|
840
868
|
* Sets the viewport to center on the given world coordinates at the specified scale.
|
|
841
869
|
* @param x - X position in world coordinates to center on.
|
|
@@ -2442,7 +2470,7 @@ export class KritzelEngine {
|
|
|
2442
2470
|
"setter": false,
|
|
2443
2471
|
"reflect": false,
|
|
2444
2472
|
"attribute": "scale-max",
|
|
2445
|
-
"defaultValue": "
|
|
2473
|
+
"defaultValue": "1000"
|
|
2446
2474
|
},
|
|
2447
2475
|
"scaleMin": {
|
|
2448
2476
|
"type": "number",
|
|
@@ -2462,7 +2490,7 @@ export class KritzelEngine {
|
|
|
2462
2490
|
"setter": false,
|
|
2463
2491
|
"reflect": false,
|
|
2464
2492
|
"attribute": "scale-min",
|
|
2465
|
-
"defaultValue": "
|
|
2493
|
+
"defaultValue": "0.0001"
|
|
2466
2494
|
},
|
|
2467
2495
|
"cursorTarget": {
|
|
2468
2496
|
"type": "unknown",
|
|
@@ -4077,6 +4105,36 @@ export class KritzelEngine {
|
|
|
4077
4105
|
}]
|
|
4078
4106
|
}
|
|
4079
4107
|
},
|
|
4108
|
+
"panToObject": {
|
|
4109
|
+
"complexType": {
|
|
4110
|
+
"signature": "(object: KritzelBaseObject) => Promise<void>",
|
|
4111
|
+
"parameters": [{
|
|
4112
|
+
"name": "object",
|
|
4113
|
+
"type": "KritzelBaseObject<HTMLElement | SVGElement>",
|
|
4114
|
+
"docs": "- The object whose center the viewport should pan to."
|
|
4115
|
+
}],
|
|
4116
|
+
"references": {
|
|
4117
|
+
"Promise": {
|
|
4118
|
+
"location": "global",
|
|
4119
|
+
"id": "global::Promise"
|
|
4120
|
+
},
|
|
4121
|
+
"KritzelBaseObject": {
|
|
4122
|
+
"location": "import",
|
|
4123
|
+
"path": "../../../classes/objects/base-object.class",
|
|
4124
|
+
"id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
|
|
4125
|
+
"referenceLocation": "KritzelBaseObject"
|
|
4126
|
+
}
|
|
4127
|
+
},
|
|
4128
|
+
"return": "Promise<void>"
|
|
4129
|
+
},
|
|
4130
|
+
"docs": {
|
|
4131
|
+
"text": "Pans the viewport to center on the given object without changing the zoom level.\nUnlike `centerObjectInViewport`, this moves the camera \u2014 not the object.",
|
|
4132
|
+
"tags": [{
|
|
4133
|
+
"name": "param",
|
|
4134
|
+
"text": "object - The object whose center the viewport should pan to."
|
|
4135
|
+
}]
|
|
4136
|
+
}
|
|
4137
|
+
},
|
|
4080
4138
|
"backToContent": {
|
|
4081
4139
|
"complexType": {
|
|
4082
4140
|
"signature": "() => Promise<boolean>",
|
|
@@ -4124,6 +4182,46 @@ export class KritzelEngine {
|
|
|
4124
4182
|
}]
|
|
4125
4183
|
}
|
|
4126
4184
|
},
|
|
4185
|
+
"centerObjects": {
|
|
4186
|
+
"complexType": {
|
|
4187
|
+
"signature": "(objects: KritzelBaseObject[], animate?: boolean) => Promise<boolean>",
|
|
4188
|
+
"parameters": [{
|
|
4189
|
+
"name": "objects",
|
|
4190
|
+
"type": "KritzelBaseObject<HTMLElement | SVGElement>[]",
|
|
4191
|
+
"docs": "- The objects to center and fit in the viewport."
|
|
4192
|
+
}, {
|
|
4193
|
+
"name": "animate",
|
|
4194
|
+
"type": "boolean",
|
|
4195
|
+
"docs": "- Whether to animate the viewport transition (default: true)."
|
|
4196
|
+
}],
|
|
4197
|
+
"references": {
|
|
4198
|
+
"Promise": {
|
|
4199
|
+
"location": "global",
|
|
4200
|
+
"id": "global::Promise"
|
|
4201
|
+
},
|
|
4202
|
+
"KritzelBaseObject": {
|
|
4203
|
+
"location": "import",
|
|
4204
|
+
"path": "../../../classes/objects/base-object.class",
|
|
4205
|
+
"id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
|
|
4206
|
+
"referenceLocation": "KritzelBaseObject"
|
|
4207
|
+
}
|
|
4208
|
+
},
|
|
4209
|
+
"return": "Promise<boolean>"
|
|
4210
|
+
},
|
|
4211
|
+
"docs": {
|
|
4212
|
+
"text": "Pans and zooms the viewport to fit the provided objects.\nCalculates the combined bounding box of the given objects and centers the viewport to show them.",
|
|
4213
|
+
"tags": [{
|
|
4214
|
+
"name": "param",
|
|
4215
|
+
"text": "objects - The objects to center and fit in the viewport."
|
|
4216
|
+
}, {
|
|
4217
|
+
"name": "param",
|
|
4218
|
+
"text": "animate - Whether to animate the viewport transition (default: true)."
|
|
4219
|
+
}, {
|
|
4220
|
+
"name": "returns",
|
|
4221
|
+
"text": "`true` if objects were provided and the viewport was adjusted, `false` otherwise."
|
|
4222
|
+
}]
|
|
4223
|
+
}
|
|
4224
|
+
},
|
|
4127
4225
|
"setViewport": {
|
|
4128
4226
|
"complexType": {
|
|
4129
4227
|
"signature": "(x: number, y: number, scale: number) => Promise<void>",
|
|
@@ -4976,6 +5074,12 @@ export class KritzelEngine {
|
|
|
4976
5074
|
}, {
|
|
4977
5075
|
"propName": "user",
|
|
4978
5076
|
"methodName": "onUserChange"
|
|
5077
|
+
}, {
|
|
5078
|
+
"propName": "globalContextMenuItems",
|
|
5079
|
+
"methodName": "onGlobalContextMenuItemsChange"
|
|
5080
|
+
}, {
|
|
5081
|
+
"propName": "objectContextMenuItems",
|
|
5082
|
+
"methodName": "onObjectContextMenuItemsChange"
|
|
4979
5083
|
}, {
|
|
4980
5084
|
"propName": "scaleMax",
|
|
4981
5085
|
"methodName": "validateScaleMax"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
border: 1px solid var(--kritzel-dropdown-border-color, #ebebeb);
|
|
12
|
-
border-radius: 6px;
|
|
12
|
+
border-radius: var(--kritzel-dropdown-border-radius, 6px);
|
|
13
13
|
overflow: visible;
|
|
14
14
|
height: 38px;
|
|
15
15
|
width: 100%;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
37
37
|
box-sizing: border-box;
|
|
38
|
-
border-radius: 6px;
|
|
38
|
+
border-radius: var(--kritzel-dropdown-border-radius, 6px);
|
|
39
39
|
border: none;
|
|
40
40
|
background-color: var(--kritzel-dropdown-background, #ffffff);
|
|
41
41
|
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
list-style: none;
|
|
104
104
|
background-color: var(--kritzel-dropdown-background, #ffffff);
|
|
105
105
|
border: 1px solid var(--kritzel-global-border-color, #ebebeb);
|
|
106
|
-
border-radius: 6px;
|
|
106
|
+
border-radius: var(--kritzel-dropdown-menu-border-radius, var(--kritzel-dropdown-border-radius, 6px));
|
|
107
107
|
box-shadow: var(--kritzel-controls-box-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
|
|
108
108
|
z-index: 1000;
|
|
109
109
|
max-height: 240px;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
border: 1px solid var(--kritzel-text-input-border-color, #ebebeb);
|
|
21
|
-
border-radius: 6px;
|
|
21
|
+
border-radius: var(--kritzel-text-input-border-radius, 6px);
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
background: var(--kritzel-text-input-background, #ffffff);
|
|
24
24
|
transition: border-color 150ms ease;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
flex: 1;
|
|
24
24
|
padding: 8px 36px 8px 12px;
|
|
25
25
|
border: 1px solid var(--kritzel-numeric-input-border-color, #ebebeb);
|
|
26
|
-
border-radius: 6px;
|
|
26
|
+
border-radius: var(--kritzel-numeric-input-border-radius, 6px);
|
|
27
27
|
font-size: 14px;
|
|
28
28
|
color: var(--kritzel-numeric-input-text-color, #333333);
|
|
29
29
|
background-color: var(--kritzel-numeric-input-input-background, #ffffff);
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: column;
|
|
68
68
|
border-left: 1px solid var(--kritzel-numeric-input-border-color, #ebebeb);
|
|
69
|
-
border-radius: 0 5px 5px 0;
|
|
69
|
+
border-radius: 0 var(--kritzel-numeric-input-spinner-border-radius, 5px) var(--kritzel-numeric-input-spinner-border-radius, 5px) 0;
|
|
70
70
|
overflow: hidden;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.menu-container {
|
|
6
|
+
position: relative;
|
|
7
|
+
z-index: 1;
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
10
|
gap: var(--kritzel-context-menu-item-spacing, 2px);
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
white-space: nowrap;
|
|
34
36
|
-webkit-tap-highlight-color: transparent;
|
|
35
37
|
width: 100%;
|
|
38
|
+
min-width: 0;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.menu-item:not(.disabled):hover,
|
|
@@ -68,6 +71,9 @@
|
|
|
68
71
|
|
|
69
72
|
.label {
|
|
70
73
|
flex-grow: 1;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
.submenu-arrow {
|
|
@@ -85,6 +91,7 @@
|
|
|
85
91
|
position: absolute;
|
|
86
92
|
top: 0;
|
|
87
93
|
left: 100%;
|
|
94
|
+
z-index: 2;
|
|
88
95
|
margin-left: 4px;
|
|
89
96
|
display: flex;
|
|
90
97
|
flex-direction: column;
|
|
@@ -113,6 +113,11 @@ export class KritzelContextMenu {
|
|
|
113
113
|
const idx = path.lastIndexOf('.');
|
|
114
114
|
return idx === -1 ? '' : path.substring(0, idx);
|
|
115
115
|
}
|
|
116
|
+
getMenuDepth(path) {
|
|
117
|
+
if (!path)
|
|
118
|
+
return 0;
|
|
119
|
+
return path.split('.').length;
|
|
120
|
+
}
|
|
116
121
|
pruneStaleRefs() {
|
|
117
122
|
const openPaths = new Set(this.getOpenSubmenuPaths());
|
|
118
123
|
for (const key of Array.from(this.submenuRefs.keys())) {
|
|
@@ -224,7 +229,8 @@ export class KritzelContextMenu {
|
|
|
224
229
|
}
|
|
225
230
|
renderSubmenu(processedChildren, path) {
|
|
226
231
|
const position = this.submenuPositions[path] === 'left' ? 'left' : 'right';
|
|
227
|
-
|
|
232
|
+
const zIndex = this.getMenuDepth(path) + 1;
|
|
233
|
+
return (h("div", { class: { 'submenu-container': true, 'position-left': position === 'left' }, key: `submenu-${path}`, style: { zIndex: String(zIndex) }, ref: el => el && this.submenuRefs.set(path, el), onMouseEnter: () => this.handleSubmenuMouseEnter(), onMouseLeave: () => this.handleSubmenuMouseLeave(path) }, this.renderItems(processedChildren, path)));
|
|
228
234
|
}
|
|
229
235
|
render() {
|
|
230
236
|
if (!this.processedItems || this.processedItems.length === 0) {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
background-color: var(--kritzel-global-primary-color, #007AFF);
|
|
42
42
|
color: var(--kritzel-global-primary-text-color, #fff);
|
|
43
43
|
border: none;
|
|
44
|
-
border-radius: 8px;
|
|
44
|
+
border-radius: var(--kritzel-button-border-radius, 8px);
|
|
45
45
|
font-size: 14px;
|
|
46
46
|
font-weight: 600;
|
|
47
47
|
cursor: pointer;
|
|
@@ -237,7 +237,7 @@ export class KritzelToolConfig {
|
|
|
237
237
|
"mutable": true,
|
|
238
238
|
"complexType": {
|
|
239
239
|
"original": "ConfigurableTool",
|
|
240
|
-
"resolved": "
|
|
240
|
+
"resolved": "KritzelBaseTool",
|
|
241
241
|
"references": {
|
|
242
242
|
"ConfigurableTool": {
|
|
243
243
|
"location": "import",
|
|
@@ -348,7 +348,7 @@ export class KritzelToolConfig {
|
|
|
348
348
|
},
|
|
349
349
|
"complexType": {
|
|
350
350
|
"original": "ConfigurableTool",
|
|
351
|
-
"resolved": "
|
|
351
|
+
"resolved": "KritzelBaseTool",
|
|
352
352
|
"references": {
|
|
353
353
|
"ConfigurableTool": {
|
|
354
354
|
"location": "import",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IndexedDBAssetProvider } from "../classes/providers/assets/indexeddb-asset-provider.class";
|
|
2
1
|
/**
|
|
3
2
|
* Default asset storage configuration. Stores bytes in IndexedDB only,
|
|
4
3
|
* which provides offline-friendly behavior out of the box. Applications
|
|
@@ -6,5 +5,5 @@ import { IndexedDBAssetProvider } from "../classes/providers/assets/indexeddb-as
|
|
|
6
5
|
* (e.g. HttpAssetProvider) so images are available across devices.
|
|
7
6
|
*/
|
|
8
7
|
export const DEFAULT_ASSET_STORAGE_CONFIG = {
|
|
9
|
-
providers: [
|
|
8
|
+
providers: [],
|
|
10
9
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { IndexedDBSyncProvider } from "../classes/providers/sync/indexeddb-sync-provider.class";
|
|
2
1
|
/**
|
|
3
|
-
* Default sync configuration -
|
|
2
|
+
* Default sync configuration - None
|
|
4
3
|
*/
|
|
5
4
|
export const DEFAULT_SYNC_CONFIG = {
|
|
6
|
-
providers: [
|
|
7
|
-
IndexedDBSyncProvider
|
|
8
|
-
],
|
|
5
|
+
providers: [],
|
|
9
6
|
};
|