foldkit 0.81.1 → 0.82.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 (200) hide show
  1. package/README.md +3 -3
  2. package/dist/calendar/calendarDate.d.ts +11 -11
  3. package/dist/calendar/calendarDate.d.ts.map +1 -1
  4. package/dist/calendar/calendarDate.js +14 -13
  5. package/dist/calendar/comparison.d.ts +3 -3
  6. package/dist/calendar/comparison.d.ts.map +1 -1
  7. package/dist/calendar/comparison.js +5 -5
  8. package/dist/calendar/info.d.ts +1 -1
  9. package/dist/calendar/info.d.ts.map +1 -1
  10. package/dist/calendar/info.js +9 -1
  11. package/dist/calendar/locale.d.ts +5 -5
  12. package/dist/calendar/locale.js +23 -2
  13. package/dist/command/index.d.ts +2 -2
  14. package/dist/command/index.d.ts.map +1 -1
  15. package/dist/devTools/overlay.d.ts.map +1 -1
  16. package/dist/devTools/overlay.js +49 -27
  17. package/dist/devTools/protocol.d.ts +192 -192
  18. package/dist/devTools/protocol.d.ts.map +1 -1
  19. package/dist/devTools/protocol.js +36 -12
  20. package/dist/devTools/serialize.d.ts.map +1 -1
  21. package/dist/devTools/serialize.js +4 -4
  22. package/dist/devTools/store.d.ts.map +1 -1
  23. package/dist/devTools/store.js +1 -2
  24. package/dist/devTools/submodelPath.d.ts +1 -1
  25. package/dist/devTools/summarize.d.ts +6 -6
  26. package/dist/devTools/summarize.d.ts.map +1 -1
  27. package/dist/devTools/summarize.js +6 -6
  28. package/dist/devTools/webSocketBridge.d.ts +1 -1
  29. package/dist/devTools/webSocketBridge.d.ts.map +1 -1
  30. package/dist/devTools/webSocketBridge.js +19 -18
  31. package/dist/fieldValidation/index.d.ts +11 -11
  32. package/dist/fieldValidation/index.d.ts.map +1 -1
  33. package/dist/fieldValidation/index.js +8 -7
  34. package/dist/file/error.d.ts +1 -1
  35. package/dist/file/file.d.ts +1 -1
  36. package/dist/file/file.js +1 -1
  37. package/dist/file/reader.d.ts +4 -4
  38. package/dist/file/reader.js +5 -5
  39. package/dist/file/select.js +1 -1
  40. package/dist/html/index.d.ts.map +1 -1
  41. package/dist/html/index.js +4 -3
  42. package/dist/html/lazy.d.ts.map +1 -1
  43. package/dist/html/lazy.js +6 -7
  44. package/dist/managedResource/index.d.ts +2 -2
  45. package/dist/managedResource/index.d.ts.map +1 -1
  46. package/dist/managedResource/index.js +2 -2
  47. package/dist/mount/index.d.ts +1 -1
  48. package/dist/mount/index.d.ts.map +1 -1
  49. package/dist/route/parser.d.ts +2 -2
  50. package/dist/route/parser.d.ts.map +1 -1
  51. package/dist/route/parser.js +5 -5
  52. package/dist/runtime/browserListeners.d.ts.map +1 -1
  53. package/dist/runtime/browserListeners.js +6 -7
  54. package/dist/runtime/deepFreeze.d.ts +1 -1
  55. package/dist/runtime/deepFreeze.js +2 -2
  56. package/dist/runtime/hmrProtocol.d.ts +22 -0
  57. package/dist/runtime/hmrProtocol.d.ts.map +1 -0
  58. package/dist/runtime/hmrProtocol.js +15 -0
  59. package/dist/runtime/hmrProtocolPublic.d.ts +2 -0
  60. package/dist/runtime/hmrProtocolPublic.d.ts.map +1 -0
  61. package/dist/runtime/hmrProtocolPublic.js +1 -0
  62. package/dist/runtime/runtime.d.ts +10 -7
  63. package/dist/runtime/runtime.d.ts.map +1 -1
  64. package/dist/runtime/runtime.js +116 -114
  65. package/dist/runtime/subscription.d.ts +5 -5
  66. package/dist/runtime/subscription.d.ts.map +1 -1
  67. package/dist/runtime/urlRequest.d.ts +15 -15
  68. package/dist/runtime/urlRequest.d.ts.map +1 -1
  69. package/dist/runtime/urlRequest.js +1 -1
  70. package/dist/schema/index.d.ts +3 -3
  71. package/dist/schema/index.d.ts.map +1 -1
  72. package/dist/schema/index.js +10 -4
  73. package/dist/task/dom.js +1 -1
  74. package/dist/task/elementMovement.js +1 -1
  75. package/dist/task/error.d.ts +2 -2
  76. package/dist/task/inert.d.ts.map +1 -1
  77. package/dist/task/inert.js +4 -7
  78. package/dist/task/time.d.ts +1 -1
  79. package/dist/task/time.js +1 -1
  80. package/dist/task/timing.d.ts +1 -1
  81. package/dist/task/timing.d.ts.map +1 -1
  82. package/dist/task/timing.js +2 -2
  83. package/dist/test/apps/bubbling.d.ts +3 -3
  84. package/dist/test/apps/bubbling.d.ts.map +1 -1
  85. package/dist/test/apps/bubbling.js +1 -1
  86. package/dist/test/apps/counter.d.ts +6 -6
  87. package/dist/test/apps/counter.d.ts.map +1 -1
  88. package/dist/test/apps/counter.js +7 -1
  89. package/dist/test/apps/disabledButton.d.ts +11 -11
  90. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  91. package/dist/test/apps/disabledButton.js +1 -1
  92. package/dist/test/apps/fileUpload.d.ts +4 -4
  93. package/dist/test/apps/fileUpload.d.ts.map +1 -1
  94. package/dist/test/apps/fileUpload.js +1 -1
  95. package/dist/test/apps/formChild.d.ts +16 -16
  96. package/dist/test/apps/formChild.d.ts.map +1 -1
  97. package/dist/test/apps/formChild.js +9 -4
  98. package/dist/test/apps/interactions.d.ts +8 -8
  99. package/dist/test/apps/interactions.d.ts.map +1 -1
  100. package/dist/test/apps/interactions.js +8 -1
  101. package/dist/test/apps/keypress.d.ts +7 -7
  102. package/dist/test/apps/keypress.d.ts.map +1 -1
  103. package/dist/test/apps/keypress.js +1 -1
  104. package/dist/test/apps/login.d.ts +14 -14
  105. package/dist/test/apps/login.d.ts.map +1 -1
  106. package/dist/test/apps/login.js +9 -2
  107. package/dist/test/apps/logoutButton.d.ts +3 -3
  108. package/dist/test/apps/logoutButton.d.ts.map +1 -1
  109. package/dist/test/apps/logoutButton.js +2 -2
  110. package/dist/test/apps/multiRole.d.ts +2 -2
  111. package/dist/test/apps/multiRole.d.ts.map +1 -1
  112. package/dist/test/apps/multiRole.js +1 -1
  113. package/dist/test/apps/pointer.d.ts +6 -6
  114. package/dist/test/apps/pointer.d.ts.map +1 -1
  115. package/dist/test/apps/pointer.js +1 -1
  116. package/dist/test/apps/resumeUpload.d.ts +8 -8
  117. package/dist/test/apps/resumeUpload.d.ts.map +1 -1
  118. package/dist/test/apps/resumeUpload.js +12 -5
  119. package/dist/test/internal.js +10 -10
  120. package/dist/test/matchers.js +1 -1
  121. package/dist/test/query.d.ts.map +1 -1
  122. package/dist/test/query.js +13 -13
  123. package/dist/test/scene.d.ts.map +1 -1
  124. package/dist/test/scene.js +3 -3
  125. package/dist/test/story.js +1 -1
  126. package/dist/ui/animation/schema.d.ts +5 -5
  127. package/dist/ui/animation/schema.d.ts.map +1 -1
  128. package/dist/ui/animation/schema.js +9 -3
  129. package/dist/ui/calendar/index.d.ts +77 -77
  130. package/dist/ui/calendar/index.d.ts.map +1 -1
  131. package/dist/ui/calendar/index.js +26 -11
  132. package/dist/ui/checkbox/index.d.ts +2 -2
  133. package/dist/ui/combobox/multi.d.ts +38 -42
  134. package/dist/ui/combobox/multi.d.ts.map +1 -1
  135. package/dist/ui/combobox/multi.js +4 -1
  136. package/dist/ui/combobox/shared.d.ts +31 -31
  137. package/dist/ui/combobox/shared.d.ts.map +1 -1
  138. package/dist/ui/combobox/shared.js +34 -12
  139. package/dist/ui/combobox/single.d.ts +39 -43
  140. package/dist/ui/combobox/single.d.ts.map +1 -1
  141. package/dist/ui/combobox/single.js +7 -6
  142. package/dist/ui/datePicker/index.d.ts +86 -86
  143. package/dist/ui/datePicker/index.d.ts.map +1 -1
  144. package/dist/ui/datePicker/index.js +10 -3
  145. package/dist/ui/dialog/index.d.ts +8 -8
  146. package/dist/ui/dialog/index.d.ts.map +1 -1
  147. package/dist/ui/dialog/index.js +9 -3
  148. package/dist/ui/disclosure/index.d.ts +2 -2
  149. package/dist/ui/disclosure/index.d.ts.map +1 -1
  150. package/dist/ui/disclosure/index.js +1 -1
  151. package/dist/ui/dragAndDrop/index.d.ts +76 -76
  152. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  153. package/dist/ui/dragAndDrop/index.js +47 -29
  154. package/dist/ui/fileDrop/index.d.ts +8 -8
  155. package/dist/ui/fileDrop/index.d.ts.map +1 -1
  156. package/dist/ui/fileDrop/index.js +7 -2
  157. package/dist/ui/listbox/multi.d.ts +36 -40
  158. package/dist/ui/listbox/multi.d.ts.map +1 -1
  159. package/dist/ui/listbox/multi.js +4 -1
  160. package/dist/ui/listbox/shared.d.ts +32 -32
  161. package/dist/ui/listbox/shared.d.ts.map +1 -1
  162. package/dist/ui/listbox/shared.js +36 -11
  163. package/dist/ui/listbox/single.d.ts +36 -40
  164. package/dist/ui/listbox/single.d.ts.map +1 -1
  165. package/dist/ui/listbox/single.js +5 -2
  166. package/dist/ui/menu/index.d.ts +40 -40
  167. package/dist/ui/menu/index.d.ts.map +1 -1
  168. package/dist/ui/menu/index.js +38 -11
  169. package/dist/ui/popover/index.d.ts +12 -12
  170. package/dist/ui/popover/index.d.ts.map +1 -1
  171. package/dist/ui/popover/index.js +17 -2
  172. package/dist/ui/radioGroup/index.d.ts +6 -6
  173. package/dist/ui/radioGroup/index.d.ts.map +1 -1
  174. package/dist/ui/radioGroup/index.js +5 -5
  175. package/dist/ui/slider/index.d.ts +26 -26
  176. package/dist/ui/slider/index.d.ts.map +1 -1
  177. package/dist/ui/slider/index.js +30 -16
  178. package/dist/ui/switch/index.d.ts +2 -2
  179. package/dist/ui/tabs/index.d.ts +8 -8
  180. package/dist/ui/tabs/index.d.ts.map +1 -1
  181. package/dist/ui/tabs/index.js +3 -3
  182. package/dist/ui/toast/index.d.ts +75 -75
  183. package/dist/ui/toast/index.d.ts.map +1 -1
  184. package/dist/ui/toast/index.js +1 -1
  185. package/dist/ui/toast/schema.d.ts +63 -63
  186. package/dist/ui/toast/schema.d.ts.map +1 -1
  187. package/dist/ui/toast/schema.js +19 -4
  188. package/dist/ui/toast/update.d.ts +67 -67
  189. package/dist/ui/toast/update.d.ts.map +1 -1
  190. package/dist/ui/toast/update.js +2 -2
  191. package/dist/ui/tooltip/index.d.ts +15 -15
  192. package/dist/ui/tooltip/index.d.ts.map +1 -1
  193. package/dist/ui/tooltip/index.js +14 -4
  194. package/dist/ui/virtualList/index.d.ts +16 -16
  195. package/dist/ui/virtualList/index.d.ts.map +1 -1
  196. package/dist/ui/virtualList/index.js +46 -42
  197. package/dist/url/index.d.ts +8 -8
  198. package/dist/url/index.d.ts.map +1 -1
  199. package/dist/url/index.js +14 -14
  200. package/package.json +12 -8
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ---
20
20
 
