foldkit 0.86.0 → 0.88.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 (154) hide show
  1. package/dist/command/index.d.ts +60 -13
  2. package/dist/command/index.d.ts.map +1 -1
  3. package/dist/command/index.js +41 -16
  4. package/dist/command/public.d.ts +1 -1
  5. package/dist/command/public.d.ts.map +1 -1
  6. package/dist/devTools/overlay.d.ts +44 -20
  7. package/dist/devTools/overlay.d.ts.map +1 -1
  8. package/dist/devTools/overlay.js +120 -79
  9. package/dist/devTools/protocol.d.ts +48 -11
  10. package/dist/devTools/protocol.d.ts.map +1 -1
  11. package/dist/devTools/protocol.js +8 -3
  12. package/dist/devTools/serialize.d.ts +8 -2
  13. package/dist/devTools/serialize.d.ts.map +1 -1
  14. package/dist/devTools/serialize.js +11 -2
  15. package/dist/devTools/store.d.ts +8 -4
  16. package/dist/devTools/store.d.ts.map +1 -1
  17. package/dist/devTools/store.js +6 -6
  18. package/dist/devTools/webSocketBridge.d.ts.map +1 -1
  19. package/dist/devTools/webSocketBridge.js +2 -2
  20. package/dist/{task → dom}/dom.d.ts +10 -10
  21. package/dist/dom/dom.d.ts.map +1 -0
  22. package/dist/{task → dom}/dom.js +15 -15
  23. package/dist/{task → dom}/elementMovement.d.ts +1 -1
  24. package/dist/dom/elementMovement.d.ts.map +1 -0
  25. package/dist/{task → dom}/elementMovement.js +3 -3
  26. package/dist/{task → dom}/error.d.ts +0 -8
  27. package/dist/dom/error.d.ts.map +1 -0
  28. package/dist/{task → dom}/error.js +0 -3
  29. package/dist/dom/index.d.ts +8 -0
  30. package/dist/dom/index.d.ts.map +1 -0
  31. package/dist/dom/index.js +6 -0
  32. package/dist/{task → dom}/inert.d.ts +4 -3
  33. package/dist/dom/inert.d.ts.map +1 -0
  34. package/dist/{task → dom}/inert.js +4 -3
  35. package/dist/dom/public.d.ts +3 -0
  36. package/dist/dom/public.d.ts.map +1 -0
  37. package/dist/dom/public.js +1 -0
  38. package/dist/{task → dom}/scrollLock.d.ts +3 -3
  39. package/dist/dom/scrollLock.d.ts.map +1 -0
  40. package/dist/{task → dom}/scrollLock.js +3 -3
  41. package/dist/dom/waitForAnimation.d.ts +17 -0
  42. package/dist/dom/waitForAnimation.d.ts.map +1 -0
  43. package/dist/dom/waitForAnimation.js +23 -0
  44. package/dist/index.d.ts +2 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -1
  47. package/dist/render/index.d.ts +2 -0
  48. package/dist/render/index.d.ts.map +1 -0
  49. package/dist/render/index.js +1 -0
  50. package/dist/render/public.d.ts +2 -0
  51. package/dist/render/public.d.ts.map +1 -0
  52. package/dist/render/public.js +1 -0
  53. package/dist/render/render.d.ts +40 -0
  54. package/dist/render/render.d.ts.map +1 -0
  55. package/dist/render/render.js +48 -0
  56. package/dist/runtime/runtime.d.ts.map +1 -1
  57. package/dist/runtime/runtime.js +12 -5
  58. package/dist/test/apps/counter.d.ts +14 -13
  59. package/dist/test/apps/counter.d.ts.map +1 -1
  60. package/dist/test/apps/counter.js +6 -3
  61. package/dist/test/apps/formChild.d.ts +4 -17
  62. package/dist/test/apps/formChild.d.ts.map +1 -1
  63. package/dist/test/apps/formChild.js +4 -6
  64. package/dist/test/apps/login.d.ts +3 -6
  65. package/dist/test/apps/login.d.ts.map +1 -1
  66. package/dist/test/apps/login.js +2 -3
  67. package/dist/test/apps/resumeUpload.d.ts +9 -7
  68. package/dist/test/apps/resumeUpload.d.ts.map +1 -1
  69. package/dist/test/apps/resumeUpload.js +4 -6
  70. package/dist/test/internal.d.ts +58 -13
  71. package/dist/test/internal.d.ts.map +1 -1
  72. package/dist/test/internal.js +121 -39
  73. package/dist/test/scene.d.ts +14 -3
  74. package/dist/test/scene.d.ts.map +1 -1
  75. package/dist/test/scene.js +21 -15
  76. package/dist/test/story.d.ts +15 -5
  77. package/dist/test/story.d.ts.map +1 -1
  78. package/dist/test/story.js +22 -15
  79. package/dist/ui/animation/update.d.ts +7 -5
  80. package/dist/ui/animation/update.d.ts.map +1 -1
  81. package/dist/ui/animation/update.js +8 -9
  82. package/dist/ui/calendar/index.d.ts +7 -8
  83. package/dist/ui/calendar/index.d.ts.map +1 -1
  84. package/dist/ui/calendar/index.js +8 -11
  85. package/dist/ui/calendar/public.d.ts +1 -1
  86. package/dist/ui/calendar/public.d.ts.map +1 -1
  87. package/dist/ui/calendar/public.js +1 -1
  88. package/dist/ui/combobox/multi.d.ts +1 -0
  89. package/dist/ui/combobox/multi.d.ts.map +1 -1
  90. package/dist/ui/combobox/shared.d.ts +32 -17
  91. package/dist/ui/combobox/shared.d.ts.map +1 -1
  92. package/dist/ui/combobox/shared.js +18 -29
  93. package/dist/ui/combobox/single.d.ts +1 -0
  94. package/dist/ui/combobox/single.d.ts.map +1 -1
  95. package/dist/ui/dialog/index.d.ts +10 -5
  96. package/dist/ui/dialog/index.d.ts.map +1 -1
  97. package/dist/ui/dialog/index.js +12 -11
  98. package/dist/ui/disclosure/index.d.ts +5 -3
  99. package/dist/ui/disclosure/index.d.ts.map +1 -1
  100. package/dist/ui/disclosure/index.js +4 -4
  101. package/dist/ui/dragAndDrop/index.d.ts +14 -7
  102. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  103. package/dist/ui/dragAndDrop/index.js +20 -9
  104. package/dist/ui/listbox/multi.d.ts +2 -1
  105. package/dist/ui/listbox/multi.d.ts.map +1 -1
  106. package/dist/ui/listbox/shared.d.ts +41 -22
  107. package/dist/ui/listbox/shared.d.ts.map +1 -1
  108. package/dist/ui/listbox/shared.js +22 -35
  109. package/dist/ui/listbox/single.d.ts +2 -1
  110. package/dist/ui/listbox/single.d.ts.map +1 -1
  111. package/dist/ui/menu/index.d.ts +40 -22
  112. package/dist/ui/menu/index.d.ts.map +1 -1
  113. package/dist/ui/menu/index.js +26 -38
  114. package/dist/ui/popover/index.d.ts +26 -16
  115. package/dist/ui/popover/index.d.ts.map +1 -1
  116. package/dist/ui/popover/index.js +15 -22
  117. package/dist/ui/radioGroup/index.d.ts +6 -3
  118. package/dist/ui/radioGroup/index.d.ts.map +1 -1
  119. package/dist/ui/radioGroup/index.js +6 -11
  120. package/dist/ui/tabs/index.d.ts +6 -3
  121. package/dist/ui/tabs/index.d.ts.map +1 -1
  122. package/dist/ui/tabs/index.js +14 -24
  123. package/dist/ui/toast/index.d.ts +4 -0
  124. package/dist/ui/toast/index.d.ts.map +1 -1
  125. package/dist/ui/toast/update.d.ts +11 -3
  126. package/dist/ui/toast/update.d.ts.map +1 -1
  127. package/dist/ui/toast/update.js +8 -5
  128. package/dist/ui/tooltip/index.d.ts +6 -3
  129. package/dist/ui/tooltip/index.d.ts.map +1 -1
  130. package/dist/ui/tooltip/index.js +2 -5
  131. package/dist/ui/virtualList/index.d.ts +7 -3
  132. package/dist/ui/virtualList/index.d.ts.map +1 -1
  133. package/dist/ui/virtualList/index.js +15 -4
  134. package/package.json +9 -5
  135. package/dist/task/dom.d.ts.map +0 -1
  136. package/dist/task/elementMovement.d.ts.map +0 -1
  137. package/dist/task/error.d.ts.map +0 -1
  138. package/dist/task/index.d.ts +0 -10
  139. package/dist/task/index.d.ts.map +0 -1
  140. package/dist/task/index.js +0 -8
  141. package/dist/task/inert.d.ts.map +0 -1
  142. package/dist/task/public.d.ts +0 -2
  143. package/dist/task/public.d.ts.map +0 -1
  144. package/dist/task/public.js +0 -1
  145. package/dist/task/random.d.ts +0 -21
  146. package/dist/task/random.d.ts.map +0 -1
  147. package/dist/task/random.js +0 -20
  148. package/dist/task/scrollLock.d.ts.map +0 -1
  149. package/dist/task/time.d.ts +0 -43
  150. package/dist/task/time.d.ts.map +0 -1
  151. package/dist/task/time.js +0 -53
  152. package/dist/task/timing.d.ts +0 -62
  153. package/dist/task/timing.d.ts.map +0 -1
  154. package/dist/task/timing.js +0 -77
