effectweb 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +93 -1
  2. package/dist/AsyncContent.d.ts +2 -2
  3. package/dist/AsyncContent.js +6 -3
  4. package/dist/actions.d.ts +4 -3
  5. package/dist/actions.js +1 -0
  6. package/dist/cache-internals.d.ts +14 -0
  7. package/dist/cache-internals.js +11 -0
  8. package/dist/cache.d.ts +17 -14
  9. package/dist/cache.js +98 -26
  10. package/dist/collection.d.ts +10 -9
  11. package/dist/collection.js +32 -6
  12. package/dist/component.d.ts +8 -7
  13. package/dist/diagnostics.d.ts +25 -0
  14. package/dist/diagnostics.js +167 -1
  15. package/dist/dom-attributes.json +71 -0
  16. package/dist/dom.d.ts +33 -12
  17. package/dist/dom.js +466 -80
  18. package/dist/form.d.ts +61 -0
  19. package/dist/form.js +98 -0
  20. package/dist/html-attributes.d.ts +602 -0
  21. package/dist/html-attributes.js +1 -0
  22. package/dist/http.d.ts +5 -0
  23. package/dist/http.js +7 -0
  24. package/dist/index.d.ts +12 -10
  25. package/dist/index.js +7 -5
  26. package/dist/jsx.d.ts +165 -33
  27. package/dist/jsx.js +2 -1
  28. package/dist/lazy.d.ts +23 -0
  29. package/dist/lazy.js +58 -0
  30. package/dist/load.d.ts +3 -3
  31. package/dist/mount.d.ts +8 -11
  32. package/dist/mount.js +1 -3
  33. package/dist/owner.d.ts +11 -9
  34. package/dist/owner.js +27 -36
  35. package/dist/pages.d.ts +23 -22
  36. package/dist/pages.js +15 -9
  37. package/dist/program.d.ts +19 -9
  38. package/dist/program.js +145 -49
  39. package/dist/query-internals.d.ts +11 -0
  40. package/dist/query-internals.js +10 -0
  41. package/dist/query.d.ts +24 -19
  42. package/dist/query.js +60 -7
  43. package/dist/resource.d.ts +4 -10
  44. package/dist/resource.js +14 -5
  45. package/dist/runtime.d.ts +1 -2
  46. package/dist/runtime.js +3 -3
  47. package/dist/session.d.ts +12 -15
  48. package/dist/session.js +15 -12
  49. package/dist/share.d.ts +5 -4
  50. package/dist/share.js +5 -44
  51. package/dist/sharing.d.ts +6 -0
  52. package/dist/sharing.js +93 -0
  53. package/dist/snapshot.d.ts +16 -5
  54. package/dist/snapshot.js +6 -7
  55. package/dist/svg-attributes.d.ts +12 -0
  56. package/dist/svg-attributes.js +1 -0
  57. package/dist/task.d.ts +9 -8
  58. package/dist/task.js +75 -47
  59. package/dist/tasks.d.ts +20 -15
  60. package/dist/tasks.js +39 -25
  61. package/dist/testing.d.ts +10 -14
  62. package/package.json +5 -1
