kritzel-stencil 0.4.24 → 0.4.25

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 (225) hide show
  1. package/LICENSE +21 -21
  2. package/LICENSE.md +49 -49
  3. package/dist/cjs/{index-Dn19mGl-.js → index-Xav9JFHg.js} +11 -47
  4. package/dist/cjs/index.cjs.js +7 -1
  5. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +196 -201
  6. package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/{schema.constants-CY0WWJYd.js → schema.constants-CjN-B633.js} +20 -44
  9. package/dist/cjs/stencil.cjs.js +3 -3
  10. package/dist/collection/classes/core/core.class.js +4 -0
  11. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +3 -0
  12. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +3 -0
  13. package/dist/collection/classes/structures/object-map.structure.js +65 -0
  14. package/dist/collection/collection-manifest.json +1 -1
  15. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.css +115 -115
  16. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +1 -1
  17. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -10
  18. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
  19. package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +160 -160
  20. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +42 -21
  21. package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
  22. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +42 -124
  23. package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.css +29 -29
  24. package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +2 -2
  25. package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.css +58 -58
  26. package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
  27. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +42 -42
  28. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +3 -3
  29. package/dist/collection/components/shared/kritzel-button/kritzel-button.css +73 -73
  30. package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
  31. package/dist/collection/components/shared/kritzel-color/kritzel-color.css +24 -24
  32. package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
  33. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +46 -46
  34. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
  35. package/dist/collection/components/shared/kritzel-dialog/kritzel-dialog.css +209 -209
  36. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +190 -190
  37. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +2 -2
  38. package/dist/collection/components/shared/kritzel-font/kritzel-font.css +10 -10
  39. package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
  40. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +48 -48
  41. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +2 -2
  42. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +30 -30
  43. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
  44. package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +18 -18
  45. package/dist/collection/components/shared/kritzel-input/kritzel-input.css +69 -69
  46. package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
  47. package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.css +60 -60
  48. package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.js +3 -3
  49. package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.css +190 -190
  50. package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
  51. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +34 -34
  52. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
  53. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +166 -166
  54. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
  55. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
  56. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
  57. package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
  58. package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
  59. package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
  60. package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
  61. package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
  62. package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
  63. package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
  64. package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
  65. package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
  66. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +78 -78
  67. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
  68. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
  69. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
  70. package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.css +50 -50
  71. package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +1 -1
  72. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +18 -18
  73. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
  74. package/dist/collection/components/ui/kritzel-active-users/kritzel-active-users.css +65 -65
  75. package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
  76. package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
  77. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +112 -112
  78. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +331 -331
  79. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
  80. package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.css +11 -11
  81. package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
  82. package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
  83. package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
  84. package/dist/collection/components/ui/kritzel-export/kritzel-export.css +89 -89
  85. package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
  86. package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.css +50 -50
  87. package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
  88. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
  89. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
  90. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.css +58 -58
  91. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +2 -2
  92. package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -101
  93. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.css +137 -137
  94. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
  95. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
  96. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
  97. package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.css +38 -38
  98. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
  99. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  100. package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
  101. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
  102. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
  103. package/dist/collection/constants/version.js +1 -1
  104. package/dist/collection/helpers/cursor.helper.js +6 -6
  105. package/dist/collection/helpers/svg-export.helper.js +41 -41
  106. package/dist/components/index.js +9 -3
  107. package/dist/components/kritzel-active-users.js +1 -1
  108. package/dist/components/kritzel-avatar.js +1 -1
  109. package/dist/components/kritzel-awareness-cursors.js +1 -1
  110. package/dist/components/kritzel-back-to-content.js +1 -1
  111. package/dist/components/kritzel-brush-style.js +4 -4
  112. package/dist/components/kritzel-button.js +1 -1
  113. package/dist/components/kritzel-color-palette.js +1 -1
  114. package/dist/components/kritzel-color.js +1 -1
  115. package/dist/components/kritzel-context-menu.js +1 -1
  116. package/dist/components/kritzel-controls.js +1 -1
  117. package/dist/components/kritzel-current-user-dialog.js +1 -1
  118. package/dist/components/kritzel-current-user.js +1 -1
  119. package/dist/components/kritzel-cursor-trail.js +1 -1
  120. package/dist/components/kritzel-dialog.js +1 -1
  121. package/dist/components/kritzel-dropdown.js +1 -1
  122. package/dist/components/kritzel-editor.js +65 -58
  123. package/dist/components/kritzel-engine.js +1 -1
  124. package/dist/components/kritzel-export.js +1 -1
  125. package/dist/components/kritzel-font-family.js +1 -1
  126. package/dist/components/kritzel-font-size.js +1 -1
  127. package/dist/components/kritzel-font.js +1 -1
  128. package/dist/components/kritzel-icon.js +1 -1
  129. package/dist/components/kritzel-input.js +1 -1
  130. package/dist/components/kritzel-line-endings.js +1 -1
  131. package/dist/components/kritzel-loading-overlay.js +1 -1
  132. package/dist/components/kritzel-login-dialog.js +1 -1
  133. package/dist/components/kritzel-master-detail.js +1 -1
  134. package/dist/components/kritzel-menu-item.js +1 -1
  135. package/dist/components/kritzel-menu.js +1 -1
  136. package/dist/components/kritzel-more-menu.js +1 -1
  137. package/dist/components/kritzel-notification-card.js +1 -1
  138. package/dist/components/kritzel-numeric-input.js +1 -1
  139. package/dist/components/kritzel-opacity-slider.js +1 -1
  140. package/dist/components/kritzel-pill-tabs.js +1 -1
  141. package/dist/components/kritzel-portal.js +1 -1
  142. package/dist/components/kritzel-settings.js +1 -1
  143. package/dist/components/kritzel-shape-fill.js +1 -1
  144. package/dist/components/kritzel-share-dialog.js +1 -1
  145. package/dist/components/kritzel-slide-toggle.js +1 -1
  146. package/dist/components/kritzel-split-button.js +1 -1
  147. package/dist/components/kritzel-stroke-size.js +1 -1
  148. package/dist/components/kritzel-sync-indicator.js +1 -1
  149. package/dist/components/kritzel-tool-config.js +1 -1
  150. package/dist/components/kritzel-tooltip.js +1 -1
  151. package/dist/components/kritzel-utility-panel.js +1 -1
  152. package/dist/components/kritzel-watermark.js +1 -1
  153. package/dist/components/kritzel-workspace-manager.js +1 -1
  154. package/dist/components/kritzel-zoom-panel.js +1 -1
  155. package/dist/components/{p-DW1B118Q.js → p-0fhjWRmT.js} +9 -9
  156. package/dist/components/{p-CLAz6RJc.js → p-2WiGyky4.js} +3 -3
  157. package/dist/components/{p-zG-WUBGF.js → p-4SPnZZkH.js} +4 -4
  158. package/dist/components/{p-MhQxGUvY.js → p-B-585egz.js} +3 -3
  159. package/dist/components/{p-C9_yBEoX.js → p-B43upypT.js} +10 -30
  160. package/dist/components/{p-CSKToqUl.js → p-B5SWPDuq.js} +4 -4
  161. package/dist/components/{p-Covorf4C.js → p-BFYtCsZu.js} +3 -3
  162. package/dist/components/{p-DYPA7jpg.js → p-BPsKYMH6.js} +2 -2
  163. package/dist/components/{p-Cx-L_28S.js → p-BoN700-O.js} +3 -3
  164. package/dist/components/{p-ME1sDz3f.js → p-BozrueXV.js} +2 -2
  165. package/dist/components/{p-D2VcPEtL.js → p-BrNsOp2v.js} +6 -6
  166. package/dist/components/{p-BXUx_C0N.js → p-BsLI_BWq.js} +2 -2
  167. package/dist/components/{p-dAXnRkjA.js → p-C98Eb3_R.js} +5 -5
  168. package/dist/components/{p-Bxi-Bm49.js → p-CAoN_STZ.js} +2 -2
  169. package/dist/components/{p-CSWCmyzb.js → p-CF8pLc07.js} +5 -5
  170. package/dist/components/{p-D3BzgkIE.js → p-CSPYkLLH.js} +2 -2
  171. package/dist/components/{p-Ck-87E2G.js → p-CSuU8frA.js} +1 -1
  172. package/dist/components/{p-Di--2boB.js → p-CXpv9Rxe.js} +3 -3
  173. package/dist/components/{p-o3NYKrVL.js → p-CaBbajU2.js} +3 -3
  174. package/dist/components/{p-3tBE7SyG.js → p-Cm33td2O.js} +2 -2
  175. package/dist/components/{p-vDCa_ZDm.js → p-CrHvaLRV.js} +3 -3
  176. package/dist/components/{p-DT_WBwsw.js → p-CwZ3KKFq.js} +6 -6
  177. package/dist/components/{p-BZZ3KRPk.js → p-CzW58DHM.js} +3 -3
  178. package/dist/components/{p-BrqSjRJN.js → p-Czhdc844.js} +3 -3
  179. package/dist/components/{p-BkXQL5Dl.js → p-D1rjfWgJ.js} +5 -5
  180. package/dist/components/{p-DPsbNStn.js → p-DB58Oa5V.js} +2 -2
  181. package/dist/components/{p-DafP9PAA.js → p-DBqoPgev.js} +2 -2
  182. package/dist/components/{p-BrA9NBEE.js → p-DDTMGbtA.js} +21 -21
  183. package/dist/components/{p-Dznwo6oc.js → p-DKGg-76-.js} +2 -2
  184. package/dist/components/{p-Dp1CD4gK.js → p-DVXTPI71.js} +2 -2
  185. package/dist/components/{p-QSyeAy8R.js → p-DX2nriaq.js} +2 -2
  186. package/dist/components/{p-CHoOe3FD.js → p-Df3BwVGy.js} +3 -3
  187. package/dist/components/{p-DcUIO14-.js → p-Dt7-I2Xz.js} +4 -4
  188. package/dist/components/{p-BShrnlam.js → p-DtnMdWWB.js} +2 -2
  189. package/dist/components/{p-Ch-KG9To.js → p-DwMqCX2P.js} +3 -3
  190. package/dist/components/{p-fSV6KVTC.js → p-GKmqCI8r.js} +3 -3
  191. package/dist/components/{p-CWAChRD5.js → p-HoO86l1o.js} +12 -12
  192. package/dist/components/{p-Qdo3E8dr.js → p-PjPPCHVL.js} +2 -2
  193. package/dist/components/{p-D6JycG-I.js → p-bAacqNHq.js} +3 -3
  194. package/dist/components/{p-DjXQxw9R.js → p-djJSnjAX.js} +3 -3
  195. package/dist/components/{p-b0J2ktAm.js → p-dsxHDlQ3.js} +7 -7
  196. package/dist/components/{p-BppcoKoo.js → p-eZXIu4yK.js} +5 -5
  197. package/dist/components/{p-BFYT03fw.js → p-fL9rl200.js} +3 -3
  198. package/dist/components/{p-DwEYMvIn.js → p-gJcH-huF.js} +141 -178
  199. package/dist/components/{p-1Q4VnThv.js → p-jIKskj3S.js} +3 -3
  200. package/dist/components/{p-D0Trc3IQ.js → p-vqEUQ-4Q.js} +5 -5
  201. package/dist/esm/{index-2va1Pk9z.js → index-Dhio9uis.js} +11 -47
  202. package/dist/esm/index.js +8 -2
  203. package/dist/esm/kritzel-active-users_47.entry.js +196 -201
  204. package/dist/esm/kritzel-brush-style.entry.js +2 -2
  205. package/dist/esm/loader.js +3 -3
  206. package/dist/esm/{schema.constants-DBvUmuDH.js → schema.constants-DfvqHmxc.js} +20 -44
  207. package/dist/esm/stencil.js +4 -4
  208. package/dist/stencil/index.esm.js +8 -2
  209. package/dist/stencil/{p-DBvUmuDH.js → p-DfvqHmxc.js} +20 -44
  210. package/dist/stencil/{p-2va1Pk9z.js → p-Dhio9uis.js} +11 -47
  211. package/dist/stencil/{p-ce6d432e.entry.js → p-dc5783ee.entry.js} +196 -201
  212. package/dist/stencil/{p-df06ca3a.entry.js → p-fb32cd8f.entry.js} +2 -2
  213. package/dist/stencil/stencil.esm.js +4 -4
  214. package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +1 -0
  215. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +1 -0
  216. package/dist/types/classes/structures/object-map.structure.d.ts +14 -0
  217. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +3 -1
  218. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +3 -14
  219. package/dist/types/components.d.ts +7 -5
  220. package/dist/types/constants/version.d.ts +1 -1
  221. package/dist/types/interfaces/sync-provider.interface.d.ts +7 -0
  222. package/dist/types/stencil-public-runtime.d.ts +0 -12
  223. package/loader/index.d.ts +1 -1
  224. package/package.json +1 -1
  225. package/readme.md +10 -10
