@surdeddd/bottom-sheet 0.21.0 → 0.21.1
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 +9 -0
- package/dist/{BottomSheetCore-CK8Rh1He.d.cts → BottomSheetCore-BHv6LPmS.d.cts} +1 -1
- package/dist/{BottomSheetCore-CIijwtdi.d.ts → BottomSheetCore-CK_mq14p.d.ts} +1 -1
- package/dist/{BottomSheetEngine-hLSAxzla.d.cts → BottomSheetEngine-mmFzIK1Z.d.cts} +1 -1
- package/dist/{BottomSheetEngine-CZglPsTF.d.ts → BottomSheetEngine-wLn6Q2kA.d.ts} +1 -1
- package/dist/core.cjs +15 -15
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +15 -15
- package/dist/debug.d.cts +1 -1
- package/dist/debug.d.ts +1 -1
- package/dist/element.cjs +15 -15
- package/dist/element.d.cts +2 -2
- package/dist/element.d.ts +2 -2
- package/dist/element.iife.global.js +1 -1
- package/dist/element.js +15 -15
- package/dist/features.d.cts +2 -2
- package/dist/features.d.ts +2 -2
- package/dist/{index-BqLHKOeM.d.ts → index-CWKv1Xy4.d.ts} +1 -1
- package/dist/{index-BEX-NHRJ.d.cts → index-juAyT76E.d.cts} +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +15 -15
- package/dist/integrations/formik.d.cts +1 -1
- package/dist/integrations/formik.d.ts +1 -1
- package/dist/integrations/react-hook-form.d.cts +1 -1
- package/dist/integrations/react-hook-form.d.ts +1 -1
- package/dist/preact.d.cts +2 -2
- package/dist/preact.d.ts +2 -2
- package/dist/qwik-lib/index.qwik.cjs +12 -15
- package/dist/qwik-lib/index.qwik.mjs +12 -15
- package/dist/qwik.cjs +15 -15
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +15 -15
- package/dist/react.cjs +15 -15
- package/dist/react.d.cts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +15 -15
- package/dist/solid.cjs +15 -15
- package/dist/solid.d.cts +1 -1
- package/dist/solid.d.ts +1 -1
- package/dist/solid.js +15 -15
- package/dist/solid.source.jsx +15 -15
- package/dist/svelte-core.cjs +15 -15
- package/dist/svelte-core.js +15 -15
- package/dist/svelte.cjs +15 -15
- package/dist/svelte.js +15 -15
- package/dist/vue.cjs +15 -15
- package/dist/vue.js +15 -15
- package/dist/webgl.d.cts +1 -1
- package/dist/webgl.d.ts +1 -1
- package/package.json +2 -2
|
@@ -781,7 +781,6 @@ class ScrimController {
|
|
|
781
781
|
__publicField(this, "backdrop");
|
|
782
782
|
__publicField(this, "mode");
|
|
783
783
|
__publicField(this, "isDestroyed");
|
|
784
|
-
__publicField(this, "isTopSheet");
|
|
785
784
|
__publicField(this, "getAllowedIds");
|
|
786
785
|
__publicField(this, "getResolvedSnaps");
|
|
787
786
|
__publicField(this, "snapToFn");
|
|
@@ -803,7 +802,6 @@ class ScrimController {
|
|
|
803
802
|
this.backdrop = deps.backdrop;
|
|
804
803
|
this.mode = deps.mode;
|
|
805
804
|
this.isDestroyed = deps.isDestroyed;
|
|
806
|
-
this.isTopSheet = deps.isTopSheet;
|
|
807
805
|
this.getAllowedIds = deps.getAllowedIds;
|
|
808
806
|
this.getResolvedSnaps = deps.getResolvedSnaps;
|
|
809
807
|
this.snapToFn = deps.snapTo;
|
|
@@ -854,8 +852,7 @@ class ScrimController {
|
|
|
854
852
|
if (this.backdrop) {
|
|
855
853
|
const [s, e] = this.backdropRange;
|
|
856
854
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
857
|
-
const
|
|
858
|
-
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
855
|
+
const backdropOpacity = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
859
856
|
if (this.backdropOpacitySentinel.shouldWrite(backdropOpacity, OPACITY_WRITE_EPSILON)) {
|
|
860
857
|
this.backdrop.style.opacity = String(backdropOpacity);
|
|
861
858
|
}
|
|
@@ -2662,6 +2659,7 @@ class BottomSheetCore {
|
|
|
2662
2659
|
__publicField(this, "progressWriteSentinel", new WriteSentinel());
|
|
2663
2660
|
__publicField(this, "isTopSheet", true);
|
|
2664
2661
|
__publicField(this, "opening", false);
|
|
2662
|
+
__publicField(this, "promotedForOpen", false);
|
|
2665
2663
|
__publicField(this, "allowOvershoot", false);
|
|
2666
2664
|
__publicField(this, "progressPayload", {
|
|
2667
2665
|
value: 0,
|
|
@@ -2718,7 +2716,6 @@ class BottomSheetCore {
|
|
|
2718
2716
|
screenComponent: this.screenComponent,
|
|
2719
2717
|
backdrop: this.backdrop,
|
|
2720
2718
|
isDestroyed: () => this.destroyed,
|
|
2721
|
-
isTopSheet: () => this.isTopSheet,
|
|
2722
2719
|
getAllowedIds: () => this.snaps.getAllowedIds().slice(),
|
|
2723
2720
|
getResolvedSnaps: () => this.snaps.getResolvedSnaps().slice(),
|
|
2724
2721
|
snapTo: (id) => {
|
|
@@ -2966,6 +2963,7 @@ class BottomSheetCore {
|
|
|
2966
2963
|
if (!_skipBeforeSnap && this.emitBeforeSnap(target, this.activeId)) {
|
|
2967
2964
|
return;
|
|
2968
2965
|
}
|
|
2966
|
+
const resumingOpen = this.opening;
|
|
2969
2967
|
const signal = this.newCycle();
|
|
2970
2968
|
const onExternalAbort = () => {
|
|
2971
2969
|
this.animation.cancel();
|
|
@@ -2974,7 +2972,7 @@ class BottomSheetCore {
|
|
|
2974
2972
|
externalSignal?.addEventListener("abort", onExternalAbort, {
|
|
2975
2973
|
once: true
|
|
2976
2974
|
});
|
|
2977
|
-
const wasClosed = this.size === 0;
|
|
2975
|
+
const wasClosed = this.size === 0 || resumingOpen;
|
|
2978
2976
|
const previousId = this.activeId;
|
|
2979
2977
|
const previousSize = this.size;
|
|
2980
2978
|
this.scrollCache.cache(previousId, previousSize, target.size);
|
|
@@ -2983,7 +2981,10 @@ class BottomSheetCore {
|
|
|
2983
2981
|
const opensToRest = id === "closed" || rawTargetSize === 0;
|
|
2984
2982
|
if (wasClosed && !opensToRest) {
|
|
2985
2983
|
this.opening = true;
|
|
2986
|
-
|
|
2984
|
+
if (!resumingOpen) {
|
|
2985
|
+
this.promotedForOpen = true;
|
|
2986
|
+
sheetStack.promote(this.id);
|
|
2987
|
+
}
|
|
2987
2988
|
}
|
|
2988
2989
|
if (this.animation.viewTransitionsAvailable) {
|
|
2989
2990
|
this.currentViewTransition?.skipTransition?.();
|
|
@@ -3422,19 +3423,12 @@ class BottomSheetCore {
|
|
|
3422
3423
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3423
3424
|
},
|
|
3424
3425
|
setIsTop: (isTop) => {
|
|
3425
|
-
if (this.isTopSheet === isTop) return;
|
|
3426
3426
|
this.isTopSheet = isTop;
|
|
3427
|
-
this.repaintScrim();
|
|
3428
3427
|
},
|
|
3429
3428
|
isOpen: () => this.size > 0 || this.opening,
|
|
3430
3429
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3431
3430
|
}));
|
|
3432
3431
|
}
|
|
3433
|
-
repaintScrim() {
|
|
3434
|
-
if (this.destroyed) return;
|
|
3435
|
-
this.scrim.invalidateOpacityCache();
|
|
3436
|
-
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3437
|
-
}
|
|
3438
3432
|
applyStackDepth(depth) {
|
|
3439
3433
|
if (!this.stackEffectEnabled) return;
|
|
3440
3434
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -3670,6 +3664,7 @@ class BottomSheetCore {
|
|
|
3670
3664
|
this.activeId = target.id;
|
|
3671
3665
|
if (previousSnapSize === 0 && target.size > 0) {
|
|
3672
3666
|
this.opening = true;
|
|
3667
|
+
this.promotedForOpen = true;
|
|
3673
3668
|
sheetStack.promote(this.id);
|
|
3674
3669
|
}
|
|
3675
3670
|
const settleCap = this.snaps.getMaxAxisSize();
|
|
@@ -3742,7 +3737,8 @@ class BottomSheetCore {
|
|
|
3742
3737
|
return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
|
|
3743
3738
|
}
|
|
3744
3739
|
handleOpen() {
|
|
3745
|
-
|
|
3740
|
+
if (this.promotedForOpen) this.promotedForOpen = false;
|
|
3741
|
+
else sheetStack.promote(this.id);
|
|
3746
3742
|
try {
|
|
3747
3743
|
this.lifecycle.install();
|
|
3748
3744
|
} catch (err) {
|
|
@@ -3774,6 +3770,7 @@ class BottomSheetCore {
|
|
|
3774
3770
|
}
|
|
3775
3771
|
handleClose() {
|
|
3776
3772
|
this.opening = false;
|
|
3773
|
+
this.promotedForOpen = false;
|
|
3777
3774
|
this.lifecycle.release();
|
|
3778
3775
|
sheetStack.update();
|
|
3779
3776
|
}
|
package/dist/qwik.cjs
CHANGED
|
@@ -777,7 +777,6 @@ var ScrimController = class {
|
|
|
777
777
|
__publicField(this, "backdrop");
|
|
778
778
|
__publicField(this, "mode");
|
|
779
779
|
__publicField(this, "isDestroyed");
|
|
780
|
-
__publicField(this, "isTopSheet");
|
|
781
780
|
__publicField(this, "getAllowedIds");
|
|
782
781
|
__publicField(this, "getResolvedSnaps");
|
|
783
782
|
__publicField(this, "snapToFn");
|
|
@@ -799,7 +798,6 @@ var ScrimController = class {
|
|
|
799
798
|
this.backdrop = deps.backdrop;
|
|
800
799
|
this.mode = deps.mode;
|
|
801
800
|
this.isDestroyed = deps.isDestroyed;
|
|
802
|
-
this.isTopSheet = deps.isTopSheet;
|
|
803
801
|
this.getAllowedIds = deps.getAllowedIds;
|
|
804
802
|
this.getResolvedSnaps = deps.getResolvedSnaps;
|
|
805
803
|
this.snapToFn = deps.snapTo;
|
|
@@ -844,8 +842,10 @@ var ScrimController = class {
|
|
|
844
842
|
if (this.backdrop) {
|
|
845
843
|
const [s, e] = this.backdropRange;
|
|
846
844
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
847
|
-
const
|
|
848
|
-
|
|
845
|
+
const backdropOpacity = Math.min(
|
|
846
|
+
Math.max((progress - s) / range, 0),
|
|
847
|
+
1
|
|
848
|
+
);
|
|
849
849
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
850
850
|
backdropOpacity,
|
|
851
851
|
OPACITY_WRITE_EPSILON
|
|
@@ -2620,6 +2620,7 @@ var BottomSheetCore = class {
|
|
|
2620
2620
|
__publicField(this, "progressWriteSentinel", new WriteSentinel());
|
|
2621
2621
|
__publicField(this, "isTopSheet", true);
|
|
2622
2622
|
__publicField(this, "opening", false);
|
|
2623
|
+
__publicField(this, "promotedForOpen", false);
|
|
2623
2624
|
__publicField(this, "allowOvershoot", false);
|
|
2624
2625
|
__publicField(this, "progressPayload", {
|
|
2625
2626
|
value: 0,
|
|
@@ -2676,7 +2677,6 @@ var BottomSheetCore = class {
|
|
|
2676
2677
|
screenComponent: this.screenComponent,
|
|
2677
2678
|
backdrop: this.backdrop,
|
|
2678
2679
|
isDestroyed: () => this.destroyed,
|
|
2679
|
-
isTopSheet: () => this.isTopSheet,
|
|
2680
2680
|
getAllowedIds: () => this.snaps.getAllowedIds().slice(),
|
|
2681
2681
|
getResolvedSnaps: () => this.snaps.getResolvedSnaps().slice(),
|
|
2682
2682
|
snapTo: (id) => {
|
|
@@ -2946,13 +2946,14 @@ var BottomSheetCore = class {
|
|
|
2946
2946
|
if (!_skipBeforeSnap && this.emitBeforeSnap(target, this.activeId)) {
|
|
2947
2947
|
return;
|
|
2948
2948
|
}
|
|
2949
|
+
const resumingOpen = this.opening;
|
|
2949
2950
|
const signal = this.newCycle();
|
|
2950
2951
|
const onExternalAbort = () => {
|
|
2951
2952
|
this.animation.cancel();
|
|
2952
2953
|
this.newCycle();
|
|
2953
2954
|
};
|
|
2954
2955
|
externalSignal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
2955
|
-
const wasClosed = this.size === 0;
|
|
2956
|
+
const wasClosed = this.size === 0 || resumingOpen;
|
|
2956
2957
|
const previousId = this.activeId;
|
|
2957
2958
|
const previousSize = this.size;
|
|
2958
2959
|
this.scrollCache.cache(previousId, previousSize, target.size);
|
|
@@ -2961,7 +2962,10 @@ var BottomSheetCore = class {
|
|
|
2961
2962
|
const opensToRest = id === "closed" || rawTargetSize === 0;
|
|
2962
2963
|
if (wasClosed && !opensToRest) {
|
|
2963
2964
|
this.opening = true;
|
|
2964
|
-
|
|
2965
|
+
if (!resumingOpen) {
|
|
2966
|
+
this.promotedForOpen = true;
|
|
2967
|
+
sheetStack.promote(this.id);
|
|
2968
|
+
}
|
|
2965
2969
|
}
|
|
2966
2970
|
if (this.animation.viewTransitionsAvailable) {
|
|
2967
2971
|
this.currentViewTransition?.skipTransition?.();
|
|
@@ -3402,19 +3406,12 @@ var BottomSheetCore = class {
|
|
|
3402
3406
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3403
3407
|
},
|
|
3404
3408
|
setIsTop: (isTop) => {
|
|
3405
|
-
if (this.isTopSheet === isTop) return;
|
|
3406
3409
|
this.isTopSheet = isTop;
|
|
3407
|
-
this.repaintScrim();
|
|
3408
3410
|
},
|
|
3409
3411
|
isOpen: () => this.size > 0 || this.opening,
|
|
3410
3412
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3411
3413
|
}));
|
|
3412
3414
|
}
|
|
3413
|
-
repaintScrim() {
|
|
3414
|
-
if (this.destroyed) return;
|
|
3415
|
-
this.scrim.invalidateOpacityCache();
|
|
3416
|
-
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3417
|
-
}
|
|
3418
3415
|
applyStackDepth(depth) {
|
|
3419
3416
|
if (!this.stackEffectEnabled) return;
|
|
3420
3417
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -3659,6 +3656,7 @@ var BottomSheetCore = class {
|
|
|
3659
3656
|
this.activeId = target.id;
|
|
3660
3657
|
if (previousSnapSize === 0 && target.size > 0) {
|
|
3661
3658
|
this.opening = true;
|
|
3659
|
+
this.promotedForOpen = true;
|
|
3662
3660
|
sheetStack.promote(this.id);
|
|
3663
3661
|
}
|
|
3664
3662
|
const settleCap = this.snaps.getMaxAxisSize();
|
|
@@ -3740,7 +3738,8 @@ var BottomSheetCore = class {
|
|
|
3740
3738
|
return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
|
|
3741
3739
|
}
|
|
3742
3740
|
handleOpen() {
|
|
3743
|
-
|
|
3741
|
+
if (this.promotedForOpen) this.promotedForOpen = false;
|
|
3742
|
+
else sheetStack.promote(this.id);
|
|
3744
3743
|
try {
|
|
3745
3744
|
this.lifecycle.install();
|
|
3746
3745
|
} catch (err) {
|
|
@@ -3772,6 +3771,7 @@ var BottomSheetCore = class {
|
|
|
3772
3771
|
}
|
|
3773
3772
|
handleClose() {
|
|
3774
3773
|
this.opening = false;
|
|
3774
|
+
this.promotedForOpen = false;
|
|
3775
3775
|
this.lifecycle.release();
|
|
3776
3776
|
sheetStack.update();
|
|
3777
3777
|
}
|
package/dist/qwik.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _builder_io_qwik from '@builder.io/qwik';
|
|
2
2
|
import { QRL } from '@builder.io/qwik';
|
|
3
3
|
import { T as TeleportTarget } from './teleport-7uYNiEAT.cjs';
|
|
4
|
-
import { a as SnapPointDef, b as SheetMode, c as EngineOptions, S as SheetEventMap, E as EngineState } from './BottomSheetCore-
|
|
5
|
-
export { d as SnapPoint } from './BottomSheetCore-
|
|
4
|
+
import { a as SnapPointDef, b as SheetMode, c as EngineOptions, S as SheetEventMap, E as EngineState } from './BottomSheetCore-BHv6LPmS.cjs';
|
|
5
|
+
export { d as SnapPoint } from './BottomSheetCore-BHv6LPmS.cjs';
|
|
6
6
|
import './transform-jVfAikE9.cjs';
|
|
7
7
|
|
|
8
8
|
type BottomSheetProps<TId extends string = string> = {
|
package/dist/qwik.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _builder_io_qwik from '@builder.io/qwik';
|
|
2
2
|
import { QRL } from '@builder.io/qwik';
|
|
3
3
|
import { T as TeleportTarget } from './teleport-7uYNiEAT.js';
|
|
4
|
-
import { a as SnapPointDef, b as SheetMode, c as EngineOptions, S as SheetEventMap, E as EngineState } from './BottomSheetCore-
|
|
5
|
-
export { d as SnapPoint } from './BottomSheetCore-
|
|
4
|
+
import { a as SnapPointDef, b as SheetMode, c as EngineOptions, S as SheetEventMap, E as EngineState } from './BottomSheetCore-CK_mq14p.js';
|
|
5
|
+
export { d as SnapPoint } from './BottomSheetCore-CK_mq14p.js';
|
|
6
6
|
import './transform-jVfAikE9.js';
|
|
7
7
|
|
|
8
8
|
type BottomSheetProps<TId extends string = string> = {
|
package/dist/qwik.js
CHANGED
|
@@ -775,7 +775,6 @@ var ScrimController = class {
|
|
|
775
775
|
__publicField(this, "backdrop");
|
|
776
776
|
__publicField(this, "mode");
|
|
777
777
|
__publicField(this, "isDestroyed");
|
|
778
|
-
__publicField(this, "isTopSheet");
|
|
779
778
|
__publicField(this, "getAllowedIds");
|
|
780
779
|
__publicField(this, "getResolvedSnaps");
|
|
781
780
|
__publicField(this, "snapToFn");
|
|
@@ -797,7 +796,6 @@ var ScrimController = class {
|
|
|
797
796
|
this.backdrop = deps.backdrop;
|
|
798
797
|
this.mode = deps.mode;
|
|
799
798
|
this.isDestroyed = deps.isDestroyed;
|
|
800
|
-
this.isTopSheet = deps.isTopSheet;
|
|
801
799
|
this.getAllowedIds = deps.getAllowedIds;
|
|
802
800
|
this.getResolvedSnaps = deps.getResolvedSnaps;
|
|
803
801
|
this.snapToFn = deps.snapTo;
|
|
@@ -842,8 +840,10 @@ var ScrimController = class {
|
|
|
842
840
|
if (this.backdrop) {
|
|
843
841
|
const [s, e] = this.backdropRange;
|
|
844
842
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
845
|
-
const
|
|
846
|
-
|
|
843
|
+
const backdropOpacity = Math.min(
|
|
844
|
+
Math.max((progress - s) / range, 0),
|
|
845
|
+
1
|
|
846
|
+
);
|
|
847
847
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
848
848
|
backdropOpacity,
|
|
849
849
|
OPACITY_WRITE_EPSILON
|
|
@@ -2618,6 +2618,7 @@ var BottomSheetCore = class {
|
|
|
2618
2618
|
__publicField(this, "progressWriteSentinel", new WriteSentinel());
|
|
2619
2619
|
__publicField(this, "isTopSheet", true);
|
|
2620
2620
|
__publicField(this, "opening", false);
|
|
2621
|
+
__publicField(this, "promotedForOpen", false);
|
|
2621
2622
|
__publicField(this, "allowOvershoot", false);
|
|
2622
2623
|
__publicField(this, "progressPayload", {
|
|
2623
2624
|
value: 0,
|
|
@@ -2674,7 +2675,6 @@ var BottomSheetCore = class {
|
|
|
2674
2675
|
screenComponent: this.screenComponent,
|
|
2675
2676
|
backdrop: this.backdrop,
|
|
2676
2677
|
isDestroyed: () => this.destroyed,
|
|
2677
|
-
isTopSheet: () => this.isTopSheet,
|
|
2678
2678
|
getAllowedIds: () => this.snaps.getAllowedIds().slice(),
|
|
2679
2679
|
getResolvedSnaps: () => this.snaps.getResolvedSnaps().slice(),
|
|
2680
2680
|
snapTo: (id) => {
|
|
@@ -2944,13 +2944,14 @@ var BottomSheetCore = class {
|
|
|
2944
2944
|
if (!_skipBeforeSnap && this.emitBeforeSnap(target, this.activeId)) {
|
|
2945
2945
|
return;
|
|
2946
2946
|
}
|
|
2947
|
+
const resumingOpen = this.opening;
|
|
2947
2948
|
const signal = this.newCycle();
|
|
2948
2949
|
const onExternalAbort = () => {
|
|
2949
2950
|
this.animation.cancel();
|
|
2950
2951
|
this.newCycle();
|
|
2951
2952
|
};
|
|
2952
2953
|
externalSignal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
2953
|
-
const wasClosed = this.size === 0;
|
|
2954
|
+
const wasClosed = this.size === 0 || resumingOpen;
|
|
2954
2955
|
const previousId = this.activeId;
|
|
2955
2956
|
const previousSize = this.size;
|
|
2956
2957
|
this.scrollCache.cache(previousId, previousSize, target.size);
|
|
@@ -2959,7 +2960,10 @@ var BottomSheetCore = class {
|
|
|
2959
2960
|
const opensToRest = id === "closed" || rawTargetSize === 0;
|
|
2960
2961
|
if (wasClosed && !opensToRest) {
|
|
2961
2962
|
this.opening = true;
|
|
2962
|
-
|
|
2963
|
+
if (!resumingOpen) {
|
|
2964
|
+
this.promotedForOpen = true;
|
|
2965
|
+
sheetStack.promote(this.id);
|
|
2966
|
+
}
|
|
2963
2967
|
}
|
|
2964
2968
|
if (this.animation.viewTransitionsAvailable) {
|
|
2965
2969
|
this.currentViewTransition?.skipTransition?.();
|
|
@@ -3400,19 +3404,12 @@ var BottomSheetCore = class {
|
|
|
3400
3404
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3401
3405
|
},
|
|
3402
3406
|
setIsTop: (isTop) => {
|
|
3403
|
-
if (this.isTopSheet === isTop) return;
|
|
3404
3407
|
this.isTopSheet = isTop;
|
|
3405
|
-
this.repaintScrim();
|
|
3406
3408
|
},
|
|
3407
3409
|
isOpen: () => this.size > 0 || this.opening,
|
|
3408
3410
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3409
3411
|
}));
|
|
3410
3412
|
}
|
|
3411
|
-
repaintScrim() {
|
|
3412
|
-
if (this.destroyed) return;
|
|
3413
|
-
this.scrim.invalidateOpacityCache();
|
|
3414
|
-
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3415
|
-
}
|
|
3416
3413
|
applyStackDepth(depth) {
|
|
3417
3414
|
if (!this.stackEffectEnabled) return;
|
|
3418
3415
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -3657,6 +3654,7 @@ var BottomSheetCore = class {
|
|
|
3657
3654
|
this.activeId = target.id;
|
|
3658
3655
|
if (previousSnapSize === 0 && target.size > 0) {
|
|
3659
3656
|
this.opening = true;
|
|
3657
|
+
this.promotedForOpen = true;
|
|
3660
3658
|
sheetStack.promote(this.id);
|
|
3661
3659
|
}
|
|
3662
3660
|
const settleCap = this.snaps.getMaxAxisSize();
|
|
@@ -3738,7 +3736,8 @@ var BottomSheetCore = class {
|
|
|
3738
3736
|
return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
|
|
3739
3737
|
}
|
|
3740
3738
|
handleOpen() {
|
|
3741
|
-
|
|
3739
|
+
if (this.promotedForOpen) this.promotedForOpen = false;
|
|
3740
|
+
else sheetStack.promote(this.id);
|
|
3742
3741
|
try {
|
|
3743
3742
|
this.lifecycle.install();
|
|
3744
3743
|
} catch (err) {
|
|
@@ -3770,6 +3769,7 @@ var BottomSheetCore = class {
|
|
|
3770
3769
|
}
|
|
3771
3770
|
handleClose() {
|
|
3772
3771
|
this.opening = false;
|
|
3772
|
+
this.promotedForOpen = false;
|
|
3773
3773
|
this.lifecycle.release();
|
|
3774
3774
|
sheetStack.update();
|
|
3775
3775
|
}
|
package/dist/react.cjs
CHANGED
|
@@ -784,7 +784,6 @@ var ScrimController = class {
|
|
|
784
784
|
__publicField(this, "backdrop");
|
|
785
785
|
__publicField(this, "mode");
|
|
786
786
|
__publicField(this, "isDestroyed");
|
|
787
|
-
__publicField(this, "isTopSheet");
|
|
788
787
|
__publicField(this, "getAllowedIds");
|
|
789
788
|
__publicField(this, "getResolvedSnaps");
|
|
790
789
|
__publicField(this, "snapToFn");
|
|
@@ -806,7 +805,6 @@ var ScrimController = class {
|
|
|
806
805
|
this.backdrop = deps.backdrop;
|
|
807
806
|
this.mode = deps.mode;
|
|
808
807
|
this.isDestroyed = deps.isDestroyed;
|
|
809
|
-
this.isTopSheet = deps.isTopSheet;
|
|
810
808
|
this.getAllowedIds = deps.getAllowedIds;
|
|
811
809
|
this.getResolvedSnaps = deps.getResolvedSnaps;
|
|
812
810
|
this.snapToFn = deps.snapTo;
|
|
@@ -851,8 +849,10 @@ var ScrimController = class {
|
|
|
851
849
|
if (this.backdrop) {
|
|
852
850
|
const [s, e] = this.backdropRange;
|
|
853
851
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
854
|
-
const
|
|
855
|
-
|
|
852
|
+
const backdropOpacity = Math.min(
|
|
853
|
+
Math.max((progress - s) / range, 0),
|
|
854
|
+
1
|
|
855
|
+
);
|
|
856
856
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
857
857
|
backdropOpacity,
|
|
858
858
|
OPACITY_WRITE_EPSILON
|
|
@@ -2627,6 +2627,7 @@ var BottomSheetCore = class {
|
|
|
2627
2627
|
__publicField(this, "progressWriteSentinel", new WriteSentinel());
|
|
2628
2628
|
__publicField(this, "isTopSheet", true);
|
|
2629
2629
|
__publicField(this, "opening", false);
|
|
2630
|
+
__publicField(this, "promotedForOpen", false);
|
|
2630
2631
|
__publicField(this, "allowOvershoot", false);
|
|
2631
2632
|
__publicField(this, "progressPayload", {
|
|
2632
2633
|
value: 0,
|
|
@@ -2683,7 +2684,6 @@ var BottomSheetCore = class {
|
|
|
2683
2684
|
screenComponent: this.screenComponent,
|
|
2684
2685
|
backdrop: this.backdrop,
|
|
2685
2686
|
isDestroyed: () => this.destroyed,
|
|
2686
|
-
isTopSheet: () => this.isTopSheet,
|
|
2687
2687
|
getAllowedIds: () => this.snaps.getAllowedIds().slice(),
|
|
2688
2688
|
getResolvedSnaps: () => this.snaps.getResolvedSnaps().slice(),
|
|
2689
2689
|
snapTo: (id) => {
|
|
@@ -2953,13 +2953,14 @@ var BottomSheetCore = class {
|
|
|
2953
2953
|
if (!_skipBeforeSnap && this.emitBeforeSnap(target, this.activeId)) {
|
|
2954
2954
|
return;
|
|
2955
2955
|
}
|
|
2956
|
+
const resumingOpen = this.opening;
|
|
2956
2957
|
const signal = this.newCycle();
|
|
2957
2958
|
const onExternalAbort = () => {
|
|
2958
2959
|
this.animation.cancel();
|
|
2959
2960
|
this.newCycle();
|
|
2960
2961
|
};
|
|
2961
2962
|
externalSignal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
2962
|
-
const wasClosed = this.size === 0;
|
|
2963
|
+
const wasClosed = this.size === 0 || resumingOpen;
|
|
2963
2964
|
const previousId = this.activeId;
|
|
2964
2965
|
const previousSize = this.size;
|
|
2965
2966
|
this.scrollCache.cache(previousId, previousSize, target.size);
|
|
@@ -2968,7 +2969,10 @@ var BottomSheetCore = class {
|
|
|
2968
2969
|
const opensToRest = id === "closed" || rawTargetSize === 0;
|
|
2969
2970
|
if (wasClosed && !opensToRest) {
|
|
2970
2971
|
this.opening = true;
|
|
2971
|
-
|
|
2972
|
+
if (!resumingOpen) {
|
|
2973
|
+
this.promotedForOpen = true;
|
|
2974
|
+
sheetStack.promote(this.id);
|
|
2975
|
+
}
|
|
2972
2976
|
}
|
|
2973
2977
|
if (this.animation.viewTransitionsAvailable) {
|
|
2974
2978
|
this.currentViewTransition?.skipTransition?.();
|
|
@@ -3409,19 +3413,12 @@ var BottomSheetCore = class {
|
|
|
3409
3413
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3410
3414
|
},
|
|
3411
3415
|
setIsTop: (isTop) => {
|
|
3412
|
-
if (this.isTopSheet === isTop) return;
|
|
3413
3416
|
this.isTopSheet = isTop;
|
|
3414
|
-
this.repaintScrim();
|
|
3415
3417
|
},
|
|
3416
3418
|
isOpen: () => this.size > 0 || this.opening,
|
|
3417
3419
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3418
3420
|
}));
|
|
3419
3421
|
}
|
|
3420
|
-
repaintScrim() {
|
|
3421
|
-
if (this.destroyed) return;
|
|
3422
|
-
this.scrim.invalidateOpacityCache();
|
|
3423
|
-
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3424
|
-
}
|
|
3425
3422
|
applyStackDepth(depth) {
|
|
3426
3423
|
if (!this.stackEffectEnabled) return;
|
|
3427
3424
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -3666,6 +3663,7 @@ var BottomSheetCore = class {
|
|
|
3666
3663
|
this.activeId = target.id;
|
|
3667
3664
|
if (previousSnapSize === 0 && target.size > 0) {
|
|
3668
3665
|
this.opening = true;
|
|
3666
|
+
this.promotedForOpen = true;
|
|
3669
3667
|
sheetStack.promote(this.id);
|
|
3670
3668
|
}
|
|
3671
3669
|
const settleCap = this.snaps.getMaxAxisSize();
|
|
@@ -3747,7 +3745,8 @@ var BottomSheetCore = class {
|
|
|
3747
3745
|
return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
|
|
3748
3746
|
}
|
|
3749
3747
|
handleOpen() {
|
|
3750
|
-
|
|
3748
|
+
if (this.promotedForOpen) this.promotedForOpen = false;
|
|
3749
|
+
else sheetStack.promote(this.id);
|
|
3751
3750
|
try {
|
|
3752
3751
|
this.lifecycle.install();
|
|
3753
3752
|
} catch (err) {
|
|
@@ -3779,6 +3778,7 @@ var BottomSheetCore = class {
|
|
|
3779
3778
|
}
|
|
3780
3779
|
handleClose() {
|
|
3781
3780
|
this.opening = false;
|
|
3781
|
+
this.promotedForOpen = false;
|
|
3782
3782
|
this.lifecycle.release();
|
|
3783
3783
|
sheetStack.update();
|
|
3784
3784
|
}
|
package/dist/react.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as EngineOptions, E as EngineState, A as AnchorOptions, e as ScrimStagesOptions, u as ScrimStageDef, S as SheetEventMap, C as CloseReason, v as ScrimUpdate, r as ScrimOverlayOptions, a as SnapPointDef, b as SheetMode } from './BottomSheetCore-
|
|
2
|
-
export { d as SnapPoint } from './BottomSheetCore-
|
|
1
|
+
import { c as EngineOptions, E as EngineState, A as AnchorOptions, e as ScrimStagesOptions, u as ScrimStageDef, S as SheetEventMap, C as CloseReason, v as ScrimUpdate, r as ScrimOverlayOptions, a as SnapPointDef, b as SheetMode } from './BottomSheetCore-BHv6LPmS.cjs';
|
|
2
|
+
export { d as SnapPoint } from './BottomSheetCore-BHv6LPmS.cjs';
|
|
3
3
|
import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.cjs';
|
|
4
4
|
export { OverlayEdge } from './overlay.cjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { CSSProperties, ReactNode } from 'react';
|
|
7
|
-
import { B as BottomSheetEngine } from './BottomSheetEngine-
|
|
7
|
+
import { B as BottomSheetEngine } from './BottomSheetEngine-mmFzIK1Z.cjs';
|
|
8
8
|
import { T as TeleportTarget } from './teleport-7uYNiEAT.cjs';
|
|
9
9
|
import './transform-jVfAikE9.cjs';
|
|
10
10
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as EngineOptions, E as EngineState, A as AnchorOptions, e as ScrimStagesOptions, u as ScrimStageDef, S as SheetEventMap, C as CloseReason, v as ScrimUpdate, r as ScrimOverlayOptions, a as SnapPointDef, b as SheetMode } from './BottomSheetCore-
|
|
2
|
-
export { d as SnapPoint } from './BottomSheetCore-
|
|
1
|
+
import { c as EngineOptions, E as EngineState, A as AnchorOptions, e as ScrimStagesOptions, u as ScrimStageDef, S as SheetEventMap, C as CloseReason, v as ScrimUpdate, r as ScrimOverlayOptions, a as SnapPointDef, b as SheetMode } from './BottomSheetCore-CK_mq14p.js';
|
|
2
|
+
export { d as SnapPoint } from './BottomSheetCore-CK_mq14p.js';
|
|
3
3
|
import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.js';
|
|
4
4
|
export { OverlayEdge } from './overlay.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { CSSProperties, ReactNode } from 'react';
|
|
7
|
-
import { B as BottomSheetEngine } from './BottomSheetEngine-
|
|
7
|
+
import { B as BottomSheetEngine } from './BottomSheetEngine-wLn6Q2kA.js';
|
|
8
8
|
import { T as TeleportTarget } from './teleport-7uYNiEAT.js';
|
|
9
9
|
import './transform-jVfAikE9.js';
|
|
10
10
|
|
package/dist/react.js
CHANGED
|
@@ -782,7 +782,6 @@ var ScrimController = class {
|
|
|
782
782
|
__publicField(this, "backdrop");
|
|
783
783
|
__publicField(this, "mode");
|
|
784
784
|
__publicField(this, "isDestroyed");
|
|
785
|
-
__publicField(this, "isTopSheet");
|
|
786
785
|
__publicField(this, "getAllowedIds");
|
|
787
786
|
__publicField(this, "getResolvedSnaps");
|
|
788
787
|
__publicField(this, "snapToFn");
|
|
@@ -804,7 +803,6 @@ var ScrimController = class {
|
|
|
804
803
|
this.backdrop = deps.backdrop;
|
|
805
804
|
this.mode = deps.mode;
|
|
806
805
|
this.isDestroyed = deps.isDestroyed;
|
|
807
|
-
this.isTopSheet = deps.isTopSheet;
|
|
808
806
|
this.getAllowedIds = deps.getAllowedIds;
|
|
809
807
|
this.getResolvedSnaps = deps.getResolvedSnaps;
|
|
810
808
|
this.snapToFn = deps.snapTo;
|
|
@@ -849,8 +847,10 @@ var ScrimController = class {
|
|
|
849
847
|
if (this.backdrop) {
|
|
850
848
|
const [s, e] = this.backdropRange;
|
|
851
849
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
852
|
-
const
|
|
853
|
-
|
|
850
|
+
const backdropOpacity = Math.min(
|
|
851
|
+
Math.max((progress - s) / range, 0),
|
|
852
|
+
1
|
|
853
|
+
);
|
|
854
854
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
855
855
|
backdropOpacity,
|
|
856
856
|
OPACITY_WRITE_EPSILON
|
|
@@ -2625,6 +2625,7 @@ var BottomSheetCore = class {
|
|
|
2625
2625
|
__publicField(this, "progressWriteSentinel", new WriteSentinel());
|
|
2626
2626
|
__publicField(this, "isTopSheet", true);
|
|
2627
2627
|
__publicField(this, "opening", false);
|
|
2628
|
+
__publicField(this, "promotedForOpen", false);
|
|
2628
2629
|
__publicField(this, "allowOvershoot", false);
|
|
2629
2630
|
__publicField(this, "progressPayload", {
|
|
2630
2631
|
value: 0,
|
|
@@ -2681,7 +2682,6 @@ var BottomSheetCore = class {
|
|
|
2681
2682
|
screenComponent: this.screenComponent,
|
|
2682
2683
|
backdrop: this.backdrop,
|
|
2683
2684
|
isDestroyed: () => this.destroyed,
|
|
2684
|
-
isTopSheet: () => this.isTopSheet,
|
|
2685
2685
|
getAllowedIds: () => this.snaps.getAllowedIds().slice(),
|
|
2686
2686
|
getResolvedSnaps: () => this.snaps.getResolvedSnaps().slice(),
|
|
2687
2687
|
snapTo: (id) => {
|
|
@@ -2951,13 +2951,14 @@ var BottomSheetCore = class {
|
|
|
2951
2951
|
if (!_skipBeforeSnap && this.emitBeforeSnap(target, this.activeId)) {
|
|
2952
2952
|
return;
|
|
2953
2953
|
}
|
|
2954
|
+
const resumingOpen = this.opening;
|
|
2954
2955
|
const signal = this.newCycle();
|
|
2955
2956
|
const onExternalAbort = () => {
|
|
2956
2957
|
this.animation.cancel();
|
|
2957
2958
|
this.newCycle();
|
|
2958
2959
|
};
|
|
2959
2960
|
externalSignal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
2960
|
-
const wasClosed = this.size === 0;
|
|
2961
|
+
const wasClosed = this.size === 0 || resumingOpen;
|
|
2961
2962
|
const previousId = this.activeId;
|
|
2962
2963
|
const previousSize = this.size;
|
|
2963
2964
|
this.scrollCache.cache(previousId, previousSize, target.size);
|
|
@@ -2966,7 +2967,10 @@ var BottomSheetCore = class {
|
|
|
2966
2967
|
const opensToRest = id === "closed" || rawTargetSize === 0;
|
|
2967
2968
|
if (wasClosed && !opensToRest) {
|
|
2968
2969
|
this.opening = true;
|
|
2969
|
-
|
|
2970
|
+
if (!resumingOpen) {
|
|
2971
|
+
this.promotedForOpen = true;
|
|
2972
|
+
sheetStack.promote(this.id);
|
|
2973
|
+
}
|
|
2970
2974
|
}
|
|
2971
2975
|
if (this.animation.viewTransitionsAvailable) {
|
|
2972
2976
|
this.currentViewTransition?.skipTransition?.();
|
|
@@ -3407,19 +3411,12 @@ var BottomSheetCore = class {
|
|
|
3407
3411
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3408
3412
|
},
|
|
3409
3413
|
setIsTop: (isTop) => {
|
|
3410
|
-
if (this.isTopSheet === isTop) return;
|
|
3411
3414
|
this.isTopSheet = isTop;
|
|
3412
|
-
this.repaintScrim();
|
|
3413
3415
|
},
|
|
3414
3416
|
isOpen: () => this.size > 0 || this.opening,
|
|
3415
3417
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3416
3418
|
}));
|
|
3417
3419
|
}
|
|
3418
|
-
repaintScrim() {
|
|
3419
|
-
if (this.destroyed) return;
|
|
3420
|
-
this.scrim.invalidateOpacityCache();
|
|
3421
|
-
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3422
|
-
}
|
|
3423
3420
|
applyStackDepth(depth) {
|
|
3424
3421
|
if (!this.stackEffectEnabled) return;
|
|
3425
3422
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -3664,6 +3661,7 @@ var BottomSheetCore = class {
|
|
|
3664
3661
|
this.activeId = target.id;
|
|
3665
3662
|
if (previousSnapSize === 0 && target.size > 0) {
|
|
3666
3663
|
this.opening = true;
|
|
3664
|
+
this.promotedForOpen = true;
|
|
3667
3665
|
sheetStack.promote(this.id);
|
|
3668
3666
|
}
|
|
3669
3667
|
const settleCap = this.snaps.getMaxAxisSize();
|
|
@@ -3745,7 +3743,8 @@ var BottomSheetCore = class {
|
|
|
3745
3743
|
return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
|
|
3746
3744
|
}
|
|
3747
3745
|
handleOpen() {
|
|
3748
|
-
|
|
3746
|
+
if (this.promotedForOpen) this.promotedForOpen = false;
|
|
3747
|
+
else sheetStack.promote(this.id);
|
|
3749
3748
|
try {
|
|
3750
3749
|
this.lifecycle.install();
|
|
3751
3750
|
} catch (err) {
|
|
@@ -3777,6 +3776,7 @@ var BottomSheetCore = class {
|
|
|
3777
3776
|
}
|
|
3778
3777
|
handleClose() {
|
|
3779
3778
|
this.opening = false;
|
|
3779
|
+
this.promotedForOpen = false;
|
|
3780
3780
|
this.lifecycle.release();
|
|
3781
3781
|
sheetStack.update();
|
|
3782
3782
|
}
|