foldkit 0.100.0 → 0.101.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 (60) hide show
  1. package/README.md +38 -36
  2. package/dist/devTools/overlay.d.ts.map +1 -1
  3. package/dist/devTools/overlay.js +25 -40
  4. package/dist/devTools/store.d.ts.map +1 -1
  5. package/dist/devTools/store.js +50 -49
  6. package/dist/runtime/runtime.d.ts +10 -10
  7. package/dist/runtime/runtime.d.ts.map +1 -1
  8. package/dist/runtime/runtime.js +3 -2
  9. package/dist/runtime/subscription.d.ts +139 -19
  10. package/dist/runtime/subscription.d.ts.map +1 -1
  11. package/dist/runtime/subscription.js +90 -9
  12. package/dist/subscription/animationFrame.d.ts +23 -26
  13. package/dist/subscription/animationFrame.d.ts.map +1 -1
  14. package/dist/subscription/animationFrame.js +17 -18
  15. package/dist/subscription/public.d.ts +2 -2
  16. package/dist/subscription/public.d.ts.map +1 -1
  17. package/dist/subscription/public.js +1 -1
  18. package/dist/test/apps/bubbling.d.ts.map +1 -1
  19. package/dist/test/apps/bubbling.js +7 -5
  20. package/dist/test/apps/counter.d.ts.map +1 -1
  21. package/dist/test/apps/counter.js +8 -6
  22. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  23. package/dist/test/apps/disabledButton.js +32 -21
  24. package/dist/test/apps/fileUpload.d.ts.map +1 -1
  25. package/dist/test/apps/fileUpload.js +18 -16
  26. package/dist/test/apps/interactions.d.ts.map +1 -1
  27. package/dist/test/apps/interactions.js +21 -19
  28. package/dist/test/apps/keypress.d.ts.map +1 -1
  29. package/dist/test/apps/keypress.js +12 -10
  30. package/dist/test/apps/login.d.ts.map +1 -1
  31. package/dist/test/apps/login.js +38 -36
  32. package/dist/test/apps/logoutButton.d.ts.map +1 -1
  33. package/dist/test/apps/logoutButton.js +4 -2
  34. package/dist/test/apps/mountPanel.d.ts.map +1 -1
  35. package/dist/test/apps/mountPanel.js +29 -21
  36. package/dist/test/apps/multiRole.d.ts.map +1 -1
  37. package/dist/test/apps/multiRole.js +6 -4
  38. package/dist/test/apps/pointer.d.ts.map +1 -1
  39. package/dist/test/apps/pointer.js +15 -13
  40. package/dist/test/apps/resumeUpload.d.ts.map +1 -1
  41. package/dist/test/apps/resumeUpload.js +20 -15
  42. package/dist/ui/dragAndDrop/index.d.ts +383 -101
  43. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  44. package/dist/ui/dragAndDrop/index.js +19 -24
  45. package/dist/ui/dragAndDrop/public.d.ts +1 -1
  46. package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
  47. package/dist/ui/dragAndDrop/public.js +1 -1
  48. package/dist/ui/slider/index.d.ts +193 -87
  49. package/dist/ui/slider/index.d.ts.map +1 -1
  50. package/dist/ui/slider/index.js +12 -19
  51. package/dist/ui/slider/public.d.ts +1 -1
  52. package/dist/ui/slider/public.d.ts.map +1 -1
  53. package/dist/ui/slider/public.js +1 -1
  54. package/dist/ui/virtualList/index.d.ts +45 -39
  55. package/dist/ui/virtualList/index.d.ts.map +1 -1
  56. package/dist/ui/virtualList/index.js +5 -12
  57. package/dist/ui/virtualList/public.d.ts +1 -1
  58. package/dist/ui/virtualList/public.d.ts.map +1 -1
  59. package/dist/ui/virtualList/public.js +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Option, Schema as S } from 'effect';
1
+ import { Option, Schema as S, Stream } from 'effect';
2
2
  import type { Command } from '../../command/index.js';
3
3
  import { type Attribute, type Html } from '../../html/index.js';
