@homepages/concrete 11.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 (322) hide show
  1. package/CHANGELOG.md +203 -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 +17 -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 -60
  16. package/dist/base.css +19 -59
  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 +48 -22
  123. package/dist/packages/internal/fill-bake/dist/held-rows.js +2 -0
  124. package/dist/packages/internal/fill-bake/dist/index.js +6 -1
  125. package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -3
  126. package/dist/packages/internal/fill-bake/dist/resolve-instance.js +9 -0
  127. package/dist/packages/internal/fill-bake/dist/resolve.js +3 -0
  128. package/dist/packages/internal/fill-bake/dist/round-trip.js +2 -0
  129. package/dist/packages/internal/fill-bake/dist/strip.js +6 -0
  130. package/dist/packages/internal/fill-vocabulary/dist/holder.js +1 -1
  131. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +1 -1
  132. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +1 -1
  133. package/dist/packages/internal/format-geometry/dist/capture.js +3 -11
  134. package/dist/packages/internal/format-geometry/dist/format.d.ts +2 -8
  135. package/dist/packages/internal/format-geometry/dist/geometry.js +2 -13
  136. package/dist/packages/internal/island-runtime/dist/index.js +1 -10
  137. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +5 -0
  138. package/dist/packages/internal/lead-fields/dist/ingest.js +72 -0
  139. package/dist/packages/internal/media-resolution/dist/video.js +6 -2
  140. package/dist/packages/internal/page-render/dist/addresses.js +57 -0
  141. package/dist/packages/internal/page-render/dist/index.js +6 -0
  142. package/dist/packages/internal/page-render/dist/kept.js +30 -0
  143. package/dist/packages/internal/page-render/dist/nav.js +42 -0
  144. package/dist/packages/internal/page-render/dist/render.js +152 -0
  145. package/dist/packages/internal/page-shell/dist/assemble.js +161 -0
  146. package/dist/packages/internal/page-shell/dist/escape.js +10 -0
  147. package/dist/packages/internal/page-shell/dist/frame.js +23 -0
  148. package/dist/packages/internal/page-shell/dist/index.js +26 -0
  149. package/dist/packages/internal/playground/dist/build-fingerprint.js +18 -0
  150. package/dist/packages/internal/playground/dist/fixture-conversions/list-names-properties.js +76 -0
  151. package/dist/packages/internal/playground/dist/fixture-formats.d.ts +37 -0
  152. package/dist/packages/internal/playground/dist/fixture-formats.js +20 -0
  153. package/dist/packages/internal/playground/dist/host/bootstrap.js +108 -0
  154. package/dist/packages/internal/playground/dist/host/built.js +202 -0
  155. package/dist/packages/internal/playground/dist/host/catalog-fixture.js +53 -0
  156. package/dist/packages/internal/playground/dist/host/download.js +34 -0
  157. package/dist/packages/internal/playground/dist/host/env.js +11 -0
  158. package/dist/packages/internal/playground/dist/host/everywhere-saves.js +353 -0
  159. package/dist/packages/internal/playground/dist/host/fixture-addresses.js +52 -0
  160. package/dist/packages/internal/playground/dist/host/fixture-documents.js +494 -0
  161. package/dist/packages/internal/playground/dist/host/fixture-operations.js +364 -0
  162. package/dist/packages/internal/playground/dist/host/fixture-units.js +93 -0
  163. package/dist/{fixtures → packages/internal/playground/dist/host}/image-dimensions.js +1 -1
  164. package/dist/packages/internal/playground/dist/host/leads.js +41 -0
  165. package/dist/packages/internal/playground/dist/host/media-saves.js +309 -0
  166. package/dist/{fixtures → packages/internal/playground/dist/host}/media-store.js +79 -26
  167. package/dist/packages/internal/playground/dist/host/overridable.js +9 -0
  168. package/dist/packages/internal/playground/dist/host/owned-saves.js +203 -0
  169. package/dist/{playground → packages/internal/playground/dist}/host/page-state.js +1 -1
  170. package/dist/packages/internal/playground/dist/host/program.js +54 -0
  171. package/dist/packages/internal/playground/dist/host/property-derive.js +216 -0
  172. package/dist/packages/internal/playground/dist/host/property-saves.js +74 -0
  173. package/dist/{fixtures → packages/internal/playground/dist/host}/property.js +88 -229
  174. package/dist/packages/internal/playground/dist/host/provenance.js +49 -0
  175. package/dist/packages/internal/playground/dist/host/resolve.js +553 -0
  176. package/dist/packages/internal/playground/dist/host/row-images.js +41 -0
  177. package/dist/{fixtures → packages/internal/playground/dist/host}/rows.js +1 -1
  178. package/dist/packages/internal/playground/dist/host/save.js +429 -0
  179. package/dist/packages/internal/playground/dist/host/serve.js +952 -0
  180. package/dist/packages/internal/playground/dist/host/site.js +79 -0
  181. package/dist/packages/internal/playground/dist/host/slots.js +202 -0
  182. package/dist/packages/internal/playground/dist/host/stated-content.js +93 -0
  183. package/dist/packages/internal/playground/dist/host/stored-fixtures.js +135 -0
  184. package/dist/packages/internal/playground/dist/host/violations.js +7 -0
  185. package/dist/packages/internal/playground/dist/jobs/lanes.js +24 -0
  186. package/dist/packages/internal/playground/dist/jobs/memory-queue.js +112 -0
  187. package/dist/packages/internal/playground/dist/jobs/probe.js +37 -0
  188. package/dist/packages/internal/playground/dist/jobs/queue.js +28 -0
  189. package/dist/packages/internal/playground/dist/jobs/runner.js +207 -0
  190. package/dist/packages/internal/playground/dist/layout.js +14 -0
  191. package/dist/packages/internal/playground/dist/platform.js +33 -0
  192. package/dist/packages/internal/playground/dist/server/changes.js +57 -0
  193. package/dist/packages/internal/playground/dist/server/crop.js +47 -0
  194. package/dist/packages/internal/playground/dist/server/derived-files.js +88 -0
  195. package/dist/packages/internal/playground/dist/server/download.js +158 -0
  196. package/dist/{cli/dev → packages/internal/playground/dist/server}/http.js +4 -12
  197. package/dist/packages/internal/playground/dist/server/jobs.js +29 -0
  198. package/dist/{cli/dev → packages/internal/playground/dist/server}/listen.js +4 -11
  199. package/dist/packages/internal/playground/dist/server/playground-server.js +424 -0
  200. package/dist/{cli/dev → packages/internal/playground/dist/server}/request-error.js +1 -1
  201. package/dist/packages/internal/playground/dist/server/size-ladders.js +170 -0
  202. package/dist/packages/internal/playground/dist/server/verification.js +75 -0
  203. package/dist/packages/internal/playground/dist/server/verify-build.js +139 -0
  204. package/dist/packages/internal/playground/dist/wire.js +78 -0
  205. package/dist/packages/internal/property-facts/dist/registry-facts.js +1 -1
  206. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -1
  207. package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +1 -1
  208. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -1
  209. package/dist/packages/internal/site-files/dist/head.js +59 -0
  210. package/dist/packages/internal/site-files/dist/index.js +4 -0
  211. package/dist/packages/internal/site-files/dist/site.js +211 -0
  212. package/dist/packages/internal/static-assets-binding/dist/index.js +32 -0
  213. package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +38 -5
  214. package/dist/packages/internal/template-artifact/dist/asset-mime.js +8 -1
  215. package/dist/packages/internal/template-artifact/dist/build.js +148 -0
  216. package/dist/packages/internal/template-artifact/dist/composition.js +62 -0
  217. package/dist/packages/internal/template-artifact/dist/index.js +2 -2
  218. package/dist/packages/internal/template-artifact/dist/layout.js +48 -12
  219. package/dist/packages/internal/template-artifact/dist/manifest.js +3 -10
  220. package/dist/packages/internal/template-artifact/dist/verify.js +51 -31
  221. package/dist/packages/internal/template-contracts/dist/address-value.js +6 -1
  222. package/dist/packages/internal/template-contracts/dist/content-categories.js +10 -1
  223. package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +1 -1
  224. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +1 -1
  225. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +3 -3
  226. package/dist/packages/internal/template-contracts/dist/fact-registry.js +59 -32
  227. package/dist/packages/internal/template-contracts/dist/fill-spec.js +14 -1
  228. package/dist/packages/internal/template-contracts/dist/list.d.ts +3 -3
  229. package/dist/packages/internal/template-contracts/dist/media-candidates.js +67 -2
  230. package/dist/packages/internal/template-contracts/dist/media-offer.js +180 -0
  231. package/dist/packages/internal/template-contracts/dist/object.d.ts +2 -2
  232. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +9 -2
  233. package/dist/packages/internal/template-contracts/dist/read-graph.js +36 -2
  234. package/dist/packages/internal/template-contracts/dist/ref-locate.js +16 -1
  235. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +9 -10
  236. package/dist/packages/internal/template-contracts/dist/registry-facts.js +12 -1
  237. package/dist/packages/internal/template-contracts/dist/registry-graph.js +112 -0
  238. package/dist/packages/internal/template-contracts/dist/registry-shape.js +15 -2
  239. package/dist/packages/internal/template-contracts/dist/require-graph.js +300 -0
  240. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +3 -3
  241. package/dist/packages/internal/template-contracts/dist/row.d.ts +3 -3
  242. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +1 -1
  243. package/dist/{schema → packages/internal/template-contracts/dist}/section-nav.d.ts +1 -1
  244. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +4 -4
  245. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +3 -1
  246. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +24 -1
  247. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +26 -1
  248. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +1 -1
  249. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -1
  250. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +1 -1
  251. package/dist/packages/internal/template-contracts/dist/table-members.js +7 -2
  252. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
  253. package/dist/packages/internal/upload-formats/dist/heic.js +35 -0
  254. package/dist/packages/internal/upload-formats/dist/index.js +80 -0
  255. package/dist/packages/internal/upload-formats/dist/magic-bytes.js +293 -0
  256. package/dist/platform/paths.js +1 -0
  257. package/dist/platform/process.js +49 -1
  258. package/dist/primitives/FrameShell.d.ts +5 -2
  259. package/dist/primitives/FrameShell.js +2 -1
  260. package/dist/rules/registry.js +28 -4
  261. package/dist/schema/fact.d.ts +2 -2
  262. package/dist/schema/facts-view.d.ts +1 -1
  263. package/dist/schema/format.d.ts +0 -1
  264. package/dist/schema/format.js +1 -2
  265. package/dist/schema/manifest.js +18 -24
  266. package/dist/schema/section-props.d.ts +1 -1
  267. package/dist/schema/section-schema.d.ts +1 -1
  268. package/dist/schema/section-schema.js +1 -0
  269. package/dist/section/declare.d.ts +1 -1
  270. package/dist/section/discovery.js +6 -2
  271. package/dist/section/publish-shape.js +38 -0
  272. package/dist/section/section.d.ts +1 -1
  273. package/dist/site-analytics.js +6 -1
  274. package/dist/site-runtime/window-height.js +19 -0
  275. package/dist/template/define-template.d.ts +25 -4
  276. package/dist/template/define-template.js +3 -0
  277. package/dist/template/logic-shim.d.ts +1 -1
  278. package/dist/template/materialize.js +3 -1
  279. package/dist/template/running-copy.js +0 -1
  280. package/dist/template/section-reads.js +1 -1
  281. package/guide/reference/cli/INDEX.md +6 -5
  282. package/guide/reference/cli/build.md +10 -8
  283. package/guide/reference/cli/check.md +4 -2
  284. package/guide/reference/cli/dev.md +6 -2
  285. package/guide/reference/cli/install.md +41 -0
  286. package/guide/reference/cli/property-add.md +5 -4
  287. package/guide/reference/cli/property-list.md +2 -2
  288. package/guide/reference/cli/publish.md +5 -5
  289. package/guide/reference/cli/upgrade.md +1 -1
  290. package/guide/reference/rules/INDEX.md +9 -5
  291. package/package.json +14 -30
  292. package/dist/artifact/playground/client/assets/index-ByeGGedv.js +0 -1259
  293. package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +0 -1
  294. package/dist/cli/build/artifact.js +0 -220
  295. package/dist/cli/build/captures.js +0 -48
  296. package/dist/cli/build/fixtures.js +0 -92
  297. package/dist/cli/capture/capture-browser.js +0 -37
  298. package/dist/cli/capture/capture.js +0 -113
  299. package/dist/cli/check/render/inputs.js +0 -60
  300. package/dist/cli/check/render/nav.js +0 -31
  301. package/dist/cli/dev/crop.js +0 -20
  302. package/dist/cli/dev/fixture-ladders.js +0 -96
  303. package/dist/cli/dev/hmr.js +0 -26
  304. package/dist/cli/dev/islands.js +0 -234
  305. package/dist/cli/dev/load-template.js +0 -52
  306. package/dist/cli/dev/vite.js +0 -114
  307. package/dist/cli/dev/workspace-reader.js +0 -248
  308. package/dist/cli/publish/freshness.js +0 -64
  309. package/dist/fixtures/brand.d.ts +0 -4
  310. package/dist/fixtures/brand.js +0 -8
  311. package/dist/fixtures/load.js +0 -159
  312. package/dist/fixtures/resolve.js +0 -392
  313. package/dist/fixtures.d.ts +0 -429
  314. package/dist/fixtures.js +0 -23
  315. package/dist/packages/internal/canvas-core/dist/island-host.js +0 -62
  316. package/dist/packages/internal/canvas-core/dist/island-shields.js +0 -30
  317. package/dist/playground/canvas-island-host.d.ts +0 -11
  318. package/dist/playground/canvas-island-host.js +0 -29
  319. package/dist/playground/canvas-markers.js +0 -14
  320. package/dist/playground/host/paths.js +0 -8
  321. package/dist/playground/layout.js +0 -17
  322. package/dist/playground/wire.js +0 -28
