@whzxc/agent-design-gallery 0.14.1 → 0.16.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/README.md +29 -16
- package/package.json +2 -1
- package/public/access.css +15 -2
- package/public/app.js +1284 -521
- package/public/arrangement-worker.js +7 -7
- package/public/arrangement.js +35 -30
- package/public/assets.js +85 -48
- package/public/auth.js +59 -4
- package/public/boards.js +129 -0
- package/public/comment-anchors.js +50 -0
- package/public/comments.css +400 -0
- package/public/comments.js +1106 -0
- package/public/context-menu.js +97 -0
- package/public/frame-identity.js +51 -14
- package/public/hub.css +25 -3
- package/public/hub.html +10 -2
- package/public/hub.js +127 -23
- package/public/icons.js +9 -0
- package/public/index.html +26 -10
- package/public/instance-actions.js +9 -2
- package/public/layout.js +156 -86
- package/public/motion-flow.js +28 -0
- package/public/motion-identity.js +100 -0
- package/public/motion-paint.js +332 -0
- package/public/motion-scene.js +165 -0
- package/public/motion-specimens.js +335 -0
- package/public/player.css +270 -0
- package/public/player.js +753 -0
- package/public/recent-updates.js +535 -0
- package/public/selection.js +1 -1
- package/public/style.css +91 -154
- package/public/switcher.css +5 -4
- package/public/switcher.js +109 -34
- package/public/token-catalog.js +8 -3
- package/public/tokens.css +20 -1
- package/public/view-boards.css +131 -0
- package/public/view-boards.js +350 -0
- package/public/view-route.js +1 -2
- package/src/boards/board.mjs +30 -0
- package/src/boards/motion-board.mjs +202 -0
- package/src/boards/token-board.mjs +200 -0
- package/src/cli-output.mjs +10 -5
- package/src/cli.mjs +89 -35
- package/src/comments.mjs +293 -0
- package/src/http.mjs +7 -5
- package/src/hub/project-link.mjs +41 -0
- package/src/hub/registry.mjs +5 -0
- package/src/hub.mjs +14 -10
- package/src/link.mjs +13 -1
- package/src/recent-frames.mjs +295 -0
- package/src/recent-history.mjs +100 -0
- package/src/recent-job.mjs +63 -0
- package/src/recent-worker.mjs +171 -0
- package/src/server.mjs +285 -110
- package/src/service.mjs +46 -12
- package/src/toolkit/arch-git.mjs +8 -14
- package/src/toolkit/arch.mjs +3 -2
- package/src/toolkit/asset-rules.mjs +24 -1
- package/src/toolkit/browser.mjs +1 -13
- package/src/toolkit/build-store.mjs +9 -1
- package/src/toolkit/build-worker.mjs +6 -0
- package/src/toolkit/build.mjs +22 -16
- package/src/toolkit/commands.mjs +105 -9
- package/src/toolkit/compare.mjs +13 -11
- package/src/toolkit/config.mjs +2 -2
- package/{public/review.js → src/toolkit/diff-document.mjs} +137 -43
- package/src/toolkit/diff-inputs.mjs +97 -52
- package/src/toolkit/diff.mjs +198 -43
- package/src/toolkit/frame-declarations.mjs +36 -0
- package/src/toolkit/git-blobs.mjs +50 -0
- package/src/toolkit/impact-inputs.mjs +11 -19
- package/src/toolkit/impact-selection.mjs +27 -12
- package/src/toolkit/impact.mjs +49 -15
- package/src/toolkit/implementation-map.mjs +17 -6
- package/src/toolkit/input-generation.mjs +15 -0
- package/src/toolkit/inspect-output.mjs +1 -1
- package/src/toolkit/inspect.d.ts +9 -1
- package/src/toolkit/inspect.mjs +25 -1
- package/src/toolkit/motion-check.mjs +382 -0
- package/src/toolkit/motion-css.mjs +105 -0
- package/src/toolkit/motion-flows.mjs +95 -0
- package/src/toolkit/motion-impact.mjs +87 -0
- package/src/toolkit/motion-inventory.mjs +202 -0
- package/src/toolkit/motion-label.mjs +111 -0
- package/src/toolkit/motion-patterns.mjs +216 -0
- package/src/toolkit/motion-primitives.mjs +94 -0
- package/src/toolkit/motion-queries.mjs +169 -0
- package/src/toolkit/motion.mjs +300 -0
- package/src/toolkit/move-pairing.mjs +140 -0
- package/src/toolkit/owner.mjs +19 -6
- package/src/toolkit/play-endpoint.mjs +66 -0
- package/src/toolkit/project-index.mjs +4 -4
- package/src/toolkit/recent-structure.mjs +201 -0
- package/src/toolkit/results.mjs +3 -3
- package/src/toolkit/review-document.mjs +440 -0
- package/src/toolkit/review-embed-document.mjs +671 -0
- package/src/toolkit/review-filmstrip.mjs +76 -0
- package/src/toolkit/review-groups.mjs +29 -0
- package/src/toolkit/review-motion-card.mjs +51 -0
- package/src/toolkit/review-motion.mjs +159 -0
- package/src/toolkit/review-observation.mjs +131 -0
- package/src/toolkit/review-playback.js +123 -0
- package/src/toolkit/review-sheet.mjs +125 -0
- package/src/toolkit/review-specimens.mjs +60 -0
- package/src/toolkit/review.mjs +240 -0
- package/src/toolkit/runtime.mjs +8 -2
- package/src/toolkit/theme.mjs +16 -0
- package/src/viewer-cache.mjs +48 -12
- package/public/annotations.js +0 -816
- package/public/labels.js +0 -122
- package/src/annotations.mjs +0 -238
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { edgePresentation } from './motion-label.mjs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { frameKey, motionFlows } from './motion-flows.mjs';
|
|
5
|
+
import { readMotion, resolveMotionToken, timingRefs } from './motion.mjs';
|
|
6
|
+
import { relative, loadTokens } from './project.mjs';
|
|
7
|
+
import { CliError } from '../cli-output.mjs';
|
|
8
|
+
|
|
9
|
+
// The server has already resolved the requested name against its current TSX inventory.
|
|
10
|
+
export function sourceMotion(config, root, source) {
|
|
11
|
+
const owner = relative(config, path.join(root, source));
|
|
12
|
+
const sidecar = path.join(root, source.replace(/\.tsx$/, '.motion.json'));
|
|
13
|
+
const graph = readMotion(config, existsSync(sidecar) ? [sidecar] : []);
|
|
14
|
+
return {
|
|
15
|
+
records: graph.records.filter(r => r.valid && r.edge.from.source === owner),
|
|
16
|
+
declarations: graph.declarations
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function playbackGraph(config, root, owners, inventory) {
|
|
20
|
+
const records = [], declarations = [];
|
|
21
|
+
for (const source of [...owners.keys()].sort()) {
|
|
22
|
+
const indexed = owners.get(source);
|
|
23
|
+
if (indexed.error) continue;
|
|
24
|
+
try {
|
|
25
|
+
indexed.motion ??= sourceMotion(config, root, source);
|
|
26
|
+
records.push(...indexed.motion.records);
|
|
27
|
+
declarations.push(...indexed.motion.declarations);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
indexed.error = error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const design = relative(config, root);
|
|
33
|
+
const prefix = design ? design + '/' : '';
|
|
34
|
+
const available = (ref) => ref.source.startsWith(prefix) && inventory.has(ref.source.slice(prefix.length));
|
|
35
|
+
const playable = records.filter(({ edge }) => available(edge.from) && available(edge.to));
|
|
36
|
+
return { records, flows: motionFlows(playable, declarations).byFrame };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function playEndpoint(config, root, source, frame, theme, build, graph) {
|
|
40
|
+
const ref = { source: relative(config, path.join(root, source)), frame };
|
|
41
|
+
const records = graph.records.filter(r => r.edge.from.source === ref.source && r.edge.from.frame === frame);
|
|
42
|
+
const built = await build(source),
|
|
43
|
+
endpoint = built.frames.find((f) => f.name === frame);
|
|
44
|
+
if (!endpoint) throw new CliError('FRAME_NOT_FOUND', 'Unknown playback frame.');
|
|
45
|
+
const tokens = loadTokens(config),
|
|
46
|
+
design = relative(config, root);
|
|
47
|
+
const edges = records.map(({ edge }) => playbackEdge(edge, endpoint, tokens, theme, design));
|
|
48
|
+
return {
|
|
49
|
+
design,
|
|
50
|
+
source,
|
|
51
|
+
frame,
|
|
52
|
+
html: endpoint.html,
|
|
53
|
+
css: built.css,
|
|
54
|
+
width: endpoint.width,
|
|
55
|
+
height: endpoint.height,
|
|
56
|
+
edges,
|
|
57
|
+
flow: graph.flows.get(frameKey(ref)) ?? null
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function playbackEdge(edge, endpoint, tokens, theme, design) {
|
|
62
|
+
const timings = Object.fromEntries(timingRefs(edge).map(({ pointer, name, kind }) =>
|
|
63
|
+
[pointer, resolveMotionToken(tokens, theme, name, kind).value]));
|
|
64
|
+
if (Object.values(timings).includes(null)) throw Error('Unresolved timing on ' + edge.id + '. Run adg check.');
|
|
65
|
+
return { ...edge, ...edgePresentation(edge, endpoint.html, design), authoredLabel: !!edge.label, timings };
|
|
66
|
+
}
|
|
@@ -47,7 +47,7 @@ async function resolutionFiles(config, artifactDirectory) {
|
|
|
47
47
|
return files.sort();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export async function openProjectIndex(config, { stateDirectory = defaultStateDirectory, persist = true, fresh = false, artifactDirectory } = {}) {
|
|
50
|
+
export async function openProjectIndex(config, { stateDirectory = defaultStateDirectory, persist = true, fresh = false, frameOrigins = false, artifactDirectory } = {}) {
|
|
51
51
|
const inventory = discoverProject(config), root = await realpath(config.root), buildPromises = new Map();
|
|
52
52
|
const directory = path.join(stateDirectory, 'cache', indexDigest(root), 'index-v1');
|
|
53
53
|
const shards = await createIndexStore({ directory, persist });
|
|
@@ -91,7 +91,7 @@ export async function openProjectIndex(config, { stateDirectory = defaultStateDi
|
|
|
91
91
|
if (!materializations.has(source)) {
|
|
92
92
|
requestedSources.add(source); freshPool ??= new BuildPool();
|
|
93
93
|
materializations.set(source, freshPool.run({ config: { root, design: physicalDesign ?? config.design, output: config.output,
|
|
94
|
-
sources: config.sources, arch: config.arch, check: config.check, allowLegacy: false },
|
|
94
|
+
sources: config.sources, arch: config.arch, check: config.check, allowLegacy: false, frameOrigins },
|
|
95
95
|
name: path.relative(physicalDesign ?? config.design, path.join(root, source)).split(path.sep).join('/') }, new AbortController().signal).then(built => {
|
|
96
96
|
observeDependencies(built);
|
|
97
97
|
for (const frame of built.frames) frame.document = theme => frameDocument(frame, theme, built.css);
|
|
@@ -184,8 +184,8 @@ export async function openProjectIndex(config, { stateDirectory = defaultStateDi
|
|
|
184
184
|
try { text = await readFile(path.join(config.root, side), 'utf8'); } catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
185
185
|
return cached('architecture', { source, text }, () => ({ source, sidecar: side, ...sidecar(text) }));
|
|
186
186
|
},
|
|
187
|
-
async relationships({ facts: supplied, projectPaths = false } = {}) {
|
|
188
|
-
const assets = await Promise.all(
|
|
187
|
+
async relationships({ facts: supplied, projectPaths = false, sources = inventory.tsx } = {}) {
|
|
188
|
+
const assets = await Promise.all(sources.map(async source => {
|
|
189
189
|
const facts = supplied?.get(source) ?? await this.source(source);
|
|
190
190
|
if (projectPaths) return { path: source, imports: facts.imports };
|
|
191
191
|
const designRelative = file => path.relative(config.design, path.join(config.root, file)).split(path.sep).join('/');
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { declarations } from './frame-declarations.mjs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { liveDependencies } from './input-generation.mjs';
|
|
4
|
+
import { readFile } from 'node:fs/promises';
|
|
5
|
+
import { prepareImpactInputs } from './impact-inputs.mjs';
|
|
6
|
+
import { canonicalBytes } from './impact-proof.mjs';
|
|
7
|
+
import { impact } from './impact.mjs';
|
|
8
|
+
import { openProjectIndex } from './project-index.mjs';
|
|
9
|
+
import { readGroups, relative, sourceFeature } from './project.mjs';
|
|
10
|
+
|
|
11
|
+
function inventoryMoves(rows, renames, complete) {
|
|
12
|
+
const removed = rows.filter((r) => r.status === 'removed'),
|
|
13
|
+
added = rows.filter((r) => r.status === 'added');
|
|
14
|
+
const paired = new Map(),
|
|
15
|
+
consumed = new Set();
|
|
16
|
+
// Git source rename plus stable frame name wins even when several sources use that name.
|
|
17
|
+
// Otherwise a name must occur only once in each complete endpoint inventory.
|
|
18
|
+
const afterById = new Map(added.map((r) => [JSON.stringify([r.source, r.frame]), r]));
|
|
19
|
+
for (const old of removed) {
|
|
20
|
+
const next = afterById.get(JSON.stringify([renames.get(old.source), old.frame]));
|
|
21
|
+
if (next) {
|
|
22
|
+
paired.set(next, old);
|
|
23
|
+
consumed.add(old);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!complete) return { paired, consumed };
|
|
27
|
+
const before = new Map(),
|
|
28
|
+
after = new Map();
|
|
29
|
+
for (const row of rows) {
|
|
30
|
+
if (row.before) before.set(row.frame, before.has(row.frame) ? null : row);
|
|
31
|
+
if (row.after) after.set(row.frame, after.has(row.frame) ? null : row);
|
|
32
|
+
}
|
|
33
|
+
for (const old of removed) {
|
|
34
|
+
const next = after.get(old.frame);
|
|
35
|
+
if (!consumed.has(old) && before.get(old.frame) === old && next?.status === 'added' && !paired.has(next)) {
|
|
36
|
+
paired.set(next, old);
|
|
37
|
+
consumed.add(old);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { paired, consumed };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function structuralChanges(config, options) {
|
|
44
|
+
const started = performance.now();
|
|
45
|
+
const inputs = await prepareImpactInputs(config, options);
|
|
46
|
+
// An immutable documentation-only range outside both design and architecture trees
|
|
47
|
+
// has identical source inputs. Config imports and the effective capture policy still count.
|
|
48
|
+
const endpoints = [inputs.session.before, inputs.session.after];
|
|
49
|
+
const policy = ({ config: c }) =>
|
|
50
|
+
canonicalBytes({
|
|
51
|
+
sources: c.sources,
|
|
52
|
+
design: relative(c, c.design),
|
|
53
|
+
arch: c.arch && relative(c, c.arch),
|
|
54
|
+
check: c.check,
|
|
55
|
+
diff: c.diff
|
|
56
|
+
});
|
|
57
|
+
if (
|
|
58
|
+
options.head &&
|
|
59
|
+
!inputs.session.globalChanges.length &&
|
|
60
|
+
policy(endpoints[0]) === policy(endpoints[1]) &&
|
|
61
|
+
inputs.session.changes
|
|
62
|
+
.flatMap((c) => [c.before, c.after])
|
|
63
|
+
.filter(Boolean)
|
|
64
|
+
.every(
|
|
65
|
+
(file) =>
|
|
66
|
+
/\.(md|txt)$/i.test(file) &&
|
|
67
|
+
endpoints.every(
|
|
68
|
+
({ config: c, sources }) =>
|
|
69
|
+
!sources.has(file) &&
|
|
70
|
+
!file.startsWith(relative(c, c.design) + '/') &&
|
|
71
|
+
!(c.arch && file.startsWith(relative(c, c.arch) + '/'))
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
) {
|
|
75
|
+
await inputs.close();
|
|
76
|
+
return {
|
|
77
|
+
rows: [],
|
|
78
|
+
globalCauses: [],
|
|
79
|
+
dependencies: [],
|
|
80
|
+
failures: [],
|
|
81
|
+
complete: true,
|
|
82
|
+
timings: { prepareMs: performance.now() - started }
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
let projection;
|
|
86
|
+
const { data } = await impact(
|
|
87
|
+
config,
|
|
88
|
+
{ ...options, json: true },
|
|
89
|
+
{
|
|
90
|
+
prepareInputs: async () => inputs,
|
|
91
|
+
tolerateSourceFailures: true,
|
|
92
|
+
openIndex: (config, opts) => openProjectIndex(config, { ...opts, frameOrigins: true }),
|
|
93
|
+
async consume({ views, rows, data, assessments, inputs }) {
|
|
94
|
+
const facts = new Map(data.facts.map((f) => [f.id, f]));
|
|
95
|
+
const globalCauses = [
|
|
96
|
+
...new Set(
|
|
97
|
+
data.changes.filter((c) => ['config', 'environment'].includes(c.role)).map((c) => c.after ?? c.before)
|
|
98
|
+
)
|
|
99
|
+
].sort();
|
|
100
|
+
const changed = new Set(
|
|
101
|
+
data.facts.filter((f) => ['source', 'architecture'].includes(f.kind)).map((f) => f.source)
|
|
102
|
+
);
|
|
103
|
+
const sides = await Promise.all(
|
|
104
|
+
views.map(async (view) => {
|
|
105
|
+
const { config } = view,
|
|
106
|
+
code = new Map(),
|
|
107
|
+
chapters = new Map();
|
|
108
|
+
for (const group of readGroups(config.design, config.sources))
|
|
109
|
+
for (const file of group.assets)
|
|
110
|
+
chapters.set(relative(config, path.join(config.design, file)), group.title);
|
|
111
|
+
for (const file of changed) {
|
|
112
|
+
if (!file?.endsWith('.tsx') || !view.index.inventory.tsx.includes(file)) continue;
|
|
113
|
+
if (data.failures.some((f) => f.source === file)) continue;
|
|
114
|
+
code.set(file, declarations(await readFile(path.join(config.root, file), 'utf8')));
|
|
115
|
+
}
|
|
116
|
+
const frames = new Map();
|
|
117
|
+
for (const [source, built] of view.built)
|
|
118
|
+
frames.set(source, new Map(built.frames.map((f) => [f.name, f])));
|
|
119
|
+
const feature = (file) =>
|
|
120
|
+
sourceFeature(path.posix.relative(relative(config, config.design), file), config.sources);
|
|
121
|
+
return { code, chapters, frames, feature };
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
const result = [];
|
|
125
|
+
const renames = new Map(inputs.session.renames.map((r) => [r.before, r.after]));
|
|
126
|
+
const { paired, consumed } = inventoryMoves(rows, renames, !data.failures.length);
|
|
127
|
+
const changedPaths = new Set(inputs.session.changes.flatMap((c) => [c.before, c.after]));
|
|
128
|
+
for (const row of rows) {
|
|
129
|
+
if (consumed.has(row)) continue;
|
|
130
|
+
const { source, frame } = row,
|
|
131
|
+
entry = { source, frame, status: row.status };
|
|
132
|
+
const chapter = sides[row.after ? 1 : 0].chapters.get(source);
|
|
133
|
+
if (chapter) entry.chapter = chapter;
|
|
134
|
+
if (row.status !== 'matched') {
|
|
135
|
+
const old = paired.get(row);
|
|
136
|
+
if (old) Object.assign(entry, { status: 'moved', former: { source: old.source, frame: old.frame } });
|
|
137
|
+
result.push(entry);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const causes = new Set();
|
|
141
|
+
const inputsChanged = ['light', 'dark']
|
|
142
|
+
.map((t) => assessments.get(JSON.stringify([source, frame, t])))
|
|
143
|
+
.filter((a) => a && a.disposition !== 'proven_unaffected');
|
|
144
|
+
for (const assessment of inputsChanged)
|
|
145
|
+
for (const reason of assessment.reasons) {
|
|
146
|
+
const fact = facts.get(reason.fact);
|
|
147
|
+
if (!fact?.source || reason.scope === 'support') continue;
|
|
148
|
+
if (
|
|
149
|
+
fact.source !== source &&
|
|
150
|
+
['token', 'source', 'global_css'].includes(fact.kind) &&
|
|
151
|
+
(fact.kind !== 'global_css' ||
|
|
152
|
+
views.some((v) => v.facts.get(source)?.dependencies.includes(fact.source)))
|
|
153
|
+
)
|
|
154
|
+
causes.add(fact.source);
|
|
155
|
+
if (fact.kind === 'architecture')
|
|
156
|
+
for (const i of fact.pathIndexes) {
|
|
157
|
+
const file = path.posix.relative(
|
|
158
|
+
inputs.projectPrefix || '.',
|
|
159
|
+
data.changes[i].after ?? data.changes[i].before
|
|
160
|
+
);
|
|
161
|
+
if (file !== source) causes.add(file);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const [old, current] = sides.map((s) => s.frames.get(source)?.get(frame));
|
|
165
|
+
const fragments = sides.map((side, i) => {
|
|
166
|
+
const declared = i ? current : old,
|
|
167
|
+
loc = declared?.declaration;
|
|
168
|
+
return loc && side.code.get(loc.source)?.site(loc);
|
|
169
|
+
});
|
|
170
|
+
let direct = fragments[0] !== fragments[1];
|
|
171
|
+
const owners = [...(row.before.parts ?? []), ...(row.after.parts ?? [])];
|
|
172
|
+
for (const { source: file, part } of owners) {
|
|
173
|
+
if (!changed.has(file)) continue;
|
|
174
|
+
if (sides[0].code.get(file)?.part(part) === sides[1].code.get(file)?.part(part)) continue;
|
|
175
|
+
if (sides[1].feature(file) === sides[1].feature(source)) direct = true;
|
|
176
|
+
}
|
|
177
|
+
// Generated values or a local unexported helper can change the individual
|
|
178
|
+
// frame while the JSX at its call site stays the same. Ignore sheet-wide CSS.
|
|
179
|
+
const ownChanged = changedPaths.has(source);
|
|
180
|
+
if (ownChanged && !causes.size && (source.endsWith('.mmd') || localFrame(old) !== localFrame(current)))
|
|
181
|
+
direct = true;
|
|
182
|
+
if (!direct && !causes.size) continue;
|
|
183
|
+
result.push({ ...entry, status: 'changed', ...(!direct ? { causes: [...causes].sort() } : {}) });
|
|
184
|
+
}
|
|
185
|
+
projection = {
|
|
186
|
+
rows: result,
|
|
187
|
+
globalCauses,
|
|
188
|
+
complete: !data.failures.length,
|
|
189
|
+
failures: data.failures,
|
|
190
|
+
dependencies: await liveDependencies(views, options.temporaryDirectory)
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
return { ...projection, timings: { ...data.timings, totalMs: performance.now() - started } };
|
|
196
|
+
}
|
|
197
|
+
function localFrame(frame) {
|
|
198
|
+
if (!frame) return '';
|
|
199
|
+
const { declaration, document, ...props } = frame;
|
|
200
|
+
return JSON.stringify(props);
|
|
201
|
+
}
|
package/src/toolkit/results.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import { CliError, classifyError } from '../cli-output.mjs';
|
|
|
3
3
|
/** @typedef {'light' | 'dark'} Theme */
|
|
4
4
|
/** @typedef {{source: string | null, frame: string | null, theme: Theme | null, line: number | null, column: number | null}} Location */
|
|
5
5
|
/** @typedef {Location & {code: string, message: string}} Finding */
|
|
6
|
-
/** @typedef {{project: string, readOnly: boolean, complete: boolean, impact: object | null, sources: string[], summary: {sources: number, frames: number, evaluations: number, problems: number}, findings: Finding[]}} CheckData */
|
|
6
|
+
/** @typedef {{project: string, readOnly: boolean, complete: boolean, impact: object | null, sources: string[], summary: {sources: number, frames: number, evaluations: number, problems: number}, findings: Finding[], motionPatterns?: {animations: number, unmapped: number, unused: number, findings: number, omitted: number}}} CheckData */
|
|
7
7
|
/** @typedef {{source: string, frame: string, theme: Theme, path: string, scale: number, width: number, height: number, pixelWidth: number, pixelHeight: number}} Capture */
|
|
8
|
-
/** @typedef {{project: string, outputDirectory: string, complete: boolean, impact: object | null, base: {rev: string, sha: string} | null, captures: Capture[], deleted: string[]}} RenderData */
|
|
9
|
-
/** @typedef {{source: string, frame: string, fixture: string, theme: Theme, settled: boolean, size: {design: [number, number], implementation: [number, number]}, matched: number, offBy2px: {text: string, dx: number, dy: number, dw: number, off: number}[], missing: string[], extra: string[], paths: {design
|
|
8
|
+
/** @typedef {{project: string, outputDirectory: string, complete: boolean, impact: object | null, base: {rev: string, sha: string} | null, themes: Theme[], captures: Capture[], deleted: string[]}} RenderData */
|
|
9
|
+
/** @typedef {{source: string, frame: string, fixture: string, theme: Theme, settled: boolean, size: {design: [number, number], implementation: [number, number]}, matched: number, offBy2px: {text: string, dx: number, dy: number, dw: number, off: number}[], missing: string[], extra: string[], paths: {design?: string, implementation?: string, overlay?: string, report: string, html: string}}} Comparison */
|
|
10
10
|
/** @typedef {{project: string, complete: boolean, all: boolean, comparisons: Comparison[], skipped: {source: string, frame: string, reason: 'no_fixture'}[], summary: {frames: number, matched: number, offsets: number, missing: number, extra: number}, indexPath: string | null, summaryPath: string | null}} CompareData */
|
|
11
11
|
|
|
12
12
|
/**
|