@@ -0,0 +1,6 @@
1
+ export { ElementNotFound } from './error.js';
2
+ export { advanceFocus, clickElement, closeModal, focus, scrollIntoView, showModal, } from './dom.js';
3
+ export { detectElementMovement } from './elementMovement.js';
4
+ export { inertOthers, restoreInert } from './inert.js';
5
+ export { lockScroll, unlockScroll } from './scrollLock.js';
6
+ export { waitForAnimationSettled } from './waitForAnimation.js';
@@ -7,7 +7,7 @@ import { Effect } from 'effect';
7
7
  *
8
8
  * @example
9
9
  * ```typescript
10
- * Task.inertOthers('my-menu', ['#menu-button', '#menu-items']).pipe(
10
+ * Dom.inertOthers('my-menu', ['#menu-button', '#menu-items']).pipe(
11
11
  * Effect.as(CompletedSetupInert()),
12
12
  * )
13
13
  * ```
@@ -15,11 +15,12 @@ import { Effect } from 'effect';
15
15
  export declare const inertOthers: (id: string, allowedSelectors: ReadonlyArray<string>) => Effect.Effect<void>;
16
16
  /**
17
17
  * Restores all elements previously marked inert by `inertOthers` for the
18
- * given ID. Safe to call without a preceding `inertOthers` acts as a no-op.
18
+ * given ID. Safe to call without a preceding `inertOthers`. Acts as a no-op
19
+ * in that case.
19
20
  *
20
21
  * @example
21
22
  * ```typescript
22
- * Task.restoreInert('my-menu').pipe(Effect.as(CompletedTeardownInert()))
23
+ * Dom.restoreInert('my-menu').pipe(Effect.as(CompletedTeardownInert()))
23
24
  * ```
24
25
  */
