@gyral/core 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/NOTICE +19 -0
  3. package/README.md +35 -8
  4. package/dist/call.d.ts +32 -0
  5. package/dist/call.js +63 -0
  6. package/dist/call.js.map +1 -0
  7. package/dist/children.d.ts +30 -5
  8. package/dist/children.js +26 -4
  9. package/dist/children.js.map +1 -1
  10. package/dist/cli/gyral-types.d.ts +2 -0
  11. package/dist/cli/gyral-types.js +23 -0
  12. package/dist/cli/gyral-types.js.map +1 -0
  13. package/dist/command.d.ts +54 -12
  14. package/dist/command.js +31 -11
  15. package/dist/command.js.map +1 -1
  16. package/dist/compiler/ast.d.ts +23 -0
  17. package/dist/compiler/ast.js +149 -0
  18. package/dist/compiler/ast.js.map +1 -0
  19. package/dist/compiler/compile.d.ts +41 -0
  20. package/dist/compiler/compile.js +148 -0
  21. package/dist/compiler/compile.js.map +1 -0
  22. package/dist/compiler/component-entries.d.ts +7 -0
  23. package/dist/compiler/component-entries.js +42 -0
  24. package/dist/compiler/component-entries.js.map +1 -0
  25. package/dist/compiler/components.d.ts +4 -0
  26. package/dist/compiler/components.js +182 -0
  27. package/dist/compiler/components.js.map +1 -0
  28. package/dist/compiler/facts.d.ts +31 -0
  29. package/dist/compiler/facts.js +285 -0
  30. package/dist/compiler/facts.js.map +1 -0
  31. package/dist/compiler/features.d.ts +34 -0
  32. package/dist/compiler/features.js +158 -0
  33. package/dist/compiler/features.js.map +1 -0
  34. package/dist/compiler/hooks.d.ts +22 -0
  35. package/dist/compiler/hooks.js +241 -0
  36. package/dist/compiler/hooks.js.map +1 -0
  37. package/dist/compiler/loader-source.d.ts +14 -0
  38. package/dist/compiler/loader-source.js +86 -0
  39. package/dist/compiler/loader-source.js.map +1 -0
  40. package/dist/compiler/locate.d.ts +14 -0
  41. package/dist/compiler/locate.js +78 -0
  42. package/dist/compiler/locate.js.map +1 -0
  43. package/dist/compiler/parse5-check.d.ts +21 -0
  44. package/dist/compiler/parse5-check.js +60 -0
  45. package/dist/compiler/parse5-check.js.map +1 -0
  46. package/dist/compiler/prop-schemas.d.ts +4 -0
  47. package/dist/compiler/prop-schemas.js +108 -0
  48. package/dist/compiler/prop-schemas.js.map +1 -0
  49. package/dist/compiler/scan.d.ts +41 -0
  50. package/dist/compiler/scan.js +160 -0
  51. package/dist/compiler/scan.js.map +1 -0
  52. package/dist/compiler/scope.d.ts +8 -0
  53. package/dist/compiler/scope.js +116 -0
  54. package/dist/compiler/scope.js.map +1 -0
  55. package/dist/compiler/source.d.ts +34 -0
  56. package/dist/compiler/source.js +114 -0
  57. package/dist/compiler/source.js.map +1 -0
  58. package/dist/compiler/tag-map.d.ts +41 -0
  59. package/dist/compiler/tag-map.js +126 -0
  60. package/dist/compiler/tag-map.js.map +1 -0
  61. package/dist/components-ready.d.ts +7 -0
  62. package/dist/components-ready.js +19 -0
  63. package/dist/components-ready.js.map +1 -0
  64. package/dist/define.d.ts +13 -4
  65. package/dist/define.js +35 -331
  66. package/dist/define.js.map +1 -1
  67. package/dist/devtools-events.d.ts +13 -0
  68. package/dist/devtools-events.js.map +1 -1
  69. package/dist/devtools-off.d.ts +2 -0
  70. package/dist/devtools-off.js +2 -0
  71. package/dist/devtools-off.js.map +1 -1
  72. package/dist/devtools.d.ts +4 -0
  73. package/dist/devtools.js +17 -2
  74. package/dist/devtools.js.map +1 -1
  75. package/dist/drivers-scope.d.ts +1 -1
  76. package/dist/drivers-scope.js +1 -8
  77. package/dist/drivers-scope.js.map +1 -1
  78. package/dist/element-internals.d.ts +1 -0
  79. package/dist/element-internals.js +11 -0
  80. package/dist/element-internals.js.map +1 -0
  81. package/dist/element-types.d.ts +11 -5
  82. package/dist/element-types.js.map +1 -1
  83. package/dist/element.d.ts +3 -0
  84. package/dist/element.js +322 -0
  85. package/dist/element.js.map +1 -0
  86. package/dist/error-view.d.ts +10 -0
  87. package/dist/error-view.js +30 -0
  88. package/dist/error-view.js.map +1 -0
  89. package/dist/errors.d.ts +21 -0
  90. package/dist/errors.js +47 -0
  91. package/dist/errors.js.map +1 -0
  92. package/dist/errors.json +289 -0
  93. package/dist/eslint/imports.d.ts +26 -0
  94. package/dist/eslint/imports.js +78 -0
  95. package/dist/eslint/imports.js.map +1 -0
  96. package/dist/eslint/index.d.ts +16 -0
  97. package/dist/eslint/index.js +23 -0
  98. package/dist/eslint/index.js.map +1 -0
  99. package/dist/eslint/locate.d.ts +33 -0
  100. package/dist/eslint/locate.js +132 -0
  101. package/dist/eslint/locate.js.map +1 -0
  102. package/dist/eslint/row-purity-rule.d.ts +2 -0
  103. package/dist/eslint/row-purity-rule.js +103 -0
  104. package/dist/eslint/row-purity-rule.js.map +1 -0
  105. package/dist/eslint/template-rule.d.ts +6 -0
  106. package/dist/eslint/template-rule.js +76 -0
  107. package/dist/eslint/template-rule.js.map +1 -0
  108. package/dist/eslint/unused-intent-rule.d.ts +2 -0
  109. package/dist/eslint/unused-intent-rule.js +186 -0
  110. package/dist/eslint/unused-intent-rule.js.map +1 -0
  111. package/dist/features.d.ts +39 -0
  112. package/dist/features.js +2 -0
  113. package/dist/features.js.map +1 -0
  114. package/dist/focus.d.ts +13 -12
  115. package/dist/focus.js +44 -11
  116. package/dist/focus.js.map +1 -1
  117. package/dist/form-associated.d.ts +46 -0
  118. package/dist/form-associated.js +77 -0
  119. package/dist/form-associated.js.map +1 -0
  120. package/dist/forms.d.ts +42 -30
  121. package/dist/forms.js +85 -41
  122. package/dist/forms.js.map +1 -1
  123. package/dist/frame-lane.d.ts +11 -0
  124. package/dist/frame-lane.js +28 -0
  125. package/dist/frame-lane.js.map +1 -0
  126. package/dist/head.d.ts +61 -0
  127. package/dist/head.js +85 -0
  128. package/dist/head.js.map +1 -0
  129. package/dist/hooks/invalid.d.ts +14 -0
  130. package/dist/hooks/invalid.js +72 -0
  131. package/dist/hooks/invalid.js.map +1 -0
  132. package/dist/host-model.d.ts +77 -0
  133. package/dist/host-model.js +278 -0
  134. package/dist/host-model.js.map +1 -0
  135. package/dist/hydration-client.d.ts +9 -0
  136. package/dist/hydration-client.js +35 -0
  137. package/dist/hydration-client.js.map +1 -0
  138. package/dist/hydration-loader.d.ts +13 -0
  139. package/dist/hydration-loader.js +58 -0
  140. package/dist/hydration-loader.js.map +1 -0
  141. package/dist/hydration-off.d.ts +8 -0
  142. package/dist/hydration-off.js +25 -0
  143. package/dist/hydration-off.js.map +1 -0
  144. package/dist/hydration.d.ts +3 -21
  145. package/dist/hydration.js +14 -63
  146. package/dist/hydration.js.map +1 -1
  147. package/dist/index.d.ts +24 -36
  148. package/dist/index.js +14 -32
  149. package/dist/index.js.map +1 -1
  150. package/dist/indexeddb-types.d.ts +97 -0
  151. package/dist/indexeddb-types.js +2 -0
  152. package/dist/indexeddb-types.js.map +1 -0
  153. package/dist/indexeddb.d.ts +5 -0
  154. package/dist/indexeddb.js +118 -0
  155. package/dist/indexeddb.js.map +1 -0
  156. package/dist/intent.d.ts +62 -17
  157. package/dist/intent.js +193 -100
  158. package/dist/intent.js.map +1 -1
  159. package/dist/internal/indexeddb-open.d.ts +8 -0
  160. package/dist/internal/indexeddb-open.js +96 -0
  161. package/dist/internal/indexeddb-open.js.map +1 -0
  162. package/dist/internal/indexeddb-transaction.d.ts +4 -0
  163. package/dist/internal/indexeddb-transaction.js +134 -0
  164. package/dist/internal/indexeddb-transaction.js.map +1 -0
  165. package/dist/internal/interpreter.d.ts +15 -1
  166. package/dist/internal/interpreter.js +42 -47
  167. package/dist/internal/interpreter.js.map +1 -1
  168. package/dist/internal/token.d.ts +1 -0
  169. package/dist/internal/token.js +7 -0
  170. package/dist/internal/token.js.map +1 -0
  171. package/dist/internal.d.ts +20 -0
  172. package/dist/internal.js +22 -0
  173. package/dist/internal.js.map +1 -0
  174. package/dist/invoker-fallback-used.d.ts +4 -0
  175. package/dist/invoker-fallback-used.js +10 -0
  176. package/dist/invoker-fallback-used.js.map +1 -0
  177. package/dist/invoker-fallback.d.ts +4 -0
  178. package/dist/invoker-fallback.js +15 -0
  179. package/dist/invoker-fallback.js.map +1 -0
  180. package/dist/invokers-shim.d.ts +6 -0
  181. package/dist/invokers-shim.js +32 -0
  182. package/dist/invokers-shim.js.map +1 -0
  183. package/dist/invokers.d.ts +3 -5
  184. package/dist/invokers.js +11 -51
  185. package/dist/invokers.js.map +1 -1
  186. package/dist/islands.d.ts +0 -2
  187. package/dist/islands.js +4 -11
  188. package/dist/islands.js.map +1 -1
  189. package/dist/light-dom.d.ts +4 -53
  190. package/dist/light-dom.js +5 -100
  191. package/dist/light-dom.js.map +1 -1
  192. package/dist/prop.d.ts +89 -0
  193. package/dist/prop.js +41 -0
  194. package/dist/prop.js.map +1 -0
  195. package/dist/props.d.ts +57 -21
  196. package/dist/props.js +157 -34
  197. package/dist/props.js.map +1 -1
  198. package/dist/retry.d.ts +15 -0
  199. package/dist/retry.js +48 -0
  200. package/dist/retry.js.map +1 -0
  201. package/dist/scheduler.d.ts +43 -0
  202. package/dist/scheduler.js +212 -0
  203. package/dist/scheduler.js.map +1 -0
  204. package/dist/script-json.d.ts +2 -0
  205. package/dist/script-json.js +13 -0
  206. package/dist/script-json.js.map +1 -0
  207. package/dist/server-component.d.ts +10 -0
  208. package/dist/server-component.js +133 -0
  209. package/dist/server-component.js.map +1 -0
  210. package/dist/server-specs.d.ts +6 -0
  211. package/dist/server-specs.js +13 -0
  212. package/dist/server-specs.js.map +1 -0
  213. package/dist/server.d.ts +34 -0
  214. package/dist/server.js +59 -0
  215. package/dist/server.js.map +1 -0
  216. package/dist/settled.d.ts +11 -0
  217. package/dist/settled.js +62 -0
  218. package/dist/settled.js.map +1 -0
  219. package/dist/spec-features-used.d.ts +21 -0
  220. package/dist/spec-features-used.js +50 -0
  221. package/dist/spec-features-used.js.map +1 -0
  222. package/dist/spec-features.d.ts +28 -0
  223. package/dist/spec-features.js +42 -0
  224. package/dist/spec-features.js.map +1 -0
  225. package/dist/states.d.ts +3 -5
  226. package/dist/states.js +22 -11
  227. package/dist/states.js.map +1 -1
  228. package/dist/storage.d.ts +69 -0
  229. package/dist/storage.js +158 -0
  230. package/dist/storage.js.map +1 -0
  231. package/dist/store-binding.d.ts +6 -3
  232. package/dist/store-binding.js +7 -8
  233. package/dist/store-binding.js.map +1 -1
  234. package/dist/store-scope.d.ts +8 -11
  235. package/dist/store-scope.js +15 -40
  236. package/dist/store-scope.js.map +1 -1
  237. package/dist/store.d.ts +3 -0
  238. package/dist/store.js +45 -10
  239. package/dist/store.js.map +1 -1
  240. package/dist/stores-provider.d.ts +2 -6
  241. package/dist/stores-provider.js +21 -55
  242. package/dist/stores-provider.js.map +1 -1
  243. package/dist/subscription.d.ts +35 -0
  244. package/dist/subscription.js +74 -0
  245. package/dist/subscription.js.map +1 -0
  246. package/dist/subscriptions.d.ts +26 -0
  247. package/dist/subscriptions.js +98 -0
  248. package/dist/subscriptions.js.map +1 -0
  249. package/dist/transitions.d.ts +5 -7
  250. package/dist/transitions.js +17 -20
  251. package/dist/transitions.js.map +1 -1
  252. package/dist/types.d.ts +142 -49
  253. package/dist/types.js.map +1 -1
  254. package/dist/use-dialogs.d.ts +2 -0
  255. package/dist/use-dialogs.js +9 -0
  256. package/dist/use-dialogs.js.map +1 -0
  257. package/dist/use-disposal.d.ts +2 -0
  258. package/dist/use-disposal.js +9 -0
  259. package/dist/use-disposal.js.map +1 -0
  260. package/dist/use-error-view.d.ts +2 -0
  261. package/dist/use-error-view.js +9 -0
  262. package/dist/use-error-view.js.map +1 -0
  263. package/dist/use-errored.d.ts +2 -0
  264. package/dist/use-errored.js +9 -0
  265. package/dist/use-errored.js.map +1 -0
  266. package/dist/use-form-associated.d.ts +2 -0
  267. package/dist/use-form-associated.js +7 -0
  268. package/dist/use-form-associated.js.map +1 -0
  269. package/dist/use-frame-lane.d.ts +2 -0
  270. package/dist/use-frame-lane.js +10 -0
  271. package/dist/use-frame-lane.js.map +1 -0
  272. package/dist/use-invokers.d.ts +2 -0
  273. package/dist/use-invokers.js +10 -0
  274. package/dist/use-invokers.js.map +1 -0
  275. package/dist/use-states.d.ts +2 -0
  276. package/dist/use-states.js +10 -0
  277. package/dist/use-states.js.map +1 -0
  278. package/dist/use-subscriptions.d.ts +2 -0
  279. package/dist/use-subscriptions.js +10 -0
  280. package/dist/use-subscriptions.js.map +1 -0
  281. package/dist/use-transitions.d.ts +2 -0
  282. package/dist/use-transitions.js +10 -0
  283. package/dist/use-transitions.js.map +1 -0
  284. package/dist/view/attributes.d.ts +11 -0
  285. package/dist/view/attributes.js +15 -0
  286. package/dist/view/attributes.js.map +1 -0
  287. package/dist/view/compiled.d.ts +1 -0
  288. package/dist/view/compiled.js +6 -0
  289. package/dist/view/compiled.js.map +1 -0
  290. package/dist/view/dev-off.d.ts +1 -0
  291. package/dist/view/dev-off.js +4 -0
  292. package/dist/view/dev-off.js.map +1 -0
  293. package/dist/view/dev.d.ts +1 -0
  294. package/dist/view/dev.js +5 -0
  295. package/dist/view/dev.js.map +1 -0
  296. package/dist/view/flags.d.ts +1 -0
  297. package/dist/view/flags.js +4 -0
  298. package/dist/view/flags.js.map +1 -0
  299. package/dist/view/index.d.ts +26 -0
  300. package/dist/view/index.js +27 -0
  301. package/dist/view/index.js.map +1 -0
  302. package/dist/view/loc.d.ts +9 -0
  303. package/dist/view/loc.js +50 -0
  304. package/dist/view/loc.js.map +1 -0
  305. package/dist/view/message.d.ts +17 -0
  306. package/dist/view/message.js +40 -0
  307. package/dist/view/message.js.map +1 -0
  308. package/dist/view/messages.d.ts +43 -0
  309. package/dist/view/messages.js +84 -0
  310. package/dist/view/messages.js.map +1 -0
  311. package/dist/view/normalize/check.d.ts +23 -0
  312. package/dist/view/normalize/check.js +81 -0
  313. package/dist/view/normalize/check.js.map +1 -0
  314. package/dist/view/normalize/emit.d.ts +15 -0
  315. package/dist/view/normalize/emit.js +165 -0
  316. package/dist/view/normalize/emit.js.map +1 -0
  317. package/dist/view/normalize/entities.d.ts +4 -0
  318. package/dist/view/normalize/entities.js +38 -0
  319. package/dist/view/normalize/entities.js.map +1 -0
  320. package/dist/view/normalize/errors.d.ts +9 -0
  321. package/dist/view/normalize/errors.js +19 -0
  322. package/dist/view/normalize/errors.js.map +1 -0
  323. package/dist/view/normalize/id.d.ts +10 -0
  324. package/dist/view/normalize/id.js +55 -0
  325. package/dist/view/normalize/id.js.map +1 -0
  326. package/dist/view/normalize/normalize.d.ts +18 -0
  327. package/dist/view/normalize/normalize.js +42 -0
  328. package/dist/view/normalize/normalize.js.map +1 -0
  329. package/dist/view/normalize/repairs.d.ts +24 -0
  330. package/dist/view/normalize/repairs.js +166 -0
  331. package/dist/view/normalize/repairs.js.map +1 -0
  332. package/dist/view/normalize/rules.d.ts +39 -0
  333. package/dist/view/normalize/rules.js +120 -0
  334. package/dist/view/normalize/rules.js.map +1 -0
  335. package/dist/view/normalize/shape.d.ts +5 -0
  336. package/dist/view/normalize/shape.js +38 -0
  337. package/dist/view/normalize/shape.js.map +1 -0
  338. package/dist/view/normalize/source.d.ts +13 -0
  339. package/dist/view/normalize/source.js +34 -0
  340. package/dist/view/normalize/source.js.map +1 -0
  341. package/dist/view/normalize/svg.d.ts +14 -0
  342. package/dist/view/normalize/svg.js +40 -0
  343. package/dist/view/normalize/svg.js.map +1 -0
  344. package/dist/view/normalize/tag-states.d.ts +23 -0
  345. package/dist/view/normalize/tag-states.js +192 -0
  346. package/dist/view/normalize/tag-states.js.map +1 -0
  347. package/dist/view/normalize/tokenizer.d.ts +5 -0
  348. package/dist/view/normalize/tokenizer.js +233 -0
  349. package/dist/view/normalize/tokenizer.js.map +1 -0
  350. package/dist/view/normalize/tokens.d.ts +55 -0
  351. package/dist/view/normalize/tokens.js +24 -0
  352. package/dist/view/normalize/tokens.js.map +1 -0
  353. package/dist/view/normalize/tree.d.ts +65 -0
  354. package/dist/view/normalize/tree.js +235 -0
  355. package/dist/view/normalize/tree.js.map +1 -0
  356. package/dist/view/normalize/types.d.ts +146 -0
  357. package/dist/view/normalize/types.js +29 -0
  358. package/dist/view/normalize/types.js.map +1 -0
  359. package/dist/view/normalize/whitespace.d.ts +2 -0
  360. package/dist/{template-whitespace.js → view/normalize/whitespace.js} +27 -36
  361. package/dist/view/normalize/whitespace.js.map +1 -0
  362. package/dist/view/prepare-stub.d.ts +3 -0
  363. package/dist/view/prepare-stub.js +7 -0
  364. package/dist/view/prepare-stub.js.map +1 -0
  365. package/dist/view/prepare.d.ts +11 -0
  366. package/dist/view/prepare.js +63 -0
  367. package/dist/view/prepare.js.map +1 -0
  368. package/dist/view/registry.d.ts +78 -0
  369. package/dist/view/registry.js +27 -0
  370. package/dist/view/registry.js.map +1 -0
  371. package/dist/view/render/adopt-attr.d.ts +14 -0
  372. package/dist/view/render/adopt-attr.js +83 -0
  373. package/dist/view/render/adopt-attr.js.map +1 -0
  374. package/dist/view/render/adopt-plan.d.ts +10 -0
  375. package/dist/view/render/adopt-plan.js +26 -0
  376. package/dist/view/render/adopt-plan.js.map +1 -0
  377. package/dist/view/render/adopt.d.ts +3 -0
  378. package/dist/view/render/adopt.js +286 -0
  379. package/dist/view/render/adopt.js.map +1 -0
  380. package/dist/view/render/attr-parts.d.ts +72 -0
  381. package/dist/view/render/attr-parts.js +262 -0
  382. package/dist/view/render/attr-parts.js.map +1 -0
  383. package/dist/view/render/child-part.d.ts +51 -0
  384. package/dist/view/render/child-part.js +173 -0
  385. package/dist/view/render/child-part.js.map +1 -0
  386. package/dist/view/render/dev-check.d.ts +12 -0
  387. package/dist/view/render/dev-check.js +122 -0
  388. package/dist/view/render/dev-check.js.map +1 -0
  389. package/dist/view/render/dispose.d.ts +3 -0
  390. package/dist/view/render/dispose.js +76 -0
  391. package/dist/view/render/dispose.js.map +1 -0
  392. package/dist/view/render/hook-part.d.ts +5 -0
  393. package/dist/view/render/hook-part.js +36 -0
  394. package/dist/view/render/hook-part.js.map +1 -0
  395. package/dist/view/render/hook-run.d.ts +2 -0
  396. package/dist/view/render/hook-run.js +72 -0
  397. package/dist/view/render/hook-run.js.map +1 -0
  398. package/dist/view/render/hooks.d.ts +108 -0
  399. package/dist/view/render/hooks.js +108 -0
  400. package/dist/view/render/hooks.js.map +1 -0
  401. package/dist/view/render/hydrate.d.ts +10 -0
  402. package/dist/view/render/hydrate.js +33 -0
  403. package/dist/view/render/hydrate.js.map +1 -0
  404. package/dist/view/render/instance.d.ts +33 -0
  405. package/dist/view/render/instance.js +107 -0
  406. package/dist/view/render/instance.js.map +1 -0
  407. package/dist/view/render/keyed.d.ts +6 -0
  408. package/dist/view/render/keyed.js +15 -0
  409. package/dist/view/render/keyed.js.map +1 -0
  410. package/dist/view/render/list.d.ts +20 -0
  411. package/dist/view/render/list.js +156 -0
  412. package/dist/view/render/list.js.map +1 -0
  413. package/dist/view/render/mismatch.d.ts +10 -0
  414. package/dist/view/render/mismatch.js +55 -0
  415. package/dist/view/render/mismatch.js.map +1 -0
  416. package/dist/view/render/modal.d.ts +3 -0
  417. package/dist/view/render/modal.js +39 -0
  418. package/dist/view/render/modal.js.map +1 -0
  419. package/dist/view/render/nodes.d.ts +10 -0
  420. package/dist/view/render/nodes.js +37 -0
  421. package/dist/view/render/nodes.js.map +1 -0
  422. package/dist/view/render/place.d.ts +18 -0
  423. package/dist/view/render/place.js +69 -0
  424. package/dist/view/render/place.js.map +1 -0
  425. package/dist/view/render/plan.d.ts +26 -0
  426. package/dist/view/render/plan.js +124 -0
  427. package/dist/view/render/plan.js.map +1 -0
  428. package/dist/view/render/raw.d.ts +21 -0
  429. package/dist/view/render/raw.js +72 -0
  430. package/dist/view/render/raw.js.map +1 -0
  431. package/dist/view/render/render.d.ts +15 -0
  432. package/dist/view/render/render.js +65 -0
  433. package/dist/view/render/render.js.map +1 -0
  434. package/dist/view/render/reorder.d.ts +4 -0
  435. package/dist/view/render/reorder.js +101 -0
  436. package/dist/view/render/reorder.js.map +1 -0
  437. package/dist/view/render/rows.d.ts +23 -0
  438. package/dist/view/render/rows.js +95 -0
  439. package/dist/view/render/rows.js.map +1 -0
  440. package/dist/view/render/seen.d.ts +11 -0
  441. package/dist/view/render/seen.js +17 -0
  442. package/dist/view/render/seen.js.map +1 -0
  443. package/dist/view/render/toggles.d.ts +6 -0
  444. package/dist/view/render/toggles.js +6 -0
  445. package/dist/view/render/toggles.js.map +1 -0
  446. package/dist/view/render/values.d.ts +29 -0
  447. package/dist/view/render/values.js +13 -0
  448. package/dist/view/render/values.js.map +1 -0
  449. package/dist/view/render/warn.d.ts +28 -0
  450. package/dist/view/render/warn.js +114 -0
  451. package/dist/view/render/warn.js.map +1 -0
  452. package/dist/view/server/component.d.ts +12 -0
  453. package/dist/view/server/component.js +64 -0
  454. package/dist/view/server/component.js.map +1 -0
  455. package/dist/view/server/escape.d.ts +10 -0
  456. package/dist/view/server/escape.js +34 -0
  457. package/dist/view/server/escape.js.map +1 -0
  458. package/dist/view/server/index.d.ts +48 -0
  459. package/dist/view/server/index.js +80 -0
  460. package/dist/view/server/index.js.map +1 -0
  461. package/dist/view/server/sha256.d.ts +2 -0
  462. package/dist/view/server/sha256.js +75 -0
  463. package/dist/view/server/sha256.js.map +1 -0
  464. package/dist/view/server/tags.d.ts +68 -0
  465. package/dist/view/server/tags.js +132 -0
  466. package/dist/view/server/tags.js.map +1 -0
  467. package/dist/view/server/values.d.ts +18 -0
  468. package/dist/view/server/values.js +94 -0
  469. package/dist/view/server/values.js.map +1 -0
  470. package/dist/view/server/writer.d.ts +21 -0
  471. package/dist/view/server/writer.js +170 -0
  472. package/dist/view/server/writer.js.map +1 -0
  473. package/dist/view/styles.d.ts +25 -0
  474. package/dist/view/styles.js +58 -0
  475. package/dist/view/styles.js.map +1 -0
  476. package/dist/view/template-element.d.ts +10 -0
  477. package/dist/view/template-element.js +45 -0
  478. package/dist/view/template-element.js.map +1 -0
  479. package/dist/view/template.d.ts +29 -0
  480. package/dist/view/template.js +84 -0
  481. package/dist/view/template.js.map +1 -0
  482. package/dist/view/trusted-html.d.ts +6 -0
  483. package/dist/view/trusted-html.js +34 -0
  484. package/dist/view/trusted-html.js.map +1 -0
  485. package/dist/vite.d.ts +57 -11
  486. package/dist/vite.js +319 -27
  487. package/dist/vite.js.map +1 -1
  488. package/package.json +70 -4
  489. package/dist/accessible-name.d.ts +0 -19
  490. package/dist/accessible-name.js +0 -56
  491. package/dist/accessible-name.js.map +0 -1
  492. package/dist/element-directive.d.ts +0 -20
  493. package/dist/element-directive.js +0 -31
  494. package/dist/element-directive.js.map +0 -1
  495. package/dist/invalid.d.ts +0 -21
  496. package/dist/invalid.js +0 -70
  497. package/dist/invalid.js.map +0 -1
  498. package/dist/lit-html-check.d.ts +0 -6
  499. package/dist/lit-html-check.js +0 -48
  500. package/dist/lit-html-check.js.map +0 -1
  501. package/dist/live-boolean.d.ts +0 -22
  502. package/dist/live-boolean.js +0 -34
  503. package/dist/live-boolean.js.map +0 -1
  504. package/dist/random.d.ts +0 -13
  505. package/dist/random.js +0 -19
  506. package/dist/random.js.map +0 -1
  507. package/dist/styles.d.ts +0 -12
  508. package/dist/styles.js +0 -11
  509. package/dist/styles.js.map +0 -1
  510. package/dist/template-whitespace.d.ts +0 -7
  511. package/dist/template-whitespace.js.map +0 -1
  512. package/dist/templates.d.ts +0 -5
  513. package/dist/templates.js +0 -15
  514. package/dist/templates.js.map +0 -1
  515. package/dist/textarea.d.ts +0 -26
  516. package/dist/textarea.js +0 -85
  517. package/dist/textarea.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hydration.js","sourceRoot":"","sources":["../src/hydration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,iFAAiF;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAYhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAC1D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,C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AE,CAAC;QACjC,OAAO,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACxE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,uBAAuB,cAAc,EAAE,EAAE,KAAK,CAAC,CAAC;QAChF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Server-render seeds (docs/design-docs/0012-ssr.md). The server writes each element's\n// state, plus the props an attribute can't carry, into one attribute; the client reads it\n// before its first (hydrating) render so both sides render the same template.\nimport type { PropertyDeclaration } from 'lit';\nimport { warnJsonHazard } from './json-safety.js';\n\n/** Host attribute holding the JSON seed. Removed once the client has read it. */\nexport const SEED_ATTRIBUTE = 'data-gyral-seed';\n\nexport interface Seed {\n /**\n * The server's state. Omitted when it equals what `init(props)` returns for the seeded\n * props (gyral-czi 4k7.10): the client recomputes it instead of reading a second copy of\n * data the props already carry.\n */\n readonly state?: unknown;\n readonly props: Readonly<Record<string, unknown>>;\n}\n\n/** JSON equality: seeds are JSON, so two values that serialize alike hydrate alike. */\nexport const sameJson = (a: unknown, b: unknown): boolean =>\n JSON.stringify(a) === JSON.stringify(b);\n\ntype Declarations = Readonly<Record<string, PropertyDeclaration>>;\n\nfunction attributeName(name: string, decl: PropertyDeclaration): string | undefined {\n if (decl.attribute === false) return undefined;\n return typeof decl.attribute === 'string' ? decl.attribute : name.toLowerCase();\n}\n\n/**\n * Server side: records the element's state and its props that are not already present as\n * attributes (property bindings such as `.items=${data}` are not in the HTML otherwise).\n * The SSR renderer escapes attribute values, so the JSON is HTML-safe.\n */\nexport function writeSeed(\n host: Element,\n state: unknown,\n props: Readonly<Record<string, unknown>>,\n declarations: Declarations,\n initialState?: { readonly value: unknown },\n): void {\n const carried: Record<string, unknown> = {};\n for (const [name, value] of Object.entries(props)) {\n const decl = declarations[name] ?? {};\n const attr = attributeName(name, decl);\n if (value !== undefined && (attr === undefined || !host.hasAttribute(attr))) {\n carried[name] = value;\n }\n }\n const derivable = initialState !== undefined && sameJson(state, initialState.value);\n const seed: Seed = derivable ? { props: carried } : { state, props: carried };\n warnJsonHazard(`<${host.localName}>`, seed, 'seed');\n host.setAttribute(SEED_ATTRIBUTE, JSON.stringify(seed));\n}\n\n/**\n * Client side, right after hydration (gyral-4k7.12, ADR 0012): Lit SSR writes nothing for\n * an empty primitive (`''`, `null`, `undefined`), so `<!--lit-part--><!--/lit-part-->`\n * has no Text node between the markers. Hydration still records the primitive as the\n * part's committed value, and the next text commit writes `.data` into the\n * `<!--/lit-part-->` comment instead. Restore the empty Text node a client render would\n * have created. Harmless for `nothing` and empty iterables, which clear or insert before\n * the end marker. Shadow roots below `root` are handled by their own hosts.\n */\nexport function fillEmptyTextParts(root: Node): void {\n const doc = root.ownerDocument ?? (root as Document);\n const walker = doc.createTreeWalker(root, NodeFilter.SHOW_COMMENT);\n const empty: Comment[] = [];\n for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {\n const next = node.nextSibling;\n if (\n (node as Comment).data === 'lit-part' &&\n next instanceof Comment &&\n next.data === '/lit-part'\n ) {\n empty.push(node as Comment);\n }\n }\n for (const start of empty) start.after(doc.createTextNode(''));\n}\n\n/** Client side: reads and removes the seed, if this element was server-rendered by Gyral. */\nexport function takeSeed(host: Element): Seed | undefined {\n const raw = host.getAttribute(SEED_ATTRIBUTE);\n if (raw === null) return undefined;\n host.removeAttribute(SEED_ATTRIBUTE);\n try {\n const parsed = JSON.parse(raw) as Partial<Seed> | null;\n if (parsed === null || typeof parsed !== 'object') return undefined;\n const props = parsed.props ?? {};\n return 'state' in parsed ? { state: parsed.state, props } : { props };\n } catch (error) {\n console.error(`<${host.localName}> has an unreadable ${SEED_ATTRIBUTE}`, error);\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"hydration.js","sourceRoot":"","sources":["../src/hydration.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,0FAA0F;AAC1F,+FAA+F;AAC/F,6FAA6F;AAC7F,2FAA2F;AAC3F,yFAAyF;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,iFAAiF;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAYhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAC1D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,GAAW,EACX,KAAc,EACd,OAAgB,EAChB,OAA0C;IAE1C,MAAM,IAAI,GAAS,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC7F,IAAI,GAAG;QAAE,cAAc,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,wCAAwC;IAE3F,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Server-render seeds (docs/design-docs/0012-ssr.md, view/06-server.md \"Components\"). The\n// server writes each component's state, plus the props an attribute can't carry, into one\n// attribute; the client reads it on connect, before its first render, so both sides start from\n// the same state. The client reads seeds in hydration-loader.ts (core's `#hydration-loader`:\n// hydration-off.ts in client-only builds); the walk that then hydrates the server's DOM is\n// hydration-client.ts, which the loader imports lazily (view/07-hydration.md \"Loading\").\nimport { warnJsonHazard } from './json-safety.js';\nimport { DEV } from './view/index.js';\n\n/** Host attribute holding the JSON seed. Removed once the client has read it. */\nexport const SEED_ATTRIBUTE = 'data-gyral-seed';\n\nexport interface Seed {\n /**\n * The server's state. Omitted when it equals what `init(props)` returns for the seeded\n * props (gyral-czi 4k7.10): the client recomputes it instead of reading a second copy of\n * data the props already carry.\n */\n readonly state?: unknown;\n readonly props: Readonly<Record<string, unknown>>;\n}\n\n/** JSON equality: seeds are JSON, so two values that serialize alike hydrate alike. */\nexport const sameJson = (a: unknown, b: unknown): boolean =>\n JSON.stringify(a) === JSON.stringify(b);\n\n/**\n * Server side: the seed for a component whose props `carried` travel in no attribute\n * (property holes) and whose state is `state`; `initial` is `init(props)`'s state.\n */\nexport function makeSeed(\n tag: string,\n state: unknown,\n initial: unknown,\n carried: Readonly<Record<string, unknown>>,\n): Seed {\n const seed: Seed = sameJson(state, initial) ? { props: carried } : { state, props: carried };\n if (DEV) warnJsonHazard(`<${tag}>`, seed, 'seed'); // view/06-server.md \"Seed\": development\n\n return seed;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,43 +1,31 @@
