@breadstone/mosaik-elements-svelte 0.0.65 → 0.0.66
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/{flow-D-0MTYCm.mjs → flow-gcpXucZv.mjs} +35 -37
- package/index.mjs +31479 -32133
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
class g {
|
|
7
7
|
constructor(i) {
|
|
8
|
-
this._map = /* @__PURE__ */ new Map(), this._roundAverageSize = !1, this.totalSize = 0,
|
|
8
|
+
this._map = /* @__PURE__ */ new Map(), this._roundAverageSize = !1, this.totalSize = 0, i?.roundAverageSize === !0 && (this._roundAverageSize = !0);
|
|
9
9
|
}
|
|
10
10
|
set(i, t) {
|
|
11
11
|
const s = this._map.get(i) || 0;
|
|
@@ -30,8 +30,8 @@ class g {
|
|
|
30
30
|
* Copyright 2021 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
32
|
*/
|
|
33
|
-
function f(
|
|
34
|
-
return
|
|
33
|
+
function f(n) {
|
|
34
|
+
return n === "horizontal" ? "width" : "height";
|
|
35
35
|
}
|
|
36
36
|
class d {
|
|
37
37
|
_getDefaultConfig() {
|
|
@@ -178,23 +178,23 @@ class d {
|
|
|
178
178
|
* that support virtualization in two dimensions.
|
|
179
179
|
*/
|
|
180
180
|
_calculateScrollIntoViewPosition(i) {
|
|
181
|
-
const { block: t } = i, s = Math.min(this.items.length, Math.max(0, i.index)),
|
|
182
|
-
let
|
|
181
|
+
const { block: t } = i, s = Math.min(this.items.length, Math.max(0, i.index)), e = this._getItemPosition(s)[this._positionDim];
|
|
182
|
+
let h = e;
|
|
183
183
|
if (t !== "start") {
|
|
184
|
-
const
|
|
184
|
+
const o = this._getItemSize(s)[this._sizeDim];
|
|
185
185
|
if (t === "center")
|
|
186
|
-
|
|
186
|
+
h = e - 0.5 * this._viewDim1 + 0.5 * o;
|
|
187
187
|
else {
|
|
188
|
-
const
|
|
188
|
+
const l = e - this._viewDim1 + o;
|
|
189
189
|
if (t === "end")
|
|
190
|
-
|
|
190
|
+
h = l;
|
|
191
191
|
else {
|
|
192
192
|
const r = this._scrollPosition;
|
|
193
|
-
|
|
193
|
+
h = Math.abs(r - e) < Math.abs(r - l) ? e : l;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
return
|
|
197
|
+
return h += this.offsetWithinScroller[this._positionDim], this._clampScrollPosition(h);
|
|
198
198
|
}
|
|
199
199
|
getScrollIntoViewCoordinates(i) {
|
|
200
200
|
return {
|
|
@@ -272,17 +272,17 @@ class d {
|
|
|
272
272
|
* Copyright 2021 Google LLC
|
|
273
273
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
274
274
|
*/
|
|
275
|
-
function m(
|
|
276
|
-
return
|
|
275
|
+
function m(n) {
|
|
276
|
+
return n === "horizontal" ? "marginLeft" : "marginTop";
|
|
277
277
|
}
|
|
278
|
-
function u(
|
|
279
|
-
return
|
|
278
|
+
function u(n) {
|
|
279
|
+
return n === "horizontal" ? "marginRight" : "marginBottom";
|
|
280
280
|
}
|
|
281
|
-
function S(
|
|
282
|
-
return
|
|
281
|
+
function S(n) {
|
|
282
|
+
return n === "horizontal" ? "xOffset" : "yOffset";
|
|
283
283
|
}
|
|
284
|
-
function z(
|
|
285
|
-
const t = [
|
|
284
|
+
function z(n, i) {
|
|
285
|
+
const t = [n, i].sort();
|
|
286
286
|
return t[1] <= 0 ? Math.min(...t) : t[0] >= 0 ? Math.max(...t) : t[0] + t[1];
|
|
287
287
|
}
|
|
288
288
|
class p {
|
|
@@ -290,15 +290,14 @@ class p {
|
|
|
290
290
|
this._childSizeCache = new g(), this._marginSizeCache = new g(), this._metricsCache = /* @__PURE__ */ new Map();
|
|
291
291
|
}
|
|
292
292
|
update(i, t) {
|
|
293
|
-
var h, n;
|
|
294
293
|
const s = /* @__PURE__ */ new Set();
|
|
295
|
-
Object.keys(i).forEach((
|
|
296
|
-
const
|
|
297
|
-
this._metricsCache.set(
|
|
294
|
+
Object.keys(i).forEach((e) => {
|
|
295
|
+
const h = Number(e);
|
|
296
|
+
this._metricsCache.set(h, i[h]), this._childSizeCache.set(h, i[h][f(t)]), s.add(h), s.add(h + 1);
|
|
298
297
|
});
|
|
299
|
-
for (const
|
|
300
|
-
const
|
|
301
|
-
this._marginSizeCache.set(
|
|
298
|
+
for (const e of s) {
|
|
299
|
+
const h = this._metricsCache.get(e)?.[m(t)] || 0, o = this._metricsCache.get(e - 1)?.[u(t)] || 0;
|
|
300
|
+
this._marginSizeCache.set(e, z(h, o));
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
get averageChildSize() {
|
|
@@ -314,8 +313,7 @@ class p {
|
|
|
314
313
|
return this._marginSizeCache.totalSize;
|
|
315
314
|
}
|
|
316
315
|
getLeadingMarginValue(i, t) {
|
|
317
|
-
|
|
318
|
-
return ((s = this._metricsCache.get(i)) == null ? void 0 : s[m(t)]) || 0;
|
|
316
|
+
return this._metricsCache.get(i)?.[m(t)] || 0;
|
|
319
317
|
}
|
|
320
318
|
getChildSize(i) {
|
|
321
319
|
return this._childSizeCache.getSize(i);
|
|
@@ -393,10 +391,10 @@ class M extends d {
|
|
|
393
391
|
return this._calculateAnchor(i, t);
|
|
394
392
|
if (this._last < 0)
|
|
395
393
|
return this._calculateAnchor(i, t);
|
|
396
|
-
const s = this._getPhysicalItem(this._first),
|
|
397
|
-
if (
|
|
394
|
+
const s = this._getPhysicalItem(this._first), e = this._getPhysicalItem(this._last), h = s.pos;
|
|
395
|
+
if (e.pos + this._metricsCache.getChildSize(this._last) < i)
|
|
398
396
|
return this._calculateAnchor(i, t);
|
|
399
|
-
if (
|
|
397
|
+
if (h > t)
|
|
400
398
|
return this._calculateAnchor(i, t);
|
|
401
399
|
let r = this._firstVisible - 1, a = -1 / 0;
|
|
402
400
|
for (; a < i; )
|
|
@@ -434,12 +432,12 @@ class M extends d {
|
|
|
434
432
|
return;
|
|
435
433
|
}
|
|
436
434
|
(this._anchorIdx === null || this._anchorPos === null) && (this._anchorIdx = this._getAnchor(t, s), this._anchorPos = this._getPosition(this._anchorIdx));
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
this._anchorIdx === 0 && (this._anchorPos =
|
|
441
|
-
let
|
|
442
|
-
for (this._anchorPos +
|
|
435
|
+
let e = this._getSize(this._anchorIdx);
|
|
436
|
+
e === void 0 && (this._stable = !1, e = this._getAverageSize());
|
|
437
|
+
const h = this._metricsCache.getMarginSize(this._anchorIdx) ?? this._metricsCache.averageMarginSize, o = this._metricsCache.getMarginSize(this._anchorIdx + 1) ?? this._metricsCache.averageMarginSize;
|
|
438
|
+
this._anchorIdx === 0 && (this._anchorPos = h), this._anchorIdx === this.items.length - 1 && (this._anchorPos = this._scrollSize - o - e);
|
|
439
|
+
let l = 0;
|
|
440
|
+
for (this._anchorPos + e + o < t && (l = t - (this._anchorPos + e + o)), this._anchorPos - h > s && (l = s - (this._anchorPos - h)), l && (this._scrollPosition -= l, t -= l, s -= l, this._scrollError += l), i.set(this._anchorIdx, { pos: this._anchorPos, size: e }), this._first = this._last = this._anchorIdx, this._physicalMin = this._anchorPos - h, this._physicalMax = this._anchorPos + e + o; this._physicalMin > t && this._first > 0; ) {
|
|
443
441
|
let a = this._getSize(--this._first);
|
|
444
442
|
a === void 0 && (this._stable = !1, a = this._getAverageSize());
|
|
445
443
|
let _ = this._metricsCache.getMarginSize(this._first);
|