25
26
  export declare const restoreInert: (id: string) => Effect.Effect<void>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/dom/inert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAuF/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GACtB,IAAI,MAAM,EACV,kBAAkB,aAAa,CAAC,MAAM,CAAC,KACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAajB,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAQxD,CAAA"}
@@ -56,7 +56,7 @@ const inertableSiblings = (parent, allowedElements) => pipe(parent.children, Arr
56
56
  *
57
57
  * @example
58
58
  * ```typescript
59
- * Task.inertOthers('my-menu', ['#menu-button', '#menu-items']).pipe(
59
+ * Dom.inertOthers('my-menu', ['#menu-button', '#menu-items']).pipe(
60
60
  * Effect.as(CompletedSetupInert()),
61
61
  * )
62
62
  * ```
@@ -68,11 +68,12 @@ export const inertOthers = (id, allowedSelectors) => Effect.sync(() => {
68
68
  });
69
69
  /**
70
70
  * Restores all elements previously marked inert by `inertOthers` for the
71
- * given ID. Safe to call without a preceding `inertOthers` acts as a no-op.
71
+ * given ID. Safe to call without a preceding `inertOthers`. Acts as a no-op
72
+ * in that case.
72
73
  *
73
74
  * @example
74
75
  * ```typescript
75
- * Task.restoreInert('my-menu').pipe(Effect.as(CompletedTeardownInert()))
76
+ * Dom.restoreInert('my-menu').pipe(Effect.as(CompletedTeardownInert()))
76
77
  * ```
77
78
  */
78
79
  export const restoreInert = (id) => Effect.sync(() => {
@@ -0,0 +1,3 @@
1
+ export { ElementNotFound, advanceFocus, clickElement, closeModal, detectElementMovement, focus, inertOthers, lockScroll, restoreInert, scrollIntoView, showModal, unlockScroll, waitForAnimationSettled, } from './index.js';
2
+ export type { FocusDirection } from './index.js';
3
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/dom/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export { ElementNotFound, advanceFocus, clickElement, closeModal, detectElementMovement, focus, inertOthers, lockScroll, restoreInert, scrollIntoView, showModal, unlockScroll, waitForAnimationSettled, } from './index.js';
@@ -4,12 +4,12 @@ import { Effect } from 'effect';
4
4
  * Compensates for scrollbar width with padding to prevent layout shift.
5
5
  * On iOS Safari, intercepts `touchmove` events to prevent page scroll
6
6
  * while allowing scrolling within overflow containers.
7
- * Uses reference counting so nested locks are safe the page only unlocks
7
+ * Uses reference counting so nested locks are safe. The page only unlocks
8
8
  * when every lock has been released.
9
9
  *
10
10
  * @example
11
11
  * ```typescript
12
- * Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))
12
+ * Dom.lockScroll.pipe(Effect.as(CompletedLockScroll()))
13
13
  * ```
14
14
  */
15
15
  export declare const lockScroll: Effect.Effect<void>;
@@ -20,7 +20,7 @@ export declare const lockScroll: Effect.Effect<void>;
20
20
  *
21
21
  * @example
22
22
  * ```typescript
23
- * Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))
23
+ * Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))
24
24
  * ```
25
25
  */
26
26
  export declare const unlockScroll: Effect.Effect<void>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollLock.d.ts","sourceRoot":"","sources":["../../src/dom/scrollLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AA6CvC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAwBzC,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAW3C,CAAA"}
@@ -41,12 +41,12 @@ const handleTouchMove = (event) => {
41
41
  * Compensates for scrollbar width with padding to prevent layout shift.
42
42
  * On iOS Safari, intercepts `touchmove` events to prevent page scroll
43
43
  * while allowing scrolling within overflow containers.
44
- * Uses reference counting so nested locks are safe the page only unlocks
44
+ * Uses reference counting so nested locks are safe. The page only unlocks
45
45
  * when every lock has been released.
46
46
  *
47
47
  * @example
48
48
  * ```typescript
49
- * Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))
49
+ * Dom.lockScroll.pipe(Effect.as(CompletedLockScroll()))
50
50
  * ```
51
51
  */
52
52
  export const lockScroll = Effect.sync(() => {
@@ -73,7 +73,7 @@ export const lockScroll = Effect.sync(() => {
73
73
  *
74
74
  * @example
75
75
  * ```typescript
76
- * Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))
76
+ * Dom.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))
77
77
  * ```
78
78
  */
79
79
  export const unlockScroll = Effect.sync(() => {
@@ -0,0 +1,17 @@
1
+ import { Effect } from 'effect';
2
+ /**
3
+ * Waits for all CSS animations on the element matching the selector to settle.
4
+ * Covers both CSS transitions and CSS keyframe animations via the Web Animations
5
+ * API. Falls back to completing immediately if the element is missing or has no
6
+ * active animations.
7
+ *
8
+ * Leave animations must be finite. `animation-iteration-count: infinite` will
9
+ * keep the underlying `.finished` promise pending and hang the caller.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * Dom.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
14
+ * ```
15
+ */
16
+ export declare const waitForAnimationSettled: (selector: string) => Effect.Effect<void>;
17
+ //# sourceMappingURL=waitForAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForAnimation.d.ts","sourceRoot":"","sources":["../../src/dom/waitForAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAYjB,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { Effect } from 'effect';
2
+ /**
3
+ * Waits for all CSS animations on the element matching the selector to settle.
4
+ * Covers both CSS transitions and CSS keyframe animations via the Web Animations
5
+ * API. Falls back to completing immediately if the element is missing or has no
6
+ * active animations.
7
+ *
8
+ * Leave animations must be finite. `animation-iteration-count: infinite` will
9
+ * keep the underlying `.finished` promise pending and hang the caller.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * Dom.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
14
+ * ```
15
+ */
16
+ export const waitForAnimationSettled = (selector) => Effect.callback(resume => {
17
+ requestAnimationFrame(async () => {
18
+ const element = document.querySelector(selector);
19
+ const animations = element instanceof HTMLElement ? element.getAnimations() : [];
20
+ await Promise.allSettled(animations.map(({ finished }) => finished));
21
+ resume(Effect.void);
22
+ });
23
+ });
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as Calendar from './calendar/public.js';
2
2
  export * as Command from './command/public.js';
3
+ export * as Dom from './dom/public.js';
3
4
  export * as ManagedResource from './managedResource/public.js';
4
5
  export * as FieldValidation from './fieldValidation/public.js';
5
6
  export * as File from './file/public.js';
@@ -7,12 +8,12 @@ export * as Html from './html/public.js';
7
8
  export * as Message from './message/public.js';
8
9
  export * as Mount from './mount/public.js';
9
10
  export * as Navigation from './navigation/public.js';
11
+ export * as Render from './render/public.js';
10
12
  export * as Route from './route/public.js';
11
13
  export * as Runtime from './runtime/public.js';
12
14
  export * as Schema from './schema/public.js';
13
15
  export * as Struct from './struct/public.js';
14
16
  export * as Subscription from './subscription/public.js';
15
- export * as Task from './task/public.js';
16
17
  export * as Scene from './test/scene.js';
17
18
  export * as Story from './test/story.js';
18
19
  export * as Ui from './ui/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AACxC,OAAO,KAAK,I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KAAK,OAAO,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as Calendar from './calendar/public.js';
2
2
  export * as Command from './command/public.js';
3
+ export * as Dom from './dom/public.js';
3
4
  export * as ManagedResource from './managedResource/public.js';
4
5
  export * as FieldValidation from './fieldValidation/public.js';
5
6
  export * as File from './file/public.js';
@@ -7,12 +8,12 @@ export * as Html from './html/public.js';
7
8
  export * as Message from './message/public.js';
8
9
  export * as Mount from './mount/public.js';
9
10
  export * as Navigation from './navigation/public.js';
11
+ export * as Render from './render/public.js';
10
12
  export * as Route from './route/public.js';
11
13
  export * as Runtime from './runtime/public.js';
12
14
  export * as Schema from './schema/public.js';
13
15
  export * as Struct from './struct/public.js';
14
16
  export * as Subscription from './subscription/public.js';
15
- export * as Task from './task/public.js';
16
17
  export * as Scene from './test/scene.js';
17
18
  export * as Story from './test/story.js';
18
19
  export * as Ui from './ui/index.js';
@@ -0,0 +1,2 @@
1
+ export { afterCommit, afterPaint } from './render.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ export { afterCommit, afterPaint } from './render.js';
@@ -0,0 +1,2 @@
1
+ export { afterCommit, afterPaint } from './index.js';
2
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/render/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export { afterCommit, afterPaint } from './index.js';
@@ -0,0 +1,40 @@
1
+ import { Effect } from 'effect';
2
+ /**
3
+ * Completes after the runtime's next render commits. The runtime batches
4
+ * renders to `requestAnimationFrame`, so a Command, Subscription, or other
5
+ * Effect that runs immediately after a dirtying Message would otherwise
6
+ * query the DOM before the matching VDOM patch has applied. Yield this
7
+ * before any DOM read or write whose target was just brought into existence
8
+ * (or moved, or had its attributes changed) by the same Message.
9
+ *
10
+ * The `Dom` helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
11
+ * already gate themselves with this internally; reach for `afterCommit`
12
+ * directly when building custom Commands or DOM-observing Subscriptions
13
+ * that need the same guarantee.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * Effect.gen(function* () {
18
+ * yield* Render.afterCommit
19
+ * const element = document.getElementById(id)
20
+ * // element reflects the post-Message DOM
21
+ * })
22
+ * ```
23
+ */
24
+ export declare const afterCommit: Effect.Effect<void>;
25
+ /**
26
+ * Completes after the prior state has been painted to the screen. Waits two
27
+ * animation frames: the first lets the runtime commit the latest model to
28
+ * the DOM and the browser paint it, the second resumes once that paint is
29
+ * visible. Use this for CSS transition orchestration where the from-state
30
+ * must be displayed before the to-state changes are applied, otherwise the
31
+ * browser collapses both states into a single frame and the transition does
32
+ * not play.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * Render.afterPaint.pipe(Effect.as(TransitionFrameAdvanced()))
37
+ * ```
38
+ */
39
+ export declare const afterPaint: Effect.Effect<void>;
40
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAK3C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAMzC,CAAA"}
@@ -0,0 +1,48 @@
1
+ import { Effect } from 'effect';
2
+ /**
3
+ * Completes after the runtime's next render commits. The runtime batches
4
+ * renders to `requestAnimationFrame`, so a Command, Subscription, or other
5
+ * Effect that runs immediately after a dirtying Message would otherwise
6
+ * query the DOM before the matching VDOM patch has applied. Yield this
7
+ * before any DOM read or write whose target was just brought into existence
8
+ * (or moved, or had its attributes changed) by the same Message.
9
+ *
10
+ * The `Dom` helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
11
+ * already gate themselves with this internally; reach for `afterCommit`
12
+ * directly when building custom Commands or DOM-observing Subscriptions
13
+ * that need the same guarantee.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * Effect.gen(function* () {
18
+ * yield* Render.afterCommit
19
+ * const element = document.getElementById(id)
20
+ * // element reflects the post-Message DOM
21
+ * })
22
+ * ```
23
+ */
24
+ export const afterCommit = Effect.callback(resume => {
25
+ const handle = requestAnimationFrame(() => resume(Effect.void));
26
+ return Effect.sync(() => cancelAnimationFrame(handle));
27
+ });
28
+ /**
29
+ * Completes after the prior state has been painted to the screen. Waits two
30
+ * animation frames: the first lets the runtime commit the latest model to
31
+ * the DOM and the browser paint it, the second resumes once that paint is
32
+ * visible. Use this for CSS transition orchestration where the from-state
33
+ * must be displayed before the to-state changes are applied, otherwise the
34
+ * browser collapses both states into a single frame and the transition does
35
+ * not play.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * Render.afterPaint.pipe(Effect.as(TransitionFrameAdvanced()))
40
+ * ```
41
+ */
42
+ export const afterPaint = Effect.callback(resume => {
43
+ requestAnimationFrame(() => {
44
+ requestAnimationFrame(() => {
45
+ resume(Effect.void);
46
+ });
47
+ });
48
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EAEP,MAAM,EAGN,KAAK,EAEL,MAAM,EAON,MAAM,EAIP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAA+B,MAAM,iBAAiB,CAAA;AAalE,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAO5C,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,YAAY,GACZ,UAAU,GACV,SAAS,CAAA;AAEb,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAA;AAEjD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,YAAY,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,QAAQ,CAAC;IACP,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;CACnD,CAAC,CAAA;AAMN,sFAAsF;AACtF,MAAM,MAAM,eAAe,CAAC,KAAK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AAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,oBAAoB,CAC1B,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAEpB,wBAAgB,WAAW,CACzB,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,sBAAsB,CAC5B,KAAK,EACL,OAAO,EACP,aAAa,EACb,KAAK,EACL,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAEpB,wBAAgB,WAAW,CACzB,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,aAAa,CACnB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AA2NpB,kEAAkE;AAClE,eAAO,MAAM,GAAG,GAAI,SAAS,iBAAiB,KAAG,IA4ChD,CAAA"}
@@ -2,7 +2,7 @@ import { BrowserRuntime } from '@effect/platform-browser';
2
2
  import { Array, Cause, Context, Duration, Effect, Exit, Function, Layer, Match, Option, Predicate, PubSub, Queue, Record, Ref, Scheduler, Schema, Stream, SubscriptionRef, pipe, } from 'effect';
3
3
  import { h } from 'snabbdom';
4
4
  import { createOverlay } from '../devTools/overlay.js';
5
- import { createDevToolsStore } from '../devTools/store.js';
5
+ import { createDevToolsStore, } from '../devTools/store.js';
6
6
  import { startWebSocketBridge } from '../devTools/webSocketBridge.js';
7
7
  import { MountTracker } from '../mount/index.js';
8
8
  import { fromString as urlFromString } from '../url/index.js';
@@ -14,6 +14,9 @@ import { PreserveModelMessage, RequestModelMessage, RestoreModelMessage, } from
14
14
  import { orderByPriority } from './messagePriority.js';
15
15
  import { makePreserveScheduler } from './preserveScheduler.js';
16
16
  import { makeRenderLoop } from './renderLoop.js';
17
+ const toCommandRecord = (command) => command.args !== undefined
18
+ ? { name: command.name, args: command.args }
19
+ : { name: command.name };
17
20
  const DEFAULT_DEV_TOOLS_SHOW = 'Development';
18
21
  const DEFAULT_DEV_TOOLS_POSITION = 'BottomRight';
19
22
  const DEFAULT_DEV_TOOLS_MODE = 'TimeTravel';
@@ -157,7 +160,9 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
157
160
  const modelPubSub = yield* PubSub.unbounded();
158
161
  yield* Effect.forEach(
159
162
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
160
- initCommands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name), provideAllResources, Effect.flatMap(enqueueNormal))));
163
+ initCommands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name, {
164
+ attributes: command.args ?? {},
165
+ }), provideAllResources, Effect.flatMap(enqueueNormal))));
161
166
  if (routingConfig) {
162
167
  addNavigationEventListeners(enqueueHighUnsafe, routingConfig);
163
168
  }
@@ -212,7 +217,9 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
212
217
  }
213
218
  yield* Effect.forEach(
214
219
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
215
- commands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name), provideAllResources, Effect.flatMap(enqueueNormal))));
220
+ commands, command => Effect.forkDetach(command.effect.pipe(Effect.withSpan(command.name, {
221
+ attributes: command.args ?? {},
222
+ }), provideAllResources, Effect.flatMap(enqueueNormal))));
216
223
  const maybeDevToolsStore = yield* Ref.get(maybeDevToolsStoreRef);
