@foldkit/ui 0.154.0-canary.f656c022545d → 0.155.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,OAAO,EAEb,MAAM,cAAc,CAAA;AAIrB,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAA;AAsBpD;0DAC0D;AAC1D,eAAO,MAAM,KAAK;;;;;;;YAXJ,eAAe;;;;;;YAMP,KAAK;YAAY,OAAO;;;;EAY5C,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,oEAAoE;AACpE,eAAO,MAAM,OAAO;;QACG,SAAS;;;QACT,eAAe;;;QACZ,OAAO;;EAC/B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAA;AACrE,MAAM,MAAM,iBAAiB,GAAG,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAA;AAErE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,mEAAmE;AACnE,MAAM,MAAM,UAAU,GA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E,MAAM,KAAK,MAAM,YAC9C,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,aAAa,CA+C1B,CAAA;AAcJ;;;;;;;;;;;;mEAYmE;AACnE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GvB,CAAA;AAMH;;;;;;kCAMkC;AAClC,MAAM,MAAM,UAAU,CAAC,IAAI,IAAI,QAAQ,CAAC;IACtC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAC1B,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAChD,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACpD,CAAC,CAAA;AAEF;;;;;;;YAOY;AACZ,KAAK,WAAW,CAAC,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;AAEvE,eAAO,MAAM,IAAI,GAAI,IAAI,OAEA,WAAW,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Effect,
|
|
2
|
+
import { Array, Effect, Number, Option, Queue, Schema as S, Stream, pipe, } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import { childAttributes, } from 'foldkit/html';
|
|
5
5
|
import { defineMessageUnion } from 'foldkit/message';
|
|
@@ -177,7 +177,7 @@ const lastOrZero = (values) => __foldkitBrandViewResult((pipe(values, Array.last
|
|
|
177
177
|
* Returns `Option.none()` when the container has not yet been measured;
|
|
178
178
|
* callers should render a placeholder (or `Html.empty`) and wait for the
|
|
179
179
|
* first `MeasuredContainer` message. */
|
|
180
|
-
export const visibleWindow = (model, itemCount, overscan) => __foldkitBrandViewResult((
|
|
180
|
+
export const visibleWindow = (model, itemCount, overscan) => __foldkitBrandViewResult((Measurement.match(model.measurement, {
|
|
181
181
|
Unmeasured: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/virtualList/index.js#Unmeasured"),
|
|
182
182
|
Measured: ({ containerHeight }) => {
|
|
183
183
|
const firstVisibleIndex = Math.floor(model.scrollTop / model.rowHeightPx);
|
|
@@ -193,7 +193,7 @@ export const visibleWindow = (model, itemCount, overscan) => __foldkitBrandViewR
|
|
|
193
193
|
bottomSpacerHeight,
|
|
194
194
|
})), "@foldkit/ui/virtualList/index.js#Measured");
|
|
195
195
|
},
|
|
196
|
-
}))
|
|
196
|
+
})), "@foldkit/ui/virtualList/index.js#visibleWindow");
|
|
197
197
|
/** Variable-height counterpart of `visibleWindow`. Walks the heights of every
|
|
198
198
|
* item to build a prefix-sum array, then locates the visible slice with two
|
|
199
199
|
* linear searches.
|
|
@@ -205,7 +205,7 @@ export const visibleWindow = (model, itemCount, overscan) => __foldkitBrandViewR
|
|
|
205
205
|
* return shape so consumers don't have to know.
|
|
206
206
|
*
|
|
207
207
|
* Returns `Option.none()` when the container has not yet been measured. */
|
|
208
|
-
export const visibleWindowVariable = (model, items, itemToRowHeightPx, overscan) => __foldkitBrandViewResult((
|
|
208
|
+
export const visibleWindowVariable = (model, items, itemToRowHeightPx, overscan) => __foldkitBrandViewResult((Measurement.match(model.measurement, {
|
|
209
209
|
Unmeasured: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/virtualList/index.js#Unmeasured~2"),
|
|
210
210
|
Measured: ({ containerHeight }) => {
|
|
211
211
|
const itemCount = items.length;
|
|
@@ -228,7 +228,7 @@ export const visibleWindowVariable = (model, items, itemToRowHeightPx, overscan)
|
|
|
228
228
|
bottomSpacerHeight,
|
|
229
229
|
})), "@foldkit/ui/virtualList/index.js#Measured~2");
|
|
230
230
|
},
|
|
231
|
-
}))
|
|
231
|
+
})), "@foldkit/ui/virtualList/index.js#visibleWindowVariable");
|
|
232
232
|
// SUBSCRIPTION
|
|
233
233
|
const containerElement = (id) => __foldkitBrandViewResult((Option.fromNullishOr(document.getElementById(id))), "@foldkit/ui/virtualList/index.js#containerElement");
|
|
234
234
|
/** Subscriptions that track the container's scroll position and size.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.155.0",
|
|
4
4
|
"description": "Headless, accessible UI components for Foldkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
],
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"effect": "4.0.0-rc.112",
|
|
125
|
-
"foldkit": "0.
|
|
125
|
+
"foldkit": ">=0.155.0"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
128
|
"@floating-ui/dom": "^1.8.0"
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@effect/vitest": "4.0.0-rc.112",
|
|
132
132
|
"effect": "4.0.0-rc.112",
|
|
133
|
-
"happy-dom": "^20.11.
|
|
133
|
+
"happy-dom": "^20.11.13",
|
|
134
134
|
"rimraf": "^6.1.3",
|
|
135
135
|
"typescript": "^7.0.2",
|
|
136
136
|
"vitest": "^4.1.11",
|
|
137
|
-
"@foldkit/vite-plugin": "0.
|
|
138
|
-
"foldkit": "0.
|
|
137
|
+
"@foldkit/vite-plugin": "0.20.0",
|
|
138
|
+
"foldkit": "0.155.0"
|
|
139
139
|
},
|
|
140
140
|
"keywords": [
|
|
141
141
|
"foldkit",
|