kritzel-stencil 0.3.17 → 0.3.19

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 (158) hide show
  1. package/dist/cjs/index-Xav9JFHg.js +2 -2
  2. package/dist/cjs/index.cjs.js +1 -1
  3. package/dist/cjs/{kritzel-active-users_44.cjs.entry.js → kritzel-active-users_45.cjs.entry.js} +739 -310
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{schema.constants-DrHO_CYF.js → schema.constants-IBG5VW_J.js} +116 -59
  6. package/dist/cjs/stencil.cjs.js +1 -1
  7. package/dist/collection/classes/core/core.class.js +22 -210
  8. package/dist/collection/classes/handlers/key.handler.js +1 -22
  9. package/dist/collection/classes/managers/browser-permission.manager.js +64 -0
  10. package/dist/collection/classes/managers/clipboard.manager.js +401 -0
  11. package/dist/collection/classes/objects/image.class.js +42 -0
  12. package/dist/collection/classes/tools/image-tool.class.js +1 -59
  13. package/dist/collection/collection-manifest.json +1 -0
  14. package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +53 -0
  15. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +133 -53
  16. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +101 -43
  17. package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +1 -1
  18. package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
  19. package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
  20. package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
  21. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
  22. package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
  23. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
  24. package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
  25. package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
  26. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
  27. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
  28. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
  29. package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
  30. package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
  31. package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
  32. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
  33. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
  34. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
  35. package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
  36. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
  37. package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
  38. package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
  39. package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
  40. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
  41. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +1 -1
  42. package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -0
  43. package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.js +173 -0
  44. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
  45. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
  46. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  47. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
  48. package/dist/collection/configs/default-engine-config.js +0 -1
  49. package/dist/collection/constants/version.js +1 -1
  50. package/dist/collection/interfaces/notification.interface.js +1 -0
  51. package/dist/collection/themes/dark-theme.js +36 -0
  52. package/dist/collection/themes/light-theme.js +36 -0
  53. package/dist/components/index.d.ts +2 -0
  54. package/dist/components/index.js +1 -1
  55. package/dist/components/kritzel-active-users.js +1 -1
  56. package/dist/components/kritzel-avatar.js +1 -1
  57. package/dist/components/kritzel-awareness-cursors.js +1 -1
  58. package/dist/components/kritzel-back-to-content.js +1 -1
  59. package/dist/components/kritzel-button.js +1 -1
  60. package/dist/components/kritzel-color-palette.js +1 -1
  61. package/dist/components/kritzel-color.js +1 -1
  62. package/dist/components/kritzel-controls.js +1 -1
  63. package/dist/components/kritzel-current-user-dialog.js +1 -1
  64. package/dist/components/kritzel-current-user.js +1 -1
  65. package/dist/components/kritzel-editor.js +1 -1
  66. package/dist/components/kritzel-engine.js +1 -1
  67. package/dist/components/kritzel-export.js +1 -1
  68. package/dist/components/kritzel-font-size.js +1 -1
  69. package/dist/components/kritzel-font.js +1 -1
  70. package/dist/components/kritzel-input.js +1 -1
  71. package/dist/components/kritzel-login-dialog.js +1 -1
  72. package/dist/components/kritzel-master-detail.js +1 -1
  73. package/dist/components/kritzel-menu-item.js +1 -1
  74. package/dist/components/kritzel-menu.js +1 -1
  75. package/dist/components/kritzel-more-menu.js +1 -1
  76. package/dist/components/kritzel-notification-card.d.ts +11 -0
  77. package/dist/components/kritzel-notification-card.js +1 -0
  78. package/dist/components/kritzel-numeric-input.js +1 -1
  79. package/dist/components/kritzel-opacity-slider.js +1 -1
  80. package/dist/components/kritzel-portal.js +1 -1
  81. package/dist/components/kritzel-settings.js +1 -1
  82. package/dist/components/kritzel-share-dialog.js +1 -1
  83. package/dist/components/kritzel-slide-toggle.js +1 -1
  84. package/dist/components/kritzel-split-button.js +1 -1
  85. package/dist/components/kritzel-stroke-size.js +1 -1
  86. package/dist/components/kritzel-tool-config.js +1 -1
  87. package/dist/components/kritzel-tooltip.js +1 -1
  88. package/dist/components/kritzel-utility-panel.js +1 -1
  89. package/dist/components/kritzel-watermark.js +1 -1
  90. package/dist/components/kritzel-workspace-manager.js +1 -1
  91. package/dist/components/kritzel-zoom-panel.js +1 -1
  92. package/dist/components/{p-BvRrA4hN.js → p-6Ca7Eolf.js} +1 -1
  93. package/dist/components/{p-BpnIvNvq.js → p-BO1CnEOT.js} +1 -1
  94. package/dist/components/{p-CyqRcqsO.js → p-BPoDE87Q.js} +1 -1
  95. package/dist/components/p-BX-nQAyH.js +1 -0
  96. package/dist/components/{p-DNdXJp8F.js → p-Bg0xIZiR.js} +1 -1
  97. package/dist/components/{p-DmWSRsjK.js → p-BhODnvMO.js} +1 -1
  98. package/dist/components/{p-3HxnBrCM.js → p-BrAeYciD.js} +1 -1
  99. package/dist/components/{p-f8aW1ye7.js → p-BwuemYET.js} +1 -1
  100. package/dist/components/{p-U4oawa1x.js → p-C-RiEw9X.js} +1 -1
  101. package/dist/components/{p-DdsSSqFY.js → p-C-Zrxv7T.js} +1 -1
  102. package/dist/components/{p-DdH1cKED.js → p-C1jg5IQi.js} +1 -1
  103. package/dist/components/{p-SDZNC8GF.js → p-C4-Som48.js} +1 -1
  104. package/dist/components/{p-C9HGoDHE.js → p-C5TZjIE1.js} +1 -1
  105. package/dist/components/{p-7NsK0uHu.js → p-CC0J_kEP.js} +1 -1
  106. package/dist/components/{p-CIcLzcfA.js → p-CJEIUs0x.js} +1 -1
  107. package/dist/components/{p-Bzv9Px8v.js → p-CO0eEzos.js} +1 -1
  108. package/dist/components/{p-DDkmsPpV.js → p-COdwK_mi.js} +1 -1
  109. package/dist/components/{p-CPtDfadX.js → p-COj8EVzL.js} +1 -1
  110. package/dist/components/{p-CEnEDaix.js → p-CVV-HzFR.js} +1 -1
  111. package/dist/components/{p-6RjeGuvH.js → p-Cb5YwXbC.js} +1 -1
  112. package/dist/components/{p-DX5K8xnh.js → p-CbMLbDou.js} +1 -1
  113. package/dist/components/{p-DZdgXCAx.js → p-CdkNxxut.js} +1 -1
  114. package/dist/components/{p-BKJSh8qQ.js → p-CpR9lc-o.js} +1 -1
  115. package/dist/components/p-CpzicliK.js +1 -0
  116. package/dist/components/{p-IpoC5EEY.js → p-D0RYktBV.js} +1 -1
  117. package/dist/components/{p-DI4vQRE3.js → p-D0v9WP5w.js} +1 -1
  118. package/dist/components/{p-DgmtCdnL.js → p-D28ZylHn.js} +1 -1
  119. package/dist/components/{p-F5_X4dZG.js → p-DEpnJBA3.js} +1 -1
  120. package/dist/components/{p-BCNyR5Sw.js → p-DRsD38Nl.js} +1 -1
  121. package/dist/components/p-DWhWFDcC.js +9 -0
  122. package/dist/components/{p-Dz-Ti24X.js → p-DeqALrzV.js} +1 -1
  123. package/dist/components/{p-BKvHg9cv.js → p-Ndib1Jb3.js} +1 -1
  124. package/dist/components/{p-vAeiXe6c.js → p-NwN6r0N0.js} +1 -1
  125. package/dist/components/{p-NuLP1xHe.js → p-W1ZwImdd.js} +1 -1
  126. package/dist/components/{p-Jn6TNdfe.js → p-YFR180v-.js} +1 -1
  127. package/dist/components/p-pagW8YF7.js +1 -0
  128. package/dist/components/{p-v7dxxrL5.js → p-vf28uSsc.js} +1 -1
  129. package/dist/esm/index-Dhio9uis.js +2 -2
  130. package/dist/esm/index.js +2 -2
  131. package/dist/esm/{kritzel-active-users_44.entry.js → kritzel-active-users_45.entry.js} +739 -311
  132. package/dist/esm/loader.js +1 -1
  133. package/dist/esm/{schema.constants-DchTXG3V.js → schema.constants-D35cwCYd.js} +116 -60
  134. package/dist/esm/stencil.js +1 -1
  135. package/dist/stencil/index.esm.js +1 -1
  136. package/dist/stencil/p-207942fe.entry.js +9 -0
  137. package/dist/stencil/p-D35cwCYd.js +1 -0
  138. package/dist/stencil/stencil.esm.js +1 -1
  139. package/dist/types/classes/core/core.class.d.ts +16 -19
  140. package/dist/types/classes/handlers/key.handler.d.ts +1 -1
  141. package/dist/types/classes/managers/browser-permission.manager.d.ts +41 -0
  142. package/dist/types/classes/managers/clipboard.manager.d.ts +86 -0
  143. package/dist/types/classes/objects/image.class.d.ts +10 -0
  144. package/dist/types/classes/tools/image-tool.class.d.ts +0 -14
  145. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +20 -1
  146. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +8 -4
  147. package/dist/types/components/ui/kritzel-notification-card/kritzel-notification-card.d.ts +22 -0
  148. package/dist/types/components.d.ts +83 -9
  149. package/dist/types/constants/version.d.ts +1 -1
  150. package/dist/types/interfaces/engine-state.interface.d.ts +0 -3
  151. package/dist/types/interfaces/notification.interface.d.ts +10 -0
  152. package/dist/types/interfaces/theme.interface.d.ts +43 -0
  153. package/package.json +2 -2
  154. package/dist/components/p-Bc55X65h.js +0 -1
  155. package/dist/components/p-C_fKgKHu.js +0 -9
  156. package/dist/components/p-Cu9KYyoq.js +0 -1
  157. package/dist/stencil/p-DchTXG3V.js +0 -1
  158. package/dist/stencil/p-c9a3807b.entry.js +0 -9