21
- Foldkit is a frontend framework for TypeScript, built on [Effect](https://effect.website/), using [The Elm Architecture](https://guide.elm-lang.org/architecture/). One Model, one update function, one way to do things. No hooks, no local state, no hidden mutations.
21
+ Built on [Effect](https://effect.website/). Architected like [Elm](https://guide.elm-lang.org/architecture/). Written in TypeScript. One Model, one update function, one way to do things. No hooks, no local state, no hidden mutations.
22
22
 
23
23
  > [!NOTE]
24
24
  > Foldkit is pre-1.0. The core API is stable, but breaking changes may occur in minor releases. See the [changelog](./CHANGELOG.md) for details.
@@ -42,7 +42,7 @@ Every Foldkit application is an [Effect](https://effect.website/) program. Your
42
42
  `create-foldkit-app` is the recommended way to start a new project. It scaffolds a complete setup with Tailwind, TypeScript, ESLint, Prettier, and the Vite plugin for state-preserving HMR — and lets you choose from a set of examples as your starting point.
43
43
 
44
44
  ```bash
45
- npx create-foldkit-app@latest --wizard
45
+ npx create-foldkit-app@latest
46
46
  ```
47
47
 
48
48
  ## Counter
@@ -66,7 +66,7 @@ const ClickedDecrement = m('ClickedDecrement')
66
66
  const ClickedIncrement = m('ClickedIncrement')
67
67
  const ClickedReset = m('ClickedReset')
68
68
 
69
- const Message = S.Union(ClickedDecrement, ClickedIncrement, ClickedReset)
69
+ const Message = S.Union([ClickedDecrement, ClickedIncrement, ClickedReset])
70
70
  type Message = typeof Message.Type
71
71
 
72
72
  // UPDATE
@@ -52,11 +52,11 @@ export declare const daysInMonth: (year: number, month: number) => number;
52
52
  * S.decodeUnknownSync(Calendar.CalendarDate)({ year: 2026, month: 4, day: 13 })
53
53
  * ```
54
54
  */
55
- export declare const CalendarDate: S.filter<S.Struct<{
56
- year: typeof S.Int;
57
- month: S.filter<typeof S.Int>;
58
- day: S.filter<typeof S.Int>;
59
- }>>;
55
+ export declare const CalendarDate: S.Struct<{
56
+ readonly year: S.Int;
57
+ readonly month: S.Int;
58
+ readonly day: S.Int;
59
+ }>;
60
60
  export type CalendarDate = typeof CalendarDate.Type;
61
61
  /**
62
62
  * Type guard for `CalendarDate`. Returns true when `value` is a valid
@@ -135,7 +135,7 @@ export declare const fromDateInZone: (date: Date, timeZone: string) => CalendarD
135
135
  */
136
136
  export declare const toDateLocal: (calendarDate: CalendarDate) => Date;
137
137
  /**
138
- * Schema transform between an ISO 8601 date string (`YYYY-MM-DD`) and a
138
+ * Schema codec between an ISO 8601 date string (`YYYY-MM-DD`) and a
139
139
  * `CalendarDate`. Useful for form inputs, JSON serialization, URL query
140
140
  * parameters, and hidden form input values.
141
141
  *
@@ -154,9 +154,9 @@ export declare const toDateLocal: (calendarDate: CalendarDate) => Date;
154
154
  * encode(Calendar.make(2026, 4, 13)) // "2026-04-13"
155
155
  * ```
156
156
  */
157
- export declare const CalendarDateFromIsoString: S.transformOrFail<typeof S.String, S.filter<S.Struct<{
158
- year: typeof S.Int;
159
- month: S.filter<typeof S.Int>;
160
- day: S.filter<typeof S.Int>;
161
- }>>, never>;
157
+ export declare const CalendarDateFromIsoString: S.decodeTo<S.Struct<{
158
+ readonly year: S.Int;
159
+ readonly month: S.Int;
160
+ readonly day: S.Int;
161
+ }>, S.String, never, never>;
162
162
  //# sourceMappingURL=calendarDate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendarDate.d.ts","sourceRoot":"","sources":["../../src/calendar/calendarDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OACgB,CAAA;AAE1D;;;;;;;;;;;;;GAaG;AACH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,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY;;;;EAcxB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAEnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,YACtC,CAAA;AAEpB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,YACP,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,KAAK,MAAM,KACV,YAC+D,CAAA;AAElE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,YAC0B,CAAA;AAErE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,EAAE,UAAU,MAAM,KAAG,YAa7D,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,cAAc,YAAY,KAAG,IACc,CAAA;AAIvE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB;;;;2BA0BrC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ParseResult, Schema as S } from 'effect';
1
+ import { Effect, Option, Schema as S, SchemaIssue, SchemaTransformation, } from 'effect';
2
2
  /**
3
3
  * Determines if a year is a leap year in the Gregorian calendar.
4
4
  *
@@ -62,9 +62,9 @@ export const daysInMonth = (year, month) => {
62
62
  */
63
63
  export const CalendarDate = S.Struct({
64
64
  year: S.Int,
65
- month: S.Int.pipe(S.between(1, 12)),
66
- day: S.Int.pipe(S.between(1, 31)),
67
- }).pipe(S.filter(({ year, month, day }) => day <= daysInMonth(year, month), {
65
+ month: S.Int.check(S.isBetween({ minimum: 1, maximum: 12 })),
66
+ day: S.Int.check(S.isBetween({ minimum: 1, maximum: 31 })),
67
+ }).check(S.makeFilter(({ year, month, day }) => day <= daysInMonth(year, month) ? undefined : 'invalid calendar date', {
68
68
  identifier: 'CalendarDate',
69
69
  description: 'a valid calendar date (year, month 1-12, day within month length)',
70
70
  }));
@@ -102,7 +102,7 @@ export const make = (year, month, day) => S.decodeUnknownSync(CalendarDate)({ ye
102
102
  * caller knows are valid — typically arithmetic results inside the calendar
103
103
  * module. Consumers should prefer `make`.
104
104
  */
105
- export const unsafeMake = (year, month, day) => CalendarDate.make({ year, month, day }, { disableValidation: true });
105
+ export const unsafeMake = (year, month, day) => CalendarDate.make({ year, month, day }, { disableChecks: true });
106
106
  /**
107
107
  * Constructs a `CalendarDate` from a JavaScript `Date` object, reading the
108
108
  * year/month/day in the browser's local timezone.
@@ -159,7 +159,7 @@ export const fromDateInZone = (date, timeZone) => {
159
159
  export const toDateLocal = (calendarDate) => new Date(calendarDate.year, calendarDate.month - 1, calendarDate.day);
160
160
  const isoPattern = /^(\d{4})-(\d{2})-(\d{2})$/;
161
161
  /**
162
- * Schema transform between an ISO 8601 date string (`YYYY-MM-DD`) and a
162
+ * Schema codec between an ISO 8601 date string (`YYYY-MM-DD`) and a
163
163
  * `CalendarDate`. Useful for form inputs, JSON serialization, URL query
164
164
  * parameters, and hidden form input values.
165
165
  *
@@ -178,19 +178,20 @@ const isoPattern = /^(\d{4})-(\d{2})-(\d{2})$/;
178
178
  * encode(Calendar.make(2026, 4, 13)) // "2026-04-13"
179
179
  * ```
180
180
  */
181
- export const CalendarDateFromIsoString = S.transformOrFail(S.String, CalendarDate, {
182
- strict: true,
183
- decode: (input, _options, ast) => {
181
+ export const CalendarDateFromIsoString = S.String.pipe(S.decodeTo(CalendarDate, SchemaTransformation.transformOrFail({
182
+ decode: input => {
184
183
  const match = input.match(isoPattern);
185
184
  if (match === null) {
186
- return ParseResult.fail(new ParseResult.Type(ast, input, `Expected ISO date (YYYY-MM-DD), got ${JSON.stringify(input)}`));
185
+ return Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), {
186
+ description: `Expected ISO date (YYYY-MM-DD), got ${JSON.stringify(input)}`,
187
+ }));
187
188
  }
188
189
  const [, yearString, monthString, dayString] = match;
189
- return ParseResult.succeed({
190
+ return Effect.succeed({
190
191
  year: Number(yearString),
191
192
  month: Number(monthString),
192
193
  day: Number(dayString),
193
194
  });
194
195
  },
195
- encode: ({ year, month, day }) => ParseResult.succeed(`${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`),
196
- });
196
+ encode: ({ year, month, day }) => Effect.succeed(`${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`),
197
+ })));
@@ -1,4 +1,4 @@
1
- import { type Equivalence as equivalence, Order as order } from 'effect';
1
+ import { type Equivalence as Equivalence_, Order as Order_ } from 'effect';
2
2
  import type { CalendarDate } from './calendarDate.js';
3
3
  /**
4
4
  * Total ordering over calendar dates. Uses lexicographic comparison on
@@ -18,11 +18,11 @@ import type { CalendarDate } from './calendarDate.js';
18
18
  * Array.sort(dates, Calendar.Order)
19
19
  * ```
20
20
  */
21
- export declare const Order: order.Order<CalendarDate>;
21
+ export declare const Order: Order_.Order<CalendarDate>;
22
22
  /**
23
23
  * Value-based equivalence for calendar dates.
24
24
  */
25
- export declare const Equivalence: equivalence.Equivalence<CalendarDate>;
25
+ export declare const Equivalence: Equivalence_.Equivalence<CalendarDate>;
26
26
  /**
27
27
  * Returns `true` when two calendar dates represent the same day.
28
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../src/calendar/comparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,IAAI,KAAK,EACf,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;;;;;;;;;;;;GAiBG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,YAAY,CAAA;IACxC,CACE,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE;QACP,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;QAC9B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;KAC/B,GACA,YAAY,CAAA;CAkBhB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Function, Order as order, } from 'effect';
1
+ import { Function, Order as Order_, } from 'effect';
2
2
  /**
3
3
  * Total ordering over calendar dates. Uses lexicographic comparison on
4
4
  * `year`, then `month`, then `day` — which matches calendar chronology
@@ -17,10 +17,10 @@ import { Function, Order as order, } from 'effect';
17
17
  * Array.sort(dates, Calendar.Order)
18
18
  * ```
19
19
  */
20
- export const Order = order.struct({
21
- year: order.number,
22
- month: order.number,
23
- day: order.number,
20
+ export const Order = Order_.Struct({
21
+ year: Order_.Number,
22
+ month: Order_.Number,
23
+ day: Order_.Number,
24
24
  });
25
25
  /**
26
26
  * Value-based equivalence for calendar dates.
@@ -4,7 +4,7 @@ import { type CalendarDate } from './calendarDate.js';
4
4
  * Schema for days of the week, Sunday through Saturday. Tagged union preferred
5
5
  * over 0-6 numeric indices to avoid magic numbers at call sites.
6
6
  */
7
- export declare const DayOfWeek: S.Literal<["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
7
+ export declare const DayOfWeek: S.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
8
8
  export type DayOfWeek = typeof DayOfWeek.Type;
9
9
  /**
10
10
  * Returns the day of the week for a calendar date.
@@ -1 +1 @@
1
- {"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/calendar/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAG9C,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,SAAS,2FAQrB,CAAA;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;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,KAAG,YACsB,CAAA;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,EAAE;IACxB,CAAC,cAAc,EAAE,SAAS,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,CAAA;IACjE,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,GAAG,YAAY,CAAA;CAS9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE;IACtB,CAAC,cAAc,EAAE,SAAS,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,CAAA;IACjE,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,GAAG,YAAY,CAAA;CAK9D,CAAA"}
@@ -5,7 +5,15 @@ import { daysInMonth, unsafeMake } from './calendarDate.js';
5
5
  * Schema for days of the week, Sunday through Saturday. Tagged union preferred
6
6
  * over 0-6 numeric indices to avoid magic numbers at call sites.
7
7
  */
8
- export const DayOfWeek = S.Literal('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
8
+ export const DayOfWeek = S.Literals([
9
+ 'Sunday',
10
+ 'Monday',
11
+ 'Tuesday',
12
+ 'Wednesday',
13
+ 'Thursday',
14
+ 'Friday',
15
+ 'Saturday',
16
+ ]);
9
17
  const dayOfWeekFromIndex = (index) => {
10
18
  if (index === 0)
11
19
  return 'Sunday';
@@ -10,11 +10,11 @@ import type { CalendarDate } from './calendarDate.js';
10
10
  * controls how the view rotates them at render time.
11
11
  */
12
12
  export declare const LocaleConfig: S.Struct<{
13
- firstDayOfWeek: S.Literal<["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
14
- monthNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
15
- shortMonthNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
16
- dayNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
17
- shortDayNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
13
+ readonly firstDayOfWeek: S.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
14
+ readonly monthNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
15
+ readonly shortMonthNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
16
+ readonly dayNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
17
+ readonly shortDayNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
18
18
  }>;
19
19
  export type LocaleConfig = typeof LocaleConfig.Type;
20
20
  /**
@@ -1,7 +1,28 @@
1
1
  import { Function, Schema as S } from 'effect';
2
2
  import { DayOfWeek, dayOfWeek } from './info.js';
3
- const twelveStrings = S.Tuple(S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String);
4
- const sevenStrings = S.Tuple(S.String, S.String, S.String, S.String, S.String, S.String, S.String);
3
+ const twelveStrings = S.Tuple([
4
+ S.String,
5
+ S.String,
6
+ S.String,
7
+ S.String,
8
+ S.String,
9
+ S.String,
10
+ S.String,
11
+ S.String,
12
+ S.String,
13
+ S.String,
14
+ S.String,
15
+ S.String,
16
+ ]);
17
+ const sevenStrings = S.Tuple([
18
+ S.String,
19
+ S.String,
20
+ S.String,
21
+ S.String,
22
+ S.String,
23
+ S.String,
24
+ S.String,
25
+ ]);
5
26
  /**
6
27
  * Locale configuration for rendering calendar dates. Contains only data —
7
28
  * month/day names and the first day of the week. Formatting functions
@@ -4,7 +4,7 @@ export declare const CommandDefinitionTypeId: unique symbol;
4
4
  /** Type-level brand for CommandDefinition values. */
5
5
  export type CommandDefinitionTypeId = typeof CommandDefinitionTypeId;
6
6
  /** A named Effect that produces a message. */
7
- export type Command<T, E = never, R = never> = [T] extends [Schema.Schema.Any] ? Readonly<{
7
+ export type Command<T, E = never, R = never> = [T] extends [Schema.Top] ? Readonly<{
8
8
  name: string;
9
9
  effect: Effect.Effect<Schema.Schema.Type<T>, E, R>;
10
10
  }> : Readonly<{
@@ -22,7 +22,7 @@ export interface CommandDefinition<Name extends string, ResultMessage = any> {
22
22
  }
23
23
  /** Defines a named Command identity with the Messages it returns. */
24
24
  export declare const define: {
25
- <const Name extends string, Results extends ReadonlyArray<Schema.Schema.Any>>(name: Name, ...results: Results): CommandDefinition<Name, Schema.Schema.Type<Results[number]>>;
25
+ <const Name extends string, Results extends ReadonlyArray<Schema.Top>>(name: Name, ...results: Results): CommandDefinition<Name, Schema.Schema.Type<Results[number]>>;
26
26
  };
27
27
  /** Transforms the Effect inside a Command while preserving its name. */
28
28
  export declare const mapEffect: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,qDAAqD;AAErD,eAAO,MAAM,uBAAuB,EAAE,OAAO,MAEN,CAAA;AAEvC,qDAAqD;AACrD,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,8CAA8C;AAC9C,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAC1E,QA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,CAAA;AAC5D,eAAO,MAAM,UAAU;;EAA6C,CAAA;AACpE,eAAO,MAAM,YAAY;;EAAiD,CAAA;AAC1E,eAAO,MAAM,WAAW;;EAA+C,CAAA;AA2zCvE,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,UAAU,gBAAgB,EAC1B,MAAM,YAAY,EAClB,aAAa,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,sCAmDhC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
- import { Array as Array_, Effect, Equal, Function, HashSet, Match as M, Number as Number_, Option, Order, Predicate, Record, Schema as S, Stream, String as String_, SubscriptionRef, pipe, } from 'effect';
2
+ import { Array as Array_, Effect, Equal, Function, HashSet, Match as M, Number as Number_, Option, Order, Predicate, Queue, Record, Schema as S, Stream, String as String_, SubscriptionRef, pipe, } from 'effect';
3
3
  import * as Command from '../command/index.js';
4
4
  import { OptionExt } from '../effectExtensions/index.js';
5
5
  import { createKeyedLazy, html, } from '../html/index.js';
@@ -18,7 +18,7 @@ import { GOT_MESSAGE_PATTERN, extractSubmodelInfo, isTagged, } from './submodelP
18
18
  const DisplayEntry = S.Struct({
19
19
  tag: S.String,
20
20
  submodelPath: S.Array(S.String),
21
- maybeLeafTag: S.OptionFromSelf(S.String),
21
+ maybeLeafTag: S.Option(S.String),
22
22
  commandNames: S.Array(S.String),
23
23
  timestamp: S.Number,
24
24
  isModelChanged: S.Boolean,
@@ -29,7 +29,7 @@ const InspectorTabsModel = S.Struct({
29
29
  id: S.String,
30
30
  activeIndex: S.Number,
31
31
  focusedIndex: S.Number,
32
- activationMode: S.Literal('Automatic', 'Manual'),
32
+ activationMode: S.Literals(['Automatic', 'Manual']),
33
33
  });
34
34
  const Model = S.Struct({
35
35
  isOpen: S.Boolean,
@@ -41,14 +41,14 @@ const Model = S.Struct({
41
41
  pausedAtIndex: S.Number,
42
42
  selectedIndex: S.Number,
43
43
  isFollowingLatest: S.Boolean,
44
- maybeInspectedModel: S.OptionFromSelf(S.Unknown),
45
- maybeInspectedMessage: S.OptionFromSelf(S.Unknown),
44
+ maybeInspectedModel: S.Option(S.Unknown),
45
+ maybeInspectedMessage: S.Option(S.Unknown),
46
46
  submodelTags: S.Array(S.String),
47
- maybeSubmodelFilter: S.OptionFromSelf(S.String),
47
+ maybeSubmodelFilter: S.Option(S.String),
48
48
  submodelFilterListbox: Listbox.Model,
49
- expandedPaths: S.HashSetFromSelf(S.String),
50
- changedPaths: S.HashSetFromSelf(S.String),
51
- affectedPaths: S.HashSetFromSelf(S.String),
49
+ expandedPaths: S.HashSet(S.String),
50
+ changedPaths: S.HashSet(S.String),
51
+ affectedPaths: S.HashSet(S.String),
52
52
  inspectorTabs: InspectorTabsModel,
53
53
  });
54
54
  const Flags = S.Struct({
@@ -76,9 +76,9 @@ const CrossedMobileBreakpoint = m('CrossedMobileBreakpoint', {
76
76
  });
77
77
  const ReceivedInspectedState = m('ReceivedInspectedState', {
78
78
  model: S.Unknown,
79
- maybeMessage: S.OptionFromSelf(S.Unknown),
80
- changedPaths: S.HashSetFromSelf(S.String),
81
- affectedPaths: S.HashSetFromSelf(S.String),
79
+ maybeMessage: S.Option(S.Unknown),
80
+ changedPaths: S.HashSet(S.String),
81
+ affectedPaths: S.HashSet(S.String),
82
82
  });
83
83
  const ToggledTreeNode = m('ToggledTreeNode', { path: S.String });
84
84
  const GotInspectorTabsMessage = m('GotInspectorTabsMessage', {
@@ -97,7 +97,26 @@ const GotSubmodelFilterMessage = m('GotSubmodelFilterMessage', {
97
97
  const SelectedSubmodelFilter = m('SelectedSubmodelFilter', {
98
98
  tag: S.String,
99
99
  });
100
- const Message = S.Union(ClickedToggle, ClickedRow, ClickedResume, ClickedClear, ClickedFollowLatest, CompletedJump, CompletedResume, CompletedClear, LockedScroll, UnlockedScroll, ScrolledToTop, CrossedMobileBreakpoint, ReceivedInspectedState, ToggledTreeNode, GotInspectorTabsMessage, ReceivedStoreUpdate, GotSubmodelFilterMessage, SelectedSubmodelFilter);
100
+ const Message = S.Union([
101
+ ClickedToggle,
102
+ ClickedRow,
103
+ ClickedResume,
104
+ ClickedClear,
105
+ ClickedFollowLatest,
106
+ CompletedJump,
107
+ CompletedResume,
108
+ CompletedClear,
109
+ LockedScroll,
110
+ UnlockedScroll,
111
+ ScrolledToTop,
112
+ CrossedMobileBreakpoint,
113
+ ReceivedInspectedState,
114
+ ToggledTreeNode,
115
+ GotInspectorTabsMessage,
116
+ ReceivedStoreUpdate,
117
+ GotSubmodelFilterMessage,
118
+ SelectedSubmodelFilter,
119
+ ]);
101
120
  // HELPERS
102
121
  const MILLIS_PER_SECOND = 1000;
103
122
  const MOBILE_BREAKPOINT = 767;
@@ -105,9 +124,9 @@ const MOBILE_BREAKPOINT_QUERY = `(max-width: ${MOBILE_BREAKPOINT}px)`;
105
124
  const TREE_INDENT_PX = 12;
106
125
  const MAX_PREVIEW_KEYS = 3;
107
126
  const ALL_MESSAGES_VALUE = '';
108
- const formatTimeDelta = (deltaMs) => M.value(deltaMs).pipe(M.when(0, () => '0ms'), M.when(Number_.lessThan(MILLIS_PER_SECOND), ms => `+${Math.round(ms)}ms`), M.orElse(ms => `+${(ms / MILLIS_PER_SECOND).toFixed(1)}s`));
127
+ const formatTimeDelta = (deltaMs) => M.value(deltaMs).pipe(M.when(0, () => '0ms'), M.when(Number_.isLessThan(MILLIS_PER_SECOND), ms => `+${Math.round(ms)}ms`), M.orElse(ms => `+${(ms / MILLIS_PER_SECOND).toFixed(1)}s`));
109
128
  const MESSAGE_LIST_SELECTOR = '.message-list';
110
- const computeSubmodelTags = (entries) => pipe(entries, Array_.flatMap(({ submodelPath }) => submodelPath), Array_.dedupe, Array_.sort(Order.string));
129
+ const computeSubmodelTags = (entries) => pipe(entries, Array_.flatMap(({ submodelPath }) => submodelPath), Array_.dedupe, Array_.sort(Order.String));
111
130
  const toDisplayEntries = ({ entries }) => Array_.map(entries, entry => {
112
131
  const { submodelPath, maybeLeafTag } = extractSubmodelInfo(entry.tag, entry.message);
113
132
  return {
@@ -136,7 +155,7 @@ const objectPreview = (value) => pipe(value, Record.keys, Array_.filter(key => k
136
155
  : `{ ${preview} }`;
137
156
  },
138
157
  }));
139
- const collapsedPreview = (value) => M.value(value).pipe(M.when(Array.isArray, array => `(${array.length})`), M.when(Predicate.isReadonlyRecord, objectPreview), M.orElse(() => ''));
158
+ const collapsedPreview = (value) => M.value(value).pipe(M.when(Array.isArray, array => `(${array.length})`), M.when(Predicate.isObject, objectPreview), M.orElse(() => ''));
140
159
  // UPDATE
141
160
  export const JumpTo = Command.define('JumpTo', CompletedJump);
142
161
  export const InspectState = Command.define('InspectState', ReceivedInspectedState);
@@ -159,7 +178,7 @@ const makeUpdate = (store, shadow, mode) => {
159
178
  }));
160
179
  const inspectLatest = InspectLatest(Effect.gen(function* () {
161
180
  const state = yield* SubscriptionRef.get(store.stateRef);
162
- const latestIndex = Array_.isEmptyReadonlyArray(state.entries)
181
+ const latestIndex = Array_.isReadonlyArrayEmpty(state.entries)
163
182
  ? INIT_INDEX
164
183
  : state.startIndex + state.entries.length - 1;
165
184
  return yield* inspectState(latestIndex).effect;
@@ -261,7 +280,9 @@ const makeUpdate = (store, shadow, mode) => {
261
280
  },
262
281
  ToggledTreeNode: ({ path }) => [
263
282
  evo(model, {
264
- expandedPaths: paths => HashSet.toggle(paths, path),
283
+ expandedPaths: paths => HashSet.has(paths, path)
284
+ ? HashSet.remove(paths, path)
285
+ : HashSet.add(paths, path),
265
286
  }),
266
287
  [],
267
288
  ],
@@ -321,18 +342,18 @@ const SubscriptionDeps = S.Struct({
321
342
  const makeOverlaySubscriptions = (store) => makeSubscriptions(SubscriptionDeps)({
322
343
  storeUpdates: {
323
344
  modelToDependencies: () => true,
324
- dependenciesToStream: () => Stream.concat(Stream.fromEffect(SubscriptionRef.get(store.stateRef).pipe(Effect.map(state => ReceivedStoreUpdate(toDisplayState(state))))), Stream.map(store.stateRef.changes, state => ReceivedStoreUpdate(toDisplayState(state)))),
345
+ dependenciesToStream: () => Stream.concat(Stream.fromEffect(SubscriptionRef.get(store.stateRef).pipe(Effect.map(state => ReceivedStoreUpdate(toDisplayState(state))))), Stream.map(SubscriptionRef.changes(store.stateRef), state => ReceivedStoreUpdate(toDisplayState(state)))),
325
346
  },
326
347
  mobileBreakpoint: {
327
348
  modelToDependencies: () => null,
328
- dependenciesToStream: () => Stream.async(emit => {
349
+ dependenciesToStream: () => Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {
329
350
  const mediaQuery = window.matchMedia(MOBILE_BREAKPOINT_QUERY);
330
351
  const handler = (event) => {
331
- emit.single(CrossedMobileBreakpoint({ isMobile: event.matches }));
352
+ Queue.offerUnsafe(queue, CrossedMobileBreakpoint({ isMobile: event.matches }));
332
353
  };
333
354
  mediaQuery.addEventListener('change', handler);
334
- return Effect.sync(() => mediaQuery.removeEventListener('change', handler));
335
- }),
355
+ return { mediaQuery, handler };
356
+ }), ({ mediaQuery, handler }) => Effect.sync(() => mediaQuery.removeEventListener('change', handler))).pipe(Effect.flatMap(() => Effect.never))),
336
357
  },
337
358
  });
338
359
  // VIEW
@@ -408,7 +429,7 @@ const makeView = (position, mode, maybeBanner) => {
408
429
  key: String(arrayIndex),
409
430
  }));
410
431
  }
411
- else if (Predicate.isReadonlyRecord(value)) {
432
+ else if (Predicate.isObject(value)) {
412
433
  pipe(value, Record.toEntries, Array_.filter(([entryKey]) => entryKey !== '_tag'), Array_.forEach(([entryKey, childValue]) => flattenTree({
413
434
  ...shared,
414
435
  value: childValue,
@@ -484,7 +505,7 @@ const makeView = (position, mode, maybeBanner) => {
484
505
  ])));
485
506
  };
486
507
  const inspectedTimestamp = (model) => {
487
- const lastIndex = Array_.isEmptyReadonlyArray(model.entries)
508
+ const lastIndex = Array_.isReadonlyArrayEmpty(model.entries)
488
509
  ? INIT_INDEX
489
510
  : model.startIndex + model.entries.length - 1;
490
511
  const selectedIndex = M.value(mode).pipe(M.when('TimeTravel', () => model.isPaused ? model.pausedAtIndex : lastIndex), M.when('Inspect', () => model.selectedIndex), M.exhaustive);
@@ -743,7 +764,7 @@ const makeView = (position, mode, maybeBanner) => {
743
764
  onNone: () => 0,
744
765
  onSome: ({ timestamp }) => timestamp,
745
766
  }));
746
- const lastIndex = Array_.isEmptyReadonlyArray(model.entries)
767
+ const lastIndex = Array_.isReadonlyArrayEmpty(model.entries)
747
768
  ? INIT_INDEX
748
769
  : model.startIndex + model.entries.length - 1;
749
770
  const selectedIndex = M.value(mode).pipe(M.when('TimeTravel', () => model.isPaused ? model.pausedAtIndex : lastIndex), M.when('Inspect', () => model.selectedIndex), M.exhaustive);
@@ -827,6 +848,7 @@ const createShadowContainer = () => {
827
848
  };
828
849
  export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(function* () {
829
850
  const { container, shadow } = createShadowContainer();
851
+ container.id = '__foldkit_devtools_overlay__';
830
852
  const flags = Effect.gen(function* () {
831
853
  const storeState = yield* SubscriptionRef.get(store.stateRef);
832
854
  return {
@@ -866,5 +888,5 @@ export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(
866
888
  subscriptions: makeOverlaySubscriptions(store),
867
889
  devTools: false,
868
890
  });
869
- yield* Effect.forkDaemon(overlayRuntime());
891
+ yield* Effect.forkDetach(overlayRuntime.start());
870
892
  });