@@ -0,0 +1,602 @@
1
+ /** HTML content attribute applicability, checked against the WHATWG index on 2026-09-08.
2
+ * https://html.spec.whatwg.org/multipage/indices.html#attributes-3
3
+ * Includes input capture, Remote Playback, Picture-in-Picture and CSS Shadow Parts extensions.
4
+ * Type-only: no runtime attribute inventory is retained.
5
+ */
6
+ export type HtmlAttributes = {
7
+ abbr: {
8
+ th: true;
9
+ };
10
+ accept: {
11
+ input: true;
12
+ };
13
+ 'accept-charset': {
14
+ form: true;
15
+ };
16
+ accesskey: {
17
+ '*': true;
18
+ };
19
+ action: {
20
+ form: true;
21
+ };
22
+ allow: {
23
+ iframe: true;
24
+ };
25
+ allowfullscreen: {
26
+ iframe: true;
27
+ };
28
+ alpha: {
29
+ input: true;
30
+ };
31
+ alt: {
32
+ area: true;
33
+ img: true;
34
+ input: true;
35
+ };
36
+ as: {
37
+ link: true;
38
+ };
39
+ async: {
40
+ script: true;
41
+ };
42
+ autocapitalize: {
43
+ '*': true;
44
+ };
45
+ autocomplete: {
46
+ form: true;
47
+ input: true;
48
+ select: true;
49
+ textarea: true;
50
+ };
51
+ autocorrect: {
52
+ '*': true;
53
+ };
54
+ autofocus: {
55
+ '*': true;
56
+ };
57
+ autoplay: {
58
+ audio: true;
59
+ video: true;
60
+ };
61
+ blocking: {
62
+ link: true;
63
+ script: true;
64
+ style: true;
65
+ };
66
+ capture: {
67
+ input: true;
68
+ };
69
+ charset: {
70
+ meta: true;
71
+ };
72
+ checked: {
73
+ input: true;
74
+ };
75
+ cite: {
76
+ blockquote: true;
77
+ del: true;
78
+ ins: true;
79
+ q: true;
80
+ };
81
+ class: {
82
+ '*': true;
83
+ };
84
+ closedby: {
85
+ dialog: true;
86
+ };
87
+ color: {
88
+ link: true;
89
+ };
90
+ colorspace: {
91
+ input: true;
92
+ };
93
+ cols: {
94
+ textarea: true;
95
+ };
96
+ colspan: {
97
+ td: true;
98
+ th: true;
99
+ };
100
+ command: {
101
+ button: true;
102
+ };
103
+ commandfor: {
104
+ button: true;
105
+ };
106
+ content: {
107
+ meta: true;
108
+ };
109
+ contenteditable: {
110
+ '*': true;
111
+ };
112
+ controls: {
113
+ audio: true;
114
+ video: true;
115
+ img: true;
116
+ };
117
+ coords: {
118
+ area: true;
119
+ };
120
+ crossorigin: {
121
+ audio: true;
122
+ img: true;
123
+ link: true;
124
+ script: true;
125
+ video: true;
126
+ };
127
+ data: {
128
+ object: true;
129
+ };
130
+ datetime: {
131
+ del: true;
132
+ ins: true;
133
+ time: true;
134
+ };
135
+ decoding: {
136
+ img: true;
137
+ };
138
+ default: {
139
+ track: true;
140
+ };
141
+ defer: {
142
+ script: true;
143
+ };
144
+ dir: {
145
+ '*': true;
146
+ bdo: true;
147
+ };
148
+ dirname: {
149
+ input: true;
150
+ textarea: true;
151
+ };
152
+ disabled: {
153
+ button: true;
154
+ input: true;
155
+ optgroup: true;
156
+ option: true;
157
+ select: true;
158
+ textarea: true;
159
+ fieldset: true;
160
+ link: true;
161
+ };
162
+ disablepictureinpicture: {
163
+ video: true;
164
+ };
165
+ disableremoteplayback: {
166
+ audio: true;
167
+ video: true;
168
+ };
169
+ download: {
170
+ a: true;
171
+ area: true;
172
+ };
173
+ draggable: {
174
+ '*': true;
175
+ };
176
+ enctype: {
177
+ form: true;
178
+ };
179
+ enterkeyhint: {
180
+ '*': true;
181
+ };
182
+ exportparts: {
183
+ '*': true;
184
+ };
185
+ fetchpriority: {
186
+ img: true;
187
+ link: true;
188
+ script: true;
189
+ };
190
+ for: {
191
+ label: true;
192
+ output: true;
193
+ template: true;
194
+ };
195
+ form: {
196
+ button: true;
197
+ fieldset: true;
198
+ input: true;
199
+ object: true;
200
+ output: true;
201
+ select: true;
202
+ textarea: true;
203
+ };
204
+ formaction: {
205
+ button: true;
206
+ input: true;
207
+ };
208
+ formenctype: {
209
+ button: true;
210
+ input: true;
211
+ };
212
+ formmethod: {
213
+ button: true;
214
+ input: true;
215
+ };
216
+ formnovalidate: {
217
+ button: true;
218
+ input: true;
219
+ };
220
+ formtarget: {
221
+ button: true;
222
+ input: true;
223
+ };
224
+ headers: {
225
+ td: true;
226
+ th: true;
227
+ };
228
+ headingoffset: {
229
+ '*': true;
230
+ };
231
+ headingreset: {
232
+ '*': true;
233
+ };
234
+ height: {
235
+ canvas: true;
236
+ embed: true;
237
+ iframe: true;
238
+ img: true;
239
+ input: true;
240
+ object: true;
241
+ source: true;
242
+ picture: true;
243
+ video: true;
244
+ };
245
+ hidden: {
246
+ '*': true;
247
+ };
248
+ high: {
249
+ meter: true;
250
+ };
251
+ href: {
252
+ a: true;
253
+ area: true;
254
+ link: true;
255
+ base: true;
256
+ };
257
+ hreflang: {
258
+ a: true;
259
+ link: true;
260
+ };
261
+ 'http-equiv': {
262
+ meta: true;
263
+ };
264
+ id: {
265
+ '*': true;
266
+ };
267
+ imagesizes: {
268
+ link: true;
269
+ };
270
+ imagesrcset: {
271
+ link: true;
272
+ };
273
+ inert: {
274
+ '*': true;
275
+ };
276
+ inputmode: {
277
+ '*': true;
278
+ };
279
+ integrity: {
280
+ link: true;
281
+ script: true;
282
+ };
283
+ is: {
284
+ '*': true;
285
+ };
286
+ ismap: {
287
+ img: true;
288
+ };
289
+ itemid: {
290
+ '*': true;
291
+ };
292
+ itemprop: {
293
+ '*': true;
294
+ };
295
+ itemref: {
296
+ '*': true;
297
+ };
298
+ itemscope: {
299
+ '*': true;
300
+ };
301
+ itemtype: {
302
+ '*': true;
303
+ };
304
+ kind: {
305
+ track: true;
306
+ };
307
+ label: {
308
+ optgroup: true;
309
+ option: true;
310
+ track: true;
311
+ };
312
+ lang: {
313
+ '*': true;
314
+ };
315
+ list: {
316
+ input: true;
317
+ };
318
+ loading: {
319
+ iframe: true;
320
+ img: true;
321
+ audio: true;
322
+ video: true;
323
+ };
324
+ loop: {
325
+ audio: true;
326
+ video: true;
327
+ };
328
+ low: {
329
+ meter: true;
330
+ };
331
+ max: {
332
+ input: true;
333
+ meter: true;
334
+ progress: true;
335
+ };
336
+ maxlength: {
337
+ input: true;
338
+ textarea: true;
339
+ };
340
+ media: {
341
+ link: true;
342
+ meta: true;
343
+ source: true;
344
+ style: true;
345
+ };
346
+ method: {
347
+ form: true;
348
+ };
349
+ min: {
350
+ input: true;
351
+ meter: true;
352
+ };
353
+ minlength: {
354
+ input: true;
355
+ textarea: true;
356
+ };
357
+ multiple: {
358
+ input: true;
359
+ select: true;
360
+ };
361
+ muted: {
362
+ audio: true;
363
+ video: true;
364
+ };
365
+ name: {
366
+ button: true;
367
+ fieldset: true;
368
+ input: true;
369
+ output: true;
370
+ select: true;
371
+ textarea: true;
372
+ details: true;
373
+ form: true;
374
+ iframe: true;
375
+ object: true;
376
+ map: true;
377
+ meta: true;
378
+ slot: true;
379
+ };
380
+ nomodule: {
381
+ script: true;
382
+ };
383
+ nonce: {
384
+ '*': true;
385
+ };
386
+ novalidate: {
387
+ form: true;
388
+ };
389
+ open: {
390
+ details: true;
391
+ dialog: true;
392
+ };
393
+ optimum: {
394
+ meter: true;
395
+ };
396
+ part: {
397
+ '*': true;
398
+ };
399
+ pattern: {
400
+ input: true;
401
+ };
402
+ ping: {
403
+ a: true;
404
+ area: true;
405
+ };
406
+ placeholder: {
407
+ input: true;
408
+ textarea: true;
409
+ };
410
+ playsinline: {
411
+ video: true;
412
+ };
413
+ popover: {
414
+ '*': true;
415
+ };
416
+ popovertarget: {
417
+ button: true;
418
+ input: true;
419
+ };
420
+ popovertargetaction: {
421
+ button: true;
422
+ input: true;
423
+ };
424
+ poster: {
425
+ video: true;
426
+ };
427
+ preload: {
428
+ audio: true;
429
+ video: true;
430
+ };
431
+ readonly: {
432
+ input: true;
433
+ textarea: true;
434
+ };
435
+ referrerpolicy: {
436
+ a: true;
437
+ area: true;
438
+ iframe: true;
439
+ img: true;
440
+ link: true;
441
+ script: true;
442
+ };
443
+ rel: {
444
+ a: true;
445
+ area: true;
446
+ link: true;
447
+ };
448
+ required: {
449
+ input: true;
450
+ select: true;
451
+ textarea: true;
452
+ };
453
+ reversed: {
454
+ ol: true;
455
+ };
456
+ rows: {
457
+ textarea: true;
458
+ };
459
+ rowspan: {
460
+ td: true;
461
+ th: true;
462
+ };
463
+ sandbox: {
464
+ iframe: true;
465
+ };
466
+ scope: {
467
+ th: true;
468
+ };
469
+ selected: {
470
+ option: true;
471
+ };
472
+ shadowrootclonable: {
473
+ template: true;
474
+ };
475
+ shadowrootcustomelementregistry: {
476
+ template: true;
477
+ };
478
+ shadowrootdelegatesfocus: {
479
+ template: true;
480
+ };
481
+ shadowrootmode: {
482
+ template: true;
483
+ };
484
+ shadowrootserializable: {
485
+ template: true;
486
+ };
487
+ shadowrootslotassignment: {
488
+ template: true;
489
+ };
490
+ shape: {
491
+ area: true;
492
+ };
493
+ size: {
494
+ input: true;
495
+ select: true;
496
+ };
497
+ sizes: {
498
+ link: true;
499
+ img: true;
500
+ source: true;
501
+ };
502
+ slot: {
503
+ '*': true;
504
+ };
505
+ span: {
506
+ col: true;
507
+ colgroup: true;
508
+ };
509
+ spellcheck: {
510
+ '*': true;
511
+ };
512
+ src: {
513
+ audio: true;
514
+ embed: true;
515
+ iframe: true;
516
+ img: true;
517
+ input: true;
518
+ script: true;
519
+ source: true;
520
+ video: true;
521
+ track: true;
522
+ };
523
+ srcdoc: {
524
+ iframe: true;
525
+ };
526
+ srclang: {
527
+ track: true;
528
+ };
529
+ srcset: {
530
+ img: true;
531
+ source: true;
532
+ };
533
+ start: {
534
+ ol: true;
535
+ };
536
+ step: {
537
+ input: true;
538
+ };
539
+ style: {
540
+ '*': true;
541
+ };
542
+ tabindex: {
543
+ '*': true;
544
+ };
545
+ target: {
546
+ a: true;
547
+ area: true;
548
+ base: true;
549
+ form: true;
550
+ };
551
+ title: {
552
+ '*': true;
553
+ abbr: true;
554
+ dfn: true;
555
+ input: true;
556
+ link: true;
557
+ style: true;
558
+ };
559
+ translate: {
560
+ '*': true;
561
+ };
562
+ type: {
563
+ a: true;
564
+ link: true;
565
+ button: true;
566
+ embed: true;
567
+ object: true;
568
+ source: true;
569
+ input: true;
570
+ ol: true;
571
+ script: true;
572
+ };
573
+ usemap: {
574
+ img: true;
575
+ };
576
+ value: {
577
+ button: true;
578
+ option: true;
579
+ data: true;
580
+ input: true;
581
+ li: true;
582
+ meter: true;
583
+ progress: true;
584
+ };
585
+ width: {
586
+ canvas: true;
587
+ embed: true;
588
+ iframe: true;
589
+ img: true;
590
+ input: true;
591
+ object: true;
592
+ source: true;
593
+ picture: true;
594
+ video: true;
595
+ };
596
+ wrap: {
597
+ textarea: true;
598
+ };
599
+ writingsuggestions: {
600
+ '*': true;
601
+ };
602
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/http.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { Effect, type Schema } from 'effect';
2
+ import * as HttpClient from 'effect/unstable/http/HttpClient';
3
+ import type * as HttpClientRequest from 'effect/unstable/http/HttpClientRequest';
4
+ /** Decode successful JSON through a schema, retaining transport, decoding and service types. */
5
+ export declare function httpJson<S extends Schema.Constraint>(request: HttpClientRequest.HttpClientRequest, schema: S): Effect.Effect<S["Type"], import("effect/unstable/http/HttpClientError").HttpClientError | Schema.SchemaError, HttpClient.HttpClient | S["DecodingServices"]>;
package/dist/http.js ADDED
@@ -0,0 +1,7 @@
1
+ import { Effect } from 'effect';
2
+ import * as HttpClient from 'effect/unstable/http/HttpClient';
3
+ import * as HttpClientResponse from 'effect/unstable/http/HttpClientResponse';
4
+ /** Decode successful JSON through a schema, retaining transport, decoding and service types. */
5
+ export function httpJson(request, schema) {
6
+ return HttpClient.execute(request).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk), Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)));
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,24 +1,26 @@
1
- export type { Snapshot } from './snapshot.js';
1
+ export type { Snapshot, SnapshotOpaque, snapshotOpaque } from './snapshot.js';
2
2
  export { modelOwner, type ModelOwner, type DisposableOwner, type TaskPolicy } from './owner.js';