1
1
  export { command, defineDriver } from './command.js';
2
- export type { AnyDriver, Command, CommandHandlers, Concurrency, Driver, DriverContext, DriverOverrides, Next, RetryPolicy, } from './command.js';
3
- export { child, emit } from './children.js';
2
+ export type { AnyDriver, Command, CommandHandlers, Concurrency, Driver, DriverContext, DriverOverrides, DriverToken, Next, RetryPolicy, } from './command.js';
3
+ export { retry } from './retry.js';
4
+ export { subscription } from './subscription.js';
5
+ export type { SubscriptionContext, SubscriptionOptions, Unsubscribe } from './subscription.js';
6
+ export { child, outputs } from './children.js';
4
7
  export { focus } from './focus.js';
8
+ export { call, type CallInput } from './call.js';
5
9
  export type { FocusOptions } from './focus.js';
6
- export { invokersSupported } from './invokers.js';
7
10
  export type { CommandInfo } from './invokers.js';
8
- export { ISLAND_ATTRIBUTE } from './islands.js';
9
11
  export type { HydrateStrategy } from './islands.js';
10
- export type { ChildSource, OutputSource } from './children.js';
12
+ export type { ChildSource, OutputEvent, OutputSource, OutputsOf } from './children.js';
11
13
  export { define } from './define.js';
