@hueest/xray 0.1.0 → 0.3.0
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/client.d.ts +64 -16
- package/dist/client.js +903 -72
- package/dist/core.d.ts +21 -27
- package/dist/core.js +39 -210
- package/dist/css-escape-N7bOusGW.js +52 -0
- package/dist/hud.js +46 -0
- package/dist/index.d.ts +297 -48
- package/dist/index.js +674 -353
- package/dist/plate-BIr62u7l.d.ts +363 -0
- package/dist/plate-BRR6d8Se.js +156 -0
- package/dist/project-DORoPAo7.js +10224 -0
- package/dist/react.core-BUj8ziwh.d.ts +79 -0
- package/dist/react.core-DMIhXHZF.js +272 -0
- package/dist/react.d.ts +2 -8
- package/dist/react.dev.d.ts +2 -9
- package/dist/react.dev.js +153 -23
- package/dist/react.js +24 -12
- package/dist/serialize-Cs7hUxmK.d.ts +107 -0
- package/package.json +8 -7
- package/virtual.d.ts +6 -0
- package/dist/breakpoints-CBNlh7lQ.js +0 -47
- package/dist/plate-BuzRMPx4.js +0 -94
- package/dist/plate-DboxMKg-.d.ts +0 -196
- package/dist/react.core-CqnDjfAJ.js +0 -59
- package/dist/react.core-fgWG_svU.d.ts +0 -21
- package/dist/serialize-Bq6yJnNV.js +0 -1071
- package/dist/serialize.d.ts +0 -88
- package/dist/serialize.js +0 -2
package/dist/client.d.ts
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as CaptureDiagnostic, o as StoredPlate } from "./plate-BIr62u7l.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* The dev capture client (M2). Runs in the browser during dev only: installs
|
|
6
|
-
* the `__XRAY__` hook `<Skeleton>` calls when content becomes ready,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* the `__XRAY__` hook `<Skeleton>` calls when content becomes ready, settles,
|
|
7
|
+
* measures the subtree into a per-Plate `PlateIR`, projects it to the structured
|
|
8
|
+
* `StoredPlate` in the browser (the ADR 0022 in-browser Serialize), and hands the
|
|
9
|
+
* envelope to the sink (the plugin's POST endpoint). Re-captures when the viewport
|
|
9
10
|
* crosses into another view while a site is still mounted.
|
|
11
|
+
*
|
|
12
|
+
* Two paths produce a Plate. BROWSE-TIME is a RECORDING SESSION (the Capture toggle):
|
|
13
|
+
* while on, each capture accumulates a View into a name-keyed `PlateIR` buffer
|
|
14
|
+
* (deduped per breakpoint band) and live-previews it in-memory; toggling off writes
|
|
15
|
+
* each accumulated Plate to the sink ONCE. The capture-all SWEEP threads ONE `PlateIR`
|
|
16
|
+
* through every emulated width (one View each) and posts the projected StoredPlate once.
|
|
10
17
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The `/__xray` POST envelope (ADR 0022 cutover). `plate` is the finished,
|
|
20
|
+
* in-browser-projected `StoredPlate` written to disk as-is; `diagnostics` is a
|
|
21
|
+
* SIBLING dev-only field the server logs and drops — it NEVER reaches the stored
|
|
22
|
+
* artifact (ADR 0008).
|
|
23
|
+
*/
|
|
24
|
+
interface CaptureEnvelope {
|
|
25
|
+
plate: StoredPlate;
|
|
26
|
+
diagnostics?: CaptureDiagnostic[];
|
|
17
27
|
}
|
|
18
28
|
interface ClientOptions {
|
|
19
29
|
/** Settle delay (ms) once the subtree goes quiet. Default 200. */
|
|
@@ -29,14 +39,52 @@ interface ClientOptions {
|
|
|
29
39
|
*/
|
|
30
40
|
maxNodes?: number;
|
|
31
41
|
/**
|
|
32
|
-
* Initial state of the capture toggle: whether
|
|
33
|
-
* A per-tab override (sessionStorage / `?xray-capture`) wins over it.
|
|
34
|
-
* Defaults to `
|
|
42
|
+
* Initial state of the capture toggle: whether the recording session is active
|
|
43
|
+
* at boot. A per-tab override (sessionStorage / `?xray-capture`) wins over it.
|
|
44
|
+
* Defaults to `false` — recording is explicit opt-in (turn it on, browse/resize to
|
|
45
|
+
* accumulate Views, turn it off to write), so normal browsing never accumulates and
|
|
46
|
+
* an HMR/close can't drop an unsaved recording. The plugin passes the same
|
|
47
|
+
* off-by-default policy; a direct caller can pass `true` to capture on boot.
|
|
35
48
|
*/
|
|
36
49
|
capture?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Where finished captures go. May be synchronous (fire-and-forget) or return
|
|
52
|
+
* a promise that resolves once the write is server-confirmed. Browse-time
|
|
53
|
+
* capture ignores the return value; the capture-all sweep awaits it so it
|
|
54
|
+
* does not advance to the next emulated width until the current writes have
|
|
55
|
+
* been accepted by the dev server (backpressure — capture-all-backpressure plan).
|
|
56
|
+
*/
|
|
57
|
+
sink: (envelope: CaptureEnvelope) => void | Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Re-pull the on-disk per-plate coverage and feed it into the coverage store.
|
|
60
|
+
* The capture-all sweep calls this after each pass so the next `sweepWidths()`
|
|
61
|
+
* sees the breakpoints just written by that pass, rather than racing the
|
|
62
|
+
* async `xray:plate` HMR event (coverage freshness — capture-all-backpressure
|
|
63
|
+
* plan). Optional: browse-time capture never needs it, and the unit tests
|
|
64
|
+
* drive coverage directly through the store.
|
|
65
|
+
*/
|
|
66
|
+
refreshCoverage?: () => void | Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Fixtures boot state (ADR 0015). `record` is when to write the live `data` to a
|
|
69
|
+
* sidecar (`'manual'` — HUD button only, the default; `'first-ready'`; or
|
|
70
|
+
* `'always'`); `replay` is whether to substitute a recorded Fixture for live
|
|
71
|
+
* `data` (`false`, `'prefer'`, or `'missing-only'`). The HUD overrides the
|
|
72
|
+
* replay toggle per tab. Absent ≡ defaults (`'manual'` / `false`).
|
|
73
|
+
*/
|
|
74
|
+
record?: 'manual' | 'first-ready' | 'always';
|
|
75
|
+
replay?: false | 'prefer' | 'missing-only';
|
|
76
|
+
/**
|
|
77
|
+
* Where a recorded Fixture's OPAQUE devalue string is POSTed (the sidecar write
|
|
78
|
+
* endpoint). The client owns the devalue stringify; this only ships the bytes.
|
|
79
|
+
* Resolves once the write is server-confirmed, rejects on a non-2xx so the HUD
|
|
80
|
+
* Record button can surface a failed write. Absent ≡ Record is a no-op (the
|
|
81
|
+
* unit tests inject their own).
|
|
82
|
+
*/
|
|
83
|
+
recordFixtureSink?: (payload: {
|
|
84
|
+
name: string;
|
|
85
|
+
data: string;
|
|
86
|
+
}) => void | Promise<void>;
|
|
39
87
|
}
|
|
40
88
|
declare function installXrayClient(options: ClientOptions): () => void;
|
|
41
89
|
//#endregion
|
|
42
|
-
export {
|
|
90
|
+
export { CaptureEnvelope, ClientOptions, installXrayClient };
|