3
- export { collection, entities, sequence, type Rows } from './collection.js';
3
+ export { collection, entities, sequence, type Rows, type Collection } from './collection.js';
4
4
  export { component, localComponent, programView } from './component.js';
5
5
  export { patchModel } from './state.js';
6
6
  export { defineActions, type ActionMessage } from './actions.js';
7
7
  export { taskComponent, taskControls, type TaskModel, type TaskMessage } from './task.js';
8
8
  export { effectEvent } from './effectEvent.js';
9
- export { mountView, view, type View } from './dom.js';
9
+ export { mountView, view, ViewBinding, type View } from './dom.js';
10
+ export { lazyView, type LazyViewOptions } from './lazy.js';
10
11
  export type { JSX } from './jsx.js';
11
- export { Portal, domBinding, domMount, type DomMount } from './mount.js';
12
- export { pages, type PagesMessage, type PagesModel } from './pages.js';
13
- export { program, actionCommand, effectCommand, type Command, type Program, type Send, type Transition, } from './program.js';
12
+ export { Portal, domBinding, domMount, type DomMount, type PortalProps } from './mount.js';
13
+ export { pages, type PagesMessage, type PagesRequest, type PagesModel, type PagesProgram, type Pagination, } from './pages.js';
14
+ export { program, actionCommand, effectCommand, commandSlot, type CommandSlot, type Command, type Program, type Send, type Transition, } from './program.js';
14
15
  export { available, resourceComponent, resourceError, type ResourceMessage, type ResourceModel, } from './resource.js';
