@gyral/core 0.3.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 (381) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/NOTICE +19 -0
  3. package/README.md +30 -5
  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 +25 -3
  8. package/dist/children.js +18 -1
  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 +25 -11
  15. package/dist/command.js.map +1 -1
  16. package/dist/compiler/ast.d.ts +2 -0
  17. package/dist/compiler/ast.js +5 -1
  18. package/dist/compiler/ast.js.map +1 -1
  19. package/dist/compiler/compile.d.ts +5 -2
  20. package/dist/compiler/compile.js +36 -17
  21. package/dist/compiler/compile.js.map +1 -1
  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 +4 -0
  35. package/dist/compiler/hooks.js +144 -89
  36. package/dist/compiler/hooks.js.map +1 -1
  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 +1 -1
  44. package/dist/compiler/parse5-check.js +8 -3
  45. package/dist/compiler/parse5-check.js.map +1 -1
  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 +13 -3
  50. package/dist/compiler/scan.js +21 -13
  51. package/dist/compiler/scan.js.map +1 -1
  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/tag-map.d.ts +41 -0
  56. package/dist/compiler/tag-map.js +126 -0
  57. package/dist/compiler/tag-map.js.map +1 -0
  58. package/dist/components-ready.d.ts +7 -0
  59. package/dist/components-ready.js +19 -0
  60. package/dist/components-ready.js.map +1 -0
  61. package/dist/define.d.ts +13 -4
  62. package/dist/define.js +8 -12
  63. package/dist/define.js.map +1 -1
  64. package/dist/devtools-events.d.ts +8 -0
  65. package/dist/devtools-events.js.map +1 -1
  66. package/dist/devtools-off.d.ts +1 -0
  67. package/dist/devtools-off.js +1 -0
  68. package/dist/devtools-off.js.map +1 -1
  69. package/dist/devtools.d.ts +3 -0
  70. package/dist/devtools.js +14 -0
  71. package/dist/devtools.js.map +1 -1
  72. package/dist/drivers-scope.js.map +1 -1
  73. package/dist/element-internals.d.ts +1 -0
  74. package/dist/element-internals.js +11 -0
  75. package/dist/element-internals.js.map +1 -0
  76. package/dist/element-types.d.ts +6 -2
  77. package/dist/element-types.js.map +1 -1
  78. package/dist/element.js +80 -27
  79. package/dist/element.js.map +1 -1
  80. package/dist/error-view.d.ts +10 -0
  81. package/dist/error-view.js +30 -0
  82. package/dist/error-view.js.map +1 -0
  83. package/dist/errors.d.ts +21 -0
  84. package/dist/errors.js +47 -0
  85. package/dist/errors.js.map +1 -0
  86. package/dist/errors.json +289 -0
  87. package/dist/eslint/imports.d.ts +2 -0
  88. package/dist/eslint/imports.js +2 -2
  89. package/dist/eslint/imports.js.map +1 -1
  90. package/dist/eslint/index.d.ts +2 -1
  91. package/dist/eslint/index.js +11 -3
  92. package/dist/eslint/index.js.map +1 -1
  93. package/dist/eslint/template-rule.d.ts +1 -0
  94. package/dist/eslint/template-rule.js +15 -5
  95. package/dist/eslint/template-rule.js.map +1 -1
  96. package/dist/eslint/unused-intent-rule.d.ts +2 -0
  97. package/dist/eslint/unused-intent-rule.js +186 -0
  98. package/dist/eslint/unused-intent-rule.js.map +1 -0
  99. package/dist/features.d.ts +2 -2
  100. package/dist/features.js.map +1 -1
  101. package/dist/focus.d.ts +6 -0
  102. package/dist/focus.js +32 -2
  103. package/dist/focus.js.map +1 -1
  104. package/dist/form-associated.d.ts +46 -0
  105. package/dist/form-associated.js +77 -0
  106. package/dist/form-associated.js.map +1 -0
  107. package/dist/forms.d.ts +42 -30
  108. package/dist/forms.js +85 -41
  109. package/dist/forms.js.map +1 -1
  110. package/dist/frame-lane.d.ts +11 -0
  111. package/dist/frame-lane.js +28 -0
  112. package/dist/frame-lane.js.map +1 -0
  113. package/dist/head.d.ts +61 -0
  114. package/dist/head.js +85 -0
  115. package/dist/head.js.map +1 -0
  116. package/dist/host-model.d.ts +34 -5
  117. package/dist/host-model.js +146 -23
  118. package/dist/host-model.js.map +1 -1
  119. package/dist/hydration-client.js +2 -2
  120. package/dist/hydration-client.js.map +1 -1
  121. package/dist/hydration-loader.d.ts +13 -0
  122. package/dist/hydration-loader.js +58 -0
  123. package/dist/hydration-loader.js.map +1 -0
  124. package/dist/hydration-off.d.ts +8 -0
  125. package/dist/hydration-off.js +25 -0
  126. package/dist/hydration-off.js.map +1 -0
  127. package/dist/hydration.d.ts +0 -12
  128. package/dist/hydration.js +3 -52
  129. package/dist/hydration.js.map +1 -1
  130. package/dist/index.d.ts +20 -24
  131. package/dist/index.js +10 -19
  132. package/dist/index.js.map +1 -1
  133. package/dist/indexeddb-types.d.ts +97 -0
  134. package/dist/indexeddb-types.js +2 -0
  135. package/dist/indexeddb-types.js.map +1 -0
  136. package/dist/indexeddb.d.ts +5 -0
  137. package/dist/indexeddb.js +118 -0
  138. package/dist/indexeddb.js.map +1 -0
  139. package/dist/intent.d.ts +41 -19
  140. package/dist/intent.js +144 -106
  141. package/dist/intent.js.map +1 -1
  142. package/dist/internal/indexeddb-open.d.ts +8 -0
  143. package/dist/internal/indexeddb-open.js +96 -0
  144. package/dist/internal/indexeddb-open.js.map +1 -0
  145. package/dist/internal/indexeddb-transaction.d.ts +4 -0
  146. package/dist/internal/indexeddb-transaction.js +134 -0
  147. package/dist/internal/indexeddb-transaction.js.map +1 -0
  148. package/dist/internal/interpreter.d.ts +12 -4
  149. package/dist/internal/interpreter.js +36 -48
  150. package/dist/internal/interpreter.js.map +1 -1
  151. package/dist/internal/token.d.ts +1 -0
  152. package/dist/internal/token.js +7 -0
  153. package/dist/internal/token.js.map +1 -0
  154. package/dist/internal.d.ts +20 -0
  155. package/dist/internal.js +22 -0
  156. package/dist/internal.js.map +1 -0
  157. package/dist/invoker-fallback-used.d.ts +4 -0
  158. package/dist/invoker-fallback-used.js +10 -0
  159. package/dist/invoker-fallback-used.js.map +1 -0
  160. package/dist/invoker-fallback.d.ts +4 -0
  161. package/dist/invoker-fallback.js +15 -0
  162. package/dist/invoker-fallback.js.map +1 -0
  163. package/dist/light-dom.d.ts +1 -1
  164. package/dist/light-dom.js.map +1 -1
  165. package/dist/prop.d.ts +30 -7
  166. package/dist/prop.js +19 -0
  167. package/dist/prop.js.map +1 -1
  168. package/dist/props.d.ts +8 -3
  169. package/dist/props.js +22 -15
  170. package/dist/props.js.map +1 -1
  171. package/dist/retry.d.ts +15 -0
  172. package/dist/retry.js +48 -0
  173. package/dist/retry.js.map +1 -0
  174. package/dist/scheduler.d.ts +7 -3
  175. package/dist/scheduler.js +38 -56
  176. package/dist/scheduler.js.map +1 -1
  177. package/dist/script-json.d.ts +2 -0
  178. package/dist/script-json.js +13 -0
  179. package/dist/script-json.js.map +1 -0
  180. package/dist/server-component.d.ts +1 -1
  181. package/dist/server-component.js +45 -14
  182. package/dist/server-component.js.map +1 -1
  183. package/dist/server.d.ts +8 -2
  184. package/dist/server.js +11 -2
  185. package/dist/server.js.map +1 -1
  186. package/dist/settled.d.ts +4 -3
  187. package/dist/settled.js +48 -26
  188. package/dist/settled.js.map +1 -1
  189. package/dist/spec-features-used.d.ts +21 -0
  190. package/dist/spec-features-used.js +50 -0
  191. package/dist/spec-features-used.js.map +1 -0
  192. package/dist/spec-features.d.ts +28 -0
  193. package/dist/spec-features.js +42 -0
  194. package/dist/spec-features.js.map +1 -0
  195. package/dist/states.d.ts +3 -5
  196. package/dist/states.js +22 -8
  197. package/dist/states.js.map +1 -1
  198. package/dist/storage.d.ts +69 -0
  199. package/dist/storage.js +158 -0
  200. package/dist/storage.js.map +1 -0
  201. package/dist/store-binding.js +2 -2
  202. package/dist/store-binding.js.map +1 -1
  203. package/dist/store-scope.d.ts +2 -4
  204. package/dist/store-scope.js +6 -16
  205. package/dist/store-scope.js.map +1 -1
  206. package/dist/store.js +36 -8
  207. package/dist/store.js.map +1 -1
  208. package/dist/subscription.d.ts +35 -0
  209. package/dist/subscription.js +74 -0
  210. package/dist/subscription.js.map +1 -0
  211. package/dist/subscriptions.d.ts +26 -0
  212. package/dist/subscriptions.js +98 -0
  213. package/dist/subscriptions.js.map +1 -0
  214. package/dist/transitions.d.ts +4 -5
  215. package/dist/transitions.js +10 -4
  216. package/dist/transitions.js.map +1 -1
  217. package/dist/types.d.ts +124 -27
  218. package/dist/types.js.map +1 -1
  219. package/dist/use-dialogs.d.ts +2 -0
  220. package/dist/use-dialogs.js +9 -0
  221. package/dist/use-dialogs.js.map +1 -0
  222. package/dist/use-disposal.d.ts +2 -0
  223. package/dist/use-disposal.js +9 -0
  224. package/dist/use-disposal.js.map +1 -0
  225. package/dist/use-error-view.d.ts +2 -0
  226. package/dist/use-error-view.js +9 -0
  227. package/dist/use-error-view.js.map +1 -0
  228. package/dist/use-errored.d.ts +2 -0
  229. package/dist/use-errored.js +9 -0
  230. package/dist/use-errored.js.map +1 -0
  231. package/dist/use-form-associated.d.ts +2 -0
  232. package/dist/use-form-associated.js +7 -0
  233. package/dist/use-form-associated.js.map +1 -0
  234. package/dist/use-frame-lane.d.ts +2 -0
  235. package/dist/use-frame-lane.js +10 -0
  236. package/dist/use-frame-lane.js.map +1 -0
  237. package/dist/use-invokers.d.ts +2 -0
  238. package/dist/use-invokers.js +10 -0
  239. package/dist/use-invokers.js.map +1 -0
  240. package/dist/use-states.d.ts +2 -0
  241. package/dist/use-states.js +10 -0
  242. package/dist/use-states.js.map +1 -0
  243. package/dist/use-subscriptions.d.ts +2 -0
  244. package/dist/use-subscriptions.js +10 -0
  245. package/dist/use-subscriptions.js.map +1 -0
  246. package/dist/use-transitions.d.ts +2 -0
  247. package/dist/use-transitions.js +10 -0
  248. package/dist/use-transitions.js.map +1 -0
  249. package/dist/view/attributes.d.ts +5 -0
  250. package/dist/view/attributes.js +5 -0
  251. package/dist/view/attributes.js.map +1 -1
  252. package/dist/view/compiled.d.ts +1 -1
  253. package/dist/view/compiled.js +1 -1
  254. package/dist/view/compiled.js.map +1 -1
  255. package/dist/view/index.d.ts +9 -4
  256. package/dist/view/index.js +9 -3
  257. package/dist/view/index.js.map +1 -1
  258. package/dist/view/loc.d.ts +9 -0
  259. package/dist/view/loc.js +50 -0
  260. package/dist/view/loc.js.map +1 -0
  261. package/dist/view/message.d.ts +17 -0
  262. package/dist/view/message.js +40 -0
  263. package/dist/view/message.js.map +1 -0
  264. package/dist/view/messages.d.ts +43 -0
  265. package/dist/view/messages.js +84 -0
  266. package/dist/view/messages.js.map +1 -0
  267. package/dist/view/normalize/check.d.ts +5 -2
  268. package/dist/view/normalize/check.js +6 -3
  269. package/dist/view/normalize/check.js.map +1 -1
  270. package/dist/view/normalize/emit.d.ts +2 -0
  271. package/dist/view/normalize/emit.js +40 -11
  272. package/dist/view/normalize/emit.js.map +1 -1
  273. package/dist/view/normalize/errors.js +1 -1
  274. package/dist/view/normalize/errors.js.map +1 -1
  275. package/dist/view/normalize/id.d.ts +5 -2
  276. package/dist/view/normalize/id.js +9 -2
  277. package/dist/view/normalize/id.js.map +1 -1
  278. package/dist/view/normalize/normalize.d.ts +7 -4
  279. package/dist/view/normalize/normalize.js +15 -9
  280. package/dist/view/normalize/normalize.js.map +1 -1
  281. package/dist/view/normalize/rules.d.ts +9 -0
  282. package/dist/view/normalize/rules.js +35 -5
  283. package/dist/view/normalize/rules.js.map +1 -1
  284. package/dist/view/normalize/svg.d.ts +14 -0
  285. package/dist/view/normalize/svg.js +40 -0
  286. package/dist/view/normalize/svg.js.map +1 -0
  287. package/dist/view/normalize/tokens.d.ts +5 -1
  288. package/dist/view/normalize/tokens.js.map +1 -1
  289. package/dist/view/normalize/tree.d.ts +8 -2
  290. package/dist/view/normalize/tree.js +58 -13
  291. package/dist/view/normalize/tree.js.map +1 -1
  292. package/dist/view/normalize/types.d.ts +24 -4
  293. package/dist/view/normalize/types.js +4 -1
  294. package/dist/view/normalize/types.js.map +1 -1
  295. package/dist/view/normalize/whitespace.js +4 -3
  296. package/dist/view/normalize/whitespace.js.map +1 -1
  297. package/dist/view/prepare-stub.js +2 -2
  298. package/dist/view/prepare-stub.js.map +1 -1
  299. package/dist/view/prepare.d.ts +5 -2
  300. package/dist/view/prepare.js +9 -3
  301. package/dist/view/prepare.js.map +1 -1
  302. package/dist/view/registry.d.ts +15 -0
  303. package/dist/view/registry.js +10 -2
  304. package/dist/view/registry.js.map +1 -1
  305. package/dist/view/render/adopt-attr.js +7 -1
  306. package/dist/view/render/adopt-attr.js.map +1 -1
  307. package/dist/view/render/adopt.js +21 -4
  308. package/dist/view/render/adopt.js.map +1 -1
  309. package/dist/view/render/attr-parts.d.ts +12 -1
  310. package/dist/view/render/attr-parts.js +38 -5
  311. package/dist/view/render/attr-parts.js.map +1 -1
  312. package/dist/view/render/child-part.js +5 -2
  313. package/dist/view/render/child-part.js.map +1 -1
  314. package/dist/view/render/dispose.d.ts +3 -0
  315. package/dist/view/render/dispose.js +76 -0
  316. package/dist/view/render/dispose.js.map +1 -0
  317. package/dist/view/render/hook-part.d.ts +3 -1
  318. package/dist/view/render/hook-part.js +21 -5
  319. package/dist/view/render/hook-part.js.map +1 -1
  320. package/dist/view/render/hook-run.d.ts +2 -0
  321. package/dist/view/render/hook-run.js +72 -0
  322. package/dist/view/render/hook-run.js.map +1 -0
  323. package/dist/view/render/hooks.d.ts +73 -5
  324. package/dist/view/render/hooks.js +79 -17
  325. package/dist/view/render/hooks.js.map +1 -1
  326. package/dist/view/render/hydrate.js +2 -2
  327. package/dist/view/render/hydrate.js.map +1 -1
  328. package/dist/view/render/keyed.d.ts +6 -0
  329. package/dist/view/render/keyed.js +15 -0
  330. package/dist/view/render/keyed.js.map +1 -0
  331. package/dist/view/render/mismatch.js +5 -3
  332. package/dist/view/render/mismatch.js.map +1 -1
  333. package/dist/view/render/modal.d.ts +3 -0
  334. package/dist/view/render/modal.js +39 -0
  335. package/dist/view/render/modal.js.map +1 -0
  336. package/dist/view/render/raw.d.ts +4 -1
  337. package/dist/view/render/raw.js +6 -2
  338. package/dist/view/render/raw.js.map +1 -1
  339. package/dist/view/render/render.d.ts +4 -1
  340. package/dist/view/render/render.js +17 -12
  341. package/dist/view/render/render.js.map +1 -1
  342. package/dist/view/render/toggles.d.ts +6 -0
  343. package/dist/view/render/toggles.js +6 -0
  344. package/dist/view/render/toggles.js.map +1 -0
  345. package/dist/view/render/warn.d.ts +14 -0
  346. package/dist/view/render/warn.js +45 -0
  347. package/dist/view/render/warn.js.map +1 -1
  348. package/dist/view/server/component.d.ts +6 -3
  349. package/dist/view/server/component.js +29 -7
  350. package/dist/view/server/component.js.map +1 -1
  351. package/dist/view/server/index.d.ts +20 -0
  352. package/dist/view/server/index.js +12 -4
  353. package/dist/view/server/index.js.map +1 -1
  354. package/dist/view/server/tags.d.ts +13 -2
  355. package/dist/view/server/tags.js +13 -2
  356. package/dist/view/server/tags.js.map +1 -1
  357. package/dist/view/server/values.d.ts +2 -0
  358. package/dist/view/server/values.js +8 -0
  359. package/dist/view/server/values.js.map +1 -1
  360. package/dist/view/server/writer.d.ts +9 -4
  361. package/dist/view/server/writer.js +33 -18
  362. package/dist/view/server/writer.js.map +1 -1
  363. package/dist/view/template-element.d.ts +7 -0
  364. package/dist/view/template-element.js +25 -5
  365. package/dist/view/template-element.js.map +1 -1
  366. package/dist/view/template.d.ts +10 -2
  367. package/dist/view/template.js +62 -8
  368. package/dist/view/template.js.map +1 -1
  369. package/dist/view/trusted-html.d.ts +6 -0
  370. package/dist/view/trusted-html.js +34 -0
  371. package/dist/view/trusted-html.js.map +1 -0
  372. package/dist/vite.d.ts +38 -31
  373. package/dist/vite.js +198 -31
  374. package/dist/vite.js.map +1 -1
  375. package/package.json +34 -3
  376. package/dist/hooks/labelled-by.d.ts +0 -13
  377. package/dist/hooks/labelled-by.js +0 -51
  378. package/dist/hooks/labelled-by.js.map +0 -1
  379. package/dist/random.d.ts +0 -13
  380. package/dist/random.js +0 -19
  381. package/dist/random.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,35 +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';
