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.
- package/README.md +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +19 -39
- package/dist/runtime/runtime.d.ts +10 -10
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +3 -2
- package/dist/runtime/subscription.d.ts +139 -19
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/subscription.js +90 -9
- package/dist/subscription/animationFrame.d.ts +23 -26
- package/dist/subscription/animationFrame.d.ts.map +1 -1
- package/dist/subscription/animationFrame.js +17 -18
- package/dist/subscription/public.d.ts +2 -2
- package/dist/subscription/public.d.ts.map +1 -1
- package/dist/subscription/public.js +1 -1
- package/dist/ui/dragAndDrop/index.d.ts +383 -101
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +19 -24
- package/dist/ui/dragAndDrop/public.d.ts +1 -1
- package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/public.js +1 -1
- package/dist/ui/slider/index.d.ts +193 -87
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +12 -19
- package/dist/ui/slider/public.d.ts +1 -1
- package/dist/ui/slider/public.d.ts.map +1 -1
- package/dist/ui/slider/public.js +1 -1
- package/dist/ui/virtualList/index.d.ts +45 -39
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +5 -12
- package/dist/ui/virtualList/public.d.ts +1 -1
- package/dist/ui/virtualList/public.d.ts.map +1 -1
- package/dist/ui/virtualList/public.js +1 -1
- 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
|
|
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 =
|
|
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,
|
|
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,
|
|
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,
|
|
1
|
+
export { init, update, scrollToIndex, scrollToIndexVariable, view, lazy, subscriptions, visibleWindow, visibleWindowVariable, Model, Message, ScrolledContainer, MeasuredContainer, CompletedApplyScroll, } from './index.js';
|