@@ -207,6 +207,29 @@ function mediaDeclarationProblem(declaration) {
207
207
  }
208
208
  return null;
209
209
  }
210
+ const DOCUMENT_MIMES = /* @__PURE__ */ new Set([
211
+ "application/pdf",
212
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
213
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
214
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation",
215
+ "application/msword",
216
+ "application/vnd.ms-excel",
217
+ "application/vnd.ms-powerpoint",
218
+ "text/plain",
219
+ "text/csv"
220
+ ]);
221
+ function kindOfMime(mime) {
222
+ const type = (mime.split(";")[0] ?? "").trim().toLowerCase();
223
+ if (type.startsWith("image/")) return "image";
224
+ if (type.startsWith("video/")) return "video";
225
+ return DOCUMENT_MIMES.has(type) ? "document" : null;
226
+ }
227
+ function kindOfLink(url) {
228
+ const provider = matchLinkProvider(url);
229
+ if (provider === null) return null;
230
+ const kind = LINK_PROVIDERS[provider].kind;
231
+ return kind === "tour" || kind === "video" ? kind : null;
232
+ }
210
233
  const DISPLAY_ENTRIES = ["visibility", "variant"];
211
234
  const VISIBILITY_CASES = ["visible", "hidden"];
212
235
  const LINK_KINDS = [
@@ -385,4 +408,4 @@ const PASSTHROUGH_TOUR_PROVIDERS = /* @__PURE__ */ new Set([
385
408
  ]);
386
409
 
387
410
  //#endregion
388
- export { CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, HOLDER_PROCESS_VERBS, LINK_KINDS, LINK_PROVIDERS, LIST_SLOT_TYPES, MEDIA_KINDS, OBJECT_BINDING_OWN_KEYS, PROCESS_CATALOG, PROCESS_VERBS, REF_SLOT_TYPES, SLOT_TYPES, VISIBILITY_CASES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isLinkAccepts, isListSlotType, isMediaKind, isMediaType, isPhoneValue, isProcessVerb, matchLinkProvider, mediaDeclarationProblem, processBindingOf, processOptionsProblem, tourEmbedUrl, videoEmbedUrl };
411
+ export { CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, HOLDER_PROCESS_VERBS, LINK_KINDS, LINK_PROVIDERS, LIST_SLOT_TYPES, MEDIA_KINDS, OBJECT_BINDING_OWN_KEYS, PROCESS_CATALOG, PROCESS_VERBS, REF_SLOT_TYPES, SLOT_TYPES, VISIBILITY_CASES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isLinkAccepts, isListSlotType, isMediaKind, isMediaType, isPhoneValue, isProcessVerb, kindOfLink, kindOfMime, matchLinkProvider, mediaDeclarationProblem, processBindingOf, processOptionsProblem, tourEmbedUrl, videoEmbedUrl };
@@ -16,9 +16,34 @@ function objectFieldOf(slotId) {
16
16
  field: slotId.slice(dot + 1)
17
17
  };
18
18
  }