@@ -31,6 +31,7 @@ import { KritzelBaseTool } from "./classes/tools/base-tool.class";
31
31
  import { KritzelAlignment } from "./enums/alignment.enum";
32
32
  import { Element, Event } from "./stencil-public-runtime";
33
33
  import { KritzelShortcut } from "./interfaces/shortcut.interface";
34
+ import { KritzelNotification } from "./interfaces/notification.interface";
34
35
  import { KritzelEngineState } from "./interfaces/engine-state.interface";
35
36
  import { KritzelImage } from "./classes/objects/image.class";
36
37
  import { KritzelText } from "./classes/objects/text.class";
@@ -71,6 +72,7 @@ export { KritzelBaseTool } from "./classes/tools/base-tool.class";
71
72
  export { KritzelAlignment } from "./enums/alignment.enum";
72
73
  export { Element, Event } from "./stencil-public-runtime";
73
74
  export { KritzelShortcut } from "./interfaces/shortcut.interface";
75
+ export { KritzelNotification } from "./interfaces/notification.interface";
74
76
  export { KritzelEngineState } from "./interfaces/engine-state.interface";
75
77
  export { KritzelImage } from "./classes/objects/image.class";
76
78
  export { KritzelText } from "./classes/objects/text.class";
@@ -409,7 +411,6 @@ export namespace Components {
409
411
  * Gets the list of available locale codes (built-in and registered).
410
412
  */
411
413
  "getAvailableLocales": () => Promise<LocaleCode[]>;
412
- "getCopiedObjects": () => Promise<KritzelBaseObject[]>;
413
414
  "getDisplayableShortcuts": () => Promise<Omit<KritzelShortcut, "action" | "condition">[]>;
414
415
  /**
415
416
  * Gets the currently active locale code.
@@ -423,7 +424,7 @@ export namespace Components {
423
424
  "getViewport": () => Promise<KritzelViewportState>;
424
425
  "getWorkspaces": () => Promise<KritzelWorkspace[]>;
425
426
  /**
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(), }, ]
427
+ * @default [ { label: 'menu.paste', icon: 'paste', action: menu => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.selectAll', icon: 'select-all', action: () => this.selectAllObjectsInViewport(), }, ]
427
428
  */
428
429
  "globalContextMenuItems": ContextMenuItem[];
429
430
  "group": () => Promise<void>;
@@ -490,7 +491,7 @@ export namespace Components {
490
491
  */
491
492
  "loginConfig"?: KritzelLoginConfig;
492
493
  /**
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() }, ]
494
+ * @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', 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', 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', action: () => this.engineRef.group(), }, { label: 'menu.ungroup', icon: 'ungroup', 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() }, ]
494
495
  */
495
496
  "objectContextMenuItems": ContextMenuItem[];
496
497
  "openContextMenu": (options: { x: number; y: number; objectId?: string; }) => Promise<void>;
@@ -543,6 +544,11 @@ export namespace Components {
543
544
  */
544
545
  "theme": ThemeName;
545
546
  "themes"?: KritzelTheme[];
547
+ /**
548
+ * Triggers a UI notification programmatically.
549
+ * @param notification - Notification payload. `id` and `timestamp` are optional.
550
+ */
551
+ "triggerNotification": (notification: Omit<KritzelNotification, "id"> & Partial<Pick<KritzelNotification, "id" | "timestamp">>) => Promise<void>;
546
552
  "triggerSelectionChange": () => Promise<void>;
547
553
  "undo": () => Promise<void>;
548
554
  "ungroup": () => Promise<void>;
@@ -747,10 +753,6 @@ export namespace Components {
747
753
  * Gets the list of available locale codes (built-in and registered).
748
754
  */
749
755
  "getAvailableLocales": () => Promise<LocaleCode[]>;
750
- /**
751
- * Returns the objects currently stored in the internal clipboard from a prior `copy()` call.
752
- */
753
- "getCopiedObjects": () => Promise<KritzelBaseObject[]>;
754
756
  /**
755
757
  * Returns all registered keyboard shortcuts (without action/condition) for display in a help UI.
756
758
  */
@@ -1296,6 +1298,21 @@ export namespace Components {
1296
1298
  */
1297
1299
  "visible": boolean;
1298
1300
  }
1301
+ interface KritzelNotificationCard {
1302
+ /**
1303
+ * Locale used for formatting the timestamp.
1304
+ */
1305
+ "locale"?: string;
1306
+ /**
1307
+ * Notification data rendered by this card.
1308
+ */
1309
+ "notification"?: KritzelNotification;
1310
+ /**
1311
+ * Whether a formatted timestamp should be displayed when available.
1312
+ * @default true
1313
+ */
1314
+ "showTimestamp": boolean;
1315
+ }
1299
1316
  interface KritzelNumericInput {
1300
1317
  /**
1301
1318
  * Label text displayed above the input
@@ -1665,6 +1682,10 @@ export interface KritzelMoreMenuCustomEvent<T> extends CustomEvent<T> {
1665
1682
  detail: T;
1666
1683
  target: HTMLKritzelMoreMenuElement;
1667
1684
  }
1685
+ export interface KritzelNotificationCardCustomEvent<T> extends CustomEvent<T> {
1686
+ detail: T;
1687
+ target: HTMLKritzelNotificationCardElement;
1688
+ }
1668
1689
  export interface KritzelNumericInputCustomEvent<T> extends CustomEvent<T> {
1669
1690
  detail: T;
1670
1691
  target: HTMLKritzelNumericInputElement;
@@ -1951,6 +1972,7 @@ declare global {
1951
1972
  "objectsInViewportChange": ObjectsInViewportChangeEvent;
1952
1973
  "viewportChange": KritzelViewportState;
1953
1974
  "awarenessChange": Map<number, Record<string, any>>;
1975
+ "notificationsChange": KritzelNotification;
1954
1976
  }
1955
1977
  interface HTMLKritzelEngineElement extends Components.KritzelEngine, HTMLStencilElement {
1956
1978
  addEventListener<K extends keyof HTMLKritzelEngineElementEventMap>(type: K, listener: (this: HTMLKritzelEngineElement, ev: KritzelEngineCustomEvent<HTMLKritzelEngineElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -2165,6 +2187,24 @@ declare global {
2165
2187
  prototype: HTMLKritzelMoreMenuElement;
2166
2188
  new (): HTMLKritzelMoreMenuElement;
2167
2189
  };
2190
+ interface HTMLKritzelNotificationCardElementEventMap {
2191
+ "dismiss": void;
2192
+ "hoverChange": boolean;
2193
+ }
2194
+ interface HTMLKritzelNotificationCardElement extends Components.KritzelNotificationCard, HTMLStencilElement {
2195
+ addEventListener<K extends keyof HTMLKritzelNotificationCardElementEventMap>(type: K, listener: (this: HTMLKritzelNotificationCardElement, ev: KritzelNotificationCardCustomEvent<HTMLKritzelNotificationCardElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2196
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2197
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2198
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2199
+ removeEventListener<K extends keyof HTMLKritzelNotificationCardElementEventMap>(type: K, listener: (this: HTMLKritzelNotificationCardElement, ev: KritzelNotificationCardCustomEvent<HTMLKritzelNotificationCardElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
2200
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2201
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2202
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2203
+ }
2204
+ var HTMLKritzelNotificationCardElement: {
2205
+ prototype: HTMLKritzelNotificationCardElement;
2206
+ new (): HTMLKritzelNotificationCardElement;
2207
+ };
2168
2208
  interface HTMLKritzelNumericInputElementEventMap {
2169
2209
  "valueChange": number | undefined;
2170
2210
  }
@@ -2482,6 +2522,7 @@ declare global {
2482
2522
  "kritzel-menu": HTMLKritzelMenuElement;
2483
2523
  "kritzel-menu-item": HTMLKritzelMenuItemElement;
2484
2524
  "kritzel-more-menu": HTMLKritzelMoreMenuElement;
2525
+ "kritzel-notification-card": HTMLKritzelNotificationCardElement;
2485
2526
  "kritzel-numeric-input": HTMLKritzelNumericInputElement;
2486
2527
  "kritzel-opacity-slider": HTMLKritzelOpacitySliderElement;
2487
2528
  "kritzel-pill-tabs": HTMLKritzelPillTabsElement;
@@ -2810,7 +2851,7 @@ declare namespace LocalJSX {
2810
2851
  */
2811
2852
  "fallbackLocale"?: LocaleCode;
2812
2853
  /**
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(), }, ]
2854
+ * @default [ { label: 'menu.paste', icon: 'paste', action: menu => this.engineRef.paste(menu.x, menu.y), }, { label: 'menu.selectAll', icon: 'select-all', action: () => this.selectAllObjectsInViewport(), }, ]
2814
2855
  */
2815
2856
  "globalContextMenuItems"?: ContextMenuItem[];
2816
2857
  /**
@@ -2872,7 +2913,7 @@ declare namespace LocalJSX {
2872
2913
  */
2873
2914
  "loginConfig"?: KritzelLoginConfig;
2874
2915
  /**
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() }, ]
2916
+ * @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', 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', 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', action: () => this.engineRef.group(), }, { label: 'menu.ungroup', icon: 'ungroup', 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() }, ]
2876
2917
  */
2877
2918
  "objectContextMenuItems"?: ContextMenuItem[];
2878
2919
  "onActiveWorkspaceChange"?: (event: KritzelEditorCustomEvent<ActiveWorkspaceChangeEvent>) => void;
@@ -3016,6 +3057,10 @@ declare namespace LocalJSX {
3016
3057
  * Emitted on long-press (touch/pen). Useful for showing custom context menus on mobile.
3017
3058
  */
3018
3059
  "onLongpress"?: (event: KritzelEngineCustomEvent<PointerEvent>) => void;
3060
+ /**
3061
+ * Emitted when notifications change.
3062
+ */
3063
+ "onNotificationsChange"?: (event: KritzelEngineCustomEvent<KritzelNotification>) => void;
3019
3064
  /**
3020
3065
  * Emitted when one or more objects are added to the canvas.
3021
3066
  */
@@ -3317,6 +3362,29 @@ declare namespace LocalJSX {
3317
3362
  */
3318
3363
  "visible"?: boolean;
3319
3364
  }
3365
+ interface KritzelNotificationCard {
3366
+ /**
3367
+ * Locale used for formatting the timestamp.
3368
+ */
3369
+ "locale"?: string;
3370
+ /**
3371
+ * Notification data rendered by this card.
3372
+ */
3373
+ "notification"?: KritzelNotification;
3374
+ /**
3375
+ * Emitted when the notification should be dismissed manually.
3376
+ */
3377
+ "onDismiss"?: (event: KritzelNotificationCardCustomEvent<void>) => void;
3378
+ /**
3379
+ * Emitted when pointer hover state changes.
3380
+ */
3381
+ "onHoverChange"?: (event: KritzelNotificationCardCustomEvent<boolean>) => void;
3382
+ /**
3383
+ * Whether a formatted timestamp should be displayed when available.
3384
+ * @default true
3385
+ */
3386
+ "showTimestamp"?: boolean;
3387
+ }
3320
3388
  interface KritzelNumericInput {
3321
3389
  /**
3322
3390
  * Label text displayed above the input
@@ -3790,6 +3858,10 @@ declare namespace LocalJSX {
3790
3858
  "iconSize": number;
3791
3859
  "offsetY": number;
3792
3860
  }
3861
+ interface KritzelNotificationCardAttributes {
3862
+ "showTimestamp": boolean;
3863
+ "locale": string;
3864
+ }
3793
3865
  interface KritzelNumericInputAttributes {
3794
3866
  "value": number;
3795
3867
  "min": number;
@@ -3884,6 +3956,7 @@ declare namespace LocalJSX {
3884
3956
  "kritzel-menu": KritzelMenu;
3885
3957
  "kritzel-menu-item": KritzelMenuItem;
3886
3958
  "kritzel-more-menu": Omit<KritzelMoreMenu, keyof KritzelMoreMenuAttributes> & { [K in keyof KritzelMoreMenu & keyof KritzelMoreMenuAttributes]?: KritzelMoreMenu[K] } & { [K in keyof KritzelMoreMenu & keyof KritzelMoreMenuAttributes as `attr:${K}`]?: KritzelMoreMenuAttributes[K] } & { [K in keyof KritzelMoreMenu & keyof KritzelMoreMenuAttributes as `prop:${K}`]?: KritzelMoreMenu[K] };
3959
+ "kritzel-notification-card": Omit<KritzelNotificationCard, keyof KritzelNotificationCardAttributes> & { [K in keyof KritzelNotificationCard & keyof KritzelNotificationCardAttributes]?: KritzelNotificationCard[K] } & { [K in keyof KritzelNotificationCard & keyof KritzelNotificationCardAttributes as `attr:${K}`]?: KritzelNotificationCardAttributes[K] } & { [K in keyof KritzelNotificationCard & keyof KritzelNotificationCardAttributes as `prop:${K}`]?: KritzelNotificationCard[K] };
3887
3960
  "kritzel-numeric-input": Omit<KritzelNumericInput, keyof KritzelNumericInputAttributes> & { [K in keyof KritzelNumericInput & keyof KritzelNumericInputAttributes]?: KritzelNumericInput[K] } & { [K in keyof KritzelNumericInput & keyof KritzelNumericInputAttributes as `attr:${K}`]?: KritzelNumericInputAttributes[K] } & { [K in keyof KritzelNumericInput & keyof KritzelNumericInputAttributes as `prop:${K}`]?: KritzelNumericInput[K] };
3888
3961
  "kritzel-opacity-slider": Omit<KritzelOpacitySlider, keyof KritzelOpacitySliderAttributes> & { [K in keyof KritzelOpacitySlider & keyof KritzelOpacitySliderAttributes]?: KritzelOpacitySlider[K] } & { [K in keyof KritzelOpacitySlider & keyof KritzelOpacitySliderAttributes as `attr:${K}`]?: KritzelOpacitySliderAttributes[K] } & { [K in keyof KritzelOpacitySlider & keyof KritzelOpacitySliderAttributes as `prop:${K}`]?: KritzelOpacitySlider[K] };
3889
3962
  "kritzel-pill-tabs": Omit<KritzelPillTabs, keyof KritzelPillTabsAttributes> & { [K in keyof KritzelPillTabs & keyof KritzelPillTabsAttributes]?: KritzelPillTabs[K] } & { [K in keyof KritzelPillTabs & keyof KritzelPillTabsAttributes as `attr:${K}`]?: KritzelPillTabsAttributes[K] } & { [K in keyof KritzelPillTabs & keyof KritzelPillTabsAttributes as `prop:${K}`]?: KritzelPillTabs[K] };
@@ -3940,6 +4013,7 @@ declare module "@stencil/core" {
3940
4013
  "kritzel-menu": LocalJSX.IntrinsicElements["kritzel-menu"] & JSXBase.HTMLAttributes<HTMLKritzelMenuElement>;
3941
4014
  "kritzel-menu-item": LocalJSX.IntrinsicElements["kritzel-menu-item"] & JSXBase.HTMLAttributes<HTMLKritzelMenuItemElement>;
3942
4015
  "kritzel-more-menu": LocalJSX.IntrinsicElements["kritzel-more-menu"] & JSXBase.HTMLAttributes<HTMLKritzelMoreMenuElement>;
4016
+ "kritzel-notification-card": LocalJSX.IntrinsicElements["kritzel-notification-card"] & JSXBase.HTMLAttributes<HTMLKritzelNotificationCardElement>;
3943
4017
  "kritzel-numeric-input": LocalJSX.IntrinsicElements["kritzel-numeric-input"] & JSXBase.HTMLAttributes<HTMLKritzelNumericInputElement>;
3944
4018
  "kritzel-opacity-slider": LocalJSX.IntrinsicElements["kritzel-opacity-slider"] & JSXBase.HTMLAttributes<HTMLKritzelOpacitySliderElement>;
3945
4019
  "kritzel-pill-tabs": LocalJSX.IntrinsicElements["kritzel-pill-tabs"] & JSXBase.HTMLAttributes<HTMLKritzelPillTabsElement>;
@@ -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 declare const KRITZEL_VERSION = "0.3.17";
6
+ export declare const KRITZEL_VERSION = "0.3.19";
@@ -10,9 +10,6 @@ import { SnapCandidate } from "./anchor.interface";
10
10
  export interface KritzelEngineState {
11
11
  activeWorkspace: KritzelWorkspace | null | undefined;
12
12
  activeTool: KritzelBaseTool | null;
13
- copiedObjects?: KritzelBaseObject<any>[] | null;
14
- /** Maps copied object IDs to their original source object IDs (for anchor remapping during paste) */
15
- copiedObjectIdMapping?: Map<string, string> | null;
16
13
  objects: KritzelObjectMap<KritzelBaseObject<Element>> | null;
17
14
  snapCandidate?: SnapCandidate | null;
18
15
  resizeHandleType: KritzelHandleType | undefined;
@@ -0,0 +1,10 @@
1
+ export interface KritzelNotification {
2
+ /** Unique identifier for the notification */
3
+ id: string;
4
+ /** Type of the notification (e.g., 'info', 'warning', 'error') */
5
+ type: 'info' | 'warning' | 'error';
6
+ /** Message content of the notification */
7
+ message: string;
8
+ /** Optional timestamp for when the notification was created */
9
+ timestamp?: Date;
10
+ }
@@ -189,6 +189,12 @@ export interface KritzelTheme {
189
189
  controlsTransform?: string;
190
190
  controlsTransition?: string;
191
191
  controlsTransitionDuration?: string;
192
+ notificationAnimationDuration?: string;
193
+ notificationAnimationEasing?: string;
194
+ notificationDismissAnimationDuration?: string;
195
+ notificationDismissAnimationEasing?: string;
196
+ topCenterNotificationTop?: string;
197
+ topCenterNotificationZIndex?: string;
192
198
  topLeftButtonsLeft?: string;
193
199
  topLeftButtonsTop?: string;
194
200
  topRightButtonsRight?: string;
@@ -307,6 +313,43 @@ export interface KritzelTheme {
307
313
  innerBorderRadius?: string;
308
314
  padding?: string;
309
315
  };
316
+ /** Notification card variables */
317
+ notificationCard?: {
318
+ backgroundColor?: string;
319
+ border?: string;
320
+ borderRadius?: string;
321
+ boxShadow?: string;
322
+ color?: string;
323
+ dismissButtonActiveBackgroundColor?: string;
324
+ dismissButtonBackgroundColor?: string;
325
+ dismissButtonBorderRadius?: string;
326
+ dismissButtonColor?: string;
327
+ dismissButtonHoverBackgroundColor?: string;
328
+ dismissButtonSize?: string;
329
+ errorPillBackgroundColor?: string;
330
+ errorPillColor?: string;
331
+ headerGap?: string;
332
+ headerMarginBottom?: string;
333
+ headerRightGap?: string;
334
+ infoPillBackgroundColor?: string;
335
+ infoPillColor?: string;
336
+ maxWidth?: string;
337
+ messageColor?: string;
338
+ messageFontSize?: string;
339
+ messageLineHeight?: string;
340
+ padding?: string;
341
+ pillBackgroundColor?: string;
342
+ pillBorderRadius?: string;
343
+ pillColor?: string;
344
+ pillFontSize?: string;
345
+ pillFontWeight?: string;
346
+ pillHeight?: string;
347
+ pillPadding?: string;
348
+ timestampColor?: string;
349
+ timestampFontSize?: string;
350
+ warningPillBackgroundColor?: string;
351
+ warningPillColor?: string;
352
+ };
310
353
  /** Numeric input variables */
311
354
  numericInput?: {
312
355
  borderColor?: string;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "kritzel-stencil",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "homepage": "https://kritzel.io/",
5
5
  "description": "Build infinite canvas experiences in minutes.",
6
- "license": "SEE LICENSE IN LICENSE.md",
6
+ "license": "PolyForm-Noncommercial-1.0.0",
7
7
  "main": "dist/index.cjs.js",
8
8
  "module": "dist/index.js",
9
9
  "types": "dist/types/index.d.ts",
@@ -1 +0,0 @@
1
- import{p as e,H as t,h as o,d as s,t as i}from"./p-B43upypT.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}fontFamily="Arial, sans-serif";size=24;color="#000000";render(){return o(s,{key:"49c44f7fef61bd7116e63bbe9522b0a0e22de116"},o("div",{key:"4d130682f67e9c0d758cb6194e6a95f15bceb2ee",class:"font-preview",style:{fontFamily:this.fontFamily,fontSize:`${this.size}px`,color:this.color}},"A"))}static get style(){return":host{display:block}.font-preview{color:var(--kritzel-font-size-text-color, #333333);line-height:1;text-align:center;font-weight:bold}"}},[513,"kritzel-font",{fontFamily:[1,"font-family"],size:[2],color:[1]}]);function r(){"undefined"!=typeof customElements&&["kritzel-font"].forEach((e=>{"kritzel-font"===e&&(customElements.get(i(e))||customElements.define(i(e),n))}))}export{n as K,r as d}