kritzel-stencil 0.4.20 → 0.4.22

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 (226) 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 +51 -2
  5. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +268 -139
  6. package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{schema.constants-CY0WWJYd.js → schema.constants-CjN-B633.js} +20 -44
  9. package/dist/cjs/stencil.cjs.js +2 -2
  10. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +21 -0
  11. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +29 -1
  12. package/dist/collection/classes/structures/app-state-map.structure.js +19 -6
  13. package/dist/collection/classes/structures/object-map.structure.js +66 -4
  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 +51 -18
  21. package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
  22. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +87 -38
  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 +53 -4
  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 +61 -56
  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-CLAz6RJc.js → p-2WiGyky4.js} +3 -3
  156. package/dist/components/{p-zG-WUBGF.js → p-4SPnZZkH.js} +4 -4
  157. package/dist/components/{p-MhQxGUvY.js → p-B-585egz.js} +3 -3
  158. package/dist/components/{p-C9_yBEoX.js → p-B43upypT.js} +10 -30
  159. package/dist/components/{p-CSKToqUl.js → p-B5SWPDuq.js} +4 -4
  160. package/dist/components/{p-Covorf4C.js → p-BFYtCsZu.js} +3 -3
  161. package/dist/components/{p-Csxx9TbU.js → p-BNeE3SiZ.js} +216 -116
  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-25ExYYPf.js → p-Dx5NfJ0U.js} +9 -9
  191. package/dist/components/{p-fSV6KVTC.js → p-GKmqCI8r.js} +3 -3
  192. package/dist/components/{p-CWAChRD5.js → p-HoO86l1o.js} +12 -12
  193. package/dist/components/{p-Qdo3E8dr.js → p-PjPPCHVL.js} +2 -2
  194. package/dist/components/{p-D6JycG-I.js → p-bAacqNHq.js} +3 -3
  195. package/dist/components/{p-DjXQxw9R.js → p-djJSnjAX.js} +3 -3
  196. package/dist/components/{p-b0J2ktAm.js → p-dsxHDlQ3.js} +7 -7
  197. package/dist/components/{p-BppcoKoo.js → p-eZXIu4yK.js} +5 -5
  198. package/dist/components/{p-BFYT03fw.js → p-fL9rl200.js} +3 -3
  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 +52 -3
  203. package/dist/esm/kritzel-active-users_47.entry.js +268 -139
  204. package/dist/esm/kritzel-brush-style.entry.js +2 -2
  205. package/dist/esm/loader.js +2 -2
  206. package/dist/esm/{schema.constants-DBvUmuDH.js → schema.constants-DfvqHmxc.js} +20 -44
  207. package/dist/esm/stencil.js +3 -3
  208. package/dist/stencil/index.esm.js +52 -3
  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-d19d1b82.entry.js → p-ab5c4292.entry.js} +268 -139
  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 +5 -0
  215. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +6 -0
  216. package/dist/types/classes/structures/app-state-map.structure.d.ts +6 -0
  217. package/dist/types/classes/structures/object-map.structure.d.ts +26 -2
  218. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +3 -0
  219. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +14 -1
  220. package/dist/types/components.d.ts +8 -1
  221. package/dist/types/constants/version.d.ts +1 -1
  222. package/dist/types/interfaces/sync-provider.interface.d.ts +13 -0
  223. package/dist/types/stencil-public-runtime.d.ts +0 -12
  224. package/loader/index.d.ts +1 -1
  225. package/package.json +1 -1
  226. package/readme.md +10 -10
