kritzel-stencil 0.4.24 → 0.4.26
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.
- package/LICENSE +21 -21
- package/LICENSE.md +49 -49
- package/dist/cjs/{index-Dn19mGl-.js → index-Xav9JFHg.js} +13 -49
- package/dist/cjs/index.cjs.js +7 -1
- package/dist/cjs/{kritzel-active-users_47.cjs.entry.js → kritzel-active-users_46.cjs.entry.js} +112 -217
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{schema.constants-CY0WWJYd.js → schema.constants-CjN-B633.js} +20 -44
- package/dist/cjs/stencil.cjs.js +3 -3
- package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +3 -0
- package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +3 -0
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.css +115 -115
- package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +1 -1
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -10
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +160 -160
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +18 -20
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +22 -124
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.css +29 -29
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +2 -2
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.css +58 -58
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +42 -42
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +3 -3
- package/dist/collection/components/shared/kritzel-button/kritzel-button.css +73 -73
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.css +24 -24
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +46 -46
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-dialog/kritzel-dialog.css +209 -209
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +190 -190
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +2 -2
- package/dist/collection/components/shared/kritzel-font/kritzel-font.css +10 -10
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +48 -48
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +2 -2
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +30 -30
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +18 -18
- package/dist/collection/components/shared/kritzel-input/kritzel-input.css +69 -69
- package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.css +60 -60
- package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.js +3 -3
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.css +190 -190
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +34 -34
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +166 -166
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
- package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
- package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +78 -78
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +18 -18
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/ui/kritzel-active-users/kritzel-active-users.css +65 -65
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +112 -112
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +331 -331
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.css +11 -11
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.css +89 -89
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.css +50 -50
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.css +58 -58
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +2 -2
- package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -101
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.css +137 -137
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.css +38 -38
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/cursor.helper.js +6 -6
- package/dist/collection/helpers/svg-export.helper.js +41 -41
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +9 -4
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-brush-style.js +4 -4
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dialog.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +94 -102
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.js +1 -1
- package/dist/components/kritzel-loading-overlay.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-notification-card.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-watermark.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.js +1 -1
- package/dist/components/{p-BFYT03fw.js → p-B38_9BJg.js} +3 -3
- package/dist/components/{p-C9_yBEoX.js → p-B43upypT.js} +10 -30
- package/dist/components/{p-Covorf4C.js → p-BFYtCsZu.js} +3 -3
- package/dist/components/{p-BppcoKoo.js → p-BPzdPKWE.js} +5 -5
- package/dist/components/{p-Cx-L_28S.js → p-Ba0c-tu2.js} +3 -3
- package/dist/components/{p-MhQxGUvY.js → p-BeSKOETx.js} +3 -3
- package/dist/components/{p-CLAz6RJc.js → p-BprEDRpA.js} +3 -3
- package/dist/components/{p-BXUx_C0N.js → p-BsLI_BWq.js} +2 -2
- package/dist/components/{p-CSKToqUl.js → p-C0FEC_gS.js} +4 -4
- package/dist/components/{p-D2VcPEtL.js → p-CAXR5-S9.js} +6 -6
- package/dist/components/{p-DYPA7jpg.js → p-CBrn5AIB.js} +2 -2
- package/dist/components/{p-D3BzgkIE.js → p-CSPYkLLH.js} +2 -2
- package/dist/components/{p-Ck-87E2G.js → p-CSuU8frA.js} +1 -1
- package/dist/components/{p-Di--2boB.js → p-CXpv9Rxe.js} +3 -3
- package/dist/components/{p-dAXnRkjA.js → p-Ce1j1-Hg.js} +5 -5
- package/dist/components/{p-BrA9NBEE.js → p-CeffYwAK.js} +21 -21
- package/dist/components/{p-DT_WBwsw.js → p-ChPs27Fd.js} +6 -6
- package/dist/components/{p-3tBE7SyG.js → p-Cm33td2O.js} +2 -2
- package/dist/components/{p-BkXQL5Dl.js → p-CoXN583u.js} +5 -5
- package/dist/components/{p-Ch-KG9To.js → p-CucCT7Qn.js} +3 -3
- package/dist/components/{p-DPsbNStn.js → p-Cva3jIIU.js} +2 -2
- package/dist/components/{p-D0Trc3IQ.js → p-D0Ed8epW.js} +5 -5
- package/dist/components/{p-DafP9PAA.js → p-DFMZEarE.js} +2 -2
- package/dist/components/{p-BShrnlam.js → p-DK0anxtL.js} +2 -2
- package/dist/components/{p-zG-WUBGF.js → p-DN9p3G9K.js} +4 -4
- package/dist/components/{p-DcUIO14-.js → p-DOTdJ3JQ.js} +4 -4
- package/dist/components/{p-CWAChRD5.js → p-DOl-95VY.js} +12 -12
- package/dist/components/{p-Dznwo6oc.js → p-DTB3ykgO.js} +2 -2
- package/dist/components/{p-BZZ3KRPk.js → p-DUmLsjKb.js} +3 -3
- package/dist/components/{p-DwEYMvIn.js → p-DUoQyGKc.js} +66 -178
- package/dist/components/{p-QSyeAy8R.js → p-DX2nriaq.js} +2 -2
- package/dist/components/{p-BrqSjRJN.js → p-D_cyY7Nd.js} +3 -3
- package/dist/components/{p-CHoOe3FD.js → p-Df3BwVGy.js} +3 -3
- package/dist/components/{p-CSWCmyzb.js → p-DhabvHJM.js} +5 -5
- package/dist/components/{p-o3NYKrVL.js → p-DkHYY72B.js} +3 -3
- package/dist/components/{p-vDCa_ZDm.js → p-DnmVD1Mz.js} +3 -3
- package/dist/components/{p-fSV6KVTC.js → p-DoxFuOy1.js} +3 -3
- package/dist/components/{p-b0J2ktAm.js → p-Dpm75DfV.js} +7 -7
- package/dist/components/{p-ME1sDz3f.js → p-Dvn6ad4a.js} +2 -2
- package/dist/components/{p-Qdo3E8dr.js → p-NOWtUeeQ.js} +2 -2
- package/dist/components/{p-Dp1CD4gK.js → p-OUl5CA4Y.js} +2 -2
- package/dist/components/{p-D6JycG-I.js → p-bAacqNHq.js} +3 -3
- package/dist/components/{p-DjXQxw9R.js → p-djJSnjAX.js} +3 -3
- package/dist/components/{p-1Q4VnThv.js → p-jIKskj3S.js} +3 -3
- package/dist/components/{p-DW1B118Q.js → p-m7SeNszM.js} +9 -9
- package/dist/esm/{index-2va1Pk9z.js → index-Dhio9uis.js} +13 -49
- package/dist/esm/index.js +8 -2
- package/dist/{stencil/p-ce6d432e.entry.js → esm/kritzel-active-users_46.entry.js} +113 -217
- package/dist/esm/kritzel-brush-style.entry.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{schema.constants-DBvUmuDH.js → schema.constants-DfvqHmxc.js} +20 -44
- package/dist/esm/stencil.js +4 -4
- package/dist/stencil/index.esm.js +8 -2
- package/dist/{esm/kritzel-active-users_47.entry.js → stencil/p-5c045d3e.entry.js} +113 -217
- package/dist/stencil/{p-DBvUmuDH.js → p-DfvqHmxc.js} +20 -44
- package/dist/stencil/{p-2va1Pk9z.js → p-Dhio9uis.js} +11 -47
- package/dist/stencil/{p-df06ca3a.entry.js → p-fb32cd8f.entry.js} +2 -2
- package/dist/stencil/stencil.esm.js +4 -4
- package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +1 -0
- package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +1 -0
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +0 -1
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +0 -14
- package/dist/types/components.d.ts +0 -42
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/sync-provider.interface.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -12
- package/loader/index.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +10 -10
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.css +0 -50
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +0 -66
- package/dist/components/kritzel-sync-indicator.d.ts +0 -11
- package/dist/components/kritzel-sync-indicator.js +0 -6
- package/dist/components/p-Bxi-Bm49.js +0 -39
- package/dist/types/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.d.ts +0 -7
|
@@ -258,10 +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. */
|
|
262
|
-
syncingChange;
|
|
263
261
|
forceUpdate = 0;
|
|
264
|
-
isSyncing = false;
|
|
265
262
|
/** Manually triggers the `objectsSelectionChange` event. */
|
|
266
263
|
async triggerSelectionChange() {
|
|
267
264
|
this.objectsSelectionChange.emit();
|
|
@@ -1839,12 +1836,6 @@ export class KritzelEngine {
|
|
|
1839
1836
|
_syncConfigRevision = 0;
|
|
1840
1837
|
_assetStorageConfigRevision = 0;
|
|
1841
1838
|
_isWorkspaceLoading = false;
|
|
1842
|
-
_syncingRequestId = 0;
|
|
1843
|
-
_syncingShowTimeout = null;
|
|
1844
|
-
_syncingHideTimeout = null;
|
|
1845
|
-
_syncingVisibleSince = null;
|
|
1846
|
-
_syncingShowDelayMs = 300;
|
|
1847
|
-
_syncingMinimumVisibleMs = 500;
|
|
1848
1839
|
_hasLoggedUnlicensedWelcomeBanner = false;
|
|
1849
1840
|
_previousVisibleCustomElements = new Set();
|
|
1850
1841
|
_revealedImageKeys = new Set();
|
|
@@ -1867,66 +1858,6 @@ export class KritzelEngine {
|
|
|
1867
1858
|
this.core.store.state.isLoading = this._isWorkspaceLoading || this.isLoading;
|
|
1868
1859
|
this.loadingChange.emit(this.core.store.state.isLoading);
|
|
1869
1860
|
}
|
|
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
1861
|
isNetworkAvailable() {
|
|
1931
1862
|
return typeof navigator !== 'undefined' && navigator.onLine;
|
|
1932
1863
|
}
|
|
@@ -2019,7 +1950,6 @@ export class KritzelEngine {
|
|
|
2019
1950
|
disconnectedCallback() {
|
|
2020
1951
|
this.throttledPointerMoveMulti.cancel();
|
|
2021
1952
|
this._revealedImageKeys.clear();
|
|
2022
|
-
this.beginSyncingRequest();
|
|
2023
1953
|
if (this._sceneBootstrapTransitionTimer !== null) {
|
|
2024
1954
|
clearTimeout(this._sceneBootstrapTransitionTimer);
|
|
2025
1955
|
this._sceneBootstrapTransitionTimer = null;
|
|
@@ -2269,27 +2199,11 @@ export class KritzelEngine {
|
|
|
2269
2199
|
}
|
|
2270
2200
|
this._isWorkspaceLoading = true;
|
|
2271
2201
|
this.syncLoadingState();
|
|
2272
|
-
const syncingRequestId = this.beginSyncingRequest();
|
|
2273
2202
|
const initializationPromise = this.core.initializeWorkspace(workspace, options);
|
|
2274
2203
|
this._workspaceInitializationPromise = initializationPromise;
|
|
2275
2204
|
this._workspaceInitializationTargetKey = targetKey;
|
|
2276
2205
|
try {
|
|
2277
2206
|
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
2207
|
}
|
|
2294
2208
|
finally {
|
|
2295
2209
|
// Only the most recent init clears loading state to prevent race conditions
|
|
@@ -3056,7 +2970,7 @@ export class KritzelEngine {
|
|
|
3056
2970
|
"optional": true,
|
|
3057
2971
|
"docs": {
|
|
3058
2972
|
"tags": [],
|
|
3059
|
-
"text": "Configuration for binary asset storage (e.g., images).\
|
|
2973
|
+
"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
2974
|
},
|
|
3061
2975
|
"getter": false,
|
|
3062
2976
|
"setter": false
|
|
@@ -3551,8 +3465,7 @@ export class KritzelEngine {
|
|
|
3551
3465
|
}
|
|
3552
3466
|
static get states() {
|
|
3553
3467
|
return {
|
|
3554
|
-
"forceUpdate": {}
|
|
3555
|
-
"isSyncing": {}
|
|
3468
|
+
"forceUpdate": {}
|
|
3556
3469
|
};
|
|
3557
3470
|
}
|
|
3558
3471
|
static get events() {
|
|
@@ -3916,21 +3829,6 @@ export class KritzelEngine {
|
|
|
3916
3829
|
"resolved": "boolean",
|
|
3917
3830
|
"references": {}
|
|
3918
3831
|
}
|
|
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
3832
|
}];
|
|
3935
3833
|
}
|
|
3936
3834
|
static get methods() {
|
|
@@ -4485,7 +4383,7 @@ export class KritzelEngine {
|
|
|
4485
4383
|
"return": "Promise<void>"
|
|
4486
4384
|
},
|
|
4487
4385
|
"docs": {
|
|
4488
|
-
"text": "Programmatically opens the context menu at a specified world-coordinate position.\
|
|
4386
|
+
"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
4387
|
"tags": [{
|
|
4490
4388
|
"name": "param",
|
|
4491
4389
|
"text": "options.x - The X position in world (canvas) coordinates."
|
|
@@ -4595,7 +4493,7 @@ export class KritzelEngine {
|
|
|
4595
4493
|
"return": "Promise<T[]>"
|
|
4596
4494
|
},
|
|
4597
4495
|
"docs": {
|
|
4598
|
-
"text": "Returns all objects that match the given predicate function.\
|
|
4496
|
+
"text": "Returns all objects that match the given predicate function.\nExcludes internal selection-related objects (selection groups and selection boxes).",
|
|
4599
4497
|
"tags": [{
|
|
4600
4498
|
"name": "param",
|
|
4601
4499
|
"text": "predicate - A filter function called for each object. Return `true` to include."
|
|
@@ -4604,7 +4502,7 @@ export class KritzelEngine {
|
|
|
4604
4502
|
"text": "An array of matching objects."
|
|
4605
4503
|
}, {
|
|
4606
4504
|
"name": "example",
|
|
4607
|
-
"text": "```ts\
|
|
4505
|
+
"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
4506
|
}]
|
|
4609
4507
|
}
|
|
4610
4508
|
},
|
|
@@ -4737,7 +4635,7 @@ export class KritzelEngine {
|
|
|
4737
4635
|
"return": "Promise<T[]>"
|
|
4738
4636
|
},
|
|
4739
4637
|
"docs": {
|
|
4740
|
-
"text": "Adds multiple objects to the canvas in a single batch operation.\
|
|
4638
|
+
"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
4639
|
"tags": [{
|
|
4742
4640
|
"name": "param",
|
|
4743
4641
|
"text": "objects - The object instances to add."
|
|
@@ -4859,7 +4757,7 @@ export class KritzelEngine {
|
|
|
4859
4757
|
"return": "Promise<T[]>"
|
|
4860
4758
|
},
|
|
4861
4759
|
"docs": {
|
|
4862
|
-
"text": "Removes multiple objects from the canvas in a single batch operation.\
|
|
4760
|
+
"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
4761
|
"tags": [{
|
|
4864
4762
|
"name": "param",
|
|
4865
4763
|
"text": "objects - The objects to remove."
|
|
@@ -5047,7 +4945,7 @@ export class KritzelEngine {
|
|
|
5047
4945
|
"return": "Promise<void>"
|
|
5048
4946
|
},
|
|
5049
4947
|
"docs": {
|
|
5050
|
-
"text": "Pans the viewport to center on the given object without changing the zoom level.\
|
|
4948
|
+
"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
4949
|
"tags": [{
|
|
5052
4950
|
"name": "param",
|
|
5053
4951
|
"text": "object - The object whose center the viewport should pan to."
|
|
@@ -5067,7 +4965,7 @@ export class KritzelEngine {
|
|
|
5067
4965
|
"return": "Promise<boolean>"
|
|
5068
4966
|
},
|
|
5069
4967
|
"docs": {
|
|
5070
|
-
"text": "Pans and zooms the viewport to fit the nearest content, with padding.\
|
|
4968
|
+
"text": "Pans and zooms the viewport to fit the nearest content, with padding.\nUseful when the user has panned away from all objects.",
|
|
5071
4969
|
"tags": [{
|
|
5072
4970
|
"name": "returns",
|
|
5073
4971
|
"text": "`true` if content was found and the viewport was adjusted, `false` otherwise."
|
|
@@ -5091,7 +4989,7 @@ export class KritzelEngine {
|
|
|
5091
4989
|
"return": "Promise<boolean>"
|
|
5092
4990
|
},
|
|
5093
4991
|
"docs": {
|
|
5094
|
-
"text": "Pans and zooms the viewport to fit ALL objects on the canvas, including those not currently rendered.\
|
|
4992
|
+
"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
4993
|
"tags": [{
|
|
5096
4994
|
"name": "param",
|
|
5097
4995
|
"text": "animate - Whether to animate the viewport transition (default: true)."
|
|
@@ -5128,7 +5026,7 @@ export class KritzelEngine {
|
|
|
5128
5026
|
"return": "Promise<boolean>"
|
|
5129
5027
|
},
|
|
5130
5028
|
"docs": {
|
|
5131
|
-
"text": "Pans and zooms the viewport to fit the provided objects.\
|
|
5029
|
+
"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
5030
|
"tags": [{
|
|
5133
5031
|
"name": "param",
|
|
5134
5032
|
"text": "objects - The objects to center and fit in the viewport."
|
|
@@ -5235,7 +5133,7 @@ export class KritzelEngine {
|
|
|
5235
5133
|
"return": "Promise<void>"
|
|
5236
5134
|
},
|
|
5237
5135
|
"docs": {
|
|
5238
|
-
"text": "Zooms the viewport to the given scale level.\
|
|
5136
|
+
"text": "Zooms the viewport to the given scale level.\nOptionally centers on a world point; if omitted, zooms around the viewport center.",
|
|
5239
5137
|
"tags": [{
|
|
5240
5138
|
"name": "param",
|
|
5241
5139
|
"text": "scale - Target scale level."
|
|
@@ -5553,7 +5451,7 @@ export class KritzelEngine {
|
|
|
5553
5451
|
"return": "Promise<KritzelObjectExportFormat[]>"
|
|
5554
5452
|
},
|
|
5555
5453
|
"docs": {
|
|
5556
|
-
"text": "Returns export formats supported by the currently selected object.\
|
|
5454
|
+
"text": "Returns export formats supported by the currently selected object.\nOnly returns formats when exactly one object is selected.",
|
|
5557
5455
|
"tags": []
|
|
5558
5456
|
}
|
|
5559
5457
|
},
|
|
@@ -5580,7 +5478,7 @@ export class KritzelEngine {
|
|
|
5580
5478
|
"return": "Promise<boolean>"
|
|
5581
5479
|
},
|
|
5582
5480
|
"docs": {
|
|
5583
|
-
"text": "Checks whether the currently selected object supports a specific export format.\
|
|
5481
|
+
"text": "Checks whether the currently selected object supports a specific export format.\nReturns false when none or multiple objects are selected.",
|
|
5584
5482
|
"tags": []
|
|
5585
5483
|
}
|
|
5586
5484
|
},
|
|
@@ -5607,7 +5505,7 @@ export class KritzelEngine {
|
|
|
5607
5505
|
"return": "Promise<void>"
|
|
5608
5506
|
},
|
|
5609
5507
|
"docs": {
|
|
5610
|
-
"text": "Exports the currently selected object in the requested format and triggers a file download.\
|
|
5508
|
+
"text": "Exports the currently selected object in the requested format and triggers a file download.\nOnly supports single selection.",
|
|
5611
5509
|
"tags": []
|
|
5612
5510
|
}
|
|
5613
5511
|
},
|
|
@@ -5628,7 +5526,7 @@ export class KritzelEngine {
|
|
|
5628
5526
|
"return": "Promise<string>"
|
|
5629
5527
|
},
|
|
5630
5528
|
"docs": {
|
|
5631
|
-
"text": "Exports the current workspace and all its objects as a JSON string.\
|
|
5529
|
+
"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
5530
|
"tags": [{
|
|
5633
5531
|
"name": "returns",
|
|
5634
5532
|
"text": "A JSON string representing the complete workspace state."
|
|
@@ -5662,7 +5560,7 @@ export class KritzelEngine {
|
|
|
5662
5560
|
"return": "Promise<void>"
|
|
5663
5561
|
},
|
|
5664
5562
|
"docs": {
|
|
5665
|
-
"text": "Imports a workspace from a JSON string into a new workspace.\
|
|
5563
|
+
"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
5564
|
"tags": [{
|
|
5667
5565
|
"name": "param",
|
|
5668
5566
|
"text": "json - A JSON string containing workspace data (from exportAsJson)."
|
|
@@ -5699,7 +5597,7 @@ export class KritzelEngine {
|
|
|
5699
5597
|
"return": "Promise<number>"
|
|
5700
5598
|
},
|
|
5701
5599
|
"docs": {
|
|
5702
|
-
"text": "Loads objects from a workspace JSON string into the current workspace.\
|
|
5600
|
+
"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
5601
|
"tags": [{
|
|
5704
5602
|
"name": "param",
|
|
5705
5603
|
"text": "json - A JSON string containing workspace data (from exportAsJson)."
|
|
@@ -5759,7 +5657,7 @@ export class KritzelEngine {
|
|
|
5759
5657
|
"return": "Promise<void>"
|
|
5760
5658
|
},
|
|
5761
5659
|
"docs": {
|
|
5762
|
-
"text": "Opens a file picker dialog and imports the selected JSON file into the workspace.\
|
|
5660
|
+
"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
5661
|
"tags": [{
|
|
5764
5662
|
"name": "returns",
|
|
5765
5663
|
"text": "A promise that resolves when the import is complete or rejects on error/cancel."
|
|
@@ -5942,7 +5840,7 @@ export class KritzelEngine {
|
|
|
5942
5840
|
"return": "Promise<void>"
|
|
5943
5841
|
},
|
|
5944
5842
|
"docs": {
|
|
5945
|
-
"text": "Loads a shared workspace by token.\
|
|
5843
|
+
"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
5844
|
"tags": [{
|
|
5947
5845
|
"name": "param",
|
|
5948
5846
|
"text": "token - The connection token identifying the shared workspace"
|
|
@@ -5962,7 +5860,7 @@ export class KritzelEngine {
|
|
|
5962
5860
|
"return": "Promise<void>"
|
|
5963
5861
|
},
|
|
5964
5862
|
"docs": {
|
|
5965
|
-
"text": "Reinitializes sync by performing a full teardown and re-initialization.\
|
|
5863
|
+
"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
5864
|
"tags": []
|
|
5967
5865
|
}
|
|
5968
5866
|
},
|
|
@@ -6225,7 +6123,7 @@ export class KritzelEngine {
|
|
|
6225
6123
|
"return": "Promise<Partial<Record<keyof KritzelTerms, string>>>"
|
|
6226
6124
|
},
|
|
6227
6125
|
"docs": {
|
|
6228
|
-
"text": "Resolves every known term key for the active locale into a flat map.\
|
|
6126
|
+
"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
6127
|
"tags": []
|
|
6230
6128
|
}
|
|
6231
6129
|
}
|
|
@@ -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: '
|
|
22
|
+
return (h(Host, { key: '297a488f26fd8637da8d00b98af85cfeda5b0992' }, h("a", { key: '6e3be65773dfda06e9b7ae611cfbb5ff09ba1f91', 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\
|
|
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: '
|
|
84
|
+
return (h(Host, { key: 'f199b56955b749b868ad8e7940ef3114f1109c37', 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: '
|
|
88
|
+
}, role: "img", "aria-label": this.getDisplayName() || 'User avatar' }, showImage && (h("img", { key: '621a58cc965cf6d037f8515e1263bd5bf4098ab0', 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: '
|
|
93
|
+
}, onError: this.handleImageError })), showInitials && (h("span", { key: '28ff2e8b191c2d476c0f40dd57a2c8ec330ba104', class: "avatar-initials", style: { backgroundColor: this.getBackgroundColor() } }, initials)), showDefaultIcon && (h("span", { key: 'd2ef56b2fca2a609b5b99bb8d7e8747308ab9699', class: "avatar-default" }, h("svg", { key: '1c1d6e6e306a9938f559016eeb77a67aae42f536', viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: '2c6af53101c20e137756d1194a3bac04c931066d', 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
|
}
|