217
224
  yield* Option.match(maybeDevToolsStore, {
218
225
  onNone: () => Effect.void,
@@ -220,7 +227,7 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
220
227
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
221
228
  message, currentModel, nextModel, Array.map(
222
229
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
223
- commands, command => command.name), currentModel !== nextModel),
230
+ commands, toCommandRecord), currentModel !== nextModel),
224
231
  });
225
232
  });
226
233
  // NOTE: `dispatchService` defaults to the live dispatch but is
@@ -305,7 +312,7 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
305
312
  const maybeStoreForInit = yield* Ref.get(maybeDevToolsStoreRef);
306
313
  yield* Option.match(maybeStoreForInit, {
307
314
  onNone: () => Effect.void,
308
- onSome: store => store.recordInit(initModel, Array.map(initCommands, ({ name }) => name), initMountEvents.starts),
315
+ onSome: store => store.recordInit(initModel, Array.map(initCommands, toCommandRecord), initMountEvents.starts),
309
316
  });
310
317
  // NOTE: lastDirtyMessageRef holds the most recent dirtying Message, so
311
318
  // slow-view callbacks during high-rate bursts attribute to the last
@@ -7,32 +7,33 @@ export type Model = typeof Model.Type;
7
7
  export declare const ClickedIncrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>;