@@ -258,7 +258,7 @@ export class KritzelEngine {
258
258
  contextMenuStateChange;
259
259
  /** Emitted when the combined loading state (external `isLoading` prop or internal workspace loading) changes. */
260
260
  loadingChange;
261
- /** Emitted when remote workspace synchronization is in progress. */
261
+ /** Emitted while remote changes are being applied to the active workspace. Stays silent when the remote holds nothing new. */
262
262
  syncingChange;
263
263
  forceUpdate = 0;
264
264
  isSyncing = false;
@@ -1845,6 +1845,7 @@ export class KritzelEngine {
1845
1845
  _sceneBootstrapOpacity = 1;
1846
1846
  _sceneBootstrapTransitionEnabled = false;
1847
1847
  _sceneBootstrapTransitionTimer = null;
1848
+ _remoteChangesUnsubscribe = null;
1848
1849
  _defaultUndoState = {
1849
1850
  canUndo: false,
1850
1851
  canRedo: false,
@@ -1862,9 +1863,16 @@ export class KritzelEngine {
1862
1863
  this.loadingChange.emit(this.core.store.state.isLoading);
1863
1864
  }
1864
1865
  syncSyncingState(isSyncing) {
1866
+ if (this.isSyncing === isSyncing) {
1867
+ return;
1868
+ }
1865
1869
  this.isSyncing = isSyncing;
1866
1870
  this.syncingChange.emit(isSyncing);
1867
1871
  }
1872
+ clearRemoteChangesSubscription() {
1873
+ this._remoteChangesUnsubscribe?.();
1874
+ this._remoteChangesUnsubscribe = null;
1875
+ }
1868
1876
  isNetworkAvailable() {
1869
1877
  return typeof navigator !== 'undefined' && navigator.onLine;
1870
1878
  }
@@ -1957,6 +1965,7 @@ export class KritzelEngine {
1957
1965
  disconnectedCallback() {
1958
1966
  this.throttledPointerMoveMulti.cancel();
1959
1967
  this._revealedImageKeys.clear();
1968
+ this.clearRemoteChangesSubscription();
1960
1969
  if (this._sceneBootstrapTransitionTimer !== null) {
1961
1970
  clearTimeout(this._sceneBootstrapTransitionTimer);
1962
1971
  this._sceneBootstrapTransitionTimer = null;
@@ -2103,6 +2112,7 @@ export class KritzelEngine {
2103
2112
  if (!this._isAssetStorageInitialized && this.assetStorageConfig) {
2104
2113
  await this.initializeAssetStorage();
2105
2114
  }
2115
+ await this.waitForRemoteAppStateIfEmpty();
2106
2116
  if (this.activeWorkspaceId) {
2107
2117
  const startupWorkspace = this.core.getWorkspaces().find(ws => ws.id === this.activeWorkspaceId);
2108
2118
  if (startupWorkspace) {
@@ -2135,6 +2145,27 @@ export class KritzelEngine {
2135
2145
  }
2136
2146
  this.tryResolveActiveWorkspaceFromId();
2137
2147
  }
2148
+ /**
2149
+ * On a cold start the remote workspace list may still be in flight; creating a
2150
+ * fallback workspace before it arrives would pollute the synced app state.
2151
+ */
2152
+ async waitForRemoteAppStateIfEmpty() {
2153
+ if (this.core.getWorkspaces().length > 0) {
2154
+ return;
2155
+ }
2156
+ if (!this.core.appStateMap.hasNetworkSyncProvider || !this.isNetworkAvailable()) {
2157
+ return;
2158
+ }
2159
+ this._isWorkspaceLoading = true;
2160
+ this.syncLoadingState();
2161
+ try {
2162
+ await this.core.appStateMap.whenNetworkSynced();
2163
+ }
2164
+ finally {
2165
+ this._isWorkspaceLoading = false;
2166
+ this.syncLoadingState();
2167
+ }
2168
+ }
2138
2169
  resolveStartupWorkspace() {
2139
2170
  if (this.activeWorkspaceId) {
2140
2171
  const workspaceById = this.core.getWorkspaces().find(ws => ws.id === this.activeWorkspaceId);
@@ -2189,21 +2220,7 @@ export class KritzelEngine {
2189
2220
  this._workspaceInitializationTargetKey = targetKey;
2190
2221
  try {
2191
2222
  await initializationPromise;
2192
- // Track remote sync in the background without blocking the loading overlay.
2193
- const initializedObjects = this.core.store.objects;
2194
- const networkSyncPromise = initializedObjects?.whenNetworkSynced();
2195
- if (networkSyncPromise && this.isNetworkAvailable()) {
2196
- this.syncSyncingState(true);
2197
- void networkSyncPromise.finally(() => {
2198
- // Only clear syncing for the currently active object map.
2199
- if (this.core.store.objects === initializedObjects) {
2200
- this.syncSyncingState(false);
2201
- }
2202
- });
2203
- }
2204
- else {
2205
- this.syncSyncingState(false);
2206
- }
2223
+ this.trackRemoteSynchronization();
2207
2224
  }
2208
2225
  finally {
2209
2226
  // Only the most recent init clears loading state to prevent race conditions
@@ -2215,6 +2232,38 @@ export class KritzelEngine {
2215
2232
  }
2216
2233
  }
2217
2234
  }
2235
+ /**
2236
+ * Reports syncing only while remote data is actually being reconciled into the
2237
+ * active workspace. Yjs suppresses updates that carry nothing new, so a workspace
2238
+ * that already matches the remote never reports syncing at all.
2239
+ */
2240
+ trackRemoteSynchronization() {
2241
+ this.clearRemoteChangesSubscription();
2242
+ this.syncSyncingState(false);
2243
+ const initializedObjects = this.core.store.objects;
2244
+ if (!initializedObjects?.hasNetworkSyncProvider || !this.isNetworkAvailable()) {
2245
+ return;
2246
+ }
2247
+ if (initializedObjects.supportsRemoteChangeDetection) {
2248
+ this._remoteChangesUnsubscribe = initializedObjects.onRemoteChangesApplied(() => {
2249
+ if (this.core.store.objects !== initializedObjects) {
2250
+ return;
2251
+ }
2252
+ this.syncSyncingState(true);
2253
+ });
2254
+ }
2255
+ else {
2256
+ // Custom providers without an update origin cannot be diffed, so fall back to reporting the whole handshake.
2257
+ this.syncSyncingState(true);
2258
+ }
2259
+ void initializedObjects.whenNetworkSynced().finally(() => {
2260
+ if (this.core.store.objects !== initializedObjects) {
2261
+ return;
2262
+ }
2263
+ this.clearRemoteChangesSubscription();
2264
+ this.syncSyncingState(false);
2265
+ });
2266
+ }
2218
2267
  emitObjectsChange() {
2219
2268
  const objectsMap = this.core.store.objects;
2220
2269
  if (!objectsMap) {
@@ -2970,7 +3019,7 @@ export class KritzelEngine {
2970
3019
  "optional": true,
2971
3020
  "docs": {
2972
3021
  "tags": [],
2973
- "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`."
3022
+ "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`."
2974
3023
  },
2975
3024
  "getter": false,
2976
3025
  "setter": false
@@ -3838,7 +3887,7 @@ export class KritzelEngine {
3838
3887
  "composed": true,
3839
3888
  "docs": {
3840
3889
  "tags": [],
3841
- "text": "Emitted when remote workspace synchronization is in progress."
3890
+ "text": "Emitted while remote changes are being applied to the active workspace. Stays silent when the remote holds nothing new."
3842
3891
  },
3843
3892
  "complexType": {
3844
3893
  "original": "boolean",
@@ -4399,7 +4448,7 @@ export class KritzelEngine {
4399
4448
  "return": "Promise<void>"
4400
4449
  },
4401
4450
  "docs": {
4402
- "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.",
4451
+ "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.",
4403
4452
  "tags": [{
4404
4453
  "name": "param",
4405
4454
  "text": "options.x - The X position in world (canvas) coordinates."
@@ -4509,7 +4558,7 @@ export class KritzelEngine {
4509
4558
  "return": "Promise<T[]>"
4510
4559
  },
4511
4560
  "docs": {
4512
- "text": "Returns all objects that match the given predicate function.\r\nExcludes internal selection-related objects (selection groups and selection boxes).",
4561
+ "text": "Returns all objects that match the given predicate function.\nExcludes internal selection-related objects (selection groups and selection boxes).",
4513
4562
  "tags": [{
4514
4563
  "name": "param",
4515
4564
  "text": "predicate - A filter function called for each object. Return `true` to include."
@@ -4518,7 +4567,7 @@ export class KritzelEngine {
4518
4567
  "text": "An array of matching objects."
4519
4568
  }, {
4520
4569
  "name": "example",
4521
- "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```"
4570
+ "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```"
4522
4571
  }]
4523
4572
  }
4524
4573
  },
@@ -4651,7 +4700,7 @@ export class KritzelEngine {
4651
4700
  "return": "Promise<T[]>"
4652
4701
  },
4653
4702
  "docs": {
4654
- "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.",
4703
+ "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.",
4655
4704
  "tags": [{
4656
4705
  "name": "param",
4657
4706
  "text": "objects - The object instances to add."
@@ -4773,7 +4822,7 @@ export class KritzelEngine {
4773
4822
  "return": "Promise<T[]>"
4774
4823
  },
4775
4824
  "docs": {
4776
- "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.",
4825
+ "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.",
4777
4826
  "tags": [{
4778
4827
  "name": "param",
4779
4828
  "text": "objects - The objects to remove."
@@ -4961,7 +5010,7 @@ export class KritzelEngine {
4961
5010
  "return": "Promise<void>"
4962
5011
  },
4963
5012
  "docs": {
4964
- "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.",
5013
+ "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.",
4965
5014
  "tags": [{
4966
5015
  "name": "param",
4967
5016
  "text": "object - The object whose center the viewport should pan to."
@@ -4981,7 +5030,7 @@ export class KritzelEngine {
4981
5030
  "return": "Promise<boolean>"
4982
5031
  },
4983
5032
  "docs": {
4984
- "text": "Pans and zooms the viewport to fit the nearest content, with padding.\r\nUseful when the user has panned away from all objects.",
5033
+ "text": "Pans and zooms the viewport to fit the nearest content, with padding.\nUseful when the user has panned away from all objects.",
4985
5034
  "tags": [{
4986
5035
  "name": "returns",
4987
5036
  "text": "`true` if content was found and the viewport was adjusted, `false` otherwise."
@@ -5005,7 +5054,7 @@ export class KritzelEngine {
5005
5054
  "return": "Promise<boolean>"
5006
5055
  },
5007
5056
  "docs": {
5008
- "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.",
5057
+ "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.",
5009
5058
  "tags": [{
5010
5059
  "name": "param",
5011
5060
  "text": "animate - Whether to animate the viewport transition (default: true)."
@@ -5042,7 +5091,7 @@ export class KritzelEngine {
5042
5091
  "return": "Promise<boolean>"
5043
5092
  },
5044
5093
  "docs": {
5045
- "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.",
5094
+ "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.",
5046
5095
  "tags": [{
5047
5096
  "name": "param",
5048
5097
  "text": "objects - The objects to center and fit in the viewport."
@@ -5149,7 +5198,7 @@ export class KritzelEngine {
5149
5198
  "return": "Promise<void>"
5150
5199
  },
5151
5200
  "docs": {
5152
- "text": "Zooms the viewport to the given scale level.\r\nOptionally centers on a world point; if omitted, zooms around the viewport center.",
5201
+ "text": "Zooms the viewport to the given scale level.\nOptionally centers on a world point; if omitted, zooms around the viewport center.",
5153
5202
  "tags": [{
5154
5203
  "name": "param",
5155
5204
  "text": "scale - Target scale level."
@@ -5467,7 +5516,7 @@ export class KritzelEngine {
5467
5516
  "return": "Promise<KritzelObjectExportFormat[]>"
5468
5517
  },
5469
5518
  "docs": {
5470
- "text": "Returns export formats supported by the currently selected object.\r\nOnly returns formats when exactly one object is selected.",
5519
+ "text": "Returns export formats supported by the currently selected object.\nOnly returns formats when exactly one object is selected.",
5471
5520
  "tags": []
5472
5521
  }
5473
5522
  },
@@ -5494,7 +5543,7 @@ export class KritzelEngine {
5494
5543
  "return": "Promise<boolean>"
5495
5544
  },
5496
5545
  "docs": {
5497
- "text": "Checks whether the currently selected object supports a specific export format.\r\nReturns false when none or multiple objects are selected.",
5546
+ "text": "Checks whether the currently selected object supports a specific export format.\nReturns false when none or multiple objects are selected.",
5498
5547
  "tags": []
5499
5548
  }
5500
5549
  },
@@ -5521,7 +5570,7 @@ export class KritzelEngine {
5521
5570
  "return": "Promise<void>"
5522
5571
  },
5523
5572
  "docs": {
5524
- "text": "Exports the currently selected object in the requested format and triggers a file download.\r\nOnly supports single selection.",
5573
+ "text": "Exports the currently selected object in the requested format and triggers a file download.\nOnly supports single selection.",
5525
5574
  "tags": []
5526
5575
  }
5527
5576
  },
@@ -5542,7 +5591,7 @@ export class KritzelEngine {
5542
5591
  "return": "Promise<string>"
5543
5592
  },
5544
5593
  "docs": {
5545
- "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.",
5594
+ "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.",
5546
5595
  "tags": [{
5547
5596
  "name": "returns",
5548
5597
  "text": "A JSON string representing the complete workspace state."
@@ -5576,7 +5625,7 @@ export class KritzelEngine {
5576
5625
  "return": "Promise<void>"
5577
5626
  },
5578
5627
  "docs": {
5579
- "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.",
5628
+ "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.",
5580
5629
  "tags": [{
5581
5630
  "name": "param",
5582
5631
  "text": "json - A JSON string containing workspace data (from exportAsJson)."
@@ -5613,7 +5662,7 @@ export class KritzelEngine {
5613
5662
  "return": "Promise<number>"
5614
5663
  },
5615
5664
  "docs": {
5616
- "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.",
5665
+ "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.",
5617
5666
  "tags": [{
5618
5667
  "name": "param",
5619
5668
  "text": "json - A JSON string containing workspace data (from exportAsJson)."
@@ -5673,7 +5722,7 @@ export class KritzelEngine {
5673
5722
  "return": "Promise<void>"
5674
5723
  },
5675
5724
  "docs": {
5676
- "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.",
5725
+ "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.",
5677
5726
  "tags": [{
5678
5727
  "name": "returns",
5679
5728
  "text": "A promise that resolves when the import is complete or rejects on error/cancel."
@@ -5856,7 +5905,7 @@ export class KritzelEngine {
5856
5905
  "return": "Promise<void>"
5857
5906
  },
5858
5907
  "docs": {
5859
- "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.",
5908
+ "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.",
5860
5909
  "tags": [{
5861
5910
  "name": "param",
5862
5911
  "text": "token - The connection token identifying the shared workspace"
@@ -5876,7 +5925,7 @@ export class KritzelEngine {
5876
5925
  "return": "Promise<void>"
5877
5926
  },
5878
5927
  "docs": {
5879
- "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).",
5928
+ "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).",
5880
5929
  "tags": []
5881
5930
  }
5882
5931
  },
@@ -6139,7 +6188,7 @@ export class KritzelEngine {
6139
6188
  "return": "Promise<Partial<Record<keyof KritzelTerms, string>>>"
6140
6189
  },
6141
6190
  "docs": {
6142
- "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.",
6191
+ "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.",
6143
6192
  "tags": []
6144
6193
  }
6145
6194
  }
@@ -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"; }
@@ -1,43 +1,43 @@
1
- :host {
2
- display: flex;
3
- align-items: flex-start;
4
- gap: 8px;
5
- padding: 8px;
6
- box-sizing: border-box;
7
- width: 100%;
8
- }
9
-
10
- .brush-style-button {
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- width: 42px;
15
- height: 32px;
16
- padding: 0;
17
- border: none;
18
- outline: none;
19
- background: none;
20
- border-radius: 0;
21
- color: var(--control-text-color);
22
- font-weight: bold;
23
- -webkit-tap-highlight-color: transparent;
24
- }
25
-
26
- .font-style-button:not(:last-child) {
27
- border-right: 1px solid #333333;
28
- }
29
-
30
- .font-style-button:hover {
31
- background-color: var(--control-hover-bg);
32
- }
33
-
34
- .font-style-button:active {
35
- background-color: var(--control-active-bg);
36
- }
37
-
38
- .font-style-button.selected,
39
- .font-style-button.selected:hover,
40
- .font-style-button.selected:active {
41
- background-color: var(--control-selected-bg);
42
- color: var(--control-selected-color);
1
+ :host {
2
+ display: flex;
3
+ align-items: flex-start;
4
+ gap: 8px;
5
+ padding: 8px;
6
+ box-sizing: border-box;
7
+ width: 100%;
8
+ }
9
+
10
+ .brush-style-button {
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ width: 42px;
15
+ height: 32px;
16
+ padding: 0;
17
+ border: none;
18
+ outline: none;
19
+ background: none;
20
+ border-radius: 0;
21
+ color: var(--control-text-color);
22
+ font-weight: bold;
23
+ -webkit-tap-highlight-color: transparent;
24
+ }
25
+
26
+ .font-style-button:not(:last-child) {
27
+ border-right: 1px solid #333333;
28
+ }
29
+
30
+ .font-style-button:hover {
31
+ background-color: var(--control-hover-bg);
32
+ }
33
+
34
+ .font-style-button:active {
35
+ background-color: var(--control-active-bg);
36
+ }
37
+
38
+ .font-style-button.selected,
39
+ .font-style-button.selected:hover,
40
+ .font-style-button.selected:active {
41
+ background-color: var(--control-selected-bg);
42
+ color: var(--control-selected-color);
43
43
  }