foldkit 0.100.1 → 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 (34) hide show
  1. package/README.md +1 -1
  2. package/dist/devTools/overlay.d.ts.map +1 -1
  3. package/dist/devTools/overlay.js +19 -39
  4. package/dist/runtime/runtime.d.ts +10 -10
  5. package/dist/runtime/runtime.d.ts.map +1 -1
  6. package/dist/runtime/runtime.js +3 -2
  7. package/dist/runtime/subscription.d.ts +139 -19
  8. package/dist/runtime/subscription.d.ts.map +1 -1
  9. package/dist/runtime/subscription.js +90 -9
  10. package/dist/subscription/animationFrame.d.ts +23 -26
  11. package/dist/subscription/animationFrame.d.ts.map +1 -1
  12. package/dist/subscription/animationFrame.js +17 -18
  13. package/dist/subscription/public.d.ts +2 -2
  14. package/dist/subscription/public.d.ts.map +1 -1
  15. package/dist/subscription/public.js +1 -1
  16. package/dist/ui/dragAndDrop/index.d.ts +383 -101
  17. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  18. package/dist/ui/dragAndDrop/index.js +19 -24
  19. package/dist/ui/dragAndDrop/public.d.ts +1 -1
  20. package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
  21. package/dist/ui/dragAndDrop/public.js +1 -1
  22. package/dist/ui/slider/index.d.ts +193 -87
  23. package/dist/ui/slider/index.d.ts.map +1 -1
  24. package/dist/ui/slider/index.js +12 -19
  25. package/dist/ui/slider/public.d.ts +1 -1
  26. package/dist/ui/slider/public.d.ts.map +1 -1
  27. package/dist/ui/slider/public.js +1 -1
  28. package/dist/ui/virtualList/index.d.ts +45 -39
  29. package/dist/ui/virtualList/index.d.ts.map +1 -1
  30. package/dist/ui/virtualList/index.js +5 -12
  31. package/dist/ui/virtualList/public.d.ts +1 -1
  32. package/dist/ui/virtualList/public.d.ts.map +1 -1
  33. package/dist/ui/virtualList/public.js +1 -1
  34. package/package.json +1 -1
@@ -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.1",
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",