19
+ function slotValueOf(slots, slotId) {
20
+ const field = objectFieldOf(slotId);
21
+ if (field === null) return slots[slotId];
22
+ const object = slots[field.object];
23
+ return object !== null && typeof object === "object" && !Array.isArray(object) ? object[field.field] : void 0;
24
+ }
25
+ function withSlotValue(slots, slotId, value) {
26
+ const field = objectFieldOf(slotId);
27
+ if (field === null) return {
28
+ ...slots,
29
+ [slotId]: value
30
+ };
31
+ const current = slots[field.object];
32
+ const object = current !== null && typeof current === "object" && !Array.isArray(current) ? current : {};
33
+ return {
34
+ ...slots,
35
+ [field.object]: {
36
+ ...object,
37
+ [field.field]: value
38
+ }
39
+ };
40
+ }
19
41
  function itemOverridesForSlot(overrides, slotId) {
20
42
  return { ...overrides?.items?.[slotId] ?? {} };
21
43
  }
44
+ function removedItemsForSlot(overrides, slotId) {
45
+ return { ...overrides?.items_removed?.[slotId] ?? {} };
46
+ }
22
47
 
23
48
  //#endregion
24
- export { isOrderOverridden, isSlotOverridden, itemOverridesForSlot, objectFieldOf, objectFieldSlotId };
49
+ export { isOrderOverridden, isSlotOverridden, itemOverridesForSlot, objectFieldOf, objectFieldSlotId, removedItemsForSlot, slotValueOf, withSlotValue };
@@ -2,9 +2,9 @@ import { DocumentValue } from "./document-value.js";
2
2
  import { TourValue } from "./tour-value.js";
