@graview/embed 0.1.0 → 0.1.3
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 +79 -1
- package/dist/embed.d.ts +30 -60
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +85 -170
- package/dist/embed.js.map +1 -1
- package/dist/frame.d.ts +255 -0
- package/dist/frame.d.ts.map +1 -0
- package/dist/frame.js +336 -0
- package/dist/frame.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pages.d.ts +44 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +48 -0
- package/dist/pages.js.map +1 -0
- package/package.json +12 -8
package/dist/frame.js
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Store } from "@graview/core";
|
|
3
|
+
import { PagesApp } from "@graview/pages";
|
|
4
|
+
import { Profile, Standing, registerDefaultViews, registerViewSpecs, themeCss, useWidth } from "@graview/primitives";
|
|
5
|
+
import { createViews, layerViews, useGraview, useTheKeyboardLandsSomewhere } from "@graview/react";
|
|
6
|
+
import { Component, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { fontsLink } from "./fonts.js";
|
|
8
|
+
/*
|
|
9
|
+
* THE DEFAULTS, THE DECLARATION'S SPECS, THEN THE HOST'S OWN — one
|
|
10
|
+
* registry, each layer over the one before, so what the host leaves alone
|
|
11
|
+
* stays drawn (FR-36) and what the declaration says as data is drawn with
|
|
12
|
+
* no views at all (FR-03). Every face draws from it, the pages too (FR-35).
|
|
13
|
+
*/
|
|
14
|
+
export function useViews(props) {
|
|
15
|
+
const { app } = props;
|
|
16
|
+
return useMemo(() => {
|
|
17
|
+
const base = registerViewSpecs(registerDefaultViews(app.schema, createViews(app.schema)), app.schema, app.viewSpecs);
|
|
18
|
+
return (props.views ? layerViews(base, props.views(app.schema, base)) : base);
|
|
19
|
+
}, [props.views, app.schema, app.viewSpecs]);
|
|
20
|
+
}
|
|
21
|
+
/** A store from a declaration and a seed: the app's own policy, in memory. */
|
|
22
|
+
export function storeOf(app, seed) {
|
|
23
|
+
return new Store({
|
|
24
|
+
schema: app.schema,
|
|
25
|
+
mutations: app.mutations ?? [],
|
|
26
|
+
invariants: app.invariants ?? [],
|
|
27
|
+
...(seed ? { snapshot: seed } : {}),
|
|
28
|
+
...(app.policy ? { policy: app.policy } : {}),
|
|
29
|
+
...(app.intelligence ? { intelligence: app.intelligence } : {}),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** The host page's scheme: an explicit `data-theme`, else the system's preference. */
|
|
33
|
+
export function hostScheme() {
|
|
34
|
+
if (typeof document === "undefined")
|
|
35
|
+
return "light";
|
|
36
|
+
const stamped = document.documentElement.dataset["theme"];
|
|
37
|
+
if (stamped === "dark" || stamped === "light")
|
|
38
|
+
return stamped;
|
|
39
|
+
return typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* THE HOST PAGE'S SCHEME, AS IT CHANGES. Read once, an embed kept the
|
|
43
|
+
* scheme the page had when it mounted: a host that stamps `data-theme` when
|
|
44
|
+
* its own toggle is pressed (or a widget's glue, when the chat says the
|
|
45
|
+
* theme changed) left the embed in the other one.
|
|
46
|
+
*/
|
|
47
|
+
function useHostScheme(follow) {
|
|
48
|
+
const [scheme, setScheme] = useState(() => hostScheme());
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!follow || typeof document === "undefined")
|
|
51
|
+
return;
|
|
52
|
+
const read = () => setScheme(hostScheme());
|
|
53
|
+
read();
|
|
54
|
+
const stamped = new MutationObserver(read);
|
|
55
|
+
stamped.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
|
|
56
|
+
const media = typeof matchMedia === "function" ? matchMedia("(prefers-color-scheme: dark)") : null;
|
|
57
|
+
media?.addEventListener?.("change", read);
|
|
58
|
+
return () => {
|
|
59
|
+
stamped.disconnect();
|
|
60
|
+
media?.removeEventListener?.("change", read);
|
|
61
|
+
};
|
|
62
|
+
}, [follow]);
|
|
63
|
+
return scheme;
|
|
64
|
+
}
|
|
65
|
+
/** Element heights, read the one way a ResizeObserver also reads them. */
|
|
66
|
+
const heightOf = (element) => (element ? element.getBoundingClientRect().height : 0);
|
|
67
|
+
/**
|
|
68
|
+
* THE HEIGHT THE EMBED ASKS FOR, told as it changes (FR-13). A chat's
|
|
69
|
+
* widget frame is sized from its content, and an embed that filled
|
|
70
|
+
* whatever box it was given had no height of its own to say: the frame
|
|
71
|
+
* stayed at its first guess. The pages face asks for the strip and the
|
|
72
|
+
* whole page; the other faces for the strip and the picture's box.
|
|
73
|
+
*/
|
|
74
|
+
export function useIntrinsicHeight(rootRef, face, onHeight) {
|
|
75
|
+
const told = useRef(onHeight);
|
|
76
|
+
told.current = onHeight;
|
|
77
|
+
const wanted = onHeight !== undefined;
|
|
78
|
+
useLayoutEffect(() => {
|
|
79
|
+
const root = rootRef.current;
|
|
80
|
+
if (!root || !wanted)
|
|
81
|
+
return;
|
|
82
|
+
const parts = () => {
|
|
83
|
+
const children = [...root.children];
|
|
84
|
+
const strip = children.find((child) => child.hasAttribute("data-embed-strip"));
|
|
85
|
+
const content = children.find((child) => child.hasAttribute("data-embed-content"));
|
|
86
|
+
const measure = content?.querySelector("[data-embed-measure]") ?? null;
|
|
87
|
+
return { strip, content, measure };
|
|
88
|
+
};
|
|
89
|
+
let last = -1;
|
|
90
|
+
const report = () => {
|
|
91
|
+
const { strip, content, measure } = parts();
|
|
92
|
+
const height = Math.ceil(heightOf(strip) + (measure ? heightOf(measure) : heightOf(content)));
|
|
93
|
+
if (height === last)
|
|
94
|
+
return;
|
|
95
|
+
last = height;
|
|
96
|
+
told.current?.(height);
|
|
97
|
+
};
|
|
98
|
+
report();
|
|
99
|
+
if (typeof ResizeObserver === "undefined")
|
|
100
|
+
return;
|
|
101
|
+
const observer = new ResizeObserver(report);
|
|
102
|
+
const watch = () => {
|
|
103
|
+
observer.disconnect();
|
|
104
|
+
const { strip, content, measure } = parts();
|
|
105
|
+
for (const element of [root, strip, content, measure])
|
|
106
|
+
if (element)
|
|
107
|
+
observer.observe(element);
|
|
108
|
+
};
|
|
109
|
+
watch();
|
|
110
|
+
// The strip comes and goes with the face's own children; a page that
|
|
111
|
+
// routes changes size inside the measured box, which the observer sees.
|
|
112
|
+
const swapped = new MutationObserver(() => {
|
|
113
|
+
watch();
|
|
114
|
+
report();
|
|
115
|
+
});
|
|
116
|
+
swapped.observe(root, { childList: true });
|
|
117
|
+
return () => {
|
|
118
|
+
observer.disconnect();
|
|
119
|
+
swapped.disconnect();
|
|
120
|
+
};
|
|
121
|
+
}, [rootRef, face, wanted]);
|
|
122
|
+
}
|
|
123
|
+
let sequence = 0;
|
|
124
|
+
/**
|
|
125
|
+
* The frame itself: the element's own keyboard, its scoped theme, the
|
|
126
|
+
* brand's fonts, the landmarks inside named after the embed, and the store.
|
|
127
|
+
*/
|
|
128
|
+
export function useFrame(props) {
|
|
129
|
+
const { app, seed, scheme: askedScheme = "auto", brand = app.brand, fonts = true, height = "100%", label } = props;
|
|
130
|
+
const rootRef = useRef(null);
|
|
131
|
+
useTheKeyboardLandsSomewhere(rootRef);
|
|
132
|
+
const scope = useMemo(() => `graview-embed-${++sequence}`, []);
|
|
133
|
+
/*
|
|
134
|
+
* ONE STORE ACROSS THE SEATS. Who is at the keyboard is the provider's
|
|
135
|
+
* business, not the store's: with the principal in these dependencies a
|
|
136
|
+
* seat change made a fresh store from the seed, and a React host that sat
|
|
137
|
+
* somebody else down lost every edit and the history with them.
|
|
138
|
+
*/
|
|
139
|
+
const store = useMemo(() => props.store ?? props.remote?.store ?? storeOf(app, seed), [props.store, props.remote, app, seed]);
|
|
140
|
+
const presence = props.presence ?? props.remote?.presence;
|
|
141
|
+
const told = props.hostContext?.theme;
|
|
142
|
+
const followed = useHostScheme(askedScheme === "auto" && told === undefined);
|
|
143
|
+
const scheme = askedScheme === "auto" ? (told ?? followed) : askedScheme;
|
|
144
|
+
const css = useMemo(() => themeCss(scheme, brand, { scope: `.${scope}` }), [scheme, brand, scope]);
|
|
145
|
+
// The brand's fonts, fetched once per family set, without the host's help.
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (!fonts || typeof document === "undefined")
|
|
148
|
+
return;
|
|
149
|
+
const href = fontsLink(brand);
|
|
150
|
+
if (!href || document.querySelector(`link[href="${href}"]`))
|
|
151
|
+
return;
|
|
152
|
+
const link = document.createElement("link");
|
|
153
|
+
link.rel = "stylesheet";
|
|
154
|
+
link.href = href;
|
|
155
|
+
document.head.appendChild(link);
|
|
156
|
+
}, [brand, fonts]);
|
|
157
|
+
// Landmarks inside, named after the embed — kept so through re-renders.
|
|
158
|
+
useLayoutEffect(() => {
|
|
159
|
+
const root = rootRef.current;
|
|
160
|
+
if (!root || !label)
|
|
161
|
+
return;
|
|
162
|
+
const name = (el) => {
|
|
163
|
+
const own = el.getAttribute("aria-label") ?? "";
|
|
164
|
+
if (own.startsWith(`${label} · `))
|
|
165
|
+
return;
|
|
166
|
+
// Named the same thing: "The pipeline · The pipeline" is one name said
|
|
167
|
+
// twice, not a place inside a place. A region of that name IS the
|
|
168
|
+
// embed's region, so it stops being a second landmark (two regions of
|
|
169
|
+
// one name is axe's `landmark-unique`) and stays a named group.
|
|
170
|
+
if (own === label) {
|
|
171
|
+
if (el.getAttribute("role") === "region" || (el.tagName === "SECTION" && !el.hasAttribute("role")))
|
|
172
|
+
el.setAttribute("role", "group");
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
el.setAttribute("aria-label", own ? `${label} · ${own}` : label);
|
|
176
|
+
};
|
|
177
|
+
// The root is the embed's own region and already wears the label; the
|
|
178
|
+
// sweep names what is INSIDE it — a named section is a region too, and
|
|
179
|
+
// the seat is one (FR-40).
|
|
180
|
+
const sweep = () => root.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation]").forEach(name);
|
|
181
|
+
sweep();
|
|
182
|
+
const observer = new MutationObserver(sweep);
|
|
183
|
+
observer.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: ["aria-label"] });
|
|
184
|
+
return () => observer.disconnect();
|
|
185
|
+
}, [label]);
|
|
186
|
+
return { rootRef, scope, css, scheme, store, presence, brand, auto: height === "auto", height };
|
|
187
|
+
}
|
|
188
|
+
/** What the provider under every face is handed from the options, beside the store and the views. */
|
|
189
|
+
export function providerProps(props, presence, brand) {
|
|
190
|
+
return {
|
|
191
|
+
...(brand ? { brand } : {}),
|
|
192
|
+
...(props.principal ? { principal: props.principal } : {}),
|
|
193
|
+
/* The seats, so every surface under the provider names a seat as it was offered (W-114). */
|
|
194
|
+
...(props.seats ? { seats: props.seats } : {}),
|
|
195
|
+
...(presence ? { presence } : {}),
|
|
196
|
+
...(props.people ? { people: props.people } : {}),
|
|
197
|
+
...(props.memory ? { memory: props.memory } : {}),
|
|
198
|
+
...(props.presenceTtlMs !== undefined ? { presenceTtlMs: props.presenceTtlMs } : {}),
|
|
199
|
+
/* The reader's own text size and motion, on somebody else's page
|
|
200
|
+
too: the answer lives on the browser, not on the installation. */
|
|
201
|
+
settings: props.app.settings ?? [],
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* The routed face in the frame. The page scrolls inside the embed's box,
|
|
206
|
+
* unless the embed is sized from its content: then the page is as tall as
|
|
207
|
+
* it is, and the height the host is told is the whole of it.
|
|
208
|
+
*/
|
|
209
|
+
export function PagesContent({ store, auto, brand, views, presence, props, }) {
|
|
210
|
+
return (_jsx("div", { "data-embed-content": "", style: auto ? { flex: "0 0 auto", background: "var(--graview-ground)" } : { flex: "1 1 auto", minHeight: 0, overflow: "auto", background: "var(--graview-ground)" }, children: _jsx("div", { "data-embed-measure": "", style: { display: "flow-root" }, children: _jsx(PagesApp, {
|
|
211
|
+
/*
|
|
212
|
+
* THE SAME PICTURES ON THE ROUTED FACE (FR-35): the registry the
|
|
213
|
+
* scene draws from, so a view registered here is the gallery's
|
|
214
|
+
* card, the list's row and the record's page too.
|
|
215
|
+
*/
|
|
216
|
+
context: {
|
|
217
|
+
store,
|
|
218
|
+
embedded: true,
|
|
219
|
+
views,
|
|
220
|
+
settings: props.app.settings ?? [],
|
|
221
|
+
...(presence ? { presence } : {}),
|
|
222
|
+
...(brand ? { brand } : {}),
|
|
223
|
+
...(props.principal ? { principal: props.principal } : {}),
|
|
224
|
+
...(props.seats ? { seats: props.seats } : {}),
|
|
225
|
+
...(props.people ? { people: props.people } : {}),
|
|
226
|
+
}, ...(props.pages ? { registry: props.pages } : {}), initialPath: props.path ?? "/" }) }) }));
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The strip above the picture: the brand's name, the faces when there are
|
|
230
|
+
* faces to switch between, the scene's own controls on the scene, who is at
|
|
231
|
+
* the keyboard, the seats a host offers, and Standing.
|
|
232
|
+
*/
|
|
233
|
+
export function Strip({ faces, scene, standing, seats, principal, onSeat, }) {
|
|
234
|
+
const { brand } = useGraview();
|
|
235
|
+
const sameSeat = (a, b) => a !== undefined && a.id === b.id && a.kind === b.kind;
|
|
236
|
+
/*
|
|
237
|
+
* COMPACT BELOW A PHONE'S WIDTH: the places and the seats as one select
|
|
238
|
+
* each rather than a pill per name. At 360px the pills wrapped to five
|
|
239
|
+
* rows and the strip was taller than the picture under it.
|
|
240
|
+
*/
|
|
241
|
+
const strip = useRef(null);
|
|
242
|
+
const width = useWidth(strip);
|
|
243
|
+
const compact = width !== null && width < 560;
|
|
244
|
+
return (_jsxs("div", { ref: strip, role: "group", "aria-label": "Face", "data-testid": "embed-faces", "data-embed-strip": compact ? "compact" : "full", style: {
|
|
245
|
+
display: "flex",
|
|
246
|
+
alignItems: "center",
|
|
247
|
+
// Wraps rather than clips: at a phone's width Standing takes the
|
|
248
|
+
// next line instead of losing its last word.
|
|
249
|
+
flexWrap: "wrap",
|
|
250
|
+
gap: 6,
|
|
251
|
+
padding: "8px 12px",
|
|
252
|
+
flex: "0 0 auto",
|
|
253
|
+
borderBottom: "1px solid var(--graview-edge)",
|
|
254
|
+
background: "var(--graview-bar)",
|
|
255
|
+
fontSize: "0.875rem",
|
|
256
|
+
}, children: [_jsx("span", { style: { fontFamily: "var(--graview-font-display)", letterSpacing: "0.12em", textTransform: "uppercase", fontSize: "0.75rem", marginRight: 6 }, children: brand?.name ?? "Graview" }), faces, scene?.(compact), _jsx(Profile, {}), seats && seats.length > 1 && compact ? (_jsx("select", { "aria-label": "Seat", "data-testid": "embed-seats", value: seats.find((seat) => sameSeat(principal, seat.principal))?.principal.id ?? "", onChange: (event) => {
|
|
257
|
+
const seat = seats.find((candidate) => candidate.principal.id === event.target.value);
|
|
258
|
+
if (seat)
|
|
259
|
+
onSeat?.(seat.principal);
|
|
260
|
+
}, style: {
|
|
261
|
+
minHeight: 24,
|
|
262
|
+
maxWidth: "46%",
|
|
263
|
+
padding: "3px 8px",
|
|
264
|
+
borderRadius: 999,
|
|
265
|
+
fontSize: "0.875rem",
|
|
266
|
+
borderWidth: 1,
|
|
267
|
+
borderStyle: "solid",
|
|
268
|
+
borderColor: "var(--graview-accent)",
|
|
269
|
+
color: "var(--graview-accent)",
|
|
270
|
+
background: "var(--graview-panel)",
|
|
271
|
+
}, children: seats.map((seat) => (_jsxs("option", { value: seat.principal.id, children: ["As ", seat.label] }, seat.principal.id))) })) : seats && seats.length > 1 ? (_jsxs("div", { role: "group", "aria-label": "Seat", "data-testid": "embed-seats", style: { display: "flex", alignItems: "center", gap: 6, marginLeft: 6 }, children: [_jsx("span", { style: { fontSize: "0.75rem", letterSpacing: "0.12em", textTransform: "uppercase", color: "var(--graview-ink-faint)" }, children: "As" }), seats.map((seat) => {
|
|
272
|
+
const pressed = sameSeat(principal, seat.principal);
|
|
273
|
+
return (_jsx("button", { type: "button", "aria-pressed": pressed, "data-testid": `embed-seat-${seat.principal.id}`, title: `Sit down as ${seat.label}: the strip, the pages and the acts narrow to what this seat may do`, onClick: () => onSeat?.(seat.principal), style: {
|
|
274
|
+
padding: "3px 11px",
|
|
275
|
+
borderRadius: 999,
|
|
276
|
+
fontSize: "0.875rem",
|
|
277
|
+
borderWidth: 1,
|
|
278
|
+
borderStyle: "solid",
|
|
279
|
+
borderColor: pressed ? "var(--graview-accent)" : "var(--graview-edge)",
|
|
280
|
+
color: pressed ? "var(--graview-accent)" : "var(--graview-ink-muted)",
|
|
281
|
+
background: pressed ? "var(--graview-panel)" : "transparent",
|
|
282
|
+
}, children: seat.label }, seat.principal.id));
|
|
283
|
+
})] })) : null, _jsx("div", { style: { marginLeft: "auto", minWidth: 0 }, children: _jsx(Standing, { clean: standing }) })] }));
|
|
284
|
+
}
|
|
285
|
+
/** An error as a host may keep it: its class, and nothing it says. */
|
|
286
|
+
export function errorClass(error) {
|
|
287
|
+
const name = typeof error === "object" && error !== null ? error.name : undefined;
|
|
288
|
+
return { name: typeof name === "string" && name.length > 0 ? name : typeof error === "object" ? "Error" : typeof error };
|
|
289
|
+
}
|
|
290
|
+
const now = () => (typeof performance !== "undefined" ? performance.now() : Date.now());
|
|
291
|
+
/** The report every boundary under the embed tells, as the host's `onError` with the face it was in. */
|
|
292
|
+
export function useErrorReport(onError, face) {
|
|
293
|
+
const latest = useRef({ onError, face });
|
|
294
|
+
latest.current = { onError, face };
|
|
295
|
+
return useCallback((error, where) => latest.current.onError?.(errorClass(error), { module: where.module, face: latest.current.face }), []);
|
|
296
|
+
}
|
|
297
|
+
/** `onReady`, once: from the first render to the first commit. */
|
|
298
|
+
export function useReady(onReady, face) {
|
|
299
|
+
const start = useRef(null);
|
|
300
|
+
if (start.current === null)
|
|
301
|
+
start.current = now();
|
|
302
|
+
const latest = useRef({ onReady, face });
|
|
303
|
+
latest.current = { onReady, face };
|
|
304
|
+
const fired = useRef(false);
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
if (fired.current)
|
|
307
|
+
return;
|
|
308
|
+
fired.current = true;
|
|
309
|
+
latest.current.onReady?.({ ms: Math.max(0, now() - (start.current ?? now())), face: latest.current.face });
|
|
310
|
+
}, []);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* A PART THAT THROWS STAYS A PART (FR-24). Each face, the strip and the
|
|
314
|
+
* studio's place on it draw behind one of these: what threw says it could
|
|
315
|
+
* not draw, in the framework's words rather than the error's, and offers
|
|
316
|
+
* to try again; everything around it keeps working.
|
|
317
|
+
*/
|
|
318
|
+
export class FaceBoundary extends Component {
|
|
319
|
+
state = { failed: false };
|
|
320
|
+
static getDerivedStateFromError() {
|
|
321
|
+
return { failed: true };
|
|
322
|
+
}
|
|
323
|
+
componentDidCatch(error, info) {
|
|
324
|
+
// The console, for whoever fixes it; the host, told only the class.
|
|
325
|
+
console.error(`[graview] ${this.props.module} threw while rendering`, error, info.componentStack);
|
|
326
|
+
this.props.report(error, { module: this.props.module });
|
|
327
|
+
}
|
|
328
|
+
render() {
|
|
329
|
+
if (!this.state.failed)
|
|
330
|
+
return this.props.children;
|
|
331
|
+
return (_jsxs("div", { role: "alert", "data-graview-face-error": this.props.module, ...(this.props.content ? { "data-embed-content": "" } : {}), style: this.props.content
|
|
332
|
+
? { flex: "1 1 auto", display: "grid", alignContent: "center", justifyItems: "center", gap: 8, padding: 24, background: "var(--graview-ground)", color: "var(--graview-ink)", fontSize: "0.9375rem" }
|
|
333
|
+
: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: "0.8125rem", color: "var(--graview-ink-muted)" }, children: [_jsx("span", { children: this.props.content ? "This part of the app could not draw." : "Could not draw." }), _jsx("button", { type: "button", onClick: () => this.setState({ failed: false }), style: { padding: "3px 11px", fontSize: "0.8125rem" }, children: "Try again" })] }));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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,EAC9F,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAEnH,IACL,CACP,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export { Embed, faceOf,
|
|
2
|
-
export type {
|
|
1
|
+
export { AUTO_SCENE_HEIGHT, Embed, faceOf, mount, mountWhenNear } from "./embed.js";
|
|
2
|
+
export type { EmbedHandle, EmbedOptions, EmbedProps } from "./embed.js";
|
|
3
|
+
export { hostScheme } from "./frame.js";
|
|
4
|
+
export type { EmbedError, EmbedErrorWhere, EmbedFace, EmbedHostContext, EmbedReady, EmbedRemote, FrameOptions } from "./frame.js";
|
|
5
|
+
export type { StudioApplied } from "@graview/studio";
|
|
3
6
|
export { fontsLink, familiesOf } from "./fonts.js";
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACpF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAClI,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { Embed, faceOf,
|
|
1
|
+
export { AUTO_SCENE_HEIGHT, Embed, faceOf, mount, mountWhenNear } from "./embed.js";
|
|
2
|
+
export { hostScheme } from "./frame.js";
|
|
2
3
|
export { fontsLink, familiesOf } from "./fonts.js";
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/pages.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AnySchema, Brand, Person, Principal, Store } from "@graview/core";
|
|
2
|
+
import { type Scheme } from "@graview/react";
|
|
3
|
+
import { type EmbedHostContext, type FrameOptions } from "./frame.js";
|
|
4
|
+
/**
|
|
5
|
+
* THE PAGES AND NOTHING ELSE (FR-19). `@graview/embed/pages` mounts the
|
|
6
|
+
* routed face alone: no scene, no Graview, no studio, no lenses it would
|
|
7
|
+
* never draw. A chat's widget or a phone's page that only ever shows the
|
|
8
|
+
* pages bundles this, and a size budget in CI holds it to that
|
|
9
|
+
* (`scripts/lib/bundle-budget.mjs`).
|
|
10
|
+
*
|
|
11
|
+
* It takes what the whole embed takes except what only the scene has (a
|
|
12
|
+
* face, a stop, the studio, the workbench's heading), and its handle is the
|
|
13
|
+
* same less the faces. It takes `views`: the pages draw the same pictures
|
|
14
|
+
* the scene would (FR-35).
|
|
15
|
+
*/
|
|
16
|
+
export type PagesEmbedOptions<S extends AnySchema = AnySchema> = FrameOptions<S>;
|
|
17
|
+
export interface PagesEmbedProps<S extends AnySchema = AnySchema> extends PagesEmbedOptions<S> {
|
|
18
|
+
/** Called when a seat on the strip is pressed; the host decides who sits. */
|
|
19
|
+
readonly onSeat?: (principal: Principal) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function PagesEmbed<S extends AnySchema>(props: PagesEmbedProps<S>): import("react").JSX.Element;
|
|
22
|
+
export interface PagesEmbedHandle {
|
|
23
|
+
setScheme(scheme: Scheme): void;
|
|
24
|
+
/** Put another principal at the keyboard; the store and its history stay. */
|
|
25
|
+
setSeat(principal: Principal): void;
|
|
26
|
+
/** Offer other seats, or none: a seat switcher is drawn only for two or more. */
|
|
27
|
+
setSeats(seats: PagesEmbedOptions["seats"]): void;
|
|
28
|
+
/** Name other people: an agent who first acts after the page opened is named from the next render. */
|
|
29
|
+
setPeople(people: readonly Person[]): void;
|
|
30
|
+
/** What the host now says about its frame: the chat's theme changed, say. */
|
|
31
|
+
setHostContext(context: EmbedHostContext): void;
|
|
32
|
+
/** Re-dress the embed: another brand, or the same brand with a different kit. */
|
|
33
|
+
setBrand(brand: Brand | undefined): void;
|
|
34
|
+
readonly store: Store<AnySchema>;
|
|
35
|
+
unmount(): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Mounts the pages of an app into an element and hands back the controls.
|
|
39
|
+
* The first render is synchronous, so what comes back is already on the page.
|
|
40
|
+
*/
|
|
41
|
+
export declare function mount<S extends AnySchema>(element: HTMLElement, options: PagesEmbedOptions<S>): PagesEmbedHandle;
|
|
42
|
+
export { hostScheme } from "./frame.js";
|
|
43
|
+
export type { EmbedError, EmbedErrorWhere, EmbedHostContext, EmbedReady, EmbedRemote } from "./frame.js";
|
|
44
|
+
//# sourceMappingURL=pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../src/pages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAuC,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIlF,OAAO,EAA+H,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnM;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAC5F,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,+BAkCxE;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6EAA6E;IAC7E,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAClD,sGAAsG;IACtG,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3C,6EAA6E;IAC7E,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChD,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CA4ChH;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/pages.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorReportContext, GraviewProvider } from "@graview/react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
import { flushSync } from "react-dom";
|
|
6
|
+
import { FaceBoundary, PagesContent, providerProps, storeOf, Strip, useErrorReport, useFrame, useIntrinsicHeight, useReady, useViews } from "./frame.js";
|
|
7
|
+
export function PagesEmbed(props) {
|
|
8
|
+
const { app, toggle = true, standing = "Everything is in order" } = props;
|
|
9
|
+
const { rootRef, scope, css, scheme, store, presence, brand, auto, height } = useFrame(props);
|
|
10
|
+
// The registry the whole embed would draw from: the pages' cards, rows and record pages (FR-35).
|
|
11
|
+
const views = useViews(props);
|
|
12
|
+
useIntrinsicHeight(rootRef, "pages", props.onIntrinsicHeight);
|
|
13
|
+
const report = useErrorReport(props.onError, "pages");
|
|
14
|
+
useReady(props.onReady, "pages");
|
|
15
|
+
return (_jsxs("section", { ref: rootRef, className: scope, "aria-label": props.label ?? app.name, "data-graview-embed": "pages", "data-graview-scheme": scheme, style: { position: "relative", height, minHeight: auto ? 0 : 320, display: "flex", flexDirection: "column", overflow: "hidden", borderRadius: "var(--graview-radius, 12px)" }, children: [_jsx("style", { children: css }), _jsx(ErrorReportContext.Provider, { value: report, children: _jsx(FaceBoundary, { module: "@graview/react", report: report, content: true, children: _jsxs(GraviewProvider, { store: store, views: views, scheme: scheme, ...providerProps(props, presence, brand), children: [toggle ? (_jsx(FaceBoundary, { module: "@graview/embed", report: report, children: _jsx(Strip, { standing: standing, seats: props.seats, principal: props.principal, onSeat: props.onSeat }) })) : null, _jsx(FaceBoundary, { module: "@graview/pages", report: report, content: true, children: _jsx(PagesContent, { store: store, views: views, presence: presence, auto: auto, brand: brand, props: props }) })] }) }) })] }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Mounts the pages of an app into an element and hands back the controls.
|
|
19
|
+
* The first render is synchronous, so what comes back is already on the page.
|
|
20
|
+
*/
|
|
21
|
+
export function mount(element, options) {
|
|
22
|
+
const store = options.store ?? options.remote?.store ?? storeOf(options.app, options.seed);
|
|
23
|
+
let set = null;
|
|
24
|
+
function Host() {
|
|
25
|
+
const [scheme, setScheme] = useState(options.scheme ?? "auto");
|
|
26
|
+
const [principal, setSeat] = useState(options.principal);
|
|
27
|
+
const [seats, setSeats] = useState(options.seats);
|
|
28
|
+
const [people, setPeople] = useState(options.people);
|
|
29
|
+
const [hostContext, setHostContext] = useState(options.hostContext);
|
|
30
|
+
const [brand, setBrand] = useState(options.brand);
|
|
31
|
+
set = { scheme: setScheme, seat: setSeat, seats: setSeats, people: setPeople, hostContext: setHostContext, brand: setBrand };
|
|
32
|
+
return (_jsx(PagesEmbed, { ...options, store: store, ...(principal ? { principal } : {}), ...(seats ? { seats } : {}), ...(people ? { people } : {}), ...(hostContext ? { hostContext } : {}), ...(brand ? { brand } : {}), scheme: scheme, onSeat: setSeat }));
|
|
33
|
+
}
|
|
34
|
+
const root = createRoot(element);
|
|
35
|
+
flushSync(() => root.render(_jsx(Host, {})));
|
|
36
|
+
return {
|
|
37
|
+
store: store,
|
|
38
|
+
setScheme: (scheme) => flushSync(() => set?.scheme(scheme)),
|
|
39
|
+
setSeat: (principal) => flushSync(() => set?.seat(principal)),
|
|
40
|
+
setSeats: (seats) => flushSync(() => set?.seats(seats)),
|
|
41
|
+
setPeople: (people) => flushSync(() => set?.people(people)),
|
|
42
|
+
setHostContext: (context) => flushSync(() => set?.hostContext(context)),
|
|
43
|
+
setBrand: (brand) => flushSync(() => set?.brand(brand)),
|
|
44
|
+
unmount: () => root.unmount(),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export { hostScheme } from "./frame.js";
|
|
48
|
+
//# sourceMappingURL=pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../src/pages.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAe,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAA4C,MAAM,YAAY,CAAC;AAqBnM,MAAM,UAAU,UAAU,CAAsB,KAAyB;IACvE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,GAAG,wBAAwB,EAAE,GAAG,KAAK,CAAC;IAC1E,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,C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C,KAAK,CAAC,CAAC;QACvD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3D,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACvD,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;KAC9B,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graview/embed",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mount a declared Graview app into any element — the scene, the Graview, or the routed pages — without the Shell, sized and themed within the element.",
|
|
6
6
|
"keywords": [
|
|
@@ -18,16 +18,20 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./pages": {
|
|
23
|
+
"types": "./dist/pages.d.ts",
|
|
24
|
+
"default": "./dist/pages.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"dependencies": {
|
|
24
|
-
"@graview/core": "0.1.
|
|
25
|
-
"@graview/
|
|
26
|
-
"@graview/primitives": "0.1.
|
|
27
|
-
"@graview/react": "0.1.
|
|
28
|
-
"@graview/
|
|
29
|
-
"@graview/
|
|
30
|
-
"@graview/
|
|
28
|
+
"@graview/core": "0.1.3",
|
|
29
|
+
"@graview/layout": "0.1.3",
|
|
30
|
+
"@graview/primitives": "0.1.3",
|
|
31
|
+
"@graview/react": "0.1.3",
|
|
32
|
+
"@graview/pages": "0.1.3",
|
|
33
|
+
"@graview/studio": "0.1.3",
|
|
34
|
+
"@graview/tools": "0.1.3"
|
|
31
35
|
},
|
|
32
36
|
"peerDependencies": {
|
|
33
37
|
"react": ">=18",
|