kritzel-stencil 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +9 -1
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +1396 -1243
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-C8hqt--r.js → schema.constants-ByNZ_qAj.js} +136 -7
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/handlers/line-handle.handler.js +1 -1
- package/dist/collection/classes/managers/license.manager.js +56 -0
- package/dist/collection/classes/objects/image.class.js +9 -0
- package/dist/collection/classes/objects/line.class.js +1 -1
- package/dist/collection/classes/objects/path.class.js +9 -0
- package/dist/collection/classes/objects/shape.class.js +12 -3
- package/dist/collection/classes/objects/text.class.js +1 -1
- package/dist/collection/classes/providers/sync/broadcast-sync-provider.class.js +1 -0
- package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +2 -0
- package/dist/collection/classes/providers/sync/in-memory-sync-provider.class.js +1 -0
- package/dist/collection/classes/providers/sync/indexeddb-sync-provider.class.js +1 -0
- package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +2 -0
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +197 -67
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +146 -172
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- 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.js +1 -1
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +90 -4
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/constants/license.constants.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/object.helper.js +11 -0
- package/dist/collection/helpers/svg-export.helper.js +19 -9
- package/dist/collection/helpers/theme.helper.js +8 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/object-export.interface.js +1 -0
- package/dist/collection/interfaces/sync-config.interface.js +21 -1
- package/dist/collection/themes/dark-theme.js +2 -0
- package/dist/collection/themes/light-theme.js +2 -0
- package/dist/components/index.js +11 -4
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-editor.js +180 -83
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.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-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-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-share-dialog.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-utility-panel.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-DwY5pghH.js → p-6rQICkGr.js} +1 -1
- package/dist/components/{p-DkH3hoLz.js → p-8ScektIm.js} +6 -6
- package/dist/components/{p-1nG2hxfJ.js → p-9m1cAVwG.js} +2 -2
- package/dist/components/{p-DkY7pIg5.js → p-BRGufCki.js} +95 -6
- package/dist/components/{p-BKOsmXB5.js → p-BqWiEmYI.js} +1 -1
- package/dist/components/{p-BLOPBDUF.js → p-C2CeSrTm.js} +1 -1
- package/dist/components/{p-zd7zXld8.js → p-CMZ09rB1.js} +1 -1
- package/dist/components/{p-BmyTdQGy.js → p-CURiiQfq.js} +12 -0
- package/dist/components/{p-DDbO5q-e.js → p-CXJZxJvp.js} +4 -4
- package/dist/components/{p-7Rt7ml3v.js → p-Cj0NElII.js} +1 -1
- package/dist/components/{p-Bm_BWQa4.js → p-Ckm1Aq0V.js} +1 -1
- package/dist/components/{p-BVEGQLBD.js → p-CoY7emAj.js} +1 -1
- package/dist/components/{p-BZxOukfY.js → p-Cr2z2UBL.js} +4 -4
- package/dist/components/{p-D0oplzU-.js → p-D7H8oxZb.js} +2 -2
- package/dist/components/{p-Dd-pMvlr.js → p-DPONTran.js} +11 -0
- package/dist/components/{p-BMRln59F.js → p-DW7WW4EN.js} +2 -2
- package/dist/components/{p-D8TOEhPY.js → p-DuVkk58V.js} +2 -2
- package/dist/components/{p-OLfoATNk.js → p-U9FjWrp-.js} +1 -1
- package/dist/components/{p-C2yi85nc.js → p-ZPPtEla5.js} +1213 -1131
- package/dist/components/{p-COjsYPir.js → p-dVfh-Sy9.js} +1 -1
- package/dist/components/{p-Ka7OWbnk.js → p-lQ7nfhOy.js} +12 -3
- package/dist/esm/index.js +9 -2
- package/dist/esm/kritzel-active-users_47.entry.js +1396 -1243
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{schema.constants-uC7_X6yr.js → schema.constants-1t45c2_U.js} +136 -8
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +9 -2
- package/dist/stencil/{p-uC7_X6yr.js → p-1t45c2_U.js} +136 -8
- package/dist/stencil/{p-472f2e90.entry.js → p-f5f088ea.entry.js} +1396 -1243
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/managers/license.manager.d.ts +6 -0
- package/dist/types/classes/objects/image.class.d.ts +3 -0
- package/dist/types/classes/objects/path.class.d.ts +3 -0
- package/dist/types/classes/objects/shape.class.d.ts +3 -0
- package/dist/types/classes/providers/sync/broadcast-sync-provider.class.d.ts +1 -0
- package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +1 -0
- package/dist/types/classes/providers/sync/in-memory-sync-provider.class.d.ts +1 -0
- package/dist/types/classes/providers/sync/indexeddb-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 +15 -3
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +16 -34
- package/dist/types/components/ui/kritzel-more-menu/kritzel-more-menu.d.ts +10 -1
- package/dist/types/components.d.ts +27 -26
- package/dist/types/constants/license.constants.d.ts +1 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/helpers/object.helper.d.ts +4 -0
- package/dist/types/helpers/theme.helper.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/menu-item.interface.d.ts +1 -1
- package/dist/types/interfaces/object-export.interface.d.ts +20 -0
- package/dist/types/interfaces/sync-config.interface.d.ts +5 -0
- package/dist/types/interfaces/sync-provider.interface.d.ts +5 -0
- package/dist/types/interfaces/theme.interface.d.ts +2 -0
- package/package.json +1 -1
|
@@ -17,6 +17,17 @@ class ObjectHelper {
|
|
|
17
17
|
static isClass(object, className) {
|
|
18
18
|
return !!object && object.__class__ === className;
|
|
19
19
|
}
|
|
20
|
+
static isKritzelExportable(object) {
|
|
21
|
+
if (!object || typeof object !== 'object') {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const candidate = object;
|
|
25
|
+
if (typeof candidate.getSupportedExportFormats !== 'function' || typeof candidate.exportAs !== 'function') {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const formats = candidate.getSupportedExportFormats();
|
|
29
|
+
return Array.isArray(formats) && formats.length > 0;
|
|
30
|
+
}
|
|
20
31
|
}
|
|
21
32
|
|
|
22
33
|
class KritzelGeometryHelper {
|
|
@@ -14557,7 +14568,9 @@ const lightTheme = {
|
|
|
14557
14568
|
},
|
|
14558
14569
|
snap: {
|
|
14559
14570
|
indicatorFill: 'rgba(59, 130, 246, 0.3)',
|
|
14571
|
+
indicatorFillInactive: 'rgba(59, 130, 246, 0.18)',
|
|
14560
14572
|
indicatorStroke: '#007bff',
|
|
14573
|
+
indicatorStrokeInactive: 'rgba(59, 130, 246, 0.5)',
|
|
14561
14574
|
lineStroke: 'rgba(0, 0, 0, 0.2)',
|
|
14562
14575
|
},
|
|
14563
14576
|
fontSize: {
|
|
@@ -14894,7 +14907,9 @@ const darkTheme = {
|
|
|
14894
14907
|
},
|
|
14895
14908
|
snap: {
|
|
14896
14909
|
indicatorFill: 'rgba(10, 132, 255, 0.35)',
|
|
14910
|
+
indicatorFillInactive: 'rgba(10, 132, 255, 0.2)',
|
|
14897
14911
|
indicatorStroke: '#0A84FF',
|
|
14912
|
+
indicatorStrokeInactive: 'rgba(255, 255, 255, 0.45)',
|
|
14898
14913
|
lineStroke: 'rgba(255, 255, 255, 0.35)',
|
|
14899
14914
|
},
|
|
14900
14915
|
fontSize: {
|
|
@@ -15094,6 +15109,7 @@ const darkTheme = {
|
|
|
15094
15109
|
};
|
|
15095
15110
|
|
|
15096
15111
|
class ThemeHelper {
|
|
15112
|
+
static appliedVariableNames = new WeakMap();
|
|
15097
15113
|
/**
|
|
15098
15114
|
* Converts a camelCase string to kebab-case.
|
|
15099
15115
|
* @example ThemeHelper.camelToKebab('controlHoverBackgroundColor') → 'control-hover-background-color'
|
|
@@ -15159,7 +15175,14 @@ class ThemeHelper {
|
|
|
15159
15175
|
*/
|
|
15160
15176
|
static applyThemeToElement(element, theme) {
|
|
15161
15177
|
const variables = ThemeHelper.flattenThemeToVariables(theme);
|
|
15178
|
+
const previousVariableNames = ThemeHelper.appliedVariableNames.get(element);
|
|
15179
|
+
for (const name of previousVariableNames ?? []) {
|
|
15180
|
+
if (!variables.has(name)) {
|
|
15181
|
+
element.style.removeProperty(name);
|
|
15182
|
+
}
|
|
15183
|
+
}
|
|
15162
15184
|
ThemeHelper.applyVariablesToElement(element, variables);
|
|
15185
|
+
ThemeHelper.appliedVariableNames.set(element, new Set(variables.keys()));
|
|
15163
15186
|
}
|
|
15164
15187
|
}
|
|
15165
15188
|
|
|
@@ -15780,7 +15803,7 @@ class KritzelText extends KritzelBaseObject {
|
|
|
15780
15803
|
}
|
|
15781
15804
|
element.style.fontFamily = KritzelFontRegistry.resolveCssFontFamily(this.fontFamily);
|
|
15782
15805
|
element.style.fontSize = `${this.fontSize}pt`;
|
|
15783
|
-
element.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor);
|
|
15806
|
+
element.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor, this._core?.themeManager?.currentTheme);
|
|
15784
15807
|
if (this.isMounted && this.elementRef === element && this.editor.dom.parentElement === element) {
|
|
15785
15808
|
if (!this._core.store.state.isScaling && !this._core.store.state.isPanning) {
|
|
15786
15809
|
requestAnimationFrame(() => this.adjustSizeOnInput());
|
|
@@ -16671,6 +16694,15 @@ class KritzelPath extends KritzelBaseObject {
|
|
|
16671
16694
|
}
|
|
16672
16695
|
return null;
|
|
16673
16696
|
}
|
|
16697
|
+
getSupportedExportFormats() {
|
|
16698
|
+
return ['svg'];
|
|
16699
|
+
}
|
|
16700
|
+
async exportAs(format, context) {
|
|
16701
|
+
if (format !== 'svg') {
|
|
16702
|
+
return null;
|
|
16703
|
+
}
|
|
16704
|
+
return context.getObjectAsSvgDataUrl(this);
|
|
16705
|
+
}
|
|
16674
16706
|
}
|
|
16675
16707
|
|
|
16676
16708
|
/** Default database name used by IndexedDBAssetProvider. */
|
|
@@ -17938,6 +17970,15 @@ class KritzelImage extends KritzelBaseObject {
|
|
|
17938
17970
|
}
|
|
17939
17971
|
return { scaledWidth, scaledHeight };
|
|
17940
17972
|
}
|
|
17973
|
+
getSupportedExportFormats() {
|
|
17974
|
+
return ['png'];
|
|
17975
|
+
}
|
|
17976
|
+
async exportAs(format, context) {
|
|
17977
|
+
if (format !== 'png') {
|
|
17978
|
+
return null;
|
|
17979
|
+
}
|
|
17980
|
+
return context.getObjectAsPngDataUrl(this);
|
|
17981
|
+
}
|
|
17941
17982
|
}
|
|
17942
17983
|
|
|
17943
17984
|
class KritzelLine extends KritzelBaseObject {
|
|
@@ -18687,7 +18728,7 @@ class KritzelLine extends KritzelBaseObject {
|
|
|
18687
18728
|
getArrowFill(end) {
|
|
18688
18729
|
const config = end === 'start' ? this.arrows?.start : this.arrows?.end;
|
|
18689
18730
|
const color = config?.fill ?? this.stroke;
|
|
18690
|
-
return KritzelColorHelper.resolveThemeColor(color);
|
|
18731
|
+
return KritzelColorHelper.resolveThemeColor(color, this._core?.themeManager?.currentTheme);
|
|
18691
18732
|
}
|
|
18692
18733
|
/**
|
|
18693
18734
|
* Generates SVG path data for an arrow head based on the given style.
|
|
@@ -19490,7 +19531,7 @@ class KritzelShape extends KritzelBaseObject {
|
|
|
19490
19531
|
}
|
|
19491
19532
|
element.style.fontFamily = this.fontFamily;
|
|
19492
19533
|
element.style.fontSize = `${this.fontSize}pt`;
|
|
19493
|
-
element.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor);
|
|
19534
|
+
element.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor, this._core?.themeManager?.currentTheme);
|
|
19494
19535
|
element.style.whiteSpace = 'pre-wrap';
|
|
19495
19536
|
element.style.wordWrap = 'break-word';
|
|
19496
19537
|
if (this.editor.dom.parentElement === element) {
|
|
@@ -19806,13 +19847,13 @@ class KritzelShape extends KritzelBaseObject {
|
|
|
19806
19847
|
this.fontColor = KritzelColorHelper.determineTextColor(this.fillColor);
|
|
19807
19848
|
// Update the editor's text color immediately
|
|
19808
19849
|
if (this.editor?.dom?.parentElement) {
|
|
19809
|
-
this.editor.dom.parentElement.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor);
|
|
19850
|
+
this.editor.dom.parentElement.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor, this._core?.themeManager?.currentTheme);
|
|
19810
19851
|
}
|
|
19811
19852
|
}
|
|
19812
19853
|
else if (changedProperties.includes('fontColor')) {
|
|
19813
19854
|
// Also update editor when fontColor changes directly
|
|
19814
19855
|
if (this.editor?.dom?.parentElement) {
|
|
19815
|
-
this.editor.dom.parentElement.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor);
|
|
19856
|
+
this.editor.dom.parentElement.style.color = KritzelColorHelper.resolveThemeColor(this.fontColor, this._core?.themeManager?.currentTheme);
|
|
19816
19857
|
}
|
|
19817
19858
|
}
|
|
19818
19859
|
}
|
|
@@ -19931,6 +19972,15 @@ class KritzelShape extends KritzelBaseObject {
|
|
|
19931
19972
|
return `M ${this.x} ${this.y} L ${this.x + w} ${this.y} L ${this.x + w} ${this.y + h} L ${this.x} ${this.y + h} Z`;
|
|
19932
19973
|
}
|
|
19933
19974
|
}
|
|
19975
|
+
getSupportedExportFormats() {
|
|
19976
|
+
return ['svg'];
|
|
19977
|
+
}
|
|
19978
|
+
async exportAs(format, context) {
|
|
19979
|
+
if (format !== 'svg') {
|
|
19980
|
+
return null;
|
|
19981
|
+
}
|
|
19982
|
+
return context.getObjectAsSvgDataUrl(this);
|
|
19983
|
+
}
|
|
19934
19984
|
}
|
|
19935
19985
|
|
|
19936
19986
|
const KRITZEL_RENDERER_REGISTRY_KEY = '__kritzelCustomElementRendererRegistry__';
|
|
@@ -24676,7 +24726,7 @@ class KritzelLineHandleHandler extends KritzelBaseHandler {
|
|
|
24676
24726
|
t: clipInfo?.t,
|
|
24677
24727
|
edgeX: clipInfo?.edgeX,
|
|
24678
24728
|
edgeY: clipInfo?.edgeY,
|
|
24679
|
-
lineStroke: KritzelColorHelper.resolveThemeColor(line.stroke),
|
|
24729
|
+
lineStroke: KritzelColorHelper.resolveThemeColor(line.stroke, this._core.themeManager.currentTheme),
|
|
24680
24730
|
lineStrokeWidth: line.strokeWidth / line.scale,
|
|
24681
24731
|
arrowOffset: endpoint === 'start'
|
|
24682
24732
|
? (line.hasStartArrow ? line.getArrowSize('start') / line.scale : undefined)
|
|
@@ -30255,7 +30305,7 @@ const KRITZEL_LICENSE_TOKEN_PREFIX = 'KRTZL1.';
|
|
|
30255
30305
|
* printed public key here. Replacing this value invalidates every license
|
|
30256
30306
|
* signed with the previous key.
|
|
30257
30307
|
*/
|
|
30258
|
-
const KRITZEL_LICENSE_PUBLIC_KEY = '
|
|
30308
|
+
const KRITZEL_LICENSE_PUBLIC_KEY = '2IwZDin-qV3kOt8SEQCqdaJsGT9S7tAGapUYJVnVGQo';
|
|
30259
30309
|
|
|
30260
30310
|
/** Minimum delay (ms) between periodic license re-validations. */
|
|
30261
30311
|
const MIN_REVALIDATION_DELAY_MS = 30_000;
|
|
@@ -30488,8 +30538,64 @@ class KritzelLicenseManager {
|
|
|
30488
30538
|
if (typeof claims.exp === 'number' && claims.exp * 1000 <= Date.now()) {
|
|
30489
30539
|
return { status: 'rejected' }; // Cleanly expired.
|
|
30490
30540
|
}
|
|
30541
|
+
const allowedDomains = this.normalizeAllowedDomains(claims.allowedDomains);
|
|
30542
|
+
if (allowedDomains === null || allowedDomains.length === 0) {
|
|
30543
|
+
return { status: 'rejected' };
|
|
30544
|
+
}
|
|
30545
|
+
const currentHostname = this.getCurrentHostname();
|
|
30546
|
+
if (!currentHostname || !allowedDomains.includes(currentHostname)) {
|
|
30547
|
+
return { status: 'rejected' };
|
|
30548
|
+
}
|
|
30491
30549
|
return { status: 'pass', payloadSegment, signatureSegment, claims };
|
|
30492
30550
|
}
|
|
30551
|
+
/** Returns the normalized current hostname, or null when unavailable/invalid. */
|
|
30552
|
+
getCurrentHostname() {
|
|
30553
|
+
const hostname = globalThis.location?.hostname;
|
|
30554
|
+
if (typeof hostname !== 'string') {
|
|
30555
|
+
return null;
|
|
30556
|
+
}
|
|
30557
|
+
return this.normalizeDomain(hostname);
|
|
30558
|
+
}
|
|
30559
|
+
/** Normalizes and validates the allowed domains claim. */
|
|
30560
|
+
normalizeAllowedDomains(domains) {
|
|
30561
|
+
if (!Array.isArray(domains)) {
|
|
30562
|
+
return null;
|
|
30563
|
+
}
|
|
30564
|
+
const normalized = new Set();
|
|
30565
|
+
for (const entry of domains) {
|
|
30566
|
+
if (typeof entry !== 'string') {
|
|
30567
|
+
return null;
|
|
30568
|
+
}
|
|
30569
|
+
const domain = this.normalizeDomain(entry);
|
|
30570
|
+
if (!domain) {
|
|
30571
|
+
return null;
|
|
30572
|
+
}
|
|
30573
|
+
normalized.add(domain);
|
|
30574
|
+
}
|
|
30575
|
+
return Array.from(normalized);
|
|
30576
|
+
}
|
|
30577
|
+
/** Normalizes a domain and rejects malformed hostnames. */
|
|
30578
|
+
normalizeDomain(value) {
|
|
30579
|
+
const trimmed = value.trim().toLowerCase();
|
|
30580
|
+
if (trimmed.length === 0) {
|
|
30581
|
+
return null;
|
|
30582
|
+
}
|
|
30583
|
+
const withoutTrailingDot = trimmed.endsWith('.') ? trimmed.slice(0, -1) : trimmed;
|
|
30584
|
+
if (withoutTrailingDot.length === 0) {
|
|
30585
|
+
return null;
|
|
30586
|
+
}
|
|
30587
|
+
try {
|
|
30588
|
+
const parsed = new URL(`https://${withoutTrailingDot}`);
|
|
30589
|
+
const normalizedHostname = parsed.hostname.toLowerCase();
|
|
30590
|
+
if (normalizedHostname !== withoutTrailingDot) {
|
|
30591
|
+
return null;
|
|
30592
|
+
}
|
|
30593
|
+
return normalizedHostname;
|
|
30594
|
+
}
|
|
30595
|
+
catch {
|
|
30596
|
+
return null;
|
|
30597
|
+
}
|
|
30598
|
+
}
|
|
30493
30599
|
/**
|
|
30494
30600
|
* Verifies the Ed25519 signature of the token against the embedded public
|
|
30495
30601
|
* key. Resolves true/false for a definitive valid/invalid signature.
|
|
@@ -30542,6 +30648,28 @@ class KritzelLicenseManager {
|
|
|
30542
30648
|
}
|
|
30543
30649
|
}
|
|
30544
30650
|
|
|
30651
|
+
/**
|
|
30652
|
+
* Returns the provider type (`'local'` or `'network'`) for a given provider config entry.
|
|
30653
|
+
* Works for both class constructors (via a static `type` property) and
|
|
30654
|
+
* factory objects (via an optional `type` property on the factory).
|
|
30655
|
+
*/
|
|
30656
|
+
function getProviderConfigType(config) {
|
|
30657
|
+
if (typeof config === 'function') {
|
|
30658
|
+
return config.type;
|
|
30659
|
+
}
|
|
30660
|
+
return config.type;
|
|
30661
|
+
}
|
|
30662
|
+
/**
|
|
30663
|
+
* Returns `true` when the given sync configuration contains at least one remote
|
|
30664
|
+
* (network) provider, meaning the share option should be available in the UI.
|
|
30665
|
+
*/
|
|
30666
|
+
function hasRemoteSyncProvider(syncConfig) {
|
|
30667
|
+
if (!syncConfig?.providers?.length) {
|
|
30668
|
+
return false;
|
|
30669
|
+
}
|
|
30670
|
+
return syncConfig.providers.some(p => getProviderConfigType(p) === 'network');
|
|
30671
|
+
}
|
|
30672
|
+
|
|
30545
30673
|
const DEFAULT_BRUSH_CONFIG = {
|
|
30546
30674
|
type: 'pen',
|
|
30547
30675
|
color: DEFAULT_COLOR_PALETTE[0],
|
|
@@ -30734,4 +30862,4 @@ const CURRENT_APP_STATE_SCHEMA_VERSION = 2;
|
|
|
30734
30862
|
/** Current schema version for workspace Y.Docs (drawable objects). */
|
|
30735
30863
|
const CURRENT_WORKSPACE_SCHEMA_VERSION = 2;
|
|
30736
30864
|
|
|
30737
|
-
export {
|
|
30865
|
+
export { ObjectHelper as $, AssetNotFoundError as A, DEFAULT_TEXT_CONFIG as B, DEFAULT_LINE_TOOL_CONFIG as C, DEFAULT_BRUSH_CONFIG as D, DEFAULT_ASSET_STORAGE_CONFIG as E, lightTheme as F, darkTheme as G, HocuspocusProvider as H, IndexedDBAssetProvider as I, EN_LOCALE as J, KritzelBaseObject as K, DE_LOCALE as L, FR_LOCALE as M, KritzelAlignment as N, runMigrations as O, APP_STATE_MIGRATIONS as P, WORKSPACE_MIGRATIONS as Q, CURRENT_APP_STATE_SCHEMA_VERSION as R, ShapeType as S, CURRENT_WORKSPACE_SCHEMA_VERSION as T, KritzelColorHelper as U, KritzelDevicesHelper as V, WORKSPACE_EXPORT_VERSION as W, KritzelMouseButton as X, KritzelHTMLHelper as Y, DEFAULT_STROKE_SIZES as Z, DEFAULT_COLOR_PALETTE as _, HocuspocusProviderWebsocket as a, resolveTextToolAvailableFonts as a0, ThemeHelper as a1, KritzelSelectionGroup as a2, KritzelSelectionBox as a3, KritzelIconRegistry as a4, KritzelKeyboardHelper as a5, KritzelBaseHandler as a6, KritzelClassHelper as a7, KritzelImageFileHelper as a8, imageCompression as a9, KritzelEventHelper as aa, KritzelText as b, KritzelPath as c, KritzelImage as d, KritzelLine as e, KritzelGroup as f, KritzelShape as g, KritzelCustomElement as h, KritzelBaseTool as i, KritzelBrushTool as j, KritzelLineTool as k, KritzelEraserTool as l, KritzelImageTool as m, KritzelTextTool as n, KritzelShapeTool as o, KritzelCursorHelper as p, KritzelSelectionTool as q, KritzelAssetResolver as r, KritzelWorkspace as s, KritzelAnchorManager as t, KritzelThemeManager as u, KritzelLocalizationManager as v, KritzelLicenseManager as w, KritzelCustomElementRendererRegistry as x, KritzelFontRegistry as y, hasRemoteSyncProvider as z };
|