@homepages/concrete 10.0.0 → 11.0.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/CHANGELOG.md +29 -0
- package/codemods/manifest.json +5 -158
- package/dist/artifact/playground/client/assets/index-ByeGGedv.js +1259 -0
- package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +1 -0
- package/dist/artifact/playground/client/index.html +2 -2
- package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
- package/dist/artifact/playground/host.mjs +26 -26
- package/dist/base.css +1 -8
- package/dist/cli/build/artifact.js +1 -1
- package/dist/cli/build/fixtures.js +3 -2
- package/dist/cli/check/stages/sections.js +1 -1
- package/dist/cli/dev/workspace-reader.js +3 -2
- package/dist/css/compile.js +3 -6
- package/dist/css/rules.js +1 -51
- package/dist/design-system/format-variants.js +1 -1
- package/dist/fixtures/resolve.js +5 -1
- package/dist/fixtures/rows.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +3 -14
- package/dist/packages/internal/media-resolution/dist/document.js +3 -3
- package/dist/packages/internal/media-resolution/dist/image.js +3 -3
- package/dist/packages/internal/media-resolution/dist/tour.js +6 -6
- package/dist/packages/internal/media-resolution/dist/video.js +9 -9
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +1 -3
- package/dist/packages/internal/section-contracts/dist/source-contract.js +3 -3
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +0 -2
- package/dist/packages/internal/template-artifact/dist/index.js +2 -2
- package/dist/packages/internal/template-artifact/dist/layout.js +11 -11
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +13 -17
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +3 -5
- package/dist/packages/internal/template-contracts/dist/fill-builders.js +2 -6
- package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +4 -1
- package/dist/packages/internal/template-contracts/dist/list.js +0 -14
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +1 -1
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +6 -7
- package/dist/packages/internal/template-contracts/dist/slot-builders.js +0 -2
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +6 -1
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +2 -4
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +3 -4
- package/dist/primitives/Image.d.ts +2 -2
- package/dist/primitives/Tour.d.ts +2 -2
- package/dist/primitives/Video.d.ts +2 -2
- package/dist/primitives/slot-bindings.js +6 -13
- package/dist/primitives/slot-document.d.ts +1 -1
- package/dist/primitives/slot-download.d.ts +3 -1
- package/dist/primitives/slot-media.d.ts +5 -2
- package/dist/primitives/slot-media.js +1 -1
- package/dist/rules/registry.js +0 -6
- package/dist/schema/format-presets.d.ts +1 -1
- package/dist/schema/section-schema.d.ts +5 -5
- package/dist/styles.css +4 -4
- package/dist/template/define-template.js +0 -1
- package/guide/reference/cli/INDEX.md +2 -2
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +1 -1
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +1 -1
- package/guide/reference/cli/publish.md +1 -1
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +1 -2
- package/package.json +2 -2
- package/codemods/fill-is-a-source.mjs +0 -533
- package/codemods/framework-namespace.mjs +0 -107
- package/codemods/list-grammar.mjs +0 -923
- package/codemods/object-form-only.mjs +0 -39
- package/codemods/platform-namespace.mjs +0 -83
- package/codemods/process-builders.mjs +0 -198
- package/codemods/reads-replace-reconcile.mjs +0 -285
- package/codemods/registry-keys-only.mjs +0 -113
- package/codemods/slot-object.mjs +0 -1097
- package/codemods/steps/content-object-fields.mjs +0 -324
- package/codemods/steps/list-object-form.mjs +0 -686
- package/codemods/steps/registry-key-reads.mjs +0 -276
- package/codemods/steps/select-object-form.mjs +0 -210
- package/codemods/table-rows.mjs +0 -568
- package/codemods/theme-collapse.mjs +0 -396
- package/codemods/unlayer-author-css.mjs +0 -194
- package/codemods/unwrap-object-fields.mjs +0 -310
- package/codemods/viewer-slot-document.mjs +0 -131
- package/codemods/write-property-as-facts-document.mjs +0 -716
- package/codemods/write-the-address-line.mjs +0 -255
- package/codemods/write-the-registry-members.mjs +0 -653
- package/codemods/write-the-select-from.mjs +0 -141
- package/codemods/write-the-sole-from.mjs +0 -369
- package/codemods/write-the-table-from.mjs +0 -267
- package/codemods/write-the-whole-item.mjs +0 -512
- package/codemods/writeback-drop.mjs +0 -168
- package/codemods/written-contact-address.mjs +0 -162
- package/codemods/written-media-category.mjs +0 -227
- package/codemods/written-ref-kinds-name-the-layer.mjs +0 -172
- package/codemods/written-uploads-replace-pool-reads.mjs +0 -454
- package/codemods/written-uploads-sort-into-lists.mjs +0 -405
- package/codemods/written-uploads-stated-in-sorted-lists.mjs +0 -295
- package/codemods/written-video-sources-drop.mjs +0 -144
- package/codemods/written-without-pick-none.mjs +0 -146
- package/codemods/written-without-retired-knowledge.mjs +0 -223
- package/codemods/written-without-the-media-key.mjs +0 -202
- package/codemods/written-without-the-property-type.mjs +0 -249
- package/dist/artifact/playground/client/assets/index-BFNHB7VM.css +0 -1
- package/dist/artifact/playground/client/assets/index-Div1yo6s.js +0 -1259
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { ASSETS_DIR, ASSET_URL_PREFIX, FIXTURES_DIR, FIXTURE_FILES,
|
|
1
|
+
import { ASSETS_DIR, ASSET_URL_PREFIX, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, boundFiles, fixturePath, playgroundPath, sectionPath, templatePath } from "./layout.js";
|
|
2
2
|
import { sha256Hex } from "./sha256.js";
|
|
3
3
|
import { sectionContentHash, templateContentHash } from "./hash.js";
|
|
4
4
|
import { ArtifactManifest, readArtifactSchema } from "./manifest.js";
|
|
5
5
|
|
|
6
6
|
//#region ../../internal/template-artifact/dist/verify.js
|
|
7
7
|
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const TEMPLATE_FILE_NAMES = /* @__PURE__ */ new Set([...Object.values(TEMPLATE_FILES), RETIRED_FILE]);
|
|
8
|
+
const SECTION_FILE_NAMES = new Set(Object.values(SECTION_FILES));
|
|
9
|
+
const TEMPLATE_FILE_NAMES = new Set(Object.values(TEMPLATE_FILES));
|
|
11
10
|
const ISLAND_CHUNK = new RegExp(`^${SECTION_ISLANDS_DIR}/[A-Za-z0-9._-]+\\.mjs$`);
|
|
12
11
|
const FLAT_FILE = /^[A-Za-z0-9._-]+$/;
|
|
13
12
|
const CLIENT_SEGMENT = /^(?!\.{1,2}$)[A-Za-z0-9._-]+$/;
|
|
14
|
-
const FIXTURE_FILE_NAMES =
|
|
13
|
+
const FIXTURE_FILE_NAMES = new Set(Object.values(FIXTURE_FILES));
|
|
15
14
|
const ASSET_URL = new RegExp(`${ASSET_URL_PREFIX.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&")}([A-Za-z0-9._-]+)`, "g");
|
|
16
15
|
function readJson(files, path, problems) {
|
|
17
16
|
const bytes = files.get(path);
|
|
@@ -64,10 +63,10 @@ function verifyArtifact(files, stored = /* @__PURE__ */ new Map()) {
|
|
|
64
63
|
problems
|
|
65
64
|
};
|
|
66
65
|
const schema = readArtifactSchema(raw.value);
|
|
67
|
-
if (schema !==
|
|
66
|
+
if (schema !== 4) {
|
|
68
67
|
problems.push({
|
|
69
68
|
path: MANIFEST_FILE,
|
|
70
|
-
message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(
|
|
69
|
+
message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(4)}` : `artifact_schema ${String(schema)} is not one this reader knows (it knows ${String(4)})`
|
|
71
70
|
});
|
|
72
71
|
return {
|
|
73
72
|
manifest: null,
|
|
@@ -144,16 +143,13 @@ function verifyArtifact(files, stored = /* @__PURE__ */ new Map()) {
|
|
|
144
143
|
path: playgroundPath(file),
|
|
145
144
|
message: "missing"
|
|
146
145
|
});
|
|
147
|
-
for (const id of manifest.fixtures) {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
message: `names ${match[0]}, which ${ASSETS_DIR}/ does not carry`
|
|
155
|
-
});
|
|
156
|
-
}
|
|
146
|
+
for (const id of manifest.fixtures) for (const file of Object.values(FIXTURE_FILES)) {
|
|
147
|
+
const path = fixturePath(id, file);
|
|
148
|
+
if (readJson(files, path, problems) === null) continue;
|
|
149
|
+
for (const match of decoder.decode(files.get(path)).matchAll(ASSET_URL)) if (!present(`${"assets"}/${match[1]}`)) problems.push({
|
|
150
|
+
path,
|
|
151
|
+
message: `names ${match[0]}, which ${ASSETS_DIR}/ does not carry`
|
|
152
|
+
});
|
|
157
153
|
}
|
|
158
154
|
const sectionHashes = /* @__PURE__ */ new Map();
|
|
159
155
|
for (const section of manifest.sections) {
|
|
@@ -10,8 +10,8 @@ import { ResponsiveImage } from "./responsive-image.js";
|
|
|
10
10
|
* poster.
|
|
11
11
|
*/
|
|
12
12
|
type DocumentValue = {
|
|
13
|
-
/** The media this slot points at — the whole stored value. */
|
|
14
|
-
|
|
13
|
+
/** The media this slot points at — the whole stored value, under the one member every resolved media value names its media by. */
|
|
14
|
+
id: string;
|
|
15
15
|
/**
|
|
16
16
|
* Served source — the editor gets a presigned URL, a published page gets the
|
|
17
17
|
* relative asset path. Same pivot as an image's or a video's `url`, so a
|
|
@@ -38,7 +38,5 @@ type DocumentValue = {
|
|
|
38
38
|
/** The preview's responsive ladder, when one exists. Absent, `<Image>` falls back to `poster`. */
|
|
39
39
|
poster_responsive?: ResponsiveImage;
|
|
40
40
|
};
|
|
41
|
-
/** A document list slot's runtime value: an ordered array of `DocumentValue`, possibly empty. */
|
|
42
|
-
type DocumentCollectionValue = DocumentValue[];
|
|
43
41
|
//#endregion
|
|
44
|
-
export {
|
|
42
|
+
export { DocumentValue };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { readsWithRequires } from "./slot-ref.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../internal/template-contracts/dist/fill-builders.js
|
|
4
|
-
const PICK_NONE_CODEMOD = "written-without-pick-none";
|
|
5
4
|
const VERB_KEYS = {
|
|
6
5
|
write: /* @__PURE__ */ new Set([
|
|
7
6
|
"brief",
|
|
@@ -31,10 +30,7 @@ function verbBinding(verb, options) {
|
|
|
31
30
|
verb
|
|
32
31
|
};
|
|
33
32
|
for (const [key, value] of Object.entries(options)) {
|
|
34
|
-
if (!allowed.has(key)) {
|
|
35
|
-
const hint = key === "none" && verb === "pick" ? ` A pick judges every candidate, so selecting none is already an outcome its brief steers — \`concrete upgrade\` drops \`none\` from every \`fill.pick\` (the \`${PICK_NONE_CODEMOD}\` codemod).` : key === "count" ? " A fill takes no count: the list's own `min` and `max` bound how many items it fills." : key === "cap" ? " A write's budget is its holder's `cap` — a text slot's own, or a list's `item: text.short({ cap })`." : key === "of" && verb === "find" ? " A find names no candidates: the platform's lookup for its holder's kind supplies the value." : key === "of" && verb === "pick" ? " A pick chooses from its holder's candidates — a select's values, a media slot's `from` list of its kinds, a row's table, a list's item's." : key === "of" ? " The kind a write produces is its holder's — a text slot's own, a list's `item`, a label's text slot." : "";
|
|
36
|
-
throw new Error(`${at}: "${key}" is not an option — it takes ${[...allowed].map((k) => `\`${k}\``).join(", ")}, and everything the model should know goes in the brief.${hint}`);
|
|
37
|
-
}
|
|
33
|
+
if (!allowed.has(key)) throw new Error(`${at}: "${key}" is not an option — it takes ${[...allowed].map((k) => `\`${k}\``).join(", ")}, and everything the model should know goes in the brief.`);
|
|
38
34
|
if (key === "none" && value !== void 0 && value !== true) throw new Error(`${at}: \`none\` is \`true\` or absent — it admits the empty answer, and the brief's last sentence says when nothing is right.`);
|
|
39
35
|
if (key === "unique" && value !== void 0 && typeof value !== "boolean") throw new Error(`${at}: \`unique\` is a boolean — \`false\` lets a pick repeat an element.`);
|
|
40
36
|
if (key === "requires" && value !== void 0 && (!Array.isArray(value) || value.length === 0)) throw new Error(`${at}: \`requires\` names at least one read — omit it when the fill needs none.`);
|
|
@@ -76,4 +72,4 @@ function isFillBinding(x) {
|
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
//#endregion
|
|
79
|
-
export {
|
|
75
|
+
export { fill, fillsOfSource, isFillBinding, isFillSource };
|
|
@@ -31,7 +31,10 @@ function fillOf(verbs) {
|
|
|
31
31
|
none: Abstention,
|
|
32
32
|
reads: DecisionReads,
|
|
33
33
|
requires: DecisionReads
|
|
34
|
-
}).strict()
|
|
34
|
+
}).strict().refine((fill) => fill.verb !== "pick" || fill.none === void 0, {
|
|
35
|
+
path: ["none"],
|
|
36
|
+
message: "a pick abstains by its verdict and states no `none`"
|
|
37
|
+
});
|
|
35
38
|
}
|
|
36
39
|
function fillsOf(verbs) {
|
|
37
40
|
return z.array(fillOf(verbs)).min(1);
|
|
@@ -215,20 +215,6 @@ function listTable(opts, label) {
|
|
|
215
215
|
}
|
|
216
216
|
function list(opts) {
|
|
217
217
|
const label = opts.label ?? "list";
|
|
218
|
-
for (const key of [
|
|
219
|
-
"fields",
|
|
220
|
-
"title",
|
|
221
|
-
"unique",
|
|
222
|
-
"count"
|
|
223
|
-
]) {
|
|
224
|
-
if (opts[key] === void 0) continue;
|
|
225
|
-
throw new Error(`list: "${label}" declares \`${key}\`, which a list no longer takes — ${{
|
|
226
|
-
fields: "declare `item: (el) => object({ fields })` — an item function returning an object",
|
|
227
|
-
title: "give the item's object a `label` — a string, or a text slot",
|
|
228
|
-
unique: "a pick is unique by default (`fill.pick({ unique: false })` lifts it)",
|
|
229
|
-
count: "`min` and `max` bound how many items any source yields"
|
|
230
|
-
}[key]}.`);
|
|
231
|
-
}
|
|
232
218
|
const source = opts.source;
|
|
233
219
|
const fills = fillsOfSource(source, `list: "${label}"`);
|
|
234
220
|
const openWrite = answersMembers(opts.item);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AddressMember, AddressSource, AddressValue } from "./address-value.js";
|
|
2
2
|
import { ResponsiveImage } from "./responsive-image.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DocumentValue } from "./document-value.js";
|
|
4
4
|
import { MediaKind } from "./slot-catalog.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { TourValue } from "./tour-value.js";
|
|
6
|
+
import { VideoValue } from "./video-value.js";
|
|
7
7
|
import { PoiPhoto, PoiRow } from "./poi-row.js";
|
|
8
8
|
//#region ../../internal/template-contracts/dist/runtime-values.d.ts
|
|
9
9
|
/**
|
|
@@ -13,7 +13,8 @@ import { PoiPhoto, PoiRow } from "./poi-row.js";
|
|
|
13
13
|
* renderer reads only `url`, `alt`, `mobile`, and `responsive`.
|
|
14
14
|
*/
|
|
15
15
|
type ImageValue = {
|
|
16
|
-
|
|
16
|
+
/** The media this slot points at: the one member every resolved media value names its media by. */
|
|
17
|
+
id: string;
|
|
17
18
|
url: string;
|
|
18
19
|
alt: string;
|
|
19
20
|
mobile?: {
|
|
@@ -27,8 +28,6 @@ type ImageValue = {
|
|
|
27
28
|
*/
|
|
28
29
|
download_url?: string;
|
|
29
30
|
};
|
|
30
|
-
/** An image list slot's runtime value: an ordered array of `ImageValue`, possibly empty. */
|
|
31
|
-
type ImageCollectionValue = ImageValue[];
|
|
32
31
|
/**
|
|
33
32
|
* A raster image the template itself ships — a build-time `import` of a file
|
|
34
33
|
* under the template's own assets — resolved to its optimized responsive
|
|
@@ -79,4 +78,4 @@ type MediaValue<Kinds extends MediaKind = MediaKind> = {
|
|
|
79
78
|
};
|
|
80
79
|
}[Kinds];
|
|
81
80
|
//#endregion
|
|
82
|
-
export { type AddressValue, AuthorImage, type
|
|
81
|
+
export { type AddressValue, AuthorImage, type DocumentValue, ImageValue, MediaValue, PlaybackConfig, type PoiPhoto, type PoiRow, type TourValue, type VideoValue };
|
|
@@ -142,8 +142,6 @@ function address(opts = {}) {
|
|
|
142
142
|
function mediaFilterKeys(type, opts) {
|
|
143
143
|
const at = `${type}: "${opts.label ?? type}"`;
|
|
144
144
|
refuseStatedOf(at, opts.source);
|
|
145
|
-
if ("category" in opts) throw new Error(`${at} declares \`category\` — a media declaration names the list it picks from in \`from\` (\`from: fact.property.property_media\`, \`fact.property.floor_plans\`, \`fact.property.uploads\`), or owns its media without one.`);
|
|
146
|
-
if ("sources" in opts) throw new Error(`${at} declares \`sources\` — a media slot takes a pasted link wherever a link provider claims its kind (a video, a tour), and declares nothing for it. \`concrete upgrade\` removes it.`);
|
|
147
145
|
const problem = mediaDeclarationProblem({
|
|
148
146
|
type,
|
|
149
147
|
kinds: opts.kinds,
|
|
@@ -115,7 +115,12 @@ type RefValue<R> = R extends {
|
|
|
115
115
|
* its media record, narrowed by kind where the value says it, at any depth. The type
|
|
116
116
|
* half of the read step (./registry-facts `readAsRecords`).
|
|
117
117
|
*/
|
|
118
|
-
type AsRead<V> = V extends
|
|
118
|
+
type AsRead<V> = V extends DocumentValue ? DocumentMedia : V extends ImageValue ? {
|
|
119
|
+
image: ImageMedia;
|
|
120
|
+
video: VideoMedia;
|
|
121
|
+
tour: TourMedia;
|
|
122
|
+
}[PictureKindOf<V>] : V extends DocumentMediaValue ? Media : V extends readonly unknown[] ? { [I in keyof V]: AsRead<V[I]>; } : V extends object ? { [K in keyof V]: AsRead<V[K]>; } : V;
|
|
123
|
+
type PictureKindOf<V> = [Extract<keyof V, Exclude<keyof VideoValue, keyof TourValue>>] extends [never] ? [Extract<keyof V, Exclude<keyof TourValue, keyof ImageValue>>] extends [never] ? "image" : "tour" : "video";
|
|
119
124
|
/**
|
|
120
125
|
* The value ONE ref hands a declaration that reads it, each media value in it its media
|
|
121
126
|
* record (`AsRead`). A slot read is always `| undefined` — the upstream section's page may
|
|
@@ -10,7 +10,7 @@ type TourValue = {
|
|
|
10
10
|
* The media id of the link this tour was selected from — the same id
|
|
11
11
|
* `facts.tours[].id` carries. `''` is the empty value.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
id: string;
|
|
14
14
|
/**
|
|
15
15
|
* The FINISHED EMBED SRC, not the URL as pasted: the facts row keeps the pasted
|
|
16
16
|
* form because that is the durable value, and `tourEmbedUrl` applies the rewrite
|
|
@@ -39,7 +39,5 @@ type TourValue = {
|
|
|
39
39
|
/** Link-provider id — any `kind: "tour"` member of `LINK_PROVIDERS`. Drives the editor's provider badge. */
|
|
40
40
|
provider?: string;
|
|
41
41
|
};
|
|
42
|
-
/** A tour list slot's runtime value: an ordered array of `TourValue`, possibly empty. */
|
|
43
|
-
type TourCollectionValue = TourValue[];
|
|
44
42
|
//#endregion
|
|
45
|
-
export {
|
|
43
|
+
export { TourValue };
|
|
@@ -7,7 +7,8 @@ import { VideoSource } from "./slot-catalog.js";
|
|
|
7
7
|
* video, and a video is selected rather than edited.
|
|
8
8
|
*/
|
|
9
9
|
type VideoValue = {
|
|
10
|
-
|
|
10
|
+
/** The media this slot points at: the one member every resolved media value names its media by. */
|
|
11
|
+
id: string;
|
|
11
12
|
/**
|
|
12
13
|
* Playable source — MEANS DIFFERENT THINGS PER BRANCH, deliberately. For a
|
|
13
14
|
* hosted upload it is the transcoded rendition; the original master is never
|
|
@@ -57,7 +58,5 @@ type VideoValue = {
|
|
|
57
58
|
/** Link-provider id; link branch only. Drives the editor's provider badge. */
|
|
58
59
|
provider?: string;
|
|
59
60
|
};
|
|
60
|
-
/** A video list slot's runtime value: an ordered array of `VideoValue`, possibly empty. */
|
|
61
|
-
type VideoCollectionValue = VideoValue[];
|
|
62
61
|
//#endregion
|
|
63
|
-
export {
|
|
62
|
+
export { VideoValue };
|
|
@@ -10,7 +10,7 @@ type ImageRendition = "mobile";
|
|
|
10
10
|
* kind of image is being rendered. Named so `Slot.Image` can derive its own passthrough
|
|
11
11
|
* from the same source rather than restating it. */
|
|
12
12
|
type ImageOptions = Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt" | "width" | "height"> & {
|
|
13
|
-
/** Render inside
|
|
13
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the image
|
|
14
14
|
* fills edge to edge, tinted when the value is absent. The frame has NO geometry of
|
|
15
15
|
* its own: `className` lands on it, and your classes are its whole box. `false`
|
|
16
16
|
* renders the bare `<img>` instead, so the layout box is the parent's; an absent
|
|
@@ -67,7 +67,7 @@ type Props = (ImageOptions & {
|
|
|
67
67
|
* `alt` prop, having no alt of its own to fall back on.
|
|
68
68
|
*
|
|
69
69
|
* **The box is always yours.** Cropping is baked upstream — the platform delivers a
|
|
70
|
-
* pre-cropped image — and
|
|
70
|
+
* pre-cropped image — and Concrete paints no geometry: no aspect, no size, no position.
|
|
71
71
|
* Whatever box your classes establish is the box, and `object-position` on the `<img>`
|
|
72
72
|
* is yours to set where a design wants the cover nudged.
|
|
73
73
|
*
|
|
@@ -6,7 +6,7 @@ type Props = Omit<HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
6
6
|
value: TourValue | null | undefined;
|
|
7
7
|
/** Overrides the value's own alt, which titles the `<iframe>`. */
|
|
8
8
|
alt?: string;
|
|
9
|
-
/** Render inside
|
|
9
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the embed
|
|
10
10
|
* fills edge to edge, tinted when there is no embed. It has NO geometry of its own:
|
|
11
11
|
* `className` lands on it and your classes are its whole box. `false` renders a bare
|
|
12
12
|
* `<iframe>` instead. Default `true`. */
|
|
@@ -22,7 +22,7 @@ type Props = Omit<HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
22
22
|
* once at resolve by `tourEmbedUrl`, so this component is a pure read.
|
|
23
23
|
*
|
|
24
24
|
* **Framed** (default): a wrapper — `relative`, clipped, tinted via `.concrete-image-frame` —
|
|
25
|
-
* that your `className` lands on and the iframe absolutely fills.
|
|
25
|
+
* that your `className` lands on and the iframe absolutely fills. Concrete paints no
|
|
26
26
|
* geometry: size the wrapper with your own classes and the embed fills it, same as
|
|
27
27
|
* `<Image>`/`<Video>`.
|
|
28
28
|
*
|
|
@@ -7,7 +7,7 @@ type Props = Omit<VideoHTMLAttributes<HTMLVideoElement>, "src" | "poster" | "aut
|
|
|
7
7
|
value: VideoValue | null | undefined;
|
|
8
8
|
/** Overrides the value's own alt. Pass `""` for a purely decorative loop. */
|
|
9
9
|
alt?: string;
|
|
10
|
-
/** Render inside
|
|
10
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the player
|
|
11
11
|
* fills edge to edge, tinted while there is nothing to show. It has NO geometry of its
|
|
12
12
|
* own: `className` lands on it and your classes are its whole box. `false` renders a
|
|
13
13
|
* bare `<video>` (or iframe) instead. Default `true`. */
|
|
@@ -33,7 +33,7 @@ type Props = Omit<VideoHTMLAttributes<HTMLVideoElement>, "src" | "poster" | "aut
|
|
|
33
33
|
* one frame container, one poster-only fallback, and one marker spread.
|
|
34
34
|
*
|
|
35
35
|
* **Framed** (default): a wrapper — `relative`, clipped, tinted via `.concrete-image-frame` —
|
|
36
|
-
* that your `className` lands on and the player absolutely fills.
|
|
36
|
+
* that your `className` lands on and the player absolutely fills. Concrete paints no
|
|
37
37
|
* geometry: size the wrapper with your own classes (an aspect utility, a height) and the
|
|
38
38
|
* player covers it. `frame={false}` hands your classes to the media element itself.
|
|
39
39
|
* Framed, `className` is the only prop that lands on the wrapper — the rest of the bag
|
|
@@ -3,13 +3,13 @@ import { OBJECT_BINDING_OWN_KEYS, acceptsLink, declaredKinds, isEmailValue, isIs
|
|
|
3
3
|
|
|
4
4
|
//#region src/primitives/slot-bindings.ts
|
|
5
5
|
const blankVideo = () => ({
|
|
6
|
-
|
|
6
|
+
id: "",
|
|
7
7
|
url: "",
|
|
8
8
|
poster: "",
|
|
9
9
|
alt: ""
|
|
10
10
|
});
|
|
11
11
|
const blankTour = () => ({
|
|
12
|
-
|
|
12
|
+
id: "",
|
|
13
13
|
url: "",
|
|
14
14
|
poster: "",
|
|
15
15
|
alt: ""
|
|
@@ -42,17 +42,13 @@ function normalizeImage(value) {
|
|
|
42
42
|
return isRecord(value) && typeof value.url === "string" && value.url !== "" ? value : null;
|
|
43
43
|
}
|
|
44
44
|
function normalizeDocument(value) {
|
|
45
|
-
|
|
46
|
-
return typeof value.poster === "string" ? value : {
|
|
47
|
-
...value,
|
|
48
|
-
poster: ""
|
|
49
|
-
};
|
|
45
|
+
return isRecord(value) && typeof value.url === "string" && value.url !== "" ? value : null;
|
|
50
46
|
}
|
|
51
47
|
function normalizeVideo(value) {
|
|
52
48
|
if (!isRecord(value)) return blankVideo();
|
|
53
49
|
return {
|
|
54
50
|
...value,
|
|
55
|
-
|
|
51
|
+
id: stringField(value.id),
|
|
56
52
|
url: stringField(value.url),
|
|
57
53
|
poster: stringField(value.poster),
|
|
58
54
|
alt: stringField(value.alt)
|
|
@@ -62,7 +58,7 @@ function normalizeTour(value) {
|
|
|
62
58
|
if (!isRecord(value)) return blankTour();
|
|
63
59
|
return {
|
|
64
60
|
...value,
|
|
65
|
-
|
|
61
|
+
id: stringField(value.id),
|
|
66
62
|
url: stringField(value.url),
|
|
67
63
|
poster: stringField(value.poster),
|
|
68
64
|
alt: stringField(value.alt)
|
|
@@ -93,13 +89,10 @@ function normalizeMedia(slot, value) {
|
|
|
93
89
|
default: return null;
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
|
-
const IDENTITY_KEYS = ["id"];
|
|
97
92
|
function normalizeFields(fields, value, identity) {
|
|
98
93
|
const source = isRecord(value) ? value : {};
|
|
99
94
|
const normalized = {};
|
|
100
|
-
if (identity)
|
|
101
|
-
for (const key of IDENTITY_KEYS) if (typeof source[key] === "string") normalized[key] = source[key];
|
|
102
|
-
}
|
|
95
|
+
if (identity && typeof source["id"] === "string") normalized["id"] = source["id"];
|
|
103
96
|
for (const [field, def] of Object.entries(fields)) normalized[field] = normalizeValue(def, source[field]);
|
|
104
97
|
return normalized;
|
|
105
98
|
}
|
|
@@ -8,7 +8,7 @@ type DocumentProps<D> = Omit<HTMLAttributes<HTMLElement>, "title" | "slot"> & {
|
|
|
8
8
|
};
|
|
9
9
|
/** Titles the `<iframe>` for assistive technology. Defaults to the file's name. */
|
|
10
10
|
title?: string;
|
|
11
|
-
/** Render inside
|
|
11
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the viewer
|
|
12
12
|
* fills edge to edge, tinted when there is nothing to show. It has NO geometry of its
|
|
13
13
|
* own: `className` lands on it and your classes are its whole box. `false` renders a
|
|
14
14
|
* bare `<iframe>` instead. Default `true`. */
|
|
@@ -6,7 +6,9 @@ import { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
|
|
|
6
6
|
//#region src/primitives/slot-download.d.ts
|
|
7
7
|
type DownloadOwnProps<D> = {
|
|
8
8
|
slot: ValueBinding<D> & {
|
|
9
|
-
value: ImageValue | VideoValue | DocumentValue
|
|
9
|
+
value: ((ImageValue | VideoValue | DocumentValue) & {
|
|
10
|
+
kind?: "image" | "video" | "document";
|
|
11
|
+
}) | null | undefined;
|
|
10
12
|
};
|
|
11
13
|
/** Author markup inside the marked element (an icon, the filename, a size
|
|
12
14
|
* line) — rendered in every branch, absent value included. */
|
|
@@ -43,9 +43,12 @@ type SlotImageProps<D> = Omit<ComponentProps<typeof Image>, "value" | "slot" | "
|
|
|
43
43
|
declare function SlotImage<D extends {
|
|
44
44
|
type: "image" | "video" | "tour" | "document" | "media";
|
|
45
45
|
}>(props: SlotImageProps<D>): ReactNode;
|
|
46
|
+
type OfKind<V, K extends MediaValue["kind"]> = V & {
|
|
47
|
+
kind?: K;
|
|
48
|
+
};
|
|
46
49
|
type SlotVideoProps<D> = Omit<ComponentProps<typeof Video>, "value" | "playback" | "slot"> & {
|
|
47
50
|
slot: ValueBinding<D> & {
|
|
48
|
-
value: VideoValue | null | undefined;
|
|
51
|
+
value: OfKind<VideoValue, "video"> | null | undefined;
|
|
49
52
|
};
|
|
50
53
|
/** `false` declines selection on THIS copy (a carousel clone, a responsive mirror) —
|
|
51
54
|
* full identity stays, and the copy is still patched live. */
|
|
@@ -67,7 +70,7 @@ declare function SlotVideo<D extends {
|
|
|
67
70
|
}>(props: SlotVideoProps<D>): ReactNode;
|
|
68
71
|
type SlotTourProps<D> = Omit<ComponentProps<typeof Tour>, "value" | "slot"> & {
|
|
69
72
|
slot: ValueBinding<D> & {
|
|
70
|
-
value: TourValue | null | undefined;
|
|
73
|
+
value: OfKind<TourValue, "tour"> | null | undefined;
|
|
71
74
|
};
|
|
72
75
|
/** `false` declines selection on THIS copy (a carousel clone, a responsive mirror) —
|
|
73
76
|
* full identity stays, and the copy is still patched live. */
|
package/dist/rules/registry.js
CHANGED
|
@@ -473,12 +473,6 @@ const AUTHORED_RULES = [
|
|
|
473
473
|
venue: "tree",
|
|
474
474
|
stage: "stylesheet",
|
|
475
475
|
summary: "A stylesheet reachable from template.ts fails to resolve or compile, so no stylesheet rule could grade it."
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
id: "css/retired-layer",
|
|
479
|
-
venue: "tree",
|
|
480
|
-
stage: "stylesheet",
|
|
481
|
-
summary: "A stylesheet declares `@layer sections` or `@layer template`, the layers the framework retired; author CSS is unlayered."
|
|
482
476
|
}
|
|
483
477
|
];
|
|
484
478
|
function contractRuleId(id) {
|
|
@@ -2,7 +2,7 @@ import { DocumentFormat, ImageFormat } from "../packages/internal/format-geometr
|
|
|
2
2
|
import { WebsiteFormat } from "./format.js";
|
|
3
3
|
//#region src/schema/format-presets.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* The v1 preset library, exported from the
|
|
5
|
+
* The v1 preset library, exported from the package root. `presets.website` is the
|
|
6
6
|
* geometry-less singleton every website template's format set holds; the rest
|
|
7
7
|
* are the known social/print/deck sizes the picker renders as branded.
|
|
8
8
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AddressValue } from "../packages/internal/template-contracts/dist/address-value.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DocumentValue } from "../packages/internal/template-contracts/dist/document-value.js";
|
|
3
|
+
import { TourValue } from "../packages/internal/template-contracts/dist/tour-value.js";
|
|
4
|
+
import { VideoValue } from "../packages/internal/template-contracts/dist/video-value.js";
|
|
5
5
|
import { PoiPhoto, PoiRow } from "../packages/internal/template-contracts/dist/poi-row.js";
|
|
6
|
-
import { AuthorImage,
|
|
6
|
+
import { AuthorImage, ImageValue, MediaValue, PlaybackConfig } from "../packages/internal/template-contracts/dist/runtime-values.js";
|
|
7
7
|
import { ItemIdentity, ObjectValue, SlotValue } from "../packages/internal/template-contracts/dist/slot-value.js";
|
|
8
8
|
import { Slot } from "../packages/internal/template-contracts/dist/slot-types.js";
|
|
9
9
|
import { Coordinates } from "./property-facts.js";
|
|
@@ -46,4 +46,4 @@ declare const SectionSchema: z.ZodObject<{
|
|
|
46
46
|
/** The authored input shape of `SectionSchema` — what `as const satisfies SectionSchemaShape` checks a section's `schema.ts` against. */
|
|
47
47
|
type SectionSchemaShape = z.input<typeof SectionSchema>;
|
|
48
48
|
//#endregion
|
|
49
|
-
export { type AddressValue, type AuthorImage, type Coordinates, DisplayEntryShape, DisplayShape, type
|
|
49
|
+
export { type AddressValue, type AuthorImage, type Coordinates, DisplayEntryShape, DisplayShape, type DocumentValue, type ImageValue, type ItemIdentity, type MediaValue, type ObjectValue, type PlaybackConfig, type PoiPhoto, type PoiRow, SectionSchema, SectionSchemaShape, type Slot, type SlotValue, type TourValue, type VideoValue };
|
package/dist/styles.css
CHANGED
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* token of yours usable.
|
|
23
23
|
*
|
|
24
24
|
* The @source below resolves relative to THIS FILE'S SHIPPED LOCATION (dist/styles.css),
|
|
25
|
-
* registering
|
|
26
|
-
* baked into
|
|
25
|
+
* registering Concrete's compiled JS for class scanning — that is how the utility classes
|
|
26
|
+
* baked into Concrete's primitives reach your compiled CSS. It also overrides Tailwind's
|
|
27
27
|
* default exclusion of node_modules.
|
|
28
28
|
*
|
|
29
29
|
* It is scoped to `primitives/` because those are the ONLY shipped modules that emit
|
|
30
30
|
* markup. Tailwind's scanner is a plain candidate-extractor — it cannot tell code from a
|
|
31
|
-
* comment — and
|
|
31
|
+
* comment — and Concrete ships unminified (deliberately: it keeps these class-name string
|
|
32
32
|
* literals scannable). Pointed at all of dist/, it therefore compiled prose out of the
|
|
33
33
|
* CLI's and the ESLint preset's doc comments into every consumer's stylesheet: 8 dead
|
|
34
34
|
* utilities and 19 stray @property registrations, ~2.5 KB. If a primitive ever moves out
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* per-page-overridable tokens, so inlining is both correct and what keeps the compiled
|
|
49
49
|
* output stable. Nothing here may reference a token a template's own CSS defines.
|
|
50
50
|
*
|
|
51
|
-
* NO BREAKPOINTS.
|
|
51
|
+
* NO BREAKPOINTS. Concrete declares none and resets none, so Tailwind's own
|
|
52
52
|
* `sm`/`md`/`lg`/`xl`/`2xl` reach a template untouched. Where a design swaps is the
|
|
53
53
|
* template's call, not the platform's: declare your own `--breakpoint-*` tokens in
|
|
54
54
|
* `@theme` (each becomes a variant prefix), or write an arbitrary variant inline. The
|
|
@@ -10,7 +10,6 @@ const CLASS_BY_CATEGORY = {
|
|
|
10
10
|
presentation: "document"
|
|
11
11
|
};
|
|
12
12
|
function defineTemplate(input) {
|
|
13
|
-
if ("reconcile" in input) throw new Error(`Template "${input.key}" passes \`reconcile\`, which defineTemplate no longer takes. A slot that depends on another section reads it on its own \`source:\` — a slot ref (\`source: Hero.slots.title\`) or \`compute({ reads }, fn)\`. \`concrete upgrade\` removes an empty \`reconcile: []\` and lists every rule left to move by hand.`);
|
|
14
13
|
assertScope(input.scope);
|
|
15
14
|
const formats = Array.isArray(input.format) ? [...input.format] : [input.format];
|
|
16
15
|
const output = outputClassOf(input.key, formats);
|
|
@@ -3,7 +3,7 @@ purpose: Every `concrete` command, with its full flag surface, exit codes and co
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# Command reference
|
|
@@ -79,7 +79,7 @@ of its flags.
|
|
|
79
79
|
|
|
80
80
|
## Versions
|
|
81
81
|
|
|
82
|
-
These pages describe `@homepages/concrete` **>=
|
|
82
|
+
These pages describe `@homepages/concrete` **>=11.0.0 <12.0.0**. The range, rather than
|
|
83
83
|
the exact version they were generated from: this reference is committed build output,
|
|
84
84
|
so a page stamped with a patch version would be stale the day it shipped.
|
|
85
85
|
`concrete --version` prints the installed one.
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete build` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete build
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete check` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete check
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete dev` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete dev
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete property add` command — its flags, exit codes and const
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete property add
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete property list` command — its flags, exit codes and cons
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete property list
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete publish` command — its flags, exit codes and constraint
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete publish
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete upgrade` command — its flags, exit codes and constraint
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete upgrade
|
|
@@ -3,7 +3,7 @@ purpose: Every rule `concrete check` grades, by the stage that grades it, in the
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete rule registry
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=11.0.0 <12.0.0"
|
|
7
7
|
related: [reference/cli/check.md]
|
|
8
8
|
---
|
|
9
9
|
# Rule reference
|
|
@@ -100,7 +100,6 @@ The CSS import graph of `template.ts` compiles into the template stylesheet exac
|
|
|
100
100
|
| `concrete/css/tailwind-import` | tree | The CSS import graph of template.ts carries no `@import "tailwindcss"`, or more than one. |
|
|
101
101
|
| `concrete/css/external-url` | tree | A rendered template's compiled stylesheet references an external URL, which the renderer cannot reach. |
|
|
102
102
|
| `concrete/css/compile-failed` | tree | A stylesheet reachable from template.ts fails to resolve or compile, so no stylesheet rule could grade it. |
|
|
103
|
-
| `concrete/css/retired-layer` | tree | A stylesheet declares `@layer sections` or `@layer template`, the layers the framework retired; author CSS is unlayered. |
|
|
104
103
|
|
|
105
104
|
## logic
|
|
106
105
|
|