@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.
@@ -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, (i == null ? void 0 : i.roundAverageSize) === !0 && (this._roundAverageSize = !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(o) {
34
- return o === "horizontal" ? "width" : "height";
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)), h = this._getItemPosition(s)[this._positionDim];
182
- let n = h;
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 l = this._getItemSize(s)[this._sizeDim];
184
+ const o = this._getItemSize(s)[this._sizeDim];
185
185
  if (t === "center")
186
- n = h - 0.5 * this._viewDim1 + 0.5 * l;
186
+ h = e - 0.5 * this._viewDim1 + 0.5 * o;
187
187
  else {
188
- const e = h - this._viewDim1 + l;
188
+ const l = e - this._viewDim1 + o;
189
189
  if (t === "end")
190
- n = e;
190
+ h = l;
191
191
  else {
192
192
  const r = this._scrollPosition;
193
- n = Math.abs(r - h) < Math.abs(r - e) ? h : e;
193
+ h = Math.abs(r - e) < Math.abs(r - l) ? e : l;
194
194
  }
195
195
  }
196
196
  }
197
- return n += this.offsetWithinScroller[this._positionDim], this._clampScrollPosition(n);
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(o) {
276
- return o === "horizontal" ? "marginLeft" : "marginTop";
275
+ function m(n) {
276
+ return n === "horizontal" ? "marginLeft" : "marginTop";
277
277
  }
278
- function u(o) {
279
- return o === "horizontal" ? "marginRight" : "marginBottom";
278
+ function u(n) {
279
+ return n === "horizontal" ? "marginRight" : "marginBottom";
280
280
  }
281
- function S(o) {
282
- return o === "horizontal" ? "xOffset" : "yOffset";
281
+ function S(n) {
282
+ return n === "horizontal" ? "xOffset" : "yOffset";
283
283
  }
284
- function z(o, i) {
285
- const t = [o, i].sort();
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((l) => {
296
- const e = Number(l);
297
- this._metricsCache.set(e, i[e]), this._childSizeCache.set(e, i[e][f(t)]), s.add(e), s.add(e + 1);
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 l of s) {
300
- const e = ((h = this._metricsCache.get(l)) == null ? void 0 : h[m(t)]) || 0, r = ((n = this._metricsCache.get(l - 1)) == null ? void 0 : n[u(t)]) || 0;
301
- this._marginSizeCache.set(l, z(e, r));
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
- var s;
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), h = this._getPhysicalItem(this._last), n = s.pos;
397
- if (h.pos + this._metricsCache.getChildSize(this._last) < i)
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 (n > t)
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 h = this._getSize(this._anchorIdx);
438
- h === void 0 && (this._stable = !1, h = this._getAverageSize());
439
- const n = this._metricsCache.getMarginSize(this._anchorIdx) ?? this._metricsCache.averageMarginSize, l = this._metricsCache.getMarginSize(this._anchorIdx + 1) ?? this._metricsCache.averageMarginSize;
440
- this._anchorIdx === 0 && (this._anchorPos = n), this._anchorIdx === this.items.length - 1 && (this._anchorPos = this._scrollSize - l - h);
441
- let e = 0;
442
- for (this._anchorPos + h + l < t && (e = t - (this._anchorPos + h + l)), this._anchorPos - n > s && (e = s - (this._anchorPos - n)), e && (this._scrollPosition -= e, t -= e, s -= e, this._scrollError += e), i.set(this._anchorIdx, { pos: this._anchorPos, size: h }), this._first = this._last = this._anchorIdx, this._physicalMin = this._anchorPos - n, this._physicalMax = this._anchorPos + h + l; this._physicalMin > t && this._first > 0; ) {
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);