@craft-ts/core 0.7.0-beta.13

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 (682) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +58 -0
  3. package/src/index.d.ts +148 -0
  4. package/src/index.d.ts.map +1 -0
  5. package/src/index.js +150 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/after-recomputation.d.ts +327 -0
  8. package/src/lib/after-recomputation.d.ts.map +1 -0
  9. package/src/lib/after-recomputation.js +25 -0
  10. package/src/lib/after-recomputation.js.map +1 -0
  11. package/src/lib/app-checked-di.d.ts +82 -0
  12. package/src/lib/app-checked-di.d.ts.map +1 -0
  13. package/src/lib/app-checked-di.js +1 -0
  14. package/src/lib/app-checked-di.js.map +1 -0
  15. package/src/lib/async-process.d.ts +411 -0
  16. package/src/lib/async-process.d.ts.map +1 -0
  17. package/src/lib/async-process.js +702 -0
  18. package/src/lib/async-process.js.map +1 -0
  19. package/src/lib/branded-component/branded-component.d.ts +129 -0
  20. package/src/lib/branded-component/branded-component.d.ts.map +1 -0
  21. package/src/lib/branded-component/branded-component.js +7 -0
  22. package/src/lib/branded-component/branded-component.js.map +1 -0
  23. package/src/lib/browser-boundaries.d.ts +165 -0
  24. package/src/lib/browser-boundaries.d.ts.map +1 -0
  25. package/src/lib/browser-boundaries.js +550 -0
  26. package/src/lib/browser-boundaries.js.map +1 -0
  27. package/src/lib/client-di-requirement.d.ts +28 -0
  28. package/src/lib/client-di-requirement.d.ts.map +1 -0
  29. package/src/lib/client-di-requirement.js +11 -0
  30. package/src/lib/client-di-requirement.js.map +1 -0
  31. package/src/lib/client-function-middleware.d.ts +130 -0
  32. package/src/lib/client-function-middleware.d.ts.map +1 -0
  33. package/src/lib/client-function-middleware.js +144 -0
  34. package/src/lib/client-function-middleware.js.map +1 -0
  35. package/src/lib/component-monitoring.d.ts +7 -0
  36. package/src/lib/component-monitoring.d.ts.map +1 -0
  37. package/src/lib/component-monitoring.js +28 -0
  38. package/src/lib/component-monitoring.js.map +1 -0
  39. package/src/lib/component-register.d.ts +12 -0
  40. package/src/lib/component-register.d.ts.map +1 -0
  41. package/src/lib/component-register.js +13 -0
  42. package/src/lib/component-register.js.map +1 -0
  43. package/src/lib/computed-source.d.ts +303 -0
  44. package/src/lib/computed-source.d.ts.map +1 -0
  45. package/src/lib/computed-source.js +319 -0
  46. package/src/lib/computed-source.js.map +1 -0
  47. package/src/lib/correlation-id-plugin.d.ts +3 -0
  48. package/src/lib/correlation-id-plugin.d.ts.map +1 -0
  49. package/src/lib/correlation-id-plugin.js +73 -0
  50. package/src/lib/correlation-id-plugin.js.map +1 -0
  51. package/src/lib/correlation-id.d.ts +30 -0
  52. package/src/lib/correlation-id.d.ts.map +1 -0
  53. package/src/lib/correlation-id.js +86 -0
  54. package/src/lib/correlation-id.js.map +1 -0
  55. package/src/lib/craft-a11y.d.ts +22 -0
  56. package/src/lib/craft-a11y.d.ts.map +1 -0
  57. package/src/lib/craft-a11y.js +32 -0
  58. package/src/lib/craft-a11y.js.map +1 -0
  59. package/src/lib/craft-activated-route.d.ts +21 -0
  60. package/src/lib/craft-activated-route.d.ts.map +1 -0
  61. package/src/lib/craft-activated-route.js +20 -0
  62. package/src/lib/craft-activated-route.js.map +1 -0
  63. package/src/lib/craft-app-config.d.ts +91 -0
  64. package/src/lib/craft-app-config.d.ts.map +1 -0
  65. package/src/lib/craft-app-config.js +64 -0
  66. package/src/lib/craft-app-config.js.map +1 -0
  67. package/src/lib/craft-codec.d.ts +16 -0
  68. package/src/lib/craft-codec.d.ts.map +1 -0
  69. package/src/lib/craft-codec.js +1 -0
  70. package/src/lib/craft-codec.js.map +1 -0
  71. package/src/lib/craft-computed.d.ts +31 -0
  72. package/src/lib/craft-computed.d.ts.map +1 -0
  73. package/src/lib/craft-computed.js +81 -0
  74. package/src/lib/craft-computed.js.map +1 -0
  75. package/src/lib/craft-control-flow.d.ts +14 -0
  76. package/src/lib/craft-control-flow.d.ts.map +1 -0
  77. package/src/lib/craft-control-flow.js +18 -0
  78. package/src/lib/craft-control-flow.js.map +1 -0
  79. package/src/lib/craft-effect.d.ts +13 -0
  80. package/src/lib/craft-effect.d.ts.map +1 -0
  81. package/src/lib/craft-effect.js +93 -0
  82. package/src/lib/craft-effect.js.map +1 -0
  83. package/src/lib/craft-exception.d.ts +40 -0
  84. package/src/lib/craft-exception.d.ts.map +1 -0
  85. package/src/lib/craft-exception.js +16 -0
  86. package/src/lib/craft-exception.js.map +1 -0
  87. package/src/lib/craft-gen.d.ts +123 -0
  88. package/src/lib/craft-gen.d.ts.map +1 -0
  89. package/src/lib/craft-gen.js +90 -0
  90. package/src/lib/craft-gen.js.map +1 -0
  91. package/src/lib/craft-generator-runtime.d.ts +110 -0
  92. package/src/lib/craft-generator-runtime.d.ts.map +1 -0
  93. package/src/lib/craft-generator-runtime.js +191 -0
  94. package/src/lib/craft-generator-runtime.js.map +1 -0
  95. package/src/lib/craft-guard-runtime.d.ts +70 -0
  96. package/src/lib/craft-guard-runtime.d.ts.map +1 -0
  97. package/src/lib/craft-guard-runtime.js +195 -0
  98. package/src/lib/craft-guard-runtime.js.map +1 -0
  99. package/src/lib/craft-handshake.d.ts +35 -0
  100. package/src/lib/craft-handshake.d.ts.map +1 -0
  101. package/src/lib/craft-handshake.js +34 -0
  102. package/src/lib/craft-handshake.js.map +1 -0
  103. package/src/lib/craft-http-client.d.ts +236 -0
  104. package/src/lib/craft-http-client.d.ts.map +1 -0
  105. package/src/lib/craft-http-client.js +437 -0
  106. package/src/lib/craft-http-client.js.map +1 -0
  107. package/src/lib/craft-http-trace.d.ts +12 -0
  108. package/src/lib/craft-http-trace.d.ts.map +1 -0
  109. package/src/lib/craft-http-trace.js +28 -0
  110. package/src/lib/craft-http-trace.js.map +1 -0
  111. package/src/lib/craft-lazy.d.ts +42 -0
  112. package/src/lib/craft-lazy.d.ts.map +1 -0
  113. package/src/lib/craft-lazy.js +83 -0
  114. package/src/lib/craft-lazy.js.map +1 -0
  115. package/src/lib/craft-load-retry.d.ts +76 -0
  116. package/src/lib/craft-load-retry.d.ts.map +1 -0
  117. package/src/lib/craft-load-retry.js +160 -0
  118. package/src/lib/craft-load-retry.js.map +1 -0
  119. package/src/lib/craft-machine-history.d.ts +145 -0
  120. package/src/lib/craft-machine-history.d.ts.map +1 -0
  121. package/src/lib/craft-machine-history.js +276 -0
  122. package/src/lib/craft-machine-history.js.map +1 -0
  123. package/src/lib/craft-match.d.ts +49 -0
  124. package/src/lib/craft-match.d.ts.map +1 -0
  125. package/src/lib/craft-match.js +58 -0
  126. package/src/lib/craft-match.js.map +1 -0
  127. package/src/lib/craft-method.d.ts +28 -0
  128. package/src/lib/craft-method.d.ts.map +1 -0
  129. package/src/lib/craft-method.js +45 -0
  130. package/src/lib/craft-method.js.map +1 -0
  131. package/src/lib/craft-node-directive.d.ts +32 -0
  132. package/src/lib/craft-node-directive.d.ts.map +1 -0
  133. package/src/lib/craft-node-directive.js +22 -0
  134. package/src/lib/craft-node-directive.js.map +1 -0
  135. package/src/lib/craft-pending.d.ts +115 -0
  136. package/src/lib/craft-pending.d.ts.map +1 -0
  137. package/src/lib/craft-pending.js +187 -0
  138. package/src/lib/craft-pending.js.map +1 -0
  139. package/src/lib/craft-pipe.d.ts +63 -0
  140. package/src/lib/craft-pipe.d.ts.map +1 -0
  141. package/src/lib/craft-pipe.js +57 -0
  142. package/src/lib/craft-pipe.js.map +1 -0
  143. package/src/lib/craft-platform.d.ts +50 -0
  144. package/src/lib/craft-platform.d.ts.map +1 -0
  145. package/src/lib/craft-platform.js +175 -0
  146. package/src/lib/craft-platform.js.map +1 -0
  147. package/src/lib/craft-primitive-gen.d.ts +137 -0
  148. package/src/lib/craft-primitive-gen.d.ts.map +1 -0
  149. package/src/lib/craft-primitive-gen.js +76 -0
  150. package/src/lib/craft-primitive-gen.js.map +1 -0
  151. package/src/lib/craft-primitive-registry.d.ts +113 -0
  152. package/src/lib/craft-primitive-registry.d.ts.map +1 -0
  153. package/src/lib/craft-primitive-registry.js +159 -0
  154. package/src/lib/craft-primitive-registry.js.map +1 -0
  155. package/src/lib/craft-program-operators.d.ts +101 -0
  156. package/src/lib/craft-program-operators.d.ts.map +1 -0
  157. package/src/lib/craft-program-operators.js +116 -0
  158. package/src/lib/craft-program-operators.js.map +1 -0
  159. package/src/lib/craft-program-runtime.d.ts +80 -0
  160. package/src/lib/craft-program-runtime.d.ts.map +1 -0
  161. package/src/lib/craft-program-runtime.js +166 -0
  162. package/src/lib/craft-program-runtime.js.map +1 -0
  163. package/src/lib/craft-register-for-runtime.d.ts +39 -0
  164. package/src/lib/craft-register-for-runtime.d.ts.map +1 -0
  165. package/src/lib/craft-register-for-runtime.js +96 -0
  166. package/src/lib/craft-register-for-runtime.js.map +1 -0
  167. package/src/lib/craft-register-for.d.ts +57 -0
  168. package/src/lib/craft-register-for.d.ts.map +1 -0
  169. package/src/lib/craft-register-for.js +200 -0
  170. package/src/lib/craft-register-for.js.map +1 -0
  171. package/src/lib/craft-render-identity.d.ts +19 -0
  172. package/src/lib/craft-render-identity.d.ts.map +1 -0
  173. package/src/lib/craft-render-identity.js +23 -0
  174. package/src/lib/craft-render-identity.js.map +1 -0
  175. package/src/lib/craft-replay.d.ts +5 -0
  176. package/src/lib/craft-replay.d.ts.map +1 -0
  177. package/src/lib/craft-replay.js +28 -0
  178. package/src/lib/craft-replay.js.map +1 -0
  179. package/src/lib/craft-resolve.d.ts +39 -0
  180. package/src/lib/craft-resolve.d.ts.map +1 -0
  181. package/src/lib/craft-resolve.js +9 -0
  182. package/src/lib/craft-resolve.js.map +1 -0
  183. package/src/lib/craft-resource.d.ts +11 -0
  184. package/src/lib/craft-resource.d.ts.map +1 -0
  185. package/src/lib/craft-resource.js +264 -0
  186. package/src/lib/craft-resource.js.map +1 -0
  187. package/src/lib/craft-route-exceptions.d.ts +785 -0
  188. package/src/lib/craft-route-exceptions.d.ts.map +1 -0
  189. package/src/lib/craft-route-exceptions.js +86 -0
  190. package/src/lib/craft-route-exceptions.js.map +1 -0
  191. package/src/lib/craft-route-load-error.d.ts +1145 -0
  192. package/src/lib/craft-route-load-error.d.ts.map +1 -0
  193. package/src/lib/craft-route-load-error.js +173 -0
  194. package/src/lib/craft-route-load-error.js.map +1 -0
  195. package/src/lib/craft-route-meta.d.ts +52 -0
  196. package/src/lib/craft-route-meta.d.ts.map +1 -0
  197. package/src/lib/craft-route-meta.js +16 -0
  198. package/src/lib/craft-route-meta.js.map +1 -0
  199. package/src/lib/craft-route-target.d.ts +27 -0
  200. package/src/lib/craft-route-target.d.ts.map +1 -0
  201. package/src/lib/craft-route-target.js +22 -0
  202. package/src/lib/craft-route-target.js.map +1 -0
  203. package/src/lib/craft-router-outlet.d.ts +105 -0
  204. package/src/lib/craft-router-outlet.d.ts.map +1 -0
  205. package/src/lib/craft-router-outlet.js +735 -0
  206. package/src/lib/craft-router-outlet.js.map +1 -0
  207. package/src/lib/craft-router-tokens.d.ts +49 -0
  208. package/src/lib/craft-router-tokens.d.ts.map +1 -0
  209. package/src/lib/craft-router-tokens.js +15 -0
  210. package/src/lib/craft-router-tokens.js.map +1 -0
  211. package/src/lib/craft-router-trace.d.ts +18 -0
  212. package/src/lib/craft-router-trace.d.ts.map +1 -0
  213. package/src/lib/craft-router-trace.js +54 -0
  214. package/src/lib/craft-router-trace.js.map +1 -0
  215. package/src/lib/craft-router.d.ts +248 -0
  216. package/src/lib/craft-router.d.ts.map +1 -0
  217. package/src/lib/craft-router.js +559 -0
  218. package/src/lib/craft-router.js.map +1 -0
  219. package/src/lib/craft-routes.d.ts +755 -0
  220. package/src/lib/craft-routes.d.ts.map +1 -0
  221. package/src/lib/craft-routes.js +510 -0
  222. package/src/lib/craft-routes.js.map +1 -0
  223. package/src/lib/craft-service.d.ts +1034 -0
  224. package/src/lib/craft-service.d.ts.map +1 -0
  225. package/src/lib/craft-service.js +1072 -0
  226. package/src/lib/craft-service.js.map +1 -0
  227. package/src/lib/craft-service.shared.d.ts +35 -0
  228. package/src/lib/craft-service.shared.d.ts.map +1 -0
  229. package/src/lib/craft-service.shared.js +4 -0
  230. package/src/lib/craft-service.shared.js.map +1 -0
  231. package/src/lib/craft-settled.d.ts +171 -0
  232. package/src/lib/craft-settled.d.ts.map +1 -0
  233. package/src/lib/craft-settled.js +130 -0
  234. package/src/lib/craft-settled.js.map +1 -0
  235. package/src/lib/craft-ssr.d.ts +29 -0
  236. package/src/lib/craft-ssr.d.ts.map +1 -0
  237. package/src/lib/craft-ssr.js +27 -0
  238. package/src/lib/craft-ssr.js.map +1 -0
  239. package/src/lib/craft-state-machine-runtime.d.ts +88 -0
  240. package/src/lib/craft-state-machine-runtime.d.ts.map +1 -0
  241. package/src/lib/craft-state-machine-runtime.js +167 -0
  242. package/src/lib/craft-state-machine-runtime.js.map +1 -0
  243. package/src/lib/craft-state-machine.d.ts +233 -0
  244. package/src/lib/craft-state-machine.d.ts.map +1 -0
  245. package/src/lib/craft-state-machine.js +254 -0
  246. package/src/lib/craft-state-machine.js.map +1 -0
  247. package/src/lib/craft-target-runtime.d.ts +20 -0
  248. package/src/lib/craft-target-runtime.d.ts.map +1 -0
  249. package/src/lib/craft-target-runtime.js +42 -0
  250. package/src/lib/craft-target-runtime.js.map +1 -0
  251. package/src/lib/craft-transfer-snapshot.d.ts +19 -0
  252. package/src/lib/craft-transfer-snapshot.d.ts.map +1 -0
  253. package/src/lib/craft-transfer-snapshot.js +90 -0
  254. package/src/lib/craft-transfer-snapshot.js.map +1 -0
  255. package/src/lib/craft-unique.d.ts +7 -0
  256. package/src/lib/craft-unique.d.ts.map +1 -0
  257. package/src/lib/craft-unique.js +16 -0
  258. package/src/lib/craft-unique.js.map +1 -0
  259. package/src/lib/craft-until-settled.d.ts +99 -0
  260. package/src/lib/craft-until-settled.d.ts.map +1 -0
  261. package/src/lib/craft-until-settled.js +81 -0
  262. package/src/lib/craft-until-settled.js.map +1 -0
  263. package/src/lib/craft-use.d.ts +26 -0
  264. package/src/lib/craft-use.d.ts.map +1 -0
  265. package/src/lib/craft-use.js +37 -0
  266. package/src/lib/craft-use.js.map +1 -0
  267. package/src/lib/craft-view-transition.d.ts +102 -0
  268. package/src/lib/craft-view-transition.d.ts.map +1 -0
  269. package/src/lib/craft-view-transition.js +130 -0
  270. package/src/lib/craft-view-transition.js.map +1 -0
  271. package/src/lib/dom-event-hook.d.ts +30 -0
  272. package/src/lib/dom-event-hook.d.ts.map +1 -0
  273. package/src/lib/dom-event-hook.js +16 -0
  274. package/src/lib/dom-event-hook.js.map +1 -0
  275. package/src/lib/fn-wrapper.d.ts +13 -0
  276. package/src/lib/fn-wrapper.d.ts.map +1 -0
  277. package/src/lib/fn-wrapper.js +66 -0
  278. package/src/lib/fn-wrapper.js.map +1 -0
  279. package/src/lib/form/craft-field.d.ts +155 -0
  280. package/src/lib/form/craft-field.d.ts.map +1 -0
  281. package/src/lib/form/craft-field.directive.d.ts +70 -0
  282. package/src/lib/form/craft-field.directive.d.ts.map +1 -0
  283. package/src/lib/form/craft-field.directive.js +549 -0
  284. package/src/lib/form/craft-field.directive.js.map +1 -0
  285. package/src/lib/form/craft-field.js +586 -0
  286. package/src/lib/form/craft-field.js.map +1 -0
  287. package/src/lib/form/field-exception.d.ts +62 -0
  288. package/src/lib/form/field-exception.d.ts.map +1 -0
  289. package/src/lib/form/field-exception.js +37 -0
  290. package/src/lib/form/field-exception.js.map +1 -0
  291. package/src/lib/form/field-lens.d.ts +29 -0
  292. package/src/lib/form/field-lens.d.ts.map +1 -0
  293. package/src/lib/form/field-lens.js +32 -0
  294. package/src/lib/form/field-lens.js.map +1 -0
  295. package/src/lib/form/insert-form-attributes.d.ts +69 -0
  296. package/src/lib/form/insert-form-attributes.d.ts.map +1 -0
  297. package/src/lib/form/insert-form-attributes.js +163 -0
  298. package/src/lib/form/insert-form-attributes.js.map +1 -0
  299. package/src/lib/form/insert-form-internals.d.ts +110 -0
  300. package/src/lib/form/insert-form-internals.d.ts.map +1 -0
  301. package/src/lib/form/insert-form-internals.js +276 -0
  302. package/src/lib/form/insert-form-internals.js.map +1 -0
  303. package/src/lib/form/insert-form-schema.d.ts +10 -0
  304. package/src/lib/form/insert-form-schema.d.ts.map +1 -0
  305. package/src/lib/form/insert-form-schema.js +62 -0
  306. package/src/lib/form/insert-form-schema.js.map +1 -0
  307. package/src/lib/form/insert-form-submit.d.ts +79 -0
  308. package/src/lib/form/insert-form-submit.d.ts.map +1 -0
  309. package/src/lib/form/insert-form-submit.js +126 -0
  310. package/src/lib/form/insert-form-submit.js.map +1 -0
  311. package/src/lib/form/insert-form.d.ts +39 -0
  312. package/src/lib/form/insert-form.d.ts.map +1 -0
  313. package/src/lib/form/insert-form.js +255 -0
  314. package/src/lib/form/insert-form.js.map +1 -0
  315. package/src/lib/form/insert-select-form-tree.d.ts +33 -0
  316. package/src/lib/form/insert-select-form-tree.d.ts.map +1 -0
  317. package/src/lib/form/insert-select-form-tree.js +144 -0
  318. package/src/lib/form/insert-select-form-tree.js.map +1 -0
  319. package/src/lib/form/insert-sub-form-field.d.ts +17 -0
  320. package/src/lib/form/insert-sub-form-field.d.ts.map +1 -0
  321. package/src/lib/form/insert-sub-form-field.js +41 -0
  322. package/src/lib/form/insert-sub-form-field.js.map +1 -0
  323. package/src/lib/form/make-form-tree-insert.d.ts +22 -0
  324. package/src/lib/form/make-form-tree-insert.d.ts.map +1 -0
  325. package/src/lib/form/make-form-tree-insert.js +43 -0
  326. package/src/lib/form/make-form-tree-insert.js.map +1 -0
  327. package/src/lib/form/target-form-field.d.ts +11 -0
  328. package/src/lib/form/target-form-field.d.ts.map +1 -0
  329. package/src/lib/form/target-form-field.js +1 -0
  330. package/src/lib/form/target-form-field.js.map +1 -0
  331. package/src/lib/form/validator.d.ts +174 -0
  332. package/src/lib/form/validator.d.ts.map +1 -0
  333. package/src/lib/form/validator.js +465 -0
  334. package/src/lib/form/validator.js.map +1 -0
  335. package/src/lib/from-event-to-source$.d.ts +210 -0
  336. package/src/lib/from-event-to-source$.d.ts.map +1 -0
  337. package/src/lib/from-event-to-source$.js +29 -0
  338. package/src/lib/from-event-to-source$.js.map +1 -0
  339. package/src/lib/global-persister-handler.service.d.ts +10 -0
  340. package/src/lib/global-persister-handler.service.d.ts.map +1 -0
  341. package/src/lib/global-persister-handler.service.js +40 -0
  342. package/src/lib/global-persister-handler.service.js.map +1 -0
  343. package/src/lib/host/craft-compat.d.ts +242 -0
  344. package/src/lib/host/craft-compat.d.ts.map +1 -0
  345. package/src/lib/host/craft-compat.js +444 -0
  346. package/src/lib/host/craft-compat.js.map +1 -0
  347. package/src/lib/host/craft-dom.d.ts +16 -0
  348. package/src/lib/host/craft-dom.d.ts.map +1 -0
  349. package/src/lib/host/craft-dom.js +24 -0
  350. package/src/lib/host/craft-dom.js.map +1 -0
  351. package/src/lib/host/craft-http.d.ts +22 -0
  352. package/src/lib/host/craft-http.d.ts.map +1 -0
  353. package/src/lib/host/craft-http.js +80 -0
  354. package/src/lib/host/craft-http.js.map +1 -0
  355. package/src/lib/host/craft-injector-host.d.ts +3 -0
  356. package/src/lib/host/craft-injector-host.d.ts.map +1 -0
  357. package/src/lib/host/craft-injector-host.js +2 -0
  358. package/src/lib/host/craft-injector-host.js.map +1 -0
  359. package/src/lib/host/craft-injector.d.ts +40 -0
  360. package/src/lib/host/craft-injector.d.ts.map +1 -0
  361. package/src/lib/host/craft-injector.js +318 -0
  362. package/src/lib/host/craft-injector.js.map +1 -0
  363. package/src/lib/host/craft-linked-signal.d.ts +17 -0
  364. package/src/lib/host/craft-linked-signal.d.ts.map +1 -0
  365. package/src/lib/host/craft-linked-signal.js +86 -0
  366. package/src/lib/host/craft-linked-signal.js.map +1 -0
  367. package/src/lib/host/craft-router-runtime.d.ts +61 -0
  368. package/src/lib/host/craft-router-runtime.d.ts.map +1 -0
  369. package/src/lib/host/craft-router-runtime.js +456 -0
  370. package/src/lib/host/craft-router-runtime.js.map +1 -0
  371. package/src/lib/host/craft-router-types.d.ts +84 -0
  372. package/src/lib/host/craft-router-types.d.ts.map +1 -0
  373. package/src/lib/host/craft-router-types.js +35 -0
  374. package/src/lib/host/craft-router-types.js.map +1 -0
  375. package/src/lib/host/craft-signal.d.ts +45 -0
  376. package/src/lib/host/craft-signal.d.ts.map +1 -0
  377. package/src/lib/host/craft-signal.js +161 -0
  378. package/src/lib/host/craft-signal.js.map +1 -0
  379. package/src/lib/host/craft-test-bed.d.ts +63 -0
  380. package/src/lib/host/craft-test-bed.d.ts.map +1 -0
  381. package/src/lib/host/craft-test-bed.js +114 -0
  382. package/src/lib/host/craft-test-bed.js.map +1 -0
  383. package/src/lib/host-tag.d.ts +2 -0
  384. package/src/lib/host-tag.d.ts.map +1 -0
  385. package/src/lib/host-tag.js +2 -0
  386. package/src/lib/host-tag.js.map +1 -0
  387. package/src/lib/insert-entities.d.ts +131 -0
  388. package/src/lib/insert-entities.d.ts.map +1 -0
  389. package/src/lib/insert-entities.js +159 -0
  390. package/src/lib/insert-entities.js.map +1 -0
  391. package/src/lib/insert-noop-typing-anchor.d.ts +15 -0
  392. package/src/lib/insert-noop-typing-anchor.d.ts.map +1 -0
  393. package/src/lib/insert-noop-typing-anchor.js +16 -0
  394. package/src/lib/insert-noop-typing-anchor.js.map +1 -0
  395. package/src/lib/insert-pagination-placeholder-data.d.ts +122 -0
  396. package/src/lib/insert-pagination-placeholder-data.d.ts.map +1 -0
  397. package/src/lib/insert-pagination-placeholder-data.js +244 -0
  398. package/src/lib/insert-pagination-placeholder-data.js.map +1 -0
  399. package/src/lib/insert-react-on-mutation.d.ts +261 -0
  400. package/src/lib/insert-react-on-mutation.d.ts.map +1 -0
  401. package/src/lib/insert-react-on-mutation.js +227 -0
  402. package/src/lib/insert-react-on-mutation.js.map +1 -0
  403. package/src/lib/insert-select-resource.d.ts +31 -0
  404. package/src/lib/insert-select-resource.d.ts.map +1 -0
  405. package/src/lib/insert-select-resource.js +27 -0
  406. package/src/lib/insert-select-resource.js.map +1 -0
  407. package/src/lib/insert-select.d.ts +126 -0
  408. package/src/lib/insert-select.d.ts.map +1 -0
  409. package/src/lib/insert-select.js +535 -0
  410. package/src/lib/insert-select.js.map +1 -0
  411. package/src/lib/insert-storage-persister.d.ts +27 -0
  412. package/src/lib/insert-storage-persister.d.ts.map +1 -0
  413. package/src/lib/insert-storage-persister.js +65 -0
  414. package/src/lib/insert-storage-persister.js.map +1 -0
  415. package/src/lib/insert-typed-pipes.d.ts +64 -0
  416. package/src/lib/insert-typed-pipes.d.ts.map +1 -0
  417. package/src/lib/insert-typed-pipes.js +32 -0
  418. package/src/lib/insert-typed-pipes.js.map +1 -0
  419. package/src/lib/linked-source.d.ts +8 -0
  420. package/src/lib/linked-source.d.ts.map +1 -0
  421. package/src/lib/linked-source.js +24 -0
  422. package/src/lib/linked-source.js.map +1 -0
  423. package/src/lib/local-storage-persister.d.ts +4 -0
  424. package/src/lib/local-storage-persister.d.ts.map +1 -0
  425. package/src/lib/local-storage-persister.js +342 -0
  426. package/src/lib/local-storage-persister.js.map +1 -0
  427. package/src/lib/middleware-schema-shared.d.ts +67 -0
  428. package/src/lib/middleware-schema-shared.d.ts.map +1 -0
  429. package/src/lib/middleware-schema-shared.js +34 -0
  430. package/src/lib/middleware-schema-shared.js.map +1 -0
  431. package/src/lib/mock-http-request-for-route.d.ts +173 -0
  432. package/src/lib/mock-http-request-for-route.d.ts.map +1 -0
  433. package/src/lib/mock-http-request-for-route.js +127 -0
  434. package/src/lib/mock-http-request-for-route.js.map +1 -0
  435. package/src/lib/mutation.d.ts +332 -0
  436. package/src/lib/mutation.d.ts.map +1 -0
  437. package/src/lib/mutation.js +923 -0
  438. package/src/lib/mutation.js.map +1 -0
  439. package/src/lib/on$.d.ts +26 -0
  440. package/src/lib/on$.d.ts.map +1 -0
  441. package/src/lib/on$.js +19 -0
  442. package/src/lib/on$.js.map +1 -0
  443. package/src/lib/portable-server-function.d.ts +68 -0
  444. package/src/lib/portable-server-function.d.ts.map +1 -0
  445. package/src/lib/portable-server-function.js +97 -0
  446. package/src/lib/portable-server-function.js.map +1 -0
  447. package/src/lib/preserved-resource.d.ts +4 -0
  448. package/src/lib/preserved-resource.d.ts.map +1 -0
  449. package/src/lib/preserved-resource.js +60 -0
  450. package/src/lib/preserved-resource.js.map +1 -0
  451. package/src/lib/primitive-method-runtime-context.d.ts +28 -0
  452. package/src/lib/primitive-method-runtime-context.d.ts.map +1 -0
  453. package/src/lib/primitive-method-runtime-context.js +38 -0
  454. package/src/lib/primitive-method-runtime-context.js.map +1 -0
  455. package/src/lib/primitive-resource-runtime-context.d.ts +46 -0
  456. package/src/lib/primitive-resource-runtime-context.d.ts.map +1 -0
  457. package/src/lib/primitive-resource-runtime-context.js +102 -0
  458. package/src/lib/primitive-resource-runtime-context.js.map +1 -0
  459. package/src/lib/query-params.d.ts +216 -0
  460. package/src/lib/query-params.d.ts.map +1 -0
  461. package/src/lib/query-params.js +324 -0
  462. package/src/lib/query-params.js.map +1 -0
  463. package/src/lib/query.core.d.ts +214 -0
  464. package/src/lib/query.core.d.ts.map +1 -0
  465. package/src/lib/query.core.js +210 -0
  466. package/src/lib/query.core.js.map +1 -0
  467. package/src/lib/query.d.ts +324 -0
  468. package/src/lib/query.d.ts.map +1 -0
  469. package/src/lib/query.js +971 -0
  470. package/src/lib/query.js.map +1 -0
  471. package/src/lib/reactive-read.d.ts +162 -0
  472. package/src/lib/reactive-read.d.ts.map +1 -0
  473. package/src/lib/reactive-read.js +389 -0
  474. package/src/lib/reactive-read.js.map +1 -0
  475. package/src/lib/resource-by-id.d.ts +71 -0
  476. package/src/lib/resource-by-id.d.ts.map +1 -0
  477. package/src/lib/resource-by-id.js +294 -0
  478. package/src/lib/resource-by-id.js.map +1 -0
  479. package/src/lib/resource-exception.d.ts +30 -0
  480. package/src/lib/resource-exception.d.ts.map +1 -0
  481. package/src/lib/resource-exception.js +86 -0
  482. package/src/lib/resource-exception.js.map +1 -0
  483. package/src/lib/route-checked-di.d.ts +229 -0
  484. package/src/lib/route-checked-di.d.ts.map +1 -0
  485. package/src/lib/route-checked-di.js +1 -0
  486. package/src/lib/route-checked-di.js.map +1 -0
  487. package/src/lib/schema-validation.d.ts +89 -0
  488. package/src/lib/schema-validation.d.ts.map +1 -0
  489. package/src/lib/schema-validation.js +110 -0
  490. package/src/lib/schema-validation.js.map +1 -0
  491. package/src/lib/send-context-to-ai.d.ts +20 -0
  492. package/src/lib/send-context-to-ai.d.ts.map +1 -0
  493. package/src/lib/send-context-to-ai.js +18 -0
  494. package/src/lib/send-context-to-ai.js.map +1 -0
  495. package/src/lib/send-context-to-ai.tokens.d.ts +12 -0
  496. package/src/lib/send-context-to-ai.tokens.d.ts.map +1 -0
  497. package/src/lib/send-context-to-ai.tokens.js +1 -0
  498. package/src/lib/send-context-to-ai.tokens.js.map +1 -0
  499. package/src/lib/server-function-client.d.ts +102 -0
  500. package/src/lib/server-function-client.d.ts.map +1 -0
  501. package/src/lib/server-function-client.js +106 -0
  502. package/src/lib/server-function-client.js.map +1 -0
  503. package/src/lib/server-function-contract.d.ts +42 -0
  504. package/src/lib/server-function-contract.d.ts.map +1 -0
  505. package/src/lib/server-function-contract.js +23 -0
  506. package/src/lib/server-function-contract.js.map +1 -0
  507. package/src/lib/server-function-middleware.d.ts +222 -0
  508. package/src/lib/server-function-middleware.d.ts.map +1 -0
  509. package/src/lib/server-function-middleware.js +189 -0
  510. package/src/lib/server-function-middleware.js.map +1 -0
  511. package/src/lib/server-function.d.ts +114 -0
  512. package/src/lib/server-function.d.ts.map +1 -0
  513. package/src/lib/server-function.js +80 -0
  514. package/src/lib/server-function.js.map +1 -0
  515. package/src/lib/server-layer.d.ts +185 -0
  516. package/src/lib/server-layer.d.ts.map +1 -0
  517. package/src/lib/server-layer.js +121 -0
  518. package/src/lib/server-layer.js.map +1 -0
  519. package/src/lib/server.d.ts +83 -0
  520. package/src/lib/server.d.ts.map +1 -0
  521. package/src/lib/server.js +266 -0
  522. package/src/lib/server.js.map +1 -0
  523. package/src/lib/setup-craft-service-test.d.ts +90 -0
  524. package/src/lib/setup-craft-service-test.d.ts.map +1 -0
  525. package/src/lib/setup-craft-service-test.js +193 -0
  526. package/src/lib/setup-craft-service-test.js.map +1 -0
  527. package/src/lib/setup-craft-service-testing-by-register.d.ts +245 -0
  528. package/src/lib/setup-craft-service-testing-by-register.d.ts.map +1 -0
  529. package/src/lib/setup-craft-service-testing-by-register.js +316 -0
  530. package/src/lib/setup-craft-service-testing-by-register.js.map +1 -0
  531. package/src/lib/signal-proxy.d.ts +21 -0
  532. package/src/lib/signal-proxy.d.ts.map +1 -0
  533. package/src/lib/signal-proxy.js +79 -0
  534. package/src/lib/signal-proxy.js.map +1 -0
  535. package/src/lib/signal-source.d.ts +392 -0
  536. package/src/lib/signal-source.d.ts.map +1 -0
  537. package/src/lib/signal-source.js +433 -0
  538. package/src/lib/signal-source.js.map +1 -0
  539. package/src/lib/source$.d.ts +121 -0
  540. package/src/lib/source$.d.ts.map +1 -0
  541. package/src/lib/source$.js +171 -0
  542. package/src/lib/source$.js.map +1 -0
  543. package/src/lib/source-from-event.d.ts +350 -0
  544. package/src/lib/source-from-event.d.ts.map +1 -0
  545. package/src/lib/source-from-event.js +26 -0
  546. package/src/lib/source-from-event.js.map +1 -0
  547. package/src/lib/stacked-source.d.ts +6 -0
  548. package/src/lib/stacked-source.d.ts.map +1 -0
  549. package/src/lib/stacked-source.js +29 -0
  550. package/src/lib/stacked-source.js.map +1 -0
  551. package/src/lib/standard-schema.d.ts +43 -0
  552. package/src/lib/standard-schema.d.ts.map +1 -0
  553. package/src/lib/standard-schema.js +1 -0
  554. package/src/lib/standard-schema.js.map +1 -0
  555. package/src/lib/state-method-runtime-context.d.ts +13 -0
  556. package/src/lib/state-method-runtime-context.d.ts.map +1 -0
  557. package/src/lib/state-method-runtime-context.js +11 -0
  558. package/src/lib/state-method-runtime-context.js.map +1 -0
  559. package/src/lib/state.d.ts +158 -0
  560. package/src/lib/state.d.ts.map +1 -0
  561. package/src/lib/state.js +388 -0
  562. package/src/lib/state.js.map +1 -0
  563. package/src/lib/storage-persister.service.d.ts +25 -0
  564. package/src/lib/storage-persister.service.d.ts.map +1 -0
  565. package/src/lib/storage-persister.service.js +27 -0
  566. package/src/lib/storage-persister.service.js.map +1 -0
  567. package/src/lib/take-app-snapshot.d.ts +31 -0
  568. package/src/lib/take-app-snapshot.d.ts.map +1 -0
  569. package/src/lib/take-app-snapshot.js +93 -0
  570. package/src/lib/take-app-snapshot.js.map +1 -0
  571. package/src/lib/template-trace.d.ts +37 -0
  572. package/src/lib/template-trace.d.ts.map +1 -0
  573. package/src/lib/template-trace.js +37 -0
  574. package/src/lib/template-trace.js.map +1 -0
  575. package/src/lib/temporal-runtime.d.ts +146 -0
  576. package/src/lib/temporal-runtime.d.ts.map +1 -0
  577. package/src/lib/temporal-runtime.js +375 -0
  578. package/src/lib/temporal-runtime.js.map +1 -0
  579. package/src/lib/to-source.d.ts +335 -0
  580. package/src/lib/to-source.d.ts.map +1 -0
  581. package/src/lib/to-source.js +359 -0
  582. package/src/lib/to-source.js.map +1 -0
  583. package/src/lib/util/craft-resource-ref.d.ts +29 -0
  584. package/src/lib/util/craft-resource-ref.d.ts.map +1 -0
  585. package/src/lib/util/craft-resource-ref.js +1 -0
  586. package/src/lib/util/craft-resource-ref.js.map +1 -0
  587. package/src/lib/util/craft-resource-status.d.ts +17 -0
  588. package/src/lib/util/craft-resource-status.d.ts.map +1 -0
  589. package/src/lib/util/craft-resource-status.js +14 -0
  590. package/src/lib/util/craft-resource-status.js.map +1 -0
  591. package/src/lib/util/entities-util.d.ts +340 -0
  592. package/src/lib/util/entities-util.d.ts.map +1 -0
  593. package/src/lib/util/entities-util.js +136 -0
  594. package/src/lib/util/entities-util.js.map +1 -0
  595. package/src/lib/util/explicit-effect.d.ts +42 -0
  596. package/src/lib/util/explicit-effect.d.ts.map +1 -0
  597. package/src/lib/util/explicit-effect.js +37 -0
  598. package/src/lib/util/explicit-effect.js.map +1 -0
  599. package/src/lib/util/extract-signal-props-and-methods.d.ts +20 -0
  600. package/src/lib/util/extract-signal-props-and-methods.d.ts.map +1 -0
  601. package/src/lib/util/extract-signal-props-and-methods.js +1 -0
  602. package/src/lib/util/extract-signal-props-and-methods.js.map +1 -0
  603. package/src/lib/util/method-trigger-nonce.d.ts +45 -0
  604. package/src/lib/util/method-trigger-nonce.d.ts.map +1 -0
  605. package/src/lib/util/method-trigger-nonce.js +58 -0
  606. package/src/lib/util/method-trigger-nonce.js.map +1 -0
  607. package/src/lib/util/persister.type.d.ts +37 -0
  608. package/src/lib/util/persister.type.d.ts.map +1 -0
  609. package/src/lib/util/persister.type.js +1 -0
  610. package/src/lib/util/persister.type.js.map +1 -0
  611. package/src/lib/util/persister.util.d.ts +8 -0
  612. package/src/lib/util/persister.util.d.ts.map +1 -0
  613. package/src/lib/util/persister.util.js +71 -0
  614. package/src/lib/util/persister.util.js.map +1 -0
  615. package/src/lib/util/react-on-mutation-effect.d.ts +16 -0
  616. package/src/lib/util/react-on-mutation-effect.d.ts.map +1 -0
  617. package/src/lib/util/react-on-mutation-effect.js +148 -0
  618. package/src/lib/util/react-on-mutation-effect.js.map +1 -0
  619. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +27 -0
  620. package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +1 -0
  621. package/src/lib/util/resource-by-id-changes-tracker.util.js +97 -0
  622. package/src/lib/util/resource-by-id-changes-tracker.util.js.map +1 -0
  623. package/src/lib/util/source.type.d.ts +6 -0
  624. package/src/lib/util/source.type.d.ts.map +1 -0
  625. package/src/lib/util/source.type.js +1 -0
  626. package/src/lib/util/source.type.js.map +1 -0
  627. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +4 -0
  628. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +1 -0
  629. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +1 -0
  630. package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +1 -0
  631. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +27 -0
  632. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +1 -0
  633. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +1 -0
  634. package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +1 -0
  635. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +24 -0
  636. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +1 -0
  637. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +1 -0
  638. package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +1 -0
  639. package/src/lib/util/types/brand.d.ts +7 -0
  640. package/src/lib/util/types/brand.d.ts.map +1 -0
  641. package/src/lib/util/types/brand.js +9 -0
  642. package/src/lib/util/types/brand.js.map +1 -0
  643. package/src/lib/util/types/object-deep-path-mapper.type.d.ts +13 -0
  644. package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +1 -0
  645. package/src/lib/util/types/object-deep-path-mapper.type.js +1 -0
  646. package/src/lib/util/types/object-deep-path-mapper.type.js.map +1 -0
  647. package/src/lib/util/types/resource-by-id-config.type.d.ts +115 -0
  648. package/src/lib/util/types/resource-by-id-config.type.d.ts.map +1 -0
  649. package/src/lib/util/types/resource-by-id-config.type.js +1 -0
  650. package/src/lib/util/types/resource-by-id-config.type.js.map +1 -0
  651. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +52 -0
  652. package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +1 -0
  653. package/src/lib/util/types/resource-with-params-or-params-fn.type.js +1 -0
  654. package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +1 -0
  655. package/src/lib/util/types/shared.type.d.ts +66 -0
  656. package/src/lib/util/types/shared.type.d.ts.map +1 -0
  657. package/src/lib/util/types/shared.type.js +1 -0
  658. package/src/lib/util/types/shared.type.js.map +1 -0
  659. package/src/lib/util/types/util.d.ts +16 -0
  660. package/src/lib/util/types/util.d.ts.map +1 -0
  661. package/src/lib/util/types/util.js +60 -0
  662. package/src/lib/util/types/util.js.map +1 -0
  663. package/src/lib/util/types/util.type.d.ts +67 -0
  664. package/src/lib/util/types/util.type.d.ts.map +1 -0
  665. package/src/lib/util/types/util.type.js +5 -0
  666. package/src/lib/util/types/util.type.js.map +1 -0
  667. package/src/lib/util/update-state.util.d.ts +10 -0
  668. package/src/lib/util/update-state.util.d.ts.map +1 -0
  669. package/src/lib/util/update-state.util.js +31 -0
  670. package/src/lib/util/update-state.util.js.map +1 -0
  671. package/src/lib/util/util.d.ts +19 -0
  672. package/src/lib/util/util.d.ts.map +1 -0
  673. package/src/lib/util/util.js +50 -0
  674. package/src/lib/util/util.js.map +1 -0
  675. package/src/lib/util/util.type.d.ts +107 -0
  676. package/src/lib/util/util.type.d.ts.map +1 -0
  677. package/src/lib/util/util.type.js +9 -0
  678. package/src/lib/util/util.type.js.map +1 -0
  679. package/src/lib/yieldable.d.ts +94 -0
  680. package/src/lib/yieldable.d.ts.map +1 -0
  681. package/src/lib/yieldable.js +109 -0
  682. package/src/lib/yieldable.js.map +1 -0
