kritzel-stencil 0.4.7 → 0.4.9

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 (113) hide show
  1. package/dist/cjs/index.cjs.js +9 -1
  2. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +1396 -1243
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{schema.constants-C8hqt--r.js → schema.constants-ByNZ_qAj.js} +136 -7
  5. package/dist/cjs/stencil.cjs.js +1 -1
  6. package/dist/collection/classes/handlers/line-handle.handler.js +1 -1
  7. package/dist/collection/classes/managers/license.manager.js +56 -0
  8. package/dist/collection/classes/objects/image.class.js +9 -0
  9. package/dist/collection/classes/objects/line.class.js +1 -1
  10. package/dist/collection/classes/objects/path.class.js +9 -0
  11. package/dist/collection/classes/objects/shape.class.js +12 -3
  12. package/dist/collection/classes/objects/text.class.js +1 -1
  13. package/dist/collection/classes/providers/sync/broadcast-sync-provider.class.js +1 -0
  14. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +2 -0
  15. package/dist/collection/classes/providers/sync/in-memory-sync-provider.class.js +1 -0
  16. package/dist/collection/classes/providers/sync/indexeddb-sync-provider.class.js +1 -0
  17. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +2 -0
  18. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +197 -67
  19. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +146 -172
  20. package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
  21. package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
  22. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
  23. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +90 -4
  24. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
  25. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
  26. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  27. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
  28. package/dist/collection/constants/license.constants.js +1 -1
  29. package/dist/collection/constants/version.js +1 -1
  30. package/dist/collection/helpers/object.helper.js +11 -0
  31. package/dist/collection/helpers/svg-export.helper.js +19 -9
  32. package/dist/collection/helpers/theme.helper.js +8 -0
  33. package/dist/collection/index.js +1 -0
  34. package/dist/collection/interfaces/object-export.interface.js +1 -0
  35. package/dist/collection/interfaces/sync-config.interface.js +21 -1
  36. package/dist/collection/themes/dark-theme.js +2 -0
  37. package/dist/collection/themes/light-theme.js +2 -0
  38. package/dist/components/index.js +11 -4
  39. package/dist/components/kritzel-awareness-cursors.js +1 -1
  40. package/dist/components/kritzel-color-palette.js +1 -1
  41. package/dist/components/kritzel-color.js +1 -1
  42. package/dist/components/kritzel-controls.js +1 -1
  43. package/dist/components/kritzel-editor.js +180 -83
  44. package/dist/components/kritzel-engine.js +1 -1
  45. package/dist/components/kritzel-export.js +1 -1
  46. package/dist/components/kritzel-loading-overlay.js +1 -1
  47. package/dist/components/kritzel-login-dialog.js +1 -1
  48. package/dist/components/kritzel-menu-item.js +1 -1
  49. package/dist/components/kritzel-menu.js +1 -1
  50. package/dist/components/kritzel-more-menu.js +1 -1
  51. package/dist/components/kritzel-portal.js +1 -1
  52. package/dist/components/kritzel-settings.js +1 -1
  53. package/dist/components/kritzel-share-dialog.js +1 -1
  54. package/dist/components/kritzel-split-button.js +1 -1
  55. package/dist/components/kritzel-stroke-size.js +1 -1
  56. package/dist/components/kritzel-tool-config.js +1 -1
  57. package/dist/components/kritzel-utility-panel.js +1 -1
  58. package/dist/components/kritzel-workspace-manager.js +1 -1
  59. package/dist/components/kritzel-zoom-panel.js +1 -1
  60. package/dist/components/{p-DwY5pghH.js → p-6rQICkGr.js} +1 -1
  61. package/dist/components/{p-DkH3hoLz.js → p-8ScektIm.js} +6 -6
  62. package/dist/components/{p-1nG2hxfJ.js → p-9m1cAVwG.js} +2 -2
  63. package/dist/components/{p-DkY7pIg5.js → p-BRGufCki.js} +95 -6
  64. package/dist/components/{p-BKOsmXB5.js → p-BqWiEmYI.js} +1 -1
  65. package/dist/components/{p-BLOPBDUF.js → p-C2CeSrTm.js} +1 -1
  66. package/dist/components/{p-zd7zXld8.js → p-CMZ09rB1.js} +1 -1
  67. package/dist/components/{p-BmyTdQGy.js → p-CURiiQfq.js} +12 -0
  68. package/dist/components/{p-DDbO5q-e.js → p-CXJZxJvp.js} +4 -4
  69. package/dist/components/{p-7Rt7ml3v.js → p-Cj0NElII.js} +1 -1
  70. package/dist/components/{p-Bm_BWQa4.js → p-Ckm1Aq0V.js} +1 -1
  71. package/dist/components/{p-BVEGQLBD.js → p-CoY7emAj.js} +1 -1
  72. package/dist/components/{p-BZxOukfY.js → p-Cr2z2UBL.js} +4 -4
  73. package/dist/components/{p-D0oplzU-.js → p-D7H8oxZb.js} +2 -2
  74. package/dist/components/{p-Dd-pMvlr.js → p-DPONTran.js} +11 -0
  75. package/dist/components/{p-BMRln59F.js → p-DW7WW4EN.js} +2 -2
  76. package/dist/components/{p-D8TOEhPY.js → p-DuVkk58V.js} +2 -2
  77. package/dist/components/{p-OLfoATNk.js → p-U9FjWrp-.js} +1 -1
  78. package/dist/components/{p-C2yi85nc.js → p-ZPPtEla5.js} +1213 -1131
  79. package/dist/components/{p-COjsYPir.js → p-dVfh-Sy9.js} +1 -1
  80. package/dist/components/{p-Ka7OWbnk.js → p-lQ7nfhOy.js} +12 -3
  81. package/dist/esm/index.js +9 -2
  82. package/dist/esm/kritzel-active-users_47.entry.js +1396 -1243
  83. package/dist/esm/loader.js +1 -1
  84. package/dist/esm/{schema.constants-uC7_X6yr.js → schema.constants-1t45c2_U.js} +136 -8
  85. package/dist/esm/stencil.js +1 -1
  86. package/dist/stencil/index.esm.js +9 -2
  87. package/dist/stencil/{p-uC7_X6yr.js → p-1t45c2_U.js} +136 -8
  88. package/dist/stencil/{p-472f2e90.entry.js → p-f5f088ea.entry.js} +1396 -1243
  89. package/dist/stencil/stencil.esm.js +1 -1
  90. package/dist/types/classes/managers/license.manager.d.ts +6 -0
  91. package/dist/types/classes/objects/image.class.d.ts +3 -0
  92. package/dist/types/classes/objects/path.class.d.ts +3 -0
  93. package/dist/types/classes/objects/shape.class.d.ts +3 -0
  94. package/dist/types/classes/providers/sync/broadcast-sync-provider.class.d.ts +1 -0
  95. package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +1 -0
  96. package/dist/types/classes/providers/sync/in-memory-sync-provider.class.d.ts +1 -0
  97. package/dist/types/classes/providers/sync/indexeddb-sync-provider.class.d.ts +1 -0
  98. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +1 -0
  99. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +15 -3
  100. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +16 -34
  101. package/dist/types/components/ui/kritzel-more-menu/kritzel-more-menu.d.ts +10 -1
  102. package/dist/types/components.d.ts +27 -26
  103. package/dist/types/constants/license.constants.d.ts +1 -1
  104. package/dist/types/constants/version.d.ts +1 -1
  105. package/dist/types/helpers/object.helper.d.ts +4 -0
  106. package/dist/types/helpers/theme.helper.d.ts +1 -0
  107. package/dist/types/index.d.ts +1 -0
  108. package/dist/types/interfaces/menu-item.interface.d.ts +1 -1
  109. package/dist/types/interfaces/object-export.interface.d.ts +20 -0
  110. package/dist/types/interfaces/sync-config.interface.d.ts +5 -0
  111. package/dist/types/interfaces/sync-provider.interface.d.ts +5 -0
  112. package/dist/types/interfaces/theme.interface.d.ts +2 -0
  113. package/package.json +1 -1
