@luci-dev/capture 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/dist/a11y.d.ts +54 -0
- package/dist/a11y.d.ts.map +1 -0
- package/dist/a11y.js +144 -0
- package/dist/a11y.js.map +1 -0
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +4 -0
- package/dist/browser.js.map +1 -0
- package/dist/color.d.ts +44 -0
- package/dist/color.d.ts.map +1 -0
- package/dist/color.js +230 -0
- package/dist/color.js.map +1 -0
- package/dist/component.d.ts +94 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/component.js +445 -0
- package/dist/component.js.map +1 -0
- package/dist/dom.d.ts +36 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +365 -0
- package/dist/dom.js.map +1 -0
- package/dist/eligibility.d.ts +24 -0
- package/dist/eligibility.d.ts.map +1 -0
- package/dist/eligibility.js +33 -0
- package/dist/eligibility.js.map +1 -0
- package/dist/font.d.ts +18 -0
- package/dist/font.d.ts.map +1 -0
- package/dist/font.js +86 -0
- package/dist/font.js.map +1 -0
- package/dist/icon.d.ts +11 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +221 -0
- package/dist/icon.js.map +1 -0
- package/dist/image.d.ts +82 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +283 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +9 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +115 -0
- package/dist/layout.js.map +1 -0
- package/dist/luci-capture.js +35510 -0
- package/dist/model.d.ts +60 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +43 -0
- package/dist/model.js.map +1 -0
- package/dist/naming.d.ts +8 -0
- package/dist/naming.d.ts.map +1 -0
- package/dist/naming.js +33 -0
- package/dist/naming.js.map +1 -0
- package/dist/page.d.ts +38 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +102 -0
- package/dist/page.js.map +1 -0
- package/dist/realm.d.ts +17 -0
- package/dist/realm.d.ts.map +1 -0
- package/dist/realm.js +18 -0
- package/dist/realm.js.map +1 -0
- package/dist/responsive.d.ts +74 -0
- package/dist/responsive.d.ts.map +1 -0
- package/dist/responsive.js +237 -0
- package/dist/responsive.js.map +1 -0
- package/dist/section.d.ts +50 -0
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +244 -0
- package/dist/section.js.map +1 -0
- package/dist/spacing.d.ts +43 -0
- package/dist/spacing.d.ts.map +1 -0
- package/dist/spacing.js +113 -0
- package/dist/spacing.js.map +1 -0
- package/dist/stack.d.ts +11 -0
- package/dist/stack.d.ts.map +1 -0
- package/dist/stack.js +150 -0
- package/dist/stack.js.map +1 -0
- package/dist/states.d.ts +89 -0
- package/dist/states.d.ts.map +1 -0
- package/dist/states.js +457 -0
- package/dist/states.js.map +1 -0
- package/dist/text.d.ts +30 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +156 -0
- package/dist/text.js.map +1 -0
- package/dist/ui/basket.d.ts +50 -0
- package/dist/ui/basket.d.ts.map +1 -0
- package/dist/ui/basket.js +93 -0
- package/dist/ui/basket.js.map +1 -0
- package/dist/ui/check.d.ts +43 -0
- package/dist/ui/check.d.ts.map +1 -0
- package/dist/ui/check.js +168 -0
- package/dist/ui/check.js.map +1 -0
- package/dist/ui/devSettings.d.ts +66 -0
- package/dist/ui/devSettings.d.ts.map +1 -0
- package/dist/ui/devSettings.js +115 -0
- package/dist/ui/devSettings.js.map +1 -0
- package/dist/ui/index.d.ts +14 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +14 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/loading.d.ts +18 -0
- package/dist/ui/loading.d.ts.map +1 -0
- package/dist/ui/loading.js +23 -0
- package/dist/ui/loading.js.map +1 -0
- package/dist/ui/modeSwitch.d.ts +17 -0
- package/dist/ui/modeSwitch.d.ts.map +1 -0
- package/dist/ui/modeSwitch.js +6 -0
- package/dist/ui/modeSwitch.js.map +1 -0
- package/dist/ui/mount.d.ts +83 -0
- package/dist/ui/mount.d.ts.map +1 -0
- package/dist/ui/mount.js +81 -0
- package/dist/ui/mount.js.map +1 -0
- package/dist/ui/picker.d.ts +22 -0
- package/dist/ui/picker.d.ts.map +1 -0
- package/dist/ui/picker.js +73 -0
- package/dist/ui/picker.js.map +1 -0
- package/dist/ui/remap.d.ts +27 -0
- package/dist/ui/remap.d.ts.map +1 -0
- package/dist/ui/remap.js +76 -0
- package/dist/ui/remap.js.map +1 -0
- package/dist/ui/screenshot.d.ts +39 -0
- package/dist/ui/screenshot.d.ts.map +1 -0
- package/dist/ui/screenshot.js +59 -0
- package/dist/ui/screenshot.js.map +1 -0
- package/dist/ui/styles.d.ts +2 -0
- package/dist/ui/styles.d.ts.map +1 -0
- package/dist/ui/styles.js +381 -0
- package/dist/ui/styles.js.map +1 -0
- package/dist/ui/theme.d.ts +59 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +93 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/toolbar.d.ts +101 -0
- package/dist/ui/toolbar.d.ts.map +1 -0
- package/dist/ui/toolbar.js +1494 -0
- package/dist/ui/toolbar.js.map +1 -0
- package/dist/ui/tools.d.ts +165 -0
- package/dist/ui/tools.d.ts.map +1 -0
- package/dist/ui/tools.js +345 -0
- package/dist/ui/tools.js.map +1 -0
- package/dist/ui/zip.d.ts +16 -0
- package/dist/ui/zip.d.ts.map +1 -0
- package/dist/ui/zip.js +104 -0
- package/dist/ui/zip.js.map +1 -0
- package/package.json +29 -3
- package/README.md +0 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { LUCI_UI_ATTRIBUTE } from './dom.js';
|
|
2
|
+
import { hasRules, isMediaRule, isStyleRule } from './realm.js';
|
|
3
|
+
/** The name of Luci's width frames: the dev toolbar does not start inside one. */
|
|
4
|
+
export const LUCI_FRAME_NAME = 'luci-width';
|
|
5
|
+
/** The widths that stand for "a phone" and "a desktop" when a range has no better one. */
|
|
6
|
+
export const PHONE_WIDTH = 375;
|
|
7
|
+
export const DESKTOP_WIDTH = 1280;
|
|
8
|
+
/** At most this many breakpoints (so at most 3 widths). */
|
|
9
|
+
export const MAX_THRESHOLDS = 2;
|
|
10
|
+
/**
|
|
11
|
+
* The widths where a media condition starts or stops applying: "(min-width: 768px)" -> [768],
|
|
12
|
+
* "(max-width: 767px)" -> [768], "(width >= 64em)" -> [1024]. em and rem count 16px.
|
|
13
|
+
*/
|
|
14
|
+
export function mediaThresholds(condition, rootFontSize = 16) {
|
|
15
|
+
const px = (n, unit) => Number(n) * (unit === 'px' ? 1 : rootFontSize);
|
|
16
|
+
const out = [];
|
|
17
|
+
for (const m of condition.matchAll(/\(\s*(min|max)-width\s*:\s*(\d*\.?\d+)(px|em|rem)\s*\)/gi)) {
|
|
18
|
+
const v = px(m[2], m[3].toLowerCase());
|
|
19
|
+
out.push(m[1].toLowerCase() === 'min' ? Math.ceil(v) : Math.floor(v) + 1);
|
|
20
|
+
}
|
|
21
|
+
for (const m of condition.matchAll(/\(\s*width\s*(>=|>|<=|<)\s*(\d*\.?\d+)(px|em|rem)\s*\)/gi)) {
|
|
22
|
+
const v = px(m[2], m[3].toLowerCase());
|
|
23
|
+
out.push(m[1] === '>=' || m[1] === '<' ? Math.ceil(v) : Math.floor(v) + 1);
|
|
24
|
+
}
|
|
25
|
+
return [...new Set(out)].filter(t => t > 1);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The widths to read at: one per range between breakpoints, the breakpoints that style the most
|
|
29
|
+
* rules first (at most two). Below the first, a phone (375px, or just under it); between two, the
|
|
30
|
+
* breakpoint itself; above the last, a desktop (1280px, or the breakpoint). Empty without breakpoints.
|
|
31
|
+
*/
|
|
32
|
+
export function pickWidths(thresholds) {
|
|
33
|
+
return widthsFor(chooseThresholds(thresholds));
|
|
34
|
+
}
|
|
35
|
+
/** The breakpoints that style the most rules (at most two), narrowest first. */
|
|
36
|
+
export function chooseThresholds(thresholds) {
|
|
37
|
+
const weights = new Map();
|
|
38
|
+
for (const t of thresholds)
|
|
39
|
+
weights.set(t.px, (weights.get(t.px) ?? 0) + t.weight);
|
|
40
|
+
return [...weights.entries()].sort((a, b) => b[1] - a[1] || a[0] - b[0]).slice(0, MAX_THRESHOLDS).map(([px]) => px).sort((a, b) => a - b);
|
|
41
|
+
}
|
|
42
|
+
/** One width per range between the breakpoints. */
|
|
43
|
+
export function widthsFor(chosen) {
|
|
44
|
+
if (!chosen.length)
|
|
45
|
+
return [];
|
|
46
|
+
const first = chosen[0];
|
|
47
|
+
const last = chosen[chosen.length - 1];
|
|
48
|
+
return [Math.min(PHONE_WIDTH, first - 1), ...chosen.slice(0, -1), Math.max(DESKTOP_WIDTH, last)];
|
|
49
|
+
}
|
|
50
|
+
/** "344px 344px 344px" -> 3: grid columns compare by count, not by track widths that follow the window. */
|
|
51
|
+
const columnCount = (computed) => (computed.trim() === 'none' ? 0 : computed.split(/\s+(?![^(]*\))/).filter(Boolean).length);
|
|
52
|
+
const columnsText = (n) => `${n} column${n === 1 ? '' : 's'}`;
|
|
53
|
+
/** Sizes the site wrote the same way at every width ("100%", "auto") follow the window: not a change. */
|
|
54
|
+
const SIZES = /^(width|height|min-width|max-width|min-height|max-height)$/;
|
|
55
|
+
/**
|
|
56
|
+
* The properties that differ between the readings (one per width, null where it could not be read):
|
|
57
|
+
* a part found at some widths only gives a `shown` row; grid columns compare by count; a size the
|
|
58
|
+
* site wrote the same way everywhere is fluid, not a change. Parts and properties in reading order.
|
|
59
|
+
*/
|
|
60
|
+
export function responsiveChanges(readings) {
|
|
61
|
+
const parts = [];
|
|
62
|
+
for (const r of readings)
|
|
63
|
+
for (const p of r ?? [])
|
|
64
|
+
if (!parts.includes(p.part))
|
|
65
|
+
parts.push(p.part);
|
|
66
|
+
const changes = [];
|
|
67
|
+
for (const part of parts) {
|
|
68
|
+
const found = readings.map(r => (r ? r.find(p => p.part === part) ?? null : undefined));
|
|
69
|
+
// A width that could not be read at all says nothing about the part
|
|
70
|
+
if (found.some(f => f === null) && found.some(f => f)) {
|
|
71
|
+
changes.push({ part, property: 'shown', values: found.map(f => (f === undefined ? null : f ? 'yes' : 'no')) });
|
|
72
|
+
}
|
|
73
|
+
const properties = [];
|
|
74
|
+
for (const f of found)
|
|
75
|
+
for (const s of f?.styles ?? [])
|
|
76
|
+
if (!properties.includes(s.property))
|
|
77
|
+
properties.push(s.property);
|
|
78
|
+
for (const property of properties) {
|
|
79
|
+
const values = found.map(f => f?.styles.find(s => s.property === property)?.value);
|
|
80
|
+
if (SIZES.test(property) && values.every(v => v?.authored && v.authored === values[0]?.authored && !v.authored.includes('var(')))
|
|
81
|
+
continue;
|
|
82
|
+
const texts = values.map(v => (!v ? null : property === 'grid-template-columns' ? columnsText(columnCount(v.computed)) : v.computed));
|
|
83
|
+
// Only where the part is there: a hidden part's missing styles are its `shown` row
|
|
84
|
+
const present = texts.filter((_, i) => found[i]);
|
|
85
|
+
if (new Set(present).size > 1)
|
|
86
|
+
changes.push({ part, property, values: texts });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return changes;
|
|
90
|
+
}
|
|
91
|
+
/** Give each repeated part name a number in order: heading, heading (2), heading (3). */
|
|
92
|
+
export function uniqueParts(parts) {
|
|
93
|
+
const seen = new Map();
|
|
94
|
+
return parts.map(p => {
|
|
95
|
+
const n = (seen.get(p.part) ?? 0) + 1;
|
|
96
|
+
seen.set(p.part, n);
|
|
97
|
+
return n > 1 ? { ...p, part: `${p.part} (${n})` } : p;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/** Rules inside a media (or @supports, @layer) block, flattened, each with its media condition. */
|
|
101
|
+
function mediaStyleRules(rules, condition, out) {
|
|
102
|
+
for (const rule of Array.from(rules)) {
|
|
103
|
+
if (isMediaRule(rule))
|
|
104
|
+
mediaStyleRules(rule.cssRules, condition ? `${condition} and ${rule.conditionText}` : rule.conditionText, out);
|
|
105
|
+
else if (isStyleRule(rule)) {
|
|
106
|
+
if (condition)
|
|
107
|
+
out.push({ condition, rule });
|
|
108
|
+
}
|
|
109
|
+
else if (hasRules(rule))
|
|
110
|
+
mediaStyleRules(rule.cssRules, condition, out);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The media conditions that style an element or anything inside it (a rule in the block matches
|
|
115
|
+
* one of them), or set custom properties on an element around it. With the number of such rules.
|
|
116
|
+
* Stylesheets the page cannot read (another origin without CORS) are skipped.
|
|
117
|
+
*/
|
|
118
|
+
export function mediaQueriesFor(root) {
|
|
119
|
+
const doc = root.ownerDocument;
|
|
120
|
+
const inside = [root, ...Array.from(root.querySelectorAll('*')).slice(0, 600)];
|
|
121
|
+
const around = [];
|
|
122
|
+
for (let n = root.parentElement; n; n = n.parentElement)
|
|
123
|
+
around.push(n);
|
|
124
|
+
const found = new Map();
|
|
125
|
+
for (const sheet of Array.from(doc.styleSheets)) {
|
|
126
|
+
let rules;
|
|
127
|
+
try {
|
|
128
|
+
rules = sheet.cssRules;
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const list = [];
|
|
134
|
+
mediaStyleRules(rules, null, list);
|
|
135
|
+
for (const { condition, rule } of list) {
|
|
136
|
+
const matches = (el) => { try {
|
|
137
|
+
return el.matches(rule.selectorText);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false;
|
|
141
|
+
} };
|
|
142
|
+
const setsVars = Array.from(rule.style).some(p => p.startsWith('--'));
|
|
143
|
+
if (inside.some(matches) || (setsVars && around.some(matches)))
|
|
144
|
+
found.set(condition, (found.get(condition) ?? 0) + 1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return [...found.entries()].map(([condition, rules]) => ({ condition, rules }));
|
|
148
|
+
}
|
|
149
|
+
const frames = (win, n = 2) => new Promise(resolve => {
|
|
150
|
+
const step = (left) => (left ? win.requestAnimationFrame(() => step(left - 1)) : resolve());
|
|
151
|
+
step(n);
|
|
152
|
+
});
|
|
153
|
+
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
|
|
154
|
+
/** Read once `read` gives something, trying until the time is up (a page still rendering in a frame). */
|
|
155
|
+
async function until(read, timeoutMs, what) {
|
|
156
|
+
const end = Date.now() + timeoutMs;
|
|
157
|
+
for (;;) {
|
|
158
|
+
let value = null;
|
|
159
|
+
try {
|
|
160
|
+
value = read();
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
value = null;
|
|
164
|
+
}
|
|
165
|
+
if (value !== null)
|
|
166
|
+
return value;
|
|
167
|
+
if (Date.now() > end)
|
|
168
|
+
throw new Error(what);
|
|
169
|
+
await sleep(150);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/** The page at one width in a hidden frame: loaded, rendered, read, removed. */
|
|
173
|
+
async function readInFrame(doc, width, read, timeoutMs) {
|
|
174
|
+
const win = doc.defaultView;
|
|
175
|
+
const frame = doc.createElement('iframe');
|
|
176
|
+
frame.setAttribute(LUCI_UI_ATTRIBUTE, '');
|
|
177
|
+
frame.setAttribute('aria-hidden', 'true');
|
|
178
|
+
frame.tabIndex = -1;
|
|
179
|
+
frame.name = LUCI_FRAME_NAME;
|
|
180
|
+
frame.style.cssText = `position:fixed;top:0;left:${-width - 200}px;width:${width}px;height:${win.innerHeight}px;border:0;opacity:0;pointer-events:none;`;
|
|
181
|
+
const loaded = new Promise((resolve, reject) => {
|
|
182
|
+
frame.addEventListener('load', () => resolve(), { once: true });
|
|
183
|
+
setTimeout(() => reject(new Error(`the page did not load in a ${width}px frame within ${Math.round(timeoutMs / 1000)}s`)), timeoutMs);
|
|
184
|
+
});
|
|
185
|
+
frame.src = doc.location.href;
|
|
186
|
+
doc.documentElement.appendChild(frame);
|
|
187
|
+
try {
|
|
188
|
+
await loaded;
|
|
189
|
+
let inner = null;
|
|
190
|
+
try {
|
|
191
|
+
inner = frame.contentDocument;
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
inner = null;
|
|
195
|
+
}
|
|
196
|
+
if (!inner || inner.location.href === 'about:blank')
|
|
197
|
+
throw new Error('this page does not allow itself in a frame (X-Frame-Options or Content-Security-Policy)');
|
|
198
|
+
const ready = inner;
|
|
199
|
+
const value = await until(() => read(ready), timeoutMs, `the component did not appear in the ${width}px frame`);
|
|
200
|
+
await frames(frame.contentWindow, 2);
|
|
201
|
+
return (read(ready) ?? value);
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
frame.remove();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Read something at each width: by resizing the window when the shell can (`setWidth`), else in a
|
|
209
|
+
* hidden frame of the same page. The window is always put back. `onWidth` says where Luci is.
|
|
210
|
+
*/
|
|
211
|
+
export async function readAtWidths(doc, widths, read, options = {}) {
|
|
212
|
+
const timeoutMs = options.timeoutMs ?? 15_000;
|
|
213
|
+
const out = [];
|
|
214
|
+
if (options.setWidth) {
|
|
215
|
+
const win = doc.defaultView;
|
|
216
|
+
try {
|
|
217
|
+
for (const [i, width] of widths.entries()) {
|
|
218
|
+
options.onWidth?.(width, i);
|
|
219
|
+
await options.setWidth(width);
|
|
220
|
+
await until(() => (Math.abs(win.innerWidth - width) <= 1 ? true : null), 3000, `the window did not change to ${width}px`);
|
|
221
|
+
await frames(win, 2);
|
|
222
|
+
out.push(await until(() => read(doc), 3000, `the component is not on the page at ${width}px`));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
await options.setWidth(null);
|
|
227
|
+
await frames(win, 2);
|
|
228
|
+
}
|
|
229
|
+
return out;
|
|
230
|
+
}
|
|
231
|
+
for (const [i, width] of widths.entries()) {
|
|
232
|
+
options.onWidth?.(width, i);
|
|
233
|
+
out.push(await readInFrame(doc, width, read, timeoutMs));
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=responsive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.js","sourceRoot":"","sources":["../src/responsive.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhE,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAC5C,0FAA0F;AAC1F,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,YAAY,GAAG,EAAE;IAClE,MAAM,EAAE,GAAG,CAAC,CAAS,EAAE,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACvF,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,0DAA0D,CAAC,EAAE,CAAC;QAC/F,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACzC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,C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;AACb,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section scope (v0.2): a picked part of a page (a pricing section, a hero) becomes one section file
|
|
3
|
+
* plus one component file per kind of component in it. The section file has the layout as an outline
|
|
4
|
+
* and places each component by reference, so every component is described once. Pure: works on the
|
|
5
|
+
* snapshot; states and images come in from the live page like the full-page reference.
|
|
6
|
+
*/
|
|
7
|
+
import { type ComponentCapture, type SectionCapture } from '@luci-dev/format/capture';
|
|
8
|
+
import { type ComponentImageInput } from './component.js';
|
|
9
|
+
import type { ElementSnapshot, PageSnapshot } from './model.js';
|
|
10
|
+
/** The kinds of component a section file places by reference; everything else is its layout and text. */
|
|
11
|
+
export declare const SECTION_COMPONENT_TYPES: ReadonlySet<string>;
|
|
12
|
+
/** A "card" larger than this share of the section is a layout box with a background, not a card. */
|
|
13
|
+
export declare const MAX_SECTION_CARD_SHARE = 0.6;
|
|
14
|
+
/** The outline stops at this depth and this many lines, so the file stays readable. */
|
|
15
|
+
export declare const MAX_STRUCTURE_DEPTH = 8;
|
|
16
|
+
export declare const MAX_STRUCTURE_LINES = 80;
|
|
17
|
+
/** One kind of component in the section: the first one (its file is captured from it) and every one in the section. */
|
|
18
|
+
export interface SectionGroup {
|
|
19
|
+
example: ElementSnapshot;
|
|
20
|
+
instances: ElementSnapshot[];
|
|
21
|
+
/** For a button or field inside another component: the outer component of its first one. */
|
|
22
|
+
within?: ElementSnapshot;
|
|
23
|
+
}
|
|
24
|
+
/** What the toolbar reads from the live page for one kind of component (as for the full-page reference). */
|
|
25
|
+
export interface SectionComponentInput {
|
|
26
|
+
entry: ElementSnapshot;
|
|
27
|
+
inside: (el: ElementSnapshot) => number | null;
|
|
28
|
+
states: ComponentCapture['states'];
|
|
29
|
+
images?: readonly ComponentImageInput[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The components in a section, grouped by kind (same tag and type): only the outermost ones (a
|
|
33
|
+
* button inside a card is part of the card's file), and not a box that holds other cards (layout).
|
|
34
|
+
*/
|
|
35
|
+
export declare function sectionGroups(snap: PageSnapshot, section: ElementSnapshot, inside: (el: ElementSnapshot) => number | null): SectionGroup[];
|
|
36
|
+
/** The section's type: its tag when it says what it is (section, header, footer...), else "section". */
|
|
37
|
+
export declare const sectionType: (el: ElementSnapshot) => string;
|
|
38
|
+
/** Its name: its id when the selector has one ("#pricing" -> "pricing"), else its type. */
|
|
39
|
+
export declare function sectionName(el: ElementSnapshot): string;
|
|
40
|
+
/**
|
|
41
|
+
* The section file and its component files. `components` holds what was read from the live page for
|
|
42
|
+
* each group's example, in the same order as `groups`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function sectionCapture(snap: PageSnapshot, section: ElementSnapshot, inside: (el: ElementSnapshot) => number | null, groups: readonly SectionGroup[], components: readonly SectionComponentInput[], options?: {
|
|
45
|
+
captured?: string;
|
|
46
|
+
}): {
|
|
47
|
+
section: SectionCapture;
|
|
48
|
+
components: ComponentCapture[];
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../src/section.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAoE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAExJ,OAAO,EAAkG,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1J,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAKhE,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAA0F,CAAC;AACnJ,oGAAoG;AACpG,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,uFAAuF;AACvF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAKtC,uHAAuH;AACvH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,4FAA4F;IAC5F,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAKD,4GAA4G;AAC5G,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,CAAC,EAAE,EAAE,eAAe,KAAK,MAAM,GAAG,IAAI,CAAC;IAC/C,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACzC;AASD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,eAAe,KAAK,MAAM,GAAG,IAAI,GAAG,YAAY,EAAE,CAmC1I;AAED,wGAAwG;AACxG,eAAO,MAAM,WAAW,OAAQ,eAAe,WAAgD,CAAC;AAChG,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAIvD;AAUD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,CAAC,EAAE,EAAE,eAAe,KAAK,MAAM,GAAG,IAAI,EAC9C,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,UAAU,EAAE,SAAS,qBAAqB,EAAE,EAC5C,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAgI7D"}
|
package/dist/section.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section scope (v0.2): a picked part of a page (a pricing section, a hero) becomes one section file
|
|
3
|
+
* plus one component file per kind of component in it. The section file has the layout as an outline
|
|
4
|
+
* and places each component by reference, so every component is described once. Pure: works on the
|
|
5
|
+
* snapshot; states and images come in from the live page like the full-page reference.
|
|
6
|
+
*/
|
|
7
|
+
import { buildLayoutTree, captureFileName, componentSchema, toCaptureName } from '@luci-dev/format/capture';
|
|
8
|
+
import { contrastOf } from './a11y.js';
|
|
9
|
+
import { componentCapture, componentType, layoutStyles, partName, textStylesOf, tokensOf, variantGroups } from './component.js';
|
|
10
|
+
import { eligibility } from './eligibility.js';
|
|
11
|
+
import { aspectRatioOf } from './image.js';
|
|
12
|
+
import { computeElementLayout } from './layout.js';
|
|
13
|
+
import { elementName } from './naming.js';
|
|
14
|
+
const today = () => new Date().toISOString().slice(0, 10);
|
|
15
|
+
/** The kinds of component a section file places by reference; everything else is its layout and text. */
|
|
16
|
+
export const SECTION_COMPONENT_TYPES = new Set(['button', 'field', 'card', 'badge', 'navigation', 'form', 'table', 'dialog']);
|
|
17
|
+
/** A "card" larger than this share of the section is a layout box with a background, not a card. */
|
|
18
|
+
export const MAX_SECTION_CARD_SHARE = 0.6;
|
|
19
|
+
/** The outline stops at this depth and this many lines, so the file stays readable. */
|
|
20
|
+
export const MAX_STRUCTURE_DEPTH = 8;
|
|
21
|
+
export const MAX_STRUCTURE_LINES = 80;
|
|
22
|
+
const SEMANTIC = new Set(['section', 'header', 'footer', 'main', 'aside', 'nav', 'form', 'article']);
|
|
23
|
+
const IMAGE_TAGS = new Set(['img', 'picture', 'video', 'canvas']);
|
|
24
|
+
/** Kinds with states of their own: they get their own file even inside another component. */
|
|
25
|
+
const OWN_FILE_INSIDE = new Set(['button', 'field']);
|
|
26
|
+
/** Children by parent, in page order. */
|
|
27
|
+
function childrenOf(snap) {
|
|
28
|
+
const out = new Map();
|
|
29
|
+
for (const e of snap.elements)
|
|
30
|
+
if (e.parent !== undefined)
|
|
31
|
+
out.set(e.parent, [...(out.get(e.parent) ?? []), e]);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The components in a section, grouped by kind (same tag and type): only the outermost ones (a
|
|
36
|
+
* button inside a card is part of the card's file), and not a box that holds other cards (layout).
|
|
37
|
+
*/
|
|
38
|
+
export function sectionGroups(snap, section, inside) {
|
|
39
|
+
const area = section.rect.width * section.rect.height;
|
|
40
|
+
const candidates = snap.elements.filter(e => {
|
|
41
|
+
const depth = inside(e);
|
|
42
|
+
if (depth === null || depth < 1 || !e.visible || eligibility({ tag: e.tag }).status !== 'allowed')
|
|
43
|
+
return false;
|
|
44
|
+
const type = componentType(e);
|
|
45
|
+
if (!SECTION_COMPONENT_TYPES.has(type))
|
|
46
|
+
return false;
|
|
47
|
+
return type !== 'card' || e.rect.width * e.rect.height <= area * MAX_SECTION_CARD_SHARE;
|
|
48
|
+
});
|
|
49
|
+
const ids = new Set(candidates.map(c => c.id));
|
|
50
|
+
const ancestors = (e) => {
|
|
51
|
+
const out = [];
|
|
52
|
+
for (let p = e.parent; p !== undefined && p !== section.id; p = snap.elements[p]?.parent)
|
|
53
|
+
out.push(p);
|
|
54
|
+
return out;
|
|
55
|
+
};
|
|
56
|
+
// A card that holds other cards is a layout box
|
|
57
|
+
const holders = new Set();
|
|
58
|
+
for (const c of candidates)
|
|
59
|
+
if (componentType(c) === 'card')
|
|
60
|
+
for (const a of ancestors(c))
|
|
61
|
+
if (ids.has(a) && componentType(snap.elements[a]) === 'card')
|
|
62
|
+
holders.add(a);
|
|
63
|
+
const kept = candidates.filter(c => !holders.has(c.id));
|
|
64
|
+
const keptIds = new Set(kept.map(k => k.id));
|
|
65
|
+
// The outermost ones; inside another kept one, only buttons and fields (for their own states)
|
|
66
|
+
const outerOf = (c) => ancestors(c).reverse().find(a => keptIds.has(a));
|
|
67
|
+
const groups = new Map();
|
|
68
|
+
for (const c of kept) {
|
|
69
|
+
const outer = outerOf(c);
|
|
70
|
+
const type = componentType(c);
|
|
71
|
+
if (outer !== undefined && !OWN_FILE_INSIDE.has(type))
|
|
72
|
+
continue;
|
|
73
|
+
const key = `${c.tag}|${type}`;
|
|
74
|
+
const g = groups.get(key);
|
|
75
|
+
if (g) {
|
|
76
|
+
g.instances.push(c);
|
|
77
|
+
g.outers.push(outer);
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
groups.set(key, { example: c, instances: [c], outers: [outer] });
|
|
81
|
+
}
|
|
82
|
+
// "Inside" only when every one of them sits in another component; outer components come first
|
|
83
|
+
return [...groups.values()]
|
|
84
|
+
.map(({ outers, ...g }) => (outers.every(o => o !== undefined) ? { ...g, within: snap.elements[outers[0]] } : g))
|
|
85
|
+
.sort((a, b) => Number(Boolean(a.within)) - Number(Boolean(b.within)));
|
|
86
|
+
}
|
|
87
|
+
/** The section's type: its tag when it says what it is (section, header, footer...), else "section". */
|
|
88
|
+
export const sectionType = (el) => (SEMANTIC.has(el.tag) ? el.tag : 'section');
|
|
89
|
+
/** Its name: its id when the selector has one ("#pricing" -> "pricing"), else its type. */
|
|
90
|
+
export function sectionName(el) {
|
|
91
|
+
const ids = [...el.selector.matchAll(/#([A-Za-z][\w-]*)/g)];
|
|
92
|
+
const id = ids.length ? ids[ids.length - 1][1] : '';
|
|
93
|
+
return toCaptureName(id || sectionType(el));
|
|
94
|
+
}
|
|
95
|
+
/** A layout box's part name from how it lays out its children. */
|
|
96
|
+
function boxPart(el) {
|
|
97
|
+
const display = el.styles.display ?? '';
|
|
98
|
+
if (/grid/.test(display))
|
|
99
|
+
return 'grid';
|
|
100
|
+
if (/flex/.test(display))
|
|
101
|
+
return (el.styles['flex-direction'] ?? 'row').startsWith('column') ? 'column' : 'row';
|
|
102
|
+
return 'group';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The section file and its component files. `components` holds what was read from the live page for
|
|
106
|
+
* each group's example, in the same order as `groups`.
|
|
107
|
+
*/
|
|
108
|
+
export function sectionCapture(snap, section, inside, groups, components, options = {}) {
|
|
109
|
+
const captured = options.captured ?? today();
|
|
110
|
+
const within = (e) => inside(e) !== null;
|
|
111
|
+
// One component file per group, names made unique, variants counted inside the section only
|
|
112
|
+
const used = new Map();
|
|
113
|
+
const files = [];
|
|
114
|
+
const placed = new Map();
|
|
115
|
+
groups.forEach((g, i) => {
|
|
116
|
+
const input = components[i];
|
|
117
|
+
const c = componentSchema.parse(componentCapture(snap, g.example, input.inside, { captured, system: true, states: input.states, within, ...(input.images ? { images: input.images } : {}) }));
|
|
118
|
+
const n = (used.get(c.meta.name) ?? 0) + 1;
|
|
119
|
+
used.set(c.meta.name, n);
|
|
120
|
+
const name = n > 1 ? `${c.meta.name}-${n}` : c.meta.name;
|
|
121
|
+
const file = n > 1 ? { ...c, meta: { ...c.meta, name }, variants: c.variants?.map((v, j) => ({ ...v, name: j === 0 ? name : `${name}-${j + 1}` })) } : c;
|
|
122
|
+
files.push(file);
|
|
123
|
+
const fileName = captureFileName(file.meta);
|
|
124
|
+
for (const v of variantGroups(snap, g.example, name, within)) {
|
|
125
|
+
for (const e of v.elements)
|
|
126
|
+
if (g.instances.includes(e))
|
|
127
|
+
placed.set(e.id, { name, file: fileName, variant: v.name });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
// The outline: layout boxes with their own styles, text parts with their text style, image slots,
|
|
131
|
+
// and components; boxes with no styles of their own are left out (their children move up a level)
|
|
132
|
+
const kids = childrenOf(snap);
|
|
133
|
+
const containerLayout = computeElementLayout(section);
|
|
134
|
+
const structure = [{
|
|
135
|
+
depth: 0,
|
|
136
|
+
part: 'container',
|
|
137
|
+
element: elementName(section.tag, section.role),
|
|
138
|
+
...(containerLayout ? { layout: containerLayout } : {}),
|
|
139
|
+
styles: layoutStyles(snap, section)
|
|
140
|
+
}];
|
|
141
|
+
const texts = [];
|
|
142
|
+
const walk = (el, depth, parentPart = 'container') => {
|
|
143
|
+
for (const child of kids.get(el.id) ?? []) {
|
|
144
|
+
if (structure.length >= MAX_STRUCTURE_LINES)
|
|
145
|
+
return;
|
|
146
|
+
if (!child.visible)
|
|
147
|
+
continue;
|
|
148
|
+
const childLayout = computeElementLayout(child, el);
|
|
149
|
+
const comp = placed.get(child.id);
|
|
150
|
+
if (comp) {
|
|
151
|
+
// Several of the same component next to each other: one line with a count
|
|
152
|
+
const last = structure[structure.length - 1];
|
|
153
|
+
if (last.component?.name === comp.name && last.depth === depth) {
|
|
154
|
+
last.count = (last.count ?? 1) + 1;
|
|
155
|
+
last.component.variants = [...(last.component.variants ?? [comp.name]), comp.variant];
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
structure.push({
|
|
159
|
+
depth,
|
|
160
|
+
part: toCaptureName(componentType(child)),
|
|
161
|
+
element: elementName(child.tag, child.role),
|
|
162
|
+
parent: parentPart,
|
|
163
|
+
...(childLayout ? { layout: childLayout } : {}),
|
|
164
|
+
styles: [],
|
|
165
|
+
component: { name: comp.name, file: comp.file, variants: [comp.variant] }
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (IMAGE_TAGS.has(child.tag)) {
|
|
171
|
+
structure.push({
|
|
172
|
+
depth,
|
|
173
|
+
part: 'image',
|
|
174
|
+
element: elementName(child.tag, child.role),
|
|
175
|
+
parent: parentPart,
|
|
176
|
+
...(childLayout ? { layout: childLayout } : {}),
|
|
177
|
+
styles: [],
|
|
178
|
+
image: { width: Math.round(child.rect.width * 100) / 100, height: Math.round(child.rect.height * 100) / 100, aspectRatio: aspectRatioOf(child.rect.width, child.rect.height) }
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (child.hasText) {
|
|
183
|
+
const part = partName(child);
|
|
184
|
+
structure.push({
|
|
185
|
+
depth,
|
|
186
|
+
part,
|
|
187
|
+
element: elementName(child.tag, child.role),
|
|
188
|
+
parent: parentPart,
|
|
189
|
+
...(childLayout ? { layout: childLayout } : {}),
|
|
190
|
+
styles: [...textStylesOf(child), ...layoutStyles(snap, child).filter(s => s.property !== 'display')]
|
|
191
|
+
});
|
|
192
|
+
texts.push({ part, el: child });
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const styles = layoutStyles(snap, child);
|
|
196
|
+
if (styles.length && depth < MAX_STRUCTURE_DEPTH) {
|
|
197
|
+
const box = boxPart(child);
|
|
198
|
+
structure.push({
|
|
199
|
+
depth,
|
|
200
|
+
part: box,
|
|
201
|
+
element: elementName(child.tag, child.role),
|
|
202
|
+
parent: parentPart,
|
|
203
|
+
...(childLayout ? { layout: childLayout } : {}),
|
|
204
|
+
styles
|
|
205
|
+
});
|
|
206
|
+
walk(child, depth + 1, box);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
walk(child, depth, parentPart);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
if (section.hasText)
|
|
214
|
+
texts.push({ part: 'container', el: section });
|
|
215
|
+
walk(section, 1, 'container');
|
|
216
|
+
// A variant list only when the components in a line are not all the same
|
|
217
|
+
for (const n of structure) {
|
|
218
|
+
const v = n.component?.variants;
|
|
219
|
+
if (n.component && v && v.every(x => x === n.component.name))
|
|
220
|
+
delete n.component.variants;
|
|
221
|
+
}
|
|
222
|
+
const layoutTree = buildLayoutTree(structure);
|
|
223
|
+
const contrast = texts.flatMap(t => { const c = contrastOf(snap, t.el, t.part); return c ? [c] : []; });
|
|
224
|
+
const counts = new Map();
|
|
225
|
+
for (const p of placed.values())
|
|
226
|
+
counts.set(p.name, (counts.get(p.name) ?? 0) + 1);
|
|
227
|
+
// The component a "within" group sits in, by name
|
|
228
|
+
const nameOf = (el) => placed.get(el.id)?.name;
|
|
229
|
+
return {
|
|
230
|
+
section: {
|
|
231
|
+
meta: { name: sectionName(section), scope: 'section', type: sectionType(section), source: snap.url, selector: section.selector, captured, method: 'measured' },
|
|
232
|
+
tokens: tokensOf(snap, structure),
|
|
233
|
+
structure,
|
|
234
|
+
...(layoutTree ? { layoutTree } : {}),
|
|
235
|
+
components: files.map((f, i) => {
|
|
236
|
+
const inside = groups[i].within ? nameOf(groups[i].within) : undefined;
|
|
237
|
+
return { name: f.meta.name, type: f.meta.type, file: captureFileName(f.meta), count: counts.get(f.meta.name) ?? 1, variants: f.variants?.length ?? 1, ...(inside ? { inside } : {}) };
|
|
238
|
+
}),
|
|
239
|
+
accessibility: { contrast }
|
|
240
|
+
},
|
|
241
|
+
components: files
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.js","sourceRoot":"","sources":["../src/section.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAA8C,MAAM,0BAA0B,CAAC;AACxJ,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AAC1J,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE1D,yGAAyG;AACzG,MAAM,CAAC,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AACnJ,oGAAoG;AACpG,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1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,CAAC,EAAE,EAAE;gBAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,MAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1E,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACxL,CAAC,CAAC;YACF,aAAa,EAAE,EAAE,QAAQ,EAAE;SAC5B;QACD,UAAU,EAAE,KAAK;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Spacing tool (FR15, FR16): padding, margin and gap of one element (authored), the distance
|
|
3
|
+
* between two elements (measured), and the page's spacing system: scale, base unit, outliers.
|
|
4
|
+
*/
|
|
5
|
+
import { type SpacingSet, type SpacingSystem, type SpacingToken } from '@luci-dev/format/capture';
|
|
6
|
+
import { type ElementSnapshot, type PageSnapshot, type Rect, type SnapshotProperty } from './model.js';
|
|
7
|
+
export interface SpacingUse {
|
|
8
|
+
el: ElementSnapshot;
|
|
9
|
+
property: SnapshotProperty;
|
|
10
|
+
kind: 'padding' | 'margin' | 'gap';
|
|
11
|
+
px: number;
|
|
12
|
+
computed: string;
|
|
13
|
+
authored?: string;
|
|
14
|
+
token?: string;
|
|
15
|
+
}
|
|
16
|
+
/** The spacing one element sets: positive px values, without the browser's defaults. */
|
|
17
|
+
export declare function spacingUses(el: ElementSnapshot): SpacingUse[];
|
|
18
|
+
export { BASE_UNITS, BASE_UNIT_MIN_STEPS, BASE_UNIT_REFINE, BASE_UNIT_REFINE_MIN, BASE_UNIT_SHARE, MULTIPLE_TOLERANCE, findBaseUnit } from '@luci-dev/format/capture';
|
|
19
|
+
/** The spacing system of the page (FR16). Null when nothing on the page sets spacing. */
|
|
20
|
+
export declare function spacingSystem(snapshot: PageSnapshot, options?: {
|
|
21
|
+
captured?: string;
|
|
22
|
+
}): SpacingSystem | null;
|
|
23
|
+
/** One spacing value set on an element (FR15 hover), labelled authored. */
|
|
24
|
+
export declare function spacingToken(snapshot: PageSnapshot, use: SpacingUse, options?: {
|
|
25
|
+
captured?: string;
|
|
26
|
+
}): SpacingToken;
|
|
27
|
+
/** Every spacing value one element sets, in one file (the Spacing tool's "All"). Null when it sets none. */
|
|
28
|
+
export declare function spacingSet(snapshot: PageSnapshot, el: ElementSnapshot, options?: {
|
|
29
|
+
captured?: string;
|
|
30
|
+
}): SpacingSet | null;
|
|
31
|
+
/**
|
|
32
|
+
* The gap between two boxes along the axis that separates them: vertical when they overlap
|
|
33
|
+
* horizontally, horizontal when they overlap vertically, else the larger of the two. 0 when they overlap.
|
|
34
|
+
*/
|
|
35
|
+
export declare function distanceBetween(a: Rect, b: Rect): {
|
|
36
|
+
px: number;
|
|
37
|
+
axis: 'vertical' | 'horizontal';
|
|
38
|
+
};
|
|
39
|
+
/** The measured distance between two picked elements (FR15 drag). */
|
|
40
|
+
export declare function distanceToken(snapshot: PageSnapshot, a: ElementSnapshot, b: ElementSnapshot, options?: {
|
|
41
|
+
captured?: string;
|
|
42
|
+
}): SpacingToken;
|
|
43
|
+
//# sourceMappingURL=spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../src/spacing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,O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