kritzel-stencil 0.3.16 → 0.3.18
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-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-mz3pUWW4.js +1 -0
- 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-86348986.entry.js +9 -0
- package/dist/stencil/p-DchTXG3V.js +1 -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
|
@@ -14,6 +14,7 @@ import { ContextMenuItem } from "./interfaces/context-menu-item.interface";
|
|
|
14
14
|
import { KritzelBaseObject } from "./classes/objects/base-object.class";
|
|
15
15
|
import { KritzelBrushToolConfig, KritzelLineToolConfig, KritzelShapeToolConfig, KritzelTextToolConfig, KritzelToolbarControl } from "./interfaces/toolbar-control.interface";
|
|
16
16
|
import { KritzelUndoState } from "./interfaces/undo-state.interface";
|
|
17
|
+
import { KritzelLocale, KritzelTermKey, KritzelTermVars, LocaleCode } from "./interfaces/localization.interface";
|
|
17
18
|
import { IKritzelDialogCloseEvent, KritzelDialogCloseReason } from "./interfaces/dialog.interface";
|
|
18
19
|
import { DropdownOption } from "./components/shared/kritzel-dropdown/kritzel-dropdown";
|
|
19
20
|
import { KritzelDebugInfo } from "./interfaces/debug-info.interface";
|
|
@@ -53,6 +54,7 @@ export { ContextMenuItem } from "./interfaces/context-menu-item.interface";
|
|
|
53
54
|
export { KritzelBaseObject } from "./classes/objects/base-object.class";
|
|
54
55
|
export { KritzelBrushToolConfig, KritzelLineToolConfig, KritzelShapeToolConfig, KritzelTextToolConfig, KritzelToolbarControl } from "./interfaces/toolbar-control.interface";
|
|
55
56
|
export { KritzelUndoState } from "./interfaces/undo-state.interface";
|
|
57
|
+
export { KritzelLocale, KritzelTermKey, KritzelTermVars, LocaleCode } from "./interfaces/localization.interface";
|
|
56
58
|
export { IKritzelDialogCloseEvent, KritzelDialogCloseReason } from "./interfaces/dialog.interface";
|
|
57
59
|
export { DropdownOption } from "./components/shared/kritzel-dropdown/kritzel-dropdown";
|
|
58
60
|
export { KritzelDebugInfo } from "./interfaces/debug-info.interface";
|
|
@@ -224,6 +226,11 @@ export namespace Components {
|
|
|
224
226
|
* @default true
|
|
225
227
|
*/
|
|
226
228
|
"isUtilityPanelVisible": boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
231
|
+
* @default {}
|
|
232
|
+
*/
|
|
233
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
227
234
|
/**
|
|
228
235
|
* @default 'light'
|
|
229
236
|
*/
|
|
@@ -243,6 +250,11 @@ export namespace Components {
|
|
|
243
250
|
* @default 40
|
|
244
251
|
*/
|
|
245
252
|
"avatarSize": number;
|
|
253
|
+
/**
|
|
254
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
255
|
+
* @default {}
|
|
256
|
+
*/
|
|
257
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
246
258
|
/**
|
|
247
259
|
* The current user to display
|
|
248
260
|
*/
|
|
@@ -251,6 +263,11 @@ export namespace Components {
|
|
|
251
263
|
interface KritzelCurrentUserDialog {
|
|
252
264
|
"close": () => Promise<void>;
|
|
253
265
|
"open": () => Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
268
|
+
* @default {}
|
|
269
|
+
*/
|
|
270
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
254
271
|
"user"?: IKritzelUser;
|
|
255
272
|
}
|
|
256
273
|
interface KritzelCursorTrail {
|
|
@@ -380,11 +397,24 @@ export namespace Components {
|
|
|
380
397
|
"exportSelectedObjectsAsSvg": () => Promise<void>;
|
|
381
398
|
"exportViewportAsPng": (options?: { includeBackground?: boolean; }) => Promise<void>;
|
|
382
399
|
"exportViewportAsSvg": (options?: { includeBackground?: boolean; }) => Promise<void>;
|
|
400
|
+
/**
|
|
401
|
+
* The locale used to resolve terms missing from the active locale.
|
|
402
|
+
* @default 'en'
|
|
403
|
+
*/
|
|
404
|
+
"fallbackLocale": LocaleCode;
|
|
383
405
|
"findObjects": <T extends KritzelBaseObject>(predicate: (obj: KritzelBaseObject<Element>) => boolean) => Promise<T[]>;
|
|
384
406
|
"getActiveWorkspace": () => Promise<KritzelWorkspace>;
|
|
385
407
|
"getAllObjects": <T extends KritzelBaseObject>() => Promise<T[]>;
|
|
408
|
+
/**
|
|
409
|
+
* Gets the list of available locale codes (built-in and registered).
|
|
410
|
+
*/
|
|
411
|
+
"getAvailableLocales": () => Promise<LocaleCode[]>;
|
|
386
412
|
"getCopiedObjects": () => Promise<KritzelBaseObject[]>;
|
|
387
413
|
"getDisplayableShortcuts": () => Promise<Omit<KritzelShortcut, "action" | "condition">[]>;
|
|
414
|
+
/**
|
|
415
|
+
* Gets the currently active locale code.
|
|
416
|
+
*/
|
|
417
|
+
"getLocale": () => Promise<LocaleCode>;
|
|
388
418
|
"getObjectById": <T extends KritzelBaseObject>(id: string) => Promise<T | null>;
|
|
389
419
|
"getObjectsInViewport": () => Promise<KritzelBaseObject[]>;
|
|
390
420
|
"getObjectsTotalCount": () => Promise<number>;
|
|
@@ -393,7 +423,7 @@ export namespace Components {
|
|
|
393
423
|
"getViewport": () => Promise<KritzelViewportState>;
|
|
394
424
|
"getWorkspaces": () => Promise<KritzelWorkspace[]>;
|
|
395
425
|
/**
|
|
396
|
-
* @default [ { label: '
|
|
426
|
+
* @default [ { label: 'menu.paste', icon: 'paste', disabled: async () => (await this.engineRef.getCopiedObjects()).length === 0, action: menu => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.selectAll', icon: 'select-all', disabled: async () => (await this.engineRef.getObjectsInViewport()).length === 0, action: () => this.selectAllObjectsInViewport(), }, ]
|
|
397
427
|
*/
|
|
398
428
|
"globalContextMenuItems": ContextMenuItem[];
|
|
399
429
|
"group": () => Promise<void>;
|
|
@@ -416,6 +446,10 @@ export namespace Components {
|
|
|
416
446
|
* @default false
|
|
417
447
|
*/
|
|
418
448
|
"isObjectDistanceFadingActive": boolean;
|
|
449
|
+
/**
|
|
450
|
+
* @default true
|
|
451
|
+
*/
|
|
452
|
+
"isPanningEnabled": boolean;
|
|
419
453
|
/**
|
|
420
454
|
* @default true
|
|
421
455
|
*/
|
|
@@ -424,8 +458,29 @@ export namespace Components {
|
|
|
424
458
|
* @default true
|
|
425
459
|
*/
|
|
426
460
|
"isWorkspaceManagerVisible": boolean;
|
|
461
|
+
/**
|
|
462
|
+
* @default true
|
|
463
|
+
*/
|
|
464
|
+
"isZoomPanelVisible": boolean;
|
|
465
|
+
/**
|
|
466
|
+
* @default true
|
|
467
|
+
*/
|
|
468
|
+
"isZoomingEnabled": boolean;
|
|
469
|
+
/**
|
|
470
|
+
* License key that, when valid, removes the "Powered by Kritzel" watermark.
|
|
471
|
+
*/
|
|
472
|
+
"licenseKey"?: string;
|
|
427
473
|
"loadObjectsFromJson": (json: string) => Promise<number>;
|
|
428
474
|
"loadSharedWorkspace": (token: string) => Promise<void>;
|
|
475
|
+
/**
|
|
476
|
+
* The current locale (language) code applied to the editor, e.g. 'en', 'de', 'fr'.
|
|
477
|
+
* @default 'en'
|
|
478
|
+
*/
|
|
479
|
+
"locale": LocaleCode;
|
|
480
|
+
/**
|
|
481
|
+
* An array of available locale definitions (with optional partial term overrides).
|
|
482
|
+
*/
|
|
483
|
+
"locales"?: KritzelLocale[];
|
|
429
484
|
/**
|
|
430
485
|
* @default true
|
|
431
486
|
*/
|
|
@@ -435,7 +490,7 @@ export namespace Components {
|
|
|
435
490
|
*/
|
|
436
491
|
"loginConfig"?: KritzelLoginConfig;
|
|
437
492
|
/**
|
|
438
|
-
* @default [ { label: '
|
|
493
|
+
* @default [ { label: 'menu.copy', icon: 'copy', group: 'clipboard', action: () => this.engineRef.copy() }, { label: 'menu.cut', icon: 'cut', group: 'clipboard', action: () => this.engineRef.cut() }, { label: 'menu.paste', icon: 'paste', group: 'clipboard', disabled: async () => (await this.engineRef.getCopiedObjects()).length === 0, action: (menu, _) => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.order', icon: 'ordering', group: 'other', children: [ { label: 'menu.bringToFront', icon: 'bring-to-front', action: () => this.engineRef.bringToFront() }, { label: 'menu.sendToBack', icon: 'send-to-back', action: () => this.engineRef.sendToBack() }, { label: 'menu.moveUp', icon: 'arrow-up-from-dot', action: () => this.engineRef.bringForward() }, { label: 'menu.moveDown', icon: 'arrow-down-from-dot', action: () => this.engineRef.sendBackward() }, ], }, { label: 'menu.align', icon: 'align', group: 'other', disabled: async () => (await this.engineRef.getSelectedObjects()).length < 2, children: [ { label: 'menu.alignLeft', icon: 'align-start-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.StartHorizontal) }, { label: 'menu.alignCenterHorizontal', icon: 'align-center-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterHorizontal) }, { label: 'menu.alignRight', icon: 'align-end-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.EndHorizontal) }, { label: 'menu.alignTop', icon: 'align-start-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.StartVertical) }, { label: 'menu.alignCenterVertical', icon: 'align-center-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterVertical) }, { label: 'menu.alignBottom', icon: 'align-end-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.EndVertical) }, ], }, { label: 'menu.group', icon: 'group', group: 'other', children: [ { label: 'menu.group', icon: 'group', disabled: async () => (await this.engineRef.getSelectedObjects()).length < 2, action: () => this.engineRef.group(), }, { label: 'menu.ungroup', icon: 'ungroup', disabled: async () => { const selectedObjects = await this.engineRef.getSelectedObjects(); return !selectedObjects.some(obj => obj.__class__ === 'KritzelGroup'); }, action: () => this.engineRef.ungroup(), }, ], }, { label: 'menu.export', icon: 'download', group: 'export', children: [ { label: 'menu.exportAsSvg', icon: 'download', action: () => this.engineRef.exportSelectedObjectsAsSvg() }, { label: 'menu.exportAsPng', icon: 'download', action: () => this.engineRef.exportSelectedObjectsAsPng() }, ], }, { label: 'menu.delete', icon: 'delete', group: 'edit', action: () => this.engineRef.delete() }, ]
|
|
439
494
|
*/
|
|
440
495
|
"objectContextMenuItems": ContextMenuItem[];
|
|
441
496
|
"openContextMenu": (options: { x: number; y: number; objectId?: string; }) => Promise<void>;
|
|
@@ -444,6 +499,11 @@ export namespace Components {
|
|
|
444
499
|
"panToObject": (object: KritzelBaseObject) => Promise<void>;
|
|
445
500
|
"paste": (x: number, y: number) => Promise<void>;
|
|
446
501
|
"redo": () => Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Registers additional locale definitions (with optional partial term overrides).
|
|
504
|
+
* @param locales - The locale definitions to register.
|
|
505
|
+
*/
|
|
506
|
+
"registerLocales": (locales: KritzelLocale[]) => Promise<void>;
|
|
447
507
|
"registerTool": (toolName: string, toolClass: any, toolConfig?: KritzelTextToolConfig | KritzelBrushToolConfig | KritzelLineToolConfig | KritzelShapeToolConfig) => Promise<KritzelBaseTool | null>;
|
|
448
508
|
"reinitSync": () => Promise<void>;
|
|
449
509
|
"removeObject": <T extends KritzelBaseObject>(object: T) => Promise<T | null>;
|
|
@@ -461,12 +521,23 @@ export namespace Components {
|
|
|
461
521
|
"selectObjects": (objects: KritzelBaseObject[]) => Promise<void>;
|
|
462
522
|
"sendBackward": (object?: KritzelBaseObject<any>) => Promise<void>;
|
|
463
523
|
"sendToBack": (object?: KritzelBaseObject<any>) => Promise<void>;
|
|
524
|
+
/**
|
|
525
|
+
* Sets the active locale (language) and re-renders the UI.
|
|
526
|
+
* @param code - The locale code to activate, e.g. 'de'.
|
|
527
|
+
*/
|
|
528
|
+
"setLocale": (code: LocaleCode) => Promise<void>;
|
|
464
529
|
"setLoginLoading": (provider: string | null) => Promise<void>;
|
|
465
530
|
"setViewport": (x: number, y: number, scale: number) => Promise<void>;
|
|
466
531
|
/**
|
|
467
532
|
* @default { providers: [], }
|
|
468
533
|
*/
|
|
469
534
|
"syncConfig"?: KritzelSyncConfig;
|
|
535
|
+
/**
|
|
536
|
+
* Resolves a term key to its translated string for the active locale.
|
|
537
|
+
* @param key - The term key to resolve.
|
|
538
|
+
* @param vars - Optional values for `{placeholder}` interpolation.
|
|
539
|
+
*/
|
|
540
|
+
"t": (key: KritzelTermKey, vars?: KritzelTermVars) => Promise<string>;
|
|
470
541
|
/**
|
|
471
542
|
* @default 'light'
|
|
472
543
|
*/
|
|
@@ -494,10 +565,6 @@ export namespace Components {
|
|
|
494
565
|
* @default -Infinity
|
|
495
566
|
*/
|
|
496
567
|
"viewportBoundaryTop": number;
|
|
497
|
-
/**
|
|
498
|
-
* @default true
|
|
499
|
-
*/
|
|
500
|
-
"wheelEnabled": boolean;
|
|
501
568
|
"worldToScreen": (x: number, y: number) => Promise<{ x: number; y: number; }>;
|
|
502
569
|
"zoomIn": (factor?: number, duration?: number) => Promise<void>;
|
|
503
570
|
"zoomOut": (factor?: number, duration?: number) => Promise<void>;
|
|
@@ -652,6 +719,11 @@ export namespace Components {
|
|
|
652
719
|
* @param options.includeBackground - Whether to include the canvas background. Defaults to `true`.
|
|
653
720
|
*/
|
|
654
721
|
"exportViewportAsSvg": (options?: { includeBackground?: boolean; }) => Promise<void>;
|
|
722
|
+
/**
|
|
723
|
+
* The locale used to resolve terms missing from the active locale.
|
|
724
|
+
* @default 'en'
|
|
725
|
+
*/
|
|
726
|
+
"fallbackLocale": LocaleCode;
|
|
655
727
|
/**
|
|
656
728
|
* Returns all objects that match the given predicate function. Excludes internal selection-related objects (selection groups and selection boxes).
|
|
657
729
|
* @param predicate - A filter function called for each object. Return `true` to include.
|
|
@@ -667,6 +739,14 @@ export namespace Components {
|
|
|
667
739
|
* Returns all objects on the canvas across all layers.
|
|
668
740
|
*/
|
|
669
741
|
"getAllObjects": <T extends KritzelBaseObject>() => Promise<T[]>;
|
|
742
|
+
/**
|
|
743
|
+
* Gets the list of available locales as `{ code, label }` options for a selector.
|
|
744
|
+
*/
|
|
745
|
+
"getAvailableLocaleOptions": () => Promise<{ code: LocaleCode; label: string; }[]>;
|
|
746
|
+
/**
|
|
747
|
+
* Gets the list of available locale codes (built-in and registered).
|
|
748
|
+
*/
|
|
749
|
+
"getAvailableLocales": () => Promise<LocaleCode[]>;
|
|
670
750
|
/**
|
|
671
751
|
* Returns the objects currently stored in the internal clipboard from a prior `copy()` call.
|
|
672
752
|
*/
|
|
@@ -680,6 +760,10 @@ export namespace Components {
|
|
|
680
760
|
* @returns True if the workspace is public, false otherwise
|
|
681
761
|
*/
|
|
682
762
|
"getIsPublic": () => Promise<boolean>;
|
|
763
|
+
/**
|
|
764
|
+
* Gets the currently active locale code.
|
|
765
|
+
*/
|
|
766
|
+
"getLocale": () => Promise<LocaleCode>;
|
|
683
767
|
/**
|
|
684
768
|
* Retrieves a canvas object by its unique ID.
|
|
685
769
|
* @param id - The object's unique identifier.
|
|
@@ -694,6 +778,10 @@ export namespace Components {
|
|
|
694
778
|
* Returns the total number of objects on the canvas.
|
|
695
779
|
*/
|
|
696
780
|
"getObjectsTotalCount": () => Promise<number>;
|
|
781
|
+
/**
|
|
782
|
+
* Resolves every known term key for the active locale into a flat map. Useful for UI layers that need to localize many strings at once.
|
|
783
|
+
*/
|
|
784
|
+
"getResolvedTerms": () => Promise<Partial<Record<KritzelTermKey, string>>>;
|
|
697
785
|
/**
|
|
698
786
|
* Captures a screenshot of the current viewport as a data URL.
|
|
699
787
|
* @param format - The image format: `'png'` (default) or `'svg'`.
|
|
@@ -714,10 +802,10 @@ export namespace Components {
|
|
|
714
802
|
"getSelectedObjectsAsPngDataUrl": (options?: { theme?: "light" | "dark"; padding?: number; scale?: number; }) => Promise<string | null>;
|
|
715
803
|
/**
|
|
716
804
|
* Generates an SVG string from the currently selected objects. Creates clean, standards-compliant SVG markup by directly serializing object properties.
|
|
717
|
-
* @param options - Optional export settings (theme, padding).
|
|
805
|
+
* @param options - Optional export settings (theme, padding, raster-safe mode for canvas export).
|
|
718
806
|
* @returns SVG markup string, or null if no objects are selected.
|
|
719
807
|
*/
|
|
720
|
-
"getSelectedObjectsAsSvgString": (options?: { theme?: "light" | "dark"; padding?: number; }) => Promise<string | null>;
|
|
808
|
+
"getSelectedObjectsAsSvgString": (options?: { theme?: "light" | "dark"; padding?: number; rasterSafeForCanvas?: boolean; }) => Promise<string | null>;
|
|
721
809
|
/**
|
|
722
810
|
* Returns the current viewport state including position, scale, and dimensions.
|
|
723
811
|
* @returns The current viewport state.
|
|
@@ -760,6 +848,20 @@ export namespace Components {
|
|
|
760
848
|
* @default false
|
|
761
849
|
*/
|
|
762
850
|
"isObjectDistanceFadingActive": boolean;
|
|
851
|
+
/**
|
|
852
|
+
* When false, non-modified wheel events do not pan the viewport.
|
|
853
|
+
* @default true
|
|
854
|
+
*/
|
|
855
|
+
"isPanningEnabled": boolean;
|
|
856
|
+
/**
|
|
857
|
+
* When false, Ctrl+wheel events do not zoom the viewport.
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
860
|
+
"isZoomingEnabled": boolean;
|
|
861
|
+
/**
|
|
862
|
+
* License key that, when valid, removes the "Powered by Kritzel" watermark.
|
|
863
|
+
*/
|
|
864
|
+
"licenseKey"?: string;
|
|
763
865
|
/**
|
|
764
866
|
* Loads objects from a workspace JSON string into the current workspace. Unlike importFromJson, this does not create a new workspace - it adds objects to the existing one. Useful for initializing a workspace with pre-existing content after the editor is ready.
|
|
765
867
|
* @param json - A JSON string containing workspace data (from exportAsJson).
|
|
@@ -777,6 +879,15 @@ export namespace Components {
|
|
|
777
879
|
* @param token - The connection token identifying the shared workspace
|
|
778
880
|
*/
|
|
779
881
|
"loadSharedWorkspace": (token: string) => Promise<void>;
|
|
882
|
+
/**
|
|
883
|
+
* The current locale (language) code to apply to the editor, e.g. 'en', 'de', 'fr'.
|
|
884
|
+
* @default 'en'
|
|
885
|
+
*/
|
|
886
|
+
"locale": LocaleCode;
|
|
887
|
+
/**
|
|
888
|
+
* An array of available locale definitions (with optional partial term overrides).
|
|
889
|
+
*/
|
|
890
|
+
"locales"?: KritzelLocale[];
|
|
780
891
|
/**
|
|
781
892
|
* When true, objects are drawn at a fixed visual size regardless of zoom level
|
|
782
893
|
* @default true
|
|
@@ -814,6 +925,11 @@ export namespace Components {
|
|
|
814
925
|
* Redoes the last undone action.
|
|
815
926
|
*/
|
|
816
927
|
"redo": () => Promise<void>;
|
|
928
|
+
/**
|
|
929
|
+
* Registers additional locale definitions (with optional partial term overrides).
|
|
930
|
+
* @param locales - The locale definitions to register.
|
|
931
|
+
*/
|
|
932
|
+
"registerLocales": (locales: KritzelLocale[]) => Promise<void>;
|
|
817
933
|
/**
|
|
818
934
|
* Registers a new drawing tool with the engine.
|
|
819
935
|
* @param toolName - Unique identifier for the tool (e.g., 'brush', 'eraser').
|
|
@@ -879,6 +995,11 @@ export namespace Components {
|
|
|
879
995
|
* @param object - The object to move. If omitted, applies to the current selection.
|
|
880
996
|
*/
|
|
881
997
|
"sendToBack": (object?: KritzelBaseObject<any>) => Promise<void>;
|
|
998
|
+
/**
|
|
999
|
+
* Sets the active locale (language) and re-renders the UI.
|
|
1000
|
+
* @param code - The locale code to activate, e.g. 'de'.
|
|
1001
|
+
*/
|
|
1002
|
+
"setLocale": (code: LocaleCode) => Promise<void>;
|
|
882
1003
|
/**
|
|
883
1004
|
* Sets the viewport to center on the given world coordinates at the specified scale.
|
|
884
1005
|
* @param x - X position in world coordinates to center on.
|
|
@@ -890,6 +1011,12 @@ export namespace Components {
|
|
|
890
1011
|
* Configuration for real-time synchronization providers (e.g., IndexedDB, WebSocket).
|
|
891
1012
|
*/
|
|
892
1013
|
"syncConfig"?: KritzelSyncConfig;
|
|
1014
|
+
/**
|
|
1015
|
+
* Resolves a term key to its translated string for the active locale.
|
|
1016
|
+
* @param key - The term key to resolve.
|
|
1017
|
+
* @param vars - Optional values for `{placeholder}` interpolation.
|
|
1018
|
+
*/
|
|
1019
|
+
"t": (key: KritzelTermKey, vars?: KritzelTermVars) => Promise<string>;
|
|
893
1020
|
/**
|
|
894
1021
|
* The current theme to apply to the editor
|
|
895
1022
|
* @default 'light'
|
|
@@ -947,11 +1074,6 @@ export namespace Components {
|
|
|
947
1074
|
* @default -Infinity
|
|
948
1075
|
*/
|
|
949
1076
|
"viewportBoundaryTop": number;
|
|
950
|
-
/**
|
|
951
|
-
* When false, wheel events will not trigger viewport pan/zoom. The event still propagates to parent elements.
|
|
952
|
-
* @default true
|
|
953
|
-
*/
|
|
954
|
-
"wheelEnabled": boolean;
|
|
955
1077
|
/**
|
|
956
1078
|
* The workspace to load and display. Changing this prop switches the active workspace.
|
|
957
1079
|
*/
|
|
@@ -985,6 +1107,11 @@ export namespace Components {
|
|
|
985
1107
|
}
|
|
986
1108
|
interface KritzelExport {
|
|
987
1109
|
"open": (previewUrl?: string) => Promise<void>;
|
|
1110
|
+
/**
|
|
1111
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1112
|
+
* @default {}
|
|
1113
|
+
*/
|
|
1114
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
988
1115
|
/**
|
|
989
1116
|
* The name of the current workspace, used as default filename
|
|
990
1117
|
* @default 'workspace'
|
|
@@ -1158,6 +1285,11 @@ export namespace Components {
|
|
|
1158
1285
|
* @default 4
|
|
1159
1286
|
*/
|
|
1160
1287
|
"offsetY": number;
|
|
1288
|
+
/**
|
|
1289
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1290
|
+
* @default {}
|
|
1291
|
+
*/
|
|
1292
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1161
1293
|
/**
|
|
1162
1294
|
* Whether the menu button is visible
|
|
1163
1295
|
* @default false
|
|
@@ -1243,6 +1375,11 @@ export namespace Components {
|
|
|
1243
1375
|
"offsetY": number;
|
|
1244
1376
|
}
|
|
1245
1377
|
interface KritzelSettings {
|
|
1378
|
+
/**
|
|
1379
|
+
* Available locales as `{ code, label }` options for the language selector.
|
|
1380
|
+
* @default []
|
|
1381
|
+
*/
|
|
1382
|
+
"availableLocales": { code: LocaleCode; label: string }[];
|
|
1246
1383
|
/**
|
|
1247
1384
|
* Keyboard shortcuts to display in the settings dialog
|
|
1248
1385
|
* @default ['light', 'dark']
|
|
@@ -1257,6 +1394,11 @@ export namespace Components {
|
|
|
1257
1394
|
* @default []
|
|
1258
1395
|
*/
|
|
1259
1396
|
"shortcuts": Omit<KritzelShortcut, 'action' | 'condition'>[];
|
|
1397
|
+
/**
|
|
1398
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1399
|
+
* @default {}
|
|
1400
|
+
*/
|
|
1401
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1260
1402
|
}
|
|
1261
1403
|
interface KritzelShapeFill {
|
|
1262
1404
|
/**
|
|
@@ -1284,6 +1426,11 @@ export namespace Components {
|
|
|
1284
1426
|
* Opens the share dialog.
|
|
1285
1427
|
*/
|
|
1286
1428
|
"open": () => Promise<void>;
|
|
1429
|
+
/**
|
|
1430
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1431
|
+
* @default {}
|
|
1432
|
+
*/
|
|
1433
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1287
1434
|
/**
|
|
1288
1435
|
* The ID of the workspace being shared. Used to build the share URL.
|
|
1289
1436
|
* @default undefined
|
|
@@ -1346,6 +1493,11 @@ export namespace Components {
|
|
|
1346
1493
|
* @default false
|
|
1347
1494
|
*/
|
|
1348
1495
|
"isExpanded": boolean;
|
|
1496
|
+
/**
|
|
1497
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1498
|
+
* @default {}
|
|
1499
|
+
*/
|
|
1500
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1349
1501
|
"theme": ThemeName;
|
|
1350
1502
|
"tool": ConfigurableTool;
|
|
1351
1503
|
}
|
|
@@ -1366,13 +1518,40 @@ export namespace Components {
|
|
|
1366
1518
|
"triggerElement": HTMLElement;
|
|
1367
1519
|
}
|
|
1368
1520
|
interface KritzelUtilityPanel {
|
|
1521
|
+
/**
|
|
1522
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1523
|
+
* @default {}
|
|
1524
|
+
*/
|
|
1525
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1369
1526
|
/**
|
|
1370
1527
|
* @default null
|
|
1371
1528
|
*/
|
|
1372
1529
|
"undoState": KritzelUndoState;
|
|
1373
1530
|
}
|
|
1531
|
+
/**
|
|
1532
|
+
* "Powered by Kritzel" watermark shown in the bottom-right corner of the engine
|
|
1533
|
+
* when the editor is not licensed.
|
|
1534
|
+
* Rendered inside the engine's Shadow DOM and gated by the license manager on
|
|
1535
|
+
* the engine's reactive render path, so removing the node simply causes it to
|
|
1536
|
+
* reappear on the next render. The badge links to the Kritzel website.
|
|
1537
|
+
*/
|
|
1538
|
+
interface KritzelWatermark {
|
|
1539
|
+
/**
|
|
1540
|
+
* The core instance used to resolve localized terms.
|
|
1541
|
+
*/
|
|
1542
|
+
"core": KritzelCore;
|
|
1543
|
+
/**
|
|
1544
|
+
* Resolved "Powered by Kritzel" label. Passed in by the engine so the badge re-renders when the active locale changes. Falls back to resolving the term from the core when not provided.
|
|
1545
|
+
*/
|
|
1546
|
+
"label"?: string;
|
|
1547
|
+
}
|
|
1374
1548
|
interface KritzelWorkspaceManager {
|
|
1375
1549
|
"activeWorkspace": KritzelWorkspace;
|
|
1550
|
+
/**
|
|
1551
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1552
|
+
* @default {}
|
|
1553
|
+
*/
|
|
1554
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1376
1555
|
/**
|
|
1377
1556
|
* Whether the workspace manager is visible
|
|
1378
1557
|
* @default false
|
|
@@ -1383,6 +1562,28 @@ export namespace Components {
|
|
|
1383
1562
|
*/
|
|
1384
1563
|
"workspaces": KritzelWorkspace[];
|
|
1385
1564
|
}
|
|
1565
|
+
interface KritzelZoomPanel {
|
|
1566
|
+
/**
|
|
1567
|
+
* Whether both zoom buttons are disabled.
|
|
1568
|
+
* @default false
|
|
1569
|
+
*/
|
|
1570
|
+
"disabled": boolean;
|
|
1571
|
+
/**
|
|
1572
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
1573
|
+
* @default {}
|
|
1574
|
+
*/
|
|
1575
|
+
"terms": Partial<Record<KritzelTermKey, string>>;
|
|
1576
|
+
/**
|
|
1577
|
+
* Whether the zoom panel is visible.
|
|
1578
|
+
* @default true
|
|
1579
|
+
*/
|
|
1580
|
+
"visible": boolean;
|
|
1581
|
+
/**
|
|
1582
|
+
* Current zoom level in percent.
|
|
1583
|
+
* @default 100
|
|
1584
|
+
*/
|
|
1585
|
+
"zoomPercent": number;
|
|
1586
|
+
}
|
|
1386
1587
|
}
|
|
1387
1588
|
export interface KritzelBackToContentCustomEvent<T> extends CustomEvent<T> {
|
|
1388
1589
|
detail: T;
|
|
@@ -1520,6 +1721,10 @@ export interface KritzelWorkspaceManagerCustomEvent<T> extends CustomEvent<T> {
|
|
|
1520
1721
|
detail: T;
|
|
1521
1722
|
target: HTMLKritzelWorkspaceManagerElement;
|
|
1522
1723
|
}
|
|
1724
|
+
export interface KritzelZoomPanelCustomEvent<T> extends CustomEvent<T> {
|
|
1725
|
+
detail: T;
|
|
1726
|
+
target: HTMLKritzelZoomPanelElement;
|
|
1727
|
+
}
|
|
1523
1728
|
declare global {
|
|
1524
1729
|
interface HTMLKritzelActiveUsersElement extends Components.KritzelActiveUsers, HTMLStencilElement {
|
|
1525
1730
|
}
|
|
@@ -1710,6 +1915,7 @@ declare global {
|
|
|
1710
1915
|
"objectsUpdated": ObjectsUpdatedEvent;
|
|
1711
1916
|
"undoStateChange": KritzelUndoState1;
|
|
1712
1917
|
"themeChange": ThemeName;
|
|
1918
|
+
"localeChange": LocaleCode;
|
|
1713
1919
|
"viewportChange": KritzelViewportState;
|
|
1714
1920
|
"logout": void;
|
|
1715
1921
|
"login": LoginEvent;
|
|
@@ -2197,6 +2403,19 @@ declare global {
|
|
|
2197
2403
|
prototype: HTMLKritzelUtilityPanelElement;
|
|
2198
2404
|
new (): HTMLKritzelUtilityPanelElement;
|
|
2199
2405
|
};
|
|
2406
|
+
/**
|
|
2407
|
+
* "Powered by Kritzel" watermark shown in the bottom-right corner of the engine
|
|
2408
|
+
* when the editor is not licensed.
|
|
2409
|
+
* Rendered inside the engine's Shadow DOM and gated by the license manager on
|
|
2410
|
+
* the engine's reactive render path, so removing the node simply causes it to
|
|
2411
|
+
* reappear on the next render. The badge links to the Kritzel website.
|
|
2412
|
+
*/
|
|
2413
|
+
interface HTMLKritzelWatermarkElement extends Components.KritzelWatermark, HTMLStencilElement {
|
|
2414
|
+
}
|
|
2415
|
+
var HTMLKritzelWatermarkElement: {
|
|
2416
|
+
prototype: HTMLKritzelWatermarkElement;
|
|
2417
|
+
new (): HTMLKritzelWatermarkElement;
|
|
2418
|
+
};
|
|
2200
2419
|
interface HTMLKritzelWorkspaceManagerElementEventMap {
|
|
2201
2420
|
"isWorkspaceManagerReady": void;
|
|
2202
2421
|
"workspaceChange": KritzelWorkspace;
|
|
@@ -2215,6 +2434,24 @@ declare global {
|
|
|
2215
2434
|
prototype: HTMLKritzelWorkspaceManagerElement;
|
|
2216
2435
|
new (): HTMLKritzelWorkspaceManagerElement;
|
|
2217
2436
|
};
|
|
2437
|
+
interface HTMLKritzelZoomPanelElementEventMap {
|
|
2438
|
+
"zoomIn": void;
|
|
2439
|
+
"zoomOut": void;
|
|
2440
|
+
}
|
|
2441
|
+
interface HTMLKritzelZoomPanelElement extends Components.KritzelZoomPanel, HTMLStencilElement {
|
|
2442
|
+
addEventListener<K extends keyof HTMLKritzelZoomPanelElementEventMap>(type: K, listener: (this: HTMLKritzelZoomPanelElement, ev: KritzelZoomPanelCustomEvent<HTMLKritzelZoomPanelElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2443
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2444
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2445
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2446
|
+
removeEventListener<K extends keyof HTMLKritzelZoomPanelElementEventMap>(type: K, listener: (this: HTMLKritzelZoomPanelElement, ev: KritzelZoomPanelCustomEvent<HTMLKritzelZoomPanelElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2447
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2448
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2449
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2450
|
+
}
|
|
2451
|
+
var HTMLKritzelZoomPanelElement: {
|
|
2452
|
+
prototype: HTMLKritzelZoomPanelElement;
|
|
2453
|
+
new (): HTMLKritzelZoomPanelElement;
|
|
2454
|
+
};
|
|
2218
2455
|
interface HTMLElementTagNameMap {
|
|
2219
2456
|
"kritzel-active-users": HTMLKritzelActiveUsersElement;
|
|
2220
2457
|
"kritzel-avatar": HTMLKritzelAvatarElement;
|
|
@@ -2258,7 +2495,9 @@ declare global {
|
|
|
2258
2495
|
"kritzel-tool-config": HTMLKritzelToolConfigElement;
|
|
2259
2496
|
"kritzel-tooltip": HTMLKritzelTooltipElement;
|
|
2260
2497
|
"kritzel-utility-panel": HTMLKritzelUtilityPanelElement;
|
|
2498
|
+
"kritzel-watermark": HTMLKritzelWatermarkElement;
|
|
2261
2499
|
"kritzel-workspace-manager": HTMLKritzelWorkspaceManagerElement;
|
|
2500
|
+
"kritzel-zoom-panel": HTMLKritzelZoomPanelElement;
|
|
2262
2501
|
}
|
|
2263
2502
|
}
|
|
2264
2503
|
declare namespace LocalJSX {
|
|
@@ -2414,6 +2653,11 @@ declare namespace LocalJSX {
|
|
|
2414
2653
|
*/
|
|
2415
2654
|
"isUtilityPanelVisible"?: boolean;
|
|
2416
2655
|
"onIsControlsReady"?: (event: KritzelControlsCustomEvent<void>) => void;
|
|
2656
|
+
/**
|
|
2657
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
2658
|
+
* @default {}
|
|
2659
|
+
*/
|
|
2660
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
2417
2661
|
/**
|
|
2418
2662
|
* @default 'light'
|
|
2419
2663
|
*/
|
|
@@ -2433,12 +2677,22 @@ declare namespace LocalJSX {
|
|
|
2433
2677
|
* @default 40
|
|
2434
2678
|
*/
|
|
2435
2679
|
"avatarSize"?: number;
|
|
2680
|
+
/**
|
|
2681
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
2682
|
+
* @default {}
|
|
2683
|
+
*/
|
|
2684
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
2436
2685
|
/**
|
|
2437
2686
|
* The current user to display
|
|
2438
2687
|
*/
|
|
2439
2688
|
"user"?: IKritzelUser;
|
|
2440
2689
|
}
|
|
2441
2690
|
interface KritzelCurrentUserDialog {
|
|
2691
|
+
/**
|
|
2692
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
2693
|
+
* @default {}
|
|
2694
|
+
*/
|
|
2695
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
2442
2696
|
"user"?: IKritzelUser;
|
|
2443
2697
|
}
|
|
2444
2698
|
interface KritzelCursorTrail {
|
|
@@ -2551,7 +2805,12 @@ declare namespace LocalJSX {
|
|
|
2551
2805
|
*/
|
|
2552
2806
|
"editorId"?: string;
|
|
2553
2807
|
/**
|
|
2554
|
-
*
|
|
2808
|
+
* The locale used to resolve terms missing from the active locale.
|
|
2809
|
+
* @default 'en'
|
|
2810
|
+
*/
|
|
2811
|
+
"fallbackLocale"?: LocaleCode;
|
|
2812
|
+
/**
|
|
2813
|
+
* @default [ { label: 'menu.paste', icon: 'paste', disabled: async () => (await this.engineRef.getCopiedObjects()).length === 0, action: menu => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.selectAll', icon: 'select-all', disabled: async () => (await this.engineRef.getObjectsInViewport()).length === 0, action: () => this.selectAllObjectsInViewport(), }, ]
|
|
2555
2814
|
*/
|
|
2556
2815
|
"globalContextMenuItems"?: ContextMenuItem[];
|
|
2557
2816
|
/**
|
|
@@ -2571,6 +2830,10 @@ declare namespace LocalJSX {
|
|
|
2571
2830
|
* @default false
|
|
2572
2831
|
*/
|
|
2573
2832
|
"isObjectDistanceFadingActive"?: boolean;
|
|
2833
|
+
/**
|
|
2834
|
+
* @default true
|
|
2835
|
+
*/
|
|
2836
|
+
"isPanningEnabled"?: boolean;
|
|
2574
2837
|
/**
|
|
2575
2838
|
* @default true
|
|
2576
2839
|
*/
|
|
@@ -2579,6 +2842,27 @@ declare namespace LocalJSX {
|
|
|
2579
2842
|
* @default true
|
|
2580
2843
|
*/
|
|
2581
2844
|
"isWorkspaceManagerVisible"?: boolean;
|
|
2845
|
+
/**
|
|
2846
|
+
* @default true
|
|
2847
|
+
*/
|
|
2848
|
+
"isZoomPanelVisible"?: boolean;
|
|
2849
|
+
/**
|
|
2850
|
+
* @default true
|
|
2851
|
+
*/
|
|
2852
|
+
"isZoomingEnabled"?: boolean;
|
|
2853
|
+
/**
|
|
2854
|
+
* License key that, when valid, removes the "Powered by Kritzel" watermark.
|
|
2855
|
+
*/
|
|
2856
|
+
"licenseKey"?: string;
|
|
2857
|
+
/**
|
|
2858
|
+
* The current locale (language) code applied to the editor, e.g. 'en', 'de', 'fr'.
|
|
2859
|
+
* @default 'en'
|
|
2860
|
+
*/
|
|
2861
|
+
"locale"?: LocaleCode;
|
|
2862
|
+
/**
|
|
2863
|
+
* An array of available locale definitions (with optional partial term overrides).
|
|
2864
|
+
*/
|
|
2865
|
+
"locales"?: KritzelLocale[];
|
|
2582
2866
|
/**
|
|
2583
2867
|
* @default true
|
|
2584
2868
|
*/
|
|
@@ -2588,13 +2872,14 @@ declare namespace LocalJSX {
|
|
|
2588
2872
|
*/
|
|
2589
2873
|
"loginConfig"?: KritzelLoginConfig;
|
|
2590
2874
|
/**
|
|
2591
|
-
* @default [ { label: '
|
|
2875
|
+
* @default [ { label: 'menu.copy', icon: 'copy', group: 'clipboard', action: () => this.engineRef.copy() }, { label: 'menu.cut', icon: 'cut', group: 'clipboard', action: () => this.engineRef.cut() }, { label: 'menu.paste', icon: 'paste', group: 'clipboard', disabled: async () => (await this.engineRef.getCopiedObjects()).length === 0, action: (menu, _) => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.order', icon: 'ordering', group: 'other', children: [ { label: 'menu.bringToFront', icon: 'bring-to-front', action: () => this.engineRef.bringToFront() }, { label: 'menu.sendToBack', icon: 'send-to-back', action: () => this.engineRef.sendToBack() }, { label: 'menu.moveUp', icon: 'arrow-up-from-dot', action: () => this.engineRef.bringForward() }, { label: 'menu.moveDown', icon: 'arrow-down-from-dot', action: () => this.engineRef.sendBackward() }, ], }, { label: 'menu.align', icon: 'align', group: 'other', disabled: async () => (await this.engineRef.getSelectedObjects()).length < 2, children: [ { label: 'menu.alignLeft', icon: 'align-start-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.StartHorizontal) }, { label: 'menu.alignCenterHorizontal', icon: 'align-center-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterHorizontal) }, { label: 'menu.alignRight', icon: 'align-end-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.EndHorizontal) }, { label: 'menu.alignTop', icon: 'align-start-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.StartVertical) }, { label: 'menu.alignCenterVertical', icon: 'align-center-vertical', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterVertical) }, { label: 'menu.alignBottom', icon: 'align-end-horizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.EndVertical) }, ], }, { label: 'menu.group', icon: 'group', group: 'other', children: [ { label: 'menu.group', icon: 'group', disabled: async () => (await this.engineRef.getSelectedObjects()).length < 2, action: () => this.engineRef.group(), }, { label: 'menu.ungroup', icon: 'ungroup', disabled: async () => { const selectedObjects = await this.engineRef.getSelectedObjects(); return !selectedObjects.some(obj => obj.__class__ === 'KritzelGroup'); }, action: () => this.engineRef.ungroup(), }, ], }, { label: 'menu.export', icon: 'download', group: 'export', children: [ { label: 'menu.exportAsSvg', icon: 'download', action: () => this.engineRef.exportSelectedObjectsAsSvg() }, { label: 'menu.exportAsPng', icon: 'download', action: () => this.engineRef.exportSelectedObjectsAsPng() }, ], }, { label: 'menu.delete', icon: 'delete', group: 'edit', action: () => this.engineRef.delete() }, ]
|
|
2592
2876
|
*/
|
|
2593
2877
|
"objectContextMenuItems"?: ContextMenuItem[];
|
|
2594
2878
|
"onActiveWorkspaceChange"?: (event: KritzelEditorCustomEvent<ActiveWorkspaceChangeEvent>) => void;
|
|
2595
2879
|
"onAwarenessChange"?: (event: KritzelEditorCustomEvent<Map<number, Record<string, any>>>) => void;
|
|
2596
2880
|
"onIsPublicChange"?: (event: KritzelEditorCustomEvent<IKritzelIsPublicChangedEvent>) => void;
|
|
2597
2881
|
"onIsReady"?: (event: KritzelEditorCustomEvent<EditorIsReadyEvent>) => void;
|
|
2882
|
+
"onLocaleChange"?: (event: KritzelEditorCustomEvent<LocaleCode>) => void;
|
|
2598
2883
|
"onLogin"?: (event: KritzelEditorCustomEvent<LoginEvent>) => void;
|
|
2599
2884
|
"onLogout"?: (event: KritzelEditorCustomEvent<void>) => void;
|
|
2600
2885
|
"onObjectsAdded"?: (event: KritzelEditorCustomEvent<ObjectsAddedEvent>) => void;
|
|
@@ -2638,10 +2923,6 @@ declare namespace LocalJSX {
|
|
|
2638
2923
|
* @default -Infinity
|
|
2639
2924
|
*/
|
|
2640
2925
|
"viewportBoundaryTop"?: number;
|
|
2641
|
-
/**
|
|
2642
|
-
* @default true
|
|
2643
|
-
*/
|
|
2644
|
-
"wheelEnabled"?: boolean;
|
|
2645
2926
|
}
|
|
2646
2927
|
interface KritzelEngine {
|
|
2647
2928
|
/**
|
|
@@ -2664,6 +2945,11 @@ declare namespace LocalJSX {
|
|
|
2664
2945
|
* Optional unique identifier for namespacing storage keys across multiple editor instances.
|
|
2665
2946
|
*/
|
|
2666
2947
|
"editorId"?: string;
|
|
2948
|
+
/**
|
|
2949
|
+
* The locale used to resolve terms missing from the active locale.
|
|
2950
|
+
* @default 'en'
|
|
2951
|
+
*/
|
|
2952
|
+
"fallbackLocale"?: LocaleCode;
|
|
2667
2953
|
/**
|
|
2668
2954
|
* Context menu items shown when right-clicking the canvas background.
|
|
2669
2955
|
*/
|
|
@@ -2678,6 +2964,29 @@ declare namespace LocalJSX {
|
|
|
2678
2964
|
* @default false
|
|
2679
2965
|
*/
|
|
2680
2966
|
"isObjectDistanceFadingActive"?: boolean;
|
|
2967
|
+
/**
|
|
2968
|
+
* When false, non-modified wheel events do not pan the viewport.
|
|
2969
|
+
* @default true
|
|
2970
|
+
*/
|
|
2971
|
+
"isPanningEnabled"?: boolean;
|
|
2972
|
+
/**
|
|
2973
|
+
* When false, Ctrl+wheel events do not zoom the viewport.
|
|
2974
|
+
* @default true
|
|
2975
|
+
*/
|
|
2976
|
+
"isZoomingEnabled"?: boolean;
|
|
2977
|
+
/**
|
|
2978
|
+
* License key that, when valid, removes the "Powered by Kritzel" watermark.
|
|
2979
|
+
*/
|
|
2980
|
+
"licenseKey"?: string;
|
|
2981
|
+
/**
|
|
2982
|
+
* The current locale (language) code to apply to the editor, e.g. 'en', 'de', 'fr'.
|
|
2983
|
+
* @default 'en'
|
|
2984
|
+
*/
|
|
2985
|
+
"locale"?: LocaleCode;
|
|
2986
|
+
/**
|
|
2987
|
+
* An array of available locale definitions (with optional partial term overrides).
|
|
2988
|
+
*/
|
|
2989
|
+
"locales"?: KritzelLocale[];
|
|
2681
2990
|
/**
|
|
2682
2991
|
* When true, objects are drawn at a fixed visual size regardless of zoom level
|
|
2683
2992
|
* @default true
|
|
@@ -2790,11 +3099,6 @@ declare namespace LocalJSX {
|
|
|
2790
3099
|
* @default -Infinity
|
|
2791
3100
|
*/
|
|
2792
3101
|
"viewportBoundaryTop"?: number;
|
|
2793
|
-
/**
|
|
2794
|
-
* When false, wheel events will not trigger viewport pan/zoom. The event still propagates to parent elements.
|
|
2795
|
-
* @default true
|
|
2796
|
-
*/
|
|
2797
|
-
"wheelEnabled"?: boolean;
|
|
2798
3102
|
/**
|
|
2799
3103
|
* The workspace to load and display. Changing this prop switches the active workspace.
|
|
2800
3104
|
*/
|
|
@@ -2804,6 +3108,11 @@ declare namespace LocalJSX {
|
|
|
2804
3108
|
"onExportJson"?: (event: KritzelExportCustomEvent<string>) => void;
|
|
2805
3109
|
"onExportPng"?: (event: KritzelExportCustomEvent<void>) => void;
|
|
2806
3110
|
"onExportSvg"?: (event: KritzelExportCustomEvent<void>) => void;
|
|
3111
|
+
/**
|
|
3112
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3113
|
+
* @default {}
|
|
3114
|
+
*/
|
|
3115
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
2807
3116
|
/**
|
|
2808
3117
|
* The name of the current workspace, used as default filename
|
|
2809
3118
|
* @default 'workspace'
|
|
@@ -2997,6 +3306,11 @@ declare namespace LocalJSX {
|
|
|
2997
3306
|
* Emitted when a menu item is selected
|
|
2998
3307
|
*/
|
|
2999
3308
|
"onItemSelect"?: (event: KritzelMoreMenuCustomEvent<{ item: IKritzelMenuItem; parent: IKritzelMenuItem }>) => void;
|
|
3309
|
+
/**
|
|
3310
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3311
|
+
* @default {}
|
|
3312
|
+
*/
|
|
3313
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3000
3314
|
/**
|
|
3001
3315
|
* Whether the menu button is visible
|
|
3002
3316
|
* @default false
|
|
@@ -3092,6 +3406,11 @@ declare namespace LocalJSX {
|
|
|
3092
3406
|
"onClose"?: (event: KritzelPortalCustomEvent<void>) => void;
|
|
3093
3407
|
}
|
|
3094
3408
|
interface KritzelSettings {
|
|
3409
|
+
/**
|
|
3410
|
+
* Available locales as `{ code, label }` options for the language selector.
|
|
3411
|
+
* @default []
|
|
3412
|
+
*/
|
|
3413
|
+
"availableLocales"?: { code: LocaleCode; label: string }[];
|
|
3095
3414
|
/**
|
|
3096
3415
|
* Keyboard shortcuts to display in the settings dialog
|
|
3097
3416
|
* @default ['light', 'dark']
|
|
@@ -3109,6 +3428,11 @@ declare namespace LocalJSX {
|
|
|
3109
3428
|
* @default []
|
|
3110
3429
|
*/
|
|
3111
3430
|
"shortcuts"?: Omit<KritzelShortcut, 'action' | 'condition'>[];
|
|
3431
|
+
/**
|
|
3432
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3433
|
+
* @default {}
|
|
3434
|
+
*/
|
|
3435
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3112
3436
|
}
|
|
3113
3437
|
interface KritzelShapeFill {
|
|
3114
3438
|
"onValueChange"?: (event: KritzelShapeFillCustomEvent<ShapeFillType>) => void;
|
|
@@ -3137,6 +3461,11 @@ declare namespace LocalJSX {
|
|
|
3137
3461
|
* Emitted when the user toggles the public sharing state.
|
|
3138
3462
|
*/
|
|
3139
3463
|
"onToggleIsPublic"?: (event: KritzelShareDialogCustomEvent<boolean>) => void;
|
|
3464
|
+
/**
|
|
3465
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3466
|
+
* @default {}
|
|
3467
|
+
*/
|
|
3468
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3140
3469
|
/**
|
|
3141
3470
|
* The ID of the workspace being shared. Used to build the share URL.
|
|
3142
3471
|
* @default undefined
|
|
@@ -3212,6 +3541,11 @@ declare namespace LocalJSX {
|
|
|
3212
3541
|
"isExpanded"?: boolean;
|
|
3213
3542
|
"onDisplayValuesChange"?: (event: KritzelToolConfigCustomEvent<ToolDisplayValues>) => void;
|
|
3214
3543
|
"onToolChange"?: (event: KritzelToolConfigCustomEvent<ConfigurableTool>) => void;
|
|
3544
|
+
/**
|
|
3545
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3546
|
+
* @default {}
|
|
3547
|
+
*/
|
|
3548
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3215
3549
|
"theme"?: ThemeName;
|
|
3216
3550
|
"tool"?: ConfigurableTool;
|
|
3217
3551
|
}
|
|
@@ -3233,15 +3567,42 @@ declare namespace LocalJSX {
|
|
|
3233
3567
|
"onDelete"?: (event: KritzelUtilityPanelCustomEvent<void>) => void;
|
|
3234
3568
|
"onRedo"?: (event: KritzelUtilityPanelCustomEvent<void>) => void;
|
|
3235
3569
|
"onUndo"?: (event: KritzelUtilityPanelCustomEvent<void>) => void;
|
|
3570
|
+
/**
|
|
3571
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3572
|
+
* @default {}
|
|
3573
|
+
*/
|
|
3574
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3236
3575
|
/**
|
|
3237
3576
|
* @default null
|
|
3238
3577
|
*/
|
|
3239
3578
|
"undoState"?: KritzelUndoState;
|
|
3240
3579
|
}
|
|
3580
|
+
/**
|
|
3581
|
+
* "Powered by Kritzel" watermark shown in the bottom-right corner of the engine
|
|
3582
|
+
* when the editor is not licensed.
|
|
3583
|
+
* Rendered inside the engine's Shadow DOM and gated by the license manager on
|
|
3584
|
+
* the engine's reactive render path, so removing the node simply causes it to
|
|
3585
|
+
* reappear on the next render. The badge links to the Kritzel website.
|
|
3586
|
+
*/
|
|
3587
|
+
interface KritzelWatermark {
|
|
3588
|
+
/**
|
|
3589
|
+
* The core instance used to resolve localized terms.
|
|
3590
|
+
*/
|
|
3591
|
+
"core": KritzelCore;
|
|
3592
|
+
/**
|
|
3593
|
+
* Resolved "Powered by Kritzel" label. Passed in by the engine so the badge re-renders when the active locale changes. Falls back to resolving the term from the core when not provided.
|
|
3594
|
+
*/
|
|
3595
|
+
"label"?: string;
|
|
3596
|
+
}
|
|
3241
3597
|
interface KritzelWorkspaceManager {
|
|
3242
3598
|
"activeWorkspace"?: KritzelWorkspace;
|
|
3243
3599
|
"onIsWorkspaceManagerReady"?: (event: KritzelWorkspaceManagerCustomEvent<void>) => void;
|
|
3244
3600
|
"onWorkspaceChange"?: (event: KritzelWorkspaceManagerCustomEvent<KritzelWorkspace>) => void;
|
|
3601
|
+
/**
|
|
3602
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3603
|
+
* @default {}
|
|
3604
|
+
*/
|
|
3605
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3245
3606
|
/**
|
|
3246
3607
|
* Whether the workspace manager is visible
|
|
3247
3608
|
* @default false
|
|
@@ -3252,6 +3613,36 @@ declare namespace LocalJSX {
|
|
|
3252
3613
|
*/
|
|
3253
3614
|
"workspaces"?: KritzelWorkspace[];
|
|
3254
3615
|
}
|
|
3616
|
+
interface KritzelZoomPanel {
|
|
3617
|
+
/**
|
|
3618
|
+
* Whether both zoom buttons are disabled.
|
|
3619
|
+
* @default false
|
|
3620
|
+
*/
|
|
3621
|
+
"disabled"?: boolean;
|
|
3622
|
+
/**
|
|
3623
|
+
* Emitted when the zoom-in button is clicked.
|
|
3624
|
+
*/
|
|
3625
|
+
"onZoomIn"?: (event: KritzelZoomPanelCustomEvent<void>) => void;
|
|
3626
|
+
/**
|
|
3627
|
+
* Emitted when the zoom-out button is clicked.
|
|
3628
|
+
*/
|
|
3629
|
+
"onZoomOut"?: (event: KritzelZoomPanelCustomEvent<void>) => void;
|
|
3630
|
+
/**
|
|
3631
|
+
* Resolved localized strings keyed by term key, supplied by the editor.
|
|
3632
|
+
* @default {}
|
|
3633
|
+
*/
|
|
3634
|
+
"terms"?: Partial<Record<KritzelTermKey, string>>;
|
|
3635
|
+
/**
|
|
3636
|
+
* Whether the zoom panel is visible.
|
|
3637
|
+
* @default true
|
|
3638
|
+
*/
|
|
3639
|
+
"visible"?: boolean;
|
|
3640
|
+
/**
|
|
3641
|
+
* Current zoom level in percent.
|
|
3642
|
+
* @default 100
|
|
3643
|
+
*/
|
|
3644
|
+
"zoomPercent"?: number;
|
|
3645
|
+
}
|
|
3255
3646
|
|
|
3256
3647
|
interface KritzelActiveUsersAttributes {
|
|
3257
3648
|
"avatarSize": number;
|
|
@@ -3323,12 +3714,17 @@ declare namespace LocalJSX {
|
|
|
3323
3714
|
"viewportBoundaryRight": number;
|
|
3324
3715
|
"viewportBoundaryTop": number;
|
|
3325
3716
|
"viewportBoundaryBottom": number;
|
|
3326
|
-
"wheelEnabled": boolean;
|
|
3327
3717
|
"theme": ThemeName;
|
|
3718
|
+
"licenseKey": string;
|
|
3719
|
+
"locale": LocaleCode;
|
|
3720
|
+
"fallbackLocale": LocaleCode;
|
|
3721
|
+
"isPanningEnabled": boolean;
|
|
3722
|
+
"isZoomingEnabled": boolean;
|
|
3328
3723
|
"isControlsVisible": boolean;
|
|
3329
3724
|
"isUtilityPanelVisible": boolean;
|
|
3330
3725
|
"isWorkspaceManagerVisible": boolean;
|
|
3331
3726
|
"isMoreMenuVisible": boolean;
|
|
3727
|
+
"isZoomPanelVisible": boolean;
|
|
3332
3728
|
"isObjectDistanceFadingActive": boolean;
|
|
3333
3729
|
"isLoading": boolean;
|
|
3334
3730
|
"editorId": string;
|
|
@@ -3342,11 +3738,15 @@ declare namespace LocalJSX {
|
|
|
3342
3738
|
"lockDrawingScale": boolean;
|
|
3343
3739
|
"isObjectDistanceFadingActive": boolean;
|
|
3344
3740
|
"theme": ThemeName;
|
|
3741
|
+
"licenseKey": string;
|
|
3742
|
+
"locale": LocaleCode;
|
|
3743
|
+
"fallbackLocale": LocaleCode;
|
|
3345
3744
|
"viewportBoundaryLeft": number;
|
|
3346
3745
|
"viewportBoundaryRight": number;
|
|
3347
3746
|
"viewportBoundaryTop": number;
|
|
3348
3747
|
"viewportBoundaryBottom": number;
|
|
3349
|
-
"
|
|
3748
|
+
"isPanningEnabled": boolean;
|
|
3749
|
+
"isZoomingEnabled": boolean;
|
|
3350
3750
|
"isLoading": boolean;
|
|
3351
3751
|
}
|
|
3352
3752
|
interface KritzelExportAttributes {
|
|
@@ -3442,9 +3842,17 @@ declare namespace LocalJSX {
|
|
|
3442
3842
|
"isVisible": boolean;
|
|
3443
3843
|
"offsetY": number;
|
|
3444
3844
|
}
|
|
3845
|
+
interface KritzelWatermarkAttributes {
|
|
3846
|
+
"label": string;
|
|
3847
|
+
}
|
|
3445
3848
|
interface KritzelWorkspaceManagerAttributes {
|
|
3446
3849
|
"visible": boolean;
|
|
3447
3850
|
}
|
|
3851
|
+
interface KritzelZoomPanelAttributes {
|
|
3852
|
+
"visible": boolean;
|
|
3853
|
+
"disabled": boolean;
|
|
3854
|
+
"zoomPercent": number;
|
|
3855
|
+
}
|
|
3448
3856
|
|
|
3449
3857
|
interface IntrinsicElements {
|
|
3450
3858
|
"kritzel-active-users": Omit<KritzelActiveUsers, keyof KritzelActiveUsersAttributes> & { [K in keyof KritzelActiveUsers & keyof KritzelActiveUsersAttributes]?: KritzelActiveUsers[K] } & { [K in keyof KritzelActiveUsers & keyof KritzelActiveUsersAttributes as `attr:${K}`]?: KritzelActiveUsersAttributes[K] } & { [K in keyof KritzelActiveUsers & keyof KritzelActiveUsersAttributes as `prop:${K}`]?: KritzelActiveUsers[K] };
|
|
@@ -3489,7 +3897,9 @@ declare namespace LocalJSX {
|
|
|
3489
3897
|
"kritzel-tool-config": Omit<KritzelToolConfig, keyof KritzelToolConfigAttributes> & { [K in keyof KritzelToolConfig & keyof KritzelToolConfigAttributes]?: KritzelToolConfig[K] } & { [K in keyof KritzelToolConfig & keyof KritzelToolConfigAttributes as `attr:${K}`]?: KritzelToolConfigAttributes[K] } & { [K in keyof KritzelToolConfig & keyof KritzelToolConfigAttributes as `prop:${K}`]?: KritzelToolConfig[K] };
|
|
3490
3898
|
"kritzel-tooltip": Omit<KritzelTooltip, keyof KritzelTooltipAttributes> & { [K in keyof KritzelTooltip & keyof KritzelTooltipAttributes]?: KritzelTooltip[K] } & { [K in keyof KritzelTooltip & keyof KritzelTooltipAttributes as `attr:${K}`]?: KritzelTooltipAttributes[K] } & { [K in keyof KritzelTooltip & keyof KritzelTooltipAttributes as `prop:${K}`]?: KritzelTooltip[K] };
|
|
3491
3899
|
"kritzel-utility-panel": KritzelUtilityPanel;
|
|
3900
|
+
"kritzel-watermark": Omit<KritzelWatermark, keyof KritzelWatermarkAttributes> & { [K in keyof KritzelWatermark & keyof KritzelWatermarkAttributes]?: KritzelWatermark[K] } & { [K in keyof KritzelWatermark & keyof KritzelWatermarkAttributes as `attr:${K}`]?: KritzelWatermarkAttributes[K] } & { [K in keyof KritzelWatermark & keyof KritzelWatermarkAttributes as `prop:${K}`]?: KritzelWatermark[K] };
|
|
3492
3901
|
"kritzel-workspace-manager": Omit<KritzelWorkspaceManager, keyof KritzelWorkspaceManagerAttributes> & { [K in keyof KritzelWorkspaceManager & keyof KritzelWorkspaceManagerAttributes]?: KritzelWorkspaceManager[K] } & { [K in keyof KritzelWorkspaceManager & keyof KritzelWorkspaceManagerAttributes as `attr:${K}`]?: KritzelWorkspaceManagerAttributes[K] } & { [K in keyof KritzelWorkspaceManager & keyof KritzelWorkspaceManagerAttributes as `prop:${K}`]?: KritzelWorkspaceManager[K] };
|
|
3902
|
+
"kritzel-zoom-panel": Omit<KritzelZoomPanel, keyof KritzelZoomPanelAttributes> & { [K in keyof KritzelZoomPanel & keyof KritzelZoomPanelAttributes]?: KritzelZoomPanel[K] } & { [K in keyof KritzelZoomPanel & keyof KritzelZoomPanelAttributes as `attr:${K}`]?: KritzelZoomPanelAttributes[K] } & { [K in keyof KritzelZoomPanel & keyof KritzelZoomPanelAttributes as `prop:${K}`]?: KritzelZoomPanel[K] };
|
|
3493
3903
|
}
|
|
3494
3904
|
}
|
|
3495
3905
|
export { LocalJSX as JSX };
|
|
@@ -3548,7 +3958,16 @@ declare module "@stencil/core" {
|
|
|
3548
3958
|
"kritzel-tool-config": LocalJSX.IntrinsicElements["kritzel-tool-config"] & JSXBase.HTMLAttributes<HTMLKritzelToolConfigElement>;
|
|
3549
3959
|
"kritzel-tooltip": LocalJSX.IntrinsicElements["kritzel-tooltip"] & JSXBase.HTMLAttributes<HTMLKritzelTooltipElement>;
|
|
3550
3960
|
"kritzel-utility-panel": LocalJSX.IntrinsicElements["kritzel-utility-panel"] & JSXBase.HTMLAttributes<HTMLKritzelUtilityPanelElement>;
|
|
3961
|
+
/**
|
|
3962
|
+
* "Powered by Kritzel" watermark shown in the bottom-right corner of the engine
|
|
3963
|
+
* when the editor is not licensed.
|
|
3964
|
+
* Rendered inside the engine's Shadow DOM and gated by the license manager on
|
|
3965
|
+
* the engine's reactive render path, so removing the node simply causes it to
|
|
3966
|
+
* reappear on the next render. The badge links to the Kritzel website.
|
|
3967
|
+
*/
|
|
3968
|
+
"kritzel-watermark": LocalJSX.IntrinsicElements["kritzel-watermark"] & JSXBase.HTMLAttributes<HTMLKritzelWatermarkElement>;
|
|
3551
3969
|
"kritzel-workspace-manager": LocalJSX.IntrinsicElements["kritzel-workspace-manager"] & JSXBase.HTMLAttributes<HTMLKritzelWorkspaceManagerElement>;
|
|
3970
|
+
"kritzel-zoom-panel": LocalJSX.IntrinsicElements["kritzel-zoom-panel"] & JSXBase.HTMLAttributes<HTMLKritzelZoomPanelElement>;
|
|
3552
3971
|
}
|
|
3553
3972
|
}
|
|
3554
3973
|
}
|