@homepages/concrete 8.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/CHANGELOG.md +988 -0
  2. package/README.md +20 -9
  3. package/codemods/list-grammar.mjs +923 -0
  4. package/codemods/manifest.json +60 -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 +251 -33
  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 +34 -10
  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-verb-contract.js +95 -0
  131. package/dist/packages/internal/section-contracts/dist/grammar-scope.js +154 -0
  132. package/dist/packages/internal/section-contracts/dist/index.js +7 -1
  133. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +15 -20
  134. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +12 -7
  135. package/dist/packages/internal/section-contracts/dist/list-source-contract.js +46 -0
  136. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +11 -2
  137. package/dist/packages/internal/section-contracts/dist/object-contract.js +92 -0
  138. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +5 -5
  139. package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +63 -0
  140. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +7 -4
  141. package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +83 -0
  142. package/dist/packages/internal/section-contracts/dist/row-source-contract.js +67 -0
  143. package/dist/packages/internal/section-contracts/dist/runners.js +74 -10
  144. package/dist/packages/internal/section-contracts/dist/select-contract.js +0 -8
  145. package/dist/packages/internal/section-contracts/dist/source-contract.js +103 -46
  146. package/dist/packages/internal/section-contracts/dist/sources-contract.js +47 -17
  147. package/dist/packages/internal/section-contracts/dist/table-member.js +16 -0
  148. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +42 -21
  149. package/dist/packages/internal/source-resolution/dist/index.js +113 -72
  150. package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +16 -0
  151. package/dist/packages/internal/street-address/dist/index.js +72 -0
  152. package/dist/packages/internal/template-artifact/dist/asset-mime.js +30 -0
  153. package/dist/packages/internal/template-artifact/dist/layout.js +1 -2
  154. package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
  155. package/dist/packages/internal/template-artifact/dist/verify.js +12 -29
  156. package/dist/packages/internal/template-contracts/dist/address-value.d.ts +52 -0
  157. package/dist/packages/internal/template-contracts/dist/address-value.js +90 -0
  158. package/dist/packages/internal/template-contracts/dist/comparable-address.js +19 -0
  159. package/dist/{schema → packages/internal/template-contracts/dist}/compute.d.ts +29 -6
  160. package/dist/{schema → packages/internal/template-contracts/dist}/compute.js +11 -13
  161. package/dist/packages/internal/template-contracts/dist/content-pick.js +51 -0
  162. package/dist/packages/internal/template-contracts/dist/decision-fills.js +85 -0
  163. package/dist/packages/internal/template-contracts/dist/display-overrides.js +7 -0
  164. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +16 -5
  165. package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +24 -0
  166. package/dist/packages/internal/template-contracts/dist/fact-compute.js +30 -0
  167. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +44 -0
  168. package/dist/packages/internal/template-contracts/dist/fact-keys.js +88 -0
  169. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +290 -0
  170. package/dist/packages/internal/template-contracts/dist/fact-registry.js +598 -0
  171. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +10 -24
  172. package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +157 -0
  173. package/dist/packages/internal/template-contracts/dist/fill-builders.js +79 -0
  174. package/dist/packages/internal/template-contracts/dist/fill-declaration.d.ts +14 -0
  175. package/dist/{schema → packages/internal/template-contracts/dist}/fill-declaration.js +6 -5
  176. package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +158 -0
  177. package/dist/packages/internal/template-contracts/dist/fill-spec.js +291 -0
  178. package/dist/packages/internal/template-contracts/dist/findable.js +8 -0
  179. package/dist/packages/internal/template-contracts/dist/floor-presets.js +13 -0
  180. package/dist/packages/internal/template-contracts/dist/icon-names.d.ts +5 -0
  181. package/dist/packages/internal/template-contracts/dist/icon-names.js +70 -0
  182. package/dist/packages/internal/template-contracts/dist/legacy-facts.js +167 -0
  183. package/dist/packages/internal/template-contracts/dist/list-editing.js +94 -0
  184. package/dist/packages/internal/template-contracts/dist/list.d.ts +215 -0
  185. package/dist/packages/internal/template-contracts/dist/list.js +258 -0
  186. package/dist/packages/internal/template-contracts/dist/markers.d.ts +2 -2
  187. package/dist/packages/internal/template-contracts/dist/media-candidates.js +38 -0
  188. package/dist/packages/internal/template-contracts/dist/mirror-kind.js +48 -0
  189. package/dist/packages/internal/template-contracts/dist/number-display.js +10 -0
  190. package/dist/packages/internal/template-contracts/dist/object.d.ts +89 -0
  191. package/dist/packages/internal/template-contracts/dist/object.js +131 -0
  192. package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +1 -1
  193. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.d.ts +1 -0
  194. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +162 -0
  195. package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +77 -0
  196. package/dist/packages/internal/template-contracts/dist/process-builders.js +73 -0
  197. package/dist/packages/internal/template-contracts/dist/read-graph.js +250 -0
  198. package/dist/packages/internal/template-contracts/dist/ref-locate.js +192 -0
  199. package/dist/packages/internal/template-contracts/dist/registry-aliases.js +77 -0
  200. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +268 -0
  201. package/dist/packages/internal/template-contracts/dist/registry-facts.js +202 -0
  202. package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +41 -0
  203. package/dist/packages/internal/template-contracts/dist/registry-shape.js +135 -0
  204. package/dist/packages/internal/template-contracts/dist/resolve-scope.js +103 -0
  205. package/dist/packages/internal/{image-descriptor/dist/index.d.ts → template-contracts/dist/responsive-image.d.ts} +1 -1
  206. package/dist/packages/internal/template-contracts/dist/row-planners.js +29 -0
  207. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +133 -0
  208. package/dist/packages/internal/template-contracts/dist/row-ref.js +101 -0
  209. package/dist/packages/internal/template-contracts/dist/row-sources.js +49 -3
  210. package/dist/packages/internal/template-contracts/dist/row.d.ts +155 -0
  211. package/dist/packages/internal/template-contracts/dist/row.js +84 -0
  212. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +97 -0
  213. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +782 -0
  214. package/dist/packages/internal/template-contracts/dist/slot-builders.js +233 -0
  215. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +243 -384
  216. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +335 -227
  217. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +21 -0
  218. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +155 -0
  219. package/dist/packages/internal/template-contracts/dist/slot-ref.js +76 -0
  220. package/dist/packages/internal/template-contracts/dist/slot-types.d.ts +163 -0
  221. package/dist/packages/internal/template-contracts/dist/slot-types.js +140 -0
  222. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +97 -0
  223. package/dist/packages/internal/template-contracts/dist/table-members.d.ts +25 -0
  224. package/dist/packages/internal/template-contracts/dist/table-members.js +90 -0
  225. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +5 -5
  226. package/dist/packages/internal/template-contracts/dist/value-contracts.js +15 -0
  227. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +2 -2
  228. package/dist/platform/fs.js +5 -2
  229. package/dist/playground/canvas-island-host.d.ts +11 -0
  230. package/dist/playground/canvas-island-host.js +29 -0
  231. package/dist/playground/canvas-markers.js +14 -0
  232. package/dist/playground-island-runtime.d.ts +3 -2
  233. package/dist/playground-island-runtime.js +3 -2
  234. package/dist/primitives/FrameShell.js +0 -1
  235. package/dist/primitives/Image.d.ts +5 -4
  236. package/dist/primitives/Tour.d.ts +1 -1
  237. package/dist/primitives/Video.d.ts +2 -2
  238. package/dist/primitives/index.d.ts +2 -3
  239. package/dist/primitives/picture-sources.js +2 -2
  240. package/dist/primitives/probe-context.js +2 -12
  241. package/dist/primitives/slot-address.d.ts +44 -0
  242. package/dist/primitives/slot-address.js +19 -0
  243. package/dist/primitives/slot-bindings.d.ts +65 -26
  244. package/dist/primitives/slot-bindings.js +104 -46
  245. package/dist/primitives/slot-document.d.ts +23 -18
  246. package/dist/primitives/slot-document.js +39 -14
  247. package/dist/primitives/slot-download.d.ts +39 -0
  248. package/dist/primitives/slot-download.js +39 -0
  249. package/dist/primitives/slot-list.d.ts +3 -3
  250. package/dist/primitives/slot-list.js +0 -2
  251. package/dist/primitives/slot-media.d.ts +24 -5
  252. package/dist/primitives/slot-media.js +6 -9
  253. package/dist/primitives/slot-object.d.ts +49 -0
  254. package/dist/primitives/slot-object.js +20 -0
  255. package/dist/primitives/slot-scalar.d.ts +27 -2
  256. package/dist/primitives/slot-scalar.js +50 -7
  257. package/dist/primitives/slot.d.ts +13 -6
  258. package/dist/primitives/slot.js +10 -3
  259. package/dist/rules/registry.js +19 -30
  260. package/dist/schema/define-schema.d.ts +4 -8
  261. package/dist/schema/define-schema.js +178 -79
  262. package/dist/schema/extract-fill-spec.js +2 -153
  263. package/dist/schema/fact.d.ts +57 -15
  264. package/dist/schema/fact.js +42 -7
  265. package/dist/schema/facts-view.d.ts +14 -0
  266. package/dist/schema/format.d.ts +1 -0
  267. package/dist/schema/format.js +2 -1
  268. package/dist/schema/manifest.js +24 -0
  269. package/dist/schema/property-facts.d.ts +8 -12
  270. package/dist/schema/section-props.d.ts +2 -66
  271. package/dist/schema/section-schema.d.ts +8 -11
  272. package/dist/schema/section-schema.js +27 -10
  273. package/dist/section/declare.d.ts +18 -7
  274. package/dist/section/declare.js +18 -5
  275. package/dist/section/materialize.js +3 -8
  276. package/dist/section/section.d.ts +12 -8
  277. package/dist/section/section.js +1 -1
  278. package/dist/template/logic-shim.d.ts +14 -7
  279. package/dist/template/logic-shim.js +14 -7
  280. package/dist/template/materialize.js +17 -18
  281. package/dist/template/mirror-types.js +30 -31
  282. package/dist/template/section-reads.js +85 -9
  283. package/guide/reference/cli/INDEX.md +2 -2
  284. package/guide/reference/cli/build.md +1 -1
  285. package/guide/reference/cli/check.md +1 -1
  286. package/guide/reference/cli/dev.md +1 -1
  287. package/guide/reference/cli/property-add.md +1 -1
  288. package/guide/reference/cli/property-list.md +2 -2
  289. package/guide/reference/cli/publish.md +1 -1
  290. package/guide/reference/cli/upgrade.md +1 -1
  291. package/guide/reference/rules/INDEX.md +28 -24
  292. package/package.json +9 -8
  293. package/dist/artifact/playground/client/assets/index-CckS2ONm.css +0 -1
  294. package/dist/artifact/playground/client/assets/index-Dn_xT16-.js +0 -1101
  295. package/dist/fixtures/canonical.d.ts +0 -166
  296. package/dist/fixtures/media.js +0 -163
  297. package/dist/packages/internal/fill-vocabulary/dist/origination.js +0 -51
  298. package/dist/packages/internal/format-geometry/dist/index.js +0 -4
  299. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +0 -10
  300. package/dist/packages/internal/property-facts/dist/index.js +0 -3
  301. package/dist/packages/internal/property-facts/dist/property-facts-Cy7-O4p0.js +0 -189
  302. package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +0 -24
  303. package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -22
  304. package/dist/packages/internal/template-contracts/dist/facts-view.js +0 -104
  305. package/dist/packages/internal/template-contracts/dist/select-key.js +0 -7
  306. package/dist/primitives/slot-group.d.ts +0 -40
  307. package/dist/primitives/slot-group.js +0 -36
  308. package/dist/schema/extract-used-facts.js +0 -34
  309. package/dist/schema/fill-builders.d.ts +0 -115
  310. package/dist/schema/fill-builders.js +0 -25
  311. package/dist/schema/fill-declaration.d.ts +0 -14
  312. package/dist/schema/fill-spec.js +0 -98
  313. package/dist/schema/layout.d.ts +0 -30
  314. package/dist/schema/layout.js +0 -14
  315. package/dist/schema/row-fields.js +0 -88
  316. package/dist/schema/row-ref.d.ts +0 -59
  317. package/dist/schema/row-ref.js +0 -28
  318. package/dist/schema/runtime-values.d.ts +0 -71
  319. package/dist/schema/section-nav.js +0 -14
  320. package/dist/schema/slot-builders.d.ts +0 -633
  321. package/dist/schema/slot-builders.js +0 -177
  322. package/dist/schema/slot-ref.d.ts +0 -79
  323. package/dist/schema/slot-ref.js +0 -41
  324. package/dist/schema/slot-types.d.ts +0 -111
  325. package/dist/schema/slot-types.js +0 -214
  326. package/dist/section/groups.js +0 -68