3
3
  import { VideoValue } from "./video-value.js";
4
4
  import { ImageValue } from "./runtime-values.js";
5
- import { SlotValue } from "./slot-value.js";
6
5
  import { Slot } from "./slot-types.js";
7
6
  import { DocumentMedia, DocumentMediaValue, ImageMedia, Media, TourMedia, VideoMedia } from "./registry-facts.js";
7
+ import { SlotValue } from "./slot-value.js";
8
8
  //#region ../../internal/template-contracts/dist/slot-ref.d.ts
9
9
  /** The reserved `slot` prefix a display entry's ref is addressed by. */
10
10
  declare const DISPLAY_REF_PREFIX = "display.";
@@ -1,4 +1,4 @@
1
- import { PRIMITIVE_DESCRIPTORS } from "./primitive-descriptors.js";
1
+ import { PRIMITIVE_DESCRIPTORS, defaultForSlotType } from "./primitive-descriptors.js";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region ../../internal/template-contracts/dist/slot-types.js
@@ -1,6 +1,6 @@
1
+ import { MediaKind } from "./slot-catalog.js";
1
2
  import { AddressValue } from "./address-value.js";
2
3
  import { DocumentValue } from "./document-value.js";
3
- import { MediaKind } from "./slot-catalog.js";
4
4
  import { TourValue } from "./tour-value.js";
5
5
  import { VideoValue } from "./video-value.js";
6
6
  import { PoiRow } from "./poi-row.js";
@@ -1,5 +1,5 @@
1
1
  import { ADDRESS_MEMBERS, isAddressMember } from "./address-value.js";
2
- import { addressPartValueType, fieldOf, isDerived, memberListOfKey, memberValueType, stampTableBounds, tableBounds, tableColumnOfKey, tableFieldsIn, tableForSlot, tableHome, tableKey, tableMemberValueType, tableNames, tableOf, tableOfSource } from "./registry-shape.js";
2
+ import { addressPartValueType, fieldOf, isDerived, memberListOfKey, memberMediaFilter, memberValueType, stampTableBounds, tableBounds, tableColumnOfKey, tableFieldsIn, tableForSlot, tableHome, tableKey, tableMemberValueType, tableNames, tableOf, tableOfSource } from "./registry-shape.js";
3
3
  import { libraryFacts, propertyFacts } from "./fact-registry.js";
4
4
  import { isRegistryFactKey, registryFactValueType } from "./fact-keys.js";
5
5
 
@@ -55,6 +55,11 @@ function isStorable(keyOrTable, path) {
55
55
  const declaration = tableField(keyOrTable, path);
56
56
  return declaration !== void 0 && !isDerived(declaration);
57
57
  }
58
+ function rowFieldMember(table, field) {
59
+ const source = field.source;
60
+ if (source?.kind !== "row" || typeof source.field !== "string") return null;
61
+ return tableRowMember(table, source.field).kind === "unknown" ? null : source.field;
62
+ }
58
63
 
59
64
  //#endregion
60
- export { isStorable, memberListOfKey, memberValueType, registryMemberNames, stampTableBounds, tableBounds, tableColumnOfKey, tableField, tableFields, tableForSlot, tableKey, tableNames, tableOf, tableRowMember };
65
+ export { isStorable, memberListOfKey, memberMediaFilter, memberValueType, registryMemberNames, rowFieldMember, stampTableBounds, tableBounds, tableColumnOfKey, tableField, tableFields, tableForSlot, tableHome, tableKey, tableNames, tableOf, tableRowMember };
@@ -1,5 +1,5 @@
1
- import { ResponsiveImage } from "./responsive-image.js";
2
1
  import { VideoSource } from "./slot-catalog.js";
