@homepages/concrete 1.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 (327) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +174 -0
  3. package/codemods/manifest.json +9 -0
  4. package/dist/artifact/playground/client/assets/index-BSA1yutg.css +1 -0
  5. package/dist/artifact/playground/client/assets/index-JloQyj8h.js +1101 -0
  6. package/dist/artifact/playground/client/index.html +13 -0
  7. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -0
  8. package/dist/artifact/playground/host.mjs +127 -0
  9. package/dist/asset-modules.d.ts +99 -0
  10. package/dist/base.css +220 -0
  11. package/dist/browser/site-config.d.ts +18 -0
  12. package/dist/browser/site-config.js +56 -0
  13. package/dist/browser/submit-lead.d.ts +98 -0
  14. package/dist/browser/submit-lead.js +188 -0
  15. package/dist/browser.d.ts +3 -0
  16. package/dist/browser.js +4 -0
  17. package/dist/cli/build/artifact.js +225 -0
  18. package/dist/cli/build/captures.js +67 -0
  19. package/dist/cli/build/esbuild.js +127 -0
  20. package/dist/cli/build/fixtures.js +96 -0
  21. package/dist/cli/build/icons.js +76 -0
  22. package/dist/cli/build/index.js +38 -0
  23. package/dist/cli/build/playground.js +31 -0
  24. package/dist/cli/build/sections.js +236 -0
  25. package/dist/cli/build/source.js +62 -0
  26. package/dist/cli/build/static.js +156 -0
  27. package/dist/cli/capture/bundle.js +37 -0
  28. package/dist/cli/capture/capture-browser.js +51 -0
  29. package/dist/cli/capture/capture.js +121 -0
  30. package/dist/cli/check/analyze.js +95 -0
  31. package/dist/cli/check/index.js +19 -0
  32. package/dist/cli/check/load-workspace.js +119 -0
  33. package/dist/cli/check/messages.js +16 -0
  34. package/dist/cli/check/render/class-conflicts.js +39 -0
  35. package/dist/cli/check/render/html.js +86 -0
  36. package/dist/cli/check/render/inputs.js +53 -0
  37. package/dist/cli/check/render/invariants.js +58 -0
  38. package/dist/cli/check/render/island-frames.js +72 -0
  39. package/dist/cli/check/render/marker-coverage.js +102 -0
  40. package/dist/cli/check/render/nav.js +64 -0
  41. package/dist/cli/check/report.js +73 -0
  42. package/dist/cli/check/stages/bundles.js +129 -0
  43. package/dist/cli/check/stages/composition.js +67 -0
  44. package/dist/cli/check/stages/contracts.js +22 -0
  45. package/dist/cli/check/stages/dependencies.js +261 -0
  46. package/dist/cli/check/stages/fixtures.js +74 -0
  47. package/dist/cli/check/stages/lint.js +41 -0
  48. package/dist/cli/check/stages/logic.js +63 -0
  49. package/dist/cli/check/stages/render.js +144 -0
  50. package/dist/cli/check/stages/sections.js +83 -0
  51. package/dist/cli/check/stages/stylesheet.js +31 -0
  52. package/dist/cli/check/stages/typecheck.js +68 -0
  53. package/dist/cli/check/stages/workspace.js +26 -0
  54. package/dist/cli/commands.js +342 -0
  55. package/dist/cli/currency/cache.js +89 -0
  56. package/dist/cli/currency/decide.js +65 -0
  57. package/dist/cli/currency/opt-out.js +16 -0
  58. package/dist/cli/currency/preamble.js +183 -0
  59. package/dist/cli/currency/prompt.js +28 -0
  60. package/dist/cli/currency/refresh.js +44 -0
  61. package/dist/cli/currency/resolve-latest.js +185 -0
  62. package/dist/cli/currency/version-order.js +38 -0
  63. package/dist/cli/dev/crop.js +22 -0
  64. package/dist/cli/dev/hmr.js +26 -0
  65. package/dist/cli/dev/http.js +129 -0
  66. package/dist/cli/dev/index.js +70 -0
  67. package/dist/cli/dev/islands.js +390 -0
  68. package/dist/cli/dev/load-template.js +46 -0
  69. package/dist/cli/dev/request-error.js +22 -0
  70. package/dist/cli/dev/server.js +307 -0
  71. package/dist/cli/dev/tsconfig-paths.js +95 -0
  72. package/dist/cli/dev/vite.js +85 -0
  73. package/dist/cli/dev/workspace-reader.js +274 -0
  74. package/dist/cli/io.d.ts +14 -0
  75. package/dist/cli/media/cache.js +125 -0
  76. package/dist/cli/media/derive.js +252 -0
  77. package/dist/cli/media/deriver-plugin.js +71 -0
  78. package/dist/cli/property/index.js +180 -0
  79. package/dist/cli/property/library.js +137 -0
  80. package/dist/cli/publish/client.js +119 -0
  81. package/dist/cli/publish/freshness.js +66 -0
  82. package/dist/cli/publish/git.js +43 -0
  83. package/dist/cli/publish/index.js +207 -0
  84. package/dist/cli/publish/pack.js +78 -0
  85. package/dist/cli/publish/report.js +98 -0
  86. package/dist/cli/publish/target.js +87 -0
  87. package/dist/cli/publish/wire.js +29 -0
  88. package/dist/cli/tar.js +87 -0
  89. package/dist/cli/upgrade/codemod.js +56 -0
  90. package/dist/cli/upgrade/index.js +263 -0
  91. package/dist/cli/upgrade/manifest.js +72 -0
  92. package/dist/cli/upgrade/plan.js +68 -0
  93. package/dist/cli/upgrade/stage.js +71 -0
  94. package/dist/cli/version.d.ts +12 -0
  95. package/dist/cli/version.js +15 -0
  96. package/dist/cli/workspace.js +108 -0
  97. package/dist/cli.d.ts +6 -0
  98. package/dist/cli.js +94 -0
  99. package/dist/css/compile.js +77 -0
  100. package/dist/css/graph.js +109 -0
  101. package/dist/css/inline.js +132 -0
  102. package/dist/css/rules.js +65 -0
  103. package/dist/design-system/format-variants.js +127 -0
  104. package/dist/eslint/authoring.js +46 -0
  105. package/dist/eslint/correctness.js +42 -0
  106. package/dist/eslint/rules/editor-declaration.js +103 -0
  107. package/dist/eslint/rules/editor-reason.js +135 -0
  108. package/dist/eslint/rules/island-imports.js +20 -0
  109. package/dist/eslint/rules/jsx-visitor.js +20 -0
  110. package/dist/eslint/rules/no-client-runtime.js +88 -0
  111. package/dist/eslint/rules/no-editor-globals.js +60 -0
  112. package/dist/eslint/rules/no-hard-coded-color.js +183 -0
  113. package/dist/eslint/rules/no-inline-style.js +24 -0
  114. package/dist/eslint/rules/no-marker-literal.js +37 -0
  115. package/dist/eslint/rules/no-nondeterminism.js +44 -0
  116. package/dist/eslint/rules/no-px-breakpoint.js +44 -0
  117. package/dist/eslint/rules/no-raw-values.js +45 -0
  118. package/dist/eslint/rules/serializable-props.js +95 -0
  119. package/dist/eslint.d.ts +6 -0
  120. package/dist/eslint.js +26 -0
  121. package/dist/fixtures/brand.d.ts +4 -0
  122. package/dist/fixtures/brand.js +9 -0
  123. package/dist/fixtures/bundle-rule.js +67 -0
  124. package/dist/fixtures/canonical.d.ts +149 -0
  125. package/dist/fixtures/image-dimensions.js +59 -0
  126. package/dist/fixtures/load.js +154 -0
  127. package/dist/fixtures/media-plugin.js +141 -0
  128. package/dist/fixtures/media.js +165 -0
  129. package/dist/fixtures/property.js +210 -0
  130. package/dist/fixtures/resolve.js +202 -0
  131. package/dist/fixtures/rows.js +108 -0
  132. package/dist/fixtures/synthesize-empties.js +42 -0
  133. package/dist/fixtures.d.ts +213 -0
  134. package/dist/fixtures.js +37 -0
  135. package/dist/index.d.ts +53 -0
  136. package/dist/index.js +37 -0
  137. package/dist/islands/client-module.js +97 -0
  138. package/dist/islands/marker.d.ts +43 -0
  139. package/dist/islands/marker.js +44 -0
  140. package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +687 -0
  141. package/dist/packages/external/concrete/package.js +5 -0
  142. package/dist/packages/internal/fact-interpolation/dist/index.js +22 -0
  143. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +111 -0
  144. package/dist/packages/internal/fill-bake/dist/display.js +9 -0
  145. package/dist/packages/internal/fill-bake/dist/index.js +6 -0
  146. package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +170 -0
  147. package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +32 -0
  148. package/dist/packages/internal/fill-vocabulary/dist/facts.js +131 -0
  149. package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +73 -0
  150. package/dist/packages/internal/format-geometry/dist/capture.js +404 -0
  151. package/dist/packages/internal/format-geometry/dist/format.d.ts +41 -0
  152. package/dist/packages/internal/format-geometry/dist/geometry.js +58 -0
  153. package/dist/packages/internal/format-geometry/dist/index.js +4 -0
  154. package/dist/packages/internal/image-descriptor/dist/index.d.ts +35 -0
  155. package/dist/packages/internal/image-ladder/dist/crop.js +82 -0
  156. package/dist/packages/internal/image-ladder/dist/encode.js +23 -0
  157. package/dist/packages/internal/image-ladder/dist/index.js +4 -0
  158. package/dist/packages/internal/image-ladder/dist/policy.js +102 -0
  159. package/dist/packages/internal/island-runtime/dist/capture-holds.d.ts +13 -0
  160. package/dist/packages/internal/island-runtime/dist/capture-holds.js +45 -0
  161. package/dist/packages/internal/island-runtime/dist/contract.d.ts +176 -0
  162. package/dist/packages/internal/island-runtime/dist/contract.js +94 -0
  163. package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +15 -0
  164. package/dist/packages/internal/island-runtime/dist/index.d.ts +103 -0
  165. package/dist/packages/internal/island-runtime/dist/index.js +163 -0
  166. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +19 -0
  167. package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +39 -0
  168. package/dist/packages/internal/island-runtime/dist/use-editor.d.ts +22 -0
  169. package/dist/packages/internal/island-runtime/dist/use-editor.js +54 -0
  170. package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +105 -0
  171. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +25 -0
  172. package/dist/packages/internal/property-facts/dist/index.js +3 -0
  173. package/dist/packages/internal/property-facts/dist/property-facts-CSdkSuD7.js +181 -0
  174. package/dist/packages/internal/section-contracts/dist/cap-contract.js +59 -0
  175. package/dist/packages/internal/section-contracts/dist/catalog.js +102 -0
  176. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +24 -0
  177. package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +48 -0
  178. package/dist/packages/internal/section-contracts/dist/display-contract.js +30 -0
  179. package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +17 -0
  180. package/dist/packages/internal/section-contracts/dist/group-contract.js +21 -0
  181. package/dist/packages/internal/section-contracts/dist/index.js +26 -0
  182. package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +48 -0
  183. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +53 -0
  184. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +70 -0
  185. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +27 -0
  186. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +12 -0
  187. package/dist/packages/internal/section-contracts/dist/option-source-contract.js +22 -0
  188. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +18 -0
  189. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +30 -0
  190. package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +24 -0
  191. package/dist/packages/internal/section-contracts/dist/row-contract.js +37 -0
  192. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +38 -0
  193. package/dist/packages/internal/section-contracts/dist/runners.js +181 -0
  194. package/dist/packages/internal/section-contracts/dist/select-contract.js +28 -0
  195. package/dist/packages/internal/section-contracts/dist/source-contract.js +48 -0
  196. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +15 -0
  197. package/dist/packages/internal/section-contracts/dist/sources-contract.js +28 -0
  198. package/dist/packages/internal/section-contracts/dist/url-contract.js +20 -0
  199. package/dist/packages/internal/source-resolution/dist/index.js +222 -0
  200. package/dist/packages/internal/template-artifact/dist/hash.js +50 -0
  201. package/dist/packages/internal/template-artifact/dist/index.js +7 -0
  202. package/dist/packages/internal/template-artifact/dist/layout.js +165 -0
  203. package/dist/packages/internal/template-artifact/dist/manifest.js +73 -0
  204. package/dist/packages/internal/template-artifact/dist/sha256.js +138 -0
  205. package/dist/packages/internal/template-artifact/dist/verify.js +275 -0
  206. package/dist/packages/internal/template-contracts/dist/collection-editing.js +38 -0
  207. package/dist/packages/internal/template-contracts/dist/content-categories.d.ts +10 -0
  208. package/dist/packages/internal/template-contracts/dist/content-categories.js +17 -0
  209. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +33 -0
  210. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +81 -0
  211. package/dist/packages/internal/template-contracts/dist/facts-view.js +136 -0
  212. package/dist/packages/internal/template-contracts/dist/layout.js +17 -0
  213. package/dist/packages/internal/template-contracts/dist/markers.d.ts +40 -0
  214. package/dist/packages/internal/template-contracts/dist/markers.js +41 -0
  215. package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +63 -0
  216. package/dist/packages/internal/template-contracts/dist/select-key.js +13 -0
  217. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1112 -0
  218. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +1109 -0
  219. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +11 -0
  220. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +45 -0
  221. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +63 -0
  222. package/dist/playground/host/page-state.js +12 -0
  223. package/dist/playground/host/paths.js +9 -0
  224. package/dist/playground/layout.js +24 -0
  225. package/dist/playground/wire.js +36 -0
  226. package/dist/playground-island-runtime.d.ts +3 -0
  227. package/dist/playground-island-runtime.js +4 -0
  228. package/dist/primitives/FrameShell.d.ts +29 -0
  229. package/dist/primitives/FrameShell.js +34 -0
  230. package/dist/primitives/Image.d.ts +119 -0
  231. package/dist/primitives/Image.js +173 -0
  232. package/dist/primitives/Section.d.ts +22 -0
  233. package/dist/primitives/Section.js +26 -0
  234. package/dist/primitives/Tour.d.ts +43 -0
  235. package/dist/primitives/Tour.js +72 -0
  236. package/dist/primitives/Video.d.ts +57 -0
  237. package/dist/primitives/Video.js +116 -0
  238. package/dist/primitives/embed-playback.js +50 -0
  239. package/dist/primitives/index.d.ts +11 -0
  240. package/dist/primitives/marker-attrs.js +44 -0
  241. package/dist/primitives/object-fit.js +11 -0
  242. package/dist/primitives/picture-sources.d.ts +24 -0
  243. package/dist/primitives/picture-sources.js +52 -0
  244. package/dist/primitives/probe-context.js +24 -0
  245. package/dist/primitives/slot-bindings.d.ts +96 -0
  246. package/dist/primitives/slot-bindings.js +226 -0
  247. package/dist/primitives/slot-document.d.ts +35 -0
  248. package/dist/primitives/slot-document.js +37 -0
  249. package/dist/primitives/slot-group.d.ts +40 -0
  250. package/dist/primitives/slot-group.js +45 -0
  251. package/dist/primitives/slot-list.d.ts +21 -0
  252. package/dist/primitives/slot-list.js +23 -0
  253. package/dist/primitives/slot-media.d.ts +71 -0
  254. package/dist/primitives/slot-media.js +98 -0
  255. package/dist/primitives/slot-scalar.d.ts +53 -0
  256. package/dist/primitives/slot-scalar.js +98 -0
  257. package/dist/primitives/slot.d.ts +26 -0
  258. package/dist/primitives/slot.js +28 -0
  259. package/dist/rules/registry.js +479 -0
  260. package/dist/schema/compute.d.ts +22 -0
  261. package/dist/schema/compute.js +30 -0
  262. package/dist/schema/define-schema.d.ts +27 -0
  263. package/dist/schema/define-schema.js +73 -0
  264. package/dist/schema/extract-fill-spec.js +246 -0
  265. package/dist/schema/extract-used-facts.js +176 -0
  266. package/dist/schema/fact.d.ts +65 -0
  267. package/dist/schema/fact.js +33 -0
  268. package/dist/schema/fill-builders.d.ts +387 -0
  269. package/dist/schema/fill-builders.js +263 -0
  270. package/dist/schema/fill-declaration.d.ts +76 -0
  271. package/dist/schema/fill-declaration.js +43 -0
  272. package/dist/schema/fill-spec.d.ts +18 -0
  273. package/dist/schema/fill-spec.js +170 -0
  274. package/dist/schema/format-presets.d.ts +27 -0
  275. package/dist/schema/format-presets.js +76 -0
  276. package/dist/schema/format.d.ts +22 -0
  277. package/dist/schema/format.js +40 -0
  278. package/dist/schema/formats.d.ts +6 -0
  279. package/dist/schema/formats.js +7 -0
  280. package/dist/schema/layout.d.ts +32 -0
  281. package/dist/schema/layout.js +30 -0
  282. package/dist/schema/manifest.js +300 -0
  283. package/dist/schema/property-facts.d.ts +83 -0
  284. package/dist/schema/runtime-values.d.ts +88 -0
  285. package/dist/schema/section-nav.d.ts +38 -0
  286. package/dist/schema/section-nav.js +29 -0
  287. package/dist/schema/section-props.d.ts +98 -0
  288. package/dist/schema/section-schema.d.ts +53 -0
  289. package/dist/schema/section-schema.js +54 -0
  290. package/dist/schema/slot-builders.d.ts +497 -0
  291. package/dist/schema/slot-builders.js +331 -0
  292. package/dist/schema/slot-types.d.ts +110 -0
  293. package/dist/schema/slot-types.js +187 -0
  294. package/dist/section/declare.d.ts +44 -0
  295. package/dist/section/declare.js +27 -0
  296. package/dist/section/discovery.js +76 -0
  297. package/dist/section/groups.js +74 -0
  298. package/dist/section/materialize.js +28 -0
  299. package/dist/section/placements.js +28 -0
  300. package/dist/section/section.d.ts +69 -0
  301. package/dist/section/section.js +101 -0
  302. package/dist/site-analytics.d.ts +1 -0
  303. package/dist/site-analytics.js +15 -0
  304. package/dist/site-runtime/analytics.js +97 -0
  305. package/dist/site-runtime/site-integrations.js +97 -0
  306. package/dist/styles.css +60 -0
  307. package/dist/template/define-template.d.ts +139 -0
  308. package/dist/template/define-template.js +98 -0
  309. package/dist/template/logic-build.js +191 -0
  310. package/dist/template/logic-shim.d.ts +43 -0
  311. package/dist/template/logic-shim.js +52 -0
  312. package/dist/template/logic-transform.js +92 -0
  313. package/dist/template/materialize.js +107 -0
  314. package/dist/template/reconcile.d.ts +67 -0
  315. package/dist/template/reconcile.js +25 -0
  316. package/dist/template/running-copy.js +58 -0
  317. package/guide/reference/cli/INDEX.md +79 -0
  318. package/guide/reference/cli/build.md +48 -0
  319. package/guide/reference/cli/check.md +49 -0
  320. package/guide/reference/cli/dev.md +46 -0
  321. package/guide/reference/cli/property-add.md +53 -0
  322. package/guide/reference/cli/property-list.md +46 -0
  323. package/guide/reference/cli/publish.md +54 -0
  324. package/guide/reference/cli/upgrade.md +48 -0
  325. package/guide/reference/rules/INDEX.md +190 -0
  326. package/package.json +137 -0
  327. package/tsconfig.base.json +16 -0