8
8
  export declare const ClickedDecrement: import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>;
9
9
  export declare const ClickedFetch: import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>;
10
+ export declare const ClickedFetchById: import("../../schema/index.js").CallableTaggedStruct<"ClickedFetchById", {
11
+ id: S.Number;
12
+ }>;
10
13
  export declare const SucceededFetchCount: import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
11
14
  count: S.Number;
12
15
  }>;
13
16
  export declare const FailedFetchCount: import("../../schema/index.js").CallableTaggedStruct<"FailedFetchCount", {
14
17
  error: S.String;
15
18
  }>;
16
- export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>, import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
19
+ export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedIncrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedDecrement", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetch", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedFetchById", {
20
+ id: S.Number;
21
+ }>, import("../../schema/index.js").CallableTaggedStruct<"SucceededFetchCount", {
17
22
  count: S.Number;
18
23
  }>, import("../../schema/index.js").CallableTaggedStruct<"FailedFetchCount", {
19
24
  error: S.String;
20
25
  }>]>;
21
26
  export type Message = typeof Message.Type;
22
- export declare const FetchCount: Command.CommandDefinition<"FetchCount", {
27
+ export declare const FetchCount: Command.CommandDefinitionNoArgs<"FetchCount", Effect.Effect<{
23
28
  readonly _tag: "SucceededFetchCount";
24
29
  readonly count: number;
25
- } | {
26
- readonly _tag: "FailedFetchCount";
27
- readonly error: string;
28
- }>;
29
- export declare const fetchCount: Readonly<{
30
- name: "FetchCount";
31
- effect: Effect.Effect<{
32
- readonly _tag: "SucceededFetchCount";
33
- readonly count: number;
34
- }, never, never>;
35
- }>;
30
+ }, never, never>>;
31
+ export declare const FetchCountById: Command.CommandDefinitionWithArgs<"FetchCountById", {
32
+ id: S.Number;
33
+ }, Effect.Effect<{
34
+ readonly _tag: "SucceededFetchCount";
35
+ readonly count: number;
36
+ }, never, never>>;
36
37
  export declare const initialModel: Model;