14
+ export { intentsOf, OUTPUT_EVENT } from './intent.js';
15
+ export { settled } from './settled.js';
16
+ export { componentsReady } from './components-ready.js';
17
+ export { GyralError, type ErrorPhase } from './errors.js';
12
18
  export { changed, defineStore, send } from './store.js';
13
- export type { AnyStore, AnyStoreInstance, Store, StoreChanged, StoreInstance, StoreOverrides, StoreRef, StoreSendInput, SeedCheck, StoreResolver, StoreSpec, StoreUpdate, } from './store.js';
14
- export { STORE_SEND } from './store.js';
15
- export { resetDocumentStores, scriptSafeJson, STORE_SEED_ATTRIBUTE, StoreRegistry, STORES_ELEMENT, withStoreScope, } from './store-scope.js';
16
- export { defineStoresProvider } from './stores-provider.js';
17
- export { DRIVERS_ELEMENT, provideDrivers } from './drivers-scope.js';
18
- export { jsonHazard, warnJsonHazard } from './json-safety.js';
19
- export { random, randomDriver, randomInt, toInt, type RandomInput } from './random.js';
20
- export { defineForm, field, fieldErrors, form, formDataToObject, formFields, intentRejectedSchema, redirectedTo, validateForm, } from './forms.js';
21
- export type { FormDefinition, FormRedirected, FormResult, FormValue } from './forms.js';
22
- export { ElementDirective } from './element-directive.js';
23
- export { runInit } from './init.js';
24
- export { invalid } from './invalid.js';
25
- export { findInScope, labelledBy } from './accessible-name.js';
26
- export { liveBoolean } from './live-boolean.js';
27
- export { textarea, textareaMarkup } from './textarea.js';
28
- export { DEVTOOLS_ENABLED as devtoolsEnabled, devLiveComponents as devtoolsLiveComponents, } from '#devtools';
29
- export { DEVTOOLS_GLOBAL } from './devtools-events.js';
30
- export type { CommandPhase, CommandTraceEvent, DevComponentRef, DevEvent, DevtoolsHook, } from './devtools-events.js';
31
- export type { TextareaAttribute, TextareaOptions } from './textarea.js';
32
- export type { Styles } from './styles.js';
33
- export { HIDDEN_MARKER, HYDRATE_KEY, isLightComponent, LIGHT_ATTRIBUTE } from './light-dom.js';
34
- export type { GyralElement, GyralElementClass } from './define.js';
35
- export type { ComponentSpec, Ctx, FieldIssue, FormFields, IntentInput, IntentNames, IntentParser, IntentRejected, Intents, PropDeclarations, Hydrated, PropsChanged, Stateless, StoreReader, Tagged, Update, } from './types.js';
36
- export { css, nothing, unsafeCSS } from 'lit';
37
- export { html, svg } from './templates.js';
38
- export { directive } from 'lit/directive.js';
39
- export { classMap } from 'lit/directives/class-map.js';
40
- export { keyed } from 'lit/directives/keyed.js';
41
- export { live } from 'lit/directives/live.js';
42
- export { repeat } from 'lit/directives/repeat.js';
43
- export { styleMap } from 'lit/directives/style-map.js';
19
+ export type { AnyStore, AnyStoreInstance, Store, StoreChanged, StoreInstance, StoreOverrides, StoreRef, SeedCheck, StoreResolver, StoreSpec, StoreUpdate, } from './store.js';
20
+ export { provideDrivers } from './drivers-scope.js';
21
+ export { defineForm, field, fieldErrors, form } from './forms.js';
22
+ export type { FieldName, FormDefinition, FormOptions, FormResult, FormValue, FormValues, } from './forms.js';
23
+ export { invalid } from './hooks/invalid.js';
24
+ export type { FormAssociation, FormControlValue, FormControlValidity, FormDisabled, FormReset, FormStateRestore, } from './form-associated.js';
25
+ export { prop } from './prop.js';
26
+ export type { Prop, PropGuard, PropKind, PropsOf } from './prop.js';
27
+ export type { Definer, GyralElement, GyralElementClass } from './define.js';
28
+ export type { ComponentSpec, Ctx, FieldIssue, FormFields, IntentInput, IntentNames, IntentParser, IntentRejected, Intents, ParserCtx, ParserFor, PropDeclarations, Errored, Hydrated, PropsChanged, ShadowOption, Stateless, StoreReader, Tagged, Update, } from './types.js';
29
+ export { css, defineHook, each, html, keyed, nothing, raw, svg } from './view/index.js';
30
+ export type { ChildValue, CssValue, HookAttributes, HookResult, HookSpec, ListResult, RawResult, StyleSource, Styles, TemplateResult, } from './view/index.js';
31
+ export type { Head, HeadLink, HeadMeta, JsonValue } from './head.js';
package/dist/index.js CHANGED
@@ -1,37 +1,19 @@
1
1
  export { command, defineDriver } from './command.js';