15
16
  export { fromPromise, type UiLoad, type UiPage } from './load.js';
16
- export { observeBindings, observePrograms, type BindingUpdate, type ProgramUpdate, } from './diagnostics.js';
17
- export { inputText, inputChecked, inputNumber, submit } from './form.js';
17
+ export { observeBindings, inspectBindings, mountBindingInspector, type BindingInspector, type BindingInspection, observePrograms, type BindingUpdate, type ProgramUpdate, } from './diagnostics.js';
18
+ export { inputText, inputChecked, inputNumber, submit, defineField, type FieldResult, type FieldState, type FieldMessage, type FieldController, } from './form.js';
18
19
  export { slot, type Slot, type CompiledContent } from './dom.js';
19
20
  export { AsyncContent, type AsyncContentProps } from './AsyncContent.js';
20
21
  export { defineTasks, type TaskDefinition, type TasksModel, type TasksMessage, type TaskResults, } from './tasks.js';
21
22
  export { uiRuntime, type UiRuntime } from './runtime.js';
22
- export { query, type Query } from './query.js';
23
+ export { query, type Query, type QueryKey } from './query.js';
23
24
  export { makeQueryCache, type QueryCache } from './cache.js';
24
- export { queryResource, observeQuery, lifetime, projectionCache, sessionGroup, type SessionContext, type Read, } from './session.js';
25
+ export { queryResource, type QueryResource, observeQuery, lifetime, projectionCache, sessionGroup, type SessionContext, type Read, } from './session.js';
26
+ export { httpJson } from './http.js';
package/dist/index.js CHANGED
@@ -5,14 +5,15 @@ export { patchModel } from './state.js';
5
5
  export { defineActions } from './actions.js';
