@pwfabric/runtime 0.0.0-stage → 1.0.0-rc.1

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 (447) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +43 -2
  3. package/dist/a11y/announcer.d.ts +65 -0
  4. package/dist/a11y/announcer.js +140 -0
  5. package/dist/a11y/announcer.js.map +1 -0
  6. package/dist/a11y/contrast.d.ts +54 -0
  7. package/dist/a11y/contrast.js +93 -0
  8. package/dist/a11y/contrast.js.map +1 -0
  9. package/dist/a11y/focus.d.ts +123 -0
  10. package/dist/a11y/focus.js +282 -0
  11. package/dist/a11y/focus.js.map +1 -0
  12. package/dist/a11y/index.d.ts +21 -0
  13. package/dist/a11y/index.js +18 -0
  14. package/dist/a11y/index.js.map +1 -0
  15. package/dist/a11y/keyboard.d.ts +144 -0
  16. package/dist/a11y/keyboard.js +317 -0
  17. package/dist/a11y/keyboard.js.map +1 -0
  18. package/dist/adapters/default-image.d.ts +25 -0
  19. package/dist/adapters/default-image.js +37 -0
  20. package/dist/adapters/default-image.js.map +1 -0
  21. package/dist/adapters/index.d.ts +27 -0
  22. package/dist/adapters/index.js +28 -0
  23. package/dist/adapters/index.js.map +1 -0
  24. package/dist/adapters/next-image.d.ts +38 -0
  25. package/dist/adapters/next-image.js +124 -0
  26. package/dist/adapters/next-image.js.map +1 -0
  27. package/dist/adapters/types.d.ts +61 -0
  28. package/dist/adapters/types.js +11 -0
  29. package/dist/adapters/types.js.map +1 -0
  30. package/dist/analytics/index.d.ts +14 -0
  31. package/dist/analytics/index.js +15 -0
  32. package/dist/analytics/index.js.map +1 -0
  33. package/dist/analytics/tracker.d.ts +65 -0
  34. package/dist/analytics/tracker.js +251 -0
  35. package/dist/analytics/tracker.js.map +1 -0
  36. package/dist/analytics/types.d.ts +130 -0
  37. package/dist/analytics/types.js +11 -0
  38. package/dist/analytics/types.js.map +1 -0
  39. package/dist/auth/index.d.ts +15 -0
  40. package/dist/auth/index.js +14 -0
  41. package/dist/auth/index.js.map +1 -0
  42. package/dist/auth/provider.d.ts +132 -0
  43. package/dist/auth/provider.js +473 -0
  44. package/dist/auth/provider.js.map +1 -0
  45. package/dist/auth/types.d.ts +117 -0
  46. package/dist/auth/types.js +9 -0
  47. package/dist/auth/types.js.map +1 -0
  48. package/dist/binding/collection.d.ts +190 -0
  49. package/dist/binding/collection.js +358 -0
  50. package/dist/binding/collection.js.map +1 -0
  51. package/dist/binding/datasource.d.ts +319 -0
  52. package/dist/binding/datasource.js +556 -0
  53. package/dist/binding/datasource.js.map +1 -0
  54. package/dist/binding/engine.d.ts +65 -0
  55. package/dist/binding/engine.js +268 -0
  56. package/dist/binding/engine.js.map +1 -0
  57. package/dist/binding/expression.d.ts +150 -0
  58. package/dist/binding/expression.js +787 -0
  59. package/dist/binding/expression.js.map +1 -0
  60. package/dist/binding/index.d.ts +19 -0
  61. package/dist/binding/index.js +14 -0
  62. package/dist/binding/index.js.map +1 -0
  63. package/dist/binding/two-way.d.ts +149 -0
  64. package/dist/binding/two-way.js +462 -0
  65. package/dist/binding/two-way.js.map +1 -0
  66. package/dist/binding/types.d.ts +119 -0
  67. package/dist/binding/types.js +9 -0
  68. package/dist/binding/types.js.map +1 -0
  69. package/dist/blocks/component-types.d.ts +81 -0
  70. package/dist/blocks/component-types.js +11 -0
  71. package/dist/blocks/component-types.js.map +1 -0
  72. package/dist/blocks/composition-rules.d.ts +168 -0
  73. package/dist/blocks/composition-rules.js +391 -0
  74. package/dist/blocks/composition-rules.js.map +1 -0
  75. package/dist/blocks/hooks.d.ts +31 -0
  76. package/dist/blocks/hooks.js +42 -0
  77. package/dist/blocks/hooks.js.map +1 -0
  78. package/dist/blocks/index.d.ts +14 -0
  79. package/dist/blocks/index.js +23 -0
  80. package/dist/blocks/index.js.map +1 -0
  81. package/dist/blocks/registry.d.ts +84 -0
  82. package/dist/blocks/registry.js +136 -0
  83. package/dist/blocks/registry.js.map +1 -0
  84. package/dist/blocks/rule-engine.d.ts +131 -0
  85. package/dist/blocks/rule-engine.js +321 -0
  86. package/dist/blocks/rule-engine.js.map +1 -0
  87. package/dist/blocks/surface-event-context.d.ts +13 -0
  88. package/dist/blocks/surface-event-context.js +14 -0
  89. package/dist/blocks/surface-event-context.js.map +1 -0
  90. package/dist/blocks/surface-id-context.d.ts +13 -0
  91. package/dist/blocks/surface-id-context.js +15 -0
  92. package/dist/blocks/surface-id-context.js.map +1 -0
  93. package/dist/bus.d.ts +41 -0
  94. package/dist/bus.js +158 -0
  95. package/dist/bus.js.map +1 -0
  96. package/dist/cache/index.d.ts +9 -0
  97. package/dist/cache/index.js +10 -0
  98. package/dist/cache/index.js.map +1 -0
  99. package/dist/cache/memory.d.ts +32 -0
  100. package/dist/cache/memory.js +138 -0
  101. package/dist/cache/memory.js.map +1 -0
  102. package/dist/cache/types.d.ts +62 -0
  103. package/dist/cache/types.js +9 -0
  104. package/dist/cache/types.js.map +1 -0
  105. package/dist/capability/index.d.ts +72 -0
  106. package/dist/capability/index.js +87 -0
  107. package/dist/capability/index.js.map +1 -0
  108. package/dist/capability/kernel-capabilities.d.ts +31 -0
  109. package/dist/capability/kernel-capabilities.js +36 -0
  110. package/dist/capability/kernel-capabilities.js.map +1 -0
  111. package/dist/capability/platform-capabilities.d.ts +71 -0
  112. package/dist/capability/platform-capabilities.js +267 -0
  113. package/dist/capability/platform-capabilities.js.map +1 -0
  114. package/dist/capability/type-mapping.d.ts +70 -0
  115. package/dist/capability/type-mapping.js +107 -0
  116. package/dist/capability/type-mapping.js.map +1 -0
  117. package/dist/capability/validation.d.ts +46 -0
  118. package/dist/capability/validation.js +54 -0
  119. package/dist/capability/validation.js.map +1 -0
  120. package/dist/connectors/declared-connector.d.ts +48 -0
  121. package/dist/connectors/declared-connector.js +333 -0
  122. package/dist/connectors/declared-connector.js.map +1 -0
  123. package/dist/connectors/engine-registry.d.ts +50 -0
  124. package/dist/connectors/engine-registry.js +135 -0
  125. package/dist/connectors/engine-registry.js.map +1 -0
  126. package/dist/connectors/index.d.ts +14 -0
  127. package/dist/connectors/index.js +14 -0
  128. package/dist/connectors/index.js.map +1 -0
  129. package/dist/connectors/module-loader.d.ts +70 -0
  130. package/dist/connectors/module-loader.js +143 -0
  131. package/dist/connectors/module-loader.js.map +1 -0
  132. package/dist/connectors/types.d.ts +174 -0
  133. package/dist/connectors/types.js +23 -0
  134. package/dist/connectors/types.js.map +1 -0
  135. package/dist/context.d.ts +27 -0
  136. package/dist/context.js +38 -0
  137. package/dist/context.js.map +1 -0
  138. package/dist/data/DataCapabilityProvider.d.ts +39 -0
  139. package/dist/data/DataCapabilityProvider.js +58 -0
  140. package/dist/data/DataCapabilityProvider.js.map +1 -0
  141. package/dist/data/index.d.ts +17 -0
  142. package/dist/data/index.js +18 -0
  143. package/dist/data/index.js.map +1 -0
  144. package/dist/data/manager.d.ts +40 -0
  145. package/dist/data/manager.js +442 -0
  146. package/dist/data/manager.js.map +1 -0
  147. package/dist/data/types.d.ts +218 -0
  148. package/dist/data/types.js +2 -0
  149. package/dist/data/types.js.map +1 -0
  150. package/dist/entity/aggregate.d.ts +8 -0
  151. package/dist/entity/aggregate.js +24 -0
  152. package/dist/entity/aggregate.js.map +1 -0
  153. package/dist/entity/apply-query.d.ts +58 -0
  154. package/dist/entity/apply-query.js +264 -0
  155. package/dist/entity/apply-query.js.map +1 -0
  156. package/dist/entity/behavior.d.ts +94 -0
  157. package/dist/entity/behavior.js +78 -0
  158. package/dist/entity/behavior.js.map +1 -0
  159. package/dist/entity/connector.d.ts +141 -0
  160. package/dist/entity/connector.js +89 -0
  161. package/dist/entity/connector.js.map +1 -0
  162. package/dist/entity/connectors/index.d.ts +12 -0
  163. package/dist/entity/connectors/index.js +11 -0
  164. package/dist/entity/connectors/index.js.map +1 -0
  165. package/dist/entity/connectors/static.d.ts +51 -0
  166. package/dist/entity/connectors/static.js +245 -0
  167. package/dist/entity/connectors/static.js.map +1 -0
  168. package/dist/entity/entity-datasource.d.ts +50 -0
  169. package/dist/entity/entity-datasource.js +33 -0
  170. package/dist/entity/entity-datasource.js.map +1 -0
  171. package/dist/entity/facade.d.ts +70 -0
  172. package/dist/entity/facade.js +70 -0
  173. package/dist/entity/facade.js.map +1 -0
  174. package/dist/entity/http-connector.d.ts +123 -0
  175. package/dist/entity/http-connector.js +295 -0
  176. package/dist/entity/http-connector.js.map +1 -0
  177. package/dist/entity/index.d.ts +38 -0
  178. package/dist/entity/index.js +31 -0
  179. package/dist/entity/index.js.map +1 -0
  180. package/dist/entity/postgres-connector.d.ts +64 -0
  181. package/dist/entity/postgres-connector.js +239 -0
  182. package/dist/entity/postgres-connector.js.map +1 -0
  183. package/dist/entity/registry.d.ts +59 -0
  184. package/dist/entity/registry.js +90 -0
  185. package/dist/entity/registry.js.map +1 -0
  186. package/dist/entity/store.d.ts +66 -0
  187. package/dist/entity/store.js +349 -0
  188. package/dist/entity/store.js.map +1 -0
  189. package/dist/entity/types.d.ts +180 -0
  190. package/dist/entity/types.js +10 -0
  191. package/dist/entity/types.js.map +1 -0
  192. package/dist/execution-context.d.ts +88 -0
  193. package/dist/execution-context.js +146 -0
  194. package/dist/execution-context.js.map +1 -0
  195. package/dist/executor.d.ts +27 -0
  196. package/dist/executor.js +33 -0
  197. package/dist/executor.js.map +1 -0
  198. package/dist/forms/form-entity-bridge.d.ts +94 -0
  199. package/dist/forms/form-entity-bridge.js +96 -0
  200. package/dist/forms/form-entity-bridge.js.map +1 -0
  201. package/dist/forms/form-write-target.d.ts +34 -0
  202. package/dist/forms/form-write-target.js +81 -0
  203. package/dist/forms/form-write-target.js.map +1 -0
  204. package/dist/forms/index.d.ts +22 -0
  205. package/dist/forms/index.js +25 -0
  206. package/dist/forms/index.js.map +1 -0
  207. package/dist/forms/named-control-values.d.ts +27 -0
  208. package/dist/forms/named-control-values.js +42 -0
  209. package/dist/forms/named-control-values.js.map +1 -0
  210. package/dist/forms/processor.d.ts +55 -0
  211. package/dist/forms/processor.js +154 -0
  212. package/dist/forms/processor.js.map +1 -0
  213. package/dist/forms/types.d.ts +174 -0
  214. package/dist/forms/types.js +33 -0
  215. package/dist/forms/types.js.map +1 -0
  216. package/dist/forms/validator.d.ts +61 -0
  217. package/dist/forms/validator.js +218 -0
  218. package/dist/forms/validator.js.map +1 -0
  219. package/dist/graph/index.d.ts +10 -0
  220. package/dist/graph/index.js +9 -0
  221. package/dist/graph/index.js.map +1 -0
  222. package/dist/graph/resolver.d.ts +66 -0
  223. package/dist/graph/resolver.js +243 -0
  224. package/dist/graph/resolver.js.map +1 -0
  225. package/dist/graph/types.d.ts +125 -0
  226. package/dist/graph/types.js +9 -0
  227. package/dist/graph/types.js.map +1 -0
  228. package/dist/hooks/useInstalledAtoms.d.ts +96 -0
  229. package/dist/hooks/useInstalledAtoms.js +92 -0
  230. package/dist/hooks/useInstalledAtoms.js.map +1 -0
  231. package/dist/i18n/index.d.ts +15 -0
  232. package/dist/i18n/index.js +14 -0
  233. package/dist/i18n/index.js.map +1 -0
  234. package/dist/i18n/translator.d.ts +76 -0
  235. package/dist/i18n/translator.js +357 -0
  236. package/dist/i18n/translator.js.map +1 -0
  237. package/dist/i18n/types.d.ts +93 -0
  238. package/dist/i18n/types.js +9 -0
  239. package/dist/i18n/types.js.map +1 -0
  240. package/dist/index.d.ts +64 -0
  241. package/dist/index.js +95 -0
  242. package/dist/index.js.map +1 -0
  243. package/dist/kernel.d.ts +47 -0
  244. package/dist/kernel.js +258 -0
  245. package/dist/kernel.js.map +1 -0
  246. package/dist/perf/budget.d.ts +92 -0
  247. package/dist/perf/budget.js +122 -0
  248. package/dist/perf/budget.js.map +1 -0
  249. package/dist/perf/index.d.ts +16 -0
  250. package/dist/perf/index.js +13 -0
  251. package/dist/perf/index.js.map +1 -0
  252. package/dist/perf/render-timer.d.ts +90 -0
  253. package/dist/perf/render-timer.js +136 -0
  254. package/dist/perf/render-timer.js.map +1 -0
  255. package/dist/perf/reporter.d.ts +126 -0
  256. package/dist/perf/reporter.js +241 -0
  257. package/dist/perf/reporter.js.map +1 -0
  258. package/dist/perf/web-vitals.d.ts +111 -0
  259. package/dist/perf/web-vitals.js +268 -0
  260. package/dist/perf/web-vitals.js.map +1 -0
  261. package/dist/registry.d.ts +63 -0
  262. package/dist/registry.js +126 -0
  263. package/dist/registry.js.map +1 -0
  264. package/dist/render/BehaviorSurfaceProvider.d.ts +65 -0
  265. package/dist/render/BehaviorSurfaceProvider.js +185 -0
  266. package/dist/render/BehaviorSurfaceProvider.js.map +1 -0
  267. package/dist/render/BlockErrorBoundary.d.ts +26 -0
  268. package/dist/render/BlockErrorBoundary.js +41 -0
  269. package/dist/render/BlockErrorBoundary.js.map +1 -0
  270. package/dist/render/DataBoundSurfaceRenderer.d.ts +78 -0
  271. package/dist/render/DataBoundSurfaceRenderer.js +998 -0
  272. package/dist/render/DataBoundSurfaceRenderer.js.map +1 -0
  273. package/dist/render/DynamicBlockWrapper.d.ts +23 -0
  274. package/dist/render/DynamicBlockWrapper.js +117 -0
  275. package/dist/render/DynamicBlockWrapper.js.map +1 -0
  276. package/dist/render/appearance-resolver.d.ts +50 -0
  277. package/dist/render/appearance-resolver.js +78 -0
  278. package/dist/render/appearance-resolver.js.map +1 -0
  279. package/dist/render/capability-gate.d.ts +69 -0
  280. package/dist/render/capability-gate.js +94 -0
  281. package/dist/render/capability-gate.js.map +1 -0
  282. package/dist/render/conditional-states-css.d.ts +41 -0
  283. package/dist/render/conditional-states-css.js +82 -0
  284. package/dist/render/conditional-states-css.js.map +1 -0
  285. package/dist/render/connections-context.d.ts +31 -0
  286. package/dist/render/connections-context.js +34 -0
  287. package/dist/render/connections-context.js.map +1 -0
  288. package/dist/render/dark-theme-css.d.ts +36 -0
  289. package/dist/render/dark-theme-css.js +67 -0
  290. package/dist/render/dark-theme-css.js.map +1 -0
  291. package/dist/render/data-binding-types.d.ts +191 -0
  292. package/dist/render/data-binding-types.js +11 -0
  293. package/dist/render/data-binding-types.js.map +1 -0
  294. package/dist/render/data-cache.d.ts +30 -0
  295. package/dist/render/data-cache.js +37 -0
  296. package/dist/render/data-cache.js.map +1 -0
  297. package/dist/render/derive-dark-theme.d.ts +17 -0
  298. package/dist/render/derive-dark-theme.js +18 -0
  299. package/dist/render/derive-dark-theme.js.map +1 -0
  300. package/dist/render/dynamic-artifact-context.d.ts +77 -0
  301. package/dist/render/dynamic-artifact-context.js +89 -0
  302. package/dist/render/dynamic-artifact-context.js.map +1 -0
  303. package/dist/render/dynamic-block-loader.d.ts +80 -0
  304. package/dist/render/dynamic-block-loader.js +197 -0
  305. package/dist/render/dynamic-block-loader.js.map +1 -0
  306. package/dist/render/endpoint.d.ts +18 -0
  307. package/dist/render/endpoint.js +109 -0
  308. package/dist/render/endpoint.js.map +1 -0
  309. package/dist/render/entity-facade-context.d.ts +34 -0
  310. package/dist/render/entity-facade-context.js +37 -0
  311. package/dist/render/entity-facade-context.js.map +1 -0
  312. package/dist/render/group-states-css.d.ts +41 -0
  313. package/dist/render/group-states-css.js +73 -0
  314. package/dist/render/group-states-css.js.map +1 -0
  315. package/dist/render/hooks/useSurfaceEvents.d.ts +8 -0
  316. package/dist/render/hooks/useSurfaceEvents.js +9 -0
  317. package/dist/render/hooks/useSurfaceEvents.js.map +1 -0
  318. package/dist/render/hooks/useSurfaceId.d.ts +8 -0
  319. package/dist/render/hooks/useSurfaceId.js +9 -0
  320. package/dist/render/hooks/useSurfaceId.js.map +1 -0
  321. package/dist/render/index.d.ts +48 -0
  322. package/dist/render/index.js +61 -0
  323. package/dist/render/index.js.map +1 -0
  324. package/dist/render/interaction-rule-engine.d.ts +12 -0
  325. package/dist/render/interaction-rule-engine.js +47 -0
  326. package/dist/render/interaction-rule-engine.js.map +1 -0
  327. package/dist/render/keyframes-css.d.ts +31 -0
  328. package/dist/render/keyframes-css.js +44 -0
  329. package/dist/render/keyframes-css.js.map +1 -0
  330. package/dist/render/query-state.d.ts +3 -0
  331. package/dist/render/query-state.js +70 -0
  332. package/dist/render/query-state.js.map +1 -0
  333. package/dist/render/renderer.d.ts +44 -0
  334. package/dist/render/renderer.js +937 -0
  335. package/dist/render/renderer.js.map +1 -0
  336. package/dist/render/resolve-expressions.d.ts +37 -0
  337. package/dist/render/resolve-expressions.js +309 -0
  338. package/dist/render/resolve-expressions.js.map +1 -0
  339. package/dist/render/responsive-style-css.d.ts +42 -0
  340. package/dist/render/responsive-style-css.js +123 -0
  341. package/dist/render/responsive-style-css.js.map +1 -0
  342. package/dist/render/responsive.d.ts +49 -0
  343. package/dist/render/responsive.js +99 -0
  344. package/dist/render/responsive.js.map +1 -0
  345. package/dist/render/scoped-css.d.ts +71 -0
  346. package/dist/render/scoped-css.js +102 -0
  347. package/dist/render/scoped-css.js.map +1 -0
  348. package/dist/render/shell-selection.d.ts +69 -0
  349. package/dist/render/shell-selection.js +117 -0
  350. package/dist/render/shell-selection.js.map +1 -0
  351. package/dist/render/states-css.d.ts +32 -0
  352. package/dist/render/states-css.js +63 -0
  353. package/dist/render/states-css.js.map +1 -0
  354. package/dist/render/surface-data-context.d.ts +18 -0
  355. package/dist/render/surface-data-context.js +21 -0
  356. package/dist/render/surface-data-context.js.map +1 -0
  357. package/dist/render/surface-event-bus.d.ts +19 -0
  358. package/dist/render/surface-event-bus.js +68 -0
  359. package/dist/render/surface-event-bus.js.map +1 -0
  360. package/dist/render/surface-event-context.d.ts +11 -0
  361. package/dist/render/surface-event-context.js +12 -0
  362. package/dist/render/surface-event-context.js.map +1 -0
  363. package/dist/render/surface-id-context.d.ts +8 -0
  364. package/dist/render/surface-id-context.js +9 -0
  365. package/dist/render/surface-id-context.js.map +1 -0
  366. package/dist/render/theme-utils.d.ts +14 -0
  367. package/dist/render/theme-utils.js +15 -0
  368. package/dist/render/theme-utils.js.map +1 -0
  369. package/dist/render/types.d.ts +282 -0
  370. package/dist/render/types.js +9 -0
  371. package/dist/render/types.js.map +1 -0
  372. package/dist/render/visibility-css.d.ts +42 -0
  373. package/dist/render/visibility-css.js +119 -0
  374. package/dist/render/visibility-css.js.map +1 -0
  375. package/dist/render/width-scope.d.ts +34 -0
  376. package/dist/render/width-scope.js +44 -0
  377. package/dist/render/width-scope.js.map +1 -0
  378. package/dist/render/write-only-sources.d.ts +33 -0
  379. package/dist/render/write-only-sources.js +99 -0
  380. package/dist/render/write-only-sources.js.map +1 -0
  381. package/dist/routing/index.d.ts +14 -0
  382. package/dist/routing/index.js +15 -0
  383. package/dist/routing/index.js.map +1 -0
  384. package/dist/routing/router.d.ts +42 -0
  385. package/dist/routing/router.js +218 -0
  386. package/dist/routing/router.js.map +1 -0
  387. package/dist/routing/types.d.ts +124 -0
  388. package/dist/routing/types.js +9 -0
  389. package/dist/routing/types.js.map +1 -0
  390. package/dist/seo/generator.d.ts +39 -0
  391. package/dist/seo/generator.js +236 -0
  392. package/dist/seo/generator.js.map +1 -0
  393. package/dist/seo/index.d.ts +14 -0
  394. package/dist/seo/index.js +15 -0
  395. package/dist/seo/index.js.map +1 -0
  396. package/dist/seo/types.d.ts +181 -0
  397. package/dist/seo/types.js +9 -0
  398. package/dist/seo/types.js.map +1 -0
  399. package/dist/state/index.d.ts +15 -0
  400. package/dist/state/index.js +16 -0
  401. package/dist/state/index.js.map +1 -0
  402. package/dist/state/manager.d.ts +33 -0
  403. package/dist/state/manager.js +81 -0
  404. package/dist/state/manager.js.map +1 -0
  405. package/dist/state/store.d.ts +40 -0
  406. package/dist/state/store.js +145 -0
  407. package/dist/state/store.js.map +1 -0
  408. package/dist/state/types.d.ts +107 -0
  409. package/dist/state/types.js +9 -0
  410. package/dist/state/types.js.map +1 -0
  411. package/dist/surface/expression.d.ts +65 -0
  412. package/dist/surface/expression.js +179 -0
  413. package/dist/surface/expression.js.map +1 -0
  414. package/dist/surface/index.d.ts +32 -0
  415. package/dist/surface/index.js +25 -0
  416. package/dist/surface/index.js.map +1 -0
  417. package/dist/surface/interpreter.d.ts +96 -0
  418. package/dist/surface/interpreter.js +231 -0
  419. package/dist/surface/interpreter.js.map +1 -0
  420. package/dist/surface/layout.d.ts +54 -0
  421. package/dist/surface/layout.js +288 -0
  422. package/dist/surface/layout.js.map +1 -0
  423. package/dist/surface/output.d.ts +90 -0
  424. package/dist/surface/output.js +104 -0
  425. package/dist/surface/output.js.map +1 -0
  426. package/dist/surface/primitives.d.ts +180 -0
  427. package/dist/surface/primitives.js +339 -0
  428. package/dist/surface/primitives.js.map +1 -0
  429. package/dist/surface/renderer.d.ts +96 -0
  430. package/dist/surface/renderer.js +190 -0
  431. package/dist/surface/renderer.js.map +1 -0
  432. package/dist/surface/schemas.d.ts +181 -0
  433. package/dist/surface/schemas.js +142 -0
  434. package/dist/surface/schemas.js.map +1 -0
  435. package/dist/surface/transforms.d.ts +144 -0
  436. package/dist/surface/transforms.js +120 -0
  437. package/dist/surface/transforms.js.map +1 -0
  438. package/dist/surface/types.d.ts +160 -0
  439. package/dist/surface/types.js +51 -0
  440. package/dist/surface/types.js.map +1 -0
  441. package/dist/surface/validation.d.ts +123 -0
  442. package/dist/surface/validation.js +147 -0
  443. package/dist/surface/validation.js.map +1 -0
  444. package/dist/validator.d.ts +55 -0
  445. package/dist/validator.js +100 -0
  446. package/dist/validator.js.map +1 -0
  447. package/package.json +106 -3
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Block Component Types
3
+ *
4
+ * Minimal type definitions for block React components.
5
+ * These types are structurally compatible with @pwfabric/runtime's
6
+ * BlockComponent and BlockComponentRegistry types.
7
+ *
8
+ * @module @pwfabric/runtime/blocks/component-types
9
+ */
10
+ import type { ReactNode } from 'react';
11
+ import type { Block } from '@pwfabric/contracts';
12
+ import type { BreakpointName } from '@pwfabric/core';
13
+ /**
14
+ * Surface event types emitted by block components
15
+ */
16
+ export type BlockSurfaceEventType = 'click' | 'submit' | 'change' | 'navigate' | 'custom';
17
+ /**
18
+ * Surface event emitted by block components
19
+ */
20
+ export interface BlockSurfaceEvent {
21
+ /** Event type */
22
+ readonly type: BlockSurfaceEventType;
23
+ /** Block ID that triggered the event */
24
+ readonly blockId: string;
25
+ /** Event payload */
26
+ readonly payload?: unknown;
27
+ /** Original DOM event (if applicable) */
28
+ readonly originalEvent?: Event;
29
+ }
30
+ /**
31
+ * Minimal block rendering context available to block components.
32
+ * Structurally compatible with @pwfabric/runtime's BlockContext.
33
+ */
34
+ export interface BlockComponentContext {
35
+ /** Event handler for block events */
36
+ readonly onEvent?: ((event: BlockSurfaceEvent) => void) | undefined;
37
+ /** Current viewport breakpoint */
38
+ readonly viewport?: BreakpointName;
39
+ /** Image adapter (optional, runtime-provided) */
40
+ readonly imageAdapter?: unknown;
41
+ /** Capabilities (optional, runtime-provided) */
42
+ readonly capabilities?: Map<string, unknown>;
43
+ }
44
+ /**
45
+ * Props passed to block components
46
+ */
47
+ export interface BlockComponentProps<T = Record<string, unknown>> {
48
+ /** Block instance */
49
+ readonly block: Block;
50
+ /** Resolved props (validated and defaulted) */
51
+ readonly props: T;
52
+ /** Rendered children (for container blocks) */
53
+ readonly children?: ReactNode;
54
+ /** Block context */
55
+ readonly context: BlockComponentContext;
56
+ }
57
+ /**
58
+ * Block component type
59
+ */
60
+ export type BlockComponent<T = Record<string, unknown>> = ((props: BlockComponentProps<T>) => ReactNode) & {
61
+ /**
62
+ * How the block wants to be sized when it sits in a flex ROW.
63
+ *
64
+ * The engine's default for a row child is an equal share (`flex: 1 1 0`) —
65
+ * right for two content columns, wrong for an avatar, a badge, a button: an
66
+ * intrinsic thing stretched to half a row is the single most measured layout
67
+ * defect of the 2026-09 surface audit (127 hand-written `flex: 0 0 auto`
68
+ * overrides across 14 receipts). A block whose natural width is its content
69
+ * declares `sizing: 'intrinsic'` — as a static on the component, the same
70
+ * way `displayName` travels — and the engine gives it `flex: 0 0 auto`.
71
+ * An authored flex hint on the instance still wins. The engine memorises no
72
+ * block names: the block declares, the engine obeys.
73
+ */
74
+ sizing?: BlockSizing;
75
+ };
76
+ /** The only sizing word the engine knows besides its default (fluid share). */
77
+ export type BlockSizing = 'intrinsic';
78
+ /**
79
+ * Block component registry — maps block type strings to React component implementations
80
+ */
81
+ export type BlockComponentRegistry = Record<string, BlockComponent>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Block Component Types
3
+ *
4
+ * Minimal type definitions for block React components.
5
+ * These types are structurally compatible with @pwfabric/runtime's
6
+ * BlockComponent and BlockComponentRegistry types.
7
+ *
8
+ * @module @pwfabric/runtime/blocks/component-types
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=component-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-types.js","sourceRoot":"","sources":["../../src/blocks/component-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * Block Component Types\n *\n * Minimal type definitions for block React components.\n * These types are structurally compatible with @pwfabric/runtime's\n * BlockComponent and BlockComponentRegistry types.\n *\n * @module @pwfabric/runtime/blocks/component-types\n */\n\nimport type { ReactNode } from 'react'\nimport type { Block } from '@pwfabric/contracts'\nimport type { BreakpointName } from '@pwfabric/core'\n\n// ============================================================\n// SURFACE EVENTS (minimal subset used by block components)\n// ============================================================\n\n/**\n * Surface event types emitted by block components\n */\nexport type BlockSurfaceEventType = 'click' | 'submit' | 'change' | 'navigate' | 'custom'\n\n/**\n * Surface event emitted by block components\n */\nexport interface BlockSurfaceEvent {\n /** Event type */\n readonly type: BlockSurfaceEventType\n /** Block ID that triggered the event */\n readonly blockId: string\n /** Event payload */\n readonly payload?: unknown\n /** Original DOM event (if applicable) */\n readonly originalEvent?: Event\n}\n\n// ============================================================\n// BLOCK CONTEXT (minimal subset needed by block components)\n// ============================================================\n\n/**\n * Minimal block rendering context available to block components.\n * Structurally compatible with @pwfabric/runtime's BlockContext.\n */\nexport interface BlockComponentContext {\n /** Event handler for block events */\n readonly onEvent?: ((event: BlockSurfaceEvent) => void) | undefined\n /** Current viewport breakpoint */\n readonly viewport?: BreakpointName\n /** Image adapter (optional, runtime-provided) */\n readonly imageAdapter?: unknown\n /** Capabilities (optional, runtime-provided) */\n readonly capabilities?: Map<string, unknown>\n}\n\n// ============================================================\n// BLOCK COMPONENT TYPES\n// ============================================================\n\n/**\n * Props passed to block components\n */\nexport interface BlockComponentProps<T = Record<string, unknown>> {\n /** Block instance */\n readonly block: Block\n /** Resolved props (validated and defaulted) */\n readonly props: T\n /** Rendered children (for container blocks) */\n readonly children?: ReactNode\n /** Block context */\n readonly context: BlockComponentContext\n}\n\n/**\n * Block component type\n */\nexport type BlockComponent<T = Record<string, unknown>> = ((\n props: BlockComponentProps<T>\n) => ReactNode) & {\n /**\n * How the block wants to be sized when it sits in a flex ROW.\n *\n * The engine's default for a row child is an equal share (`flex: 1 1 0`) —\n * right for two content columns, wrong for an avatar, a badge, a button: an\n * intrinsic thing stretched to half a row is the single most measured layout\n * defect of the 2026-09 surface audit (127 hand-written `flex: 0 0 auto`\n * overrides across 14 receipts). A block whose natural width is its content\n * declares `sizing: 'intrinsic'` — as a static on the component, the same\n * way `displayName` travels — and the engine gives it `flex: 0 0 auto`.\n * An authored flex hint on the instance still wins. The engine memorises no\n * block names: the block declares, the engine obeys.\n */\n sizing?: BlockSizing\n}\n\n/** The only sizing word the engine knows besides its default (fluid share). */\nexport type BlockSizing = 'intrinsic'\n\n/**\n * Block component registry — maps block type strings to React component implementations\n */\nexport type BlockComponentRegistry = Record<string, BlockComponent>\n"]}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Composition Rules
3
+ *
4
+ * CP7: Rules defining valid block compositions
5
+ *
6
+ * @module @pwfabric/core/blocks/composition-rules
7
+ */
8
+ import type { CompositionRule } from '@pwfabric/core';
9
+ /**
10
+ * Maximum nesting depth rule
11
+ *
12
+ * Prevents blocks from being nested too deeply.
13
+ */
14
+ export declare const maxDepthRule: CompositionRule;
15
+ /**
16
+ * Form children rule
17
+ *
18
+ * Forms can contain all form input elements plus structural/content blocks.
19
+ */
20
+ export declare const formChildrenRule: CompositionRule;
21
+ /**
22
+ * Grid children rule
23
+ *
24
+ * Grids cannot have nested grids as direct children.
25
+ */
26
+ export declare const gridChildrenRule: CompositionRule;
27
+ /**
28
+ * Button no children rule
29
+ *
30
+ * Buttons cannot have children.
31
+ */
32
+ export declare const buttonNoChildrenRule: CompositionRule;
33
+ /**
34
+ * Text no children rule
35
+ *
36
+ * Text blocks cannot have children.
37
+ */
38
+ export declare const textNoChildrenRule: CompositionRule;
39
+ /**
40
+ * Heading no children rule
41
+ *
42
+ * Heading blocks cannot have children.
43
+ */
44
+ export declare const headingNoChildrenRule: CompositionRule;
45
+ /**
46
+ * Image no children rule
47
+ *
48
+ * Image blocks cannot have children.
49
+ */
50
+ export declare const imageNoChildrenRule: CompositionRule;
51
+ /**
52
+ * Input no children rule
53
+ *
54
+ * Input blocks cannot have children.
55
+ */
56
+ export declare const inputNoChildrenRule: CompositionRule;
57
+ /**
58
+ * Input required parent rule
59
+ *
60
+ * Inputs should be inside forms or containers.
61
+ */
62
+ export declare const inputParentRule: CompositionRule;
63
+ /**
64
+ * Link no children rule
65
+ *
66
+ * Link blocks cannot have children.
67
+ */
68
+ export declare const linkNoChildrenRule: CompositionRule;
69
+ /**
70
+ * Icon no children rule
71
+ *
72
+ * Icon blocks cannot have children.
73
+ */
74
+ export declare const iconNoChildrenRule: CompositionRule;
75
+ /**
76
+ * Badge no children rule
77
+ *
78
+ * Badge blocks cannot have children.
79
+ */
80
+ export declare const badgeNoChildrenRule: CompositionRule;
81
+ /**
82
+ * Code no children rule
83
+ *
84
+ * Code blocks cannot have children.
85
+ */
86
+ export declare const codeNoChildrenRule: CompositionRule;
87
+ /**
88
+ * Divider no children rule
89
+ *
90
+ * Divider blocks cannot have children.
91
+ */
92
+ export declare const dividerNoChildrenRule: CompositionRule;
93
+ /**
94
+ * List no children rule
95
+ *
96
+ * List blocks cannot have children.
97
+ */
98
+ export declare const listNoChildrenRule: CompositionRule;
99
+ /**
100
+ * Table no children rule
101
+ *
102
+ * Table blocks cannot have children.
103
+ */
104
+ export declare const tableNoChildrenRule: CompositionRule;
105
+ /**
106
+ * Accordion no children rule
107
+ *
108
+ * Accordion items are defined via props, not children.
109
+ */
110
+ export declare const accordionNoChildrenRule: CompositionRule;
111
+ /**
112
+ * Dropdown no children rule
113
+ *
114
+ * Dropdown items are defined via props, not children.
115
+ */
116
+ export declare const dropdownNoChildrenRule: CompositionRule;
117
+ /**
118
+ * Avatar no children rule
119
+ *
120
+ * Avatar is a leaf block with no children.
121
+ */
122
+ export declare const avatarNoChildrenRule: CompositionRule;
123
+ /**
124
+ * Tooltip children rule
125
+ *
126
+ * Tooltip can wrap specific inline/interactive blocks.
127
+ */
128
+ export declare const tooltipChildrenRule: CompositionRule;
129
+ /**
130
+ * Tabs children rule
131
+ *
132
+ * Tabs can contain containers as tab panels.
133
+ */
134
+ export declare const tabsChildrenRule: CompositionRule;
135
+ /**
136
+ * Modal children rule
137
+ *
138
+ * Modal can contain layout and content blocks.
139
+ */
140
+ export declare const modalChildrenRule: CompositionRule;
141
+ /**
142
+ * No self nesting rule
143
+ *
144
+ * Blocks cannot be nested inside themselves.
145
+ */
146
+ export declare const noSelfNestingRule: CompositionRule;
147
+ /**
148
+ * All composition rules
149
+ */
150
+ export declare const compositionRules: readonly CompositionRule[];
151
+ /**
152
+ * Get rules that apply to a specific block type
153
+ *
154
+ * @param blockType - Block type to get rules for
155
+ * @returns Array of applicable rules
156
+ */
157
+ export declare function getRulesForBlockType(blockType: string): readonly CompositionRule[];
158
+ /**
159
+ * Get rules by type
160
+ *
161
+ * @param ruleType - Rule type to filter by
162
+ * @returns Array of matching rules
163
+ */
164
+ export declare function getRulesByType(ruleType: CompositionRule['type']): readonly CompositionRule[];
165
+ /** Allowed direct children of a tabs block */
166
+ export declare const TABS_ALLOWED_CHILDREN: Set<string>;
167
+ /** Allowed direct children of a form block */
168
+ export declare const FORM_ALLOWED_CHILDREN: Set<string>;
@@ -0,0 +1,391 @@
1
+ /**
2
+ * Composition Rules
3
+ *
4
+ * CP7: Rules defining valid block compositions
5
+ *
6
+ * @module @pwfabric/core/blocks/composition-rules
7
+ */
8
+ import { MAX_NESTING_DEPTH } from '@pwfabric/core';
9
+ // ============================================================
10
+ // BUILT-IN RULES
11
+ // ============================================================
12
+ /**
13
+ * Maximum nesting depth rule
14
+ *
15
+ * Prevents blocks from being nested too deeply.
16
+ */
17
+ export const maxDepthRule = {
18
+ type: 'max_depth',
19
+ description: `Blocks cannot be nested more than ${MAX_NESTING_DEPTH} levels deep`,
20
+ appliesTo: '*',
21
+ config: {
22
+ maxDepth: MAX_NESTING_DEPTH,
23
+ },
24
+ };
25
+ /**
26
+ * Form children rule
27
+ *
28
+ * Forms can contain all form input elements plus structural/content blocks.
29
+ */
30
+ export const formChildrenRule = {
31
+ type: 'allowed_children',
32
+ description: 'Forms can contain form input elements and structural/content blocks (text, heading, container, divider, button)',
33
+ appliesTo: 'form',
34
+ config: {
35
+ allowedChildren: [
36
+ // Form input elements — the form family of the first-party base pack as
37
+ // shipped, so every field a form pattern uses passes validation.
38
+ 'input',
39
+ 'textarea',
40
+ 'select',
41
+ 'checkbox',
42
+ 'radio',
43
+ 'toggle',
44
+ 'slider',
45
+ 'combobox',
46
+ 'date-input',
47
+ 'file-dropzone',
48
+ 'number-stepper',
49
+ 'otp-input',
50
+ 'rich-text-editor',
51
+ 'segmented-control',
52
+ 'tag-input',
53
+ // legacy names kept so older documents keep validating
54
+ 'switch',
55
+ 'file-upload',
56
+ // Structural / content blocks valid inside forms
57
+ 'button',
58
+ 'text',
59
+ 'heading',
60
+ 'container',
61
+ 'divider',
62
+ 'badge',
63
+ 'icon',
64
+ 'link',
65
+ 'alert',
66
+ ],
67
+ },
68
+ };
69
+ /**
70
+ * Grid children rule
71
+ *
72
+ * Grids cannot have nested grids as direct children.
73
+ */
74
+ export const gridChildrenRule = {
75
+ type: 'allowed_children',
76
+ description: 'Grids cannot contain other grids as direct children',
77
+ appliesTo: 'grid',
78
+ config: {
79
+ disallowedChildren: ['grid'],
80
+ },
81
+ };
82
+ /**
83
+ * Button no children rule
84
+ *
85
+ * Buttons cannot have children.
86
+ */
87
+ export const buttonNoChildrenRule = {
88
+ type: 'no_children',
89
+ description: 'Buttons cannot have children',
90
+ appliesTo: 'button',
91
+ config: {},
92
+ };
93
+ /**
94
+ * Text no children rule
95
+ *
96
+ * Text blocks cannot have children.
97
+ */
98
+ export const textNoChildrenRule = {
99
+ type: 'no_children',
100
+ description: 'Text blocks cannot have children',
101
+ appliesTo: 'text',
102
+ config: {},
103
+ };
104
+ /**
105
+ * Heading no children rule
106
+ *
107
+ * Heading blocks cannot have children.
108
+ */
109
+ export const headingNoChildrenRule = {
110
+ type: 'no_children',
111
+ description: 'Heading blocks cannot have children',
112
+ appliesTo: 'heading',
113
+ config: {},
114
+ };
115
+ /**
116
+ * Image no children rule
117
+ *
118
+ * Image blocks cannot have children.
119
+ */
120
+ export const imageNoChildrenRule = {
121
+ type: 'no_children',
122
+ description: 'Image blocks cannot have children',
123
+ appliesTo: 'image',
124
+ config: {},
125
+ };
126
+ /**
127
+ * Input no children rule
128
+ *
129
+ * Input blocks cannot have children.
130
+ */
131
+ export const inputNoChildrenRule = {
132
+ type: 'no_children',
133
+ description: 'Input blocks cannot have children',
134
+ appliesTo: 'input',
135
+ config: {},
136
+ };
137
+ /**
138
+ * Input required parent rule
139
+ *
140
+ * Inputs should be inside forms or containers.
141
+ */
142
+ export const inputParentRule = {
143
+ type: 'allowed_parents',
144
+ description: 'Inputs should be placed inside forms or containers',
145
+ appliesTo: 'input',
146
+ config: {
147
+ allowedParents: ['form', 'container'],
148
+ severity: 'warning',
149
+ },
150
+ };
151
+ /**
152
+ * Link no children rule
153
+ *
154
+ * Link blocks cannot have children.
155
+ */
156
+ export const linkNoChildrenRule = {
157
+ type: 'no_children',
158
+ description: 'Link blocks cannot have children',
159
+ appliesTo: 'link',
160
+ config: {},
161
+ };
162
+ /**
163
+ * Icon no children rule
164
+ *
165
+ * Icon blocks cannot have children.
166
+ */
167
+ export const iconNoChildrenRule = {
168
+ type: 'no_children',
169
+ description: 'Icon blocks cannot have children',
170
+ appliesTo: 'icon',
171
+ config: {},
172
+ };
173
+ /**
174
+ * Badge no children rule
175
+ *
176
+ * Badge blocks cannot have children.
177
+ */
178
+ export const badgeNoChildrenRule = {
179
+ type: 'no_children',
180
+ description: 'Badge blocks cannot have children',
181
+ appliesTo: 'badge',
182
+ config: {},
183
+ };
184
+ /**
185
+ * Code no children rule
186
+ *
187
+ * Code blocks cannot have children.
188
+ */
189
+ export const codeNoChildrenRule = {
190
+ type: 'no_children',
191
+ description: 'Code blocks cannot have children',
192
+ appliesTo: 'code',
193
+ config: {},
194
+ };
195
+ /**
196
+ * Divider no children rule
197
+ *
198
+ * Divider blocks cannot have children.
199
+ */
200
+ export const dividerNoChildrenRule = {
201
+ type: 'no_children',
202
+ description: 'Divider blocks cannot have children',
203
+ appliesTo: 'divider',
204
+ config: {},
205
+ };
206
+ /**
207
+ * List no children rule
208
+ *
209
+ * List blocks cannot have children.
210
+ */
211
+ export const listNoChildrenRule = {
212
+ type: 'no_children',
213
+ description: 'List blocks cannot have children',
214
+ appliesTo: 'list',
215
+ config: {},
216
+ };
217
+ /**
218
+ * Table no children rule
219
+ *
220
+ * Table blocks cannot have children.
221
+ */
222
+ export const tableNoChildrenRule = {
223
+ type: 'no_children',
224
+ description: 'Table blocks cannot have children',
225
+ appliesTo: 'table',
226
+ config: {},
227
+ };
228
+ // ============================================================
229
+ // INTERACTIVE BLOCK RULES
230
+ // ============================================================
231
+ /**
232
+ * Accordion no children rule
233
+ *
234
+ * Accordion items are defined via props, not children.
235
+ */
236
+ export const accordionNoChildrenRule = {
237
+ type: 'no_children',
238
+ description: 'Accordion items are defined via props, not as children blocks',
239
+ appliesTo: 'accordion',
240
+ config: {},
241
+ };
242
+ /**
243
+ * Dropdown no children rule
244
+ *
245
+ * Dropdown items are defined via props, not children.
246
+ */
247
+ export const dropdownNoChildrenRule = {
248
+ type: 'no_children',
249
+ description: 'Dropdown items are defined via props, not as children blocks',
250
+ appliesTo: 'dropdown',
251
+ config: {},
252
+ };
253
+ /**
254
+ * Avatar no children rule
255
+ *
256
+ * Avatar is a leaf block with no children.
257
+ */
258
+ export const avatarNoChildrenRule = {
259
+ type: 'no_children',
260
+ description: 'Avatar blocks cannot have children',
261
+ appliesTo: 'avatar',
262
+ config: {},
263
+ };
264
+ /**
265
+ * Tooltip children rule
266
+ *
267
+ * Tooltip can wrap specific inline/interactive blocks.
268
+ */
269
+ export const tooltipChildrenRule = {
270
+ type: 'allowed_children',
271
+ description: 'Tooltips can only wrap text, buttons, icons, badges, and links',
272
+ appliesTo: 'tooltip',
273
+ config: {
274
+ allowedChildren: ['text', 'button', 'icon', 'badge', 'link'],
275
+ },
276
+ };
277
+ /**
278
+ * Tabs children rule
279
+ *
280
+ * Tabs can contain containers as tab panels.
281
+ */
282
+ export const tabsChildrenRule = {
283
+ type: 'allowed_children',
284
+ description: 'Tabs can only contain containers as tab panel content',
285
+ appliesTo: 'tabs',
286
+ config: {
287
+ allowedChildren: ['container'],
288
+ },
289
+ };
290
+ /**
291
+ * Modal children rule
292
+ *
293
+ * Modal can contain layout and content blocks.
294
+ */
295
+ export const modalChildrenRule = {
296
+ type: 'allowed_children',
297
+ description: 'Modals can contain layout and content blocks',
298
+ appliesTo: 'modal',
299
+ config: {
300
+ allowedChildren: [
301
+ 'container',
302
+ 'grid',
303
+ 'text',
304
+ 'heading',
305
+ 'button',
306
+ 'image',
307
+ 'form',
308
+ 'input',
309
+ 'list',
310
+ 'table',
311
+ 'divider',
312
+ 'icon',
313
+ 'badge',
314
+ ],
315
+ },
316
+ };
317
+ /**
318
+ * No self nesting rule
319
+ *
320
+ * Blocks cannot be nested inside themselves.
321
+ */
322
+ export const noSelfNestingRule = {
323
+ type: 'no_self_nesting',
324
+ description: 'Blocks cannot be nested inside themselves',
325
+ appliesTo: '*',
326
+ config: {},
327
+ };
328
+ // ============================================================
329
+ // ALL RULES
330
+ // ============================================================
331
+ /**
332
+ * All composition rules
333
+ */
334
+ export const compositionRules = [
335
+ maxDepthRule,
336
+ formChildrenRule,
337
+ gridChildrenRule,
338
+ // Content blocks - no children
339
+ buttonNoChildrenRule,
340
+ textNoChildrenRule,
341
+ headingNoChildrenRule,
342
+ linkNoChildrenRule,
343
+ iconNoChildrenRule,
344
+ badgeNoChildrenRule,
345
+ codeNoChildrenRule,
346
+ dividerNoChildrenRule,
347
+ // Layout blocks - no children (leaf)
348
+ listNoChildrenRule,
349
+ tableNoChildrenRule,
350
+ // Media blocks - no children
351
+ imageNoChildrenRule,
352
+ // Form blocks - no children
353
+ inputNoChildrenRule,
354
+ inputParentRule,
355
+ // Interactive blocks
356
+ accordionNoChildrenRule,
357
+ dropdownNoChildrenRule,
358
+ avatarNoChildrenRule,
359
+ tooltipChildrenRule,
360
+ tabsChildrenRule,
361
+ modalChildrenRule,
362
+ // Universal rules
363
+ noSelfNestingRule,
364
+ ];
365
+ /**
366
+ * Get rules that apply to a specific block type
367
+ *
368
+ * @param blockType - Block type to get rules for
369
+ * @returns Array of applicable rules
370
+ */
371
+ export function getRulesForBlockType(blockType) {
372
+ return compositionRules.filter((rule) => rule.appliesTo === '*' || rule.appliesTo === blockType);
373
+ }
374
+ /**
375
+ * Get rules by type
376
+ *
377
+ * @param ruleType - Rule type to filter by
378
+ * @returns Array of matching rules
379
+ */
380
+ export function getRulesByType(ruleType) {
381
+ return compositionRules.filter((rule) => rule.type === ruleType);
382
+ }
383
+ // ============================================================
384
+ // CANONICAL CHILD SETS (single source of truth)
385
+ // Import these in API validator instead of redeclaring.
386
+ // ============================================================
387
+ /** Allowed direct children of a tabs block */
388
+ export const TABS_ALLOWED_CHILDREN = new Set(tabsChildrenRule.config.allowedChildren);
389
+ /** Allowed direct children of a form block */
390
+ export const FORM_ALLOWED_CHILDREN = new Set(formChildrenRule.config.allowedChildren);
391
+ //# sourceMappingURL=composition-rules.js.map