kritzel-stencil 0.3.12 → 0.3.14

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.
Files changed (169) hide show
  1. package/dist/cjs/{index-CFnj_FXt.js → index-Xav9JFHg.js} +1 -1
  2. package/dist/cjs/index.cjs.js +41 -3
  3. package/dist/cjs/kritzel-active-users_42.cjs.entry.js +281 -113
  4. package/dist/cjs/kritzel-brush-style.cjs.entry.js +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{schema.constants-CzfoUWxF.js → schema.constants-DJQTjcy7.js} +84 -42
  7. package/dist/cjs/stencil.cjs.js +3 -3
  8. package/dist/collection/classes/core/viewport.class.js +97 -8
  9. package/dist/collection/classes/objects/image.class.js +62 -0
  10. package/dist/collection/classes/objects/shape.class.js +2 -1
  11. package/dist/collection/classes/tools/base-tool.class.js +2 -0
  12. package/dist/collection/classes/tools/brush-tool.class.js +1 -0
  13. package/dist/collection/classes/tools/eraser-tool.class.js +1 -0
  14. package/dist/collection/classes/tools/image-tool.class.js +1 -0
  15. package/dist/collection/classes/tools/line-tool.class.js +1 -0
  16. package/dist/collection/classes/tools/selection-tool.class.js +1 -0
  17. package/dist/collection/classes/tools/shape-tool.class.js +1 -0
  18. package/dist/collection/classes/tools/text-tool.class.js +1 -0
  19. package/dist/collection/collection-manifest.json +1 -1
  20. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +156 -33
  21. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +270 -19
  22. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +3 -3
  23. package/dist/collection/components/shared/kritzel-input/kritzel-input.css +1 -1
  24. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +2 -2
  25. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +7 -0
  26. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +7 -1
  27. package/dist/collection/components/ui/kritzel-export/kritzel-export.css +1 -1
  28. package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.js +2 -2
  29. package/dist/collection/configs/default-asset-storage.config.js +1 -2
  30. package/dist/collection/configs/default-sync.config.js +2 -5
  31. package/dist/collection/constants/version.js +1 -1
  32. package/dist/collection/helpers/tool-config.helper.js +58 -65
  33. package/dist/collection/interfaces/tool-type.interface.js +1 -0
  34. package/dist/collection/themes/dark-theme.js +5 -0
  35. package/dist/collection/themes/light-theme.js +5 -0
  36. package/dist/components/index.js +1 -1
  37. package/dist/components/kritzel-active-users.js +1 -1
  38. package/dist/components/kritzel-avatar.js +1 -1
  39. package/dist/components/kritzel-awareness-cursors.js +1 -1
  40. package/dist/components/kritzel-back-to-content.js +1 -1
  41. package/dist/components/kritzel-brush-style.js +1 -1
  42. package/dist/components/kritzel-button.js +1 -1
  43. package/dist/components/kritzel-color-palette.js +1 -1
  44. package/dist/components/kritzel-color.js +1 -1
  45. package/dist/components/kritzel-context-menu.js +1 -1
  46. package/dist/components/kritzel-controls.js +1 -1
  47. package/dist/components/kritzel-current-user-dialog.js +1 -1
  48. package/dist/components/kritzel-current-user.js +1 -1
  49. package/dist/components/kritzel-cursor-trail.js +1 -1
  50. package/dist/components/kritzel-dialog.js +1 -1
  51. package/dist/components/kritzel-dropdown.js +1 -1
  52. package/dist/components/kritzel-editor.js +1 -1
  53. package/dist/components/kritzel-engine.js +1 -1
  54. package/dist/components/kritzel-export.js +1 -1
  55. package/dist/components/kritzel-font-family.js +1 -1
  56. package/dist/components/kritzel-font-size.js +1 -1
  57. package/dist/components/kritzel-font.js +1 -1
  58. package/dist/components/kritzel-icon.js +1 -1
  59. package/dist/components/kritzel-input.js +1 -1
  60. package/dist/components/kritzel-line-endings.js +1 -1
  61. package/dist/components/kritzel-login-dialog.js +1 -1
  62. package/dist/components/kritzel-master-detail.js +1 -1
  63. package/dist/components/kritzel-menu-item.js +1 -1
  64. package/dist/components/kritzel-menu.js +1 -1
  65. package/dist/components/kritzel-more-menu.js +1 -1
  66. package/dist/components/kritzel-numeric-input.js +1 -1
  67. package/dist/components/kritzel-opacity-slider.js +1 -1
  68. package/dist/components/kritzel-pill-tabs.js +1 -1
  69. package/dist/components/kritzel-portal.js +1 -1
  70. package/dist/components/kritzel-settings.js +1 -1
  71. package/dist/components/kritzel-shape-fill.js +1 -1
  72. package/dist/components/kritzel-share-dialog.js +1 -1
  73. package/dist/components/kritzel-slide-toggle.js +1 -1
  74. package/dist/components/kritzel-split-button.js +1 -1
  75. package/dist/components/kritzel-stroke-size.js +1 -1
  76. package/dist/components/kritzel-tool-config.js +1 -1
  77. package/dist/components/kritzel-tooltip.js +1 -1
  78. package/dist/components/kritzel-utility-panel.js +1 -1
  79. package/dist/components/kritzel-workspace-manager.js +1 -1
  80. package/dist/components/p-2xYAGd0I.js +1 -0
  81. package/dist/components/{p-DdmJquQr.js → p-B2Os1ya_.js} +1 -1
  82. package/dist/components/p-B2w8X7vn.js +1 -0
  83. package/dist/components/{p-DRB3TZzI.js → p-B4b6TDxp.js} +1 -1
  84. package/dist/components/p-B5xxfwKF.js +1 -0
  85. package/dist/components/{p-D0aom7Yu.js → p-BFYtCsZu.js} +1 -1
  86. package/dist/components/{p-CARNM9pf.js → p-BFoK4W--.js} +1 -1
  87. package/dist/components/p-BTEV1WwT.js +1 -0
  88. package/dist/components/{p-x38RbGJA.js → p-BYmp9Ovv.js} +1 -1
  89. package/dist/components/{p-KVG5rztB.js → p-BbactVA0.js} +1 -1
  90. package/dist/components/{p-B_JH91jB.js → p-BfNHpqQ8.js} +1 -1
  91. package/dist/components/{p-DXgUuzXW.js → p-BiG1dxPS.js} +1 -1
  92. package/dist/components/{p-Dov3qOAR.js → p-Bj2laX89.js} +1 -1
  93. package/dist/components/{p-Cr7xOsIZ.js → p-BqwqGFQY.js} +1 -1
  94. package/dist/components/{p-DmTG0Y5h.js → p-BzYU3-MJ.js} +1 -1
  95. package/dist/components/p-C0TN5IAi.js +1 -0
  96. package/dist/components/{p-RnuCSIt-.js → p-C2SX-XRr.js} +1 -1
  97. package/dist/components/{p-guqEWGgV.js → p-CFgkUYoO.js} +1 -1
  98. package/dist/components/{p-BTSOqHMI.js → p-CHrSFOSI.js} +1 -1
  99. package/dist/components/p-CJOhfMU5.js +1 -0
  100. package/dist/components/p-CLLbE_z8.js +9 -0
  101. package/dist/components/{p-DJLJfKY2.js → p-COLHjboZ.js} +1 -1
  102. package/dist/components/{p-CKY7AvGR.js → p-COgo9OWy.js} +1 -1
  103. package/dist/components/p-CUPYGT8c.js +1 -0
  104. package/dist/components/{p-DhAM4qeQ.js → p-CXpv9Rxe.js} +1 -1
  105. package/dist/components/{p-Bp3kdH4l.js → p-CcyIAi9S.js} +1 -1
  106. package/dist/components/{p-COIxq81R.js → p-CmuNn1Tc.js} +1 -1
  107. package/dist/components/{p-DfH7YY2C.js → p-D-sRVAbQ.js} +1 -1
  108. package/dist/components/{p-ZgZqbJ58.js → p-DDYoDSrm.js} +1 -1
  109. package/dist/components/{p-u0b2RJAn.js → p-DEy7zJCe.js} +1 -1
  110. package/dist/components/{p-BPEn0_hr.js → p-DM11KXUT.js} +1 -1
  111. package/dist/components/{p-CJERvHdy.js → p-DbB730vO.js} +1 -1
  112. package/dist/components/{p-C8ggg-5h.js → p-Df3BwVGy.js} +1 -1
  113. package/dist/components/{p-EFyZdR89.js → p-DkaiWg1V.js} +1 -1
  114. package/dist/components/{p-Dx_xz_El.js → p-DlwYHzSj.js} +1 -1
  115. package/dist/components/{p-CJ2V42sz.js → p-FK7b3BGt.js} +1 -1
  116. package/dist/components/{p-Do4UlU4e.js → p-J9_SwObO.js} +1 -1
  117. package/dist/components/{p-CxtTuKCy.js → p-JhOYwUOj.js} +1 -1
  118. package/dist/components/{p-Dw9sKOsb.js → p-SptaSMno.js} +1 -1
  119. package/dist/components/{p-KjtNlFTl.js → p-UoPj5QjH.js} +1 -1
  120. package/dist/components/{p-CYR9wbJg.js → p-dcAernE1.js} +1 -1
  121. package/dist/components/{p-BI_UUiTr.js → p-skWUIStn.js} +1 -1
  122. package/dist/components/{p-DgtrNOWm.js → p-x6doYeiI.js} +1 -1
  123. package/dist/esm/{index-D9HaikfQ.js → index-Dhio9uis.js} +1 -1
  124. package/dist/esm/index.js +42 -4
  125. package/dist/esm/kritzel-active-users_42.entry.js +281 -113
  126. package/dist/esm/kritzel-brush-style.entry.js +1 -1
  127. package/dist/esm/loader.js +3 -3
  128. package/dist/esm/{schema.constants-BcT1vV4J.js → schema.constants-DiCnmIYK.js} +85 -42
  129. package/dist/esm/stencil.js +4 -4
  130. package/dist/stencil/index.esm.js +1 -1
  131. package/dist/stencil/p-DiCnmIYK.js +1 -0
  132. package/dist/stencil/p-ea76b21f.entry.js +9 -0
  133. package/dist/stencil/{p-69298b5f.entry.js → p-fb32cd8f.entry.js} +1 -1
  134. package/dist/stencil/stencil.esm.js +1 -1
  135. package/dist/types/classes/core/viewport.class.d.ts +38 -0
  136. package/dist/types/classes/objects/image.class.d.ts +15 -0
  137. package/dist/types/classes/tools/base-tool.class.d.ts +3 -0
  138. package/dist/types/classes/tools/brush-tool.class.d.ts +1 -0
  139. package/dist/types/classes/tools/eraser-tool.class.d.ts +1 -0
  140. package/dist/types/classes/tools/image-tool.class.d.ts +1 -0
  141. package/dist/types/classes/tools/line-tool.class.d.ts +1 -0
  142. package/dist/types/classes/tools/selection-tool.class.d.ts +1 -0
  143. package/dist/types/classes/tools/shape-tool.class.d.ts +1 -0
  144. package/dist/types/classes/tools/text-tool.class.d.ts +1 -0
  145. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +13 -3
  146. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +49 -5
  147. package/dist/types/components/ui/kritzel-context-menu/kritzel-context-menu.d.ts +1 -0
  148. package/dist/types/components.d.ts +54 -20
  149. package/dist/types/configs/default-asset-storage.config.d.ts +1 -1
  150. package/dist/types/configs/default-sync.config.d.ts +1 -1
  151. package/dist/types/constants/version.d.ts +1 -1
  152. package/dist/types/interfaces/theme.interface.d.ts +8 -3
  153. package/dist/types/interfaces/tool-config.interface.d.ts +3 -6
  154. package/dist/types/interfaces/tool-type.interface.d.ts +1 -0
  155. package/dist/types/interfaces/tool.interface.d.ts +1 -0
  156. package/dist/types/stencil-public-runtime.d.ts +1 -0
  157. package/package.json +1 -1
  158. package/dist/components/p-C0wFAtT_.js +0 -1
  159. package/dist/components/p-CWgI1dA0.js +0 -1
  160. package/dist/components/p-DH-H7om7.js +0 -1
  161. package/dist/components/p-DIiGd0LS.js +0 -1
  162. package/dist/components/p-DLh8x1jK.js +0 -9
  163. package/dist/components/p-Dqjil3Hm.js +0 -1
  164. package/dist/components/p-IiG44Unz.js +0 -1
  165. package/dist/components/p-K7ySy791.js +0 -1
  166. package/dist/stencil/p-0c95e585.entry.js +0 -9
  167. package/dist/stencil/p-BcT1vV4J.js +0 -1
  168. /package/dist/components/{p-BWj1eE2b.js → p-B43upypT.js} +0 -0
  169. /package/dist/stencil/{p-D9HaikfQ.js → p-Dhio9uis.js} +0 -0