6
6
  export { taskComponent, taskControls } from './task.js';
7
7
  export { effectEvent } from './effectEvent.js';
8
- export { mountView, view } from './dom.js';
8
+ export { mountView, view, ViewBinding } from './dom.js';
9
+ export { lazyView } from './lazy.js';
9
10
  export { Portal, domBinding, domMount } from './mount.js';
10
- export { pages } from './pages.js';
11
- export { program, actionCommand, effectCommand, } from './program.js';
11
+ export { pages, } from './pages.js';
12
+ export { program, actionCommand, effectCommand, commandSlot, } from './program.js';
12
13
  export { available, resourceComponent, resourceError, } from './resource.js';
13
14
  export { fromPromise } from './load.js';
14
- export { observeBindings, observePrograms, } from './diagnostics.js';
15
- export { inputText, inputChecked, inputNumber, submit } from './form.js';
15
+ export { observeBindings, inspectBindings, mountBindingInspector, observePrograms, } from './diagnostics.js';
16
+ export { inputText, inputChecked, inputNumber, submit, defineField, } from './form.js';
16
17
  export { slot } from './dom.js';
17
18
  export { AsyncContent } from './AsyncContent.js';
18
19
  export { defineTasks, } from './tasks.js';
@@ -20,3 +21,4 @@ export { uiRuntime } from './runtime.js';
20
21
  export { query } from './query.js';
21
22
  export { makeQueryCache } from './cache.js';
22
23
  export { queryResource, observeQuery, lifetime, projectionCache, sessionGroup, } from './session.js';
24
+ export { httpJson } from './http.js';