@bitbitpress/client 1.1.0 → 1.1.1
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/README.md +71 -0
- package/dist/generated/openapi.d.ts +487 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react/index.d.ts +29 -54
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +69 -81
- package/dist/react/index.js.map +1 -1
- package/dist/react-native-expo/index.d.ts +1 -52
- package/dist/react-native-expo/index.d.ts.map +1 -1
- package/dist/react-native-expo/index.js +1 -91
- package/dist/react-native-expo/index.js.map +1 -1
- package/dist/runtime/index.d.ts +60 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +84 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/synthesisUi/context.d.ts +18 -0
- package/dist/synthesisUi/context.d.ts.map +1 -0
- package/dist/synthesisUi/context.js +15 -0
- package/dist/synthesisUi/context.js.map +1 -0
- package/dist/synthesisUi/types.d.ts +30 -0
- package/dist/synthesisUi/types.d.ts.map +1 -0
- package/dist/{synthesisView → synthesisUi}/types.js.map +1 -1
- package/dist/user/index.d.ts +59 -11
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +12 -6
- package/dist/user/index.js.map +1 -1
- package/dist/user/interaction.d.ts +7 -0
- package/dist/user/interaction.d.ts.map +1 -1
- package/dist/user/interaction.js +7 -0
- package/dist/user/interaction.js.map +1 -1
- package/dist/user/submissions.d.ts +65 -0
- package/dist/user/submissions.d.ts.map +1 -1
- package/dist/user/submissions.js +57 -0
- package/dist/user/submissions.js.map +1 -1
- package/dist/user/synthesize-batch-manager.js +2 -0
- package/dist/user/synthesize-batch-manager.js.map +1 -1
- package/dist/user/synthesize.d.ts +26 -0
- package/dist/user/synthesize.d.ts.map +1 -1
- package/dist/user/synthesize.js +11 -2
- package/dist/user/synthesize.js.map +1 -1
- package/dist/user/synthesizeUi.d.ts +67 -0
- package/dist/user/synthesizeUi.d.ts.map +1 -0
- package/dist/user/synthesizeUi.js +51 -0
- package/dist/user/synthesizeUi.js.map +1 -0
- package/dist/user/track-batch-manager.d.ts +17 -0
- package/dist/user/track-batch-manager.d.ts.map +1 -0
- package/dist/user/track-batch-manager.js +52 -0
- package/dist/user/track-batch-manager.js.map +1 -0
- package/dist/user/track.d.ts +17 -0
- package/dist/user/track.d.ts.map +1 -0
- package/dist/user/track.js +24 -0
- package/dist/user/track.js.map +1 -0
- package/dist/user/typeDefs.d.ts +9 -3
- package/dist/user/typeDefs.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/react/primitives.d.ts +0 -54
- package/dist/react/primitives.d.ts.map +0 -1
- package/dist/react/primitives.js +0 -223
- package/dist/react/primitives.js.map +0 -1
- package/dist/react-native-expo/primitives.d.ts +0 -58
- package/dist/react-native-expo/primitives.d.ts.map +0 -1
- package/dist/react-native-expo/primitives.js +0 -218
- package/dist/react-native-expo/primitives.js.map +0 -1
- package/dist/synthesisView/context.d.ts +0 -18
- package/dist/synthesisView/context.d.ts.map +0 -1
- package/dist/synthesisView/context.js +0 -15
- package/dist/synthesisView/context.js.map +0 -1
- package/dist/synthesisView/createComponentMap.d.ts +0 -18
- package/dist/synthesisView/createComponentMap.d.ts.map +0 -1
- package/dist/synthesisView/createComponentMap.js +0 -40
- package/dist/synthesisView/createComponentMap.js.map +0 -1
- package/dist/synthesisView/devLog.d.ts +0 -10
- package/dist/synthesisView/devLog.d.ts.map +0 -1
- package/dist/synthesisView/devLog.js +0 -23
- package/dist/synthesisView/devLog.js.map +0 -1
- package/dist/synthesisView/engine.d.ts +0 -35
- package/dist/synthesisView/engine.d.ts.map +0 -1
- package/dist/synthesisView/engine.js +0 -139
- package/dist/synthesisView/engine.js.map +0 -1
- package/dist/synthesisView/primitives.d.ts +0 -180
- package/dist/synthesisView/primitives.d.ts.map +0 -1
- package/dist/synthesisView/primitives.js +0 -29
- package/dist/synthesisView/primitives.js.map +0 -1
- package/dist/synthesisView/resolve.d.ts +0 -17
- package/dist/synthesisView/resolve.d.ts.map +0 -1
- package/dist/synthesisView/resolve.js +0 -42
- package/dist/synthesisView/resolve.js.map +0 -1
- package/dist/synthesisView/types.d.ts +0 -121
- package/dist/synthesisView/types.d.ts.map +0 -1
- package/dist/synthesisView/useEventDrivenView.d.ts +0 -32
- package/dist/synthesisView/useEventDrivenView.d.ts.map +0 -1
- package/dist/synthesisView/useEventDrivenView.js +0 -157
- package/dist/synthesisView/useEventDrivenView.js.map +0 -1
- package/dist/synthesisView/useSynthesisView.d.ts +0 -13
- package/dist/synthesisView/useSynthesisView.d.ts.map +0 -1
- package/dist/synthesisView/useSynthesisView.js +0 -49
- package/dist/synthesisView/useSynthesisView.js.map +0 -1
- package/dist/user/synthesize-view-batch-manager.d.ts +0 -17
- package/dist/user/synthesize-view-batch-manager.d.ts.map +0 -1
- package/dist/user/synthesize-view-batch-manager.js +0 -52
- package/dist/user/synthesize-view-batch-manager.js.map +0 -1
- package/dist/user/synthesizeView.d.ts +0 -41
- package/dist/user/synthesizeView.d.ts.map +0 -1
- package/dist/user/synthesizeView.js +0 -26
- package/dist/user/synthesizeView.js.map +0 -1
- /package/dist/{synthesisView → synthesisUi}/types.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/synthesisView/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAyBhD,SAAS,YAAY,CAAC,KAA+B;IACnD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC;IACvB,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;YAAE,GAAG,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AE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,aAAa,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Cross-platform prop contracts for the BB built-in primitives. Each primitive
|
|
4
|
-
* names a small set of *semantic* fields (what the engine reads or wires), and
|
|
5
|
-
* accepts arbitrary extra props that pass through to the underlying platform
|
|
6
|
-
* element — no variants, no enum unions. Styling and platform-specific knobs
|
|
7
|
-
* (`style`, `className`, etc.) flow straight to the host element so the UI
|
|
8
|
-
* tree author owns the look without our primitives prescribing one.
|
|
9
|
-
*
|
|
10
|
-
* Future registry contracts are generated from this file.
|
|
11
|
-
*/
|
|
12
|
-
/** Extra props that aren't part of the semantic contract — passed through to
|
|
13
|
-
* the platform host element (e.g. `style`, `className`, ARIA attributes). */
|
|
14
|
-
export type PassThroughProps = Record<string, unknown>;
|
|
15
|
-
export type TextProps = PassThroughProps & {
|
|
16
|
-
text?: string;
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
};
|
|
19
|
-
export type ImageProps = PassThroughProps & {
|
|
20
|
-
src: string;
|
|
21
|
-
alt?: string;
|
|
22
|
-
};
|
|
23
|
-
export type ButtonProps = PassThroughProps & {
|
|
24
|
-
title?: string;
|
|
25
|
-
children?: ReactNode;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Emitted with the authored event payload + bindings; no component payload. */
|
|
28
|
-
onPress?: () => void;
|
|
29
|
-
};
|
|
30
|
-
/** Transparent press target around arbitrary content. Unlike `Button` it
|
|
31
|
-
* imposes no visual chrome, so wrapping `Text`/`Image`/`Card` doesn't alter
|
|
32
|
-
* their look. Web renders as a `role="button"` element so keyboard and
|
|
33
|
-
* screen-reader semantics survive. */
|
|
34
|
-
export type PressableProps = PassThroughProps & {
|
|
35
|
-
children?: ReactNode;
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
onPress?: () => void;
|
|
38
|
-
};
|
|
39
|
-
export type IconProps = PassThroughProps & {
|
|
40
|
-
name: string;
|
|
41
|
-
};
|
|
42
|
-
export type VideoProps = PassThroughProps & {
|
|
43
|
-
src: string;
|
|
44
|
-
poster?: string;
|
|
45
|
-
};
|
|
46
|
-
export type AudioProps = PassThroughProps & {
|
|
47
|
-
src: string;
|
|
48
|
-
};
|
|
49
|
-
/** A point in the gradient's local box, with each axis in [0, 1]. */
|
|
50
|
-
export type GradientPoint = {
|
|
51
|
-
x: number;
|
|
52
|
-
y: number;
|
|
53
|
-
};
|
|
54
|
-
/** Linear-gradient backdrop primitive. Matches `expo-linear-gradient`'s shape
|
|
55
|
-
* on RN; the web impl converts `start`/`end` to a CSS `linear-gradient(...)`.
|
|
56
|
-
* Defaults paint top→bottom so a no-arg `Gradient` matches the common case. */
|
|
57
|
-
export type GradientProps = PassThroughProps & {
|
|
58
|
-
colors: string[];
|
|
59
|
-
/** Defaults to `{ x: 0, y: 0 }` (top). */
|
|
60
|
-
start?: GradientPoint;
|
|
61
|
-
/** Defaults to `{ x: 0, y: 1 }` (bottom). */
|
|
62
|
-
end?: GradientPoint;
|
|
63
|
-
/** Optional color stops in [0, 1], one per color. */
|
|
64
|
-
locations?: number[];
|
|
65
|
-
children?: ReactNode;
|
|
66
|
-
};
|
|
67
|
-
export type ColumnProps = PassThroughProps & {
|
|
68
|
-
children?: ReactNode;
|
|
69
|
-
};
|
|
70
|
-
/** Horizontal flex container. Same surface as `Column` but the baseline is
|
|
71
|
-
* `flexDirection: 'row'`. Authors override via `style` when needed. */
|
|
72
|
-
export type RowProps = PassThroughProps & {
|
|
73
|
-
children?: ReactNode;
|
|
74
|
-
};
|
|
75
|
-
export type ListProps = PassThroughProps & {
|
|
76
|
-
children?: ReactNode;
|
|
77
|
-
};
|
|
78
|
-
export type CardProps = PassThroughProps & {
|
|
79
|
-
children?: ReactNode;
|
|
80
|
-
};
|
|
81
|
-
export type DividerProps = PassThroughProps;
|
|
82
|
-
/** Vertical scrollable container. Overflowing children scroll on the y-axis.
|
|
83
|
-
* Authors style the viewport (height, padding) via `style`; the inner
|
|
84
|
-
* content sizes naturally to its children. */
|
|
85
|
-
export type VerticalScrollProps = PassThroughProps & {
|
|
86
|
-
children?: ReactNode;
|
|
87
|
-
};
|
|
88
|
-
/** Horizontal scrollable container. Overflowing children scroll on the
|
|
89
|
-
* x-axis. Authors style the viewport (height, padding) via `style`; the
|
|
90
|
-
* inner content sizes naturally to its children. */
|
|
91
|
-
export type HorizontalScrollProps = PassThroughProps & {
|
|
92
|
-
children?: ReactNode;
|
|
93
|
-
};
|
|
94
|
-
export type TabsProps = PassThroughProps & {
|
|
95
|
-
defaultValue?: string;
|
|
96
|
-
children?: ReactNode;
|
|
97
|
-
};
|
|
98
|
-
export type TabsItemProps = PassThroughProps & {
|
|
99
|
-
value: string;
|
|
100
|
-
label: string;
|
|
101
|
-
children?: ReactNode;
|
|
102
|
-
};
|
|
103
|
-
export type ModalProps = PassThroughProps & {
|
|
104
|
-
/** Whether the modal is shown. Default true so a node-mounted modal is visible. */
|
|
105
|
-
open?: boolean;
|
|
106
|
-
children?: ReactNode;
|
|
107
|
-
/** Emitted when the user dismisses via backdrop or close affordance. */
|
|
108
|
-
onClose?: () => void;
|
|
109
|
-
};
|
|
110
|
-
/** All form primitives emit `{ value }` via their event slot; the engine
|
|
111
|
-
* merges that into the authored payload before calling the host's onEvent. */
|
|
112
|
-
export type FormChangePayload<T> = {
|
|
113
|
-
value: T;
|
|
114
|
-
};
|
|
115
|
-
export type TextFieldProps = PassThroughProps & {
|
|
116
|
-
defaultValue?: string;
|
|
117
|
-
placeholder?: string;
|
|
118
|
-
multiline?: boolean;
|
|
119
|
-
disabled?: boolean;
|
|
120
|
-
onChange?: (payload: FormChangePayload<string>) => void;
|
|
121
|
-
};
|
|
122
|
-
export type CheckboxProps = PassThroughProps & {
|
|
123
|
-
label?: string;
|
|
124
|
-
defaultChecked?: boolean;
|
|
125
|
-
disabled?: boolean;
|
|
126
|
-
onChange?: (payload: FormChangePayload<boolean>) => void;
|
|
127
|
-
};
|
|
128
|
-
export type ChoicePickerOption = {
|
|
129
|
-
label: string;
|
|
130
|
-
value: string;
|
|
131
|
-
};
|
|
132
|
-
export type ChoicePickerProps = PassThroughProps & {
|
|
133
|
-
defaultValue?: string;
|
|
134
|
-
options: ChoicePickerOption[];
|
|
135
|
-
disabled?: boolean;
|
|
136
|
-
onChange?: (payload: FormChangePayload<string>) => void;
|
|
137
|
-
};
|
|
138
|
-
export type SliderProps = PassThroughProps & {
|
|
139
|
-
defaultValue?: number;
|
|
140
|
-
min?: number;
|
|
141
|
-
max?: number;
|
|
142
|
-
step?: number;
|
|
143
|
-
disabled?: boolean;
|
|
144
|
-
onChange?: (payload: FormChangePayload<number>) => void;
|
|
145
|
-
};
|
|
146
|
-
export type DateTimeMode = 'date' | 'time' | 'datetime';
|
|
147
|
-
export type DateTimeInputProps = PassThroughProps & {
|
|
148
|
-
defaultValue?: string;
|
|
149
|
-
mode?: DateTimeMode;
|
|
150
|
-
disabled?: boolean;
|
|
151
|
-
onChange?: (payload: FormChangePayload<string>) => void;
|
|
152
|
-
};
|
|
153
|
-
/** The string names a UI tree uses in `UiNode.component` to reference each
|
|
154
|
-
* primitive. The host's `ComponentMap` keys must match. */
|
|
155
|
-
export declare const PRIMITIVE_NAMES: {
|
|
156
|
-
readonly Text: "Text";
|
|
157
|
-
readonly Image: "Image";
|
|
158
|
-
readonly Button: "Button";
|
|
159
|
-
readonly Pressable: "Pressable";
|
|
160
|
-
readonly Icon: "Icon";
|
|
161
|
-
readonly Video: "Video";
|
|
162
|
-
readonly Audio: "Audio";
|
|
163
|
-
readonly Column: "Column";
|
|
164
|
-
readonly Row: "Row";
|
|
165
|
-
readonly List: "List";
|
|
166
|
-
readonly Card: "Card";
|
|
167
|
-
readonly VerticalScroll: "VerticalScroll";
|
|
168
|
-
readonly HorizontalScroll: "HorizontalScroll";
|
|
169
|
-
readonly Tabs: "Tabs";
|
|
170
|
-
readonly TabsItem: "TabsItem";
|
|
171
|
-
readonly Modal: "Modal";
|
|
172
|
-
readonly Divider: "Divider";
|
|
173
|
-
readonly Gradient: "Gradient";
|
|
174
|
-
readonly TextField: "TextField";
|
|
175
|
-
readonly Checkbox: "Checkbox";
|
|
176
|
-
readonly ChoicePicker: "ChoicePicker";
|
|
177
|
-
readonly Slider: "Slider";
|
|
178
|
-
readonly DateTimeInput: "DateTimeInput";
|
|
179
|
-
};
|
|
180
|
-
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/synthesisView/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;GASG;AAEH;8EAC8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAIvD,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAIF,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAIF,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;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C,KAAK,IAAI,CAAC;CACzD,CAAC;AAIF;4DAC4D;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CAwBlB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// --- Catalog name constants -------------------------------------------------
|
|
2
|
-
/** The string names a UI tree uses in `UiNode.component` to reference each
|
|
3
|
-
* primitive. The host's `ComponentMap` keys must match. */
|
|
4
|
-
export const PRIMITIVE_NAMES = {
|
|
5
|
-
Text: 'Text',
|
|
6
|
-
Image: 'Image',
|
|
7
|
-
Button: 'Button',
|
|
8
|
-
Pressable: 'Pressable',
|
|
9
|
-
Icon: 'Icon',
|
|
10
|
-
Video: 'Video',
|
|
11
|
-
Audio: 'Audio',
|
|
12
|
-
Column: 'Column',
|
|
13
|
-
Row: 'Row',
|
|
14
|
-
List: 'List',
|
|
15
|
-
Card: 'Card',
|
|
16
|
-
VerticalScroll: 'VerticalScroll',
|
|
17
|
-
HorizontalScroll: 'HorizontalScroll',
|
|
18
|
-
Tabs: 'Tabs',
|
|
19
|
-
TabsItem: 'TabsItem',
|
|
20
|
-
Modal: 'Modal',
|
|
21
|
-
Divider: 'Divider',
|
|
22
|
-
Gradient: 'Gradient',
|
|
23
|
-
TextField: 'TextField',
|
|
24
|
-
Checkbox: 'Checkbox',
|
|
25
|
-
ChoicePicker: 'ChoicePicker',
|
|
26
|
-
Slider: 'Slider',
|
|
27
|
-
DateTimeInput: 'DateTimeInput',
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=primitives.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/synthesisView/primitives.ts"],"names":[],"mappings":"AAsMA,+EAA+E;AAE/E;4DAC4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,eAAe;CACtB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type Scope = {
|
|
2
|
-
/** The synthesis data the view binds against. */
|
|
3
|
-
data: unknown;
|
|
4
|
-
/** The current element when inside a Repeat subtree. */
|
|
5
|
-
item?: unknown;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Resolve a dot-path against the data scope. `$item` (and `$item.x`) reads the
|
|
9
|
-
* current Repeat element; any other path reads from the synthesis data.
|
|
10
|
-
*
|
|
11
|
-
* Bracket notation (`variants[variant]`, `themes[mode].text.primary`) is
|
|
12
|
-
* supported: the inner path resolves first, then the result is interpolated
|
|
13
|
-
* into the outer path before walking. This lets bindings pick a style or
|
|
14
|
-
* theme bucket at runtime — the consumer just sets the discriminator prop.
|
|
15
|
-
*/
|
|
16
|
-
export declare function resolvePath(path: string, scope: Scope): unknown;
|
|
17
|
-
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/synthesisView/resolve.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,KAAK,GAAG;IAClB,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CA8B/D"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const ITEM = '$item';
|
|
2
|
-
const BRACKET_RE = /\[([^\]]+)\]/;
|
|
3
|
-
/**
|
|
4
|
-
* Resolve a dot-path against the data scope. `$item` (and `$item.x`) reads the
|
|
5
|
-
* current Repeat element; any other path reads from the synthesis data.
|
|
6
|
-
*
|
|
7
|
-
* Bracket notation (`variants[variant]`, `themes[mode].text.primary`) is
|
|
8
|
-
* supported: the inner path resolves first, then the result is interpolated
|
|
9
|
-
* into the outer path before walking. This lets bindings pick a style or
|
|
10
|
-
* theme bucket at runtime — the consumer just sets the discriminator prop.
|
|
11
|
-
*/
|
|
12
|
-
export function resolvePath(path, scope) {
|
|
13
|
-
// Expand any `[inner]` segments first so prefix handling sees a normalized
|
|
14
|
-
// dot-path. Each inner segment recursively resolves against the same scope.
|
|
15
|
-
while (path.includes('[')) {
|
|
16
|
-
const m = BRACKET_RE.exec(path);
|
|
17
|
-
if (!m || m.index === undefined)
|
|
18
|
-
break;
|
|
19
|
-
const key = resolvePath(m[1], scope);
|
|
20
|
-
if (typeof key !== 'string' && typeof key !== 'number')
|
|
21
|
-
return undefined;
|
|
22
|
-
const before = path.slice(0, m.index);
|
|
23
|
-
const after = path.slice(m.index + m[0].length);
|
|
24
|
-
path = `${before}${before && !before.endsWith('.') ? '.' : ''}${key}${after}`;
|
|
25
|
-
}
|
|
26
|
-
if (path.startsWith('.'))
|
|
27
|
-
path = path.slice(1);
|
|
28
|
-
if (path === ITEM)
|
|
29
|
-
return scope.item;
|
|
30
|
-
let base;
|
|
31
|
-
let keys;
|
|
32
|
-
if (path.startsWith(`${ITEM}.`)) {
|
|
33
|
-
base = scope.item;
|
|
34
|
-
keys = path.slice(ITEM.length + 1).split('.');
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
base = scope.data;
|
|
38
|
-
keys = path.split('.');
|
|
39
|
-
}
|
|
40
|
-
return keys.reduce((acc, key) => (acc == null ? undefined : acc[key]), base);
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=resolve.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/synthesisView/resolve.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,OAAO,CAAC;AACrB,MAAM,UAAU,GAAG,cAAc,CAAC;AASlC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAY;IACpD,2EAA2E;IAC3E,4EAA4E;IAC5E,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS;YAAE,MAAM;QACvC,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QACzE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAChF,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/C,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IAErC,IAAI,IAAa,CAAC;IAClB,IAAI,IAAc,CAAC;IACnB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC;QAChC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAClB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAClB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAChB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC,EAC/E,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Render-ready node delivered by the API. The SDK walks the array and
|
|
4
|
-
* renders each node — there is no further resolution to do.
|
|
5
|
-
*
|
|
6
|
-
* - `PRIMITIVE` — a BB built-in (`Row`, `Column`, `Text`, `Image`, …) with
|
|
7
|
-
* inline props.
|
|
8
|
-
* - `KEY_NAME` — a component the host app registered via
|
|
9
|
-
* `<BitBitView components={{ X: ... }} />`.
|
|
10
|
-
*/
|
|
11
|
-
export type FlatUiPrimitiveNode = {
|
|
12
|
-
id: string;
|
|
13
|
-
kind: 'PRIMITIVE';
|
|
14
|
-
/** BB primitive identifier (e.g. `'Row'`, `'Text'`, `'Image'`). */
|
|
15
|
-
component: string;
|
|
16
|
-
style?: Record<string, unknown>;
|
|
17
|
-
/** Ordered nested-node ids. */
|
|
18
|
-
children?: string[];
|
|
19
|
-
/** Single nested-node id shorthand. */
|
|
20
|
-
child?: string;
|
|
21
|
-
/** Host-facing event bindings. Component-emitted payloads (e.g.
|
|
22
|
-
* `TextField` `{value}`) merge over the static payload at fire time.
|
|
23
|
-
* `handleWith` is lifted from the component contract by the flattener so
|
|
24
|
-
* the SDK can route the event without re-fetching the catalog:
|
|
25
|
-
* - `HOST` — fires `onEvent` to the customer.
|
|
26
|
-
* - `AGENT` (default) — `<BitBitView>` round-trips to the synthesis
|
|
27
|
-
* endpoint with the event as continuation context; the agent emits
|
|
28
|
-
* the next UI. The customer's `onEvent` still fires for observability.
|
|
29
|
-
* - `payloadSchema` (when present) opts the event out of speculative
|
|
30
|
-
* preload — the payload requires runtime input. */
|
|
31
|
-
events?: Record<string, {
|
|
32
|
-
name: string;
|
|
33
|
-
payload?: Record<string, unknown>;
|
|
34
|
-
handleWith?: ViewEventHandleWith;
|
|
35
|
-
payloadSchema?: unknown;
|
|
36
|
-
}>;
|
|
37
|
-
/** Other fields (`text`, `src`, `title`, …) are static props on the node. */
|
|
38
|
-
[prop: string]: unknown;
|
|
39
|
-
};
|
|
40
|
-
export type FlatUiKeyNameNode = {
|
|
41
|
-
id: string;
|
|
42
|
-
kind: 'KEY_NAME';
|
|
43
|
-
/** Name the host registered with `<BitBitView components={{ X: ... }} />`. */
|
|
44
|
-
component: string;
|
|
45
|
-
props?: Record<string, unknown>;
|
|
46
|
-
/** Projected children (ids in the same array). */
|
|
47
|
-
children?: string[];
|
|
48
|
-
child?: string;
|
|
49
|
-
/** Host-facing event bindings — same shape and semantics as on
|
|
50
|
-
* {@link FlatUiPrimitiveNode}. The SDK wires each slot into a prop
|
|
51
|
-
* callback on the host component so customer code can fire BB events
|
|
52
|
-
* (`AGENT` continuations, `HOST` dispatches) without grabbing the
|
|
53
|
-
* provider context manually. */
|
|
54
|
-
events?: Record<string, {
|
|
55
|
-
name: string;
|
|
56
|
-
payload?: Record<string, unknown>;
|
|
57
|
-
handleWith?: ViewEventHandleWith;
|
|
58
|
-
payloadSchema?: unknown;
|
|
59
|
-
}>;
|
|
60
|
-
};
|
|
61
|
-
export type FlatUiNode = FlatUiPrimitiveNode | FlatUiKeyNameNode;
|
|
62
|
-
export type ViewEventHandleWith = 'AGENT' | 'HOST';
|
|
63
|
-
export type SynthesisViewEvent = {
|
|
64
|
-
/** Host-facing event name — what the view-author bound the slot to. */
|
|
65
|
-
name: string;
|
|
66
|
-
/** Resolved payload — static `payload` from the binding merged with any
|
|
67
|
-
* runtime payload the primitive emitted (e.g. `TextField` `{value}`). */
|
|
68
|
-
payload: Record<string, unknown>;
|
|
69
|
-
/** Slot that fired (e.g. `onPress`). Useful when several slots are bound
|
|
70
|
-
* to the same host event name. */
|
|
71
|
-
slot: string;
|
|
72
|
-
/** The flat-uid of the node that fired. SDK-internal mostly; useful for
|
|
73
|
-
* the CMS preview to disambiguate multiple instances. */
|
|
74
|
-
nodeId: string;
|
|
75
|
-
/** Catalog name of the component the event was fired from. */
|
|
76
|
-
componentName: string;
|
|
77
|
-
/** Routing the component contract declared. `null` defaults to `AGENT`. */
|
|
78
|
-
handleWith: ViewEventHandleWith;
|
|
79
|
-
};
|
|
80
|
-
/** Sent to the synthesis endpoint as `viewInputs.event` when an `AGENT` event
|
|
81
|
-
* fires. The agent gets the prior UI + event as continuation context and
|
|
82
|
-
* emits the next UI in response. */
|
|
83
|
-
export type SynthesisViewEventInput = {
|
|
84
|
-
name: string;
|
|
85
|
-
componentName: string;
|
|
86
|
-
payload?: Record<string, unknown>;
|
|
87
|
-
sourceNodeId?: string;
|
|
88
|
-
priorUiData: FlatUiNode[];
|
|
89
|
-
};
|
|
90
|
-
/** Maps component names → React implementations. Used both for BB
|
|
91
|
-
* primitives and for the host-registered `KEY_NAME` components. */
|
|
92
|
-
export type ComponentMap = Record<string, ComponentType<Record<string, unknown>>>;
|
|
93
|
-
export type ContentInput = {
|
|
94
|
-
type: string;
|
|
95
|
-
value: string;
|
|
96
|
-
};
|
|
97
|
-
export type ViewInputs = {
|
|
98
|
-
/** Provide the dark mode setting of the current UI to the agent. */
|
|
99
|
-
darkMode?: boolean;
|
|
100
|
-
/** Event continuation. Set by the SDK on AGENT-handled events (and on
|
|
101
|
-
* speculative preload calls); the agent re-renders given the prior UI
|
|
102
|
-
* plus this event. Customers don't pass this — `<BitBitView>` manages it
|
|
103
|
-
* internally. */
|
|
104
|
-
event?: SynthesisViewEventInput;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Minimal structural shape `<BitBitView>` needs to fetch a view. A
|
|
108
|
-
* `BitBitPressClient` satisfies it via `client.user.synthesizeViewItem(...)`.
|
|
109
|
-
*/
|
|
110
|
-
export interface SynthesizeViewFetcher {
|
|
111
|
-
user: {
|
|
112
|
-
synthesizeViewItem(item: {
|
|
113
|
-
keyName: string;
|
|
114
|
-
contentInputs?: ContentInput[];
|
|
115
|
-
viewInputs?: ViewInputs;
|
|
116
|
-
}): Promise<{
|
|
117
|
-
uiData: unknown[];
|
|
118
|
-
}>;
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/synthesisView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,O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FlatUiNode, SynthesisViewEvent, SynthesizeViewFetcher, ViewInputs } from './types.js';
|
|
2
|
-
export type UseEventDrivenViewOptions = {
|
|
3
|
-
/** When true (default), speculatively prefetches the agent's next-UI for
|
|
4
|
-
* every AGENT event whose payload is fully derivable from the rendered
|
|
5
|
-
* tree (i.e. the contract declared no `payloadSchema`). On the real
|
|
6
|
-
* click, the SDK swaps in the prefetched response without a server hop. */
|
|
7
|
-
preloadNextUi?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type UseEventDrivenViewResult = {
|
|
10
|
-
uiData: FlatUiNode[];
|
|
11
|
-
loading: boolean;
|
|
12
|
-
error: string | null;
|
|
13
|
-
/** Wire this to `<BitBitViewRenderer onEvent={...}>`. Routes the event
|
|
14
|
-
* based on its `handleWith`:
|
|
15
|
-
* - `HOST` — fires the supplied `onHostEvent` callback.
|
|
16
|
-
* - `AGENT` — re-fetches with the event as continuation context (cache
|
|
17
|
-
* hit if a speculative preload landed first), swaps `uiData` in
|
|
18
|
-
* place. The customer's `onHostEvent` is NOT fired for AGENT events. */
|
|
19
|
-
handleEvent: (event: SynthesisViewEvent) => void;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Live-view hook on top of `useSynthesisView`. Owns:
|
|
23
|
-
* - the live `uiData` (swaps in place on AGENT events),
|
|
24
|
-
* - a per-tree preload cache so deterministic event sequences are 0ms,
|
|
25
|
-
* - an event dispatcher the renderer calls back into.
|
|
26
|
-
*
|
|
27
|
-
* Resets state whenever the underlying view (keyName / contentInputs)
|
|
28
|
-
* changes — speculative entries from a stale tree aren't relevant to a
|
|
29
|
-
* different view.
|
|
30
|
-
*/
|
|
31
|
-
export declare function useEventDrivenView(client: SynthesizeViewFetcher, keyName: string, onHostEvent: ((event: SynthesisViewEvent) => void) | undefined, contentInputs?: ContentInput[], baseViewInputs?: ViewInputs, options?: UseEventDrivenViewOptions): UseEventDrivenViewResult;
|
|
32
|
-
//# sourceMappingURL=useEventDrivenView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEventDrivenView.d.ts","sourceRoot":"","sources":["../../src/synthesisView/useEventDrivenView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAEV,kBAAkB,EAElB,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;gFAG4E;IAC5E,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;;;;gFAK4E;IAC5E,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAClD,CAAC;AA4DF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC,GAAG,SAAS,EAC9D,aAAa,CAAC,EAAE,YAAY,EAAE,EAC9B,cAAc,CAAC,EAAE,UAAU,EAC3B,OAAO,CAAC,EAAE,yBAAyB,GAClC,wBAAwB,CAuG1B"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { useSynthesisView } from './useSynthesisView.js';
|
|
3
|
-
function isPrimitive(node) {
|
|
4
|
-
return node.kind === 'PRIMITIVE';
|
|
5
|
-
}
|
|
6
|
-
/** Stable string key for an event's cache entry. Speculation + real fire
|
|
7
|
-
* produce the same key when the runtime payload matches the declared one. */
|
|
8
|
-
function buildEventKey(componentName, eventName, sourceNodeId, payload) {
|
|
9
|
-
// Sort keys so payload order doesn't matter.
|
|
10
|
-
const payloadStr = payload
|
|
11
|
-
? JSON.stringify(Object.keys(payload)
|
|
12
|
-
.sort()
|
|
13
|
-
.reduce((acc, k) => {
|
|
14
|
-
acc[k] = payload[k];
|
|
15
|
-
return acc;
|
|
16
|
-
}, {}))
|
|
17
|
-
: '';
|
|
18
|
-
return `${componentName}:${eventName}:${sourceNodeId}:${payloadStr}`;
|
|
19
|
-
}
|
|
20
|
-
/** Walks the rendered tree and pulls out AGENT events with empty
|
|
21
|
-
* `payloadSchema` — those have payloads that don't depend on user input,
|
|
22
|
-
* so the SDK can fabricate the request and prefetch the agent's response. */
|
|
23
|
-
function findPreloadCandidates(uiData) {
|
|
24
|
-
const out = [];
|
|
25
|
-
for (const node of uiData) {
|
|
26
|
-
if (!isPrimitive(node) || !node.events)
|
|
27
|
-
continue;
|
|
28
|
-
for (const [, event] of Object.entries(node.events)) {
|
|
29
|
-
const handleWith = event.handleWith ?? 'AGENT';
|
|
30
|
-
if (handleWith !== 'AGENT')
|
|
31
|
-
continue;
|
|
32
|
-
// Skip events that need runtime payload — we can't fabricate the value.
|
|
33
|
-
if (event.payloadSchema)
|
|
34
|
-
continue;
|
|
35
|
-
out.push({
|
|
36
|
-
key: buildEventKey(node.component, event.name, node.id, event.payload),
|
|
37
|
-
event: {
|
|
38
|
-
name: event.name,
|
|
39
|
-
componentName: node.component,
|
|
40
|
-
payload: event.payload,
|
|
41
|
-
sourceNodeId: node.id,
|
|
42
|
-
priorUiData: uiData,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return out;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Live-view hook on top of `useSynthesisView`. Owns:
|
|
51
|
-
* - the live `uiData` (swaps in place on AGENT events),
|
|
52
|
-
* - a per-tree preload cache so deterministic event sequences are 0ms,
|
|
53
|
-
* - an event dispatcher the renderer calls back into.
|
|
54
|
-
*
|
|
55
|
-
* Resets state whenever the underlying view (keyName / contentInputs)
|
|
56
|
-
* changes — speculative entries from a stale tree aren't relevant to a
|
|
57
|
-
* different view.
|
|
58
|
-
*/
|
|
59
|
-
export function useEventDrivenView(client, keyName, onHostEvent, contentInputs, baseViewInputs, options) {
|
|
60
|
-
const fetched = useSynthesisView(client, keyName, contentInputs, baseViewInputs);
|
|
61
|
-
// Live tree: starts as the fetched one, replaced on AGENT events.
|
|
62
|
-
const [liveUiData, setLiveUiData] = useState(fetched.uiData);
|
|
63
|
-
// Preload cache scoped to the current view; reset on every base refetch.
|
|
64
|
-
const preloadCacheRef = useRef(new Map());
|
|
65
|
-
const inFlightRef = useRef(new Map());
|
|
66
|
-
// Keep `onHostEvent` reachable inside the stable `handleEvent` callback
|
|
67
|
-
// without making the callback identity churn on every render.
|
|
68
|
-
const onHostEventRef = useRef(onHostEvent);
|
|
69
|
-
onHostEventRef.current = onHostEvent;
|
|
70
|
-
const baseViewInputsRef = useRef(baseViewInputs);
|
|
71
|
-
baseViewInputsRef.current = baseViewInputs;
|
|
72
|
-
// When the base fetch produces new uiData (initial load, or a view change),
|
|
73
|
-
// adopt it and drop any stale speculations.
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
setLiveUiData(fetched.uiData);
|
|
76
|
-
preloadCacheRef.current = new Map();
|
|
77
|
-
inFlightRef.current = new Map();
|
|
78
|
-
}, [fetched.uiData]);
|
|
79
|
-
const preload = options?.preloadNextUi ?? true;
|
|
80
|
-
/** Fire one speculative event lookup and stash the result. Idempotent on
|
|
81
|
-
* the cache key — concurrent triggers share the in-flight promise. */
|
|
82
|
-
const speculate = useCallback(async (candidate) => {
|
|
83
|
-
if (preloadCacheRef.current.has(candidate.key)) {
|
|
84
|
-
return preloadCacheRef.current.get(candidate.key) ?? [];
|
|
85
|
-
}
|
|
86
|
-
const existing = inFlightRef.current.get(candidate.key);
|
|
87
|
-
if (existing)
|
|
88
|
-
return existing;
|
|
89
|
-
const promise = client.user
|
|
90
|
-
.synthesizeViewItem({
|
|
91
|
-
keyName,
|
|
92
|
-
contentInputs,
|
|
93
|
-
viewInputs: { ...baseViewInputsRef.current, event: candidate.event },
|
|
94
|
-
})
|
|
95
|
-
.then((res) => {
|
|
96
|
-
const next = Array.isArray(res.uiData) ? res.uiData : [];
|
|
97
|
-
preloadCacheRef.current.set(candidate.key, next);
|
|
98
|
-
inFlightRef.current.delete(candidate.key);
|
|
99
|
-
return next;
|
|
100
|
-
})
|
|
101
|
-
.catch(() => {
|
|
102
|
-
inFlightRef.current.delete(candidate.key);
|
|
103
|
-
return [];
|
|
104
|
-
});
|
|
105
|
-
inFlightRef.current.set(candidate.key, promise);
|
|
106
|
-
return promise;
|
|
107
|
-
},
|
|
108
|
-
// contentInputs object identity changes are tolerated by the
|
|
109
|
-
// fetch path; we only need a fresh `keyName` to invalidate.
|
|
110
|
-
[client, keyName, contentInputs]);
|
|
111
|
-
// Preload pump: whenever the live tree changes, look up speculatable
|
|
112
|
-
// events and prefetch them in the background. Cap so a giant gallery
|
|
113
|
-
// doesn't blow up the LLM budget.
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
if (!preload)
|
|
116
|
-
return;
|
|
117
|
-
const candidates = findPreloadCandidates(liveUiData).slice(0, MAX_SPECULATIONS);
|
|
118
|
-
for (const candidate of candidates)
|
|
119
|
-
void speculate(candidate);
|
|
120
|
-
}, [liveUiData, preload, speculate]);
|
|
121
|
-
const handleEvent = useCallback((event) => {
|
|
122
|
-
if (event.handleWith === 'HOST') {
|
|
123
|
-
onHostEventRef.current?.(event);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const key = buildEventKey(event.componentName, event.name, event.nodeId, event.payload);
|
|
127
|
-
const cached = preloadCacheRef.current.get(key);
|
|
128
|
-
if (cached) {
|
|
129
|
-
setLiveUiData(cached);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
// Cache miss → live call. The result joins the cache so a repeat
|
|
133
|
-
// event-sequence step is 0ms.
|
|
134
|
-
const candidate = {
|
|
135
|
-
key,
|
|
136
|
-
event: {
|
|
137
|
-
name: event.name,
|
|
138
|
-
componentName: event.componentName,
|
|
139
|
-
payload: event.payload,
|
|
140
|
-
sourceNodeId: event.nodeId,
|
|
141
|
-
priorUiData: liveUiData,
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
void speculate(candidate).then((next) => {
|
|
145
|
-
if (next.length > 0)
|
|
146
|
-
setLiveUiData(next);
|
|
147
|
-
});
|
|
148
|
-
}, [liveUiData, speculate]);
|
|
149
|
-
return {
|
|
150
|
-
uiData: liveUiData,
|
|
151
|
-
loading: fetched.loading,
|
|
152
|
-
error: fetched.error,
|
|
153
|
-
handleEvent,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
const MAX_SPECULATIONS = 8;
|
|
157
|
-
//# sourceMappingURL=useEventDrivenView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEventDrivenView.js","sourceRoot":"","sources":["../../src/synthesisView/useEventDrivenView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAuBzD,SAAS,WAAW,CAAC,IAAgB;IACnC,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC;AACnC,CAAC;AAED;8EAC8E;AAC9E,SAAS,aAAa,CACpB,aAAqB,EACrB,SAAiB,EACjB,YAAoB,EACpB,OAA4C;IAE5C,6CAA6C;IAC7C,MAAM,UAAU,GAAG,OAAO;QACxB,CAAC,CAAC,IAAI,CAAC,SAAS,CACZ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;aACjB,IAAI,EAAE;aACN,MAAM,CAA0B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,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C;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ContentInput, FlatUiNode, SynthesizeViewFetcher, ViewInputs } from './types.js';
|
|
2
|
-
export type UseSynthesisViewResult = {
|
|
3
|
-
uiData: FlatUiNode[];
|
|
4
|
-
loading: boolean;
|
|
5
|
-
error: string | null;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Fetches a view's `uiData` by keyName and tracks loading/error state.
|
|
9
|
-
* Re-fetches when keyName, contentInputs, or viewInputs change. Calls
|
|
10
|
-
* coalesce with other views' lookups via the SDK's batch manager.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useSynthesisView(client: SynthesizeViewFetcher, keyName: string, contentInputs?: ContentInput[], viewInputs?: ViewInputs): UseSynthesisViewResult;
|
|
13
|
-
//# sourceMappingURL=useSynthesisView.d.ts.map
|