@@ -0,0 +1,22 @@
1
+ import { InjectionToken, } from './host/craft-compat';
2
+ import { CRAFT_REGISTRATION_TARGET, } from './craft-register-for-runtime';
3
+ /** Runtime marker shared by core-authored DOM directives and the Craft renderer. */
4
+ export const CRAFT_NODE_DIRECTIVE = Symbol.for('@craft-ts/core/craft-node-directive');
5
+ export const CRAFT_NODE_EFFECT_FACTORY = new InjectionToken('CRAFT_NODE_EFFECT_FACTORY');
6
+ /** Creates a functional directive mounted directly on a rendered DOM node. */
7
+ export function craftNodeDirective(name, inputs, mount) {
8
+ const directive = (() => undefined);
9
+ Object.defineProperty(directive, CRAFT_NODE_DIRECTIVE, {
10
+ value: { name, inputs, mount },
11
+ enumerable: false,
12
+ });
13
+ Object.defineProperty(directive, CRAFT_REGISTRATION_TARGET, {
14
+ value: { kind: 'directive', name },
15
+ enumerable: false,
16
+ });
17
+ return directive;
18
+ }
19
+ export function isCraftNodeDirective(value) {
20
+ return typeof value === 'function' && CRAFT_NODE_DIRECTIVE in value;
21
+ }
22
+ //# sourceMappingURL=craft-node-directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-node-directive.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-node-directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,yBAAyB,GAE1B,MAAM,8BAA8B,CAAC;AAGtC,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAC5C,qCAAqC,CACtC,CAAC;AAQF,MAAM,CAAC,MAAM,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,CAAC,CAAC;AA8C1E,8EAA8E;AAC9E,MAAM,UAAU,kBAAkB,CAGhC,IAAY,EACZ,MAAyC,EACzC,KAAqC;IAErC,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAyC,CAAC;IAE5E,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE;QACrD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;QAC9B,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,yBAAyB,EAAE;QAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE;QAClC,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,oBAAoB,IAAI,KAAK,CAAC;AACtE,CAAC","sourcesContent":["import {\n InjectionToken,\n type EffectRef,\n type Injector,\n} from './host/craft-compat';\nimport {\n CRAFT_REGISTRATION_TARGET,\n type CraftRegistrationTarget,\n} from './craft-register-for-runtime';\nimport type { CraftDomAdapter } from './host/craft-dom';\n\n/** Runtime marker shared by core-authored DOM directives and the Craft renderer. */\nexport const CRAFT_NODE_DIRECTIVE = Symbol.for(\n '@craft-ts/core/craft-node-directive',\n);\n\n/** Creates a reactive effect owned by the current node-directive mount. */\nexport type CraftNodeEffectFactory = (\n name: string,\n effectFn: () => void,\n) => EffectRef;\n\nexport const CRAFT_NODE_EFFECT_FACTORY =\n new InjectionToken<CraftNodeEffectFactory>('CRAFT_NODE_EFFECT_FACTORY');\n\n/** The element-scoped services and reactive inputs available to a DOM directive. */\nexport interface CraftNodeDirectiveContext<\n Props extends Readonly<Record<string, unknown>> = Readonly<\n Record<string, unknown>\n >,\n> {\n readonly element: Element;\n readonly injector: Injector;\n readonly renderer: CraftDomAdapter;\n /**\n * The current directive inputs. Reading this property inside an effect tracks\n * input updates without remounting the directive.\n */\n readonly props: Props;\n}\n\nexport type CraftNodeDirectiveMount<\n Props extends Readonly<Record<string, unknown>> = Readonly<\n Record<string, unknown>\n >,\n> = (context: CraftNodeDirectiveContext<Props>) => void | (() => void);\n\nexport interface CraftNodeDirectiveDefinition<\n Props extends Readonly<Record<string, unknown>> = Readonly<\n Record<string, unknown>\n >,\n> {\n readonly name: string;\n readonly inputs: readonly (keyof Props & string)[];\n readonly mount: CraftNodeDirectiveMount<Props>;\n}\n\nexport interface CraftNodeDirective<\n Props extends Readonly<Record<string, unknown>> = Readonly<\n Record<string, unknown>\n >,\n> extends CraftRegistrationTarget<\n string,\n 'directive',\n CraftNodeDirectiveContext<Props>\n > {\n readonly [CRAFT_NODE_DIRECTIVE]: CraftNodeDirectiveDefinition<Props>;\n}\n\n/** Creates a functional directive mounted directly on a rendered DOM node. */\nexport function craftNodeDirective<\n const Props extends Readonly<Record<string, unknown>>,\n>(\n name: string,\n inputs: readonly (keyof Props & string)[],\n mount: CraftNodeDirectiveMount<Props>,\n): CraftNodeDirective<Props> {\n const directive = (() => undefined) as unknown as CraftNodeDirective<Props>;\n\n Object.defineProperty(directive, CRAFT_NODE_DIRECTIVE, {\n value: { name, inputs, mount },\n enumerable: false,\n });\n Object.defineProperty(directive, CRAFT_REGISTRATION_TARGET, {\n value: { kind: 'directive', name },\n enumerable: false,\n });\n\n return directive;\n}\n\nexport function isCraftNodeDirective(\n value: unknown,\n): value is CraftNodeDirective<any> {\n return typeof value === 'function' && CRAFT_NODE_DIRECTIVE in value;\n}\n"]}
@@ -0,0 +1,115 @@
1
+ import { InjectionToken, type Provider, type Signal } from './host/craft-compat';
2
+ import type { CraftExceptionComponentDescriptor } from './craft-route-exceptions';
3
+ import { type CraftRouteTargetInput } from './craft-route-target';
4
+ /**
5
+ * The text rendered by {@link DefaultCraftPendingComponent}. A `Signal<string>`
6
+ * so a reactive translation source can be plugged in via {@link withLoadingText}.
7
+ *
8
+ * The default reads {@link LOCALE_ID} and picks a built-in translation (English
9
+ * and French shipped; unknown locales fall back to English).
10
+ */
11
+ export declare const CRAFT_LOADING_TEXT: InjectionToken<Signal<string>>;
12
+ /**
13
+ * Installs the real loader. `@craft-ts/component` calls this on import, since
14
+ * rendering anything at all needs the renderer that only it owns.
15
+ */
16
+ export declare function ɵregisterDefaultCraftPendingComponent(component: CraftRouteTargetInput): void;
17
+ /**
18
+ * The component (loader) shown in the **pending** phase — once both
19
+ * {@link CRAFT_STAY_MS} and {@link CRAFT_BLANK_MS} have elapsed and the route's
20
+ * guard/resolve chain is still in flight. Defaults to
21
+ * {@link DefaultCraftPendingComponent}.
22
+ */
23
+ export declare const CRAFT_PENDING_COMPONENT: InjectionToken<CraftRouteTargetInput>;
24
+ /**
25
+ * Phase 1 duration (ms): how long the outlet keeps the **previous page** on
26
+ * screen after the URL commits, before blanking it. A chain that settles within
27
+ * this window transitions straight to the target — no blank, no loader.
28
+ * Defaults to `300`.
29
+ */
30
+ export declare const CRAFT_STAY_MS: InjectionToken<number>;
31
+ /**
32
+ * Phase 2 duration (ms): how long the outlet shows a **blank** surface (after
33
+ * {@link CRAFT_STAY_MS}) before showing the pending component (loader). A chain
34
+ * that settles within this window transitions straight to the target without
35
+ * ever flashing the loader. Defaults to `300`.
36
+ */
37
+ export declare const CRAFT_BLANK_MS: InjectionToken<number>;
38
+ /**
39
+ * Phase 3 anti-flicker (ms): once the pending component (loader) is shown, keep
40
+ * it visible for at least this long so a chain that settles right after the
41
+ * loader appears does not blink it in and out. Defaults to `0` (no minimum).
42
+ */
43
+ export declare const CRAFT_PENDING_MIN_MS: InjectionToken<number>;
44
+ /**
45
+ * The application-wide global error component, rendered by the outlet when a
46
+ * route exception handler delegates to `globalError()`. `null` until configured
47
+ * via {@link withErrorComponent}; the global error component reads its (typed)
48
+ * exception with `injectCraftGlobalError()`.
49
+ */
50
+ export declare const CRAFT_ERROR_COMPONENT: InjectionToken<CraftExceptionComponentDescriptor | null>;
51
+ declare const CRAFT_LOADING_FEATURE: unique symbol;
52
+ /**
53
+ * An opaque unit of pending/error configuration produced by a `with*` helper and
54
+ * consumed by {@link provideCraftLoading}. Mirrors Angular's `provideRouter`
55
+ * feature pattern so config reads as `provideCraftLoading(withX(), withY())`.
56
+ */
57
+ export interface CraftLoadingFeature {
58
+ readonly [CRAFT_LOADING_FEATURE]: true;
59
+ readonly providers: Provider[];
60
+ readonly routerFeatures?: readonly unknown[];
61
+ readonly recoveryRoute?: unknown;
62
+ }
63
+ /**
64
+ * Builds an opaque {@link CraftLoadingFeature} from a provider list. Shared with
65
+ * sibling loading features (e.g. `withCraftViewTransitions`) so they all flow
66
+ * through {@link provideCraftLoading} / {@link isCraftLoadingFeature}.
67
+ */
68
+ export declare function craftLoadingFeature(providers: Provider[]): CraftLoadingFeature;
69
+ /**
70
+ * Runtime guard distinguishing a {@link CraftLoadingFeature} (produced by a
71
+ * `with*` loading helper) from any other value — notably an Angular
72
+ * `RouterFeature`. Lets {@link provideCraftRouter} accept loading and router
73
+ * features mixed in a single call and split them apart.
74
+ */
75
+ export declare function isCraftLoadingFeature(value: unknown): value is CraftLoadingFeature;
76
+ /** Override the pending component shown while a route chain is in flight. */
77
+ export declare function withPendingComponent(component: CraftRouteTargetInput): CraftLoadingFeature;
78
+ /**
79
+ * Override the loading text rendered by {@link DefaultCraftPendingComponent}.
80
+ * The factory runs in an injection context, so it may read a translation
81
+ * service and return a reactive `Signal<string>`.
82
+ */
83
+ export declare function withLoadingText(factory: () => Signal<string>): CraftLoadingFeature;
84
+ /**
85
+ * Override the navigation transition timings (in ms):
86
+ *
87
+ * - `stayMs` — phase 1, how long the previous page is kept on screen;
88
+ * - `blankMs` — phase 2, how long the blank surface is shown before the loader;
89
+ * - `pendingMinMs` — phase 3, minimum time the loader stays once shown.
90
+ *
91
+ * Only the provided keys are overridden.
92
+ */
93
+ export declare function withTransitionTimings(thresholds: {
94
+ stayMs?: number;
95
+ blankMs?: number;
96
+ pendingMinMs?: number;
97
+ }): CraftLoadingFeature;
98
+ /** Register the application-wide global error component (see `globalError()`). */
99
+ export declare function withErrorComponent(component: CraftExceptionComponentDescriptor): CraftLoadingFeature;
100
+ /**
101
+ * Configures the {@link CraftRouterOutletController} pending/error surface.
102
+ *
103
+ * ```ts
104
+ * provideCraftLoading(
105
+ * withTransitionTimings({ stayMs: 300, blankMs: 300, pendingMinMs: 500 }),
106
+ * withLoadingText(() => computed(() => translate('common.loading'))),
107
+ * withPendingComponent(MyBrandedSpinner),
108
+ * // Check the functional error SFC separately through ComponentDepsOf.
109
+ * withErrorComponent({ component: CraftGlobalErrorComponentHost }),
110
+ * )
111
+ * ```
112
+ */
113
+ export declare function provideCraftLoading(...features: CraftLoadingFeature[]): Provider[];
114
+ export {};
115
+ //# sourceMappingURL=craft-pending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-pending.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-pending.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAGd,KAAK,QAAQ,EACb,KAAK,MAAM,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iCAAiC,E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AC,UAAU,EAAE;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,mBAAmB,CAmBtB;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,iCAAiC,GAC3C,mBAAmB,CAIrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,QAAQ,EAAE,mBAAmB,EAAE,GACjC,QAAQ,EAAE,CAEZ"}
@@ -0,0 +1,187 @@
1
+ import { inject, InjectionToken, LOCALE_ID, signal, } from './host/craft-compat';
2
+ import { craftRouteTarget, } from './craft-route-target';
3
+ /**
4
+ * The non-blocking router outlet ({@link CraftRouterOutletController}) commits
5
+ * the URL
6
+ * immediately, then runs the route's guard/resolve chain through three phases
7
+ * while it is in flight:
8
+ *
9
+ * 1. **stay** ({@link CRAFT_STAY_MS}) — the PREVIOUS page is kept on screen, so a
10
+ * chain that settles quickly transitions straight to the target with no flash;
11
+ * 2. **blank** ({@link CRAFT_BLANK_MS}) — a blank surface, signalling the page is
12
+ * changing;
13
+ * 3. **pending** — the configured pending component (loader), held for at least
14
+ * {@link CRAFT_PENDING_MIN_MS} to avoid flicker.
15
+ *
16
+ * The target component is mounted only once the chain succeeds.
17
+ *
18
+ * This module owns the pending UI surface: the default pending component, the
19
+ * DI tokens that parameterise it (component, loading text, phase thresholds,
20
+ * and the global error component), and the {@link provideCraftLoading} feature
21
+ * builder used to override them at the application root.
22
+ */
23
+ const CRAFT_LOADING_TEXT_BY_LANGUAGE = {
24
+ en: 'Loading…',
25
+ fr: 'Chargement…',
26
+ };
27
+ const DEFAULT_CRAFT_LOADING_LANGUAGE = 'en';
28
+ function resolveLoadingTextForLocale(locale) {
29
+ const language = locale.split('-')[0]?.toLowerCase() ?? '';
30
+ return (CRAFT_LOADING_TEXT_BY_LANGUAGE[language] ??
31
+ CRAFT_LOADING_TEXT_BY_LANGUAGE[DEFAULT_CRAFT_LOADING_LANGUAGE]);
32
+ }
33
+ /**
34
+ * The text rendered by {@link DefaultCraftPendingComponent}. A `Signal<string>`
35
+ * so a reactive translation source can be plugged in via {@link withLoadingText}.
36
+ *
37
+ * The default reads {@link LOCALE_ID} and picks a built-in translation (English
38
+ * and French shipped; unknown locales fall back to English).
39
+ */
40
+ export const CRAFT_LOADING_TEXT = new InjectionToken('CRAFT_LOADING_TEXT', {
41
+ providedIn: 'root',
42
+ factory: () => signal(resolveLoadingTextForLocale(inject(LOCALE_ID))),
43
+ });
44
+ let defaultCraftPendingComponent;
45
+ /**
46
+ * Installs the real loader. `@craft-ts/component` calls this on import, since
47
+ * rendering anything at all needs the renderer that only it owns.
48
+ */
49
+ export function ɵregisterDefaultCraftPendingComponent(component) {
50
+ defaultCraftPendingComponent = component;
51
+ }
52
+ /**
53
+ * Core alone can render nothing, so the fallback is an empty target rather
54
+ * than a throw: a router used without `@craft-ts/component` still navigates,
55
+ * it just shows nothing during the pending phase.
56
+ */
57
+ function getDefaultCraftPendingComponent() {
58
+ return defaultCraftPendingComponent ?? craftRouteTarget(null);
59
+ }
60
+ /**
61
+ * The component (loader) shown in the **pending** phase — once both
62
+ * {@link CRAFT_STAY_MS} and {@link CRAFT_BLANK_MS} have elapsed and the route's
63
+ * guard/resolve chain is still in flight. Defaults to
64
+ * {@link DefaultCraftPendingComponent}.
65
+ */
66
+ export const CRAFT_PENDING_COMPONENT = new InjectionToken('CRAFT_PENDING_COMPONENT', {
67
+ providedIn: 'root',
68
+ factory: () => getDefaultCraftPendingComponent(),
69
+ });
70
+ /**
71
+ * Phase 1 duration (ms): how long the outlet keeps the **previous page** on
72
+ * screen after the URL commits, before blanking it. A chain that settles within
73
+ * this window transitions straight to the target — no blank, no loader.
74
+ * Defaults to `300`.
75
+ */
76
+ export const CRAFT_STAY_MS = new InjectionToken('CRAFT_STAY_MS', {
77
+ providedIn: 'root',
78
+ factory: () => 300,
79
+ });
80
+ /**
81
+ * Phase 2 duration (ms): how long the outlet shows a **blank** surface (after
82
+ * {@link CRAFT_STAY_MS}) before showing the pending component (loader). A chain
83
+ * that settles within this window transitions straight to the target without
84
+ * ever flashing the loader. Defaults to `300`.
85
+ */
86
+ export const CRAFT_BLANK_MS = new InjectionToken('CRAFT_BLANK_MS', {
87
+ providedIn: 'root',
88
+ factory: () => 300,
89
+ });
90
+ /**
91
+ * Phase 3 anti-flicker (ms): once the pending component (loader) is shown, keep
92
+ * it visible for at least this long so a chain that settles right after the
93
+ * loader appears does not blink it in and out. Defaults to `0` (no minimum).
94
+ */
95
+ export const CRAFT_PENDING_MIN_MS = new InjectionToken('CRAFT_PENDING_MIN_MS', { providedIn: 'root', factory: () => 0 });
96
+ /**
97
+ * The application-wide global error component, rendered by the outlet when a
98
+ * route exception handler delegates to `globalError()`. `null` until configured
99
+ * via {@link withErrorComponent}; the global error component reads its (typed)
100
+ * exception with `injectCraftGlobalError()`.
101
+ */
102
+ export const CRAFT_ERROR_COMPONENT = new InjectionToken('CRAFT_ERROR_COMPONENT', { providedIn: 'root', factory: () => null });
103
+ const CRAFT_LOADING_FEATURE = Symbol('craft-loading-feature');
104
+ /**
105
+ * Builds an opaque {@link CraftLoadingFeature} from a provider list. Shared with
106
+ * sibling loading features (e.g. `withCraftViewTransitions`) so they all flow
107
+ * through {@link provideCraftLoading} / {@link isCraftLoadingFeature}.
108
+ */
109
+ export function craftLoadingFeature(providers) {
110
+ return { [CRAFT_LOADING_FEATURE]: true, providers };
111
+ }
112
+ /**
113
+ * Runtime guard distinguishing a {@link CraftLoadingFeature} (produced by a
114
+ * `with*` loading helper) from any other value — notably an Angular
115
+ * `RouterFeature`. Lets {@link provideCraftRouter} accept loading and router
116
+ * features mixed in a single call and split them apart.
117
+ */
118
+ export function isCraftLoadingFeature(value) {
119
+ return (typeof value === 'object' &&
120
+ value !== null &&
121
+ value[CRAFT_LOADING_FEATURE] ===
122
+ true);
123
+ }
124
+ /** Override the pending component shown while a route chain is in flight. */
125
+ export function withPendingComponent(component) {
126
+ return craftLoadingFeature([
127
+ { provide: CRAFT_PENDING_COMPONENT, useValue: component },
128
+ ]);
129
+ }
130
+ /**
131
+ * Override the loading text rendered by {@link DefaultCraftPendingComponent}.
132
+ * The factory runs in an injection context, so it may read a translation
133
+ * service and return a reactive `Signal<string>`.
134
+ */
135
+ export function withLoadingText(factory) {
136
+ return craftLoadingFeature([
137
+ { provide: CRAFT_LOADING_TEXT, useFactory: factory },
138
+ ]);
139
+ }
140
+ /**
141
+ * Override the navigation transition timings (in ms):
142
+ *
143
+ * - `stayMs` — phase 1, how long the previous page is kept on screen;
144
+ * - `blankMs` — phase 2, how long the blank surface is shown before the loader;
145
+ * - `pendingMinMs` — phase 3, minimum time the loader stays once shown.
146
+ *
147
+ * Only the provided keys are overridden.
148
+ */
149
+ export function withTransitionTimings(thresholds) {
150
+ const providers = [];
151
+ if (thresholds.stayMs !== undefined) {
152
+ providers.push({ provide: CRAFT_STAY_MS, useValue: thresholds.stayMs });
153
+ }
154
+ if (thresholds.blankMs !== undefined) {
155
+ providers.push({ provide: CRAFT_BLANK_MS, useValue: thresholds.blankMs });
156
+ }
157
+ if (thresholds.pendingMinMs !== undefined) {
158
+ providers.push({
159
+ provide: CRAFT_PENDING_MIN_MS,
160
+ useValue: thresholds.pendingMinMs,
161
+ });
162
+ }
163
+ return craftLoadingFeature(providers);
164
+ }
165
+ /** Register the application-wide global error component (see `globalError()`). */
166
+ export function withErrorComponent(component) {
167
+ return craftLoadingFeature([
168
+ { provide: CRAFT_ERROR_COMPONENT, useValue: component },
169
+ ]);
170
+ }
171
+ /**
172
+ * Configures the {@link CraftRouterOutletController} pending/error surface.
173
+ *
174
+ * ```ts
175
+ * provideCraftLoading(
176
+ * withTransitionTimings({ stayMs: 300, blankMs: 300, pendingMinMs: 500 }),
177
+ * withLoadingText(() => computed(() => translate('common.loading'))),
178
+ * withPendingComponent(MyBrandedSpinner),
179
+ * // Check the functional error SFC separately through ComponentDepsOf.
180
+ * withErrorComponent({ component: CraftGlobalErrorComponentHost }),
181
+ * )
182
+ * ```
183
+ */
184
+ export function provideCraftLoading(...features) {
185
+ return features.flatMap((feature) => feature.providers);
186
+ }
187
+ //# sourceMappingURL=craft-pending.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-pending.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-pending.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,EACd,SAAS,EACT,MAAM,GAGP,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,GAEjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,8BAA8B,GAAqC;IACvE,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,aAAa;CAClB,CAAC;AAEF,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAE5C,SAAS,2BAA2B,CAAC,MAAc;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAE3D,OAAO,CACL,8BAA8B,CAAC,QAAQ,CAAC;QACxC,8BAA8B,CAAC,8BAA8B,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAClD,oBAAoB,EACpB;IACE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CACtE,CACF,CAAC;AAEF,IAAI,4BAA+D,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CACnD,SAAgC;IAEhC,4BAA4B,GAAG,SAAS,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAS,+BAA+B;IACtC,OAAO,4BAA4B,IAAI,gB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AC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAG,QAA+B;IAElC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import {\n inject,\n InjectionToken,\n LOCALE_ID,\n signal,\n type Provider,\n type Signal,\n} from './host/craft-compat';\nimport type { CraftExceptionComponentDescriptor } from './craft-route-exceptions';\nimport {\n craftRouteTarget,\n type CraftRouteTargetInput,\n} from './craft-route-target';\n\n/**\n * The non-blocking router outlet ({@link CraftRouterOutletController}) commits\n * the URL\n * immediately, then runs the route's guard/resolve chain through three phases\n * while it is in flight:\n *\n * 1. **stay** ({@link CRAFT_STAY_MS}) — the PREVIOUS page is kept on screen, so a\n * chain that settles quickly transitions straight to the target with no flash;\n * 2. **blank** ({@link CRAFT_BLANK_MS}) — a blank surface, signalling the page is\n * changing;\n * 3. **pending** — the configured pending component (loader), held for at least\n * {@link CRAFT_PENDING_MIN_MS} to avoid flicker.\n *\n * The target component is mounted only once the chain succeeds.\n *\n * This module owns the pending UI surface: the default pending component, the\n * DI tokens that parameterise it (component, loading text, phase thresholds,\n * and the global error component), and the {@link provideCraftLoading} feature\n * builder used to override them at the application root.\n */\n\nconst CRAFT_LOADING_TEXT_BY_LANGUAGE: Readonly<Record<string, string>> = {\n en: 'Loading…',\n fr: 'Chargement…',\n};\n\nconst DEFAULT_CRAFT_LOADING_LANGUAGE = 'en';\n\nfunction resolveLoadingTextForLocale(locale: string): string {\n const language = locale.split('-')[0]?.toLowerCase() ?? '';\n\n return (\n CRAFT_LOADING_TEXT_BY_LANGUAGE[language] ??\n CRAFT_LOADING_TEXT_BY_LANGUAGE[DEFAULT_CRAFT_LOADING_LANGUAGE]\n );\n}\n\n/**\n * The text rendered by {@link DefaultCraftPendingComponent}. A `Signal<string>`\n * so a reactive translation source can be plugged in via {@link withLoadingText}.\n *\n * The default reads {@link LOCALE_ID} and picks a built-in translation (English\n * and French shipped; unknown locales fall back to English).\n */\nexport const CRAFT_LOADING_TEXT = new InjectionToken<Signal<string>>(\n 'CRAFT_LOADING_TEXT',\n {\n providedIn: 'root',\n factory: () => signal(resolveLoadingTextForLocale(inject(LOCALE_ID))),\n },\n);\n\nlet defaultCraftPendingComponent: CraftRouteTargetInput | undefined;\n\n/**\n * Installs the real loader. `@craft-ts/component` calls this on import, since\n * rendering anything at all needs the renderer that only it owns.\n */\nexport function ɵregisterDefaultCraftPendingComponent(\n component: CraftRouteTargetInput,\n): void {\n defaultCraftPendingComponent = component;\n}\n\n/**\n * Core alone can render nothing, so the fallback is an empty target rather\n * than a throw: a router used without `@craft-ts/component` still navigates,\n * it just shows nothing during the pending phase.\n */\nfunction getDefaultCraftPendingComponent(): CraftRouteTargetInput {\n return defaultCraftPendingComponent ?? craftRouteTarget(null);\n}\n\n/**\n * The component (loader) shown in the **pending** phase — once both\n * {@link CRAFT_STAY_MS} and {@link CRAFT_BLANK_MS} have elapsed and the route's\n * guard/resolve chain is still in flight. Defaults to\n * {@link DefaultCraftPendingComponent}.\n */\nexport const CRAFT_PENDING_COMPONENT =\n new InjectionToken<CraftRouteTargetInput>('CRAFT_PENDING_COMPONENT', {\n providedIn: 'root',\n factory: () => getDefaultCraftPendingComponent(),\n });\n\n/**\n * Phase 1 duration (ms): how long the outlet keeps the **previous page** on\n * screen after the URL commits, before blanking it. A chain that settles within\n * this window transitions straight to the target — no blank, no loader.\n * Defaults to `300`.\n */\nexport const CRAFT_STAY_MS = new InjectionToken<number>('CRAFT_STAY_MS', {\n providedIn: 'root',\n factory: () => 300,\n});\n\n/**\n * Phase 2 duration (ms): how long the outlet shows a **blank** surface (after\n * {@link CRAFT_STAY_MS}) before showing the pending component (loader). A chain\n * that settles within this window transitions straight to the target without\n * ever flashing the loader. Defaults to `300`.\n */\nexport const CRAFT_BLANK_MS = new InjectionToken<number>('CRAFT_BLANK_MS', {\n providedIn: 'root',\n factory: () => 300,\n});\n\n/**\n * Phase 3 anti-flicker (ms): once the pending component (loader) is shown, keep\n * it visible for at least this long so a chain that settles right after the\n * loader appears does not blink it in and out. Defaults to `0` (no minimum).\n */\nexport const CRAFT_PENDING_MIN_MS = new InjectionToken<number>(\n 'CRAFT_PENDING_MIN_MS',\n { providedIn: 'root', factory: () => 0 },\n);\n\n/**\n * The application-wide global error component, rendered by the outlet when a\n * route exception handler delegates to `globalError()`. `null` until configured\n * via {@link withErrorComponent}; the global error component reads its (typed)\n * exception with `injectCraftGlobalError()`.\n */\nexport const CRAFT_ERROR_COMPONENT =\n new InjectionToken<CraftExceptionComponentDescriptor | null>(\n 'CRAFT_ERROR_COMPONENT',\n { providedIn: 'root', factory: () => null },\n );\n\nconst CRAFT_LOADING_FEATURE = Symbol('craft-loading-feature');\n\n/**\n * An opaque unit of pending/error configuration produced by a `with*` helper and\n * consumed by {@link provideCraftLoading}. Mirrors Angular's `provideRouter`\n * feature pattern so config reads as `provideCraftLoading(withX(), withY())`.\n */\nexport interface CraftLoadingFeature {\n readonly [CRAFT_LOADING_FEATURE]: true;\n readonly providers: Provider[];\n readonly routerFeatures?: readonly unknown[];\n readonly recoveryRoute?: unknown;\n}\n\n/**\n * Builds an opaque {@link CraftLoadingFeature} from a provider list. Shared with\n * sibling loading features (e.g. `withCraftViewTransitions`) so they all flow\n * through {@link provideCraftLoading} / {@link isCraftLoadingFeature}.\n */\nexport function craftLoadingFeature(\n providers: Provider[],\n): CraftLoadingFeature {\n return { [CRAFT_LOADING_FEATURE]: true, providers };\n}\n\n/**\n * Runtime guard distinguishing a {@link CraftLoadingFeature} (produced by a\n * `with*` loading helper) from any other value — notably an Angular\n * `RouterFeature`. Lets {@link provideCraftRouter} accept loading and router\n * features mixed in a single call and split them apart.\n */\nexport function isCraftLoadingFeature(\n value: unknown,\n): value is CraftLoadingFeature {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { [CRAFT_LOADING_FEATURE]?: unknown })[CRAFT_LOADING_FEATURE] ===\n true\n );\n}\n\n/** Override the pending component shown while a route chain is in flight. */\nexport function withPendingComponent(\n component: CraftRouteTargetInput,\n): CraftLoadingFeature {\n return craftLoadingFeature([\n { provide: CRAFT_PENDING_COMPONENT, useValue: component },\n ]);\n}\n\n/**\n * Override the loading text rendered by {@link DefaultCraftPendingComponent}.\n * The factory runs in an injection context, so it may read a translation\n * service and return a reactive `Signal<string>`.\n */\nexport function withLoadingText(\n factory: () => Signal<string>,\n): CraftLoadingFeature {\n return craftLoadingFeature([\n { provide: CRAFT_LOADING_TEXT, useFactory: factory },\n ]);\n}\n\n/**\n * Override the navigation transition timings (in ms):\n *\n * - `stayMs` — phase 1, how long the previous page is kept on screen;\n * - `blankMs` — phase 2, how long the blank surface is shown before the loader;\n * - `pendingMinMs` — phase 3, minimum time the loader stays once shown.\n *\n * Only the provided keys are overridden.\n */\nexport function withTransitionTimings(thresholds: {\n stayMs?: number;\n blankMs?: number;\n pendingMinMs?: number;\n}): CraftLoadingFeature {\n const providers: Provider[] = [];\n\n if (thresholds.stayMs !== undefined) {\n providers.push({ provide: CRAFT_STAY_MS, useValue: thresholds.stayMs });\n }\n\n if (thresholds.blankMs !== undefined) {\n providers.push({ provide: CRAFT_BLANK_MS, useValue: thresholds.blankMs });\n }\n\n if (thresholds.pendingMinMs !== undefined) {\n providers.push({\n provide: CRAFT_PENDING_MIN_MS,\n useValue: thresholds.pendingMinMs,\n });\n }\n\n return craftLoadingFeature(providers);\n}\n\n/** Register the application-wide global error component (see `globalError()`). */\nexport function withErrorComponent(\n component: CraftExceptionComponentDescriptor,\n): CraftLoadingFeature {\n return craftLoadingFeature([\n { provide: CRAFT_ERROR_COMPONENT, useValue: component },\n ]);\n}\n\n/**\n * Configures the {@link CraftRouterOutletController} pending/error surface.\n *\n * ```ts\n * provideCraftLoading(\n * withTransitionTimings({ stayMs: 300, blankMs: 300, pendingMinMs: 500 }),\n * withLoadingText(() => computed(() => translate('common.loading'))),\n * withPendingComponent(MyBrandedSpinner),\n * // Check the functional error SFC separately through ComponentDepsOf.\n * withErrorComponent({ component: CraftGlobalErrorComponentHost }),\n * )\n * ```\n */\nexport function provideCraftLoading(\n ...features: CraftLoadingFeature[]\n): Provider[] {\n return features.flatMap((feature) => feature.providers);\n}\n"]}
@@ -0,0 +1,63 @@
1
+ import { type YieldableInsertionMethods } from './yieldable';
2
+ type NormalizeIns<T> = [T] extends [never] ? {} : T;
3
+ type CtxWithIns<Ctx, I> = Omit<Ctx, 'insertions'> & {
4
+ insertions: YieldableInsertionMethods<I>;
5
+ };
6
+ type MergedIns<Ctx extends {
7
+ insertions?: any;
8
+ }, I> = NormalizeIns<Ctx['insertions']> & I;
9
+ /**
10
+ * Composes several insertions into a single one, for ANY primitive
11
+ * (`query`, `mutation`, `asyncProcess`, `state`, `queryParams`) and for the
12
+ * nested insertions of `insertSelect`.
13
+ *
14
+ * ```typescript
15
+ * const users = yield* query(
16
+ * config,
17
+ * (context) =>
18
+ * craftPipe(
19
+ * context,
20
+ * insertStoragePersister(craftUnique({
21
+ * storeName: 'app',
22
+ * key: 'users',
23
+ * })),
24
+ * insertReactOnMutation(deleteUser, { ... }),
25
+ * ),
26
+ * ));
27
+ * ```
28
+ *
29
+ * Semantics are identical to passing the members directly:
30
+ * - members run left to right,
31
+ * - each member sees the previous members' outputs on `context.insertions`,
32
+ * - the resulting outputs are the intersection of all members' outputs
33
+ * (on a key conflict the rightmost member wins at runtime),
34
+ * - tracked dependencies (primitive generator yields, craft-service yields)
35
+ * are the union of all members',
36
+ * - each member factory is individually wrapped with the fn-wrapper chain
37
+ * (correlation-id tracking, app snapshots observe each member).
38
+ *
39
+ * Inline lambdas keep the primitive's contextual typing because the outer
40
+ * `(context) => craftPipe(context, ...)` lambda receives the concrete
41
+ * context from the primitive. Pipes nest freely, including inside
42
+ * `insertSelect`: `insertSelect('grid', (gridContext) => craftPipe(gridContext, ...))`.
43
+ */
44
+ export declare function craftPipe<Ctx extends {
45
+ insertions?: any;
46
+ }, I1, I2, Y1 = never, Y2 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>): Generator<Y1 | Y2, I1 & I2, unknown>;
47
+ export declare function craftPipe<Ctx extends {
48
+ insertions?: any;
49
+ }, I1, I2, I3, Y1 = never, Y2 = never, Y3 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>, m3: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>) => I3 | Generator<Y3, I3, unknown>): Generator<Y1 | Y2 | Y3, I1 & I2 & I3, unknown>;
50
+ export declare function craftPipe<Ctx extends {
51
+ insertions?: any;
52
+ }, I1, I2, I3, I4, Y1 = never, Y2 = never, Y3 = never, Y4 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>, m3: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>) => I3 | Generator<Y3, I3, unknown>, m4: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>) => I4 | Generator<Y4, I4, unknown>): Generator<Y1 | Y2 | Y3 | Y4, I1 & I2 & I3 & I4, unknown>;
53
+ export declare function craftPipe<Ctx extends {
54
+ insertions?: any;
55
+ }, I1, I2, I3, I4, I5, Y1 = never, Y2 = never, Y3 = never, Y4 = never, Y5 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>, m3: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>) => I3 | Generator<Y3, I3, unknown>, m4: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>) => I4 | Generator<Y4, I4, unknown>, m5: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>>) => I5 | Generator<Y5, I5, unknown>): Generator<Y1 | Y2 | Y3 | Y4 | Y5, I1 & I2 & I3 & I4 & I5, unknown>;
56
+ export declare function craftPipe<Ctx extends {
57
+ insertions?: any;
58
+ }, I1, I2, I3, I4, I5, I6, Y1 = never, Y2 = never, Y3 = never, Y4 = never, Y5 = never, Y6 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>, m3: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>) => I3 | Generator<Y3, I3, unknown>, m4: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>) => I4 | Generator<Y4, I4, unknown>, m5: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>>) => I5 | Generator<Y5, I5, unknown>, m6: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5>>) => I6 | Generator<Y6, I6, unknown>): Generator<Y1 | Y2 | Y3 | Y4 | Y5 | Y6, I1 & I2 & I3 & I4 & I5 & I6, unknown>;
59
+ export declare function craftPipe<Ctx extends {
60
+ insertions?: any;
61
+ }, I1, I2, I3, I4, I5, I6, I7, Y1 = never, Y2 = never, Y3 = never, Y4 = never, Y5 = never, Y6 = never, Y7 = never>(context: Ctx, m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>, m2: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>) => I2 | Generator<Y2, I2, unknown>, m3: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>) => I3 | Generator<Y3, I3, unknown>, m4: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>) => I4 | Generator<Y4, I4, unknown>, m5: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>>) => I5 | Generator<Y5, I5, unknown>, m6: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5>>) => I6 | Generator<Y6, I6, unknown>, m7: (context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5 & I6>>) => I7 | Generator<Y7, I7, unknown>): Generator<Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7, I1 & I2 & I3 & I4 & I5 & I6 & I7, unknown>;
62
+ export {};
63
+ //# sourceMappingURL=craft-pipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-pipe.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-pipe.ts"],"names":[],"mappings":"AAUA,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,aAAa,CAAC;AAsBrB,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACpD,KAAK,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,GAAG;IAClD,UAAU,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC;AACF,KAAK,SAAS,CA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AO,CAAC,GAAG,CAAC,EACZ,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAChD,KACE,EAAE,GAAG,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EACpC,EAAE,EAAE,CACF,OAAO,EAAE,UAAU,CACjB,OAAO,CAAC,GAAG,CAAC,EACZ,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CACrD,KACE,EAAE,GAAG,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,GACnC,SAAS,CACV,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAChC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAChC,OAAO,CACR,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { inject, Injector, isSignal, runInInjectionContext, } from './host/craft-compat';
2
+ import { isGenerator } from './craft-generator-runtime';
3
+ import { injectFnWrapper } from './fn-wrapper';
4
+ import { ɵcreateHostTaggedInjector } from './craft-service';
5
+ import { isSource } from './util/util';
6
+ import { createYieldableInsertionMethod, isNonYieldableInsertionMethod, isYieldableMethod, } from './yieldable';
7
+ import { isYieldableReactiveValue, nameInsertedReactiveValue, } from './reactive-read';
8
+ export function* craftPipe(context, ...members) {
9
+ // This generator is driven by the primitive's craft-generator runtime,
10
+ // inside `runInInjectionContext(injector)`: inject() is available on the
11
+ // first synchronous segment. Capture the fn-wrapper adapter here so each
12
+ // member keeps its own wrapping (per-member observability), exactly like
13
+ // the primitives' own insertion loop.
14
+ const wrap = injectFnWrapper();
15
+ const injector = inject(Injector);
16
+ let acc = {};
17
+ let exposedAcc = {};
18
+ for (const member of members) {
19
+ const wrappedMember = wrap(member);
20
+ const result = wrappedMember({
21
+ ...context,
22
+ insertions: { ...(context.insertions ?? {}), ...exposedAcc },
23
+ });
24
+ const output = isGenerator(result)
25
+ ? yield* result
26
+ : result;
27
+ const rawOutput = output;
28
+ acc = { ...acc, ...rawOutput };
29
+ const nextExposed = Object.entries(rawOutput).reduce((previous, [key, value]) => {
30
+ if (isYieldableReactiveValue(value)) {
31
+ previous[key] = nameInsertedReactiveValue(value, key, 'craftPipe', `craftPipe.${key}`);
32
+ return previous;
33
+ }
34
+ if (isSource(value) || isSignal(value) || isYieldableMethod(value)) {
35
+ previous[key] = value;
36
+ return previous;
37
+ }
38
+ if (typeof value === 'function' &&
39
+ !isNonYieldableInsertionMethod(value)) {
40
+ const methodInjector = ɵcreateHostTaggedInjector(injector, `method:${key}`);
41
+ const wrappedFn = runInInjectionContext(methodInjector, () => injectFnWrapper()(value));
42
+ previous[key] = createYieldableInsertionMethod(wrappedFn, {
43
+ injector: methodInjector,
44
+ invalidYieldErrorMessage: 'craftPipe insertion method generators can only yield craftService dependencies or exposed dependency helpers.',
45
+ multipleAppStartErrorMessage: 'craftPipe insertion methods do not support multiple onAppStart(...) declarations.',
46
+ onAppStartNotSupportedErrorMessage: 'craftPipe insertion methods do not support onAppStart(...).',
47
+ });
48
+ return previous;
49
+ }
50
+ previous[key] = value;
51
+ return previous;
52
+ }, {});
53
+ exposedAcc = { ...exposedAcc, ...nextExposed };
54
+ }
55
+ return acc;
56
+ }
57
+ //# sourceMappingURL=craft-pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-pipe.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,M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IAAI,wBAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpC,QAAQ,CAAC,GAAG,CAAC,GAAG,yBAAyB,CACvC,KAAK,EACL,GAAG,EACH,WAAW,EACX,aAAa,GAAG,EAAE,CACnB,CAAC;gBACF,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnE,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACtB,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,IACE,OAAO,KAAK,KAAK,UAAU;gBAC3B,CAAC,6BAA6B,CAAC,KAAK,CAAC,EACrC,CAAC;gBACD,MAAM,cAAc,GAAG,yBAAyB,CAC9C,QAAQ,EACR,UAAU,GAAG,EAAE,CAChB,CAAC;gBACF,MAAM,SAAS,GAAG,qBAAqB,CAAC,cAAc,EAAE,GAAG,EAAE,CAC3D,eAAe,EAAE,CAAC,KAAwC,CAAC,CAC5D,CAAC;gBACF,QAAQ,CAAC,GAAG,CAAC,GAAG,8BAA8B,CAAC,SAAS,EAAE;oBACxD,QAAQ,EAAE,cAAc;oBACxB,wBAAwB,EACtB,+GAA+G;oBACjH,4BAA4B,EAC1B,mFAAmF;oBACrF,kCAAkC,EAChC,6DAA6D;iBAChE,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACtB,OAAO,QAAQ,CAAC;QAClB,CAAC,EACD,EAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,WAAW,EAAE,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n inject,\n Injector,\n isSignal,\n runInInjectionContext,\n} from './host/craft-compat';\nimport { isGenerator } from './craft-generator-runtime';\nimport { injectFnWrapper } from './fn-wrapper';\nimport { ɵcreateHostTaggedInjector } from './craft-service';\nimport { isSource } from './util/util';\nimport {\n createYieldableInsertionMethod,\n isNonYieldableInsertionMethod,\n isYieldableMethod,\n type YieldableInsertionMethods,\n} from './yieldable';\nimport {\n isYieldableReactiveValue,\n nameInsertedReactiveValue,\n} from './reactive-read';\n\n// `craftPipe` composes several insertions into ONE, with the primitive's\n// context passed EXPLICITLY: `primitive(config, (context) => craftPipe(context, m1, m2))`.\n//\n// Why explicit context: the outer lambda is context-sensitive, so the\n// primitive types `context` concretely BEFORE the pipe call is resolved, and\n// the pipe's `Ctx` generic infers from a VALUE argument. No per-primitive\n// alias, no conditional resource/by-id handling, and the pipe also works\n// INSIDE `insertSelect` (each level re-passes its own context) — none of\n// which the previous implicit dedicated pipes could do.\n//\n// In member parameter types, `Ctx` is wrapped in `NoInfer` so member\n// arguments (e.g. non-higher-order factories) can never pollute the context\n// inference; only the `context` argument is an inference source.\n\n// Primitives type `insertions` as `keyof P extends string ? P : never`;\n// normalize `never` (empty previous outputs) back to `{}` before merging.\ntype NormalizeIns<T> = [T] extends [never] ? {} : T;\ntype CtxWithIns<Ctx, I> = Omit<Ctx, 'insertions'> & {\n insertions: YieldableInsertionMethods<I>;\n};\ntype MergedIns<Ctx extends { insertions?: any }, I> = NormalizeIns<\n Ctx['insertions']\n> &\n I;\n\n/**\n * Composes several insertions into a single one, for ANY primitive\n * (`query`, `mutation`, `asyncProcess`, `state`, `queryParams`) and for the\n * nested insertions of `insertSelect`.\n *\n * ```typescript\n * const users = yield* query(\n * config,\n * (context) =>\n * craftPipe(\n * context,\n * insertStoragePersister(craftUnique({\n * storeName: 'app',\n * key: 'users',\n * })),\n * insertReactOnMutation(deleteUser, { ... }),\n * ),\n * ));\n * ```\n *\n * Semantics are identical to passing the members directly:\n * - members run left to right,\n * - each member sees the previous members' outputs on `context.insertions`,\n * - the resulting outputs are the intersection of all members' outputs\n * (on a key conflict the rightmost member wins at runtime),\n * - tracked dependencies (primitive generator yields, craft-service yields)\n * are the union of all members',\n * - each member factory is individually wrapped with the fn-wrapper chain\n * (correlation-id tracking, app snapshots observe each member).\n *\n * Inline lambdas keep the primitive's contextual typing because the outer\n * `(context) => craftPipe(context, ...)` lambda receives the concrete\n * context from the primitive. Pipes nest freely, including inside\n * `insertSelect`: `insertSelect('grid', (gridContext) => craftPipe(gridContext, ...))`.\n */\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n Y1 = never,\n Y2 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n): Generator<Y1 | Y2, I1 & I2, unknown>;\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n I3,\n Y1 = never,\n Y2 = never,\n Y3 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n m3: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>,\n ) => I3 | Generator<Y3, I3, unknown>,\n): Generator<Y1 | Y2 | Y3, I1 & I2 & I3, unknown>;\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n I3,\n I4,\n Y1 = never,\n Y2 = never,\n Y3 = never,\n Y4 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n m3: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>,\n ) => I3 | Generator<Y3, I3, unknown>,\n m4: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>,\n ) => I4 | Generator<Y4, I4, unknown>,\n): Generator<Y1 | Y2 | Y3 | Y4, I1 & I2 & I3 & I4, unknown>;\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n I3,\n I4,\n I5,\n Y1 = never,\n Y2 = never,\n Y3 = never,\n Y4 = never,\n Y5 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n m3: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>,\n ) => I3 | Generator<Y3, I3, unknown>,\n m4: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>,\n ) => I4 | Generator<Y4, I4, unknown>,\n m5: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>\n >,\n ) => I5 | Generator<Y5, I5, unknown>,\n): Generator<Y1 | Y2 | Y3 | Y4 | Y5, I1 & I2 & I3 & I4 & I5, unknown>;\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n I3,\n I4,\n I5,\n I6,\n Y1 = never,\n Y2 = never,\n Y3 = never,\n Y4 = never,\n Y5 = never,\n Y6 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n m3: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>,\n ) => I3 | Generator<Y3, I3, unknown>,\n m4: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>,\n ) => I4 | Generator<Y4, I4, unknown>,\n m5: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>\n >,\n ) => I5 | Generator<Y5, I5, unknown>,\n m6: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5>\n >,\n ) => I6 | Generator<Y6, I6, unknown>,\n): Generator<Y1 | Y2 | Y3 | Y4 | Y5 | Y6, I1 & I2 & I3 & I4 & I5 & I6, unknown>;\nexport function craftPipe<\n Ctx extends { insertions?: any },\n I1,\n I2,\n I3,\n I4,\n I5,\n I6,\n I7,\n Y1 = never,\n Y2 = never,\n Y3 = never,\n Y4 = never,\n Y5 = never,\n Y6 = never,\n Y7 = never,\n>(\n context: Ctx,\n m1: (context: NoInfer<Ctx>) => I1 | Generator<Y1, I1, unknown>,\n m2: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1>>,\n ) => I2 | Generator<Y2, I2, unknown>,\n m3: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2>>,\n ) => I3 | Generator<Y3, I3, unknown>,\n m4: (\n context: CtxWithIns<NoInfer<Ctx>, MergedIns<NoInfer<Ctx>, I1 & I2 & I3>>,\n ) => I4 | Generator<Y4, I4, unknown>,\n m5: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4>\n >,\n ) => I5 | Generator<Y5, I5, unknown>,\n m6: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5>\n >,\n ) => I6 | Generator<Y6, I6, unknown>,\n m7: (\n context: CtxWithIns<\n NoInfer<Ctx>,\n MergedIns<NoInfer<Ctx>, I1 & I2 & I3 & I4 & I5 & I6>\n >,\n ) => I7 | Generator<Y7, I7, unknown>,\n): Generator<\n Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7,\n I1 & I2 & I3 & I4 & I5 & I6 & I7,\n unknown\n>;\nexport function* craftPipe(\n context: { insertions?: Record<string, unknown> },\n ...members: Array<(context: any) => unknown>\n): Generator<unknown, Record<string, unknown>, unknown> {\n // This generator is driven by the primitive's craft-generator runtime,\n // inside `runInInjectionContext(injector)`: inject() is available on the\n // first synchronous segment. Capture the fn-wrapper adapter here so each\n // member keeps its own wrapping (per-member observability), exactly like\n // the primitives' own insertion loop.\n const wrap = injectFnWrapper();\n const injector = inject(Injector);\n let acc: Record<string, unknown> = {};\n let exposedAcc: Record<string, unknown> = {};\n for (const member of members) {\n const wrappedMember = wrap(member);\n const result = wrappedMember({\n ...context,\n insertions: { ...(context.insertions ?? {}), ...exposedAcc },\n });\n const output = isGenerator(result)\n ? yield* result as Generator<unknown, Record<string, unknown>, unknown>\n : result;\n const rawOutput = output as Record<string, unknown>;\n acc = { ...acc, ...rawOutput };\n\n const nextExposed = Object.entries(rawOutput).reduce(\n (previous, [key, value]) => {\n if (isYieldableReactiveValue(value)) {\n previous[key] = nameInsertedReactiveValue(\n value,\n key,\n 'craftPipe',\n `craftPipe.${key}`,\n );\n return previous;\n }\n\n if (isSource(value) || isSignal(value) || isYieldableMethod(value)) {\n previous[key] = value;\n return previous;\n }\n\n if (\n typeof value === 'function' &&\n !isNonYieldableInsertionMethod(value)\n ) {\n const methodInjector = ɵcreateHostTaggedInjector(\n injector,\n `method:${key}`,\n );\n const wrappedFn = runInInjectionContext(methodInjector, () =>\n injectFnWrapper()(value as (...args: unknown[]) => unknown),\n );\n previous[key] = createYieldableInsertionMethod(wrappedFn, {\n injector: methodInjector,\n invalidYieldErrorMessage:\n 'craftPipe insertion method generators can only yield craftService dependencies or exposed dependency helpers.',\n multipleAppStartErrorMessage:\n 'craftPipe insertion methods do not support multiple onAppStart(...) declarations.',\n onAppStartNotSupportedErrorMessage:\n 'craftPipe insertion methods do not support onAppStart(...).',\n });\n return previous;\n }\n\n previous[key] = value;\n return previous;\n },\n {} as Record<string, unknown>,\n );\n exposedAcc = { ...exposedAcc, ...nextExposed };\n }\n return acc;\n}\n"]}
@@ -0,0 +1,50 @@
1
+ import { type CraftHistory } from './host/craft-router-runtime';
2
+ import type { SsrMode } from './craft-ssr';
3
+ export type CraftPlatformKind = 'browser' | 'server';
4
+ export type CraftStorage = Pick<Storage, 'clear' | 'getItem' | 'key' | 'removeItem' | 'setItem'> & {
5
+ readonly length: number;
6
+ };
7
+ export type CraftPlatform = Readonly<{
8
+ kind: CraftPlatformKind;
9
+ /** True only during the first client pass over server-rendered DOM. */
10
+ hydrating: boolean;
11
+ document?: Document;
12
+ window?: Window;
13
+ history: CraftHistory;
14
+ localStorage: CraftStorage;
15
+ sessionStorage: CraftStorage;
16
+ requestSignal?: AbortSignal;
17
+ serverResources?: CraftServerResourceController;
18
+ now(): number;
19
+ randomUUID(): string;
20
+ listen(target: EventTarget, event: string, handler: EventListener): () => void;
21
+ }>;
22
+ export type CraftServerResourceController = Readonly<{
23
+ defer(source: string, start: () => void): void;
24
+ decide(source: string, mode: SsrMode): void;
25
+ }>;
26
+ export declare const CRAFT_PLATFORM: import("..").CraftToken<Readonly<{
27
+ kind: CraftPlatformKind;
28
+ /** True only during the first client pass over server-rendered DOM. */
29
+ hydrating: boolean;
30
+ document?: Document;
31
+ window?: Window;
32
+ history: CraftHistory;
33
+ localStorage: CraftStorage;
34
+ sessionStorage: CraftStorage;
35
+ requestSignal?: AbortSignal;
36
+ serverResources?: CraftServerResourceController;
37
+ now(): number;
38
+ randomUUID(): string;
39
+ listen(target: EventTarget, event: string, handler: EventListener): () => void;
40
+ }>>;
41
+ export declare function createMemoryStorage(): CraftStorage;
42
+ export declare function createBrowserPlatform(win: Window, options?: Readonly<{
43
+ hydrating?: boolean;
44
+ }>): CraftPlatform;
45
+ export declare function createServerPlatform(options?: Readonly<{
46
+ url?: string;
47
+ document?: Document;
48
+ signal?: AbortSignal;
49
+ }>): CraftPlatform;
50
+ //# sourceMappingURL=craft-platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craft-platform.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/craft-platform.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,OAAO,EACP,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,YAAY,GAAG,SAAS,CACvD,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhC,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,IAAI,EAAE,iBAAiB,CAAC;IACxB,uEAAuE;IACvE,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC;IAC7B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,eAAe,CAAC,EAAE,6BAA6B,CAAC;IAChD,GAAG,IAAI,MAAM,CAAC;IACd,UAAU,IAAI,MAAM,CAAC;IACrB,MAAM,CACJ,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,aAAa,GACrB,MAAM,IAAI,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC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