12
- export { intents } from './intent.js';
14
+ export { intentsOf, OUTPUT_EVENT } from './intent.js';
13
15
  export { settled } from './settled.js';
16
+ export { componentsReady } from './components-ready.js';
17
+ export { GyralError, type ErrorPhase } from './errors.js';
14
18
  export { changed, defineStore, send } from './store.js';
15
- export type { AnyStore, AnyStoreInstance, Store, StoreChanged, StoreInstance, StoreOverrides, StoreRef, StoreSendInput, SeedCheck, StoreResolver, StoreSpec, StoreUpdate, } from './store.js';
16
- export { STORE_SEND } from './store.js';
17
- export { resetDocumentStores, scriptSafeJson, STORE_SEED_ATTRIBUTE, StoreRegistry, STORES_ELEMENT, withStoreScope, } from './store-scope.js';
18
- export { DRIVERS_ELEMENT, provideDrivers } from './drivers-scope.js';
19
- export { jsonHazard, warnJsonHazard } from './json-safety.js';
20
- export { random, randomDriver, randomInt, toInt, type RandomInput } from './random.js';
21
- export { defineForm, field, fieldErrors, form, formDataToObject, formFields, intentRejectedSchema, redirectedTo, validateForm, } from './forms.js';
22
- export type { FormDefinition, FormRedirected, FormResult, FormValue } from './forms.js';
23
- export { runInit } from './init.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';
24
23
  export { invalid } from './hooks/invalid.js';