37
38
  export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
38
39
  //# sourceMappingURL=counter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO;;;;IAMlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,UAAU;;;;;;EAItB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;EAEtB,CAAA;AAID,eAAO,MAAM,YAAY,EAAE,KAAoB,CAAA;AAI/C,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAYxD,CAAA"}
1
+ {"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,gBAAgB;;EAA0C,CAAA;AACvE,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO;;;;;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,UAAU;;;iBAIgC,CAAA;AAEvD,eAAO,MAAM,cAAc;;;;;iBAKyC,CAAA;AAIpE,eAAO,MAAM,YAAY,EAAE,KAAoB,CAAA;AAI/C,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAaxD,CAAA"}
@@ -7,25 +7,28 @@ export const Model = S.Struct({ count: S.Number });
7
7
  export const ClickedIncrement = m('ClickedIncrement');
8
8
  export const ClickedDecrement = m('ClickedDecrement');
9
9
  export const ClickedFetch = m('ClickedFetch');
10
+ export const ClickedFetchById = m('ClickedFetchById', { id: S.Number });
10
11
  export const SucceededFetchCount = m('SucceededFetchCount', { count: S.Number });
11
12
  export const FailedFetchCount = m('FailedFetchCount', { error: S.String });
12
13
  export const Message = S.Union([
13
14
  ClickedIncrement,
14
15
  ClickedDecrement,
15
16
  ClickedFetch,
17
+ ClickedFetchById,
16
18
  SucceededFetchCount,
17
19
  FailedFetchCount,
18
20
  ]);
