@homepages/concrete 8.0.0 → 9.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 +988 -0
- package/README.md +20 -9
- package/codemods/list-grammar.mjs +923 -0
- package/codemods/manifest.json +60 -0
- package/codemods/process-builders.mjs +198 -0
- package/codemods/slot-object.mjs +1097 -0
- package/codemods/steps/content-object-fields.mjs +324 -0
- package/codemods/steps/list-object-form.mjs +6 -7
- package/codemods/table-rows.mjs +568 -0
- package/codemods/unwrap-object-fields.mjs +310 -0
- package/codemods/viewer-slot-document.mjs +131 -0
- package/codemods/write-property-as-facts-document.mjs +716 -0
- package/codemods/write-the-address-line.mjs +255 -0
- package/codemods/write-the-registry-members.mjs +653 -0
- package/codemods/write-the-select-from.mjs +141 -0
- package/codemods/write-the-sole-from.mjs +369 -0
- package/codemods/write-the-table-from.mjs +267 -0
- package/codemods/write-the-whole-item.mjs +512 -0
- package/codemods/writeback-drop.mjs +168 -0
- package/codemods/written-contact-address.mjs +162 -0
- package/codemods/written-media-category.mjs +227 -0
- package/codemods/written-ref-kinds-name-the-layer.mjs +172 -0
- package/codemods/written-uploads-replace-pool-reads.mjs +454 -0
- package/codemods/written-uploads-sort-into-lists.mjs +405 -0
- package/codemods/written-uploads-stated-in-sorted-lists.mjs +295 -0
- package/codemods/written-video-sources-drop.mjs +144 -0
- package/codemods/written-without-pick-none.mjs +146 -0
- package/codemods/written-without-retired-knowledge.mjs +223 -0
- package/codemods/written-without-the-media-key.mjs +202 -0
- package/codemods/written-without-the-property-type.mjs +249 -0
- package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +1259 -0
- package/dist/artifact/playground/client/assets/index-DDOcM0zA.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 +61 -27
- package/dist/base.css +58 -1
- package/dist/cli/build/artifact.js +6 -9
- package/dist/cli/build/captures.js +2 -12
- package/dist/cli/build/esbuild.js +1 -25
- package/dist/cli/build/fixtures.js +2 -1
- package/dist/cli/build/icons.js +1 -1
- package/dist/cli/build/static.js +2 -2
- package/dist/cli/capture/capture.js +8 -9
- package/dist/cli/check/analyze.js +8 -1
- package/dist/cli/check/load-outdir.js +47 -0
- package/dist/cli/check/load-workspace.js +4 -4
- package/dist/cli/check/render/html.js +1 -2
- package/dist/cli/check/render/inputs.js +10 -3
- package/dist/cli/check/render/island-frames.js +2 -1
- package/dist/cli/check/render/marker-coverage.js +23 -15
- package/dist/cli/check/report.js +5 -0
- package/dist/cli/check/stages/bundles.js +1 -1
- package/dist/cli/check/stages/relations.js +1 -1
- package/dist/cli/check/stages/render.js +48 -33
- package/dist/cli/check/stages/sections.js +83 -31
- package/dist/cli/commands.js +1 -1
- package/dist/cli/dev/crop.js +1 -1
- package/dist/cli/dev/fixture-ladders.js +96 -0
- package/dist/cli/dev/islands.js +12 -123
- package/dist/cli/dev/listen.js +20 -1
- package/dist/cli/dev/load-template.js +1 -1
- package/dist/cli/dev/server.js +35 -10
- package/dist/cli/dev/vite.js +9 -7
- package/dist/cli/dev/workspace-reader.js +16 -16
- package/dist/cli/media/derive.js +43 -57
- package/dist/cli/media/frame-rung-floor.js +0 -1
- package/dist/cli/property/index.js +1 -6
- package/dist/css/inline.js +1 -22
- package/dist/eslint/rules/no-marker-literal.js +1 -1
- package/dist/fixtures/load.js +16 -7
- package/dist/fixtures/media-plugin.js +17 -12
- package/dist/fixtures/media-store.js +115 -0
- package/dist/fixtures/property.js +345 -126
- package/dist/fixtures/resolve.js +263 -251
- package/dist/fixtures/rows.js +4 -11
- package/dist/fixtures.d.ts +234 -109
- package/dist/index.d.ts +25 -16
- package/dist/index.js +10 -6
- package/dist/islands/marker.js +2 -1
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/canvas-core/dist/island-host.js +62 -0
- package/dist/packages/internal/canvas-core/dist/island-shields.js +30 -0
- package/dist/packages/internal/capture-settle/dist/index.js +3 -0
- package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +13 -0
- package/dist/packages/internal/capture-settle/dist/island-markers.js +6 -0
- package/dist/packages/internal/capture-settle/dist/settle.js +150 -0
- package/dist/packages/internal/{image-ladder/dist/crop.js → crop-region/dist/index.js} +21 -20
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +251 -33
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +365 -4
- package/dist/packages/internal/fill-bake/dist/derive-source.js +35 -21
- package/dist/packages/internal/fill-bake/dist/index.js +8 -3
- package/dist/packages/internal/fill-bake/dist/item-merge.js +119 -0
- package/dist/packages/internal/fill-bake/dist/item-overrides.js +28 -0
- package/dist/packages/internal/fill-bake/dist/linked-merge.js +40 -0
- package/dist/packages/internal/fill-bake/dist/list-grammar.js +175 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +51 -0
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +390 -0
- package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -23
- package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +75 -0
- package/dist/packages/internal/format-geometry/dist/capture.js +11 -147
- package/dist/packages/internal/format-geometry/dist/format.d.ts +8 -2
- package/dist/packages/internal/format-geometry/dist/geometry.js +13 -2
- package/dist/packages/internal/image-ladder/dist/encode.js +27 -14
- package/dist/packages/internal/image-ladder/dist/index.js +3 -3
- package/dist/packages/internal/image-ladder/dist/policy.js +28 -53
- package/dist/packages/internal/island-runtime/dist/capture-holds.js +1 -1
- package/dist/packages/internal/island-runtime/dist/contract.d.ts +3 -12
- package/dist/packages/internal/island-runtime/dist/contract.js +2 -2
- package/dist/packages/internal/island-runtime/dist/index.d.ts +3 -7
- package/dist/packages/internal/island-runtime/dist/index.js +2 -1
- package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +1 -1
- package/dist/packages/internal/media-resolution/dist/crop-key.js +7 -0
- package/dist/packages/internal/media-resolution/dist/document.js +63 -0
- package/dist/packages/internal/media-resolution/dist/image.js +228 -0
- package/dist/packages/internal/media-resolution/dist/index.js +11 -0
- package/dist/packages/internal/media-resolution/dist/list.js +112 -0
- package/dist/packages/internal/media-resolution/dist/media.js +59 -0
- package/dist/packages/internal/media-resolution/dist/records.js +7 -0
- package/dist/packages/internal/media-resolution/dist/slot.js +34 -0
- package/dist/packages/internal/media-resolution/dist/store.js +19 -0
- package/dist/packages/internal/media-resolution/dist/tour.js +59 -0
- package/dist/packages/internal/media-resolution/dist/video.js +93 -0
- package/dist/packages/internal/property-facts/dist/registry-facts.js +244 -0
- package/dist/packages/internal/section-contracts/dist/cap-contract.js +8 -17
- package/dist/packages/internal/section-contracts/dist/catalog.js +34 -10
- package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +11 -2
- package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +27 -0
- package/dist/packages/internal/section-contracts/dist/fill-options.js +12 -0
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +95 -0
- package/dist/packages/internal/section-contracts/dist/grammar-scope.js +154 -0
- package/dist/packages/internal/section-contracts/dist/index.js +7 -1
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +15 -20
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +12 -7
- package/dist/packages/internal/section-contracts/dist/list-source-contract.js +46 -0
- package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +11 -2
- package/dist/packages/internal/section-contracts/dist/object-contract.js +92 -0
- package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +5 -5
- package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +63 -0
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +7 -4
- package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +83 -0
- package/dist/packages/internal/section-contracts/dist/row-source-contract.js +67 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +74 -10
- package/dist/packages/internal/section-contracts/dist/select-contract.js +0 -8
- package/dist/packages/internal/section-contracts/dist/source-contract.js +103 -46
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +47 -17
- package/dist/packages/internal/section-contracts/dist/table-member.js +16 -0
- package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +42 -21
- package/dist/packages/internal/source-resolution/dist/index.js +113 -72
- package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +16 -0
- package/dist/packages/internal/street-address/dist/index.js +72 -0
- package/dist/packages/internal/template-artifact/dist/asset-mime.js +30 -0
- package/dist/packages/internal/template-artifact/dist/layout.js +1 -2
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +12 -29
- package/dist/packages/internal/template-contracts/dist/address-value.d.ts +52 -0
- package/dist/packages/internal/template-contracts/dist/address-value.js +90 -0
- package/dist/packages/internal/template-contracts/dist/comparable-address.js +19 -0
- package/dist/{schema → packages/internal/template-contracts/dist}/compute.d.ts +29 -6
- package/dist/{schema → packages/internal/template-contracts/dist}/compute.js +11 -13
- package/dist/packages/internal/template-contracts/dist/content-pick.js +51 -0
- package/dist/packages/internal/template-contracts/dist/decision-fills.js +85 -0
- package/dist/packages/internal/template-contracts/dist/display-overrides.js +7 -0
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +16 -5
- package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +24 -0
- package/dist/packages/internal/template-contracts/dist/fact-compute.js +30 -0
- package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +44 -0
- package/dist/packages/internal/template-contracts/dist/fact-keys.js +88 -0
- package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +290 -0
- package/dist/packages/internal/template-contracts/dist/fact-registry.js +598 -0
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +10 -24
- package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +157 -0
- package/dist/packages/internal/template-contracts/dist/fill-builders.js +79 -0
- package/dist/packages/internal/template-contracts/dist/fill-declaration.d.ts +14 -0
- package/dist/{schema → packages/internal/template-contracts/dist}/fill-declaration.js +6 -5
- package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +158 -0
- package/dist/packages/internal/template-contracts/dist/fill-spec.js +291 -0
- package/dist/packages/internal/template-contracts/dist/findable.js +8 -0
- package/dist/packages/internal/template-contracts/dist/floor-presets.js +13 -0
- package/dist/packages/internal/template-contracts/dist/icon-names.d.ts +5 -0
- package/dist/packages/internal/template-contracts/dist/icon-names.js +70 -0
- package/dist/packages/internal/template-contracts/dist/legacy-facts.js +167 -0
- package/dist/packages/internal/template-contracts/dist/list-editing.js +94 -0
- package/dist/packages/internal/template-contracts/dist/list.d.ts +215 -0
- package/dist/packages/internal/template-contracts/dist/list.js +258 -0
- package/dist/packages/internal/template-contracts/dist/markers.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/media-candidates.js +38 -0
- package/dist/packages/internal/template-contracts/dist/mirror-kind.js +48 -0
- package/dist/packages/internal/template-contracts/dist/number-display.js +10 -0
- package/dist/packages/internal/template-contracts/dist/object.d.ts +89 -0
- package/dist/packages/internal/template-contracts/dist/object.js +131 -0
- package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.d.ts +1 -0
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +162 -0
- package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +77 -0
- package/dist/packages/internal/template-contracts/dist/process-builders.js +73 -0
- package/dist/packages/internal/template-contracts/dist/read-graph.js +250 -0
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +192 -0
- package/dist/packages/internal/template-contracts/dist/registry-aliases.js +77 -0
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +268 -0
- package/dist/packages/internal/template-contracts/dist/registry-facts.js +202 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +41 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.js +135 -0
- package/dist/packages/internal/template-contracts/dist/resolve-scope.js +103 -0
- package/dist/packages/internal/{image-descriptor/dist/index.d.ts → template-contracts/dist/responsive-image.d.ts} +1 -1
- package/dist/packages/internal/template-contracts/dist/row-planners.js +29 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +133 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.js +101 -0
- package/dist/packages/internal/template-contracts/dist/row-sources.js +49 -3
- package/dist/packages/internal/template-contracts/dist/row.d.ts +155 -0
- package/dist/packages/internal/template-contracts/dist/row.js +84 -0
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +97 -0
- package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +782 -0
- package/dist/packages/internal/template-contracts/dist/slot-builders.js +233 -0
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +243 -384
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +335 -227
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +21 -0
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +155 -0
- package/dist/packages/internal/template-contracts/dist/slot-ref.js +76 -0
- package/dist/packages/internal/template-contracts/dist/slot-types.d.ts +163 -0
- package/dist/packages/internal/template-contracts/dist/slot-types.js +140 -0
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +97 -0
- package/dist/packages/internal/template-contracts/dist/table-members.d.ts +25 -0
- package/dist/packages/internal/template-contracts/dist/table-members.js +90 -0
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +5 -5
- package/dist/packages/internal/template-contracts/dist/value-contracts.js +15 -0
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +2 -2
- package/dist/platform/fs.js +5 -2
- package/dist/playground/canvas-island-host.d.ts +11 -0
- package/dist/playground/canvas-island-host.js +29 -0
- package/dist/playground/canvas-markers.js +14 -0
- package/dist/playground-island-runtime.d.ts +3 -2
- package/dist/playground-island-runtime.js +3 -2
- package/dist/primitives/FrameShell.js +0 -1
- package/dist/primitives/Image.d.ts +5 -4
- package/dist/primitives/Tour.d.ts +1 -1
- package/dist/primitives/Video.d.ts +2 -2
- package/dist/primitives/index.d.ts +2 -3
- package/dist/primitives/picture-sources.js +2 -2
- package/dist/primitives/probe-context.js +2 -12
- package/dist/primitives/slot-address.d.ts +44 -0
- package/dist/primitives/slot-address.js +19 -0
- package/dist/primitives/slot-bindings.d.ts +65 -26
- package/dist/primitives/slot-bindings.js +104 -46
- package/dist/primitives/slot-document.d.ts +23 -18
- package/dist/primitives/slot-document.js +39 -14
- package/dist/primitives/slot-download.d.ts +39 -0
- package/dist/primitives/slot-download.js +39 -0
- package/dist/primitives/slot-list.d.ts +3 -3
- package/dist/primitives/slot-list.js +0 -2
- package/dist/primitives/slot-media.d.ts +24 -5
- package/dist/primitives/slot-media.js +6 -9
- package/dist/primitives/slot-object.d.ts +49 -0
- package/dist/primitives/slot-object.js +20 -0
- package/dist/primitives/slot-scalar.d.ts +27 -2
- package/dist/primitives/slot-scalar.js +50 -7
- package/dist/primitives/slot.d.ts +13 -6
- package/dist/primitives/slot.js +10 -3
- package/dist/rules/registry.js +19 -30
- package/dist/schema/define-schema.d.ts +4 -8
- package/dist/schema/define-schema.js +178 -79
- package/dist/schema/extract-fill-spec.js +2 -153
- package/dist/schema/fact.d.ts +57 -15
- package/dist/schema/fact.js +42 -7
- package/dist/schema/facts-view.d.ts +14 -0
- package/dist/schema/format.d.ts +1 -0
- package/dist/schema/format.js +2 -1
- package/dist/schema/manifest.js +24 -0
- package/dist/schema/property-facts.d.ts +8 -12
- package/dist/schema/section-props.d.ts +2 -66
- package/dist/schema/section-schema.d.ts +8 -11
- package/dist/schema/section-schema.js +27 -10
- package/dist/section/declare.d.ts +18 -7
- package/dist/section/declare.js +18 -5
- package/dist/section/materialize.js +3 -8
- package/dist/section/section.d.ts +12 -8
- package/dist/section/section.js +1 -1
- package/dist/template/logic-shim.d.ts +14 -7
- package/dist/template/logic-shim.js +14 -7
- package/dist/template/materialize.js +17 -18
- package/dist/template/mirror-types.js +30 -31
- package/dist/template/section-reads.js +85 -9
- 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 +2 -2
- package/guide/reference/cli/publish.md +1 -1
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +28 -24
- package/package.json +9 -8
- package/dist/artifact/playground/client/assets/index-CckS2ONm.css +0 -1
- package/dist/artifact/playground/client/assets/index-Dn_xT16-.js +0 -1101
- package/dist/fixtures/canonical.d.ts +0 -166
- package/dist/fixtures/media.js +0 -163
- package/dist/packages/internal/fill-vocabulary/dist/origination.js +0 -51
- package/dist/packages/internal/format-geometry/dist/index.js +0 -4
- package/dist/packages/internal/property-facts/dist/derive-facts-view.js +0 -10
- package/dist/packages/internal/property-facts/dist/index.js +0 -3
- package/dist/packages/internal/property-facts/dist/property-facts-Cy7-O4p0.js +0 -189
- package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +0 -24
- package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -22
- package/dist/packages/internal/template-contracts/dist/facts-view.js +0 -104
- package/dist/packages/internal/template-contracts/dist/select-key.js +0 -7
- package/dist/primitives/slot-group.d.ts +0 -40
- package/dist/primitives/slot-group.js +0 -36
- package/dist/schema/extract-used-facts.js +0 -34
- package/dist/schema/fill-builders.d.ts +0 -115
- package/dist/schema/fill-builders.js +0 -25
- package/dist/schema/fill-declaration.d.ts +0 -14
- package/dist/schema/fill-spec.js +0 -98
- package/dist/schema/layout.d.ts +0 -30
- package/dist/schema/layout.js +0 -14
- package/dist/schema/row-fields.js +0 -88
- package/dist/schema/row-ref.d.ts +0 -59
- package/dist/schema/row-ref.js +0 -28
- package/dist/schema/runtime-values.d.ts +0 -71
- package/dist/schema/section-nav.js +0 -14
- package/dist/schema/slot-builders.d.ts +0 -633
- package/dist/schema/slot-builders.js +0 -177
- package/dist/schema/slot-ref.d.ts +0 -79
- package/dist/schema/slot-ref.js +0 -41
- package/dist/schema/slot-types.d.ts +0 -111
- package/dist/schema/slot-types.js +0 -214
- package/dist/section/groups.js +0 -68
|
@@ -7,15 +7,209 @@ const CONTENT_SLOT_TYPES = [
|
|
|
7
7
|
"list",
|
|
8
8
|
"poi",
|
|
9
9
|
"url",
|
|
10
|
+
"date",
|
|
11
|
+
"email",
|
|
12
|
+
"phone",
|
|
13
|
+
"address",
|
|
10
14
|
"video",
|
|
11
15
|
"tour",
|
|
12
|
-
"document"
|
|
16
|
+
"document",
|
|
17
|
+
"media"
|
|
13
18
|
];
|
|
14
19
|
const REF_SLOT_TYPES = [];
|
|
15
20
|
const SLOT_TYPES = [...CONTENT_SLOT_TYPES, ...REF_SLOT_TYPES];
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
return
|
|
21
|
+
const LIST_SLOT_TYPES = ["list"];
|
|
22
|
+
function isListSlotType(type) {
|
|
23
|
+
return LIST_SLOT_TYPES.includes(type);
|
|
24
|
+
}
|
|
25
|
+
const OBJECT_BINDING_OWN_KEYS = [
|
|
26
|
+
"id",
|
|
27
|
+
"slot",
|
|
28
|
+
"index",
|
|
29
|
+
"def",
|
|
30
|
+
"value",
|
|
31
|
+
"present",
|
|
32
|
+
"enclosing"
|
|
33
|
+
];
|
|
34
|
+
const MEDIA_KINDS = [
|
|
35
|
+
"image",
|
|
36
|
+
"video",
|
|
37
|
+
"tour",
|
|
38
|
+
"document"
|
|
39
|
+
];
|
|
40
|
+
function isMediaKind(type) {
|
|
41
|
+
return MEDIA_KINDS.includes(type);
|
|
42
|
+
}
|
|
43
|
+
function isMediaType(type) {
|
|
44
|
+
return type === "media" || isMediaKind(type);
|
|
45
|
+
}
|
|
46
|
+
const PROCESS_CATALOG = {
|
|
47
|
+
cutout: {
|
|
48
|
+
label: "Background removed",
|
|
49
|
+
kinds: ["image"],
|
|
50
|
+
site: "holder",
|
|
51
|
+
options: { enclosed: {
|
|
52
|
+
required: false,
|
|
53
|
+
type: "string",
|
|
54
|
+
values: ["clear", "keep"]
|
|
55
|
+
} }
|
|
56
|
+
},
|
|
57
|
+
autocrop: {
|
|
58
|
+
label: "Cropped to its subject",
|
|
59
|
+
kinds: ["image"],
|
|
60
|
+
site: "holder",
|
|
61
|
+
options: { brief: {
|
|
62
|
+
required: true,
|
|
63
|
+
type: "string"
|
|
64
|
+
} }
|
|
65
|
+
},
|
|
66
|
+
probe: {
|
|
67
|
+
label: "Probed",
|
|
68
|
+
kinds: [
|
|
69
|
+
"image",
|
|
70
|
+
"video",
|
|
71
|
+
"document"
|
|
72
|
+
],
|
|
73
|
+
site: "kind",
|
|
74
|
+
options: {}
|
|
75
|
+
},
|
|
76
|
+
understand: {
|
|
77
|
+
label: "Understood",
|
|
78
|
+
kinds: [
|
|
79
|
+
"image",
|
|
80
|
+
"video",
|
|
81
|
+
"document",
|
|
82
|
+
"tour"
|
|
83
|
+
],
|
|
84
|
+
site: "kind",
|
|
85
|
+
options: {}
|
|
86
|
+
},
|
|
87
|
+
preview: {
|
|
88
|
+
label: "Preview",
|
|
89
|
+
kinds: [
|
|
90
|
+
"image",
|
|
91
|
+
"video",
|
|
92
|
+
"document"
|
|
93
|
+
],
|
|
94
|
+
site: "kind",
|
|
95
|
+
options: {}
|
|
96
|
+
},
|
|
97
|
+
ladder: {
|
|
98
|
+
label: "Renditions",
|
|
99
|
+
kinds: [
|
|
100
|
+
"image",
|
|
101
|
+
"video",
|
|
102
|
+
"document"
|
|
103
|
+
],
|
|
104
|
+
site: "kind",
|
|
105
|
+
options: {}
|
|
106
|
+
},
|
|
107
|
+
transcode: {
|
|
108
|
+
label: "Transcoded",
|
|
109
|
+
kinds: ["video"],
|
|
110
|
+
site: "kind",
|
|
111
|
+
options: {}
|
|
112
|
+
},
|
|
113
|
+
poster: {
|
|
114
|
+
label: "Poster",
|
|
115
|
+
kinds: ["video", "document"],
|
|
116
|
+
site: "kind",
|
|
117
|
+
options: {}
|
|
118
|
+
},
|
|
119
|
+
rasterize: {
|
|
120
|
+
label: "Pages rasterized",
|
|
121
|
+
kinds: ["document"],
|
|
122
|
+
site: "kind",
|
|
123
|
+
options: {}
|
|
124
|
+
},
|
|
125
|
+
fetch: {
|
|
126
|
+
label: "Link fetched",
|
|
127
|
+
kinds: ["video", "tour"],
|
|
128
|
+
site: "kind",
|
|
129
|
+
options: {}
|
|
130
|
+
},
|
|
131
|
+
tour_details: {
|
|
132
|
+
label: "Tour details",
|
|
133
|
+
kinds: ["tour"],
|
|
134
|
+
site: "kind",
|
|
135
|
+
options: {}
|
|
136
|
+
},
|
|
137
|
+
crop: {
|
|
138
|
+
label: "Cut to its crop",
|
|
139
|
+
kinds: ["image"],
|
|
140
|
+
site: "place",
|
|
141
|
+
options: {}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const PROCESS_VERBS = Object.keys(PROCESS_CATALOG);
|
|
145
|
+
const HOLDER_PROCESS_VERBS = PROCESS_VERBS.filter((verb) => PROCESS_CATALOG[verb].site === "holder");
|
|
146
|
+
const KIND_PROCESS_VERBS = PROCESS_VERBS.filter((verb) => PROCESS_CATALOG[verb].site === "kind");
|
|
147
|
+
function isProcessVerb(value) {
|
|
148
|
+
return typeof value === "string" && Object.hasOwn(PROCESS_CATALOG, value);
|
|
149
|
+
}
|
|
150
|
+
function processBindingOf(entry) {
|
|
151
|
+
if (typeof entry === "string") return isProcessVerb(entry) ? {
|
|
152
|
+
kind: "process",
|
|
153
|
+
verb: entry
|
|
154
|
+
} : null;
|
|
155
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return null;
|
|
156
|
+
const { kind, verb } = entry;
|
|
157
|
+
return kind === "process" && isProcessVerb(verb) ? entry : null;
|
|
158
|
+
}
|
|
159
|
+
function processOptionsProblem(binding) {
|
|
160
|
+
const entry = PROCESS_CATALOG[binding.verb];
|
|
161
|
+
const takes = Object.keys(entry.options);
|
|
162
|
+
const listed = takes.length > 0 ? `it takes ${takes.map((key) => `\`${key}\``).join(", ")}` : "it takes none";
|
|
163
|
+
for (const [key, value] of Object.entries(binding)) {
|
|
164
|
+
if (key === "kind" || key === "verb" || value === void 0) continue;
|
|
165
|
+
if (key === "reads") return `\`${binding.verb}\` takes no \`reads\` — a process is about one asset, never the property`;
|
|
166
|
+
const option = entry.options[key];
|
|
167
|
+
if (option === void 0) {
|
|
168
|
+
const hint = key === "aspect" && binding.verb === "autocrop" ? "; its aspect is the holder's `crop` — the aspect it locks, free form where it locks none" : "";
|
|
169
|
+
return `\`${binding.verb}\` takes no option "${key}" — ${listed}${hint}`;
|
|
170
|
+
}
|
|
171
|
+
if (option.values !== void 0) {
|
|
172
|
+
if (typeof value !== "string" || !option.values.includes(value)) return `\`${binding.verb}\`'s \`${key}\` is one of ${option.values.map((one) => `"${one}"`).join(", ")}`;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (typeof value !== option.type || typeof value === "string" && value.trim() === "") return `\`${binding.verb}\`'s \`${key}\` is a non-empty ${option.type}`;
|
|
176
|
+
}
|
|
177
|
+
for (const [key, option] of Object.entries(entry.options)) if (option.required && binding[key] === void 0) return `\`${binding.verb}\` requires \`${key}\``;
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
function declaredKinds(declaration) {
|
|
181
|
+
const { type, kinds } = declaration;
|
|
182
|
+
if (type === "media") {
|
|
183
|
+
const stated = Array.isArray(kinds) ? kinds.filter((kind) => typeof kind === "string" && isMediaKind(kind)) : [];
|
|
184
|
+
return stated.length > 0 ? stated : MEDIA_KINDS;
|
|
185
|
+
}
|
|
186
|
+
return typeof type === "string" && isMediaKind(type) ? [type] : [];
|
|
187
|
+
}
|
|
188
|
+
function mediaDeclarationProblem(declaration) {
|
|
189
|
+
const { kinds, process } = declaration;
|
|
190
|
+
if (kinds !== void 0) {
|
|
191
|
+
if (declaration.type !== "media") return "declares `kinds` — only `media()` leaves its kind open; a kind's own builder fixes it";
|
|
192
|
+
if (!Array.isArray(kinds) || kinds.length === 0 || !kinds.every((kind) => typeof kind === "string" && isMediaKind(kind))) return `declares \`kinds\` ${JSON.stringify(kinds)} — a non-empty list of ${MEDIA_KINDS.join(", ")}`;
|
|
193
|
+
}
|
|
194
|
+
if (process === void 0) return null;
|
|
195
|
+
const builders = HOLDER_PROCESS_VERBS.map((verb) => `process.${verb}()`).join(", ");
|
|
196
|
+
if (!Array.isArray(process) || process.length === 0) return `declares \`process\` ${JSON.stringify(process)} — a non-empty list of processes (${builders})`;
|
|
197
|
+
const seen = /* @__PURE__ */ new Set();
|
|
198
|
+
for (const entry of process) {
|
|
199
|
+
const binding = processBindingOf(entry);
|
|
200
|
+
if (binding === null) return `processes ${JSON.stringify(entry)}, which is no process (${builders})`;
|
|
201
|
+
const { verb } = binding;
|
|
202
|
+
const declared = PROCESS_CATALOG[verb];
|
|
203
|
+
if (declared.site === "kind") return `processes "${verb}", which every ${declared.kinds.join(", ")} gets from birth on its kind's row — never a holder's to declare`;
|
|
204
|
+
if (declared.site === "place") return `processes "${verb}", which every ${declared.kinds.join(", ")} place gets wherever its value carries a crop — never a holder's to declare`;
|
|
205
|
+
if (seen.has(verb)) return `processes "${verb}" twice — a holder declares each process once`;
|
|
206
|
+
seen.add(verb);
|
|
207
|
+
const options = processOptionsProblem(binding);
|
|
208
|
+
if (options !== null) return `processes "${verb}" with options that do not fit: ${options}`;
|
|
209
|
+
const outside = declaredKinds(declaration).filter((kind) => !declared.kinds.includes(kind));
|
|
210
|
+
if (outside.length > 0) return `processes "${verb}", which applies to ${declared.kinds.join(", ")} and not to ${outside.join(", ")}`;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
19
213
|
}
|
|
20
214
|
const REFERRAL_FIELDS = [
|
|
21
215
|
"name",
|
|
@@ -37,27 +231,6 @@ const REFERRAL_IMAGE_FIELDS = [
|
|
|
37
231
|
"logo_dark",
|
|
38
232
|
"logo_light"
|
|
39
233
|
];
|
|
40
|
-
const INPUT_GROUPS = [
|
|
41
|
-
"address",
|
|
42
|
-
"type",
|
|
43
|
-
"intent",
|
|
44
|
-
"describe",
|
|
45
|
-
"uploads",
|
|
46
|
-
"units",
|
|
47
|
-
"comparables",
|
|
48
|
-
"contacts"
|
|
49
|
-
];
|
|
50
|
-
const INPUT_GROUP_REQUIREMENT = {
|
|
51
|
-
address: "always",
|
|
52
|
-
type: "always",
|
|
53
|
-
intent: "always",
|
|
54
|
-
describe: "always",
|
|
55
|
-
uploads: "always",
|
|
56
|
-
units: "derived",
|
|
57
|
-
comparables: "derived",
|
|
58
|
-
contacts: "derived"
|
|
59
|
-
};
|
|
60
|
-
const ALWAYS_ASKED_INPUT_GROUPS = INPUT_GROUPS.filter((group) => INPUT_GROUP_REQUIREMENT[group] === "always");
|
|
61
234
|
const FACT_PROJECTIONS = {
|
|
62
235
|
property: {
|
|
63
236
|
latitude: "lat",
|
|
@@ -68,11 +241,8 @@ const FACT_PROJECTIONS = {
|
|
|
68
241
|
const PROPERTY_ROOT_FACTS = {
|
|
69
242
|
address: {
|
|
70
243
|
role: "bindable",
|
|
71
|
-
path: "address",
|
|
72
244
|
container: "property",
|
|
73
245
|
value_type: "text",
|
|
74
|
-
input_group: "address",
|
|
75
|
-
strength: "blocking",
|
|
76
246
|
fields: {
|
|
77
247
|
display: { value_type: "text" },
|
|
78
248
|
street: { value_type: "text" },
|
|
@@ -85,89 +255,54 @@ const PROPERTY_ROOT_FACTS = {
|
|
|
85
255
|
},
|
|
86
256
|
address_street: {
|
|
87
257
|
role: "bindable",
|
|
88
|
-
path: "address.street",
|
|
89
258
|
container: "property",
|
|
90
|
-
value_type: "text"
|
|
91
|
-
input_group: "address",
|
|
92
|
-
strength: "blocking"
|
|
259
|
+
value_type: "text"
|
|
93
260
|
},
|
|
94
261
|
address_unit: {
|
|
95
262
|
role: "bindable",
|
|
96
|
-
path: "address.unit",
|
|
97
263
|
container: "property",
|
|
98
|
-
value_type: "text"
|
|
99
|
-
input_group: "address",
|
|
100
|
-
strength: "optional"
|
|
264
|
+
value_type: "text"
|
|
101
265
|
},
|
|
102
266
|
address_city: {
|
|
103
267
|
role: "bindable",
|
|
104
|
-
path: "address.city",
|
|
105
268
|
container: "property",
|
|
106
|
-
value_type: "text"
|
|
107
|
-
input_group: "address",
|
|
108
|
-
strength: "blocking"
|
|
269
|
+
value_type: "text"
|
|
109
270
|
},
|
|
110
271
|
address_state: {
|
|
111
272
|
role: "bindable",
|
|
112
|
-
path: "address.state",
|
|
113
273
|
container: "property",
|
|
114
|
-
value_type: "text"
|
|
115
|
-
input_group: "address",
|
|
116
|
-
strength: "blocking"
|
|
274
|
+
value_type: "text"
|
|
117
275
|
},
|
|
118
276
|
address_postal: {
|
|
119
277
|
role: "bindable",
|
|
120
|
-
path: "address.postal",
|
|
121
278
|
container: "property",
|
|
122
|
-
value_type: "text"
|
|
123
|
-
input_group: "address",
|
|
124
|
-
strength: "blocking"
|
|
279
|
+
value_type: "text"
|
|
125
280
|
},
|
|
126
281
|
listing_intent: {
|
|
127
282
|
role: "bindable",
|
|
128
|
-
path: "listing_intent",
|
|
129
283
|
container: "property",
|
|
130
284
|
value_type: "text",
|
|
131
|
-
input_group: "intent",
|
|
132
|
-
strength: "blocking",
|
|
133
285
|
writeback: {
|
|
134
286
|
kind: "property",
|
|
135
287
|
column: "listing_intent"
|
|
136
288
|
}
|
|
137
289
|
},
|
|
138
|
-
property_type: {
|
|
139
|
-
role: "bindable",
|
|
140
|
-
path: "property_type",
|
|
141
|
-
container: "property",
|
|
142
|
-
value_type: "text",
|
|
143
|
-
input_group: "type",
|
|
144
|
-
strength: "blocking"
|
|
145
|
-
},
|
|
146
290
|
lat: {
|
|
147
291
|
role: "bindable",
|
|
148
|
-
path: "lat",
|
|
149
292
|
container: "property",
|
|
150
|
-
value_type: "number"
|
|
151
|
-
input_group: "address",
|
|
152
|
-
strength: "blocking"
|
|
293
|
+
value_type: "number"
|
|
153
294
|
},
|
|
154
295
|
lon: {
|
|
155
296
|
role: "bindable",
|
|
156
|
-
path: "lon",
|
|
157
297
|
container: "property",
|
|
158
|
-
value_type: "number"
|
|
159
|
-
input_group: "address",
|
|
160
|
-
strength: "blocking"
|
|
298
|
+
value_type: "number"
|
|
161
299
|
}
|
|
162
300
|
};
|
|
163
|
-
const
|
|
301
|
+
const TABLE_FACTS = {
|
|
164
302
|
units: {
|
|
165
303
|
role: "bindable",
|
|
166
|
-
path: "units",
|
|
167
304
|
container: "property",
|
|
168
305
|
value_type: "unit_list",
|
|
169
|
-
input_group: "units",
|
|
170
|
-
strength: "blocking",
|
|
171
306
|
row: {
|
|
172
307
|
unit_id: {
|
|
173
308
|
path: "unit_id",
|
|
@@ -180,7 +315,6 @@ const COLLECTION_FACTS = {
|
|
|
180
315
|
floor_plans: {
|
|
181
316
|
path: "floor_plans",
|
|
182
317
|
value_type: "image_list",
|
|
183
|
-
pool: "floor_plans",
|
|
184
318
|
row: {
|
|
185
319
|
id: { value_type: "text" },
|
|
186
320
|
floor_label: { value_type: "text" },
|
|
@@ -190,42 +324,39 @@ const COLLECTION_FACTS = {
|
|
|
190
324
|
unit_label: {
|
|
191
325
|
path: "unit_label",
|
|
192
326
|
value_type: "text",
|
|
193
|
-
|
|
327
|
+
primary: true,
|
|
194
328
|
writeback: { column: "unit_label" }
|
|
195
329
|
},
|
|
196
330
|
beds: {
|
|
197
331
|
path: "beds",
|
|
198
332
|
value_type: "number",
|
|
199
|
-
|
|
333
|
+
primary: true,
|
|
200
334
|
writeback: { column: "beds" }
|
|
201
335
|
},
|
|
202
336
|
baths: {
|
|
203
337
|
path: "baths",
|
|
204
338
|
value_type: "number",
|
|
205
|
-
|
|
339
|
+
primary: true,
|
|
206
340
|
writeback: { column: "baths" }
|
|
207
341
|
},
|
|
208
342
|
sqft: {
|
|
209
343
|
path: "sqft",
|
|
210
344
|
value_type: "number",
|
|
211
|
-
|
|
345
|
+
primary: true,
|
|
212
346
|
writeback: { column: "sqft" }
|
|
213
347
|
},
|
|
214
348
|
price: {
|
|
215
349
|
path: "price",
|
|
216
350
|
value_type: "text",
|
|
217
|
-
|
|
351
|
+
primary: true,
|
|
218
352
|
writeback: { column: "price" }
|
|
219
353
|
}
|
|
220
354
|
}
|
|
221
355
|
},
|
|
222
356
|
comparables: {
|
|
223
357
|
role: "bindable",
|
|
224
|
-
path: "comparables",
|
|
225
358
|
container: "property",
|
|
226
359
|
value_type: "comparable_list",
|
|
227
|
-
input_group: "comparables",
|
|
228
|
-
strength: "blocking",
|
|
229
360
|
row: {
|
|
230
361
|
id: {
|
|
231
362
|
path: "id",
|
|
@@ -233,8 +364,7 @@ const COLLECTION_FACTS = {
|
|
|
233
364
|
},
|
|
234
365
|
address_street: {
|
|
235
366
|
path: "address_street",
|
|
236
|
-
value_type: "text"
|
|
237
|
-
required: true
|
|
367
|
+
value_type: "text"
|
|
238
368
|
},
|
|
239
369
|
address_city: {
|
|
240
370
|
path: "address_city",
|
|
@@ -254,13 +384,11 @@ const COLLECTION_FACTS = {
|
|
|
254
384
|
},
|
|
255
385
|
lat: {
|
|
256
386
|
path: "lat",
|
|
257
|
-
value_type: "number"
|
|
258
|
-
required: true
|
|
387
|
+
value_type: "number"
|
|
259
388
|
},
|
|
260
389
|
lng: {
|
|
261
390
|
path: "lng",
|
|
262
|
-
value_type: "number"
|
|
263
|
-
required: true
|
|
391
|
+
value_type: "number"
|
|
264
392
|
},
|
|
265
393
|
distance_m: {
|
|
266
394
|
path: "distance_m",
|
|
@@ -273,7 +401,6 @@ const COLLECTION_FACTS = {
|
|
|
273
401
|
price: {
|
|
274
402
|
path: "price",
|
|
275
403
|
value_type: "number",
|
|
276
|
-
required: true,
|
|
277
404
|
writeback: { column: "price" }
|
|
278
405
|
},
|
|
279
406
|
price_period: {
|
|
@@ -288,19 +415,16 @@ const COLLECTION_FACTS = {
|
|
|
288
415
|
beds: {
|
|
289
416
|
path: "beds",
|
|
290
417
|
value_type: "number",
|
|
291
|
-
required: true,
|
|
292
418
|
writeback: { column: "beds" }
|
|
293
419
|
},
|
|
294
420
|
baths: {
|
|
295
421
|
path: "baths",
|
|
296
422
|
value_type: "number",
|
|
297
|
-
required: true,
|
|
298
423
|
writeback: { column: "baths" }
|
|
299
424
|
},
|
|
300
425
|
sqft: {
|
|
301
426
|
path: "sqft",
|
|
302
427
|
value_type: "number",
|
|
303
|
-
required: true,
|
|
304
428
|
writeback: { column: "sqft" }
|
|
305
429
|
},
|
|
306
430
|
photo: {
|
|
@@ -342,20 +466,13 @@ const COLLECTION_FACTS = {
|
|
|
342
466
|
description: {
|
|
343
467
|
path: "description",
|
|
344
468
|
value_type: "text"
|
|
345
|
-
},
|
|
346
|
-
property_type: {
|
|
347
|
-
path: "property_type",
|
|
348
|
-
value_type: "text"
|
|
349
469
|
}
|
|
350
470
|
}
|
|
351
471
|
},
|
|
352
472
|
contacts: {
|
|
353
473
|
role: "bindable",
|
|
354
|
-
path: "contacts",
|
|
355
474
|
container: "property",
|
|
356
475
|
value_type: "contact_list",
|
|
357
|
-
input_group: "contacts",
|
|
358
|
-
strength: "blocking",
|
|
359
476
|
row: {
|
|
360
477
|
id: {
|
|
361
478
|
path: "id",
|
|
@@ -368,92 +485,88 @@ const COLLECTION_FACTS = {
|
|
|
368
485
|
name: {
|
|
369
486
|
path: "name",
|
|
370
487
|
value_type: "text",
|
|
371
|
-
|
|
488
|
+
primary: true,
|
|
372
489
|
writeback: { column: "name" }
|
|
373
490
|
},
|
|
374
491
|
title: {
|
|
375
492
|
path: "title",
|
|
376
493
|
value_type: "text",
|
|
377
|
-
|
|
494
|
+
primary: true,
|
|
378
495
|
writeback: { column: "title" }
|
|
379
496
|
},
|
|
380
497
|
org_name: {
|
|
381
498
|
path: "org_name",
|
|
382
499
|
value_type: "text",
|
|
383
|
-
|
|
500
|
+
primary: true,
|
|
384
501
|
writeback: { column: "org_name" }
|
|
385
502
|
},
|
|
386
503
|
bio: {
|
|
387
504
|
path: "bio",
|
|
388
505
|
value_type: "text",
|
|
389
|
-
|
|
506
|
+
primary: true,
|
|
390
507
|
writeback: { column: "bio" }
|
|
391
508
|
},
|
|
392
509
|
address: {
|
|
393
510
|
path: "address",
|
|
394
511
|
value_type: "text",
|
|
395
|
-
|
|
396
|
-
writeback: { column: "address" }
|
|
512
|
+
primary: true
|
|
397
513
|
},
|
|
398
514
|
email: {
|
|
399
515
|
path: "email",
|
|
400
516
|
value_type: "text",
|
|
401
|
-
|
|
517
|
+
primary: true,
|
|
402
518
|
writeback: { column: "email" }
|
|
403
519
|
},
|
|
404
520
|
phone: {
|
|
405
521
|
path: "phone",
|
|
406
522
|
value_type: "text",
|
|
407
|
-
|
|
523
|
+
primary: true,
|
|
408
524
|
writeback: { column: "phone" }
|
|
409
525
|
},
|
|
410
526
|
website: {
|
|
411
527
|
path: "website_url",
|
|
412
528
|
value_type: "text",
|
|
413
|
-
|
|
529
|
+
primary: true,
|
|
414
530
|
writeback: { column: "website" }
|
|
415
531
|
},
|
|
416
532
|
instagram: {
|
|
417
533
|
path: "instagram_url",
|
|
418
534
|
value_type: "text",
|
|
419
|
-
|
|
535
|
+
primary: true,
|
|
420
536
|
writeback: { column: "socials.instagram" }
|
|
421
537
|
},
|
|
422
538
|
linkedin: {
|
|
423
539
|
path: "linkedin_url",
|
|
424
540
|
value_type: "text",
|
|
425
|
-
|
|
541
|
+
primary: true,
|
|
426
542
|
writeback: { column: "socials.linkedin" }
|
|
427
543
|
},
|
|
428
544
|
x: {
|
|
429
545
|
path: "x_url",
|
|
430
546
|
value_type: "text",
|
|
431
|
-
|
|
547
|
+
primary: true,
|
|
432
548
|
writeback: { column: "socials.x" }
|
|
433
549
|
},
|
|
434
550
|
facebook: {
|
|
435
551
|
path: "facebook_url",
|
|
436
552
|
value_type: "text",
|
|
437
|
-
|
|
553
|
+
primary: true,
|
|
438
554
|
writeback: { column: "socials.facebook" }
|
|
439
555
|
},
|
|
440
556
|
headshot: {
|
|
441
557
|
path: "avatar_upload_id",
|
|
442
558
|
value_type: "image",
|
|
443
|
-
|
|
444
|
-
pool: "library"
|
|
559
|
+
primary: true
|
|
445
560
|
},
|
|
446
561
|
logo_dark: {
|
|
447
562
|
path: "logo_dark_upload_id",
|
|
448
563
|
value_type: "image",
|
|
449
|
-
|
|
450
|
-
pool: "library"
|
|
564
|
+
primary: true
|
|
451
565
|
},
|
|
452
566
|
logo_light: {
|
|
453
567
|
path: "logo_light_upload_id",
|
|
454
568
|
value_type: "image",
|
|
455
|
-
|
|
456
|
-
pool: "library"
|
|
569
|
+
primary: true
|
|
457
570
|
}
|
|
458
571
|
}
|
|
459
572
|
}
|
|
@@ -462,92 +575,7 @@ const READABLE_FACTS = {
|
|
|
462
575
|
description: {
|
|
463
576
|
role: "readable",
|
|
464
577
|
path: "narrative.description",
|
|
465
|
-
value_type: "text"
|
|
466
|
-
input_group: "describe",
|
|
467
|
-
strength: "optional"
|
|
468
|
-
},
|
|
469
|
-
photos: {
|
|
470
|
-
role: "readable",
|
|
471
|
-
path: "photos",
|
|
472
|
-
value_type: "row_list",
|
|
473
|
-
input_group: "uploads",
|
|
474
|
-
strength: "optional",
|
|
475
|
-
row: {
|
|
476
|
-
id: { value_type: "text" },
|
|
477
|
-
tags: { value_type: "text_list" },
|
|
478
|
-
caption: { value_type: "text" }
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
videos: {
|
|
482
|
-
role: "readable",
|
|
483
|
-
path: "videos",
|
|
484
|
-
value_type: "row_list",
|
|
485
|
-
input_group: "uploads",
|
|
486
|
-
strength: "optional",
|
|
487
|
-
row: {
|
|
488
|
-
id: { value_type: "text" },
|
|
489
|
-
source: { value_type: "text" },
|
|
490
|
-
tags: { value_type: "text_list" },
|
|
491
|
-
caption: { value_type: "text" },
|
|
492
|
-
description: { value_type: "text" },
|
|
493
|
-
duration_ms: { value_type: "number" },
|
|
494
|
-
url: { value_type: "text" },
|
|
495
|
-
provider: { value_type: "text" }
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
tours: {
|
|
499
|
-
role: "readable",
|
|
500
|
-
path: "tours",
|
|
501
|
-
value_type: "row_list",
|
|
502
|
-
input_group: "uploads",
|
|
503
|
-
strength: "optional",
|
|
504
|
-
row: {
|
|
505
|
-
id: { value_type: "text" },
|
|
506
|
-
url: { value_type: "text" },
|
|
507
|
-
provider: { value_type: "text" }
|
|
508
|
-
}
|
|
509
|
-
},
|
|
510
|
-
floor_plans: {
|
|
511
|
-
role: "readable",
|
|
512
|
-
path: "floor_plans",
|
|
513
|
-
value_type: "row_list",
|
|
514
|
-
input_group: "uploads",
|
|
515
|
-
strength: "optional",
|
|
516
|
-
row: {
|
|
517
|
-
id: { value_type: "text" },
|
|
518
|
-
unit_assignments: {
|
|
519
|
-
value_type: "row_list",
|
|
520
|
-
row: {
|
|
521
|
-
unit_label: { value_type: "text" },
|
|
522
|
-
floor_label: { value_type: "text" },
|
|
523
|
-
position: { value_type: "number" }
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
documents: {
|
|
529
|
-
role: "readable",
|
|
530
|
-
path: "documents",
|
|
531
|
-
value_type: "row_list",
|
|
532
|
-
input_group: "uploads",
|
|
533
|
-
strength: "optional",
|
|
534
|
-
row: {
|
|
535
|
-
id: { value_type: "text" },
|
|
536
|
-
filename: { value_type: "text" },
|
|
537
|
-
mime: { value_type: "text" },
|
|
538
|
-
notes: { value_type: "text" }
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
document_notes: {
|
|
542
|
-
role: "readable",
|
|
543
|
-
path: "document_notes",
|
|
544
|
-
value_type: "row_list",
|
|
545
|
-
input_group: "uploads",
|
|
546
|
-
strength: "optional",
|
|
547
|
-
row: {
|
|
548
|
-
upload_id: { value_type: "text" },
|
|
549
|
-
notes: { value_type: "text" }
|
|
550
|
-
}
|
|
578
|
+
value_type: "text"
|
|
551
579
|
},
|
|
552
580
|
unit: {
|
|
553
581
|
role: "readable",
|
|
@@ -563,18 +591,15 @@ const READABLE_FACTS = {
|
|
|
563
591
|
}
|
|
564
592
|
};
|
|
565
593
|
function primaryRowFacts(container) {
|
|
566
|
-
const
|
|
594
|
+
const table = TABLE_FACTS[READABLE_FACTS[container].primary_of];
|
|
567
595
|
const aliases = FACT_PROJECTIONS[container] ?? {};
|
|
568
596
|
const facts = {};
|
|
569
|
-
for (const [name, member] of Object.entries(
|
|
570
|
-
if (member.
|
|
597
|
+
for (const [name, member] of Object.entries(table.row)) {
|
|
598
|
+
if (member.primary !== true) continue;
|
|
571
599
|
const fact = {
|
|
572
600
|
role: "bindable",
|
|
573
|
-
path: `${collection.path}[].${member.path}`,
|
|
574
601
|
container,
|
|
575
|
-
value_type: member.value_type
|
|
576
|
-
input_group: collection.input_group,
|
|
577
|
-
strength: member.strength
|
|
602
|
+
value_type: member.value_type
|
|
578
603
|
};
|
|
579
604
|
if (member.value_type === "image") fact.image = true;
|
|
580
605
|
if (member.writeback !== void 0) fact.writeback = container === "unit" ? {
|
|
@@ -592,7 +617,7 @@ function composeFactGraph() {
|
|
|
592
617
|
return {
|
|
593
618
|
...PROPERTY_ROOT_FACTS,
|
|
594
619
|
...primaryRowFacts("unit"),
|
|
595
|
-
...
|
|
620
|
+
...TABLE_FACTS,
|
|
596
621
|
...primaryRowFacts("contact"),
|
|
597
622
|
...READABLE_FACTS
|
|
598
623
|
};
|
|
@@ -613,14 +638,11 @@ function projectBindableFacts(graph) {
|
|
|
613
638
|
return projected;
|
|
614
639
|
}
|
|
615
640
|
const SOURCE_FIELDS = /* @__PURE__ */ projectBindableFacts(FACT_GRAPH);
|
|
616
|
-
function isWritableSourceField(field) {
|
|
617
|
-
return SOURCE_FIELDS[field]?.writeback !== void 0;
|
|
618
|
-
}
|
|
619
641
|
const OPTION_SOURCES = ["listing_intent"];
|
|
620
642
|
function isOptionSource(value) {
|
|
621
643
|
return OPTION_SOURCES.includes(value);
|
|
622
644
|
}
|
|
623
|
-
const
|
|
645
|
+
const TABLES = {
|
|
624
646
|
units: {
|
|
625
647
|
idKey: "unit_id",
|
|
626
648
|
ownership: "property"
|
|
@@ -636,23 +658,51 @@ const COLLECTIONS = {
|
|
|
636
658
|
ownership: "property"
|
|
637
659
|
}
|
|
638
660
|
};
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
661
|
+
const REGISTRY_TABLE_KEYS = {
|
|
662
|
+
units: "property.units",
|
|
663
|
+
contacts: "property.contacts",
|
|
664
|
+
comparables: "property.comparables",
|
|
665
|
+
commercial_spaces: "property.commercial_spaces"
|
|
666
|
+
};
|
|
667
|
+
const LIBRARY_TABLE_KEYS = { contacts: "library.contacts" };
|
|
668
|
+
function isLegacyTable(table) {
|
|
669
|
+
return Object.hasOwn(TABLES, table);
|
|
670
|
+
}
|
|
671
|
+
const TABLE_OF_REGISTRY_KEY = /* @__PURE__ */ Object.fromEntries([...Object.entries(REGISTRY_TABLE_KEYS), ...Object.entries(LIBRARY_TABLE_KEYS)].map(([table, key]) => [key, table]));
|
|
672
|
+
function tableKeyOf(key) {
|
|
673
|
+
if (typeof key !== "string") return null;
|
|
674
|
+
if (Object.hasOwn(TABLES, key)) return {
|
|
675
|
+
table: key,
|
|
676
|
+
reading: "legacy"
|
|
677
|
+
};
|
|
678
|
+
const table = Object.hasOwn(TABLE_OF_REGISTRY_KEY, key) ? TABLE_OF_REGISTRY_KEY[key] : void 0;
|
|
679
|
+
return table === void 0 ? null : {
|
|
680
|
+
table,
|
|
681
|
+
reading: "registry"
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function tableKeyOfSource(source) {
|
|
685
|
+
return source?.kind === "home" ? tableKeyOf(source.key) : null;
|
|
686
|
+
}
|
|
687
|
+
function tableForSlot(slot) {
|
|
688
|
+
return tableKeyOfSource(slot.source)?.table ?? null;
|
|
689
|
+
}
|
|
690
|
+
function rowMemberWriteback(table, member) {
|
|
691
|
+
return FACT_GRAPH[table].row[member]?.writeback ?? null;
|
|
643
692
|
}
|
|
644
|
-
function
|
|
645
|
-
|
|
693
|
+
function tableBounds(field) {
|
|
694
|
+
if (!isLegacyTable(field)) return {};
|
|
695
|
+
const entry = TABLES[field];
|
|
646
696
|
return {
|
|
647
697
|
...entry.min !== void 0 ? { min: entry.min } : {},
|
|
648
698
|
...entry.cap !== void 0 ? { max: entry.cap } : {}
|
|
649
699
|
};
|
|
650
700
|
}
|
|
651
|
-
function
|
|
701
|
+
function stampTableBounds(slots) {
|
|
652
702
|
for (const slot of Object.values(slots)) {
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
655
|
-
const inherited =
|
|
703
|
+
const table = tableForSlot(slot);
|
|
704
|
+
if (table === null) continue;
|
|
705
|
+
const inherited = tableBounds(table);
|
|
656
706
|
if (slot.min === void 0 && inherited.min !== void 0) slot.min = inherited.min;
|
|
657
707
|
if (slot.max === void 0 && inherited.max !== void 0) slot.max = inherited.max;
|
|
658
708
|
}
|
|
@@ -680,6 +730,43 @@ const LINK_PROVIDERS = {
|
|
|
680
730
|
pattern: /(^|\.)biganto\.com$/i,
|
|
681
731
|
strategy: "opengraph"
|
|
682
732
|
},
|
|
733
|
+
iguide: {
|
|
734
|
+
kind: "tour",
|
|
735
|
+
label: "iGUIDE",
|
|
736
|
+
pattern: /(^|\.)youriguide\.com$/i,
|
|
737
|
+
strategy: "opengraph"
|
|
738
|
+
},
|
|
739
|
+
kuula: {
|
|
740
|
+
kind: "tour",
|
|
741
|
+
label: "Kuula",
|
|
742
|
+
pattern: /(^|\.)kuula\.co$/i,
|
|
743
|
+
strategy: "opengraph"
|
|
744
|
+
},
|
|
745
|
+
momento360: {
|
|
746
|
+
kind: "tour",
|
|
747
|
+
label: "Momento360",
|
|
748
|
+
pattern: /(^|\.)momento360\.com$/i,
|
|
749
|
+
strategy: "opengraph"
|
|
750
|
+
},
|
|
751
|
+
cloudpano: {
|
|
752
|
+
kind: "tour",
|
|
753
|
+
label: "CloudPano",
|
|
754
|
+
pattern: /(^|\.)cloudpano\.com$/i,
|
|
755
|
+
strategy: "none"
|
|
756
|
+
},
|
|
757
|
+
asteroom: {
|
|
758
|
+
kind: "tour",
|
|
759
|
+
label: "Asteroom",
|
|
760
|
+
pattern: /(^|\.)asteroom\.com$/i,
|
|
761
|
+
strategy: "none"
|
|
762
|
+
},
|
|
763
|
+
zillow3d: {
|
|
764
|
+
kind: "tour",
|
|
765
|
+
label: "Zillow 3D Home",
|
|
766
|
+
pattern: /(^|\.)zillow\.com$/i,
|
|
767
|
+
path: /^\/view-3d-home\//i,
|
|
768
|
+
strategy: "none"
|
|
769
|
+
},
|
|
683
770
|
youtube: {
|
|
684
771
|
kind: "video",
|
|
685
772
|
label: "YouTube",
|
|
@@ -748,7 +835,19 @@ function acceptsLink(accepts, url) {
|
|
|
748
835
|
if (id === accepts) return true;
|
|
749
836
|
return LINK_KINDS.includes(accepts) && LINK_PROVIDERS[id].kind === accepts;
|
|
750
837
|
}
|
|
751
|
-
|
|
838
|
+
function isIsoDateValue(value) {
|
|
839
|
+
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return false;
|
|
840
|
+
const day = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
|
|
841
|
+
return !Number.isNaN(day.getTime()) && day.toISOString().slice(0, 10) === value;
|
|
842
|
+
}
|
|
843
|
+
function isEmailValue(value) {
|
|
844
|
+
return typeof value === "string" && /^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/.test(value);
|
|
845
|
+
}
|
|
846
|
+
function isPhoneValue(value) {
|
|
847
|
+
if (typeof value !== "string" || !/^\+?[\d\s().-]+$/.test(value)) return false;
|
|
848
|
+
const digits = value.replace(/\D/g, "").length;
|
|
849
|
+
return digits >= 7 && digits <= 15;
|
|
850
|
+
}
|
|
752
851
|
const VIMEO_PARAMS = "badge=0&autopause=0&player_id=0&title=0&byline=0&portrait=0&sidedock=0&vimeo_logo=0&pip=0&chromecast=0&quality_selector=0&progress_bar=1";
|
|
753
852
|
function videoEmbedUrl(raw) {
|
|
754
853
|
const url = raw.trim();
|
|
@@ -772,9 +871,18 @@ function tourEmbedUrl(raw) {
|
|
|
772
871
|
const sid = new URL(url).searchParams.get("m");
|
|
773
872
|
return sid !== null && /^[A-Za-z0-9]+$/.test(sid) ? `https://my.matterport.com/show/?m=${sid}&nt=1` : null;
|
|
774
873
|
}
|
|
775
|
-
if (provider
|
|
874
|
+
if (provider !== null && PASSTHROUGH_TOUR_PROVIDERS.has(provider)) return url;
|
|
776
875
|
return null;
|
|
777
876
|
}
|
|
877
|
+
const PASSTHROUGH_TOUR_PROVIDERS = /* @__PURE__ */ new Set([
|
|
878
|
+
"biganto",
|
|
879
|
+
"iguide",
|
|
880
|
+
"kuula",
|
|
881
|
+
"momento360",
|
|
882
|
+
"cloudpano",
|
|
883
|
+
"asteroom",
|
|
884
|
+
"zillow3d"
|
|
885
|
+
]);
|
|
778
886
|
|
|
779
887
|
//#endregion
|
|
780
|
-
export {
|
|
888
|
+
export { CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, FACT_GRAPH, FACT_PROJECTIONS, HOLDER_PROCESS_VERBS, LIBRARY_TABLE_KEYS, LINK_KINDS, LINK_PROVIDERS, LIST_SLOT_TYPES, MEDIA_KINDS, OBJECT_BINDING_OWN_KEYS, OPTION_SOURCES, PROCESS_CATALOG, PROCESS_VERBS, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, REF_SLOT_TYPES, REGISTRY_TABLE_KEYS, SLOT_TYPES, SOURCE_FIELDS, TABLES, VISIBILITY_CASES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isLegacyTable, isLinkAccepts, isListSlotType, isMediaKind, isMediaType, isOptionSource, isPhoneValue, isProcessVerb, matchLinkProvider, mediaDeclarationProblem, processBindingOf, processOptionsProblem, rowMemberWriteback, stampTableBounds, tableBounds, tableForSlot, tableKeyOf, tableKeyOfSource, tourEmbedUrl, videoEmbedUrl };
|