@homepages/concrete 12.0.0 → 13.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 (311) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/README.md +8 -10
  3. package/codemods/fixtures-are-data.mjs +7 -0
  4. package/codemods/fixtures-list-properties.mjs +6 -0
  5. package/codemods/manifest.json +11 -0
  6. package/codemods/steps/fixtures-list-properties.mjs +16 -0
  7. package/codemods/steps/fixtures-to-data.mjs +41 -0
  8. package/dist/artifact/playground/client/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  9. package/dist/artifact/playground/client/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  10. package/dist/artifact/playground/client/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  11. package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +1338 -0
  12. package/dist/artifact/playground/client/assets/index-C01UCAWD.css +1 -0
  13. package/dist/artifact/playground/client/index.html +2 -2
  14. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
  15. package/dist/artifact/playground/host.mjs +110 -59
  16. package/dist/base.css +2 -2
  17. package/dist/cli/build/icons.js +1 -1
  18. package/dist/cli/build/index.js +11 -10
  19. package/dist/cli/build/manifest.js +44 -0
  20. package/dist/cli/build/record.js +123 -0
  21. package/dist/cli/build/sections.js +28 -18
  22. package/dist/cli/build/source.js +1 -1
  23. package/dist/cli/build/static.js +8 -5
  24. package/dist/cli/build/template-build.js +614 -0
  25. package/dist/cli/check/analyze.js +18 -1
  26. package/dist/cli/check/load-workspace.js +2 -2
  27. package/dist/cli/check/portable-names.js +1 -1
  28. package/dist/cli/check/render/corpus.js +119 -0
  29. package/dist/cli/check/render/invariants.js +1 -0
  30. package/dist/cli/check/stages/bundles.js +15 -18
  31. package/dist/cli/check/stages/composition.js +8 -25
  32. package/dist/cli/check/stages/fixtures.js +14 -10
  33. package/dist/cli/check/stages/logic.js +7 -23
  34. package/dist/cli/check/stages/render.js +12 -14
  35. package/dist/cli/check/stages/sections.js +22 -66
  36. package/dist/cli/check/stages/stylesheet.js +4 -26
  37. package/dist/cli/check/stages/workspace.js +27 -22
  38. package/dist/cli/commands.js +51 -23
  39. package/dist/cli/currency/preamble.js +1 -1
  40. package/dist/cli/currency/resolve-latest.js +3 -2
  41. package/dist/cli/dev/capture-browser.js +26 -0
  42. package/dist/cli/dev/fixture-schema.js +441 -0
  43. package/dist/cli/dev/folder-files.js +244 -0
  44. package/dist/cli/dev/index.js +7 -3
  45. package/dist/cli/dev/playground-server.js +34 -0
  46. package/dist/cli/dev/section-ladders.js +76 -0
  47. package/dist/cli/dev/server.js +120 -304
  48. package/dist/cli/install/background.js +16 -0
  49. package/dist/cli/install/index.js +45 -0
  50. package/dist/cli/install/tools.js +27 -0
  51. package/dist/cli/media/derive.js +19 -13
  52. package/dist/cli/media/deriver-plugin.js +14 -3
  53. package/dist/cli/property/fixture-list.js +46 -0
  54. package/dist/cli/property/index.js +12 -9
  55. package/dist/cli/property/library.js +12 -10
  56. package/dist/cli/publish/artifact.js +90 -0
  57. package/dist/cli/publish/captures.js +61 -0
  58. package/dist/cli/publish/fixtures.js +17 -0
  59. package/dist/cli/publish/index.js +10 -18
  60. package/dist/cli/{build → publish}/playground.js +3 -3
  61. package/dist/cli/publish/report.js +15 -33
  62. package/dist/cli/upgrade/codemod.d.ts +14 -0
  63. package/dist/cli/upgrade/fixture-conversion.d.ts +11 -0
  64. package/dist/cli/upgrade/fixture-conversion.js +54 -0
  65. package/dist/cli/upgrade/fixture-modules.js +125 -0
  66. package/dist/cli/upgrade/fixtures-to-data.d.ts +40 -0
  67. package/dist/cli/upgrade/fixtures-to-data.js +498 -0
  68. package/dist/cli/upgrade/index.js +18 -2
  69. package/dist/cli/upgrade/legacy-fixtures.d.ts +34 -0
  70. package/dist/cli/upgrade/legacy-fixtures.js +22 -0
  71. package/dist/cli/upgrade/stage.js +1 -1
  72. package/dist/cli/workspace-fixtures.js +80 -0
  73. package/dist/cli.js +1 -0
  74. package/dist/css/compile.js +9 -3
  75. package/dist/fixtures/bundle-rule.js +16 -16
  76. package/dist/fixtures/media-plugin.js +12 -33
  77. package/dist/fixtures/synthesize-empties.js +3 -2
  78. package/dist/index.d.ts +7 -7
  79. package/dist/{playground-island-runtime.d.ts → island-runtime.d.ts} +1 -2
  80. package/dist/{playground-island-runtime.js → island-runtime.js} +1 -2
  81. package/dist/islands/client-module.js +1 -1
  82. package/dist/{cli/dev → islands}/tsconfig-paths.js +2 -14
  83. package/dist/islands/wrap.js +40 -0
  84. package/dist/node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.js +5119 -0
  85. package/dist/packages/external/concrete/package.js +1 -1
  86. package/dist/packages/internal/bundle-evaluation/dist/cache.js +36 -0
  87. package/dist/packages/internal/bundle-evaluation/dist/evaluate.js +174 -0
  88. package/dist/packages/internal/bundle-evaluation/dist/index.js +5 -0
  89. package/dist/packages/internal/bundle-evaluation/dist/section-code.js +10 -0
  90. package/dist/packages/internal/capture-settle/dist/index.js +2 -2
  91. package/dist/packages/internal/capture-settle/dist/settle.js +88 -13
  92. package/dist/packages/internal/code-fingerprint/dist/index.js +57 -0
  93. package/dist/packages/internal/content-doc-ops/dist/index.js +176 -0
  94. package/dist/packages/internal/content-doc-ops/dist/made-rows.js +15 -0
  95. package/dist/packages/internal/deliverable-reads/dist/bootstrap.js +81 -0
  96. package/dist/packages/internal/deliverable-reads/dist/display.js +21 -0
  97. package/dist/packages/internal/deliverable-reads/dist/format.js +15 -0
  98. package/dist/packages/internal/deliverable-reads/dist/index.js +7 -0
  99. package/dist/packages/internal/deliverable-reads/dist/pages.js +29 -0
  100. package/dist/packages/internal/deliverable-reads/dist/requirements.js +72 -0
  101. package/dist/{cli/capture → packages/internal/download-files/dist}/bundle.js +8 -4
  102. package/dist/packages/internal/download-files/dist/capture-origin.js +126 -0
  103. package/dist/packages/internal/download-files/dist/capture-routes.js +139 -0
  104. package/dist/packages/internal/download-files/dist/capture-shell.js +38 -0
  105. package/dist/packages/internal/download-files/dist/capture.js +74 -0
  106. package/dist/packages/internal/download-files/dist/egress-watch.js +38 -0
  107. package/dist/packages/internal/download-files/dist/files.js +7 -0
  108. package/dist/packages/internal/download-files/dist/finish.js +35 -0
  109. package/dist/packages/internal/download-files/dist/fleet.js +94 -0
  110. package/dist/packages/internal/download-files/dist/format.js +40 -0
  111. package/dist/packages/internal/download-files/dist/make.js +105 -0
  112. package/dist/packages/internal/download-files/dist/master-tally.js +32 -0
  113. package/dist/packages/internal/download-files/dist/names.js +24 -0
  114. package/dist/packages/internal/download-files/dist/pdf-boxes.js +33 -0
  115. package/dist/packages/internal/download-files/dist/pdf-image-placements.js +194 -0
  116. package/dist/packages/internal/download-files/dist/pdf-images.js +289 -0
  117. package/dist/packages/internal/file-store/dist/files.js +8 -0
  118. package/dist/packages/internal/file-store/dist/lru.js +40 -0
  119. package/dist/packages/internal/file-store/dist/refusal.js +12 -0
  120. package/dist/packages/internal/file-store/dist/trees.js +151 -0
  121. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +1 -1
  122. package/dist/packages/internal/fill-bake/dist/compute-reads.js +47 -21
  123. package/dist/packages/internal/fill-bake/dist/index.js +5 -1
  124. package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -3
  125. package/dist/packages/internal/fill-bake/dist/resolve-instance.js +9 -0
  126. package/dist/packages/internal/fill-bake/dist/resolve.js +3 -0
  127. package/dist/packages/internal/fill-bake/dist/round-trip.js +2 -0
  128. package/dist/packages/internal/fill-bake/dist/strip.js +6 -0
  129. package/dist/packages/internal/fill-vocabulary/dist/holder.js +1 -1
  130. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +1 -1
  131. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +1 -1
  132. package/dist/packages/internal/island-runtime/dist/index.js +1 -10
  133. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +5 -0
  134. package/dist/packages/internal/lead-fields/dist/ingest.js +72 -0
  135. package/dist/packages/internal/media-resolution/dist/video.js +6 -2
  136. package/dist/packages/internal/page-render/dist/addresses.js +57 -0
  137. package/dist/packages/internal/page-render/dist/index.js +6 -0
  138. package/dist/packages/internal/page-render/dist/kept.js +30 -0
  139. package/dist/packages/internal/page-render/dist/nav.js +42 -0
  140. package/dist/packages/internal/page-render/dist/render.js +152 -0
  141. package/dist/packages/internal/page-shell/dist/assemble.js +161 -0
  142. package/dist/packages/internal/page-shell/dist/escape.js +10 -0
  143. package/dist/packages/internal/page-shell/dist/frame.js +23 -0
  144. package/dist/packages/internal/page-shell/dist/index.js +26 -0
  145. package/dist/packages/internal/playground/dist/build-fingerprint.js +18 -0
  146. package/dist/packages/internal/playground/dist/fixture-conversions/list-names-properties.js +76 -0
  147. package/dist/packages/internal/playground/dist/fixture-formats.d.ts +37 -0
  148. package/dist/packages/internal/playground/dist/fixture-formats.js +20 -0
  149. package/dist/packages/internal/playground/dist/host/bootstrap.js +108 -0
  150. package/dist/packages/internal/playground/dist/host/built.js +202 -0
  151. package/dist/packages/internal/playground/dist/host/catalog-fixture.js +53 -0
  152. package/dist/packages/internal/playground/dist/host/download.js +34 -0
  153. package/dist/packages/internal/playground/dist/host/env.js +11 -0
  154. package/dist/packages/internal/playground/dist/host/everywhere-saves.js +353 -0
  155. package/dist/packages/internal/playground/dist/host/fixture-addresses.js +52 -0
  156. package/dist/packages/internal/playground/dist/host/fixture-documents.js +494 -0
  157. package/dist/packages/internal/playground/dist/host/fixture-operations.js +364 -0
  158. package/dist/packages/internal/playground/dist/host/fixture-units.js +93 -0
  159. package/dist/{fixtures → packages/internal/playground/dist/host}/image-dimensions.js +1 -1
  160. package/dist/packages/internal/playground/dist/host/leads.js +41 -0
  161. package/dist/packages/internal/playground/dist/host/media-saves.js +309 -0
  162. package/dist/{fixtures → packages/internal/playground/dist/host}/media-store.js +79 -26
  163. package/dist/packages/internal/playground/dist/host/overridable.js +9 -0
  164. package/dist/packages/internal/playground/dist/host/owned-saves.js +203 -0
  165. package/dist/{playground → packages/internal/playground/dist}/host/page-state.js +1 -1
  166. package/dist/packages/internal/playground/dist/host/program.js +54 -0
  167. package/dist/packages/internal/playground/dist/host/property-derive.js +216 -0
  168. package/dist/packages/internal/playground/dist/host/property-saves.js +74 -0
  169. package/dist/{fixtures → packages/internal/playground/dist/host}/property.js +88 -229
  170. package/dist/packages/internal/playground/dist/host/provenance.js +49 -0
  171. package/dist/packages/internal/playground/dist/host/resolve.js +553 -0
  172. package/dist/packages/internal/playground/dist/host/row-images.js +41 -0
  173. package/dist/{fixtures → packages/internal/playground/dist/host}/rows.js +1 -1
  174. package/dist/packages/internal/playground/dist/host/save.js +429 -0
  175. package/dist/packages/internal/playground/dist/host/serve.js +952 -0
  176. package/dist/packages/internal/playground/dist/host/site.js +79 -0
  177. package/dist/packages/internal/playground/dist/host/slots.js +202 -0
  178. package/dist/packages/internal/playground/dist/host/stated-content.js +93 -0
  179. package/dist/packages/internal/playground/dist/host/stored-fixtures.js +135 -0
  180. package/dist/packages/internal/playground/dist/host/violations.js +7 -0
  181. package/dist/packages/internal/playground/dist/jobs/lanes.js +24 -0
  182. package/dist/packages/internal/playground/dist/jobs/memory-queue.js +112 -0
  183. package/dist/packages/internal/playground/dist/jobs/probe.js +37 -0
  184. package/dist/packages/internal/playground/dist/jobs/queue.js +28 -0
  185. package/dist/packages/internal/playground/dist/jobs/runner.js +207 -0
  186. package/dist/packages/internal/playground/dist/layout.js +14 -0
  187. package/dist/packages/internal/playground/dist/platform.js +33 -0
  188. package/dist/packages/internal/playground/dist/server/changes.js +57 -0
  189. package/dist/packages/internal/playground/dist/server/crop.js +47 -0
  190. package/dist/packages/internal/playground/dist/server/derived-files.js +88 -0
  191. package/dist/packages/internal/playground/dist/server/download.js +158 -0
  192. package/dist/{cli/dev → packages/internal/playground/dist/server}/http.js +4 -12
  193. package/dist/packages/internal/playground/dist/server/jobs.js +29 -0
  194. package/dist/{cli/dev → packages/internal/playground/dist/server}/listen.js +4 -11
  195. package/dist/packages/internal/playground/dist/server/playground-server.js +424 -0
  196. package/dist/{cli/dev → packages/internal/playground/dist/server}/request-error.js +1 -1
  197. package/dist/packages/internal/playground/dist/server/size-ladders.js +170 -0
  198. package/dist/packages/internal/playground/dist/server/verification.js +75 -0
  199. package/dist/packages/internal/playground/dist/server/verify-build.js +139 -0
  200. package/dist/packages/internal/playground/dist/wire.js +78 -0
  201. package/dist/packages/internal/property-facts/dist/registry-facts.js +1 -1
  202. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -1
  203. package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +1 -1
  204. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -1
  205. package/dist/packages/internal/site-files/dist/head.js +59 -0
  206. package/dist/packages/internal/site-files/dist/index.js +4 -0
  207. package/dist/packages/internal/site-files/dist/site.js +211 -0
  208. package/dist/packages/internal/static-assets-binding/dist/index.js +32 -0
  209. package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +38 -5
  210. package/dist/packages/internal/template-artifact/dist/asset-mime.js +8 -1
  211. package/dist/packages/internal/template-artifact/dist/build.js +148 -0
  212. package/dist/packages/internal/template-artifact/dist/composition.js +62 -0
  213. package/dist/packages/internal/template-artifact/dist/index.js +2 -2
  214. package/dist/packages/internal/template-artifact/dist/layout.js +48 -12
  215. package/dist/packages/internal/template-artifact/dist/manifest.js +3 -10
  216. package/dist/packages/internal/template-artifact/dist/verify.js +51 -31
  217. package/dist/packages/internal/template-contracts/dist/address-value.js +6 -1
  218. package/dist/packages/internal/template-contracts/dist/content-categories.js +10 -1
  219. package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +1 -1
  220. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +1 -1
  221. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +3 -3
  222. package/dist/packages/internal/template-contracts/dist/fact-registry.js +59 -32
  223. package/dist/packages/internal/template-contracts/dist/fill-spec.js +14 -1
  224. package/dist/packages/internal/template-contracts/dist/list.d.ts +3 -3
  225. package/dist/packages/internal/template-contracts/dist/media-candidates.js +67 -2
  226. package/dist/packages/internal/template-contracts/dist/media-offer.js +180 -0
  227. package/dist/packages/internal/template-contracts/dist/object.d.ts +2 -2
  228. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +9 -2
  229. package/dist/packages/internal/template-contracts/dist/read-graph.js +36 -2
  230. package/dist/packages/internal/template-contracts/dist/ref-locate.js +16 -1
  231. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +9 -10
  232. package/dist/packages/internal/template-contracts/dist/registry-facts.js +12 -1
  233. package/dist/packages/internal/template-contracts/dist/registry-graph.js +112 -0
  234. package/dist/packages/internal/template-contracts/dist/registry-shape.js +15 -2
  235. package/dist/packages/internal/template-contracts/dist/require-graph.js +300 -0
  236. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +3 -3
  237. package/dist/packages/internal/template-contracts/dist/row.d.ts +3 -3
  238. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +1 -1
  239. package/dist/{schema → packages/internal/template-contracts/dist}/section-nav.d.ts +1 -1
  240. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +4 -4
  241. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +3 -1
  242. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +24 -1
  243. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +26 -1
  244. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +1 -1
  245. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -1
  246. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +1 -1
  247. package/dist/packages/internal/template-contracts/dist/table-members.js +7 -2
  248. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
  249. package/dist/packages/internal/upload-formats/dist/heic.js +35 -0
  250. package/dist/packages/internal/upload-formats/dist/index.js +80 -0
  251. package/dist/packages/internal/upload-formats/dist/magic-bytes.js +293 -0
  252. package/dist/platform/paths.js +1 -0
  253. package/dist/platform/process.js +49 -1
  254. package/dist/rules/registry.js +27 -3
  255. package/dist/schema/fact.d.ts +2 -2
  256. package/dist/schema/facts-view.d.ts +1 -1
  257. package/dist/schema/section-props.d.ts +1 -1
  258. package/dist/schema/section-schema.d.ts +1 -1
  259. package/dist/schema/section-schema.js +1 -0
  260. package/dist/section/declare.d.ts +1 -1
  261. package/dist/section/discovery.js +6 -2
  262. package/dist/section/publish-shape.js +38 -0
  263. package/dist/section/section.d.ts +1 -1
  264. package/dist/template/define-template.d.ts +14 -4
  265. package/dist/template/define-template.js +2 -0
  266. package/dist/template/logic-shim.d.ts +1 -1
  267. package/dist/template/materialize.js +1 -1
  268. package/dist/template/running-copy.js +0 -1
  269. package/dist/template/section-reads.js +1 -1
  270. package/guide/reference/cli/INDEX.md +6 -5
  271. package/guide/reference/cli/build.md +10 -8
  272. package/guide/reference/cli/check.md +4 -2
  273. package/guide/reference/cli/dev.md +6 -2
  274. package/guide/reference/cli/install.md +41 -0
  275. package/guide/reference/cli/property-add.md +5 -4
  276. package/guide/reference/cli/property-list.md +2 -2
  277. package/guide/reference/cli/publish.md +5 -5
  278. package/guide/reference/cli/upgrade.md +1 -1
  279. package/guide/reference/rules/INDEX.md +8 -4
  280. package/package.json +14 -30
  281. package/dist/artifact/playground/client/assets/index-BcLGpWLR.js +0 -1266
  282. package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +0 -1
  283. package/dist/cli/build/artifact.js +0 -220
  284. package/dist/cli/build/captures.js +0 -48
  285. package/dist/cli/build/fixtures.js +0 -92
  286. package/dist/cli/capture/capture-browser.js +0 -37
  287. package/dist/cli/capture/capture.js +0 -115
  288. package/dist/cli/check/render/inputs.js +0 -60
  289. package/dist/cli/check/render/nav.js +0 -31
  290. package/dist/cli/dev/crop.js +0 -20
  291. package/dist/cli/dev/fixture-ladders.js +0 -96
  292. package/dist/cli/dev/hmr.js +0 -26
  293. package/dist/cli/dev/islands.js +0 -234
  294. package/dist/cli/dev/load-template.js +0 -52
  295. package/dist/cli/dev/vite.js +0 -114
  296. package/dist/cli/dev/workspace-reader.js +0 -249
  297. package/dist/cli/publish/freshness.js +0 -64
  298. package/dist/fixtures/brand.d.ts +0 -4
  299. package/dist/fixtures/brand.js +0 -8
  300. package/dist/fixtures/load.js +0 -159
  301. package/dist/fixtures/resolve.js +0 -392
  302. package/dist/fixtures.d.ts +0 -429
  303. package/dist/fixtures.js +0 -23
  304. package/dist/packages/internal/canvas-core/dist/island-host.js +0 -62
  305. package/dist/packages/internal/canvas-core/dist/island-shields.js +0 -30
  306. package/dist/playground/canvas-island-host.d.ts +0 -11
  307. package/dist/playground/canvas-island-host.js +0 -29
  308. package/dist/playground/canvas-markers.js +0 -14
  309. package/dist/playground/host/paths.js +0 -8
  310. package/dist/playground/layout.js +0 -17
  311. package/dist/playground/wire.js +0 -28