@@ -205,7 +205,7 @@ export class KritzelSettings {
205
205
  return (h("div", { class: "settings-categories-wrapper" }, h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'general' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.general.title', 'General Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.theme.label', 'Theme')), h("p", { class: "settings-description" }, this.t('settings.general.theme.description', 'Select a registered color theme for the editor interface.')), h("kritzel-dropdown", { options: this.availableThemes.map(t => ({ value: t, label: t })), value: this.theme, onValueChanged: this.handleThemeChange })), this.availableLocales.length > 0 && (h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.language.label', 'Language')), h("p", { class: "settings-description" }, this.t('settings.general.language.description', 'Select the display language for the editor interface.')), h("kritzel-dropdown", { options: this.availableLocales.map(l => ({ value: l.code, label: l.label })), value: this.locale, onValueChanged: this.handleLocaleChange }))), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale')), h("p", { class: "settings-description" }, this.t('settings.general.lockDrawingScale.description', 'When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.')), h("kritzel-slide-toggle", { checked: this.lockDrawingScale, label: this.t('settings.general.lockDrawingScale.label', 'Lock Drawing Scale'), onCheckedChange: this.handleLockDrawingScaleChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'viewport' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.viewport.title', 'Viewport Settings')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.minZoom.label', 'Minimum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.minZoom.description', 'Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.')), h("kritzel-numeric-input", { value: this.scaleMin, min: 0.0001, max: 1, step: 0.0001, onValueChange: this.handleScaleMinChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.maxZoom.label', 'Maximum Zoom Level')), h("p", { class: "settings-description" }, this.t('settings.viewport.maxZoom.description', 'Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.')), h("kritzel-numeric-input", { value: this.scaleMax, min: 1, max: 1000, step: 1, onValueChange: this.handleScaleMaxChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryLeft.label', 'Viewport Boundary Left')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryLeft.description', 'Left boundary in world coordinates. Set to limit how far left the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryLeft, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryLeftChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryRight.label', 'Viewport Boundary Right')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryRight.description', 'Right boundary in world coordinates. Set to limit how far right the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryRight, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryRightChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryTop.label', 'Viewport Boundary Top')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryTop.description', 'Top boundary in world coordinates. Set to limit how far up the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryTop, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryTopChange })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.viewport.boundaryBottom.label', 'Viewport Boundary Bottom')), h("p", { class: "settings-description" }, this.t('settings.viewport.boundaryBottom.description', 'Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.')), h("kritzel-numeric-input", { value: this.viewportBoundaryBottom, step: 100, placeholder: this.t('settings.viewport.boundaryPlaceholder', 'Infinite'), onValueChange: this.handleViewportBoundaryBottomChange }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'shortcuts' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.shortcuts.title', 'Keyboard Shortcuts')), h("div", { class: "shortcuts-list" }, Array.from(this.groupShortcutsByCategory()).map(([category, shortcuts]) => (h("div", { class: "shortcuts-category", key: category }, h("h4", { class: "shortcuts-category-title" }, category), h("div", { class: "shortcuts-group" }, shortcuts.map(shortcut => (h("div", { class: "shortcut-item", key: shortcut.key + shortcut.label }, h("span", { class: "shortcut-label" }, shortcut.label), h("kbd", { class: "shortcut-key" }, this.formatKeyCombo(shortcut)))))))))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'developer' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.developer.title', 'Developer Options')), h("div", { class: "settings-group" }, h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showViewportInfo.description', 'Display viewport debug information such as position, zoom level, and boundaries.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showViewportInfo, label: this.t('settings.developer.showViewportInfo.label', 'Show Viewport Info'), onCheckedChange: this.handleDebugInfoChange('showViewportInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showObjectInfo.label', 'Show Object Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showObjectInfo.description', 'Display debug information about objects on the canvas.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showObjectInfo, label: this.t('settings.developer.showObjectInfo.label', 'Show Object Info'), onCheckedChange: this.handleDebugInfoChange('showObjectInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showSyncProviderInfo.description', 'Display debug information about the sync provider connection status.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showSyncProviderInfo, label: this.t('settings.developer.showSyncProviderInfo.label', 'Show Sync Provider Info'), onCheckedChange: this.handleDebugInfoChange('showSyncProviderInfo') })), h("div", { class: "settings-item" }, h("label", { class: "settings-label" }, this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info')), h("p", { class: "settings-description" }, this.t('settings.developer.showMigrationInfo.description', 'Display debug information about data migrations.')), h("kritzel-slide-toggle", { checked: this.debugInfo.showMigrationInfo, label: this.t('settings.developer.showMigrationInfo.label', 'Show Migration Info'), onCheckedChange: this.handleDebugInfoChange('showMigrationInfo') }))))), h("div", { class: { 'settings-tab-panel': true, 'is-active': this.selectedCategoryId === 'about' } }, h("div", { class: "settings-content" }, h("h3", null, this.t('settings.about.title', 'About')), h("p", null, this.t('settings.about.description', 'Kritzel - A drawing application')), h("p", { class: "version-info" }, "Version ", KRITZEL_VERSION), h("p", { class: "version-info" }, "App-State Schema v", CURRENT_APP_STATE_SCHEMA_VERSION), h("p", { class: "version-info" }, "Workspace Schema v", CURRENT_WORKSPACE_SCHEMA_VERSION)))));
206
206
  }
207
207
  render() {
208
- return (h(Host, { key: '36bca8be04b34a37630d6aa5394595a8b394d180' }, h("kritzel-dialog", { key: '1e257904178fd9afa2bfbe4a758663fb366c8847', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: 'b7d9ad97d9b126ccf6e800e6c9032749635eb988', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
208
+ return (h(Host, { key: 'b8a899abd3dd55bc3493b7d124ac5505e2284036' }, h("kritzel-dialog", { key: '8d47f3548271e24a8a280a30139f04b2e4b4ec2b', isOpen: this.isDialogOpen, dialogTitle: this.t('settings.dialogTitle', 'Settings'), size: "large", contained: true, onDialogClose: this.closeDialog }, h("kritzel-master-detail", { key: 'a5213307761b84b8f5f67cb35409ab1c0c1fa57b', items: this.categories, selectedItemId: this.selectedCategoryId, onItemSelect: this.handleCategorySelect }, this.renderCategoryContent()))));
209
209
  }
210
210
  static get is() { return "kritzel-settings"; }
211
211
  static get encapsulation() { return "shadow"; }
@@ -123,9 +123,9 @@ export class KritzelShareDialog {
123
123
  this.dialogClosed.emit();
124
124
  };
125
125
  render() {
126
- return (h(Host, { key: 'd30a468b9443f76731b207cb5caec1911f378c15' }, h("kritzel-dialog", { key: '4a4ec0a2becba58a49a87fc411a82e26557d8232', dialogTitle: this.terms['share.dialogTitle'] ?? 'Share Workspace', size: "small", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, contained: true }, h("div", { key: '0b2fec3db6c039752429768fb4bd6a2150a4345e', class: "share-content" }, h("div", { key: 'bd0b85f8418d0c46d14b718024ed62b9f72e4f52', class: "share-section" }, h("div", { key: 'bf62503a593454ffacd30d532fcd79dcbf938659', class: "share-row" }, h("div", { key: 'dfd9e83166b886d00fb5b097d0ccd77169c011bd', class: "share-label-group" }, h("label", { key: '67dba950ded47a08eb006c1628d14038b18171b5', class: "share-label" }, this.terms['share.linkSharing.label'] ?? 'Link sharing'), h("p", { key: '926f8670b35dab1e3e2a6496f44b5d6e0ee46417', class: "share-description" }, this.internalIsPublic
126
+ return (h(Host, { key: '75deaa66e6a6f640506985a8b3a2746892b5da07' }, h("kritzel-dialog", { key: '237413c9302e3756c5f7653e69326fac80d9e181', dialogTitle: this.terms['share.dialogTitle'] ?? 'Share Workspace', size: "small", isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, contained: true }, h("div", { key: '295394b851cc2210fece6f3e297dfbc0c516b0f7', class: "share-content" }, h("div", { key: 'df64d71f9c7a7064d36db6d0a196071f1e8835a9', class: "share-section" }, h("div", { key: '9db4902a5edd917efb5ad6c183f0862b12313635', class: "share-row" }, h("div", { key: '8ead1d363d3430a4e65fa3b5835401b0e20006db', class: "share-label-group" }, h("label", { key: '2f3c28a3909eab86a123ba6cf7386b79894717c5', class: "share-label" }, this.terms['share.linkSharing.label'] ?? 'Link sharing'), h("p", { key: '3167ae1ed6ff52abc531eafdd905f1397807f551', class: "share-description" }, this.internalIsPublic
127
127
  ? (this.terms['share.linkSharing.enabledDescription'] ?? 'Anyone with the link can access this workspace.')
128
- : (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: 'e42fabecb37fd21cc4907b966e2f50113b945eda', checked: this.internalIsPublic, onCheckedChange: this.handleToggleChange, label: this.terms['share.linkSharing.toggleLabel'] ?? 'Enable link sharing' }))), this.internalIsPublic && (h("div", { key: '40afacc81e0bbcf4c404ae32491e5142a32bca66', class: "share-section" }, h("div", { key: '57b6952670b1cbc789770362b573623035b50cf3', class: "share-url-container" }, h("input", { key: '0ee836655ca26c1e073d5d86014322939527c74b', type: "text", class: "share-url-input", value: this.getShareUrl(), readOnly: true, onClick: (e) => e.target.select() }), h("button", { key: '2d4661c1718bd8390dbe1146e8f9afe035934635', class: { 'copy-button': true, 'copy-success': this.copySuccess }, onClick: this.handleCopyUrl, title: this.copySuccess ? (this.terms['share.copyLink.copied'] ?? 'Copied!') : (this.terms['share.copyLink.title'] ?? 'Copy link') }, h("kritzel-icon", { key: 'b43bde94601c352b6065c89c026807d7efb3bcc3', name: this.copySuccess ? 'check' : 'copy', size: 18 }))), this.qrCodeDataUrl && (h("div", { key: 'f4d657aa918abbb3cf3ed039332d8c67247b83e8', class: "share-qr-container" }, h("img", { key: 'b165a446df3fba87918a19928734d39af1e6bfcf', class: "share-qr-image", src: this.qrCodeDataUrl, alt: "QR code for share link" })))))))));
128
+ : (this.terms['share.linkSharing.disabledDescription'] ?? 'Link sharing is disabled. Only you can access this workspace.'))), h("kritzel-slide-toggle", { key: '3ff608b262e2ff3fa779f7d1e9a4ee3c0b9a16c0', checked: this.internalIsPublic, onCheckedChange: this.handleToggleChange, label: this.terms['share.linkSharing.toggleLabel'] ?? 'Enable link sharing' }))), this.internalIsPublic && (h("div", { key: '355261384b0ed386f3b48c041bcf0039db0534c1', class: "share-section" }, h("div", { key: 'ad3d975c650757d0b6dbd5317c9bac4f98029e0c', class: "share-url-container" }, h("input", { key: '0da2cc9cb30f1da8bcab3aa82c679b8d685641bd', type: "text", class: "share-url-input", value: this.getShareUrl(), readOnly: true, onClick: (e) => e.target.select() }), h("button", { key: 'aee232b7a70b524d52a4b4cf9074c099d29a5300', class: { 'copy-button': true, 'copy-success': this.copySuccess }, onClick: this.handleCopyUrl, title: this.copySuccess ? (this.terms['share.copyLink.copied'] ?? 'Copied!') : (this.terms['share.copyLink.title'] ?? 'Copy link') }, h("kritzel-icon", { key: 'c151baf7b890dbf51c4f4831d60b0ebb1a5d05fa', name: this.copySuccess ? 'check' : 'copy', size: 18 }))), this.qrCodeDataUrl && (h("div", { key: '63b43efe3dc5929054af9e5ee7f64d093864b3b0', class: "share-qr-container" }, h("img", { key: '9d3b0418eb80ff8c7e9106ad86d7cc211d017504', class: "share-qr-image", src: this.qrCodeDataUrl, alt: "QR code for share link" })))))))));
129
129
  }
130
130
  static get is() { return "kritzel-share-dialog"; }
131
131
  static get encapsulation() { return "shadow"; }
@@ -19,7 +19,7 @@ export class KritzelUtilityPanel {
19
19
  this.redo.emit();
20
20
  }
21
21
  render() {
22
- return (h(Host, { key: '3e86e2c4c480ab56f4646a4f288ad37a63e29642' }, h("button", { key: 'e5282e42994f2de061ec36bf892f4da3fc01d2e5', class: "utility-button", "data-testid": "utility-undo", disabled: !this.undoState?.canUndo, onClick: event => this.handleUndo(event), "aria-label": this.terms['utility.undo'] ?? 'Undo' }, h("kritzel-icon", { key: '5a2b903cc3e5f9c554928f11a1c3098d569cbc4d', name: "undo" })), h("button", { key: '466cdff71501f34f0236b4dc60263817966d7b4a', class: "utility-button", "data-testid": "utility-redo", disabled: !this.undoState?.canRedo, onClick: event => this.handleRedo(event), "aria-label": this.terms['utility.redo'] ?? 'Redo' }, h("kritzel-icon", { key: '19209a95787f4475eda9dc0712c2bf36a573c953', name: "redo" })), h("div", { key: '7a463d5ac1f78017fb728abcd2c33061d8545978', class: "utility-separator" }), h("button", { key: '155c2bb50d70223e4f4d5377bacced56ffda68ad', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": this.terms['utility.delete'] ?? 'Delete selected items' }, h("kritzel-icon", { key: '47bd8469b9efe395e9185b3e7375c7375811c0aa', name: "delete" }))));
22
+ return (h(Host, { key: '001ee010d714513a4b5027f84cac4586c64e2260' }, h("button", { key: '6ba6cbf100e2ad9f81de6416b85f981cd1467f1c', class: "utility-button", "data-testid": "utility-undo", disabled: !this.undoState?.canUndo, onClick: event => this.handleUndo(event), "aria-label": this.terms['utility.undo'] ?? 'Undo' }, h("kritzel-icon", { key: 'b246d3964623e57e9458e5f0266a2f9e0565c646', name: "undo" })), h("button", { key: '1f5015fbd2fd84508bc8b8f295d35960bf31af5b', class: "utility-button", "data-testid": "utility-redo", disabled: !this.undoState?.canRedo, onClick: event => this.handleRedo(event), "aria-label": this.terms['utility.redo'] ?? 'Redo' }, h("kritzel-icon", { key: 'b3694d884707c6844a0036610990cdcfa74c6931', name: "redo" })), h("div", { key: '4f8f4725213d1453af11dc3b4c9ff271f1933df5', class: "utility-separator" }), h("button", { key: '5eba2c56dd96698538a48a8ea9f32fcf8b4d8402', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": this.terms['utility.delete'] ?? 'Delete selected items' }, h("kritzel-icon", { key: '268a186e4e7eaa1ea874ef23e72df511f86b0343', name: "delete" }))));
23
23
  }
24
24
  static get is() { return "kritzel-utility-panel"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -26,7 +26,7 @@ export class KritzelZoomPanel {
26
26
  return Number.isFinite(this.zoomPercent) ? Math.max(1, Math.round(this.zoomPercent)) : 100;
27
27
  }
28
28
  render() {
29
- return (h(Host, { key: '054e24893ed609c29b02cf574a68cf9311a3f025' }, h("div", { key: '42ad21dca9486ae350d5814b949e0c577a6ed996', class: { panel: true, visible: this.visible } }, h("button", { key: 'e360884e5a2edaada46d232cae8121f2c5f45bb6', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomOut'] ?? 'Zoom out', disabled: this.disabled, onClick: this.handleZoomOut }, h("kritzel-icon", { key: '8c8bb23c4ec4b78fd04aee5c0edd3371c4d14125', name: "minus" })), h("span", { key: '42ab93551c2fbb6d8d4ef076d66405277ba941bf', class: "zoom-level", "aria-live": "polite" }, this.normalizedZoomPercent, "%"), h("button", { key: '232f0f74b748999c6892549978bbe085636ca189', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomIn'] ?? 'Zoom in', disabled: this.disabled, onClick: this.handleZoomIn }, h("kritzel-icon", { key: '6f9b8ddd4c666573d9716d7bc455c2a3b1035ede', name: "plus" })))));
29
+ return (h(Host, { key: 'aa4a0194b7ba89a32e369ae5ce9a8c148c05574f' }, h("div", { key: 'c88d4b299210d2aff28e07815bcbd4864ff13afd', class: { panel: true, visible: this.visible } }, h("button", { key: 'bf2c78d32ba31c25dcfed0b1f87fbfaee776acc1', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomOut'] ?? 'Zoom out', disabled: this.disabled, onClick: this.handleZoomOut }, h("kritzel-icon", { key: '3d350d003ed9d0b4548929d0765aae5da82c41b0', name: "minus" })), h("span", { key: 'da6454d4c28b5bdde41300c21b6593d91ce08085', class: "zoom-level", "aria-live": "polite" }, this.normalizedZoomPercent, "%"), h("button", { key: 'cf314fb20dcff5b3e728eae2129978cb12942947', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomIn'] ?? 'Zoom in', disabled: this.disabled, onClick: this.handleZoomIn }, h("kritzel-icon", { key: '71ca263815fd1774d5511118d8217863adcac64b', name: "plus" })))));
30
30
  }
31
31
  static get is() { return "kritzel-zoom-panel"; }
32
32
  static get encapsulation() { return "shadow"; }
@@ -22,4 +22,4 @@ export const KRITZEL_LICENSE_TOKEN_PREFIX = 'KRTZL1.';
22
22
  * printed public key here. Replacing this value invalidates every license
23
23
  * signed with the previous key.
24
24
  */
25
- export const KRITZEL_LICENSE_PUBLIC_KEY = 'I-pYJlxDEjT94rwSaqhXW5Sv__fMKS-JKKnV3pg0PaM';
25
+ export const KRITZEL_LICENSE_PUBLIC_KEY = '2IwZDin-qV3kOt8SEQCqdaJsGT9S7tAGapUYJVnVGQo';
@@ -3,4 +3,4 @@
3
3
  * This file is auto-generated by the version bump scripts.
4
4
  * Do not modify manually.
5
5
  */
6
- export const KRITZEL_VERSION = '0.4.7';
6
+ export const KRITZEL_VERSION = '0.4.9';
@@ -15,4 +15,15 @@ export class ObjectHelper {
15
15
  static isClass(object, className) {
16
16
  return !!object && object.__class__ === className;
17
17
  }
18
+ static isKritzelExportable(object) {
19
+ if (!object || typeof object !== 'object') {
20
+ return false;
21
+ }
22
+ const candidate = object;
23
+ if (typeof candidate.getSupportedExportFormats !== 'function' || typeof candidate.exportAs !== 'function') {
24
+ return false;
25
+ }
26
+ const formats = candidate.getSupportedExportFormats();
27
+ return Array.isArray(formats) && formats.length > 0;
28
+ }
18
29
  }
@@ -346,14 +346,20 @@ export class KritzelSvgExportHelper {
346
346
  const scale = this.getObjectScale(text);
347
347
  // Convert ProseMirror content to HTML
348
348
  const htmlContent = this.prosemirrorToHtml(text.content, text, theme);
349
- // Calculate dimensions accounting for scale
349
+ // Calculate dimensions in SVG world units (world units = CSS px in a 1:1 SVG).
350
350
  const width = text.totalWidth / scale;
351
351
  const height = text.totalHeight / scale;
352
+ // Convert the font size from pt to SVG world units (px equivalent).
353
+ // text.fontSize is stored in CSS pt; 1 pt = 4/3 px at 96 dpi.
354
+ // We also bake in scaleFactor (user resize) and divide by the object scale so
355
+ // that the rendered font aligns with the world-unit dimensions above.
356
+ // The CSS transform: scale(scaleFactor) is removed from the div because the
357
+ // adjusted font-size already accounts for it – keeping both would double-scale
358
+ // the content and overflow the foreignObject.
359
+ const svgFontSizePx = (text.fontSize * (4 / 3) * (text.scaleFactor || 1) / scale).toFixed(4);
352
360
  return `<g transform="${transform}"${opacity}>
353
- <foreignObject x="0" y="0" width="${width}" height="${height}">
354
- <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${text.fontSize}pt; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; transform: scale(${text.scaleFactor}); transform-origin: top left; white-space: pre-wrap; word-wrap: break-word;">
355
- ${htmlContent}
356
- </div>
361
+ <foreignObject x="0" y="0" width="${width}" height="${height}" overflow="visible">
362
+ <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${svgFontSizePx}px; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; white-space: pre-wrap; word-wrap: break-word; width: 100%; margin: 0; padding: 0; box-sizing: border-box;">${htmlContent.trim()}</div>
357
363
  </foreignObject>
358
364
  </g>`;
359
365
  }
@@ -372,9 +378,13 @@ export class KritzelSvgExportHelper {
372
378
  const height = text.totalHeight / scale;
373
379
  const lines = this.prosemirrorToPlainTextLines(text.content);
374
380
  const resolvedLines = lines.length > 0 ? lines : [''];
375
- const resolvedFontSize = Math.max(1, text.fontSize * (text.scaleFactor || 1));
376
- const lineHeight = resolvedFontSize * 1.2;
377
- const startY = resolvedFontSize;
381
+ // Convert the font size from pt to SVG world units (px equivalent).
382
+ // text.fontSize is stored in CSS pt; 1 pt = 4/3 px at 96 dpi.
383
+ // We also bake in scaleFactor (user resize) and divide by the object scale so
384
+ // that the rendered lines align with the world-unit bounding box dimensions above.
385
+ const resolvedFontSizePx = Math.max(1, text.fontSize * (4 / 3) * (text.scaleFactor || 1) / scale);
386
+ const lineHeight = resolvedFontSizePx * 1.2;
387
+ const startY = resolvedFontSizePx;
378
388
  const bgRect = bgColor && bgColor !== 'transparent'
379
389
  ? `<rect x="0" y="0" width="${width}" height="${height}" fill="${bgColor}"/>`
380
390
  : '';
@@ -386,7 +396,7 @@ export class KritzelSvgExportHelper {
386
396
  .join('');
387
397
  return `<g transform="${transform}"${opacity}>
388
398
  ${bgRect}
389
- <text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSize}" fill="${fontColor}">${tspans}</text>
399
+ <text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSizePx}" fill="${fontColor}">${tspans}</text>
390
400
  </g>`;
391
401
  }
392
402
  /**
@@ -1,4 +1,5 @@
1
1
  export class ThemeHelper {
2
+ static appliedVariableNames = new WeakMap();
2
3
  /**
3
4
  * Converts a camelCase string to kebab-case.
4
5
  * @example ThemeHelper.camelToKebab('controlHoverBackgroundColor') → 'control-hover-background-color'
@@ -64,6 +65,13 @@ export class ThemeHelper {
64
65
  */
65
66
  static applyThemeToElement(element, theme) {
66
67
  const variables = ThemeHelper.flattenThemeToVariables(theme);
68
+ const previousVariableNames = ThemeHelper.appliedVariableNames.get(element);
69
+ for (const name of previousVariableNames ?? []) {
70
+ if (!variables.has(name)) {
71
+ element.style.removeProperty(name);
72
+ }
73
+ }
67
74
  ThemeHelper.applyVariablesToElement(element, variables);
75
+ ThemeHelper.appliedVariableNames.set(element, new Set(variables.keys()));
68
76
  }
69
77
  }
@@ -42,6 +42,7 @@ export * from './classes/registries/custom-element-renderer.registry';
42
42
  export * from './classes/registries/font-registry.class';
43
43
  export * from './interfaces/toolbar-control.interface';
44
44
  export * from './interfaces/menu-item.interface';
45
+ export * from './interfaces/object-export.interface';
45
46
  export * from './interfaces/object-change-event.interface';
46
47
  export * from './interfaces/custom-element-renderer.interface';
47
48
  export * from './interfaces/sync-provider.interface';
@@ -1 +1,21 @@
1
- export {};
1
+ /**
2
+ * Returns the provider type (`'local'` or `'network'`) for a given provider config entry.
3
+ * Works for both class constructors (via a static `type` property) and
4
+ * factory objects (via an optional `type` property on the factory).
5
+ */
6
+ function getProviderConfigType(config) {
7
+ if (typeof config === 'function') {
8
+ return config.type;
9
+ }
10
+ return config.type;
11
+ }
12
+ /**
13
+ * Returns `true` when the given sync configuration contains at least one remote
14
+ * (network) provider, meaning the share option should be available in the UI.
15
+ */
16
+ export function hasRemoteSyncProvider(syncConfig) {
17
+ if (!syncConfig?.providers?.length) {
18
+ return false;
19
+ }
20
+ return syncConfig.providers.some(p => getProviderConfigType(p) === 'network');
21
+ }
@@ -131,7 +131,9 @@ export const darkTheme = {
131
131
  },
132
132
  snap: {
133
133
  indicatorFill: 'rgba(10, 132, 255, 0.35)',
134
+ indicatorFillInactive: 'rgba(10, 132, 255, 0.2)',
134
135
  indicatorStroke: '#0A84FF',
136
+ indicatorStrokeInactive: 'rgba(255, 255, 255, 0.45)',
135
137
  lineStroke: 'rgba(255, 255, 255, 0.35)',
136
138
  },
137
139
  fontSize: {
@@ -132,7 +132,9 @@ export const lightTheme = {
132
132
  },
133
133
  snap: {
134
134
  indicatorFill: 'rgba(59, 130, 246, 0.3)',
135
+ indicatorFillInactive: 'rgba(59, 130, 246, 0.18)',
135
136
  indicatorStroke: '#007bff',
137
+ indicatorStrokeInactive: 'rgba(59, 130, 246, 0.5)',
136
138
  lineStroke: 'rgba(0, 0, 0, 0.2)',
137
139
  },
138
140
  fontSize: {
@@ -1,13 +1,13 @@
1
1
  export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-B43upypT.js';
2
- export { K as KritzelBaseObject, b as KritzelLine, a as KritzelPath } from './p-Ka7OWbnk.js';
3
- export { u as APP_STATE_MIGRATIONS, A as AssetNotFoundError, D as DE_LOCALE, E as EN_LOCALE, F as FR_LOCALE, I as IndexedDBAssetProvider, s as KritzelAlignment, o as KritzelAnchorManager, n as KritzelAssetResolver, e as KritzelBaseTool, f as KritzelBrushTool, l as KritzelCursorHelper, d as KritzelCustomElement, r as KritzelCustomElementRendererRegistry, h as KritzelEraserTool, b as KritzelGroup, a as KritzelImage, i as KritzelImageTool, q as KritzelLicenseManager, g as KritzelLineTool, p as KritzelLocalizationManager, m as KritzelSelectionTool, c as KritzelShape, k as KritzelShapeTool, K as KritzelText, j as KritzelTextTool, S as ShapeType, W as WORKSPACE_MIGRATIONS, t as runMigrations } from './p-C2yi85nc.js';
2
+ export { K as KritzelBaseObject, b as KritzelLine, a as KritzelPath } from './p-lQ7nfhOy.js';
3
+ export { u as APP_STATE_MIGRATIONS, A as AssetNotFoundError, D as DE_LOCALE, E as EN_LOCALE, F as FR_LOCALE, I as IndexedDBAssetProvider, s as KritzelAlignment, o as KritzelAnchorManager, n as KritzelAssetResolver, e as KritzelBaseTool, f as KritzelBrushTool, l as KritzelCursorHelper, d as KritzelCustomElement, r as KritzelCustomElementRendererRegistry, h as KritzelEraserTool, b as KritzelGroup, a as KritzelImage, i as KritzelImageTool, q as KritzelLicenseManager, g as KritzelLineTool, p as KritzelLocalizationManager, m as KritzelSelectionTool, c as KritzelShape, k as KritzelShapeTool, K as KritzelText, j as KritzelTextTool, S as ShapeType, W as WORKSPACE_MIGRATIONS, t as runMigrations } from './p-ZPPtEla5.js';
4
4
  import * as Y from 'yjs';
5
5
  import { IndexeddbPersistence } from 'y-indexeddb';
6
6
  import { WebsocketProvider } from 'y-websocket';
7
7
  import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './kritzel-editor.js';
8
- export { d as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, c as DEFAULT_LINE_TOOL_CONFIG, b as DEFAULT_TEXT_CONFIG, KritzelEditor, defineCustomElement as defineCustomElementKritzelEditor } from './kritzel-editor.js';
8
+ export { d as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, c as DEFAULT_LINE_TOOL_CONFIG, b as DEFAULT_TEXT_CONFIG, KritzelEditor, defineCustomElement as defineCustomElementKritzelEditor, h as hasRemoteSyncProvider } from './kritzel-editor.js';
9
9
  export { K as KritzelWorkspace, W as WORKSPACE_EXPORT_VERSION } from './p-DAwPPDMS.js';
10
- export { K as KritzelThemeManager, d as darkTheme, l as lightTheme } from './p-BmyTdQGy.js';
10
+ export { K as KritzelThemeManager, d as darkTheme, l as lightTheme } from './p-CURiiQfq.js';
11
11
  export { K as KritzelFontRegistry } from './p-DJkKlUyZ.js';
12
12
  export { C as CURRENT_APP_STATE_SCHEMA_VERSION, a as CURRENT_WORKSPACE_SCHEMA_VERSION } from './p-CW-VyJgK.js';
13
13
  export { KritzelActiveUsers, defineCustomElement as defineCustomElementKritzelActiveUsers } from './kritzel-active-users.js';
@@ -393,6 +393,7 @@ const readVarUint = decoder => {
393
393
  * This is a lightweight alternative to y-webrtc for browser-tab-only sync
394
394
  */
395
395
  class BroadcastSyncProvider {
396
+ static type = 'local';
396
397
  type = 'local';
397
398
  doc;
398
399
  channel;
@@ -499,6 +500,7 @@ const sessionCache = new Map();
499
500
  * is not desired.
500
501
  */
501
502
  class InMemorySyncProvider {
503
+ static type = 'local';
502
504
  type = 'local';
503
505
  doc;
504
506
  cacheKey;
@@ -557,6 +559,7 @@ class InMemorySyncProvider {
557
559
  * IndexedDB sync provider for local persistence
558
560
  */
559
561
  class IndexedDBSyncProvider {
562
+ static type = 'local';
560
563
  type = 'local';
561
564
  provider;
562
565
  isConnected = false;
@@ -595,6 +598,7 @@ class IndexedDBSyncProvider {
595
598
  * WebSocket sync provider for real-time collaboration
596
599
  */
597
600
  class WebSocketSyncProvider {
601
+ static type = 'network';
598
602
  type = 'network';
599
603
  provider;
600
604
  isConnected = false;
@@ -625,6 +629,7 @@ class WebSocketSyncProvider {
625
629
  */
626
630
  static with(options) {
627
631
  return {
632
+ type: 'network',
628
633
  create: (docName, doc, runtimeOptions) => {
629
634
  const mergedOptions = runtimeOptions ? { ...options, ...runtimeOptions } : options;
630
635
  return new WebSocketSyncProvider(docName, doc, mergedOptions);
@@ -701,6 +706,7 @@ class WebSocketSyncProvider {
701
706
  * Supports multiplexing - multiple documents can share the same WebSocket connection
702
707
  */
703
708
  class HocuspocusSyncProvider {
709
+ static type = 'network';
704
710
  type = 'network';
705
711
  provider;
706
712
  isConnected = false;
@@ -929,6 +935,7 @@ class HocuspocusSyncProvider {
929
935
  */
930
936
  static with(options) {
931
937
  return {
938
+ type: 'network',
932
939
  create: (docName, doc, runtimeOptions) => {
933
940
  const mergedOptions = runtimeOptions ? { ...options, ...runtimeOptions } : options;
934
941
  return new HocuspocusSyncProvider(docName, doc, mergedOptions);
@@ -1,4 +1,4 @@
1
- import { c as KritzelAwarenessCursors$1, d as defineCustomElement$1 } from './p-Ka7OWbnk.js';
1
+ import { c as KritzelAwarenessCursors$1, d as defineCustomElement$1 } from './p-lQ7nfhOy.js';
2
2
 
3
3
  const KritzelAwarenessCursors = KritzelAwarenessCursors$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { K as KritzelColorPalette$1, d as defineCustomElement$1 } from './p-1nG2hxfJ.js';
1
+ import { K as KritzelColorPalette$1, d as defineCustomElement$1 } from './p-9m1cAVwG.js';
2
2
 
3
3
  const KritzelColorPalette = KritzelColorPalette$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { K as KritzelColorComponent, d as defineCustomElement$1 } from './p-zd7zXld8.js';
1
+ import { K as KritzelColorComponent, d as defineCustomElement$1 } from './p-CMZ09rB1.js';
2
2
 
3
3
  const KritzelColor = KritzelColorComponent;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { K as KritzelControls$1, d as defineCustomElement$1 } from './p-DkH3hoLz.js';
1
+ import { K as KritzelControls$1, d as defineCustomElement$1 } from './p-8ScektIm.js';
2
2
 
3
3
  const KritzelControls = KritzelControls$1;
4
4
  const defineCustomElement = defineCustomElement$1;