@juxtapose/core 0.4.0 → 0.6.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.
Files changed (153) hide show
  1. package/dist/agent/handoff.d.ts +8 -1
  2. package/dist/agent/handoff.js +75 -7
  3. package/dist/agent/handoff.js.map +1 -1
  4. package/dist/analysis/affected.d.ts +37 -0
  5. package/dist/analysis/affected.js +97 -22
  6. package/dist/analysis/affected.js.map +1 -1
  7. package/dist/analysis/cause.d.ts +32 -0
  8. package/dist/analysis/cause.js +187 -0
  9. package/dist/analysis/cause.js.map +1 -0
  10. package/dist/baseline/approve.d.ts +24 -0
  11. package/dist/baseline/approve.js +54 -0
  12. package/dist/baseline/approve.js.map +1 -0
  13. package/dist/baseline/git-store.d.ts +4 -0
  14. package/dist/baseline/git-store.js +22 -0
  15. package/dist/baseline/git-store.js.map +1 -1
  16. package/dist/browser/acquire.d.ts +15 -0
  17. package/dist/browser/acquire.js +26 -0
  18. package/dist/browser/acquire.js.map +1 -0
  19. package/dist/browser/browser.d.ts +53 -0
  20. package/dist/browser/browser.js +122 -0
  21. package/dist/browser/browser.js.map +1 -0
  22. package/dist/browser/cdp.d.ts +81 -0
  23. package/dist/browser/cdp.js +230 -0
  24. package/dist/browser/cdp.js.map +1 -0
  25. package/dist/browser/daemon/client.d.ts +145 -0
  26. package/dist/browser/daemon/client.js +764 -0
  27. package/dist/browser/daemon/client.js.map +1 -0
  28. package/dist/browser/daemon/state.d.ts +99 -0
  29. package/dist/browser/daemon/state.js +297 -0
  30. package/dist/browser/daemon/state.js.map +1 -0
  31. package/dist/browser/daemon/supervisor-main.d.ts +1 -0
  32. package/dist/browser/daemon/supervisor-main.js +54 -0
  33. package/dist/browser/daemon/supervisor-main.js.map +1 -0
  34. package/dist/browser/daemon/supervisor.d.ts +37 -0
  35. package/dist/browser/daemon/supervisor.js +777 -0
  36. package/dist/browser/daemon/supervisor.js.map +1 -0
  37. package/dist/{capture/launch.d.ts → browser/flags.d.ts} +19 -1
  38. package/dist/browser/flags.js +146 -0
  39. package/dist/browser/flags.js.map +1 -0
  40. package/dist/browser/index.d.ts +14 -0
  41. package/dist/browser/index.js +14 -0
  42. package/dist/browser/index.js.map +1 -0
  43. package/dist/browser/install.d.ts +33 -0
  44. package/dist/browser/install.js +167 -0
  45. package/dist/browser/install.js.map +1 -0
  46. package/dist/browser/launch.d.ts +37 -0
  47. package/dist/browser/launch.js +254 -0
  48. package/dist/browser/launch.js.map +1 -0
  49. package/dist/browser/page.d.ts +125 -0
  50. package/dist/browser/page.js +564 -0
  51. package/dist/browser/page.js.map +1 -0
  52. package/dist/browser/pins.d.ts +12 -0
  53. package/dist/browser/pins.js +57 -0
  54. package/dist/browser/pins.js.map +1 -0
  55. package/dist/browser/private-dir.d.ts +7 -0
  56. package/dist/browser/private-dir.js +24 -0
  57. package/dist/browser/private-dir.js.map +1 -0
  58. package/dist/browser/resolve.d.ts +31 -0
  59. package/dist/browser/resolve.js +126 -0
  60. package/dist/browser/resolve.js.map +1 -0
  61. package/dist/browser/selectors.d.ts +10 -0
  62. package/dist/browser/selectors.js +60 -0
  63. package/dist/browser/selectors.js.map +1 -0
  64. package/dist/browser/transport.d.ts +51 -0
  65. package/dist/browser/transport.js +124 -0
  66. package/dist/browser/transport.js.map +1 -0
  67. package/dist/browser/types.d.ts +4 -0
  68. package/dist/browser/types.js +2 -0
  69. package/dist/browser/types.js.map +1 -0
  70. package/dist/browser/zip.d.ts +27 -0
  71. package/dist/browser/zip.js +241 -0
  72. package/dist/browser/zip.js.map +1 -0
  73. package/dist/capture/capture.d.ts +7 -1
  74. package/dist/capture/capture.js +25 -8
  75. package/dist/capture/capture.js.map +1 -1
  76. package/dist/capture/env.d.ts +1 -1
  77. package/dist/capture/pool.d.ts +1 -1
  78. package/dist/capture/pool.js +41 -8
  79. package/dist/capture/pool.js.map +1 -1
  80. package/dist/capture/settle.d.ts +1 -1
  81. package/dist/capture/settle.js +2 -0
  82. package/dist/capture/settle.js.map +1 -1
  83. package/dist/capture/snap.d.ts +43 -0
  84. package/dist/capture/snap.js +103 -0
  85. package/dist/capture/snap.js.map +1 -0
  86. package/dist/capture/structure.d.ts +77 -0
  87. package/dist/capture/structure.js +498 -0
  88. package/dist/capture/structure.js.map +1 -0
  89. package/dist/diff/compare.d.ts +19 -0
  90. package/dist/diff/compare.js +19 -0
  91. package/dist/diff/compare.js.map +1 -0
  92. package/dist/diff/crops.d.ts +26 -0
  93. package/dist/diff/crops.js +92 -0
  94. package/dist/diff/crops.js.map +1 -0
  95. package/dist/diff/structural/classify.d.ts +29 -0
  96. package/dist/diff/structural/classify.js +113 -0
  97. package/dist/diff/structural/classify.js.map +1 -0
  98. package/dist/diff/structural/coverage.d.ts +11 -0
  99. package/dist/diff/structural/coverage.js +37 -0
  100. package/dist/diff/structural/coverage.js.map +1 -0
  101. package/dist/diff/structural/deltas.d.ts +29 -0
  102. package/dist/diff/structural/deltas.js +218 -0
  103. package/dist/diff/structural/deltas.js.map +1 -0
  104. package/dist/diff/structural/disambiguate.d.ts +3 -0
  105. package/dist/diff/structural/disambiguate.js +89 -0
  106. package/dist/diff/structural/disambiguate.js.map +1 -0
  107. package/dist/diff/structural/label.d.ts +15 -0
  108. package/dist/diff/structural/label.js +64 -0
  109. package/dist/diff/structural/label.js.map +1 -0
  110. package/dist/diff/structural/match.d.ts +13 -0
  111. package/dist/diff/structural/match.js +135 -0
  112. package/dist/diff/structural/match.js.map +1 -0
  113. package/dist/diff/structural/shift.d.ts +2 -0
  114. package/dist/diff/structural/shift.js +144 -0
  115. package/dist/diff/structural/shift.js.map +1 -0
  116. package/dist/diff/structural/summary.d.ts +31 -0
  117. package/dist/diff/structural/summary.js +420 -0
  118. package/dist/diff/structural/summary.js.map +1 -0
  119. package/dist/diff/structural.d.ts +40 -0
  120. package/dist/diff/structural.js +219 -0
  121. package/dist/diff/structural.js.map +1 -0
  122. package/dist/index.d.ts +28 -4
  123. package/dist/index.js +32 -3
  124. package/dist/index.js.map +1 -1
  125. package/dist/platform.d.ts +1 -1
  126. package/dist/platforms/urls.d.ts +3 -0
  127. package/dist/platforms/urls.js +89 -0
  128. package/dist/platforms/urls.js.map +1 -0
  129. package/dist/report/comment.js +9 -3
  130. package/dist/report/comment.js.map +1 -1
  131. package/dist/report/format.d.ts +18 -0
  132. package/dist/report/format.js +20 -0
  133. package/dist/report/format.js.map +1 -1
  134. package/dist/report/html.js +2 -2
  135. package/dist/report/html.js.map +1 -1
  136. package/dist/run/groups.d.ts +2 -0
  137. package/dist/run/groups.js +45 -0
  138. package/dist/run/groups.js.map +1 -0
  139. package/dist/run/run.d.ts +6 -2
  140. package/dist/run/run.js +74 -6
  141. package/dist/run/run.js.map +1 -1
  142. package/dist/shell-quote.d.ts +2 -0
  143. package/dist/shell-quote.js +10 -0
  144. package/dist/shell-quote.js.map +1 -0
  145. package/dist/types.d.ts +201 -5
  146. package/dist/types.js +0 -2
  147. package/dist/types.js.map +1 -1
  148. package/dist/url-platform.d.ts +2 -2
  149. package/dist/url-platform.js +2 -2
  150. package/dist/url-platform.js.map +1 -1
  151. package/package.json +6 -10
  152. package/dist/capture/launch.js +0 -56
  153. package/dist/capture/launch.js.map +0 -1