25
- export { findInScope, labelledBy } from './hooks/labelled-by.js';
24
+ export type { FormAssociation, FormControlValue, FormControlValidity, FormDisabled, FormReset, FormStateRestore, } from './form-associated.js';
26
25
  export { prop } from './prop.js';
27
- export type { Prop, PropKind, PropsOf } from './prop.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 { isLightComponent, LIGHT_ATTRIBUTE } from './light-dom.js';
32
- export type { GyralElement, GyralElementClass } from './define.js';
33
- export type { ComponentSpec, Ctx, FieldIssue, FormFields, IntentInput, IntentNames, IntentParser, IntentRejected, Intents, PropDeclarations, Hydrated, PropsChanged, Stateless, StoreReader, Tagged, Update, } from './types.js';
34
- export { css, defineHook, each, html, HydrationMismatch, nothing, raw } from './view/index.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';
35
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,28 +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';
7
- export { intents } from './intent.js';
8
+ export { intentsOf, OUTPUT_EVENT } from './intent.js';
8
9
  export { settled } from './settled.js';
10
+ export { componentsReady } from './components-ready.js';
11
+ export { GyralError } from './errors.js';
9
12
  export { changed, defineStore, send } from './store.js';
10
- export { STORE_SEND } from './store.js';
11
- // Store scoping: used by @gyral/ssr (server scope + page seed) and @gyral/testing.
12
- export { resetDocumentStores, scriptSafeJson, STORE_SEED_ATTRIBUTE, StoreRegistry, STORES_ELEMENT, withStoreScope, } from './store-scope.js';
13
- export { DRIVERS_ELEMENT, provideDrivers } from './drivers-scope.js';
14
- export { jsonHazard, warnJsonHazard } from './json-safety.js';
15
- export { random, randomDriver, randomInt, toInt } from './random.js';
16
- export { defineForm, field, fieldErrors, form, formDataToObject, formFields, intentRejectedSchema, redirectedTo, validateForm, } from './forms.js';
17
- export { runInit } from './init.js';
13
+ export { provideDrivers } from './drivers-scope.js';
14
+ export { defineForm, field, fieldErrors, form } from './forms.js';
18
15
  export { invalid } from './hooks/invalid.js';