@@ -1,40 +1,61 @@
1
- import { originationFor } from "../../fill-vocabulary/dist/origination.js";
1
+ import { rowTableOf } from "../../template-contracts/dist/ref-locate.js";
2
+ import { listItemFieldsOf, memberSourceOf } from "../../template-contracts/dist/row-sources.js";
3
+ import { holderOf } from "../../fill-vocabulary/dist/holder.js";
4
+ import { impliedVerbOf } from "../../fill-vocabulary/dist/verbs.js";
5
+ import { elementIsFact, grammarSlots, producedSlot, slotInScope } from "./grammar-scope.js";
2
6
  import { plannedFieldsOf } from "./fill-spec-view.js";
3
7
 
4
8
  //#region ../../internal/section-contracts/dist/writer-reads-fact-contract.js
5
- const WRITES = [
6
- "write",
7
- "estimate",
8
- "write-items"
9
- ];
10
- function writes(slot, planned = []) {
9
+ function writes(node, slot, planned = []) {
10
+ if (node.verb !== void 0) return node.verb === "write";
11
11
  if (slot === void 0) return false;
12
- const origination = originationFor(slot, planned);
13
- if (origination === void 0) return false;
14
- return WRITES.includes(origination.kind);
12
+ return impliedVerbOf(slot, planned) === "write" && holderOf(slot).shape !== "objects";
15
13
  }
16
- function readsAFact(reads, rowsAreFacts) {
14
+ function readsAFact(reads, rowsAreFacts, memberIsFact) {
17
15
  return (reads ?? []).some((ref) => {
18
- const kind = ref?.kind;
19
- return kind === "fact" || rowsAreFacts && kind === "row";
16
+ if (ref === null || typeof ref !== "object") return false;
17
+ const kind = ref.kind;
18
+ if (kind === "home") return true;
19
+ if (kind === "element") return memberIsFact(ref);
20
+ if (kind !== "row") return false;
21
+ return "slot" in ref ? memberIsFact(ref) : rowsAreFacts;
20
22
  });
21
23
  }
22
- function assertWriterReadsFactContract(schema, decision, sectionKey) {
24
+ function assertWriterReadsFactContract(schema, decision, sectionKey, fillSpec = { decisions: [decision] }) {
23
25
  if (decision.kind !== "text" && decision.kind !== "number" && decision.kind !== "list") return;
24
26
  const fill = decision;
27
+ const ctx = {
28
+ key: sectionKey,
29
+ schema,
30
+ fillSpec
31
+ };
32
+ const scoped = grammarSlots(schema);
33
+ const memberIsFact = (reader) => (ref) => {
34
+ if (ref.kind === "element") return reader?.container !== void 0 && reader.place === "item-field" && elementIsFact(ctx, reader.container);
35
+ const member = memberSourceOf(ref);
36
+ const row = member === null || reader === void 0 ? void 0 : slotInScope(schema, reader, member.slot);
37
+ return row?.def.type === "row" && rowTableOf(row.def) !== null;
38
+ };
25
39
  const writing = [];
26
40
  let rowsAreFacts = false;
41
+ let fieldsReadAFact = false;
27
42
  for (const slotId of decision.produces) {
28
- const slot = schema.slots[slotId];
43
+ const slot = producedSlot(schema, slotId);
29
44
  if (slot === void 0) continue;
30
- if (originationFor(slot)?.kind === "bound-rows") rowsAreFacts = true;
31
- if (decision.kind === "text" || decision.kind === "number" || writes(slot, plannedFieldsOf(decision))) writing.push(slotId);
32
- for (const field of Object.keys(fill.fields ?? {})) if (writes(slot.fields?.[field])) writing.push(`${slotId}.${field}`);
45
+ const holder = holderOf(slot);
46
+ if (holder.shape === "objects" && holder.bound !== void 0) rowsAreFacts = true;
47
+ if (decision.verb === void 0 && (decision.kind === "text" || decision.kind === "number") || writes(fill, slot, plannedFieldsOf(decision))) writing.push(slotId);
48
+ const itemFields = listItemFieldsOf(slot);
49
+ for (const [field, node] of Object.entries(fill.fields ?? {})) {
50
+ if (writes(node, itemFields?.[field])) writing.push(`${slotId}.${field}`);
51
+ const reader = scoped.find((s) => s.place === "item-field" && s.path === `${slotId}.${field}`);
52
+ if (readsAFact(node.reads, rowsAreFacts, memberIsFact(reader))) fieldsReadAFact = true;
53
+ }
33
54
  }
34
55
  if (writing.length === 0) return;
35
- const fields = Object.values(fill.fields ?? {});
36
- if (readsAFact(fill.reads, false) || fields.some((field) => readsAFact(field.reads, rowsAreFacts))) return;
37
- throw new Error(`Section "${sectionKey}": fill "${decision.id}" writes ${writing.map((w) => `"${w}"`).join(", ")} but reads no fact — its model call is shown exactly its \`reads\`, so it would write from the brief alone. Declare the facts it writes from (\`reads: [fact.description]\`), on the fill or on the row field that writes.`);
56
+ const reader = scoped.find((s) => s.place !== "element" && decision.produces.includes(s.path));
57
+ if (fieldsReadAFact || readsAFact(fill.reads, false, memberIsFact(reader))) return;
58
+ throw new Error(`Section "${sectionKey}": fill "${decision.id}" writes ${writing.map((w) => `"${w}"`).join(", ")} but reads no fact — its model call is shown exactly its \`reads\`, so it would write from the brief alone. Declare the facts it writes from (\`reads: [fact.description]\`), on the fill or on the item field that writes.`);
38
59
  }
39
60
 
40
61
  //#endregion
@@ -1,36 +1,45 @@
1
- import { COLLECTIONS, FACT_GRAPH, FACT_PROJECTIONS, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, SOURCE_FIELDS } from "../../template-contracts/dist/slot-catalog.js";
2
- import { rowMemberOf, rowMemberSources } from "../../template-contracts/dist/row-sources.js";
3
- import { projectFactsView } from "../../template-contracts/dist/facts-view.js";
1
+ import { addressMember, isAddressMember, normalizeAddressValue } from "../../template-contracts/dist/address-value.js";
2
+ import { FACT_GRAPH, FACT_PROJECTIONS, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, SOURCE_FIELDS, TABLES, tableKeyOf } from "../../template-contracts/dist/slot-catalog.js";
3
+ import { memberValueType, tableColumnOfKey } from "../../template-contracts/dist/registry-shape.js";
4
+ import { elementIdentityKey } from "../../template-contracts/dist/ref-locate.js";
5
+ import { isMediaListKey, isRegistryFactKey, readRegistryFact, registryPropertyRoot } from "../../template-contracts/dist/fact-keys.js";
6
+ import { rowIdentityKey, tableFields, tableRowMember } from "../../template-contracts/dist/table-members.js";
7
+ import { elementRowKeys, rowMemberSources } from "../../template-contracts/dist/row-sources.js";
8
+ import { readLegacyFact, readLegacyRows } from "../../template-contracts/dist/legacy-facts.js";
4
9
 
5
10
  //#region ../../internal/source-resolution/dist/index.js
6
- function primaryContact(facts) {
7
- return facts.contacts?.find((c) => c.primary) ?? facts.contacts?.[0];
11
+ function tableKey(table) {
12
+ return typeof table === "string" ? {
13
+ table,
14
+ reading: "legacy"
15
+ } : table;
16
+ }
17
+ function registryTableRows(table, facts) {
18
+ const addresses = Object.entries(tableFields(table)).filter(([, declaration]) => memberValueType(declaration) === "address").map(([name]) => name);
19
+ return facts[table].map((item) => {
20
+ const row = { ...item };
21
+ for (const name of addresses) row[name] = normalizeAddressValue(item[name]);
22
+ return row;
23
+ });
8
24
  }
9
25
  function contactsOf(facts) {
10
- const raw = facts.contacts;
11
- return Array.isArray(raw) ? raw : [];
12
- }
13
- function comparablesOf(facts) {
14
- const raw = facts.comparables;
15
- return Array.isArray(raw) ? raw : [];
26
+ return readLegacyRows(facts, "contacts");
16
27
  }
17
- const CONTACT_ROW = FACT_GRAPH.contacts.row;
18
- const REFERRAL_FIELD_TO_CONTACT_KEY = Object.fromEntries(REFERRAL_FIELDS.map((field) => [field, CONTACT_ROW[field].path]));
28
+ const REFERRAL_FIELD_SET = new Set(REFERRAL_FIELDS);
19
29
  const REFERRAL_IMAGE_FIELD_SET = new Set(REFERRAL_IMAGE_FIELDS);
20
30
  const LOGO_VARIANT_FALLBACK = {
21
31
  logo_dark: {
22
- other: CONTACT_ROW.logo_light.path,
32
+ other: "logo_light",
23
33
  mask: "black"
24
34
  },
25
35
  logo_light: {
26
- other: CONTACT_ROW.logo_dark.path,
36
+ other: "logo_dark",
27
37
  mask: "white"
28
38
  }
29
39
  };
30
40
  function resolveContactCardField(contact, field) {
31
- const key = REFERRAL_FIELD_TO_CONTACT_KEY[field];
32
- if (key === void 0) return null;
33
- const raw = contact?.[key] ?? null;
41
+ if (!REFERRAL_FIELD_SET.has(field)) return null;
42
+ const raw = contact?.[field] ?? null;
34
43
  if (REFERRAL_IMAGE_FIELD_SET.has(field)) {
35
44
  const assetId = typeof raw === "string" && raw.trim().length > 0 ? raw.trim() : null;
36
45
  if (assetId !== null) return { asset_id: assetId };
@@ -48,45 +57,33 @@ function resolveContactCardField(contact, field) {
48
57
  if (raw === null || raw === void 0) return "";
49
58
  return typeof raw === "string" ? raw : String(raw);
50
59
  }
51
- const PRIMARY_CONTACT_FACT_TO_CONTACT_KEY = {
60
+ const PRIMARY_CONTACT_FACT_TO_CONTACT_MEMBER = {
52
61
  primary_contact_name: "name",
53
62
  primary_contact_title: "title",
54
63
  primary_contact_bio: "bio",
55
64
  primary_contact_email: "email",
56
65
  primary_contact_phone: "phone",
57
66
  primary_contact_address: "address",
58
- primary_contact_website_url: "website_url",
59
- primary_contact_avatar_upload_id: "avatar_upload_id",
60
- primary_contact_logo_dark_upload_id: "logo_dark_upload_id",
61
- primary_contact_logo_light_upload_id: "logo_light_upload_id",
62
- primary_contact_instagram_url: "instagram_url",
63
- primary_contact_linkedin_url: "linkedin_url",
64
- primary_contact_x_url: "x_url",
65
- primary_contact_facebook_url: "facebook_url"
67
+ primary_contact_website_url: "website",
68
+ primary_contact_avatar_upload_id: "headshot",
69
+ primary_contact_logo_dark_upload_id: "logo_dark",
70
+ primary_contact_logo_light_upload_id: "logo_light",
71
+ primary_contact_instagram_url: "instagram",
72
+ primary_contact_linkedin_url: "linkedin",
73
+ primary_contact_x_url: "x",
74
+ primary_contact_facebook_url: "facebook"
66
75
  };
67
76
  function primaryContactFactValue(facts, factKey) {
68
- const key = PRIMARY_CONTACT_FACT_TO_CONTACT_KEY[factKey];
77
+ const key = PRIMARY_CONTACT_FACT_TO_CONTACT_MEMBER[factKey];
69
78
  if (key === void 0) return void 0;
70
- const raw = primaryContact({ contacts: contactsOf(facts) })?.[key] ?? null;
79
+ const raw = contactsOf(facts)[0]?.[key] ?? null;
71
80
  return typeof raw === "string" ? raw : null;
72
81
  }
73
- function singleUnitLabelDefault(propertyType) {
74
- switch (propertyType) {
75
- case "single_family": return "Single Family";
76
- case "condo_townhome": return "Condo";
77
- case "multi_family":
78
- case "investment": return null;
79
- default: return null;
80
- }
81
- }
82
- function collectionRowsOf(collection, facts) {
83
- switch (collection) {
84
- case "units": return [...facts.units].sort((a, b) => a.position - b.position);
85
- case "contacts": return contactsOf(facts);
86
- case "comparables": return comparablesOf(facts);
87
- }
82
+ function tableRowsOf(table, facts) {
83
+ const key = tableKey(table);
84
+ return key.reading === "legacy" ? readLegacyRows(facts, key.table) : registryTableRows(key.table, facts);
88
85
  }
89
- const CONTACT_MEMBER_FACT = Object.fromEntries(Object.entries(CONTACT_ROW).filter(([, member]) => member.strength !== void 0).map(([name]) => [name, FACT_PROJECTIONS.contact[name] ?? name]));
86
+ const CONTACT_MEMBER_FACT = Object.fromEntries(Object.entries(FACT_GRAPH.contacts.row).filter(([, member]) => member.primary === true).map(([name]) => [name, FACT_PROJECTIONS.contact[name] ?? name]));
90
87
  function mediaRefOf(raw) {
91
88
  if (typeof raw !== "string") return null;
92
89
  const assetId = raw.trim();
@@ -101,32 +98,69 @@ function mediaRefListOf(raw) {
101
98
  return [ref];
102
99
  });
103
100
  }
104
- function readRowMember(collection, row, member, facts) {
105
- const descriptor = FACT_GRAPH[collection].row[member];
101
+ function readMemberOf(table, row, member) {
102
+ const key = tableKey(table);
103
+ if (key.reading === "legacy") return readLegacyMemberOf(key.table, row, member);
104
+ return readRegistryMemberOf(key.table, row, member);
105
+ }
106
+ function readLegacyMemberOf(table, row, member) {
107
+ const descriptor = FACT_GRAPH[table].row[member];
106
108
  if (descriptor === void 0) return null;
107
- if (collection === "contacts") {
109
+ if (table === "contacts") {
108
110
  const fact = CONTACT_MEMBER_FACT[member];
109
111
  if (fact !== void 0) return resolveContactScalar(row, fact);
110
112
  }
111
- if (collection === "units" && member === "unit_label") return row["unit_label"] ?? singleUnitLabelDefault(facts.property_type);
112
- const raw = row[descriptor.path] ?? null;
113
+ const raw = row[member] ?? null;
113
114
  if (descriptor.value_type === "image") return mediaRefOf(raw);
114
115
  if (descriptor.value_type === "image_list") return mediaRefListOf(raw);
115
116
  return raw;
116
117
  }
117
- function projectCollectionRows(collection, facts, fields, rowComputes = {}) {
118
- const idKey = COLLECTIONS[collection].idKey;
118
+ function readRegistryMemberOf(table, row, path) {
119
+ const lookup = tableRowMember({
120
+ table,
121
+ reading: "registry"
122
+ }, path);
123
+ if (lookup.kind === "identity") return row["id"] ?? null;
124
+ if (lookup.kind === "unknown") return null;
125
+ const dot = path.indexOf(".");
126
+ if (dot === -1) return row[path] ?? null;
127
+ const part = path.slice(dot + 1);
128
+ return isAddressMember(part) ? addressMember(row[path.slice(0, dot)], part) : null;
129
+ }
130
+ function tableRowIds(table, facts) {
131
+ const idKey = rowIdentityKey(tableKey(table));
132
+ return tableRowsOf(table, facts).flatMap((row) => {
133
+ const id = row[idKey];
134
+ return typeof id === "string" ? [id] : [];
135
+ });
136
+ }
137
+ function tableRowById(table, id, facts) {
138
+ const idKey = rowIdentityKey(tableKey(table));
139
+ return tableRowsOf(table, facts).find((row) => row[idKey] === id);
140
+ }
141
+ function readRowMember(table, id, member, facts) {
142
+ const row = tableRowById(table, id, facts);
143
+ return row === void 0 ? null : readMemberOf(table, row, member);
144
+ }
145
+ function projectTableRows(table, facts, fields, rowComputes = {}, ids) {
146
+ const key = tableKey(table);
147
+ const idKey = elementIdentityKey(key.table);
148
+ const rowId = rowIdentityKey(key);
119
149
  const members = rowMemberSources(fields);
120
- return collectionRowsOf(collection, facts).map((row) => {
121
- const out = { [idKey]: row[idKey] };
122
- for (const [key, member] of Object.entries(members)) out[key] = readRowMember(collection, row, member, facts);
123
- for (const [key, compute] of Object.entries(rowComputes)) out[key] = compute((member) => readRowMember(collection, row, member, facts));
150
+ const elementRows = elementRowKeys(fields);
151
+ return (ids === void 0 ? tableRowsOf(table, facts) : ids.flatMap((id) => {
152
+ const row = tableRowById(table, id, facts);
153
+ return row === void 0 ? [] : [row];
154
+ })).map((row) => {
155
+ const out = { [idKey]: row[rowId] };
156
+ for (const field of elementRows) out[field] = row[rowId];
157
+ for (const [field, member] of Object.entries(members)) out[field] = readMemberOf(key, row, member);
158
+ for (const [field, compute] of Object.entries(rowComputes)) out[field] = compute((member) => readMemberOf(key, row, member), row[rowId]);
124
159
  return out;
125
160
  });
126
161
  }
127
162
  function firstUnit(facts) {
128
- if (facts.units.length === 0) return void 0;
129
- return [...facts.units].sort((a, b) => a.position - b.position)[0];
163
+ return tableRowsOf("units", facts)[0];
130
164
  }
131
165
  function resolveUnitScalar(unit, field) {
132
166
  switch (field) {
@@ -139,35 +173,42 @@ function resolveUnitScalar(unit, field) {
139
173
  }
140
174
  }
141
175
  function resolvePropertyScalar(facts, field) {
176
+ const address = readLegacyFact(facts, "address");
142
177
  if (field === "address") {
143
- if (facts.address && typeof facts.address === "object") return facts.address.display ?? null;
144
- return facts.address;
178
+ if (address && typeof address === "object") return address.display ?? null;
179
+ return address;
145
180
  }
146
181
  const part = ADDRESS_PARTS[field];
147
- if (part !== void 0) return readAddressPart(facts.address, part);
182
+ if (part !== void 0) return readAddressPart(address, part);
148
183
  const virtual = primaryContactFactValue(facts, field);
149
184
  if (virtual !== void 0) return virtual;
150
- return facts[field];
185
+ return readLegacyFact(facts, field);
151
186
  }
152
- const CONTACT_FIELD_TO_CONTACT_KEY = Object.fromEntries(Object.entries(FACT_GRAPH).flatMap(([name, entry]) => {
153
- if (entry.role !== "bindable" || entry.container !== "contact") return [];
154
- const key = /^contacts\[\]\.(\w+)$/.exec(entry.path)?.[1];
155
- return key === void 0 ? [] : [[name, key]];
156
- }));
187
+ const CONTACT_FIELD_TO_CONTACT_MEMBER = Object.fromEntries(Object.entries(CONTACT_MEMBER_FACT).map(([member, fact]) => [fact, member]));
157
188
  function resolveContactScalar(contact, field) {
158
- if (REFERRAL_FIELD_TO_CONTACT_KEY[field] !== void 0) return resolveContactCardField(contact, field);
159
- const key = CONTACT_FIELD_TO_CONTACT_KEY[field];
189
+ if (REFERRAL_FIELD_SET.has(field)) return resolveContactCardField(contact, field);
190
+ const key = CONTACT_FIELD_TO_CONTACT_MEMBER[field];
160
191
  if (key === void 0) return null;
161
192
  const raw = contact?.[key] ?? null;
162
193
  if (typeof raw !== "string") return null;
163
194
  const trimmed = raw.trim();
164
195
  return trimmed.length > 0 ? trimmed : null;
165
196
  }
197
+ function readFactRef(facts, key) {
198
+ if (isRegistryFactKey(key)) return readRegistryFact(key, registryPropertyRoot(facts));
199
+ if (isMediaListKey(key)) return facts[key.slice(9)];
200
+ const table = tableKeyOf(key);
201
+ if (table?.reading === "registry") return registryTableRows(table.table, facts);
202
+ const column = tableColumnOfKey(key);
203
+ if (column !== null) return registryTableRows(column.table, facts).map((row) => row[column.member] ?? null);
204
+ return readLegacyFact(facts, key);
205
+ }
166
206
  function readFrom(field, ctx) {
207
+ if (isRegistryFactKey(field)) return readFactRef(ctx.facts, field);
167
208
  const desc = SOURCE_FIELDS[field];
168
209
  if (!desc) return null;
169
- if (Object.hasOwn(COLLECTIONS, field)) return null;
170
- if (desc.container === "contact") return resolveContactScalar(ctx.contact ?? primaryContact(ctx.facts), field);
210
+ if (Object.hasOwn(TABLES, field)) return null;
211
+ if (desc.container === "contact") return resolveContactScalar(ctx.contact ?? contactsOf(ctx.facts)[0], field);
171
212
  if (desc.container === "unit") return resolveUnitScalar(ctx.unit ?? firstUnit(ctx.facts), field);
172
213
  return resolvePropertyScalar(ctx.facts, field);
173
214
  }
@@ -185,4 +226,4 @@ function readAddressPart(address, part) {
185
226
  }
186
227
 
187
228
  //#endregion
188
- export { primaryContact, primaryContactFactValue, projectCollectionRows, projectFactsView, readFrom, readRowMember, resolveContactCardField, rowMemberSources, singleUnitLabelDefault };
229
+ export { primaryContactFactValue, projectTableRows, readFactRef, readFrom, readRowMember, registryTableRows, resolveContactCardField, tableRowById, tableRowIds };
@@ -0,0 +1,16 @@
1
+ //#region ../../internal/static-assets-binding/dist/section-asset-url.js
2
+ const SECTION_ASSET_PREFIX = "/section-assets/";
3
+ const FILENAME = "[A-Za-z0-9._-]+\\.[A-Za-z0-9]+";
4
+ const FILENAME_RE = new RegExp(`^${FILENAME}$`);
5
+ const CANONICAL_REF_RE = new RegExp(`${SECTION_ASSET_PREFIX.replace(/\//g, "\\/")}(${FILENAME})`, "g");
6
+ function sectionAssetPrefix(profile) {
7
+ switch (profile.kind) {
8
+ case "canonical": return SECTION_ASSET_PREFIX;
9
+ case "publishedDocument": return "/assets/";
10
+ case "publishedStylesheet": return "";
11
+ case "canvas": return `${profile.basePath}runtime/section-asset/`;
12
+ }
13
+ }
14
+
15
+ //#endregion
16
+ export { SECTION_ASSET_PREFIX, sectionAssetPrefix };
@@ -0,0 +1,72 @@
1
+ //#region ../../internal/street-address/dist/index.js
2
+ const STREET_SUFFIXES = {
3
+ street: "st",
4
+ str: "st",
5
+ st: "st",
6
+ avenue: "ave",
7
+ aven: "ave",
8
+ av: "ave",
9
+ ave: "ave",
10
+ road: "rd",
11
+ rd: "rd",
12
+ drive: "dr",
13
+ dr: "dr",
14
+ boulevard: "blvd",
15
+ blvd: "blvd",
16
+ lane: "ln",
17
+ ln: "ln",
18
+ court: "ct",
19
+ ct: "ct",
20
+ circle: "cir",
21
+ cir: "cir",
22
+ place: "pl",
23
+ pl: "pl",
24
+ terrace: "ter",
25
+ ter: "ter",
26
+ parkway: "pkwy",
27
+ pkwy: "pkwy",
28
+ highway: "hwy",
29
+ hwy: "hwy",
30
+ way: "way",
31
+ trail: "trl",
32
+ trl: "trl",
33
+ square: "sq",
34
+ sq: "sq",
35
+ loop: "loop",
36
+ point: "pt",
37
+ pt: "pt"
38
+ };
39
+ const DIRECTIONALS = {
40
+ north: "n",
41
+ "n": "n",
42
+ south: "s",
43
+ "s": "s",
44
+ east: "e",
45
+ "e": "e",
46
+ west: "w",
47
+ "w": "w",
48
+ northeast: "ne",
49
+ ne: "ne",
50
+ northwest: "nw",
51
+ nw: "nw",
52
+ southeast: "se",
53
+ se: "se",
54
+ southwest: "sw",
55
+ sw: "sw"
56
+ };
57
+ function joinStreetUnit(street, unit) {
58
+ return [street, unit].map((part) => (part ?? "").trim()).filter((part) => part !== "").join(", ");
59
+ }
60
+ const MIN_NAMED_TOKENS = 2;
61
+ function streetNoType(street) {
62
+ const tokens = (street ?? "").trim().split(/\s+/).filter((token) => token !== "");
63
+ if (tokens.length === 0) return null;
64
+ const word = (index) => (tokens[index] ?? "").replace(/\.$/, "").toLowerCase();
65
+ let end = tokens.length;
66
+ if (end > 3 && DIRECTIONALS[word(end - 1)] !== void 0) end -= 1;
67
+ if (end - 1 >= MIN_NAMED_TOKENS && STREET_SUFFIXES[word(end - 1)] !== void 0) return tokens.slice(0, end - 1).join(" ");
68
+ return tokens.join(" ");
69
+ }
70
+
71
+ //#endregion
72
+ export { joinStreetUnit, streetNoType };
@@ -0,0 +1,30 @@
1
+ //#region ../../internal/template-artifact/dist/asset-mime.js
2
+ const ASSET_MIME = {
3
+ ".svg": "image/svg+xml",
4
+ ".png": "image/png",
5
+ ".jpg": "image/jpeg",
6
+ ".jpeg": "image/jpeg",
7
+ ".gif": "image/gif",
8
+ ".webp": "image/webp",
9
+ ".avif": "image/avif",
10
+ ".ico": "image/x-icon",
11
+ ".woff": "font/woff",
12
+ ".woff2": "font/woff2",
13
+ ".ttf": "font/ttf",
14
+ ".otf": "font/otf",
15
+ ".eot": "application/vnd.ms-fontobject",
16
+ ".mp4": "video/mp4",
17
+ ".webm": "video/webm",
18
+ ".mov": "video/quicktime",
19
+ ".mp3": "audio/mpeg",
20
+ ".wav": "audio/wav",
21
+ ".pdf": "application/pdf",
22
+ ".zip": "application/zip"
23
+ };
24
+ function assetContentType(filename) {
25
+ const ext = filename.slice(filename.lastIndexOf(".")).toLowerCase();
26
+ return ASSET_MIME[ext] ?? "application/octet-stream";
27
+ }
28
+
29
+ //#endregion
30
+ export { ASSET_MIME, assetContentType };
@@ -34,13 +34,12 @@ function playgroundPath(file) {
34
34
  const SECTION_FILES = {
35
35
  schema: "schema.json",
36
36
  fillSpec: "fill-spec.json",
37
- usedFacts: "used-facts.json",
37
+ readGraph: "read-graph.json",
38
38
  logic: "logic.mjs",
39
39
  renderer: "renderer.mjs"
40
40
  };
41
41
  const TEMPLATE_FILES = {
42
42
  composition: "composition.json",
43
- usedFacts: "used-facts.json",
44
43
  stylesheet: "template.css",
45
44
  preview: "preview.json",
46
45
  staticAssets: "static-assets.json"
@@ -11,7 +11,7 @@ const ArtifactSection = z.object({
11
11
  content_hash: Sha256
12
12
  }).strict();
13
13
  const ArtifactManifest = z.object({
14
- artifact_schema: z.literal(2),
14
+ artifact_schema: z.literal(3),
15
15
  framework_version: z.string().min(1),
16
16
  key: z.string().refine(isTemplateKey, "a template key: one path segment"),
17
17
  display_name: z.string().min(1),
@@ -5,8 +5,9 @@ import { ArtifactManifest, readArtifactSchema } from "./manifest.js";
5
5
 
6
6
  //#region ../../internal/template-artifact/dist/verify.js
7
7
  const decoder = new TextDecoder("utf-8", { fatal: true });
8
- const SECTION_FILE_NAMES = new Set(Object.values(SECTION_FILES));
9
- const TEMPLATE_FILE_NAMES = new Set(Object.values(TEMPLATE_FILES));
8
+ const RETIRED_FILE = "used-facts.json";
9
+ const SECTION_FILE_NAMES = /* @__PURE__ */ new Set([...Object.values(SECTION_FILES), RETIRED_FILE]);
10
+ const TEMPLATE_FILE_NAMES = /* @__PURE__ */ new Set([...Object.values(TEMPLATE_FILES), RETIRED_FILE]);
10
11
  const ISLAND_CHUNK = new RegExp(`^${SECTION_ISLANDS_DIR}/[A-Za-z0-9._-]+\\.mjs$`);
11
12
  const FLAT_FILE = /^[A-Za-z0-9._-]+$/;
12
13
  const CLIENT_SEGMENT = /^(?!\.{1,2}$)[A-Za-z0-9._-]+$/;
@@ -31,22 +32,6 @@ function readJson(files, path, problems) {
31
32
  return null;
32
33
  }
33
34
  }
34
- function checkUsedFacts(value, path, problems) {
35
- if (!Array.isArray(value) || !value.every((entry) => typeof entry === "string")) {
36
- problems.push({
37
- path,
38
- message: "used facts must be an array of fact keys, never null"
39
- });
40
- return;
41
- }
42
- for (let i = 1; i < value.length; i++) if (value[i - 1] >= value[i]) {
43
- problems.push({
44
- path,
45
- message: `used facts must be sorted with no repeat; "${value[i]}" follows "${value[i - 1]}"`
46
- });
47
- return;
48
- }
49
- }
50
35
  function composedSections(composition) {
51
36
  const pages = composition?.pages;
52
37
  if (!Array.isArray(pages)) return null;
@@ -70,10 +55,10 @@ function verifyArtifact(files) {
70
55
  problems
71
56
  };
72
57
  const schema = readArtifactSchema(raw.value);
73
- if (schema !== 2) {
58
+ if (schema !== 3) {
74
59
  problems.push({
75
60
  path: MANIFEST_FILE,
76
- message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(2)}` : `artifact_schema ${String(schema)} is not one this reader knows (it knows ${String(2)})`
61
+ message: schema === null ? `carries no integer artifact_schema; this reader knows ${String(3)}` : `artifact_schema ${String(schema)} is not one this reader knows (it knows ${String(3)})`
77
62
  });
78
63
  return {
79
64
  manifest: null,
@@ -171,10 +156,13 @@ function verifyArtifact(files) {
171
156
  const path = sectionPath(section.key, file);
172
157
  if (files.has(path)) readJson(files, path, problems);
173
158
  }
174
- const usedPath = sectionPath(section.key, SECTION_FILES.usedFacts);
175
- if (files.has(usedPath)) {
176
- const used = readJson(files, usedPath, problems);
177
- if (used !== null) checkUsedFacts(used.value, usedPath, problems);
159
+ const graphPath = sectionPath(section.key, SECTION_FILES.readGraph);
160
+ if (files.has(graphPath)) {
161
+ const graph = readJson(files, graphPath, problems);
162
+ if (graph !== null && !Array.isArray(graph.value?.slots)) problems.push({
163
+ path: graphPath,
164
+ message: "a read graph is an object carrying its `slots` array"
165
+ });
178
166
  }
179
167
  let actual;
180
168
  try {
@@ -213,11 +201,6 @@ function verifyArtifact(files) {
213
201
  }
214
202
  }
215
203
  }
216
- const templateUsed = templatePath(TEMPLATE_FILES.usedFacts);
217
- if (files.has(templateUsed)) {
218
- const used = readJson(files, templateUsed, problems);
219
- if (used !== null) checkUsedFacts(used.value, templateUsed, problems);
220
- }
221
204
  if (files.has(templatePath(TEMPLATE_FILES.preview))) readJson(files, templatePath(TEMPLATE_FILES.preview), problems);
222
205
  const bindingPath = templatePath(TEMPLATE_FILES.staticAssets);
223
206
  if (files.has(bindingPath)) {
@@ -0,0 +1,52 @@
1
+ //#region ../../internal/template-contracts/dist/address-value.d.ts
2
+ /**
3
+ * How an address was placed: picked from autocomplete, typed and pinned by hand, or
4
+ * resolved by the platform's lookup for a `fill.find` — its parts and coordinates off
5
+ * the lookup's record, the unit the reference wrote carried beside them.
6
+ */
7
+ declare const ADDRESS_SOURCES: readonly ["autocomplete", "manual_pinned", "resolved"];
8
+ /** One of {@link ADDRESS_SOURCES}. */
9
+ type AddressSource = (typeof ADDRESS_SOURCES)[number];
10
+ /**
11
+ * An address slot's stored value. Every part is `null` when absent — never `""`, so a
12
+ * section tests a part for presence — and the coordinates are a pair: both or neither.
13
+ */
14
+ type AddressValue = {
15
+ /** Street line ("123 Main St"). */
16
+ street: string | null;
17
+ /** Apartment, suite or unit designator ("Apt 4B"). */
18
+ unit: string | null;
19
+ /** City ("Springfield"). */
20
+ city: string | null;
21
+ /** State or region ("IL"). */
22
+ state: string | null;
23
+ /** Postal code ("62704"). */
24
+ postal: string | null;
25
+ /** Latitude of the pin; `null` until the address is geocoded. */
26
+ latitude: number | null;
27
+ /** Longitude of the pin; `null` until the address is geocoded. */
28
+ longitude: number | null;
29
+ /** How the address was placed. */
30
+ source: AddressSource | null;
31
+ };
32
+ /**
33
+ * An address with the lines the platform derives from it beside its stored parts — the
34
+ * facts document's shape of an address. Not what an author reads: an address slot, a
35
+ * registry key and `Slot.Address` offer the {@link AddressValue} alone.
36
+ */
37
+ type AddressView = AddressValue & {
38
+ /** The address as one line: "123 Main St, Apt 4B, Springfield, IL 62704". */
39
+ display: string | null;
40
+ /** The street line without its street type ("123 Main"), for a short label. */
41
+ street_no_type: string | null;
42
+ };
43
+ /**
44
+ * The members an address slot offers a reader (`address.city`): every stored part but
45
+ * `source` — which is a slot's own key, its binding — and nothing derived. Each is
46
+ * read-only: a part edited alone would break the agreement the value holds.
47
+ */
48
+ declare const ADDRESS_MEMBERS: readonly ["street", "unit", "city", "state", "postal", "latitude", "longitude"];
49
+ /** One of {@link ADDRESS_MEMBERS}. */
50
+ type AddressMember = (typeof ADDRESS_MEMBERS)[number];
51
+ //#endregion
52
+ export { ADDRESS_MEMBERS, ADDRESS_SOURCES, AddressMember, AddressSource, AddressValue, AddressView };