@reqvire-org/ads 0.5.2 → 0.5.3
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/dist/ads-errors.mjs +33 -26
- package/dist/analysis/design-usage.mjs +4 -20
- package/dist/analysis/mock-check.mjs +4 -5
- package/dist/analysis/owner-accessibility.mjs +4 -4
- package/dist/analysis/owner-analysis-key.mjs +1 -1
- package/dist/analysis/owner-choices.mjs +33 -3
- package/dist/analysis/owner-composition.mjs +61 -12
- package/dist/analysis/owner-source.mjs +52 -35
- package/dist/composed-contrast.mjs +143 -62
- package/dist/construction-output.mjs +6 -1
- package/dist/construction-spec.d.mts +53 -44
- package/dist/construction-spec.mjs +64 -76
- package/dist/corner-overpaint.mjs +5 -4
- package/dist/design-foundation.mjs +16 -0
- package/dist/design-usage.mjs +2 -8
- package/dist/emit/emission.mjs +0 -5
- package/dist/grid-lowering.mjs +3 -1
- package/dist/lowering-enter.mjs +6 -6
- package/dist/lowering-session.mjs +10 -0
- package/dist/mcp/server-observation.mjs +6 -4
- package/dist/mcp/server-project.mjs +4 -1
- package/dist/owner-analysis-check.mjs +4 -1
- package/dist/owner-errors.mjs +2 -1
- package/dist/owner-lowering.mjs +10 -4
- package/dist/owner-scenarios.mjs +2 -22
- package/dist/ownership-model.mjs +7 -5
- package/dist/paint-contrast.mjs +6 -0
- package/dist/profile-macro.d.mts +7 -0
- package/dist/recipe-macro.d.mts +46 -42
- package/dist/recipe-model.mjs +12 -11
- package/dist/region-lowering.mjs +54 -109
- package/dist/role-vocabulary.d.mts +4 -0
- package/dist/role-vocabulary.mjs +4 -0
- package/dist/runtime-paint-contrast.mjs +5 -2
- package/dist/showcase/client.bundle.js +48 -48
- package/dist/showcase/http-client.bundle.js +13 -13
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +5 -5
- package/dist/skills/ads-designer/references/accessibility.md +3 -4
- package/dist/skills/ads-designer/references/design-data.md +12 -6
- package/dist/skills/ads-designer/references/layout.md +7 -3
- package/dist/skills/ads-designer/references/motion.md +2 -1
- package/dist/skills/ads-designer/references/recipes.md +28 -18
- package/dist/skills/ads-import/references/design-data.md +12 -6
- package/dist/skills/ads-import/references/layout.md +7 -3
- package/dist/skills/ads-import/references/recipes.md +28 -18
- package/dist/skills/ads-migrate/SKILL.md +1 -0
- package/dist/skills/ads-migrate/references/0.5.2-to-0.5.3.md +71 -0
- package/dist/skills/ads-port/references/design-data.md +12 -6
- package/dist/skills/ads-port/references/layout.md +7 -3
- package/dist/skills/ads-port/references/recipes.md +28 -18
- package/dist/spatial-model.mjs +2 -2
- package/dist/surface-contrast.mjs +6 -2
- package/dist/target-size.mjs +21 -3
- package/docs/ADS.md +9 -3
- package/docs/ARCHITECTURE.md +33 -23
- package/docs/CACHING.md +1 -1
- package/docs/CHANGELOG.md +128 -21
- package/docs/GUIDE.md +64 -19
- package/docs/LANGUAGE.md +141 -134
- package/docs/MCP.md +5 -1
- package/docs/MOTION.md +5 -2
- package/docs/PROFILE-KINDS.md +46 -4
- package/docs/RULES.md +16 -15
- package/package.json +1 -1
- package/dist/analysis/prose-owners.mjs +0 -57
- package/dist/prose-model.d.mts +0 -81
- package/dist/prose-model.mjs +0 -101
package/dist/region-lowering.mjs
CHANGED
|
@@ -26,16 +26,12 @@ import {
|
|
|
26
26
|
writeStateText
|
|
27
27
|
} from "./construction-output.mjs";
|
|
28
28
|
import { settled } from "./lowering-enter.mjs";
|
|
29
|
-
import { paintContrast } from "./paint-contrast.mjs";
|
|
30
|
-
import { PROSE_BLOCKS, PROSE_COMPONENT, PROSE_ELEMENTS, PROSE_ELEMENT_NAMES, PROSE_FIRST, proseContents, proseDefaults, proseSelector, proseState } from "./prose-model.mjs";
|
|
31
|
-
import { textMinimum } from "./surface-contrast.mjs";
|
|
32
|
-
import { tokenValueContexts } from "./design-foundation.mjs";
|
|
33
29
|
import { checkPlaceholderContrast, checkProgressContrast } from "./placeholder-contrast.mjs";
|
|
34
30
|
import { fixedLength, lowerLayer, openState, ownsPlacement } from "./lowering-layer.mjs";
|
|
35
31
|
import { RATIO_SUFFIX, focalPosition, intrinsicInlineSize, measuredFallback, measuredProperty, measuredWrites, positions } from "./measured-geometry.mjs";
|
|
36
32
|
import { paintProperty, paintTokens, paintWrites } from "./runtime-paint.mjs";
|
|
37
33
|
import { conditionBound, conditionQueries, geometryOf, tierBelowQuery } from "./spatial-reading.mjs";
|
|
38
|
-
import { FRAME_CORNERS } from "./construction-spec.mjs";
|
|
34
|
+
import { CORNER_RADIUS_FIELDS, cornerRadius, FRAME_CORNERS } from "./construction-spec.mjs";
|
|
39
35
|
import {
|
|
40
36
|
LAYER,
|
|
41
37
|
MARKER_HIDDEN,
|
|
@@ -71,8 +67,6 @@ function arrangementValues(arrangement, slots, profile, overflow = { kind: "visi
|
|
|
71
67
|
const values = {}, scrolls = (axis) => overflow.kind === "scroll" && (overflow.axis === axis || overflow.axis === "both"), { layout } = arrangement;
|
|
72
68
|
if (layout === "native")
|
|
73
69
|
return values;
|
|
74
|
-
if (layout === "prose")
|
|
75
|
-
return { display: "flow-root" };
|
|
76
70
|
if (layout === "layered")
|
|
77
71
|
return { ...layeredValues(arrangement.align, arrangement.justify) };
|
|
78
72
|
if (layout === "inline" || layout === "stack") {
|
|
@@ -175,7 +169,7 @@ function writeStateGeometry(path, element, rest, states, transition, frameOf, co
|
|
|
175
169
|
gaps
|
|
176
170
|
};
|
|
177
171
|
}
|
|
178
|
-
const FRAME_FIELDS = [...FRAME_INSET_FIELDS, ...FRAME_SIDE_WIDTH_FIELDS, BORDER_STYLE, "border-width", "radius", "min-block-size", "block-size", "max-block-size", "inline-size", "min-inline-size", "max-inline-size", ...HIT_AREA_FIELDS], isHitAreaField = (field) => HIT_AREA_FIELDS.some((name) => name === field);
|
|
172
|
+
const CORNER_FIELDS = Object.values(CORNER_RADIUS_FIELDS), FRAME_FIELDS = [...FRAME_INSET_FIELDS, ...FRAME_SIDE_WIDTH_FIELDS, BORDER_STYLE, "border-width", "radius", ...CORNER_FIELDS, "min-block-size", "block-size", "max-block-size", "inline-size", "min-inline-size", "max-inline-size", ...HIT_AREA_FIELDS], isHitAreaField = (field) => HIT_AREA_FIELDS.some((name) => name === field);
|
|
179
173
|
export function frameValues(frame, profile, reject, sides = { kind: "profile" }) {
|
|
180
174
|
profile.only(frame, "frame", FRAME_FIELDS);
|
|
181
175
|
const insets = frameInsets(frame);
|
|
@@ -191,13 +185,23 @@ export function frameValues(frame, profile, reject, sides = { kind: "profile" })
|
|
|
191
185
|
Object.assign(values, border(value));
|
|
192
186
|
for (const side of ["top", "right", "bottom", "left"])
|
|
193
187
|
values[`border-${side}-style`] = frame[BORDER_STYLE] ?? "solid";
|
|
194
|
-
} else if (property === BORDER_STYLE)
|
|
188
|
+
} else if (property === BORDER_STYLE || CORNER_FIELDS.includes(property))
|
|
195
189
|
continue;
|
|
196
190
|
else if (property === "radius")
|
|
197
191
|
values["border-radius"] = value;
|
|
198
192
|
else
|
|
199
193
|
values[property] = value;
|
|
200
194
|
}
|
|
195
|
+
if (CORNER_FIELDS.some((field) => frame[field] !== void 0)) {
|
|
196
|
+
delete values["border-radius"];
|
|
197
|
+
for (const corner of FRAME_CORNERS)
|
|
198
|
+
values[`border-${corner}-radius`] = cornerRadius((field) => frame[field], corner) ?? "0";
|
|
199
|
+
}
|
|
200
|
+
for (const axis of ["inline", "block"]) {
|
|
201
|
+
const size = values[`${axis}-size`];
|
|
202
|
+
if (size !== void 0 && values[`min-${axis}-size`] === void 0 && values[`max-${axis}-size`] === void 0)
|
|
203
|
+
values[`min-${axis}-size`] = size;
|
|
204
|
+
}
|
|
201
205
|
return values;
|
|
202
206
|
}
|
|
203
207
|
function permittedRatio(ratio, slots, profile, reject) {
|
|
@@ -228,10 +232,10 @@ function regionFrameValues(frame, slots, surface, profile, reject) {
|
|
|
228
232
|
Object.assign(values, rules.value);
|
|
229
233
|
}
|
|
230
234
|
if (frame.corners !== null) {
|
|
231
|
-
const radius =
|
|
235
|
+
const named = frame.corners, radius = (corner) => cornerRadius((field) => fields[field], corner) ?? reject({ kind: "profile-field-missing", profile: frameReference ?? "frame", field: "radius" });
|
|
232
236
|
delete values["border-radius"];
|
|
233
237
|
for (const corner of FRAME_CORNERS)
|
|
234
|
-
values[`border-${corner}-radius`] =
|
|
238
|
+
values[`border-${corner}-radius`] = named.includes(corner) ? radius(corner) : "0";
|
|
235
239
|
}
|
|
236
240
|
if (frame.container) {
|
|
237
241
|
values["container-type"] = "inline-size";
|
|
@@ -282,97 +286,6 @@ function anchorClearValues(binding, { profile, slots }) {
|
|
|
282
286
|
return {};
|
|
283
287
|
return { "scroll-margin-block-start": binding.slot === "layer" ? profile.field(profile.of(slots["layer-profile"], "layer", "anchorClear"), "layer", "clear-block-start") : profile.field(profile.of(slots["spacing-profile"], "spacing", "anchorClear"), "spacing", "anchor-gap") };
|
|
284
288
|
}
|
|
285
|
-
function lowerProse(prose, root, context) {
|
|
286
|
-
const { out, profile, slots, foundation, reject } = context, spacing = (binding) => profile.field(profile.of(slots["spacing-profile"], "spacing", "prose"), "spacing", kebab(binding.field)), rhythm = prose.rhythm === null ? null : spacing(prose.rhythm), declared = new Map(prose.elements.map((element) => [element.name, element])), componentBefore = prose.component?.spaceBefore == null ? null : spacing(prose.component.spaceBefore), componentAfter = prose.component?.spaceAfter == null ? null : spacing(prose.component.spaceAfter), following = (level) => ":not(:first-child)".repeat(level), paints = new Map;
|
|
287
|
-
for (const name of PROSE_ELEMENT_NAMES) {
|
|
288
|
-
const element = declared.get(name), block = PROSE_BLOCKS.includes(name);
|
|
289
|
-
if (element === void 0 && (!block || rhythm === null) && Object.keys(proseDefaults(name)).length === 0)
|
|
290
|
-
continue;
|
|
291
|
-
const text = element?.text == null ? {} : profile.of(element.text, "text"), surface = element?.surface == null ? {} : profile.of(element.surface, "surface"), states = (element?.when ?? []).map(([condition, state]) => [condition, profile.of(state, "surface")]);
|
|
292
|
-
if (element !== void 0)
|
|
293
|
-
checkSurfaceEffects(foundation, profile, [element.surface, ...element.when.map(([, state]) => state)], name === "media" ? "visual" : name === "pre" ? "scroller" : "container", reject);
|
|
294
|
-
const frame = element?.frame == null ? {} : frameValues(profile.of(element.frame, "frame"), profile, reject), before = element?.spaceBefore == null ? rhythm : spacing(element.spaceBefore), values = {
|
|
295
|
-
...proseDefaults(name),
|
|
296
|
-
...block && (before !== null || element !== void 0) ? { "margin-block-start": before ?? "0", "margin-block-end": "0" } : {},
|
|
297
|
-
...element?.indent == null ? {} : { "padding-inline-start": spacing(element.indent) },
|
|
298
|
-
...anchorClearValues(element?.anchorClear ?? null, context),
|
|
299
|
-
...text,
|
|
300
|
-
...frame,
|
|
301
|
-
...surface
|
|
302
|
-
};
|
|
303
|
-
for (const tag of PROSE_ELEMENTS[name]) {
|
|
304
|
-
const selector = proseSelector(tag);
|
|
305
|
-
if (Object.keys(values).length > 0)
|
|
306
|
-
out.rule(selector, { ...values });
|
|
307
|
-
for (const [condition, fields] of states)
|
|
308
|
-
out.rule(proseState(selector, condition), { ...fields });
|
|
309
|
-
if (element?.marker != null) {
|
|
310
|
-
const fields = profile.of(element.marker, "surface"), other = Object.keys(fields).find((field) => field !== "color");
|
|
311
|
-
if (other !== void 0 || fields.color === void 0)
|
|
312
|
-
return reject({ kind: "profile-field-unsupported", profile: element.marker, field: other ?? "color", value: other === void 0 ? "" : fields[other] ?? "" });
|
|
313
|
-
out.rule(`${selector}::marker`, { color: fields.color });
|
|
314
|
-
}
|
|
315
|
-
if (element?.markerText != null)
|
|
316
|
-
out.rule(`${selector}::marker`, { "font-weight": profile.field(profile.of(element.markerText, "text"), "text", "font-weight") });
|
|
317
|
-
if (element?.spaceAfter != null) {
|
|
318
|
-
const after = spacing(element.spaceAfter);
|
|
319
|
-
out.rule(`${selector} + :not([class])`, { "margin-block-start": after });
|
|
320
|
-
out.rule(`${selector} + [class]${following(1)}`, { "margin-block-start": componentBefore === null ? after : `max(${after}, ${componentBefore})` });
|
|
321
|
-
for (const next of prose.elements)
|
|
322
|
-
if (next.spaceBefore !== null)
|
|
323
|
-
for (const nextTag of PROSE_ELEMENTS[next.name])
|
|
324
|
-
out.rule(`${selector} + ${nextTag}:not([class])`, { "margin-block-start": `max(${after}, ${spacing(next.spaceBefore)})` });
|
|
325
|
-
}
|
|
326
|
-
if (tag === "ul")
|
|
327
|
-
(element?.markers ?? []).forEach((shape, depth) => out.rule(`& ${"ul:not([class]) ".repeat(depth)}ul:not([class])`, { "list-style-type": shape }));
|
|
328
|
-
}
|
|
329
|
-
if (element !== void 0)
|
|
330
|
-
paints.set(name, { paints: [surface, ...states.map(([, fields]) => fields)].map((fields) => ({ color: fields.color ?? null, background: fields.background ?? null })), text });
|
|
331
|
-
}
|
|
332
|
-
if (rhythm !== null || prose.elements.some((element) => element.spaceBefore !== null))
|
|
333
|
-
for (const selector of PROSE_FIRST)
|
|
334
|
-
out.rule(selector, { "margin-block-start": "0" });
|
|
335
|
-
if (componentBefore !== null || rhythm !== null)
|
|
336
|
-
out.rule(PROSE_COMPONENT, { "margin-block-start": componentBefore ?? rhythm ?? "0" });
|
|
337
|
-
if (componentAfter !== null) {
|
|
338
|
-
out.rule(`& > [class] + :not([class])${following(2)}`, { "margin-block-start": componentAfter });
|
|
339
|
-
out.rule(`& > [class] + [class]${following(3)}`, { "margin-block-start": componentBefore === null ? componentAfter : `max(${componentAfter}, ${componentBefore})` });
|
|
340
|
-
for (const next of prose.elements)
|
|
341
|
-
if (next.spaceBefore !== null)
|
|
342
|
-
for (const tag of PROSE_ELEMENTS[next.name])
|
|
343
|
-
out.rule(`& > [class] + ${tag}:not([class])${following(2)}`, { "margin-block-start": `max(${componentAfter}, ${spacing(next.spaceBefore)})` });
|
|
344
|
-
}
|
|
345
|
-
const base = { color: root.color ?? null, background: root.background ?? null }, colored = [...paints].filter(([, entry]) => entry.paints.some((paint) => paint.color !== null || paint.background !== null));
|
|
346
|
-
if (colored.length === 0)
|
|
347
|
-
return;
|
|
348
|
-
const contexts = tokenValueContexts(foundation), prove = (name, text, foreground, background, on) => {
|
|
349
|
-
if (foreground === null || background === null)
|
|
350
|
-
return;
|
|
351
|
-
for (const tokens of contexts) {
|
|
352
|
-
const minimum = textMinimum({ fontSize: text["font-size"] ?? null, fontWeight: text["font-weight"] ?? null }, tokens), outcome = paintContrast(tokens, { foreground, background }, minimum);
|
|
353
|
-
if (outcome.kind === "insufficient")
|
|
354
|
-
return reject({ kind: "prose-contrast-insufficient", element: name, on, foreground, background, ratio: outcome.ratio, minimum: outcome.minimum, context: tokens.label });
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
for (const [name, entry] of colored) {
|
|
358
|
-
if (name === "rule" || name === "media")
|
|
359
|
-
continue;
|
|
360
|
-
for (const paint of entry.paints)
|
|
361
|
-
prove(name, entry.text, paint.color ?? base.color, paint.background ?? base.background, "the prose root");
|
|
362
|
-
}
|
|
363
|
-
for (const [container, outer] of colored) {
|
|
364
|
-
const [around] = outer.paints;
|
|
365
|
-
if (around === void 0)
|
|
366
|
-
continue;
|
|
367
|
-
for (const inner of proseContents(container)) {
|
|
368
|
-
const entry = paints.get(inner);
|
|
369
|
-
if (entry === void 0 || inner === "rule" || inner === "media")
|
|
370
|
-
continue;
|
|
371
|
-
for (const paint of entry.paints)
|
|
372
|
-
prove(inner, entry.text, paint.color ?? around.color ?? base.color, paint.background ?? around.background ?? base.background, `inside ${container}`);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
289
|
function partMotion(path, effects, { out, profile, slots, reject }) {
|
|
377
290
|
if (effects === null)
|
|
378
291
|
return null;
|
|
@@ -509,14 +422,24 @@ function lowerParts(parts, parent, layout, gap, context, parentGrows = !1, overl
|
|
|
509
422
|
"outline-style": "solid"
|
|
510
423
|
});
|
|
511
424
|
}
|
|
425
|
+
for (const part of parts) {
|
|
426
|
+
const drawing = part.drawnBy === null ? void 0 : parts.find((other) => other.name === part.drawnBy);
|
|
427
|
+
if (drawing === void 0)
|
|
428
|
+
continue;
|
|
429
|
+
const size = drawing.box === null ? {} : frameValues(context.profile.of(drawing.box, "frame"), context.profile, context.reject), inline = size["inline-size"], block = size["block-size"];
|
|
430
|
+
if (inline === void 0 || block === void 0)
|
|
431
|
+
return context.reject({ kind: "profile-field-missing", profile: drawing.box ?? drawing.name, field: inline === void 0 ? "inlineSize" : "blockSize" });
|
|
432
|
+
context.out.rule(`${parent} > ${part.selector}`, { position: "absolute", "inline-size": inline, "block-size": block, "margin-block": "0", "margin-inline": "0", opacity: "0", "z-index": "1" });
|
|
433
|
+
}
|
|
434
|
+
writePartSpace(parts, parent, layout, gap, context);
|
|
512
435
|
const lowered = parts.map((part) => lowerPart(part, parent, layout, context, parentGrows, overlapping));
|
|
513
436
|
if (layout !== "inline" && layout !== "stack")
|
|
514
437
|
return;
|
|
515
438
|
const axes = layout === "inline" ? ["inline"] : ["block"];
|
|
516
|
-
lowered.
|
|
517
|
-
const second = lowered[index + 1];
|
|
518
|
-
|
|
519
|
-
|
|
439
|
+
lowered.flatMap((first, index) => {
|
|
440
|
+
const own = first !== null && parts[index]?.repeat === !0 ? [[first, first]] : [], second = lowered[index + 1];
|
|
441
|
+
return first === null || second === null || second === void 0 ? own : [...own, [first, second]];
|
|
442
|
+
}).forEach(([first, second]) => {
|
|
520
443
|
if (overlapping !== null)
|
|
521
444
|
return context.reject({ kind: "state-geometry-unsupported", element: parent === "&" ? "&" : parent, reason: "targets-overlap", detail: `${first.element} and ${second.element}` });
|
|
522
445
|
for (const axis of axes)
|
|
@@ -524,12 +447,35 @@ function lowerParts(parts, parent, layout, gap, context, parentGrows = !1, overl
|
|
|
524
447
|
context.neighbours.push({ axis, gap: between, first, second });
|
|
525
448
|
});
|
|
526
449
|
}
|
|
450
|
+
function writePartSpace(parts, parent, layout, gap, context) {
|
|
451
|
+
const spaced = parts.filter((part) => part.spaceBefore !== null || part.spaceAfter !== null);
|
|
452
|
+
if (spaced.length === 0)
|
|
453
|
+
return;
|
|
454
|
+
const [first] = spaced;
|
|
455
|
+
if (layout !== "stack" && layout !== "native" && first !== void 0)
|
|
456
|
+
return context.reject({ kind: "space-parent-unsupported", part: first.name, layout });
|
|
457
|
+
const { out, profile, slots } = context, spacing = (binding) => profile.field(profile.of(slots["spacing-profile"], "spacing", "space"), "spacing", kebab(binding.field)), between = gap ?? "0px", margin = (space) => ({ "margin-block-start": `calc(${space} - ${between})` });
|
|
458
|
+
for (const part of spaced) {
|
|
459
|
+
if (part.spaceBefore !== null)
|
|
460
|
+
out.rule(`${parent} > * + ${part.selector}`, margin(spacing(part.spaceBefore)));
|
|
461
|
+
if (part.spaceAfter !== null)
|
|
462
|
+
out.rule(`${parent} > ${part.selector} + :not(:first-child)`, margin(spacing(part.spaceAfter)));
|
|
463
|
+
}
|
|
464
|
+
for (const before of spaced)
|
|
465
|
+
for (const after of spaced)
|
|
466
|
+
if (before.spaceAfter !== null && after.spaceBefore !== null)
|
|
467
|
+
out.rule(`${parent} > ${before.selector} + ${after.selector}:not(:first-child)`, margin(`max(${spacing(before.spaceAfter)}, ${spacing(after.spaceBefore)})`));
|
|
468
|
+
}
|
|
527
469
|
function lowerPart(part, parent, parentLayout, context, parentGrows, overlapping = null) {
|
|
528
470
|
const { out, profile, slots, reject } = context, path = `${parent} > ${part.selector}`;
|
|
529
471
|
if (part.content.kind === "vector") {
|
|
530
472
|
lowerVector(part, part.content.stroke, path, context);
|
|
531
473
|
return null;
|
|
532
474
|
}
|
|
475
|
+
if (part.content.kind === "component") {
|
|
476
|
+
writeConditioned(part, path, checked(extentValues(part.extent, parentLayout, part.name, parentGrows), reject), context);
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
533
479
|
const partSurface = part.surface === null ? {} : profile.of(part.surface, "surface"), moving = partMotion(path, part.effects, context), collapsible = part.collapsed || part.geometryWhen.some((state) => state.collapsed !== null), axis = parentLayout === "inline" ? "inline" : parentLayout === "stack" ? "block" : null;
|
|
534
480
|
if (collapsible) {
|
|
535
481
|
if (axis === null)
|
|
@@ -641,7 +587,8 @@ function lowerPart(part, parent, parentLayout, context, parentGrows, overlapping
|
|
|
641
587
|
const conditioned = conditionedVisual(part, context);
|
|
642
588
|
if (part.scheme !== null && visualOf(context.input, part.name)?.kind !== "content-media")
|
|
643
589
|
return reject({ kind: "scheme-unsupported", part: part.name });
|
|
644
|
-
|
|
590
|
+
const unrendered = part.content.kind === "visual" && !part.required && visualOf(context.input, part.name) === null;
|
|
591
|
+
if (part.content.kind === "visual" && !unrendered)
|
|
645
592
|
lowerVisual(path, context, part.measured.find((value) => value.type === "intrinsic-size") ?? null, conditioned, part.scheme, boxFields, part.name);
|
|
646
593
|
if (snapped !== null)
|
|
647
594
|
out.rule(`${path} > *`, { ...snapped.children });
|
|
@@ -912,8 +859,6 @@ export function lowerRegion(spec, foundation, input) {
|
|
|
912
859
|
for (const [selector, normalized] of spec.normalizeWhen)
|
|
913
860
|
out.rule(selector, normalizedDeclarations(normalized));
|
|
914
861
|
stateRules(out, "&", spec.when, profile, entering?.blurred ?? !1);
|
|
915
|
-
if (spec.prose !== null)
|
|
916
|
-
lowerProse(spec.prose, rootSurface, context);
|
|
917
862
|
const partLayout = spec.exposeRows.length > 0 ? "grid" : arrangement.layout;
|
|
918
863
|
lowerParts(spec.parts, "&", partLayout, values.gap, context, growsWithContent(values), rootGeometry.overlap, rootGeometry.gaps);
|
|
919
864
|
return out.finish({ kind: "region", artwork: placedArtwork[0] ?? null, artworks: placedByPart, exposed, targets: { elements: targets, neighbours } }, input.hidden);
|
|
@@ -112,6 +112,10 @@ declare const tokenRolesByKind: {
|
|
|
112
112
|
frame: {
|
|
113
113
|
"border-width": string[];
|
|
114
114
|
radius: string[];
|
|
115
|
+
"start-start-radius": string[];
|
|
116
|
+
"start-end-radius": string[];
|
|
117
|
+
"end-start-radius": string[];
|
|
118
|
+
"end-end-radius": string[];
|
|
115
119
|
padding: string[];
|
|
116
120
|
"padding-inline": string[];
|
|
117
121
|
"padding-block": string[];
|
package/dist/role-vocabulary.mjs
CHANGED
|
@@ -135,6 +135,10 @@ const tokenRolesByKind = {
|
|
|
135
135
|
frame: {
|
|
136
136
|
"border-width": ["border-width"],
|
|
137
137
|
radius: ["radius"],
|
|
138
|
+
"start-start-radius": ["radius"],
|
|
139
|
+
"start-end-radius": ["radius"],
|
|
140
|
+
"end-start-radius": ["radius"],
|
|
141
|
+
"end-end-radius": ["radius"],
|
|
138
142
|
padding: ["frame-inset"],
|
|
139
143
|
"padding-inline": ["frame-inset"],
|
|
140
144
|
"padding-block": ["frame-inset"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { selectedProfile, tokenValueContexts } from "./design-foundation.mjs";
|
|
2
|
-
import { inactiveCondition, NON_TEXT_MINIMUM, paintContrast } from "./paint-contrast.mjs";
|
|
2
|
+
import { inactiveCondition, NON_TEXT_MINIMUM, paintContrast, unshown } from "./paint-contrast.mjs";
|
|
3
3
|
import { describeUnresolved, surfacedElements, textMinimum } from "./surface-contrast.mjs";
|
|
4
4
|
import { err, ok } from "./result.mjs";
|
|
5
5
|
import { isPaintProperty } from "./runtime-paint.mjs";
|
|
@@ -68,7 +68,10 @@ export function runtimePaintContrast(foundation, spec) {
|
|
|
68
68
|
}
|
|
69
69
|
for (const pair of checked)
|
|
70
70
|
for (const context of contexts) {
|
|
71
|
-
const minimum = pair.minimum(context)
|
|
71
|
+
const minimum = pair.minimum(context);
|
|
72
|
+
if (unshown(pair.paints.foreground, context))
|
|
73
|
+
continue;
|
|
74
|
+
const outcome = paintContrast(context, pair.paints, minimum);
|
|
72
75
|
switch (outcome.kind) {
|
|
73
76
|
case "sufficient":
|
|
74
77
|
break;
|