@homepages/concrete 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +174 -0
  3. package/codemods/manifest.json +9 -0
  4. package/dist/artifact/playground/client/assets/index-BSA1yutg.css +1 -0
  5. package/dist/artifact/playground/client/assets/index-JloQyj8h.js +1101 -0
  6. package/dist/artifact/playground/client/index.html +13 -0
  7. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -0
  8. package/dist/artifact/playground/host.mjs +127 -0
  9. package/dist/asset-modules.d.ts +99 -0
  10. package/dist/base.css +220 -0
  11. package/dist/browser/site-config.d.ts +18 -0
  12. package/dist/browser/site-config.js +56 -0
  13. package/dist/browser/submit-lead.d.ts +98 -0
  14. package/dist/browser/submit-lead.js +188 -0
  15. package/dist/browser.d.ts +3 -0
  16. package/dist/browser.js +4 -0
  17. package/dist/cli/build/artifact.js +225 -0
  18. package/dist/cli/build/captures.js +67 -0
  19. package/dist/cli/build/esbuild.js +127 -0
  20. package/dist/cli/build/fixtures.js +96 -0
  21. package/dist/cli/build/icons.js +76 -0
  22. package/dist/cli/build/index.js +38 -0
  23. package/dist/cli/build/playground.js +31 -0
  24. package/dist/cli/build/sections.js +236 -0
  25. package/dist/cli/build/source.js +62 -0
  26. package/dist/cli/build/static.js +156 -0
  27. package/dist/cli/capture/bundle.js +37 -0
  28. package/dist/cli/capture/capture-browser.js +51 -0
  29. package/dist/cli/capture/capture.js +121 -0
  30. package/dist/cli/check/analyze.js +95 -0
  31. package/dist/cli/check/index.js +19 -0
  32. package/dist/cli/check/load-workspace.js +119 -0
  33. package/dist/cli/check/messages.js +16 -0
  34. package/dist/cli/check/render/class-conflicts.js +39 -0
  35. package/dist/cli/check/render/html.js +86 -0
  36. package/dist/cli/check/render/inputs.js +53 -0
  37. package/dist/cli/check/render/invariants.js +58 -0
  38. package/dist/cli/check/render/island-frames.js +72 -0
  39. package/dist/cli/check/render/marker-coverage.js +102 -0
  40. package/dist/cli/check/render/nav.js +64 -0
  41. package/dist/cli/check/report.js +73 -0
  42. package/dist/cli/check/stages/bundles.js +129 -0
  43. package/dist/cli/check/stages/composition.js +67 -0
  44. package/dist/cli/check/stages/contracts.js +22 -0
  45. package/dist/cli/check/stages/dependencies.js +261 -0
  46. package/dist/cli/check/stages/fixtures.js +74 -0
  47. package/dist/cli/check/stages/lint.js +41 -0
  48. package/dist/cli/check/stages/logic.js +63 -0
  49. package/dist/cli/check/stages/render.js +144 -0
  50. package/dist/cli/check/stages/sections.js +83 -0
  51. package/dist/cli/check/stages/stylesheet.js +31 -0
  52. package/dist/cli/check/stages/typecheck.js +68 -0
  53. package/dist/cli/check/stages/workspace.js +26 -0
  54. package/dist/cli/commands.js +342 -0
  55. package/dist/cli/currency/cache.js +89 -0
  56. package/dist/cli/currency/decide.js +65 -0
  57. package/dist/cli/currency/opt-out.js +16 -0
  58. package/dist/cli/currency/preamble.js +183 -0
  59. package/dist/cli/currency/prompt.js +28 -0
  60. package/dist/cli/currency/refresh.js +44 -0
  61. package/dist/cli/currency/resolve-latest.js +185 -0
  62. package/dist/cli/currency/version-order.js +38 -0
  63. package/dist/cli/dev/crop.js +22 -0
  64. package/dist/cli/dev/hmr.js +26 -0
  65. package/dist/cli/dev/http.js +129 -0
  66. package/dist/cli/dev/index.js +70 -0
  67. package/dist/cli/dev/islands.js +390 -0
  68. package/dist/cli/dev/load-template.js +46 -0
  69. package/dist/cli/dev/request-error.js +22 -0
  70. package/dist/cli/dev/server.js +307 -0
  71. package/dist/cli/dev/tsconfig-paths.js +95 -0
  72. package/dist/cli/dev/vite.js +85 -0
  73. package/dist/cli/dev/workspace-reader.js +274 -0
  74. package/dist/cli/io.d.ts +14 -0
  75. package/dist/cli/media/cache.js +125 -0
  76. package/dist/cli/media/derive.js +252 -0
  77. package/dist/cli/media/deriver-plugin.js +71 -0
  78. package/dist/cli/property/index.js +180 -0
  79. package/dist/cli/property/library.js +137 -0
  80. package/dist/cli/publish/client.js +119 -0
  81. package/dist/cli/publish/freshness.js +66 -0
  82. package/dist/cli/publish/git.js +43 -0
  83. package/dist/cli/publish/index.js +207 -0
  84. package/dist/cli/publish/pack.js +78 -0
  85. package/dist/cli/publish/report.js +98 -0
  86. package/dist/cli/publish/target.js +87 -0
  87. package/dist/cli/publish/wire.js +29 -0
  88. package/dist/cli/tar.js +87 -0
  89. package/dist/cli/upgrade/codemod.js +56 -0
  90. package/dist/cli/upgrade/index.js +263 -0
  91. package/dist/cli/upgrade/manifest.js +72 -0
  92. package/dist/cli/upgrade/plan.js +68 -0
  93. package/dist/cli/upgrade/stage.js +71 -0
  94. package/dist/cli/version.d.ts +12 -0
  95. package/dist/cli/version.js +15 -0
  96. package/dist/cli/workspace.js +108 -0
  97. package/dist/cli.d.ts +6 -0
  98. package/dist/cli.js +94 -0
  99. package/dist/css/compile.js +77 -0
  100. package/dist/css/graph.js +109 -0
  101. package/dist/css/inline.js +132 -0
  102. package/dist/css/rules.js +65 -0
  103. package/dist/design-system/format-variants.js +127 -0
  104. package/dist/eslint/authoring.js +46 -0
  105. package/dist/eslint/correctness.js +42 -0
  106. package/dist/eslint/rules/editor-declaration.js +103 -0
  107. package/dist/eslint/rules/editor-reason.js +135 -0
  108. package/dist/eslint/rules/island-imports.js +20 -0
  109. package/dist/eslint/rules/jsx-visitor.js +20 -0
  110. package/dist/eslint/rules/no-client-runtime.js +88 -0
  111. package/dist/eslint/rules/no-editor-globals.js +60 -0
  112. package/dist/eslint/rules/no-hard-coded-color.js +183 -0
  113. package/dist/eslint/rules/no-inline-style.js +24 -0
  114. package/dist/eslint/rules/no-marker-literal.js +37 -0
  115. package/dist/eslint/rules/no-nondeterminism.js +44 -0
  116. package/dist/eslint/rules/no-px-breakpoint.js +44 -0
  117. package/dist/eslint/rules/no-raw-values.js +45 -0
  118. package/dist/eslint/rules/serializable-props.js +95 -0
  119. package/dist/eslint.d.ts +6 -0
  120. package/dist/eslint.js +26 -0
  121. package/dist/fixtures/brand.d.ts +4 -0
  122. package/dist/fixtures/brand.js +9 -0
  123. package/dist/fixtures/bundle-rule.js +67 -0
  124. package/dist/fixtures/canonical.d.ts +149 -0
  125. package/dist/fixtures/image-dimensions.js +59 -0
  126. package/dist/fixtures/load.js +154 -0
  127. package/dist/fixtures/media-plugin.js +141 -0
  128. package/dist/fixtures/media.js +165 -0
  129. package/dist/fixtures/property.js +210 -0
  130. package/dist/fixtures/resolve.js +202 -0
  131. package/dist/fixtures/rows.js +108 -0
  132. package/dist/fixtures/synthesize-empties.js +42 -0
  133. package/dist/fixtures.d.ts +213 -0
  134. package/dist/fixtures.js +37 -0
  135. package/dist/index.d.ts +53 -0
  136. package/dist/index.js +37 -0
  137. package/dist/islands/client-module.js +97 -0
  138. package/dist/islands/marker.d.ts +43 -0
  139. package/dist/islands/marker.js +44 -0
  140. package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +687 -0
  141. package/dist/packages/external/concrete/package.js +5 -0
  142. package/dist/packages/internal/fact-interpolation/dist/index.js +22 -0
  143. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +111 -0
  144. package/dist/packages/internal/fill-bake/dist/display.js +9 -0
  145. package/dist/packages/internal/fill-bake/dist/index.js +6 -0
  146. package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +170 -0
  147. package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +32 -0
  148. package/dist/packages/internal/fill-vocabulary/dist/facts.js +131 -0
  149. package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +73 -0
  150. package/dist/packages/internal/format-geometry/dist/capture.js +404 -0
  151. package/dist/packages/internal/format-geometry/dist/format.d.ts +41 -0
  152. package/dist/packages/internal/format-geometry/dist/geometry.js +58 -0
  153. package/dist/packages/internal/format-geometry/dist/index.js +4 -0
  154. package/dist/packages/internal/image-descriptor/dist/index.d.ts +35 -0
  155. package/dist/packages/internal/image-ladder/dist/crop.js +82 -0
  156. package/dist/packages/internal/image-ladder/dist/encode.js +23 -0
  157. package/dist/packages/internal/image-ladder/dist/index.js +4 -0
  158. package/dist/packages/internal/image-ladder/dist/policy.js +102 -0
  159. package/dist/packages/internal/island-runtime/dist/capture-holds.d.ts +13 -0
  160. package/dist/packages/internal/island-runtime/dist/capture-holds.js +45 -0
  161. package/dist/packages/internal/island-runtime/dist/contract.d.ts +176 -0
  162. package/dist/packages/internal/island-runtime/dist/contract.js +94 -0
  163. package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +15 -0
  164. package/dist/packages/internal/island-runtime/dist/index.d.ts +103 -0
  165. package/dist/packages/internal/island-runtime/dist/index.js +163 -0
  166. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +19 -0
  167. package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +39 -0
  168. package/dist/packages/internal/island-runtime/dist/use-editor.d.ts +22 -0
  169. package/dist/packages/internal/island-runtime/dist/use-editor.js +54 -0
  170. package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +105 -0
  171. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +25 -0
  172. package/dist/packages/internal/property-facts/dist/index.js +3 -0
  173. package/dist/packages/internal/property-facts/dist/property-facts-CSdkSuD7.js +181 -0
  174. package/dist/packages/internal/section-contracts/dist/cap-contract.js +59 -0
  175. package/dist/packages/internal/section-contracts/dist/catalog.js +102 -0
  176. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +24 -0
  177. package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +48 -0
  178. package/dist/packages/internal/section-contracts/dist/display-contract.js +30 -0
  179. package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +17 -0
  180. package/dist/packages/internal/section-contracts/dist/group-contract.js +21 -0
  181. package/dist/packages/internal/section-contracts/dist/index.js +26 -0
  182. package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +48 -0
  183. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +53 -0
  184. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +70 -0
  185. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +27 -0
  186. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +12 -0
  187. package/dist/packages/internal/section-contracts/dist/option-source-contract.js +22 -0
  188. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +18 -0
  189. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +30 -0
  190. package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +24 -0
  191. package/dist/packages/internal/section-contracts/dist/row-contract.js +37 -0
  192. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +38 -0
  193. package/dist/packages/internal/section-contracts/dist/runners.js +181 -0
  194. package/dist/packages/internal/section-contracts/dist/select-contract.js +28 -0
  195. package/dist/packages/internal/section-contracts/dist/source-contract.js +48 -0
  196. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +15 -0
  197. package/dist/packages/internal/section-contracts/dist/sources-contract.js +28 -0
  198. package/dist/packages/internal/section-contracts/dist/url-contract.js +20 -0
  199. package/dist/packages/internal/source-resolution/dist/index.js +222 -0
  200. package/dist/packages/internal/template-artifact/dist/hash.js +50 -0
  201. package/dist/packages/internal/template-artifact/dist/index.js +7 -0
  202. package/dist/packages/internal/template-artifact/dist/layout.js +165 -0
  203. package/dist/packages/internal/template-artifact/dist/manifest.js +73 -0
  204. package/dist/packages/internal/template-artifact/dist/sha256.js +138 -0
  205. package/dist/packages/internal/template-artifact/dist/verify.js +275 -0
  206. package/dist/packages/internal/template-contracts/dist/collection-editing.js +38 -0
  207. package/dist/packages/internal/template-contracts/dist/content-categories.d.ts +10 -0
  208. package/dist/packages/internal/template-contracts/dist/content-categories.js +17 -0
  209. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +33 -0
  210. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +81 -0
  211. package/dist/packages/internal/template-contracts/dist/facts-view.js +136 -0
  212. package/dist/packages/internal/template-contracts/dist/layout.js +17 -0
  213. package/dist/packages/internal/template-contracts/dist/markers.d.ts +40 -0
  214. package/dist/packages/internal/template-contracts/dist/markers.js +41 -0
  215. package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +63 -0
  216. package/dist/packages/internal/template-contracts/dist/select-key.js +13 -0
  217. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1112 -0
  218. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +1109 -0
  219. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +11 -0
  220. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +45 -0
  221. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +63 -0
  222. package/dist/playground/host/page-state.js +12 -0
  223. package/dist/playground/host/paths.js +9 -0
  224. package/dist/playground/layout.js +24 -0
  225. package/dist/playground/wire.js +36 -0
  226. package/dist/playground-island-runtime.d.ts +3 -0
  227. package/dist/playground-island-runtime.js +4 -0
  228. package/dist/primitives/FrameShell.d.ts +29 -0
  229. package/dist/primitives/FrameShell.js +34 -0
  230. package/dist/primitives/Image.d.ts +119 -0
  231. package/dist/primitives/Image.js +173 -0
  232. package/dist/primitives/Section.d.ts +22 -0
  233. package/dist/primitives/Section.js +26 -0
  234. package/dist/primitives/Tour.d.ts +43 -0
  235. package/dist/primitives/Tour.js +72 -0
  236. package/dist/primitives/Video.d.ts +57 -0
  237. package/dist/primitives/Video.js +116 -0
  238. package/dist/primitives/embed-playback.js +50 -0
  239. package/dist/primitives/index.d.ts +11 -0
  240. package/dist/primitives/marker-attrs.js +44 -0
  241. package/dist/primitives/object-fit.js +11 -0
  242. package/dist/primitives/picture-sources.d.ts +24 -0
  243. package/dist/primitives/picture-sources.js +52 -0
  244. package/dist/primitives/probe-context.js +24 -0
  245. package/dist/primitives/slot-bindings.d.ts +96 -0
  246. package/dist/primitives/slot-bindings.js +226 -0
  247. package/dist/primitives/slot-document.d.ts +35 -0
  248. package/dist/primitives/slot-document.js +37 -0
  249. package/dist/primitives/slot-group.d.ts +40 -0
  250. package/dist/primitives/slot-group.js +45 -0
  251. package/dist/primitives/slot-list.d.ts +21 -0
  252. package/dist/primitives/slot-list.js +23 -0
  253. package/dist/primitives/slot-media.d.ts +71 -0
  254. package/dist/primitives/slot-media.js +98 -0
  255. package/dist/primitives/slot-scalar.d.ts +53 -0
  256. package/dist/primitives/slot-scalar.js +98 -0
  257. package/dist/primitives/slot.d.ts +26 -0
  258. package/dist/primitives/slot.js +28 -0
  259. package/dist/rules/registry.js +479 -0
  260. package/dist/schema/compute.d.ts +22 -0
  261. package/dist/schema/compute.js +30 -0
  262. package/dist/schema/define-schema.d.ts +27 -0
  263. package/dist/schema/define-schema.js +73 -0
  264. package/dist/schema/extract-fill-spec.js +246 -0
  265. package/dist/schema/extract-used-facts.js +176 -0
  266. package/dist/schema/fact.d.ts +65 -0
  267. package/dist/schema/fact.js +33 -0
  268. package/dist/schema/fill-builders.d.ts +387 -0
  269. package/dist/schema/fill-builders.js +263 -0
  270. package/dist/schema/fill-declaration.d.ts +76 -0
  271. package/dist/schema/fill-declaration.js +43 -0
  272. package/dist/schema/fill-spec.d.ts +18 -0
  273. package/dist/schema/fill-spec.js +170 -0
  274. package/dist/schema/format-presets.d.ts +27 -0
  275. package/dist/schema/format-presets.js +76 -0
  276. package/dist/schema/format.d.ts +22 -0
  277. package/dist/schema/format.js +40 -0
  278. package/dist/schema/formats.d.ts +6 -0
  279. package/dist/schema/formats.js +7 -0
  280. package/dist/schema/layout.d.ts +32 -0
  281. package/dist/schema/layout.js +30 -0
  282. package/dist/schema/manifest.js +300 -0
  283. package/dist/schema/property-facts.d.ts +83 -0
  284. package/dist/schema/runtime-values.d.ts +88 -0
  285. package/dist/schema/section-nav.d.ts +38 -0
  286. package/dist/schema/section-nav.js +29 -0
  287. package/dist/schema/section-props.d.ts +98 -0
  288. package/dist/schema/section-schema.d.ts +53 -0
  289. package/dist/schema/section-schema.js +54 -0
  290. package/dist/schema/slot-builders.d.ts +497 -0
  291. package/dist/schema/slot-builders.js +331 -0
  292. package/dist/schema/slot-types.d.ts +110 -0
  293. package/dist/schema/slot-types.js +187 -0
  294. package/dist/section/declare.d.ts +44 -0
  295. package/dist/section/declare.js +27 -0
  296. package/dist/section/discovery.js +76 -0
  297. package/dist/section/groups.js +74 -0
  298. package/dist/section/materialize.js +28 -0
  299. package/dist/section/placements.js +28 -0
  300. package/dist/section/section.d.ts +69 -0
  301. package/dist/section/section.js +101 -0
  302. package/dist/site-analytics.d.ts +1 -0
  303. package/dist/site-analytics.js +15 -0
  304. package/dist/site-runtime/analytics.js +97 -0
  305. package/dist/site-runtime/site-integrations.js +97 -0
  306. package/dist/styles.css +60 -0
  307. package/dist/template/define-template.d.ts +139 -0
  308. package/dist/template/define-template.js +98 -0
  309. package/dist/template/logic-build.js +191 -0
  310. package/dist/template/logic-shim.d.ts +43 -0
  311. package/dist/template/logic-shim.js +52 -0
  312. package/dist/template/logic-transform.js +92 -0
  313. package/dist/template/materialize.js +107 -0
  314. package/dist/template/reconcile.d.ts +67 -0
  315. package/dist/template/reconcile.js +25 -0
  316. package/dist/template/running-copy.js +58 -0
  317. package/guide/reference/cli/INDEX.md +79 -0
  318. package/guide/reference/cli/build.md +48 -0
  319. package/guide/reference/cli/check.md +49 -0
  320. package/guide/reference/cli/dev.md +46 -0
  321. package/guide/reference/cli/property-add.md +53 -0
  322. package/guide/reference/cli/property-list.md +46 -0
  323. package/guide/reference/cli/publish.md +54 -0
  324. package/guide/reference/cli/upgrade.md +48 -0
  325. package/guide/reference/rules/INDEX.md +190 -0
  326. package/package.json +137 -0
  327. package/tsconfig.base.json +16 -0