@@ -395,6 +395,87 @@ export class KritzelViewport {
395
395
  this.setViewport(centerWorldX, centerWorldY, scale);
396
396
  }
397
397
  }
398
+ /**
399
+ * Zooms in by a fixed step, centered on the current viewport center,
400
+ * with a smooth animation. The resulting scale is clamped to the allowed range.
401
+ * @param factor - Multiplicative zoom-in step
402
+ * @param duration - Animation duration in milliseconds
403
+ */
404
+ zoomIn(factor, duration) {
405
+ this.animateZoomAroundViewportCenter(factor, duration);
406
+ }
407
+ /**
408
+ * Zooms out by a fixed step, centered on the current viewport center,
409
+ * with a smooth animation. The resulting scale is clamped to the allowed range.
410
+ * @param factor - Multiplicative zoom-out step
411
+ * @param duration - Animation duration in milliseconds
412
+ */
413
+ zoomOut(factor, duration) {
414
+ this.animateZoomAroundViewportCenter(1 / factor, duration);
415
+ }
416
+ /**
417
+ * Smoothly zooms around the viewport center, keeping the center world point
418
+ * fixed for the entire animation. The translation is recomputed from the fixed
419
+ * center point on every frame (rather than interpolated independently), which
420
+ * guarantees the center never drifts and the viewport does not jump.
421
+ * The resulting scale is clamped to the allowed range and the translation is
422
+ * clamped to the viewport boundaries.
423
+ * @param scaleFactor - Multiplicative scale factor (>1 zooms in, <1 zooms out)
424
+ * @param duration - Animation duration in milliseconds
425
+ */
426
+ animateZoomAroundViewportCenter(scaleFactor, duration) {
427
+ this.cancelViewportAnimation();
428
+ const state = this._core.store.state;
429
+ const startScale = state.scale;
430
+ const effectiveMinScale = this.getEffectiveMinScale();
431
+ const targetScale = Math.min(state.scaleMax, Math.max(effectiveMinScale, startScale * scaleFactor));
432
+ // The world point currently under the viewport center stays fixed.
433
+ const centerScreenX = state.viewportWidth / 2;
434
+ const centerScreenY = state.viewportHeight / 2;
435
+ const centerWorldX = (centerScreenX - state.translateX) / startScale;
436
+ const centerWorldY = (centerScreenY - state.translateY) / startScale;
437
+ if (targetScale === startScale || duration <= 0) {
438
+ this.applyZoomAroundCenter(targetScale, centerScreenX, centerScreenY, centerWorldX, centerWorldY);
439
+ state.isScaling = true;
440
+ this._core.rerender();
441
+ this._debounceUpdate();
442
+ this._debounceEndScaling();
443
+ return;
444
+ }
445
+ const startTime = performance.now();
446
+ state.isScaling = true;
447
+ const animate = (currentTime) => {
448
+ const elapsed = currentTime - startTime;
449
+ const progress = Math.min(elapsed / duration, 1);
450
+ // easeInOutCubic for a smooth ramp in and out
451
+ const eased = progress < 0.5 ? 4 * progress * progress * progress : 1 - Math.pow(-2 * progress + 2, 3) / 2;
452
+ const frameScale = startScale + (targetScale - startScale) * eased;
453
+ this.applyZoomAroundCenter(frameScale, centerScreenX, centerScreenY, centerWorldX, centerWorldY);
454
+ this._core.rerender();
455
+ if (progress < 1) {
456
+ this._animationFrameId = requestAnimationFrame(animate);
457
+ }
458
+ else {
459
+ this._animationFrameId = null;
460
+ state.isScaling = false;
461
+ this._core.rerender();
462
+ this._debounceUpdate();
463
+ }
464
+ };
465
+ this._animationFrameId = requestAnimationFrame(animate);
466
+ }
467
+ /**
468
+ * Applies a single zoom step that keeps the given world point anchored to the
469
+ * given screen point at the specified scale, clamped to the viewport boundaries.
470
+ */
471
+ applyZoomAroundCenter(scale, screenX, screenY, worldX, worldY) {
472
+ const state = this._core.store.state;
473
+ state.scale = scale;
474
+ const clamped = this.clampTranslate(screenX - worldX * scale, screenY - worldY * scale);
475
+ state.translateX = clamped.translateX;
476
+ state.translateY = clamped.translateY;
477
+ state.hasViewportChanged = true;
478
+ }
398
479
  /**
399
480
  * Centers a given object in the viewport without changing the scale.
400
481
  * The object's center point will be positioned at the viewport center.
@@ -651,22 +732,21 @@ export class KritzelViewport {
651
732
  return true;
652
733
  }
653
734
  /**
654
- * Centers and fits ALL objects in the viewport, including objects not currently rendered.
655
- * Calculates the combined bounding box of all objects and optionally animates the viewport to show them.
735
+ * Centers and fits the provided objects in the viewport.
736
+ * Calculates the combined bounding box of the provided objects and optionally animates the viewport to show them.
737
+ * @param objects - Objects to include in the fit operation.
656
738
  * @param animate - Whether to animate the viewport transition (default: true)
657
- * @returns true if objects were found and viewport was adjusted, false if no objects exist
739
+ * @returns true if at least one object was provided and viewport was adjusted, false otherwise
658
740
  */