4
4
  /** Schema for the slider component's state. Tracks the current value, the
@@ -97,99 +97,205 @@ export declare const setRange: (model: Model, range: Readonly<{
97
97
  * Does not emit `ChangedValue`; use when the value is being driven by
98
98
  * external state rather than user input. */
99
99
  export declare const setValue: (model: Model, value: number) => Model;
100
- /** Schema describing the subscription dependencies for slider drag. */
101
- export declare const SubscriptionDependencies: S.Struct<{
102
- readonly dragPointer: S.Struct<{
103
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
104
- readonly id: S.String;
105
- readonly min: S.Number;
106
- readonly max: S.Number;
107
- }>;
108
- readonly dragEscape: S.Struct<{
109
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
110
- }>;
111
- }>;
112
100
  /** Builds slider drag subscriptions, looking up the track
113
101
  * element through the supplied root resolver. Use this when the slider is
114
102
  * rendered inside a Shadow DOM. The root is read lazily so consumers can
115
103
  * resolve it at subscription time. */
116
- export declare const subscriptionsForRoot: (getTrackRoot: () => Document | ShadowRoot) => import("../../runtime/subscription.js").Subscriptions<{
117
- readonly id: string;
118
- readonly value: number;
119
- readonly min: number;
120
- readonly max: number;
121
- readonly step: number;
122
- readonly dragState: {
123
- readonly _tag: "Idle";
124
- } | {
125
- readonly _tag: "Dragging";
126
- readonly originValue: number;
104
+ export declare const subscriptionsForRoot: (getTrackRoot: () => Document | ShadowRoot) => {
105
+ readonly dragPointer: {
106
+ readonly dependenciesSchema: S.Schema<{
107
+ readonly dragActivity: "Idle" | "Active";
108
+ readonly id: string;
109
+ readonly min: number;
110
+ readonly max: number;
111
+ }> & {
112
+ readonly fields: S.Struct.Fields;
113
+ };
114
+ readonly modelToDependencies: (model: {
115
+ readonly id: string;
116
+ readonly value: number;
117
+ readonly min: number;
118
+ readonly max: number;
119
+ readonly step: number;
120
+ readonly dragState: {
121
+ readonly _tag: "Idle";
122
+ } | {
123
+ readonly _tag: "Dragging";
124
+ readonly originValue: number;
125
+ };
126
+ }) => {
127
+ readonly dragActivity: "Idle" | "Active";
128
+ readonly id: string;
129
+ readonly min: number;
130
+ readonly max: number;
131
+ };
132
+ readonly keepAliveEquivalence?: never;
133
+ readonly dependenciesToStream: (dependencies: {
134
+ readonly dragActivity: "Idle" | "Active";
135
+ readonly id: string;
136
+ readonly min: number;
137
+ readonly max: number;
138
+ }) => Stream.Stream<{
139
+ readonly _tag: "PressedThumb";
140
+ } | {
141
+ readonly _tag: "PressedPointer";
142
+ readonly value: number;
143
+ } | {
144
+ readonly _tag: "MovedDragPointer";
145
+ readonly value: number;
146
+ } | {
147
+ readonly _tag: "ReleasedDragPointer";
148
+ } | {
149
+ readonly _tag: "CancelledDrag";
150
+ } | {
151
+ readonly _tag: "PressedKeyboardNavigation";
152
+ readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
153
+ }, never, never>;
154
+ } & {
155
+ readonly __subscription: never;
156
+ };
157
+ readonly dragEscape: {
158
+ readonly dependenciesSchema: S.Schema<{
159
+ readonly dragActivity: "Idle" | "Active";
160
+ }> & {
161
+ readonly fields: S.Struct.Fields;
162
+ };
163
+ readonly modelToDependencies: (model: {
164
+ readonly id: string;
165
+ readonly value: number;
166
+ readonly min: number;
167
+ readonly max: number;
168
+ readonly step: number;
169
+ readonly dragState: {
170
+ readonly _tag: "Idle";
171
+ } | {
172
+ readonly _tag: "Dragging";
173
+ readonly originValue: number;
174
+ };
175
+ }) => {
176
+ readonly dragActivity: "Idle" | "Active";
177
+ };
178
+ readonly keepAliveEquivalence?: never;
179
+ readonly dependenciesToStream: (dependencies: {
180
+ readonly dragActivity: "Idle" | "Active";
181
+ }) => Stream.Stream<{
182
+ readonly _tag: "PressedThumb";
183
+ } | {
184
+ readonly _tag: "PressedPointer";
185
+ readonly value: number;
186
+ } | {
187
+ readonly _tag: "MovedDragPointer";
188
+ readonly value: number;
189
+ } | {
190
+ readonly _tag: "ReleasedDragPointer";
191
+ } | {
192
+ readonly _tag: "CancelledDrag";
193
+ } | {
194
+ readonly _tag: "PressedKeyboardNavigation";
195
+ readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
196
+ }, never, never>;
197
+ } & {
198
+ readonly __subscription: never;
127
199
  };
128
- }, {
129
- readonly _tag: "PressedThumb";
130
- } | {
131
- readonly _tag: "PressedPointer";
132
- readonly value: number;
133
- } | {
134
- readonly _tag: "MovedDragPointer";
135
- readonly value: number;
136
- } | {
137
- readonly _tag: "ReleasedDragPointer";
138
- } | {
139
- readonly _tag: "CancelledDrag";
140
- } | {
141
- readonly _tag: "PressedKeyboardNavigation";
142
- readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
143
- }, S.Struct<{
144
- readonly dragPointer: S.Struct<{
145
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
146
- readonly id: S.String;
147
- readonly min: S.Number;
148
- readonly max: S.Number;
149
- }>;
150
- readonly dragEscape: S.Struct<{
151
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
152
- }>;
153
- }>, never>;
200
+ };
154
201
  /** Default drag subscriptions, with the track looked up via `document`. */
155
- export declare const subscriptions: import("../../runtime/subscription.js").Subscriptions<{
156
- readonly id: string;
157
- readonly value: number;
158
- readonly min: number;
159
- readonly max: number;
160
- readonly step: number;
161
- readonly dragState: {
162
- readonly _tag: "Idle";
163
- } | {
164
- readonly _tag: "Dragging";
165
- readonly originValue: number;
202
+ export declare const subscriptions: {
203
+ readonly dragPointer: {
204
+ readonly dependenciesSchema: S.Schema<{
205
+ readonly dragActivity: "Idle" | "Active";
206
+ readonly id: string;
207
+ readonly min: number;
208
+ readonly max: number;
209
+ }> & {
210
+ readonly fields: S.Struct.Fields;
211
+ };
212
+ readonly modelToDependencies: (model: {
213
+ readonly id: string;
214
+ readonly value: number;
215
+ readonly min: number;
216
+ readonly max: number;
217
+ readonly step: number;
218
+ readonly dragState: {
219
+ readonly _tag: "Idle";
220
+ } | {
221
+ readonly _tag: "Dragging";
222
+ readonly originValue: number;
223
+ };
224
+ }) => {
225
+ readonly dragActivity: "Idle" | "Active";
226
+ readonly id: string;
227
+ readonly min: number;
228
+ readonly max: number;
229
+ };
230
+ readonly keepAliveEquivalence?: never;
231
+ readonly dependenciesToStream: (dependencies: {
232
+ readonly dragActivity: "Idle" | "Active";
233
+ readonly id: string;
234
+ readonly min: number;
235
+ readonly max: number;
236
+ }) => Stream.Stream<{
237
+ readonly _tag: "PressedThumb";
238
+ } | {
239
+ readonly _tag: "PressedPointer";
240
+ readonly value: number;
241
+ } | {
242
+ readonly _tag: "MovedDragPointer";
243
+ readonly value: number;
244
+ } | {
245
+ readonly _tag: "ReleasedDragPointer";
246
+ } | {
247
+ readonly _tag: "CancelledDrag";
248
+ } | {
249
+ readonly _tag: "PressedKeyboardNavigation";
250
+ readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
251
+ }, never, never>;
252
+ } & {
253
+ readonly __subscription: never;
254
+ };
255
+ readonly dragEscape: {
256
+ readonly dependenciesSchema: S.Schema<{
257
+ readonly dragActivity: "Idle" | "Active";
258
+ }> & {
259
+ readonly fields: S.Struct.Fields;
260
+ };
261
+ readonly modelToDependencies: (model: {
262
+ readonly id: string;
263
+ readonly value: number;
264
+ readonly min: number;
265
+ readonly max: number;
266
+ readonly step: number;
267
+ readonly dragState: {
268
+ readonly _tag: "Idle";
269
+ } | {
270
+ readonly _tag: "Dragging";
271
+ readonly originValue: number;
272
+ };
273
+ }) => {
274
+ readonly dragActivity: "Idle" | "Active";
275
+ };
276
+ readonly keepAliveEquivalence?: never;
277
+ readonly dependenciesToStream: (dependencies: {
278
+ readonly dragActivity: "Idle" | "Active";
279
+ }) => Stream.Stream<{
280
+ readonly _tag: "PressedThumb";
281
+ } | {
282
+ readonly _tag: "PressedPointer";
283
+ readonly value: number;
284
+ } | {
285
+ readonly _tag: "MovedDragPointer";
286
+ readonly value: number;
287
+ } | {
288
+ readonly _tag: "ReleasedDragPointer";
289
+ } | {
290
+ readonly _tag: "CancelledDrag";
291
+ } | {
292
+ readonly _tag: "PressedKeyboardNavigation";
293
+ readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
294
+ }, never, never>;
295
+ } & {
296
+ readonly __subscription: never;
166
297
  };
167
- }, {
168
- readonly _tag: "PressedThumb";
169
- } | {
170
- readonly _tag: "PressedPointer";
171
- readonly value: number;
172
- } | {
173
- readonly _tag: "MovedDragPointer";
174
- readonly value: number;
175
- } | {
176
- readonly _tag: "ReleasedDragPointer";
177
- } | {
178
- readonly _tag: "CancelledDrag";
179
- } | {
180
- readonly _tag: "PressedKeyboardNavigation";
181
- readonly direction: "Max" | "Min" | "StepDecrement" | "StepIncrement" | "PageDecrement" | "PageIncrement";
182
- }, S.Struct<{
183
- readonly dragPointer: S.Struct<{
184
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
185
- readonly id: S.String;
186
- readonly min: S.Number;
187
- readonly max: S.Number;
188
- }>;
189
- readonly dragEscape: S.Struct<{
190
- readonly dragActivity: S.Literals<readonly ["Idle", "Active"]>;
191
- }>;
192
- }>, never>;
298
+ };
193
299
  /** Attribute groups the slider component provides to the consumer's `toView`
194
300
  * callback. */
195
301
  export type SliderAttributes<ParentMessage> = Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EACN,MAAM,IAAI,CAAC,EAIZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAa5B;uDACuD;AACvD,eAAO,MAAM,KAAK;;;;;;;;;EAOhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,4EAA4E;AAC5E,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C;;sDAEsD;AACtD,eAAO,MAAM,cAAc;;EAA2C,CAAA;AACtE;wCACwC;AACxC,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAC1E,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,iFAAiF;AACjF,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,uEAAuE;AACvE,eAAO,M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AAQ,GAAG,UAAU,CAAA;CAC3C,CAAC,CAAA;AAEF;;;;0EAI0E;AAC1E,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAgJF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,KACzE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { Effect, Equal, Match as M, Option, Schema as S, Stream, String as String_, pipe, } from 'effect';
2
2
  import { createLazy, html, } from '../../html/index.js';
3
3
  import { m } from '../../message/index.js';
4
- import { makeSubscriptions } from '../../runtime/subscription.js';
4
+ import * as Subscription from '../../runtime/subscription.js';
5
5
  import { ts } from '../../schema/index.js';
6
6
  import { evo } from '../../struct/index.js';
7
7
  // MODEL
@@ -183,24 +183,17 @@ const valueFromClientX = (clientX, trackElement_, min, max) => {
183
183
  return min + fraction * (max - min);
184
184
  }
185
185
  };
186
- /** Schema describing the subscription dependencies for slider drag. */
187
- export const SubscriptionDependencies = S.Struct({
188
- dragPointer: S.Struct({
189
- dragActivity: DragActivity,
190
- id: S.String,
191
- min: S.Number,
192
- max: S.Number,
193
- }),
194
- dragEscape: S.Struct({
195
- dragActivity: DragActivity,
196
- }),
197
- });
198
186
  /** Builds slider drag subscriptions, looking up the track
199
187
  * element through the supplied root resolver. Use this when the slider is
200
188
  * rendered inside a Shadow DOM. The root is read lazily so consumers can
201
189
  * resolve it at subscription time. */
202
- export const subscriptionsForRoot = (getTrackRoot) => makeSubscriptions(SubscriptionDependencies)({
203
- dragPointer: {
190
+ export const subscriptionsForRoot = (getTrackRoot) => Subscription.make()(entry => ({
191
+ dragPointer: entry({
192
+ dragActivity: DragActivity,
193
+ id: S.String,
194
+ min: S.Number,
195
+ max: S.Number,
196
+ }, {
204
197
  modelToDependencies: model => ({
205
198
  dragActivity: dragActivityFromModel(model),
206
199
  id: model.id,
@@ -227,14 +220,14 @@ export const subscriptionsForRoot = (getTrackRoot) => makeSubscriptions(Subscrip
227
220
  })).pipe(Effect.flatMap(() => Effect.never)));
228
221
  return Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => dragActivity === 'Active'));
229
222
  },
230
- },
231
- dragEscape: {
223
+ }),
224
+ dragEscape: entry({ dragActivity: DragActivity }, {
232
225
  modelToDependencies: model => ({
233
226
  dragActivity: dragActivityFromModel(model),
234
227
  }),
235
228
  dependenciesToStream: ({ dragActivity }) => Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => key === 'Escape'), Stream.map(() => CancelledDrag())), Effect.sync(() => dragActivity === 'Active')),
236
- },
237
- });
229
+ }),
230
+ }));
238
231
  /** Default drag subscriptions, with the track looked up via `document`. */