@@ -0,0 +1,144 @@
1
+ // "Everything below the banner moved down 14px because the banner grew 14px"
2
+ // is one fact, not forty. Collapse a run of ≥3 matched elements that moved by
3
+ // the same (dx, dy), contiguous in document order, into one `shift` anchored
4
+ // on the element that explains it (see `collapse`).
5
+ //
6
+ // The anchor set is wider than the spec's added/removed/resized: a margin or
7
+ // line-height change moves everything after it without resizing anything the
8
+ // LCS can see, and leaving those as 40 `moved` deltas defeats the purpose.
9
+ import { compareCodeUnits, sortFacts } from './deltas.js';
10
+ const MIN_RUN = 3;
11
+ export function synthesizeShifts(facts) {
12
+ const anchors = facts.filter((f) => f.delta.kind !== 'moved' && f.delta.kind !== 'shift');
13
+ const moved = facts.filter((f) => f.delta.kind === 'moved');
14
+ if (moved.length < MIN_RUN)
15
+ return facts;
16
+ // Group by displacement, keeping document order within a group.
17
+ const groups = new Map();
18
+ for (const f of moved) {
19
+ const d = f.delta;
20
+ const key = `${d.dx},${d.dy}`;
21
+ const g = groups.get(key);
22
+ if (g)
23
+ g.push(f);
24
+ else
25
+ groups.set(key, [f]);
26
+ }
27
+ // A fact's position among all moves, in document order: two members of a
28
+ // group are adjacent exactly when no move with another displacement sits
29
+ // between them (unmoved elements in between — sticky headers, absolutes —
30
+ // do not break a run).
31
+ const pos = new Map(moved.map((f, k) => [f, k]));
32
+ const anchorOrders = anchors.map((f) => f.order); // ascending: facts are sorted
33
+ const collapsed = new Set();
34
+ const shifts = [];
35
+ // Deterministic: iterate groups by key, not by insertion.
36
+ for (const key of [...groups.keys()].sort(compareCodeUnits)) {
37
+ const g = groups.get(key);
38
+ // A different move inside a group splits it rather than vetoing it: in
39
+ // `font-size` the logo slides right between the button and the rows, and
40
+ // the six elements below still moved up together. So does another cause
41
+ // between two members: rows below a second removal moved because of that
42
+ // removal, not the first, so "480 elements after the first" would blame
43
+ // the wrong element (measured on the 50-section perf tree).
44
+ let start = 0;
45
+ for (let k = 1; k <= g.length; k++) {
46
+ if (k < g.length &&
47
+ pos.get(g[k]) === pos.get(g[k - 1]) + 1 &&
48
+ !causeBetween(anchorOrders, g[k - 1].order, g[k].order))
49
+ continue;
50
+ const run = g.slice(start, k);
51
+ start = k;
52
+ const shift = run.length >= MIN_RUN ? collapse(run, anchors, moved) : undefined;
53
+ if (!shift)
54
+ continue;
55
+ for (const f of run)
56
+ collapsed.add(f);
57
+ shifts.push(shift);
58
+ }
59
+ }
60
+ if (shifts.length === 0)
61
+ return facts;
62
+ return sortFacts([...facts.filter((f) => !collapsed.has(f)), ...shifts]);
63
+ }
64
+ /** One contiguous run as a shift on what explains it; nothing means the
65
+ * move stays as moves. In order of preference:
66
+ *
67
+ * 1. A move with another displacement that crossed the run — before it in
68
+ * the baseline, after it now, or the reverse. That is a reorder: moving
69
+ * item 3 to slot 9 of 12 moves items 4–9 up 37px each, and item 3 (the
70
+ * only thing the author touched) sits after them in the current order,
71
+ * so "nearest preceding" can never find it. Measured on the 12-item
72
+ * probe: before this, the six −37px moves stayed six (no anchor) and
73
+ * item 3's `moved down 222px` was the 8th line.
74
+ * 2. The nearest preceding element that changed in another way.
75
+ * 3. The nearest preceding move with another displacement.
76
+ *
77
+ * (1) and (3) take the head of the anchor's own block of equal moves, so the
78
+ * shift names the list item, not the `span` inside it that moved with it.
79
+ * (2) is ahead of (3) because a nearer odd move is usually a consequence of
80
+ * the same cause: in `inserted` the logo drops off the button's line between
81
+ * the banner and the rows, and the rows moved because of the banner. */
82
+ function collapse(run, anchors, moved) {
83
+ const first = run[0];
84
+ const last = run[run.length - 1];
85
+ const d = first.delta;
86
+ const other = moved.filter((f) => {
87
+ const m = f.delta;
88
+ return m.dx !== d.dx || m.dy !== d.dy;
89
+ });
90
+ const base = (f) => f.source.index; // moves are matched: baseline side
91
+ const crossed = other
92
+ .filter((f) => (base(f) < base(first) && f.order > last.order) ||
93
+ (base(f) > base(last) && f.order < first.order))
94
+ .sort((x, y) => base(x) - base(y));
95
+ const preceding = (fs) => fs.filter((f) => f.order < first.order).at(-1);
96
+ const anchor = (crossed[0] && headOf(crossed[0], moved)) ??
97
+ preceding(anchors) ??
98
+ (preceding(other) && headOf(preceding(other), moved));
99
+ if (!anchor)
100
+ return undefined;
101
+ return {
102
+ delta: {
103
+ kind: 'shift',
104
+ after: 'el' in anchor.delta ? anchor.delta.el : anchor.delta.after,
105
+ dx: d.dx,
106
+ dy: d.dy,
107
+ count: run.length,
108
+ },
109
+ rects: run.flatMap((f) => f.rects),
110
+ abstract: anchor.abstract,
111
+ order: anchor.order + 0.25,
112
+ source: anchor.source,
113
+ };
114
+ }
115
+ /** The first of the moves contiguous (in document order) with `f` that
116
+ * share its displacement: an element and the descendants that moved with it
117
+ * read as the element. */
118
+ function headOf(f, moved) {
119
+ const m = f.delta;
120
+ let k = moved.indexOf(f);
121
+ while (k > 0) {
122
+ const p = moved[k - 1].delta;
123
+ if (p.dx !== m.dx || p.dy !== m.dy)
124
+ break;
125
+ k--;
126
+ }
127
+ return moved[k];
128
+ }
129
+ /** Some anchor sits strictly between two run members. An anchor at a
130
+ * member's own position (a moved row whose text also changed) is part of
131
+ * the run, not a new cause. */
132
+ function causeBetween(orders, lo, hi) {
133
+ let a = 0;
134
+ let b = orders.length;
135
+ while (a < b) {
136
+ const m = (a + b) >> 1;
137
+ if (orders[m] <= lo)
138
+ a = m + 1;
139
+ else
140
+ b = m;
141
+ }
142
+ return a < orders.length && orders[a] < hi;
143
+ }
144
+ //# sourceMappingURL=shift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shift.js","sourceRoot":"","sources":["../../../src/diff/structural/shift.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,oDAAoD;AACpD,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAG3E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAa,MAAM,aAAa,CAAC;AAErE,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAC5D,CAAC;IACF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO;QAAE,OAAO,KAAK,CAAC;IAEzC,gEAAgE;IAChE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;Q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EAAE,EAAU;IAC5D,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE;YAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;;YAC1B,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { ChangedRegion, Classification, Delta, Flag, StructureSnapshot, StyleTag } from '../../types.js';
2
+ export declare const MAX_SUMMARY = 300;
3
+ /** `change`: the summary's lead clauses without the per-story tail. */
4
+ export declare const MAX_CHANGE = 160;
5
+ export declare function describeDelta(d: Delta): string;
6
+ /** The deltas as indented display lines for a human, grouped by element:
7
+ * the element's content changes (four-side longhands collapsed), then its
8
+ * resize and move on one line. Groups run causes first — content, added and
9
+ * removed, and a move a shift is blamed on; then shifts; then other moves;
10
+ * then resizes, so an ancestor's consequential `resized` comes last. Every
11
+ * delta passed in is stated on some line; `total` is the verdict's
12
+ * `deltaCount`, which says whether `deltas` is the whole set. */
13
+ export declare function describeDeltas(deltas: Delta[], total?: number): string[];
14
+ export interface SummaryArgs {
15
+ classification: Classification;
16
+ styleTags: StyleTag[];
17
+ deltas: Delta[];
18
+ deltaCount: number;
19
+ regionCount: number;
20
+ unexplainedRegions: ChangedRegion[];
21
+ flags: Flag[];
22
+ imagesIdentical: boolean;
23
+ baseline?: StructureSnapshot;
24
+ current?: StructureSnapshot;
25
+ }
26
+ /** The change alone, for naming what several stories share: the summary's
27
+ * own clause wording with every element reduced to its role|tag (the
28
+ * caller passes `deltas` already abstracted), no coverage or tolerance
29
+ * tail, at most two clauses. */
30
+ export declare function buildChange(a: SummaryArgs): string;
31
+ export declare function buildSummary(a: SummaryArgs): string;
@@ -0,0 +1,420 @@
1
+ // Deterministic prose. No model, no adjectives: the classification, the
2
+ // changes that caused it, and whether they account for the pixels. 300 chars,
3
+ // met by construction: labels and values are capped, the tail is reserved
4
+ // first, and each clause has shorter forms down to `el prop changed`, so the
5
+ // hard cut at the end is a backstop no input reaches.
6
+ //
7
+ // The summary is the line an agent reads first, so it leads with causes
8
+ // (text, attr, style, added, removed) and only then consequences (shift,
9
+ // resize, move). Fact order is document order, which puts `main resized` —
10
+ // a consequence of every reflow — first; read as-is, five of the 18 corpus
11
+ // summaries opened with it and the actual change came second or third.
12
+ import { selfPaintingAt } from './classify.js';
13
+ import { clip, label } from './label.js';
14
+ export const MAX_SUMMARY = 300;
15
+ /** `change`: the summary's lead clauses without the per-story tail. */
16
+ export const MAX_CHANGE = 160;
17
+ const CHANGE_ITEMS = 2;
18
+ const LEAD_ITEMS = 3;
19
+ /** Changes listed in one element's clause; the rest join "(+N more)". */
20
+ const CLAUSE_CHANGES = 3;
21
+ /** Longest value shown in prose. Not deltas.ts's MAX_VALUE (200), which caps
22
+ * what the JSON stores; this caps what a sentence repeats of it. */
23
+ const MAX_SHOWN_VALUE = 40;
24
+ export function describeDelta(d) {
25
+ switch (d.kind) {
26
+ case 'text':
27
+ case 'style':
28
+ case 'attr':
29
+ return `${d.el} ${change(d)}`;
30
+ case 'added':
31
+ return `added ${d.el} (${d.rect.w}×${d.rect.h} at ${d.rect.x},${d.rect.y})`;
32
+ case 'removed':
33
+ return `removed ${d.el} (${d.rect.w}×${d.rect.h} at ${d.rect.x},${d.rect.y})`;
34
+ case 'moved':
35
+ return `${d.el} moved ${direction(d.dx, d.dy)}`;
36
+ case 'resized':
37
+ return `${d.el} resized ${extent(d.dw, d.dh)}`;
38
+ case 'shift':
39
+ return `${d.count} elements after ${d.after} moved ${direction(d.dx, d.dy)}`;
40
+ }
41
+ }
42
+ /** The deltas as indented display lines for a human, grouped by element:
43
+ * the element's content changes (four-side longhands collapsed), then its
44
+ * resize and move on one line. Groups run causes first — content, added and
45
+ * removed, and a move a shift is blamed on; then shifts; then other moves;
46
+ * then resizes, so an ancestor's consequential `resized` comes last. Every
47
+ * delta passed in is stated on some line; `total` is the verdict's
48
+ * `deltaCount`, which says whether `deltas` is the whole set. */
49
+ export function describeDeltas(deltas, total = deltas.length) {
50
+ const ctx = context(deltas, total);
51
+ const lines = [];
52
+ const ordered = groupByElement(deltas)
53
+ .map((g, i) => ({ g, i, rank: groupRank(g, ctx) }))
54
+ .sort((a, b) => a.rank - b.rank || a.i - b.i);
55
+ for (const { g } of ordered) {
56
+ if (g.solo !== undefined) {
57
+ lines.push(` ${describe(g.solo, ctx)}`);
58
+ continue;
59
+ }
60
+ const effects = [
61
+ g.resized && `resized ${extent(g.resized.dw, g.resized.dh)}`,
62
+ g.moved && `moved ${direction(g.moved.dx, g.moved.dy)}`,
63
+ ].filter((x) => typeof x === 'string');
64
+ const own = [
65
+ ...shorthand(g.content, ' → ').map((p) => p.text),
66
+ ...(effects.length ? [effects.join(', ')] : []),
67
+ ];
68
+ if (own.length === 1)
69
+ lines.push(` ${g.el} ${own[0]}`);
70
+ else {
71
+ lines.push(` ${g.el}`);
72
+ for (const l of own)
73
+ lines.push(` ${l}`);
74
+ }
75
+ }
76
+ return lines;
77
+ }
78
+ /** Facts about one element are adjacent in `deltas` (they sort by element
79
+ * position first) and, since `disambiguate`, distinct elements never share
80
+ * a label — so an element is a run of one label, not every delta with that
81
+ * label. The run also splits when a kind or property repeats, which only an
82
+ * older verdict with colliding labels can produce: two elements, never one
83
+ * element stating `background-color` twice. */
84
+ function groupByElement(deltas) {
85
+ const groups = [];
86
+ let open;
87
+ for (const d of deltas) {
88
+ if (d.kind === 'added' || d.kind === 'removed' || d.kind === 'shift') {
89
+ groups.push({ content: [], solo: d });
90
+ open = undefined;
91
+ continue;
92
+ }
93
+ const fact = d.kind === 'style'
94
+ ? `style:${d.prop}`
95
+ : d.kind === 'attr'
96
+ ? `attr:${d.attr}`
97
+ : d.kind;
98
+ if (!open || open.g.el !== d.el || open.seen.has(fact)) {
99
+ open = { g: { el: d.el, content: [] }, seen: new Set() };
100
+ groups.push(open.g);
101
+ }
102
+ open.seen.add(fact);
103
+ if (d.kind === 'moved')
104
+ open.g.moved = d;
105
+ else if (d.kind === 'resized')
106
+ open.g.resized = d;
107
+ else
108
+ open.g.content.push(d);
109
+ }
110
+ return groups;
111
+ }
112
+ const disp = (d) => `${d.dx},${d.dy}`;
113
+ function context(deltas, total) {
114
+ const anchors = new Set();
115
+ const displacements = new Map();
116
+ // An element with its own content change is the cause through that change
117
+ // (padding grew); its move is a consequence like any other.
118
+ const changed = new Set(deltas
119
+ .filter((d) => d.kind === 'text' || d.kind === 'style' || d.kind === 'attr')
120
+ .map((d) => d.el));
121
+ for (const d of deltas) {
122
+ if (d.kind === 'shift' && !changed.has(d.after))
123
+ anchors.add(d.after);
124
+ if (d.kind === 'shift' || d.kind === 'moved')
125
+ displacements.set(disp(d), (displacements.get(disp(d)) ?? 0) + 1);
126
+ }
127
+ const still = total === deltas.length &&
128
+ !deltas.some((d) => d.kind === 'shift' || d.kind === 'moved' || d.kind === 'resized');
129
+ return { anchors, displacements, still };
130
+ }
131
+ /** A move a shift names as its cause (a reordered item) reads with the
132
+ * causes; a move with a displacement nothing else shares reads before ones
133
+ * that are part of a crowd. */
134
+ function moveRank(d, ctx) {
135
+ if (ctx.anchors.has(d.el))
136
+ return 0.5;
137
+ return (ctx.displacements.get(disp(d)) ?? 0) > 1 ? 3.5 : 3;
138
+ }
139
+ function groupRank(g, ctx) {
140
+ if (g.solo)
141
+ return g.solo.kind === 'shift' ? 1 : 0;
142
+ if (g.content.length)
143
+ return 0;
144
+ // 0.5 (blamed by a shift), else 2 or 2.5: after shifts, before resizes.
145
+ if (g.moved) {
146
+ const r = moveRank(g.moved, ctx);
147
+ return r === 0.5 ? r : r - 1;
148
+ }
149
+ return 4;
150
+ }
151
+ /** `describeDelta`, except that a removal with nothing moving or resizing
152
+ * around it may not be a removal: the capture drops `visibility: hidden`
153
+ * boxes, which leave their space behind. `display: none` and a real removal
154
+ * reflow what follows; this does not. The JSON `kind` stays `removed` —
155
+ * that is what the structure says — only the prose hedges. */
156
+ function describe(d, ctx) {
157
+ if (d.kind === 'removed' && ctx.still)
158
+ return `hidden or removed ${d.el} (${d.rect.w}×${d.rect.h} at ${d.rect.x},${d.rect.y})`;
159
+ return describeDelta(d);
160
+ }
161
+ /** `prop from→to`, without the element. */
162
+ function change(d, arrow = '→') {
163
+ if (d.kind === 'text')
164
+ return `text "${trim(d.from)}"${arrow}"${trim(d.to)}"`;
165
+ return `${changedName(d)} ${value(d.from)}${arrow}${value(d.to)}`;
166
+ }
167
+ const changedName = (d) => d.kind === 'style' ? d.prop : d.kind === 'attr' ? d.attr : 'text';
168
+ const headOf = (a) => a.styleTags.length > 0
169
+ ? `${a.classification} (${a.styleTags.join(', ')})`
170
+ : a.classification;
171
+ /** The change alone, for naming what several stories share: the summary's
172
+ * own clause wording with every element reduced to its role|tag (the
173
+ * caller passes `deltas` already abstracted), no coverage or tolerance
174
+ * tail, at most two clauses. */
175
+ export function buildChange(a) {
176
+ return clip(lead(headOf(a), a, [], MAX_CHANGE, CHANGE_ITEMS), MAX_CHANGE);
177
+ }
178
+ export function buildSummary(a) {
179
+ const head = headOf(a);
180
+ const subThreshold = a.flags.includes('sub-threshold');
181
+ const missing = a.flags.includes('no-baseline-structure')
182
+ ? 'baseline'
183
+ : a.flags.includes('no-current-structure')
184
+ ? 'current'
185
+ : undefined;
186
+ const tail = [];
187
+ const trunc = [a.baseline, a.current].find((s) => s?.truncated)?.truncated;
188
+ if (trunc)
189
+ tail.push(`Structure truncated (${trunc.kept}/${trunc.total} elements)`);
190
+ let body;
191
+ if (a.classification === 'identical') {
192
+ body = missing
193
+ ? `identical: images byte-identical; no ${missing} structure to compare`
194
+ : 'identical: images byte-identical, no structural change';
195
+ }
196
+ else if (a.classification === 'dimension-change') {
197
+ // Regions do not exist across sizes, so there is no region tail here.
198
+ const b = a.baseline && size(a.baseline);
199
+ const c = a.current && size(a.current);
200
+ body =
201
+ b && c && b !== c
202
+ ? `${head}: ${b} → ${c}; compare at one viewport`
203
+ : b && c
204
+ ? `${head}: image dimensions differ at the same ${b} viewport`
205
+ : `${head}: image dimensions differ; no ${missing} structure to name the sizes`;
206
+ }
207
+ else if (missing) {
208
+ body = `${head}: no ${missing} structure, so nothing explains the pixels; re-snap (or re-approve) with structure capture enabled`;
209
+ tail.unshift(subThreshold
210
+ ? 'Pixel diff below tolerance'
211
+ : `${a.regionCount} changed region${a.regionCount === 1 ? '' : 's'}`);
212
+ }
213
+ else if (a.deltas.length === 0) {
214
+ const painter = a.current && selfPaintingAt(a.current, a.unexplainedRegions);
215
+ body = painter
216
+ ? `${head}: structure and styles identical; the change is inside ${label(painter)}, which paints its own pixels`
217
+ : subThreshold
218
+ ? `${head}: structure and styles identical; pixels differ below the diff's tolerance`
219
+ : `${head}: structure and styles identical, pixels differ`;
220
+ if (!subThreshold)
221
+ tail.unshift(regions(a));
222
+ }
223
+ else {
224
+ tail.unshift(subThreshold
225
+ ? 'Pixel diff below tolerance; structure explains it'
226
+ : a.imagesIdentical
227
+ ? 'Images byte-identical: the change paints nothing at this viewport'
228
+ : regions(a));
229
+ body = lead(head, a, tail);
230
+ }
231
+ const out = [body, ...tail].join('. ') + '.';
232
+ return clip(out, MAX_SUMMARY);
233
+ }
234
+ /** Up to LEAD_ITEMS clauses, causes first. Each clause takes the richest
235
+ * form that fits beside the reserved tail — a clause cut mid-value would
236
+ * misstate the change — and whatever is left over is counted in
237
+ * "(+N more)". */
238
+ function lead(head, a, tail, max = MAX_SUMMARY, items = LEAD_ITEMS) {
239
+ const budget = max - tail.reduce((n, t) => n + t.length + 2, 0) - 1;
240
+ const render = (texts, more) => `${head}: ${texts.join('; ')}${more > 0 ? ` (+${more} more)` : ''}`;
241
+ const shown = [];
242
+ let used = 0;
243
+ for (const item of leadItems(a.deltas, a.deltaCount).slice(0, items)) {
244
+ const fit = item.find((o) => render([...shown, o.text], a.deltaCount - used - o.consumed).length <= budget) ?? (shown.length === 0 ? item.at(-1) : undefined);
245
+ if (!fit)
246
+ break;
247
+ shown.push(fit.text);
248
+ used += fit.consumed;
249
+ }
250
+ return render(shown, a.deltaCount - used);
251
+ }
252
+ /** Causes before consequences; within a rank, fact (document) order. A
253
+ * move is ranked by `moveRank`. */
254
+ const CAUSE_RANK = {
255
+ removed: 0,
256
+ added: 0,
257
+ text: 0,
258
+ attr: 0,
259
+ style: 0,
260
+ shift: 1,
261
+ resized: 2,
262
+ moved: 3,
263
+ };
264
+ function leadItems(deltas, total) {
265
+ const ctx = context(deltas, total);
266
+ const rank = (d) => (d.kind === 'moved' ? moveRank(d, ctx) : CAUSE_RANK[d.kind]);
267
+ // Content changes on one element read as one clause: `el a→b, c→d`; its
268
+ // resize and move stay separate clauses, ranked as consequences.
269
+ const items = [];
270
+ for (const g of groupByElement(deltas)) {
271
+ const i = items.length;
272
+ if (g.solo) {
273
+ items.push({
274
+ rank: rank(g.solo),
275
+ i,
276
+ item: [{ text: describe(g.solo, ctx), consumed: 1 }],
277
+ });
278
+ continue;
279
+ }
280
+ if (g.content.length)
281
+ items.push({ rank: 0, i, item: contentForms(g.el, g.content) });
282
+ for (const d of [g.resized, g.moved])
283
+ if (d)
284
+ items.push({
285
+ rank: rank(d),
286
+ i: items.length,
287
+ item: [{ text: describeDelta(d), consumed: 1 }],
288
+ });
289
+ }
290
+ return items.sort((x, y) => x.rank - y.rank || x.i - y.i).map((x) => x.item);
291
+ }
292
+ function contentForms(el, content) {
293
+ const parts = shorthand(content);
294
+ const forms = [];
295
+ for (let k = Math.min(CLAUSE_CHANGES, parts.length); k >= 1; k--) {
296
+ const some = parts.slice(0, k);
297
+ forms.push({
298
+ text: `${el} ${some.map((p) => p.text).join(', ')}`,
299
+ consumed: some.reduce((n, p) => n + p.consumed, 0),
300
+ });
301
+ }
302
+ forms.push({ text: `${el} ${parts[0].name} changed`, consumed: parts[0].consumed });
303
+ return forms;
304
+ }
305
+ /** CSS box properties whose four longhands collapse to one shorthand, in the
306
+ * shorthand's own value order (top, right, bottom, left / corners clockwise
307
+ * from top-left). */
308
+ const BOXES = [
309
+ ['padding', ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']],
310
+ ['margin', ['margin-top', 'margin-right', 'margin-bottom', 'margin-left']],
311
+ [
312
+ 'border-width',
313
+ [
314
+ 'border-top-width',
315
+ 'border-right-width',
316
+ 'border-bottom-width',
317
+ 'border-left-width',
318
+ ],
319
+ ],
320
+ [
321
+ 'border-color',
322
+ [
323
+ 'border-top-color',
324
+ 'border-right-color',
325
+ 'border-bottom-color',
326
+ 'border-left-color',
327
+ ],
328
+ ],
329
+ [
330
+ 'border-radius',
331
+ [
332
+ 'border-top-left-radius',
333
+ 'border-top-right-radius',
334
+ 'border-bottom-right-radius',
335
+ 'border-bottom-left-radius',
336
+ ],
337
+ ],
338
+ ];
339
+ /** One element's changes as `prop from→to` strings; when all four longhands
340
+ * of a box changed, they read as the shorthand (`padding 8px 12px→12px
341
+ * 16px`), placed where the first of them was. */
342
+ function shorthand(changes, arrow = '→') {
343
+ const style = new Map();
344
+ for (const c of changes)
345
+ if (c.kind === 'style')
346
+ style.set(c.prop, c);
347
+ const collapsed = new Map(); // first longhand seen → clause
348
+ const absorbed = new Set();
349
+ for (const [name, sides] of BOXES) {
350
+ const ds = sides.map((p) => style.get(p));
351
+ if (ds.some((d) => d === undefined))
352
+ continue;
353
+ const four = ds;
354
+ const first = changes.find((c) => c.kind === 'style' && sides.includes(c.prop));
355
+ if (first?.kind !== 'style')
356
+ continue;
357
+ collapsed.set(first.prop, {
358
+ name,
359
+ text: `${name} ${value(boxValue(four.map((d) => d.from)))}${arrow}${value(boxValue(four.map((d) => d.to)))}`,
360
+ consumed: 4,
361
+ });
362
+ for (const p of sides)
363
+ absorbed.add(p);
364
+ }
365
+ const out = [];
366
+ for (const c of changes) {
367
+ const box = c.kind === 'style' ? collapsed.get(c.prop) : undefined;
368
+ if (box)
369
+ out.push(box);
370
+ else if (c.kind !== 'style' || !absorbed.has(c.prop))
371
+ out.push({ name: changedName(c), text: change(c, arrow), consumed: 1 });
372
+ }
373
+ return out;
374
+ }
375
+ /** CSS shorthand value compression: `a a a a` → `a`, `a b a b` → `a b`,
376
+ * `a b c b` → `a b c`. */
377
+ function boxValue([t, r, b, l]) {
378
+ if (r === l) {
379
+ if (t === b)
380
+ return t === r ? t : `${t} ${r}`;
381
+ return `${t} ${r} ${b}`;
382
+ }
383
+ return `${t} ${r} ${b} ${l}`;
384
+ }
385
+ /** How many changed regions the structure accounts for, by count. */
386
+ function regions(a) {
387
+ const n = a.regionCount;
388
+ const u = a.unexplainedRegions.length;
389
+ const the = n === 1
390
+ ? 'the changed region'
391
+ : n === 2
392
+ ? 'both changed regions'
393
+ : `all ${n} changed regions`;
394
+ if (u === 0)
395
+ return `Structure explains ${the}`;
396
+ if (u === n)
397
+ return n === 1
398
+ ? 'Nothing in the structure explains the changed region'
399
+ : n === 2
400
+ ? 'Nothing in the structure explains either changed region'
401
+ : `Nothing in the structure explains the ${n} changed regions`;
402
+ return `${u} of ${n} changed regions unexplained`;
403
+ }
404
+ const size = (s) => `${s.viewport.width}×${s.viewport.height}`;
405
+ const signed = (n) => (n > 0 ? `+${n}` : `${n}`);
406
+ const trim = (s) => clip(s, MAX_SHOWN_VALUE);
407
+ /** Opaque `rgb(r, g, b)` as `#rrggbb`: a third the length, and the form a
408
+ * developer greps their stylesheet for. Alpha colours stay as they are. */
409
+ const value = (s) => trim(s.replace(/rgb\((\d+), (\d+), (\d+)\)/g, (_, r, g, b) => [r, g, b].reduce((hex, c) => hex + Number(c).toString(16).padStart(2, '0'), '#')));
410
+ const direction = (dx, dy) => dx === 0
411
+ ? `${dy > 0 ? 'down' : 'up'} ${Math.abs(dy)}px`
412
+ : dy === 0
413
+ ? `${dx > 0 ? 'right' : 'left'} ${Math.abs(dx)}px`
414
+ : `${signed(dx)},${signed(dy)}px`;
415
+ const extent = (dw, dh) => dw === 0
416
+ ? `height ${signed(dh)}px`
417
+ : dh === 0
418
+ ? `width ${signed(dw)}px`
419
+ : `${signed(dw)}×${signed(dh)}px`;
420
+ //# sourceMappingURL=summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../src/diff/structural/summary.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,sDAAsD;AACtD,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,2EAA2E;AAC3E,uEAAuE;AAUvE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAC/B,uEAAuE;AACvE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAC9B,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,yEAAyE;AACzE,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB;qEACqE;AACrE,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,aAAa,CAAC,CAAQ;IACpC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,MAAM;YACT,OAAO,GAAG,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,KAAK,OAAO;YACV,OAAO,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAA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