@homepages/concrete 7.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.
Files changed (331) hide show
  1. package/CHANGELOG.md +1007 -0
  2. package/README.md +20 -9
  3. package/codemods/list-grammar.mjs +923 -0
  4. package/codemods/manifest.json +66 -0
  5. package/codemods/process-builders.mjs +198 -0
  6. package/codemods/slot-object.mjs +1097 -0
  7. package/codemods/steps/content-object-fields.mjs +324 -0
  8. package/codemods/steps/list-object-form.mjs +6 -7
  9. package/codemods/table-rows.mjs +568 -0
  10. package/codemods/unwrap-object-fields.mjs +310 -0
  11. package/codemods/viewer-slot-document.mjs +131 -0
  12. package/codemods/write-property-as-facts-document.mjs +716 -0
  13. package/codemods/write-the-address-line.mjs +255 -0
  14. package/codemods/write-the-registry-members.mjs +653 -0
  15. package/codemods/write-the-select-from.mjs +141 -0
  16. package/codemods/write-the-sole-from.mjs +369 -0
  17. package/codemods/write-the-table-from.mjs +267 -0
  18. package/codemods/write-the-whole-item.mjs +512 -0
  19. package/codemods/writeback-drop.mjs +168 -0
  20. package/codemods/written-contact-address.mjs +162 -0
  21. package/codemods/written-media-category.mjs +227 -0
  22. package/codemods/written-ref-kinds-name-the-layer.mjs +172 -0
  23. package/codemods/written-uploads-replace-pool-reads.mjs +454 -0
  24. package/codemods/written-uploads-sort-into-lists.mjs +405 -0
  25. package/codemods/written-uploads-stated-in-sorted-lists.mjs +295 -0
  26. package/codemods/written-video-sources-drop.mjs +144 -0
  27. package/codemods/written-without-pick-none.mjs +146 -0
  28. package/codemods/written-without-retired-knowledge.mjs +223 -0
  29. package/codemods/written-without-the-media-key.mjs +202 -0
  30. package/codemods/written-without-the-property-type.mjs +249 -0
  31. package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +1259 -0
  32. package/dist/artifact/playground/client/assets/index-DDOcM0zA.css +1 -0
  33. package/dist/artifact/playground/client/index.html +2 -2
  34. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
  35. package/dist/artifact/playground/host.mjs +61 -27
  36. package/dist/base.css +58 -1
  37. package/dist/cli/build/artifact.js +6 -9
  38. package/dist/cli/build/captures.js +2 -12
  39. package/dist/cli/build/esbuild.js +1 -25
  40. package/dist/cli/build/fixtures.js +2 -1
  41. package/dist/cli/build/icons.js +1 -1
  42. package/dist/cli/build/static.js +2 -2
  43. package/dist/cli/capture/capture.js +8 -9
  44. package/dist/cli/check/analyze.js +8 -1
  45. package/dist/cli/check/load-outdir.js +47 -0
  46. package/dist/cli/check/load-workspace.js +4 -4
  47. package/dist/cli/check/render/html.js +1 -2
  48. package/dist/cli/check/render/inputs.js +10 -3
  49. package/dist/cli/check/render/island-frames.js +2 -1
  50. package/dist/cli/check/render/marker-coverage.js +23 -15
  51. package/dist/cli/check/report.js +5 -0
  52. package/dist/cli/check/stages/bundles.js +1 -1
  53. package/dist/cli/check/stages/relations.js +1 -1
  54. package/dist/cli/check/stages/render.js +48 -33
  55. package/dist/cli/check/stages/sections.js +83 -31
  56. package/dist/cli/commands.js +1 -1
  57. package/dist/cli/dev/crop.js +1 -1
  58. package/dist/cli/dev/fixture-ladders.js +96 -0
  59. package/dist/cli/dev/islands.js +12 -123
  60. package/dist/cli/dev/listen.js +20 -1
  61. package/dist/cli/dev/load-template.js +1 -1
  62. package/dist/cli/dev/server.js +35 -10
  63. package/dist/cli/dev/vite.js +9 -7
  64. package/dist/cli/dev/workspace-reader.js +16 -16
  65. package/dist/cli/media/derive.js +43 -57
  66. package/dist/cli/media/frame-rung-floor.js +0 -1
  67. package/dist/cli/property/index.js +1 -6
  68. package/dist/css/inline.js +1 -22
  69. package/dist/eslint/rules/no-marker-literal.js +1 -1
  70. package/dist/fixtures/load.js +16 -7
  71. package/dist/fixtures/media-plugin.js +17 -12
  72. package/dist/fixtures/media-store.js +115 -0
  73. package/dist/fixtures/property.js +345 -126
  74. package/dist/fixtures/resolve.js +263 -251
  75. package/dist/fixtures/rows.js +4 -11
  76. package/dist/fixtures.d.ts +234 -109
  77. package/dist/index.d.ts +25 -16
  78. package/dist/index.js +10 -6
  79. package/dist/islands/marker.js +2 -1
  80. package/dist/packages/external/concrete/package.js +1 -1
  81. package/dist/packages/internal/canvas-core/dist/island-host.js +62 -0
  82. package/dist/packages/internal/canvas-core/dist/island-shields.js +30 -0
  83. package/dist/packages/internal/capture-settle/dist/index.js +3 -0
  84. package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +13 -0
  85. package/dist/packages/internal/capture-settle/dist/island-markers.js +6 -0
  86. package/dist/packages/internal/capture-settle/dist/settle.js +150 -0
  87. package/dist/packages/internal/{image-ladder/dist/crop.js → crop-region/dist/index.js} +21 -20
  88. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +252 -35
  89. package/dist/packages/internal/fill-bake/dist/compute-reads.js +365 -4
  90. package/dist/packages/internal/fill-bake/dist/derive-source.js +35 -21
  91. package/dist/packages/internal/fill-bake/dist/index.js +8 -3
  92. package/dist/packages/internal/fill-bake/dist/item-merge.js +119 -0
  93. package/dist/packages/internal/fill-bake/dist/item-overrides.js +28 -0
  94. package/dist/packages/internal/fill-bake/dist/linked-merge.js +40 -0
  95. package/dist/packages/internal/fill-bake/dist/list-grammar.js +175 -0
  96. package/dist/packages/internal/fill-vocabulary/dist/holder.js +51 -0
  97. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +390 -0
  98. package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -23
  99. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +1 -1
  100. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +75 -0
  101. package/dist/packages/internal/format-geometry/dist/capture.js +11 -147
  102. package/dist/packages/internal/format-geometry/dist/format.d.ts +8 -2
  103. package/dist/packages/internal/format-geometry/dist/geometry.js +13 -2
  104. package/dist/packages/internal/image-ladder/dist/encode.js +27 -14
  105. package/dist/packages/internal/image-ladder/dist/index.js +3 -3
  106. package/dist/packages/internal/image-ladder/dist/policy.js +28 -53
  107. package/dist/packages/internal/island-runtime/dist/capture-holds.js +1 -1
  108. package/dist/packages/internal/island-runtime/dist/contract.d.ts +3 -12
  109. package/dist/packages/internal/island-runtime/dist/contract.js +2 -2
  110. package/dist/packages/internal/island-runtime/dist/index.d.ts +3 -7
  111. package/dist/packages/internal/island-runtime/dist/index.js +2 -1
  112. package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +1 -1
  113. package/dist/packages/internal/media-resolution/dist/crop-key.js +7 -0
  114. package/dist/packages/internal/media-resolution/dist/document.js +63 -0
  115. package/dist/packages/internal/media-resolution/dist/image.js +228 -0
  116. package/dist/packages/internal/media-resolution/dist/index.js +11 -0
  117. package/dist/packages/internal/media-resolution/dist/list.js +112 -0
  118. package/dist/packages/internal/media-resolution/dist/media.js +59 -0
  119. package/dist/packages/internal/media-resolution/dist/records.js +7 -0
  120. package/dist/packages/internal/media-resolution/dist/slot.js +34 -0
  121. package/dist/packages/internal/media-resolution/dist/store.js +19 -0
  122. package/dist/packages/internal/media-resolution/dist/tour.js +59 -0
  123. package/dist/packages/internal/media-resolution/dist/video.js +93 -0
  124. package/dist/packages/internal/property-facts/dist/registry-facts.js +244 -0
  125. package/dist/packages/internal/section-contracts/dist/cap-contract.js +8 -17
  126. package/dist/packages/internal/section-contracts/dist/catalog.js +35 -27
  127. package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +11 -2
  128. package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +27 -0
  129. package/dist/packages/internal/section-contracts/dist/fill-options.js +12 -0
  130. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -0
  131. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +95 -0
  132. package/dist/packages/internal/section-contracts/dist/grammar-scope.js +154 -0
  133. package/dist/packages/internal/section-contracts/dist/index.js +7 -5
  134. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +23 -19
  135. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +12 -7
  136. package/dist/packages/internal/section-contracts/dist/list-source-contract.js +46 -0
  137. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +11 -2
  138. package/dist/packages/internal/section-contracts/dist/object-contract.js +92 -0
  139. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +5 -5
  140. package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +63 -0
  141. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +7 -4
  142. package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +83 -0
  143. package/dist/packages/internal/section-contracts/dist/row-source-contract.js +67 -0
  144. package/dist/packages/internal/section-contracts/dist/runners.js +77 -33
  145. package/dist/packages/internal/section-contracts/dist/select-contract.js +0 -8
  146. package/dist/packages/internal/section-contracts/dist/source-contract.js +120 -66
  147. package/dist/packages/internal/section-contracts/dist/sources-contract.js +47 -17
  148. package/dist/packages/internal/section-contracts/dist/table-member.js +16 -0
  149. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +43 -18
  150. package/dist/packages/internal/source-resolution/dist/index.js +113 -118
  151. package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +16 -0
  152. package/dist/packages/internal/street-address/dist/index.js +72 -0
  153. package/dist/packages/internal/template-artifact/dist/asset-mime.js +30 -0
  154. package/dist/packages/internal/template-artifact/dist/layout.js +1 -2
  155. package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
  156. package/dist/packages/internal/template-artifact/dist/verify.js +12 -29
  157. package/dist/packages/internal/template-contracts/dist/address-value.d.ts +52 -0
  158. package/dist/packages/internal/template-contracts/dist/address-value.js +90 -0
  159. package/dist/packages/internal/template-contracts/dist/comparable-address.js +19 -0
  160. package/dist/{schema → packages/internal/template-contracts/dist}/compute.d.ts +29 -6
  161. package/dist/{schema → packages/internal/template-contracts/dist}/compute.js +11 -13
  162. package/dist/packages/internal/template-contracts/dist/content-pick.js +51 -0
  163. package/dist/packages/internal/template-contracts/dist/decision-fills.js +85 -0
  164. package/dist/packages/internal/template-contracts/dist/display-overrides.js +7 -0
  165. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +16 -5
  166. package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +24 -0
  167. package/dist/packages/internal/template-contracts/dist/fact-compute.js +30 -0
  168. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +44 -0
  169. package/dist/packages/internal/template-contracts/dist/fact-keys.js +88 -0
  170. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +290 -0
  171. package/dist/packages/internal/template-contracts/dist/fact-registry.js +598 -0
  172. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +12 -36
  173. package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +157 -0
  174. package/dist/packages/internal/template-contracts/dist/fill-builders.js +79 -0
  175. package/dist/packages/internal/template-contracts/dist/fill-declaration.d.ts +14 -0
  176. package/dist/{schema → packages/internal/template-contracts/dist}/fill-declaration.js +6 -5
  177. package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +158 -0
  178. package/dist/packages/internal/template-contracts/dist/fill-spec.js +291 -0
  179. package/dist/packages/internal/template-contracts/dist/findable.js +8 -0
  180. package/dist/packages/internal/template-contracts/dist/floor-presets.js +13 -0
  181. package/dist/packages/internal/template-contracts/dist/icon-names.d.ts +5 -0
  182. package/dist/packages/internal/template-contracts/dist/icon-names.js +70 -0
  183. package/dist/packages/internal/template-contracts/dist/legacy-facts.js +167 -0
  184. package/dist/packages/internal/template-contracts/dist/list-editing.js +94 -0
  185. package/dist/packages/internal/template-contracts/dist/list.d.ts +215 -0
  186. package/dist/packages/internal/template-contracts/dist/list.js +258 -0
  187. package/dist/packages/internal/template-contracts/dist/markers.d.ts +2 -2
  188. package/dist/packages/internal/template-contracts/dist/media-candidates.js +38 -0
  189. package/dist/packages/internal/template-contracts/dist/mirror-kind.js +48 -0
  190. package/dist/packages/internal/template-contracts/dist/number-display.js +10 -0
  191. package/dist/packages/internal/template-contracts/dist/object.d.ts +89 -0
  192. package/dist/packages/internal/template-contracts/dist/object.js +131 -0
  193. package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +1 -1
  194. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.d.ts +1 -0
  195. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +162 -0
  196. package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +77 -0
  197. package/dist/packages/internal/template-contracts/dist/process-builders.js +73 -0
  198. package/dist/packages/internal/template-contracts/dist/read-graph.js +250 -0
  199. package/dist/packages/internal/template-contracts/dist/ref-locate.js +192 -0
  200. package/dist/packages/internal/template-contracts/dist/registry-aliases.js +77 -0
  201. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +268 -0
  202. package/dist/packages/internal/template-contracts/dist/registry-facts.js +202 -0
  203. package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +41 -0
  204. package/dist/packages/internal/template-contracts/dist/registry-shape.js +135 -0
  205. package/dist/packages/internal/template-contracts/dist/resolve-scope.js +103 -0
  206. package/dist/packages/internal/{image-descriptor/dist/index.d.ts → template-contracts/dist/responsive-image.d.ts} +1 -1
  207. package/dist/packages/internal/template-contracts/dist/row-planners.js +29 -0
  208. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +133 -0
  209. package/dist/packages/internal/template-contracts/dist/row-ref.js +101 -0
  210. package/dist/packages/internal/template-contracts/dist/row-sources.js +48 -8
  211. package/dist/packages/internal/template-contracts/dist/row.d.ts +155 -0
  212. package/dist/packages/internal/template-contracts/dist/row.js +84 -0
  213. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +97 -0
  214. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +782 -0
  215. package/dist/packages/internal/template-contracts/dist/slot-builders.js +233 -0
  216. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +243 -384
  217. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +334 -230
  218. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +21 -0
  219. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +155 -0
  220. package/dist/packages/internal/template-contracts/dist/slot-ref.js +76 -0
  221. package/dist/packages/internal/template-contracts/dist/slot-types.d.ts +163 -0
  222. package/dist/packages/internal/template-contracts/dist/slot-types.js +140 -0
  223. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +97 -0
  224. package/dist/packages/internal/template-contracts/dist/table-members.d.ts +25 -0
  225. package/dist/packages/internal/template-contracts/dist/table-members.js +90 -0
  226. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +5 -5
  227. package/dist/packages/internal/template-contracts/dist/value-contracts.js +15 -0
  228. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +2 -2
  229. package/dist/platform/fs.js +5 -2
  230. package/dist/playground/canvas-island-host.d.ts +11 -0
  231. package/dist/playground/canvas-island-host.js +29 -0
  232. package/dist/playground/canvas-markers.js +14 -0
  233. package/dist/playground-island-runtime.d.ts +3 -2
  234. package/dist/playground-island-runtime.js +3 -2
  235. package/dist/primitives/FrameShell.js +0 -1
  236. package/dist/primitives/Image.d.ts +5 -4
  237. package/dist/primitives/Tour.d.ts +1 -1
  238. package/dist/primitives/Video.d.ts +2 -2
  239. package/dist/primitives/index.d.ts +2 -3
  240. package/dist/primitives/picture-sources.js +2 -2
  241. package/dist/primitives/probe-context.js +2 -12
  242. package/dist/primitives/slot-address.d.ts +44 -0
  243. package/dist/primitives/slot-address.js +19 -0
  244. package/dist/primitives/slot-bindings.d.ts +65 -26
  245. package/dist/primitives/slot-bindings.js +104 -46
  246. package/dist/primitives/slot-document.d.ts +23 -18
  247. package/dist/primitives/slot-document.js +39 -14
  248. package/dist/primitives/slot-download.d.ts +39 -0
  249. package/dist/primitives/slot-download.js +39 -0
  250. package/dist/primitives/slot-list.d.ts +3 -3
  251. package/dist/primitives/slot-list.js +0 -2
  252. package/dist/primitives/slot-media.d.ts +24 -5
  253. package/dist/primitives/slot-media.js +6 -9
  254. package/dist/primitives/slot-object.d.ts +49 -0
  255. package/dist/primitives/slot-object.js +20 -0
  256. package/dist/primitives/slot-scalar.d.ts +27 -2
  257. package/dist/primitives/slot-scalar.js +50 -7
  258. package/dist/primitives/slot.d.ts +13 -6
  259. package/dist/primitives/slot.js +10 -3
  260. package/dist/rules/registry.js +19 -30
  261. package/dist/schema/define-schema.d.ts +4 -8
  262. package/dist/schema/define-schema.js +178 -79
  263. package/dist/schema/extract-fill-spec.js +2 -158
  264. package/dist/schema/fact.d.ts +57 -15
  265. package/dist/schema/fact.js +42 -7
  266. package/dist/schema/facts-view.d.ts +14 -0
  267. package/dist/schema/format.d.ts +1 -0
  268. package/dist/schema/format.js +2 -1
  269. package/dist/schema/manifest.js +24 -0
  270. package/dist/schema/property-facts.d.ts +8 -11
  271. package/dist/schema/section-props.d.ts +2 -66
  272. package/dist/schema/section-schema.d.ts +8 -11
  273. package/dist/schema/section-schema.js +27 -10
  274. package/dist/section/declare.d.ts +18 -7
  275. package/dist/section/declare.js +18 -5
  276. package/dist/section/materialize.js +3 -8
  277. package/dist/section/section.d.ts +12 -8
  278. package/dist/section/section.js +1 -1
  279. package/dist/template/logic-shim.d.ts +14 -7
  280. package/dist/template/logic-shim.js +14 -7
  281. package/dist/template/materialize.js +17 -18
  282. package/dist/template/mirror-types.js +30 -31
  283. package/dist/template/section-reads.js +85 -9
  284. package/guide/reference/cli/INDEX.md +2 -2
  285. package/guide/reference/cli/build.md +1 -1
  286. package/guide/reference/cli/check.md +1 -1
  287. package/guide/reference/cli/dev.md +1 -1
  288. package/guide/reference/cli/property-add.md +1 -1
  289. package/guide/reference/cli/property-list.md +2 -2
  290. package/guide/reference/cli/publish.md +1 -1
  291. package/guide/reference/cli/upgrade.md +1 -1
  292. package/guide/reference/rules/INDEX.md +29 -29
  293. package/package.json +9 -8
  294. package/dist/artifact/playground/client/assets/index-CckS2ONm.css +0 -1
  295. package/dist/artifact/playground/client/assets/index-D8eepVr-.js +0 -1101
  296. package/dist/fixtures/canonical.d.ts +0 -166
  297. package/dist/fixtures/media.js +0 -163
  298. package/dist/packages/internal/fill-vocabulary/dist/origination.js +0 -111
  299. package/dist/packages/internal/format-geometry/dist/index.js +0 -4
  300. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +0 -10
  301. package/dist/packages/internal/property-facts/dist/index.js +0 -3
  302. package/dist/packages/internal/property-facts/dist/property-facts-Cy7-O4p0.js +0 -189
  303. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +0 -20
  304. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +0 -20
  305. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +0 -22
  306. package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +0 -24
  307. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +0 -15
  308. package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -22
  309. package/dist/packages/internal/template-contracts/dist/facts-view.js +0 -111
  310. package/dist/packages/internal/template-contracts/dist/select-key.js +0 -7
  311. package/dist/primitives/slot-group.d.ts +0 -40
  312. package/dist/primitives/slot-group.js +0 -36
  313. package/dist/schema/extract-used-facts.js +0 -34
  314. package/dist/schema/fill-builders.d.ts +0 -115
  315. package/dist/schema/fill-builders.js +0 -25
  316. package/dist/schema/fill-declaration.d.ts +0 -14
  317. package/dist/schema/fill-spec.js +0 -89
  318. package/dist/schema/layout.d.ts +0 -30
  319. package/dist/schema/layout.js +0 -14
  320. package/dist/schema/row-fields.js +0 -88
  321. package/dist/schema/row-ref.d.ts +0 -59
  322. package/dist/schema/row-ref.js +0 -28
  323. package/dist/schema/runtime-values.d.ts +0 -71
  324. package/dist/schema/section-nav.js +0 -14
  325. package/dist/schema/slot-builders.d.ts +0 -613
  326. package/dist/schema/slot-builders.js +0 -177
  327. package/dist/schema/slot-ref.d.ts +0 -79
  328. package/dist/schema/slot-ref.js +0 -41
  329. package/dist/schema/slot-types.d.ts +0 -111
  330. package/dist/schema/slot-types.js +0 -214
  331. package/dist/section/groups.js +0 -68
