@kritzel/editor 0.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +50 -0
- package/README.md +5 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-B92VHWr4.js +1834 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/kritzel-active-users_46.cjs.entry.js +75271 -0
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +31 -0
- package/dist/cjs/kritzel-editor.cjs.js +25 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/collection/collection-manifest.json +65 -0
- package/dist/collection/components/kritzel-active-users/kritzel-active-users.css +65 -0
- package/dist/collection/components/kritzel-active-users/kritzel-active-users.js +134 -0
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.css +58 -0
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.js +207 -0
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.css +42 -0
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.js +95 -0
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.css +43 -0
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.js +97 -0
- package/dist/collection/components/kritzel-button/kritzel-button.css +73 -0
- package/dist/collection/components/kritzel-button/kritzel-button.js +118 -0
- package/dist/collection/components/kritzel-color/kritzel-color.css +25 -0
- package/dist/collection/components/kritzel-color/kritzel-color.js +149 -0
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.css +46 -0
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.js +225 -0
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.css +112 -0
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.js +368 -0
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.css +11 -0
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.js +109 -0
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -0
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.js +169 -0
- package/dist/collection/components/kritzel-dialog/kritzel-dialog.css +209 -0
- package/dist/collection/components/kritzel-dialog/kritzel-dialog.js +787 -0
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.css +190 -0
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.js +418 -0
- package/dist/collection/components/kritzel-editor/kritzel-editor.css +161 -0
- package/dist/collection/components/kritzel-editor/kritzel-editor.js +4678 -0
- package/dist/collection/components/kritzel-export/kritzel-export.css +89 -0
- package/dist/collection/components/kritzel-export/kritzel-export.js +246 -0
- package/dist/collection/components/kritzel-font/kritzel-font.css +10 -0
- package/dist/collection/components/kritzel-font/kritzel-font.js +89 -0
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.css +48 -0
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.js +122 -0
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.css +30 -0
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.js +117 -0
- package/dist/collection/components/kritzel-input/kritzel-input.css +69 -0
- package/dist/collection/components/kritzel-input/kritzel-input.js +198 -0
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.css +60 -0
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.js +165 -0
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.css +54 -0
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.js +70 -0
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.css +98 -0
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.js +239 -0
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.css +190 -0
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.js +201 -0
- package/dist/collection/components/kritzel-menu/kritzel-menu.css +34 -0
- package/dist/collection/components/kritzel-menu/kritzel-menu.js +297 -0
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.css +167 -0
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.js +298 -0
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.css +58 -0
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.js +381 -0
- package/dist/collection/components/kritzel-notification-card/kritzel-notification-card.css +101 -0
- package/dist/collection/components/kritzel-notification-card/kritzel-notification-card.js +173 -0
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.css +102 -0
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.js +255 -0
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -0
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.js +164 -0
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -0
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.js +135 -0
- package/dist/collection/components/kritzel-portal/kritzel-portal.js +432 -0
- package/dist/collection/components/kritzel-settings/kritzel-settings.css +137 -0
- package/dist/collection/components/kritzel-settings/kritzel-settings.js +448 -0
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.css +47 -0
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.js +93 -0
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.css +150 -0
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.js +308 -0
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -0
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.js +119 -0
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.css +78 -0
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.js +433 -0
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.css +37 -0
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.js +89 -0
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.css +38 -0
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.js +467 -0
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.css +348 -0
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.js +588 -0
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.css +18 -0
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.js +388 -0
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.css +46 -0
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.js +146 -0
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -0
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.js +365 -0
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -0
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.js +173 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +121 -0
- package/dist/components/index.js +48 -0
- package/dist/components/kritzel-active-users.d.ts +11 -0
- package/dist/components/kritzel-active-users.js +6 -0
- package/dist/components/kritzel-avatar.d.ts +11 -0
- package/dist/components/kritzel-avatar.js +6 -0
- package/dist/components/kritzel-awareness-cursors.js +6 -0
- package/dist/components/kritzel-back-to-content.d.ts +11 -0
- package/dist/components/kritzel-back-to-content.js +6 -0
- package/dist/components/kritzel-brush-style.d.ts +11 -0
- package/dist/components/kritzel-brush-style.js +64 -0
- package/dist/components/kritzel-button.d.ts +11 -0
- package/dist/components/kritzel-button.js +6 -0
- package/dist/components/kritzel-color-palette.d.ts +11 -0
- package/dist/components/kritzel-color-palette.js +6 -0
- package/dist/components/kritzel-color.d.ts +11 -0
- package/dist/components/kritzel-color.js +6 -0
- package/dist/components/kritzel-context-menu.d.ts +11 -0
- package/dist/components/kritzel-context-menu.js +6 -0
- package/dist/components/kritzel-current-user-dialog.d.ts +11 -0
- package/dist/components/kritzel-current-user-dialog.js +6 -0
- package/dist/components/kritzel-current-user.d.ts +11 -0
- package/dist/components/kritzel-current-user.js +6 -0
- package/dist/components/kritzel-cursor-trail.js +6 -0
- package/dist/components/kritzel-dialog.d.ts +11 -0
- package/dist/components/kritzel-dialog.js +6 -0
- package/dist/components/kritzel-dropdown.d.ts +11 -0
- package/dist/components/kritzel-dropdown.js +6 -0
- package/dist/components/kritzel-editor.d.ts +11 -0
- package/dist/components/kritzel-editor.js +1792 -0
- package/dist/components/kritzel-engine.js +6 -0
- package/dist/components/kritzel-export.d.ts +11 -0
- package/dist/components/kritzel-export.js +6 -0
- package/dist/components/kritzel-font-family.d.ts +11 -0
- package/dist/components/kritzel-font-family.js +6 -0
- package/dist/components/kritzel-font-size.d.ts +11 -0
- package/dist/components/kritzel-font-size.js +6 -0
- package/dist/components/kritzel-font.d.ts +11 -0
- package/dist/components/kritzel-font.js +6 -0
- package/dist/components/kritzel-icon.js +6 -0
- package/dist/components/kritzel-input.d.ts +11 -0
- package/dist/components/kritzel-input.js +6 -0
- package/dist/components/kritzel-line-endings.d.ts +11 -0
- package/dist/components/kritzel-line-endings.js +6 -0
- package/dist/components/kritzel-loading-overlay.d.ts +11 -0
- package/dist/components/kritzel-loading-overlay.js +6 -0
- package/dist/components/kritzel-login-dialog.d.ts +11 -0
- package/dist/components/kritzel-login-dialog.js +6 -0
- package/dist/components/kritzel-master-detail.d.ts +11 -0
- package/dist/components/kritzel-master-detail.js +6 -0
- package/dist/components/kritzel-menu-item.d.ts +11 -0
- package/dist/components/kritzel-menu-item.js +6 -0
- package/dist/components/kritzel-menu.d.ts +11 -0
- package/dist/components/kritzel-menu.js +6 -0
- package/dist/components/kritzel-more-menu.d.ts +11 -0
- package/dist/components/kritzel-more-menu.js +6 -0
- package/dist/components/kritzel-notification-card.d.ts +11 -0
- package/dist/components/kritzel-notification-card.js +6 -0
- package/dist/components/kritzel-numeric-input.d.ts +11 -0
- package/dist/components/kritzel-numeric-input.js +6 -0
- package/dist/components/kritzel-opacity-slider.d.ts +11 -0
- package/dist/components/kritzel-opacity-slider.js +6 -0
- package/dist/components/kritzel-pill-tabs.d.ts +11 -0
- package/dist/components/kritzel-pill-tabs.js +6 -0
- package/dist/components/kritzel-portal.d.ts +11 -0
- package/dist/components/kritzel-portal.js +6 -0
- package/dist/components/kritzel-settings.d.ts +11 -0
- package/dist/components/kritzel-settings.js +6 -0
- package/dist/components/kritzel-shape-fill.d.ts +11 -0
- package/dist/components/kritzel-shape-fill.js +6 -0
- package/dist/components/kritzel-share-dialog.d.ts +11 -0
- package/dist/components/kritzel-share-dialog.js +6 -0
- package/dist/components/kritzel-slide-toggle.d.ts +11 -0
- package/dist/components/kritzel-slide-toggle.js +6 -0
- package/dist/components/kritzel-split-button.d.ts +11 -0
- package/dist/components/kritzel-split-button.js +6 -0
- package/dist/components/kritzel-stroke-size.d.ts +11 -0
- package/dist/components/kritzel-stroke-size.js +6 -0
- package/dist/components/kritzel-tool-config.d.ts +11 -0
- package/dist/components/kritzel-tool-config.js +6 -0
- package/dist/components/kritzel-toolbar.d.ts +11 -0
- package/dist/components/kritzel-toolbar.js +6 -0
- package/dist/components/kritzel-tooltip.d.ts +11 -0
- package/dist/components/kritzel-tooltip.js +6 -0
- package/dist/components/kritzel-utility-panel.d.ts +11 -0
- package/dist/components/kritzel-utility-panel.js +6 -0
- package/dist/components/kritzel-watermark.js +6 -0
- package/dist/components/kritzel-workspace-manager.d.ts +11 -0
- package/dist/components/kritzel-workspace-manager.js +6 -0
- package/dist/components/kritzel-zoom-panel.d.ts +11 -0
- package/dist/components/kritzel-zoom-panel.js +6 -0
- package/dist/components/p-4-qLegHb.js +142 -0
- package/dist/components/p-5qkOM1RJ.js +1557 -0
- package/dist/components/p-B3Tqoyl9.js +43 -0
- package/dist/components/p-B5xYV1o3.js +77 -0
- package/dist/components/p-B6UJztrf.js +290 -0
- package/dist/components/p-BDjRSoAc.js +43 -0
- package/dist/components/p-BFTU3MAI.js +7 -0
- package/dist/components/p-BGmTmdLe.js +167 -0
- package/dist/components/p-BN8VWPlq.js +164 -0
- package/dist/components/p-BZ_KnHdR.js +222 -0
- package/dist/components/p-B_gT0lCn.js +94 -0
- package/dist/components/p-BfMlwIcG.js +62 -0
- package/dist/components/p-BjFrt1q0.js +62 -0
- package/dist/components/p-Blq9a1ni.js +3267 -0
- package/dist/components/p-BrGJIoGK.js +52 -0
- package/dist/components/p-BvG3JO85.js +56 -0
- package/dist/components/p-CS3YZVYE.js +319 -0
- package/dist/components/p-CVxGF4bJ.js +150 -0
- package/dist/components/p-Ckqh1tqY.js +468 -0
- package/dist/components/p-ClfOtiNp.js +84 -0
- package/dist/components/p-CmjXRLdr.js +220 -0
- package/dist/components/p-CoNexfpB.js +106 -0
- package/dist/components/p-Cp4e4oTE.js +122 -0
- package/dist/components/p-CrIEmItB.js +85 -0
- package/dist/components/p-CvaxFYS0.js +304 -0
- package/dist/components/p-CwBxnzYu.js +57 -0
- package/dist/components/p-Cy_cLtOP.js +3456 -0
- package/dist/components/p-CzUeIini.js +381 -0
- package/dist/components/p-D0tPTPkR.js +99 -0
- package/dist/components/p-DJxgPPfs.js +194 -0
- package/dist/components/p-DOJCDPVD.js +55 -0
- package/dist/components/p-DVv8ChhE.js +91 -0
- package/dist/components/p-DXZBWJBt.js +70 -0
- package/dist/components/p-DXuf225S.js +53 -0
- package/dist/components/p-DZsSiMnA.js +63037 -0
- package/dist/components/p-DqOC_Yck.js +112 -0
- package/dist/components/p-Ds0uNtwQ.js +97 -0
- package/dist/components/p-DyRJFg4w.js +57 -0
- package/dist/components/p-GbCxpbQ6.js +88 -0
- package/dist/components/p-McY5wZ0h.js +135 -0
- package/dist/components/p-QEue33R5.js +70 -0
- package/dist/components/p-R1D8Sr0l.js +299 -0
- package/dist/components/p-SLnqczCS.js +49 -0
- package/dist/components/p-hQwVRh0t.js +147 -0
- package/dist/components/p-h_uh_Njf.js +63 -0
- package/dist/components/p-kOINnzaR.js +161 -0
- package/dist/components/p-peZjvnkK.js +486 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-OjbYJz-P.js +1807 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/kritzel-active-users_46.entry.js +75224 -0
- package/dist/esm/kritzel-brush-style.entry.js +29 -0
- package/dist/esm/kritzel-editor.js +21 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/kritzel-editor/index.esm.js +1 -0
- package/dist/kritzel-editor/kritzel-editor.esm.js +21 -0
- package/dist/kritzel-editor/p-501047d8.entry.js +29 -0
- package/dist/kritzel-editor/p-60319edb.entry.js +75224 -0
- package/dist/kritzel-editor/p-DQuL1Twl.js +3 -0
- package/dist/kritzel-editor/p-OjbYJz-P.js +1790 -0
- package/dist/types/components/kritzel-active-users/kritzel-active-users.d.ts +21 -0
- package/dist/types/components/kritzel-avatar/kritzel-avatar.d.ts +27 -0
- package/dist/types/components/kritzel-back-to-content/kritzel-back-to-content.d.ts +17 -0
- package/dist/types/components/kritzel-brush-style/kritzel-brush-style.d.ts +11 -0
- package/dist/types/components/kritzel-button/kritzel-button.d.ts +13 -0
- package/dist/types/components/kritzel-color/kritzel-color.d.ts +10 -0
- package/dist/types/components/kritzel-color-palette/kritzel-color-palette.d.ts +17 -0
- package/dist/types/components/kritzel-context-menu/kritzel-context-menu.d.ts +40 -0
- package/dist/types/components/kritzel-current-user/kritzel-current-user.d.ts +15 -0
- package/dist/types/components/kritzel-current-user-dialog/kritzel-current-user-dialog.d.ts +18 -0
- package/dist/types/components/kritzel-dialog/kritzel-dialog.d.ts +85 -0
- package/dist/types/components/kritzel-dropdown/kritzel-dropdown.d.ts +48 -0
- package/dist/types/components/kritzel-editor/kritzel-editor.d.ts +356 -0
- package/dist/types/components/kritzel-export/kritzel-export.d.ts +35 -0
- package/dist/types/components/kritzel-font/kritzel-font.d.ts +6 -0
- package/dist/types/components/kritzel-font-family/kritzel-font-family.d.ts +17 -0
- package/dist/types/components/kritzel-font-size/kritzel-font-size.d.ts +10 -0
- package/dist/types/components/kritzel-input/kritzel-input.d.ts +22 -0
- package/dist/types/components/kritzel-line-endings/kritzel-line-endings.d.ts +21 -0
- package/dist/types/components/kritzel-loading-overlay/kritzel-loading-overlay.d.ts +11 -0
- package/dist/types/components/kritzel-login-dialog/kritzel-login-dialog.d.ts +32 -0
- package/dist/types/components/kritzel-master-detail/kritzel-master-detail.d.ts +25 -0
- package/dist/types/components/kritzel-menu/kritzel-menu.d.ts +25 -0
- package/dist/types/components/kritzel-menu-item/kritzel-menu-item.d.ts +28 -0
- package/dist/types/components/kritzel-more-menu/kritzel-more-menu.d.ts +55 -0
- package/dist/types/components/kritzel-notification-card/kritzel-notification-card.d.ts +22 -0
- package/dist/types/components/kritzel-numeric-input/kritzel-numeric-input.d.ts +32 -0
- package/dist/types/components/kritzel-opacity-slider/kritzel-opacity-slider.d.ts +17 -0
- package/dist/types/components/kritzel-pill-tabs/kritzel-pill-tabs.d.ts +26 -0
- package/dist/types/components/kritzel-portal/kritzel-portal.d.ts +33 -0
- package/dist/types/components/kritzel-settings/kritzel-settings.d.ts +64 -0
- package/dist/types/components/kritzel-shape-fill/kritzel-shape-fill.d.ts +10 -0
- package/dist/types/components/kritzel-share-dialog/kritzel-share-dialog.d.ts +49 -0
- package/dist/types/components/kritzel-slide-toggle/kritzel-slide-toggle.d.ts +14 -0
- package/dist/types/components/kritzel-split-button/kritzel-split-button.d.ts +38 -0
- package/dist/types/components/kritzel-stroke-size/kritzel-stroke-size.d.ts +8 -0
- package/dist/types/components/kritzel-tool-config/kritzel-tool-config.d.ts +39 -0
- package/dist/types/components/kritzel-toolbar/kritzel-toolbar.d.ts +76 -0
- package/dist/types/components/kritzel-tooltip/kritzel-tooltip.d.ts +30 -0
- package/dist/types/components/kritzel-utility-panel/kritzel-utility-panel.d.ts +14 -0
- package/dist/types/components/kritzel-workspace-manager/kritzel-workspace-manager.d.ts +40 -0
- package/dist/types/components/kritzel-zoom-panel/kritzel-zoom-panel.d.ts +20 -0
- package/dist/types/components.d.ts +3166 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +1873 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +83 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { KRITZEL_VERSION } from "@kritzel/engine";
|
|
3
|
+
import { CURRENT_APP_STATE_SCHEMA_VERSION, CURRENT_WORKSPACE_SCHEMA_VERSION } from "@kritzel/engine";
|
|
4
|
+
const DEFAULT_SCALE_MIN = 0.0001;
|
|
5
|
+
const DEFAULT_SCALE_MAX = 1000;
|
|
6
|
+
const DEFAULT_LOCK_DRAWING_SCALE = true;
|
|
7
|
+
const DEFAULT_VIEWPORT_BOUNDARY_LEFT = -Infinity;
|
|
8
|
+
const DEFAULT_VIEWPORT_BOUNDARY_RIGHT = Infinity;
|
|
9
|
+
const DEFAULT_VIEWPORT_BOUNDARY_TOP = -Infinity;
|
|
10
|
+
const DEFAULT_VIEWPORT_BOUNDARY_BOTTOM = Infinity;
|
|
11
|
+
const DEFAULT_DEBUG_INFO = {
|
|
12
|
+
showViewportInfo: false,
|
|
13
|
+
showObjectInfo: false,
|
|
14
|
+
showSyncProviderInfo: true,
|
|
15
|
+
showMigrationInfo: true,
|
|
16
|
+
showAssetResolverInfo: false,
|
|
17
|
+
};
|
|
18
|
+
const SETTINGS_CATEGORY_IDS = ['general', 'viewport', 'shortcuts', 'developer', 'about'];
|
|
19
|
+
export class KritzelSettings {
|
|
20
|
+
host;
|
|
21
|
+
/** Keyboard shortcuts to display in the settings dialog */
|
|
22
|
+
availableThemes = ['light', 'dark'];
|
|
23
|
+
/** Available locales as `{ code, label }` options for the language selector. */
|
|
24
|
+
availableLocales = [];
|
|
25
|
+
shortcuts = [];
|
|
26
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
27
|
+
terms = {};
|
|
28
|
+
/** Current settings values. Used to initialize and sync the component's internal state. */
|
|
29
|
+
settings;
|
|
30
|
+
onSettingsPropChange(newSettings) {
|
|
31
|
+
if (newSettings) {
|
|
32
|
+
this.applySettings(newSettings);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
isDialogOpen = false;
|
|
36
|
+
selectedCategoryId = SETTINGS_CATEGORY_IDS[0];
|
|
37
|
+
scaleMin = DEFAULT_SCALE_MIN;
|
|
38
|
+
scaleMax = DEFAULT_SCALE_MAX;
|
|
39
|
+
lockDrawingScale = DEFAULT_LOCK_DRAWING_SCALE;
|
|
40
|
+
theme = 'light';
|
|
41
|
+
locale = 'en';
|
|
42
|
+
viewportBoundaryLeft = DEFAULT_VIEWPORT_BOUNDARY_LEFT;
|
|
43
|
+
viewportBoundaryRight = DEFAULT_VIEWPORT_BOUNDARY_RIGHT;
|
|
44
|
+
viewportBoundaryTop = DEFAULT_VIEWPORT_BOUNDARY_TOP;
|
|
45
|
+
viewportBoundaryBottom = DEFAULT_VIEWPORT_BOUNDARY_BOTTOM;
|
|
46
|
+
debugInfo = { ...DEFAULT_DEBUG_INFO };
|
|
47
|
+
/** Emitted when settings change */
|
|
48
|
+
settingsChange;
|
|
49
|
+
componentWillLoad() {
|
|
50
|
+
if (this.settings) {
|
|
51
|
+
this.applySettings(this.settings);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
applySettings(settings) {
|
|
55
|
+
if (typeof settings.scaleMin === 'number') {
|
|
56
|
+
this.scaleMin = settings.scaleMin;
|
|
57
|
+
}
|
|
58
|
+
if (typeof settings.scaleMax === 'number') {
|
|
59
|
+
this.scaleMax = settings.scaleMax;
|
|
60
|
+
}
|
|
61
|
+
if (typeof settings.lockDrawingScale === 'boolean') {
|
|
62
|
+
this.lockDrawingScale = settings.lockDrawingScale;
|
|
63
|
+
}
|
|
64
|
+
if (typeof settings.theme === 'string') {
|
|
65
|
+
this.theme = settings.theme;
|
|
66
|
+
}
|
|
67
|
+
if (typeof settings.locale === 'string') {
|
|
68
|
+
this.locale = settings.locale;
|
|
69
|
+
}
|
|
70
|
+
if (typeof settings.viewportBoundaryLeft === 'number') {
|
|
71
|
+
this.viewportBoundaryLeft = settings.viewportBoundaryLeft;
|
|
72
|
+
}
|
|
73
|
+
if (typeof settings.viewportBoundaryRight === 'number') {
|
|
74
|
+
this.viewportBoundaryRight = settings.viewportBoundaryRight;
|
|
75
|
+
}
|
|
76
|
+
if (typeof settings.viewportBoundaryTop === 'number') {
|
|
77
|
+
this.viewportBoundaryTop = settings.viewportBoundaryTop;
|
|
78
|
+
}
|
|
79
|
+
if (typeof settings.viewportBoundaryBottom === 'number') {
|
|
80
|
+
this.viewportBoundaryBottom = settings.viewportBoundaryBottom;
|
|
81
|
+
}
|
|
82
|
+
if (settings.debugInfo) {
|
|
83
|
+
this.debugInfo = { ...DEFAULT_DEBUG_INFO, ...settings.debugInfo };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
emitSettings() {
|
|
87
|
+
const settings = {
|
|
88
|
+
scaleMin: this.scaleMin,
|
|
89
|
+
scaleMax: this.scaleMax,
|
|
90
|
+
lockDrawingScale: this.lockDrawingScale,
|
|
91
|
+
theme: this.theme,
|
|
92
|
+
locale: this.locale,
|
|
93
|
+
viewportBoundaryLeft: this.viewportBoundaryLeft,
|
|
94
|
+
viewportBoundaryRight: this.viewportBoundaryRight,
|
|
95
|
+
viewportBoundaryTop: this.viewportBoundaryTop,
|
|
96
|
+
viewportBoundaryBottom: this.viewportBoundaryBottom,
|
|
97
|
+
debugInfo: this.debugInfo,
|
|
98
|
+
};
|
|
99
|
+
this.settingsChange.emit(settings);
|
|
100
|
+
}
|
|
101
|
+
handleScaleMinChange = (event) => {
|
|
102
|
+
this.scaleMin = event.detail;
|
|
103
|
+
this.emitSettings();
|
|
104
|
+
};
|
|
105
|
+
handleScaleMaxChange = (event) => {
|
|
106
|
+
this.scaleMax = event.detail;
|
|
107
|
+
this.emitSettings();
|
|
108
|
+
};
|
|
109
|
+
handleLockDrawingScaleChange = (event) => {
|
|
110
|
+
this.lockDrawingScale = event.detail;
|
|
111
|
+
this.emitSettings();
|
|
112
|
+
};
|
|
113
|
+
handleThemeChange = (event) => {
|
|
114
|
+
this.theme = event.detail;
|
|
115
|
+
this.emitSettings();
|
|
116
|
+
};
|
|
117
|
+
handleLocaleChange = (event) => {
|
|
118
|
+
this.locale = event.detail;
|
|
119
|
+
this.emitSettings();
|
|
120
|
+
};
|
|
121
|
+
handleViewportBoundaryLeftChange = (event) => {
|
|
122
|
+
this.viewportBoundaryLeft = event.detail ?? DEFAULT_VIEWPORT_BOUNDARY_LEFT;
|
|
123
|
+
this.emitSettings();
|
|
124
|
+
};
|
|
125
|
+
handleViewportBoundaryRightChange = (event) => {
|
|
126
|
+
this.viewportBoundaryRight = event.detail ?? DEFAULT_VIEWPORT_BOUNDARY_RIGHT;
|
|
127
|
+
this.emitSettings();
|
|
128
|
+
};
|
|
129
|
+
handleViewportBoundaryTopChange = (event) => {
|
|
130
|
+
this.viewportBoundaryTop = event.detail ?? DEFAULT_VIEWPORT_BOUNDARY_TOP;
|
|
131
|
+
this.emitSettings();
|
|
132
|
+
};
|
|
133
|
+
handleViewportBoundaryBottomChange = (event) => {
|
|
134
|
+
this.viewportBoundaryBottom = event.detail ?? DEFAULT_VIEWPORT_BOUNDARY_BOTTOM;
|
|
135
|
+
this.emitSettings();
|
|
136
|
+
};
|
|
137
|
+
handleDebugInfoChange = (key) => (event) => {
|
|
138
|
+
this.debugInfo = { ...this.debugInfo, [key]: event.detail };
|
|
139
|
+
this.emitSettings();
|
|
140
|
+
};
|
|
141
|
+
async open() {
|
|
142
|
+
this.isDialogOpen = true;
|
|
143
|
+
}
|
|
144
|
+
async close() {
|
|
145
|
+
this.closeDialog();
|
|
146
|
+
}
|
|
147
|
+
closeDialog = () => {
|
|
148
|
+
this.isDialogOpen = false;
|
|
149
|
+
};
|
|
150
|
+
handleCategorySelect = (event) => {
|
|
151
|
+
this.selectedCategoryId = event.detail.item.id;
|
|
152
|
+
};
|
|
153
|
+
formatKeyCombo(shortcut) {
|
|
154
|
+
const parts = [];
|
|
155
|
+
if (shortcut.ctrl)
|
|
156
|
+
parts.push('Ctrl');
|
|
157
|
+
if (shortcut.shift)
|
|
158
|
+
parts.push('Shift');
|
|
159
|
+
parts.push(this.formatKey(shortcut.key));
|
|
160
|
+
return parts.join('+');
|
|
161
|
+
}
|
|
162
|
+
formatKey(key) {
|
|
163
|
+
const keyMap = {
|
|
164
|
+
'Escape': 'Esc',
|
|
165
|
+
'Delete': 'Del',
|
|
166
|
+
' ': 'Space',
|
|
167
|
+
};
|
|
168
|
+
return keyMap[key] ?? key.toUpperCase();
|
|
169
|
+
}
|
|
170
|
+
groupShortcutsByCategory() {
|
|
171
|
+
const grouped = new Map();
|
|
172
|
+
for (const shortcut of this.shortcuts) {
|
|
173
|
+
const existing = grouped.get(shortcut.category) || [];
|
|
174
|
+
existing.push(shortcut);
|
|
175
|
+
grouped.set(shortcut.category, existing);
|
|
176
|
+
}
|
|
177
|
+
return grouped;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Resolves a localized string from the supplied {@link terms} map, falling
|
|
181
|
+
* back to the provided English default when the key is missing.
|
|
182
|
+
*/
|
|
183
|
+
t(key, fallback) {
|
|
184
|
+
return this.terms[key] ?? fallback;
|
|
185
|
+
}
|
|
186
|
+
get categories() {
|
|
187
|
+
const icons = {
|
|
188
|
+
general: 'settings',
|
|
189
|
+
viewport: 'viewport',
|
|
190
|
+
shortcuts: 'command',
|
|
191
|
+
developer: 'braces',
|
|
192
|
+
about: 'info',
|
|
193
|
+
};
|
|
194
|
+
const labels = {
|
|
195
|
+
general: { key: 'settings.categories.general', fallback: 'General' },
|
|
196
|
+
viewport: { key: 'settings.categories.viewport', fallback: 'Viewport' },
|
|
197
|
+
shortcuts: { key: 'settings.categories.shortcuts', fallback: 'Keyboard Shortcuts' },
|
|
198
|
+
developer: { key: 'settings.categories.developer', fallback: 'Developer Options' },
|
|
199
|
+
about: { key: 'settings.categories.about', fallback: 'About' },
|
|
200
|
+
};
|
|
201
|
+
return SETTINGS_CATEGORY_IDS.map(id => ({
|
|
202
|
+
id,
|
|
203
|
+
label: this.t(labels[id].key, labels[id].fallback),
|
|
204
|
+
icon: icons[id],
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
renderCategoryContent() {
|
|
208
|
+
return (h("div", { class: "settings-categories-wrapper" }, h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'general' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.general.title', 'General Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.theme.label', 'Theme')), h("p", { class: "settings-description" }, this.t('settings.general.theme.description', 'Select a registered color theme for the editor interface.')), h("kritzel-dropdown", { options: this.availableThemes.map(t => ({ value: t, label: t })), value: this.theme, onValueChanged: this.handleThemeChange })), this.availableLocales.length > 0 && (h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.language.label', 'Language')), h("p", { class: "settings-description" }, this.t('settings.general.language.description', 'Select the display language for the editor interface.')), h("kritzel-dropdown", { options: this.availableLocales.map(l => ({ value: l.code, label: l.label })), value: this.locale, onValueChanged: this.handleLocaleChange }))), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale')), h("p", { class: "settings-description" }, this.t('settings.general.lockDrawingScale.description', 'When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.')), h("kritzel-slide-toggle", { checked: this.lockDrawingScale, label: this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale'), onCheckedChange: this.handleLockDrawingScaleChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'viewport' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.viewport.title', 'Viewport Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.minZoom.label', 'Minimum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.minZoom.description', 'Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.')), h("kritzel-numeric-input", { value: this.scaleMin, min: 0.0001, max: 1, step: 0.0001, onValueChange: this.handleScaleMinChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.maxZoom.label', 'Maximum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.maxZoom.description', 'Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.')), h("kritzel-numeric-input", { value: this.scaleMax, min: 1, max: 1000, step: 1, onValueChange: this.handleScaleMaxChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryLeft.label', 'Viewport Boundary Left')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryLeft.description', 'Left boundary in world coordinates. Set to limit how far left the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryLeft, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryLeftChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryRight.label', 'Viewport Boundary Right')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryRight.description', 'Right boundary in world coordinates. Set to limit how far right the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryRight, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryRightChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryTop.label', 'Viewport Boundary Top')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryTop.description', 'Top boundary in world coordinates. Set to limit how far up the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryTop, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryTopChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryBottom.label', 'Viewport Boundary Bottom')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryBottom.description', 'Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryBottom, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryBottomChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'shortcuts' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.shortcuts.title', 'Keyboard Shortcuts')), h("div", { class: "shortcuts-list" }, Array.from(this.groupShortcutsByCategory()).map(([category, shortcuts]) => (h("div", { class: "shortcuts-category", key: category }, h("h4", { class: "shortcuts-category-title" }, category), h("div", { class: "shortcuts-group" }, shortcuts.map(shortcut => (h("div", { class: "shortcut-item", key: shortcut.key + shortcut.label }, h("span", { class: "shortcut-label" }, shortcut.label), h("kbd", { class: "shortcut-key" }, this.formatKeyCombo(shortcut)))))))))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'developer' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.developer.title', 'Developer Options')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showViewportInfo.description', 'Display viewport debug information such as position, zoom level, and boundaries.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showViewportInfo, label: this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info'), onCheckedChange: this.handleDebugInfoChange('showViewportInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showObjectInfo.label', 'Show Object Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showObjectInfo.description', 'Display debug information about objects on the canvas.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showObjectInfo, label: this.t('settings.developer.showObjectInfo.label', 'Show Object Info'), onCheckedChange: this.handleDebugInfoChange('showObjectInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showSyncProviderInfo.description', 'Display debug information about the sync provider connection status.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showSyncProviderInfo, label: this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info'), onCheckedChange: this.handleDebugInfoChange('showSyncProviderInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showMigrationInfo.description', 'Display debug information about data migrations.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showMigrationInfo, label: this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info'), onCheckedChange: this.handleDebugInfoChange('showMigrationInfo') }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'about' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.about.title', 'About')), h("p", null, this.t('settings.about.description', 'Kritzel - A drawing application')), h("p", { class: "version-info" }, "Version ", KRITZEL_VERSION), h("p", { class: "version-info" }, "App-State Schema v", CURRENT_APP_STATE_SCHEMA_VERSION), h("p", { class: "version-info" }, "Workspace Schema v", CURRENT_WORKSPACE_SCHEMA_VERSION)))));
|
|
209
|
+
}
|
|
210
|
+
render() {
|
|
211
|
+
return (h(Host, { key: '0461408163ca90999eef2885be2496264cae94ac' }, h("kritzel-dialog", { key: 'bbeb801a3024887d9e4aff94128f50d15a0a6820', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: 'ee2013cb3e7588b0b25c0f6175e79290de21cf09', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
|
|
212
|
+
}
|
|
213
|
+
static get is() { return "kritzel-settings"; }
|
|
214
|
+
static get encapsulation() { return "shadow"; }
|
|
215
|
+
static get originalStyleUrls() {
|
|
216
|
+
return {
|
|
217
|
+
"$": ["kritzel-settings.css"]
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
static get styleUrls() {
|
|
221
|
+
return {
|
|
222
|
+
"$": ["kritzel-settings.css"]
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
static get properties() {
|
|
226
|
+
return {
|
|
227
|
+
"availableThemes": {
|
|
228
|
+
"type": "unknown",
|
|
229
|
+
"mutable": false,
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "string[]",
|
|
232
|
+
"resolved": "string[]",
|
|
233
|
+
"references": {}
|
|
234
|
+
},
|
|
235
|
+
"required": false,
|
|
236
|
+
"optional": false,
|
|
237
|
+
"docs": {
|
|
238
|
+
"tags": [],
|
|
239
|
+
"text": "Keyboard shortcuts to display in the settings dialog"
|
|
240
|
+
},
|
|
241
|
+
"getter": false,
|
|
242
|
+
"setter": false,
|
|
243
|
+
"defaultValue": "['light', 'dark']"
|
|
244
|
+
},
|
|
245
|
+
"availableLocales": {
|
|
246
|
+
"type": "unknown",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "{ code: LocaleCode; label: string }[]",
|
|
250
|
+
"resolved": "{ code: LocaleCode; label: string; }[]",
|
|
251
|
+
"references": {
|
|
252
|
+
"LocaleCode": {
|
|
253
|
+
"location": "import",
|
|
254
|
+
"path": "@kritzel/engine",
|
|
255
|
+
"id": "../../engine/core/dist/types/index.d.ts::LocaleCode",
|
|
256
|
+
"referenceLocation": "LocaleCode"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"required": false,
|
|
261
|
+
"optional": false,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": "Available locales as `{ code, label }` options for the language selector."
|
|
265
|
+
},
|
|
266
|
+
"getter": false,
|
|
267
|
+
"setter": false,
|
|
268
|
+
"defaultValue": "[]"
|
|
269
|
+
},
|
|
270
|
+
"shortcuts": {
|
|
271
|
+
"type": "unknown",
|
|
272
|
+
"mutable": false,
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "Omit<KritzelShortcut, 'action' | 'condition'>[]",
|
|
275
|
+
"resolved": "Omit<KritzelShortcut, \"action\" | \"condition\">[]",
|
|
276
|
+
"references": {
|
|
277
|
+
"Omit": {
|
|
278
|
+
"location": "global",
|
|
279
|
+
"id": "global::Omit"
|
|
280
|
+
},
|
|
281
|
+
"KritzelShortcut": {
|
|
282
|
+
"location": "import",
|
|
283
|
+
"path": "@kritzel/engine",
|
|
284
|
+
"id": "../../engine/core/dist/types/index.d.ts::KritzelShortcut",
|
|
285
|
+
"referenceLocation": "KritzelShortcut"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": ""
|
|
294
|
+
},
|
|
295
|
+
"getter": false,
|
|
296
|
+
"setter": false,
|
|
297
|
+
"defaultValue": "[]"
|
|
298
|
+
},
|
|
299
|
+
"terms": {
|
|
300
|
+
"type": "unknown",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "Partial<Record<KritzelTermKey, string>>",
|
|
304
|
+
"resolved": "\"backToContent.label\" | \"currentUser.dialogTitle\" | \"editor.loading\" | \"export.dialogTitle\" | \"export.exportButton\" | \"export.filename.label\" | \"export.filename.placeholder\" | \"export.format.label\" | \"export.tabs.viewport\" | \"export.tabs.workspace\" | \"login.dialogTitle\" | \"menu.align\" | \"menu.alignBottom\" | \"menu.alignCenterHorizontal\" | \"menu.alignCenterVertical\" | \"menu.alignLeft\" | \"menu.alignRight\" | \"menu.alignTop\" | \"menu.bringToFront\" | \"menu.copy\" | \"menu.cut\" | \"menu.delete\" | \"menu.export\" | \"menu.exportAsPng\" | \"menu.exportAsSvg\" | \"menu.group\" | \"menu.import\" | \"menu.logout\" | \"menu.moveDown\" | \"menu.moveUp\" | \"menu.order\" | \"menu.paste\" | \"menu.selectAll\" | \"menu.sendToBack\" | \"menu.settings\" | \"menu.share\" | \"menu.ungroup\" | \"moreMenu.ariaLabel\" | \"settings.about.description\" | \"settings.about.title\" | \"settings.categories.about\" | \"settings.categories.developer\" | \"settings.categories.general\" | \"settings.categories.shortcuts\" | \"settings.categories.viewport\" | \"settings.developer.showMigrationInfo.description\" | \"settings.developer.showMigrationInfo.label\" | \"settings.developer.showObjectInfo.description\" | \"settings.developer.showObjectInfo.label\" | \"settings.developer.showSyncProviderInfo.description\" | \"settings.developer.showSyncProviderInfo.label\" | \"settings.developer.showViewportInfo.description\" | \"settings.developer.showViewportInfo.label\" | \"settings.developer.title\" | \"settings.dialogTitle\" | \"settings.general.language.description\" | \"settings.general.language.label\" | \"settings.general.lockDrawingScale.description\" | \"settings.general.lockDrawingScale.label\" | \"settings.general.theme.description\" | \"settings.general.theme.label\" | \"settings.general.title\" | \"settings.shortcuts.title\" | \"settings.viewport.boundaryBottom.description\" | \"settings.viewport.boundaryBottom.label\" | \"settings.viewport.boundaryLeft.description\" | \"settings.viewport.boundaryLeft.label\" | \"settings.viewport.boundaryPlaceholder\" | \"settings.viewport.boundaryRight.description\" | \"settings.viewport.boundaryRight.label\" | \"settings.viewport.boundaryTop.description\" | \"settings.viewport.boundaryTop.label\" | \"settings.viewport.maxZoom.description\" | \"settings.viewport.maxZoom.label\" | \"settings.viewport.minZoom.description\" | \"settings.viewport.minZoom.label\" | \"settings.viewport.title\" | \"share.copyLink.copied\" | \"share.copyLink.title\" | \"share.dialogTitle\" | \"share.linkSharing.disabledDescription\" | \"share.linkSharing.enabledDescription\" | \"share.linkSharing.label\" | \"share.linkSharing.toggleLabel\" | \"toolConfig.collapse\" | \"toolConfig.expand\" | \"utility.delete\" | \"utility.redo\" | \"utility.undo\" | \"watermark.poweredBy\" | \"workspace.delete\" | \"workspace.rename\" | \"workspace.sharedTooltip\" | \"zoom.zoomIn\" | \"zoom.zoomOut\" | string",
|
|
305
|
+
"references": {
|
|
306
|
+
"Partial": {
|
|
307
|
+
"location": "global",
|
|
308
|
+
"id": "global::Partial"
|
|
309
|
+
},
|
|
310
|
+
"Record": {
|
|
311
|
+
"location": "global",
|
|
312
|
+
"id": "global::Record"
|
|
313
|
+
},
|
|
314
|
+
"KritzelTermKey": {
|
|
315
|
+
"location": "import",
|
|
316
|
+
"path": "@kritzel/engine",
|
|
317
|
+
"id": "../../engine/core/dist/types/index.d.ts::KritzelTermKey",
|
|
318
|
+
"referenceLocation": "KritzelTermKey"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": false,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "Resolved localized strings keyed by term key, supplied by the editor."
|
|
327
|
+
},
|
|
328
|
+
"getter": false,
|
|
329
|
+
"setter": false,
|
|
330
|
+
"defaultValue": "{}"
|
|
331
|
+
},
|
|
332
|
+
"settings": {
|
|
333
|
+
"type": "unknown",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "Partial<KritzelSettingsConfig>",
|
|
337
|
+
"resolved": "KritzelSettingsConfig",
|
|
338
|
+
"references": {
|
|
339
|
+
"Partial": {
|
|
340
|
+
"location": "global",
|
|
341
|
+
"id": "global::Partial"
|
|
342
|
+
},
|
|
343
|
+
"KritzelSettingsConfig": {
|
|
344
|
+
"location": "import",
|
|
345
|
+
"path": "@kritzel/engine",
|
|
346
|
+
"id": "../../engine/core/dist/types/index.d.ts::KritzelSettingsConfig",
|
|
347
|
+
"referenceLocation": "KritzelSettingsConfig"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": true,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": "Current settings values. Used to initialize and sync the component's internal state."
|
|
356
|
+
},
|
|
357
|
+
"getter": false,
|
|
358
|
+
"setter": false
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
static get states() {
|
|
363
|
+
return {
|
|
364
|
+
"isDialogOpen": {},
|
|
365
|
+
"selectedCategoryId": {},
|
|
366
|
+
"scaleMin": {},
|
|
367
|
+
"scaleMax": {},
|
|
368
|
+
"lockDrawingScale": {},
|
|
369
|
+
"theme": {},
|
|
370
|
+
"locale": {},
|
|
371
|
+
"viewportBoundaryLeft": {},
|
|
372
|
+
"viewportBoundaryRight": {},
|
|
373
|
+
"viewportBoundaryTop": {},
|
|
374
|
+
"viewportBoundaryBottom": {},
|
|
375
|
+
"debugInfo": {}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
static get events() {
|
|
379
|
+
return [{
|
|
380
|
+
"method": "settingsChange",
|
|
381
|
+
"name": "settingsChange",
|
|
382
|
+
"bubbles": true,
|
|
383
|
+
"cancelable": true,
|
|
384
|
+
"composed": true,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [],
|
|
387
|
+
"text": "Emitted when settings change"
|
|
388
|
+
},
|
|
389
|
+
"complexType": {
|
|
390
|
+
"original": "KritzelSettingsConfig",
|
|
391
|
+
"resolved": "KritzelSettingsConfig",
|
|
392
|
+
"references": {
|
|
393
|
+
"KritzelSettingsConfig": {
|
|
394
|
+
"location": "import",
|
|
395
|
+
"path": "@kritzel/engine",
|
|
396
|
+
"id": "../../engine/core/dist/types/index.d.ts::KritzelSettingsConfig",
|
|
397
|
+
"referenceLocation": "KritzelSettingsConfig"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}];
|
|
402
|
+
}
|
|
403
|
+
static get methods() {
|
|
404
|
+
return {
|
|
405
|
+
"open": {
|
|
406
|
+
"complexType": {
|
|
407
|
+
"signature": "() => Promise<void>",
|
|
408
|
+
"parameters": [],
|
|
409
|
+
"references": {
|
|
410
|
+
"Promise": {
|
|
411
|
+
"location": "global",
|
|
412
|
+
"id": "global::Promise"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"return": "Promise<void>"
|
|
416
|
+
},
|
|
417
|
+
"docs": {
|
|
418
|
+
"text": "",
|
|
419
|
+
"tags": []
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"close": {
|
|
423
|
+
"complexType": {
|
|
424
|
+
"signature": "() => Promise<void>",
|
|
425
|
+
"parameters": [],
|
|
426
|
+
"references": {
|
|
427
|
+
"Promise": {
|
|
428
|
+
"location": "global",
|
|
429
|
+
"id": "global::Promise"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
"return": "Promise<void>"
|
|
433
|
+
},
|
|
434
|
+
"docs": {
|
|
435
|
+
"text": "",
|
|
436
|
+
"tags": []
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
static get elementRef() { return "host"; }
|
|
442
|
+
static get watchers() {
|
|
443
|
+
return [{
|
|
444
|
+
"propName": "settings",
|
|
445
|
+
"methodName": "onSettingsPropChange"
|
|
446
|
+
}];
|
|
447
|
+
}
|
|
448
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
padding: 0;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.fill-row {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.fill-option {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 48px;
|
|
20
|
+
height: 32px;
|
|
21
|
+
border-radius: 6px;
|
|
22
|
+
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
23
|
+
border: 2px solid transparent;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
background: var(--kritzel-shape-fill-option-background, #ffffff);
|
|
26
|
+
padding: 4px;
|
|
27
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.fill-option:hover {
|
|
31
|
+
background-color: var(--kritzel-shape-fill-hover-background-color, #ebebeb);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.fill-option.selected {
|
|
35
|
+
border-color: var(--kritzel-selection-border-color, #007AFF);
|
|
36
|
+
background-color: var(--kritzel-shape-fill-selected-background-color, #ebebeb);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.fill-option:focus {
|
|
40
|
+
outline: none;
|
|
41
|
+
box-shadow: 0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.fill-icon {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class KritzelShapeFill {
|
|
3
|
+
/** Current fill type */
|
|
4
|
+
value = 'transparent';
|
|
5
|
+
valueChange;
|
|
6
|
+
handleFillChange(type) {
|
|
7
|
+
this.value = type;
|
|
8
|
+
this.valueChange.emit(type);
|
|
9
|
+
}
|
|
10
|
+
renderFillIcon(type) {
|
|
11
|
+
const strokeColor = 'var(--kritzel-global-text-primary)';
|
|
12
|
+
if (type === 'transparent') {
|
|
13
|
+
return (h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: "none", stroke: strokeColor, "stroke-width": "2" })));
|
|
14
|
+
}
|
|
15
|
+
// Filled
|
|
16
|
+
return (h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: strokeColor, stroke: strokeColor, "stroke-width": "2" })));
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, { key: 'ec214708dd4210e0c36734cb81fba76849114f9b' }, h("div", { key: 'd64bacdb7c50b31f3c460bdf2e939b4159d4d000', class: "fill-row" }, h("button", { key: '812735be08265145a13ab116e7153fd684f8b77f', class: {
|
|
20
|
+
'fill-option': true,
|
|
21
|
+
'selected': this.value === 'transparent',
|
|
22
|
+
}, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), h("button", { key: 'cb5caf2db8aece4bef2eebca37e7ac36383bb450', class: {
|
|
23
|
+
'fill-option': true,
|
|
24
|
+
'selected': this.value === 'filled',
|
|
25
|
+
}, onClick: () => this.handleFillChange('filled'), title: "Filled background" }, this.renderFillIcon('filled')))));
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "kritzel-shape-fill"; }
|
|
28
|
+
static get encapsulation() { return "shadow"; }
|
|
29
|
+
static get originalStyleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["kritzel-shape-fill.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get styleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["kritzel-shape-fill.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get properties() {
|
|
40
|
+
return {
|
|
41
|
+
"value": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": true,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "ShapeFillType",
|
|
46
|
+
"resolved": "\"filled\" | \"transparent\"",
|
|
47
|
+
"references": {
|
|
48
|
+
"ShapeFillType": {
|
|
49
|
+
"location": "local",
|
|
50
|
+
"path": "C:/Projects/kritzel/libs/editor/core/src/components/kritzel-shape-fill/kritzel-shape-fill.tsx",
|
|
51
|
+
"id": "src/components/kritzel-shape-fill/kritzel-shape-fill.tsx::ShapeFillType"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": "Current fill type"
|
|
60
|
+
},
|
|
61
|
+
"getter": false,
|
|
62
|
+
"setter": false,
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"attribute": "value",
|
|
65
|
+
"defaultValue": "'transparent'"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static get events() {
|
|
70
|
+
return [{
|
|
71
|
+
"method": "valueChange",
|
|
72
|
+
"name": "valueChange",
|
|
73
|
+
"bubbles": true,
|
|
74
|
+
"cancelable": true,
|
|
75
|
+
"composed": true,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": ""
|
|
79
|
+
},
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "ShapeFillType",
|
|
82
|
+
"resolved": "\"filled\" | \"transparent\"",
|
|
83
|
+
"references": {
|
|
84
|
+
"ShapeFillType": {
|
|
85
|
+
"location": "local",
|
|
86
|
+
"path": "C:/Projects/kritzel/libs/editor/core/src/components/kritzel-shape-fill/kritzel-shape-fill.tsx",
|
|
87
|
+
"id": "src/components/kritzel-shape-fill/kritzel-shape-fill.tsx::ShapeFillType"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
}
|