@@ -0,0 +1,98 @@
1
+ import { useSlotProbe } from "./probe-context.js";
2
+ import { ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE } from "../packages/internal/template-contracts/dist/markers.js";
3
+ import { identityMarkerAttrs } from "./marker-attrs.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/primitives/slot-scalar.tsx
7
+ /** `value == null` catches null AND undefined; `""` is the empty-string blank. `0`/`false`
8
+ * are NOT blank (a number slot legitimately holds 0). */
9
+ function isBlank(value) {
10
+ return value == null || value === "";
11
+ }
12
+ /** Split a multiline string into text nodes separated by `<br>`. The editor learns `<br>`
13
+ * (host side), so a multiline value keeps its text leaf and types live. */
14
+ function renderMultiline(text) {
15
+ return text.split("\n").flatMap((line, i) => i === 0 ? [line] : [/* @__PURE__ */ jsx("br", {}, i), line]);
16
+ }
17
+ function markerAttrs(binding, leaf, selectable) {
18
+ return {
19
+ ...identityMarkerAttrs(binding),
20
+ ...leaf ? { [ATTR_SLOT_TEXT_LEAF]: "" } : {},
21
+ ...selectable ? {} : { [ATTR_SLOT_UNSELECTABLE]: "" }
22
+ };
23
+ }
24
+ function Textish(props) {
25
+ const { slot, as, format, children, multiline, selectable = true, leafEligible, coerce, ...rest } = props;
26
+ useSlotProbe(slot);
27
+ const Tag = as;
28
+ const value = slot.value;
29
+ const leaf = leafEligible && format == null && children == null;
30
+ let content;
31
+ if (children != null) content = children;
32
+ else if (format != null) content = isBlank(value) ? null : format(value);
33
+ else {
34
+ const text = coerce(value);
35
+ content = multiline ? renderMultiline(text) : text;
36
+ }
37
+ return /* @__PURE__ */ jsx(Tag, {
38
+ ...rest,
39
+ ...markerAttrs(slot, leaf, selectable),
40
+ children: content
41
+ });
42
+ }
43
+ function displayText(value) {
44
+ return typeof value === "string" ? value : "";
45
+ }
46
+ function displayNumber(value) {
47
+ return typeof value === "number" ? String(value) : "";
48
+ }
49
+ function SlotText(props) {
50
+ return /* @__PURE__ */ jsx(Textish, {
51
+ ...props,
52
+ leafEligible: true,
53
+ coerce: displayText
54
+ });
55
+ }
56
+ function SlotNumber(props) {
57
+ return /* @__PURE__ */ jsx(Textish, {
58
+ ...props,
59
+ leafEligible: true,
60
+ coerce: displayNumber
61
+ });
62
+ }
63
+ function SlotSelect(props) {
64
+ return /* @__PURE__ */ jsx(Textish, {
65
+ ...props,
66
+ leafEligible: false,
67
+ coerce: displayText
68
+ });
69
+ }
70
+ const SRC_ELEMENTS = /* @__PURE__ */ new Set([
71
+ "iframe",
72
+ "img",
73
+ "source",
74
+ "embed",
75
+ "video",
76
+ "audio",
77
+ "track",
78
+ "script"
79
+ ]);
80
+ function urlAttrName(as) {
81
+ return typeof as === "string" && SRC_ELEMENTS.has(as) ? "src" : "href";
82
+ }
83
+ function SlotUrl(props) {
84
+ const { slot, as, children, selectable = true, ...rest } = props;
85
+ useSlotProbe(slot);
86
+ const Tag = as ?? "a";
87
+ const value = slot.value;
88
+ const urlAttr = isBlank(value) ? {} : { [urlAttrName(Tag)]: value };
89
+ return /* @__PURE__ */ jsx(Tag, {
90
+ ...rest,
91
+ ...urlAttr,
92
+ ...markerAttrs(slot, false, selectable),
93
+ children
94
+ });
95
+ }
96
+
97
+ //#endregion
98
+ export { SlotNumber, SlotSelect, SlotText, SlotUrl };
@@ -0,0 +1,26 @@
1
+ import { SlotGroup } from "./slot-group.js";
2
+ import { SlotNumber, SlotSelect, SlotText, SlotUrl } from "./slot-scalar.js";
3
+ import { SlotDocument } from "./slot-document.js";
4
+ import { SlotList } from "./slot-list.js";
5
+ import { SlotImage, SlotTour, SlotVideo } from "./slot-media.js";
6
+ //#region src/primitives/slot.d.ts
7
+ /**
8
+ * The slot-authoring namespace: one component per slot kind, each rendering its
9
+ * value and marking it for the editor, plus `Slot.Group` — the unit container of
10
+ * a declared schema group or one collection row. `Slot.Text`, `Slot.List`, and so
11
+ * on are accessed off this one imported name rather than as separate exports.
12
+ */
13
+ declare const Slot: {
14
+ readonly Text: typeof SlotText;
15
+ readonly Number: typeof SlotNumber;
16
+ readonly Select: typeof SlotSelect;
17
+ readonly Url: typeof SlotUrl;
18
+ readonly Image: typeof SlotImage;
19
+ readonly Video: typeof SlotVideo;
20
+ readonly Tour: typeof SlotTour;
21
+ readonly Document: typeof SlotDocument;
22
+ readonly List: typeof SlotList;
23
+ readonly Group: typeof SlotGroup;
24
+ };
25
+ //#endregion
26
+ export { Slot };
@@ -0,0 +1,28 @@
1
+ import { SlotGroup } from "./slot-group.js";
2
+ import { SlotDocument } from "./slot-document.js";
3
+ import { SlotList } from "./slot-list.js";
4
+ import { SlotImage, SlotTour, SlotVideo } from "./slot-media.js";
5
+ import { SlotNumber, SlotSelect, SlotText, SlotUrl } from "./slot-scalar.js";
6
+
7
+ //#region src/primitives/slot.ts
8
+ /**
9
+ * The slot-authoring namespace: one component per slot kind, each rendering its
10
+ * value and marking it for the editor, plus `Slot.Group` — the unit container of
11
+ * a declared schema group or one collection row. `Slot.Text`, `Slot.List`, and so
12
+ * on are accessed off this one imported name rather than as separate exports.
13
+ */
14
+ const Slot = {
15
+ Text: SlotText,
16
+ Number: SlotNumber,
17
+ Select: SlotSelect,
18
+ Url: SlotUrl,
19
+ Image: SlotImage,
20
+ Video: SlotVideo,
21
+ Tour: SlotTour,
22
+ Document: SlotDocument,
23
+ List: SlotList,
24
+ Group: SlotGroup
25
+ };
26
+
27
+ //#endregion
28
+ export { Slot };
@@ -0,0 +1,479 @@
1
+ import { SECTION_CONTRACT_CATALOG } from "../packages/internal/section-contracts/dist/catalog.js";
2
+
3
+ //#region src/rules/registry.ts
4
+ /**
5
+ * The stages, in run order. No stage aborts the run: a stage whose input an earlier
6
+ * stage could not produce is reported as skipped, never as passed.
7
+ */
8
+ const CHECK_STAGES = [
9
+ {
10
+ id: "workspace",
11
+ summary: "The workspace loads: `template.ts` default-exports a `defineTemplate` value and every module builds and evaluates."
12
+ },
13
+ {
14
+ id: "typecheck",
15
+ summary: "This package's TypeScript compiles the workspace against its own `tsconfig.json`."
16
+ },
17
+ {
18
+ id: "lint",
19
+ summary: "This package's ESLint preset lints every module in the workspace."
20
+ },
21
+ {
22
+ id: "composition",
23
+ summary: "Each page is rendered once under the page probe, and the composition it places parses."
24
+ },
25
+ {
26
+ id: "stylesheet",
27
+ summary: "The CSS import graph of `template.ts` compiles into the template stylesheet exactly as `build` compiles it."
28
+ },
29
+ {
30
+ id: "logic",
31
+ summary: "Every placed section's logic bundle and the template's build exactly as `build` builds them, and the template's carries every reconcile rule."
32
+ },
33
+ {
34
+ id: "fixtures",
35
+ summary: "The fixtures under `fixtures/` load, resolve over the composition, and stay out of the bundle."
36
+ },
37
+ {
38
+ id: "sections",
39
+ summary: "Every placed section materializes: groups derived over the fixture corpus, the schema and fill spec parsed."
40
+ },
41
+ {
42
+ id: "contracts",
43
+ summary: "Every placed section's schema and fill spec satisfy the contract assertions publishing re-runs."
44
+ },
45
+ {
46
+ id: "render",
47
+ summary: "Every placed instance renders over every fixture and synthesized empty: deterministic, free of defects, and fully marked for the editor."
48
+ },
49
+ {
50
+ id: "bundles",
51
+ summary: "Every placed section bundles exactly as `build` bundles it, its weights are reported, its renderer and island chunks stay under their ceilings, and each frameless island renders no content."
52
+ },
53
+ {
54
+ id: "dependencies",
55
+ summary: "The workspace's lockfile is current, installs one React, and carries no high-severity advisory."
56
+ }
57
+ ];
58
+ const AUTHORED_RULES = [
59
+ {
60
+ id: "workspace/template-missing",
61
+ venue: "tree",
62
+ stage: "workspace",
63
+ summary: "The workspace root has no `template.ts`."
64
+ },
65
+ {
66
+ id: "workspace/template-invalid",
67
+ venue: "tree",
68
+ stage: "workspace",
69
+ summary: "`template.ts` does not default-export a `defineTemplate` value."
70
+ },
71
+ {
72
+ id: "workspace/module-invalid",
73
+ venue: "tree",
74
+ stage: "workspace",
75
+ summary: "A workspace module fails to build or throws when it is evaluated."
76
+ },
77
+ {
78
+ id: "workspace/duplicate-section-key",
79
+ venue: "tree",
80
+ stage: "workspace",
81
+ summary: "Two different exported sections declare the same key."
82
+ },
83
+ {
84
+ id: "typecheck/error",
85
+ venue: "tree",
86
+ stage: "typecheck",
87
+ summary: "TypeScript reports an error in a workspace module or its `tsconfig.json`."
88
+ },
89
+ {
90
+ id: "lint/parse-error",
91
+ venue: "eslint",
92
+ stage: "lint",
93
+ summary: "A workspace module cannot be parsed, so no lint rule could grade it."
94
+ },
95
+ {
96
+ id: "correctness/no-base-to-string",
97
+ venue: "eslint",
98
+ stage: "lint",
99
+ engineId: "@typescript-eslint/no-base-to-string",
100
+ summary: "No value stringifies to `[object Object]` or `[object File]`."
101
+ },
102
+ {
103
+ id: "correctness/restrict-template-expressions",
104
+ venue: "eslint",
105
+ stage: "lint",
106
+ engineId: "@typescript-eslint/restrict-template-expressions",
107
+ summary: "A template literal interpolates only strings, numbers and booleans."
108
+ },
109
+ {
110
+ id: "correctness/restrict-plus-operands",
111
+ venue: "eslint",
112
+ stage: "lint",
113
+ engineId: "@typescript-eslint/restrict-plus-operands",
114
+ summary: "`+` never mixes a string with a number."
115
+ },
116
+ {
117
+ id: "correctness/no-misused-promises",
118
+ venue: "eslint",
119
+ stage: "lint",
120
+ engineId: "@typescript-eslint/no-misused-promises",
121
+ summary: "No async function is passed where a void return is expected."
122
+ },
123
+ {
124
+ id: "correctness/no-floating-promises",
125
+ venue: "eslint",
126
+ stage: "lint",
127
+ engineId: "@typescript-eslint/no-floating-promises",
128
+ summary: "Every promise is awaited, returned or caught."
129
+ },
130
+ {
131
+ id: "correctness/await-thenable",
132
+ venue: "eslint",
133
+ stage: "lint",
134
+ engineId: "@typescript-eslint/await-thenable",
135
+ summary: "`await` is applied only to a thenable."
136
+ },
137
+ {
138
+ id: "correctness/no-for-in-array",
139
+ venue: "eslint",
140
+ stage: "lint",
141
+ engineId: "@typescript-eslint/no-for-in-array",
142
+ summary: "No `for...in` loop walks an array."
143
+ },
144
+ {
145
+ id: "correctness/no-implied-eval",
146
+ venue: "eslint",
147
+ stage: "lint",
148
+ engineId: "@typescript-eslint/no-implied-eval",
149
+ summary: "No string is evaluated as code at runtime."
150
+ },
151
+ {
152
+ id: "server/no-nondeterminism",
153
+ venue: "eslint",
154
+ stage: "lint",
155
+ engineId: "concrete/server/no-nondeterminism",
156
+ summary: "Server-rendered code reads no clock and no random source."
157
+ },
158
+ {
159
+ id: "server/no-client-runtime",
160
+ venue: "eslint",
161
+ stage: "lint",
162
+ engineId: "concrete/server/no-client-runtime",
163
+ summary: "Server-rendered code uses no effect, state, event handler, network call or browser global."
164
+ },
165
+ {
166
+ id: "server/no-inline-style",
167
+ venue: "eslint",
168
+ stage: "lint",
169
+ engineId: "concrete/server/no-inline-style",
170
+ summary: "Server-rendered JSX carries no inline `style` prop."
171
+ },
172
+ {
173
+ id: "islands/serializable-props",
174
+ venue: "eslint",
175
+ stage: "lint",
176
+ engineId: "concrete/islands/serializable-props",
177
+ summary: "Every prop written to an island is JSON-serializable."
178
+ },
179
+ {
180
+ id: "islands/editor-declaration",
181
+ venue: "eslint",
182
+ stage: "lint",
183
+ engineId: "concrete/islands/editor-declaration",
184
+ summary: "Every island exports a literal `editor = { live }`, and a literal `serverFrame` when it declares one."
185
+ },
186
+ {
187
+ id: "islands/editor-reason",
188
+ venue: "eslint",
189
+ stage: "lint",
190
+ engineId: "concrete/islands/editor-reason",
191
+ summary: "Every read of `inCanvas` that changes behavior carries an `editor-reason:` comment directly above it."
192
+ },
193
+ {
194
+ id: "islands/no-editor-globals",
195
+ venue: "eslint",
196
+ stage: "lint",
197
+ engineId: "concrete/islands/no-editor-globals",
198
+ summary: "No code reads the editor canvas's internal `__tr` globals."
199
+ },
200
+ {
201
+ id: "slots/no-marker-literal",
202
+ venue: "eslint",
203
+ stage: "lint",
204
+ engineId: "concrete/slots/no-marker-literal",
205
+ summary: "No code writes or reads a `data-slot-*` marker; the slot primitives emit them."
206
+ },
207
+ {
208
+ id: "slots/no-raw-values",
209
+ venue: "eslint",
210
+ stage: "lint",
211
+ engineId: "concrete/slots/no-raw-values",
212
+ summary: "Slot values are read through bindings, never off a raw `slots` object."
213
+ },
214
+ {
215
+ id: "style/no-hard-coded-color",
216
+ venue: "eslint",
217
+ stage: "lint",
218
+ engineId: "concrete/style/no-hard-coded-color",
219
+ severity: "warn",
220
+ summary: "Colors come from the theme, not from a hex value or a color function in a class or inline style."
221
+ },
222
+ {
223
+ id: "style/no-px-breakpoint",
224
+ venue: "eslint",
225
+ stage: "lint",
226
+ engineId: "concrete/style/no-px-breakpoint",
227
+ summary: "An arbitrary `min-[…]:` or `max-[…]:` breakpoint is written in `rem`, never `px`."
228
+ },
229
+ {
230
+ id: "pages/non-section-markup",
231
+ venue: "probe",
232
+ stage: "composition",
233
+ summary: "A page emits markup that is not a section; a page may contain only sections."
234
+ },
235
+ {
236
+ id: "pages/section-not-exported",
237
+ venue: "probe",
238
+ stage: "composition",
239
+ summary: "A page places a section no module exports, so the build cannot bundle it alone."
240
+ },
241
+ {
242
+ id: "pages/composition-invalid",
243
+ venue: "probe",
244
+ stage: "composition",
245
+ summary: "The composition the pages place breaks a page, canvas, instance or reconcile rule."
246
+ },
247
+ {
248
+ id: "fixtures/none",
249
+ venue: "tree",
250
+ stage: "fixtures",
251
+ summary: "The workspace exports no fixture; group derivation and marker coverage have no input."
252
+ },
253
+ {
254
+ id: "fixtures/property-invalid",
255
+ venue: "tree",
256
+ stage: "fixtures",
257
+ summary: "A property fails the platform schema, references a missing file, or repeats an id within a pool."
258
+ },
259
+ {
260
+ id: "fixtures/media-not-in-property",
261
+ venue: "tree",
262
+ stage: "fixtures",
263
+ summary: "A content entry references a media entry its property does not carry."
264
+ },
265
+ {
266
+ id: "fixtures/instance-not-placed",
267
+ venue: "tree",
268
+ stage: "fixtures",
269
+ summary: "A content entry names an instance the composition does not place."
270
+ },
271
+ {
272
+ id: "fixtures/reachable-from-bundle",
273
+ venue: "tree",
274
+ stage: "fixtures",
275
+ summary: "A module reachable from template.ts imports fixtures/, the fixtures subpath as a value, or the sample library."
276
+ },
277
+ {
278
+ id: "groups/slot-in-two-groups",
279
+ venue: "probe",
280
+ stage: "sections",
281
+ summary: "A slot is rendered inside two different `SlotGroup` cards."
282
+ },
283
+ {
284
+ id: "groups/label-conflict",
285
+ venue: "probe",
286
+ stage: "sections",
287
+ summary: "One `SlotGroup` id is rendered under two different labels."
288
+ },
289
+ {
290
+ id: "groups/empty",
291
+ venue: "probe",
292
+ stage: "sections",
293
+ summary: "A `SlotGroup` holds no slot in any fixture state."
294
+ },
295
+ {
296
+ id: "groups/probe-failed",
297
+ venue: "probe",
298
+ stage: "sections",
299
+ summary: "A section throws while it is rendered under the groups probe."
300
+ },
301
+ {
302
+ id: "sections/schema-invalid",
303
+ venue: "probe",
304
+ stage: "sections",
305
+ summary: "A section's materialized schema or fill spec fails to parse."
306
+ },
307
+ {
308
+ id: "render/unrenderable",
309
+ venue: "render",
310
+ stage: "render",
311
+ summary: "A placed instance throws when it is rendered over a fixture."
312
+ },
313
+ {
314
+ id: "render/determinism-drift",
315
+ venue: "render",
316
+ stage: "render",
317
+ summary: "An instance renders different markup twice from the same input."
318
+ },
319
+ {
320
+ id: "render/sentinel-text",
321
+ venue: "render",
322
+ stage: "render",
323
+ summary: "Rendered text is `[object Object]` or a bare `null`, `undefined` or `NaN`."
324
+ },
325
+ {
326
+ id: "render/broken-image",
327
+ venue: "render",
328
+ stage: "render",
329
+ summary: "An `<img>` renders with no source."
330
+ },
331
+ {
332
+ id: "render/unresolved-media",
333
+ venue: "render",
334
+ stage: "render",
335
+ summary: "A rendered fixture media URL names no file the fixture load produced."
336
+ },
337
+ {
338
+ id: "render/missing-slot-marker",
339
+ venue: "render",
340
+ stage: "render",
341
+ summary: "An editable slot, row or row field is never rendered as a selectable marker the editor can reach."
342
+ },
343
+ {
344
+ id: "render/unit-collection-item-marker",
345
+ venue: "render",
346
+ stage: "render",
347
+ summary: "A list edited as one card renders per-row item markers the editor never uses."
348
+ },
349
+ {
350
+ id: "render/group-ancestry",
351
+ venue: "render",
352
+ stage: "render",
353
+ summary: "A grouped slot is marked outside its group's element."
354
+ },
355
+ {
356
+ id: "render/section-root-margin",
357
+ venue: "render",
358
+ stage: "render",
359
+ summary: "The section root carries a margin utility, opening a gap between sections."
360
+ },
361
+ {
362
+ id: "bundles/build-failed",
363
+ venue: "build",
364
+ stage: "bundles",
365
+ summary: "A placed section's renderer or one of its island chunks fails to bundle, so `build` could not write it."
366
+ },
367
+ {
368
+ id: "bundles/renderer-size",
369
+ venue: "build",
370
+ stage: "bundles",
371
+ summary: "A section's renderer bundle is over 300 KB gzip."
372
+ },
373
+ {
374
+ id: "bundles/island-size",
375
+ venue: "build",
376
+ stage: "bundles",
377
+ summary: "An island chunk is over 1 MB gzip."
378
+ },
379
+ {
380
+ id: "islands/server-frame",
381
+ venue: "render",
382
+ stage: "bundles",
383
+ summary: "An island declaring `serverFrame = false` renders content on the server, which the build would delete from every published page."
384
+ },
385
+ {
386
+ id: "dependencies/lockfile-missing",
387
+ venue: "tree",
388
+ stage: "dependencies",
389
+ summary: "The workspace has no `package-lock.json`, so no dependency gate can be measured."
390
+ },
391
+ {
392
+ id: "dependencies/lockfile-stale",
393
+ venue: "tree",
394
+ stage: "dependencies",
395
+ summary: "The lockfile does not satisfy `package.json`."
396
+ },
397
+ {
398
+ id: "dependencies/single-react",
399
+ venue: "tree",
400
+ stage: "dependencies",
401
+ summary: "More than one copy of React is installed."
402
+ },
403
+ {
404
+ id: "dependencies/audit-severity",
405
+ venue: "tree",
406
+ stage: "dependencies",
407
+ summary: "`npm audit` reports a high or critical advisory."
408
+ },
409
+ {
410
+ id: "logic/section-build-failed",
411
+ venue: "tree",
412
+ stage: "logic",
413
+ summary: "A placed section's logic bundle fails to build, as when React reaches it through a compute closure."
414
+ },
415
+ {
416
+ id: "logic/template-build-failed",
417
+ venue: "tree",
418
+ stage: "logic",
419
+ summary: "The template's logic bundle fails to build or to evaluate."
420
+ },
421
+ {
422
+ id: "logic/reconcile-not-exported",
423
+ venue: "tree",
424
+ stage: "logic",
425
+ summary: "`defineTemplate` is handed reconcile rules `template.ts` does not export as `reconcile`, so the logic bundle drops them."
426
+ },
427
+ {
428
+ id: "css/tailwind-import",
429
+ venue: "tree",
430
+ stage: "stylesheet",
431
+ summary: "The CSS import graph of template.ts carries no `@import \"tailwindcss\"`, or more than one."
432
+ },
433
+ {
434
+ id: "css/external-url",
435
+ venue: "tree",
436
+ stage: "stylesheet",
437
+ summary: "A rendered template's compiled stylesheet references an external URL, which the renderer cannot reach."
438
+ },
439
+ {
440
+ id: "css/compile-failed",
441
+ venue: "tree",
442
+ stage: "stylesheet",
443
+ summary: "A stylesheet reachable from template.ts fails to resolve or compile, so no stylesheet rule could grade it."
444
+ }
445
+ ];
446
+ /** The id a contract assertion is reported under. */
447
+ function contractRuleId(id) {
448
+ return `contract/${id}`;
449
+ }
450
+ const CONTRACT_RULES = SECTION_CONTRACT_CATALOG.map((doc) => ({
451
+ id: contractRuleId(doc.id),
452
+ venue: "contract",
453
+ stage: "contracts",
454
+ summary: doc.summary
455
+ }));
456
+ /** The full rule catalog, stages in run order. Renaming an id is a breaking change. */
457
+ const CONCRETE_RULES = [...AUTHORED_RULES, ...CONTRACT_RULES];
458
+ const BY_ID = new Map(CONCRETE_RULES.map((rule) => [rule.id, rule]));
459
+ /** Is `id` a registered rule? */
460
+ function isConcreteRuleId(id) {
461
+ return BY_ID.has(id);
462
+ }
463
+ /** The registered rule with this id. Throws for an unregistered one: a rule absent from the registry cannot run. */
464
+ function ruleById(id) {
465
+ const rule = BY_ID.get(id);
466
+ if (rule === void 0) throw new Error(`"${id}" is not a registered Concrete rule.`);
467
+ return rule;
468
+ }
469
+ /** The registered ESLint rule an engine id reports under, or `undefined`. */
470
+ function eslintRuleByEngineId(engineId) {
471
+ return CONCRETE_RULES.find((rule) => rule.venue === "eslint" && rule.engineId === engineId);
472
+ }
473
+ /** The id as a violation reports it: `concrete/<id>`. */
474
+ function qualify(id) {
475
+ return `concrete/${id}`;
476
+ }
477
+
478
+ //#endregion
479
+ export { CHECK_STAGES, CONCRETE_RULES, contractRuleId, eslintRuleByEngineId, isConcreteRuleId, qualify, ruleById };
@@ -0,0 +1,22 @@
1
+ import { Facts } from "../packages/internal/template-contracts/dist/facts-view.js";
2
+ //#region src/schema/compute.d.ts
3
+ /**
4
+ * Collapses to `never` for any `Promise`-returning `T`, so a `compute()`
5
+ * callback that returns a promise (e.g. an `async` fn) fails to typecheck at
6
+ * the call site instead of silently running async at derive time.
7
+ */
8
+ type NoPromise<T> = T extends Promise<unknown> ? never : T;
9
+ /** The authoring marker `compute()` produces — read back by `getComputed`. */
10
+ interface ComputeBinding<T> {
11
+ readonly kind: "compute";
12
+ readonly fn: (f: Facts) => T;
13
+ }
14
+ /**
15
+ * Marks a slot's value as derived from `Facts` at render time rather than
16
+ * bound to a source field. `fn` must be synchronous — see `NoPromise`.
17
+ */
18
+ declare function compute<T>(fn: (f: Facts) => NoPromise<T>): ComputeBinding<T>;
19
+ /** Reads a schema's `COMPUTED` handle→fn map, or `{}` when none is attached. */
20
+ declare function getComputed(schema: unknown): Record<string, (f: Facts) => unknown>;
21
+ //#endregion
22
+ export { ComputeBinding, NoPromise, compute, getComputed };
@@ -0,0 +1,30 @@
1
+ //#region src/schema/compute.ts
2
+ /**
3
+ * Marks a slot's value as derived from `Facts` at render time rather than
4
+ * bound to a source field. `fn` must be synchronous — see `NoPromise`.
5
+ */
6
+ function compute(fn) {
7
+ return {
8
+ kind: "compute",
9
+ fn
10
+ };
11
+ }
12
+ /** Narrows `x` to a `ComputeBinding` produced by `compute()`. */
13
+ function isComputeBinding(x) {
14
+ return typeof x === "object" && x !== null && "kind" in x && x.kind === "compute" && "fn" in x && typeof x.fn === "function";
15
+ }
16
+ /**
17
+ * The non-enumerable key `defineSchema` attaches a schema's handle→fn map
18
+ * under. A symbol key so the map rides on the schema object invisibly to
19
+ * `JSON.stringify`/`Object.keys`/Zod — the whole point of the seam is that a
20
+ * `compute()` fn never has to survive serialization to `SectionSchema.parse`.
21
+ */
22
+ const COMPUTED = Symbol("compute:handles");
23
+ /** Reads a schema's `COMPUTED` handle→fn map, or `{}` when none is attached. */
24
+ function getComputed(schema) {
25
+ if (typeof schema !== "object" || schema === null) return {};
26
+ return schema[COMPUTED] ?? {};
27
+ }
28
+
29
+ //#endregion
30
+ export { COMPUTED, compute, getComputed, isComputeBinding };