19
- export { findInScope, labelledBy } from './hooks/labelled-by.js';
20
16
  export { prop } from './prop.js';
21
- // Devtools event stream (ADR 0017): emitted in development builds only.
22
- export { DEVTOOLS_ENABLED as devtoolsEnabled, devLiveComponents as devtoolsLiveComponents, } from '#devtools';
23
- export { DEVTOOLS_GLOBAL } from './devtools-events.js';
24
- // Used by the server renderer and @gyral/ssr (ADR 0014, view/06-server.md).
25
- export { isLightComponent, LIGHT_ATTRIBUTE } from './light-dom.js';
26
17
  // The view layer (ADR 0018, docs/design-docs/view/): templates, lists, hooks and styles.
27
- export { css, defineHook, each, html, HydrationMismatch, nothing, raw } from './view/index.js';
18
+ export { css, defineHook, each, html, keyed, nothing, raw, svg } from './view/index.js';
28
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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sB,CAAC;AAQvD,4EAA4E;AAC5E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAqBnE,yFAAyF;AACzF,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,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 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 { intents } from './intent.js';\nexport { settled } from './settled.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 { 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 { runInit } from './init.js';\nexport { invalid } from './hooks/invalid.js';\nexport { findInScope, labelledBy } from './hooks/labelled-by.js';\nexport { prop } from './prop.js';\nexport type { Prop, PropKind, PropsOf } from './prop.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';\n// Used by the server renderer and @gyral/ssr (ADR 0014, view/06-server.md).\nexport { 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 (ADR 0018, docs/design-docs/view/): templates, lists, hooks and styles.\nexport { css, defineHook, each, html, HydrationMismatch, nothing, raw } 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"]}
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,EAAE,I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,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,19 +1,28 @@
1
- import type { IntentInput, IntentNames, IntentParser, 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). */
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. */
4
4
  export declare const OUTPUT_EVENT = "gyral-output";