239
232
  export const subscriptions = subscriptionsForRoot(() => document);
240
233
  // VIEW
@@ -1,3 +1,3 @@
1
- export { init, update, setRange, setValue, view, lazy, subscriptions, subscriptionsForRoot, fractionOfValue, Model, Message, OutMessage, SubscriptionDependencies, } from './index.js';
1
+ export { init, update, setRange, setValue, view, lazy, subscriptions, subscriptionsForRoot, fractionOfValue, Model, Message, OutMessage, } from './index.js';
2
2
  export type { InitConfig, ViewConfig, SliderAttributes, PressedThumb, PressedPointer, MovedDragPointer, ReleasedDragPointer, CancelledDrag, PressedKeyboardNavigation, } from './index.js';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/slider/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,OAAO,EACP,UAAU,EACV,wBAAwB,GACzB,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,yBAAyB,GAC1B,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/slider/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,OAAO,EACP,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,yBAAyB,GAC1B,MAAM,YAAY,CAAA"}
@@ -1 +1 @@
1
- export { init, update, setRange, setValue, view, lazy, subscriptions, subscriptionsForRoot, fractionOfValue, Model, Message, OutMessage, SubscriptionDependencies, } from './index.js';
1
+ export { init, update, setRange, setValue, view, lazy, subscriptions, subscriptionsForRoot, fractionOfValue, Model, Message, OutMessage, } from './index.js';
@@ -1,4 +1,4 @@
1
- import { Effect, Option, Schema as S } from 'effect';
1
+ import { Effect, Option, Schema as S, Stream } from 'effect';
2
2
  import * as Command from '../../command/index.js';