19
21
  // COMMAND
20
- export const FetchCount = Command.define('FetchCount', SucceededFetchCount, FailedFetchCount);
21
- export const fetchCount = FetchCount(Effect.sync(() => SucceededFetchCount({ count: 0 })));
22
+ export const FetchCount = Command.define('FetchCount', SucceededFetchCount, FailedFetchCount)(Effect.sync(() => SucceededFetchCount({ count: 0 })));
23
+ export const FetchCountById = Command.define('FetchCountById', { id: S.Number }, SucceededFetchCount, FailedFetchCount)(({ id }) => Effect.sync(() => SucceededFetchCount({ count: id })));
22
24
  // INIT
23
25
  export const initialModel = { count: 0 };
24
26
  // UPDATE
25
27
  export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
26
28
  ClickedIncrement: () => [{ count: model.count + 1 }, []],
27
29
  ClickedDecrement: () => [{ count: model.count - 1 }, []],
28
- ClickedFetch: () => [model, [fetchCount]],
30
+ ClickedFetch: () => [model, [FetchCount()]],
31
+ ClickedFetchById: ({ id }) => [model, [FetchCountById({ id })]],
29
32
  SucceededFetchCount: ({ count }) => [{ count }, []],
30
33
  FailedFetchCount: () => [model, []],
31
34
  }));
@@ -22,26 +22,13 @@ export declare const ChildOutMessage: S.Union<readonly [import("../../schema/ind
22
22
  id: S.String;
23
23
  }>, import("../../schema/index.js").CallableTaggedStruct<"RequestedCancel", {}>]>;
24
24
  export type ChildOutMessage = typeof ChildOutMessage.Type;
25
- export declare const SubmitForm: Command.CommandDefinition<"SubmitForm", {
25
+ export declare const SubmitForm: Command.CommandDefinitionNoArgs<"SubmitForm", Effect.Effect<{
26
26
  readonly _tag: "SucceededSubmit";
27
27
  readonly id: string;
28
- }>;
29
- export declare const submitForm: Readonly<{
30
- name: "SubmitForm";
31
- effect: Effect.Effect<{
32
- readonly _tag: "SucceededSubmit";
33
- readonly id: string;
34
- }, never, never>;
35
- }>;
36
- export declare const ResetForm: Command.CommandDefinition<"ResetForm", {
28
+ }, never, never>>;
29
+ export declare const ResetForm: Command.CommandDefinitionNoArgs<"ResetForm", Effect.Effect<{
37
30
  readonly _tag: "CompletedReset";
38
- }>;
39
- export declare const resetForm: Readonly<{
40
- name: "ResetForm";
41
- effect: Effect.Effect<{
42
- readonly _tag: "CompletedReset";
43
- }, never, never>;
44
- }>;
31
+ }, never, never>>;
45
32
  export declare const initialChildModel: ChildModel;
46
33
  export declare const childUpdate: (_model: ChildModel, message: ChildMessage) => readonly [ChildModel, ReadonlyArray<Command.Command<ChildMessage>>, Option.Option<ChildOutMessage>];