2
+ import { ResponsiveImage } from "./responsive-image.js";
3
3
  //#region ../../internal/template-contracts/dist/video-value.d.ts
4
4
  /**
5
5
  * A video slot's runtime value after resolution. Has no cropping or
@@ -0,0 +1,35 @@
1
+ //#region ../../internal/upload-formats/dist/heic.js
2
+ const HEIC_REFUSAL = "We can’t read HEIC photos yet. Save it as a JPEG (on a Mac, open it in Preview and choose File > Export), then upload that.";
3
+ const HEIC_EXTENSIONS = /* @__PURE__ */ new Set([".heic", ".heif"]);
4
+ const HEIC_MIME_TYPES = /* @__PURE__ */ new Set([
5
+ "image/heic",
6
+ "image/heif",
7
+ "image/heic-sequence",
8
+ "image/heif-sequence"
9
+ ]);
10
+ const HEVC_BRANDS = /* @__PURE__ */ new Set([
11
+ "heic",
12
+ "heix",
13
+ "heim",
14
+ "heis",
15
+ "hevc",
16
+ "hevx",
17
+ "hevm",
18
+ "hevs"
19
+ ]);
20
+ function isHeicClaim(extension, mime) {
21
+ return HEIC_EXTENSIONS.has(extension) || HEIC_MIME_TYPES.has(mime);
22
+ }
23
+ function hasHevcBrand(bytes) {
24
+ if (bytes.length < 12) return false;
25
+ const ascii = (at) => String.fromCharCode(bytes[at], bytes[at + 1], bytes[at + 2], bytes[at + 3]);
26
+ if (ascii(4) !== "ftyp") return false;
27
+ if (HEVC_BRANDS.has(ascii(8))) return true;
28
+ const boxSize = (bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3]) >>> 0;
29
+ const end = Math.min(boxSize, bytes.length);
30
+ for (let at = 16; at + 4 <= end; at += 4) if (HEVC_BRANDS.has(ascii(at))) return true;
31
+ return false;
32
+ }
33
+
34
+ //#endregion
35
+ export { HEIC_REFUSAL, HEVC_BRANDS, hasHevcBrand, isHeicClaim };
@@ -0,0 +1,80 @@
1
+ import { HEIC_REFUSAL, isHeicClaim } from "./heic.js";
2
+ import { MAGIC_PREFIX_BYTES, verifyMagicBytes } from "./magic-bytes.js";
3
+
4
+ //#region ../../internal/upload-formats/dist/index.js
5
+ const MAX_UPLOAD_BYTES = 500 * 1024 * 1024;
6
+ const DOCUMENT_FORMATS = [
7
+ {
8
+ extension: ".pdf",
9
+ mimeTypes: ["application/pdf"],
10
+ family: "pdf"
11
+ },
12
+ {
13
+ extension: ".csv",
14
+ mimeTypes: ["text/csv", "application/vnd.ms-excel"],
15
+ family: "spreadsheet"
16
+ },
17
+ {
18
+ extension: ".xlsx",
19
+ mimeTypes: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
20
+ family: "spreadsheet"
21
+ },
22
+ {
23
+ extension: ".docx",
24
+ mimeTypes: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
25
+ family: "text-document"
26
+ },
27
+ {
28
+ extension: ".doc",
29
+ mimeTypes: ["application/msword"],
30
+ family: "text-document"
31
+ },
32
+ {
33
+ extension: ".txt",
34
+ mimeTypes: ["text/plain"],
35
+ family: "text-document"
36
+ },
37
+ {
38
+ extension: ".pptx",
39
+ mimeTypes: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
40
+ family: "presentation"
41
+ }
42
+ ];
43
+ const DOCUMENT_EXTENSIONS = new Set(DOCUMENT_FORMATS.map((format) => format.extension));
44
+ const DOCUMENT_MIME_TYPES = new Set(DOCUMENT_FORMATS.flatMap((format) => format.mimeTypes));
45
+ function normalizeMime(mime) {
46
+ const parameterStart = mime.indexOf(";");
47
+ return (parameterStart === -1 ? mime : mime.slice(0, parameterStart)).trim().toLowerCase();
48
+ }
49
+ function extensionOf(filename) {
50
+ const separator = Math.max(filename.lastIndexOf("/"), filename.lastIndexOf("\\"));
51
+ const basename = filename.slice(separator + 1);
52
+ const dot = basename.lastIndexOf(".");
53
+ return dot <= 0 ? "" : basename.slice(dot).toLowerCase();
54
+ }
55
+ function isImageMime(mime) {
56
+ return normalizeMime(mime).startsWith("image/");
57
+ }
58
+ function isVideoMime(mime) {
59
+ return normalizeMime(mime).startsWith("video/");
60
+ }
61
+ function isAcceptedDocument(filename, mime) {
62
+ return DOCUMENT_EXTENSIONS.has(extensionOf(filename)) && DOCUMENT_MIME_TYPES.has(normalizeMime(mime));
63
+ }
64
+ function isAcceptedUpload(filename, mime) {
65
+ if (heicRefusal(filename, mime) !== null) return false;
66
+ return isImageMime(mime) || isVideoMime(mime) || isAcceptedDocument(filename, mime);
67
+ }
68
+ function heicRefusal(filename, mime) {
69
+ return isHeicClaim(extensionOf(filename), normalizeMime(mime)) ? HEIC_REFUSAL : null;
70
+ }
71
+ const DOCUMENT_ACCEPT_ATTRIBUTE = [...DOCUMENT_MIME_TYPES, ...DOCUMENT_EXTENSIONS].join(",");
72
+ const UPLOAD_ACCEPT_ATTRIBUTE = [
73
+ "image/*",
74
+ "video/*",
75
+ DOCUMENT_ACCEPT_ATTRIBUTE
76
+ ].join(",");
77
+ const ACCEPTED_UPLOAD_SUMMARY = "an image, a video, or a document (PDF, Word, Excel .xlsx, PowerPoint .pptx, CSV, or text)";
78
+
79
+ //#endregion
80
+ export { ACCEPTED_UPLOAD_SUMMARY, DOCUMENT_ACCEPT_ATTRIBUTE, DOCUMENT_FORMATS, MAGIC_PREFIX_BYTES, MAX_UPLOAD_BYTES, extensionOf, heicRefusal, isAcceptedDocument, isAcceptedUpload, isImageMime, isVideoMime, normalizeMime, verifyMagicBytes };
@@ -0,0 +1,293 @@
1
+ import { HEIC_REFUSAL, hasHevcBrand } from "./heic.js";
2
+
3
+ //#region ../../internal/upload-formats/dist/magic-bytes.js
4
+ const MAGIC_PREFIX_BYTES = 4096;
5
+ const OOXML_MIME = /* @__PURE__ */ new Set([
6
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
7
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
8
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation"
9
+ ]);
10
+ const LEGACY_OFFICE_MIME = /* @__PURE__ */ new Set([
11
+ "application/msword",
12
+ "application/vnd.ms-excel",
13
+ "application/vnd.ms-powerpoint"
14
+ ]);
15
+ const PLAIN_TEXT_MIME = /* @__PURE__ */ new Set(["text/plain", "text/csv"]);
16
+ const CSV_MIME = /* @__PURE__ */ new Set([...PLAIN_TEXT_MIME, "application/vnd.ms-excel"]);
17
+ const isImageMime = (mime) => mime.startsWith("image/");
18
+ const isVideoMime = (mime) => mime.startsWith("video/");
19
+ function bytesAt(bytes, offset, expected) {
20
+ if (bytes.length < offset + expected.length) return false;
21
+ return expected.every((byte, i) => bytes[offset + i] === byte);
22
+ }
23
+ function asciiAt(bytes, offset, expected) {
24
+ return bytesAt(bytes, offset, Array.from(expected, (ch) => ch.charCodeAt(0)));
25
+ }
26
+ const isIsoBaseMedia = (bytes) => asciiAt(bytes, 4, "ftyp");
27
+ const QUICKTIME_BOXES = [
28
+ "moov",
29
+ "mdat",
30
+ "wide",
31
+ "free",
32
+ "skip",
33
+ "pnot"
34
+ ];
35
+ function isMpegTransportStream(bytes) {
36
+ const syncsAt = (start, stride) => bytes.length > start + stride * 2 && bytes[start] === 71 && bytes[start + stride] === 71 && bytes[start + stride * 2] === 71;
37
+ return syncsAt(0, 188) || syncsAt(4, 192);
38
+ }
39
+ const PDF_HEADER_SEARCH_BYTES = 1024;
40
+ function hasPdfHeader(bytes) {
41
+ const limit = Math.min(bytes.length, PDF_HEADER_SEARCH_BYTES);
42
+ for (let i = 0; i + 5 <= limit; i++) if (asciiAt(bytes, i, "%PDF-")) return true;
43
+ return false;
44
+ }
45
+ function looksLikeText(bytes) {
46
+ if (bytes.length === 0) return false;
47
+ return bytes.every((byte) => byte >= 32 || byte === 9 || byte === 10 || byte === 13 || byte === 12);
48
+ }
49
+ function looksLikeSvgOrXml(bytes) {
50
+ if (!looksLikeText(bytes)) return false;
51
+ const head = new TextDecoder("utf-8", { fatal: false }).decode(bytes).toLowerCase();
52
+ return head.trimStart().startsWith("<?xml") || head.includes("<svg");
53
+ }
54
+ const SIGNATURES = [
55
+ {
56
+ label: "a JPEG image",
57
+ test: (b) => bytesAt(b, 0, [
58
+ 255,
59
+ 216,
60
+ 255
61
+ ]),
62
+ satisfies: isImageMime
63
+ },
64
+ {
65
+ label: "a PNG image",
66
+ test: (b) => bytesAt(b, 0, [
67
+ 137,
68
+ 80,
69
+ 78,
70
+ 71,
71
+ 13,
72
+ 10,
73
+ 26,
74
+ 10
75
+ ]),
76
+ satisfies: isImageMime
77
+ },
78
+ {
79
+ label: "a GIF image",
80
+ test: (b) => asciiAt(b, 0, "GIF87a") || asciiAt(b, 0, "GIF89a"),
81
+ satisfies: isImageMime
82
+ },
83
+ {
84
+ label: "a WebP image",
85
+ test: (b) => asciiAt(b, 0, "RIFF") && asciiAt(b, 8, "WEBP"),
86
+ satisfies: isImageMime
87
+ },
88
+ {
89
+ label: "a BMP image",
90
+ test: (b) => asciiAt(b, 0, "BM"),
91
+ satisfies: isImageMime
92
+ },
93
+ {
94
+ label: "a TIFF image",
95
+ test: (b) => bytesAt(b, 0, [
96
+ 73,
97
+ 73,
98
+ 42,
99
+ 0
100
+ ]) || bytesAt(b, 0, [
101
+ 77,
102
+ 77,
103
+ 0,
104
+ 42
105
+ ]),
106
+ satisfies: isImageMime
107
+ },
108
+ {
109
+ label: "a Windows icon",
110
+ test: (b) => bytesAt(b, 0, [
111
+ 0,
112
+ 0,
113
+ 1,
114
+ 0
115
+ ]) || bytesAt(b, 0, [
116
+ 0,
117
+ 0,
118
+ 2,
119
+ 0
120
+ ]),
121
+ satisfies: isImageMime
122
+ },
123
+ {
124
+ label: "a JPEG 2000 image",
125
+ test: (b) => bytesAt(b, 0, [
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 12,
130
+ 106,
131
+ 80,
132
+ 32,
133
+ 32
134
+ ]) || bytesAt(b, 0, [
135
+ 255,
136
+ 79,
137
+ 255,
138
+ 81
139
+ ]),
140
+ satisfies: isImageMime
141
+ },
142
+ {
143
+ label: "a JPEG XL image",
144
+ test: (b) => bytesAt(b, 0, [255, 10]) || bytesAt(b, 0, [
145
+ 0,
146
+ 0,
147
+ 0,
148
+ 12,
149
+ 74,
150
+ 88,
151
+ 76,
152
+ 32
153
+ ]),
154
+ satisfies: isImageMime
155
+ },
156
+ {
157
+ label: "an ISO base media file (MP4, MOV or AVIF)",
158
+ test: isIsoBaseMedia,
159
+ satisfies: (mime) => isImageMime(mime) || isVideoMime(mime)
160
+ },
161
+ {
162
+ label: "a QuickTime video",
163
+ test: (b) => QUICKTIME_BOXES.some((box) => asciiAt(b, 4, box)),
164
+ satisfies: isVideoMime
165
+ },
166
+ {
167
+ label: "a Matroska or WebM video",
168
+ test: (b) => bytesAt(b, 0, [
169
+ 26,
170
+ 69,
171
+ 223,
172
+ 163
173
+ ]),
174
+ satisfies: isVideoMime
175
+ },
176
+ {
177
+ label: "an AVI video",
178
+ test: (b) => asciiAt(b, 0, "RIFF") && asciiAt(b, 8, "AVI "),
179
+ satisfies: isVideoMime
180
+ },
181
+ {
182
+ label: "an MPEG video stream",
183
+ test: (b) => bytesAt(b, 0, [
184
+ 0,
185
+ 0,
186
+ 1,
187
+ 186
188
+ ]) || bytesAt(b, 0, [
189
+ 0,
190
+ 0,
191
+ 1,
192
+ 179
193
+ ]),
194
+ satisfies: isVideoMime
195
+ },
196
+ {
197
+ label: "an MPEG transport stream",
198
+ test: isMpegTransportStream,
199
+ satisfies: isVideoMime
200
+ },
201
+ {
202
+ label: "a Flash video",
203
+ test: (b) => asciiAt(b, 0, "FLV") && b[3] === 1,
204
+ satisfies: isVideoMime
205
+ },
206
+ {
207
+ label: "an Ogg video",
208
+ test: (b) => asciiAt(b, 0, "OggS"),
209
+ satisfies: isVideoMime
210
+ },
211
+ {
212
+ label: "a Windows Media video",
213
+ test: (b) => bytesAt(b, 0, [
214
+ 48,
215
+ 38,
216
+ 178,
217
+ 117,
218
+ 142,
219
+ 102,
220
+ 207,
221
+ 17
222
+ ]),
223
+ satisfies: isVideoMime
224
+ },
225
+ {
226
+ label: "a PDF",
227
+ test: hasPdfHeader,
228
+ satisfies: (mime) => mime === "application/pdf"
229
+ },
230
+ {
231
+ label: "a ZIP archive (the container Word, Excel and PowerPoint files use)",
232
+ test: (b) => bytesAt(b, 0, [
233
+ 80,
234
+ 75,
235
+ 3,
236
+ 4
237
+ ]) || bytesAt(b, 0, [
238
+ 80,
239
+ 75,
240
+ 5,
241
+ 6
242
+ ]) || bytesAt(b, 0, [
243
+ 80,
244
+ 75,
245
+ 7,
246
+ 8
247
+ ]),
248
+ satisfies: (mime) => OOXML_MIME.has(mime)
249
+ },
250
+ {
251
+ label: "a legacy Office document",
252
+ test: (b) => bytesAt(b, 0, [
253
+ 208,
254
+ 207,
255
+ 17,
256
+ 224,
257
+ 161,
258
+ 177,
259
+ 26,
260
+ 225
261
+ ]),
262
+ satisfies: (mime) => LEGACY_OFFICE_MIME.has(mime)
263
+ },
264
+ {
265
+ label: "SVG or XML markup",
266
+ test: looksLikeSvgOrXml,
267
+ satisfies: (mime) => mime === "image/svg+xml" || PLAIN_TEXT_MIME.has(mime)
268
+ },
269
+ {
270
+ label: "plain text",
271
+ test: looksLikeText,
272
+ satisfies: (mime) => CSV_MIME.has(mime)
273
+ }
274
+ ];
275
+ function verifyMagicBytes(prefix, declaredMime) {
276
+ if (hasHevcBrand(prefix)) return {
277
+ ok: false,
278
+ detail: HEIC_REFUSAL
279
+ };
280
+ const signature = SIGNATURES.find((candidate) => candidate.test(prefix));
281
+ if (!signature) return {
282
+ ok: false,
283
+ detail: `This file's contents don't look like ${declaredMime}. It may be corrupt, empty, or saved in a format we don't accept.`
284
+ };
285
+ if (!signature.satisfies(declaredMime)) return {
286
+ ok: false,
287
+ detail: `This file was uploaded as ${declaredMime}, but its contents are ${signature.label}. Rename or re-export the file so its type matches, then try again.`
288
+ };
289
+ return { ok: true };
290
+ }
291
+
292
+ //#endregion
293
+ export { MAGIC_PREFIX_BYTES, verifyMagicBytes };
@@ -26,6 +26,7 @@ function replaceRoot(text, root, replacement, paths = nodePath) {
26
26
  function withoutRoot(text, root, paths = nodePath) {
27
27
  return replaceRoot(text, root.endsWith(paths.sep) ? root : root + paths.sep, "", paths);
28
28
  }
29
+ const recordedPath = nodePath.posix;
29
30
  function normalizePosix(path) {
30
31
  return nodePath.posix.normalize(path);
31
32
  }
@@ -12,6 +12,54 @@ function spawnNpm(args, options) {
12
12
  shell: npmNeedsShell()
13
13
  });
