@homepages/concrete 5.0.0 → 6.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.
Files changed (269) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/README.md +28 -17
  3. package/codemods/fill-is-a-source.mjs +533 -0
  4. package/codemods/manifest.json +12 -0
  5. package/codemods/reads-replace-reconcile.mjs +285 -0
  6. package/dist/artifact/playground/client/assets/{index-D1fwOGVK.js → index-u3T7DiSN.js} +96 -96
  7. package/dist/artifact/playground/client/index.html +1 -1
  8. package/dist/artifact/playground/host.mjs +23 -23
  9. package/dist/base.css +3 -8
  10. package/dist/browser/site-config.js +1 -16
  11. package/dist/browser/submit-lead.js +0 -31
  12. package/dist/cli/build/artifact.js +16 -23
  13. package/dist/cli/build/captures.js +0 -6
  14. package/dist/cli/build/esbuild.js +0 -17
  15. package/dist/cli/build/fixtures.js +15 -30
  16. package/dist/cli/build/icons.js +0 -3
  17. package/dist/cli/build/index.js +1 -1
  18. package/dist/cli/build/playground.js +4 -8
  19. package/dist/cli/build/sections.js +9 -30
  20. package/dist/cli/build/source.js +52 -27
  21. package/dist/cli/build/static.js +4 -25
  22. package/dist/cli/capture/bundle.js +0 -9
  23. package/dist/cli/capture/capture-browser.js +0 -14
  24. package/dist/cli/capture/capture.js +1 -8
  25. package/dist/cli/check/analyze.js +2 -5
  26. package/dist/cli/check/index.js +1 -1
  27. package/dist/cli/check/line-endings.js +52 -0
  28. package/dist/cli/check/load-workspace.js +3 -8
  29. package/dist/cli/check/portable-names.js +48 -0
  30. package/dist/cli/check/render/class-conflicts.js +0 -5
  31. package/dist/cli/check/render/html.js +0 -1
  32. package/dist/cli/check/render/invariants.js +0 -5
  33. package/dist/cli/check/render/island-frames.js +0 -25
  34. package/dist/cli/check/render/marker-coverage.js +0 -20
  35. package/dist/cli/check/render/nav.js +0 -33
  36. package/dist/cli/check/report.js +0 -3
  37. package/dist/cli/check/stages/bundles.js +1 -9
  38. package/dist/cli/check/stages/composition.js +3 -2
  39. package/dist/cli/check/stages/dependencies.js +7 -38
  40. package/dist/cli/check/stages/fixtures.js +3 -31
  41. package/dist/cli/check/stages/lint.js +2 -2
  42. package/dist/cli/check/stages/logic.js +3 -34
  43. package/dist/cli/check/stages/relations.js +46 -0
  44. package/dist/cli/check/stages/render.js +0 -1
  45. package/dist/cli/check/stages/sections.js +3 -3
  46. package/dist/cli/check/stages/stylesheet.js +1 -1
  47. package/dist/cli/check/stages/typecheck.js +5 -11
  48. package/dist/cli/check/stages/workspace.js +36 -14
  49. package/dist/cli/commands.js +9 -56
  50. package/dist/cli/currency/cache.js +4 -17
  51. package/dist/cli/currency/decide.js +0 -14
  52. package/dist/cli/currency/opt-out.js +0 -7
  53. package/dist/cli/currency/preamble.js +3 -24
  54. package/dist/cli/currency/prompt.js +0 -1
  55. package/dist/cli/currency/refresh.js +5 -12
  56. package/dist/cli/currency/resolve-latest.js +3 -64
  57. package/dist/cli/currency/version-order.js +0 -12
  58. package/dist/cli/dev/crop.js +0 -2
  59. package/dist/cli/dev/http.js +0 -13
  60. package/dist/cli/dev/index.js +3 -4
  61. package/dist/cli/dev/islands.js +25 -70
  62. package/dist/cli/dev/listen.js +26 -0
  63. package/dist/cli/dev/load-template.js +0 -1
  64. package/dist/cli/dev/request-error.js +0 -4
  65. package/dist/cli/dev/server.js +46 -52
  66. package/dist/cli/dev/tsconfig-paths.js +0 -13
  67. package/dist/cli/dev/vite.js +9 -38
  68. package/dist/cli/dev/workspace-reader.js +4 -34
  69. package/dist/cli/media/cache.js +4 -51
  70. package/dist/cli/media/derive.js +2 -94
  71. package/dist/cli/media/deriver-plugin.js +0 -2
  72. package/dist/cli/media/frame-rung-floor.js +0 -6
  73. package/dist/cli/property/index.js +0 -4
  74. package/dist/cli/property/library.js +6 -24
  75. package/dist/cli/publish/client.js +0 -1
  76. package/dist/cli/publish/freshness.js +0 -2
  77. package/dist/cli/publish/git.js +2 -8
  78. package/dist/cli/publish/index.js +8 -15
  79. package/dist/cli/publish/pack.js +5 -6
  80. package/dist/cli/publish/report.js +0 -6
  81. package/dist/cli/publish/target.js +16 -13
  82. package/dist/cli/publish/wire.js +0 -6
  83. package/dist/cli/tar.js +2 -9
  84. package/dist/cli/upgrade/codemod.js +0 -8
  85. package/dist/cli/upgrade/index.js +0 -24
  86. package/dist/cli/upgrade/manifest.js +0 -12
  87. package/dist/cli/upgrade/plan.js +0 -17
  88. package/dist/cli/upgrade/stage.js +12 -15
  89. package/dist/cli/version.js +0 -8
  90. package/dist/cli/workspace.js +2 -34
  91. package/dist/cli.js +4 -21
  92. package/dist/css/compile.js +25 -28
  93. package/dist/css/graph.js +3 -10
  94. package/dist/css/inline.js +3 -13
  95. package/dist/css/rules.js +6 -43
  96. package/dist/design-system/format-variants.js +0 -22
  97. package/dist/eslint/authoring.js +0 -2
  98. package/dist/eslint/correctness.js +0 -7
  99. package/dist/eslint/rules/editor-reason.js +0 -11
  100. package/dist/eslint/rules/island-ids.js +0 -1
  101. package/dist/eslint/rules/jsx-visitor.js +0 -13
  102. package/dist/eslint/rules/no-editor-globals.js +0 -2
  103. package/dist/eslint/rules/no-raw-values.js +0 -1
  104. package/dist/fixtures/brand.js +0 -1
  105. package/dist/fixtures/bundle-rule.js +4 -9
  106. package/dist/fixtures/canonical.d.ts +20 -0
  107. package/dist/fixtures/image-dimensions.js +0 -1
  108. package/dist/fixtures/load.js +8 -17
  109. package/dist/fixtures/media-plugin.js +4 -31
  110. package/dist/fixtures/media.js +0 -21
  111. package/dist/fixtures/package-stylesheets.js +0 -6
  112. package/dist/fixtures/property.js +16 -15
  113. package/dist/fixtures/resolve.js +102 -29
  114. package/dist/fixtures/rows.js +12 -11
  115. package/dist/fixtures/synthesize-empties.js +0 -4
  116. package/dist/fixtures.d.ts +19 -4
  117. package/dist/fixtures.js +0 -18
  118. package/dist/index.d.ts +8 -9
  119. package/dist/index.js +2 -11
  120. package/dist/islands/client-module.js +0 -11
  121. package/dist/islands/marker.js +0 -33
  122. package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +0 -20
  123. package/dist/packages/external/concrete/package.js +1 -1
  124. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +21 -35
  125. package/dist/packages/internal/fill-bake/dist/compute-reads.js +4 -0
  126. package/dist/packages/internal/fill-bake/dist/derive-source.js +40 -0
  127. package/dist/packages/internal/fill-bake/dist/display.js +0 -1
  128. package/dist/packages/internal/fill-bake/dist/index.js +4 -4
  129. package/dist/packages/internal/fill-vocabulary/dist/origination.js +106 -0
  130. package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -49
  131. package/dist/packages/internal/format-geometry/dist/capture.js +10 -240
  132. package/dist/packages/internal/format-geometry/dist/geometry.js +0 -6
  133. package/dist/packages/internal/image-ladder/dist/crop.js +0 -12
  134. package/dist/packages/internal/image-ladder/dist/policy.js +0 -14
  135. package/dist/packages/internal/island-runtime/dist/capture-holds.js +0 -13
  136. package/dist/packages/internal/island-runtime/dist/contract.js +0 -34
  137. package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +0 -1
  138. package/dist/packages/internal/island-runtime/dist/index.js +0 -34
  139. package/dist/packages/internal/island-runtime/dist/island-id-context.js +0 -1
  140. package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +0 -15
  141. package/dist/packages/internal/island-runtime/dist/use-editor.js +0 -10
  142. package/dist/packages/internal/island-runtime/dist/use-island-id.js +0 -32
  143. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +2 -17
  144. package/dist/packages/internal/property-facts/dist/index.js +1 -1
  145. package/dist/packages/internal/property-facts/dist/{property-facts-CSdkSuD7.js → property-facts-5pxZnlkh.js} +13 -2
  146. package/dist/packages/internal/section-contracts/dist/cap-contract.js +1 -18
  147. package/dist/packages/internal/section-contracts/dist/catalog.js +16 -8
  148. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +12 -16
  149. package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +5 -11
  150. package/dist/packages/internal/section-contracts/dist/display-contract.js +2 -0
  151. package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +2 -8
  152. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +13 -0
  153. package/dist/packages/internal/section-contracts/dist/index.js +2 -1
  154. package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +16 -42
  155. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +24 -43
  156. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +11 -18
  157. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +10 -12
  158. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +3 -13
  159. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +6 -18
  160. package/dist/packages/internal/section-contracts/dist/runners.js +21 -13
  161. package/dist/packages/internal/section-contracts/dist/source-contract.js +13 -2
  162. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +31 -0
  163. package/dist/packages/internal/source-resolution/dist/index.js +1 -9
  164. package/dist/packages/internal/template-artifact/dist/hash.js +0 -8
  165. package/dist/packages/internal/template-artifact/dist/index.js +1 -1
  166. package/dist/packages/internal/template-artifact/dist/layout.js +0 -39
  167. package/dist/packages/internal/template-artifact/dist/manifest.js +1 -9
  168. package/dist/packages/internal/template-artifact/dist/sha256.js +0 -1
  169. package/dist/packages/internal/template-artifact/dist/verify.js +2 -4
  170. package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -16
  171. package/dist/packages/internal/template-contracts/dist/content-categories.js +0 -4
  172. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +16 -10
  173. package/dist/packages/internal/template-contracts/dist/facts-view.js +15 -28
  174. package/dist/packages/internal/template-contracts/dist/layout.js +0 -7
  175. package/dist/packages/internal/template-contracts/dist/markers.js +0 -29
  176. package/dist/packages/internal/template-contracts/dist/select-key.js +0 -6
  177. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +56 -34
  178. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +22 -389
  179. package/dist/platform/file-url.js +8 -0
  180. package/dist/platform/fs.js +73 -0
  181. package/dist/platform/names.js +63 -0
  182. package/dist/platform/order.js +7 -0
  183. package/dist/platform/paths.js +62 -0
  184. package/dist/platform/process.js +97 -0
  185. package/dist/playground/host/page-state.js +0 -2
  186. package/dist/playground/host/paths.js +0 -1
  187. package/dist/playground/layout.js +0 -7
  188. package/dist/playground/wire.js +0 -8
  189. package/dist/primitives/FrameShell.js +0 -18
  190. package/dist/primitives/Image.d.ts +5 -1
  191. package/dist/primitives/Image.js +2 -68
  192. package/dist/primitives/Section.js +0 -13
  193. package/dist/primitives/Tour.js +0 -26
  194. package/dist/primitives/Video.js +0 -32
  195. package/dist/primitives/embed-playback.js +0 -1
  196. package/dist/primitives/marker-attrs.js +0 -17
  197. package/dist/primitives/picture-sources.js +6 -1
  198. package/dist/primitives/probe-context.js +0 -7
  199. package/dist/primitives/slot-bindings.js +0 -46
  200. package/dist/primitives/slot-document.js +0 -11
  201. package/dist/primitives/slot-group.js +0 -9
  202. package/dist/primitives/slot-media.js +0 -27
  203. package/dist/primitives/slot-scalar.js +0 -4
  204. package/dist/primitives/slot.js +0 -6
  205. package/dist/rules/registry.js +42 -24
  206. package/dist/schema/compute.d.ts +46 -8
  207. package/dist/schema/compute.js +21 -15
  208. package/dist/schema/define-schema.d.ts +1 -1
  209. package/dist/schema/define-schema.js +37 -17
  210. package/dist/schema/extract-fill-spec.js +93 -180
  211. package/dist/schema/extract-used-facts.js +16 -158
  212. package/dist/schema/fact.d.ts +25 -12
  213. package/dist/schema/fact.js +7 -11
  214. package/dist/schema/fill-builders.d.ts +91 -366
  215. package/dist/schema/fill-builders.js +21 -259
  216. package/dist/schema/fill-declaration.d.ts +7 -69
  217. package/dist/schema/fill-declaration.js +5 -34
  218. package/dist/schema/fill-spec.js +59 -148
  219. package/dist/schema/format-presets.js +0 -12
  220. package/dist/schema/format.js +0 -7
  221. package/dist/schema/layout.js +0 -10
  222. package/dist/schema/manifest.js +0 -39
  223. package/dist/schema/property-facts.d.ts +20 -0
  224. package/dist/schema/section-nav.js +0 -15
  225. package/dist/schema/section-schema.d.ts +0 -1
  226. package/dist/schema/section-schema.js +4 -20
  227. package/dist/schema/slot-builders.d.ts +128 -117
  228. package/dist/schema/slot-builders.js +18 -201
  229. package/dist/schema/slot-ref.d.ts +63 -0
  230. package/dist/schema/slot-ref.js +33 -0
  231. package/dist/schema/slot-types.d.ts +3 -2
  232. package/dist/schema/slot-types.js +11 -20
  233. package/dist/section/declare.d.ts +14 -10
  234. package/dist/section/declare.js +13 -2
  235. package/dist/section/discovery.js +6 -21
  236. package/dist/section/groups.js +0 -6
  237. package/dist/section/materialize.js +0 -5
  238. package/dist/section/placements.js +0 -4
  239. package/dist/section/section.d.ts +8 -5
  240. package/dist/section/section.js +7 -29
  241. package/dist/styles.css +5 -0
  242. package/dist/template/define-template.d.ts +0 -4
  243. package/dist/template/define-template.js +1 -15
  244. package/dist/template/logic-build.js +8 -35
  245. package/dist/template/logic-shim.d.ts +4 -5
  246. package/dist/template/logic-shim.js +2 -6
  247. package/dist/template/logic-transform.js +0 -6
  248. package/dist/template/materialize.js +52 -43
  249. package/dist/template/mirror-types.js +43 -0
  250. package/dist/template/running-copy.js +5 -20
  251. package/dist/template/section-reads.js +83 -0
  252. package/guide/reference/cli/INDEX.md +12 -6
  253. package/guide/reference/cli/build.md +1 -1
  254. package/guide/reference/cli/check.md +1 -1
  255. package/guide/reference/cli/dev.md +3 -3
  256. package/guide/reference/cli/property-add.md +1 -1
  257. package/guide/reference/cli/property-list.md +1 -1
  258. package/guide/reference/cli/publish.md +4 -2
  259. package/guide/reference/cli/upgrade.md +1 -1
  260. package/guide/reference/rules/INDEX.md +26 -13
  261. package/package.json +4 -2
  262. package/dist/packages/internal/fact-interpolation/dist/index.js +0 -22
  263. package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +0 -170
  264. package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +0 -32
  265. package/dist/packages/internal/fill-vocabulary/dist/facts.js +0 -131
  266. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +0 -11
  267. package/dist/schema/fill-spec.d.ts +0 -18
  268. package/dist/template/reconcile.d.ts +0 -67
  269. package/dist/template/reconcile.js +0 -25