3
3
  import { type Attribute, type Html, type TagName } from '../../html/index.js';
4
4
  /** Schema for the virtual list's state. Tracks scroll position, container
@@ -123,13 +123,6 @@ export declare const visibleWindow: (model: Model, itemCount: number, overscan:
123
123
  *
124
124
  * Returns `Option.none()` when the container has not yet been measured. */
125
125
  export declare const visibleWindowVariable: <Item>(model: Model, items: ReadonlyArray<Item>, itemToRowHeightPx: (item: Item, index: number) => number, overscan: number) => Option.Option<VisibleWindow>;
126
- /** Schema describing the subscription dependencies for container scroll and
127
- * resize tracking. */
128
- export declare const SubscriptionDependencies: S.Struct<{
129
- readonly containerEvents: S.Struct<{
130
- readonly id: S.String;
131
- }>;
132
- }>;
133
126
  /** Subscriptions that track the container's scroll position and size.
134
127
  *
135
128
  * - **scroll**: listens for `scroll` events on the container element and
@@ -143,38 +136,51 @@ export declare const SubscriptionDependencies: S.Struct<{
143
136
  * makes the subscription robust across SPA route changes: navigating to a
144
137
  * page that mounts the list, away, and back all reattach correctly without
145
138
  * the consumer having to teach the framework about navigation. */