@@ -1,613 +0,0 @@
1
- import { CollectionField, LinkKind, LinkProviderId, SourceFieldName, VideoSource, WritableSourceFieldName } from "../packages/internal/template-contracts/dist/slot-catalog.js";
2
- import { FillBinding, FillFor } from "./fill-builders.js";
3
- import { FillMark } from "./fill-declaration.js";
4
- import { ListFieldSlot, ListItemSlot } from "./slot-types.js";
5
- import { RefValue, RowRef, SiblingSlot, SlotRef } from "./slot-ref.js";
6
- import { ComputeBinding } from "./compute.js";
7
- import { VideoValue } from "../packages/internal/template-contracts/dist/video-value.js";
8
- import { TourValue } from "../packages/internal/template-contracts/dist/tour-value.js";
9
- import { ImageValue, PlaybackConfig } from "./runtime-values.js";
10
- import { RowOf } from "./row-ref.js";
11
- import { BoundRowValue, RowValue, SlotValue } from "./section-props.js";
12
- //#region src/schema/slot-builders.d.ts
13
- /**
14
- * Where a slot's value comes from: the `direct` literal a `fact.*` entry emits
15
- * into a builder's `source`, or the `derived` literal `defineSchema` rewrites a
16
- * `compute()` binding to — whose `transform` is always the slot's own key.
17
- */
18
- type SlotSource = {
19
- kind: "direct";
20
- field: SourceFieldName;
21
- } | {
22
- kind: "derived";
23
- transform: string;
24
- };
25
- type SourceMark<HasSource extends SourceBinding | undefined> = HasSource extends SlotSource | ComputeBinding<unknown> | RowRef ? {
26
- source: HasSource;
27
- } : HasSource extends MirrorSource ? {
28
- source: ComputeBinding<unknown>;
29
- } : unknown;
30
- /**
31
- * A MIRROR's `source:` — another slot, whose value this slot IS: another section's
32
- * slot ref (`Hero.slots.title`, `Video.display.variant`) or, inside one section, a
33
- * sibling slot's own const. The builder rewrites it to the identity `compute()` over
34
- * that one read, so the slot settles, propagates and takes a user's whole-slot
35
- * override exactly as a computed slot does. Nothing writes through to the upstream.
36
- */
37
- type MirrorSource = SlotRef | SiblingSlot;
38
- /** Everything a builder's `source:` takes: a fact, a row member, a `compute()`, a mirrored slot, or a `fill()`. */
39
- type SourceBinding = SlotSource | RowRef | ComputeBinding<unknown> | MirrorSource | FillBinding;
40
- /** The value a mirror's upstream holds — a ref's phantom, or a sibling slot's own value type. */
41
- type MirroredValue<Upstream> = Upstream extends SlotRef ? RefValue<Upstream> : SlotValue<Upstream>;
42
- /**
43
- * The value-type check a mirror or a row member owes: the upstream's value type must
44
- * be assignable to this slot kind's `CV` — what a `compute()` here must return. A
45
- * projection or a join is a `compute()`, never a mirror. A mismatch demands a key no
46
- * author can supply, so the compile error names both types. Any other `source` owes
47
- * nothing.
48
- */
49
- type MirrorOption<HasSource, CV> = HasSource extends MirrorSource ? [MirroredValue<HasSource>] extends [CV] ? unknown : {
50
- "a mirrored slot's value type must be assignable to this slot's": [upstream: MirroredValue<HasSource>, slot: CV];
51
- } : HasSource extends RowRef<string, infer Member> ? [Member] extends [CV] ? unknown : {
52
- "a row member's value type must be assignable to this slot's": [member: Member, slot: CV];
53
- } : unknown;
54
- /**
55
- * The `writeback` key a builder's options must carry, decided by the slot's
56
- * `source`. A direct fact binding or a row member REQUIRES the boolean —
57
- * `true`/`false` where the catalog entry or the member is writable, the literal
58
- * `false` where it is read-only, so the answer to "do edits propagate?" is visible
59
- * without opening the catalog. A `compute()` binding and an unsourced (AI-filled /
60
- * authored) slot admit no `writeback` key at all: nothing can write back through a
61
- * derivation, and propagation is meaningless for generated content.
62
- */
63
- type WritebackOption<HasSource extends SourceBinding | undefined> = HasSource extends {
64
- kind: "direct";
65
- field: infer F;
66
- } ? [F] extends [WritableSourceFieldName] ? {
67
- writeback: boolean;
68
- } : {
69
- writeback: false;
70
- } : HasSource extends RowRef<string, unknown, infer Writable> ? [Writable] extends [true] ? {
71
- writeback: boolean;
72
- } : {
73
- writeback: false;
74
- } : {
75
- writeback?: never;
76
- };
77
- /**
78
- * An `image` slot's crop — the ASSET's contract: what the cropper cuts, and which cut
79
- * a viewport is served. It paints no box; the rendered box is your own classes.
80
- * `mode` picks the cropper behavior ("locked" keeps `aspect`, w/h; "free" resizes any
81
- * edge), `aspectLabel` is the cropper's pill text. `mobile` declares a distinct second
82
- * cut for narrow viewports: the cropper offers a desktop/mobile toggle at its `aspect`,
83
- * and `<Image>` serves that cut below `breakpoint` — a VIEWPORT width, the only thing a
84
- * `<picture><source media>` can switch on. `Slot.Image` reads it off the slot; a raw
85
- * `<Image>` takes the same number as `mobileBreakpoint`.
86
- */
87
- interface CropConfig {
88
- mode: "locked" | "free";
89
- aspect?: number;
90
- aspectLabel?: string;
91
- mobile?: {
92
- aspect: number;
93
- breakpoint: number;
94
- };
95
- }
96
- interface CommonOptions<CV = never, F = never> {
97
- label: string;
98
- locked?: boolean;
99
- source?: SlotSource | RowRef | ComputeBinding<CV> | MirrorSource | F;
100
- writeback?: boolean;
101
- placeholder?: string;
102
- when?: string | readonly string[];
103
- }
104
- interface Head {
105
- locked?: true;
106
- label: string;
107
- source?: SlotSource | RowRef | ComputeBinding<unknown>;
108
- writeback?: boolean;
109
- placeholder?: string;
110
- when?: string | readonly string[];
111
- }
112
- /** The fill a `text` slot takes: it is written, so a lower `cap` and `none` both bind. */
113
- type TextFill = FillFor<"cap" | "none">;
114
- interface TextOptions extends CommonOptions<string | null, TextFill> {
115
- cap?: number;
116
- }
117
- /** The serialized shape `text.short`/`.medium`/`.long` emit — a `text`-kind `SlotDef`. */
118
- interface TextSlotDef<Size extends "short" | "medium" | "long"> extends Head {
119
- type: "text";
120
- size: Size;
121
- cap?: number;
122
- }
123
- /**
124
- * The text slot, sized by the member you pick: `text.short` / `.medium` / `.long`.
125
- *
126
- * `cap` is the slot's character budget and the ONLY declaration of it: it bounds
127
- * what a user may type in the editor, and a `fill()` producing the slot inherits it
128
- * as the budget the model writes to. A filled slot must declare one; the fill's own
129
- * `cap` only ever asks for something strictly shorter.
130
- * @example
131
- * ```ts
132
- * import { fact, fill, text } from "@homepages/concrete";
133
- *
134
- * text.medium({
135
- * cap: 60,
136
- * label: "Headline",
137
- * source: fill({
138
- * reads: [fact.property.address, fact.description],
139
- * brief: "A marketing headline in one sentence. Confident, no exclamation marks.",
140
- * }),
141
- * });
142
- * ```
143
- */
144
- declare const text: {
145
- short: <const HasSource extends SourceBinding | undefined = undefined>(opts: TextOptions & {
146
- source?: HasSource | undefined;
147
- } & WritebackOption<HasSource> & MirrorOption<HasSource, string | null>) => TextSlotDef<"short"> & SourceMark<HasSource> & FillMark;
148
- medium: <const HasSource extends SourceBinding | undefined = undefined>(opts: TextOptions & {
149
- source?: HasSource | undefined;
150
- } & WritebackOption<HasSource> & MirrorOption<HasSource, string | null>) => TextSlotDef<"medium"> & SourceMark<HasSource> & FillMark;
151
- long: <const HasSource extends SourceBinding | undefined = undefined>(opts: TextOptions & {
152
- source?: HasSource | undefined;
153
- } & WritebackOption<HasSource> & MirrorOption<HasSource, string | null>) => TextSlotDef<"long"> & SourceMark<HasSource> & FillMark;
154
- };
155
- interface NumberOptions extends CommonOptions<number | null> {
156
- prefix?: string;
157
- suffix?: string;
158
- thousandsSep?: boolean;
159
- decimals?: boolean;
160
- maxDigits?: number;
161
- }
162
- /** The serialized shape the `number` builder emits — a `number`-kind `SlotDef`. */
163
- interface NumberSlotDef extends Head {
164
- type: "number";
165
- prefix?: string;
166
- suffix?: string;
167
- thousandsSep?: boolean;
168
- decimals?: boolean;
169
- maxDigits?: number;
170
- }
171
- /**
172
- * A numeric slot. `prefix`/`suffix` are rendered strings (such as `"$"` /
173
- * `" sq ft"`), `thousandsSep` toggles grouping-separator formatting, `decimals`
174
- * toggles decimal display, and `maxDigits` caps the digit count — all read by
175
- * the renderer's number formatting, not enforced as an input range.
176
- *
177
- * Binding-only: no fill produces a number, so `source` takes a fact, a slot or a
178
- * `compute()`, never a `fill()`.
179
- * @example
180
- * ```ts
181
- * import { fact, number } from "@homepages/concrete";
182
- *
183
- * number({ source: fact.unit.sqft, writeback: true, label: "Square feet", thousandsSep: true, suffix: "sqft", maxDigits: 7 });
184
- * ```
185
- */
186
- declare function number<const HasSource extends SourceBinding | undefined = undefined>(opts: NumberOptions & {
187
- source?: HasSource;
188
- } & WritebackOption<HasSource> & MirrorOption<HasSource, number | null>): NumberSlotDef & SourceMark<HasSource>;
189
- /** One authored select choice: a bare string (value === label) or a stored key with display text. */
190
- type SelectOptionInput = string | {
191
- value: string;
192
- label: string;
193
- };
194
- /**
195
- * The serialized shape a select slot emits — a `select`-kind `SlotDef`.
196
- * `values` (the authored `options`, stored under their old name) and
197
- * `options.source` (a fact-derived vocabulary) are mutually exclusive: which one is
198
- * present depends on whether the slot was built with `select({ options })` or
199
- * `select({ source: fact.… })`. `unique` rides only on a record row's field; a
200
- * list's single item hands it to the list (`list({ item })`), which stores it there.
201
- */
202
- interface SelectSlotDef extends Head {
203
- type: "select";
204
- values?: SelectOptionInput[];
205
- options?: {
206
- source: string;
207
- };
208
- creatable?: boolean;
209
- unique?: true;
210
- }
211
- /** The one source that supplies a select's vocabulary: a direct fact binding. */
212
- type FactSource = Extract<SlotSource, {
213
- kind: "direct";
214
- }>;
215
- interface SelectFactOptions extends Omit<CommonOptions<never>, "source"> {
216
- creatable?: boolean;
217
- options?: never;
218
- unique?: never;
219
- }
220
- type SelectFill = FillFor<"none">;
221
- interface SelectChoiceOptions extends Omit<CommonOptions<never>, "source"> {
222
- options: readonly SelectOptionInput[];
223
- creatable?: boolean;
224
- unique?: true;
225
- source?: ComputeBinding<string | null> | MirrorSource | RowRef | SelectFill;
226
- }
227
- /**
228
- * The fill a `meta.display` entry takes: the model picks ONE of the entry's own
229
- * cases. The brief and `reads` alone — an entry always resolves a case, so it
230
- * never abstains, and a pick of one has no count or cap.
231
- */
232
- type DisplayFill = FillFor<never>;
233
- /**
234
- * One `meta.display` entry as authored under `defineSchema`'s `display:` —
235
- * the declared `cases` (the FIRST is the default and the failure posture), an
236
- * optional `locked` opting the entry out of user switching, and its one origin as
237
- * written: `source: compute(fn)` (still a live binding here; `defineSchema` strips
238
- * it into the logic bundle exactly as it does a slot's) or `source: fill({ brief })`.
239
- */
240
- interface DisplayEntryInput<C extends readonly string[] = readonly string[]> {
241
- cases: [...C];
242
- locked?: true;
243
- source?: ComputeBinding<C[number]> | DisplayFill;
244
- }
245
- interface DisplaySelectOptions<C extends readonly [string, ...string[]]> {
246
- options: C;
247
- locked?: boolean;
248
- source?: ComputeBinding<NoInfer<C>[number]> | DisplayFill;
249
- label?: never;
250
- }
251
- /**
252
- * The select builder: a slot, a record row's field, a list's item, or a
253
- * `meta.display` entry, each declared with one options object.
254
- *
255
- * As a slot or field it declares exactly one set of choices:
256
- * `select({ label, options: [...] })` for an authored vocabulary, or
257
- * `select({ label, source: fact.… })` for one the fact supplies. A top-level select
258
- * is bound (or computed) and is never filled. As a record row's field, an authored
259
- * select declares its own origin like every row field: a member of the row, or its
260
- * own `source: fill({ brief })`, which picks this one field's key per row in the
261
- * list's batched call. Inside a list, `unique: true` says a picked value does not
262
- * repeat across the rows.
263
- *
264
- * As a display entry — under `display:`, with no `label` —
265
- * `select({ options: cases, source: compute({ reads }, fn) })` or
266
- * `select({ options: cases, source: fill({ brief }) })` declares a `meta.display`
267
- * `visibility`/`variant`: the first case is the default and the failure posture,
268
- * `locked: true` opts a variant out of user switching, and the entry takes exactly
269
- * one origin.
270
- * @example
271
- * ```ts
272
- * import { compute, fact, fill, select } from "@homepages/concrete";
273
- *
274
- * select({ label: "Status", options: ["for_sale", "sold"] });
275
- * select({ label: "Listing status", source: fact.property.listing_intent, writeback: true });
276
- * select({ label: "Comparable status", options: ["regular", "highlight"], source: fill({ brief: "Highlight the two or three strongest sales." }) });
277
- * select({ options: ["visible", "hidden"], source: compute({ reads: [fact.tours] }, (tours) => (tours.length > 0 ? "visible" : "hidden")) });
278
- * select({ options: ["classic", "editorial"], source: fill({ brief: "Prefer editorial for story-driven narratives." }) });
279
- * ```
280
- */
281
- interface SelectBuilder {
282
- <const C extends readonly [string, ...string[]]>(opts: DisplaySelectOptions<C>): DisplayEntryInput<C>;
283
- <const HasSource extends SourceBinding | undefined = undefined>(opts: SelectChoiceOptions & {
284
- source?: HasSource;
285
- } & WritebackOption<HasSource> & MirrorOption<HasSource, string | null>): SelectSlotDef & SourceMark<HasSource> & FillMark;
286
- <const HasSource extends FactSource>(opts: SelectFactOptions & {
287
- source: HasSource;
288
- } & WritebackOption<HasSource>): SelectSlotDef & SourceMark<HasSource>;
289
- }
290
- /** The select builder — see {@link SelectBuilder}. */
291
- declare const select: SelectBuilder;
292
- interface UrlOptions extends CommonOptions<string | null> {
293
- accepts?: LinkKind | LinkProviderId;
294
- }
295
- /** The serialized shape the `url` builder emits — a `url`-kind `SlotDef`. */
296
- interface UrlSlotDef extends Head {
297
- type: "url";
298
- accepts?: LinkKind | LinkProviderId;
299
- }
300
- /**
301
- * A URL string slot. `accepts` names a single link kind (such as `"tour"`) or
302
- * link-provider id (such as `"matterport"`) the value must match. A link kind
303
- * with no provider behind it admits no url at all, which the type cannot say —
304
- * check time rejects those.
305
- *
306
- * Binding-only: no fill produces a url, so `source` takes a fact, a slot or a
307
- * `compute()`, never a `fill()`.
308
- * @example
309
- * ```ts
310
- * import { url } from "@homepages/concrete";
311
- *
312
- * url({ label: "Tour URL", accepts: "tour" });
313
- * ```
314
- */
315
- declare function url<const HasSource extends SourceBinding | undefined = undefined>(opts: UrlOptions & {
316
- source?: HasSource;
317
- } & WritebackOption<HasSource> & MirrorOption<HasSource, string | null>): UrlSlotDef & SourceMark<HasSource>;
318
- /** The fill a single-asset slot takes: one pick out of that type's pool, which may abstain. */
319
- type AssetFill = FillFor<"none">;
320
- interface AssetRowOptions {
321
- unique?: true;
322
- }
323
- interface ImageOptions extends CommonOptions<ImageValue | null, AssetFill>, AssetRowOptions {
324
- crop?: CropConfig;
325
- }
326
- /** The serialized shape the `image` builder emits — an `image`-kind `SlotDef`. */
327
- interface ImageSlotDef extends Head {
328
- type: "image";
329
- crop?: CropConfig;
330
- unique?: true;
331
- }
332
- /**
333
- * A single image slot — the resolved value is always one `ImageValue`, never a
334
- * list, so it carries no count bounds (a list of them does). `crop` is the asset's
335
- * contract — the editor's cropper and `<Image>`'s mobile-crop switch read it; the box
336
- * the image renders in is the section's own classes.
337
- * `source: fill({ brief })` picks one of the property's photos.
338
- * @example
339
- * ```ts
340
- * import { fill, image } from "@homepages/concrete";
341
- *
342
- * image({ label: "Hero photo", crop: { mode: "locked", aspect: 16 / 9 }, source: fill({ brief: "The strongest exterior." }) });
343
- * ```
344
- */
345
- declare function image<const HasSource extends SourceBinding | undefined = undefined>(opts: ImageOptions & {
346
- source?: HasSource;
347
- } & WritebackOption<HasSource> & MirrorOption<HasSource, ImageValue | null>): ImageSlotDef & SourceMark<HasSource> & FillMark;
348
- type VideoSources = readonly [VideoSource, ...VideoSource[]];
349
- interface VideoOptions extends CommonOptions<VideoValue | null, AssetFill>, AssetRowOptions {
350
- playback?: PlaybackConfig;
351
- sources?: VideoSources;
352
- }
353
- /** The serialized shape the `video` builder emits — a `video`-kind `SlotDef`. */
354
- interface VideoSlotDef extends Head {
355
- type: "video";
356
- playback?: PlaybackConfig;
357
- sources?: VideoSources;
358
- unique?: true;
359
- }
360
- /**
361
- * A single video slot, resolved as a `VideoValue`. Unlike `image`, there is no
362
- * `crop` — a video is selected, never re-edited. `sources` opts into which
363
- * origins the value may come from (`"upload"`, `"link"`); omitted means
364
- * upload-only. `playback` configures the renderer's `<Video>`; the box it plays
365
- * in is your own classes.
366
- * `source: fill({ brief })` picks one of the property's videos.
367
- * @example
368
- * ```ts
369
- * import { video } from "@homepages/concrete";
370
- *
371
- * video({ label: "Property video", playback: { controls: true }, sources: ["upload", "link"] });
372
- * ```
373
- */
374
- declare function video<const HasSource extends SourceBinding | undefined = undefined>(opts: VideoOptions & {
375
- source?: HasSource;
376
- } & WritebackOption<HasSource> & MirrorOption<HasSource, VideoValue | null>): VideoSlotDef & SourceMark<HasSource> & FillMark;
377
- type TourOptions = CommonOptions<TourValue | null, AssetFill> & AssetRowOptions;
378
- /** The serialized shape the `tour` builder emits — a `tour`-kind `SlotDef`. */
379
- interface TourSlotDef extends Head {
380
- type: "tour";
381
- unique?: true;
382
- }
383
- /**
384
- * A single 3D-tour slot, resolved as a `TourValue`. Its own kind rather than a
385
- * third video source: `playback` is meaningless on a walkthrough, and the fill
386
- * pool would otherwise mix videos with tour models. It has no type-specific
387
- * option at all — no `crop` (a tour is selected, never edited), no `playback`,
388
- * no `sources` and no `accepts`; which providers are admitted widens in the
389
- * link-provider catalog, never on a slot, and the box the embed fills is your
390
- * own classes.
391
- *
392
- * Render it with `<Slot.Tour>` for the embed, `<Slot.Image>` for the tour's
393
- * thumbnail, or both — two positions from one selection.
394
- * `source: fill({ brief })` picks one of the property's tours.
395
- * @example
396
- * ```ts
397
- * import { fill, tour } from "@homepages/concrete";
398
- *
399
- * tour({ label: "3D tour", source: fill({ brief: "The whole-home walkthrough, not a single-room scan." }) });
400
- * ```
401
- */
402
- declare function tour<const HasSource extends SourceBinding | undefined = undefined>(opts: TourOptions & {
403
- source?: HasSource;
404
- } & WritebackOption<HasSource> & MirrorOption<HasSource, TourValue | null>): TourSlotDef & SourceMark<HasSource> & FillMark;
405
- type StripHead<E> = Omit<E, "locked" | "unique">;
406
- /**
407
- * The serialized shape a single-item list emits — a `list`-kind `SlotDef` carrying
408
- * `element` (never `fields`). `element` is the bare item shape (its `locked` is
409
- * stripped, since a list holds present items, not an editable slot itself).
410
- * `min`/`max` bound the list's item count; `unique` says no two items hold the same
411
- * value — written on the item (`select({ …, unique: true })`, `image({ …, unique: true })`),
412
- * stored here — and is passed through as-authored: this module does not itself
413
- * deduplicate anything.
414
- */
415
- interface ListSlotDef<E> extends Head {
416
- type: "list";
417
- element: E;
418
- min?: number;
419
- max?: number;
420
- unique?: boolean;
421
- }
422
- type ListFillFor<E> = E extends {
423
- type: "text";
424
- } ? FillFor<"count" | "cap" | "none"> : E extends {
425
- type: "poi";
426
- } ? FillFor<"count"> : FillFor<"count" | "none">;
427
- type ListRecordFill = FillFor<"count" | "none">;
428
- /**
429
- * The serialized shape a record list emits — a `list`-kind `SlotDef` carrying
430
- * `fields` (never `element`), plus the record-item surface: `title` (the field whose
431
- * value titles each row). Its fields' declaration order is the row's order; which of
432
- * them share a row is the editor's rule.
433
- */
434
- interface ListRecordSlotDef<I extends Record<string, ListFieldSlot>> extends Head {
435
- type: "list";
436
- fields: I;
437
- title?: string;
438
- min?: number;
439
- max?: number;
440
- }
441
- interface ListHeadOptions {
442
- label: string;
443
- locked?: boolean;
444
- placeholder?: string;
445
- when?: string | readonly string[];
446
- min?: number;
447
- max?: number;
448
- }
449
- /** `list({ item })`: one slot per entry. Its distinctness is the item's `unique`. */
450
- interface ListItemOptions<E> extends ListHeadOptions {
451
- item: E;
452
- fields?: never;
453
- title?: never;
454
- source?: SlotSource | RowRef | ComputeBinding<NonNullable<SlotValue<E>>[]> | MirrorSource | ListFillFor<E>;
455
- writeback?: boolean;
456
- }
457
- /** A collection a record list's rows are baked from: `fact.property.units`, `.contacts` or `.comparables`. */
458
- type CollectionSource = {
459
- readonly kind: "direct";
460
- readonly field: CollectionField;
461
- };
462
- /** Where a record list's rows come from: a collection, a `compute()` or a slot holding rows, or the model. */
463
- type ListRowsSource = CollectionSource | ComputeBinding<readonly object[]> | MirrorSource | ListRecordFill;
464
- /**
465
- * `list({ fields })`: a record per entry. `fields` receives the row reference, whose
466
- * members the `source` decides (`RowOf`); `title` names the field that titles a row.
467
- */
468
- interface ListFieldsOptions<HasSource, I> extends ListHeadOptions {
469
- source?: HasSource;
470
- fields: (row: RowOf<HasSource>) => I;
471
- item?: never;
472
- title?: NoInfer<keyof I & string>;
473
- writeback?: boolean;
474
- }
475
- /**
476
- * One baked row of a record list: the collection's identity key beside each declared
477
- * field — nothing of the collection reaches a row a field does not name. A row the
478
- * model or a `compute()` supplies carries the stamped `id` instead.
479
- */
480
- type DeclaredRow<HasSource, I> = HasSource extends {
481
- kind: "direct";
482
- field: infer C extends CollectionField;
483
- } ? BoundRowValue<C, I> : RowValue<I>;
484
- /** What a `fields` list's rows are typed as, carried as a phantom `SlotValue` reads. */
485
- type DeclaredRowsMark<HasSource, I> = {
486
- readonly __row?: DeclaredRow<HasSource, I>;
487
- };
488
- /**
489
- * The list slot — one primitive for everything multi-item, declared with one options
490
- * object and exactly one of `item` or `fields`.
491
- *
492
- * `item` is one slot per entry: `list({ label: "Features", item: text.short({ label: "Feature", cap: 80 }) })`.
493
- * A select or media item may say `unique: true`: no two entries hold the same value.
494
- *
495
- * `fields` is a record per entry, written as a function of the row reference, whose
496
- * members follow the list's `source`:
497
- *
498
- * - bound to a collection (`fact.property.units`, `.contacts`, `.comparables`), `row`
499
- * offers that collection's members — `unit.beds`, `contact.headshot`, `comp.photo` —
500
- * each a legal row field `source:` (with `writeback`, `true` only on a writable
501
- * member) and a legal `reads` entry of a row field's `fill()` or `compute()`;
502
- * - sourced by a `compute()` or another slot, `row` offers the members of that value's
503
- * rows;
504
- * - sourced by a `fill()`, the model writes each row, and every field declares its own
505
- * `fill()`: a field reads an EARLIER field of its row by that field's const.
506
- *
507
- * Every row field declares its origin — a row member, a `fill()` or a `compute()`. A
508
- * property fact is the same value in every row, so it is read inside a field's
509
- * `reads`, never bound; `fact.unit.*` and `fact.contact.*` name the primary row.
510
- * Inside a list, `unique: true` on a select or media field says its value does not
511
- * repeat across the rows.
512
- *
513
- * Depth is fixed: an item is never a list, a record field is never a record, and a
514
- * field-level list holds a single non-record item.
515
- * @example
516
- * ```ts
517
- * import { fact, fill, image, list, number, text } from "@homepages/concrete";
518
- *
519
- * list({
520
- * label: "Units",
521
- * source: fact.property.units,
522
- * writeback: false,
523
- * title: "unit_label",
524
- * fields: (unit) => ({
525
- * unit_label: text.medium({ label: "Unit name", cap: 40, source: unit.unit_label, writeback: true }),
526
- * beds: number({ label: "Beds", source: unit.beds, writeback: true }),
527
- * floor_plans: list({ label: "Floor plans", source: unit.floor_plans, writeback: false, item: image({ label: "Floor plan" }) }),
528
- * }),
529
- * });
530
- *
531
- * list({
532
- * label: "FAQ",
533
- * source: fill({ count: 6, brief: "Questions a buyer would ask, each on a different topic." }),
534
- * fields: () => {
535
- * const question = text.medium({ label: "Question", cap: 72, source: fill({ brief: "One question." }) });
536
- * return {
537
- * question,
538
- * answer: text.long({ label: "Answer", cap: 300, source: fill({ reads: [fact.description, question], brief: "Answer it." }) }),
539
- * };
540
- * },
541
- * });
542
- * ```
543
- */
544
- interface ListBuilder {
545
- <const E extends ListItemSlot, const HasSource extends SourceBinding | undefined = undefined>(opts: ListItemOptions<E> & {
546
- source?: HasSource;
547
- } & WritebackOption<HasSource> & MirrorOption<HasSource, NonNullable<SlotValue<E>>[]>): ListSlotDef<StripHead<E>> & SourceMark<HasSource> & FillMark;
548
- <const I extends Record<string, ListFieldSlot>, const HasSource extends ListRowsSource | undefined = undefined>(opts: ListFieldsOptions<HasSource, I> & WritebackOption<HasSource>): ListRecordSlotDef<I> & SourceMark<HasSource> & FillMark & DeclaredRowsMark<HasSource, I>;
549
- }
550
- /** The list builder — see {@link ListBuilder}. */
551
- declare const list: ListBuilder;
552
- interface PoiOptions {
553
- label: string;
554
- locked?: boolean;
555
- placeholder?: string;
556
- when?: string | readonly string[];
557
- }
558
- /** The serialized shape the `poi` builder emits — a `poi`-kind `SlotDef`. */
559
- interface PoiSlotDef extends Head {
560
- type: "poi";
561
- }
562
- /**
563
- * A single point of interest — one platform-built place (a `PoiRow`), picked
564
- * in the editor's place search. The platform owns the row's content; there is
565
- * nothing to configure beyond the head. Usable standalone or as a list item
566
- * (`list({ label: "Restaurants", item: poi({ label: "Restaurant" }) })`).
567
- * @example
568
- * ```ts
569
- * import { poi } from "@homepages/concrete";
570
- *
571
- * poi({ label: "Nearest station", placeholder: "Search places…" });
572
- * ```
573
- */
574
- declare function poi(opts: PoiOptions): PoiSlotDef;
575
- interface DocumentOptions extends AssetRowOptions {
576
- label: string;
577
- locked?: boolean;
578
- placeholder?: string;
579
- when?: string | readonly string[];
580
- source?: AssetFill;
581
- }
582
- /** The serialized shape the `document` builder emits — a `document`-kind `SlotDef`. */
583
- interface DocumentSlotDef extends Head {
584
- type: "document";
585
- unique?: true;
586
- }
587
- /**
588
- * A single platform-hosted document — a pdf, spreadsheet, or office file the
589
- * visitor opens in the browser or downloads. The value resolves to one
590
- * `DocumentValue` (served url plus filename, type and size); render it with
591
- * `Slot.Document`, which is one anchor.
592
- *
593
- * Reach for `url({ accepts: "file" })` instead when the file lives somewhere
594
- * else — a Drive or Dropbox link the platform neither stores nor serves.
595
- *
596
- * `source: fill({ brief })` picks one file out of the documents stored on the
597
- * property. The model sees each candidate's filename, file type, and whatever text
598
- * was distilled out of it (a spreadsheet or slide deck carries none, so name the
599
- * file type when it matters). Usable standalone or as a list item — a
600
- * `list({ item: document(…) })` carries its own fill and picks a SET from the same pool.
601
- * @example
602
- * ```ts
603
- * import { document, fill } from "@homepages/concrete";
604
- *
605
- * document({
606
- * label: "Offering brochure",
607
- * source: fill({ brief: "The offering brochure: a multi-page PDF about the whole property, not a single-unit floor plan." }),
608
- * });
609
- * ```
610
- */
611
- declare function document(opts: DocumentOptions): DocumentSlotDef & FillMark;
612
- //#endregion
613
- export { CropConfig, DeclaredRow, DeclaredRowsMark, DisplayEntryInput, DisplayFill, DocumentSlotDef, ImageSlotDef, ListBuilder, ListRecordSlotDef, ListSlotDef, MirrorOption, MirrorSource, NumberSlotDef, PoiSlotDef, SelectBuilder, SelectOptionInput, SelectSlotDef, SlotSource, SourceBinding, SourceMark, TextSlotDef, TourSlotDef, UrlSlotDef, VideoSlotDef, WritebackOption, document, image, list, number, poi, select, text, tour, url, video };