kritzel-stencil 0.3.16 → 0.3.17
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/dist/cjs/index-Xav9JFHg.js +2 -2
- package/dist/cjs/index.cjs.js +7 -1
- package/dist/cjs/{kritzel-active-users_42.cjs.entry.js → kritzel-active-users_44.cjs.entry.js} +710 -145
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-DJQTjcy7.js → schema.constants-DrHO_CYF.js} +1169 -171
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/core.class.js +24 -0
- package/dist/collection/classes/handlers/context-menu.handler.js +24 -2
- package/dist/collection/classes/managers/license.manager.js +285 -0
- package/dist/collection/classes/managers/localization.manager.js +189 -0
- package/dist/collection/classes/objects/custom-element.class.js +2 -0
- package/dist/collection/classes/objects/group.class.js +7 -2
- package/dist/collection/classes/objects/image.class.js +10 -7
- package/dist/collection/classes/objects/line.class.js +3 -0
- package/dist/collection/classes/objects/path.class.js +13 -12
- package/dist/collection/classes/objects/selection-group.class.js +7 -2
- package/dist/collection/classes/objects/shape.class.js +3 -0
- package/dist/collection/classes/objects/text.class.js +4 -1
- package/dist/collection/classes/registries/icon-registry.class.js +1 -0
- package/dist/collection/classes/tools/brush-tool.class.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +16 -0
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +462 -60
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +446 -16
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.css +29 -0
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +83 -0
- 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 +2 -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 +2 -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 +41 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +36 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +36 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +44 -7
- 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 +36 -1
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +108 -14
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +38 -3
- package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.js +38 -3
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +36 -1
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js +38 -3
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -0
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +173 -0
- package/dist/collection/constants/engine.constants.js +2 -0
- package/dist/collection/constants/license.constants.js +25 -0
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/localization.helper.js +25 -0
- package/dist/collection/helpers/math.helper.js +3 -0
- package/dist/collection/helpers/svg-export.helper.js +223 -26
- package/dist/collection/index.js +13 -0
- package/dist/collection/interfaces/localization.interface.js +1 -0
- package/dist/collection/locales/de-locale.js +119 -0
- package/dist/collection/locales/en-locale.js +120 -0
- package/dist/collection/locales/fr-locale.js +119 -0
- package/dist/collection/themes/dark-theme.js +18 -0
- package/dist/collection/themes/light-theme.js +18 -0
- package/dist/components/index.d.ts +4 -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-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-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-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-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-watermark.d.ts +11 -0
- package/dist/components/kritzel-watermark.js +1 -0
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.d.ts +11 -0
- package/dist/components/kritzel-zoom-panel.js +1 -0
- package/dist/components/{p-B5xxfwKF.js → p-3HxnBrCM.js} +1 -1
- package/dist/components/p-6RjeGuvH.js +1 -0
- package/dist/components/p-7NsK0uHu.js +1 -0
- package/dist/components/{p-dcAernE1.js → p-BCNyR5Sw.js} +1 -1
- package/dist/components/{p-C2SX-XRr.js → p-BG6hOSrm.js} +1 -1
- package/dist/components/p-BKJSh8qQ.js +1 -0
- package/dist/components/{p-SptaSMno.js → p-BKvHg9cv.js} +1 -1
- package/dist/components/p-Bc55X65h.js +1 -0
- package/dist/components/p-BpnIvNvq.js +1 -0
- package/dist/components/p-BvRrA4hN.js +1 -0
- package/dist/components/{p-B2w8X7vn.js → p-BxpKq94F.js} +1 -1
- package/dist/components/{p-BFoK4W--.js → p-Bzv9Px8v.js} +1 -1
- package/dist/components/{p-COLHjboZ.js → p-C9HGoDHE.js} +1 -1
- package/dist/components/p-CEnEDaix.js +1 -0
- package/dist/components/p-CIcLzcfA.js +1 -0
- package/dist/components/p-CPtDfadX.js +1 -0
- package/dist/components/p-C_fKgKHu.js +9 -0
- package/dist/components/p-CdR76C4L.js +1 -0
- package/dist/components/p-Cu9KYyoq.js +1 -0
- package/dist/components/p-CyqRcqsO.js +1 -0
- package/dist/components/{p-UoPj5QjH.js → p-DDkmsPpV.js} +1 -1
- package/dist/components/{p-D-sRVAbQ.js → p-DI4vQRE3.js} +1 -1
- package/dist/components/{p-CJOhfMU5.js → p-DNdXJp8F.js} +1 -1
- package/dist/components/p-DX5K8xnh.js +1 -0
- package/dist/components/{p-DEy7zJCe.js → p-DZdgXCAx.js} +1 -1
- package/dist/components/p-DdH1cKED.js +1 -0
- package/dist/components/p-DdsSSqFY.js +1 -0
- package/dist/components/p-DgmtCdnL.js +1 -0
- package/dist/components/{p-BzYU3-MJ.js → p-DmWSRsjK.js} +1 -1
- package/dist/components/{p-Bj2laX89.js → p-Dz-Ti24X.js} +1 -1
- package/dist/components/{p-BiG1dxPS.js → p-F5_X4dZG.js} +1 -1
- package/dist/components/{p-x6doYeiI.js → p-IpoC5EEY.js} +1 -1
- package/dist/components/p-Jn6TNdfe.js +1 -0
- package/dist/components/{p-BfNHpqQ8.js → p-NuLP1xHe.js} +1 -1
- package/dist/components/{p-skWUIStn.js → p-SDZNC8GF.js} +1 -1
- package/dist/components/{p-BYmp9Ovv.js → p-U4oawa1x.js} +1 -1
- package/dist/components/{p-DM11KXUT.js → p-f8aW1ye7.js} +1 -1
- package/dist/components/p-v7dxxrL5.js +1 -0
- package/dist/components/p-vAeiXe6c.js +1 -0
- package/dist/esm/index-Dhio9uis.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/{kritzel-active-users_42.entry.js → kritzel-active-users_44.entry.js} +709 -146
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{schema.constants-DiCnmIYK.js → schema.constants-DchTXG3V.js} +1163 -172
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-DchTXG3V.js +1 -0
- package/dist/stencil/p-c9a3807b.entry.js +9 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/core/core.class.d.ts +16 -0
- package/dist/types/classes/handlers/context-menu.handler.d.ts +13 -0
- package/dist/types/classes/managers/license.manager.d.ts +141 -0
- package/dist/types/classes/managers/localization.manager.d.ts +121 -0
- package/dist/types/classes/objects/custom-element.class.d.ts +2 -0
- package/dist/types/classes/objects/group.class.d.ts +6 -1
- package/dist/types/classes/objects/image.class.d.ts +1 -1
- package/dist/types/classes/objects/path.class.d.ts +3 -2
- package/dist/types/classes/objects/selection-group.class.d.ts +6 -1
- package/dist/types/classes/objects/shape.class.d.ts +2 -0
- package/dist/types/classes/objects/text.class.d.ts +2 -1
- package/dist/types/classes/tools/brush-tool.class.d.ts +1 -1
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +53 -1
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +55 -3
- package/dist/types/components/core/kritzel-watermark/kritzel-watermark.d.ts +20 -0
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +3 -0
- package/dist/types/components/ui/kritzel-current-user/kritzel-current-user.d.ts +3 -0
- package/dist/types/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.d.ts +3 -0
- package/dist/types/components/ui/kritzel-export/kritzel-export.d.ts +4 -1
- package/dist/types/components/ui/kritzel-more-menu/kritzel-more-menu.d.ts +3 -0
- package/dist/types/components/ui/kritzel-settings/kritzel-settings.d.ts +16 -0
- package/dist/types/components/ui/kritzel-share-dialog/kritzel-share-dialog.d.ts +3 -0
- package/dist/types/components/ui/kritzel-tool-config/kritzel-tool-config.d.ts +3 -0
- package/dist/types/components/ui/kritzel-utility-panel/kritzel-utility-panel.d.ts +3 -0
- package/dist/types/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.d.ts +3 -0
- package/dist/types/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.d.ts +20 -0
- package/dist/types/components.d.ts +445 -26
- package/dist/types/constants/engine.constants.d.ts +2 -0
- package/dist/types/constants/license.constants.d.ts +25 -0
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/helpers/localization.helper.d.ts +18 -0
- package/dist/types/helpers/math.helper.d.ts +1 -0
- package/dist/types/helpers/svg-export.helper.d.ts +81 -7
- package/dist/types/index.d.ts +13 -0
- package/dist/types/interfaces/context-menu-item.interface.d.ts +7 -1
- package/dist/types/interfaces/line-options.interface.d.ts +2 -0
- package/dist/types/interfaces/localization.interface.d.ts +143 -0
- package/dist/types/interfaces/path-options.interface.d.ts +2 -0
- package/dist/types/interfaces/settings.interface.d.ts +3 -0
- package/dist/types/interfaces/theme.interface.d.ts +27 -2
- package/dist/types/locales/de-locale.d.ts +5 -0
- package/dist/types/locales/en-locale.d.ts +6 -0
- package/dist/types/locales/fr-locale.d.ts +5 -0
- package/package.json +4 -7
- package/dist/components/p-2xYAGd0I.js +0 -1
- package/dist/components/p-B2Os1ya_.js +0 -1
- package/dist/components/p-BTEV1WwT.js +0 -1
- package/dist/components/p-BbactVA0.js +0 -1
- package/dist/components/p-BqwqGFQY.js +0 -1
- package/dist/components/p-C0TN5IAi.js +0 -1
- package/dist/components/p-CFgkUYoO.js +0 -1
- package/dist/components/p-COgo9OWy.js +0 -1
- package/dist/components/p-CUPYGT8c.js +0 -1
- package/dist/components/p-CcyIAi9S.js +0 -1
- package/dist/components/p-Cj78L1Kk.js +0 -1
- package/dist/components/p-CkAVEdDw.js +0 -9
- package/dist/components/p-CmuNn1Tc.js +0 -1
- package/dist/components/p-DDYoDSrm.js +0 -1
- package/dist/components/p-DbB730vO.js +0 -1
- package/dist/components/p-DlwYHzSj.js +0 -1
- package/dist/components/p-FK7b3BGt.js +0 -1
- package/dist/components/p-J9_SwObO.js +0 -1
- package/dist/stencil/p-67775031.entry.js +0 -9
- package/dist/stencil/p-DiCnmIYK.js +0 -1
|
@@ -13,6 +13,7 @@ import { KritzelBaseTool } from '../../../classes/tools/base-tool.class';
|
|
|
13
13
|
import { KritzelBrushToolConfig, KritzelLineToolConfig, KritzelShapeToolConfig, KritzelTextToolConfig } from '../../../interfaces/toolbar-control.interface';
|
|
14
14
|
import { ActiveWorkspaceChangeEvent, EditorIsReadyEvent, KritzelUndoState } from '../../..';
|
|
15
15
|
import { ThemeName, KritzelTheme } from '../../../interfaces/theme.interface';
|
|
16
|
+
import { KritzelLocale, KritzelTermKey, KritzelTermVars, LocaleCode } from '../../../interfaces/localization.interface';
|
|
16
17
|
import { KritzelShortcut } from '../../../interfaces/shortcut.interface';
|
|
17
18
|
import { KritzelViewportState } from '../../../interfaces/viewport-state.interface';
|
|
18
19
|
import { ObjectsAddedEvent, ObjectsRemovedEvent, ObjectsUpdatedEvent } from '../../../interfaces/object-change-event.interface';
|
|
@@ -29,7 +30,6 @@ export declare class KritzelEditor {
|
|
|
29
30
|
viewportBoundaryRight: number;
|
|
30
31
|
viewportBoundaryTop: number;
|
|
31
32
|
viewportBoundaryBottom: number;
|
|
32
|
-
wheelEnabled: boolean;
|
|
33
33
|
debugInfo: KritzelDebugInfo;
|
|
34
34
|
user?: IKritzelUser;
|
|
35
35
|
activeUsers?: IKritzelUser[];
|
|
@@ -38,11 +38,22 @@ export declare class KritzelEditor {
|
|
|
38
38
|
objectContextMenuItems: ContextMenuItem[];
|
|
39
39
|
themes?: KritzelTheme[];
|
|
40
40
|
theme: ThemeName;
|
|
41
|
+
/** License key that, when valid, removes the "Powered by Kritzel" watermark. */
|
|
42
|
+
licenseKey?: string;
|
|
43
|
+
/** The current locale (language) code applied to the editor, e.g. 'en', 'de', 'fr'. */
|
|
44
|
+
locale: LocaleCode;
|
|
45
|
+
/** An array of available locale definitions (with optional partial term overrides). */
|
|
46
|
+
locales?: KritzelLocale[];
|
|
47
|
+
/** The locale used to resolve terms missing from the active locale. */
|
|
48
|
+
fallbackLocale: LocaleCode;
|
|
41
49
|
customSvgIcons: Record<string, string>;
|
|
50
|
+
isPanningEnabled: boolean;
|
|
51
|
+
isZoomingEnabled: boolean;
|
|
42
52
|
isControlsVisible: boolean;
|
|
43
53
|
isUtilityPanelVisible: boolean;
|
|
44
54
|
isWorkspaceManagerVisible: boolean;
|
|
45
55
|
isMoreMenuVisible: boolean;
|
|
56
|
+
isZoomPanelVisible: boolean;
|
|
46
57
|
isObjectDistanceFadingActive: boolean;
|
|
47
58
|
syncConfig?: KritzelSyncConfig;
|
|
48
59
|
assetStorageConfig?: KritzelAssetStorageConfig;
|
|
@@ -64,6 +75,7 @@ export declare class KritzelEditor {
|
|
|
64
75
|
objectsUpdated: EventEmitter<ObjectsUpdatedEvent>;
|
|
65
76
|
undoStateChange: EventEmitter<KritzelUndoState>;
|
|
66
77
|
themeChange: EventEmitter<ThemeName>;
|
|
78
|
+
localeChange: EventEmitter<LocaleCode>;
|
|
67
79
|
viewportChange: EventEmitter<KritzelViewportState>;
|
|
68
80
|
logout: EventEmitter<void>;
|
|
69
81
|
login: EventEmitter<LoginEvent>;
|
|
@@ -77,6 +89,14 @@ export declare class KritzelEditor {
|
|
|
77
89
|
isVirtualKeyboardOpen: boolean;
|
|
78
90
|
undoState: KritzelUndoState | null;
|
|
79
91
|
isBackToContentButtonVisible: boolean;
|
|
92
|
+
/** Localized strings for editor-owned UI (e.g. the more menu), resolved from the active locale. */
|
|
93
|
+
resolvedTerms: Partial<Record<KritzelTermKey, string>>;
|
|
94
|
+
/** Available locales as `{ code, label }` options for the settings language selector. */
|
|
95
|
+
availableLocaleOptions: {
|
|
96
|
+
code: LocaleCode;
|
|
97
|
+
label: string;
|
|
98
|
+
}[];
|
|
99
|
+
currentZoomPercent: number;
|
|
80
100
|
shortcuts: Omit<KritzelShortcut, 'action' | 'condition'>[];
|
|
81
101
|
currentIsPublic: boolean;
|
|
82
102
|
isEditorVisible: boolean;
|
|
@@ -87,6 +107,13 @@ export declare class KritzelEditor {
|
|
|
87
107
|
onActiveWorkspaceIdChange(newId?: string): void;
|
|
88
108
|
onCurrentThemeChange(): void;
|
|
89
109
|
onThemesChange(): void;
|
|
110
|
+
onLocaleChange(newValue: LocaleCode): void;
|
|
111
|
+
/**
|
|
112
|
+
* Refreshes the editor-owned localized strings (e.g. the more menu and the
|
|
113
|
+
* strings forwarded to child UI components) from the engine's localization
|
|
114
|
+
* manager for the active locale.
|
|
115
|
+
*/
|
|
116
|
+
private refreshLocalizedTerms;
|
|
90
117
|
onTouchStart(event: MouseEvent): void;
|
|
91
118
|
getObjectById<T extends KritzelBaseObject>(id: string): Promise<T | null>;
|
|
92
119
|
addObject<T extends KritzelBaseObject>(object: T): Promise<T | null>;
|
|
@@ -191,6 +218,7 @@ export declare class KritzelEditor {
|
|
|
191
218
|
handleUndoStateChange(event: CustomEvent<KritzelUndoState>): void;
|
|
192
219
|
handleObjectsInViewportChange(event: CustomEvent<KritzelBaseObject<Element>[]>): Promise<void>;
|
|
193
220
|
handleViewportChange(event: CustomEvent<KritzelViewportState>): void;
|
|
221
|
+
private getZoomPercentFromScale;
|
|
194
222
|
handleAwarenessChange(event: CustomEvent<Map<number, Record<string, any>>>): void;
|
|
195
223
|
handleSettingsChange(event: CustomEvent<KritzelSettingsConfig>): void;
|
|
196
224
|
private get moreMenuItems();
|
|
@@ -203,6 +231,30 @@ export declare class KritzelEditor {
|
|
|
203
231
|
private get isLoggedIn();
|
|
204
232
|
openLoginDialog(): Promise<void>;
|
|
205
233
|
setLoginLoading(provider: string | null): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Sets the active locale (language) and re-renders the UI.
|
|
236
|
+
* @param code - The locale code to activate, e.g. 'de'.
|
|
237
|
+
*/
|
|
238
|
+
setLocale(code: LocaleCode): Promise<void>;
|
|
239
|
+
/**
|
|
240
|
+
* Gets the currently active locale code.
|
|
241
|
+
*/
|
|
242
|
+
getLocale(): Promise<LocaleCode>;
|
|
243
|
+
/**
|
|
244
|
+
* Gets the list of available locale codes (built-in and registered).
|
|
245
|
+
*/
|
|
246
|
+
getAvailableLocales(): Promise<LocaleCode[]>;
|
|
247
|
+
/**
|
|
248
|
+
* Registers additional locale definitions (with optional partial term overrides).
|
|
249
|
+
* @param locales - The locale definitions to register.
|
|
250
|
+
*/
|
|
251
|
+
registerLocales(locales: KritzelLocale[]): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Resolves a term key to its translated string for the active locale.
|
|
254
|
+
* @param key - The term key to resolve.
|
|
255
|
+
* @param vars - Optional values for `{placeholder}` interpolation.
|
|
256
|
+
*/
|
|
257
|
+
t(key: KritzelTermKey, vars?: KritzelTermVars): Promise<string>;
|
|
206
258
|
private getSettingsStorageKey;
|
|
207
259
|
private loadSettingsFromStorage;
|
|
208
260
|
private loadShortcuts;
|
|
@@ -15,6 +15,7 @@ import { KritzelSyncConfig } from '../../../interfaces/sync-config.interface';
|
|
|
15
15
|
import { KritzelAssetStorageConfig } from '../../../interfaces/asset-storage-config.interface';
|
|
16
16
|
import { KritzelUndoState } from '../../../interfaces/undo-state.interface';
|
|
17
17
|
import { KritzelTheme, ThemeName } from '../../../interfaces/theme.interface';
|
|
18
|
+
import { KritzelLocale, KritzelTermKey, KritzelTermVars, LocaleCode } from '../../../interfaces/localization.interface';
|
|
18
19
|
import { KritzelShortcut } from '../../../interfaces/shortcut.interface';
|
|
19
20
|
import { KritzelAlignment } from '../../../enums/alignment.enum';
|
|
20
21
|
import { KritzelViewportState } from '../../../interfaces/viewport-state.interface';
|
|
@@ -71,9 +72,21 @@ export declare class KritzelEngine {
|
|
|
71
72
|
/** The current theme to apply to the editor */
|
|
72
73
|
theme: ThemeName;
|
|
73
74
|
onThemeChange(newValue: ThemeName): void;
|
|
75
|
+
/** License key that, when valid, removes the "Powered by Kritzel" watermark. */
|
|
76
|
+
licenseKey?: string;
|
|
77
|
+
onLicenseKeyChange(newValue?: string): void;
|
|
74
78
|
/** An array of available themes for the editor. */
|
|
75
79
|
themes?: KritzelTheme[];
|
|
76
80
|
onThemesChange(newValue?: KritzelTheme[]): void;
|
|
81
|
+
/** The current locale (language) code to apply to the editor, e.g. 'en', 'de', 'fr'. */
|
|
82
|
+
locale: LocaleCode;
|
|
83
|
+
onLocaleChange(newValue: LocaleCode): void;
|
|
84
|
+
/** An array of available locale definitions (with optional partial term overrides). */
|
|
85
|
+
locales?: KritzelLocale[];
|
|
86
|
+
onLocalesChange(newValue?: KritzelLocale[]): void;
|
|
87
|
+
/** The locale used to resolve terms missing from the active locale. */
|
|
88
|
+
fallbackLocale: LocaleCode;
|
|
89
|
+
onFallbackLocaleChange(newValue: LocaleCode): void;
|
|
77
90
|
/** Left boundary of the viewport in world coordinates. Objects beyond this X position cannot be panned to. */
|
|
78
91
|
viewportBoundaryLeft: number;
|
|
79
92
|
onViewportBoundaryLeftChange(newValue: number): void;
|
|
@@ -89,8 +102,10 @@ export declare class KritzelEngine {
|
|
|
89
102
|
/** Debug info display options controlling which debug overlays are visible */
|
|
90
103
|
debugInfo?: KritzelDebugInfo;
|
|
91
104
|
onDebugInfoChange(newValue: KritzelDebugInfo): void;
|
|
92
|
-
/** When false, wheel events
|
|
93
|
-
|
|
105
|
+
/** When false, non-modified wheel events do not pan the viewport. */
|
|
106
|
+
isPanningEnabled: boolean;
|
|
107
|
+
/** When false, Ctrl+wheel events do not zoom the viewport. */
|
|
108
|
+
isZoomingEnabled: boolean;
|
|
94
109
|
/** External loading state. Combined with internal workspace-loading state to drive the overlay. */
|
|
95
110
|
isLoading: boolean;
|
|
96
111
|
onIsLoadingChange(): void;
|
|
@@ -434,12 +449,13 @@ export declare class KritzelEngine {
|
|
|
434
449
|
/**
|
|
435
450
|
* Generates an SVG string from the currently selected objects.
|
|
436
451
|
* Creates clean, standards-compliant SVG markup by directly serializing object properties.
|
|
437
|
-
* @param options - Optional export settings (theme, padding).
|
|
452
|
+
* @param options - Optional export settings (theme, padding, raster-safe mode for canvas export).
|
|
438
453
|
* @returns SVG markup string, or null if no objects are selected.
|
|
439
454
|
*/
|
|
440
455
|
getSelectedObjectsAsSvgString(options?: {
|
|
441
456
|
theme?: 'light' | 'dark';
|
|
442
457
|
padding?: number;
|
|
458
|
+
rasterSafeForCanvas?: boolean;
|
|
443
459
|
}): Promise<string | null>;
|
|
444
460
|
/**
|
|
445
461
|
* Exports the currently selected objects as an SVG file and triggers a browser download.
|
|
@@ -553,6 +569,42 @@ export declare class KritzelEngine {
|
|
|
553
569
|
* @returns The stored settings, or null if nothing is stored or the value is invalid.
|
|
554
570
|
*/
|
|
555
571
|
loadSettings(): Promise<Partial<KritzelSettingsConfig> | null>;
|
|
572
|
+
/**
|
|
573
|
+
* Registers additional locale definitions (with optional partial term overrides).
|
|
574
|
+
* @param locales - The locale definitions to register.
|
|
575
|
+
*/
|
|
576
|
+
registerLocales(locales: KritzelLocale[]): Promise<void>;
|
|
577
|
+
/**
|
|
578
|
+
* Sets the active locale (language) and re-renders the UI.
|
|
579
|
+
* @param code - The locale code to activate, e.g. 'de'.
|
|
580
|
+
*/
|
|
581
|
+
setLocale(code: LocaleCode): Promise<void>;
|
|
582
|
+
/**
|
|
583
|
+
* Gets the currently active locale code.
|
|
584
|
+
*/
|
|
585
|
+
getLocale(): Promise<LocaleCode>;
|
|
586
|
+
/**
|
|
587
|
+
* Gets the list of available locale codes (built-in and registered).
|
|
588
|
+
*/
|
|
589
|
+
getAvailableLocales(): Promise<LocaleCode[]>;
|
|
590
|
+
/**
|
|
591
|
+
* Gets the list of available locales as `{ code, label }` options for a selector.
|
|
592
|
+
*/
|
|
593
|
+
getAvailableLocaleOptions(): Promise<{
|
|
594
|
+
code: LocaleCode;
|
|
595
|
+
label: string;
|
|
596
|
+
}[]>;
|
|
597
|
+
/**
|
|
598
|
+
* Resolves a term key to its translated string for the active locale.
|
|
599
|
+
* @param key - The term key to resolve.
|
|
600
|
+
* @param vars - Optional values for `{placeholder}` interpolation.
|
|
601
|
+
*/
|
|
602
|
+
t(key: KritzelTermKey, vars?: KritzelTermVars): Promise<string>;
|
|
603
|
+
/**
|
|
604
|
+
* Resolves every known term key for the active locale into a flat map.
|
|
605
|
+
* Useful for UI layers that need to localize many strings at once.
|
|
606
|
+
*/
|
|
607
|
+
getResolvedTerms(): Promise<Partial<Record<KritzelTermKey, string>>>;
|
|
556
608
|
core: KritzelCore;
|
|
557
609
|
viewport: KritzelViewport;
|
|
558
610
|
contextMenuHandler: KritzelContextMenuHandler;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { KritzelCore } from '../../../classes/core/core.class';
|
|
2
|
+
/**
|
|
3
|
+
* "Powered by Kritzel" watermark shown in the bottom-right corner of the engine
|
|
4
|
+
* when the editor is not licensed.
|
|
5
|
+
*
|
|
6
|
+
* Rendered inside the engine's Shadow DOM and gated by the license manager on
|
|
7
|
+
* the engine's reactive render path, so removing the node simply causes it to
|
|
8
|
+
* reappear on the next render. The badge links to the Kritzel website.
|
|
9
|
+
*/
|
|
10
|
+
export declare class KritzelWatermark {
|
|
11
|
+
/** The core instance used to resolve localized terms. */
|
|
12
|
+
core: KritzelCore;
|
|
13
|
+
/**
|
|
14
|
+
* Resolved "Powered by Kritzel" label. Passed in by the engine so the badge
|
|
15
|
+
* re-renders when the active locale changes. Falls back to resolving the term
|
|
16
|
+
* from the core when not provided.
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
render(): any;
|
|
20
|
+
}
|
|
@@ -7,6 +7,7 @@ import { KritzelToolbarControl, KritzelToolbarSubOption } from '../../../interfa
|
|
|
7
7
|
import { KritzelUndoState } from '../../../interfaces/undo-state.interface';
|
|
8
8
|
import { ToolDisplayValues } from '../../../interfaces/tool-config.interface';
|
|
9
9
|
import { ThemeName } from '../../../interfaces/theme.interface';
|
|
10
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
10
11
|
type ToolConfig = Record<string, any>;
|
|
11
12
|
export declare class KritzelControls {
|
|
12
13
|
host: HTMLElement;
|
|
@@ -16,6 +17,8 @@ export declare class KritzelControls {
|
|
|
16
17
|
isUtilityPanelVisible: boolean;
|
|
17
18
|
undoState: KritzelUndoState;
|
|
18
19
|
theme: ThemeName;
|
|
20
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
21
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
19
22
|
isControlsReady: EventEmitter<void>;
|
|
20
23
|
firstConfig: ToolConfig | null;
|
|
21
24
|
isTouchDevice: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IKritzelUser } from '../../../interfaces/user.interface';
|
|
2
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
2
3
|
export declare class KritzelCurrentUser {
|
|
3
4
|
host: HTMLElement;
|
|
4
5
|
/**
|
|
@@ -9,6 +10,8 @@ export declare class KritzelCurrentUser {
|
|
|
9
10
|
* Avatar size in pixels
|
|
10
11
|
*/
|
|
11
12
|
avatarSize: number;
|
|
13
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
14
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
12
15
|
private dialogRef;
|
|
13
16
|
private handleAvatarClick;
|
|
14
17
|
render(): any;
|
package/dist/types/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IKritzelUser } from '../../../interfaces/user.interface';
|
|
2
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
2
3
|
export declare class KritzelCurrentUserDialog {
|
|
3
4
|
host: HTMLElement;
|
|
4
5
|
user?: IKritzelUser;
|
|
6
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
7
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
5
8
|
isDialogOpen: boolean;
|
|
6
9
|
open(): Promise<void>;
|
|
7
10
|
close(): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
2
3
|
type ExportTab = 'viewport' | 'workspace';
|
|
3
4
|
type ViewportExportFormat = 'png' | 'svg';
|
|
4
5
|
export declare class KritzelExport {
|
|
@@ -6,6 +7,8 @@ export declare class KritzelExport {
|
|
|
6
7
|
* The name of the current workspace, used as default filename
|
|
7
8
|
*/
|
|
8
9
|
workspaceName: string;
|
|
10
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
11
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
9
12
|
isDialogOpen: boolean;
|
|
10
13
|
previewUrl: string;
|
|
11
14
|
isLoading: boolean;
|
|
@@ -15,7 +18,7 @@ export declare class KritzelExport {
|
|
|
15
18
|
exportPng: EventEmitter<void>;
|
|
16
19
|
exportSvg: EventEmitter<void>;
|
|
17
20
|
exportJson: EventEmitter<string>;
|
|
18
|
-
private tabs;
|
|
21
|
+
private get tabs();
|
|
19
22
|
private viewportFormatOptions;
|
|
20
23
|
open(previewUrl?: string): Promise<void>;
|
|
21
24
|
private generateDefaultFilename;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { IKritzelMenuItem } from '../../../interfaces/menu-item.interface';
|
|
3
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
3
4
|
export declare class KritzelMoreMenu {
|
|
4
5
|
host: HTMLElement;
|
|
5
6
|
/**
|
|
@@ -24,6 +25,8 @@ export declare class KritzelMoreMenu {
|
|
|
24
25
|
* Offset Y for the portal positioning
|
|
25
26
|
*/
|
|
26
27
|
offsetY: number;
|
|
28
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
29
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
27
30
|
/**
|
|
28
31
|
* Emitted when a menu item is selected
|
|
29
32
|
*/
|
|
@@ -3,11 +3,19 @@ import { KritzelSettingsConfig } from '../../../interfaces/settings.interface';
|
|
|
3
3
|
import { KritzelDebugInfo } from '../../../interfaces/debug-info.interface';
|
|
4
4
|
import { ThemeName } from '../../../interfaces/theme.interface';
|
|
5
5
|
import { KritzelShortcut } from '../../../interfaces/shortcut.interface';
|
|
6
|
+
import { LocaleCode, KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
6
7
|
export declare class KritzelSettings {
|
|
7
8
|
host: HTMLElement;
|
|
8
9
|
/** Keyboard shortcuts to display in the settings dialog */
|
|
9
10
|
availableThemes: string[];
|
|
11
|
+
/** Available locales as `{ code, label }` options for the language selector. */
|
|
12
|
+
availableLocales: {
|
|
13
|
+
code: LocaleCode;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
10
16
|
shortcuts: Omit<KritzelShortcut, 'action' | 'condition'>[];
|
|
17
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
18
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
11
19
|
/** Current settings values. Used to initialize and sync the component's internal state. */
|
|
12
20
|
settings?: Partial<KritzelSettingsConfig>;
|
|
13
21
|
onSettingsPropChange(newSettings?: Partial<KritzelSettingsConfig>): void;
|
|
@@ -17,6 +25,7 @@ export declare class KritzelSettings {
|
|
|
17
25
|
scaleMax: number;
|
|
18
26
|
lockDrawingScale: boolean;
|
|
19
27
|
theme: ThemeName;
|
|
28
|
+
locale: LocaleCode;
|
|
20
29
|
viewportBoundaryLeft: number;
|
|
21
30
|
viewportBoundaryRight: number;
|
|
22
31
|
viewportBoundaryTop: number;
|
|
@@ -31,6 +40,7 @@ export declare class KritzelSettings {
|
|
|
31
40
|
private handleScaleMaxChange;
|
|
32
41
|
private handleLockDrawingScaleChange;
|
|
33
42
|
private handleThemeChange;
|
|
43
|
+
private handleLocaleChange;
|
|
34
44
|
private handleViewportBoundaryLeftChange;
|
|
35
45
|
private handleViewportBoundaryRightChange;
|
|
36
46
|
private handleViewportBoundaryTopChange;
|
|
@@ -42,6 +52,12 @@ export declare class KritzelSettings {
|
|
|
42
52
|
private formatKeyCombo;
|
|
43
53
|
private formatKey;
|
|
44
54
|
private groupShortcutsByCategory;
|
|
55
|
+
/**
|
|
56
|
+
* Resolves a localized string from the supplied {@link terms} map, falling
|
|
57
|
+
* back to the provided English default when the key is missing.
|
|
58
|
+
*/
|
|
59
|
+
private t;
|
|
60
|
+
private get categories();
|
|
45
61
|
private renderCategoryContent;
|
|
46
62
|
render(): any;
|
|
47
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
2
3
|
/**
|
|
3
4
|
* Share dialog component for managing workspace link sharing.
|
|
4
5
|
* This is a presentational component that emits events for all actions.
|
|
@@ -14,6 +15,8 @@ export declare class KritzelShareDialog {
|
|
|
14
15
|
* The ID of the workspace being shared. Used to build the share URL.
|
|
15
16
|
*/
|
|
16
17
|
workspaceId: string | undefined;
|
|
18
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
19
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
17
20
|
onIsPublicChange(newValue: boolean): void;
|
|
18
21
|
isDialogOpen: boolean;
|
|
19
22
|
internalIsPublic: boolean;
|
|
@@ -2,12 +2,15 @@ import { EventEmitter } from '../../../stencil-public-runtime';
|
|
|
2
2
|
import { ConfigurableTool, ToolConfigDefinition, ToolDisplayValues } from '../../../interfaces/tool-config.interface';
|
|
3
3
|
import { ThemeAwareColor } from '../../../constants/color-palette.constants';
|
|
4
4
|
import { ThemeName } from '../../../interfaces/theme.interface';
|
|
5
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
5
6
|
export declare class KritzelToolConfig {
|
|
6
7
|
tool: ConfigurableTool;
|
|
7
8
|
handleToolChange(newTool: ConfigurableTool, oldTool: ConfigurableTool): void;
|
|
8
9
|
isExpanded: boolean;
|
|
9
10
|
theme: ThemeName;
|
|
10
11
|
engine: HTMLElement;
|
|
12
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
13
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
11
14
|
private handleSelectionChangeBound;
|
|
12
15
|
onThemeChange(): void;
|
|
13
16
|
handleEngineChange(newEngine: HTMLElement, oldEngine: HTMLElement): void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { KritzelUndoState } from '../../../interfaces/undo-state.interface';
|
|
3
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
3
4
|
export declare class KritzelUtilityPanel {
|
|
4
5
|
undoState: KritzelUndoState;
|
|
6
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
7
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
5
8
|
undo: EventEmitter<void>;
|
|
6
9
|
redo: EventEmitter<void>;
|
|
7
10
|
delete: EventEmitter<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KritzelWorkspace } from '../../../classes/core/workspace.class';
|
|
2
2
|
import { IKritzelMenuItem } from '../../../interfaces/menu-item.interface';
|
|
3
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
3
4
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
4
5
|
export declare class KritzelWorkspaceManager {
|
|
5
6
|
host: HTMLElement;
|
|
@@ -9,6 +10,8 @@ export declare class KritzelWorkspaceManager {
|
|
|
9
10
|
visible: boolean;
|
|
10
11
|
activeWorkspace: KritzelWorkspace;
|
|
11
12
|
workspaces: KritzelWorkspace[];
|
|
13
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
14
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
12
15
|
isWorkspaceManagerReady: EventEmitter<void>;
|
|
13
16
|
workspaceChange: EventEmitter<KritzelWorkspace>;
|
|
14
17
|
childMenuAnchor: HTMLElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { KritzelTermKey } from '../../../interfaces/localization.interface';
|
|
3
|
+
export declare class KritzelZoomPanel {
|
|
4
|
+
/** Whether the zoom panel is visible. */
|
|
5
|
+
visible: boolean;
|
|
6
|
+
/** Whether both zoom buttons are disabled. */
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
/** Current zoom level in percent. */
|
|
9
|
+
zoomPercent: number;
|
|
10
|
+
/** Resolved localized strings keyed by term key, supplied by the editor. */
|
|
11
|
+
terms: Partial<Record<KritzelTermKey, string>>;
|
|
12
|
+
/** Emitted when the zoom-in button is clicked. */
|
|
13
|
+
zoomIn: EventEmitter<void>;
|
|
14
|
+
/** Emitted when the zoom-out button is clicked. */
|
|
15
|
+
zoomOut: EventEmitter<void>;
|
|
16
|
+
private handleZoomIn;
|
|
17
|
+
private handleZoomOut;
|
|
18
|
+
private get normalizedZoomPercent();
|
|
19
|
+
render(): any;
|
|
20
|
+
}
|