47
34
  export declare const ParentModel: S.Struct<{
@@ -1 +1 @@
1
- {"version":3,"file":"formChild.d.ts","sourceRoot":"","sources":["../../../src/test/apps/formChild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAKjD,eAAO,MAAM,UAAU;;EAErB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,eAAe;;EAAyC,CAAA;AACrE,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,cAAc,4EAAsB,CAAA;AAEjD,eAAO,MAAM,YAAY;;2JAKvB,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAInD,eAAO,MAAM,aAAa;;EAAuC,CAAA;AACjE,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,eAAe;;iFAA4C,CAAA;AACxE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD,eAAO,MAAM,UAAU;;;EAAgD,CAAA;AACvE,eAAO,MAAM,UAAU;;;;;;EAEtB,CAAA;AAED,eAAO,MAAM,SAAS;;EAA8C,CAAA;AACpE,eAAO,MAAM,SAAS;;;;;EAAiD,CAAA;AAIvE,eAAO,MAAM,iBAAiB,EAAE,UAA+B,CAAA;AAI/D,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,EAClB,SAAS,YAAY,KACpB,SAAS,CACV,UAAU,EACV,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAC5C,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CA4B7B,CAAA;AAI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;AAIzD,eAAO,MAAM,UAAU;;;iBAG6B,CAAA;AAEpD,eAAO,MAAM,SAAS;;iBAGgB,CAAA;AAItC,eAAO,MAAM,iBAAiB,EAAE,UAA+B,CAAA;AAI/D,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,EAClB,SAAS,YAAY,KACpB,SAAS,CACV,UAAU,EACV,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAC5C,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CA4B7B,CAAA;AAIH,eAAO,MAAM,WAAW;;;;;;EAItB,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAIjD,eAAO,MAAM,eAAe;;;;EAE1B,CAAA;AACF,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAE7D,eAAO,MAAM,aAAa;;;;sFAAmD,CAAA;AAC7E,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAIrD,eAAO,MAAM,kBAAkB,EAAE,WAIhC,CAAA;AAID,eAAO,MAAM,YAAY,GACvB,aAAa,WAAW,EACxB,SAAS,aAAa,KACrB,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAkCnE,CAAA"}
@@ -21,22 +21,20 @@ export const RequestedSave = m('RequestedSave', { id: S.String });
21
21
  export const RequestedCancel = m('RequestedCancel');
22
22
  export const ChildOutMessage = S.Union([RequestedSave, RequestedCancel]);
23
23
  // CHILD COMMAND
24
- export const SubmitForm = Command.define('SubmitForm', SucceededSubmit);
25
- export const submitForm = SubmitForm(Effect.sync(() => SucceededSubmit({ id: 'abc' })));
26
- export const ResetForm = Command.define('ResetForm', CompletedReset);
27
- export const resetForm = ResetForm(Effect.sync(() => CompletedReset()));
24
+ export const SubmitForm = Command.define('SubmitForm', SucceededSubmit)(Effect.sync(() => SucceededSubmit({ id: 'abc' })));
25
+ export const ResetForm = Command.define('ResetForm', CompletedReset)(Effect.sync(() => CompletedReset()));
28
26
  // CHILD INIT
29
27
  export const initialChildModel = { status: 'Idle' };
30
28
  // CHILD UPDATE
31
29
  export const childUpdate = (_model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
32
30
  SubmittedForm: () => [
33
31
  { status: 'Submitting' },
34
- [submitForm],
32
+ [SubmitForm()],
35
33
  Option.none(),
36
34
  ],
37
35
  SucceededSubmit: ({ id }) => [
38
36
  { status: 'Submitted' },
39
- [resetForm],
37
+ [ResetForm()],
40
38
  Option.some(RequestedSave({ id })),
41
39
  ],
42
40
  CancelledForm: () => [
@@ -1,4 +1,4 @@
1
- import { Schema as S } from 'effect';
1
+ import { Effect, Schema as S } from 'effect';
2
2
  import * as Command from '../../command/index.js';
3
3
  import { type Html } from '../../html/index.js';
4
4
  export declare const Model: S.Struct<{
@@ -33,13 +33,10 @@ export declare const Message: S.Union<readonly [import("../../schema/index.js").
33
33
  error: S.String;
34
34
  }>, import("../../schema/index.js").CallableTaggedStruct<"ClickedLogout", {}>]>;
35
35
  export type Message = typeof Message.Type;
36
- export declare const Authenticate: Command.CommandDefinition<"Authenticate", {
36
+ export declare const Authenticate: Command.CommandDefinitionNoArgs<"Authenticate", Effect.Effect<{
37
37
  readonly _tag: "SucceededAuthenticate";
38
38
  readonly username: string;
39
- } | {
40
- readonly _tag: "FailedAuthenticate";
41
- readonly error: string;
42
- }>;
39
+ }, never, never>>;
43
40
  export declare const initialModel: Model;
44
41
  export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
45
42
  export declare const view: (model: Model) => Html;