@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,429 +0,0 @@
1
- import "./asset-modules.js";
2
- import { AddressValue } from "./packages/internal/template-contracts/dist/address-value.js";
3
- import { PoiRow } from "./packages/internal/template-contracts/dist/poi-row.js";
4
- import { AuthorImage } from "./packages/internal/template-contracts/dist/runtime-values.js";
5
- import { SlotValue } from "./packages/internal/template-contracts/dist/slot-value.js";
6
- import { RegistryFacts } from "./packages/internal/template-contracts/dist/registry-facts.js";
7
- import "./schema/section-props.js";
8
- import { FIXTURE } from "./fixtures/brand.js";
9
- //#region src/fixtures/index.d.ts
10
- /**
11
- * What an imported media file resolves to. A raster image import (`.jpg`, `.png`,
12
- * `.webp`, `.avif`) yields a derived {@link AuthorImage}; every other file (`.pdf`,
13
- * `.mp4`, `.svg`, …) yields its built URL. Either is a file the resolver can serve in
14
- * `dev` and hash into the artifact in `build`.
15
- */
16
- type MediaFile = AuthorImage | string;
17
- type Facts = RegistryFacts;
18
- type FactsUnit = Facts["units"][number];
19
- type FactsUnitFloorPlan = FactsUnit["floor_plans"][number];
20
- type FactsContact = Facts["contacts"][number];
21
- type FactsComparable = Facts["comparables"][number];
22
- type FactsCommercialSpace = Facts["commercial_spaces"][number];
23
- /**
24
- * An address as a property states it: its parts and its pin. `unit` (address line 2)
25
- * and `source` may be left out.
26
- */
27
- type AddressEntry = Omit<AddressValue, "unit" | "source"> & Partial<Pick<AddressValue, "unit" | "source">>;
28
- /**
29
- * The identity every upload carries — the id a content entry and a content doc name it
30
- * by — and what the platform learned of it.
31
- */
32
- interface UploadIdentity {
33
- readonly id: string;
34
- /**
35
- * What the platform learned of the upload: plain statements, one fact each, of what it
36
- * is and how it was made, what it shows, every word printed on it and how it looks,
37
- * written for a reader who cannot see it. Fills judge from it; nothing displays it.
38
- * Absent or `null`, the platform has not looked at the upload.
39
- */
40
- readonly account?: string | null;
41
- }
42
- /** What a video measures, hosted or linked. */
43
- interface VideoMeasure {
44
- readonly kind: "video";
45
- /** Its running time; `null` means unknown, never short. */
46
- readonly duration_ms: number | null;
47
- }
48
- /**
49
- * A photo of the property, its file imported. What shows the property is what the
50
- * property's `property_media` lists.
51
- */
52
- type PhotoEntry = UploadIdentity & {
53
- readonly kind: "image";
54
- readonly file: MediaFile;
55
- };
56
- /**
57
- * A floor plan, its file imported. That it is a plan is the property's `floor_plans`
58
- * listing it; which units hold it, and on which floor, is stated on each unit
59
- * (`units[].floor_plans`), never on the plan.
60
- */
61
- type FloorPlanEntry = UploadIdentity & {
62
- readonly kind: "image";
63
- readonly file: MediaFile;
64
- };
65
- /** A hosted video, its file imported. */
66
- type UploadVideoEntry = UploadIdentity & VideoMeasure & {
67
- readonly source: "upload";
68
- readonly file: MediaFile;
69
- /**
70
- * The poster frame the platform cuts from the upload, imported like any image and
71
- * served with its ladder. Absent means the video resolves with no poster.
72
- */
73
- readonly poster?: MediaFile;
74
- };
75
- /** A pasted provider link. Stays a URL, exactly as the platform stores it. */
76
- type LinkVideoEntry = UploadIdentity & VideoMeasure & {
77
- readonly source: "link";
78
- readonly url: string | null;
79
- /** The link provider that claims `url`. */
80
- readonly provider: string | null;
81
- /**
82
- * The provider thumbnail the platform's link enrichment records, served as the
83
- * video's poster. It stays a link: the fixture never hosts it. Absent means no poster.
84
- */
85
- readonly thumbnail_source_url?: string;
86
- };
87
- /** One video — a hosted upload or a pasted provider link. */
88
- type VideoEntry = UploadVideoEntry | LinkVideoEntry;
89
- /** One 3D tour link. Stays a URL, exactly as the platform stores it. */
90
- type TourEntry = UploadIdentity & {
91
- readonly kind: "tour";
92
- readonly url: string;
93
- /** The link provider that claims `url`. */
94
- readonly provider: string;
95
- /**
96
- * The provider thumbnail the platform's link enrichment records, served as the
97
- * tour's poster. It stays a link. Absent means no poster, as for a private tour.
98
- */
99
- readonly thumbnail_source_url?: string;
100
- };
101
- /**
102
- * An attachable document, its file imported — its display name and type come off the
103
- * file.
104
- */
105
- type DocumentEntry = UploadIdentity & {
106
- readonly kind: "document";
107
- readonly file: MediaFile;
108
- /**
109
- * The first page's preview the platform renders from a PDF, imported like any image
110
- * and served with its ladder — what `Slot.Image` draws over a document slot. Absent
111
- * means the document resolves with no preview.
112
- */
113
- readonly preview?: MediaFile;
114
- };
115
- /**
116
- * One upload of the property. The platform keeps every upload in one list, in the order
117
- * the user added them; its photos, floor plans, videos, tours and documents are that
118
- * list read by kind, each in this order.
119
- */
120
- type UploadEntry = PhotoEntry | FloorPlanEntry | VideoEntry | TourEntry | DocumentEntry;
121
- /**
122
- * An upload that shows the property — a photo, a video or a tour — as the property's
123
- * `property_media` lists it: an entry of its `uploads`, by value.
124
- */
125
- type MediaEntry = PhotoEntry | FloorPlanEntry | VideoEntry | TourEntry;
126
- /**
127
- * An upload that sets out the property's specifics — a document, or an image or video
128
- * made to record its figures, terms or plans — as the property's `property_documents`
129
- * lists it: an entry of its `uploads`, by value.
130
- */
131
- type InformationEntry = PhotoEntry | FloorPlanEntry | VideoEntry | DocumentEntry;
132
- /**
133
- * A floor plan a unit holds: the plan, picked by value from the property's
134
- * `floor_plans`, and the floor it draws. A unit holds a plan once, so the plan's id is
135
- * the item's.
136
- */
137
- type UnitFloorPlanEntry = Omit<FactsUnitFloorPlan, "id" | "image"> & {
138
- readonly image: FloorPlanEntry;
139
- };
140
- /** A unit's members a fixture states only when it has them: each omitted one loads as unanswered (`null`, or an empty list). */
141
- type UnitOptionalMember = "floor" | "hoa_monthly" | "parking" | "lot_sqft" | "amenities";
142
- /**
143
- * One unit: the platform's unit with its floor plans picked by value from the property's
144
- * `floor_plans`, and its photos from its `property_media`. Its floor, HOA fees, parking,
145
- * lot size, amenities and photos are stated only by a fixture that has them.
146
- */
147
- type UnitEntry = Omit<FactsUnit, "floor_plans" | "photos" | UnitOptionalMember> & Partial<Pick<FactsUnit, UnitOptionalMember>> & {
148
- readonly floor_plans: UnitFloorPlanEntry[];
149
- readonly photos?: PhotoEntry[];
150
- };
151
- /** A commercial space's members a fixture states only when it has them: each omitted one loads as unanswered (`null`, or an empty list). */
152
- type CommercialSpaceOptionalMember = "use" | "sqft" | "price" | "floor" | "parking" | "amenities";
153
- /**
154
- * One commercial space of a mixed-use building, written as a unit is: its floor plans
155
- * picked by value from the property's `floor_plans` and its photos from its
156
- * `property_media`. Every member but its `label` is stated only by a fixture that has it.
157
- */
158
- type CommercialSpaceEntry = Omit<FactsCommercialSpace, "floor_plans" | "photos" | CommercialSpaceOptionalMember> & Partial<Pick<FactsCommercialSpace, CommercialSpaceOptionalMember>> & {
159
- readonly floor_plans: UnitFloorPlanEntry[];
160
- readonly photos?: PhotoEntry[];
161
- };
162
- /** The images a contact card OWNS: each belongs to its field, in no pool. */
163
- type ContactImageField = "headshot" | "logo_dark" | "logo_light";
164
- /**
165
- * A contact card: the platform's contact with its headshot and logos imported (each, or
166
- * `null`), and its address stated as parts and a pin — `null` when the card names none.
167
- */
168
- type ContactEntry = Omit<FactsContact, ContactImageField | "address"> & { readonly [F in ContactImageField]: MediaFile | null; } & {
169
- readonly address: AddressEntry | null;
170
- };
171
- /** The members of a comparable the platform derives — its standing, its distance and its price's period. Never stated. */
172
- type DerivedComparableMember = "status" | "distance_m" | "price_period";
173
- /**
174
- * The members of a comparable's listing record — everything beyond the address, the
175
- * pin and the figures a comps table prints.
176
- */
177
- type CollectedComparableMember = "year_built" | "lot_sqft" | "stories" | "units" | "hoa_monthly" | "list_price" | "listed_date" | "mls_number" | "description";
178
- /**
179
- * A comparable property: the platform's comparable with the listing-record members
180
- * optional, its address stated as parts and its photo imported.
181
- *
182
- * The listing-record members are the part of a comp a user or a document fills only
183
- * sometimes, so a fixture that cares about an age or an asking price states it and a
184
- * fixture that does not says nothing. An omitted member loads as `null`, which is
185
- * exactly what a real bake carries for a comp whose record was never filled in. Its
186
- * `status` (sold when it has a sale date), `distance_m` (from the subject's pin) and
187
- * `price_period` (from the subject's listing intent) are derived, never stated.
188
- */
189
- type ComparableEntry = Omit<FactsComparable, DerivedComparableMember | CollectedComparableMember | "address" | "photo"> & Partial<Pick<FactsComparable, CollectedComparableMember>> & {
190
- readonly address: AddressEntry;
191
- /**
192
- * The comp's photo, which the comp OWNS: the loader mints its id and registers the
193
- * file as image media. Absent or `null` means the comp has no photo.
194
- */
195
- readonly photo?: MediaFile | null;
196
- };
197
- interface AuthoredMembers {
198
- readonly address: AddressEntry;
199
- readonly uploads: UploadEntry[];
200
- readonly property_media: MediaEntry[];
201
- readonly floor_plans: FloorPlanEntry[];
202
- readonly units: UnitEntry[];
203
- readonly commercial_spaces: CommercialSpaceEntry[];
204
- readonly contacts: ContactEntry[];
205
- readonly comparables: ComparableEntry[];
206
- }
207
- /**
208
- * A property as a user might upload it: the platform's own facts document, member for
209
- * member, with one substitution — a media value is an imported file, or an entry of the
210
- * property that carries one. What the platform derives (an address's display line, a
211
- * comparable's distance) is derived, never stated. Plain data, validated with the
212
- * platform schema when loaded; there is no builder and no derivation API, so a variation
213
- * is a second property written beside the first.
214
- *
215
- * Facts only. Unit copy, points of interest, amenities and any other fill output are
216
- * not on a property; a fixture states them in its content entries. The sorted lists
217
- * are stated as the platform has sorted the uploads: `property_media` the photos, videos and
218
- * tours that show the property, `floor_plans` its plans, and `property_documents` what
219
- * sets out its specifics (absent, it holds none) — each an entry of `uploads`, by value,
220
- * in the list's order. One upload may be in several, or in none.
221
- * Its cover photo, `hero`, is an image of its `property_media`, by value; absent or `null`, the
222
- * property has none. Its website address, `site_url`, is the full address its site publishes
223
- * at (`"https://maple-court.example.com"`); absent or `null`, the property has no website.
224
- * Its `commercial_spaces`, a mixed-use building's, are stated only by a property that has
225
- * them.
226
- */
227
- type Property = { readonly [K in Exclude<keyof Facts, "files" | "hero" | "property_documents" | "site_url" | "commercial_spaces">]: K extends keyof AuthoredMembers ? AuthoredMembers[K] : Facts[K]; } & {
228
- readonly hero?: PhotoEntry | FloorPlanEntry | null;
229
- readonly property_documents?: InformationEntry[];
230
- readonly site_url?: string | null;
231
- readonly commercial_spaces?: CommercialSpaceEntry[];
232
- };
233
- /**
234
- * What `content(Section, …)` is typed against: a section value's identity. A value
235
- * `section()` returned also carries its `schema`, which is what types the entry's
236
- * values by the section's declared slots; a bare `{ key }` (a section the program
237
- * cannot see) types them as an open record.
238
- */
239
- interface SectionRef {
240
- readonly key: string;
241
- }
242
- /** The per-instance display state a content doc carries beside a section's values. */
243
- interface ContentDisplay {
244
- /** For an optional section: whether this instance renders at all. */
245
- readonly enabled?: boolean;
246
- /** For a section with declared display variants: the case this instance renders. */
247
- readonly variant?: string;
248
- }
249
- /** The generative slots and display state one content entry states for one placed instance. */
250
- type ContentValues = ContentDisplay & {
251
- readonly [slot: string]: unknown;
252
- };
253
- /** One `content(...)` entry: a section, the values it states, and the placed instance they belong to. */
254
- interface ContentEntry<S extends SectionRef = SectionRef> {
255
- readonly section: S;
256
- readonly values: ContentValues;
257
- /** The id of the placed instance, when the template places the section more than once. */
258
- readonly instance?: string;
259
- }
260
- /** The input of {@link defineFixture}. */
261
- interface FixtureSpec {
262
- /** The property this fixture is built on. */
263
- readonly property: Property;
264
- /**
265
- * The content layer: what a fill of this property would generate, stated per
266
- * section. Absent means the sparse-fill case — every generative slot resolves to its
267
- * empty value.
268
- */
269
- readonly content?: readonly ContentEntry[];
270
- /** The human name the playground lists. Defaults to the fixture's export name. */
271
- readonly label?: string;
272
- }
273
- /**
274
- * A fixture: one property plus a content layer applied to the whole template. Branded,
275
- * so the loader can tell a fixture value from any other export of a fixture module.
276
- */
277
- type Fixture = FixtureSpec & {
278
- readonly [FIXTURE]: true;
279
- };
280
- /**
281
- * Declare a fixture. The export name is the fixture id; the loader collects every
282
- * exported fixture value from every module under the workspace's `fixtures/`
283
- * directory. Validation is the loader's: this returns the spec, branded.
284
- */
285
- declare function defineFixture(spec: FixtureSpec): Fixture;
286
- /** The section's declared slots when the value carries its schema; otherwise unknown. */
287
- type SlotsOf<S> = S extends {
288
- readonly schema: {
289
- readonly slots: infer Slots;
290
- };
291
- } ? Slots : never;
292
- /**
293
- * Whether a content entry may state a slot: a list, a row or an object always; a field
294
- * bound to the element of the item it sits in (the element a filled list's fixture
295
- * states); and any value slot no fact, member or compute sources.
296
- */
297
- type Statable<S> = S extends {
298
- type: "list" | "row" | "object";
299
- } ? true : S extends {
300
- source: {
301
- kind: "element";
302
- };
303
- } ? true : S extends {
304
- source: unknown;
305
- } ? false : true;
306
- /** The fields of an object a content entry may state, each optional. */
307
- type ContentFields<F> = { readonly [K in keyof F as Statable<F[K]> extends true ? K : never]?: ContentSlotValue<F[K]> | null; };
308
- /**
309
- * One item of a list of objects as a content entry states it: every statable field
310
- * optional, since an entry states only what an item sets and the resolver fills the rest
311
- * with each field's blank. `id` rides along because every persisted item carries one.
312
- */
313
- type ContentItem<F> = {
314
- readonly id?: string;
315
- } & ContentFields<F>;
316
- /**
317
- * One of a contact's images, stated as the card of the fixture's property plus the field:
318
- * `{ contact: listingAgent, field: "logo_dark" }`. A contact's headshot and logos are image
319
- * media like any other, but the platform holds them on the card rather than in a pool, so
320
- * they have no entry of their own to state — this names the same image the resolver
321
- * registers, and it resolves to the `{ media }` reference the platform bakes for that field. A contact the property does not carry, or a field it holds `null`, is a check
322
- * error like any other media the property lacks.
323
- */
324
- interface ContactImageEntry {
325
- readonly contact: ContactEntry;
326
- readonly field: ContactImageField;
327
- }
328
- /**
329
- * An entry a content doc may state on an `image` slot: every property entry the resolver
330
- * registers as image media — a photo, a floor plan, or one of a contact's images.
331
- */
332
- type ImageEntry = PhotoEntry | FloorPlanEntry | ContactImageEntry;
333
- /**
334
- * The value one slot takes in a content entry: a media slot takes an entry of the
335
- * fixture's property, a list of them an array, a row the identity of the row it holds, an
336
- * object its fields, a list of objects its items, a points-of-interest slot the rows a
337
- * curation would produce, and every other kind its runtime value unchanged.
338
- */
339
- type ContentSlotValue<S> = S extends {
340
- type: "image";
341
- } ? ImageEntry : S extends {
342
- type: "video";
343
- } ? VideoEntry : S extends {
344
- type: "tour";
345
- } ? TourEntry : S extends {
346
- type: "document";
347
- } ? DocumentEntry : S extends {
348
- type: "media";
349
- } ? ImageEntry | VideoEntry | TourEntry | DocumentEntry : S extends {
350
- type: "poi";
351
- } ? PoiRow : S extends {
352
- type: "row";
353
- } ? string : S extends {
354
- type: "object";
355
- fields: infer F;
356
- } ? ContentFields<F> : S extends {
357
- type: "list";
358
- element: {
359
- type: "object";
360
- fields: infer F;
361
- };
362
- } ? readonly ContentItem<F>[] : S extends {
363
- type: "list";
364
- element: {
365
- type: "row";
366
- };
367
- } ? readonly string[] : S extends {
368
- type: "list";
369
- element: infer E;
370
- } ? readonly NonNullable<ContentSlotValue<E>>[] : SlotValue<S>;
371
- /**
372
- * The slots a content entry may state: every declared slot but a value slot a fact, a
373
- * row's member or a `compute()` sources, each optional.
374
- *
375
- * @remarks
376
- * A fact-bound or computed slot resolves from the property and is never stated, so
377
- * naming one is a compile error. A list sourced by a table is the platform's own shape
378
- * rather than a loophole: the fill takes its items from the table and writes the fields
379
- * that carry no `source:` onto them in one batched call, merging both halves into each
380
- * stored item. A fixture states that half, item by item in the table's own order, and
381
- * the resolver merges it onto the table's rows by position.
382
- */
383
- type ContentSlots<Slots> = { readonly [K in keyof Slots as Statable<Slots[K]> extends true ? K : never]?: ContentSlotValue<Slots[K]> | null; };
384
- type VariantOf<S> = S extends {
385
- readonly schema: {
386
- readonly meta: infer Meta;
387
- };
388
- } ? Meta extends {
389
- readonly display: {
390
- readonly variant: {
391
- readonly cases: readonly (infer C extends string)[];
392
- };
393
- };
394
- } ? C : never : string;
395
- /** What one entry may state for `S`: its content slots plus the per-instance display state. */
396
- type ContentValuesOf<S> = [SlotsOf<S>] extends [never] ? ContentValues : ContentSlots<SlotsOf<S>> & {
397
- readonly enabled?: boolean;
398
- readonly variant?: VariantOf<S>;
399
- };
400
- type ExactObject<E, R> = E extends object ? unknown extends R ? E : R extends object ? E & { [K in Exclude<keyof E, keyof R>]: never; } : E : E;
401
- type ExactValue<V, A> = unknown extends A ? V : NonNullable<A> extends readonly (infer R)[] ? V extends readonly (infer E)[] ? readonly ExactObject<E, R>[] : V : ExactObject<V, NonNullable<A>>;
402
- /**
403
- * A values map `M` checked exactly against `Allowed`: each shared key by its declared
404
- * value type and by its object's declared keys, and every key `Allowed` does not
405
- * declare typed `never` — so an unknown or source-bound slot key is a compile error.
406
- * A plain `values: Allowed` parameter would catch those keys only on a fresh object
407
- * literal; capturing the map's own type as `M` puts the check on the type. `M` must be
408
- * inferred UNCONSTRAINED for that, which is why the naked `M &` member leads.
409
- */
410
- type ExactContent<M, Allowed> = M & Allowed & { [K in Exclude<keyof M, keyof Allowed>]: never; } & { [K in Extract<keyof M, keyof Allowed>]: ExactValue<M[K], Allowed[K]>; };
411
- /**
412
- * State the content a fill would generate for one placed instance of a section: its
413
- * generative slots and its display state, typed by the section value. A fact-bound or
414
- * computed slot is never stated here — derived information is taken from the property —
415
- * with one exception in the platform's own image: a list sourced by a table takes the
416
- * fields of each item a fill writes, stated item by item in the property's own order,
417
- * while the fields its row binds stay the property's. A row states the identity of the
418
- * row it holds — the user's re-pick.
419
- * Media is stated by value, as an entry of the fixture's property (`hero_image:
420
- * deckShot`), of the slot's own kind; an entry the property does not carry is a check
421
- * error. A contact's image, which has no entry, is stated as the card plus the field
422
- * ({@link ContactImageEntry}). A second placed instance names itself with `instance`,
423
- * the same id the placement wrote.
424
- */
425
- declare function content<S extends SectionRef, M extends object>(section: S, values: ExactContent<M, ContentValuesOf<S>>, options?: {
426
- readonly instance?: string;
427
- }): ContentEntry<S>;
428
- //#endregion
429
- export { AddressEntry, CommercialSpaceEntry, ComparableEntry, ContactEntry, ContactImageEntry, ContactImageField, ContentDisplay, ContentEntry, ContentFields, ContentItem, ContentSlotValue, ContentSlots, ContentValues, ContentValuesOf, DocumentEntry, ExactContent, Fixture, FixtureSpec, FloorPlanEntry, ImageEntry, InformationEntry, LinkVideoEntry, MediaEntry, MediaFile, PhotoEntry, Property, SectionRef, TourEntry, UnitEntry, UnitFloorPlanEntry, UploadEntry, UploadVideoEntry, VideoEntry, content, defineFixture };
package/dist/fixtures.js DELETED
@@ -1,23 +0,0 @@
1
- import { FIXTURE } from "./fixtures/brand.js";
2
-
3
- //#region src/fixtures/index.ts
4
- function defineFixture(spec) {
5
- return {
6
- ...spec,
7
- [FIXTURE]: true
8
- };
9
- }
10
- function content(section, values, options = {}) {
11
- const stated = values;
12
- return options.instance === void 0 ? {
13
- section,
14
- values: stated
15
- } : {
16
- section,
17
- values: stated,
18
- instance: options.instance
19
- };
20
- }
21
-
22
- //#endregion
23
- export { content, defineFixture };
@@ -1,62 +0,0 @@
1
- import { hydrateIslands, unmountIslands } from "../../island-runtime/dist/index.js";
2
- import { installIslandShields, removeIslandShields } from "./island-shields.js";
3
- import { createElement, useLayoutEffect } from "react";
4
-
5
- //#region ../../internal/canvas-core/dist/island-host.js
6
- function withCommitSignal(component, signalCommit) {
7
- return function IslandCommitSignal(props) {
8
- useLayoutEffect(signalCommit, []);
9
- return createElement(component, props);
10
- };
11
- }
12
- function createCanvasIslandHost(options) {
13
- const { importModule, markers, label } = options;
14
- const commitOf = /* @__PURE__ */ new WeakMap();
15
- async function load(islandKey) {
16
- const url = window.__TR_ISLAND_MAP?.[islandKey];
17
- if (!url) throw new Error(`${label}: no island module for "${islandKey}"`);
18
- const islandModule = await importModule(url);
19
- let signalCommit;
20
- const committed = new Promise((resolve) => {
21
- signalCommit = resolve;
22
- });
23
- const editor = islandModule.editor ? { ...islandModule.editor } : void 0;
24
- if (editor) commitOf.set(editor, {
25
- committed,
26
- signalCommit
27
- });
28
- return {
29
- ...islandModule,
30
- editor,
31
- default: withCommitSignal(islandModule.default, signalCommit)
32
- };
33
- }
34
- function shieldHandle(islandHandle) {
35
- if (islandHandle.editor?.live !== true) return;
36
- installIslandShields(islandHandle.element, markers);
37
- }
38
- return {
39
- hydrate: async (root) => {
40
- const handles = await hydrateIslands({
41
- root,
42
- load,
43
- schedule: "eager",
44
- shouldHydrate: (ctx) => ctx.editor?.live === true,
45
- onError: (error, ctx) => {
46
- console.error(`${label}: canvas island failed to hydrate:`, ctx.key, error);
47
- if (ctx.editor) commitOf.get(ctx.editor)?.signalCommit();
48
- }
49
- });
50
- await Promise.all(handles.map((islandHandle) => islandHandle.editor ? commitOf.get(islandHandle.editor)?.committed : void 0).filter((committed) => committed !== void 0));
51
- for (const islandHandle of handles) shieldHandle(islandHandle);
52
- return handles;
53
- },
54
- unmount: (root) => {
55
- unmountIslands(root);
56
- removeIslandShields(root);
57
- }
58
- };
59
- }
60
-
61
- //#endregion
62
- export { createCanvasIslandHost };
@@ -1,30 +0,0 @@
1
- //#region ../../internal/canvas-core/dist/island-shields.js
2
- const ISLAND_SHIELD_CLASS = "we-enh-shield";
3
- const ISLAND_SHIELD_ITEM_CLASS = "we-enh-shield--item";
4
- function makeShield(doc, itemShield) {
5
- const shield = doc.createElement("div");
6
- shield.className = itemShield ? `${ISLAND_SHIELD_CLASS} ${ISLAND_SHIELD_ITEM_CLASS}` : ISLAND_SHIELD_CLASS;
7
- shield.setAttribute("aria-hidden", "true");
8
- return shield;
9
- }
10
- function installShield(surface, itemShield) {
11
- const doc = surface.ownerDocument;
12
- const pos = doc.defaultView?.getComputedStyle(surface).position ?? "";
13
- if (!pos || pos === "static") surface.style.position = "relative";
14
- if (Array.from(surface.children).some((c) => c.classList.contains("we-enh-shield"))) return;
15
- surface.appendChild(makeShield(doc, itemShield));
16
- }
17
- function islandShieldBaseEls(root) {
18
- if (root.ownerDocument.defaultView?.getComputedStyle(root).display !== "contents") return [root];
19
- return Array.from(root.children).filter((c) => c instanceof HTMLElement);
20
- }
21
- function installIslandShields(root, markers) {
22
- for (const itemEl of Array.from(root.querySelectorAll(`[${markers.slotItem}]`))) installShield(itemEl, true);
23
- for (const baseEl of islandShieldBaseEls(root)) installShield(baseEl, false);
24
- }
25
- function removeIslandShields(scope) {
26
- scope.querySelectorAll(`.${ISLAND_SHIELD_CLASS}`).forEach((shield) => shield.remove());
27
- }
28
-
29
- //#endregion
30
- export { ISLAND_SHIELD_CLASS, ISLAND_SHIELD_ITEM_CLASS, installIslandShields, islandShieldBaseEls, removeIslandShields };
@@ -1,11 +0,0 @@
1
- import { IslandModule } from "../packages/internal/island-runtime/dist/contract.js";
2
- import "../packages/internal/island-runtime/dist/index.js";
3
- //#region src/playground/canvas-island-host.d.ts
4
- /**
5
- * Publish the canvas island host on `window.__trCanvasIslands` and hydrate what the
6
- * frame already holds. `importModule` fetches the module at a URL the frame's island
7
- * map names; `label` prefixes the host's console lines.
8
- */
9
- declare function installCanvasIslandHost(importModule: (url: string) => Promise<IslandModule>, label: string): void;
10
- //#endregion
11
- export { installCanvasIslandHost };
@@ -1,29 +0,0 @@
1
- import { createCanvasIslandHost } from "../packages/internal/canvas-core/dist/island-host.js";
2
- import { CANVAS_MARKERS } from "./canvas-markers.js";
3
-
4
- //#region src/playground/canvas-island-host.ts
5
- function realComponent(islandModule) {
6
- return islandModule.__trIslandReal ?? islandModule.default;
7
- }
8
- function installCanvasIslandHost(importModule, label) {
9
- const host = createCanvasIslandHost({
10
- importModule: async (url) => {
11
- const islandModule = await importModule(url);
12
- return {
13
- ...islandModule,
14
- default: realComponent(islandModule)
15
- };
16
- },
17
- markers: CANVAS_MARKERS,
18
- label
19
- });
20
- const driver = {
21
- hydrateRoot: host.hydrate,
22
- unmountRoot: host.unmount
23
- };
24
- window.__trCanvasIslands = driver;
25
- driver.hydrateRoot(document.body);
26
- }
27
-
28
- //#endregion
29
- export { installCanvasIslandHost };
@@ -1,14 +0,0 @@
1
- import { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_UNSELECTABLE } from "../packages/internal/template-contracts/dist/markers.js";
2
-
3
- //#region src/playground/canvas-markers.ts
4
- const CANVAS_MARKERS = {
5
- sectionInstanceId: ATTR_SECTION_INSTANCE_ID,
6
- slotId: ATTR_SLOT_ID,
7
- slotGroup: ATTR_SLOT_GROUP,
8
- slotItem: ATTR_SLOT_ITEM,
9
- slotField: ATTR_SLOT_FIELD,
10
- slotUnselectable: ATTR_SLOT_UNSELECTABLE
11
- };
12
-
13
- //#endregion
14
- export { CANVAS_MARKERS };
@@ -1,8 +0,0 @@
1
- //#region src/playground/host/paths.ts
2
- const STYLESHEET_PATHS = {
3
- base: "stylesheets/base.css",
4
- template: "stylesheets/template.css"
5
- };
6
-
7
- //#endregion
8
- export { STYLESHEET_PATHS };
@@ -1,17 +0,0 @@
1
- import { PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES } from "../packages/internal/template-artifact/dist/layout.js";
2
- import "../packages/internal/template-artifact/dist/index.js";
3
- import { resolve } from "node:path";
4
-
5
- //#region src/playground/layout.ts
6
- function playgroundDistDir(packageRoot) {
7
- return resolve(packageRoot, "dist", "artifact", PLAYGROUND_DIR);
8
- }
9
- function playgroundClientOutDir(packageRoot) {
10
- return resolve(playgroundDistDir(packageRoot), PLAYGROUND_CLIENT_DIR);
11
- }
12
- function playgroundHostFile(packageRoot) {
13
- return resolve(playgroundDistDir(packageRoot), PLAYGROUND_FILES.host);
14
- }
15
-
16
- //#endregion
17
- export { playgroundClientOutDir, playgroundDistDir, playgroundHostFile };
@@ -1,28 +0,0 @@
1
- //#region src/playground/wire.ts
2
- function query(params) {
3
- const search = new URLSearchParams();
4
- for (const [key, value] of Object.entries(params)) if (value !== null && value !== void 0 && value !== "") search.set(key, value);
5
- const text = search.toString();
6
- return text === "" ? "" : `?${text}`;
7
- }
8
- const ROUTES = {
9
- catalog: "api/catalog",
10
- render: "api/render",
11
- media: (fixture) => `api/media${query({ fixture })}`,
12
- capture: (kind, target) => `api/capture/${kind}${query({
13
- fixture: target.fixture,
14
- format: target.format,
15
- page: target.page,
16
- canvas: target.canvas
17
- })}`,
18
- live: (fixture, pagePath) => `fixtures/${encodeURIComponent(fixture)}/live${pagePath === "/" ? "/" : `${pagePath}/`}`,
19
- hmr: "__hmr"
20
- };
21
- const HMR_EVENTS = {
22
- source: "source:changed",
23
- stylesheet: "stylesheet:changed",
24
- fixtures: "fixtures:changed"
25
- };
26
-
27
- //#endregion
28
- export { HMR_EVENTS, ROUTES };