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
@@ -1,43 +0,0 @@
1
- import { DateTime, Effect } from 'effect';
2
- import { TimeZoneError } from './error.js';
3
- /**
4
- * Gets the current UTC time.
5
- *
6
- * @example
7
- * ```typescript
8
- * Task.getTime.pipe(Effect.map(utc => GotTime({ utc })))
9
- * ```
10
- */
11
- export declare const getTime: Effect.Effect<DateTime.Utc>;
12
- /**
13
- * Gets the system timezone.
14
- *
15
- * @example
16
- * ```typescript
17
- * Task.getTimeZone.pipe(Effect.map(zone => GotTimeZone({ zone })))
18
- * ```
19
- */
20
- export declare const getTimeZone: Effect.Effect<DateTime.TimeZone>;
21
- /**
22
- * Gets the current time in the system timezone.
23
- *
24
- * @example
25
- * ```typescript
26
- * Task.getZonedTime.pipe(Effect.map(zoned => GotTime({ zoned })))
27
- * ```
28
- */
29
- export declare const getZonedTime: Effect.Effect<DateTime.Zoned>;
30
- /**
31
- * Gets the current time in a specific timezone.
32
- * Fails with `TimeZoneError` if the timezone ID is invalid.
33
- *
34
- * @example
35
- * ```typescript
36
- * Task.getZonedTimeIn('America/New_York').pipe(
37
- * Effect.map(zoned => GotNYTime({ zoned })),
38
- * Effect.catch(() => Effect.succeed(FailedGetTimeZone())),
39
- * )
40
- * ```
41
- */
42
- export declare const getZonedTimeIn: (zoneId: string) => Effect.Effect<DateTime.Zoned, TimeZoneError>;
43
- //# sourceMappingURL=time.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/task/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAgB,CAAA;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAExD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAMtD,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAQ1C,CAAA"}
package/dist/task/time.js DELETED
@@ -1,53 +0,0 @@
1
- import { DateTime, Effect, Option } from 'effect';
2
- import { TimeZoneError } from './error.js';
3
- /**
4
- * Gets the current UTC time.
5
- *
6
- * @example
7
- * ```typescript
8
- * Task.getTime.pipe(Effect.map(utc => GotTime({ utc })))
9
- * ```
10
- */
11
- export const getTime = DateTime.now;
12
- /**
13
- * Gets the system timezone.
14
- *
15
- * @example
16
- * ```typescript
17
- * Task.getTimeZone.pipe(Effect.map(zone => GotTimeZone({ zone })))
18
- * ```
19
- */
20
- export const getTimeZone = Effect.sync(() => DateTime.zoneMakeLocal());
21
- /**
22
- * Gets the current time in the system timezone.
23
- *
24
- * @example
25
- * ```typescript
26
- * Task.getZonedTime.pipe(Effect.map(zoned => GotTime({ zoned })))
27
- * ```
28
- */
29
- export const getZonedTime = Effect.gen(function* () {
30
- const utc = yield* DateTime.now;
31
- const zone = DateTime.zoneMakeLocal();
32
- return DateTime.setZone(utc, zone);
33
- });
34
- /**
35
- * Gets the current time in a specific timezone.
36
- * Fails with `TimeZoneError` if the timezone ID is invalid.
37
- *
38
- * @example
39
- * ```typescript
40
- * Task.getZonedTimeIn('America/New_York').pipe(
41
- * Effect.map(zoned => GotNYTime({ zoned })),
42
- * Effect.catch(() => Effect.succeed(FailedGetTimeZone())),
43
- * )
44
- * ```
45
- */
46
- export const getZonedTimeIn = (zoneId) => Effect.gen(function* () {
47
- const utc = yield* DateTime.now;
48
- const maybeZone = DateTime.zoneMakeNamed(zoneId);
49
- if (Option.isNone(maybeZone)) {
50
- return yield* Effect.fail(new TimeZoneError({ zoneId }));
51
- }
52
- return DateTime.setZone(utc, maybeZone.value);
53
- });
@@ -1,62 +0,0 @@
1
- import { Duration, Effect } from 'effect';
2
- /**
3
- * Waits for the given duration before completing.
4
- * Useful for debouncing, such as clearing a typeahead search query.
5
- *
6
- * @example
7
- * ```typescript
8
- * Task.delay('1 second').pipe(Effect.as(TimedOut()))
9
- * ```
10
- */
11
- export declare const delay: (duration: Duration.Input) => Effect.Effect<void>;
12
- /**
13
- * Completes after the runtime's next render commits. The runtime batches
14
- * renders to `requestAnimationFrame`, so a Command, Subscription, or other
15
- * Effect that runs immediately after a dirtying Message would otherwise
16
- * query the DOM before the matching VDOM patch has applied. Yield this
17
- * before any DOM read or write whose target was just brought into existence
18
- * (or moved, or had its attributes changed) by the same Message.
19
- *
20
- * The Task DOM helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
21
- * already gate themselves with this internally; reach for `afterRender`
22
- * directly when building custom Commands or DOM-observing Subscriptions
23
- * that need the same guarantee.
24
- *
25
- * @example
26
- * ```typescript
27
- * Effect.gen(function* () {
28
- * yield* Task.afterRender
29
- * const element = document.getElementById(id)
30
- * // element reflects the post-Message DOM
31
- * })
32
- * ```
33
- */
34
- export declare const afterRender: Effect.Effect<void>;
35
- /**
36
- * Completes after two animation frames, ensuring the browser has painted
37
- * the current state before proceeding. Used for CSS transition orchestration —
38
- * the double-rAF guarantees the "from" state is visible before transitioning
39
- * to the "to" state.
40
- *
41
- * @example
42
- * ```typescript
43
- * Task.nextFrame.pipe(Effect.as(TransitionFrameAdvanced()))
44
- * ```
45
- */
46
- export declare const nextFrame: Effect.Effect<void>;
47
- /**
48
- * Waits for all CSS animations on the element matching the selector to settle.
49
- * Covers both CSS transitions and CSS keyframe animations via the Web Animations
50
- * API. Falls back to completing immediately if the element is missing or has no
51
- * active animations.
52
- *
53
- * Leave animations must be finite. `animation-iteration-count: infinite` will
54
- * keep the underlying `.finished` promise pending and hang the caller.
55
- *
56
- * @example
57
- * ```typescript
58
- * Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
59
- * ```
60
- */
61
- export declare const waitForAnimationSettled: (selector: string) => Effect.Effect<void>;
62
- //# sourceMappingURL=timing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/task/timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,QAAQ,CAAC,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAC3C,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAK3C,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAMxC,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAYjB,CAAA"}
@@ -1,77 +0,0 @@
1
- import { Effect } from 'effect';
2
- /**
3
- * Waits for the given duration before completing.
4
- * Useful for debouncing, such as clearing a typeahead search query.
5
- *
6
- * @example
7
- * ```typescript
8
- * Task.delay('1 second').pipe(Effect.as(TimedOut()))
9
- * ```
10
- */
11
- export const delay = (duration) => Effect.sleep(duration);
12
- /**
13
- * Completes after the runtime's next render commits. The runtime batches
14
- * renders to `requestAnimationFrame`, so a Command, Subscription, or other
15
- * Effect that runs immediately after a dirtying Message would otherwise
16
- * query the DOM before the matching VDOM patch has applied. Yield this
17
- * before any DOM read or write whose target was just brought into existence
18
- * (or moved, or had its attributes changed) by the same Message.
19
- *
20
- * The Task DOM helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
21
- * already gate themselves with this internally; reach for `afterRender`
22
- * directly when building custom Commands or DOM-observing Subscriptions
23
- * that need the same guarantee.
24
- *
25
- * @example
26
- * ```typescript
27
- * Effect.gen(function* () {
28
- * yield* Task.afterRender
29
- * const element = document.getElementById(id)
30
- * // element reflects the post-Message DOM
31
- * })
32
- * ```
33
- */
34
- export const afterRender = Effect.callback(resume => {
35
- const handle = requestAnimationFrame(() => resume(Effect.void));
36
- return Effect.sync(() => cancelAnimationFrame(handle));
37
- });
38
- /**
39
- * Completes after two animation frames, ensuring the browser has painted
40
- * the current state before proceeding. Used for CSS transition orchestration —
41
- * the double-rAF guarantees the "from" state is visible before transitioning
42
- * to the "to" state.
43
- *
44
- * @example
45
- * ```typescript
46
- * Task.nextFrame.pipe(Effect.as(TransitionFrameAdvanced()))
47
- * ```
48
- */
49
- export const nextFrame = Effect.callback(resume => {
50
- requestAnimationFrame(() => {
51
- requestAnimationFrame(() => {
52
- resume(Effect.void);
53
- });
54
- });
55
- });
56
- /**
57
- * Waits for all CSS animations on the element matching the selector to settle.
58
- * Covers both CSS transitions and CSS keyframe animations via the Web Animations
59
- * API. Falls back to completing immediately if the element is missing or has no
60
- * active animations.
61
- *
62
- * Leave animations must be finite. `animation-iteration-count: infinite` will
63
- * keep the underlying `.finished` promise pending and hang the caller.
64
- *
65
- * @example
66
- * ```typescript
67
- * Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
68
- * ```
69
- */
70
- export const waitForAnimationSettled = (selector) => Effect.callback(resume => {
71
- requestAnimationFrame(async () => {
72
- const element = document.querySelector(selector);
73
- const animations = element instanceof HTMLElement ? element.getAnimations() : [];
74
- await Promise.allSettled(animations.map(({ finished }) => finished));
75
- resume(Effect.void);
76
- });
77
- });