@luci-dev/capture 0.0.0-stage → 0.5.1
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
package/dist/ui/tools.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each toolbar tool produces from a pick. The view (toolbar.tsx) calls these; they hold no UI state.
|
|
3
|
+
* Every tool offers two outputs (FR5): this one item, or the whole system on the page.
|
|
4
|
+
*/
|
|
5
|
+
import { captureFileName, checkComponent, formatCapture, readComponentFile } from '@luci-dev/format/capture';
|
|
6
|
+
import { colorToken, colorUses, colorSystem, componentColorSet } from '../color.js';
|
|
7
|
+
import { anatomyOf, componentCapture, componentType, stateParts } from '../component.js';
|
|
8
|
+
import { DESKTOP_WIDTH, PHONE_WIDTH, chooseThresholds, mediaQueriesFor, mediaThresholds, readAtWidths, responsiveChanges, uniqueParts, widthsFor } from '../responsive.js';
|
|
9
|
+
import { imagesInside, readImage } from '../image.js';
|
|
10
|
+
import { focusDepthOf, prepareTargets, readComputed, readDisabled, readStatesFromRules, statesFromForced } from '../states.js';
|
|
11
|
+
import { snapshotPage } from '../dom.js';
|
|
12
|
+
import { pageCapture, pageComponents } from '../page.js';
|
|
13
|
+
import { sectionCapture, sectionGroups } from '../section.js';
|
|
14
|
+
import { distanceToken, spacingSet, spacingSystem, spacingToken, spacingUses } from '../spacing.js';
|
|
15
|
+
import { textToken, typographySystem } from '../text.js';
|
|
16
|
+
export const TOOLS = ['component', 'text', 'color', 'spacing'];
|
|
17
|
+
export const TOOL_LABELS = { component: 'Component', text: 'Text', color: 'Color', spacing: 'Spacing' };
|
|
18
|
+
export const toOutput = (capture, settings) => ({
|
|
19
|
+
capture,
|
|
20
|
+
fileName: captureFileName(capture.meta),
|
|
21
|
+
markdown: formatCapture(capture, settings)
|
|
22
|
+
});
|
|
23
|
+
export function liveSnapshot(doc = document) {
|
|
24
|
+
const nodes = [];
|
|
25
|
+
const snapshot = snapshotPage(doc, { nodes });
|
|
26
|
+
const index = new Map(nodes.map((n, i) => [n, i]));
|
|
27
|
+
return { snapshot, nodes, entryFor: el => snapshot.elements[index.get(el) ?? -1] ?? null };
|
|
28
|
+
}
|
|
29
|
+
/** The element whose text a Text pick means: the element itself, or the first text inside it. */
|
|
30
|
+
export function textTarget(live, entry) {
|
|
31
|
+
if (entry.hasText && entry.visible)
|
|
32
|
+
return entry;
|
|
33
|
+
const node = live.nodes[entry.id];
|
|
34
|
+
return live.snapshot.elements.find(e => e.id > entry.id && e.hasText && e.visible && node.contains(live.nodes[e.id])) ?? null;
|
|
35
|
+
}
|
|
36
|
+
/** Spacing values one element sets, for the Spacing tool to offer. */
|
|
37
|
+
export const spacingChoices = (entry) => spacingUses(entry);
|
|
38
|
+
/** The Spacing choice that takes every value of the element (the default). */
|
|
39
|
+
export const ALL_SPACING = -1;
|
|
40
|
+
const CAPTURED = () => new Date().toISOString().slice(0, 10);
|
|
41
|
+
/** How deep an element is inside a container (0 for the container itself, null outside it). */
|
|
42
|
+
export function insideOf(live, container) {
|
|
43
|
+
const root = live.nodes[container.id];
|
|
44
|
+
return (el) => {
|
|
45
|
+
let depth = 0;
|
|
46
|
+
for (let n = live.nodes[el.id] ?? null; n; n = n.parentElement ?? (n.getRootNode().host ?? null)) {
|
|
47
|
+
if (n === root)
|
|
48
|
+
return depth;
|
|
49
|
+
depth++;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** A component capture from a pick; `system` adds the page's variants. States are read separately (states.ts). */
|
|
55
|
+
export function captureComponent(live, entry, settings, options = {}) {
|
|
56
|
+
const images = componentImages(live, entry);
|
|
57
|
+
return { ok: true, output: toOutput(componentCapture(live.snapshot, entry, insideOf(live, entry), { captured: CAPTURED(), ...options, images, nodes: live.nodes }), settings) };
|
|
58
|
+
}
|
|
59
|
+
/** The images inside a component, read from the live page: how each is shown, never the image itself. */
|
|
60
|
+
export function componentImages(live, entry, cache = new Map()) {
|
|
61
|
+
const container = live.nodes[entry.id];
|
|
62
|
+
return imagesInside(container).flatMap(node => {
|
|
63
|
+
const el = live.entryFor(node);
|
|
64
|
+
return el ? [{ el, reading: readImage(node, container, cache) }] : [];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** The elements a component's states are read on: the container, its parts and every other element inside it. */
|
|
68
|
+
export function stateTargets(live, entry) {
|
|
69
|
+
return stateParts(live.snapshot, entry, insideOf(live, entry)).map(p => ({ part: p.part, el: live.nodes[p.el.id] }));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A point on the component where a real pointer would land on it (viewport px), or undefined when it
|
|
73
|
+
* is out of view or covered (by Luci's own panel, say). Tried: the centre, then points around it.
|
|
74
|
+
*/
|
|
75
|
+
export function pointerPointOf(el) {
|
|
76
|
+
const r = el.getBoundingClientRect();
|
|
77
|
+
const view = el.ownerDocument.defaultView;
|
|
78
|
+
if (!view || r.width < 1 || r.height < 1)
|
|
79
|
+
return undefined;
|
|
80
|
+
const root = el.getRootNode();
|
|
81
|
+
const spots = [[0.5, 0.5], [0.25, 0.25], [0.75, 0.25], [0.25, 0.75], [0.75, 0.75], [0.5, 0.15], [0.5, 0.85], [0.15, 0.5], [0.85, 0.5]];
|
|
82
|
+
for (const [fx, fy] of spots) {
|
|
83
|
+
const x = Math.round(r.left + r.width * fx);
|
|
84
|
+
const y = Math.round(r.top + r.height * fy);
|
|
85
|
+
if (x < 0 || y < 0 || x >= view.innerWidth || y >= view.innerHeight)
|
|
86
|
+
continue;
|
|
87
|
+
const hit = root.elementFromPoint(x, y);
|
|
88
|
+
if (hit && (hit === el || el.contains(hit)))
|
|
89
|
+
return { x, y };
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
/** Where the user's pointer is while states are read: on Luci's panel (or the top-left corner). */
|
|
94
|
+
function luciPanelPoint(doc) {
|
|
95
|
+
const panel = doc.querySelector('luci-toolbar')?.shadowRoot?.querySelector('.panel, .bar');
|
|
96
|
+
const r = panel?.getBoundingClientRect();
|
|
97
|
+
return r ? { x: Math.round(r.left + r.width / 2), y: Math.round(r.top + r.height / 2) } : { x: 0, y: 0 };
|
|
98
|
+
}
|
|
99
|
+
/** The resting values of the targets, for comparing a state captured by hand later. */
|
|
100
|
+
export const restingValues = (targets) => targets.map(t => readComputed(t.el));
|
|
101
|
+
/**
|
|
102
|
+
* A component's states (FR8): through the debugger when the shell has it (exact), otherwise from
|
|
103
|
+
* stylesheet rules; disabled for buttons and fields by setting the attribute for a moment. The page
|
|
104
|
+
* is left exactly as it was.
|
|
105
|
+
*/
|
|
106
|
+
export async function readComponentStates(live, entry, readForced) {
|
|
107
|
+
const targets = stateTargets(live, entry);
|
|
108
|
+
const container = targets[0].el;
|
|
109
|
+
// Before prepareTargets: the point must be read while the page looks as it does
|
|
110
|
+
const hoverPoint = pointerPointOf(container);
|
|
111
|
+
const restore = prepareTargets(targets);
|
|
112
|
+
try {
|
|
113
|
+
let pseudo;
|
|
114
|
+
let note = null;
|
|
115
|
+
if (readForced) {
|
|
116
|
+
try {
|
|
117
|
+
const options = { focusDepth: focusDepthOf(container), awayPoint: luciPanelPoint(container.ownerDocument), ...(hoverPoint ? { hoverPoint } : {}) };
|
|
118
|
+
pseudo = statesFromForced(targets, await readForced(targets.length, options));
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
pseudo = readStatesFromRules(targets);
|
|
122
|
+
note = `The browser's debugger was not available (${err instanceof Error ? err.message : String(err)}), so states were read from stylesheet rules.`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
pseudo = readStatesFromRules(targets);
|
|
127
|
+
}
|
|
128
|
+
const disabled = ['button', 'field'].includes(componentType(entry)) ? readDisabled(targets) : null;
|
|
129
|
+
return { states: [...pseudo, ...(disabled ? [disabled] : [])], note };
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
restore();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The design check (v0.3): capture the built component the way the Component tool does (states
|
|
137
|
+
* included), write it as a file, read both files back and compare them. The built side is written
|
|
138
|
+
* in px and hex; the design can use any unit and color setting.
|
|
139
|
+
*/
|
|
140
|
+
export async function checkAgainst(live, entry, design, readForced) {
|
|
141
|
+
const want = readComponentFile(design.markdown);
|
|
142
|
+
if (!want.ok)
|
|
143
|
+
return { ok: false, message: want.error };
|
|
144
|
+
const { states, note } = await readComponentStates(live, entry, readForced);
|
|
145
|
+
const r = captureComponent(live, entry, {}, { states });
|
|
146
|
+
if (!r.ok)
|
|
147
|
+
return r;
|
|
148
|
+
const have = readComponentFile(r.output.markdown);
|
|
149
|
+
if (!have.ok)
|
|
150
|
+
return { ok: false, message: `Luci could not read its own capture of the built component: ${have.error}` };
|
|
151
|
+
const result = checkComponent(want.value, have.value, { knownTokens: Object.keys(live.snapshot.customProperties) });
|
|
152
|
+
return { ok: true, result, design: want.value, built: r.output, note };
|
|
153
|
+
}
|
|
154
|
+
export const checkNote = (d, designFile) => ({
|
|
155
|
+
comment: d.comment,
|
|
156
|
+
priority: d.priority,
|
|
157
|
+
check: { design: designFile, part: d.part, ...(d.state ? { state: d.state } : {}), property: d.property, expected: d.expected, actual: d.actual }
|
|
158
|
+
});
|
|
159
|
+
/** "This one": one item from the picked element. */
|
|
160
|
+
export function captureOne(tool, live, entry, settings, choice = ALL_SPACING) {
|
|
161
|
+
const options = { captured: CAPTURED() };
|
|
162
|
+
if (tool === 'component')
|
|
163
|
+
return captureComponent(live, entry, settings);
|
|
164
|
+
if (tool === 'text') {
|
|
165
|
+
const target = textTarget(live, entry);
|
|
166
|
+
if (!target)
|
|
167
|
+
return { ok: false, message: 'This element has no text. Pick a heading, paragraph, link or label.' };
|
|
168
|
+
return { ok: true, output: toOutput(textToken(live.snapshot, target, options), settings) };
|
|
169
|
+
}
|
|
170
|
+
if (tool === 'color') {
|
|
171
|
+
const inside = insideOf(live, entry);
|
|
172
|
+
const setOrToken = componentColorSet(live.snapshot, entry, inside, options);
|
|
173
|
+
if (!setOrToken)
|
|
174
|
+
return { ok: false, message: 'This element and its parts apply no color of their own. Pick another, or use "Pick a pixel".' };
|
|
175
|
+
return { ok: true, output: toOutput(setOrToken, settings) };
|
|
176
|
+
}
|
|
177
|
+
const uses = spacingChoices(entry);
|
|
178
|
+
const none = { ok: false, message: 'This element sets no padding, margin or gap. Pick another, or drag between two elements to measure.' };
|
|
179
|
+
// ALL_SPACING (the default): every value in one file; one value alone stays a single token
|
|
180
|
+
if (choice === ALL_SPACING && uses.length > 1) {
|
|
181
|
+
const set = spacingSet(live.snapshot, entry, options);
|
|
182
|
+
return set ? { ok: true, output: toOutput(set, settings) } : none;
|
|
183
|
+
}
|
|
184
|
+
const use = uses[Math.max(0, choice)];
|
|
185
|
+
if (!use)
|
|
186
|
+
return none;
|
|
187
|
+
return { ok: true, output: toOutput(spacingToken(live.snapshot, use, options), settings) };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The states of one component of a page file: from stylesheet rules, plus disabled for buttons and
|
|
191
|
+
* fields. Only the states found: a page file has no "capture by hand", so "not detected" is noise there.
|
|
192
|
+
*/
|
|
193
|
+
function ruleStates(live, entry) {
|
|
194
|
+
const targets = stateTargets(live, entry);
|
|
195
|
+
const restore = prepareTargets(targets);
|
|
196
|
+
try {
|
|
197
|
+
const disabled = ['button', 'field'].includes(componentType(entry)) ? readDisabled(targets) : null;
|
|
198
|
+
return [...readStatesFromRules(targets), ...(disabled ? [disabled] : [])].filter(s => s.detected);
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
restore();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** One component of a page file, read from the live page: its states and images. A part that fails is listed in `skipped`. */
|
|
205
|
+
function readPageComponent(live, entry, skipped, rules) {
|
|
206
|
+
let states = [];
|
|
207
|
+
try {
|
|
208
|
+
states = ruleStates(live, entry);
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
skipped.push({ part: `states of ${entry.selector}`, reason: (err instanceof Error ? err.message : String(err)).slice(0, 200) });
|
|
212
|
+
}
|
|
213
|
+
let images = [];
|
|
214
|
+
try {
|
|
215
|
+
images = componentImages(live, entry, rules);
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
skipped.push({ part: `images of ${entry.selector}`, reason: (err instanceof Error ? err.message : String(err)).slice(0, 200) });
|
|
219
|
+
}
|
|
220
|
+
return { entry, inside: insideOf(live, entry), states, images };
|
|
221
|
+
}
|
|
222
|
+
function pageResult(live, components, skipped, settings, captured) {
|
|
223
|
+
const page = pageCapture(live.snapshot, components, { captured, skipped });
|
|
224
|
+
if (!page.typography && !page.color && !page.spacing && !page.components.length)
|
|
225
|
+
return { ok: false, message: 'This page has nothing visible to capture.' };
|
|
226
|
+
return { ok: true, output: toOutput(page, settings) };
|
|
227
|
+
}
|
|
228
|
+
/** "Whole page": one file with the page's systems and every kind of component on it. */
|
|
229
|
+
export function capturePage(live, settings, options = {}) {
|
|
230
|
+
const skipped = [];
|
|
231
|
+
const rules = new Map();
|
|
232
|
+
const components = pageComponents(live.snapshot).map(entry => readPageComponent(live, entry, skipped, rules));
|
|
233
|
+
return pageResult(live, components, skipped, settings, options.captured ?? CAPTURED());
|
|
234
|
+
}
|
|
235
|
+
/** The steps of "Whole page", as the loader says them. */
|
|
236
|
+
export const PAGE_STEPS = {
|
|
237
|
+
snapshot: 'Reading the page',
|
|
238
|
+
component: (i, n) => `Components ${i} of ${n}: states and images`,
|
|
239
|
+
systems: 'Text styles, colors and spacing'
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* "Whole page" in steps, the same file as capturePage: between steps it waits for `pause` (the
|
|
243
|
+
* toolbar: the next paint), so the loader can show where Luci is on a large page.
|
|
244
|
+
*/
|
|
245
|
+
export async function capturePageInSteps(doc, settings, options = {}) {
|
|
246
|
+
const pause = options.pause ?? (() => new Promise(r => setTimeout(r, 0)));
|
|
247
|
+
const step = async (text) => { options.onStep?.(text); await pause(); };
|
|
248
|
+
await step(PAGE_STEPS.snapshot);
|
|
249
|
+
const live = liveSnapshot(doc);
|
|
250
|
+
const skipped = [];
|
|
251
|
+
const rules = new Map();
|
|
252
|
+
const entries = pageComponents(live.snapshot);
|
|
253
|
+
const components = [];
|
|
254
|
+
for (const [i, entry] of entries.entries()) {
|
|
255
|
+
await step(PAGE_STEPS.component(i + 1, entries.length));
|
|
256
|
+
components.push(readPageComponent(live, entry, skipped, rules));
|
|
257
|
+
}
|
|
258
|
+
await step(PAGE_STEPS.systems);
|
|
259
|
+
return pageResult(live, components, skipped, settings, options.captured ?? CAPTURED());
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* "This section" (v0.2): the section file (layout outline, components placed by reference) plus one
|
|
263
|
+
* component file per kind of component in it, each with its variants in the section and the states
|
|
264
|
+
* its stylesheet rules give it (as in the full-page reference).
|
|
265
|
+
*/
|
|
266
|
+
export function captureSection(live, entry, settings, options = {}) {
|
|
267
|
+
if (entry.tag === 'body' || entry.tag === 'html') {
|
|
268
|
+
return { ok: false, message: 'Pick one section of the page (a hero, a pricing section, a footer). For the whole page, use Whole page.' };
|
|
269
|
+
}
|
|
270
|
+
const inside = insideOf(live, entry);
|
|
271
|
+
const groups = sectionGroups(live.snapshot, entry, inside);
|
|
272
|
+
const skipped = [];
|
|
273
|
+
const rules = new Map();
|
|
274
|
+
const inputs = groups.map(g => readPageComponent(live, g.example, skipped, rules));
|
|
275
|
+
const { section, components } = sectionCapture(live.snapshot, entry, inside, groups, inputs, { captured: options.captured ?? CAPTURED() });
|
|
276
|
+
return { ok: true, output: { ...toOutput(section, settings), files: components.map(c => toOutput(c, settings)) } };
|
|
277
|
+
}
|
|
278
|
+
/** Widths read when no media query styles the component: a phone and a desktop. */
|
|
279
|
+
export const COMMON_WIDTHS = [PHONE_WIDTH, DESKTOP_WIDTH];
|
|
280
|
+
/**
|
|
281
|
+
* One width's reading of a component or section (v0.3.4): its parts and their styles, found by its
|
|
282
|
+
* element in this page, or by its selector in another (a frame). Null while it is not there yet.
|
|
283
|
+
*/
|
|
284
|
+
export function partsAt(doc, kind, target) {
|
|
285
|
+
const el = typeof target === 'string' ? doc.querySelector(target) : target;
|
|
286
|
+
if (!el)
|
|
287
|
+
return null;
|
|
288
|
+
const live = liveSnapshot(doc);
|
|
289
|
+
let entry = null;
|
|
290
|
+
for (let n = el; n && !entry; n = n.parentElement)
|
|
291
|
+
entry = live.entryFor(n);
|
|
292
|
+
if (!entry)
|
|
293
|
+
return null;
|
|
294
|
+
const inside = insideOf(live, entry);
|
|
295
|
+
if (kind === 'component')
|
|
296
|
+
return anatomyOf(live.snapshot, entry, inside).map(p => ({ part: p.part, styles: p.styles }));
|
|
297
|
+
const groups = sectionGroups(live.snapshot, entry, inside);
|
|
298
|
+
const inputs = groups.map(g => ({ entry: g.example, inside: insideOf(live, g.example), states: [], images: [] }));
|
|
299
|
+
const { section } = sectionCapture(live.snapshot, entry, inside, groups, inputs, { captured: CAPTURED() });
|
|
300
|
+
return uniqueParts(section.structure.map(n => ({ part: n.part, styles: n.styles })));
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* How a picked component or section changes by width: the widths from the media queries that style
|
|
304
|
+
* it (or a phone and a desktop), each read with the page's own styles, and what differs.
|
|
305
|
+
*/
|
|
306
|
+
export async function readResponsive(live, entry, kind, options = {}) {
|
|
307
|
+
const node = live.nodes[entry.id];
|
|
308
|
+
const doc = node.ownerDocument;
|
|
309
|
+
const queries = mediaQueriesFor(node);
|
|
310
|
+
const thresholds = queries.flatMap(q => mediaThresholds(q.condition).map(px => ({ px, weight: q.rules, condition: q.condition })));
|
|
311
|
+
const chosen = chooseThresholds(thresholds);
|
|
312
|
+
const widths = chosen.length ? widthsFor(chosen) : [...COMMON_WIDTHS];
|
|
313
|
+
// The queries behind the chosen breakpoints (one left out is not listed)
|
|
314
|
+
const conditions = [...new Set(thresholds.filter(t => chosen.includes(t.px)).map(t => t.condition))];
|
|
315
|
+
const selector = entry.selector;
|
|
316
|
+
const readings = await readAtWidths(doc, widths, d => partsAt(d, kind, d === doc ? node : selector), {
|
|
317
|
+
...(options.setWidth ? { setWidth: options.setWidth } : {}),
|
|
318
|
+
...(options.timeoutMs ? { timeoutMs: options.timeoutMs } : {}),
|
|
319
|
+
onWidth: (w, i) => options.onWidth?.(w, i, widths.length)
|
|
320
|
+
});
|
|
321
|
+
return { widths, queries: conditions, changes: responsiveChanges(readings) };
|
|
322
|
+
}
|
|
323
|
+
/** The color of a pixel from the eyedropper. */
|
|
324
|
+
export function capturePixel(live, hex, settings) {
|
|
325
|
+
const token = colorToken(live.snapshot, { pixel: hex }, { captured: CAPTURED() });
|
|
326
|
+
return token ? { ok: true, output: toOutput(token, settings) } : { ok: false, message: `Not a color: ${hex}` };
|
|
327
|
+
}
|
|
328
|
+
/** The distance between two elements (a Spacing drag). */
|
|
329
|
+
export function captureDistance(live, a, b, settings) {
|
|
330
|
+
return { ok: true, output: toOutput(distanceToken(live.snapshot, a, b, { captured: CAPTURED() }), settings) };
|
|
331
|
+
}
|
|
332
|
+
/** "The whole system": the page's typography, colors or spacing; for a component, its variants on the page. */
|
|
333
|
+
export function captureSystem(tool, live, settings, entry) {
|
|
334
|
+
const options = { captured: CAPTURED() };
|
|
335
|
+
if (tool === 'component') {
|
|
336
|
+
if (!entry || entry.tag === 'body' || entry.tag === 'html')
|
|
337
|
+
return { ok: false, message: 'Pick a component first (a button, card, link...), then "The whole system" lists its variants on this page.' };
|
|
338
|
+
return captureComponent(live, entry, settings, { system: true });
|
|
339
|
+
}
|
|
340
|
+
const system = tool === 'text' ? typographySystem(live.snapshot, options) : tool === 'color' ? colorSystem(live.snapshot, options) : spacingSystem(live.snapshot, options);
|
|
341
|
+
if (!system)
|
|
342
|
+
return { ok: false, message: `This page has no ${tool === 'text' ? 'visible text' : tool === 'color' ? 'visible colors' : 'spacing'} to capture.` };
|
|
343
|
+
return { ok: true, output: toOutput(system, settings) };
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/ui/tools.ts"],"names":[],"mappings":"AAAA;;;GAG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AE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3K,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,oBAAoB,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC;IACjK,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;AAC1D,CAAC"}
|
package/dist/ui/zip.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal .zip writer for a section's files (a section file and its component files): files are
|
|
3
|
+
* stored, not compressed (Markdown is small), so no compression library is needed. UTF-8 names,
|
|
4
|
+
* CRC-32, one central directory. Pure and browser-safe.
|
|
5
|
+
*/
|
|
6
|
+
export declare function crc32(data: Uint8Array): number;
|
|
7
|
+
export interface ZipEntry {
|
|
8
|
+
/** A relative path with forward slashes. */
|
|
9
|
+
name: string;
|
|
10
|
+
data: Uint8Array | string;
|
|
11
|
+
}
|
|
12
|
+
/** The archive's bytes. Throws on an unsafe or repeated name. */
|
|
13
|
+
export declare function zip(entries: readonly ZipEntry[], date?: Date): Uint8Array;
|
|
14
|
+
/** The files of a stored-only archive (for tests and checks): name -> text. */
|
|
15
|
+
export declare function unzipStored(bytes: Uint8Array): Record<string, string>;
|
|
16
|
+
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../src/ui/zip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAI9C;AAED,MAAM,WAAW,QAAQ;IACvB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;CAC3B;AAED,iEAAiE;AACjE,wBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,QAAQ,EAAE,EAAE,IAAI,OAAa,GAAG,UAAU,CA+D/E;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcrE"}
|
package/dist/ui/zip.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal .zip writer for a section's files (a section file and its component files): files are
|
|
3
|
+
* stored, not compressed (Markdown is small), so no compression library is needed. UTF-8 names,
|
|
4
|
+
* CRC-32, one central directory. Pure and browser-safe.
|
|
5
|
+
*/
|
|
6
|
+
const CRC_TABLE = (() => {
|
|
7
|
+
const table = new Uint32Array(256);
|
|
8
|
+
for (let n = 0; n < 256; n++) {
|
|
9
|
+
let c = n;
|
|
10
|
+
for (let k = 0; k < 8; k++)
|
|
11
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
12
|
+
table[n] = c >>> 0;
|
|
13
|
+
}
|
|
14
|
+
return table;
|
|
15
|
+
})();
|
|
16
|
+
export function crc32(data) {
|
|
17
|
+
let c = 0xffffffff;
|
|
18
|
+
for (const byte of data)
|
|
19
|
+
c = CRC_TABLE[(c ^ byte) & 0xff] ^ (c >>> 8);
|
|
20
|
+
return (c ^ 0xffffffff) >>> 0;
|
|
21
|
+
}
|
|
22
|
+
/** The archive's bytes. Throws on an unsafe or repeated name. */
|
|
23
|
+
export function zip(entries, date = new Date()) {
|
|
24
|
+
const enc = new TextEncoder();
|
|
25
|
+
const time = (date.getHours() << 11) | (date.getMinutes() << 5) | (date.getSeconds() >> 1);
|
|
26
|
+
const day = ((Math.max(1980, date.getFullYear()) - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate();
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
const parts = [];
|
|
29
|
+
const central = [];
|
|
30
|
+
let offset = 0;
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
if (!entry.name || /^\/|\\|(^|\/)\.\.(\/|$)/.test(entry.name))
|
|
33
|
+
throw new Error(`not a safe file name in a zip: ${entry.name}`);
|
|
34
|
+
if (seen.has(entry.name))
|
|
35
|
+
throw new Error(`two files named ${entry.name}`);
|
|
36
|
+
seen.add(entry.name);
|
|
37
|
+
const name = enc.encode(entry.name);
|
|
38
|
+
const data = typeof entry.data === 'string' ? enc.encode(entry.data) : entry.data;
|
|
39
|
+
const crc = crc32(data);
|
|
40
|
+
const local = new Uint8Array(30 + name.length);
|
|
41
|
+
const l = new DataView(local.buffer);
|
|
42
|
+
l.setUint32(0, 0x04034b50, true); // local file header
|
|
43
|
+
l.setUint16(4, 20, true); // version needed: 2.0
|
|
44
|
+
l.setUint16(6, 0x0800, true); // flags: UTF-8 names
|
|
45
|
+
l.setUint16(8, 0, true); // method: stored
|
|
46
|
+
l.setUint16(10, time, true);
|
|
47
|
+
l.setUint16(12, day, true);
|
|
48
|
+
l.setUint32(14, crc, true);
|
|
49
|
+
l.setUint32(18, data.length, true);
|
|
50
|
+
l.setUint32(22, data.length, true);
|
|
51
|
+
l.setUint16(26, name.length, true);
|
|
52
|
+
local.set(name, 30);
|
|
53
|
+
const dir = new Uint8Array(46 + name.length);
|
|
54
|
+
const d = new DataView(dir.buffer);
|
|
55
|
+
d.setUint32(0, 0x02014b50, true); // central directory header
|
|
56
|
+
d.setUint16(4, 20, true); // made by
|
|
57
|
+
d.setUint16(6, 20, true); // version needed
|
|
58
|
+
d.setUint16(8, 0x0800, true);
|
|
59
|
+
d.setUint16(10, 0, true);
|
|
60
|
+
d.setUint16(12, time, true);
|
|
61
|
+
d.setUint16(14, day, true);
|
|
62
|
+
d.setUint32(16, crc, true);
|
|
63
|
+
d.setUint32(20, data.length, true);
|
|
64
|
+
d.setUint32(24, data.length, true);
|
|
65
|
+
d.setUint16(28, name.length, true);
|
|
66
|
+
d.setUint32(42, offset, true); // where the local header starts
|
|
67
|
+
dir.set(name, 46);
|
|
68
|
+
parts.push(local, data);
|
|
69
|
+
central.push(dir);
|
|
70
|
+
offset += local.length + data.length;
|
|
71
|
+
}
|
|
72
|
+
const dirSize = central.reduce((n, c) => n + c.length, 0);
|
|
73
|
+
const end = new Uint8Array(22);
|
|
74
|
+
const e = new DataView(end.buffer);
|
|
75
|
+
e.setUint32(0, 0x06054b50, true); // end of central directory
|
|
76
|
+
e.setUint16(8, central.length, true);
|
|
77
|
+
e.setUint16(10, central.length, true);
|
|
78
|
+
e.setUint32(12, dirSize, true);
|
|
79
|
+
e.setUint32(16, offset, true);
|
|
80
|
+
const out = new Uint8Array(offset + dirSize + end.length);
|
|
81
|
+
let at = 0;
|
|
82
|
+
for (const p of [...parts, ...central, end]) {
|
|
83
|
+
out.set(p, at);
|
|
84
|
+
at += p.length;
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
/** The files of a stored-only archive (for tests and checks): name -> text. */
|
|
89
|
+
export function unzipStored(bytes) {
|
|
90
|
+
const dec = new TextDecoder();
|
|
91
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
92
|
+
const out = {};
|
|
93
|
+
let at = 0;
|
|
94
|
+
while (at + 30 <= bytes.length && view.getUint32(at, true) === 0x04034b50) {
|
|
95
|
+
const size = view.getUint32(at + 18, true);
|
|
96
|
+
const nameLength = view.getUint16(at + 26, true);
|
|
97
|
+
const name = dec.decode(bytes.subarray(at + 30, at + 30 + nameLength));
|
|
98
|
+
const start = at + 30 + nameLength;
|
|
99
|
+
out[name] = dec.decode(bytes.subarray(start, start + size));
|
|
100
|
+
at = start + size;
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=zip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../../src/ui/zip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE;IACtB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACzE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,UAAU,KAAK,CAAC,IAAgB;IACpC,IAAI,CAAC,GAAG,UAAU,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,IAAI;QAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAQD,iEAAiE;AACjE,MAAM,UAAU,GAAG,CAAC,OAA4B,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE;IACjE,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,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AK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5E,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,OAAO,EAAE,GAAG,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;QACnC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;QAC5D,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luci-dev/capture",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Capture: the picker, the eligibility check and the Text, Colour and Spacing tools. Browser-safe.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./states": {
|
|
13
|
+
"types": "./dist/states.d.ts",
|
|
14
|
+
"default": "./dist/states.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@luci-dev/format": "0.5.1",
|
|
22
|
+
"@luci-dev/ui": "0.5.1",
|
|
23
|
+
"culori": "4.0.2",
|
|
24
|
+
"preact": "10.29.8"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/culori": "4.0.1"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
6
32
|
}
|
package/README.md
DELETED