659
- centerFitAllObjects(animate = true) {
660
- const allObjects = this._core.store.allNonSelectionObjects;
661
- if (allObjects.length === 0) {
741
+ centerFitObjects(objects, animate = true) {
742
+ if (objects.length === 0) {
662
743
  return false;
663
744
  }
664
- // Calculate combined bounds of all objects
665
745
  let minX = Infinity;
666
746
  let minY = Infinity;
667
747
  let maxX = -Infinity;
668
748
  let maxY = -Infinity;
669
- for (const obj of allObjects) {
749
+ for (const obj of objects) {
670
750
  const bounds = obj.rotatedBoundingBox;
671
751
  minX = Math.min(minX, bounds.x);
672
752
  minY = Math.min(minY, bounds.y);
@@ -689,4 +769,13 @@ export class KritzelViewport {
689
769
  this.animateViewportTo(targetTranslateX, targetTranslateY, clampedScale, animate ? 150 : 0);
690
770
  return true;
691
771
  }
772
+ /**
773
+ * Centers and fits ALL objects in the viewport, including objects not currently rendered.
774
+ * Calculates the combined bounding box of all objects and optionally animates the viewport to show them.
775
+ * @param animate - Whether to animate the viewport transition (default: true)
776
+ * @returns true if objects were found and viewport was adjusted, false if no objects exist
777
+ */
778
+ centerFitAllObjects(animate = true) {
779
+ return this.centerFitObjects(this._core.store.allNonSelectionObjects, animate);
780
+ }
692
781
  }
@@ -328,6 +328,68 @@ export class KritzelImage extends KritzelBaseObject {
328
328
  this.migrateLegacyDataUrlIfNeeded();
329
329
  }
330
330
  }
331
+ /**
332
+ * Prepares image objects for insertion into the canvas while preserving
333
+ * the standard object-first flow (`new KritzelImage(...); addObject(image)`).
334
+ *
335
+ * Behavior:
336
+ * - If `assetId` is already set, no-op.
337
+ * - If `src` is set (URL or data URL), uploads bytes through the asset
338
+ * resolver, fills `assetId`/`mimeType`, computes dimensions when needed,
339
+ * and seeds `resolvedSrc` for immediate rendering.
340
+ */
341
+ async prepareForInsert() {
342
+ if (this.assetId || !this.src) {
343
+ return;
344
+ }
345
+ if (!this._core?.assetResolver) {
346
+ return;
347
+ }
348
+ const source = this.src;
349
+ const response = await fetch(source);
350
+ if (!response.ok) {
351
+ throw new Error(`Failed to load image source: ${source} (HTTP ${response.status})`);
352
+ }
353
+ const blob = await response.blob();
354
+ const mimeType = blob.type || 'image/png';
355
+ const { naturalWidth, naturalHeight } = await this.measureImageBlob(blob);
356
+ const asset = await this._core.assetResolver.put(blob, {
357
+ mimeType,
358
+ kind: 'image',
359
+ width: naturalWidth,
360
+ height: naturalHeight,
361
+ });
362
+ this.assetId = asset.id;
363
+ this.mimeType = asset.mimeType;
364
+ if (this.width <= 0 || this.height <= 0) {
365
+ const { scaledWidth, scaledHeight } = this.calculateScaledDimensions({
366
+ width: naturalWidth,
367
+ height: naturalHeight,
368
+ });
369
+ this.width = scaledWidth;
370
+ this.height = scaledHeight;
371
+ }
372
+ this.resolvedSrc = await this._core.assetResolver.resolve(asset.id);
373
+ this.loadState = 'ready';
374
+ this.src = '';
375
+ }
376
+ /**
377
+ * Measures intrinsic image dimensions from a Blob.
378
+ */
379
+ async measureImageBlob(blob) {
380
+ const objectUrl = URL.createObjectURL(blob);
381
+ try {
382
+ return await new Promise((resolve, reject) => {
383
+ const img = new Image();
384
+ img.onload = () => resolve({ naturalWidth: img.naturalWidth, naturalHeight: img.naturalHeight });
385
+ img.onerror = err => reject(err);
386
+ img.src = objectUrl;
387
+ });
388
+ }
389
+ finally {
390
+ URL.revokeObjectURL(objectUrl);
391
+ }
392
+ }
331
393
  /**
332
394
  * Overrides base mount to kick off asset resolution the first time
333
395
  * the image is attached to the DOM. Legacy images persisted with an
@@ -68,6 +68,8 @@ export class KritzelShape extends KritzelBaseObject {
68
68
  */
69
69
  constructor(config) {
70
70
  super();
71
+ // Always create the editor so setContent() works immediately
72
+ this.editor = this.createEditor();
71
73
  if (config) {
72
74
  this.x = config.x ?? 0;
73
75
  this.y = config.y ?? 0;
@@ -118,7 +120,6 @@ export class KritzelShape extends KritzelBaseObject {
118
120
  object.scaleFactor = 1;
119
121
  object.scale = config?.scale ?? core.store.state.scale;
120
122
  object.zIndex = core.store.currentZIndex;
121
- object.editor = object.createEditor();
122
123
  // Compute world-space translateX/Y from screen-space coordinates
123
124
  // This follows the same pattern as KritzelPath.updateDimensions()
124
125
  object.updateDimensions();
@@ -6,6 +6,8 @@
6
6
  export class KritzelBaseTool {
7
7
  /** Class name identifier used for serialization/deserialization */
8
8
  __class__ = this.constructor.name;
9
+ /** Identifies the tool type for config resolution (survives minification and dual-package bundling) */
10
+ toolType = 'base';
9
11
  /** Human-readable name of the tool */
10
12
  name = 'base-tool';
11
13
  /** Reference to the Kritzel core instance for accessing store, viewport, and other core functionality */
@@ -9,6 +9,7 @@ import { DEFAULT_STROKE_SIZES } from "../../constants/stroke-size.constants";
9
9
  * Supports mouse, touch, and pen input with configurable color, size, and opacity.
10
10
  */
11
11
  export class KritzelBrushTool extends KritzelBaseTool {
12
+ toolType = 'brush';
12
13
  /** The color of the brush stroke (supports theme-aware light/dark colors) */
13
14
  color = DEFAULT_COLOR_PALETTE[0];
14
15
  /** The width of the brush stroke in pixels */
@@ -6,6 +6,7 @@ import { KritzelBaseTool } from "./base-tool.class";
6
6
  * and deleted when the gesture completes. Supports mouse, touch, and pen input.
7
7
  */
8
8
  export class KritzelEraserTool extends KritzelBaseTool {
9
+ toolType = 'eraser';
9
10
  /** Timeout handle for delayed touch start activation to prevent accidental erasing */
10
11
  touchStartTimeout = null;
11
12
  /**
@@ -15,6 +15,7 @@ import imageCompression from "browser-image-compression";
15
15
  * the id to a URL via the asset resolver.
16
16
  */
17
17
  export class KritzelImageTool extends KritzelBaseTool {
18
+ toolType = 'image';
18
19
  /** Hidden file input element for image selection */
19
20
  fileInput = null;
20
21
  /** Maximum dimension (width or height) for image compression in pixels */
@@ -11,6 +11,7 @@ import { DEFAULT_STROKE_SIZES } from "../../constants/stroke-size.constants";
11
11
  * Automatically switches to selection tool after line completion.
12
12
  */
13
13
  export class KritzelLineTool extends KritzelBaseTool {
14
+ toolType = 'line';
14
15
  /** The stroke color of the line (supports theme-aware light/dark colors) */
15
16
  color = DEFAULT_COLOR_PALETTE[0];
16
17
  /** The stroke width of the line in pixels */
@@ -22,6 +22,7 @@ import { DEFAULT_COLOR_PALETTE } from "../../constants/color-palette.constants";
22
22
  * to specialized handlers (selection, move, resize, rotation, hover, line handle).
23
23
  */
24
24
  export class KritzelSelectionTool extends KritzelBaseTool {
25
+ toolType = 'selection';
25
26
  /** Handler for selection box and object selection logic */
26
27
  selectionHandler;
27
28
  /** Handler for moving selected objects */
@@ -11,6 +11,7 @@ import { DEFAULT_STROKE_SIZES } from "../../constants/stroke-size.constants";
11
11
  * Automatically switches to selection tool after shape completion.
12
12
  */
13
13
  export class KritzelShapeTool extends KritzelBaseTool {
14
+ toolType = 'shape';
14
15
  /** The type of shape to create (rectangle, ellipse, etc.) */
15
16
  shapeType = ShapeType.Rectangle;
16
17
  /** The fill color of the shape (supports theme-aware light/dark colors) */
@@ -10,6 +10,7 @@ import { DEFAULT_FONT_SIZES } from "../../constants/stroke-size.constants";
10
10
  * Supports configurable font family, size, color, and opacity.
11
11
  */
12
12
  export class KritzelTextTool extends KritzelBaseTool {
13
+ toolType = 'text';
13
14
  /** Backing field for {@link fontFamily}. */
14
15
  _fontFamily = 'Arial';
15
16
  /** Backing field for {@link fontSize}. */
@@ -47,7 +47,7 @@
47
47
  "mixins": [],
48
48
  "compiler": {
49
49
  "name": "@stencil/core",
50
- "version": "4.43.4",
50
+ "version": "4.43.5",
51
51
  "typescriptVersion": "5.8.3"
52
52
  },
53
53
  "collections": [],
@@ -194,15 +194,7 @@ export class KritzelEditor {
194
194
  /** The element to use as the target for the cursor. Defaults to the editor container if not set. */
195
195
  cursorTarget;
196
196
  /** Optional login configuration. When provided, a "Sign in" button is shown that opens a login dialog with the configured providers. */
197
- loginConfig = {
198
- providers: [
199
- {
200
- label: 'Sign in with Google',
201
- icon: 'google',
202
- name: 'Google',
203
- },
204
- ],
205
- };
197
+ loginConfig;
206
198
  /** Whether the editor is in a loading state. When true, a loading overlay is displayed. */
207
199
  isLoading = false;
208
200
  /** Optional unique identifier for namespacing storage keys across multiple editor instances. */
@@ -331,12 +323,18 @@ export class KritzelEditor {
331
323
  async centerObjectInViewport(object) {
332
324
  return this.engineRef.centerObjectInViewport(object);
333
325
  }
326
+ async panToObject(object) {
327
+ return this.engineRef.panToObject(object);
328
+ }
334
329
  async backToContent() {
335
330
  return this.engineRef.backToContent();
336
331
  }
337
332
  async centerAllObjects(animate = true) {
338
333
  return this.engineRef.centerAllObjects(animate);
339
334
  }
335
+ async centerObjects(objects, animate = true) {
336
+ return this.engineRef.centerObjects(objects, animate);
337
+ }
340
338
  async setViewport(x, y, scale) {
341
339
  return this.engineRef.setViewport(x, y, scale);
342
340
  }
@@ -346,6 +344,12 @@ export class KritzelEditor {
346
344
  async zoomTo(scale, worldX, worldY) {
347
345
  return this.engineRef.zoomTo(scale, worldX, worldY);
348
346
  }
347
+ async zoomIn(factor = 1.6, duration = 200) {
348
+ return this.engineRef.zoomIn(factor, duration);
349
+ }
350
+ async zoomOut(factor = 1.6, duration = 200) {
351
+ return this.engineRef.zoomOut(factor, duration);
352
+ }
349
353
  async getViewport() {
350
354
  return this.engineRef.getViewport();
351
355
  }
@@ -431,14 +435,14 @@ export class KritzelEditor {
431
435
  async redo() {
432
436
  return this.engineRef.redo();
433
437
  }
434
- async getScreenshot(format = 'png') {
435
- return this.engineRef.getScreenshot(format);
438
+ async getScreenshot(format = 'png', options) {
439
+ return this.engineRef.getScreenshot(format, options);
436
440
  }
437
- async exportViewportAsPng() {
438
- return this.engineRef.exportViewportAsPng();
441
+ async exportViewportAsPng(options) {
442
+ return this.engineRef.exportViewportAsPng(options);
439
443
  }
440
- async exportViewportAsSvg() {
441
- return this.engineRef.exportViewportAsSvg();
444
+ async exportViewportAsSvg(options) {
445
+ return this.engineRef.exportViewportAsSvg(options);
442
446
  }
443
447
  async exportSelectedObjectsAsPng() {
444
448
  return this.engineRef.exportSelectedObjectsAsPng();
@@ -790,31 +794,31 @@ export class KritzelEditor {
790
794
  const isLoggedIn = this.isLoggedIn;
791
795
  const shouldShowCurrentUser = isLoggedIn;
792
796
  const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
793
- return (h(Host, { key: '440621eb23598732c63d4be92ae16785d84b3d6f', style: {
797
+ return (h(Host, { key: 'ffacaea5d3df12a3a8b448d31db3c5949053156c', style: {
794
798
  opacity: this.isEditorVisible ? '1' : '0',
795
799
  visibility: this.isEditorVisible ? 'visible' : 'hidden',
796
800
  transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
797
- } }, h("div", { key: 'b20c930c8094f7ab9db8fdb09428cf34a2cab024', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'a6ff7e54fb3d45f4a3b1d009b12d2f6229d14d87', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: 'a3cbb86082c2f0768b7457ec25740d27200e287b', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), h("kritzel-engine", { key: '82e611de33c40997943e1fd702f0b601fadbf591', ref: el => {
801
+ } }, h("div", { key: '669eafee25b4f84c39469738a1337c21ab03e388', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'd6feb4a71c3286830fbe53a533f283c8af9a0385', visible: this.isWorkspaceManagerVisible, workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '5bd0e6263d51119b197292b69879c1ae437f92fc', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), h("kritzel-engine", { key: '468f17137c51c90fd61c9179d13c449b1ac8feb9', ref: el => {
798
802
  if (el) {
799
803
  this.engineRef = el;
800
804
  }
801
- }, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.theme, themes: this.themes, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), h("kritzel-controls", { key: 'eb48df395318bde3fc0bc48784510bf5139bc9e8', visible: this.isControlsVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
805
+ }, workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, isObjectDistanceFadingActive: this.isObjectDistanceFadingActive, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, isLoading: this.isLoading, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.theme, themes: this.themes, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), h("kritzel-controls", { key: '848c30b27fb916c8480b41745bd6ec844e0b23a2', visible: this.isControlsVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
802
806
  if (el) {
803
807
  this.controlsRef = el;
804
808
  }
805
- }, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: '1259089ca70c634621f7e2db274868b12a3e5e8a', class: "top-right-buttons" }, h("kritzel-settings", { key: 'b38b01040714827a5d824694b481edb8094eafd8', ref: el => {
809
+ }, controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: 'e998d60679c767d15617bd7ecde5ee77e781a92f', class: "top-right-buttons" }, h("kritzel-settings", { key: '43b9cdb2d10de789cc03d2a9ef5df870b8ca7bfe', ref: el => {
806
810
  if (el) {
807
811
  this.settingsRef = el;
808
812
  }
809
- }, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: 'a678999cac4f3618c44d1340b6905ec2f3061dd5', ref: el => {
813
+ }, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], settings: this.currentSettingsConfig, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '74669624a1e5177125ef00e1667c880ce47cbce4', ref: el => {
810
814
  if (el) {
811
815
  this.exportRef = el;
812
816
  }
813
- }, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '7d0b70c7347e7fda4e96a59b27b8fb6c2eb77f49', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: 'ed364648df937fb1e84d850953fee51f6e54e95e', user: this.user }), shouldShowLoginButton && (h("kritzel-button", { key: 'dd24afa0746a311ac4a27000281fef28bddf844a', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in")), h("kritzel-more-menu", { key: '713da1a5313809083470a8a23c0531e9e198c4bd', items: this.moreMenuItems, visible: this.isMoreMenuVisible }), h("kritzel-share-dialog", { key: '37f80fdb7b1087926b72ece7693f816c9f85f746', ref: el => {
817
+ }, workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '18d925f32d021ff6713accb22d0594d259d70f2e', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: 'bddd5c29c5f17cced47276c237c04cfdb711da38', user: this.user }), shouldShowLoginButton && (h("kritzel-button", { key: '4eb6c85459f59863d6e644ecf21c2295da71bafc', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in")), h("kritzel-more-menu", { key: 'a5a323ec248bebc7bc07898f344e0926fac8db17', items: this.moreMenuItems, visible: this.isMoreMenuVisible }), h("kritzel-share-dialog", { key: '8cb3ddad95d36f5b7ad59d8c4f057df93cb2bfe3', ref: el => {
814
818
  if (el) {
815
819
  this.shareDialogRef = el;
816
820
  }
817
- }, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: 'f5b59522082824bc236784a9083f1d425852d487', ref: el => {
821
+ }, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '35395d0faadcfeb021fba685aa46e180e47d2be2', ref: el => {
818
822
  if (el) {
819
823
  this.loginDialogRef = el;
820
824
  }
@@ -851,7 +855,7 @@ export class KritzelEditor {
851
855
  "setter": false,
852
856
  "reflect": false,
853
857
  "attribute": "scale-max",
854
- "defaultValue": "ABSOLUTE_SCALE_MAX"
858
+ "defaultValue": "1000"
855
859
  },
856
860
  "scaleMin": {
857
861
  "type": "number",
@@ -871,7 +875,7 @@ export class KritzelEditor {
871
875
  "setter": false,
872
876
  "reflect": false,
873
877
  "attribute": "scale-min",
874
- "defaultValue": "ABSOLUTE_SCALE_MIN"
878
+ "defaultValue": "0.0001"
875
879
  },
876
880
  "lockDrawingScale": {
877
881
  "type": "boolean",
@@ -1338,7 +1342,7 @@ export class KritzelEditor {
1338
1342
  },
1339
1343
  "getter": false,
1340
1344
  "setter": false,
1341
- "defaultValue": "DEFAULT_SYNC_CONFIG"
1345
+ "defaultValue": "{\n providers: [],\n}"
1342
1346
  },
1343
1347
  "assetStorageConfig": {
1344
1348
  "type": "unknown",
@@ -1363,7 +1367,7 @@ export class KritzelEditor {
1363
1367
  },
1364
1368
  "getter": false,
1365
1369
  "setter": false,
1366
- "defaultValue": "DEFAULT_ASSET_STORAGE_CONFIG"
1370
+ "defaultValue": "{\n providers: [],\n}"
1367
1371
  },
1368
1372
  "cursorTarget": {
1369
1373
  "type": "unknown",
@@ -1409,8 +1413,7 @@ export class KritzelEditor {
1409
1413
  "text": "Optional login configuration. When provided, a \"Sign in\" button is shown that opens a login dialog with the configured providers."
1410
1414
  },
1411
1415
  "getter": false,
1412
- "setter": false,
1413
- "defaultValue": "{\n providers: [\n {\n label: 'Sign in with Google',\n icon: 'google',\n name: 'Google',\n },\n ],\n }"
1416
+ "setter": false
1414
1417
  },
1415
1418
  "isLoading": {
1416
1419
  "type": "boolean",
@@ -2094,6 +2097,33 @@ export class KritzelEditor {
2094
2097
  "tags": []
2095
2098
  }
2096
2099
  },
2100
+ "panToObject": {
2101
+ "complexType": {
2102
+ "signature": "(object: KritzelBaseObject) => Promise<void>",
2103
+ "parameters": [{
2104
+ "name": "object",
2105
+ "type": "KritzelBaseObject<HTMLElement | SVGElement>",
2106
+ "docs": ""
2107
+ }],
2108
+ "references": {
2109
+ "Promise": {
2110
+ "location": "global",
2111
+ "id": "global::Promise"
2112
+ },
2113
+ "KritzelBaseObject": {
2114
+ "location": "import",
2115
+ "path": "../../../classes/objects/base-object.class",
2116
+ "id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
2117
+ "referenceLocation": "KritzelBaseObject"
2118
+ }
2119
+ },
2120
+ "return": "Promise<void>"
2121
+ },
2122
+ "docs": {
2123
+ "text": "",
2124
+ "tags": []
2125
+ }
2126
+ },
2097
2127
  "backToContent": {
2098
2128
  "complexType": {
2099
2129
  "signature": "() => Promise<boolean>",
@@ -2132,6 +2162,37 @@ export class KritzelEditor {
2132
2162
  "tags": []
2133
2163
  }
2134
2164
  },
2165
+ "centerObjects": {
2166
+ "complexType": {
2167
+ "signature": "(objects: KritzelBaseObject[], animate?: boolean) => Promise<boolean>",
2168
+ "parameters": [{
2169
+ "name": "objects",
2170
+ "type": "KritzelBaseObject<HTMLElement | SVGElement>[]",
2171
+ "docs": ""
2172
+ }, {
2173
+ "name": "animate",
2174
+ "type": "boolean",
2175
+ "docs": ""
2176
+ }],
2177
+ "references": {
2178
+ "Promise": {
2179
+ "location": "global",
2180
+ "id": "global::Promise"
2181
+ },
2182
+ "KritzelBaseObject": {
2183
+ "location": "import",
2184
+ "path": "../../../classes/objects/base-object.class",
2185
+ "id": "src/classes/objects/base-object.class.ts::KritzelBaseObject",
2186
+ "referenceLocation": "KritzelBaseObject"
2187
+ }
2188
+ },
2189
+ "return": "Promise<boolean>"
2190
+ },
2191
+ "docs": {
2192
+ "text": "",
2193
+ "tags": []
2194
+ }
2195
+ },
2135
2196
  "setViewport": {
2136
2197
  "complexType": {
2137
2198
  "signature": "(x: number, y: number, scale: number) => Promise<void>",
@@ -2215,6 +2276,56 @@ export class KritzelEditor {
2215
2276
  "tags": []
2216
2277
  }
2217
2278
  },
2279
+ "zoomIn": {
2280
+ "complexType": {
2281
+ "signature": "(factor?: number, duration?: number) => Promise<void>",
2282
+ "parameters": [{
2283
+ "name": "factor",
2284
+ "type": "number",
2285
+ "docs": ""
2286
+ }, {
2287
+ "name": "duration",
2288
+ "type": "number",
2289
+ "docs": ""
2290
+ }],
2291
+ "references": {
2292
+ "Promise": {
2293
+ "location": "global",
2294
+ "id": "global::Promise"
2295
+ }
2296
+ },
2297
+ "return": "Promise<void>"
2298
+ },
2299
+ "docs": {
2300
+ "text": "",
2301
+ "tags": []
2302
+ }
2303
+ },
2304
+ "zoomOut": {
2305
+ "complexType": {
2306
+ "signature": "(factor?: number, duration?: number) => Promise<void>",
2307
+ "parameters": [{
2308
+ "name": "factor",
2309
+ "type": "number",
2310
+ "docs": ""
2311
+ }, {
2312
+ "name": "duration",
2313
+ "type": "number",
2314
+ "docs": ""
2315
+ }],
2316
+ "references": {
2317
+ "Promise": {
2318
+ "location": "global",
2319
+ "id": "global::Promise"
2320
+ }
2321
+ },
2322
+ "return": "Promise<void>"
2323
+ },
2324
+ "docs": {
2325
+ "text": "",
2326
+ "tags": []
2327
+ }
2328
+ },
2218
2329
  "getViewport": {
2219
2330
  "complexType": {
2220
2331
  "signature": "() => Promise<KritzelViewportState>",
@@ -2875,11 +2986,15 @@ export class KritzelEditor {
2875
2986
  },
2876
2987
  "getScreenshot": {
2877
2988
  "complexType": {
2878
- "signature": "(format?: \"png\" | \"svg\") => Promise<string | null>",
2989
+ "signature": "(format?: \"png\" | \"svg\", options?: { includeBackground?: boolean; }) => Promise<string | null>",
2879
2990
  "parameters": [{
2880
2991
  "name": "format",
2881
2992
  "type": "\"svg\" | \"png\"",
2882
2993
  "docs": ""
2994
+ }, {
2995
+ "name": "options",
2996
+ "type": "{ includeBackground?: boolean; }",
2997
+ "docs": ""
2883
2998
  }],
2884
2999
  "references": {
2885
3000
  "Promise": {
@@ -2896,8 +3011,12 @@ export class KritzelEditor {
2896
3011
  },
2897
3012
  "exportViewportAsPng": {
2898
3013
  "complexType": {
2899
- "signature": "() => Promise<void>",
2900
- "parameters": [],
3014
+ "signature": "(options?: { includeBackground?: boolean; }) => Promise<void>",
3015
+ "parameters": [{
3016
+ "name": "options",
3017
+ "type": "{ includeBackground?: boolean; }",
3018
+ "docs": ""
3019
+ }],
2901
3020
  "references": {
2902
3021
  "Promise": {
2903
3022
  "location": "global",
@@ -2913,8 +3032,12 @@ export class KritzelEditor {
2913
3032
  },
2914
3033
  "exportViewportAsSvg": {
2915
3034
  "complexType": {
2916
- "signature": "() => Promise<void>",
2917
- "parameters": [],
3035
+ "signature": "(options?: { includeBackground?: boolean; }) => Promise<void>",
3036
+ "parameters": [{
3037
+ "name": "options",
3038
+ "type": "{ includeBackground?: boolean; }",
3039
+ "docs": ""
3040
+ }],
2918
3041
  "references": {
2919
3042
  "Promise": {
2920
3043
  "location": "global",