@@ -1,5 +1,4 @@
1
1
  //#region ../../internal/template-contracts/dist/slot-catalog.js
2
- /** Standard content slot types — AI-fillable or user-editable freeform. */
3
2
  const CONTENT_SLOT_TYPES = [
4
3
  "text",
5
4
  "number",
@@ -12,85 +11,21 @@ const CONTENT_SLOT_TYPES = [
12
11
  "tour",
13
12
  "document"
14
13
  ];
15
- /**
16
- * Reference slot types — a slot type bound via the `source` axis / baked from facts rather than authored/AI-filled.
17
- *
18
- * @remarks
19
- * Currently empty: no slot type is source-bound at the type level. A slot's
20
- * provenance is expressed by its `source` axis kind (`authored` / `direct` /
21
- * `derived`) instead, orthogonal to its content slot type.
22
- */
23
14
  const REF_SLOT_TYPES = [];
24
- /** Every slot type, content and reference combined. */
25
15
  const SLOT_TYPES = [...CONTENT_SLOT_TYPES, ...REF_SLOT_TYPES];
26
- /** The collection slot types — every kind whose runtime value is an array of items. */
27
16
  const COLLECTION_SLOT_TYPES = ["list"];
28
- /** Whether `type` names a collection slot type. */
29
17
  function isCollectionSlotType(type) {
30
18
  return COLLECTION_SLOT_TYPES.includes(type);
31
19
  }
32
- /**
33
- * The asset-pool filters an `image` slot's `sourceFilter` may name — the tag that narrows the candidate pool the editor offers for that slot.
34
- *
35
- * @remarks
36
- * `"floorplans"` routes the slot to the per-unit floor-plan picker rather than
37
- * the property photo pool. The vocabulary is closed and checked at authoring
38
- * time (`assertSourceFilterContract`) because an unrecognized tag is invisible:
39
- * the editor simply falls through to the ordinary photo pool, with no error
40
- * anywhere and no way to tell that from an author who meant that pool.
41
- */
42
20
  const SOURCE_FILTERS = ["floorplans"];
43
- /** Whether `value` names a real asset-pool filter. */
44
21
  function isSourceFilter(value) {
45
22
  return SOURCE_FILTERS.includes(value);
46
23
  }
47
- /**
48
- * Referral-provider field names a slot may bind to via `source.kind:"direct"` on a named property-level referral (v1: `"primary_contact"`).
49
- *
50
- * @remarks
51
- * Names the referral-specific fields, as distinct from the property/unit
52
- * scalars in `SOURCE_FIELDS`, for slot-type cross-checks. The
53
- * field-to-contact-card-key translation applied when a value is baked is not
54
- * part of this kit.
55
- */
56
- const REFERRAL_FIELDS = [
57
- "name",
58
- "title",
59
- "org_name",
60
- "email",
61
- "phone",
62
- "website",
63
- "instagram",
64
- "linkedin",
65
- "x",
66
- "facebook",
67
- "headshot",
68
- "logo_dark",
69
- "logo_light"
70
- ];
71
- /**
72
- * The subset of `REFERRAL_FIELDS` whose slot type is `image` rather than scalar text — a baked value for these is an `ImageValue`, not a string.
73
- */
74
24
  const REFERRAL_IMAGE_FIELDS = [
75
25
  "headshot",
76
26
  "logo_dark",
77
27
  "logo_light"
78
28
  ];
79
- /**
80
- * The askable units a fact can belong to — the key space of `FACT_GRAPH`'s
81
- * `input_group`, and the vocabulary the app's input-group registry implements.
82
- *
83
- * @remarks
84
- * A VOCABULARY, not an order. Which question comes before which is pure
85
- * presentation and stays app-owned (the ordered registry that renders the
86
- * intake steps and the Details sections); the server never needs it, so
87
- * declaring an order here would be a second, drifting copy of one.
88
- *
89
- * Only groups a FACT can belong to are members. `domain` is absent because a
90
- * web address is a website input rather than a property fact and never enters
91
- * the graph; the template selection is absent for the same reason — nothing
92
- * about it is a fact about the property.
93
- */
94
29
  const INPUT_GROUPS = [
95
30
  "address",
96
31
  "type",
@@ -101,19 +36,6 @@ const INPUT_GROUPS = [
101
36
  "comparables",
102
37
  "contacts"
103
38
  ];
104
- /**
105
- * When each askable unit's question is owed — the one declaration of the group conditional axis.
106
- *
107
- * @remarks
108
- * Every base group is always-on except three: `units`, `comparables` and
109
- * `contacts` are each asked only of a property whose templates read one of the
110
- * group's facts. A template that never binds, reads or computes over a unit
111
- * fact — a document-sourced investment fact sheet, say — neither asks for unit
112
- * details nor gates Generate on them; one that never reaches a contact fact
113
- * asks for no contact either, unless it is a website, which
114
- * {@link WEBSITE_ASKED_INPUT_GROUPS} summons the contacts for regardless.
115
- * See {@link InputGroupRequirementKind}.
116
- */
117
39
  const INPUT_GROUP_REQUIREMENT = {
118
40
  address: "always",
119
41
  type: "always",
@@ -124,37 +46,8 @@ const INPUT_GROUP_REQUIREMENT = {
124
46
  comparables: "derived",
125
47
  contacts: "derived"
126
48
  };
127
- /**
128
- * The askable units every property is asked for, whatever its templates use.
129
- *
130
- * @remarks
131
- * The always-on leg of requiredness, as a list. A reader that grades
132
- * requiredness needs both legs and gets the conditional one from the subjects
133
- * it holds; this is the half that needs no subjects at all.
134
- */
135
49
  const ALWAYS_ASKED_INPUT_GROUPS = INPUT_GROUPS.filter((group) => INPUT_GROUP_REQUIREMENT[group] === "always");
136
- /**
137
- * The single description of every fact an author can reach — the whole property fact graph, bindable and readable-only alike.
138
- *
139
- * @remarks
140
- * Every canonical `property_facts.facts` path is either an entry here (or a
141
- * member of one) or carries a stated reason on `FACT_GRAPH_EXCLUSIONS`; a
142
- * completeness gate holds that exactly, top level and row level.
143
- * Each entry's own doc comment is the hover text an author sees on the
144
- * matching `fact.*` entry elsewhere in the schema layer, so keep every entry
145
- * documented — that sentence is the only way an author distinguishes
146
- * `fact.unit.beds` from `fact.property.property_type` without opening this file.
147
- * The bindable entries are declared in the order `fact.*` presents them.
148
- *
149
- * It is also where a fact's CONDITIONAL axis is declared — `input_group` (the
150
- * askable unit whose question produces it) and `strength` (whether that
151
- * question gates Generate). Both live on the fact rather than on the template
152
- * that uses it, which is what lets a fact be re-grouped or re-weighted without
153
- * republishing a single template: a published template stores only the fact
154
- * KEYS it uses, and the group and strength are joined from here at read time.
155
- */
156
50
  const FACT_GRAPH = {
157
- /** Street address, resolved to its display form. Read-only. */
158
51
  address: {
159
52
  role: "bindable",
160
53
  path: "address",
@@ -163,23 +56,15 @@ const FACT_GRAPH = {
163
56
  input_group: "address",
164
57
  strength: "blocking",
165
58
  fields: {
166
- /** The address as one display line. */
167
59
  display: { value_type: "text" },
168
- /** Street line ("123 Main St"). */
169
60
  street: { value_type: "text" },
170
- /** Street number and name without the type suffix ("1112 Commonwealth"), for a short street label. */
171
61
  street_no_type: { value_type: "text" },
172
- /** City ("Springfield"). */
173
62
  city: { value_type: "text" },
174
- /** State ("IL"). */
175
63
  state: { value_type: "text" },
176
- /** Postal code ("62704"). */
177
64
  postal: { value_type: "text" },
178
- /** Apartment, suite or unit designator ("Unit 4B"), where the address carries one. */
179
65
  unit: { value_type: "text" }
180
66
  }
181
67
  },
182
- /** Street line of the property address ("123 Main St"). Read-only. */
183
68
  address_street: {
184
69
  role: "bindable",
185
70
  path: "address.street",
@@ -188,7 +73,6 @@ const FACT_GRAPH = {
188
73
  input_group: "address",
189
74
  strength: "blocking"
190
75
  },
191
- /** Secondary line of the property address — the apartment, suite or unit designator ("Apt 4"). Read-only. Unrelated to the `unit` container, which holds a priced listing unit. */
192
76
  address_unit: {
193
77
  role: "bindable",
194
78
  path: "address.unit",
@@ -197,7 +81,6 @@ const FACT_GRAPH = {
197
81
  input_group: "address",
198
82
  strength: "optional"
199
83
  },
200
- /** City of the property address ("Springfield"). Read-only. */
201
84
  address_city: {
202
85
  role: "bindable",
203
86
  path: "address.city",
@@ -206,7 +89,6 @@ const FACT_GRAPH = {
206
89
  input_group: "address",
207
90
  strength: "blocking"
208
91
  },
209
- /** State of the property address ("IL"). Read-only. */
210
92
  address_state: {
211
93
  role: "bindable",
212
94
  path: "address.state",
@@ -215,7 +97,6 @@ const FACT_GRAPH = {
215
97
  input_group: "address",
216
98
  strength: "blocking"
217
99
  },
218
- /** Postal code of the property address ("62704"). Read-only. */
219
100
  address_postal: {
220
101
  role: "bindable",
221
102
  path: "address.postal",
@@ -224,7 +105,6 @@ const FACT_GRAPH = {
224
105
  input_group: "address",
225
106
  strength: "blocking"
226
107
  },
227
- /** Whether the property is for sale or for rent. **Writable** — the editor offers "Update everywhere". Also supplies a `select` slot's option vocabulary. */
228
108
  listing_intent: {
229
109
  role: "bindable",
230
110
  path: "listing_intent",
@@ -237,7 +117,6 @@ const FACT_GRAPH = {
237
117
  column: "listing_intent"
238
118
  }
239
119
  },
240
- /** Property type (single family, condo, multi-family, …). Read-only. */
241
120
  property_type: {
242
121
  role: "bindable",
243
122
  path: "property_type",
@@ -246,7 +125,6 @@ const FACT_GRAPH = {
246
125
  input_group: "type",
247
126
  strength: "blocking"
248
127
  },
249
- /** Property latitude, projected from the geocode. Read-only; null until the property is geocoded. Reachable as `fact.property.latitude`. */
250
128
  lat: {
251
129
  role: "bindable",
252
130
  path: "lat",
@@ -255,7 +133,6 @@ const FACT_GRAPH = {
255
133
  input_group: "address",
256
134
  strength: "blocking"
257
135
  },
258
- /** Property longitude, projected from the geocode. Read-only; null until the property is geocoded. Reachable as `fact.property.longitude`. */
259
136
  lon: {
260
137
  role: "bindable",
261
138
  path: "lon",
@@ -264,7 +141,6 @@ const FACT_GRAPH = {
264
141
  input_group: "address",
265
142
  strength: "blocking"
266
143
  },
267
- /** Unit label, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
268
144
  unit_label: {
269
145
  role: "bindable",
270
146
  path: "units[].unit_label",
@@ -277,7 +153,6 @@ const FACT_GRAPH = {
277
153
  column: "unit_label"
278
154
  }
279
155
  },
280
- /** Bedroom count, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
281
156
  beds: {
282
157
  role: "bindable",
283
158
  path: "units[].beds",
@@ -290,7 +165,6 @@ const FACT_GRAPH = {
290
165
  column: "beds"
291
166
  }
292
167
  },
293
- /** Bathroom count, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
294
168
  baths: {
295
169
  role: "bindable",
296
170
  path: "units[].baths",
@@ -303,7 +177,6 @@ const FACT_GRAPH = {
303
177
  column: "baths"
304
178
  }
305
179
  },
306
- /** Interior square footage, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
307
180
  sqft: {
308
181
  role: "bindable",
309
182
  path: "units[].sqft",
@@ -316,7 +189,6 @@ const FACT_GRAPH = {
316
189
  column: "sqft"
317
190
  }
318
191
  },
319
- /** Price as a flex value (digits or a text override such as "Sold"), resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
320
192
  price: {
321
193
  role: "bindable",
322
194
  path: "units[].price",
@@ -329,7 +201,6 @@ const FACT_GRAPH = {
329
201
  column: "price"
330
202
  }
331
203
  },
332
- /** Every unit, baked verbatim as a record list. Read-only as a whole; the per-row fields under `fact.unit` stay writable. */
333
204
  units: {
334
205
  role: "bindable",
335
206
  path: "units",
@@ -338,35 +209,23 @@ const FACT_GRAPH = {
338
209
  input_group: "units",
339
210
  strength: "blocking",
340
211
  row: {
341
- /** Durable unit identity, stable across edits — what a baked row is addressed by. */
342
212
  unit_id: { value_type: "text" },
343
- /** The unit's label, or null when the listing never asked for one. */
344
213
  unit_label: { value_type: "text" },
345
- /** Bedroom count. */
346
214
  beds: { value_type: "number" },
347
- /** Bathroom count. */
348
215
  baths: { value_type: "number" },
349
- /** Interior square footage. */
350
216
  sqft: { value_type: "number" },
351
- /** Price as a flex value — digits when numeric, the verbatim text override otherwise. */
352
217
  price: { value_type: "text" },
353
- /** Display order within the property. */
354
218
  position: { value_type: "number" },
355
- /** The floor plans assigned to this unit, in display order. */
356
219
  floor_plans: {
357
220
  value_type: "row_list",
358
221
  row: {
359
- /** Identity of the floor-plan image (its upload id). */
360
222
  id: { value_type: "text" },
361
- /** The floor this plan covers, where one was detected. */
362
223
  floor_label: { value_type: "text" },
363
- /** Display order within the unit. */
364
224
  position: { value_type: "number" }
365
225
  }
366
226
  }
367
227
  }
368
228
  },
369
- /** Every comparable property — recently sold or currently listed homes similar to the subject — baked verbatim as a record list, in display order. The array itself is read-only (every market number a slide shows is a `compute()` over these rows), but the members marked writable below are edited on the canvas like a unit's. */
370
229
  comparables: {
371
230
  role: "bindable",
372
231
  path: "comparables",
@@ -375,72 +234,66 @@ const FACT_GRAPH = {
375
234
  input_group: "comparables",
376
235
  strength: "blocking",
377
236
  row: {
378
- /** Durable row identity, stable across edits — what a baked row is addressed by. */
379
237
  id: { value_type: "text" },
380
- /** Street line of the comparable's address ("12 Oak St"). Part of what makes a row complete. */
381
238
  address_street: {
382
239
  value_type: "text",
383
240
  required: true
384
241
  },
385
- /** City of the comparable's address. */
386
242
  address_city: { value_type: "text" },
387
- /** State of the comparable's address. */
388
243
  address_state: { value_type: "text" },
389
- /** Postal code of the comparable's address. */
390
244
  address_postal: { value_type: "text" },
391
- /** The comparable's address as one display line, assembled at projection. */
392
245
  address: { value_type: "text" },
393
- /** Latitude of the comparable. Part of what makes a row complete — the comps map pins on it. */
394
246
  lat: {
395
247
  value_type: "number",
396
248
  required: true
397
249
  },
398
- /** Longitude of the comparable. Part of what makes a row complete. */
399
250
  lng: {
400
251
  value_type: "number",
401
252
  required: true
402
253
  },
403
- /** Great-circle distance from the subject property in meters, computed at projection; null while either side lacks coordinates. */
404
254
  distance_m: { value_type: "number" },
405
- /** Where the comparable stands on the market: `"sold"` when the row carries a sale date, `"active"` when it does not. Derived rather than answered, which is why it is not a completeness member; it is what disambiguates `price`. */
406
255
  status: { value_type: "text" },
407
- /** One integer in dollars. It takes two members to read: `status` says sale price versus list price, and `price_period` says total versus monthly rent. Part of what makes a row complete. **Writable** from the canvas. */
408
256
  price: {
409
257
  value_type: "number",
410
258
  required: true,
411
259
  writeback: { column: "price" }
412
260
  },
413
- /** What `price` is denominated in: `"monthly"` on a `for_rent` property (a rent per month), `"total"` on any other listing intent. Derived at projection from the SUBJECT's listing intent rather than stored per row, and never null — print a comp's price through it or a $2,400 rent renders as a sale. */
414
261
  price_period: { value_type: "text" },
415
- /** The closing date (ISO `YYYY-MM-DD`) when sold; null otherwise. The one market fact the user answers — `status` is read off it. **Writable** from the canvas, and the write moves `status` with it. */
416
262
  sale_date: {
417
263
  value_type: "text",
418
264
  writeback: { column: "sale_date" }
419
265
  },
420
- /** Bedroom count. **Writable** from the canvas. */
421
266
  beds: {
422
267
  value_type: "number",
268
+ required: true,
423
269
  writeback: { column: "beds" }
424
270
  },
425
- /** Bathroom count. **Writable** from the canvas. */
426
271
  baths: {
427
272
  value_type: "number",
273
+ required: true,
428
274
  writeback: { column: "baths" }
429
275
  },
430
- /** Interior square footage. **Writable** from the canvas. */
431
276
  sqft: {
432
277
  value_type: "number",
278
+ required: true,
433
279
  writeback: { column: "sqft" }
434
280
  },
435
- /** A photo of the comparable, as an absolute URL rather than an upload id — comparables are not property uploads. */
436
281
  photo_url: { value_type: "text" },
437
- /** Where the row's facts were read from — the listing's detail page. */
438
282
  source_url: { value_type: "text" },
439
- /** The name of that source ("Redfin", an MLS). */
440
- source_name: { value_type: "text" }
283
+ source_name: { value_type: "text" },
284
+ year_built: { value_type: "number" },
285
+ lot_sqft: { value_type: "number" },
286
+ stories: { value_type: "number" },
287
+ units: { value_type: "number" },
288
+ hoa_monthly: { value_type: "number" },
289
+ days_on_market: { value_type: "number" },
290
+ list_price: { value_type: "number" },
291
+ listed_date: { value_type: "text" },
292
+ mls_number: { value_type: "text" },
293
+ description: { value_type: "text" },
294
+ property_type: { value_type: "text" }
441
295
  }
442
296
  },
443
- /** Every contact card, baked verbatim as a record list. Read-only as a whole; the per-row fields under `fact.contact` stay writable. */
444
297
  contacts: {
445
298
  role: "bindable",
446
299
  path: "contacts",
@@ -449,43 +302,25 @@ const FACT_GRAPH = {
449
302
  input_group: "contacts",
450
303
  strength: "blocking",
451
304
  row: {
452
- /** Stable identity of the contact card. */
453
305
  id: { value_type: "text" },
454
- /** Whether this is the property's primary contact — the one lead routing and the brand marks resolve from. */
455
306
  primary: { value_type: "boolean" },
456
- /** Contact name. */
457
307
  name: { value_type: "text" },
458
- /** Contact job title. */
459
308
  title: { value_type: "text" },
460
- /** The organization the contact belongs to. */
461
309
  org_name: { value_type: "text" },
462
- /** Contact biography. */
463
310
  bio: { value_type: "text" },
464
- /** Contact email address. */
465
311
  email: { value_type: "text" },
466
- /** Contact phone number. */
467
312
  phone: { value_type: "text" },
468
- /** The contact's address exactly as entered, on one line. */
469
313
  address: { value_type: "text" },
470
- /** Contact website URL. */
471
314
  website_url: { value_type: "text" },
472
- /** The contact's headshot, as an upload id rather than a URL. */
473
315
  avatar_upload_id: { value_type: "text" },
474
- /** The contact's logo for dark backgrounds, as an upload id rather than a URL. */
475
316
  logo_dark_upload_id: { value_type: "text" },
476
- /** The contact's logo for light backgrounds, as an upload id rather than a URL. */
477
317
  logo_light_upload_id: { value_type: "text" },
478
- /** Contact Instagram URL. */
479
318
  instagram_url: { value_type: "text" },
480
- /** Contact LinkedIn URL. */
481
319
  linkedin_url: { value_type: "text" },
482
- /** Contact X URL. */
483
320
  x_url: { value_type: "text" },
484
- /** Contact Facebook URL. */
485
321
  facebook_url: { value_type: "text" }
486
322
  }
487
323
  },
488
- /** Contact name, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
489
324
  name: {
490
325
  role: "bindable",
491
326
  path: "contacts[].name",
@@ -498,7 +333,6 @@ const FACT_GRAPH = {
498
333
  field: "name"
499
334
  }
500
335
  },
501
- /** Contact job title, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
502
336
  title: {
503
337
  role: "bindable",
504
338
  path: "contacts[].title",
@@ -511,7 +345,6 @@ const FACT_GRAPH = {
511
345
  field: "title"
512
346
  }
513
347
  },
514
- /** The organization the contact belongs to — the brokerage a branded deliverable paints as its wordmark. Resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
515
348
  org_name: {
516
349
  role: "bindable",
517
350
  path: "contacts[].org_name",
@@ -524,7 +357,6 @@ const FACT_GRAPH = {
524
357
  field: "org_name"
525
358
  }
526
359
  },
527
- /** Contact biography, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
528
360
  bio: {
529
361
  role: "bindable",
530
362
  path: "contacts[].bio",
@@ -537,7 +369,6 @@ const FACT_GRAPH = {
537
369
  field: "bio"
538
370
  }
539
371
  },
540
- /** The contact's address exactly as entered, on one line. **Writable** — the editor offers "Update everywhere". Reachable as `fact.contact.address` — the key is prefixed because this catalog is one FLAT name space shared by all three containers, and the property already owns `address`. */
541
372
  contact_address: {
542
373
  role: "bindable",
543
374
  path: "contacts[].address",
@@ -550,7 +381,6 @@ const FACT_GRAPH = {
550
381
  field: "address"
551
382
  }
552
383
  },
553
- /** Contact email address, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
554
384
  email: {
555
385
  role: "bindable",
556
386
  path: "contacts[].email",
@@ -563,7 +393,6 @@ const FACT_GRAPH = {
563
393
  field: "email"
564
394
  }
565
395
  },
566
- /** Contact phone number, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
567
396
  phone: {
568
397
  role: "bindable",
569
398
  path: "contacts[].phone",
@@ -576,7 +405,6 @@ const FACT_GRAPH = {
576
405
  field: "phone"
577
406
  }
578
407
  },
579
- /** Contact website URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
580
408
  website: {
581
409
  role: "bindable",
582
410
  path: "contacts[].website_url",
@@ -589,7 +417,6 @@ const FACT_GRAPH = {
589
417
  field: "website"
590
418
  }
591
419
  },
592
- /** Contact Instagram URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
593
420
  instagram: {
594
421
  role: "bindable",
595
422
  path: "contacts[].instagram_url",
@@ -602,7 +429,6 @@ const FACT_GRAPH = {
602
429
  field: "socials.instagram"
603
430
  }
604
431
  },
605
- /** Contact LinkedIn URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
606
432
  linkedin: {
607
433
  role: "bindable",
608
434
  path: "contacts[].linkedin_url",
@@ -615,7 +441,6 @@ const FACT_GRAPH = {
615
441
  field: "socials.linkedin"
616
442
  }
617
443
  },
618
- /** Contact X URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
619
444
  x: {
620
445
  role: "bindable",
621
446
  path: "contacts[].x_url",
@@ -628,7 +453,6 @@ const FACT_GRAPH = {
628
453
  field: "socials.x"
629
454
  }
630
455
  },
631
- /** Contact Facebook URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
632
456
  facebook: {
633
457
  role: "bindable",
634
458
  path: "contacts[].facebook_url",
@@ -641,7 +465,6 @@ const FACT_GRAPH = {
641
465
  field: "socials.facebook"
642
466
  }
643
467
  },
644
- /** Contact headshot, resolved against the primary contact card (or the current row of a record list). Read-only; belongs on an `image` slot. */
645
468
  headshot: {
646
469
  role: "bindable",
647
470
  path: "contacts[].avatar_upload_id",
@@ -651,7 +474,6 @@ const FACT_GRAPH = {
651
474
  strength: "optional",
652
475
  image: true
653
476
  },
654
- /** Contact logo for dark backgrounds, falling back to a silhouette of the light logo. Read-only; belongs on an `image` slot. */
655
477
  logo_dark: {
656
478
  role: "bindable",
657
479
  path: "contacts[].logo_dark_upload_id",
@@ -661,7 +483,6 @@ const FACT_GRAPH = {
661
483
  strength: "optional",
662
484
  image: true
663
485
  },
664
- /** Contact logo for light backgrounds, falling back to a silhouette of the dark logo. Read-only; belongs on an `image` slot. */
665
486
  logo_light: {
666
487
  role: "bindable",
667
488
  path: "contacts[].logo_light_upload_id",
@@ -671,34 +492,25 @@ const FACT_GRAPH = {
671
492
  strength: "optional",
672
493
  image: true
673
494
  },
674
- /** The property's always-on prose description, the substrate every text decision is grounded in. */
675
- narrative: {
495
+ description: {
676
496
  role: "readable",
677
- path: "narrative",
678
- value_type: "object",
497
+ path: "narrative.description",
498
+ value_type: "text",
679
499
  input_group: "describe",
680
- strength: "optional",
681
- fields: {
682
- /** The description itself. */
683
- description: { value_type: "text" } }
500
+ strength: "optional"
684
501
  },
685
- /** Every property photo, in candidate order. */
686
502
  photos: {
687
503
  role: "readable",
688
504
  path: "photos",
689
505
  value_type: "row_list",
690
506
  input_group: "uploads",
691
- strength: "blocking",
507
+ strength: "optional",
692
508
  row: {
693
- /** Identity of the photo. */
694
509
  id: { value_type: "text" },
695
- /** What the classifier recognized in the photo — the vocabulary image decisions rank on. */
696
510
  tags: { value_type: "text_list" },
697
- /** The photo's caption, where it has one. */
698
511
  caption: { value_type: "text" }
699
512
  }
700
513
  },
701
- /** Every video on the property — hosted uploads and pasted provider links alike, in the order they were added. */
702
514
  videos: {
703
515
  role: "readable",
704
516
  path: "videos",
@@ -706,25 +518,16 @@ description: { value_type: "text" } }
706
518
  input_group: "uploads",
707
519
  strength: "optional",
708
520
  row: {
709
- /** Identity of the video. */
710
521
  id: { value_type: "text" },
711
- /** Where the bytes live: `"upload"` for a rendition served directly, `"link"` for a provider embed. */
712
522
  source: { value_type: "text" },
713
- /** What the classifier recognized in the video. Always empty for a link — no classifier runs on one. */
714
523
  tags: { value_type: "text_list" },
715
- /** The video's caption; for a link, the provider's title until someone corrects it. */
716
524
  caption: { value_type: "text" },
717
- /** The provider's own description, where it publishes one. Null for an upload. */
718
525
  description: { value_type: "text" },
719
- /** Length in milliseconds. Null means UNKNOWN, never short. */
720
526
  duration_ms: { value_type: "number" },
721
- /** The pasted link, exactly as it was given. Null for an upload. */
722
527
  url: { value_type: "text" },
723
- /** Which provider hosts the link ("youtube", "vimeo"). Null for an upload. */
724
528
  provider: { value_type: "text" }
725
529
  }
726
530
  },
727
- /** Every 3D tour on the property, in a stable order. */
728
531
  tours: {
729
532
  role: "readable",
730
533
  path: "tours",
@@ -732,15 +535,11 @@ description: { value_type: "text" } }
732
535
  input_group: "uploads",
733
536
  strength: "optional",
734
537
  row: {
735
- /** Identity of the tour. */
736
538
  id: { value_type: "text" },
737
- /** The tour link, exactly as it was given. */
738
539
  url: { value_type: "text" },
739
- /** Which provider hosts the tour ("matterport", "biganto"). */
740
540
  provider: { value_type: "text" }
741
541
  }
742
542
  },
743
- /** Every floor-plan image on the property, whichever units it was assigned to. */
744
543
  floor_plans: {
745
544
  role: "readable",
746
545
  path: "floor_plans",
@@ -748,23 +547,17 @@ description: { value_type: "text" } }
748
547
  input_group: "uploads",
749
548
  strength: "optional",
750
549
  row: {
751
- /** Identity of the floor-plan image (its upload id). */
752
550
  id: { value_type: "text" },
753
- /** Which units this plan was assigned to — empty when it is building-wide. */
754
551
  unit_assignments: {
755
552
  value_type: "row_list",
756
553
  row: {
757
- /** The assigned unit's label. */
758
554
  unit_label: { value_type: "text" },
759
- /** The floor this plan covers for that unit. */
760
555
  floor_label: { value_type: "text" },
761
- /** Display order within that unit. */
762
556
  position: { value_type: "number" }
763
557
  }
764
558
  }
765
559
  }
766
560
  },
767
- /** Every attachable document on the property — the files a visitor opens or downloads. */
768
561
  documents: {
769
562
  role: "readable",
770
563
  path: "documents",
@@ -772,17 +565,12 @@ description: { value_type: "text" } }
772
565
  input_group: "uploads",
773
566
  strength: "optional",
774
567
  row: {
775
- /** Identity of the document. */
776
568
  id: { value_type: "text" },
777
- /** The name it was uploaded under, and the name delivery serves it as. */
778
569
  filename: { value_type: "text" },
779
- /** The file's media type — the format, which a filename may not carry. */
780
570
  mime: { value_type: "text" },
781
- /** Prose distilled out of the file, empty where there is none. */
782
571
  notes: { value_type: "text" }
783
572
  }
784
573
  },
785
- /** The prose distilled from uploaded documents, one entry per document — always-on grounding, where `documents` is the files themselves. */
786
574
  document_notes: {
787
575
  role: "readable",
788
576
  path: "document_notes",
@@ -790,49 +578,29 @@ description: { value_type: "text" } }
790
578
  input_group: "uploads",
791
579
  strength: "optional",
792
580
  row: {
793
- /** Which upload the notes were distilled from. */
794
581
  upload_id: { value_type: "text" },
795
- /** The distilled notes. */
796
582
  notes: { value_type: "text" }
797
583
  }
798
584
  },
799
- /** The primary unit — the lowest-positioned one — or null when the property has no units. */
800
585
  unit: {
801
586
  role: "readable",
802
587
  path: "units",
803
588
  value_type: "row",
804
589
  primary_of: "units"
805
590
  },
806
- /** The primary contact card, or null when the property has no contacts. */
807
591
  contact: {
808
592
  role: "readable",
809
593
  path: "contacts",
810
594
  value_type: "row",
811
595
  primary_of: "contacts"
812
- },
813
- /** The current calendar year. Ambient — read at derive time, not from any fact. */
814
- year: {
815
- role: "readable",
816
- path: null,
817
- value_type: "number",
818
- ambient: true
819
596
  }
820
597
  };
821
- /**
822
- * Author-facing aliases over the registry's flat key space, per container —
823
- * alias name → the registry key it projects. One table serves every derived
824
- * fact surface (`fact.*` and the derive-time view).
825
- */
826
598
  const FACT_PROJECTIONS = {
827
599
  property: {
828
- /** Property latitude, projected from the geocode. Read-only; null until the property is geocoded. */
829
600
  latitude: "lat",
830
- /** Property longitude, projected from the geocode. Read-only; null until the property is geocoded. */
831
601
  longitude: "lon"
832
602
  },
833
- contact: {
834
- /** The primary contact's address exactly as entered, on one line. **Writable** — the editor offers "Update everywhere". */
835
- address: "contact_address" }
603
+ contact: { address: "contact_address" }
836
604
  };
837
605
  function projectBindableFacts(graph) {
838
606
  const projected = {};
@@ -848,54 +616,14 @@ function projectBindableFacts(graph) {
848
616
  }
849
617
  return projected;
850
618
  }
851
- /**
852
- * The catalog of every canonical field a slot's `direct` source may bind to — property, unit, and contact scalars, plus the read-only array sources (`units`, `contacts`).
853
- *
854
- * @remarks
855
- * Not a list of its own: it is exactly the bindable half of the property fact
856
- * graph, stripped to the descriptor a resolver and the editor read. Each entry
857
- * declares its container, value type, and (if writable) writeback target, and
858
- * carries its doc sentence through to `fact.*` — where the fact namespace
859
- * reference lists every binding this yields, with that prose.
860
- * Computed/aggregated values are never here — a section authors those with
861
- * `compute()`.
862
- */
863
619
  const SOURCE_FIELDS = /* @__PURE__ */ projectBindableFacts(FACT_GRAPH);
864
- /** Whether the catalog entry named `field` is writable (carries a `writeback` target). */
865
620
  function isWritableSourceField(field) {
866
621
  return SOURCE_FIELDS[field]?.writeback !== void 0;
867
622
  }
868
- /**
869
- * The named dynamic option sources a `select` slot's `options.source` may name — the fields whose own domain IS the slot's option vocabulary.
870
- *
871
- * @remarks
872
- * A `select({ source: fact.* })` emits `options.source` from its binding, so
873
- * every member is necessarily a `SOURCE_FIELDS` key (the `satisfies` below is
874
- * what holds that). Not every source field earns a member: only one whose value
875
- * space is a small closed set an editor can offer as a dropdown. An unlisted
876
- * source resolves to an EMPTY dropdown at runtime rather than an error, which
877
- * is why `assertOptionSourceContract` checks it at authoring time. The provider
878
- * functions that turn each member into concrete options live in the editor
879
- * layer (`@homepages/slot-editors`); the vocabulary is here so the validators
880
- * can read it without depending on React.
881
- */
882
623
  const OPTION_SOURCES = ["listing_intent"];
883
- /** Whether `value` names a real dynamic option source. */
884
624
  function isOptionSource(value) {
885
625
  return OPTION_SOURCES.includes(value);
886
626
  }
887
- /**
888
- * The registry of fact array fields a slot may be collection-bound to (a slot is collection-bound iff `source.kind === "direct"` and `source.field` is a key here).
889
- *
890
- * @remarks
891
- * The single home for per-kind mechanics; other layers implement their
892
- * operations keyed by these entries rather than restating them. `idKey`
893
- * names the stable canonical row id (used for merge, markers, and editor
894
- * identity). `cap`/`min`, when present, are the API-enforced membership
895
- * ceiling/floor. `ownership` is the property-owned vs. library-shared
896
- * discriminator that gates writeback/fan-out strategy per layer — never a
897
- * shared physical table.
898
- */
899
627
  const COLLECTIONS = {
900
628
  units: {
901
629
  idKey: "unit_id",
@@ -912,29 +640,11 @@ const COLLECTIONS = {
912
640
  ownership: "property"
913
641
  }
914
642
  };
915
- /**
916
- * Which `COLLECTIONS` entry, if any, a slot definition is bound to.
917
- *
918
- * Keys on the SOURCE alone — no slot-type literal involved: a slot is
919
- * collection-bound iff its `source` is `direct` and names a `COLLECTIONS`
920
- * field. That a bound slot's item must be a record (a `list` carrying
921
- * `fields`) is the authoring gate's business (`@homepages/section-contracts`),
922
- * not this key.
923
- *
924
- * @returns The collection field name, or `null` when the slot's source is not
925
- * `kind:"direct"` or names a field outside `COLLECTIONS`.
926
- */
927
643
  function collectionForSlot(slot) {
928
644
  if (slot.source?.kind !== "direct") return null;
929
645
  const field = slot.source.field;
930
646
  return field !== void 0 && Object.hasOwn(COLLECTIONS, field) ? field : null;
931
647
  }
932
- /**
933
- * The membership bounds a collection-bound list inherits — the registry
934
- * entry's `min` floor and its `cap` ceiling, spelled as the slot's `min`/`max`.
935
- *
936
- * @returns Only the bounds the entry actually declares; `units` declares neither.
937
- */
938
648
  function collectionBounds(field) {
939
649
  const entry = COLLECTIONS[field];
940
650
  return {
@@ -942,16 +652,6 @@ function collectionBounds(field) {
942
652
  ...entry.cap !== void 0 ? { max: entry.cap } : {}
943
653
  };
944
654
  }
945
- /**
946
- * Resolves every collection-bound list in `slots` to a concrete `min`/`max`,
947
- * in place: an omitted bound takes the registry's value, an authored (narrower) one
948
- * stands. Serialized schemas therefore always carry a number, so the editor and the
949
- * API enforce the same one instead of each reading its own declaration.
950
- *
951
- * @remarks
952
- * Runs at materialization, AFTER validation — `assertRecordCollectionContract`
953
- * decides legality from what the author wrote, and a stamped slot no longer says.
954
- */
955
655
  function stampCollectionBounds(slots) {
956
656
  for (const slot of Object.values(slots)) {
957
657
  const collection = collectionForSlot(slot);
@@ -961,25 +661,8 @@ function stampCollectionBounds(slots) {
961
661
  if (slot.max === void 0 && inherited.max !== void 0) slot.max = inherited.max;
962
662
  }
963
663
  }
964
- /**
965
- * The entries a section's `display` block may declare, in the order a batched
966
- * `display-select` resolves them. The one axis rule is the block's shape, not a
967
- * value here: `variant` is singular.
968
- */
969
664
  const DISPLAY_ENTRIES = ["visibility", "variant"];
970
- /**
971
- * The pinned vocabulary of a `display.visibility` entry — an author declares
972
- * exactly these two cases, in either order, and the order states the failure
973
- * posture (first case wins when the decision or the compute fails). A variant's
974
- * cases are the author's own; visibility's are not, because storage maps them
975
- * onto the existing instance `enabled` boolean.
976
- */
977
665
  const VISIBILITY_CASES = ["visible", "hidden"];
978
- /**
979
- * The single source of truth for "what kind of link is this URL". A `url`
980
- * slot names one of these — or a single provider id — in its `accepts`
981
- * field; `acceptsLink()` enforces it.
982
- */
983
666
  const LINK_KINDS = [
984
667
  "tour",
985
668
  "video",
@@ -988,11 +671,6 @@ const LINK_KINDS = [
988
671
  "file",
989
672
  "map"
990
673
  ];
991
- /**
992
- * The catalog of recognized link providers, keyed by provider id. Each
993
- * entry's `pattern` (and optional `path`) classifies a pasted URL;
994
- * `matchLinkProvider` walks this catalog in declaration order.
995
- */
996
674
  const LINK_PROVIDERS = {
997
675
  matterport: {
998
676
  kind: "tour",
@@ -1050,17 +728,6 @@ const LINK_PROVIDERS = {
1050
728
  strategy: "none"
1051
729
  }
1052
730
  };
1053
- /**
1054
- * Classify a pasted URL against `LINK_PROVIDERS`.
1055
- *
1056
- * @returns `null` for an unparseable value, a scheme-less value (callers
1057
- * must normalize a bare host by prepending `https://` before calling), or a
1058
- * host matching no provider. Otherwise the FIRST match in `LINK_PROVIDERS`
1059
- * declaration order — load-bearing, since `drive.google.com` matches both
1060
- * `drive`'s own pattern and `maps`'s `google.com` pattern, and only
1061
- * `drive`'s earlier declaration makes it resolve to `drive` rather than
1062
- * `maps`.
1063
- */
1064
731
  function matchLinkProvider(url) {
1065
732
  let parsed;
1066
733
  try {
@@ -1076,41 +743,17 @@ function matchLinkProvider(url) {
1076
743
  }
1077
744
  return null;
1078
745
  }
1079
- /** True iff `value` names a LINK_KINDS member or a LINK_PROVIDERS key. */
1080
746
  function isLinkAccepts(value) {
1081
747
  return LINK_KINDS.includes(value) || Object.prototype.hasOwnProperty.call(LINK_PROVIDERS, value);
1082
748
  }
1083
- /**
1084
- * Does `url` satisfy an `accepts` token — a `LinkKind` or a single `LinkProviderId`?
1085
- *
1086
- * @param accepts A `url` slot's `accepts` value. An unrecognized token
1087
- * always yields `false`: a typo must fail closed, never accept everything.
1088
- * @remarks Callers handle the empty-value case themselves — an empty `url`
1089
- * slot is legal regardless of `accepts` (clearing a slot is not a validity
1090
- * question).
1091
- */
1092
749
  function acceptsLink(accepts, url) {
1093
750
  const id = matchLinkProvider(url);
1094
751
  if (id === null) return false;
1095
752
  if (id === accepts) return true;
1096
753
  return LINK_KINDS.includes(accepts) && LINK_PROVIDERS[id].kind === accepts;
1097
754
  }
1098
- /**
1099
- * Where a video's bytes live: `"upload"` is a transcoded rendition served directly; `"link"` is a provider embed whose bytes are never served locally.
1100
- *
1101
- * @remarks
1102
- * Deliberately not spelled like `LinkStrategy` (`"oembed"` | `"api"` |
1103
- * `"opengraph"` | `"none"`), which means HOW a provider's metadata was
1104
- * obtained, an orthogonal concern.
1105
- */
1106
755
  const VIDEO_SOURCES = ["upload", "link"];
1107
756
  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";
1108
- /**
1109
- * The embeddable player URL for a pasted video link, or `null` when the value is
1110
- * empty, names no provider, or names one that is not embeddable video.
1111
- *
1112
- * Only YouTube and Vimeo embed; every other provider returns `null`.
1113
- */
1114
757
  function videoEmbedUrl(raw) {
1115
758
  const url = raw.trim();
1116
759
  if (!url) return null;
@@ -1125,16 +768,6 @@ function videoEmbedUrl(raw) {
1125
768
  }
1126
769
  return null;
1127
770
  }
1128
- /**
1129
- * The embeddable player URL for a pasted 3D-tour link, or `null` when the value
1130
- * is empty, names no provider, names one that is not a tour provider, or is a
1131
- * tour URL the provider's embed form cannot be built from.
1132
- *
1133
- * @remarks
1134
- * Covers every `kind: "tour"` member of `LINK_PROVIDERS`. A tour provider added
1135
- * to that catalog without a branch here returns `null` — an unembeddable slot
1136
- * rather than a wrong iframe — and `slot-catalog.test.ts` fails on the gap.
1137
- */
1138
771
  function tourEmbedUrl(raw) {
1139
772
  const url = raw.trim();
1140
773
  if (!url) return null;
@@ -1148,4 +781,4 @@ function tourEmbedUrl(raw) {
1148
781
  }
1149
782
 
1150
783
  //#endregion
1151
- export { COLLECTIONS, COLLECTION_SLOT_TYPES, CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, FACT_GRAPH, FACT_PROJECTIONS, INPUT_GROUPS, INPUT_GROUP_REQUIREMENT, LINK_KINDS, LINK_PROVIDERS, OPTION_SOURCES, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, REF_SLOT_TYPES, SLOT_TYPES, SOURCE_FIELDS, SOURCE_FILTERS, VIDEO_SOURCES, VISIBILITY_CASES, acceptsLink, collectionBounds, collectionForSlot, isCollectionSlotType, isLinkAccepts, isOptionSource, isSourceFilter, isWritableSourceField, matchLinkProvider, stampCollectionBounds, tourEmbedUrl, videoEmbedUrl };
784
+ export { COLLECTIONS, COLLECTION_SLOT_TYPES, CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, FACT_GRAPH, FACT_PROJECTIONS, INPUT_GROUPS, INPUT_GROUP_REQUIREMENT, LINK_KINDS, LINK_PROVIDERS, OPTION_SOURCES, REFERRAL_IMAGE_FIELDS, REF_SLOT_TYPES, SLOT_TYPES, SOURCE_FIELDS, SOURCE_FILTERS, VIDEO_SOURCES, VISIBILITY_CASES, acceptsLink, collectionBounds, collectionForSlot, isCollectionSlotType, isLinkAccepts, isOptionSource, isSourceFilter, isWritableSourceField, matchLinkProvider, stampCollectionBounds, tourEmbedUrl, videoEmbedUrl };