@fluid-app/rep-core 0.1.0 → 0.1.2
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/chunk-2IFFXFJL.js +621 -0
- package/dist/chunk-2IFFXFJL.js.map +1 -0
- package/dist/chunk-2SIG55BD.cjs +131 -0
- package/dist/chunk-2SIG55BD.cjs.map +1 -0
- package/dist/chunk-2SPTFZRC.js +72 -0
- package/dist/chunk-2SPTFZRC.js.map +1 -0
- package/dist/chunk-3I5Y3PEO.js +23 -0
- package/dist/chunk-3I5Y3PEO.js.map +1 -0
- package/dist/chunk-46PUWB7C.cjs +69 -0
- package/dist/chunk-46PUWB7C.cjs.map +1 -0
- package/dist/chunk-4WFDFEHC.js +134 -0
- package/dist/chunk-4WFDFEHC.js.map +1 -0
- package/dist/chunk-5NYM4UTW.cjs +58 -0
- package/dist/chunk-5NYM4UTW.cjs.map +1 -0
- package/dist/chunk-BWHUEED3.cjs +32 -0
- package/dist/chunk-BWHUEED3.cjs.map +1 -0
- package/dist/chunk-CMXYKDHC.cjs +666 -0
- package/dist/chunk-CMXYKDHC.cjs.map +1 -0
- package/dist/chunk-ESYAYVNK.cjs +136 -0
- package/dist/chunk-ESYAYVNK.cjs.map +1 -0
- package/dist/{chunk-6QLUUNJL.cjs → chunk-GDY76JA6.cjs} +2 -2
- package/dist/chunk-GDY76JA6.cjs.map +1 -0
- package/dist/chunk-HGVSPZEL.cjs +119 -0
- package/dist/chunk-HGVSPZEL.cjs.map +1 -0
- package/dist/chunk-HIDJYVKJ.js +54 -0
- package/dist/chunk-HIDJYVKJ.js.map +1 -0
- package/dist/chunk-HUR3MSO4.js +25 -0
- package/dist/chunk-HUR3MSO4.js.map +1 -0
- package/dist/chunk-LVLNO2YQ.cjs +28 -0
- package/dist/chunk-LVLNO2YQ.cjs.map +1 -0
- package/dist/chunk-N2K6W7FX.cjs +169 -0
- package/dist/chunk-N2K6W7FX.cjs.map +1 -0
- package/dist/chunk-NAMNXRI5.js +129 -0
- package/dist/chunk-NAMNXRI5.js.map +1 -0
- package/dist/chunk-OWU7MFJ2.cjs +15 -0
- package/dist/chunk-OWU7MFJ2.cjs.map +1 -0
- package/dist/chunk-PVTQWD4I.js +166 -0
- package/dist/chunk-PVTQWD4I.js.map +1 -0
- package/dist/chunk-PZ6BM57A.js +30 -0
- package/dist/chunk-PZ6BM57A.js.map +1 -0
- package/dist/chunk-SJQPHJL4.cjs +26 -0
- package/dist/chunk-SJQPHJL4.cjs.map +1 -0
- package/dist/chunk-V7D3QUE6.cjs +42 -0
- package/dist/chunk-V7D3QUE6.cjs.map +1 -0
- package/dist/chunk-VRF7QEID.js +67 -0
- package/dist/chunk-VRF7QEID.js.map +1 -0
- package/dist/chunk-WASVMCZB.js +13 -0
- package/dist/chunk-WASVMCZB.js.map +1 -0
- package/dist/chunk-WYOHFNNW.js +117 -0
- package/dist/chunk-WYOHFNNW.js.map +1 -0
- package/dist/chunk-XCNBVV4T.js +38 -0
- package/dist/chunk-XCNBVV4T.js.map +1 -0
- package/dist/{chunk-EWR5EIBP.js → chunk-YKF5ZFF5.js} +2 -2
- package/dist/chunk-YKF5ZFF5.js.map +1 -0
- package/dist/chunk-YXJMBVXO.cjs +76 -0
- package/dist/chunk-YXJMBVXO.cjs.map +1 -0
- package/dist/data-sources/DataAwareWidget.cjs +59 -0
- package/dist/data-sources/DataAwareWidget.cjs.map +1 -0
- package/dist/data-sources/DataAwareWidget.d.cts +30 -0
- package/dist/data-sources/DataAwareWidget.d.ts +30 -0
- package/dist/data-sources/DataAwareWidget.js +57 -0
- package/dist/data-sources/DataAwareWidget.js.map +1 -0
- package/dist/data-sources/ErrorState.cjs +12 -0
- package/dist/data-sources/ErrorState.cjs.map +1 -0
- package/dist/data-sources/ErrorState.d.cts +5 -0
- package/dist/data-sources/ErrorState.d.ts +5 -0
- package/dist/data-sources/ErrorState.js +3 -0
- package/dist/data-sources/ErrorState.js.map +1 -0
- package/dist/data-sources/context.cjs +10 -20
- package/dist/data-sources/context.cjs.map +1 -1
- package/dist/data-sources/context.d.cts +2 -2
- package/dist/data-sources/context.d.ts +2 -2
- package/dist/data-sources/context.js +1 -21
- package/dist/data-sources/context.js.map +1 -1
- package/dist/data-sources/fetchers/api.cjs +12 -0
- package/dist/data-sources/fetchers/api.cjs.map +1 -0
- package/dist/data-sources/fetchers/api.d.cts +8 -0
- package/dist/data-sources/fetchers/api.d.ts +8 -0
- package/dist/data-sources/fetchers/api.js +3 -0
- package/dist/data-sources/fetchers/api.js.map +1 -0
- package/dist/data-sources/fetchers/custom.cjs +12 -0
- package/dist/data-sources/fetchers/custom.cjs.map +1 -0
- package/dist/data-sources/fetchers/custom.d.cts +15 -0
- package/dist/data-sources/fetchers/custom.d.ts +15 -0
- package/dist/data-sources/fetchers/custom.js +3 -0
- package/dist/data-sources/fetchers/custom.js.map +1 -0
- package/dist/data-sources/fetchers/static.cjs +16 -0
- package/dist/data-sources/fetchers/static.cjs.map +1 -0
- package/dist/data-sources/fetchers/static.d.cts +38 -0
- package/dist/data-sources/fetchers/static.d.ts +38 -0
- package/dist/data-sources/fetchers/static.js +3 -0
- package/dist/data-sources/fetchers/static.js.map +1 -0
- package/dist/data-sources/registry-context.cjs +26 -0
- package/dist/data-sources/registry-context.cjs.map +1 -0
- package/dist/data-sources/registry-context.d.cts +41 -0
- package/dist/data-sources/registry-context.d.ts +41 -0
- package/dist/data-sources/registry-context.js +9 -0
- package/dist/data-sources/registry-context.js.map +1 -0
- package/dist/data-sources/registry.cjs +20 -0
- package/dist/data-sources/registry.cjs.map +1 -0
- package/dist/data-sources/registry.d.cts +17 -0
- package/dist/data-sources/registry.d.ts +17 -0
- package/dist/data-sources/registry.js +7 -0
- package/dist/data-sources/registry.js.map +1 -0
- package/dist/data-sources/transformers.cjs +12 -0
- package/dist/data-sources/transformers.cjs.map +1 -0
- package/dist/data-sources/transformers.d.cts +23 -0
- package/dist/data-sources/transformers.d.ts +23 -0
- package/dist/data-sources/transformers.js +3 -0
- package/dist/data-sources/transformers.js.map +1 -0
- package/dist/data-sources/types.d.cts +37 -2
- package/dist/data-sources/types.d.ts +37 -2
- package/dist/data-sources/use-widget-data.cjs +19 -0
- package/dist/data-sources/use-widget-data.cjs.map +1 -0
- package/dist/data-sources/use-widget-data.d.cts +16 -0
- package/dist/data-sources/use-widget-data.d.ts +16 -0
- package/dist/data-sources/use-widget-data.js +10 -0
- package/dist/data-sources/use-widget-data.js.map +1 -0
- package/dist/registries/index.cjs +8 -15
- package/dist/registries/index.cjs.map +1 -1
- package/dist/registries/index.d.cts +20 -7
- package/dist/registries/index.d.ts +20 -7
- package/dist/registries/index.js +8 -15
- package/dist/registries/index.js.map +1 -1
- package/dist/shareable-item-DkgWpwoU.d.cts +21 -0
- package/dist/shareable-item-DkgWpwoU.d.ts +21 -0
- package/dist/shell/AppShellLayout.cjs +14 -0
- package/dist/shell/AppShellLayout.cjs.map +1 -0
- package/dist/shell/AppShellLayout.d.cts +30 -0
- package/dist/shell/AppShellLayout.d.ts +30 -0
- package/dist/shell/AppShellLayout.js +5 -0
- package/dist/shell/AppShellLayout.js.map +1 -0
- package/dist/shell/ThemeModeContext.cjs +20 -0
- package/dist/shell/ThemeModeContext.cjs.map +1 -0
- package/dist/shell/ThemeModeContext.d.cts +27 -0
- package/dist/shell/ThemeModeContext.d.ts +27 -0
- package/dist/shell/ThemeModeContext.js +3 -0
- package/dist/shell/ThemeModeContext.js.map +1 -0
- package/dist/shell/index.cjs +135 -0
- package/dist/shell/index.cjs.map +1 -0
- package/dist/shell/index.d.cts +8 -0
- package/dist/shell/index.d.ts +8 -0
- package/dist/shell/index.js +6 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/sidebar.cjs +105 -0
- package/dist/shell/sidebar.cjs.map +1 -0
- package/dist/shell/sidebar.d.cts +73 -0
- package/dist/shell/sidebar.d.ts +73 -0
- package/dist/shell/sidebar.js +4 -0
- package/dist/shell/sidebar.js.map +1 -0
- package/dist/shell/use-mobile.cjs +20 -0
- package/dist/shell/use-mobile.cjs.map +1 -0
- package/dist/shell/use-mobile.d.cts +5 -0
- package/dist/shell/use-mobile.d.ts +5 -0
- package/dist/shell/use-mobile.js +3 -0
- package/dist/shell/use-mobile.js.map +1 -0
- package/dist/theme/index.cjs +599 -970
- package/dist/theme/index.cjs.map +1 -1
- package/dist/theme/index.d.cts +106 -2655
- package/dist/theme/index.d.ts +106 -2655
- package/dist/theme/index.js +570 -917
- package/dist/theme/index.js.map +1 -1
- package/dist/types/index.cjs +17 -17
- package/dist/types/index.d.cts +28 -4
- package/dist/types/index.d.ts +28 -4
- package/dist/types/index.js +1 -1
- package/dist/types-R1kV_DKF.d.cts +80 -0
- package/dist/types-R1kV_DKF.d.ts +80 -0
- package/dist/{shareable-item-DPmNZkE1.d.cts → widget-schema-36uGUTWL.d.cts} +5 -21
- package/dist/{shareable-item-DPmNZkE1.d.ts → widget-schema-DxdlJD8E.d.ts} +5 -21
- package/dist/widget-utils/index.cjs +3 -3
- package/dist/widget-utils/index.d.cts +3 -1
- package/dist/widget-utils/index.d.ts +3 -1
- package/dist/widget-utils/index.js +1 -1
- package/package.json +84 -13
- package/dist/chunk-6QLUUNJL.cjs.map +0 -1
- package/dist/chunk-EWR5EIBP.js.map +0 -1
- package/dist/theme-DrMUYZTO.d.cts +0 -22
- package/dist/theme-DrMUYZTO.d.ts +0 -22
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Color from 'colorjs.io';
|
|
2
|
+
|
|
3
|
+
declare const SEMANTIC_COLOR_NAMES: readonly ["background", "foreground", "primary", "secondary", "accent", "muted", "destructive"];
|
|
4
|
+
type SemanticColorName = (typeof SEMANTIC_COLOR_NAMES)[number];
|
|
5
|
+
declare const SHADE_STEPS: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
6
|
+
type ShadeStep = (typeof SHADE_STEPS)[number];
|
|
7
|
+
declare const FONT_SIZE_KEYS: readonly ["extraSmall", "small", "regular", "large", "extraLarge", "giant"];
|
|
8
|
+
type FontSizeKey = (typeof FONT_SIZE_KEYS)[number];
|
|
9
|
+
declare const FONT_FAMILY_KEYS: readonly ["header", "body"];
|
|
10
|
+
type FontFamilyKey = (typeof FONT_FAMILY_KEYS)[number];
|
|
11
|
+
declare const RADIUS_KEYS: readonly ["small", "medium", "large", "extraLarge"];
|
|
12
|
+
type RadiusKey = (typeof RADIUS_KEYS)[number];
|
|
13
|
+
/** Author-time color input (what the user configures) */
|
|
14
|
+
interface ThemeColorInput {
|
|
15
|
+
base: Color;
|
|
16
|
+
foreground: Color;
|
|
17
|
+
}
|
|
18
|
+
/** Complete theme definition — stored in-memory with Color objects */
|
|
19
|
+
interface ThemeDefinition {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
/** Light mode — always fully specified */
|
|
23
|
+
light: Record<SemanticColorName, ThemeColorInput>;
|
|
24
|
+
/**
|
|
25
|
+
* Dark mode — only user-overridden colors.
|
|
26
|
+
* Missing keys are auto-derived from `light` at resolve time.
|
|
27
|
+
*/
|
|
28
|
+
dark: Partial<Record<SemanticColorName, Partial<ThemeColorInput>>>;
|
|
29
|
+
fontSizes: Record<FontSizeKey, string>;
|
|
30
|
+
fontFamilies: Record<FontFamilyKey, string>;
|
|
31
|
+
spacing: string;
|
|
32
|
+
radii: Record<RadiusKey, string>;
|
|
33
|
+
}
|
|
34
|
+
/** Resolved semantic color with generated shade ramp */
|
|
35
|
+
interface ResolvedSemanticColor {
|
|
36
|
+
base: Color;
|
|
37
|
+
foreground: Color;
|
|
38
|
+
shades: Record<ShadeStep, Color>;
|
|
39
|
+
}
|
|
40
|
+
/** Complete resolved color set for one mode */
|
|
41
|
+
type ResolvedColorSet = Record<SemanticColorName, ResolvedSemanticColor>;
|
|
42
|
+
/** Fully resolved theme — all colors materialised for both modes */
|
|
43
|
+
interface ResolvedTheme {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
light: ResolvedColorSet;
|
|
47
|
+
dark: ResolvedColorSet;
|
|
48
|
+
fontSizes: ThemeDefinition["fontSizes"];
|
|
49
|
+
fontFamilies: ThemeDefinition["fontFamilies"];
|
|
50
|
+
spacing: string;
|
|
51
|
+
radii: ThemeDefinition["radii"];
|
|
52
|
+
}
|
|
53
|
+
/** Plain OKLCH triplet for JSON serialisation (no Color dependency) */
|
|
54
|
+
interface OklchPlain {
|
|
55
|
+
l: number;
|
|
56
|
+
c: number;
|
|
57
|
+
h: number;
|
|
58
|
+
}
|
|
59
|
+
/** Serialised color pair as stored in the backend payload */
|
|
60
|
+
interface ThemeColorPlain {
|
|
61
|
+
base: OklchPlain;
|
|
62
|
+
foreground: OklchPlain;
|
|
63
|
+
}
|
|
64
|
+
/** Backend payload — plain JSON, no Color objects */
|
|
65
|
+
interface ThemePayload {
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
light: Record<SemanticColorName, ThemeColorPlain>;
|
|
70
|
+
dark: Partial<Record<SemanticColorName, {
|
|
71
|
+
base?: OklchPlain;
|
|
72
|
+
foreground?: OklchPlain;
|
|
73
|
+
}>>;
|
|
74
|
+
fontSizes: Record<FontSizeKey, string>;
|
|
75
|
+
fontFamilies: Record<FontFamilyKey, string>;
|
|
76
|
+
spacing: string;
|
|
77
|
+
radii: Record<RadiusKey, string>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { type FontSizeKey as F, type OklchPlain as O, type ResolvedTheme as R, type ShadeStep as S, type ThemeDefinition as T, type ThemeColorInput as a, type ThemePayload as b, type SemanticColorName as c, type FontFamilyKey as d, type RadiusKey as e, type ThemeColorPlain as f, type ResolvedSemanticColor as g, type ResolvedColorSet as h, SEMANTIC_COLOR_NAMES as i, SHADE_STEPS as j, FONT_SIZE_KEYS as k, FONT_FAMILY_KEYS as l, RADIUS_KEYS as m };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
+
import { DataSourceConfig } from './data-sources/types.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Widget type names as a const object.
|
|
@@ -45,6 +46,8 @@ type WidgetSchema = {
|
|
|
45
46
|
readonly type: WidgetType;
|
|
46
47
|
readonly props: Readonly<Record<string, unknown>>;
|
|
47
48
|
readonly id?: string;
|
|
49
|
+
/** Optional data source configuration for data-bound widgets */
|
|
50
|
+
readonly dataSource?: DataSourceConfig | undefined;
|
|
48
51
|
/** Column index for masonry layouts (0-indexed) */
|
|
49
52
|
readonly columnIndex?: number;
|
|
50
53
|
};
|
|
@@ -59,6 +62,7 @@ type TypedWidgetSchema<T extends Record<string, ComponentType<any>>> = {
|
|
|
59
62
|
readonly type: K;
|
|
60
63
|
readonly props: Readonly<React.ComponentProps<T[K]>>;
|
|
61
64
|
readonly id?: string;
|
|
65
|
+
readonly dataSource?: DataSourceConfig | undefined;
|
|
62
66
|
/** Column index for masonry layouts (0-indexed) */
|
|
63
67
|
readonly columnIndex?: number;
|
|
64
68
|
};
|
|
@@ -115,24 +119,4 @@ declare function assertNever(value: never, context?: string): never;
|
|
|
115
119
|
*/
|
|
116
120
|
declare function assertDefined<T>(value: T | undefined | null, name?: string): asserts value is T;
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
* Base props for a shareable item.
|
|
120
|
-
* Uses structural typing to be compatible with various modal implementations.
|
|
121
|
-
* The index signature allows additional properties from consuming apps.
|
|
122
|
-
*/
|
|
123
|
-
interface ShareableItem {
|
|
124
|
-
id: string | number;
|
|
125
|
-
title?: string | null;
|
|
126
|
-
image_url?: string | null;
|
|
127
|
-
imageUrl?: string | null;
|
|
128
|
-
kind?: string | null;
|
|
129
|
-
type?: string | null;
|
|
130
|
-
shareableType?: string | null;
|
|
131
|
-
share_link?: string | null;
|
|
132
|
-
videoUrl?: string;
|
|
133
|
-
price?: string | number | null;
|
|
134
|
-
display_price?: string | null;
|
|
135
|
-
[key: string]: unknown;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export { type ShareableItem as S, type TypedWidgetSchema as T, type WidgetPath as W, type WidgetSchema as a, type WidgetType as b, type WidgetTypeName as c, type WidgetRegistry as d, WIDGET_TYPE_NAMES as e, isWidgetType as f, assertNever as g, assertDefined as h, isWidgetTypeName as i };
|
|
122
|
+
export { type TypedWidgetSchema as T, type WidgetSchema as W, type WidgetPath as a, type WidgetType as b, type WidgetTypeName as c, type WidgetRegistry as d, WIDGET_TYPE_NAMES as e, isWidgetType as f, assertNever as g, assertDefined as h, isWidgetTypeName as i };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
+
import { DataSourceConfig } from './data-sources/types.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Widget type names as a const object.
|
|
@@ -45,6 +46,8 @@ type WidgetSchema = {
|
|
|
45
46
|
readonly type: WidgetType;
|
|
46
47
|
readonly props: Readonly<Record<string, unknown>>;
|
|
47
48
|
readonly id?: string;
|
|
49
|
+
/** Optional data source configuration for data-bound widgets */
|
|
50
|
+
readonly dataSource?: DataSourceConfig | undefined;
|
|
48
51
|
/** Column index for masonry layouts (0-indexed) */
|
|
49
52
|
readonly columnIndex?: number;
|
|
50
53
|
};
|
|
@@ -59,6 +62,7 @@ type TypedWidgetSchema<T extends Record<string, ComponentType<any>>> = {
|
|
|
59
62
|
readonly type: K;
|
|
60
63
|
readonly props: Readonly<React.ComponentProps<T[K]>>;
|
|
61
64
|
readonly id?: string;
|
|
65
|
+
readonly dataSource?: DataSourceConfig | undefined;
|
|
62
66
|
/** Column index for masonry layouts (0-indexed) */
|
|
63
67
|
readonly columnIndex?: number;
|
|
64
68
|
};
|
|
@@ -115,24 +119,4 @@ declare function assertNever(value: never, context?: string): never;
|
|
|
115
119
|
*/
|
|
116
120
|
declare function assertDefined<T>(value: T | undefined | null, name?: string): asserts value is T;
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
* Base props for a shareable item.
|
|
120
|
-
* Uses structural typing to be compatible with various modal implementations.
|
|
121
|
-
* The index signature allows additional properties from consuming apps.
|
|
122
|
-
*/
|
|
123
|
-
interface ShareableItem {
|
|
124
|
-
id: string | number;
|
|
125
|
-
title?: string | null;
|
|
126
|
-
image_url?: string | null;
|
|
127
|
-
imageUrl?: string | null;
|
|
128
|
-
kind?: string | null;
|
|
129
|
-
type?: string | null;
|
|
130
|
-
shareableType?: string | null;
|
|
131
|
-
share_link?: string | null;
|
|
132
|
-
videoUrl?: string;
|
|
133
|
-
price?: string | number | null;
|
|
134
|
-
display_price?: string | null;
|
|
135
|
-
[key: string]: unknown;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export { type ShareableItem as S, type TypedWidgetSchema as T, type WidgetPath as W, type WidgetSchema as a, type WidgetType as b, type WidgetTypeName as c, type WidgetRegistry as d, WIDGET_TYPE_NAMES as e, isWidgetType as f, assertNever as g, assertDefined as h, isWidgetTypeName as i };
|
|
122
|
+
export { type TypedWidgetSchema as T, type WidgetSchema as W, type WidgetPath as a, type WidgetType as b, type WidgetTypeName as c, type WidgetRegistry as d, WIDGET_TYPE_NAMES as e, isWidgetType as f, assertNever as g, assertDefined as h, isWidgetTypeName as i };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGDY76JA6_cjs = require('../chunk-GDY76JA6.cjs');
|
|
4
4
|
|
|
5
5
|
// src/widget-utils/widget-utils.ts
|
|
6
6
|
function generateWidgetId(type) {
|
|
@@ -23,7 +23,7 @@ function ensureWidgetIds(widgets) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function deepCloneWidget(widget) {
|
|
26
|
-
if (
|
|
26
|
+
if (chunkGDY76JA6_cjs.isWidgetType(widget, chunkGDY76JA6_cjs.WIDGET_TYPE_NAMES.Layout) && Array.isArray(widget.props.children)) {
|
|
27
27
|
return {
|
|
28
28
|
type: widget.type,
|
|
29
29
|
props: {
|
|
@@ -46,7 +46,7 @@ function getWidgetByPath(screen, path) {
|
|
|
46
46
|
if (path.length === 0 || path[0] === void 0) return null;
|
|
47
47
|
let current = screen[path[0]] ?? null;
|
|
48
48
|
for (let i = 1; i < path.length; i++) {
|
|
49
|
-
if (!
|
|
49
|
+
if (!chunkGDY76JA6_cjs.isWidgetType(current, chunkGDY76JA6_cjs.WIDGET_TYPE_NAMES.Layout)) return null;
|
|
50
50
|
const children = current.props.children ?? [];
|
|
51
51
|
const index = path[i];
|
|
52
52
|
if (index === void 0) return null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as WidgetPath, W as WidgetSchema, T as TypedWidgetSchema } from '../widget-schema-36uGUTWL.cjs';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
|
+
import { S as ShareableItem } from '../shareable-item-DkgWpwoU.cjs';
|
|
4
|
+
import '../data-sources/types.cjs';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Generates a unique ID for a widget
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as WidgetPath, W as WidgetSchema, T as TypedWidgetSchema } from '../widget-schema-DxdlJD8E.js';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
|
+
import { S as ShareableItem } from '../shareable-item-DkgWpwoU.js';
|
|
4
|
+
import '../data-sources/types.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Generates a unique ID for a widget
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-app/rep-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Core types, theme engine, and widget utilities for the Fluid rep platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,16 +14,6 @@
|
|
|
14
14
|
"default": "./dist/types/index.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"./theme": {
|
|
18
|
-
"import": {
|
|
19
|
-
"types": "./dist/theme/index.d.ts",
|
|
20
|
-
"default": "./dist/theme/index.js"
|
|
21
|
-
},
|
|
22
|
-
"require": {
|
|
23
|
-
"types": "./dist/theme/index.d.cts",
|
|
24
|
-
"default": "./dist/theme/index.cjs"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
17
|
"./widget-utils": {
|
|
28
18
|
"import": {
|
|
29
19
|
"types": "./dist/widget-utils/index.d.ts",
|
|
@@ -63,21 +53,95 @@
|
|
|
63
53
|
"types": "./dist/registries/index.d.cts",
|
|
64
54
|
"default": "./dist/registries/index.cjs"
|
|
65
55
|
}
|
|
56
|
+
},
|
|
57
|
+
"./theme": {
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./dist/theme/index.d.ts",
|
|
60
|
+
"default": "./dist/theme/index.js"
|
|
61
|
+
},
|
|
62
|
+
"require": {
|
|
63
|
+
"types": "./dist/theme/index.d.cts",
|
|
64
|
+
"default": "./dist/theme/index.cjs"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"./shell": {
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./dist/shell/index.d.ts",
|
|
70
|
+
"default": "./dist/shell/index.js"
|
|
71
|
+
},
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/shell/index.d.cts",
|
|
74
|
+
"default": "./dist/shell/index.cjs"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"./shell/sidebar": {
|
|
78
|
+
"import": {
|
|
79
|
+
"types": "./dist/shell/sidebar.d.ts",
|
|
80
|
+
"default": "./dist/shell/sidebar.js"
|
|
81
|
+
},
|
|
82
|
+
"require": {
|
|
83
|
+
"types": "./dist/shell/sidebar.d.cts",
|
|
84
|
+
"default": "./dist/shell/sidebar.cjs"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"./shell/ThemeModeContext": {
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./dist/shell/ThemeModeContext.d.ts",
|
|
90
|
+
"default": "./dist/shell/ThemeModeContext.js"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./dist/shell/ThemeModeContext.d.cts",
|
|
94
|
+
"default": "./dist/shell/ThemeModeContext.cjs"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"./shell/use-mobile": {
|
|
98
|
+
"import": {
|
|
99
|
+
"types": "./dist/shell/use-mobile.d.ts",
|
|
100
|
+
"default": "./dist/shell/use-mobile.js"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./dist/shell/use-mobile.d.cts",
|
|
104
|
+
"default": "./dist/shell/use-mobile.cjs"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"./shell/AppShellLayout": {
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/shell/AppShellLayout.d.ts",
|
|
110
|
+
"default": "./dist/shell/AppShellLayout.js"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"types": "./dist/shell/AppShellLayout.d.cts",
|
|
114
|
+
"default": "./dist/shell/AppShellLayout.cjs"
|
|
115
|
+
}
|
|
66
116
|
}
|
|
67
117
|
},
|
|
118
|
+
"publishConfig": {
|
|
119
|
+
"access": "public"
|
|
120
|
+
},
|
|
68
121
|
"files": [
|
|
69
122
|
"dist"
|
|
70
123
|
],
|
|
71
124
|
"sideEffects": false,
|
|
72
125
|
"peerDependencies": {
|
|
73
|
-
"
|
|
126
|
+
"@fortawesome/fontawesome-svg-core": ">=6.0.0",
|
|
127
|
+
"@fortawesome/react-fontawesome": ">=0.2.0",
|
|
128
|
+
"@fortawesome/pro-regular-svg-icons": ">=6.0.0",
|
|
129
|
+
"react": ">=18.0.0",
|
|
130
|
+
"@tanstack/react-query": ">=5.0.0"
|
|
74
131
|
},
|
|
75
132
|
"peerDependenciesMeta": {
|
|
76
133
|
"react": {
|
|
77
134
|
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"@tanstack/react-query": {
|
|
137
|
+
"optional": true
|
|
78
138
|
}
|
|
79
139
|
},
|
|
80
140
|
"devDependencies": {
|
|
141
|
+
"@tanstack/react-query": "^5.90.11",
|
|
142
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
143
|
+
"@fortawesome/pro-regular-svg-icons": "^6.7.2",
|
|
144
|
+
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
81
145
|
"@types/react": "^19.2.13",
|
|
82
146
|
"eslint": "^9.39.1",
|
|
83
147
|
"react": "^19.2.4",
|
|
@@ -86,10 +150,17 @@
|
|
|
86
150
|
"@fluid-app/eslint-config": "0.0.0",
|
|
87
151
|
"@fluid-app/typescript-config": "0.0.0"
|
|
88
152
|
},
|
|
153
|
+
"dependencies": {
|
|
154
|
+
"@radix-ui/react-slot": "^1.1.2",
|
|
155
|
+
"class-variance-authority": "^0.7.1",
|
|
156
|
+
"clsx": "^2.1.1",
|
|
157
|
+
"colorjs.io": "^0.5.2",
|
|
158
|
+
"tailwind-merge": "^3.0.2"
|
|
159
|
+
},
|
|
89
160
|
"scripts": {
|
|
90
161
|
"build": "tsup",
|
|
91
162
|
"dev": "tsup --watch",
|
|
92
|
-
"lint": "eslint .",
|
|
163
|
+
"lint": "eslint . --cache --cache-strategy content",
|
|
93
164
|
"lint:fix": "eslint . --fix",
|
|
94
165
|
"typecheck": "tsc --noEmit"
|
|
95
166
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/widget-schema.ts","../src/types/field-types.ts"],"names":[],"mappings":";;;AAOO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,KAAA,EAAO,aAAA;AAAA,EACP,QAAA,EAAU,gBAAA;AAAA,EACV,QAAA,EAAU,gBAAA;AAAA,EACV,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO,aAAA;AAAA,EACP,SAAA,EAAW,iBAAA;AAAA,EACX,KAAA,EAAO,aAAA;AAAA,EACP,KAAA,EAAO,aAAA;AAAA,EACP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AAE,OAAA,EAAS,CAAA,EAAG,QAAQ,CAAC,KAAK,CAAA,EAAG,WAAA,EAAa,EAAA,EAAG;AAAA,EAChE,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAAA,IAC5B,WAAA,EAAa;AAAA,GACf;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAAA,IAC5B,WAAA,EAAa;AAAA;AAEjB;AAgBO,IAAM,mBAAA,GAAsB","file":"chunk-6QLUUNJL.cjs","sourcesContent":["import type { ComponentType } from \"react\";\n\n/**\n * Widget type names as a const object.\n * This serves as the single source of truth for widget discriminants.\n * Use `as const` for literal type inference (safety-as-const-deep-readonly rule).\n */\nexport const WIDGET_TYPE_NAMES = {\n Alert: \"AlertWidget\",\n Calendar: \"CalendarWidget\",\n Carousel: \"CarouselWidget\",\n CatchUp: \"CatchUpWidget\",\n Chart: \"ChartWidget\",\n Container: \"ContainerWidget\",\n Embed: \"EmbedWidget\",\n Image: \"ImageWidget\",\n Layout: \"LayoutWidget\",\n List: \"ListWidget\",\n MySite: \"MySiteWidget\",\n Nested: \"NestedWidget\",\n QuickShare: \"QuickShareWidget\",\n RecentActivity: \"RecentActivityWidget\",\n Spacer: \"SpacerWidget\",\n Table: \"TableWidget\",\n Text: \"TextWidget\",\n ToDo: \"ToDoWidget\",\n Video: \"VideoWidget\",\n} as const;\n\n/**\n * Union of all known widget type names.\n * Derived from WIDGET_TYPE_NAMES to avoid duplication (deriving-typeof-for-object-keys rule).\n */\nexport type WidgetTypeName =\n (typeof WIDGET_TYPE_NAMES)[keyof typeof WIDGET_TYPE_NAMES];\n\n/**\n * Legacy alias for backwards compatibility.\n * Prefer using WidgetTypeName for new code when you need the union type.\n */\nexport type WidgetType = string;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type WidgetRegistry = Record<WidgetType, ComponentType<any>>;\n\n/**\n * Base widget schema with loose typing for runtime data.\n * Use TypedWidgetSchema<T> when you have a known registry for better type safety.\n */\nexport type WidgetSchema = {\n readonly type: WidgetType;\n readonly props: Readonly<Record<string, unknown>>;\n readonly id?: string; // Optional unique identifier for drag-and-drop\n /** Column index for masonry layouts (0-indexed) */\n readonly columnIndex?: number;\n};\n\n/**\n * Type-safe widget schema based on registry.\n * Uses discriminated unions - the `type` field serves as discriminant.\n * When narrowed (e.g., `if (widget.type === \"AlertWidget\")`),\n * TypeScript automatically knows the correct props type.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TypedWidgetSchema<T extends Record<string, ComponentType<any>>> = {\n [K in keyof T]: {\n readonly type: K;\n readonly props: Readonly<React.ComponentProps<T[K]>>;\n readonly id?: string;\n /** Column index for masonry layouts (0-indexed) */\n readonly columnIndex?: number;\n };\n}[keyof T];\n\n/**\n * Widget path in the tree - array of indices.\n * Readonly tuple to prevent accidental mutation.\n */\nexport type WidgetPath = readonly number[];\n\n// ============================================================================\n// Type Guards and Assertion Functions\n// ============================================================================\n\n/**\n * Type predicate to check if a string is a known widget type name.\n * Use for runtime validation of widget types.\n *\n * @example\n * if (isWidgetTypeName(widget.type)) {\n * // TypeScript knows widget.type is WidgetTypeName\n * }\n */\nexport function isWidgetTypeName(type: string): type is WidgetTypeName {\n // Type assertion required in type guard: Object.values() returns string[], but we\n // need to check against WidgetTypeName values. The assertion is safe because we're\n // checking membership, and the return type predicate ensures correct narrowing.\n return Object.values(WIDGET_TYPE_NAMES).includes(type as WidgetTypeName);\n}\n\n/**\n * Type predicate to check if a widget has a specific type.\n * Enables type-safe widget narrowing without `as` assertions.\n *\n * @example\n * if (isWidgetType(widget, \"LayoutWidget\")) {\n * // TypeScript knows widget.type === \"LayoutWidget\"\n * // and widget.props is LayoutWidget props\n * }\n */\nexport function isWidgetType<T extends WidgetTypeName>(\n widget: WidgetSchema | null | undefined,\n typeName: T,\n): widget is WidgetSchema & { readonly type: T } {\n return widget != null && widget.type === typeName;\n}\n\n/**\n * Helper for exhaustive switch statements on widget types.\n * Use in the default case to ensure all widget types are handled.\n *\n * @example\n * switch (widget.type) {\n * case \"AlertWidget\": return handleAlert();\n * case \"TextWidget\": return handleText();\n * // ... all other widget types\n * default: return assertNever(widget.type, \"widget type\");\n * }\n */\nexport function assertNever(value: never, context?: string): never {\n const message = context\n ? `Unexpected ${context}: ${String(value)}`\n : `Unexpected value: ${String(value)}`;\n throw new Error(message);\n}\n\n/**\n * Assertion function that throws if value is undefined.\n * Narrows the type to exclude undefined.\n *\n * @example\n * const widget = screen[0];\n * assertDefined(widget, \"widget at index 0\");\n * // TypeScript knows widget is defined here\n */\nexport function assertDefined<T>(\n value: T | undefined | null,\n name?: string,\n): asserts value is T {\n if (value == null) {\n throw new Error(name ? `${name} is required` : \"Value is required\");\n }\n}\n","import type { ShareableItem } from \"./shareable-item\";\n\n// ============================================================================\n// Color Options - Derive type from constant for single source of truth\n// ============================================================================\n\n/**\n * Color options constant - single source of truth for color values.\n * Use COLOR_OPTIONS.primary instead of \"primary\" for type-safe comparisons.\n */\nexport const COLOR_OPTIONS = {\n background: \"background\",\n foreground: \"foreground\",\n primary: \"primary\",\n secondary: \"secondary\",\n accent: \"accent\",\n muted: \"muted\",\n destructive: \"destructive\",\n} as const;\n\n/**\n * Union type of all color options, derived from COLOR_OPTIONS constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];\n\n// ============================================================================\n// Size Options - Derive types from constants for single source of truth\n// ============================================================================\n\nexport const FONT_SIZE_OPTIONS = {\n \"2xl\": \"2xl\",\n xl: \"xl\",\n lg: \"lg\",\n md: \"md\",\n sm: \"sm\",\n xs: \"xs\",\n} as const;\n\nexport type FontSizeOptions =\n (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];\n\nexport const BORDER_RADIUS_OPTIONS = {\n none: \"none\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n full: \"full\",\n} as const;\n\nexport type BorderRadiusOptions =\n (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];\n\n/** Padding values - numeric, so we use a tuple for derivation */\nexport const PADDING_VALUES = [0, 2, 4, 6, 8, 10] as const;\nexport type PaddingOptions = (typeof PADDING_VALUES)[number];\n\nexport const BUTTON_SIZE_OPTIONS = {\n sm: \"sm\",\n default: \"default\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type ButtonSizeOptions =\n (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];\n\nexport const GAP_OPTIONS = {\n none: \"none\",\n xs: \"xs\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];\n\n// ============================================================================\n// Alignment Options - Derive from constants\n// ============================================================================\n\nexport const VERTICAL_ALIGN_OPTIONS = {\n top: \"top\",\n center: \"center\",\n bottom: \"bottom\",\n} as const;\n\nexport type VerticalAlign =\n (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];\n\nexport const HORIZONTAL_ALIGN_OPTIONS = {\n left: \"left\",\n center: \"center\",\n right: \"right\",\n} as const;\n\nexport type HorizontalAlign =\n (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];\n\nexport type AlignOptions = {\n vertical?: VerticalAlign;\n horizontal?: HorizontalAlign;\n};\n\n// ============================================================================\n// Background Options - Derive from constant\n// ============================================================================\n\nexport const BACKGROUND_TYPES = {\n solid: \"solid\",\n image: \"image\",\n} as const;\n\nexport type BackgroundType =\n (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];\nexport interface BackgroundValue {\n type: BackgroundType;\n color?: ColorOptions;\n resource?: ShareableItem;\n}\n\n// ============================================================================\n// Section Layout - Derive type from config keys (single source of truth)\n// ============================================================================\n\n/**\n * Section layout configuration - single source of truth for layout types.\n * SectionLayoutType is derived from these keys to prevent drift.\n */\nexport const SECTION_LAYOUT_CONFIG = {\n \"single-column\": { columns: 1, widths: [\"1fr\"], gridClasses: \"\" },\n \"2c-equal\": {\n columns: 2,\n widths: [\"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-2\",\n },\n \"2c-left-wider\": {\n columns: 2,\n widths: [\"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[2fr_1fr]\",\n },\n \"2c-right-wider\": {\n columns: 2,\n widths: [\"1fr\", \"2fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr]\",\n },\n \"2c-left-narrow\": {\n columns: 2,\n widths: [\"1fr\", \"3fr\"],\n gridClasses: \"@md:grid-cols-[1fr_3fr]\",\n },\n \"2c-right-narrow\": {\n columns: 2,\n widths: [\"3fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[3fr_1fr]\",\n },\n \"3c-equal\": {\n columns: 3,\n widths: [\"1fr\", \"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-3\",\n },\n \"3c-middle-wider\": {\n columns: 3,\n widths: [\"1fr\", \"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\",\n },\n} as const satisfies Record<\n string,\n {\n readonly columns: number;\n readonly widths: readonly string[];\n readonly gridClasses: string;\n }\n>;\n\n/**\n * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;\n\n/** @deprecated Use SECTION_LAYOUT_CONFIG instead */\nexport const sectionLayoutConfig = SECTION_LAYOUT_CONFIG;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/widget-schema.ts","../src/types/field-types.ts"],"names":[],"mappings":";AAOO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,KAAA,EAAO,aAAA;AAAA,EACP,QAAA,EAAU,gBAAA;AAAA,EACV,QAAA,EAAU,gBAAA;AAAA,EACV,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO,aAAA;AAAA,EACP,SAAA,EAAW,iBAAA;AAAA,EACX,KAAA,EAAO,aAAA;AAAA,EACP,KAAA,EAAO,aAAA;AAAA,EACP,MAAA,EAAQ,cAAA;AAAA,EACR,IAAA,EAAM,YAAA;AAAA,EACN,MAAA,EAAQ,cAAA;AAAA,EACR,MAAA,EAAQ,cAAA;AAAA,EACR,UAAA,EAAY,kBAAA;AAAA,EACZ,cAAA,EAAgB,sBAAA;AAAA,EAChB,MAAA,EA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AAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,IACrB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAAA,IAC5B,WAAA,EAAa;AAAA,GACf;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,OAAA,EAAS,CAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAAA,IAC5B,WAAA,EAAa;AAAA;AAEjB;AAgBO,IAAM,mBAAA,GAAsB","file":"chunk-EWR5EIBP.js","sourcesContent":["import type { ComponentType } from \"react\";\n\n/**\n * Widget type names as a const object.\n * This serves as the single source of truth for widget discriminants.\n * Use `as const` for literal type inference (safety-as-const-deep-readonly rule).\n */\nexport const WIDGET_TYPE_NAMES = {\n Alert: \"AlertWidget\",\n Calendar: \"CalendarWidget\",\n Carousel: \"CarouselWidget\",\n CatchUp: \"CatchUpWidget\",\n Chart: \"ChartWidget\",\n Container: \"ContainerWidget\",\n Embed: \"EmbedWidget\",\n Image: \"ImageWidget\",\n Layout: \"LayoutWidget\",\n List: \"ListWidget\",\n MySite: \"MySiteWidget\",\n Nested: \"NestedWidget\",\n QuickShare: \"QuickShareWidget\",\n RecentActivity: \"RecentActivityWidget\",\n Spacer: \"SpacerWidget\",\n Table: \"TableWidget\",\n Text: \"TextWidget\",\n ToDo: \"ToDoWidget\",\n Video: \"VideoWidget\",\n} as const;\n\n/**\n * Union of all known widget type names.\n * Derived from WIDGET_TYPE_NAMES to avoid duplication (deriving-typeof-for-object-keys rule).\n */\nexport type WidgetTypeName =\n (typeof WIDGET_TYPE_NAMES)[keyof typeof WIDGET_TYPE_NAMES];\n\n/**\n * Legacy alias for backwards compatibility.\n * Prefer using WidgetTypeName for new code when you need the union type.\n */\nexport type WidgetType = string;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type WidgetRegistry = Record<WidgetType, ComponentType<any>>;\n\n/**\n * Base widget schema with loose typing for runtime data.\n * Use TypedWidgetSchema<T> when you have a known registry for better type safety.\n */\nexport type WidgetSchema = {\n readonly type: WidgetType;\n readonly props: Readonly<Record<string, unknown>>;\n readonly id?: string; // Optional unique identifier for drag-and-drop\n /** Column index for masonry layouts (0-indexed) */\n readonly columnIndex?: number;\n};\n\n/**\n * Type-safe widget schema based on registry.\n * Uses discriminated unions - the `type` field serves as discriminant.\n * When narrowed (e.g., `if (widget.type === \"AlertWidget\")`),\n * TypeScript automatically knows the correct props type.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TypedWidgetSchema<T extends Record<string, ComponentType<any>>> = {\n [K in keyof T]: {\n readonly type: K;\n readonly props: Readonly<React.ComponentProps<T[K]>>;\n readonly id?: string;\n /** Column index for masonry layouts (0-indexed) */\n readonly columnIndex?: number;\n };\n}[keyof T];\n\n/**\n * Widget path in the tree - array of indices.\n * Readonly tuple to prevent accidental mutation.\n */\nexport type WidgetPath = readonly number[];\n\n// ============================================================================\n// Type Guards and Assertion Functions\n// ============================================================================\n\n/**\n * Type predicate to check if a string is a known widget type name.\n * Use for runtime validation of widget types.\n *\n * @example\n * if (isWidgetTypeName(widget.type)) {\n * // TypeScript knows widget.type is WidgetTypeName\n * }\n */\nexport function isWidgetTypeName(type: string): type is WidgetTypeName {\n // Type assertion required in type guard: Object.values() returns string[], but we\n // need to check against WidgetTypeName values. The assertion is safe because we're\n // checking membership, and the return type predicate ensures correct narrowing.\n return Object.values(WIDGET_TYPE_NAMES).includes(type as WidgetTypeName);\n}\n\n/**\n * Type predicate to check if a widget has a specific type.\n * Enables type-safe widget narrowing without `as` assertions.\n *\n * @example\n * if (isWidgetType(widget, \"LayoutWidget\")) {\n * // TypeScript knows widget.type === \"LayoutWidget\"\n * // and widget.props is LayoutWidget props\n * }\n */\nexport function isWidgetType<T extends WidgetTypeName>(\n widget: WidgetSchema | null | undefined,\n typeName: T,\n): widget is WidgetSchema & { readonly type: T } {\n return widget != null && widget.type === typeName;\n}\n\n/**\n * Helper for exhaustive switch statements on widget types.\n * Use in the default case to ensure all widget types are handled.\n *\n * @example\n * switch (widget.type) {\n * case \"AlertWidget\": return handleAlert();\n * case \"TextWidget\": return handleText();\n * // ... all other widget types\n * default: return assertNever(widget.type, \"widget type\");\n * }\n */\nexport function assertNever(value: never, context?: string): never {\n const message = context\n ? `Unexpected ${context}: ${String(value)}`\n : `Unexpected value: ${String(value)}`;\n throw new Error(message);\n}\n\n/**\n * Assertion function that throws if value is undefined.\n * Narrows the type to exclude undefined.\n *\n * @example\n * const widget = screen[0];\n * assertDefined(widget, \"widget at index 0\");\n * // TypeScript knows widget is defined here\n */\nexport function assertDefined<T>(\n value: T | undefined | null,\n name?: string,\n): asserts value is T {\n if (value == null) {\n throw new Error(name ? `${name} is required` : \"Value is required\");\n }\n}\n","import type { ShareableItem } from \"./shareable-item\";\n\n// ============================================================================\n// Color Options - Derive type from constant for single source of truth\n// ============================================================================\n\n/**\n * Color options constant - single source of truth for color values.\n * Use COLOR_OPTIONS.primary instead of \"primary\" for type-safe comparisons.\n */\nexport const COLOR_OPTIONS = {\n background: \"background\",\n foreground: \"foreground\",\n primary: \"primary\",\n secondary: \"secondary\",\n accent: \"accent\",\n muted: \"muted\",\n destructive: \"destructive\",\n} as const;\n\n/**\n * Union type of all color options, derived from COLOR_OPTIONS constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];\n\n// ============================================================================\n// Size Options - Derive types from constants for single source of truth\n// ============================================================================\n\nexport const FONT_SIZE_OPTIONS = {\n \"2xl\": \"2xl\",\n xl: \"xl\",\n lg: \"lg\",\n md: \"md\",\n sm: \"sm\",\n xs: \"xs\",\n} as const;\n\nexport type FontSizeOptions =\n (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];\n\nexport const BORDER_RADIUS_OPTIONS = {\n none: \"none\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n full: \"full\",\n} as const;\n\nexport type BorderRadiusOptions =\n (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];\n\n/** Padding values - numeric, so we use a tuple for derivation */\nexport const PADDING_VALUES = [0, 2, 4, 6, 8, 10] as const;\nexport type PaddingOptions = (typeof PADDING_VALUES)[number];\n\nexport const BUTTON_SIZE_OPTIONS = {\n sm: \"sm\",\n default: \"default\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type ButtonSizeOptions =\n (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];\n\nexport const GAP_OPTIONS = {\n none: \"none\",\n xs: \"xs\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n xl: \"xl\",\n} as const;\n\nexport type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];\n\n// ============================================================================\n// Alignment Options - Derive from constants\n// ============================================================================\n\nexport const VERTICAL_ALIGN_OPTIONS = {\n top: \"top\",\n center: \"center\",\n bottom: \"bottom\",\n} as const;\n\nexport type VerticalAlign =\n (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];\n\nexport const HORIZONTAL_ALIGN_OPTIONS = {\n left: \"left\",\n center: \"center\",\n right: \"right\",\n} as const;\n\nexport type HorizontalAlign =\n (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];\n\nexport type AlignOptions = {\n vertical?: VerticalAlign;\n horizontal?: HorizontalAlign;\n};\n\n// ============================================================================\n// Background Options - Derive from constant\n// ============================================================================\n\nexport const BACKGROUND_TYPES = {\n solid: \"solid\",\n image: \"image\",\n} as const;\n\nexport type BackgroundType =\n (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];\nexport interface BackgroundValue {\n type: BackgroundType;\n color?: ColorOptions;\n resource?: ShareableItem;\n}\n\n// ============================================================================\n// Section Layout - Derive type from config keys (single source of truth)\n// ============================================================================\n\n/**\n * Section layout configuration - single source of truth for layout types.\n * SectionLayoutType is derived from these keys to prevent drift.\n */\nexport const SECTION_LAYOUT_CONFIG = {\n \"single-column\": { columns: 1, widths: [\"1fr\"], gridClasses: \"\" },\n \"2c-equal\": {\n columns: 2,\n widths: [\"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-2\",\n },\n \"2c-left-wider\": {\n columns: 2,\n widths: [\"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[2fr_1fr]\",\n },\n \"2c-right-wider\": {\n columns: 2,\n widths: [\"1fr\", \"2fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr]\",\n },\n \"2c-left-narrow\": {\n columns: 2,\n widths: [\"1fr\", \"3fr\"],\n gridClasses: \"@md:grid-cols-[1fr_3fr]\",\n },\n \"2c-right-narrow\": {\n columns: 2,\n widths: [\"3fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[3fr_1fr]\",\n },\n \"3c-equal\": {\n columns: 3,\n widths: [\"1fr\", \"1fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-3\",\n },\n \"3c-middle-wider\": {\n columns: 3,\n widths: [\"1fr\", \"2fr\", \"1fr\"],\n gridClasses: \"@md:grid-cols-[1fr_2fr_1fr]\",\n },\n} as const satisfies Record<\n string,\n {\n readonly columns: number;\n readonly widths: readonly string[];\n readonly gridClasses: string;\n }\n>;\n\n/**\n * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;\n\n/** @deprecated Use SECTION_LAYOUT_CONFIG instead */\nexport const sectionLayoutConfig = SECTION_LAYOUT_CONFIG;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme configuration - a flexible record where keys and values
|
|
3
|
-
* come from admin configuration (e.g., "primary-500": "#3B82F6")
|
|
4
|
-
*/
|
|
5
|
-
type ThemeConfig = Record<string, string>;
|
|
6
|
-
/**
|
|
7
|
-
* Theme definition for rep portal customization
|
|
8
|
-
*/
|
|
9
|
-
interface Theme {
|
|
10
|
-
/** Database-generated identifier */
|
|
11
|
-
readonly id?: number;
|
|
12
|
-
/** Human-readable theme name */
|
|
13
|
-
name: string;
|
|
14
|
-
/** Light or dark mode variant */
|
|
15
|
-
mode?: "light" | "dark";
|
|
16
|
-
/** CSS variable configuration */
|
|
17
|
-
config: ThemeConfig;
|
|
18
|
-
/** Whether this is the default theme */
|
|
19
|
-
default: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type { ThemeConfig as T, Theme as a };
|
package/dist/theme-DrMUYZTO.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme configuration - a flexible record where keys and values
|
|
3
|
-
* come from admin configuration (e.g., "primary-500": "#3B82F6")
|
|
4
|
-
*/
|
|
5
|
-
type ThemeConfig = Record<string, string>;
|
|
6
|
-
/**
|
|
7
|
-
* Theme definition for rep portal customization
|
|
8
|
-
*/
|
|
9
|
-
interface Theme {
|
|
10
|
-
/** Database-generated identifier */
|
|
11
|
-
readonly id?: number;
|
|
12
|
-
/** Human-readable theme name */
|
|
13
|
-
name: string;
|
|
14
|
-
/** Light or dark mode variant */
|
|
15
|
-
mode?: "light" | "dark";
|
|
16
|
-
/** CSS variable configuration */
|
|
17
|
-
config: ThemeConfig;
|
|
18
|
-
/** Whether this is the default theme */
|
|
19
|
-
default: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type { ThemeConfig as T, Theme as a };
|