@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.
@@ -1,88 +0,0 @@
1
- import { n as MergedPlate, s as ViewCapture, t as LeafKind } from "./plate-DboxMKg-.js";
2
-
3
- //#region src/serialize.d.ts
4
- /**
5
- * Browser-side capture: walk a live rendered subtree into a Plate — one node
6
- * tree plus one self-contained, scoped CSS string (ADR 0003). The CSS is
7
- * lifted from the author rules that matched each node, rewritten to
8
- * plate-local selectors — it carries `@media` for free and keeps layout live
9
- * (the M1 bake-off winner; ADR 0005).
10
- */
11
- interface CaptureOptions {
12
- /** Plate name; comes from the virtual-module specifier. */
13
- name: string;
14
- }
15
- /**
16
- * Capture the rendered subtree(s) under a Skeleton into a Plate. `roots` are
17
- * the component's top-level elements (the children of the layout-neutral
18
- * wrapper); the synthetic root node (id 0) stands in for the wrapper itself.
19
- */
20
- declare function capture(roots: readonly Element[], options: CaptureOptions): MergedPlate;
21
- /**
22
- * Thrown when a subtree has more nodes than the capture limit — almost always
23
- * a `<Skeleton>` sitting too high in the tree. Raised after the cheap walk and
24
- * before the O(rules × nodes) CSS extraction, so an oversized capture is
25
- * refused without freezing the main thread on it.
26
- */
27
- declare class CaptureTooLargeError extends Error {
28
- readonly nodeCount: number;
29
- constructor(nodeCount: number);
30
- }
31
- interface CaptureRegimeOptions {
32
- /** Refuse (throw `CaptureTooLargeError`) before CSS extraction if the walk exceeds this. */
33
- maxNodes?: number;
34
- }
35
- /**
36
- * Capture one view's worth of a component: the tree plus id-form rules,
37
- * with the viewport width it was taken at. The caller (the dev client)
38
- * derives the view interval and ships it off; `capture` is the
39
- * single-view convenience on top.
40
- */
41
- declare function captureRegime(roots: readonly Element[], options?: CaptureRegimeOptions): ViewCapture;
42
- /** One measurement per walked node, ids matching what `capture` assigns. */
43
- interface AuditEntry {
44
- id: number;
45
- tag: string;
46
- leaf?: LeafKind;
47
- w: number;
48
- h: number;
49
- }
50
- /**
51
- * Walk a live subtree exactly like `capture` does, but return per-node
52
- * geometry instead of a plate. Rendering the captured plate and auditing both
53
- * sides gives an id-aligned fidelity diff (used by the M1 bake-off).
54
- */
55
- declare function audit(roots: readonly Element[]): AuditEntry[];
56
- /**
57
- * Shrink a text run's measured box to what's actually painted. A `Range`'s
58
- * rect is the text's full geometry and ignores ancestor clipping, so a
59
- * `-webkit-line-clamp` box (fewer lines than the text fills) or a single-line
60
- * `text-overflow: ellipsis` (`white-space: nowrap; overflow: hidden`) makes the
61
- * bar over-measure — a 2-line title bone rendered at its unclamped 5-line
62
- * height. Painted text can't exceed any clipping ancestor's content box, so we
63
- * intersect with each: per axis the ancestor clips (`overflow !== visible`),
64
- * clamp to its content box. A non-clipping or larger ancestor leaves it be, so
65
- * unclamped text is untouched. Walks to the root since the clamp may sit a few
66
- * inline wrappers up from the text node.
67
- */
68
- interface ClippingStyle {
69
- overflowX: string;
70
- overflowY: string;
71
- paddingTop: string;
72
- paddingBottom: string;
73
- paddingLeft: string;
74
- paddingRight: string;
75
- borderTopWidth: string;
76
- borderBottomWidth: string;
77
- borderLeftWidth: string;
78
- borderRightWidth: string;
79
- }
80
- interface ClippingWindow {
81
- getComputedStyle(element: Element): ClippingStyle;
82
- }
83
- declare function clampToClipping(width: number, height: number, fromParent: Element | null, win: ClippingWindow): {
84
- width: number;
85
- height: number;
86
- };
87
- //#endregion
88
- export { AuditEntry, CaptureOptions, CaptureRegimeOptions, CaptureTooLargeError, audit, capture, captureRegime, clampToClipping };
package/dist/serialize.js DELETED
@@ -1,2 +0,0 @@
1
- import { a as clampToClipping, i as captureRegime, n as audit, r as capture, t as CaptureTooLargeError } from "./serialize-Bq6yJnNV.js";
2
- export { CaptureTooLargeError, audit, capture, captureRegime, clampToClipping };