@surdeddd/bottom-sheet 0.21.1 → 0.21.2
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/dist/core.cjs +16 -6
- package/dist/core.js +16 -6
- package/dist/element.cjs +22 -11
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +22 -11
- package/dist/index.cjs +16 -6
- package/dist/index.js +16 -6
- package/dist/qwik-lib/index.qwik.cjs +17 -4
- package/dist/qwik-lib/index.qwik.mjs +17 -4
- package/dist/qwik.cjs +16 -6
- package/dist/qwik.js +16 -6
- package/dist/react.cjs +16 -6
- package/dist/react.js +16 -6
- package/dist/solid.cjs +16 -6
- package/dist/solid.js +16 -6
- package/dist/solid.source.jsx +16 -6
- package/dist/svelte-core.cjs +16 -6
- package/dist/svelte-core.js +16 -6
- package/dist/svelte.cjs +16 -6
- package/dist/svelte.js +16 -6
- package/dist/vue.cjs +16 -6
- package/dist/vue.js +16 -6
- package/package.json +1 -1
package/dist/svelte.cjs
CHANGED
|
@@ -399,14 +399,26 @@ function notifyLinkedSheets(sheets, self) {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
+
// src/core/primitives/hot-path-thresholds.ts
|
|
403
|
+
var SIZE_WRITE_EPSILON = 0.5;
|
|
404
|
+
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
405
|
+
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
406
|
+
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
407
|
+
|
|
402
408
|
// src/core/features/resize-observer.ts
|
|
403
409
|
function installResizeObserver(deps) {
|
|
404
410
|
if (typeof window === "undefined") {
|
|
405
411
|
return () => {
|
|
406
412
|
};
|
|
407
413
|
}
|
|
414
|
+
const seatFor = () => {
|
|
415
|
+
const snap = deps.resolveActiveSnap();
|
|
416
|
+
const max = deps.getMaxAxisSize();
|
|
417
|
+
return { target: snap ? Math.min(snap.size, max) : null, max };
|
|
418
|
+
};
|
|
408
419
|
const onResize = () => {
|
|
409
420
|
if (deps.isDestroyed()) return;
|
|
421
|
+
const before = seatFor();
|
|
410
422
|
deps.recomputeSnaps();
|
|
411
423
|
const mode = deps.getMode();
|
|
412
424
|
const isVerticalAxis = mode === "bottom" || mode === "top";
|
|
@@ -415,6 +427,10 @@ function installResizeObserver(deps) {
|
|
|
415
427
|
if (viewportSize2 > 0 && viewportSize2 < max) {
|
|
416
428
|
deps.setMaxAxisSize(viewportSize2);
|
|
417
429
|
}
|
|
430
|
+
const after = seatFor();
|
|
431
|
+
if (before.target !== null && after.target !== null && Math.abs(after.target - before.target) < SIZE_WRITE_EPSILON && Math.abs(after.max - before.max) < SIZE_WRITE_EPSILON) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
418
434
|
const wasAnimating = deps.isAnimating?.() ?? false;
|
|
419
435
|
deps.cancelInFlight();
|
|
420
436
|
deps.newCycle();
|
|
@@ -683,12 +699,6 @@ var SCRIM_PRESETS = Object.freeze({
|
|
|
683
699
|
}
|
|
684
700
|
});
|
|
685
701
|
|
|
686
|
-
// src/core/primitives/hot-path-thresholds.ts
|
|
687
|
-
var SIZE_WRITE_EPSILON = 0.5;
|
|
688
|
-
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
689
|
-
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
690
|
-
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
691
|
-
|
|
692
702
|
// src/core/primitives/opacity-dedup.ts
|
|
693
703
|
var WriteSentinel = class {
|
|
694
704
|
constructor() {
|
package/dist/svelte.js
CHANGED
|
@@ -377,14 +377,26 @@ function notifyLinkedSheets(sheets, self) {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
// src/core/primitives/hot-path-thresholds.ts
|
|
381
|
+
var SIZE_WRITE_EPSILON = 0.5;
|
|
382
|
+
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
383
|
+
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
384
|
+
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
385
|
+
|
|
380
386
|
// src/core/features/resize-observer.ts
|
|
381
387
|
function installResizeObserver(deps) {
|
|
382
388
|
if (typeof window === "undefined") {
|
|
383
389
|
return () => {
|
|
384
390
|
};
|
|
385
391
|
}
|
|
392
|
+
const seatFor = () => {
|
|
393
|
+
const snap = deps.resolveActiveSnap();
|
|
394
|
+
const max = deps.getMaxAxisSize();
|
|
395
|
+
return { target: snap ? Math.min(snap.size, max) : null, max };
|
|
396
|
+
};
|
|
386
397
|
const onResize = () => {
|
|
387
398
|
if (deps.isDestroyed()) return;
|
|
399
|
+
const before = seatFor();
|
|
388
400
|
deps.recomputeSnaps();
|
|
389
401
|
const mode = deps.getMode();
|
|
390
402
|
const isVerticalAxis = mode === "bottom" || mode === "top";
|
|
@@ -393,6 +405,10 @@ function installResizeObserver(deps) {
|
|
|
393
405
|
if (viewportSize2 > 0 && viewportSize2 < max) {
|
|
394
406
|
deps.setMaxAxisSize(viewportSize2);
|
|
395
407
|
}
|
|
408
|
+
const after = seatFor();
|
|
409
|
+
if (before.target !== null && after.target !== null && Math.abs(after.target - before.target) < SIZE_WRITE_EPSILON && Math.abs(after.max - before.max) < SIZE_WRITE_EPSILON) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
396
412
|
const wasAnimating = deps.isAnimating?.() ?? false;
|
|
397
413
|
deps.cancelInFlight();
|
|
398
414
|
deps.newCycle();
|
|
@@ -661,12 +677,6 @@ var SCRIM_PRESETS = Object.freeze({
|
|
|
661
677
|
}
|
|
662
678
|
});
|
|
663
679
|
|
|
664
|
-
// src/core/primitives/hot-path-thresholds.ts
|
|
665
|
-
var SIZE_WRITE_EPSILON = 0.5;
|
|
666
|
-
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
667
|
-
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
668
|
-
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
669
|
-
|
|
670
680
|
// src/core/primitives/opacity-dedup.ts
|
|
671
681
|
var WriteSentinel = class {
|
|
672
682
|
constructor() {
|
package/dist/vue.cjs
CHANGED
|
@@ -377,14 +377,26 @@ function notifyLinkedSheets(sheets, self) {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
// src/core/primitives/hot-path-thresholds.ts
|
|
381
|
+
var SIZE_WRITE_EPSILON = 0.5;
|
|
382
|
+
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
383
|
+
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
384
|
+
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
385
|
+
|
|
380
386
|
// src/core/features/resize-observer.ts
|
|
381
387
|
function installResizeObserver(deps) {
|
|
382
388
|
if (typeof window === "undefined") {
|
|
383
389
|
return () => {
|
|
384
390
|
};
|
|
385
391
|
}
|
|
392
|
+
const seatFor = () => {
|
|
393
|
+
const snap = deps.resolveActiveSnap();
|
|
394
|
+
const max = deps.getMaxAxisSize();
|
|
395
|
+
return { target: snap ? Math.min(snap.size, max) : null, max };
|
|
396
|
+
};
|
|
386
397
|
const onResize = () => {
|
|
387
398
|
if (deps.isDestroyed()) return;
|
|
399
|
+
const before = seatFor();
|
|
388
400
|
deps.recomputeSnaps();
|
|
389
401
|
const mode = deps.getMode();
|
|
390
402
|
const isVerticalAxis = mode === "bottom" || mode === "top";
|
|
@@ -393,6 +405,10 @@ function installResizeObserver(deps) {
|
|
|
393
405
|
if (viewportSize2 > 0 && viewportSize2 < max) {
|
|
394
406
|
deps.setMaxAxisSize(viewportSize2);
|
|
395
407
|
}
|
|
408
|
+
const after = seatFor();
|
|
409
|
+
if (before.target !== null && after.target !== null && Math.abs(after.target - before.target) < SIZE_WRITE_EPSILON && Math.abs(after.max - before.max) < SIZE_WRITE_EPSILON) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
396
412
|
const wasAnimating = deps.isAnimating?.() ?? false;
|
|
397
413
|
deps.cancelInFlight();
|
|
398
414
|
deps.newCycle();
|
|
@@ -661,12 +677,6 @@ var SCRIM_PRESETS = Object.freeze({
|
|
|
661
677
|
}
|
|
662
678
|
});
|
|
663
679
|
|
|
664
|
-
// src/core/primitives/hot-path-thresholds.ts
|
|
665
|
-
var SIZE_WRITE_EPSILON = 0.5;
|
|
666
|
-
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
667
|
-
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
668
|
-
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
669
|
-
|
|
670
680
|
// src/core/primitives/opacity-dedup.ts
|
|
671
681
|
var WriteSentinel = class {
|
|
672
682
|
constructor() {
|
package/dist/vue.js
CHANGED
|
@@ -375,14 +375,26 @@ function notifyLinkedSheets(sheets, self) {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
+
// src/core/primitives/hot-path-thresholds.ts
|
|
379
|
+
var SIZE_WRITE_EPSILON = 0.5;
|
|
380
|
+
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
381
|
+
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
382
|
+
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
383
|
+
|
|
378
384
|
// src/core/features/resize-observer.ts
|
|
379
385
|
function installResizeObserver(deps) {
|
|
380
386
|
if (typeof window === "undefined") {
|
|
381
387
|
return () => {
|
|
382
388
|
};
|
|
383
389
|
}
|
|
390
|
+
const seatFor = () => {
|
|
391
|
+
const snap = deps.resolveActiveSnap();
|
|
392
|
+
const max = deps.getMaxAxisSize();
|
|
393
|
+
return { target: snap ? Math.min(snap.size, max) : null, max };
|
|
394
|
+
};
|
|
384
395
|
const onResize = () => {
|
|
385
396
|
if (deps.isDestroyed()) return;
|
|
397
|
+
const before = seatFor();
|
|
386
398
|
deps.recomputeSnaps();
|
|
387
399
|
const mode = deps.getMode();
|
|
388
400
|
const isVerticalAxis = mode === "bottom" || mode === "top";
|
|
@@ -391,6 +403,10 @@ function installResizeObserver(deps) {
|
|
|
391
403
|
if (viewportSize2 > 0 && viewportSize2 < max) {
|
|
392
404
|
deps.setMaxAxisSize(viewportSize2);
|
|
393
405
|
}
|
|
406
|
+
const after = seatFor();
|
|
407
|
+
if (before.target !== null && after.target !== null && Math.abs(after.target - before.target) < SIZE_WRITE_EPSILON && Math.abs(after.max - before.max) < SIZE_WRITE_EPSILON) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
394
410
|
const wasAnimating = deps.isAnimating?.() ?? false;
|
|
395
411
|
deps.cancelInFlight();
|
|
396
412
|
deps.newCycle();
|
|
@@ -659,12 +675,6 @@ var SCRIM_PRESETS = Object.freeze({
|
|
|
659
675
|
}
|
|
660
676
|
});
|
|
661
677
|
|
|
662
|
-
// src/core/primitives/hot-path-thresholds.ts
|
|
663
|
-
var SIZE_WRITE_EPSILON = 0.5;
|
|
664
|
-
var OPACITY_WRITE_EPSILON = 5e-3;
|
|
665
|
-
var POINTER_EVENTS_OPACITY_THRESHOLD = 0.05;
|
|
666
|
-
var RANGE_DIVISION_EPSILON = 1e-4;
|
|
667
|
-
|
|
668
678
|
// src/core/primitives/opacity-dedup.ts
|
|
669
679
|
var WriteSentinel = class {
|
|
670
680
|
constructor() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surdeddd/bottom-sheet",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "Universal, headless bottom sheet — framework-agnostic core with React, Vue 3, Svelte, Solid, Qwik, Preact, Lit and Custom Element adapters. Pointer Events, snap points, momentum, a11y, SSR-safe.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|