14
14
  }
15
+ function spawnNode(args, options) {
16
+ return spawn(process.execPath, [...args], {
17
+ ...options,
18
+ shell: false
19
+ });
20
+ }
21
+ function failureLine(output) {
22
+ const lines = output.split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("at "));
23
+ return [...lines].reverse().find((line) => /^\w*Error\b/.test(line)) ?? lines.at(-1);
24
+ }
25
+ function runNodeScript(args, { cwd, env, sink } = {}) {
26
+ return new Promise((resolve) => {
27
+ let child;
28
+ try {
29
+ child = spawnNode(args, {
30
+ ...cwd === void 0 ? {} : { cwd },
31
+ ...env === void 0 ? {} : { env: { ...env } },
32
+ stdio: [
33
+ "ignore",
34
+ "pipe",
35
+ "pipe"
36
+ ]
37
+ });
38
+ } catch (cause) {
39
+ resolve(cause instanceof Error ? cause.message : String(cause));
40
+ return;
41
+ }
42
+ let tail = "";
43
+ for (const stream of [child.stdout, child.stderr]) {
44
+ stream?.on("data", (chunk) => {
45
+ tail = (tail + chunk.toString("utf8")).slice(-2e3);
46
+ });
47
+ if (sink !== void 0) stream?.pipe(sink, { end: false });
48
+ }
49
+ child.once("error", (cause) => {
50
+ resolve(cause.message);
51
+ });
52
+ child.once("close", (code, signal) => {
53
+ if (code === 0) {
54
+ resolve(null);
55
+ return;
56
+ }
57
+ const exit = signal === null ? `exited ${String(code)}` : `was killed by ${signal}`;
58
+ const said = failureLine(tail);
59
+ resolve(said === void 0 ? exit : `${exit}: ${said}`);
60
+ });
61
+ });
62
+ }
15
63
  function killTree(child, platform = process.platform, start = spawn) {
16
64
  if (child.pid === void 0 || child.exitCode !== null) return;
17
65
  if (platform !== "win32") {
@@ -94,4 +142,4 @@ function invokedAsBin(moduleUrl, argv1 = process.argv[1]) {
94
142
  }
95
143
 
96
144
  //#endregion
97
- export { SHUTDOWN_SIGNALS, execBounded, execGit, execNpm, invokedAsBin, killTree, npmNeedsShell, onShutdown, spawnNpm };
145
+ export { SHUTDOWN_SIGNALS, execBounded, execGit, execNpm, failureLine, invokedAsBin, killTree, npmNeedsShell, onShutdown, runNodeScript, spawnNode, spawnNpm };
@@ -4,6 +4,8 @@ import { ReactNode } from "react";
4
4
  //#region src/primitives/FrameShell.d.ts
5
5
  type Props = {
6
6
  format: ImageFormat | DocumentFormat;
7
+ /** The page's declared direction; a row page stamps `data-direction="row"`, a column page nothing. */
8
+ direction?: "column" | "row";
7
9
  children: ReactNode;
8
10
  };
9
11
  /**
@@ -12,7 +14,8 @@ type Props = {
12
14
  * document a window that is exactly the format's bleed box, and the static
13
15
  * half of the contract (`.concrete-frame`, from the base stylesheet) fills
14
16
  * that window, clips at the shell's own edge, and lays sections out as a
15
- * rigid flex column (`flex-shrink: 0` on every direct child, so an
17
+ * rigid flex column, or a rigid flex row on a page declaring
18
+ * `direction: "row"` (`flex-shrink: 0` on every direct child, so an
16
19
  * overflowing stack overflows measurably instead of being silently
17
20
  * compressed). The shell sets the three geometry tokens
18
21
  * (`--frame-w`/`--frame-h`/`--frame-bleed`) — the declared geometry, for
@@ -24,6 +27,6 @@ type Props = {
24
27
  * shell draws nothing: trim and bleed guides are host chrome, never markup, so
25
28
  * rendered bytes are identical in every host.
26
29
  */
27
- declare function FrameShell({ format, children }: Props): import("react").JSX.Element;
30
+ declare function FrameShell({ format, direction, children }: Props): import("react").JSX.Element;
28
31
  //#endregion
29
32
  export { FrameShell };
@@ -2,10 +2,11 @@ import { FRAME_ROOT_CLASS, frameTokens } from "../packages/internal/format-geome
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/primitives/FrameShell.tsx
5
- function FrameShell({ format, children }) {
5
+ function FrameShell({ format, direction = "column", children }) {
6
6
  return /* @__PURE__ */ jsx("div", {
7
7
  className: FRAME_ROOT_CLASS,
8
8
  "data-format": format.id,
9
+ "data-direction": direction === "row" ? "row" : void 0,
9
10
  style: frameTokens(format),
10
11
  children
11
12
  });