@homepages/concrete 11.0.0 → 13.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 +203 -0
- package/README.md +8 -10
- package/codemods/fixtures-are-data.mjs +7 -0
- package/codemods/fixtures-list-properties.mjs +6 -0
- package/codemods/manifest.json +17 -0
- package/codemods/steps/fixtures-list-properties.mjs +16 -0
- package/codemods/steps/fixtures-to-data.mjs +41 -0
- package/dist/artifact/playground/client/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/dist/artifact/playground/client/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/dist/artifact/playground/client/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +1338 -0
- package/dist/artifact/playground/client/assets/index-C01UCAWD.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 +110 -60
- package/dist/base.css +19 -59
- package/dist/cli/build/icons.js +1 -1
- package/dist/cli/build/index.js +11 -10
- package/dist/cli/build/manifest.js +44 -0
- package/dist/cli/build/record.js +123 -0
- package/dist/cli/build/sections.js +28 -18
- package/dist/cli/build/source.js +1 -1
- package/dist/cli/build/static.js +8 -5
- package/dist/cli/build/template-build.js +614 -0
- package/dist/cli/check/analyze.js +18 -1
- package/dist/cli/check/load-workspace.js +2 -2
- package/dist/cli/check/portable-names.js +1 -1
- package/dist/cli/check/render/corpus.js +119 -0
- package/dist/cli/check/render/invariants.js +1 -0
- package/dist/cli/check/stages/bundles.js +15 -18
- package/dist/cli/check/stages/composition.js +8 -25
- package/dist/cli/check/stages/fixtures.js +14 -10
- package/dist/cli/check/stages/logic.js +7 -23
- package/dist/cli/check/stages/render.js +12 -14
- package/dist/cli/check/stages/sections.js +22 -66
- package/dist/cli/check/stages/stylesheet.js +4 -26
- package/dist/cli/check/stages/workspace.js +27 -22
- package/dist/cli/commands.js +51 -23
- package/dist/cli/currency/preamble.js +1 -1
- package/dist/cli/currency/resolve-latest.js +3 -2
- package/dist/cli/dev/capture-browser.js +26 -0
- package/dist/cli/dev/fixture-schema.js +441 -0
- package/dist/cli/dev/folder-files.js +244 -0
- package/dist/cli/dev/index.js +7 -3
- package/dist/cli/dev/playground-server.js +34 -0
- package/dist/cli/dev/section-ladders.js +76 -0
- package/dist/cli/dev/server.js +120 -304
- package/dist/cli/install/background.js +16 -0
- package/dist/cli/install/index.js +45 -0
- package/dist/cli/install/tools.js +27 -0
- package/dist/cli/media/derive.js +19 -13
- package/dist/cli/media/deriver-plugin.js +14 -3
- package/dist/cli/property/fixture-list.js +46 -0
- package/dist/cli/property/index.js +12 -9
- package/dist/cli/property/library.js +12 -10
- package/dist/cli/publish/artifact.js +90 -0
- package/dist/cli/publish/captures.js +61 -0
- package/dist/cli/publish/fixtures.js +17 -0
- package/dist/cli/publish/index.js +10 -18
- package/dist/cli/{build → publish}/playground.js +3 -3
- package/dist/cli/publish/report.js +15 -33
- package/dist/cli/upgrade/codemod.d.ts +14 -0
- package/dist/cli/upgrade/fixture-conversion.d.ts +11 -0
- package/dist/cli/upgrade/fixture-conversion.js +54 -0
- package/dist/cli/upgrade/fixture-modules.js +125 -0
- package/dist/cli/upgrade/fixtures-to-data.d.ts +40 -0
- package/dist/cli/upgrade/fixtures-to-data.js +498 -0
- package/dist/cli/upgrade/index.js +18 -2
- package/dist/cli/upgrade/legacy-fixtures.d.ts +34 -0
- package/dist/cli/upgrade/legacy-fixtures.js +22 -0
- package/dist/cli/upgrade/stage.js +1 -1
- package/dist/cli/workspace-fixtures.js +80 -0
- package/dist/cli.js +1 -0
- package/dist/css/compile.js +9 -3
- package/dist/fixtures/bundle-rule.js +16 -16
- package/dist/fixtures/media-plugin.js +12 -33
- package/dist/fixtures/synthesize-empties.js +3 -2
- package/dist/index.d.ts +7 -7
- package/dist/{playground-island-runtime.d.ts → island-runtime.d.ts} +1 -2
- package/dist/{playground-island-runtime.js → island-runtime.js} +1 -2
- package/dist/islands/client-module.js +1 -1
- package/dist/{cli/dev → islands}/tsconfig-paths.js +2 -14
- package/dist/islands/wrap.js +40 -0
- package/dist/node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.js +5119 -0
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/bundle-evaluation/dist/cache.js +36 -0
- package/dist/packages/internal/bundle-evaluation/dist/evaluate.js +174 -0
- package/dist/packages/internal/bundle-evaluation/dist/index.js +5 -0
- package/dist/packages/internal/bundle-evaluation/dist/section-code.js +10 -0
- package/dist/packages/internal/capture-settle/dist/index.js +2 -2
- package/dist/packages/internal/capture-settle/dist/settle.js +88 -13
- package/dist/packages/internal/code-fingerprint/dist/index.js +57 -0
- package/dist/packages/internal/content-doc-ops/dist/index.js +176 -0
- package/dist/packages/internal/content-doc-ops/dist/made-rows.js +15 -0
- package/dist/packages/internal/deliverable-reads/dist/bootstrap.js +81 -0
- package/dist/packages/internal/deliverable-reads/dist/display.js +21 -0
- package/dist/packages/internal/deliverable-reads/dist/format.js +15 -0
- package/dist/packages/internal/deliverable-reads/dist/index.js +7 -0
- package/dist/packages/internal/deliverable-reads/dist/pages.js +29 -0
- package/dist/packages/internal/deliverable-reads/dist/requirements.js +72 -0
- package/dist/{cli/capture → packages/internal/download-files/dist}/bundle.js +8 -4
- package/dist/packages/internal/download-files/dist/capture-origin.js +126 -0
- package/dist/packages/internal/download-files/dist/capture-routes.js +139 -0
- package/dist/packages/internal/download-files/dist/capture-shell.js +38 -0
- package/dist/packages/internal/download-files/dist/capture.js +74 -0
- package/dist/packages/internal/download-files/dist/egress-watch.js +38 -0
- package/dist/packages/internal/download-files/dist/files.js +7 -0
- package/dist/packages/internal/download-files/dist/finish.js +35 -0
- package/dist/packages/internal/download-files/dist/fleet.js +94 -0
- package/dist/packages/internal/download-files/dist/format.js +40 -0
- package/dist/packages/internal/download-files/dist/make.js +105 -0
- package/dist/packages/internal/download-files/dist/master-tally.js +32 -0
- package/dist/packages/internal/download-files/dist/names.js +24 -0
- package/dist/packages/internal/download-files/dist/pdf-boxes.js +33 -0
- package/dist/packages/internal/download-files/dist/pdf-image-placements.js +194 -0
- package/dist/packages/internal/download-files/dist/pdf-images.js +289 -0
- package/dist/packages/internal/file-store/dist/files.js +8 -0
- package/dist/packages/internal/file-store/dist/lru.js +40 -0
- package/dist/packages/internal/file-store/dist/refusal.js +12 -0
- package/dist/packages/internal/file-store/dist/trees.js +151 -0
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +1 -1
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +48 -22
- package/dist/packages/internal/fill-bake/dist/held-rows.js +2 -0
- package/dist/packages/internal/fill-bake/dist/index.js +6 -1
- package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -3
- package/dist/packages/internal/fill-bake/dist/resolve-instance.js +9 -0
- package/dist/packages/internal/fill-bake/dist/resolve.js +3 -0
- package/dist/packages/internal/fill-bake/dist/round-trip.js +2 -0
- package/dist/packages/internal/fill-bake/dist/strip.js +6 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +1 -1
- 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/island-runtime/dist/index.js +1 -10
- package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +5 -0
- package/dist/packages/internal/lead-fields/dist/ingest.js +72 -0
- package/dist/packages/internal/media-resolution/dist/video.js +6 -2
- package/dist/packages/internal/page-render/dist/addresses.js +57 -0
- package/dist/packages/internal/page-render/dist/index.js +6 -0
- package/dist/packages/internal/page-render/dist/kept.js +30 -0
- package/dist/packages/internal/page-render/dist/nav.js +42 -0
- package/dist/packages/internal/page-render/dist/render.js +152 -0
- package/dist/packages/internal/page-shell/dist/assemble.js +161 -0
- package/dist/packages/internal/page-shell/dist/escape.js +10 -0
- package/dist/packages/internal/page-shell/dist/frame.js +23 -0
- package/dist/packages/internal/page-shell/dist/index.js +26 -0
- package/dist/packages/internal/playground/dist/build-fingerprint.js +18 -0
- package/dist/packages/internal/playground/dist/fixture-conversions/list-names-properties.js +76 -0
- package/dist/packages/internal/playground/dist/fixture-formats.d.ts +37 -0
- package/dist/packages/internal/playground/dist/fixture-formats.js +20 -0
- package/dist/packages/internal/playground/dist/host/bootstrap.js +108 -0
- package/dist/packages/internal/playground/dist/host/built.js +202 -0
- package/dist/packages/internal/playground/dist/host/catalog-fixture.js +53 -0
- package/dist/packages/internal/playground/dist/host/download.js +34 -0
- package/dist/packages/internal/playground/dist/host/env.js +11 -0
- package/dist/packages/internal/playground/dist/host/everywhere-saves.js +353 -0
- package/dist/packages/internal/playground/dist/host/fixture-addresses.js +52 -0
- package/dist/packages/internal/playground/dist/host/fixture-documents.js +494 -0
- package/dist/packages/internal/playground/dist/host/fixture-operations.js +364 -0
- package/dist/packages/internal/playground/dist/host/fixture-units.js +93 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/image-dimensions.js +1 -1
- package/dist/packages/internal/playground/dist/host/leads.js +41 -0
- package/dist/packages/internal/playground/dist/host/media-saves.js +309 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/media-store.js +79 -26
- package/dist/packages/internal/playground/dist/host/overridable.js +9 -0
- package/dist/packages/internal/playground/dist/host/owned-saves.js +203 -0
- package/dist/{playground → packages/internal/playground/dist}/host/page-state.js +1 -1
- package/dist/packages/internal/playground/dist/host/program.js +54 -0
- package/dist/packages/internal/playground/dist/host/property-derive.js +216 -0
- package/dist/packages/internal/playground/dist/host/property-saves.js +74 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/property.js +88 -229
- package/dist/packages/internal/playground/dist/host/provenance.js +49 -0
- package/dist/packages/internal/playground/dist/host/resolve.js +553 -0
- package/dist/packages/internal/playground/dist/host/row-images.js +41 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/rows.js +1 -1
- package/dist/packages/internal/playground/dist/host/save.js +429 -0
- package/dist/packages/internal/playground/dist/host/serve.js +952 -0
- package/dist/packages/internal/playground/dist/host/site.js +79 -0
- package/dist/packages/internal/playground/dist/host/slots.js +202 -0
- package/dist/packages/internal/playground/dist/host/stated-content.js +93 -0
- package/dist/packages/internal/playground/dist/host/stored-fixtures.js +135 -0
- package/dist/packages/internal/playground/dist/host/violations.js +7 -0
- package/dist/packages/internal/playground/dist/jobs/lanes.js +24 -0
- package/dist/packages/internal/playground/dist/jobs/memory-queue.js +112 -0
- package/dist/packages/internal/playground/dist/jobs/probe.js +37 -0
- package/dist/packages/internal/playground/dist/jobs/queue.js +28 -0
- package/dist/packages/internal/playground/dist/jobs/runner.js +207 -0
- package/dist/packages/internal/playground/dist/layout.js +14 -0
- package/dist/packages/internal/playground/dist/platform.js +33 -0
- package/dist/packages/internal/playground/dist/server/changes.js +57 -0
- package/dist/packages/internal/playground/dist/server/crop.js +47 -0
- package/dist/packages/internal/playground/dist/server/derived-files.js +88 -0
- package/dist/packages/internal/playground/dist/server/download.js +158 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/http.js +4 -12
- package/dist/packages/internal/playground/dist/server/jobs.js +29 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/listen.js +4 -11
- package/dist/packages/internal/playground/dist/server/playground-server.js +424 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/request-error.js +1 -1
- package/dist/packages/internal/playground/dist/server/size-ladders.js +170 -0
- package/dist/packages/internal/playground/dist/server/verification.js +75 -0
- package/dist/packages/internal/playground/dist/server/verify-build.js +139 -0
- package/dist/packages/internal/playground/dist/wire.js +78 -0
- package/dist/packages/internal/property-facts/dist/registry-facts.js +1 -1
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -1
- package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +1 -1
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -1
- package/dist/packages/internal/site-files/dist/head.js +59 -0
- package/dist/packages/internal/site-files/dist/index.js +4 -0
- package/dist/packages/internal/site-files/dist/site.js +211 -0
- package/dist/packages/internal/static-assets-binding/dist/index.js +32 -0
- package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +38 -5
- package/dist/packages/internal/template-artifact/dist/asset-mime.js +8 -1
- package/dist/packages/internal/template-artifact/dist/build.js +148 -0
- package/dist/packages/internal/template-artifact/dist/composition.js +62 -0
- package/dist/packages/internal/template-artifact/dist/index.js +2 -2
- package/dist/packages/internal/template-artifact/dist/layout.js +48 -12
- package/dist/packages/internal/template-artifact/dist/manifest.js +3 -10
- package/dist/packages/internal/template-artifact/dist/verify.js +51 -31
- package/dist/packages/internal/template-contracts/dist/address-value.js +6 -1
- package/dist/packages/internal/template-contracts/dist/content-categories.js +10 -1
- package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/fact-registry.js +59 -32
- package/dist/packages/internal/template-contracts/dist/fill-spec.js +14 -1
- package/dist/packages/internal/template-contracts/dist/list.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/media-candidates.js +67 -2
- package/dist/packages/internal/template-contracts/dist/media-offer.js +180 -0
- package/dist/packages/internal/template-contracts/dist/object.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +9 -2
- package/dist/packages/internal/template-contracts/dist/read-graph.js +36 -2
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +16 -1
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +9 -10
- package/dist/packages/internal/template-contracts/dist/registry-facts.js +12 -1
- package/dist/packages/internal/template-contracts/dist/registry-graph.js +112 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.js +15 -2
- package/dist/packages/internal/template-contracts/dist/require-graph.js +300 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/row.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +1 -1
- package/dist/{schema → packages/internal/template-contracts/dist}/section-nav.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +4 -4
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +3 -1
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +24 -1
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +26 -1
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/table-members.js +7 -2
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
- package/dist/packages/internal/upload-formats/dist/heic.js +35 -0
- package/dist/packages/internal/upload-formats/dist/index.js +80 -0
- package/dist/packages/internal/upload-formats/dist/magic-bytes.js +293 -0
- package/dist/platform/paths.js +1 -0
- package/dist/platform/process.js +49 -1
- package/dist/primitives/FrameShell.d.ts +5 -2
- package/dist/primitives/FrameShell.js +2 -1
- package/dist/rules/registry.js +28 -4
- package/dist/schema/fact.d.ts +2 -2
- package/dist/schema/facts-view.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-props.d.ts +1 -1
- package/dist/schema/section-schema.d.ts +1 -1
- package/dist/schema/section-schema.js +1 -0
- package/dist/section/declare.d.ts +1 -1
- package/dist/section/discovery.js +6 -2
- package/dist/section/publish-shape.js +38 -0
- package/dist/section/section.d.ts +1 -1
- package/dist/site-analytics.js +6 -1
- package/dist/site-runtime/window-height.js +19 -0
- package/dist/template/define-template.d.ts +25 -4
- package/dist/template/define-template.js +3 -0
- package/dist/template/logic-shim.d.ts +1 -1
- package/dist/template/materialize.js +3 -1
- package/dist/template/running-copy.js +0 -1
- package/dist/template/section-reads.js +1 -1
- package/guide/reference/cli/INDEX.md +6 -5
- package/guide/reference/cli/build.md +10 -8
- package/guide/reference/cli/check.md +4 -2
- package/guide/reference/cli/dev.md +6 -2
- package/guide/reference/cli/install.md +41 -0
- package/guide/reference/cli/property-add.md +5 -4
- package/guide/reference/cli/property-list.md +2 -2
- package/guide/reference/cli/publish.md +5 -5
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +9 -5
- package/package.json +14 -30
- package/dist/artifact/playground/client/assets/index-ByeGGedv.js +0 -1259
- package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +0 -1
- package/dist/cli/build/artifact.js +0 -220
- package/dist/cli/build/captures.js +0 -48
- package/dist/cli/build/fixtures.js +0 -92
- package/dist/cli/capture/capture-browser.js +0 -37
- package/dist/cli/capture/capture.js +0 -113
- package/dist/cli/check/render/inputs.js +0 -60
- package/dist/cli/check/render/nav.js +0 -31
- package/dist/cli/dev/crop.js +0 -20
- package/dist/cli/dev/fixture-ladders.js +0 -96
- package/dist/cli/dev/hmr.js +0 -26
- package/dist/cli/dev/islands.js +0 -234
- package/dist/cli/dev/load-template.js +0 -52
- package/dist/cli/dev/vite.js +0 -114
- package/dist/cli/dev/workspace-reader.js +0 -248
- package/dist/cli/publish/freshness.js +0 -64
- package/dist/fixtures/brand.d.ts +0 -4
- package/dist/fixtures/brand.js +0 -8
- package/dist/fixtures/load.js +0 -159
- package/dist/fixtures/resolve.js +0 -392
- package/dist/fixtures.d.ts +0 -429
- package/dist/fixtures.js +0 -23
- package/dist/packages/internal/canvas-core/dist/island-host.js +0 -62
- package/dist/packages/internal/canvas-core/dist/island-shields.js +0 -30
- package/dist/playground/canvas-island-host.d.ts +0 -11
- package/dist/playground/canvas-island-host.js +0 -29
- package/dist/playground/canvas-markers.js +0 -14
- package/dist/playground/host/paths.js +0 -8
- package/dist/playground/layout.js +0 -17
- package/dist/playground/wire.js +0 -28
|
@@ -24,6 +24,23 @@ function listKeyOf(key) {
|
|
|
24
24
|
key: key.slice(dot + 1)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
function pickedRowOf(element) {
|
|
28
|
+
return element.type === "row" ? element : null;
|
|
29
|
+
}
|
|
30
|
+
function pickedMediaField(element) {
|
|
31
|
+
if (element.type !== "object") return null;
|
|
32
|
+
for (const [key, field] of Object.entries(element.fields)) {
|
|
33
|
+
const source = field.source;
|
|
34
|
+
if (isMediaKind(field.type) && typeof source === "object" && source !== null && source.kind === "element") return key;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function rowFromKeys(row) {
|
|
39
|
+
return (Array.isArray(row.from) ? row.from : [row.from]).filter((key) => typeof key === "string");
|
|
40
|
+
}
|
|
41
|
+
function isPaged(fact) {
|
|
42
|
+
return fact.head !== null;
|
|
43
|
+
}
|
|
27
44
|
function page(head, declaration) {
|
|
28
45
|
if ("label" in head) throw new Error("fact registry: a page head holds no `label` — the declaration states the fact's name");
|
|
29
46
|
for (const key of ["title", "description"]) {
|
|
@@ -334,7 +351,7 @@ const propertyMedia = list({
|
|
|
334
351
|
],
|
|
335
352
|
from: uploads
|
|
336
353
|
}),
|
|
337
|
-
source: fill.pick({ brief: "
|
|
354
|
+
source: fill.pick({ brief: "What shows the property: its photographs, renderings, videos and virtual tours, of the building, its rooms, grounds, amenities, surroundings and views, which a page's gallery and sections draw for a visitor walking through the property. An upload belongs when its name or account says it is one of those. It does not belong when its name or account says it is something else: a floor plan or other diagram, a logo or brand graphic, a photograph of a person or people, a flyer, slide or other image that is mostly text, a screenshot, a map or a document page. When neither its name nor its account says what it is, you cannot tell. The list runs as a walk through the property: aerial and street views, then the approach and entry, then the interiors room by room (living spaces, kitchen and dining, bedrooms, bathrooms), then outdoor spaces, amenities, surroundings and views, every shot of one space together; a video or tour sits with the space it shows, and one of the whole property comes first." })
|
|
338
355
|
});
|
|
339
356
|
const floor_plans = list({
|
|
340
357
|
label: "Floor plans",
|
|
@@ -343,7 +360,7 @@ const floor_plans = list({
|
|
|
343
360
|
from: uploads,
|
|
344
361
|
process: [process.cutout({ enclosed: "keep" })]
|
|
345
362
|
}),
|
|
346
|
-
source: fill.pick({ brief: "
|
|
363
|
+
source: fill.pick({ brief: "The property's floor plans: each upload that is exactly one floor plan, a top-down view of one floor of a dwelling's rooms and walls, drawn or rendered, flat or in 3D, at any size, whatever title, figures or text are printed around it, which a page's plans draw and each unit's own plans are picked from. An upload belongs when its name or account says it shows one floor plan. It does not belong when its name or account says it holds two or more plans, or is something else: a building key or site diagram, a legend, scale bar or north arrow on its own, a logo, a photograph or plain text. When neither its name nor its account says what it is, or how many plans it holds, you cannot tell. The list runs from the lowest floor to the highest, the plans of several units in the order the units are numbered, each unit's floors together." })
|
|
347
364
|
});
|
|
348
365
|
const propertyDocuments = list({
|
|
349
366
|
label: "Documents",
|
|
@@ -355,28 +372,39 @@ const propertyDocuments = list({
|
|
|
355
372
|
],
|
|
356
373
|
from: uploads
|
|
357
374
|
}),
|
|
358
|
-
source: fill.pick({ brief: "
|
|
375
|
+
source: fill.pick({ brief: "The property's documents: what sets out its specifics, the figures, finances, terms, legal record, condition or plans a buyer, tenant or investor studies, which a page offers as downloads and a reader wanting only them reads in place of every upload. An upload belongs when its name or account says it records those: an offering memorandum, brochure, listing sheet, rent roll, financials, comparables, lease, survey, site plan, plan set, disclosure or report. It does not belong when its name or account says it is a photograph, rendering, video or tour showing the property, an image of floor plans or elevations, a logo, a photograph of people, an ad, sign or announcement, a map, or notes for whoever makes the marketing. When neither its name nor its account says what it is, you cannot tell. The list runs as a buyer reads it: the offering memorandum, brochure or listing sheet, then the financials, rent roll and comparables, then the leases, legal record and disclosures, then the reports, surveys and plans." })
|
|
359
376
|
});
|
|
360
377
|
const hero = image({
|
|
361
378
|
label: "Hero",
|
|
362
379
|
from: propertyMedia,
|
|
363
|
-
source: fill.pick({ brief: "
|
|
380
|
+
source: fill.pick({ brief: "The property's cover image: the one image the page's banner draws above the address, standing for the whole property at a glance for a visitor arriving at the page. It is an image of the property, by its name or account, a photograph or a rendering alike, ranked by what it shows and never by how it was made: the front exterior of the building first, then another exterior or aerial view, then the widest, brightest view of the main living space. A close-up, a bathroom, a utility space, an empty room or anything that reads as a fragment rather than a place is a weaker cover, never ruled out, so where those are the only images of the property the best of them is the cover. A logo or brand graphic, a headshot, an image that is mostly text, a screenshot, a map, a document page, a floor plan or other diagram is not an image of the property, nor is an image whose name and account do not say what it is; with no image of the property there is no cover." })
|
|
364
381
|
});
|
|
365
382
|
const site_url = url({ label: "Website" });
|
|
366
|
-
const
|
|
367
|
-
|
|
383
|
+
const LABEL_FORMS = {
|
|
384
|
+
unit: "\"Unit 3\", \"#3\", \"Apt 3\" and \"Residence 3\" all label \"Unit 3\"",
|
|
385
|
+
space: "\"Suite 200\", \"Ste 200\" and \"#200\" all label \"Suite 200\""
|
|
386
|
+
};
|
|
387
|
+
function labeledPlansBrief(row) {
|
|
388
|
+
return `This ${row}'s floor plans: every one of the property's floor plans labeled for it, whatever the plan draws (a floor of the ${row}, its roof deck, its storage), listed beside the ${row}'s specs. A plan's label is read from its name and the text printed on it, never from the rooms drawn or any figures. A plan belongs when its label names this ${row}: the ${row}'s own label or a plain variant of it (${LABEL_FORMS[row]}), a descriptor the ${row}'s label carries in brackets left off; a plan labeled for several ${row}s, as a shared floor printed with each ${row}'s number, belongs to each of them. A plan labeled for other ${row}s and not this one does not belong. When a plan labels no ${row}, you cannot tell. The list runs from the lowest floor to the highest.
|
|
389
|
+
|
|
390
|
+
floor: the level of the ${row} the plan draws, or the part of it where the plan draws no whole level, in the form "Basement", "2nd floor" or "Roof deck". It is read as the plan's label is, from the plan's name and a title among the words printed on it, never from what its account says the drawing shows or from the words that mark its rooms, and a ${row} number is not a floor. A plan whose name and printed title state neither has none.`;
|
|
391
|
+
}
|
|
392
|
+
function labeledPhotosBrief(row) {
|
|
393
|
+
return `This ${row}'s photos: every one of the property's photos labeled for it, whatever the photo shows, listed beside the ${row}'s specs. A photo's label is read from its name, the text printed on it and a caption its account records, never from what it shows, any figures, how much it looks like the ${row} or where it falls among the uploads. A photo belongs when its label names this ${row}: the ${row}'s own label or a plain variant of it (${LABEL_FORMS[row]}), a descriptor the ${row}'s label carries in brackets left off; a photo labeled for several ${row}s belongs to each of them. A photo labeled for other ${row}s and not this one does not belong. When a photo labels no ${row}, you cannot tell.`;
|
|
394
|
+
}
|
|
395
|
+
const UNIT_PLANS_BRIEF = labeledPlansBrief("unit");
|
|
396
|
+
const UNIT_PHOTOS_BRIEF = labeledPhotosBrief("unit");
|
|
368
397
|
const UNITS_BRIEF = [
|
|
369
|
-
"
|
|
370
|
-
"
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
376
|
-
"
|
|
377
|
-
"
|
|
378
|
-
"
|
|
379
|
-
"When the uploads present no dwelling with its own specs printed, return no items."
|
|
398
|
+
"The property's units: a row for each dwelling the uploads present with specs of its own, the home a listing describes or each unit a building's documents name or number, read by a buyer or tenant comparing the residences and by the user checking each row against their documents. The property is what the uploads market, whatever address they print for it. A row holds what the uploads print for that dwelling: the words printed on a sheet, a page or a floor plan, as its account quotes them, never what an account says a drawing, a photo or a map shows, the rooms, doors and spaces; each figure as printed, not worked out from other figures, rounded or carried over from another dwelling, a unit mix or the building; and a member no upload prints for that dwelling is empty. A dwelling the uploads only name, picture or mark with a status, with no specs printed for it, has no row. A plan or a row printed for several dwellings, in the form \"Unit 4/6\", gives each of those dwellings a row of its own carrying what is printed for it, and no row stands for two; a dwelling named in several uploads or on several pages is one row carrying everything they print for it. A commercial space is not a dwelling, nor is a unit-mix row standing for unnamed units, a whole building, a comparable property, a market average or a portfolio total.",
|
|
399
|
+
"label: the dwelling's own name as printed, its unit number or name, in the form \"201\", \"Residence 201\" or \"4B\", one dwelling's alone, without a status word and never its street address; a dwelling presented alone, with no unit name, is \"Home\".",
|
|
400
|
+
"beds, baths, sqft: as printed for that dwelling; a studio is one bedroom.",
|
|
401
|
+
"price: the asking price or monthly rent as written for that dwelling, or, where none is printed, its status word, in the form \"Sold\" or \"Leased\".",
|
|
402
|
+
"floor: the floor of its building the dwelling sits on, as printed; a unit number is not a floor.",
|
|
403
|
+
"hoa_monthly: the HOA, condo or strata fee printed per month for that dwelling; a fee for another period, or for the building, is not its own.",
|
|
404
|
+
"parking: the number of parking spaces printed for that dwelling, a garage counted by its cars; parking printed with no count, or for the building, is not its own.",
|
|
405
|
+
"lot_sqft: the lot printed in square feet for that dwelling, a home's own; a lot the building's dwellings share is not its own.",
|
|
406
|
+
"amenities: what sets this dwelling apart from the other dwellings in its building, each in the few words an upload states it; a feature printed for two of them, or for the building, is the building's, and a standard finish, a note printed on a plan or what the other members already say sets nothing apart. Most dwellings have none.",
|
|
407
|
+
"When no dwelling has specs of its own printed, the table is empty."
|
|
380
408
|
].join("\n\n");
|
|
381
409
|
const unitLabel = text.short({ label: "Unit" });
|
|
382
410
|
const unitBeds = number({ label: "Beds" });
|
|
@@ -465,19 +493,18 @@ const units = page({
|
|
|
465
493
|
}
|
|
466
494
|
})
|
|
467
495
|
}));
|
|
468
|
-
const SPACE_PLANS_BRIEF = "
|
|
469
|
-
const SPACE_PHOTOS_BRIEF = "
|
|
496
|
+
const SPACE_PLANS_BRIEF = labeledPlansBrief("space");
|
|
497
|
+
const SPACE_PHOTOS_BRIEF = labeledPhotosBrief("space");
|
|
470
498
|
const COMMERCIAL_SPACES_BRIEF = [
|
|
471
|
-
"
|
|
472
|
-
"
|
|
473
|
-
"
|
|
474
|
-
"
|
|
475
|
-
"
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"
|
|
479
|
-
"
|
|
480
|
-
"When the uploads present no commercial space with its own specs printed, return no items."
|
|
499
|
+
"The property's commercial spaces: a row for each shop, office suite, restaurant or other non-residential space the uploads present with specs of its own, named or numbered in a building's documents, read by a tenant or investor comparing the spaces and by the user checking each row against their documents. The property is what the uploads market, whatever address they print for it. A row holds what the uploads print for that space: the words printed on a sheet, a page or a floor plan, as its account quotes them, never what an account says a drawing, a photo or a map shows; each figure as printed, not worked out from other figures, rounded or carried over from another space or the building; and a member no upload prints for that space is empty. A space the uploads only name, picture or mark with a status, with no specs printed for it, has no row, and a space named in several uploads or on several pages is one row carrying everything they print for it. A dwelling is not a commercial space, nor is a whole building, a comparable property, a market average or a portfolio total.",
|
|
500
|
+
"label: the space's own name as printed, in the form \"Suite 200\" or \"Retail A\", without a status word and never its street address.",
|
|
501
|
+
"use: what the space is for, as printed.",
|
|
502
|
+
"sqft: as printed for that space.",
|
|
503
|
+
"price: the rent or price as written for that space, or, where none is printed, its status word, in the form \"Leased\" or \"Call for pricing\".",
|
|
504
|
+
"floor: the floor of its building the space sits on, as printed; a suite number is not a floor.",
|
|
505
|
+
"parking: the number of parking spaces printed for that space; parking printed with no count, or for the building, is not its own.",
|
|
506
|
+
"amenities: what sets this space apart from the other spaces in its building, each in the few words an upload states it; a feature printed for two of them, or for the building, is the building's, and a standard fitting, a note printed on a plan or what the other members already say sets nothing apart. Most spaces have none.",
|
|
507
|
+
"When no commercial space has specs of its own printed, the table is empty."
|
|
481
508
|
].join("\n\n");
|
|
482
509
|
const spaceLabel = text.short({ label: "Space" });
|
|
483
510
|
const commercial_spaces = page({
|
|
@@ -507,7 +534,7 @@ const commercial_spaces = page({
|
|
|
507
534
|
}
|
|
508
535
|
})
|
|
509
536
|
}));
|
|
510
|
-
const COMPARABLES_BRIEF = "The
|
|
537
|
+
const COMPARABLES_BRIEF = "The property's comparables: the other properties an upload sets beside the one it markets, so that property's price and specs can be weighed against theirs, read by a buyer or seller judging the price and by the user checking each row against their documents. They appear as the 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 in its own comparables table or at the center of a comparables map, and an upload presenting it or one of its units for itself, such as a 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 that is not one property is not a comparable. A row holds what the uploads print for that property, read through every upload whole, a table included where it continues onto the next page: each figure as printed and a listing's remarks word for word, never worked out from other figures or carried over from a neighboring row, a summary or the property itself; a studio is one bedroom; a property listed in several places is one row carrying every figure those places state; a figure no upload prints for it is empty. When no upload sets another property beside the one it markets, the list is empty.";
|
|
511
538
|
const comparablePlace = address({ label: "Address" });
|
|
512
539
|
const comparableSaleDate = date({ label: "Sale date" });
|
|
513
540
|
const comparables = page({
|
|
@@ -574,7 +601,7 @@ const contacts = page({
|
|
|
574
601
|
max: 12,
|
|
575
602
|
source: fill.pick({
|
|
576
603
|
reads: [uploads],
|
|
577
|
-
brief: "
|
|
604
|
+
brief: "The listing's contacts: the people a buyer or tenant reaches about this property, chosen from the library's contacts, in the order the listing presents them, the first or most prominent first. A contact belongs when an upload's name or account says it prints their email or phone, or their full name, as a contact for this listing, an agent, broker, or sales or leasing contact, judged by their name, title, organization, email and phone against what the uploads print. A contact the uploads leave out, where their accounts name the listing's contacts, does not belong, and a shared organization, a matching first name or a name printed in another role, an architect, a photographer or a seller, names no contact. When no upload's account names any contact, there are none."
|
|
578
605
|
}),
|
|
579
606
|
item: row({
|
|
580
607
|
label: "Contact",
|
|
@@ -602,4 +629,4 @@ const propertyFacts = defineFacts("property", {
|
|
|
602
629
|
linkRegistry(propertyFacts);
|
|
603
630
|
|
|
604
631
|
//#endregion
|
|
605
|
-
export { COMPARABLE_PRICE_PERIOD_VALUES, COMPARABLE_STATUS_VALUES, FACT_HOMES, LISTING_INTENT_VALUES, comparableDistanceMeters, comparablePricePeriod, comparableStatusOf, defineFacts, haversineMeters, libraryFacts, listKeyOf, page, propertyFacts, refuseHolderKeys };
|
|
632
|
+
export { COMPARABLE_PRICE_PERIOD_VALUES, COMPARABLE_STATUS_VALUES, FACT_HOMES, LISTING_INTENT_VALUES, comparableDistanceMeters, comparablePricePeriod, comparableStatusOf, defineFacts, haversineMeters, isPaged, libraryFacts, listKeyOf, page, pickedMediaField, pickedRowOf, propertyFacts, refuseHolderKeys, rowFromKeys };
|
|
@@ -287,6 +287,19 @@ function fillSpecFromSchema(schema) {
|
|
|
287
287
|
decisions
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
+
function fillSpecFromRegistry(registry) {
|
|
291
|
+
const reads = newCollector();
|
|
292
|
+
const pages = registry.pages;
|
|
293
|
+
const decisions = treeDecisions({
|
|
294
|
+
slots: Object.fromEntries(Object.entries(pages).map(([key, page]) => [`${registry.home}.${key}`, page.declaration])),
|
|
295
|
+
userAnswers: true
|
|
296
|
+
}, reads);
|
|
297
|
+
return {
|
|
298
|
+
reads: [...reads.facts].sort(),
|
|
299
|
+
slot_reads: [],
|
|
300
|
+
decisions
|
|
301
|
+
};
|
|
302
|
+
}
|
|
290
303
|
|
|
291
304
|
//#endregion
|
|
292
|
-
export { fillSpecFromSchema };
|
|
305
|
+
export { fillSpecFromRegistry, fillSpecFromSchema };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ImageValue } from "./runtime-values.js";
|
|
2
|
-
import { RegistryTableKey } from "./registry-shape.js";
|
|
3
|
-
import { ComputeBinding } from "./compute.js";
|
|
4
|
-
import { ElementOf, ElementTableOf } from "./row-ref.js";
|
|
5
2
|
import { ListItemSlot } from "./slot-types.js";
|
|
6
3
|
import { ComputeRead, RowRef, SiblingSlot, SiblingSource, SlotRef } from "./slot-ref.js";
|
|
7
4
|
import { FindFill, PickFill, WriteFill } from "./fill-builders.js";
|
|
8
5
|
import { FillMark } from "./fill-declaration.js";
|
|
6
|
+
import { ComputeBinding } from "./compute.js";
|
|
9
7
|
import { MediaSlotDef } from "./slot-builders.js";
|
|
8
|
+
import { RegistryTableKey } from "./registry-shape.js";
|
|
10
9
|
import { RowSlotDef, TableSource } from "./row.js";
|
|
10
|
+
import { ElementOf, ElementTableOf } from "./row-ref.js";
|
|
11
11
|
//#region ../../internal/template-contracts/dist/list.d.ts
|
|
12
12
|
interface FillNode {
|
|
13
13
|
readonly brief: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { declaredKinds, mediaDeclarationProblem } from "./slot-catalog.js";
|
|
2
|
-
import "./registry-facts.js";
|
|
2
|
+
import { framedValueAt, isMediaReference, mediaIdOf, mergeMedia, owningValues } from "./registry-facts.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../internal/template-contracts/dist/media-candidates.js
|
|
5
|
+
const UPLOADS_LIST = "property.uploads";
|
|
5
6
|
function fromListsOf(from) {
|
|
6
7
|
if (typeof from === "string" && from !== "") return [from];
|
|
7
8
|
if (!Array.isArray(from) || from.length === 0 || !from.every((key) => typeof key === "string" && key !== "")) return void 0;
|
|
@@ -16,6 +17,63 @@ function mediaFilterOf(declaration) {
|
|
|
16
17
|
from
|
|
17
18
|
};
|
|
18
19
|
}
|
|
20
|
+
function isRecord(value) {
|
|
21
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
function itemValueOf(item) {
|
|
24
|
+
if (mediaIdOf(item) !== void 0 || !isRecord(item)) return item;
|
|
25
|
+
for (const member of Object.values(item)) if (mediaIdOf(member) !== void 0) return member;
|
|
26
|
+
}
|
|
27
|
+
function mediaListValues(facts, key) {
|
|
28
|
+
const [home, ...path] = key.split(".");
|
|
29
|
+
if (home !== "property" || path.length === 0) return null;
|
|
30
|
+
let at = facts;
|
|
31
|
+
for (const step of path) {
|
|
32
|
+
at = Array.isArray(at) ? at.find((item) => isRecord(item) && item["id"] === step) : isRecord(at) && Object.hasOwn(at, step) ? at[step] : void 0;
|
|
33
|
+
if (at === void 0) return null;
|
|
34
|
+
}
|
|
35
|
+
if (!Array.isArray(at)) return null;
|
|
36
|
+
return at.flatMap((item) => {
|
|
37
|
+
const value = itemValueOf(item);
|
|
38
|
+
const id = mediaIdOf(value);
|
|
39
|
+
return id === void 0 ? [] : [{
|
|
40
|
+
id,
|
|
41
|
+
value
|
|
42
|
+
}];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function mediaListItems(facts, key) {
|
|
46
|
+
return mediaListValues(facts, key)?.map(({ id }) => id) ?? null;
|
|
47
|
+
}
|
|
48
|
+
function attributedCandidates(facts, filter) {
|
|
49
|
+
const owning = owningValues(facts);
|
|
50
|
+
const seen = /* @__PURE__ */ new Set();
|
|
51
|
+
const out = [];
|
|
52
|
+
for (const list of fromListsOf(filter.from) ?? []) for (const { id, value: item } of mediaListValues(facts, list) ?? []) {
|
|
53
|
+
if (seen.has(id)) continue;
|
|
54
|
+
const owner = owning.get(id);
|
|
55
|
+
const file = owner === void 0 || !Object.hasOwn(facts.files, owner.file) ? void 0 : facts.files[owner.file];
|
|
56
|
+
if (owner === void 0 || file === void 0 || !filter.kinds.includes(file.kind)) continue;
|
|
57
|
+
seen.add(id);
|
|
58
|
+
const value = isMediaReference(item) ? framedValueAt(owner, item) : owner;
|
|
59
|
+
out.push({
|
|
60
|
+
id,
|
|
61
|
+
value,
|
|
62
|
+
file,
|
|
63
|
+
list
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
function attributedMedia(facts, filter) {
|
|
69
|
+
return attributedCandidates(facts, filter).map(({ value, file, list }) => ({
|
|
70
|
+
record: mergeMedia(file, value),
|
|
71
|
+
list
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
function candidateSet(facts, filter) {
|
|
75
|
+
return attributedMedia(facts, filter).map(({ record }) => record);
|
|
76
|
+
}
|
|
19
77
|
function readMediaOf(of) {
|
|
20
78
|
if (of === null || typeof of !== "object") return null;
|
|
21
79
|
const record = of;
|
|
@@ -33,6 +91,13 @@ function mediaOf(filter) {
|
|
|
33
91
|
...filter.from === void 0 ? {} : { from: [...filter.from] }
|
|
34
92
|
};
|
|
35
93
|
}
|
|
94
|
+
function withSubsetOrder(ids, reordered) {
|
|
95
|
+
const listed = new Set(ids);
|
|
96
|
+
const moved = reordered.filter((id) => listed.has(id));
|
|
97
|
+
const members = new Set(moved);
|
|
98
|
+
let next = 0;
|
|
99
|
+
return ids.map((id) => members.has(id) ? moved[next++] : id);
|
|
100
|
+
}
|
|
36
101
|
|
|
37
102
|
//#endregion
|
|
38
|
-
export { fromListsOf, mediaFilterOf, mediaOf, readMediaOf };
|
|
103
|
+
export { UPLOADS_LIST, attributedCandidates, attributedMedia, candidateSet, fromListsOf, mediaFilterOf, mediaListItems, mediaListValues, mediaOf, readMediaOf, withSubsetOrder };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { declaredKinds } from "./slot-catalog.js";
|
|
2
|
+
import { mediaFilterOf, readMediaOf } from "./media-candidates.js";
|
|
3
|
+
import { memberMediaFilter, memberValueType, tableHome } from "./registry-shape.js";
|
|
4
|
+
import { listTableOf, memberAddressOf, rowTableOf } from "./ref-locate.js";
|
|
5
|
+
import { rowFieldMember, tableField } from "./table-members.js";
|
|
6
|
+
import { memberSourceOf } from "./row-sources.js";
|
|
7
|
+
import { decisionFills } from "./decision-fills.js";
|
|
8
|
+
import { isAnnotatedMediaItem } from "./list-editing.js";
|
|
9
|
+
|
|
10
|
+
//#region ../../internal/template-contracts/dist/media-offer.js
|
|
11
|
+
function boundMember(slot, table) {
|
|
12
|
+
if (table == null) return null;
|
|
13
|
+
const member = rowFieldMember(table, slot);
|
|
14
|
+
if (member === null) return null;
|
|
15
|
+
const declaration = tableField(table, member);
|
|
16
|
+
const valueType = declaration === void 0 ? null : memberValueType(declaration);
|
|
17
|
+
if (declaration === void 0 || valueType == null) return null;
|
|
18
|
+
const filter = memberMediaFilter(declaration);
|
|
19
|
+
return {
|
|
20
|
+
table,
|
|
21
|
+
member,
|
|
22
|
+
value_type: valueType,
|
|
23
|
+
...filter !== void 0 ? { filter } : {}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const OWNED = { kind: "owned" };
|
|
27
|
+
function picked(filter) {
|
|
28
|
+
return filter === null ? OWNED : {
|
|
29
|
+
kind: "picked",
|
|
30
|
+
filter
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function declaredOffer(slot, table) {
|
|
34
|
+
if (slot.from !== void 0) return picked(mediaFilterOf(slot));
|
|
35
|
+
const member = boundMember(slot, table);
|
|
36
|
+
if (member === null) return null;
|
|
37
|
+
return member.filter === void 0 ? OWNED : picked(mediaFilterOf({
|
|
38
|
+
type: slot.type,
|
|
39
|
+
from: member.filter.from
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
function mediaOffer(slot, table) {
|
|
43
|
+
return declaredOffer(slot, table) ?? OWNED;
|
|
44
|
+
}
|
|
45
|
+
function itemOffer(list, itemSlot, table) {
|
|
46
|
+
return declaredOffer(itemSlot, table) ?? declaredOffer({
|
|
47
|
+
...itemSlot,
|
|
48
|
+
source: list.source
|
|
49
|
+
}, table);
|
|
50
|
+
}
|
|
51
|
+
function annotatedFieldOffer(list, field, scope) {
|
|
52
|
+
const declared = declaredOffer(field, scope.itemTable);
|
|
53
|
+
if (declared !== null) return declared;
|
|
54
|
+
if (scope.picksBy !== null && field.source?.kind === "element") return {
|
|
55
|
+
kind: "picked",
|
|
56
|
+
filter: scope.picksBy
|
|
57
|
+
};
|
|
58
|
+
return declaredOffer({
|
|
59
|
+
...field,
|
|
60
|
+
source: list.source
|
|
61
|
+
}, scope.listTable) ?? OWNED;
|
|
62
|
+
}
|
|
63
|
+
function fillPicksMediaBy(fillSpec, slotId) {
|
|
64
|
+
const decisions = isRecord(fillSpec) ? fillSpec["decisions"] : void 0;
|
|
65
|
+
if (!Array.isArray(decisions)) return null;
|
|
66
|
+
const decision = decisions.find((entry) => {
|
|
67
|
+
const produces = isRecord(entry) ? entry["produces"] : void 0;
|
|
68
|
+
return Array.isArray(produces) && produces[0] === slotId;
|
|
69
|
+
});
|
|
70
|
+
if (!decisionFills(decision).some((fill) => fill.verb === "pick")) return null;
|
|
71
|
+
return readMediaOf(isRecord(decision) ? decision["of"] : void 0);
|
|
72
|
+
}
|
|
73
|
+
function isRecord(value) {
|
|
74
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
75
|
+
}
|
|
76
|
+
function itemFieldsOf(list) {
|
|
77
|
+
const element = list.element;
|
|
78
|
+
return element?.type === "object" ? element.fields ?? {} : null;
|
|
79
|
+
}
|
|
80
|
+
function memberRowTable(slots, scope, source) {
|
|
81
|
+
const member = memberSourceOf(source);
|
|
82
|
+
if (member === null) return null;
|
|
83
|
+
const row = (Object.hasOwn(scope, member.slot) ? scope[member.slot] : void 0) ?? (Object.hasOwn(slots, member.slot) ? slots[member.slot] : void 0);
|
|
84
|
+
return row?.type === "row" ? rowTableOf(row) : null;
|
|
85
|
+
}
|
|
86
|
+
function contentSlotOfferAt(slots, slotPath, fillSpec) {
|
|
87
|
+
const [head = "", ...rest] = slotPath.split(".");
|
|
88
|
+
const top = Object.hasOwn(slots, head) ? slots[head] : void 0;
|
|
89
|
+
if (top === void 0) return null;
|
|
90
|
+
if (top.type === "list") return listOfferAt(slots, top, rest, {
|
|
91
|
+
rowTable: memberRowTable(slots, slots, top.source),
|
|
92
|
+
inRecord: false,
|
|
93
|
+
picksBy: fillPicksMediaBy(fillSpec, head)
|
|
94
|
+
});
|
|
95
|
+
if (top.type === "object") {
|
|
96
|
+
const [field, ...deeper] = rest;
|
|
97
|
+
const declaration = field === void 0 ? void 0 : top.fields?.[field];
|
|
98
|
+
if (declaration === void 0 || deeper.length > 0) return null;
|
|
99
|
+
return mediaAt(declaration, mediaOffer(declaration, memberRowTable(slots, top.fields ?? {}, declaration.source)));
|
|
100
|
+
}
|
|
101
|
+
return rest.length > 0 ? null : mediaAt(top, mediaOffer(top, memberRowTable(slots, slots, top.source)));
|
|
102
|
+
}
|
|
103
|
+
function listOfferAt(slots, list, path, walk) {
|
|
104
|
+
const [field, ...deeper] = path;
|
|
105
|
+
if (field === void 0) {
|
|
106
|
+
const element = list.element;
|
|
107
|
+
if (element === void 0) return null;
|
|
108
|
+
return mediaAt(element, itemOffer(list, element, walk.rowTable) ?? OWNED);
|
|
109
|
+
}
|
|
110
|
+
const fields = itemFieldsOf(list);
|
|
111
|
+
const declaration = fields?.[field];
|
|
112
|
+
if (fields === null || declaration === void 0) return null;
|
|
113
|
+
const itemTable = walk.inRecord ? walk.rowTable : listTableOf({ slots }, list);
|
|
114
|
+
if (declaration.type === "list") return listOfferAt(slots, declaration, deeper, {
|
|
115
|
+
rowTable: itemTable,
|
|
116
|
+
inRecord: true,
|
|
117
|
+
picksBy: null
|
|
118
|
+
});
|
|
119
|
+
if (deeper.length > 0) return null;
|
|
120
|
+
return mediaAt(declaration, isAnnotatedMediaItem(fields) ? annotatedFieldOffer(list, declaration, {
|
|
121
|
+
itemTable,
|
|
122
|
+
listTable: walk.rowTable,
|
|
123
|
+
picksBy: walk.picksBy
|
|
124
|
+
}) : declaredOffer(declaration, itemTable) ?? (walk.picksBy !== null && declaration.source?.kind === "element" ? {
|
|
125
|
+
kind: "picked",
|
|
126
|
+
filter: walk.picksBy
|
|
127
|
+
} : OWNED));
|
|
128
|
+
}
|
|
129
|
+
function mediaAt(declaration, offer) {
|
|
130
|
+
return mediaFilterOf(declaration) === null ? null : {
|
|
131
|
+
declaration,
|
|
132
|
+
offer
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const OWNED_MEMBER_TYPES = /* @__PURE__ */ new Set([
|
|
136
|
+
"image",
|
|
137
|
+
"video",
|
|
138
|
+
"tour",
|
|
139
|
+
"document"
|
|
140
|
+
]);
|
|
141
|
+
function slotDeclarationAt(slots, slotId) {
|
|
142
|
+
const [head = "", ...rest] = slotId.split(".");
|
|
143
|
+
let slot = Object.hasOwn(slots, head) ? slots[head] : void 0;
|
|
144
|
+
for (const field of rest) slot = (slot?.type === "list" ? slot.element ?? slot : slot)?.fields?.[field];
|
|
145
|
+
return slot;
|
|
146
|
+
}
|
|
147
|
+
function readerAt(slots, slotId) {
|
|
148
|
+
const dot = slotId.lastIndexOf(".");
|
|
149
|
+
if (dot <= 0) return {};
|
|
150
|
+
const container = slotId.slice(0, dot);
|
|
151
|
+
const holder = slotDeclarationAt(slots, container);
|
|
152
|
+
const siblings = (holder?.type === "list" ? holder.element ?? holder : holder)?.fields;
|
|
153
|
+
return siblings === void 0 ? { container } : {
|
|
154
|
+
container,
|
|
155
|
+
siblings
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function ownedRowMemberOf(slots, slotId, declaration) {
|
|
159
|
+
const source = declaration.source;
|
|
160
|
+
if (source?.kind !== "row" || source.slot === void 0) return null;
|
|
161
|
+
const address = memberAddressOf(slots, readerAt(slots, slotId), {
|
|
162
|
+
slot: source.slot,
|
|
163
|
+
field: source.field
|
|
164
|
+
});
|
|
165
|
+
if (address?.layer !== "home") return null;
|
|
166
|
+
const { table, member } = address;
|
|
167
|
+
const fact = tableField(table, member);
|
|
168
|
+
if (fact === void 0 || !OWNED_MEMBER_TYPES.has(fact.type) || fact.from !== void 0) return null;
|
|
169
|
+
const kind = fact.type;
|
|
170
|
+
if (!declaredKinds(declaration).includes(kind)) return null;
|
|
171
|
+
return {
|
|
172
|
+
table,
|
|
173
|
+
member,
|
|
174
|
+
kind,
|
|
175
|
+
home: tableHome(table)
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
export { annotatedFieldOffer, boundMember, contentSlotOfferAt, declaredOffer, fillPicksMediaBy, itemOffer, mediaOffer, ownedRowMemberOf };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AddressValue } from "./address-value.js";
|
|
2
1
|
import { ObjectBindingOwnKey } from "./slot-catalog.js";
|
|
3
|
-
import {
|
|
2
|
+
import { AddressValue } from "./address-value.js";
|
|
4
3
|
import { ObjectFieldSlot } from "./slot-types.js";
|
|
5
4
|
import { ElementRef, RowRef } from "./slot-ref.js";
|
|
5
|
+
import { ComputeBinding } from "./compute.js";
|
|
6
6
|
import { MirrorSource, MirrorValueOption, SlotSource, TextSlotDef } from "./slot-builders.js";
|
|
7
7
|
//#region ../../internal/template-contracts/dist/object.d.ts
|
|
8
8
|
/** A field an object takes: a value slot, a row, or a list of value slots — each stating its label. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeAddressValue } from "./address-value.js";
|
|
2
|
-
import { MEDIA_KINDS, PROCESS_VERBS } from "./slot-catalog.js";
|
|
2
|
+
import { MEDIA_KINDS, PROCESS_VERBS, SLOT_TYPES } from "./slot-catalog.js";
|
|
3
3
|
import { ICON_NAMES } from "./icon-names.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
@@ -157,6 +157,13 @@ const PRIMITIVE_DESCRIPTORS = {
|
|
|
157
157
|
isEmpty: isBlankMedia
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
+
function isPrimitive(type) {
|
|
161
|
+
return SLOT_TYPES.includes(type);
|
|
162
|
+
}
|
|
163
|
+
function defaultForSlotType(type) {
|
|
164
|
+
if (type === "object") return {};
|
|
165
|
+
return isPrimitive(type) ? PRIMITIVE_DESCRIPTORS[type].default() : null;
|
|
166
|
+
}
|
|
160
167
|
|
|
161
168
|
//#endregion
|
|
162
|
-
export { PRIMITIVE_DESCRIPTORS };
|
|
169
|
+
export { PRIMITIVE_DESCRIPTORS, defaultForSlotType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memberListOfKey, tableColumnOfKey, tableOf } from "./registry-shape.js";
|
|
2
|
-
import "./ref-locate.js";
|
|
2
|
+
import { placementOf } from "./ref-locate.js";
|
|
3
3
|
import { isMediaListKey, isRegistryFactKey } from "./fact-keys.js";
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/template-contracts/dist/read-graph.js
|
|
@@ -208,6 +208,40 @@ function sectionGraphOf(schema, fillSpec) {
|
|
|
208
208
|
}
|
|
209
209
|
return graph;
|
|
210
210
|
}
|
|
211
|
+
function templateGraphOf(pages, sections) {
|
|
212
|
+
const placement = placementOf(pages);
|
|
213
|
+
return { pages: pages.map((page) => ({
|
|
214
|
+
id: page.id,
|
|
215
|
+
instances: page.sections.map((entry) => {
|
|
216
|
+
const graph = sections.get(entry.section);
|
|
217
|
+
if (graph === void 0) throw new Error(`read graph: the composition places section "${entry.section}", which carries no read graph.`);
|
|
218
|
+
const reader = {
|
|
219
|
+
instanceId: entry.instance_id,
|
|
220
|
+
section: entry.section
|
|
221
|
+
};
|
|
222
|
+
const slots = graph.slots.map((slot) => {
|
|
223
|
+
const { mirrors, ...rest } = slot;
|
|
224
|
+
if (mirrors === void 0) return rest;
|
|
225
|
+
const upstream = placement.locate(mirrors, reader);
|
|
226
|
+
return upstream === void 0 ? rest : {
|
|
227
|
+
...rest,
|
|
228
|
+
mirrors: {
|
|
229
|
+
instanceId: upstream.instanceId,
|
|
230
|
+
slot: upstream.slot
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
return {
|
|
235
|
+
instanceId: entry.instance_id,
|
|
236
|
+
section: entry.section,
|
|
237
|
+
required: entry.required === true,
|
|
238
|
+
...graph.visibility === void 0 ? {} : { visibility: graph.visibility },
|
|
239
|
+
...graph.variant === void 0 ? {} : { variant: graph.variant },
|
|
240
|
+
slots
|
|
241
|
+
};
|
|
242
|
+
})
|
|
243
|
+
})) };
|
|
244
|
+
}
|
|
211
245
|
|
|
212
246
|
//#endregion
|
|
213
|
-
export { factPathOf, rowBaseOf, sectionGraphOf };
|
|
247
|
+
export { factPathOf, rowBaseOf, sectionGraphOf, templateGraphOf };
|