146
- export declare const subscriptions: import("../../runtime/subscription.js").Subscriptions<{
147
- readonly id: string;
148
- readonly rowHeightPx: number;
149
- readonly scrollTop: number;
150
- readonly measurement: {
151
- readonly _tag: "Unmeasured";
152
- } | {
153
- readonly _tag: "Measured";
154
- readonly containerHeight: number;
155
- };
156
- readonly pendingScroll: {
157
- readonly _tag: "Idle";
158
- } | {
159
- readonly _tag: "ScrollingToIndex";
160
- readonly index: number;
161
- readonly version: number;
139
+ export declare const subscriptions: {
140
+ readonly containerEvents: {
141
+ readonly dependenciesSchema: S.Schema<{
142
+ readonly id: string;
143
+ }> & {
144
+ readonly fields: S.Struct.Fields;
145
+ };
146
+ readonly modelToDependencies: (model: {
147
+ readonly id: string;
148
+ readonly rowHeightPx: number;
149
+ readonly scrollTop: number;
150
+ readonly measurement: {
151
+ readonly _tag: "Unmeasured";
152
+ } | {
153
+ readonly _tag: "Measured";
154
+ readonly containerHeight: number;
155
+ };
156
+ readonly pendingScroll: {
157
+ readonly _tag: "Idle";
158
+ } | {
159
+ readonly _tag: "ScrollingToIndex";
160
+ readonly index: number;
161
+ readonly version: number;
162
+ };
163
+ readonly pendingScrollVersion: number;
164
+ }) => {
165
+ readonly id: string;
166
+ };
167
+ readonly keepAliveEquivalence?: never;
168
+ readonly dependenciesToStream: (dependencies: {
169
+ readonly id: string;
170
+ }) => Stream.Stream<{
171
+ readonly _tag: "ScrolledContainer";
172
+ readonly scrollTop: number;
173
+ } | {
174
+ readonly _tag: "MeasuredContainer";
175
+ readonly containerHeight: number;
176
+ } | {
177
+ readonly _tag: "CompletedApplyScroll";
178
+ readonly version: number;
179
+ }, never, never>;
180
+ } & {
181
+ readonly __subscription: never;
162
182
  };
163
- readonly pendingScrollVersion: number;
164
- }, {
165
- readonly _tag: "ScrolledContainer";
166
- readonly scrollTop: number;
167
- } | {
168
- readonly _tag: "MeasuredContainer";
169
- readonly containerHeight: number;
170
- } | {
171
- readonly _tag: "CompletedApplyScroll";
172
- readonly version: number;
173
- }, S.Struct<{
174
- readonly containerEvents: S.Struct<{
175
- readonly id: S.String;
176
- }>;
177
- }>, never>;
183
+ };
178
184
  /** Configuration for rendering a virtual list with `view`.
179
185
  *
180
186
  * VirtualList does not take a `toParentMessage` callback. All input
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAGN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,qBAAqB,CAAA;AA6B5B;0DAC0D;AAC1D,eAAO,MAAM,KAAK;;;;;;;;;;;;EAOhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC;kCACkC;AAClC,eAAO,MAAM,iBAAiB;;EAE5B,CAAA;AACF;uCACuC;AACvC,eAAO,MAAM,iBAAiB;;EAE5B,CAAA;AACF;8DAC8D;AAC9D,eAAO,MAAM,oBAAoB;;EAE/B,CAAA;AAEF,oEAAoE;AACpE,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,iBAAiB;IACxB,OAAO,iBAAiB;IACxB,OAAO,oBAAoB;CAC5B,CACsE,CAAA;AAEzE,MAAM,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,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;uCAgBuC;AACvC,eAAO,MAAM,IAAI,GAAI,aAAa,EAAE,IAAI,EACtC,QAAQ,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,KACtC,IAoFF,CAAA;AAED;;oBAEoB;AACpB,eAAO,MAAM,IAAI,GAAI,aAAa,EAAE,IAAI,EACtC,cAAc,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,KACrE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,CAarD,CAAA"}
@@ -2,7 +2,7 @@ import { Array, Effect, Match as M, Number, Option, Queue, Schema as S, Stream,
2
2
  import * as Command from '../../command/index.js';
3
3
  import { createLazy, html, } from '../../html/index.js';
4
4
  import { m } from '../../message/index.js';
5
- import { makeSubscriptions } from '../../runtime/subscription.js';
5
+ import * as Subscription from '../../runtime/subscription.js';
6
6
  import { ts } from '../../schema/index.js';
7
7
  import { evo } from '../../struct/index.js';
8
8
  // MODEL
@@ -235,13 +235,6 @@ export const visibleWindowVariable = (model, items, itemToRowHeightPx, overscan)
235
235
  }));
236
236
  // SUBSCRIPTION
237
237
  const containerElement = (id) => Option.fromNullishOr(document.getElementById(id));
238
- /** Schema describing the subscription dependencies for container scroll and
239
- * resize tracking. */
240
- export const SubscriptionDependencies = S.Struct({
241
- containerEvents: S.Struct({
242
- id: S.String,
243
- }),
244
- });
245
238
  /** Subscriptions that track the container's scroll position and size.
246
239
  *
247
240
  * - **scroll**: listens for `scroll` events on the container element and
@@ -255,8 +248,8 @@ export const SubscriptionDependencies = S.Struct({
255
248
  * makes the subscription robust across SPA route changes: navigating to a
256
249
  * page that mounts the list, away, and back all reattach correctly without
257
250
  * the consumer having to teach the framework about navigation. */
258
- export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
259
- containerEvents: {
251
+ export const subscriptions = Subscription.make()(entry => ({
252
+ containerEvents: entry({ id: S.String }, {
260
253
  modelToDependencies: model => ({ id: model.id }),
261
254
  dependenciesToStream: ({ id }) => Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {
262
255
  const state = {
@@ -335,8 +328,8 @@ export const subscriptions = makeSubscriptions(SubscriptionDependencies)({
335
328
  }
336
329
  detach();
337
330
  })).pipe(Effect.flatMap(() => Effect.never))),
338
- },
339
- });
331
+ }),
332
+ }));
340
333
  // VIEW