@@ -252,16 +252,15 @@ export class KritzelEngine {
252
252
  viewportChange;
253
253
  /** Emitted when the awareness state changes (remote user cursors, presence). */
254
254
  awarenessChange;
255
+ /** Emitted when a remote sync starts (`true`, data differs from the local copy) or finishes (`false`). */
256
+ isSyncing;
255
257
  /** Emitted when notifications change. */
256
258
  notificationsChange;
257
259
  /** Emitted when context-menu visibility, items, or position changes. */
258
260
  contextMenuStateChange;
259
261
  /** Emitted when the combined loading state (external `isLoading` prop or internal workspace loading) changes. */
260
262
  loadingChange;
261
- /** Emitted when remote workspace synchronization is in progress. */
262
- syncingChange;
263
263
  forceUpdate = 0;
264
- isSyncing = false;
265
264
  /** Manually triggers the `objectsSelectionChange` event. */
266
265
  async triggerSelectionChange() {
267
266
  this.objectsSelectionChange.emit();
@@ -1839,12 +1838,6 @@ export class KritzelEngine {
1839
1838
  _syncConfigRevision = 0;
1840
1839
  _assetStorageConfigRevision = 0;
1841
1840
  _isWorkspaceLoading = false;
1842
- _syncingRequestId = 0;
1843
- _syncingShowTimeout = null;
1844
- _syncingHideTimeout = null;
1845
- _syncingVisibleSince = null;
1846
- _syncingShowDelayMs = 300;
1847
- _syncingMinimumVisibleMs = 500;
1848
1841
  _hasLoggedUnlicensedWelcomeBanner = false;
1849
1842
  _previousVisibleCustomElements = new Set();
1850
1843
  _revealedImageKeys = new Set();
@@ -1867,66 +1860,6 @@ export class KritzelEngine {
1867
1860
  this.core.store.state.isLoading = this._isWorkspaceLoading || this.isLoading;
1868
1861
  this.loadingChange.emit(this.core.store.state.isLoading);
1869
1862
  }
1870
- beginSyncingRequest() {
1871
- this._syncingRequestId++;
1872
- this.clearSyncingShowTimeout();
1873
- this.clearSyncingHideTimeout();
1874
- return this._syncingRequestId;
1875
- }
1876
- syncSyncingState(isSyncing, requestId) {
1877
- if (requestId !== this._syncingRequestId) {
1878
- return;
1879
- }
1880
- if (isSyncing) {
1881
- this.clearSyncingHideTimeout();
1882
- if (this.isSyncing || this._syncingShowTimeout !== null) {
1883
- return;
1884
- }
1885
- this._syncingShowTimeout = setTimeout(() => {
1886
- this._syncingShowTimeout = null;
1887
- if (requestId !== this._syncingRequestId || this.isSyncing) {
1888
- return;
1889
- }
1890
- this.isSyncing = true;
1891
- this._syncingVisibleSince = Date.now();
1892
- this.syncingChange.emit(true);
1893
- }, this._syncingShowDelayMs);
1894
- return;
1895
- }
1896
- this.clearSyncingShowTimeout();
1897
- if (!this.isSyncing) {
1898
- return;
1899
- }
1900
- this.clearSyncingHideTimeout();
1901
- const elapsedMs = Date.now() - (this._syncingVisibleSince ?? Date.now());
1902
- const remainingVisibleMs = Math.max(0, this._syncingMinimumVisibleMs - elapsedMs);
1903
- if (remainingVisibleMs === 0) {
1904
- this.finishSyncingState(requestId);
1905
- return;
1906
- }
1907
- this._syncingHideTimeout = setTimeout(() => this.finishSyncingState(requestId), remainingVisibleMs);
1908
- }
1909
- finishSyncingState(requestId) {
1910
- this._syncingHideTimeout = null;
1911
- if (requestId !== this._syncingRequestId || !this.isSyncing) {
1912
- return;
1913
- }
1914
- this.isSyncing = false;
1915
- this._syncingVisibleSince = null;
1916
- this.syncingChange.emit(false);
1917
- }
1918
- clearSyncingShowTimeout() {
1919
- if (this._syncingShowTimeout !== null) {
1920
- clearTimeout(this._syncingShowTimeout);
1921
- this._syncingShowTimeout = null;
1922
- }
1923
- }
1924
- clearSyncingHideTimeout() {
1925
- if (this._syncingHideTimeout !== null) {
1926
- clearTimeout(this._syncingHideTimeout);
1927
- this._syncingHideTimeout = null;
1928
- }
1929
- }
1930
1863
  isNetworkAvailable() {
1931
1864
  return typeof navigator !== 'undefined' && navigator.onLine;
1932
1865
  }
@@ -2019,7 +1952,6 @@ export class KritzelEngine {
2019
1952
  disconnectedCallback() {
2020
1953
  this.throttledPointerMoveMulti.cancel();
2021
1954
  this._revealedImageKeys.clear();
2022
- this.beginSyncingRequest();
2023
1955
  if (this._sceneBootstrapTransitionTimer !== null) {
2024
1956
  clearTimeout(this._sceneBootstrapTransitionTimer);
2025
1957
  this._sceneBootstrapTransitionTimer = null;
@@ -2269,27 +2201,11 @@ export class KritzelEngine {
2269
2201
  }
2270
2202
  this._isWorkspaceLoading = true;
2271
2203
  this.syncLoadingState();
2272
- const syncingRequestId = this.beginSyncingRequest();
2273
2204
  const initializationPromise = this.core.initializeWorkspace(workspace, options);
2274
2205
  this._workspaceInitializationPromise = initializationPromise;
2275
2206
  this._workspaceInitializationTargetKey = targetKey;
2276
2207
  try {
2277
2208
  await initializationPromise;
2278
- // Track remote sync in the background without blocking the loading overlay.
2279
- const initializedObjects = this.core.store.objects;
2280
- const networkSyncPromise = initializedObjects?.whenNetworkSynced();
2281
- if (networkSyncPromise && this.isNetworkAvailable()) {
2282
- this.syncSyncingState(true, syncingRequestId);
2283
- void networkSyncPromise.finally(() => {
2284
- // Only clear syncing for the currently active object map.
2285
- if (this.core.store.objects === initializedObjects) {
2286
- this.syncSyncingState(false, syncingRequestId);
2287
- }
2288
- });
2289
- }
2290
- else {
2291
- this.syncSyncingState(false, syncingRequestId);
2292
- }
2293
2209
  }
2294
2210
  finally {
2295
2211
  // Only the most recent init clears loading state to prevent race conditions
@@ -2334,6 +2250,9 @@ export class KritzelEngine {
2334
2250
  emitAwarenessChange(states) {
2335
2251
  this.awarenessChange.emit(states);
2336
2252
  }
2253
+ emitIsSyncing(isSyncing) {
2254
+ this.isSyncing.emit(isSyncing);
2255
+ }
2337
2256
  emitObjectsInViewportChange() {
2338
2257
  const visibleObjects = this.core.store.objectsInViewport;
2339
2258
  this.objectsInViewportChange.emit(visibleObjects);
@@ -3056,7 +2975,7 @@ export class KritzelEngine {
3056
2975
  "optional": true,
3057
2976
  "docs": {
3058
2977
  "tags": [],
3059
- "text": "Configuration for binary asset storage (e.g., images).\r\n\r\nThe Yjs document only persists asset ids; the actual bytes are stored\r\nby the providers listed here. Defaults to IndexedDB-only storage. To\r\nsupport cross-device image sync alongside a networked sync provider\r\n(Hocuspocus, WebSocket), configure at least one remote asset provider\r\nsuch as `HttpAssetProvider` or `PresignedAssetProvider`."
2978
+ "text": "Configuration for binary asset storage (e.g., images).\n\nThe Yjs document only persists asset ids; the actual bytes are stored\nby the providers listed here. Defaults to IndexedDB-only storage. To\nsupport cross-device image sync alongside a networked sync provider\n(Hocuspocus, WebSocket), configure at least one remote asset provider\nsuch as `HttpAssetProvider` or `PresignedAssetProvider`."
3060
2979
  },
3061
2980
  "getter": false,
3062
2981
  "setter": false
@@ -3551,8 +3470,7 @@ export class KritzelEngine {
3551
3470
  }
3552
3471
  static get states() {
3553
3472
  return {
3554
- "forceUpdate": {},
3555
- "isSyncing": {}
3473
+ "forceUpdate": {}
3556
3474
  };
3557
3475
  }
3558
3476
  static get events() {
@@ -3857,6 +3775,21 @@ export class KritzelEngine {
3857
3775
  }
3858
3776
  }
3859
3777
  }
3778
+ }, {
3779
+ "method": "isSyncing",
3780
+ "name": "isSyncing",
3781
+ "bubbles": true,
3782
+ "cancelable": true,
3783
+ "composed": true,
3784
+ "docs": {
3785
+ "tags": [],
3786
+ "text": "Emitted when a remote sync starts (`true`, data differs from the local copy) or finishes (`false`)."
3787
+ },
3788
+ "complexType": {
3789
+ "original": "boolean",
3790
+ "resolved": "boolean",
3791
+ "references": {}
3792
+ }
3860
3793
  }, {
3861
3794
  "method": "notificationsChange",
3862
3795
  "name": "notificationsChange",
@@ -3916,21 +3849,6 @@ export class KritzelEngine {
3916
3849
  "resolved": "boolean",
3917
3850
  "references": {}
3918
3851
  }
3919
- }, {
3920
- "method": "syncingChange",
3921
- "name": "syncingChange",
3922
- "bubbles": true,
3923
- "cancelable": true,
3924
- "composed": true,
3925
- "docs": {
3926
- "tags": [],
3927
- "text": "Emitted when remote workspace synchronization is in progress."
3928
- },
3929
- "complexType": {
3930
- "original": "boolean",
3931
- "resolved": "boolean",
3932
- "references": {}
3933
- }
3934
3852
  }];
3935
3853
  }
3936
3854
  static get methods() {
@@ -4485,7 +4403,7 @@ export class KritzelEngine {
4485
4403
  "return": "Promise<void>"
4486
4404
  },
4487
4405
  "docs": {
4488
- "text": "Programmatically opens the context menu at a specified world-coordinate position.\r\nIf `objectId` is provided and found, the object context menu is shown for that object.\r\nIf no `objectId` is provided but a selection group already exists, the object context menu is shown.\r\nOtherwise, the global context menu is shown.",
4406
+ "text": "Programmatically opens the context menu at a specified world-coordinate position.\nIf `objectId` is provided and found, the object context menu is shown for that object.\nIf no `objectId` is provided but a selection group already exists, the object context menu is shown.\nOtherwise, the global context menu is shown.",
4489
4407
  "tags": [{
4490
4408
  "name": "param",
4491
4409
  "text": "options.x - The X position in world (canvas) coordinates."
@@ -4595,7 +4513,7 @@ export class KritzelEngine {
4595
4513
  "return": "Promise<T[]>"
4596
4514
  },
4597
4515
  "docs": {
4598
- "text": "Returns all objects that match the given predicate function.\r\nExcludes internal selection-related objects (selection groups and selection boxes).",
4516
+ "text": "Returns all objects that match the given predicate function.\nExcludes internal selection-related objects (selection groups and selection boxes).",
4599
4517
  "tags": [{
4600
4518
  "name": "param",
4601
4519
  "text": "predicate - A filter function called for each object. Return `true` to include."
@@ -4604,7 +4522,7 @@ export class KritzelEngine {
4604
4522
  "text": "An array of matching objects."
4605
4523
  }, {
4606
4524
  "name": "example",
4607
- "text": "```ts\r\n// Find all text objects\r\nconst texts = await engine.findObjects(obj => obj.__class__ === 'KritzelText');\r\n\r\n// Find objects at a point\r\nconst hits = await engine.findObjects(obj => obj.hitTest(100, 200));\r\n\r\n// Combine criteria\r\nconst filtered = await engine.findObjects(obj => obj.__class__ === 'KritzelPath' && obj.opacity < 0.5);\r\n```"
4525
+ "text": "```ts\n// Find all text objects\nconst texts = await engine.findObjects(obj => obj.__class__ === 'KritzelText');\n\n// Find objects at a point\nconst hits = await engine.findObjects(obj => obj.hitTest(100, 200));\n\n// Combine criteria\nconst filtered = await engine.findObjects(obj => obj.__class__ === 'KritzelPath' && obj.opacity < 0.5);\n```"
4608
4526
  }]
4609
4527
  }
4610
4528
  },
@@ -4737,7 +4655,7 @@ export class KritzelEngine {
4737
4655
  "return": "Promise<T[]>"
4738
4656
  },
4739
4657
  "docs": {
4740
- "text": "Adds multiple objects to the canvas in a single batch operation.\r\nAll objects are inserted within one Yjs transaction (single undo step),\r\ntriggering only one rerender cycle. Intended for programmatic streaming\r\nscenarios where per-object overhead would cause stutter.",
4658
+ "text": "Adds multiple objects to the canvas in a single batch operation.\nAll objects are inserted within one Yjs transaction (single undo step),\ntriggering only one rerender cycle. Intended for programmatic streaming\nscenarios where per-object overhead would cause stutter.",
4741
4659
  "tags": [{
4742
4660
  "name": "param",
4743
4661
  "text": "objects - The object instances to add."
@@ -4859,7 +4777,7 @@ export class KritzelEngine {
4859
4777
  "return": "Promise<T[]>"
4860
4778
  },
4861
4779
  "docs": {
4862
- "text": "Removes multiple objects from the canvas in a single batch operation.\r\nAll removals happen within one Yjs transaction (single undo step),\r\ntriggering only one rerender cycle. Intended for programmatic streaming\r\nscenarios where per-object overhead would cause stutter.",
4780
+ "text": "Removes multiple objects from the canvas in a single batch operation.\nAll removals happen within one Yjs transaction (single undo step),\ntriggering only one rerender cycle. Intended for programmatic streaming\nscenarios where per-object overhead would cause stutter.",
4863
4781
  "tags": [{
4864
4782
  "name": "param",
4865
4783
  "text": "objects - The objects to remove."
@@ -5047,7 +4965,7 @@ export class KritzelEngine {
5047
4965
  "return": "Promise<void>"
5048
4966
  },
5049
4967
  "docs": {
5050
- "text": "Pans the viewport to center on the given object without changing the zoom level.\r\nUnlike `centerObjectInViewport`, this moves the camera \u2014 not the object.",
4968
+ "text": "Pans the viewport to center on the given object without changing the zoom level.\nUnlike `centerObjectInViewport`, this moves the camera \u2014 not the object.",
5051
4969
  "tags": [{
5052
4970
  "name": "param",
5053
4971
  "text": "object - The object whose center the viewport should pan to."
@@ -5067,7 +4985,7 @@ export class KritzelEngine {
5067
4985
  "return": "Promise<boolean>"
5068
4986
  },
5069
4987
  "docs": {
5070
- "text": "Pans and zooms the viewport to fit the nearest content, with padding.\r\nUseful when the user has panned away from all objects.",
4988
+ "text": "Pans and zooms the viewport to fit the nearest content, with padding.\nUseful when the user has panned away from all objects.",
5071
4989
  "tags": [{
5072
4990
  "name": "returns",
5073
4991
  "text": "`true` if content was found and the viewport was adjusted, `false` otherwise."
@@ -5091,7 +5009,7 @@ export class KritzelEngine {
5091
5009
  "return": "Promise<boolean>"
5092
5010
  },
5093
5011
  "docs": {
5094
- "text": "Pans and zooms the viewport to fit ALL objects on the canvas, including those not currently rendered.\r\nCalculates the combined bounding box of all objects and centers the viewport to show them.",
5012
+ "text": "Pans and zooms the viewport to fit ALL objects on the canvas, including those not currently rendered.\nCalculates the combined bounding box of all objects and centers the viewport to show them.",
5095
5013
  "tags": [{
5096
5014
  "name": "param",
5097
5015
  "text": "animate - Whether to animate the viewport transition (default: true)."
@@ -5128,7 +5046,7 @@ export class KritzelEngine {
5128
5046
  "return": "Promise<boolean>"
5129
5047
  },
5130
5048
  "docs": {
5131
- "text": "Pans and zooms the viewport to fit the provided objects.\r\nCalculates the combined bounding box of the given objects and centers the viewport to show them.",
5049
+ "text": "Pans and zooms the viewport to fit the provided objects.\nCalculates the combined bounding box of the given objects and centers the viewport to show them.",
5132
5050
  "tags": [{
5133
5051
  "name": "param",
5134
5052
  "text": "objects - The objects to center and fit in the viewport."
@@ -5235,7 +5153,7 @@ export class KritzelEngine {
5235
5153
  "return": "Promise<void>"
5236
5154
  },
5237
5155
  "docs": {
5238
- "text": "Zooms the viewport to the given scale level.\r\nOptionally centers on a world point; if omitted, zooms around the viewport center.",
5156
+ "text": "Zooms the viewport to the given scale level.\nOptionally centers on a world point; if omitted, zooms around the viewport center.",
5239
5157
  "tags": [{
5240
5158
  "name": "param",
5241
5159
  "text": "scale - Target scale level."
@@ -5553,7 +5471,7 @@ export class KritzelEngine {
5553
5471
  "return": "Promise<KritzelObjectExportFormat[]>"
5554
5472
  },
5555
5473
  "docs": {
5556
- "text": "Returns export formats supported by the currently selected object.\r\nOnly returns formats when exactly one object is selected.",
5474
+ "text": "Returns export formats supported by the currently selected object.\nOnly returns formats when exactly one object is selected.",
5557
5475
  "tags": []
5558
5476
  }
5559
5477
  },
@@ -5580,7 +5498,7 @@ export class KritzelEngine {
5580
5498
  "return": "Promise<boolean>"
5581
5499
  },
5582
5500
  "docs": {
5583
- "text": "Checks whether the currently selected object supports a specific export format.\r\nReturns false when none or multiple objects are selected.",
5501
+ "text": "Checks whether the currently selected object supports a specific export format.\nReturns false when none or multiple objects are selected.",
5584
5502
  "tags": []
5585
5503
  }
5586
5504
  },
@@ -5607,7 +5525,7 @@ export class KritzelEngine {
5607
5525
  "return": "Promise<void>"
5608
5526
  },
5609
5527
  "docs": {
5610
- "text": "Exports the currently selected object in the requested format and triggers a file download.\r\nOnly supports single selection.",
5528
+ "text": "Exports the currently selected object in the requested format and triggers a file download.\nOnly supports single selection.",
5611
5529
  "tags": []
5612
5530
  }
5613
5531
  },
@@ -5628,7 +5546,7 @@ export class KritzelEngine {
5628
5546
  "return": "Promise<string>"
5629
5547
  },
5630
5548
  "docs": {
5631
- "text": "Exports the current workspace and all its objects as a JSON string.\r\nThe exported data includes workspace metadata (id, name, viewport) and all canvas objects.",
5549
+ "text": "Exports the current workspace and all its objects as a JSON string.\nThe exported data includes workspace metadata (id, name, viewport) and all canvas objects.",
5632
5550
  "tags": [{
5633
5551
  "name": "returns",
5634
5552
  "text": "A JSON string representing the complete workspace state."
@@ -5662,7 +5580,7 @@ export class KritzelEngine {
5662
5580
  "return": "Promise<void>"
5663
5581
  },
5664
5582
  "docs": {
5665
- "text": "Imports a workspace from a JSON string into a new workspace.\r\nCreates a new workspace with the imported data and automatically switches to it.",
5583
+ "text": "Imports a workspace from a JSON string into a new workspace.\nCreates a new workspace with the imported data and automatically switches to it.",
5666
5584
  "tags": [{
5667
5585
  "name": "param",
5668
5586
  "text": "json - A JSON string containing workspace data (from exportAsJson)."
@@ -5699,7 +5617,7 @@ export class KritzelEngine {
5699
5617
  "return": "Promise<number>"
5700
5618
  },
5701
5619
  "docs": {
5702
- "text": "Loads objects from a workspace JSON string into the current workspace.\r\nUnlike importFromJson, this does not create a new workspace - it adds objects to the existing one.\r\nUseful for initializing a workspace with pre-existing content after the editor is ready.",
5620
+ "text": "Loads objects from a workspace JSON string into the current workspace.\nUnlike importFromJson, this does not create a new workspace - it adds objects to the existing one.\nUseful for initializing a workspace with pre-existing content after the editor is ready.",
5703
5621
  "tags": [{
5704
5622
  "name": "param",
5705
5623
  "text": "json - A JSON string containing workspace data (from exportAsJson)."
@@ -5759,7 +5677,7 @@ export class KritzelEngine {
5759
5677
  "return": "Promise<void>"
5760
5678
  },
5761
5679
  "docs": {
5762
- "text": "Opens a file picker dialog and imports the selected JSON file into the workspace.\r\nThis method creates a hidden file input, triggers the browser's file chooser,\r\nreads the selected JSON file, and imports it using importFromJson.",
5680
+ "text": "Opens a file picker dialog and imports the selected JSON file into the workspace.\nThis method creates a hidden file input, triggers the browser's file chooser,\nreads the selected JSON file, and imports it using importFromJson.",
5763
5681
  "tags": [{
5764
5682
  "name": "returns",
5765
5683
  "text": "A promise that resolves when the import is complete or rejects on error/cancel."
@@ -5942,7 +5860,7 @@ export class KritzelEngine {
5942
5860
  "return": "Promise<void>"
5943
5861
  },
5944
5862
  "docs": {
5945
- "text": "Loads a shared workspace by token.\r\nIf the workspace exists locally, it switches to it.\r\nIf it doesn't exist, it adds it to the local workspaces list and then switches to it.",
5863
+ "text": "Loads a shared workspace by token.\nIf the workspace exists locally, it switches to it.\nIf it doesn't exist, it adds it to the local workspaces list and then switches to it.",
5946
5864
  "tags": [{
5947
5865
  "name": "param",
5948
5866
  "text": "token - The connection token identifying the shared workspace"
@@ -5962,7 +5880,7 @@ export class KritzelEngine {
5962
5880
  "return": "Promise<void>"
5963
5881
  },
5964
5882
  "docs": {
5965
- "text": "Reinitializes sync by performing a full teardown and re-initialization.\r\nDestroys the current Yjs documents and providers, then rebuilds everything\r\nfrom the current syncConfig. Data reloads from IndexedDB nearly instantly.\r\nCall this after updating the syncConfig prop (e.g. after authentication state changes).",
5883
+ "text": "Reinitializes sync by performing a full teardown and re-initialization.\nDestroys the current Yjs documents and providers, then rebuilds everything\nfrom the current syncConfig. Data reloads from IndexedDB nearly instantly.\nCall this after updating the syncConfig prop (e.g. after authentication state changes).",
5966
5884
  "tags": []
5967
5885
  }
5968
5886
  },
@@ -6225,7 +6143,7 @@ export class KritzelEngine {
6225
6143
  "return": "Promise<Partial<Record<keyof KritzelTerms, string>>>"
6226
6144
  },
6227
6145
  "docs": {
6228
- "text": "Resolves every known term key for the active locale into a flat map.\r\nUseful for UI layers that need to localize many strings at once.",
6146
+ "text": "Resolves every known term key for the active locale into a flat map.\nUseful for UI layers that need to localize many strings at once.",
6229
6147
  "tags": []
6230
6148
  }
6231
6149
  }
@@ -1,29 +1,29 @@
1
- :host {
2
- position: absolute;
3
- bottom: var(--kritzel-watermark-offset-bottom, 12px);
4
- right: var(--kritzel-watermark-offset-right, 12px);
5
- z-index: 10000;
6
- pointer-events: none;
7
- }
8
-
9
- .watermark-link {
10
- pointer-events: auto;
11
- display: inline-flex;
12
- align-items: center;
13
- padding: 4px 8px;
14
- border-radius: var(--kritzel-watermark-border-radius, 6px);
15
- font-family: var(--kritzel-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
16
- font-size: var(--kritzel-watermark-font-size, 11px);
17
- line-height: 1;
18
- text-decoration: none;
19
- color: var(--kritzel-watermark-color, rgba(60, 60, 60, 0.75));
20
- background-color: var(--kritzel-watermark-background, rgba(255, 255, 255, 0.6));
21
- box-shadow: var(--kritzel-watermark-box-shadow, 0 1px 2px rgba(0, 0, 0, 0.12));
22
- opacity: var(--kritzel-watermark-opacity, 0.85);
23
- transition: opacity 150ms ease;
24
- user-select: none;
25
- }
26
-
27
- .watermark-link:hover {
28
- opacity: 1;
29
- }
1
+ :host {
2
+ position: absolute;
3
+ bottom: var(--kritzel-watermark-offset-bottom, 12px);
4
+ right: var(--kritzel-watermark-offset-right, 12px);
5
+ z-index: 10000;
6
+ pointer-events: none;
7
+ }
8
+
9
+ .watermark-link {
10
+ pointer-events: auto;
11
+ display: inline-flex;
12
+ align-items: center;
13
+ padding: 4px 8px;
14
+ border-radius: var(--kritzel-watermark-border-radius, 6px);
15
+ font-family: var(--kritzel-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
16
+ font-size: var(--kritzel-watermark-font-size, 11px);
17
+ line-height: 1;
18
+ text-decoration: none;
19
+ color: var(--kritzel-watermark-color, rgba(60, 60, 60, 0.75));
20
+ background-color: var(--kritzel-watermark-background, rgba(255, 255, 255, 0.6));
21
+ box-shadow: var(--kritzel-watermark-box-shadow, 0 1px 2px rgba(0, 0, 0, 0.12));
22
+ opacity: var(--kritzel-watermark-opacity, 0.85);
23
+ transition: opacity 150ms ease;
24
+ user-select: none;
25
+ }
26
+
27
+ .watermark-link:hover {
28
+ opacity: 1;
29
+ }
@@ -19,7 +19,7 @@ export class KritzelWatermark {
19
19
  label;
20
20
  render() {
21
21
  const label = this.label ?? this.core.localizationManager.translate('watermark.poweredBy');
22
- return (h(Host, { key: 'de81b568421f5517fe19897bd4a4a5d58d1f622d' }, h("a", { key: '6278f78180869650afc181aac5c37aa401c09040', class: "watermark-link", href: KRITZEL_WEBSITE_URL, target: "_blank", rel: "noopener noreferrer", part: "watermark", onPointerDown: (ev) => ev.stopPropagation(), onPointerUp: (ev) => ev.stopPropagation() }, label)));
22
+ return (h(Host, { key: 'ae00d98f16912afcb7a90d47a9fc4d55fc7468f0' }, h("a", { key: '8781f94c9efe44b0e7a7a8c20a119160cb9feb8e', class: "watermark-link", href: KRITZEL_WEBSITE_URL, target: "_blank", rel: "noopener noreferrer", part: "watermark", onPointerDown: (ev) => ev.stopPropagation(), onPointerUp: (ev) => ev.stopPropagation() }, label)));
23
23
  }
24
24
  static get is() { return "kritzel-watermark"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -71,7 +71,7 @@ export class KritzelWatermark {
71
71
  "optional": true,
72
72
  "docs": {
73
73
  "tags": [],
74
- "text": "Resolved \"Powered by Kritzel\" label. Passed in by the engine so the badge\r\nre-renders when the active locale changes. Falls back to resolving the term\r\nfrom the core when not provided."
74
+ "text": "Resolved \"Powered by Kritzel\" label. Passed in by the engine so the badge\nre-renders when the active locale changes. Falls back to resolving the term\nfrom the core when not provided."
75
75
  },
76
76
  "getter": false,
77
77
  "setter": false,
@@ -1,58 +1,58 @@
1
- :host {
2
- display: inline-flex;
3
- justify-content: center;
4
- align-items: center;
5
- border-radius: 50%;
6
- overflow: hidden;
7
- user-select: none;
8
- flex-shrink: 0;
9
- }
10
-
11
- .avatar-image {
12
- display: block;
13
- width: 100%;
14
- height: 100%;
15
- object-fit: cover;
16
- border-radius: 50%;
17
- }
18
-
19
- .avatar-initials {
20
- display: flex;
21
- justify-content: center;
22
- align-items: center;
23
- width: 100%;
24
- height: 100%;
25
- border-radius: 50%;
26
- color: var(--kritzel-avatar-initials-color, #ffffff);
27
- font-weight: var(--kritzel-avatar-initials-font-weight, 500);
28
- font-family: var(--kritzel-avatar-initials-font-family, sans-serif);
29
- line-height: 1;
30
- }
31
-
32
- .avatar-default {
33
- display: flex;
34
- justify-content: center;
35
- align-items: center;
36
- width: 100%;
37
- height: 100%;
38
- border-radius: 50%;
39
- background-color: var(--kritzel-avatar-default-background, #e0e0e0);
40
- color: var(--kritzel-avatar-default-color, #9e9e9e);
41
- }
42
-
43
- .avatar-default svg {
44
- width: 60%;
45
- height: 60%;
46
- }
47
-
48
- :host(.has-image) {
49
- border: var(--kritzel-avatar-border, none);
50
- }
51
-
52
- :host(.has-initials) {
53
- border: var(--kritzel-avatar-border, none);
54
- }
55
-
56
- :host(.has-default) {
57
- border: var(--kritzel-avatar-border, none);
58
- }
1
+ :host {
2
+ display: inline-flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ border-radius: 50%;
6
+ overflow: hidden;
7
+ user-select: none;
8
+ flex-shrink: 0;
9
+ }
10
+
11
+ .avatar-image {
12
+ display: block;
13
+ width: 100%;
14
+ height: 100%;
15
+ object-fit: cover;
16
+ border-radius: 50%;
17
+ }
18
+
19
+ .avatar-initials {
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ width: 100%;
24
+ height: 100%;
25
+ border-radius: 50%;
26
+ color: var(--kritzel-avatar-initials-color, #ffffff);
27
+ font-weight: var(--kritzel-avatar-initials-font-weight, 500);
28
+ font-family: var(--kritzel-avatar-initials-font-family, sans-serif);
29
+ line-height: 1;
30
+ }
31
+
32
+ .avatar-default {
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ width: 100%;
37
+ height: 100%;
38
+ border-radius: 50%;
39
+ background-color: var(--kritzel-avatar-default-background, #e0e0e0);
40
+ color: var(--kritzel-avatar-default-color, #9e9e9e);
41
+ }
42
+
43
+ .avatar-default svg {
44
+ width: 60%;
45
+ height: 60%;
46
+ }
47
+
48
+ :host(.has-image) {
49
+ border: var(--kritzel-avatar-border, none);
50
+ }
51
+
52
+ :host(.has-initials) {
53
+ border: var(--kritzel-avatar-border, none);
54
+ }
55
+
56
+ :host(.has-default) {
57
+ border: var(--kritzel-avatar-border, none);
58
+ }
@@ -81,16 +81,16 @@ export class KritzelAvatar {
81
81
  height: `${this.size}px`,
82
82
  fontSize: `${Math.round(this.size * 0.4)}px`,
83
83
  };
84
- return (h(Host, { key: '020217baf0aa2736af33c5a003e89406322e5fdc', style: containerStyles, class: {
84
+ return (h(Host, { key: '90ce966bb2a374e68c544906c8c746df6cc01038', style: containerStyles, class: {
85
85
  'has-image': !!showImage,
86
86
  'has-initials': !!showInitials,
87
87
  'has-default': !!showDefaultIcon,
88
- }, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '2f54dad2260ebf38cfe8c57e28899c98729e7e38', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
88
+ }, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '6799f4ad45c7d40ebaf640f191171ed6a5f14ae9', src: imageUrl, alt: "", class: "avatar-image", ref: (el) => {
89
89
  if (el) {
90
90
  el.referrerPolicy = 'no-referrer';
91
91
  el.crossOrigin = 'anonymous';
92
92
  }
93
- }, onError: this.handleImageError })), showInitials && (h("span", { key: 'a97435d30044a37f15ce72ed51439e9c682c0aa3', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: '6d0893d3f15a2d68a93f3fcf1b0fbd36786be0eb', class: "avatar-default" }, h("svg", { key: '688a9a1f88e22f4f3c3085675618b5f5f460d8f7', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: 'd12c67677e162534b2ad92535acc6a836df179c7', d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }))))));
93
+ }, onError: this.handleImageError })), showInitials && (h("span", { key: '98cdcda64b900994b61a03179be9f2af17c489e8', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: '64e6a6ee67017c927dce0b51810a5bb02fc0d6d1', class: "avatar-default" }, h("svg", { key: '42f99637a3c23aaf10fa7c99753347ede1d518c0', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: '28b52a68b36e98b0e14891fd225457be65f1bb46', d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }))))));
94
94
  }
95
95
  static get is() { return "kritzel-avatar"; }
96
96
  static get encapsulation() { return "shadow"; }