5
5
  /** Default triggers (`defaultTrigger`): every component root listens for these. */
6
6
  export declare const DEFAULT_EVENTS: readonly string[];
7
7
  /**
8
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, for `spec.events`, and
10
- * for the `data-intent-on` values in the templates it renders; a template that binds
11
- * `data-intent-on` dynamically adds all of these (view/05-element.md "Intent events").
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").
12
14
  */
13
15
  export declare const INTENT_EVENTS: readonly string[];
14
- /** The intent events a template's (or `raw()` markup's) `data-intent-on` attributes name. */
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
+ */
15
21
  export declare function eventsOf(markup: Markup): readonly string[];
16
- /** The event that fires an intent unless `data-intent-on` overrides it. */
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.
25
+ */
17
26
  export declare function defaultTrigger(el: Element): string;
18
27
  export declare function markGyralHost(ctor: object): void;
19
28
  /**
@@ -22,27 +31,40 @@ export declare function markGyralHost(ctor: object): void;
22
31
  */
23
32
  export declare function hostDepth(el: Element): number;
24
33
  /**
25
- * Finds the nearest `data-intent` element for this event that belongs to `root`. Elements
26
- * inside nested components are ignored: that is component isolation.
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.
27
39
  */
28
- export declare function findIntentElement(event: Event, root: Node): Element | undefined;
29
- /** Reads an event into an IntentInput. Form submissions are prevented and turned into FormData. */
30
- export declare function readIntent(event: Event, root: Node): IntentInput | undefined;
40
+ export declare function readIntent(event: Event, root: Node, after?: Element): IntentInput | undefined;
31
41
  export declare const intentNames: unknown;