341
334
  const DEFAULT_OVERSCAN = 5;
342
335
  /** Renders a virtualized list. Only items inside the viewport (plus an
@@ -1,3 +1,3 @@
1
- export { init, update, scrollToIndex, scrollToIndexVariable, view, lazy, subscriptions, visibleWindow, visibleWindowVariable, Model, Message, ScrolledContainer, MeasuredContainer, CompletedApplyScroll, SubscriptionDependencies, } from './index.js';
1
+ export { init, update, scrollToIndex, scrollToIndexVariable, view, lazy, subscriptions, visibleWindow, visibleWindowVariable, Model, Message, ScrolledContainer, MeasuredContainer, CompletedApplyScroll, } from './index.js';
2
2
  export type { InitConfig, ViewConfig, VisibleWindow } from './index.js';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/virtualList/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/virtualList/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -1 +1 @@
1
- export { init, update, scrollToIndex, scrollToIndexVariable, view, lazy, subscriptions, visibleWindow, visibleWindowVariable, Model, Message, ScrolledContainer, MeasuredContainer, CompletedApplyScroll, SubscriptionDependencies, } from './index.js';
1
+ export { init, update, scrollToIndex, scrollToIndexVariable, view, lazy, subscriptions, visibleWindow, visibleWindowVariable, Model, Message, ScrolledContainer, MeasuredContainer, CompletedApplyScroll, } from './index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit",
3
- "version": "0.100.0",
3
+ "version": "0.101.0",
4
4
  "description": "A TypeScript frontend framework, built on Effect and architected like Elm",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",