@pwfabric/runtime 0.0.0-stage → 1.0.0-rc.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 (603) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +13 -2
  3. package/dist/__tests__/dom-test-setup.d.ts +21 -0
  4. package/dist/__tests__/dom-test-setup.d.ts.map +1 -0
  5. package/dist/__tests__/dom-test-setup.js +36 -0
  6. package/dist/__tests__/dom-test-setup.js.map +1 -0
  7. package/dist/a11y/announcer.d.ts +66 -0
  8. package/dist/a11y/announcer.d.ts.map +1 -0
  9. package/dist/a11y/announcer.js +140 -0
  10. package/dist/a11y/announcer.js.map +1 -0
  11. package/dist/a11y/contrast.d.ts +55 -0
  12. package/dist/a11y/contrast.d.ts.map +1 -0
  13. package/dist/a11y/contrast.js +93 -0
  14. package/dist/a11y/contrast.js.map +1 -0
  15. package/dist/a11y/focus.d.ts +124 -0
  16. package/dist/a11y/focus.d.ts.map +1 -0
  17. package/dist/a11y/focus.js +282 -0
  18. package/dist/a11y/focus.js.map +1 -0
  19. package/dist/a11y/index.d.ts +22 -0
  20. package/dist/a11y/index.d.ts.map +1 -0
  21. package/dist/a11y/index.js +18 -0
  22. package/dist/a11y/index.js.map +1 -0
  23. package/dist/a11y/keyboard.d.ts +145 -0
  24. package/dist/a11y/keyboard.d.ts.map +1 -0
  25. package/dist/a11y/keyboard.js +317 -0
  26. package/dist/a11y/keyboard.js.map +1 -0
  27. package/dist/adapters/default-image.d.ts +26 -0
  28. package/dist/adapters/default-image.d.ts.map +1 -0
  29. package/dist/adapters/default-image.js +37 -0
  30. package/dist/adapters/default-image.js.map +1 -0
  31. package/dist/adapters/index.d.ts +28 -0
  32. package/dist/adapters/index.d.ts.map +1 -0
  33. package/dist/adapters/index.js +28 -0
  34. package/dist/adapters/index.js.map +1 -0
  35. package/dist/adapters/next-image.d.ts +39 -0
  36. package/dist/adapters/next-image.d.ts.map +1 -0
  37. package/dist/adapters/next-image.js +124 -0
  38. package/dist/adapters/next-image.js.map +1 -0
  39. package/dist/adapters/types.d.ts +62 -0
  40. package/dist/adapters/types.d.ts.map +1 -0
  41. package/dist/adapters/types.js +11 -0
  42. package/dist/adapters/types.js.map +1 -0
  43. package/dist/analytics/index.d.ts +15 -0
  44. package/dist/analytics/index.d.ts.map +1 -0
  45. package/dist/analytics/index.js +15 -0
  46. package/dist/analytics/index.js.map +1 -0
  47. package/dist/analytics/tracker.d.ts +66 -0
  48. package/dist/analytics/tracker.d.ts.map +1 -0
  49. package/dist/analytics/tracker.js +251 -0
  50. package/dist/analytics/tracker.js.map +1 -0
  51. package/dist/analytics/types.d.ts +131 -0
  52. package/dist/analytics/types.d.ts.map +1 -0
  53. package/dist/analytics/types.js +11 -0
  54. package/dist/analytics/types.js.map +1 -0
  55. package/dist/auth/index.d.ts +16 -0
  56. package/dist/auth/index.d.ts.map +1 -0
  57. package/dist/auth/index.js +14 -0
  58. package/dist/auth/index.js.map +1 -0
  59. package/dist/auth/provider.d.ts +133 -0
  60. package/dist/auth/provider.d.ts.map +1 -0
  61. package/dist/auth/provider.js +473 -0
  62. package/dist/auth/provider.js.map +1 -0
  63. package/dist/auth/types.d.ts +118 -0
  64. package/dist/auth/types.d.ts.map +1 -0
  65. package/dist/auth/types.js +9 -0
  66. package/dist/auth/types.js.map +1 -0
  67. package/dist/binding/collection.d.ts +191 -0
  68. package/dist/binding/collection.d.ts.map +1 -0
  69. package/dist/binding/collection.js +358 -0
  70. package/dist/binding/collection.js.map +1 -0
  71. package/dist/binding/datasource.d.ts +320 -0
  72. package/dist/binding/datasource.d.ts.map +1 -0
  73. package/dist/binding/datasource.js +556 -0
  74. package/dist/binding/datasource.js.map +1 -0
  75. package/dist/binding/engine.d.ts +66 -0
  76. package/dist/binding/engine.d.ts.map +1 -0
  77. package/dist/binding/engine.js +268 -0
  78. package/dist/binding/engine.js.map +1 -0
  79. package/dist/binding/expression.d.ts +151 -0
  80. package/dist/binding/expression.d.ts.map +1 -0
  81. package/dist/binding/expression.js +787 -0
  82. package/dist/binding/expression.js.map +1 -0
  83. package/dist/binding/index.d.ts +20 -0
  84. package/dist/binding/index.d.ts.map +1 -0
  85. package/dist/binding/index.js +14 -0
  86. package/dist/binding/index.js.map +1 -0
  87. package/dist/binding/two-way.d.ts +150 -0
  88. package/dist/binding/two-way.d.ts.map +1 -0
  89. package/dist/binding/two-way.js +462 -0
  90. package/dist/binding/two-way.js.map +1 -0
  91. package/dist/binding/types.d.ts +120 -0
  92. package/dist/binding/types.d.ts.map +1 -0
  93. package/dist/binding/types.js +9 -0
  94. package/dist/binding/types.js.map +1 -0
  95. package/dist/blocks/__test-fixtures__/block-fixtures.d.ts +40 -0
  96. package/dist/blocks/__test-fixtures__/block-fixtures.d.ts.map +1 -0
  97. package/dist/blocks/__test-fixtures__/block-fixtures.js +506 -0
  98. package/dist/blocks/__test-fixtures__/block-fixtures.js.map +1 -0
  99. package/dist/blocks/component-types.d.ts +82 -0
  100. package/dist/blocks/component-types.d.ts.map +1 -0
  101. package/dist/blocks/component-types.js +11 -0
  102. package/dist/blocks/component-types.js.map +1 -0
  103. package/dist/blocks/composition-rules.d.ts +169 -0
  104. package/dist/blocks/composition-rules.d.ts.map +1 -0
  105. package/dist/blocks/composition-rules.js +391 -0
  106. package/dist/blocks/composition-rules.js.map +1 -0
  107. package/dist/blocks/hooks.d.ts +32 -0
  108. package/dist/blocks/hooks.d.ts.map +1 -0
  109. package/dist/blocks/hooks.js +42 -0
  110. package/dist/blocks/hooks.js.map +1 -0
  111. package/dist/blocks/index.d.ts +16 -0
  112. package/dist/blocks/index.d.ts.map +1 -0
  113. package/dist/blocks/index.js +24 -0
  114. package/dist/blocks/index.js.map +1 -0
  115. package/dist/blocks/registry.d.ts +85 -0
  116. package/dist/blocks/registry.d.ts.map +1 -0
  117. package/dist/blocks/registry.js +136 -0
  118. package/dist/blocks/registry.js.map +1 -0
  119. package/dist/blocks/rule-engine.d.ts +132 -0
  120. package/dist/blocks/rule-engine.d.ts.map +1 -0
  121. package/dist/blocks/rule-engine.js +321 -0
  122. package/dist/blocks/rule-engine.js.map +1 -0
  123. package/dist/blocks/surface-event-context.d.ts +14 -0
  124. package/dist/blocks/surface-event-context.d.ts.map +1 -0
  125. package/dist/blocks/surface-event-context.js +14 -0
  126. package/dist/blocks/surface-event-context.js.map +1 -0
  127. package/dist/blocks/surface-id-context.d.ts +14 -0
  128. package/dist/blocks/surface-id-context.d.ts.map +1 -0
  129. package/dist/blocks/surface-id-context.js +15 -0
  130. package/dist/blocks/surface-id-context.js.map +1 -0
  131. package/dist/bus.d.ts +42 -0
  132. package/dist/bus.d.ts.map +1 -0
  133. package/dist/bus.js +158 -0
  134. package/dist/bus.js.map +1 -0
  135. package/dist/cache/index.d.ts +10 -0
  136. package/dist/cache/index.d.ts.map +1 -0
  137. package/dist/cache/index.js +10 -0
  138. package/dist/cache/index.js.map +1 -0
  139. package/dist/cache/memory.d.ts +33 -0
  140. package/dist/cache/memory.d.ts.map +1 -0
  141. package/dist/cache/memory.js +138 -0
  142. package/dist/cache/memory.js.map +1 -0
  143. package/dist/cache/types.d.ts +63 -0
  144. package/dist/cache/types.d.ts.map +1 -0
  145. package/dist/cache/types.js +9 -0
  146. package/dist/cache/types.js.map +1 -0
  147. package/dist/capability/index.d.ts +73 -0
  148. package/dist/capability/index.d.ts.map +1 -0
  149. package/dist/capability/index.js +87 -0
  150. package/dist/capability/index.js.map +1 -0
  151. package/dist/capability/kernel-capabilities.d.ts +32 -0
  152. package/dist/capability/kernel-capabilities.d.ts.map +1 -0
  153. package/dist/capability/kernel-capabilities.js +36 -0
  154. package/dist/capability/kernel-capabilities.js.map +1 -0
  155. package/dist/capability/platform-capabilities.d.ts +72 -0
  156. package/dist/capability/platform-capabilities.d.ts.map +1 -0
  157. package/dist/capability/platform-capabilities.js +267 -0
  158. package/dist/capability/platform-capabilities.js.map +1 -0
  159. package/dist/capability/type-mapping.d.ts +71 -0
  160. package/dist/capability/type-mapping.d.ts.map +1 -0
  161. package/dist/capability/type-mapping.js +107 -0
  162. package/dist/capability/type-mapping.js.map +1 -0
  163. package/dist/capability/validation.d.ts +47 -0
  164. package/dist/capability/validation.d.ts.map +1 -0
  165. package/dist/capability/validation.js +54 -0
  166. package/dist/capability/validation.js.map +1 -0
  167. package/dist/connectors/declared-connector.d.ts +49 -0
  168. package/dist/connectors/declared-connector.d.ts.map +1 -0
  169. package/dist/connectors/declared-connector.js +333 -0
  170. package/dist/connectors/declared-connector.js.map +1 -0
  171. package/dist/connectors/engine-registry.d.ts +51 -0
  172. package/dist/connectors/engine-registry.d.ts.map +1 -0
  173. package/dist/connectors/engine-registry.js +135 -0
  174. package/dist/connectors/engine-registry.js.map +1 -0
  175. package/dist/connectors/index.d.ts +15 -0
  176. package/dist/connectors/index.d.ts.map +1 -0
  177. package/dist/connectors/index.js +14 -0
  178. package/dist/connectors/index.js.map +1 -0
  179. package/dist/connectors/module-loader.d.ts +71 -0
  180. package/dist/connectors/module-loader.d.ts.map +1 -0
  181. package/dist/connectors/module-loader.js +143 -0
  182. package/dist/connectors/module-loader.js.map +1 -0
  183. package/dist/connectors/types.d.ts +175 -0
  184. package/dist/connectors/types.d.ts.map +1 -0
  185. package/dist/connectors/types.js +23 -0
  186. package/dist/connectors/types.js.map +1 -0
  187. package/dist/context.d.ts +28 -0
  188. package/dist/context.d.ts.map +1 -0
  189. package/dist/context.js +38 -0
  190. package/dist/context.js.map +1 -0
  191. package/dist/data/DataCapabilityProvider.d.ts +40 -0
  192. package/dist/data/DataCapabilityProvider.d.ts.map +1 -0
  193. package/dist/data/DataCapabilityProvider.js +58 -0
  194. package/dist/data/DataCapabilityProvider.js.map +1 -0
  195. package/dist/data/index.d.ts +18 -0
  196. package/dist/data/index.d.ts.map +1 -0
  197. package/dist/data/index.js +18 -0
  198. package/dist/data/index.js.map +1 -0
  199. package/dist/data/manager.d.ts +41 -0
  200. package/dist/data/manager.d.ts.map +1 -0
  201. package/dist/data/manager.js +442 -0
  202. package/dist/data/manager.js.map +1 -0
  203. package/dist/data/types.d.ts +219 -0
  204. package/dist/data/types.d.ts.map +1 -0
  205. package/dist/data/types.js +2 -0
  206. package/dist/data/types.js.map +1 -0
  207. package/dist/entity/aggregate.d.ts +9 -0
  208. package/dist/entity/aggregate.d.ts.map +1 -0
  209. package/dist/entity/aggregate.js +24 -0
  210. package/dist/entity/aggregate.js.map +1 -0
  211. package/dist/entity/apply-query.d.ts +59 -0
  212. package/dist/entity/apply-query.d.ts.map +1 -0
  213. package/dist/entity/apply-query.js +264 -0
  214. package/dist/entity/apply-query.js.map +1 -0
  215. package/dist/entity/behavior.d.ts +95 -0
  216. package/dist/entity/behavior.d.ts.map +1 -0
  217. package/dist/entity/behavior.js +78 -0
  218. package/dist/entity/behavior.js.map +1 -0
  219. package/dist/entity/connector.d.ts +142 -0
  220. package/dist/entity/connector.d.ts.map +1 -0
  221. package/dist/entity/connector.js +89 -0
  222. package/dist/entity/connector.js.map +1 -0
  223. package/dist/entity/connectors/index.d.ts +13 -0
  224. package/dist/entity/connectors/index.d.ts.map +1 -0
  225. package/dist/entity/connectors/index.js +11 -0
  226. package/dist/entity/connectors/index.js.map +1 -0
  227. package/dist/entity/connectors/static.d.ts +52 -0
  228. package/dist/entity/connectors/static.d.ts.map +1 -0
  229. package/dist/entity/connectors/static.js +245 -0
  230. package/dist/entity/connectors/static.js.map +1 -0
  231. package/dist/entity/entity-datasource.d.ts +51 -0
  232. package/dist/entity/entity-datasource.d.ts.map +1 -0
  233. package/dist/entity/entity-datasource.js +33 -0
  234. package/dist/entity/entity-datasource.js.map +1 -0
  235. package/dist/entity/facade.d.ts +71 -0
  236. package/dist/entity/facade.d.ts.map +1 -0
  237. package/dist/entity/facade.js +70 -0
  238. package/dist/entity/facade.js.map +1 -0
  239. package/dist/entity/http-connector.d.ts +124 -0
  240. package/dist/entity/http-connector.d.ts.map +1 -0
  241. package/dist/entity/http-connector.js +295 -0
  242. package/dist/entity/http-connector.js.map +1 -0
  243. package/dist/entity/index.d.ts +39 -0
  244. package/dist/entity/index.d.ts.map +1 -0
  245. package/dist/entity/index.js +31 -0
  246. package/dist/entity/index.js.map +1 -0
  247. package/dist/entity/postgres-connector.d.ts +65 -0
  248. package/dist/entity/postgres-connector.d.ts.map +1 -0
  249. package/dist/entity/postgres-connector.js +239 -0
  250. package/dist/entity/postgres-connector.js.map +1 -0
  251. package/dist/entity/registry.d.ts +60 -0
  252. package/dist/entity/registry.d.ts.map +1 -0
  253. package/dist/entity/registry.js +90 -0
  254. package/dist/entity/registry.js.map +1 -0
  255. package/dist/entity/store.d.ts +67 -0
  256. package/dist/entity/store.d.ts.map +1 -0
  257. package/dist/entity/store.js +349 -0
  258. package/dist/entity/store.js.map +1 -0
  259. package/dist/entity/types.d.ts +181 -0
  260. package/dist/entity/types.d.ts.map +1 -0
  261. package/dist/entity/types.js +10 -0
  262. package/dist/entity/types.js.map +1 -0
  263. package/dist/execution-context.d.ts +89 -0
  264. package/dist/execution-context.d.ts.map +1 -0
  265. package/dist/execution-context.js +146 -0
  266. package/dist/execution-context.js.map +1 -0
  267. package/dist/executor.d.ts +28 -0
  268. package/dist/executor.d.ts.map +1 -0
  269. package/dist/executor.js +33 -0
  270. package/dist/executor.js.map +1 -0
  271. package/dist/forms/form-entity-bridge.d.ts +95 -0
  272. package/dist/forms/form-entity-bridge.d.ts.map +1 -0
  273. package/dist/forms/form-entity-bridge.js +96 -0
  274. package/dist/forms/form-entity-bridge.js.map +1 -0
  275. package/dist/forms/form-write-target.d.ts +35 -0
  276. package/dist/forms/form-write-target.d.ts.map +1 -0
  277. package/dist/forms/form-write-target.js +81 -0
  278. package/dist/forms/form-write-target.js.map +1 -0
  279. package/dist/forms/index.d.ts +23 -0
  280. package/dist/forms/index.d.ts.map +1 -0
  281. package/dist/forms/index.js +25 -0
  282. package/dist/forms/index.js.map +1 -0
  283. package/dist/forms/named-control-values.d.ts +28 -0
  284. package/dist/forms/named-control-values.d.ts.map +1 -0
  285. package/dist/forms/named-control-values.js +42 -0
  286. package/dist/forms/named-control-values.js.map +1 -0
  287. package/dist/forms/processor.d.ts +56 -0
  288. package/dist/forms/processor.d.ts.map +1 -0
  289. package/dist/forms/processor.js +154 -0
  290. package/dist/forms/processor.js.map +1 -0
  291. package/dist/forms/types.d.ts +175 -0
  292. package/dist/forms/types.d.ts.map +1 -0
  293. package/dist/forms/types.js +33 -0
  294. package/dist/forms/types.js.map +1 -0
  295. package/dist/forms/validator.d.ts +62 -0
  296. package/dist/forms/validator.d.ts.map +1 -0
  297. package/dist/forms/validator.js +218 -0
  298. package/dist/forms/validator.js.map +1 -0
  299. package/dist/graph/index.d.ts +11 -0
  300. package/dist/graph/index.d.ts.map +1 -0
  301. package/dist/graph/index.js +9 -0
  302. package/dist/graph/index.js.map +1 -0
  303. package/dist/graph/resolver.d.ts +67 -0
  304. package/dist/graph/resolver.d.ts.map +1 -0
  305. package/dist/graph/resolver.js +243 -0
  306. package/dist/graph/resolver.js.map +1 -0
  307. package/dist/graph/types.d.ts +126 -0
  308. package/dist/graph/types.d.ts.map +1 -0
  309. package/dist/graph/types.js +9 -0
  310. package/dist/graph/types.js.map +1 -0
  311. package/dist/hooks/useInstalledAtoms.d.ts +97 -0
  312. package/dist/hooks/useInstalledAtoms.d.ts.map +1 -0
  313. package/dist/hooks/useInstalledAtoms.js +92 -0
  314. package/dist/hooks/useInstalledAtoms.js.map +1 -0
  315. package/dist/i18n/index.d.ts +16 -0
  316. package/dist/i18n/index.d.ts.map +1 -0
  317. package/dist/i18n/index.js +14 -0
  318. package/dist/i18n/index.js.map +1 -0
  319. package/dist/i18n/translator.d.ts +77 -0
  320. package/dist/i18n/translator.d.ts.map +1 -0
  321. package/dist/i18n/translator.js +357 -0
  322. package/dist/i18n/translator.js.map +1 -0
  323. package/dist/i18n/types.d.ts +94 -0
  324. package/dist/i18n/types.d.ts.map +1 -0
  325. package/dist/i18n/types.js +9 -0
  326. package/dist/i18n/types.js.map +1 -0
  327. package/dist/index.d.ts +65 -0
  328. package/dist/index.d.ts.map +1 -0
  329. package/dist/index.js +95 -0
  330. package/dist/index.js.map +1 -0
  331. package/dist/kernel.d.ts +48 -0
  332. package/dist/kernel.d.ts.map +1 -0
  333. package/dist/kernel.js +258 -0
  334. package/dist/kernel.js.map +1 -0
  335. package/dist/perf/budget.d.ts +93 -0
  336. package/dist/perf/budget.d.ts.map +1 -0
  337. package/dist/perf/budget.js +122 -0
  338. package/dist/perf/budget.js.map +1 -0
  339. package/dist/perf/index.d.ts +17 -0
  340. package/dist/perf/index.d.ts.map +1 -0
  341. package/dist/perf/index.js +13 -0
  342. package/dist/perf/index.js.map +1 -0
  343. package/dist/perf/render-timer.d.ts +91 -0
  344. package/dist/perf/render-timer.d.ts.map +1 -0
  345. package/dist/perf/render-timer.js +136 -0
  346. package/dist/perf/render-timer.js.map +1 -0
  347. package/dist/perf/reporter.d.ts +127 -0
  348. package/dist/perf/reporter.d.ts.map +1 -0
  349. package/dist/perf/reporter.js +241 -0
  350. package/dist/perf/reporter.js.map +1 -0
  351. package/dist/perf/web-vitals.d.ts +112 -0
  352. package/dist/perf/web-vitals.d.ts.map +1 -0
  353. package/dist/perf/web-vitals.js +268 -0
  354. package/dist/perf/web-vitals.js.map +1 -0
  355. package/dist/registry.d.ts +64 -0
  356. package/dist/registry.d.ts.map +1 -0
  357. package/dist/registry.js +126 -0
  358. package/dist/registry.js.map +1 -0
  359. package/dist/render/BehaviorSurfaceProvider.d.ts +66 -0
  360. package/dist/render/BehaviorSurfaceProvider.d.ts.map +1 -0
  361. package/dist/render/BehaviorSurfaceProvider.js +185 -0
  362. package/dist/render/BehaviorSurfaceProvider.js.map +1 -0
  363. package/dist/render/BlockErrorBoundary.d.ts +27 -0
  364. package/dist/render/BlockErrorBoundary.d.ts.map +1 -0
  365. package/dist/render/BlockErrorBoundary.js +41 -0
  366. package/dist/render/BlockErrorBoundary.js.map +1 -0
  367. package/dist/render/DataBoundSurfaceRenderer.d.ts +79 -0
  368. package/dist/render/DataBoundSurfaceRenderer.d.ts.map +1 -0
  369. package/dist/render/DataBoundSurfaceRenderer.js +998 -0
  370. package/dist/render/DataBoundSurfaceRenderer.js.map +1 -0
  371. package/dist/render/DynamicBlockWrapper.d.ts +24 -0
  372. package/dist/render/DynamicBlockWrapper.d.ts.map +1 -0
  373. package/dist/render/DynamicBlockWrapper.js +117 -0
  374. package/dist/render/DynamicBlockWrapper.js.map +1 -0
  375. package/dist/render/appearance-resolver.d.ts +51 -0
  376. package/dist/render/appearance-resolver.d.ts.map +1 -0
  377. package/dist/render/appearance-resolver.js +78 -0
  378. package/dist/render/appearance-resolver.js.map +1 -0
  379. package/dist/render/capability-gate.d.ts +70 -0
  380. package/dist/render/capability-gate.d.ts.map +1 -0
  381. package/dist/render/capability-gate.js +94 -0
  382. package/dist/render/capability-gate.js.map +1 -0
  383. package/dist/render/conditional-states-css.d.ts +42 -0
  384. package/dist/render/conditional-states-css.d.ts.map +1 -0
  385. package/dist/render/conditional-states-css.js +82 -0
  386. package/dist/render/conditional-states-css.js.map +1 -0
  387. package/dist/render/connections-context.d.ts +32 -0
  388. package/dist/render/connections-context.d.ts.map +1 -0
  389. package/dist/render/connections-context.js +34 -0
  390. package/dist/render/connections-context.js.map +1 -0
  391. package/dist/render/dark-theme-css.d.ts +37 -0
  392. package/dist/render/dark-theme-css.d.ts.map +1 -0
  393. package/dist/render/dark-theme-css.js +67 -0
  394. package/dist/render/dark-theme-css.js.map +1 -0
  395. package/dist/render/data-binding-types.d.ts +192 -0
  396. package/dist/render/data-binding-types.d.ts.map +1 -0
  397. package/dist/render/data-binding-types.js +11 -0
  398. package/dist/render/data-binding-types.js.map +1 -0
  399. package/dist/render/data-cache.d.ts +31 -0
  400. package/dist/render/data-cache.d.ts.map +1 -0
  401. package/dist/render/data-cache.js +37 -0
  402. package/dist/render/data-cache.js.map +1 -0
  403. package/dist/render/derive-dark-theme.d.ts +18 -0
  404. package/dist/render/derive-dark-theme.d.ts.map +1 -0
  405. package/dist/render/derive-dark-theme.js +18 -0
  406. package/dist/render/derive-dark-theme.js.map +1 -0
  407. package/dist/render/dynamic-artifact-context.d.ts +78 -0
  408. package/dist/render/dynamic-artifact-context.d.ts.map +1 -0
  409. package/dist/render/dynamic-artifact-context.js +89 -0
  410. package/dist/render/dynamic-artifact-context.js.map +1 -0
  411. package/dist/render/dynamic-block-loader.d.ts +81 -0
  412. package/dist/render/dynamic-block-loader.d.ts.map +1 -0
  413. package/dist/render/dynamic-block-loader.js +197 -0
  414. package/dist/render/dynamic-block-loader.js.map +1 -0
  415. package/dist/render/endpoint.d.ts +19 -0
  416. package/dist/render/endpoint.d.ts.map +1 -0
  417. package/dist/render/endpoint.js +109 -0
  418. package/dist/render/endpoint.js.map +1 -0
  419. package/dist/render/entity-facade-context.d.ts +35 -0
  420. package/dist/render/entity-facade-context.d.ts.map +1 -0
  421. package/dist/render/entity-facade-context.js +37 -0
  422. package/dist/render/entity-facade-context.js.map +1 -0
  423. package/dist/render/group-states-css.d.ts +42 -0
  424. package/dist/render/group-states-css.d.ts.map +1 -0
  425. package/dist/render/group-states-css.js +73 -0
  426. package/dist/render/group-states-css.js.map +1 -0
  427. package/dist/render/hooks/useSurfaceEvents.d.ts +9 -0
  428. package/dist/render/hooks/useSurfaceEvents.d.ts.map +1 -0
  429. package/dist/render/hooks/useSurfaceEvents.js +9 -0
  430. package/dist/render/hooks/useSurfaceEvents.js.map +1 -0
  431. package/dist/render/hooks/useSurfaceId.d.ts +9 -0
  432. package/dist/render/hooks/useSurfaceId.d.ts.map +1 -0
  433. package/dist/render/hooks/useSurfaceId.js +9 -0
  434. package/dist/render/hooks/useSurfaceId.js.map +1 -0
  435. package/dist/render/index.d.ts +49 -0
  436. package/dist/render/index.d.ts.map +1 -0
  437. package/dist/render/index.js +61 -0
  438. package/dist/render/index.js.map +1 -0
  439. package/dist/render/interaction-rule-engine.d.ts +13 -0
  440. package/dist/render/interaction-rule-engine.d.ts.map +1 -0
  441. package/dist/render/interaction-rule-engine.js +47 -0
  442. package/dist/render/interaction-rule-engine.js.map +1 -0
  443. package/dist/render/keyframes-css.d.ts +32 -0
  444. package/dist/render/keyframes-css.d.ts.map +1 -0
  445. package/dist/render/keyframes-css.js +44 -0
  446. package/dist/render/keyframes-css.js.map +1 -0
  447. package/dist/render/query-state.d.ts +4 -0
  448. package/dist/render/query-state.d.ts.map +1 -0
  449. package/dist/render/query-state.js +70 -0
  450. package/dist/render/query-state.js.map +1 -0
  451. package/dist/render/renderer.d.ts +45 -0
  452. package/dist/render/renderer.d.ts.map +1 -0
  453. package/dist/render/renderer.js +937 -0
  454. package/dist/render/renderer.js.map +1 -0
  455. package/dist/render/resolve-expressions.d.ts +38 -0
  456. package/dist/render/resolve-expressions.d.ts.map +1 -0
  457. package/dist/render/resolve-expressions.js +309 -0
  458. package/dist/render/resolve-expressions.js.map +1 -0
  459. package/dist/render/responsive-style-css.d.ts +43 -0
  460. package/dist/render/responsive-style-css.d.ts.map +1 -0
  461. package/dist/render/responsive-style-css.js +123 -0
  462. package/dist/render/responsive-style-css.js.map +1 -0
  463. package/dist/render/responsive.d.ts +50 -0
  464. package/dist/render/responsive.d.ts.map +1 -0
  465. package/dist/render/responsive.js +99 -0
  466. package/dist/render/responsive.js.map +1 -0
  467. package/dist/render/scoped-css.d.ts +72 -0
  468. package/dist/render/scoped-css.d.ts.map +1 -0
  469. package/dist/render/scoped-css.js +102 -0
  470. package/dist/render/scoped-css.js.map +1 -0
  471. package/dist/render/shell-selection.d.ts +70 -0
  472. package/dist/render/shell-selection.d.ts.map +1 -0
  473. package/dist/render/shell-selection.js +117 -0
  474. package/dist/render/shell-selection.js.map +1 -0
  475. package/dist/render/states-css.d.ts +33 -0
  476. package/dist/render/states-css.d.ts.map +1 -0
  477. package/dist/render/states-css.js +63 -0
  478. package/dist/render/states-css.js.map +1 -0
  479. package/dist/render/surface-data-context.d.ts +19 -0
  480. package/dist/render/surface-data-context.d.ts.map +1 -0
  481. package/dist/render/surface-data-context.js +21 -0
  482. package/dist/render/surface-data-context.js.map +1 -0
  483. package/dist/render/surface-event-bus.d.ts +20 -0
  484. package/dist/render/surface-event-bus.d.ts.map +1 -0
  485. package/dist/render/surface-event-bus.js +68 -0
  486. package/dist/render/surface-event-bus.js.map +1 -0
  487. package/dist/render/surface-event-context.d.ts +12 -0
  488. package/dist/render/surface-event-context.d.ts.map +1 -0
  489. package/dist/render/surface-event-context.js +12 -0
  490. package/dist/render/surface-event-context.js.map +1 -0
  491. package/dist/render/surface-id-context.d.ts +9 -0
  492. package/dist/render/surface-id-context.d.ts.map +1 -0
  493. package/dist/render/surface-id-context.js +9 -0
  494. package/dist/render/surface-id-context.js.map +1 -0
  495. package/dist/render/theme-utils.d.ts +15 -0
  496. package/dist/render/theme-utils.d.ts.map +1 -0
  497. package/dist/render/theme-utils.js +15 -0
  498. package/dist/render/theme-utils.js.map +1 -0
  499. package/dist/render/types.d.ts +283 -0
  500. package/dist/render/types.d.ts.map +1 -0
  501. package/dist/render/types.js +9 -0
  502. package/dist/render/types.js.map +1 -0
  503. package/dist/render/visibility-css.d.ts +43 -0
  504. package/dist/render/visibility-css.d.ts.map +1 -0
  505. package/dist/render/visibility-css.js +119 -0
  506. package/dist/render/visibility-css.js.map +1 -0
  507. package/dist/render/width-scope.d.ts +35 -0
  508. package/dist/render/width-scope.d.ts.map +1 -0
  509. package/dist/render/width-scope.js +44 -0
  510. package/dist/render/width-scope.js.map +1 -0
  511. package/dist/render/write-only-sources.d.ts +34 -0
  512. package/dist/render/write-only-sources.d.ts.map +1 -0
  513. package/dist/render/write-only-sources.js +99 -0
  514. package/dist/render/write-only-sources.js.map +1 -0
  515. package/dist/routing/index.d.ts +15 -0
  516. package/dist/routing/index.d.ts.map +1 -0
  517. package/dist/routing/index.js +15 -0
  518. package/dist/routing/index.js.map +1 -0
  519. package/dist/routing/router.d.ts +43 -0
  520. package/dist/routing/router.d.ts.map +1 -0
  521. package/dist/routing/router.js +218 -0
  522. package/dist/routing/router.js.map +1 -0
  523. package/dist/routing/types.d.ts +125 -0
  524. package/dist/routing/types.d.ts.map +1 -0
  525. package/dist/routing/types.js +9 -0
  526. package/dist/routing/types.js.map +1 -0
  527. package/dist/seo/generator.d.ts +40 -0
  528. package/dist/seo/generator.d.ts.map +1 -0
  529. package/dist/seo/generator.js +236 -0
  530. package/dist/seo/generator.js.map +1 -0
  531. package/dist/seo/index.d.ts +15 -0
  532. package/dist/seo/index.d.ts.map +1 -0
  533. package/dist/seo/index.js +15 -0
  534. package/dist/seo/index.js.map +1 -0
  535. package/dist/seo/types.d.ts +182 -0
  536. package/dist/seo/types.d.ts.map +1 -0
  537. package/dist/seo/types.js +9 -0
  538. package/dist/seo/types.js.map +1 -0
  539. package/dist/state/index.d.ts +16 -0
  540. package/dist/state/index.d.ts.map +1 -0
  541. package/dist/state/index.js +16 -0
  542. package/dist/state/index.js.map +1 -0
  543. package/dist/state/manager.d.ts +34 -0
  544. package/dist/state/manager.d.ts.map +1 -0
  545. package/dist/state/manager.js +81 -0
  546. package/dist/state/manager.js.map +1 -0
  547. package/dist/state/store.d.ts +41 -0
  548. package/dist/state/store.d.ts.map +1 -0
  549. package/dist/state/store.js +145 -0
  550. package/dist/state/store.js.map +1 -0
  551. package/dist/state/types.d.ts +108 -0
  552. package/dist/state/types.d.ts.map +1 -0
  553. package/dist/state/types.js +9 -0
  554. package/dist/state/types.js.map +1 -0
  555. package/dist/surface/expression.d.ts +66 -0
  556. package/dist/surface/expression.d.ts.map +1 -0
  557. package/dist/surface/expression.js +179 -0
  558. package/dist/surface/expression.js.map +1 -0
  559. package/dist/surface/index.d.ts +33 -0
  560. package/dist/surface/index.d.ts.map +1 -0
  561. package/dist/surface/index.js +25 -0
  562. package/dist/surface/index.js.map +1 -0
  563. package/dist/surface/interpreter.d.ts +97 -0
  564. package/dist/surface/interpreter.d.ts.map +1 -0
  565. package/dist/surface/interpreter.js +231 -0
  566. package/dist/surface/interpreter.js.map +1 -0
  567. package/dist/surface/layout.d.ts +55 -0
  568. package/dist/surface/layout.d.ts.map +1 -0
  569. package/dist/surface/layout.js +288 -0
  570. package/dist/surface/layout.js.map +1 -0
  571. package/dist/surface/output.d.ts +91 -0
  572. package/dist/surface/output.d.ts.map +1 -0
  573. package/dist/surface/output.js +104 -0
  574. package/dist/surface/output.js.map +1 -0
  575. package/dist/surface/primitives.d.ts +181 -0
  576. package/dist/surface/primitives.d.ts.map +1 -0
  577. package/dist/surface/primitives.js +339 -0
  578. package/dist/surface/primitives.js.map +1 -0
  579. package/dist/surface/renderer.d.ts +97 -0
  580. package/dist/surface/renderer.d.ts.map +1 -0
  581. package/dist/surface/renderer.js +190 -0
  582. package/dist/surface/renderer.js.map +1 -0
  583. package/dist/surface/schemas.d.ts +182 -0
  584. package/dist/surface/schemas.d.ts.map +1 -0
  585. package/dist/surface/schemas.js +142 -0
  586. package/dist/surface/schemas.js.map +1 -0
  587. package/dist/surface/transforms.d.ts +145 -0
  588. package/dist/surface/transforms.d.ts.map +1 -0
  589. package/dist/surface/transforms.js +120 -0
  590. package/dist/surface/transforms.js.map +1 -0
  591. package/dist/surface/types.d.ts +161 -0
  592. package/dist/surface/types.d.ts.map +1 -0
  593. package/dist/surface/types.js +51 -0
  594. package/dist/surface/types.js.map +1 -0
  595. package/dist/surface/validation.d.ts +124 -0
  596. package/dist/surface/validation.d.ts.map +1 -0
  597. package/dist/surface/validation.js +147 -0
  598. package/dist/surface/validation.js.map +1 -0
  599. package/dist/validator.d.ts +56 -0
  600. package/dist/validator.d.ts.map +1 -0
  601. package/dist/validator.js +100 -0
  602. package/dist/validator.js.map +1 -0
  603. package/package.json +105 -3
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Conditional-state CSS generation (aria/data/disabled/checked/`:has(…)` variants).
3
+ *
4
+ * `block.style` sits inline and cannot express pseudo-classes or attribute
5
+ * selectors, and the fixed `block.states` field only covers the three
6
+ * interaction pseudo-classes (`:hover`/`:active`/`:focus-visible`). Everything
7
+ * else a block can style by STATE without JS — form pseudo-classes
8
+ * (`:disabled`, `:checked`, `:invalid`, `:required`), ARIA reflections
9
+ * (`[aria-expanded="true"]`), `data-*` flags (`[data-active]`), and structural
10
+ * `:has(…)` / sibling rules — lives in `block.conditionalStates`. Each entry's
11
+ * `selector` is a CSS suffix APPENDED to the block selector, so the runtime
12
+ * emits:
13
+ *
14
+ * `[data-pw-surface] [data-block-id="<id>"]:disabled{ … }`
15
+ * `[data-pw-surface] [data-block-id="<id>"][aria-expanded="true"]{ … }`
16
+ * `[data-pw-surface] [data-block-id="<id>"]:has(> img){ … }`
17
+ *
18
+ * Keys are CSS camelCase property names (converted to kebab-case); declarations
19
+ * are emitted with `!important` because a block COMPONENT often applies the same
20
+ * CSS property inline with its own default, and inline beats any plain
21
+ * stylesheet rule. Scoped to `[data-block-id]`, so it only overrides the one
22
+ * block. Blocks without `conditionalStates` emit zero bytes so existing surfaces
23
+ * are byte-identical.
24
+ *
25
+ * @module @pwfabric/runtime/render/conditional-states-css
26
+ */
27
+ import { blockSelector, camelToKebab, collectScopedCss } from './scoped-css.js';
28
+ /** Serialize a camelCase decl record to `prop:value !important;…` (values pass through). */
29
+ function declsToCss(decls) {
30
+ return Object.entries(decls)
31
+ .map(([prop, value]) => `${camelToKebab(prop)}:${value} !important`)
32
+ .join(';');
33
+ }
34
+ /**
35
+ * A conditional-state selector must be a SUFFIX that attaches directly to the
36
+ * block selector — never a bare/standalone selector that could match (and leak
37
+ * to) unrelated elements on the host page. Valid first characters:
38
+ * `:` pseudo-class/element (`:disabled`, `:has(…)`)
39
+ * `[` attribute selector (`[aria-expanded="true"]`, `[data-active]`)
40
+ * `>` `+` `~` combinators (`> img`, `+ .x`, `~ .y`)
41
+ * whitespace — descendant combinator (` .child`)
42
+ * Anything else (a bare `.class`, `div`, `*`, empty string) is rejected.
43
+ */
44
+ function isValidSuffixSelector(selector) {
45
+ if (typeof selector !== 'string' || selector.length === 0)
46
+ return false;
47
+ const first = selector.charAt(0);
48
+ return first === ':' || first === '[' || first === '>' || first === '+' || first === '~' || /\s/.test(first);
49
+ }
50
+ /**
51
+ * Emit the scoped CSS rule(s) for a single block's conditional states. Targets
52
+ * `[data-block-id="<id>"]<selector>` scoped under the surface root so it cannot
53
+ * leak to the host page. Entries with a malformed `selector` (not a valid
54
+ * suffix) or an empty `style` record are skipped. Returns '' when the block
55
+ * declares no usable conditional state.
56
+ */
57
+ export function blockConditionalStatesCss(blockId, conditionalStates, surfaceId) {
58
+ const selector = blockSelector(blockId, surfaceId);
59
+ let css = '';
60
+ for (const entry of conditionalStates) {
61
+ if (!entry || !isValidSuffixSelector(entry.selector))
62
+ continue;
63
+ const decls = entry.style;
64
+ if (!decls || Object.keys(decls).length === 0)
65
+ continue;
66
+ // Same wrapper-exclusion as states-css: the id matches two elements; the
67
+ // visual rule must land on the component root, not the square wrapper.
68
+ css += `${selector}:not([data-block-wrapper])${entry.selector}{${declsToCss(decls)}}`;
69
+ }
70
+ return css;
71
+ }
72
+ /**
73
+ * Walk a surface block tree and concatenate the per-block conditional-state CSS
74
+ * for every block declaring `conditionalStates`. Blocks without it are skipped
75
+ * (zero bytes emitted) so existing surfaces are byte-identical.
76
+ */
77
+ export function collectConditionalStatesCss(blocks, surfaceId) {
78
+ return collectScopedCss(blocks, (block) => block.conditionalStates
79
+ ? blockConditionalStatesCss(block.id, block.conditionalStates, surfaceId)
80
+ : '');
81
+ }
82
+ //# sourceMappingURL=conditional-states-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-states-css.js","sourceRoot":"","sources":["../../src/render/conditional-states-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAE/E,4FAA4F;AAC5F,SAAS,UAAU,CAAC,KAAuC;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC;SACnE,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACvE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAChC,OAAO,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9G,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAe,EACf,iBAA0D,EAC1D,SAAkB;IAElB,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAClD,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC;YAAE,SAAQ;QAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,SAAQ;QACvD,yEAAyE;QACzE,uEAAuE;QACvE,GAAG,IAAI,GAAG,QAAQ,6BAA6B,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAA;IACvF,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAwB,EAAE,SAAkB;IACtF,OAAO,gBAAgB,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CACxC,KAAK,CAAC,iBAAiB;QACrB,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,SAAS,CAAC;QACzE,CAAC,CAAC,EAAE,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Surface Connections React Context
3
+ *
4
+ * Carries the surface's CONNECTIONS CONTEXT — the world's configured
5
+ * connections (name/connector/config, single dialect with the runner's
6
+ * `connections.json` entries) plus the loaded engine registry — through
7
+ * the render tree. Pattern mirrors `EntityFacadeContext`.
8
+ *
9
+ * Consumers:
10
+ * - `DataBoundSurfaceRenderer` routes `{kind:'entity', connector}` data
11
+ * sources through the registry (via the renderer prop, not this context
12
+ * — the fetch runs above `SurfaceRenderer`).
13
+ * - Pack blocks on the engine-bridge path read connections/config here
14
+ * (platform source) instead of the runner's bundled connections.json —
15
+ * same shape, different source.
16
+ *
17
+ * Absent provider = null = today's behavior (additive, opt-in).
18
+ *
19
+ * @module @pwfabric/runtime/render/connections-context
20
+ */
21
+ import type { SurfaceConnectionsValue } from '../connectors/types.js';
22
+ /**
23
+ * React context carrying the connections context. Defaults to null —
24
+ * hosts that don't provide it keep today's behavior everywhere.
25
+ */
26
+ export declare const SurfaceConnectionsContext: import("react").Context<SurfaceConnectionsValue | null>;
27
+ /**
28
+ * Returns the connections context from the nearest provider, or null when
29
+ * the host didn't opt in (runner default path, legacy platform rendering).
30
+ */
31
+ export declare function useSurfaceConnections(): SurfaceConnectionsValue | null;
32
+ //# sourceMappingURL=connections-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections-context.d.ts","sourceRoot":"","sources":["../../src/render/connections-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,yDAAsD,CAAA;AAE5F;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,uBAAuB,GAAG,IAAI,CAEtE"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Surface Connections React Context
3
+ *
4
+ * Carries the surface's CONNECTIONS CONTEXT — the world's configured
5
+ * connections (name/connector/config, single dialect with the runner's
6
+ * `connections.json` entries) plus the loaded engine registry — through
7
+ * the render tree. Pattern mirrors `EntityFacadeContext`.
8
+ *
9
+ * Consumers:
10
+ * - `DataBoundSurfaceRenderer` routes `{kind:'entity', connector}` data
11
+ * sources through the registry (via the renderer prop, not this context
12
+ * — the fetch runs above `SurfaceRenderer`).
13
+ * - Pack blocks on the engine-bridge path read connections/config here
14
+ * (platform source) instead of the runner's bundled connections.json —
15
+ * same shape, different source.
16
+ *
17
+ * Absent provider = null = today's behavior (additive, opt-in).
18
+ *
19
+ * @module @pwfabric/runtime/render/connections-context
20
+ */
21
+ import { createContext, useContext } from 'react';
22
+ /**
23
+ * React context carrying the connections context. Defaults to null —
24
+ * hosts that don't provide it keep today's behavior everywhere.
25
+ */
26
+ export const SurfaceConnectionsContext = createContext(null);
27
+ /**
28
+ * Returns the connections context from the nearest provider, or null when
29
+ * the host didn't opt in (runner default path, legacy platform rendering).
30
+ */
31
+ export function useSurfaceConnections() {
32
+ return useContext(SurfaceConnectionsContext);
33
+ }
34
+ //# sourceMappingURL=connections-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections-context.js","sourceRoot":"","sources":["../../src/render/connections-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGjD;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAA;AAE5F;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,UAAU,CAAC,yBAAyB,CAAC,CAAA;AAC9C,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Dark theme variant CSS generation (the "both strategies" dark mode).
3
+ *
4
+ * Light theme tokens stay INLINE on the surface root (`[data-pw-surface]`); this
5
+ * module emits the scoped rules that override them under TWO conditions:
6
+ *
7
+ * 1. Manual force-dark — `[data-pw-surface="<sid>"][data-pw-theme="dark"]{…}`
8
+ * (host toggles `data-pw-theme="dark"` on the root regardless of OS).
9
+ * 2. Auto (OS preference) — `@media (prefers-color-scheme:dark){
10
+ * [data-pw-surface="<sid>"]:not([data-pw-theme="light"]){…}}` (applies
11
+ * unless the host has force-toggled light).
12
+ *
13
+ * The selector carries the surface ID by VALUE. It used to match on the mere
14
+ * PRESENCE of `[data-pw-surface]`, which was a real bug: the embed autoloader
15
+ * hydrates every `[data-pw-surface]` element in a document, so a host page can
16
+ * hold several surfaces with different palettes. Each emitted its own `<style>`
17
+ * with the same value-less selector and `!important`, so equal specificity made
18
+ * DOCUMENT ORDER decide — the last surface's dark palette repainted all of them.
19
+ * Reproduced in Chromium: a blue-themed surface rendered the amber surface's
20
+ * dark background. The light theme was never affected because its values are
21
+ * inline per element and custom properties inherit.
22
+ *
23
+ * @module @pwfabric/runtime/render/dark-theme-css
24
+ */
25
+ import type { AppearanceModePolicy } from '@pwfabric/contracts';
26
+ /**
27
+ * Build the dark theme CSS from a resolved dark CSS-variable map (the output of
28
+ * `resolveAppearanceDarkVars`). Emits BOTH the manual force-dark rule and the
29
+ * `prefers-color-scheme:dark` auto rule. Returns '' when there are no dark vars.
30
+ *
31
+ * @param darkVars - resolved `--pw-*` map for the dark variant
32
+ * @param surfaceId - scopes the rules to ONE surface. Omit only when rendering a
33
+ * single surface in isolation (unit tests); the renderer always supplies it,
34
+ * because two surfaces sharing a document must not share a dark palette.
35
+ */
36
+ export declare function buildDarkThemeCss(darkVars: Record<string, string>, surfaceId?: string, policy?: AppearanceModePolicy): string;
37
+ //# sourceMappingURL=dark-theme-css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dark-theme-css.d.ts","sourceRoot":"","sources":["../../src/render/dark-theme-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAiB/D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,GAAE,oBAA+B,GACtC,MAAM,CAcR"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Dark theme variant CSS generation (the "both strategies" dark mode).
3
+ *
4
+ * Light theme tokens stay INLINE on the surface root (`[data-pw-surface]`); this
5
+ * module emits the scoped rules that override them under TWO conditions:
6
+ *
7
+ * 1. Manual force-dark — `[data-pw-surface="<sid>"][data-pw-theme="dark"]{…}`
8
+ * (host toggles `data-pw-theme="dark"` on the root regardless of OS).
9
+ * 2. Auto (OS preference) — `@media (prefers-color-scheme:dark){
10
+ * [data-pw-surface="<sid>"]:not([data-pw-theme="light"]){…}}` (applies
11
+ * unless the host has force-toggled light).
12
+ *
13
+ * The selector carries the surface ID by VALUE. It used to match on the mere
14
+ * PRESENCE of `[data-pw-surface]`, which was a real bug: the embed autoloader
15
+ * hydrates every `[data-pw-surface]` element in a document, so a host page can
16
+ * hold several surfaces with different palettes. Each emitted its own `<style>`
17
+ * with the same value-less selector and `!important`, so equal specificity made
18
+ * DOCUMENT ORDER decide — the last surface's dark palette repainted all of them.
19
+ * Reproduced in Chromium: a blue-themed surface rendered the amber surface's
20
+ * dark background. The light theme was never affected because its values are
21
+ * inline per element and custom properties inherit.
22
+ *
23
+ * @module @pwfabric/runtime/render/dark-theme-css
24
+ */
25
+ import { surfaceScope } from './scoped-css.js';
26
+ /**
27
+ * Serialize a `--pw-*` CSS-var map to `--pw-…:val !important;…`.
28
+ * `!important`: the LIGHT theme vars are applied INLINE on the surface root
29
+ * (`rootStyle`), and an inline declaration beats any stylesheet/@media rule — so
30
+ * without `!important` the dark overrides would never take effect. `!important`
31
+ * on a custom-property declaration is honoured by the cascade and lets the
32
+ * stylesheet dark vars override the inline light vars.
33
+ */
34
+ function varsToCss(vars) {
35
+ return Object.entries(vars)
36
+ .map(([name, value]) => `${name}:${value} !important`)
37
+ .join(';');
38
+ }
39
+ /**
40
+ * Build the dark theme CSS from a resolved dark CSS-variable map (the output of
41
+ * `resolveAppearanceDarkVars`). Emits BOTH the manual force-dark rule and the
42
+ * `prefers-color-scheme:dark` auto rule. Returns '' when there are no dark vars.
43
+ *
44
+ * @param darkVars - resolved `--pw-*` map for the dark variant
45
+ * @param surfaceId - scopes the rules to ONE surface. Omit only when rendering a
46
+ * single surface in isolation (unit tests); the renderer always supplies it,
47
+ * because two surfaces sharing a document must not share a dark palette.
48
+ */
49
+ export function buildDarkThemeCss(darkVars, surfaceId, policy = 'system') {
50
+ // The app says which modes it wears. A light-only app emits no
51
+ // dark rule at all, so a dark device keeps it light; a dark-only app wears the
52
+ // dark palette unconditionally. `system` follows the device.
53
+ if (policy === 'light')
54
+ return '';
55
+ const body = varsToCss(darkVars);
56
+ if (!body)
57
+ return '';
58
+ const scope = surfaceScope(surfaceId);
59
+ if (policy === 'dark')
60
+ return `${scope}{${body}}`;
61
+ // 1. Manual force-dark (host sets data-pw-theme="dark").
62
+ const manual = `${scope}[data-pw-theme="dark"]{${body}}`;
63
+ // 2. Auto via OS preference, unless force-light (data-pw-theme="light").
64
+ const auto = `@media (prefers-color-scheme:dark){${scope}:not([data-pw-theme="light"]){${body}}}`;
65
+ return manual + auto;
66
+ }
67
+ //# sourceMappingURL=dark-theme-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dark-theme-css.js","sourceRoot":"","sources":["../../src/render/dark-theme-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,IAA4B;IAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,aAAa,CAAC;SACrD,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAgC,EAChC,SAAkB,EAClB,SAA+B,QAAQ;IAEvC,+DAA+D;IAC/D,+EAA+E;IAC/E,6DAA6D;IAC7D,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,EAAE,CAAA;IACjC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IAChC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACpB,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;IACrC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,CAAA;IACjD,yDAAyD;IACzD,MAAM,MAAM,GAAG,GAAG,KAAK,0BAA0B,IAAI,GAAG,CAAA;IACxD,yEAAyE;IACzE,MAAM,IAAI,GAAG,sCAAsC,KAAK,iCAAiC,IAAI,IAAI,CAAA;IACjG,OAAO,MAAM,GAAG,IAAI,CAAA;AACtB,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Data Binding Types for Surface Renderer
3
+ *
4
+ * Type definitions for data-bound surface rendering.
5
+ * These types define the shape of surface JSON definitions that include
6
+ * dataSources, state, and expression-based prop bindings.
7
+ *
8
+ * @module @pwfabric/runtime/render/data-binding-types
9
+ */
10
+ import type { SurfaceDataCache } from './data-cache.js';
11
+ import type { Block } from '@pwfabric/core';
12
+ import type { RenderableSurface, SurfaceRendererProps } from './types.js';
13
+ import type { DataServiceConfig } from '../data/types.js';
14
+ /**
15
+ * Source kinds supported in surface JSON definitions.
16
+ * Note: 'computed' is excluded because functions can't be serialized in JSON.
17
+ */
18
+ export type SurfaceDataSourceKind = 'rest' | 'static' | 'state' | 'entity';
19
+ /**
20
+ * Data source definition within a surface JSON.
21
+ * Unlike DataSourceDefinition from data/types, this is JSON-serializable.
22
+ */
23
+ export interface SurfaceDataSourceDefinition {
24
+ /** Unique source identifier, used as the key in expression context */
25
+ readonly id: string;
26
+ /** Source kind */
27
+ readonly kind: SurfaceDataSourceKind;
28
+ /** REST endpoint (may contain {{state.key}} placeholders) */
29
+ readonly endpoint?: string;
30
+ /** HTTP method for REST sources */
31
+ readonly method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
32
+ /** Static inline data */
33
+ readonly staticData?: unknown;
34
+ /** Auto-refresh interval in ms (0 or undefined = no auto-refresh) */
35
+ readonly refreshInterval?: number;
36
+ /** Optional HTTP headers to include in REST requests (e.g. Authorization) */
37
+ readonly headers?: Readonly<Record<string, string>>;
38
+ /** Entity type to list (kind: 'entity') via the platform/entities facade */
39
+ readonly entityType?: string;
40
+ /** Optional query for entity sources (filter/sort/pagination). String
41
+ * leaves may carry `{{state.x}}` expressions — resolved against surface
42
+ * state before the connector is called (see render/query-state.ts). */
43
+ readonly query?: Readonly<Record<string, unknown>>;
44
+ /** Payload bound when the source cannot be served (connector missing /
45
+ * failed). `__errors.<id>` stays populated alongside it. */
46
+ readonly fallback?: unknown;
47
+ /**
48
+ * Contract parity with `dataSourceSchema.connector`: which
49
+ * data-plane engine serves this entity source (e.g. 'graph-lists').
50
+ * Routed through the host-provided `ConnectorEngineRegistry` when the
51
+ * connection is registered there; absent/unregistered = the default
52
+ * entity facade path (today's behavior).
53
+ */
54
+ readonly connector?: string;
55
+ /**
56
+ * The response property holding the list — `data`, `products`, or absent
57
+ * when the body IS the array. Dotted paths allowed for a nested one.
58
+ */
59
+ readonly returns?: string;
60
+ /** world auth binding BY NAME — never credential values. */
61
+ readonly authProviderRef?: string;
62
+ /**
63
+ * Contract parity with `dataSourceSchema.aggregate`: ask for ONE
64
+ * NUMBER over the collection instead of its rows. The source binds
65
+ * `{ fn, field?, value, count }` — `{{<id>.value}}` — and is exempt from
66
+ * the list wrap. `filter` leaves may carry `{{state.x}}` like `query`.
67
+ */
68
+ readonly aggregate?: {
69
+ readonly fn: 'count' | 'sum' | 'avg';
70
+ readonly field?: string;
71
+ readonly filter?: Readonly<Record<string, unknown>>;
72
+ };
73
+ }
74
+ /**
75
+ * Action types that blocks can dispatch via their action prop.
76
+ */
77
+ export type SurfaceActionType = 'setState' | 'refresh' | 'refreshAll' | 'showBlock' | 'hideBlock' | 'navigate';
78
+ /**
79
+ * Action dispatched by a block (e.g. button click, tab change).
80
+ */
81
+ export type SurfaceAction = {
82
+ readonly type: 'setState';
83
+ readonly key: string;
84
+ readonly value: unknown;
85
+ } | {
86
+ readonly type: 'refresh';
87
+ readonly sourceId: string;
88
+ } | {
89
+ readonly type: 'refreshAll';
90
+ } | {
91
+ readonly type: 'showBlock';
92
+ readonly blockId: string;
93
+ } | {
94
+ readonly type: 'hideBlock';
95
+ readonly blockId: string;
96
+ } | {
97
+ readonly type: 'navigate';
98
+ readonly url: string;
99
+ };
100
+ /**
101
+ * What a block's `action` prop may hold: one action, or a list run in order
102
+ * on the block's click (`block:click`) — never on its other events.
103
+ */
104
+ export type BlockActionProp = SurfaceAction | readonly SurfaceAction[];
105
+ /**
106
+ * A behavior stored on a published surface — maps an event trigger to one or more actions.
107
+ * The `event` field accepts canonical colon form (`block:click`) or legacy dot form
108
+ * (`surface.load`) — normalized at match time by `canonicalizeEventType`.
109
+ */
110
+ export interface RuntimeBehavior {
111
+ readonly id: string;
112
+ readonly event: string;
113
+ readonly targetBlockId?: string;
114
+ readonly actions: readonly SurfaceAction[];
115
+ }
116
+ /**
117
+ * Surface definition extended with data binding capabilities.
118
+ * This is the shape of a surface JSON that uses live data.
119
+ */
120
+ export interface DataBoundSurface {
121
+ /**
122
+ * Stable surface id — SurfaceRenderer's render scope.
123
+ *
124
+ * Omitted from this type originally, which made the drop invisible: the
125
+ * renderer decomposes the surface into blocks/appearance/capabilities and
126
+ * rebuilds it, and a field the type never had could not survive the rebuild.
127
+ * Downstream, `[data-pw-surface]` rendered with an EMPTY value and every
128
+ * per-surface rule (dark theme, visibility, interaction states) fell back to
129
+ * the value-less selector shared by every surface in the document — the exact
130
+ * collision the scoping was added to prevent.
131
+ */
132
+ readonly id?: string;
133
+ /** Block composition */
134
+ readonly blocks: readonly Block[];
135
+ /** ui-appearance atom reference (theme + layout + styleVariables consolidated). */
136
+ readonly appearance?: RenderableSurface['appearance'];
137
+ /** capability list — `platform/persistence` carries dataSources + initialState in its config. */
138
+ readonly capabilities?: RenderableSurface['capabilities'];
139
+ }
140
+ /**
141
+ * Props for DataBoundSurfaceRenderer.
142
+ * Extends SurfaceRendererProps but accepts a DataBoundSurface.
143
+ */
144
+ export interface DataBoundSurfaceRendererProps extends Omit<SurfaceRendererProps, 'surface'> {
145
+ /** Surface definition with optional dataSources and state */
146
+ readonly surface: DataBoundSurface;
147
+ /** Stored behaviors to execute when their trigger event fires on the bus */
148
+ readonly behaviors?: readonly RuntimeBehavior[];
149
+ /**
150
+ * Intercept a `navigate` action before the default `window.location.assign`
151
+ * fallback runs. Return `true` to signal the host handled it (e.g. swapped
152
+ * to a sibling page in place, connected-preview style) — the default hard
153
+ * navigation is skipped. Return `false`/`undefined` to fall through to the
154
+ * default behavior.
155
+ */
156
+ readonly onNavigateAction?: (url: string) => boolean;
157
+ /**
158
+ * What to render while the initial `fetchAllSources` pass is in flight.
159
+ *
160
+ * - `'gate'` (default) — the historical behavior: an all-or-nothing
161
+ * "Loading data..." placeholder replaces the ENTIRE block tree until the
162
+ * first fetch settles. Kept as the default so existing consumers (e.g.
163
+ * published `/s/` pages) are byte-identical.
164
+ * - `'immediate'` — render the block tree right away; expressions bound to
165
+ * still-loading sources resolve to `undefined` (never a literal `{{…}}`
166
+ * string — path expressions always evaluate successfully) and fill in as
167
+ * each source lands. Static chrome (navbar, headings, footer) is visible
168
+ * from the first frame. Pair with the `__loading.<sourceId>` /
169
+ * `__anyLoading` expression keys to drive per-widget skeletons.
170
+ */
171
+ readonly loadingStrategy?: 'gate' | 'immediate';
172
+ /**
173
+ * Yesterday's rows while today's load. A source whose key (see
174
+ * `dataSourceCacheKey`) is present is seeded from the cache on the first
175
+ * frame and still re-fetched; the fresh result replaces the seed and is
176
+ * written back. Pairs naturally with `loadingStrategy: 'immediate'`.
177
+ */
178
+ readonly dataCache?: SurfaceDataCache;
179
+ /**
180
+ * Configuration for the DataService this renderer creates.
181
+ *
182
+ * IT WAS NEVER PASSED. `<DataCapabilityProvider>` was mounted bare, so the
183
+ * service was built with no config — which means `getAccessToken` was always
184
+ * undefined and every `authProviderRef` on every rest source resolved to
185
+ * nobody. The field parsed, travelled and was read by a resolver that could
186
+ * not exist. Threading it is the repair; it is also what lets a host say
187
+ * which origin is its own, so our API can be called with a cookie and
188
+ * nobody else's can.
189
+ */
190
+ readonly dataServiceConfig?: DataServiceConfig;
191
+ }
192
+ //# sourceMappingURL=data-binding-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding-types.d.ts","sourceRoot":"","sources":["../../src/render/data-binding-types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Data Binding Types for Surface Renderer
3
+ *
4
+ * Type definitions for data-bound surface rendering.
5
+ * These types define the shape of surface JSON definitions that include
6
+ * dataSources, state, and expression-based prop bindings.
7
+ *
8
+ * @module @pwfabric/runtime/render/data-binding-types
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=data-binding-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-binding-types.js","sourceRoot":"","sources":["../../src/render/data-binding-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * A host-provided cache for fetched source data — stale-while-revalidate.
3
+ *
4
+ * A page the visitor has already seen should not come back empty while its
5
+ * sources are re-fetched. The renderer knows nothing about where the cache
6
+ * lives (the published-app runner keeps it in sessionStorage, a host may keep
7
+ * it in memory); it only asks for a value by key on the first frame and
8
+ * writes the fresh result back after a successful fetch. A failed fetch never
9
+ * writes, so a good entry is not replaced by nothing.
10
+ *
11
+ * @module @pwfabric/runtime/render/data-cache
12
+ */
13
+ import type { SurfaceDataSourceDefinition } from './data-binding-types.js';
14
+ export interface SurfaceDataCache {
15
+ /** The last successful result for this key, or undefined. */
16
+ get(key: string): unknown;
17
+ /** Remember a successful result. Must not throw on a full store. */
18
+ set(key: string, value: unknown): void;
19
+ }
20
+ /**
21
+ * The key a source's fetched data is remembered under.
22
+ *
23
+ * Built from everything that decides WHAT is fetched — kind, id, resolved address,
24
+ * entity type, connector, and the query with its `{{state.*}}` placeholders
25
+ * resolved against the current state — so page 2 never answers as page 1.
26
+ * The `fallback` payload is left out: sample rows are not part of what was
27
+ * fetched. `state` and `static` sources are never fetched, so they have no
28
+ * key.
29
+ */
30
+ export declare function dataSourceCacheKey(source: SurfaceDataSourceDefinition, state: Readonly<Record<string, unknown>>): string | undefined;
31
+ //# sourceMappingURL=data-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-cache.d.ts","sourceRoot":"","sources":["../../src/render/data-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AAI1E,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACzB,oEAAoE;IACpE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CACvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,2BAA2B,EACnC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvC,MAAM,GAAG,SAAS,CAsBpB"}
@@ -0,0 +1,37 @@
1
+ import { resolveQueryState } from './query-state.js';
2
+ import { endpointMissingPathValue, resolveEndpoint } from './endpoint.js';
3
+ /**
4
+ * The key a source's fetched data is remembered under.
5
+ *
6
+ * Built from everything that decides WHAT is fetched — kind, id, resolved address,
7
+ * entity type, connector, and the query with its `{{state.*}}` placeholders
8
+ * resolved against the current state — so page 2 never answers as page 1.
9
+ * The `fallback` payload is left out: sample rows are not part of what was
10
+ * fetched. `state` and `static` sources are never fetched, so they have no
11
+ * key.
12
+ */
13
+ export function dataSourceCacheKey(source, state) {
14
+ if (source.kind === 'state' || source.kind === 'static')
15
+ return undefined;
16
+ // An idle source (a required path value is empty) is not fetched either.
17
+ if (source.kind === 'rest' && source.endpoint !== undefined && endpointMissingPathValue(source.endpoint, state)) {
18
+ return undefined;
19
+ }
20
+ const query = source.query ? resolveQueryState(source.query, state) : null;
21
+ const aggregate = source.aggregate ? resolveQueryState(source.aggregate, state) : null;
22
+ return JSON.stringify([
23
+ source.kind,
24
+ source.id,
25
+ // The RESOLVED address, not the template: with the template every
26
+ // `/products/{{state.id}}` shared one key, and `?id=13` opened on the
27
+ // rows cached for 12 until the fetch landed.
28
+ source.endpoint !== undefined ? resolveEndpoint(source.endpoint, state) : null,
29
+ source.method ?? null,
30
+ source.entityType ?? null,
31
+ source.connector ?? null,
32
+ source.returns ?? null,
33
+ query,
34
+ aggregate,
35
+ ]);
36
+ }
37
+ //# sourceMappingURL=data-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-cache.js","sourceRoot":"","sources":["../../src/render/data-cache.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AASzE;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAmC,EACnC,KAAwC;IAExC,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAA;IACzE,yEAAyE;IACzE,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,wBAAwB,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;QAChH,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1E,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtF,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,MAAM,CAAC,IAAI;QACX,MAAM,CAAC,EAAE;QACT,kEAAkE;QAClE,sEAAsE;QACtE,6CAA6C;QAC7C,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;QAC9E,MAAM,CAAC,MAAM,IAAI,IAAI;QACrB,MAAM,CAAC,UAAU,IAAI,IAAI;QACzB,MAAM,CAAC,SAAS,IAAI,IAAI;QACxB,MAAM,CAAC,OAAO,IAAI,IAAI;QACtB,KAAK;QACL,SAAS;KACV,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Derive a dark theme variant from a light SurfaceTheme.
3
+ *
4
+ * A colour palette is a preset the end user edits — not a reason to ship a
5
+ * separate appearance atom. The dark variant is DERIVED from the light palette
6
+ * rather than authored twice.
7
+ *
8
+ * The implementation lives in `@pwfabric/contracts`
9
+ * (`fabric/appearance-cascade`), because the derivation can run at WRITE
10
+ * time: an authoring tool may bake the result into
11
+ * `appearance.config.darkTheme` so the author can see and edit the dark palette
12
+ * instead of it being invisible render-time magic. Render still derives as the
13
+ * fallback for surfaces that carry no baked variant.
14
+ *
15
+ * @module @pwfabric/runtime/render/derive-dark-theme
16
+ */
17
+ export { deriveDarkTheme } from '@pwfabric/contracts';
18
+ //# sourceMappingURL=derive-dark-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive-dark-theme.d.ts","sourceRoot":"","sources":["../../src/render/derive-dark-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Derive a dark theme variant from a light SurfaceTheme.
3
+ *
4
+ * A colour palette is a preset the end user edits — not a reason to ship a
5
+ * separate appearance atom. The dark variant is DERIVED from the light palette
6
+ * rather than authored twice.
7
+ *
8
+ * The implementation lives in `@pwfabric/contracts`
9
+ * (`fabric/appearance-cascade`), because the derivation can run at WRITE
10
+ * time: an authoring tool may bake the result into
11
+ * `appearance.config.darkTheme` so the author can see and edit the dark palette
12
+ * instead of it being invisible render-time magic. Render still derives as the
13
+ * fallback for surfaces that carry no baked variant.
14
+ *
15
+ * @module @pwfabric/runtime/render/derive-dark-theme
16
+ */
17
+ export { deriveDarkTheme } from '@pwfabric/contracts';
18
+ //# sourceMappingURL=derive-dark-theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive-dark-theme.js","sourceRoot":"","sources":["../../src/render/derive-dark-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}