@homepages/concrete 10.0.0 → 12.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 +48 -0
- package/codemods/manifest.json +7 -154
- package/dist/artifact/playground/client/assets/index-BcLGpWLR.js +1266 -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 +39 -40
- package/dist/base.css +18 -65
- package/dist/cli/build/artifact.js +1 -1
- package/dist/cli/build/fixtures.js +3 -2
- package/dist/cli/capture/capture.js +8 -6
- package/dist/cli/check/stages/sections.js +1 -1
- package/dist/cli/dev/workspace-reader.js +4 -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-bake/dist/compute-reads.js +1 -1
- package/dist/packages/internal/fill-bake/dist/held-rows.js +2 -0
- package/dist/packages/internal/fill-bake/dist/index.js +1 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +3 -14
- package/dist/packages/internal/format-geometry/dist/capture.js +3 -11
- package/dist/packages/internal/format-geometry/dist/format.d.ts +2 -8
- package/dist/packages/internal/format-geometry/dist/geometry.js +2 -13
- 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/fact-registry.js +1 -1
- 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/FrameShell.d.ts +5 -2
- package/dist/primitives/FrameShell.js +2 -1
- 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 +1 -7
- package/dist/schema/format-presets.d.ts +1 -1
- package/dist/schema/format.d.ts +0 -1
- package/dist/schema/format.js +1 -2
- package/dist/schema/manifest.js +18 -24
- package/dist/schema/section-schema.d.ts +5 -5
- package/dist/site-analytics.js +6 -1
- package/dist/site-runtime/window-height.js +19 -0
- package/dist/styles.css +4 -4
- package/dist/template/define-template.d.ts +11 -0
- package/dist/template/define-template.js +1 -1
- package/dist/template/materialize.js +2 -0
- 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 +2 -3
- 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
|
@@ -4,7 +4,7 @@ import { readLadder } from "./store.js";
|
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/media-resolution/dist/tour.js
|
|
6
6
|
const DEFAULT = {
|
|
7
|
-
|
|
7
|
+
id: "",
|
|
8
8
|
url: "",
|
|
9
9
|
poster: "",
|
|
10
10
|
alt: ""
|
|
@@ -23,12 +23,12 @@ async function resolveTourSlot(value, records, store) {
|
|
|
23
23
|
if (!tourId) return DEFAULT;
|
|
24
24
|
const record = records.get(tourId);
|
|
25
25
|
if (record === void 0) {
|
|
26
|
-
store.log?.warn({
|
|
26
|
+
store.log?.warn({ media_id: tourId }, "resolve-tour-slot: no tour media the render may reach");
|
|
27
27
|
return DEFAULT;
|
|
28
28
|
}
|
|
29
29
|
if (record.kind !== "tour") {
|
|
30
30
|
store.log?.warn({
|
|
31
|
-
|
|
31
|
+
media_id: tourId,
|
|
32
32
|
kind: record.kind
|
|
33
33
|
}, "resolve-tour-slot: media is not a tour");
|
|
34
34
|
return DEFAULT;
|
|
@@ -36,12 +36,12 @@ async function resolveTourSlot(value, records, store) {
|
|
|
36
36
|
try {
|
|
37
37
|
const embed = tourEmbedUrl(record.url);
|
|
38
38
|
if (embed === null) {
|
|
39
|
-
store.log?.warn({
|
|
39
|
+
store.log?.warn({ media_id: tourId }, "resolve-tour-slot: tour link embeds nowhere");
|
|
40
40
|
return DEFAULT;
|
|
41
41
|
}
|
|
42
42
|
const posterKey = record.renditions.poster?.key ?? null;
|
|
43
43
|
return attachPosterResponsive({
|
|
44
|
-
|
|
44
|
+
id: tourId,
|
|
45
45
|
url: embed,
|
|
46
46
|
poster: posterKey ? await store.fileUrl(posterKey) : "",
|
|
47
47
|
alt: typeof v.alt === "string" ? v.alt : "",
|
|
@@ -49,7 +49,7 @@ async function resolveTourSlot(value, records, store) {
|
|
|
49
49
|
}, posterKey, store);
|
|
50
50
|
} catch (err) {
|
|
51
51
|
store.log?.error({
|
|
52
|
-
|
|
52
|
+
media_id: tourId,
|
|
53
53
|
err: err.message
|
|
54
54
|
}, "resolve-tour-slot: presign failed; soft-empty tour");
|
|
55
55
|
return DEFAULT;
|
|
@@ -4,7 +4,7 @@ import { readLadder } from "./store.js";
|
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/media-resolution/dist/video.js
|
|
6
6
|
const DEFAULT = {
|
|
7
|
-
|
|
7
|
+
id: "",
|
|
8
8
|
url: "",
|
|
9
9
|
poster: "",
|
|
10
10
|
alt: ""
|
|
@@ -23,12 +23,12 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
23
23
|
if (!videoId) return DEFAULT;
|
|
24
24
|
const record = records.get(videoId);
|
|
25
25
|
if (record === void 0) {
|
|
26
|
-
store.log?.warn({
|
|
26
|
+
store.log?.warn({ media_id: videoId }, "resolve-video-slot: no video media the render may reach");
|
|
27
27
|
return DEFAULT;
|
|
28
28
|
}
|
|
29
29
|
if (record.kind !== "video") {
|
|
30
30
|
store.log?.warn({
|
|
31
|
-
|
|
31
|
+
media_id: videoId,
|
|
32
32
|
kind: record.kind
|
|
33
33
|
}, "resolve-video-slot: media is not a video");
|
|
34
34
|
return DEFAULT;
|
|
@@ -40,11 +40,11 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
40
40
|
const url = record.url;
|
|
41
41
|
const embed = videoEmbedUrl(url);
|
|
42
42
|
if (!embed) {
|
|
43
|
-
store.log?.warn({
|
|
43
|
+
store.log?.warn({ media_id: videoId }, "resolve-video-slot: link upload embeds nowhere");
|
|
44
44
|
return DEFAULT;
|
|
45
45
|
}
|
|
46
46
|
const out = {
|
|
47
|
-
|
|
47
|
+
id: videoId,
|
|
48
48
|
url: embed,
|
|
49
49
|
poster: posterKey ? await store.fileUrl(posterKey) : "",
|
|
50
50
|
alt,
|
|
@@ -57,7 +57,7 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
57
57
|
const encode = record.renditions.encode;
|
|
58
58
|
if (encode === null) {
|
|
59
59
|
store.log?.warn({
|
|
60
|
-
|
|
60
|
+
media_id: videoId,
|
|
61
61
|
state: record.state
|
|
62
62
|
}, "resolve-video-slot: no encode; poster-only");
|
|
63
63
|
if (record.state !== "failed") store.notePending?.({
|
|
@@ -65,14 +65,14 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
65
65
|
id: videoId
|
|
66
66
|
});
|
|
67
67
|
return attachPosterResponsive({
|
|
68
|
-
|
|
68
|
+
id: videoId,
|
|
69
69
|
url: "",
|
|
70
70
|
poster,
|
|
71
71
|
alt
|
|
72
72
|
}, posterKey, store);
|
|
73
73
|
}
|
|
74
74
|
const out = {
|
|
75
|
-
|
|
75
|
+
id: videoId,
|
|
76
76
|
url: await store.fileUrl(encode.key),
|
|
77
77
|
poster,
|
|
78
78
|
alt
|
|
@@ -82,7 +82,7 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
82
82
|
return attachPosterResponsive(out, posterKey, store);
|
|
83
83
|
} catch (err) {
|
|
84
84
|
store.log?.error({
|
|
85
|
-
|
|
85
|
+
media_id: videoId,
|
|
86
86
|
err: err.message
|
|
87
87
|
}, "resolve-video-slot: presign failed; soft-empty video");
|
|
88
88
|
return DEFAULT;
|
|
@@ -42,6 +42,7 @@ function checkNode(node, where) {
|
|
|
42
42
|
if (typeof node["brief"] !== "string" || node["brief"] === "") throw new Error(`${where} declares no \`brief\` — the brief is the whole instruction.`);
|
|
43
43
|
if (verb === "pick") {
|
|
44
44
|
if (node["of"] === void 0) throw new Error(`${where} picks with no \`of\` — a pick names its candidates on every holder.`);
|
|
45
|
+
if (node["none"] !== void 0) throw new Error(`${where} picks with \`none\` — a pick's verdict may always select nothing, so it states no \`none\`.`);
|
|
45
46
|
checkCandidates(node["of"], where);
|
|
46
47
|
} else if (node["of"] !== void 0) throw new Error(verb === "write" ? `${where} writes \`of\` something — the kind a write produces is its holder's (a text slot's own, a list's \`item\`), so a write takes no \`of\`.` : `${where} finds \`of\` something — the platform's lookup supplies what a find yields, so it takes no \`of\`.`);
|
|
47
48
|
return verb;
|
|
@@ -59,10 +59,8 @@ const CONTRACTS = {
|
|
|
59
59
|
"decision-kind": {
|
|
60
60
|
implementation: byDecision(({ key }, d) => {
|
|
61
61
|
if (d.kind !== void 0 && DECISION_KINDS.includes(d.kind)) return;
|
|
62
|
-
const { type } = d;
|
|
63
62
|
const found = d.kind === void 0 ? "declares no `kind`" : `declares kind "${d.kind}"`;
|
|
64
|
-
|
|
65
|
-
throw new Error(`Section "${key}": fill-spec decision "${d.id}" ${found}${retired}. A decision's kind is one of ${DECISION_KINDS.map((k) => `"${k}"`).join(", ")}; rebuild the section with the current Concrete.`);
|
|
63
|
+
throw new Error(`Section "${key}": fill-spec decision "${d.id}" ${found}. A decision's kind is one of ${DECISION_KINDS.map((k) => `"${k}"`).join(", ")}; rebuild the section with the current Concrete.`);
|
|
66
64
|
}),
|
|
67
65
|
assertions: []
|
|
68
66
|
},
|
|
@@ -24,11 +24,11 @@ function assertOne(path, key, slot, section) {
|
|
|
24
24
|
if (!isRegistryFactKey(field)) throw new Error(`${path}: unknown fact "${String(src.key)}"`);
|
|
25
25
|
const valueType = registryFactValueType(field);
|
|
26
26
|
if (valueType === "image" && slot.type !== "image") throw new Error(`${path}: image source field "${src.key}" must sit on an image slot`);
|
|
27
|
-
if (valueType === "address" && slot.type !== "address") throw new Error(`${path}: "${field}" is a whole address, which only an \`address\` slot holds — bind it to an \`address()\`, or show the line you want with a \`compute()\` reading it
|
|
27
|
+
if (valueType === "address" && slot.type !== "address") throw new Error(`${path}: "${field}" is a whole address, which only an \`address\` slot holds — bind it to an \`address()\`, or show the line you want with a \`compute()\` reading it.`);
|
|
28
28
|
if (slot.type === "address" && valueType !== "address") throw new Error(`${path}: an \`address\` slot bound to "${field}", which is not an address — bind it to the property's address, or compute the value.`);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (typeof src.kind !== "string") throw new Error(`${path} is sourced by a ref without a "kind" —
|
|
31
|
+
if (typeof src.kind !== "string") throw new Error(`${path} is sourced by a ref without a "kind" — every ref names its kind.`);
|
|
32
32
|
if (src.kind === "item") throw new Error(`${path} is sourced by a field of its own item ({ kind: "item" }) — a section's item fields do not read one another; read the element, or a member through a row.`);
|
|
33
33
|
if (src.kind !== "derived") return;
|
|
34
34
|
if (src.transform !== key) throw new Error(`${path}: unknown transform "${String(src.transform)}". A "derived" source is a compute() binding, and its transform must equal its own slot key ("${key}") — it does not, which means the schema was hand-authored with a mismatched transform rather than produced by defineSchema's compute() path. Author a derived value with compute() ("slot({ source: compute({ reads }, fn) })").`);
|
|
@@ -62,7 +62,7 @@ function assertDeclaredRefs(path, reads) {
|
|
|
62
62
|
if (kind === "section" && typeof section === "string" && typeof slot === "string") return;
|
|
63
63
|
refuseIndexedRow(`${path}: reads[${String(i)}]`, record);
|
|
64
64
|
if (kind === "row" && "slot" in record || kind === "element") return;
|
|
65
|
-
throw new Error(kind ===
|
|
65
|
+
throw new Error(kind === "item" ? `${path}: reads[${String(i)}] reads a field of its own item ({ kind: "item" }) — a section's item fields do not read one another; read the element, or a member through a row.` : kind === "row" ? `${path}: reads[${String(i)}] reads the row member "${String(field)}" without naming its row slot — read it through a row: \`{ kind: "row", slot, field }\`.` : `${path}: reads[${String(i)}] is not a home ref ({ kind: "home", key }) or a section ref ({ kind: "section", section, slot }).`);
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function assertSourceContract(schema) {
|
|
@@ -16,7 +16,6 @@ function isBound(slot) {
|
|
|
16
16
|
return kind !== void 0 && BINDING_KINDS.has(kind);
|
|
17
17
|
}
|
|
18
18
|
function check(slot, sectionKey, path, inherited, picked = false) {
|
|
19
|
-
if (slot.sources !== void 0) throw new Error(`Section "${sectionKey}": slot "${path}" 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.`);
|
|
20
19
|
const holdsPick = picked && slot.source?.kind === "element" && isMediaType(slot.type ?? "");
|
|
21
20
|
checkMediaFilter(slot, sectionKey, path, inherited || isBound(slot) && !holdsPick);
|
|
22
21
|
if (slot.element) {
|
|
@@ -27,7 +26,6 @@ function check(slot, sectionKey, path, inherited, picked = false) {
|
|
|
27
26
|
}
|
|
28
27
|
function checkMediaFilter(slot, sectionKey, path, bound) {
|
|
29
28
|
const kind = slot.type ?? "";
|
|
30
|
-
if ("category" in slot) throw new Error(`Section "${sectionKey}": slot "${path}" declares \`category\`. A media slot names the list it picks from in \`from\` (${mediaListKeys().map((key) => `"${key}"`).join(", ")}), or owns its media without one.`);
|
|
31
29
|
if (!isMediaType(kind)) {
|
|
32
30
|
if (slot.from !== void 0 && kind !== "row") throw new Error(`Section "${sectionKey}": slot "${path}" declares \`from\`, but a section's ${kind === "select" ? "select states its values" : "slot names no candidates of its own"} — a media slot picks \`from\` a media list, a row from its table.`);
|
|
33
31
|
if (slot.process !== void 0) throw new Error(`Section "${sectionKey}": slot "${path}" declares \`process\`, which only a media slot (image, video, tour, document, media) carries.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
1
|
+
import { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath } from "./layout.js";
|
|
2
2
|
import { sha256Hex } from "./sha256.js";
|
|
3
3
|
import { listingDigest, sectionContentHash, sourceDigest, templateContentHash } from "./hash.js";
|
|
4
4
|
import { ArtifactManifest, ArtifactScope, ArtifactSection, readArtifactSchema } from "./manifest.js";
|
|
5
5
|
import { verifyArtifact } from "./verify.js";
|
|
6
6
|
|
|
7
|
-
export { ASSET_URL_PREFIX, ArtifactManifest, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
7
|
+
export { ASSET_URL_PREFIX, ArtifactManifest, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTION_FILES, TEMPLATE_FILES, assetPath, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionContentHash, sectionDir, sectionPath, sourceDigest, staticPath, templateContentHash, templatePath, verifyArtifact };
|
|
@@ -17,18 +17,20 @@ const UNHASHED_DIRS = [
|
|
|
17
17
|
const STORED_DIRS = [ASSETS_DIR, CAPTURES_DIR];
|
|
18
18
|
const FIXTURE_FILES = {
|
|
19
19
|
contentDoc: "content-doc.json",
|
|
20
|
+
settledDoc: "settled-doc.json",
|
|
20
21
|
property: "property.json",
|
|
21
22
|
meta: "meta.json"
|
|
22
23
|
};
|
|
23
|
-
const FIXTURE_OPTIONAL_FILES = { settledDoc: "settled-doc.json" };
|
|
24
24
|
const CAPTURE_FILES = {
|
|
25
25
|
bundle: "bundle.zip",
|
|
26
26
|
document: "document.pdf"
|
|
27
27
|
};
|
|
28
28
|
const ASSET_URL_PREFIX = "/section-assets/";
|
|
29
|
+
const PLAYGROUND_CANVAS_ISLAND_HOST = "island-canvas-host.mjs";
|
|
29
30
|
const PLAYGROUND_FILES = {
|
|
30
31
|
host: "host.mjs",
|
|
31
|
-
clientShell: `${PLAYGROUND_CLIENT_DIR}/index.html
|
|
32
|
+
clientShell: `${PLAYGROUND_CLIENT_DIR}/index.html`,
|
|
33
|
+
canvasIslandHost: `${PLAYGROUND_CLIENT_DIR}/${PLAYGROUND_CANVAS_ISLAND_HOST}`
|
|
32
34
|
};
|
|
33
35
|
function playgroundPath(file) {
|
|
34
36
|
return `${PLAYGROUND_DIR}/${file}`;
|
|
@@ -109,19 +111,17 @@ function boundFiles(binding) {
|
|
|
109
111
|
for (const facade of Object.values(binding.react_vendor ?? {})) ref(staticPath(facade.filename), facade);
|
|
110
112
|
if (binding.react_vendor_core !== null) ref(staticPath(binding.react_vendor_core.filename), binding.react_vendor_core);
|
|
111
113
|
if (binding.analytics !== null) ref(staticPath(binding.analytics.filename), binding.analytics);
|
|
112
|
-
for (const filename of Object.values(binding.masters
|
|
114
|
+
for (const filename of Object.values(binding.masters)) out.push({
|
|
113
115
|
path: assetPath(filename),
|
|
114
116
|
filename
|
|
115
117
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ref(assetPath(apple_touch.filename), apple_touch);
|
|
122
|
-
}
|
|
118
|
+
const { ico, svg, png, apple_touch } = binding.icons;
|
|
119
|
+
ref(assetPath(ico.filename), ico);
|
|
120
|
+
if (svg !== null) ref(assetPath(svg.filename), svg);
|
|
121
|
+
for (const size of Object.values(png)) ref(assetPath(size.filename), size);
|
|
122
|
+
ref(assetPath(apple_touch.filename), apple_touch);
|
|
123
123
|
return out;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
//#endregion
|
|
127
|
-
export { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
127
|
+
export { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath };
|
|
@@ -11,7 +11,7 @@ const ArtifactSection = z.object({
|
|
|
11
11
|
content_hash: Sha256
|
|
12
12
|
}).strict();
|
|
13
13
|
const ArtifactManifest = z.object({
|
|
14
|
-
artifact_schema: z.literal(
|
|
14
|
+
artifact_schema: z.literal(4),
|
|
15
15
|
framework_version: z.string().min(1),
|
|
16
16
|
key: z.string().refine(isTemplateKey, "a template key: one path segment"),
|
|
17
17
|
display_name: z.string().min(1),
|
|
@@ -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 };
|
|
@@ -507,7 +507,7 @@ const commercial_spaces = page({
|
|
|
507
507
|
}
|
|
508
508
|
})
|
|
509
509
|
}));
|
|
510
|
-
const COMPARABLES_BRIEF = "
|
|
510
|
+
const COMPARABLES_BRIEF = "List the comparable properties the uploads present: other properties an upload sets beside the property it markets, so that property's price and specs can be weighed against theirs. They appear as rows of a sales or rent comparables table, as panels with their own photo and figures, as numbered pins in a map legend, or as lines in a survey of recent trades. The property the uploads market is the one this request is for, whatever address they print for it; in a building, it is the building and every unit the uploads market in it. It is never a comparable, even where it appears in a comparables table or at the centre of a comparables map, and an upload presenting it or one of its units for itself, such as its listing sheet, brochure, price list or market history, presents no comparable. Another unit of its building is a comparable only where an upload sets it beside the property as one, such as a sister unit's earlier sale in a comps table. A market or area average, a portfolio total, or anything else that is not one property is not a comparable. Read every upload whole, including tables that continue onto the next page. Each figure is what an upload prints as text for that property, copied exactly, and a listing's remarks word for word: never counted off a floor plan, a photo or a map, never worked out from other figures (a price per unit times a unit count, a price over a size, the days between two dates, a yearly fee made monthly, an average of rows), and never carried over from a neighbouring row, a summary or the property itself. A studio has one bedroom. A property listed in several places is one item carrying every figure those places state. A figure no upload states for that property is null. When no upload sets another property beside the one it markets, return no items.";
|
|
511
511
|
const comparablePlace = address({ label: "Address" });
|
|
512
512
|
const comparableSaleDate = date({ label: "Sale date" });
|
|
513
513
|
const comparables = page({
|
|
@@ -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 };
|
|
@@ -4,6 +4,8 @@ import { ReactNode } from "react";
|
|
|
4
4
|
//#region src/primitives/FrameShell.d.ts
|
|
5
5
|
type Props = {
|
|
6
6
|
format: ImageFormat | DocumentFormat;
|
|
7
|
+
/** The page's declared direction; a row page stamps `data-direction="row"`, a column page nothing. */
|
|
8
|
+
direction?: "column" | "row";
|
|
7
9
|
children: ReactNode;
|
|
8
10
|
};
|
|
9
11
|
/**
|
|
@@ -12,7 +14,8 @@ type Props = {
|
|
|
12
14
|
* document a window that is exactly the format's bleed box, and the static
|
|
13
15
|
* half of the contract (`.concrete-frame`, from the base stylesheet) fills
|
|
14
16
|
* that window, clips at the shell's own edge, and lays sections out as a
|
|
15
|
-
* rigid flex column
|
|
17
|
+
* rigid flex column, or a rigid flex row on a page declaring
|
|
18
|
+
* `direction: "row"` (`flex-shrink: 0` on every direct child, so an
|
|
16
19
|
* overflowing stack overflows measurably instead of being silently
|
|
17
20
|
* compressed). The shell sets the three geometry tokens
|
|
18
21
|
* (`--frame-w`/`--frame-h`/`--frame-bleed`) — the declared geometry, for
|
|
@@ -24,6 +27,6 @@ type Props = {
|
|
|
24
27
|
* shell draws nothing: trim and bleed guides are host chrome, never markup, so
|
|
25
28
|
* rendered bytes are identical in every host.
|
|
26
29
|
*/
|
|
27
|
-
declare function FrameShell({ format, children }: Props): import("react").JSX.Element;
|
|
30
|
+
declare function FrameShell({ format, direction, children }: Props): import("react").JSX.Element;
|
|
28
31
|
//#endregion
|
|
29
32
|
export { FrameShell };
|
|
@@ -2,10 +2,11 @@ import { FRAME_ROOT_CLASS, frameTokens } from "../packages/internal/format-geome
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/primitives/FrameShell.tsx
|
|
5
|
-
function FrameShell({ format, children }) {
|
|
5
|
+
function FrameShell({ format, direction = "column", children }) {
|
|
6
6
|
return /* @__PURE__ */ jsx("div", {
|
|
7
7
|
className: FRAME_ROOT_CLASS,
|
|
8
8
|
"data-format": format.id,
|
|
9
|
+
"data-direction": direction === "row" ? "row" : void 0,
|
|
9
10
|
style: frameTokens(format),
|
|
10
11
|
children
|
|
11
12
|
});
|
|
@@ -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
|
*
|