2
- export { child, emit } from './children.js';
2
+ export { retry } from './retry.js';
3
+ export { subscription } from './subscription.js';
4
+ export { child, outputs } from './children.js';
3
5
  export { focus } from './focus.js';
4
- export { invokersSupported } from './invokers.js';
5
- export { ISLAND_ATTRIBUTE } from './islands.js';
6
+ export { call } from './call.js';
6
7
  export { define } from './define.js';
8
+ export { intentsOf, OUTPUT_EVENT } from './intent.js';
9
+ export { settled } from './settled.js';
10
+ export { componentsReady } from './components-ready.js';
11
+ export { GyralError } from './errors.js';
7
12
  export { changed, defineStore, send } from './store.js';
8
- export { STORE_SEND } from './store.js';
9
- // Store scoping: used by @gyral/ssr (server scope + page seed) and @gyral/testing.
10
- export { resetDocumentStores, scriptSafeJson, STORE_SEED_ATTRIBUTE, StoreRegistry, STORES_ELEMENT, withStoreScope, } from './store-scope.js';
11
- export { defineStoresProvider } from './stores-provider.js';
12
- export { DRIVERS_ELEMENT, provideDrivers } from './drivers-scope.js';
13
- export { jsonHazard, warnJsonHazard } from './json-safety.js';
14
- export { random, randomDriver, randomInt, toInt } from './random.js';
15
- export { defineForm, field, fieldErrors, form, formDataToObject, formFields, intentRejectedSchema, redirectedTo, validateForm, } from './forms.js';
16
- export { ElementDirective } from './element-directive.js';
17
- export { runInit } from './init.js';
18
- export { invalid } from './invalid.js';
19
- export { findInScope, labelledBy } from './accessible-name.js';
20
- export { liveBoolean } from './live-boolean.js';
21
- export { textarea, textareaMarkup } from './textarea.js';
22
- // Devtools event stream (ADR 0017): emitted in development builds only.
23
- export { DEVTOOLS_ENABLED as devtoolsEnabled, devLiveComponents as devtoolsLiveComponents, } from '#devtools';
24
- export { DEVTOOLS_GLOBAL } from './devtools-events.js';
25
- // Used by @gyral/ssr to render light-DOM components as plain children (ADR 0014).
26
- export { HIDDEN_MARKER, HYDRATE_KEY, isLightComponent, LIGHT_ATTRIBUTE } from './light-dom.js';
27
- // The view layer is Lit. Re-exported so most apps need a single import. `html` and `svg` are
28
- // Lit's tags with indentation whitespace removed (template-whitespace.ts, gyral-9rf).
29
- export { css, nothing, unsafeCSS } from 'lit';
30
- export { html, svg } from './templates.js';
31
- export { directive } from 'lit/directive.js';
32
- export { classMap } from 'lit/directives/class-map.js';
33
- export { keyed } from 'lit/directives/keyed.js';
34
- export { live } from 'lit/directives/live.js';
35
- export { repeat } from 'lit/directives/repeat.js';
36
- export { styleMap } from 'lit/directives/style-map.js';
13
+ export { provideDrivers } from './drivers-scope.js';
14
+ export { defineForm, field, fieldErrors, form } from './forms.js';
15
+ export { invalid } from './hooks/invalid.js';
16
+ export { prop } from './prop.js';
17
+ // The view layer (ADR 0018, docs/design-docs/view/): templates, lists, hooks and styles.
18
+ export { css, defineHook, each, html, keyed, nothing, raw, svg } from './view/index.js';
37
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAYrD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAexD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,mFAAmF;AACnF,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO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AClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { command, defineDriver } from './command.js';\nexport type {\n AnyDriver,\n Command,\n CommandHandlers,\n Concurrency,\n Driver,\n DriverContext,\n DriverOverrides,\n Next,\n RetryPolicy,\n} from './command.js';\nexport { child, emit } from './children.js';\nexport { focus } from './focus.js';\nexport type { FocusOptions } from './focus.js';\nexport { invokersSupported } from './invokers.js';\nexport type { CommandInfo } from './invokers.js';\nexport { ISLAND_ATTRIBUTE } from './islands.js';\nexport type { HydrateStrategy } from './islands.js';\nexport type { ChildSource, OutputSource } from './children.js';\nexport { define } from './define.js';\nexport { changed, defineStore, send } from './store.js';\nexport type {\n AnyStore,\n AnyStoreInstance,\n Store,\n StoreChanged,\n StoreInstance,\n StoreOverrides,\n StoreRef,\n StoreSendInput,\n SeedCheck,\n StoreResolver,\n StoreSpec,\n StoreUpdate,\n} from './store.js';\nexport { STORE_SEND } from './store.js';\n// Store scoping: used by @gyral/ssr (server scope + page seed) and @gyral/testing.\nexport {\n resetDocumentStores,\n scriptSafeJson,\n STORE_SEED_ATTRIBUTE,\n StoreRegistry,\n STORES_ELEMENT,\n withStoreScope,\n} from './store-scope.js';\nexport { defineStoresProvider } from './stores-provider.js';\nexport { DRIVERS_ELEMENT, provideDrivers } from './drivers-scope.js';\nexport { jsonHazard, warnJsonHazard } from './json-safety.js';\nexport { random, randomDriver, randomInt, toInt, type RandomInput } from './random.js';\nexport {\n defineForm,\n field,\n fieldErrors,\n form,\n formDataToObject,\n formFields,\n intentRejectedSchema,\n redirectedTo,\n validateForm,\n} from './forms.js';\nexport type { FormDefinition, FormRedirected, FormResult, FormValue } from './forms.js';\nexport { ElementDirective } from './element-directive.js';\nexport { runInit } from './init.js';\nexport { invalid } from './invalid.js';\nexport { findInScope, labelledBy } from './accessible-name.js';\nexport { liveBoolean } from './live-boolean.js';\nexport { textarea, textareaMarkup } from './textarea.js';\n// Devtools event stream (ADR 0017): emitted in development builds only.\nexport {\n DEVTOOLS_ENABLED as devtoolsEnabled,\n devLiveComponents as devtoolsLiveComponents,\n} from '#devtools';\nexport { DEVTOOLS_GLOBAL } from './devtools-events.js';\nexport type {\n CommandPhase,\n CommandTraceEvent,\n DevComponentRef,\n DevEvent,\n DevtoolsHook,\n} from './devtools-events.js';\nexport type { TextareaAttribute, TextareaOptions } from './textarea.js';\nexport type { Styles } from './styles.js';\n// Used by @gyral/ssr to render light-DOM components as plain children (ADR 0014).\nexport { HIDDEN_MARKER, HYDRATE_KEY, isLightComponent, LIGHT_ATTRIBUTE } from './light-dom.js';\nexport type { GyralElement, GyralElementClass } from './define.js';\nexport type {\n ComponentSpec,\n Ctx,\n FieldIssue,\n FormFields,\n IntentInput,\n IntentNames,\n IntentParser,\n IntentRejected,\n Intents,\n PropDeclarations,\n Hydrated,\n PropsChanged,\n Stateless,\n StoreReader,\n Tagged,\n Update,\n} from './types.js';\n\n// The view layer is Lit. Re-exported so most apps need a single import. `html` and `svg` are\n// Lit's tags with indentation whitespace removed (template-whitespace.ts, gyral-9rf).\nexport { css, nothing, unsafeCSS } from 'lit';\nexport { html, svg } from './templates.js';\nexport { directive } from 'lit/directive.js';\nexport { classMap } from 'lit/directives/class-map.js';\nexport { keyed } from 'lit/directives/keyed.js';\nexport { live } from 'lit/directives/live.js';\nexport { repeat } from 'lit/directives/repeat.js';\nexport { styleMap } from 'lit/directives/style-map.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAarD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AAKjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAcxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AASlE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAS7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA0BjC,yFAAyF;AACzF,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { command, defineDriver } from './command.js';\nexport type {\n AnyDriver,\n Command,\n CommandHandlers,\n Concurrency,\n Driver,\n DriverContext,\n DriverOverrides,\n DriverToken,\n Next,\n RetryPolicy,\n} from './command.js';\nexport { retry } from './retry.js';\nexport { subscription } from './subscription.js';\nexport type { SubscriptionContext, SubscriptionOptions, Unsubscribe } from './subscription.js';\nexport { child, outputs } from './children.js';\nexport { focus } from './focus.js';\nexport { call, type CallInput } from './call.js';\nexport type { FocusOptions } from './focus.js';\nexport type { CommandInfo } from './invokers.js';\nexport type { HydrateStrategy } from './islands.js';\nexport type { ChildSource, OutputEvent, OutputSource, OutputsOf } from './children.js';\nexport { define } from './define.js';\nexport { intentsOf, OUTPUT_EVENT } from './intent.js';\nexport { settled } from './settled.js';\nexport { componentsReady } from './components-ready.js';\nexport { GyralError, type ErrorPhase } from './errors.js';\nexport { changed, defineStore, send } from './store.js';\nexport type {\n AnyStore,\n AnyStoreInstance,\n Store,\n StoreChanged,\n StoreInstance,\n StoreOverrides,\n StoreRef,\n SeedCheck,\n StoreResolver,\n StoreSpec,\n StoreUpdate,\n} from './store.js';\nexport { provideDrivers } from './drivers-scope.js';\nexport { defineForm, field, fieldErrors, form } from './forms.js';\nexport type {\n FieldName,\n FormDefinition,\n FormOptions,\n FormResult,\n FormValue,\n FormValues,\n} from './forms.js';\nexport { invalid } from './hooks/invalid.js';\nexport type {\n FormAssociation,\n FormControlValue,\n FormControlValidity,\n FormDisabled,\n FormReset,\n FormStateRestore,\n} from './form-associated.js';\nexport { prop } from './prop.js';\nexport type { Prop, PropGuard, PropKind, PropsOf } from './prop.js';\nexport type { Definer, GyralElement, GyralElementClass } from './define.js';\nexport type {\n ComponentSpec,\n Ctx,\n FieldIssue,\n FormFields,\n IntentInput,\n IntentNames,\n IntentParser,\n IntentRejected,\n Intents,\n ParserCtx,\n ParserFor,\n PropDeclarations,\n Errored,\n Hydrated,\n PropsChanged,\n ShadowOption,\n Stateless,\n StoreReader,\n Tagged,\n Update,\n} from './types.js';\n\n// The view layer (ADR 0018, docs/design-docs/view/): templates, lists, hooks and styles.\nexport { css, defineHook, each, html, keyed, nothing, raw, svg } from './view/index.js';\nexport type {\n ChildValue,\n CssValue,\n HookAttributes,\n HookResult,\n HookSpec,\n ListResult,\n RawResult,\n StyleSource,\n Styles,\n TemplateResult,\n} from './view/index.js';\n\n// The head model (ADR 0019): shared by @gyral/ssr's renderPage() and @gyral/router's setHead().\nexport type { Head, HeadLink, HeadMeta, JsonValue } from './head.js';\n"]}
@@ -0,0 +1,97 @@
1
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
2
+ export type IndexedDBStores = Readonly<Record<string, StandardSchemaV1>>;
3
+ export type IndexedDBRecord<S extends StandardSchemaV1> = StandardSchemaV1.InferOutput<S>;
4
+ export type IndexedDBRange = {
5
+ readonly _tag: 'Only';
6
+ readonly key: IDBValidKey;
7
+ } | {
8
+ readonly _tag: 'Lower' | 'Upper';
9
+ readonly key: IDBValidKey;
10
+ readonly open?: boolean;
11
+ } | {
12
+ readonly _tag: 'Bound';
13
+ readonly lower: IDBValidKey;
14
+ readonly upper: IDBValidKey;
15
+ readonly lowerOpen?: boolean;
16
+ readonly upperOpen?: boolean;
17
+ };
18
+ export type IndexedDBOperation<S extends IndexedDBStores> = {
19
+ [K in keyof S & string]: {
20
+ readonly _tag: 'Read' | 'Delete';
21
+ readonly store: K;
22
+ readonly key: IDBValidKey;
23
+ } | {
24
+ readonly _tag: 'Put';
25
+ readonly store: K;
26
+ readonly value: IndexedDBRecord<S[K]>;
27
+ readonly key?: IDBValidKey;
28
+ } | {
29
+ readonly _tag: 'Query';
30
+ readonly store: K;
31
+ readonly index?: string;
32
+ readonly range?: IndexedDBRange;
33
+ readonly direction?: IDBCursorDirection;
34
+ readonly limit: number;
35
+ };
36
+ }[keyof S & string];
37
+ export type IndexedDBInput<S extends IndexedDBStores> = IndexedDBOperation<S> | {
38
+ readonly _tag: 'Transaction';
39
+ readonly operations: readonly IndexedDBOperation<S>[];
40
+ };
41
+ export type IndexedDBResult<S extends IndexedDBStores> = {
42
+ [K in keyof S & string]: {
43
+ readonly _tag: 'Record';
44
+ readonly store: K;
45
+ readonly key: IDBValidKey;
46
+ readonly entry: {
47
+ readonly found: false;
48
+ } | {
49
+ readonly found: true;
50
+ readonly value: IndexedDBRecord<S[K]>;
51
+ };
52
+ } | {
53
+ readonly _tag: 'Put' | 'Deleted';
54
+ readonly store: K;
55
+ readonly key: IDBValidKey;
56
+ } | {
57
+ readonly _tag: 'Records';
58
+ readonly store: K;
59
+ readonly records: readonly {
60
+ readonly key: IDBValidKey;
61
+ readonly value: IndexedDBRecord<S[K]>;
62
+ }[];
63
+ };
64
+ }[keyof S & string];
65
+ export type IndexedDBOutput<S extends IndexedDBStores> = IndexedDBResult<S> | {
66
+ readonly _tag: 'Committed';
67
+ readonly results: readonly IndexedDBResult<S>[];
68
+ };
69
+ export type IndexedDBError = {
70
+ readonly _tag: 'IndexedDBBlockedError';
71
+ readonly database: string;
72
+ readonly version: number;
73
+ } | {
74
+ readonly _tag: 'IndexedDBInputError';
75
+ readonly message: string;
76
+ } | {
77
+ readonly _tag: 'IndexedDBAccessError';
78
+ readonly database: string;
79
+ readonly phase: 'encode' | 'open' | 'upgrade' | 'transaction';
80
+ readonly name: string;
81
+ readonly message: string;
82
+ } | {
83
+ readonly _tag: 'IndexedDBDecodeError';
84
+ readonly store: string;
85
+ readonly issues: readonly StandardSchemaV1.Issue[];
86
+ /** Native transaction completed before decoding. Its writes cannot be undone. */
87
+ readonly committed: true;
88
+ };
89
+ export interface IndexedDBOptions<S extends IndexedDBStores> {
90
+ readonly database: string;
91
+ readonly version: number;
92
+ readonly name?: string;
93
+ readonly factory?: () => IDBFactory;
94
+ /** Synchronous: queue migration requests before returning; never await. */
95
+ readonly upgrade?: (db: IDBDatabase, oldVersion: number, newVersion: number, transaction: IDBTransaction) => void;
96
+ readonly encode?: <K extends keyof S & string>(store: K, value: IndexedDBRecord<S[K]>) => unknown;
97
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=indexeddb-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexeddb-types.js","sourceRoot":"","sources":["../src/indexeddb-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StandardSchemaV1 } from '@standard-schema/spec';\n\nexport type IndexedDBStores = Readonly<Record<string, StandardSchemaV1>>;\nexport type IndexedDBRecord<S extends StandardSchemaV1> = StandardSchemaV1.InferOutput<S>;\nexport type IndexedDBRange =\n | { readonly _tag: 'Only'; readonly key: IDBValidKey }\n | { readonly _tag: 'Lower' | 'Upper'; readonly key: IDBValidKey; readonly open?: boolean }\n | {\n readonly _tag: 'Bound';\n readonly lower: IDBValidKey;\n readonly upper: IDBValidKey;\n readonly lowerOpen?: boolean;\n readonly upperOpen?: boolean;\n };\nexport type IndexedDBOperation<S extends IndexedDBStores> = {\n [K in keyof S & string]:\n | { readonly _tag: 'Read' | 'Delete'; readonly store: K; readonly key: IDBValidKey }\n | {\n readonly _tag: 'Put';\n readonly store: K;\n readonly value: IndexedDBRecord<S[K]>;\n readonly key?: IDBValidKey;\n }\n | {\n readonly _tag: 'Query';\n readonly store: K;\n readonly index?: string;\n readonly range?: IndexedDBRange;\n readonly direction?: IDBCursorDirection;\n readonly limit: number;\n };\n}[keyof S & string];\nexport type IndexedDBInput<S extends IndexedDBStores> =\n | IndexedDBOperation<S>\n | { readonly _tag: 'Transaction'; readonly operations: readonly IndexedDBOperation<S>[] };\nexport type IndexedDBResult<S extends IndexedDBStores> = {\n [K in keyof S & string]:\n | {\n readonly _tag: 'Record';\n readonly store: K;\n readonly key: IDBValidKey;\n readonly entry:\n | { readonly found: false }\n | { readonly found: true; readonly value: IndexedDBRecord<S[K]> };\n }\n | { readonly _tag: 'Put' | 'Deleted'; readonly store: K; readonly key: IDBValidKey }\n | {\n readonly _tag: 'Records';\n readonly store: K;\n readonly records: readonly {\n readonly key: IDBValidKey;\n readonly value: IndexedDBRecord<S[K]>;\n }[];\n };\n}[keyof S & string];\nexport type IndexedDBOutput<S extends IndexedDBStores> =\n | IndexedDBResult<S>\n | { readonly _tag: 'Committed'; readonly results: readonly IndexedDBResult<S>[] };\nexport type IndexedDBError =\n | { readonly _tag: 'IndexedDBBlockedError'; readonly database: string; readonly version: number }\n | { readonly _tag: 'IndexedDBInputError'; readonly message: string }\n | {\n readonly _tag: 'IndexedDBAccessError';\n readonly database: string;\n readonly phase: 'encode' | 'open' | 'upgrade' | 'transaction';\n readonly name: string;\n readonly message: string;\n }\n | {\n readonly _tag: 'IndexedDBDecodeError';\n readonly store: string;\n readonly issues: readonly StandardSchemaV1.Issue[];\n /** Native transaction completed before decoding. Its writes cannot be undone. */\n readonly committed: true;\n };\nexport interface IndexedDBOptions<S extends IndexedDBStores> {\n readonly database: string;\n readonly version: number;\n readonly name?: string;\n readonly factory?: () => IDBFactory;\n /** Synchronous: queue migration requests before returning; never await. */\n readonly upgrade?: (\n db: IDBDatabase,\n oldVersion: number,\n newVersion: number,\n transaction: IDBTransaction,\n ) => void;\n readonly encode?: <K extends keyof S & string>(store: K, value: IndexedDBRecord<S[K]>) => unknown;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { Driver } from './command.js';
2
+ import type { IndexedDBError, IndexedDBInput, IndexedDBOptions, IndexedDBOutput, IndexedDBStores } from './indexeddb-types.js';
3
+ export type { IndexedDBError, IndexedDBInput, IndexedDBOperation, IndexedDBOptions, IndexedDBOutput, IndexedDBRange, IndexedDBRecord, IndexedDBResult, IndexedDBStores, } from './indexeddb-types.js';
4
+ /** Typed record operations and atomic batches over application-owned stores and migrations. */
5
+ export declare function makeIndexedDBDriver<S extends IndexedDBStores>(stores: S, options: IndexedDBOptions<S>): Driver<IndexedDBInput<S>, IndexedDBOutput<S>, IndexedDBError>;
@@ -0,0 +1,118 @@
1
+ import { DatabaseFailure, databaseError, openDatabase } from './internal/indexeddb-open.js';
2
+ import { transact } from './internal/indexeddb-transaction.js';
3
+ /** Typed record operations and atomic batches over application-owned stores and migrations. */
4
+ export function makeIndexedDBDriver(stores, options) {
5
+ const decode = async (store, value) => {
6
+ const schema = stores[store];
7
+ if (schema === undefined)
8
+ throw new DatabaseFailure({
9
+ _tag: 'IndexedDBInputError',
10
+ message: `Unknown store ${store}.`,
11
+ });
12
+ try {
13
+ const result = await schema['~standard'].validate(value);
14
+ if (result.issues !== undefined)
15
+ throw new DatabaseFailure({
16
+ _tag: 'IndexedDBDecodeError',
17
+ store,
18
+ issues: result.issues,
19
+ committed: true,
20
+ });
21
+ return result.value;
22
+ }
23
+ catch (cause) {
24
+ if (cause instanceof DatabaseFailure)
25
+ throw cause;
26
+ throw new DatabaseFailure({
27
+ _tag: 'IndexedDBDecodeError',
28
+ store,
29
+ committed: true,
30
+ issues: [{ message: cause instanceof Error ? cause.message : String(cause) }],
31
+ });
32
+ }
33
+ };
34
+ const decodeResult = async (result) => {
35
+ let decoded = result;
36
+ if (result._tag === 'Record' && result.entry.found)
37
+ decoded = {
38
+ ...result,
39
+ entry: { found: true, value: await decode(result.store, result.entry.value) },
40
+ };
41
+ else if (result._tag === 'Records')
42
+ decoded = {
43
+ ...result,
44
+ records: await Promise.all(result.records.map(async (r) => ({
45
+ key: r.key,
46
+ value: await decode(result.store, r.value),
47
+ }))),
48
+ };
49
+ // The store name originates in the typed input, and each value passed that store's schema.
50
+ return decoded;
51
+ };
52
+ return {
53
+ name: options.name ?? 'indexeddb',
54
+ concurrency: 'merge',
55
+ toError: (cause) => cause instanceof DatabaseFailure
56
+ ? cause.error
57
+ : databaseError(options.database, 'open', cause).error,
58
+ run: async (input, ctx) => {
59
+ ctx.signal.throwIfAborted();
60
+ let phase = 'encode';
61
+ try {
62
+ const operations = input._tag === 'Transaction' ? input.operations : [input];
63
+ if (operations.length === 0)
64
+ throw new DatabaseFailure({
65
+ _tag: 'IndexedDBInputError',
66
+ message: 'Transactions require at least one operation.',
67
+ });
68
+ for (const op of operations) {
69
+ if (stores[op.store] === undefined)
70
+ throw new DatabaseFailure({
71
+ _tag: 'IndexedDBInputError',
72
+ message: `Unknown store ${op.store}.`,
73
+ });
74
+ if (op._tag === 'Query' &&
75
+ (!Number.isInteger(op.limit) || op.limit < 1 || op.limit > 0xffffffff))
76
+ throw new DatabaseFailure({
77
+ _tag: 'IndexedDBInputError',
78
+ message: 'Query limit must be an integer from 1 to 2^32 - 1.',
79
+ });
80
+ }
81
+ const encoded = operations.map((op) => {
82
+ if (op._tag !== 'Put' || options.encode === undefined)
83
+ return op;
84
+ return {
85
+ _tag: 'Put',
86
+ store: op.store,
87
+ value: options.encode(op.store, op.value),
88
+ ...(op.key === undefined ? {} : { key: op.key }),
89
+ };
90
+ });
91
+ phase = 'open';
92
+ const db = await openDatabase(options, ctx.signal);
93
+ phase = 'transaction';
94
+ let raw;
95
+ try {
96
+ raw = await transact(db, encoded, ctx.signal);
97
+ }
98
+ finally {
99
+ db.close();
100
+ }
101
+ const results = await Promise.all(raw.map(decodeResult));
102
+ ctx.signal.throwIfAborted();
103
+ if (input._tag === 'Transaction')
104
+ return { _tag: 'Committed', results };
105
+ const result = results[0];
106
+ if (result === undefined)
107
+ throw new Error('Missing transaction result.');
108
+ return result;
109
+ }
110
+ catch (cause) {
111
+ if (ctx.signal.aborted || cause instanceof DatabaseFailure)
112
+ throw cause;
113
+ throw databaseError(options.database, phase, cause);
114
+ }
115
+ },
116
+ };
117
+ }
118
+ //# sourceMappingURL=indexeddb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexeddb.js","sourceRoot":"","sources":["../src/indexeddb.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAkB,MAAM,qCAAqC,CAAC;AAa/E,+FAA+F;AAC/F,MAAM,UAAU,mBAAmB,CACjC,MAAS,EACT,OAA4B;IAE5B,MAAM,MAAM,GAAG,KAAK,EAAE,KAAa,EAAE,KAAc,EAAoB,EAAE;QACvE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,MAAM,KAAK,SAAS;YACtB,MAAM,IAAI,eAAe,CAAC;gBACxB,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,iBAAiB,KAAK,GAAG;aACnC,CAAC,CAAC;QACL,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACzD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;gBAC7B,MAAM,IAAI,eAAe,CAAC;oBACxB,IAAI,EAAE,sBAAsB;oBAC5B,KAAK;oBACL,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,SAAS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AC,CAAC,CAAC;gBAC1B,IAAI,MAAM,KAAK,SAAS;oBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACzE,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,KAAK,YAAY,eAAe;oBAAE,MAAM,KAAK,CAAC;gBACxE,MAAM,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Optional native IndexedDB commands; native resources only exist while commands run (ADR 0028).\nimport type { Driver } from './command.js';\nimport type {\n IndexedDBError,\n IndexedDBInput,\n IndexedDBOptions,\n IndexedDBOperation,\n IndexedDBOutput,\n IndexedDBResult,\n IndexedDBStores,\n} from './indexeddb-types.js';\nimport { DatabaseFailure, databaseError, openDatabase } from './internal/indexeddb-open.js';\nimport { transact, type RawResult } from './internal/indexeddb-transaction.js';\nexport type {\n IndexedDBError,\n IndexedDBInput,\n IndexedDBOperation,\n IndexedDBOptions,\n IndexedDBOutput,\n IndexedDBRange,\n IndexedDBRecord,\n IndexedDBResult,\n IndexedDBStores,\n} from './indexeddb-types.js';\n\n/** Typed record operations and atomic batches over application-owned stores and migrations. */\nexport function makeIndexedDBDriver<S extends IndexedDBStores>(\n stores: S,\n options: IndexedDBOptions<S>,\n): Driver<IndexedDBInput<S>, IndexedDBOutput<S>, IndexedDBError> {\n const decode = async (store: string, value: unknown): Promise<unknown> => {\n const schema = stores[store];\n if (schema === undefined)\n throw new DatabaseFailure({\n _tag: 'IndexedDBInputError',\n message: `Unknown store ${store}.`,\n });\n try {\n const result = await schema['~standard'].validate(value);\n if (result.issues !== undefined)\n throw new DatabaseFailure({\n _tag: 'IndexedDBDecodeError',\n store,\n issues: result.issues,\n committed: true,\n });\n return result.value;\n } catch (cause) {\n if (cause instanceof DatabaseFailure) throw cause;\n throw new DatabaseFailure({\n _tag: 'IndexedDBDecodeError',\n store,\n committed: true,\n issues: [{ message: cause instanceof Error ? cause.message : String(cause) }],\n });\n }\n };\n const decodeResult = async (result: RawResult): Promise<IndexedDBResult<S>> => {\n let decoded: RawResult = result;\n if (result._tag === 'Record' && result.entry.found)\n decoded = {\n ...result,\n entry: { found: true, value: await decode(result.store, result.entry.value) },\n };\n else if (result._tag === 'Records')\n decoded = {\n ...result,\n records: await Promise.all(\n result.records.map(async (r) => ({\n key: r.key,\n value: await decode(result.store, r.value),\n })),\n ),\n };\n // The store name originates in the typed input, and each value passed that store's schema.\n return decoded;\n };\n return {\n name: options.name ?? 'indexeddb',\n concurrency: 'merge',\n toError: (cause) =>\n cause instanceof DatabaseFailure\n ? cause.error\n : databaseError(options.database, 'open', cause).error,\n run: async (input, ctx) => {\n ctx.signal.throwIfAborted();\n let phase: 'encode' | 'open' | 'transaction' = 'encode';\n try {\n const operations = input._tag === 'Transaction' ? input.operations : [input];\n if (operations.length === 0)\n throw new DatabaseFailure({\n _tag: 'IndexedDBInputError',\n message: 'Transactions require at least one operation.',\n });\n for (const op of operations) {\n if (stores[op.store] === undefined)\n throw new DatabaseFailure({\n _tag: 'IndexedDBInputError',\n message: `Unknown store ${op.store}.`,\n });\n if (\n op._tag === 'Query' &&\n (!Number.isInteger(op.limit) || op.limit < 1 || op.limit > 0xffffffff)\n )\n throw new DatabaseFailure({\n _tag: 'IndexedDBInputError',\n message: 'Query limit must be an integer from 1 to 2^32 - 1.',\n });\n }\n const encoded = operations.map((op): IndexedDBOperation<IndexedDBStores> => {\n if (op._tag !== 'Put' || options.encode === undefined) return op;\n return {\n _tag: 'Put',\n store: op.store,\n value: options.encode(op.store, op.value),\n ...(op.key === undefined ? {} : { key: op.key }),\n };\n });\n phase = 'open';\n const db = await openDatabase(options, ctx.signal);\n phase = 'transaction';\n let raw: readonly RawResult[];\n try {\n raw = await transact(db, encoded, ctx.signal);\n } finally {\n db.close();\n }\n const results = await Promise.all(raw.map(decodeResult));\n ctx.signal.throwIfAborted();\n if (input._tag === 'Transaction') return { _tag: 'Committed', results };\n const result = results[0];\n if (result === undefined) throw new Error('Missing transaction result.');\n return result;\n } catch (cause) {\n if (ctx.signal.aborted || cause instanceof DatabaseFailure) throw cause;\n throw databaseError(options.database, phase, cause);\n }\n },\n };\n}\n"]}
package/dist/intent.d.ts CHANGED
@@ -1,25 +1,70 @@
1
- import type { IntentInput, IntentParser, Tagged } from './types.js';
2
- /** Event a child component dispatches on its host to send an output up (ADR 0010). */
1
+ import type { IntentInput, IntentNames, IntentParser, ParserCtx, Tagged } from './types.js';
2
+ import { type Markup } from './view/index.js';
3
+ /** Event a child component dispatches on its host to send an output up (ADR 0010); public. */
3
4
  export declare const OUTPUT_EVENT = "gyral-output";
5
+ /** Default triggers (`defaultTrigger`): every component root listens for these. */
6
+ export declare const DEFAULT_EVENTS: readonly string[];
4
7
  /**
5
- * Events the intent layer listens for on each component's shadow root (capture phase, so
6
- * non-bubbling events such as `toggle` are seen too). Only `click`, `submit`, `input`,
7
- * `change` and outputs are default triggers; the rest fire via `data-intent-on="…"`.
8
- * Components may add more with `spec.events`.
8
+ * The events `data-intent-on` usually names. A component root listens (capture phase, so
9
+ * non-bubbling events such as `toggle` are seen too) for the defaults and for the events its
10
+ * templates name in `data-intent-<event>` attributes and static `data-intent-on` values; a
11
+ * template that binds `data-intent-on` dynamically adds all of these. Any other event with a
12
+ * bound intent takes a per-event attribute, `data-intent-pointerdown=${i.Press}`, whose name the
13
+ * template carries (view/05-element.md "Intent events").
14
+ */
15
+ export declare const INTENT_EVENTS: readonly string[];
16
+ /**
17
+ * The intent events a template's (or `raw()` markup's) `data-intent-<event>` and
18
+ * `data-intent-on` attributes name. A bound attribute's name is in its part; a bound
19
+ * `data-intent-on` adds every intent event.
20
+ */
21
+ export declare function eventsOf(markup: Markup): readonly string[];
22
+ /**
23
+ * The event that fires an intent unless `data-intent-on` overrides it. Custom elements
24
+ * (autonomous: the name has a dash) talk to their parent via outputs.
9
25
  */
10
- export declare const INTENT_EVENTS: readonly ["click", "submit", "input", "change", "keydown", "keyup", "focusin", "focusout", "toggle", "command", "gyral-output"];
11
- /** The event that fires an intent unless `data-intent-on` overrides it. */
12
26
  export declare function defaultTrigger(el: Element): string;
13
27
  export declare function markGyralHost(ctor: object): void;
14
28
  /**
15
- * Finds the nearest `data-intent` element for this event that belongs to `root`. Elements
16
- * inside nested components are ignored: that is component isolation.
29
+ * The number of Gyral host ancestors of `el` in the composed tree (across shadow roots): the
30
+ * scheduler renders smaller depths first (view/04-scheduler.md "Marking").
31
+ */
32
+ export declare function hostDepth(el: Element): number;
33
+ /**
34
+ * Reads an event into an IntentInput for the nearest element on its path that names an intent
35
+ * for it and belongs to `root`: its `data-intent-<type>`, else its `data-intent` when the
36
+ * event is one of its triggers. With `after`, the search starts past that element (the intent
37
+ * whose parser declined). Elements inside nested components are ignored: that is component
38
+ * isolation. Form submissions are prevented and turned into FormData.
17
39
  */
18
- export declare function findIntentElement(event: Event, root: Node): Element | undefined;
19
- /** Reads an event into an IntentInput. Form submissions are prevented and turned into FormData. */
20
- export declare function readIntent(event: Event, root: Node): IntentInput | undefined;
40
+ export declare function readIntent(event: Event, root: Node, after?: Element): IntentInput | undefined;
21
41
  export declare const intentNames: unknown;
22
- /** Listens for intent events on a component root (capture phase: `toggle` doesn't bubble). */
23
- export declare function listenForIntents(root: Node, extra: readonly string[], handler: (event: Event) => void): void;
24
- /** Parses one event with its matching parser and delivers the message (sync or async). */
25
- export declare function handleIntent<M>(event: Event, root: Node, parsers: Readonly<Record<string, IntentParser<M> | undefined>>, tag: string, deliver: (msg: Tagged | undefined) => void): void;
42
+ /**
43
+ * A component's intent names as a module-level constant, so pure list rows can name intents
44
+ * without passing them through `pick` (view/03-lists.md "Rows must be pure"). The same object
45
+ * the view gets as `i`, typed by the component's class (ADR 0023). A row that names intents
46
+ * this way needs an explicit return type, or the row, the view and the class infer each other
47
+ * in a circle:
48
+ *
49
+ * const i = intentsOf<typeof TodoList>();
50
+ * const Row = (t: Todo): TemplateResult => html`<input value=${t.id} data-intent=${i.Toggle} />`;
51
+ */
52
+ export declare function intentsOf<C extends {
53
+ readonly intentNames?: string;
54
+ }>(): IntentNames<NonNullable<C['intentNames']>>;
55
+ /**
56
+ * Adds capture listeners for `types` to a component root, skipping those in `listening`. A
57
+ * root that listens for `command` in a browser without invoker commands loads the fallback
58
+ * (invokers-shim.ts, ADR 0003 tier 3); settled() waits for it.
59
+ */
60
+ export declare function listenForIntents(root: Node, listening: Set<string>, types: readonly string[], handler: (event: Event) => void): void;
61
+ /**
62
+ * Parses one event with its matching parser and delivers the message (sync or async). A
63
+ * parser that returns `undefined` synchronously declines: the next intent outward for the same
64
+ * event gets it, up to the component root. A promise can't decline. The model's `ctx()` is
65
+ * built only when a parser runs, so its props are those at event time.
66
+ */
67
+ export declare function handleIntent<M>(event: Event, root: Node, parsers: Readonly<Record<string, IntentParser<M> | true | undefined>>, tag: string, model: {
68
+ ctx(): ParserCtx<unknown>;
69
+ fail(cause: unknown, phase: 'parse', text: string, msg?: string): unknown;
70
+ }, deliver: (msg: Tagged | undefined) => void): void;