@@ -0,0 +1,10 @@
1
+ //#region ../../internal/template-contracts/dist/content-categories.d.ts
2
+ /**
3
+ * The closed v1 category keys, in display order. `website` belongs to the
4
+ * geometry-less website format only; the rest classify rendered formats.
5
+ */
6
+ declare const CONTENT_CATEGORIES: readonly ["website", "social-post", "story", "brochure", "flyer", "postcard", "presentation"];
7
+ /** One curated category key — the browsing metadata on a format's identity. */
8
+ type ContentCategory = (typeof CONTENT_CATEGORIES)[number];
9
+ //#endregion
10
+ export { CONTENT_CATEGORIES, ContentCategory };
@@ -0,0 +1,17 @@
1
+ //#region ../../internal/template-contracts/dist/content-categories.js
2
+ /**
3
+ * The closed v1 category keys, in display order. `website` belongs to the
4
+ * geometry-less website format only; the rest classify rendered formats.
5
+ */
6
+ const CONTENT_CATEGORIES = [
7
+ "website",
8
+ "social-post",
9
+ "story",
10
+ "brochure",
11
+ "flyer",
12
+ "postcard",
13
+ "presentation"
14
+ ];
15
+
16
+ //#endregion
17
+ export { CONTENT_CATEGORIES };
@@ -0,0 +1,33 @@
1
+ //#region ../../internal/template-contracts/dist/document-value.d.ts
2
+ /**
3
+ * A document slot's runtime value after resolution: the upload it references
4
+ * plus the metadata a link needs to describe itself.
5
+ *
6
+ * A document is never transformed — no crop, no rendition, no responsive
7
+ * ladder — so unlike an image or a video there is nothing here but the served
8
+ * bytes and their description.
9
+ */
10
+ type DocumentValue = {
11
+ /** The `intake.upload` row this slot points at — the whole stored value. */
12
+ asset_id: string;
13
+ /**
14
+ * Served source — the editor gets a presigned URL, a published page gets the
15
+ * relative asset path. Same pivot as an image's or a video's `url`, so a
16
+ * renderer reads one field either side of publish.
17
+ */
18
+ url: string;
19
+ /**
20
+ * The upload's display name AT RESOLVE TIME, so renaming an upload renames it
21
+ * everywhere it is attached. Also the name the download lands under — delivery
22
+ * carries it in the content disposition rather than the content-addressed hash.
23
+ */
24
+ filename: string;
25
+ /** The upload's MIME type, from the accepted-document allowlist. */
26
+ content_type: string;
27
+ /** Size of the served bytes, for the "PDF · 2.4 MB" line beside a link. */
28
+ size_bytes: number;
29
+ };
30
+ /** A document list slot's runtime value: an ordered array of `DocumentValue`, possibly empty. */
31
+ type DocumentCollectionValue = DocumentValue[];
32
+ //#endregion
33
+ export { DocumentCollectionValue, DocumentValue };
@@ -0,0 +1,81 @@
1
+ import { FACT_GRAPH, FactGraphName, FactMemberDescriptor, FactProjections, FactShapeDescriptor, FactValueType, SourceFieldContainer } from "./slot-catalog.js";
2
+ //#region ../../internal/template-contracts/dist/facts-view.d.ts
3
+ type Graph = typeof FACT_GRAPH;
4
+ type ScalarType<V extends FactValueType> = V extends "number" ? number | null : V extends "boolean" ? boolean : V extends "text_list" ? readonly string[] : string | null;
5
+ type MemberType<M extends FactMemberDescriptor> = M extends {
6
+ row: infer R extends FactShapeDescriptor;
7
+ } ? readonly ShapeOf<R>[] : ScalarType<M["value_type"]>;
8
+ type ShapeOf<S extends FactShapeDescriptor> = { readonly [K in keyof S]: MemberType<S[K]>; };
9
+ /** A registry entry name whose value is a pool of rows (carries a `row` descriptor). */
10
+ type FactPoolName = { [K in FactGraphName]: Graph[K] extends {
11
+ row: FactShapeDescriptor;
12
+ } ? K : never; }[FactGraphName];
13
+ type PoolRow<P extends FactPoolName> = Graph[P] extends {
14
+ row: infer R extends FactShapeDescriptor;
15
+ } ? R : never;
16
+ type RowBindableName<P extends FactPoolName> = { [K in FactGraphName]: Graph[K] extends {
17
+ role: "bindable";
18
+ path: `${P}[].${string}`;
19
+ } ? K : never; }[FactGraphName];
20
+ type BoundRowMember<P extends FactPoolName, K> = K extends FactGraphName ? Graph[K]["path"] extends `${P}[].${infer M}` ? M : never : never;
21
+ type BoundMembers<P extends FactPoolName> = { [K in RowBindableName<P>]: BoundRowMember<P, K>; }[RowBindableName<P>];
22
+ type ContainerOf<K extends FactGraphName> = Graph[K] extends {
23
+ container: infer C extends SourceFieldContainer;
24
+ } ? C : never;
25
+ type AliasNameFor<C, K> = C extends keyof FactProjections ? { [A in keyof FactProjections[C]]: FactProjections[C][A] extends K ? A : never; }[keyof FactProjections[C]] : never;
26
+ type AuthorFacingName<K extends FactGraphName> = [AliasNameFor<ContainerOf<K>, K>] extends [never] ? K : AliasNameFor<ContainerOf<K>, K>;
27
+ /**
28
+ * One row of pool `P`, as the derive-time view carries it: exactly the
29
+ * registry row descriptor's members, each member a bindable entry binds into
30
+ * renamed to that entry's author-facing spelling (`website` ←
31
+ * `contacts[].website_url`; the alias table applies, so `address` ←
32
+ * `contacts[].address` via `contact_address`).
33
+ */
34
+ type FactsRow<P extends FactPoolName> = { readonly [K in RowBindableName<P> as AuthorFacingName<K>]: MemberType<PoolRow<P>[BoundRowMember<P, K> & keyof PoolRow<P>]>; } & { readonly [M in keyof PoolRow<P> as M extends BoundMembers<P> ? never : M]: MemberType<PoolRow<P>[M]>; };
35
+ type EntryValue<K extends FactGraphName> = Graph[K] extends {
36
+ ambient: true;
37
+ } ? Exclude<ScalarType<Graph[K]["value_type"]>, null> : Graph[K] extends {
38
+ primary_of: infer P extends FactPoolName;
39
+ } ? FactsRow<P> | null : Graph[K] extends {
40
+ row: FactShapeDescriptor;
41
+ } ? readonly FactsRow<K & FactPoolName>[] : Graph[K] extends {
42
+ fields: infer F extends FactShapeDescriptor;
43
+ } ? ShapeOf<F> : ScalarType<Graph[K]["value_type"]>;
44
+ type PropertyBranch = { readonly [K in FactGraphName as Graph[K] extends {
45
+ role: "bindable";
46
+ container: "property";
47
+ } ? K : never]: EntryValue<K>; } & { readonly [A in keyof FactProjections["property"]]: EntryValue<FactProjections["property"][A]>; };
48
+ /**
49
+ * The derive-time view a `compute((f) => …)` callback's parameter is bound to
50
+ * — a mapped type over the fact graph registry. Bindable facts sit at
51
+ * `f.<container>.<key>` (`f.property.*`; the unit and contact containers read
52
+ * through the primary rows `unit` and `contact`), readable-only entries at
53
+ * `f.<key>`, and the ambient `year` is injected at derive time.
54
+ */
55
+ type Facts = {
56
+ readonly property: PropertyBranch;
57
+ } & { readonly [K in FactGraphName as Graph[K] extends {
58
+ role: "readable";
59
+ } ? K : never]: EntryValue<K>; };
60
+ /** One unit row of `property.units` (and the shape of the primary `unit`). */
61
+ type FactsUnit = FactsRow<"units">;
62
+ /** One full contact card of `property.contacts` (and the shape of the primary `contact`), spelled as `fact.contact.*` spells it. */
63
+ type FactsContact = FactsRow<"contacts">;
64
+ /** One property photo of the `photos` pool. */
65
+ type FactsPhoto = FactsRow<"photos">;
66
+ /** One video candidate of the `videos` pool — a hosted upload or a pasted provider link. */
67
+ type FactsVideo = FactsRow<"videos">;
68
+ /** One 3D tour of the `tours` pool. */
69
+ type FactsTour = FactsRow<"tours">;
70
+ /** One detected floor plan of the `floor_plans` pool, with its per-unit assignments. */
71
+ type FactsFloorPlan = FactsRow<"floor_plans">;
72
+ /** One attachable document of the `documents` pool. */
73
+ type FactsDocument = FactsRow<"documents">;
74
+ /** One distilled document-notes entry of the `document_notes` pool. */
75
+ type FactsDocumentNote = FactsRow<"document_notes">;
76
+ /** The structured address at `property.address`. */
77
+ type FactsAddress = Facts["property"]["address"];
78
+ /** The always-on narrative at `narrative`. */
79
+ type FactsNarrative = Facts["narrative"];
80
+ //#endregion
81
+ export { FactPoolName, Facts, FactsAddress, FactsContact, FactsDocument, FactsDocumentNote, FactsFloorPlan, FactsNarrative, FactsPhoto, FactsRow, FactsTour, FactsUnit, FactsVideo };
@@ -0,0 +1,136 @@
1
+ import { FACT_GRAPH, FACT_PROJECTIONS } from "./slot-catalog.js";
2
+
3
+ //#region ../../internal/template-contracts/dist/facts-view.js
4
+ /**
5
+ * The ambient `year`'s fixture/test default. Deterministic by construction —
6
+ * never a clock read; live callers pass the real year via `opts.year`.
7
+ */
8
+ const DEFAULT_FACTS_VIEW_YEAR = 2025;
9
+ function str(v) {
10
+ return typeof v === "string" ? v : null;
11
+ }
12
+ function num(v) {
13
+ return typeof v === "number" && Number.isFinite(v) ? v : null;
14
+ }
15
+ function scalarValue(valueType, v) {
16
+ switch (valueType) {
17
+ case "number": return num(v);
18
+ case "boolean": return v === true;
19
+ case "text_list": return Array.isArray(v) ? v.filter((t) => typeof t === "string") : [];
20
+ default: return str(v);
21
+ }
22
+ }
23
+ function memberValue(desc, v) {
24
+ const row = desc.row;
25
+ if (row !== void 0) return Array.isArray(v) ? v.map((item) => shapeValue(row, item)) : [];
26
+ return scalarValue(desc.value_type, v);
27
+ }
28
+ function shapeValue(shape, raw) {
29
+ const source = raw !== null && typeof raw === "object" ? raw : {};
30
+ const out = {};
31
+ for (const [member, desc] of Object.entries(shape)) out[member] = memberValue(desc, source[member]);
32
+ return out;
33
+ }
34
+ function readPath(root, path) {
35
+ let cursor = root;
36
+ for (const key of path.split(".")) {
37
+ if (cursor === null || typeof cursor !== "object") return void 0;
38
+ cursor = cursor[key];
39
+ }
40
+ return cursor;
41
+ }
42
+ function authorFacingName(key, container) {
43
+ const aliases = FACT_PROJECTIONS[container];
44
+ if (aliases !== void 0) {
45
+ for (const [alias, target] of Object.entries(aliases)) if (target === key) return alias;
46
+ }
47
+ return key;
48
+ }
49
+ const ROW_BINDABLES = {};
50
+ for (const [key, entry] of Object.entries(FACT_GRAPH)) {
51
+ if (entry.role !== "bindable") continue;
52
+ const match = /^(\w+)\[\]\.(\w+)$/.exec(entry.path);
53
+ if (match === null) continue;
54
+ (ROW_BINDABLES[match[1]] ??= []).push({
55
+ name: authorFacingName(key, entry.container),
56
+ member: match[2]
57
+ });
58
+ }
59
+ function rowValue(pool, shape, raw) {
60
+ const source = raw !== null && typeof raw === "object" ? raw : {};
61
+ const bound = ROW_BINDABLES[pool] ?? [];
62
+ const boundMembers = new Set(bound.map((b) => b.member));
63
+ const out = {};
64
+ for (const [member, desc] of Object.entries(shape)) {
65
+ if (boundMembers.has(member)) continue;
66
+ out[member] = memberValue(desc, source[member]);
67
+ }
68
+ for (const { name, member } of bound) {
69
+ const desc = shape[member];
70
+ out[name] = desc === void 0 ? null : memberValue(desc, source[member]);
71
+ }
72
+ return out;
73
+ }
74
+ const POOL_ORDER = { units: (rows) => [...rows].sort((a, b) => (num(a.position) ?? 0) - (num(b.position) ?? 0)) };
75
+ const POOL_PRIMARY = {
76
+ units: (ordered) => ordered[0],
77
+ contacts: (ordered) => ordered.find((r) => r.primary === true) ?? ordered[0]
78
+ };
79
+ /**
80
+ * Projects a canonical `property_facts.facts` bundle into the derive-time
81
+ * {@link Facts} view — the ONE projector both the fill pipeline and the kit's
82
+ * fixture path run. Data-driven off the registry: every entry's own path,
83
+ * descriptors and flags decide its member, so the view cannot fall behind the
84
+ * registry. Input is deliberately loose: values are normalized member-by-
85
+ * member against the descriptors, so a partial bundle (the facts-failed
86
+ * fallback) projects to a well-formed view of nulls and empty pools.
87
+ * `opts.year` supplies the ambient year (defaults to
88
+ * {@link DEFAULT_FACTS_VIEW_YEAR} for deterministic fixtures; live callers
89
+ * pass the real year).
90
+ */
91
+ function projectFactsView(canonical, opts) {
92
+ const property = {};
93
+ const view = { property };
94
+ const pooled = /* @__PURE__ */ new Map();
95
+ const poolRows = (pool, path) => {
96
+ const cached = pooled.get(pool);
97
+ if (cached !== void 0) return cached;
98
+ const raw = readPath(canonical, path);
99
+ let rows = Array.isArray(raw) ? raw.filter((r) => r !== null && typeof r === "object") : [];
100
+ const order = POOL_ORDER[pool];
101
+ if (order !== void 0) rows = order(rows);
102
+ pooled.set(pool, rows);
103
+ return rows;
104
+ };
105
+ for (const [key, entry] of Object.entries(FACT_GRAPH)) {
106
+ if (entry.role === "bindable" && entry.container !== "property") continue;
107
+ const target = entry.role === "bindable" ? property : view;
108
+ if (entry.role === "readable" && entry.ambient === true) {
109
+ if (key !== "year") throw new Error(`ambient fact "${key}" has no derive-time source wired`);
110
+ view[key] = opts?.year ?? 2025;
111
+ continue;
112
+ }
113
+ if (entry.role === "readable" && entry.primary_of !== void 0) {
114
+ const pool = entry.primary_of;
115
+ const poolEntry = FACT_GRAPH[pool];
116
+ const rows = poolRows(pool, entry.path ?? pool);
117
+ const primary = POOL_PRIMARY[pool]?.(rows);
118
+ view[key] = primary === void 0 || poolEntry.row === void 0 ? null : rowValue(pool, poolEntry.row, primary);
119
+ continue;
120
+ }
121
+ if (entry.row !== void 0) {
122
+ target[key] = poolRows(key, entry.path ?? key).map((r) => rowValue(key, entry.row, r));
123
+ continue;
124
+ }
125
+ if (entry.fields !== void 0) {
126
+ target[key] = shapeValue(entry.fields, readPath(canonical, entry.path ?? key));
127
+ continue;
128
+ }
129
+ target[key] = scalarValue(entry.value_type, readPath(canonical, entry.path ?? key));
130
+ }
131
+ for (const [alias, key] of Object.entries(FACT_PROJECTIONS.property)) property[alias] = property[key];
132
+ return view;
133
+ }
134
+
135
+ //#endregion
136
+ export { DEFAULT_FACTS_VIEW_YEAR, projectFactsView };
@@ -0,0 +1,17 @@
1
+ //#region ../../internal/template-contracts/dist/layout.js
2
+ /** Flatten a row layout to its bare slot-id order, left to right — each `[a, b]` pair expands to its two ids in place. */
3
+ function flattenLayout(layout) {
4
+ return layout.flatMap((entry) => typeof entry === "string" ? [entry] : [entry[0], entry[1]]);
5
+ }
6
+ /**
7
+ * Whether a slot is short enough to share a 2-up row: a `number`, a `url`, or
8
+ * a `text` slot whose `size` is absent or `"short"`. The single source of the
9
+ * row-eligibility rule — the editor renders authored rows verbatim, so this
10
+ * is the only guard an authored row layout is checked against.
11
+ */
12
+ function isShortSlot(slot) {
13
+ return slot.type === "number" || slot.type === "url" || slot.type === "text" && (slot.size === void 0 || slot.size === "short");
14
+ }
15
+
16
+ //#endregion
17
+ export { flattenLayout, isShortSlot };
@@ -0,0 +1,40 @@
1
+ //#region ../../internal/template-contracts/dist/markers.d.ts
2
+ /** The element an editable slot's value was rendered on (`{...slot.x}`). */
3
+ declare const ATTR_SLOT_ID = "data-slot-id";
4
+ /** The element whose text content IS the slot's value (`{...slot.x.text}`). */
5
+ declare const ATTR_SLOT_TEXT_LEAF = "data-slot-text-leaf";
6
+ /** The shared container of a set of slots edited as one unit (`{...group.g}`). */
7
+ declare const ATTR_SLOT_GROUP = "data-slot-group";
8
+ /**
9
+ * Zero-based index of one item inside a collection slot (`{...slot.x.item(i)}`) — the
10
+ * per-item handle for a record-item list. The editor
11
+ * resolves per-item selection, live enhancer surfaces, and per-item image
12
+ * crops against it, scoped to the enclosing `ATTR_SLOT_ID` element.
13
+ */
14
+ declare const ATTR_SLOT_ITEM = "data-slot-item";
15
+ /**
16
+ * The field name of one row field inside a record item — the fourth and last
17
+ * dimension of slot identity, `(instance, slot, item?, field?)`.
18
+ *
19
+ * It is also a SCOPE BOUNDARY for item queries, exactly as `data-slot-id` is: an item
20
+ * resolves to the nearest `[data-slot-item]` whose closest `[data-slot-id]` or
21
+ * `[data-slot-field]` ancestor is the element doing the lookup, so an outer collection's
22
+ * lookup can never reach into a nested list rendered inside one of its rows. Identity
23
+ * stays a fixed 4-tuple rather than a path because a record cannot nest inside a
24
+ * record — the list grammar's field union enforces that in the type.
25
+ */
26
+ declare const ATTR_SLOT_FIELD = "data-slot-field";
27
+ /**
28
+ * Presence flag on a marked element declaring it a non-selectable rendering. The
29
+ * copy keeps full identity — patchers and the crop treatment still reach it — but
30
+ * the canvas never selects, outlines, scrolls to, or live-stamps it, and a click
31
+ * on it falls through exactly as on unmarked markup. Coverage gates count no
32
+ * flagged copy, so a slot needs at least one rendering without this flag.
33
+ */
34
+ declare const ATTR_SLOT_UNSELECTABLE = "data-slot-unselectable";
35
+ /** Per-section-instance identity on the section root. */
36
+ declare const ATTR_SECTION_INSTANCE_ID = "data-section-instance-id";
37
+ /** Opt-in hook telling an enhancer to attach to this element. */
38
+ declare const ATTR_TR_ENHANCE = "data-tr-enhance";
39
+ //#endregion
40
+ export { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE };
@@ -0,0 +1,41 @@
1
+ //#region ../../internal/template-contracts/dist/markers.js
2
+ /** The element an editable slot's value was rendered on (`{...slot.x}`). */
3
+ const ATTR_SLOT_ID = "data-slot-id";
4
+ /** The element whose text content IS the slot's value (`{...slot.x.text}`). */
5
+ const ATTR_SLOT_TEXT_LEAF = "data-slot-text-leaf";
6
+ /** The shared container of a set of slots edited as one unit (`{...group.g}`). */
7
+ const ATTR_SLOT_GROUP = "data-slot-group";
8
+ /**
9
+ * Zero-based index of one item inside a collection slot (`{...slot.x.item(i)}`) — the
10
+ * per-item handle for a record-item list. The editor
11
+ * resolves per-item selection, live enhancer surfaces, and per-item image
12
+ * crops against it, scoped to the enclosing `ATTR_SLOT_ID` element.
13
+ */
14
+ const ATTR_SLOT_ITEM = "data-slot-item";
15
+ /**
16
+ * The field name of one row field inside a record item — the fourth and last
17
+ * dimension of slot identity, `(instance, slot, item?, field?)`.
18
+ *
19
+ * It is also a SCOPE BOUNDARY for item queries, exactly as `data-slot-id` is: an item
20
+ * resolves to the nearest `[data-slot-item]` whose closest `[data-slot-id]` or
21
+ * `[data-slot-field]` ancestor is the element doing the lookup, so an outer collection's
22
+ * lookup can never reach into a nested list rendered inside one of its rows. Identity
23
+ * stays a fixed 4-tuple rather than a path because a record cannot nest inside a
24
+ * record — the list grammar's field union enforces that in the type.
25
+ */
26
+ const ATTR_SLOT_FIELD = "data-slot-field";
27
+ /**
28
+ * Presence flag on a marked element declaring it a non-selectable rendering. The
29
+ * copy keeps full identity — patchers and the crop treatment still reach it — but
30
+ * the canvas never selects, outlines, scrolls to, or live-stamps it, and a click
31
+ * on it falls through exactly as on unmarked markup. Coverage gates count no
32
+ * flagged copy, so a slot needs at least one rendering without this flag.
33
+ */
34
+ const ATTR_SLOT_UNSELECTABLE = "data-slot-unselectable";
35
+ /** Per-section-instance identity on the section root. */
36
+ const ATTR_SECTION_INSTANCE_ID = "data-section-instance-id";
37
+ /** Opt-in hook telling an enhancer to attach to this element. */
38
+ const ATTR_TR_ENHANCE = "data-tr-enhance";
39
+
40
+ //#endregion
41
+ export { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE };
@@ -0,0 +1,63 @@
1
+ import { ResponsiveImage } from "../../image-descriptor/dist/index.js";
2
+ //#region ../../internal/template-contracts/dist/poi-row.d.ts
3
+ /**
4
+ * Photo metadata for one point of interest — dimensions and attribution, never image bytes.
5
+ *
6
+ * @remarks
7
+ * A `PoiRow`'s missing `photo` field is how a template knows the place has
8
+ * no photo at all. Only `width`/`height`/`attribution` are persisted; the
9
+ * display URL is minted at render time from the row's `place_id` and
10
+ * delivered on the same object, so a renderer reads it without a cast.
11
+ */
12
+ type PoiPhoto = {
13
+ width: number;
14
+ height: number;
15
+ /** The photo author's credit. Google requires it displayed with the image. */
16
+ attribution: string;
17
+ /**
18
+ * The display URL, signed from the row's `place_id` at RESOLVE time — never
19
+ * persisted and never emitted by a producer. Absent in a stored content
20
+ * document, and absent at render too when the platform has no signing
21
+ * secret configured, so a renderer must treat it as optional.
22
+ */
23
+ url?: string;
24
+ /** Minted alongside `url`, over the photo proxy's allowlisted widths. */
25
+ responsive?: ResponsiveImage | null;
26
+ };
27
+ /**
28
+ * One point of interest — a nearby place (a school, park, coffee shop, transit stop, …) identified by Google Places, with its location and whatever enrichment fields Places returned for it.
29
+ *
30
+ * @remarks
31
+ * Every field past `distance_m` is optional and never nullable: Places omits
32
+ * most of them for many place types, so a renderer must handle absence
33
+ * regardless of what a producer managed to fetch. Nothing here refreshes on
34
+ * a schedule — a row is stale by design until its deliverable is
35
+ * regenerated or the user re-picks the place. `photo`, if present, is
36
+ * resolved fresh from `place_id` on every request rather than cached, since
37
+ * it is the one field that would visibly break rather than merely age.
38
+ */
39
+ type PoiRow = {
40
+ id: string;
41
+ place_id: string;
42
+ name: string;
43
+ address: string | null;
44
+ lat: number;
45
+ lng: number;
46
+ /** Metres from the property, captured when the row was produced. */
47
+ distance_m: number | null;
48
+ /** 1.0–5.0. */
49
+ rating?: number;
50
+ review_count?: number;
51
+ /** A display label — "Coffee shop", not the machine type `cafe`. */
52
+ type_label?: string;
53
+ /** An opaque enum string (`PRICE_LEVEL_MODERATE` …), not a currency amount. */
54
+ price_level?: string;
55
+ website_uri?: string;
56
+ /** The place on Google Maps — also the attribution target a photo requires. */
57
+ google_maps_uri?: string;
58
+ /** One editorial sentence about the place, already prose. */
59
+ summary?: string;
60
+ photo?: PoiPhoto;
61
+ };
62
+ //#endregion
63
+ export { PoiPhoto, PoiRow };
@@ -0,0 +1,13 @@
1
+ //#region ../../internal/template-contracts/dist/select-key.js
2
+ /**
3
+ * The stored form of a user-created select value: trimmed, lower-cased, every run
4
+ * of whitespace collapsed to a single `-`. Case and spacing only — punctuation is
5
+ * left alone. Idempotent, which is what makes `normalizeSelectKey(k) === k` a
6
+ * usable stability check on an authored key.
7
+ */
8
+ function normalizeSelectKey(text) {
9
+ return text.trim().toLowerCase().replace(/\s+/g, "-");
10
+ }
11
+
12
+ //#endregion
13
+ export { normalizeSelectKey };