32
42
  /**
33
43
  * A component's intent names as a module-level constant, so pure list rows can name intents
34
44
  * without passing them through `pick` (view/03-lists.md "Rows must be pure"). The same object
35
- * the view gets as `i`:
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:
36
48
  *
37
- * const i = intents<Msg>();
38
- * const Row = (t: Todo) => html`<input value=${t.id} data-intent=${i.Toggle} />`;
49
+ * const i = intentsOf<typeof TodoList>();
50
+ * const Row = (t: Todo): TemplateResult => html`<input value=${t.id} data-intent=${i.Toggle} />`;
39
51
  */
40
- export declare function intents<M extends Tagged>(): IntentNames<M>;
52
+ export declare function intentsOf<C extends {
53
+ readonly intentNames?: string;
54
+ }>(): IntentNames<NonNullable<C['intentNames']>>;
41
55
  /**
42
56
  * Adds capture listeners for `types` to a component root, skipping those in `listening`. A
43
57
  * root that listens for `command` in a browser without invoker commands loads the fallback
44
58
  * (invokers-shim.ts, ADR 0003 tier 3); settled() waits for it.
45
59
  */
46
60
  export declare function listenForIntents(root: Node, listening: Set<string>, types: readonly string[], handler: (event: Event) => void): void;
47
- /** Parses one event with its matching parser and delivers the message (sync or async). */
48
- export declare function handleIntent<M>(event: Event, root: Node, parsers: Readonly<Record<string, IntentParser<M> | undefined>>, tag: string, deliver: (msg: Tagged | undefined) => 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;