@@ -1,33 +1,9 @@
1
- import { storedAddressView } from "../packages/internal/template-contracts/dist/address-value.js";
2
- import { derivedMembers } from "../packages/internal/template-contracts/dist/fact-compute.js";
3
- import { splitMedia } from "../packages/internal/template-contracts/dist/registry-facts.js";
4
- import { propertyFacts } from "../packages/internal/template-contracts/dist/fact-registry.js";
5
- import { RegistryFactsSchema } from "../packages/internal/property-facts/dist/registry-facts.js";
6
- import { basename, extname } from "node:path";
1
+ import { storedAddressView } from "../../../template-contracts/dist/address-value.js";
2
+ import { splitMedia } from "../../../template-contracts/dist/registry-facts.js";
3
+ import { comparableDerived, comparableImageId, contactImageId, fileMedia, linkMedia, ownedImageMedia } from "./property-derive.js";
4
+ import { RegistryFactsSchema } from "../../../property-facts/dist/registry-facts.js";
7
5
 
8
- //#region src/fixtures/property.ts
9
- function contactImageId(contactId, field) {
10
- return `contact:${contactId}:${field}`;
11
- }
12
- function comparableImageId(comparableId) {
13
- return `comparable:${comparableId}:photo`;
14
- }
15
- const MIME_BY_EXTENSION = {
16
- ".pdf": "application/pdf",
17
- ".mp4": "video/mp4",
18
- ".webm": "video/webm",
19
- ".mov": "video/quicktime",
20
- ".mp3": "audio/mpeg",
21
- ".wav": "audio/wav",
22
- ".png": "image/png",
23
- ".jpg": "image/jpeg",
24
- ".jpeg": "image/jpeg",
25
- ".webp": "image/webp",
26
- ".avif": "image/avif",
27
- ".gif": "image/gif",
28
- ".svg": "image/svg+xml",
29
- ".zip": "application/zip"
30
- };
6
+ //#region ../../internal/playground/dist/host/property.js
31
7
  const CONTACT_IMAGE_FIELDS = [
32
8
  "headshot",
33
9
  "logo_dark",
@@ -43,17 +19,6 @@ const ADDRESS_PARTS = /* @__PURE__ */ new Set([
43
19
  "longitude",
44
20
  "source"
45
21
  ]);
46
- const COMPARABLE_FIELDS = propertyFacts.pages.comparables.declaration.element.fields;
47
- function mediaUrl(file) {
48
- return typeof file === "string" ? file : file.url;
49
- }
50
- function displayName(url) {
51
- const ext = extname(url);
52
- return basename(url, ext).replace(/-[0-9a-f]{8}$/, "") + ext;
53
- }
54
- function mimeOf(url) {
55
- return MIME_BY_EXTENSION[extname(url).toLowerCase()] ?? "application/octet-stream";
56
- }
57
22
  function isMediaFile(value) {
58
23
  if (typeof value === "string") return value.length > 0;
59
24
  return typeof value === "object" && value !== null && typeof value.url === "string" && typeof value.width === "number" && typeof value.height === "number";
@@ -69,81 +34,6 @@ const ENTRY_SUBSTITUTIONS = /* @__PURE__ */ new Set([
69
34
  "thumbnail_source_url",
70
35
  "source"
71
36
  ]);
72
- const FIXTURE_EPOCH = Date.UTC(2026, 0, 1);
73
- function addedAt(index) {
74
- return new Date(FIXTURE_EPOCH + index * 1e3).toISOString();
75
- }
76
- const NOTHING_STATED = {
77
- crop: null,
78
- key: null,
79
- mime: null,
80
- bytes: null,
81
- url: null,
82
- provider: null,
83
- account: null,
84
- page_count: null,
85
- duration_ms: null,
86
- width: null,
87
- height: null,
88
- captured_at: null,
89
- scan_count: null,
90
- poster_at_ms: null,
91
- renditions: {
92
- master: null,
93
- crop: null,
94
- cutout: null,
95
- mask_white: null,
96
- mask_black: null,
97
- poster: null,
98
- encode: null
99
- },
100
- state: "ready"
101
- };
102
- function fixtureRecord(id, kind, name, added, stated) {
103
- return {
104
- ...NOTHING_STATED,
105
- id,
106
- file: id,
107
- kind,
108
- name,
109
- added_at: added,
110
- ...stated
111
- };
112
- }
113
- function linkName(url) {
114
- return typeof url === "string" ? url.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "") : "";
115
- }
116
- function renditionsOf(held) {
117
- return {
118
- master: null,
119
- crop: null,
120
- cutout: null,
121
- mask_white: null,
122
- mask_black: null,
123
- poster: null,
124
- encode: null,
125
- ...held
126
- };
127
- }
128
- function renditionOf(file, mime = null) {
129
- const sized = typeof file === "string" ? null : file;
130
- return {
131
- key: mediaUrl(file),
132
- mime,
133
- width: sized?.width ?? null,
134
- height: sized?.height ?? null,
135
- bytes: null
136
- };
137
- }
138
- function thumbnailRendition(url) {
139
- return {
140
- key: url,
141
- mime: null,
142
- width: null,
143
- height: null,
144
- bytes: null
145
- };
146
- }
147
37
  const AUTHORED_LISTS = /* @__PURE__ */ new Set([
148
38
  "address",
149
39
  "uploads",
@@ -156,20 +46,34 @@ const AUTHORED_LISTS = /* @__PURE__ */ new Set([
156
46
  "contacts",
157
47
  "comparables"
158
48
  ]);
159
- const UNSTATED_UNIT_MEMBERS = {
160
- floor: null,
161
- hoa_monthly: null,
162
- parking: null,
163
- lot_sqft: null,
164
- amenities: []
165
- };
166
- const UNSTATED_SPACE_MEMBERS = {
167
- use: null,
168
- sqft: null,
169
- price: null,
170
- floor: null,
171
- parking: null,
172
- amenities: []
49
+ const UNSTATED_PROPERTY_MEMBERS = { site_url: null };
50
+ const UNSTATED_ROW_MEMBERS = {
51
+ units: {
52
+ floor: null,
53
+ hoa_monthly: null,
54
+ parking: null,
55
+ lot_sqft: null,
56
+ amenities: []
57
+ },
58
+ commercial_spaces: {
59
+ use: null,
60
+ sqft: null,
61
+ price: null,
62
+ floor: null,
63
+ parking: null,
64
+ amenities: []
65
+ },
66
+ comparables: {
67
+ year_built: null,
68
+ lot_sqft: null,
69
+ stories: null,
70
+ units: null,
71
+ hoa_monthly: null,
72
+ list_price: null,
73
+ listed_date: null,
74
+ mls_number: null,
75
+ description: null
76
+ }
173
77
  };
174
78
  const SORTED_LISTS = {
175
79
  property_media: {
@@ -199,6 +103,44 @@ function omit(record, keys) {
199
103
  function listOf(value) {
200
104
  return Array.isArray(value) ? value : [];
201
105
  }
106
+ function uploadEntryMedia(raw, index, path, invalid) {
107
+ const admitFile = (value, at) => {
108
+ if (isMediaFile(value)) return true;
109
+ invalid(`${at}: expected a media file`);
110
+ return false;
111
+ };
112
+ const id = raw["id"];
113
+ const { file: entryFile, poster, preview, thumbnail_source_url: thumbnail } = raw;
114
+ const stated = omit(raw, ENTRY_SUBSTITUTIONS);
115
+ const kind = raw["kind"];
116
+ if (kind === "video" && raw["source"] !== "upload" && raw["source"] !== "link") {
117
+ invalid(`${path}.source: expected "upload" or "link"`);
118
+ return null;
119
+ }
120
+ if (kind === "image") {
121
+ if (!admitFile(entryFile, `${path}.file`)) return null;
122
+ return fileMedia(id, "image", entryFile, index, stated);
123
+ }
124
+ if (kind === "video" && raw["source"] === "upload") {
125
+ if (!admitFile(entryFile, `${path}.file`)) return null;
126
+ if (poster !== void 0 && !admitFile(poster, `${path}.poster`)) return null;
127
+ return fileMedia(id, "video", entryFile, index, stated, poster);
128
+ }
129
+ if (kind === "video" || kind === "tour") {
130
+ if (thumbnail !== void 0 && (typeof thumbnail !== "string" || thumbnail === "")) {
131
+ invalid(`${path}.thumbnail_source_url: expected a non-empty URL`);
132
+ return null;
133
+ }
134
+ return linkMedia(id, kind, stated, index, thumbnail);
135
+ }
136
+ if (kind === "document") {
137
+ if (!admitFile(entryFile, `${path}.file`)) return null;
138
+ if (preview !== void 0 && !admitFile(preview, `${path}.preview`)) return null;
139
+ return fileMedia(id, "document", entryFile, index, stated, preview);
140
+ }
141
+ invalid(`${path}.kind: expected "image", "video", "tour" or "document"`);
142
+ return null;
143
+ }
202
144
  function canonicalizeProperty(property, file) {
203
145
  const violations = [];
204
146
  const media = /* @__PURE__ */ new Map();
@@ -232,20 +174,10 @@ function canonicalizeProperty(property, file) {
232
174
  };
233
175
  const admitFile = (value, path) => {
234
176
  if (isMediaFile(value)) return true;
235
- invalid(`${path}: expected an imported media file`);
177
+ invalid(`${path}: expected a media file`);
236
178
  return false;
237
179
  };
238
- const admitThumbnail = (value, path) => {
239
- if (value === void 0) return {};
240
- if (typeof value === "string" && value !== "") return { posterUrl: value };
241
- invalid(`${path}.thumbnail_source_url: expected a non-empty URL`);
242
- return null;
243
- };
244
180
  const uploads = [];
245
- const pooled = (id, record, catalog) => {
246
- uploads.push(owning(record));
247
- media.set(id, catalog);
248
- };
249
181
  for (const [i, raw] of listOf(property.uploads).entries()) {
250
182
  const path = `uploads[${i}]`;
251
183
  if (!isRecord(raw)) {
@@ -253,58 +185,10 @@ function canonicalizeProperty(property, file) {
253
185
  continue;
254
186
  }
255
187
  if (!admit("uploads", raw["id"], path)) continue;
256
- const id = raw["id"];
257
- const { file: entryFile, poster, preview, thumbnail_source_url: thumbnail } = raw;
258
- const stated = omit(raw, ENTRY_SUBSTITUTIONS);
259
- const added = addedAt(i);
260
- const fileNamed = (file, held = {}) => ({
261
- mime: mimeOf(mediaUrl(file)),
262
- ...stated,
263
- key: mediaUrl(file),
264
- renditions: renditionsOf(held)
265
- });
266
- const kind = raw["kind"];
267
- if (kind === "video" && raw["source"] !== "upload" && raw["source"] !== "link") {
268
- invalid(`${path}.source: expected "upload" or "link"`);
269
- continue;
270
- }
271
- if (kind === "image") {
272
- if (!admitFile(entryFile, `${path}.file`)) continue;
273
- pooled(id, fixtureRecord(id, "image", displayName(mediaUrl(entryFile)), added, fileNamed(entryFile)), entry(id, "image", entryFile));
274
- } else if (kind === "video" && raw["source"] === "upload") {
275
- if (!admitFile(entryFile, `${path}.file`)) continue;
276
- if (poster !== void 0 && !admitFile(poster, `${path}.poster`)) continue;
277
- const held = {
278
- encode: renditionOf(entryFile, mimeOf(mediaUrl(entryFile))),
279
- ...poster === void 0 ? {} : { poster: renditionOf(poster) }
280
- };
281
- pooled(id, fixtureRecord(id, "video", displayName(mediaUrl(entryFile)), added, fileNamed(entryFile, held)), {
282
- ...entry(id, "video", entryFile),
283
- ...poster === void 0 ? {} : { posterFile: poster }
284
- });
285
- } else if (kind === "video" || kind === "tour") {
286
- const thumb = admitThumbnail(thumbnail, path);
287
- if (thumb === null) continue;
288
- const held = thumb.posterUrl === void 0 ? {} : { poster: thumbnailRendition(thumb.posterUrl) };
289
- pooled(id, fixtureRecord(id, kind, linkName(raw["url"]), added, {
290
- ...stated,
291
- renditions: renditionsOf(held)
292
- }), {
293
- ...entry(id, kind, null),
294
- url: typeof raw["url"] === "string" ? raw["url"] : null,
295
- provider: typeof raw["provider"] === "string" ? raw["provider"] : null,
296
- ...thumb
297
- });
298
- } else if (kind === "document") {
299
- if (!admitFile(entryFile, `${path}.file`)) continue;
300
- if (preview !== void 0 && !admitFile(preview, `${path}.preview`)) continue;
301
- const url = mediaUrl(entryFile);
302
- const held = preview === void 0 ? {} : { poster: renditionOf(preview) };
303
- pooled(id, fixtureRecord(id, "document", displayName(url), added, fileNamed(entryFile, held)), {
304
- ...entry(id, "document", entryFile),
305
- ...preview === void 0 ? {} : { posterFile: preview }
306
- });
307
- } else invalid(`${path}.kind: expected "image", "video", "tour" or "document"`);
188
+ const read = uploadEntryMedia(raw, i, path, invalid);
189
+ if (read === null) continue;
190
+ uploads.push(owning(read.record));
191
+ media.set(read.catalog.id, read.catalog);
308
192
  }
309
193
  const statedKinds = new Map(listOf(property.uploads).flatMap((raw) => isRecord(raw) && typeof raw["id"] === "string" ? [[raw["id"], raw["kind"]]] : []));
310
194
  const sorted = {
@@ -334,11 +218,9 @@ function canonicalizeProperty(property, file) {
334
218
  const owned = (value, id, path) => {
335
219
  if (value === null || value === void 0) return null;
336
220
  if (!admitFile(value, path)) return null;
337
- media.set(id, entry(id, "image", value));
338
- return owning(fixtureRecord(id, "image", displayName(mediaUrl(value)), addedAt(0), {
339
- mime: mimeOf(mediaUrl(value)),
340
- key: mediaUrl(value)
341
- }));
221
+ const { record, catalog } = ownedImageMedia(id, value);
222
+ media.set(id, catalog);
223
+ return owning(record);
342
224
  };
343
225
  const rowsPicking = (list, rows, unstated) => {
344
226
  const out = [];
@@ -372,8 +254,8 @@ function canonicalizeProperty(property, file) {
372
254
  }
373
255
  return out;
374
256
  };
375
- const units = rowsPicking("units", property.units, UNSTATED_UNIT_MEMBERS);
376
- const commercialSpaces = rowsPicking("commercial_spaces", property.commercial_spaces, UNSTATED_SPACE_MEMBERS);
257
+ const units = rowsPicking("units", property.units, UNSTATED_ROW_MEMBERS.units);
258
+ const commercialSpaces = rowsPicking("commercial_spaces", property.commercial_spaces, UNSTATED_ROW_MEMBERS.commercial_spaces);
377
259
  const statedAddress = (value, path) => {
378
260
  if (value !== null && value !== void 0 && !isRecord(value)) invalid(`${path}: expected an address — its parts and its pin — or null`);
379
261
  for (const [key, part] of Object.entries(isRecord(value) ? value : {})) if (!ADDRESS_PARTS.has(key)) invalid(`${path}.${key}: not a member an address states (its parts and its pin)`);
@@ -400,26 +282,15 @@ function canonicalizeProperty(property, file) {
400
282
  const { photo, ...row } = raw;
401
283
  const address = statedAddress(raw["address"], `${path}.address`);
402
284
  const comparable = {
403
- year_built: null,
404
- lot_sqft: null,
405
- stories: null,
406
- units: null,
407
- hoa_monthly: null,
408
- list_price: null,
409
- listed_date: null,
410
- mls_number: null,
411
- description: null,
285
+ ...UNSTATED_ROW_MEMBERS.comparables,
412
286
  ...row,
413
287
  address,
414
288
  photo: owned(photo, comparableImageId(raw["id"]), `${path}.photo`)
415
289
  };
416
- comparables.push({
417
- ...comparable,
418
- ...derivedMembers(COMPARABLE_FIELDS, comparable, {
419
- address: subject,
420
- listing_intent: property.listing_intent
421
- })
422
- });
290
+ comparables.push(comparableDerived(comparable, {
291
+ address: subject,
292
+ listing_intent: property.listing_intent
293
+ }));
423
294
  }
424
295
  if (violations.length > 0) return {
425
296
  facts: null,
@@ -427,7 +298,7 @@ function canonicalizeProperty(property, file) {
427
298
  violations
428
299
  };
429
300
  const candidate = {
430
- site_url: null,
301
+ ...UNSTATED_PROPERTY_MEMBERS,
431
302
  ...omit(property, AUTHORED_LISTS),
432
303
  address: subject,
433
304
  uploads,
@@ -456,18 +327,6 @@ function canonicalizeProperty(property, file) {
456
327
  violations
457
328
  };
458
329
  }
459
- function entry(id, kind, file) {
460
- const url = file === null ? "" : mediaUrl(file);
461
- return {
462
- id,
463
- kind,
464
- file,
465
- url: null,
466
- provider: null,
467
- filename: url === "" ? "" : displayName(url),
468
- mime: url === "" ? "" : mimeOf(url)
469
- };
470
- }
471
330
 
472
331
  //#endregion
473
- export { canonicalizeProperty, comparableImageId, contactImageId, mediaUrl };
332
+ export { ADDRESS_PARTS, AUTHORED_LISTS, UNSTATED_PROPERTY_MEMBERS, UNSTATED_ROW_MEMBERS, canonicalizeProperty, comparableImageId, contactImageId, uploadEntryMedia };
@@ -0,0 +1,49 @@
1
+ import { tableKey } from "../../../template-contracts/dist/registry-shape.js";
2
+ import { heldRowTableOf, rowTablesOf } from "../../../template-contracts/dist/ref-locate.js";
3
+ import "../../../template-contracts/dist/table-members.js";
4
+ import { memberSourceOf } from "../../../template-contracts/dist/row-sources.js";
5
+
6
+ //#region ../../internal/playground/dist/host/provenance.js
7
+ function isEmptyValue(value, type) {
8
+ if (type === "list") return Array.isArray(value) && value.length === 0;
9
+ if (type === "object") return typeof value === "object" && value !== null && Object.keys(value).length === 0;
10
+ return value === null || value === void 0;
11
+ }
12
+ function slotProvenance(def, id, stated, value, facts, marks) {
13
+ if (Object.keys(marks?.scalar ?? {}).some((marked) => marked === id || marked.startsWith(`${id}.`))) return { kind: "authored" };
14
+ const source = def.source;
15
+ if (def.type === "object") return { kind: "authored" };
16
+ if (def.type === "row") {
17
+ if (typeof stated === "string") return { kind: "authored" };
18
+ const table = heldRowTableOf(facts, rowTablesOf(def), typeof value === "string" ? value : null);
19
+ return table !== null ? {
20
+ kind: "fact",
21
+ ref: tableKey(table)
22
+ } : { kind: "empty" };
23
+ }
24
+ if (source?.kind === "home") return {
25
+ kind: "fact",
26
+ ref: String(source.key)
27
+ };
28
+ if (source?.kind === "derived") return {
29
+ kind: "computed",
30
+ ref: String(source.transform)
31
+ };
32
+ if (source?.kind === "section") return {
33
+ kind: "computed",
34
+ ref: id
35
+ };
36
+ const member = memberSourceOf(source);
37
+ if (member !== null) return {
38
+ kind: "fact",
39
+ ref: `${member.slot}.${member.field}`
40
+ };
41
+ if (source?.kind === "element") return {
42
+ kind: "fact",
43
+ ref: "element"
44
+ };
45
+ return isEmptyValue(value, def.type) ? { kind: "empty" } : { kind: "authored" };
46
+ }
47
+
48
+ //#endregion
49
+ export { isEmptyValue, slotProvenance };