@surdeddd/bottom-sheet 0.20.1 → 0.21.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.
- package/README.md +1 -1
- package/dist/{BottomSheetCore-Cgn8b_6A.d.ts → BottomSheetCore-CIijwtdi.d.ts} +1 -0
- package/dist/{BottomSheetCore-VPJZcKcg.d.cts → BottomSheetCore-CK8Rh1He.d.cts} +1 -0
- package/dist/{BottomSheetEngine-DwYR_ygJ.d.ts → BottomSheetEngine-CZglPsTF.d.ts} +1 -1
- package/dist/{BottomSheetEngine-B8C2CwF9.d.cts → BottomSheetEngine-hLSAxzla.d.cts} +1 -1
- package/dist/core.cjs +22 -14
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +22 -14
- package/dist/debug.d.cts +1 -1
- package/dist/debug.d.ts +1 -1
- package/dist/element.cjs +26 -14
- package/dist/element.d.cts +2 -2
- package/dist/element.d.ts +2 -2
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +26 -14
- package/dist/features.d.cts +2 -2
- package/dist/features.d.ts +2 -2
- package/dist/{index-CnfbOKx0.d.cts → index-BEX-NHRJ.d.cts} +1 -1
- package/dist/{index-DcMkhXAy.d.ts → index-BqLHKOeM.d.ts} +1 -1
- package/dist/index.cjs +22 -14
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +22 -14
- 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 +28 -11
- package/dist/qwik-lib/index.qwik.mjs +28 -11
- package/dist/qwik.cjs +28 -14
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +28 -14
- package/dist/react.cjs +27 -14
- package/dist/react.d.cts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +27 -14
- package/dist/solid.cjs +28 -14
- package/dist/solid.d.cts +1 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +28 -14
- package/dist/solid.source.jsx +32 -14
- package/dist/styles.d.ts +1 -0
- package/dist/svelte-core.cjs +22 -14
- package/dist/svelte-core.js +22 -14
- package/dist/svelte-src/BottomSheet.svelte +3 -0
- package/dist/svelte.cjs +25 -14
- package/dist/svelte.js +25 -14
- package/dist/themes/ios.d.ts +1 -0
- package/dist/themes/material.d.ts +1 -0
- package/dist/themes/vercel.d.ts +1 -0
- package/dist/vue.cjs +27 -15
- package/dist/vue.d.cts +6 -1
- package/dist/vue.d.ts +6 -1
- package/dist/vue.js +27 -15
- package/dist/webgl.d.cts +1 -1
- package/dist/webgl.d.ts +1 -1
- package/package.json +36 -12
package/dist/element.js
CHANGED
|
@@ -947,13 +947,11 @@ var init_scrim_controller = __esm({
|
|
|
947
947
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
if (this.backdrop
|
|
950
|
+
if (this.backdrop) {
|
|
951
951
|
const [s, e] = this.backdropRange;
|
|
952
952
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
1
|
|
956
|
-
);
|
|
953
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
954
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
957
955
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
958
956
|
backdropOpacity,
|
|
959
957
|
OPACITY_WRITE_EPSILON
|
|
@@ -1524,18 +1522,20 @@ var init_animation_runner = __esm({
|
|
|
1524
1522
|
get isAnimating() {
|
|
1525
1523
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1526
1524
|
}
|
|
1525
|
+
cancelWaapi() {
|
|
1526
|
+
if (!this.currentWaapi) return;
|
|
1527
|
+
const entry = this.currentWaapi;
|
|
1528
|
+
this.currentWaapi = null;
|
|
1529
|
+
entry.stop();
|
|
1530
|
+
try {
|
|
1531
|
+
entry.anim.cancel();
|
|
1532
|
+
} catch {
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1527
1535
|
cancel() {
|
|
1528
1536
|
this.currentTween?.cancel();
|
|
1529
1537
|
this.currentSpring?.cancel();
|
|
1530
|
-
|
|
1531
|
-
const entry = this.currentWaapi;
|
|
1532
|
-
this.currentWaapi = null;
|
|
1533
|
-
entry.stop();
|
|
1534
|
-
try {
|
|
1535
|
-
entry.anim.cancel();
|
|
1536
|
-
} catch {
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1538
|
+
this.cancelWaapi();
|
|
1539
1539
|
}
|
|
1540
1540
|
async animateTo(target, velocityPxPerMs) {
|
|
1541
1541
|
if (target === this.getSize()) {
|
|
@@ -1546,6 +1546,7 @@ var init_animation_runner = __esm({
|
|
|
1546
1546
|
}
|
|
1547
1547
|
this.currentTween?.cancel();
|
|
1548
1548
|
this.currentSpring?.cancel();
|
|
1549
|
+
this.cancelWaapi();
|
|
1549
1550
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1550
1551
|
this.element.style.willChange = "transform";
|
|
1551
1552
|
if (this.reducedMotion) {
|
|
@@ -3674,12 +3675,19 @@ var init_BottomSheetCore = __esm({
|
|
|
3674
3675
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3675
3676
|
},
|
|
3676
3677
|
setIsTop: (isTop) => {
|
|
3678
|
+
if (this.isTopSheet === isTop) return;
|
|
3677
3679
|
this.isTopSheet = isTop;
|
|
3680
|
+
this.repaintScrim();
|
|
3678
3681
|
},
|
|
3679
3682
|
isOpen: () => this.size > 0 || this.opening,
|
|
3680
3683
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3681
3684
|
}));
|
|
3682
3685
|
}
|
|
3686
|
+
repaintScrim() {
|
|
3687
|
+
if (this.destroyed) return;
|
|
3688
|
+
this.scrim.invalidateOpacityCache();
|
|
3689
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3690
|
+
}
|
|
3683
3691
|
applyStackDepth(depth) {
|
|
3684
3692
|
if (!this.stackEffectEnabled) return;
|
|
3685
3693
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -4686,6 +4694,7 @@ var init_attributes = __esm({
|
|
|
4686
4694
|
ATTR_SCRIM_COLOR = "scrim-color";
|
|
4687
4695
|
ATTR_SNAP = "snap";
|
|
4688
4696
|
LIVE_ATTRS = /* @__PURE__ */ new Set([
|
|
4697
|
+
ATTR_MODE,
|
|
4689
4698
|
ATTR_RADIUS,
|
|
4690
4699
|
ATTR_MAX_HEIGHT,
|
|
4691
4700
|
ATTR_BACKDROP_COLOR,
|
|
@@ -4912,6 +4921,9 @@ var init_BottomSheetElement = __esm({
|
|
|
4912
4921
|
if (mode) this.engine.setDragFrom(mode);
|
|
4913
4922
|
break;
|
|
4914
4923
|
}
|
|
4924
|
+
case ATTR_MODE:
|
|
4925
|
+
this.engine.setMode(parseMode(value));
|
|
4926
|
+
break;
|
|
4915
4927
|
case ATTR_SNAP:
|
|
4916
4928
|
if (value && value !== this.engine.state.activeId) {
|
|
4917
4929
|
void this.engine.snapTo(value);
|
package/dist/features.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as EngineFeature } from './BottomSheetCore-
|
|
2
|
-
export { m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage } from './BottomSheetCore-
|
|
1
|
+
import { f as EngineFeature } from './BottomSheetCore-CK8Rh1He.cjs';
|
|
2
|
+
export { m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage } from './BottomSheetCore-CK8Rh1He.cjs';
|
|
3
3
|
import './transform-jVfAikE9.cjs';
|
|
4
4
|
|
|
5
5
|
declare function routeFeature(): EngineFeature;
|
package/dist/features.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as EngineFeature } from './BottomSheetCore-
|
|
2
|
-
export { m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage } from './BottomSheetCore-
|
|
1
|
+
import { f as EngineFeature } from './BottomSheetCore-CIijwtdi.js';
|
|
2
|
+
export { m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage } from './BottomSheetCore-CIijwtdi.js';
|
|
3
3
|
import './transform-jVfAikE9.js';
|
|
4
4
|
|
|
5
5
|
declare function routeFeature(): EngineFeature;
|
package/dist/index.cjs
CHANGED
|
@@ -838,13 +838,11 @@ var ScrimController = class {
|
|
|
838
838
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
|
-
if (this.backdrop
|
|
841
|
+
if (this.backdrop) {
|
|
842
842
|
const [s, e] = this.backdropRange;
|
|
843
843
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
1
|
|
847
|
-
);
|
|
844
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
845
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
848
846
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
849
847
|
backdropOpacity,
|
|
850
848
|
OPACITY_WRITE_EPSILON
|
|
@@ -1384,18 +1382,20 @@ var AnimationRunner = class {
|
|
|
1384
1382
|
get isAnimating() {
|
|
1385
1383
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1386
1384
|
}
|
|
1385
|
+
cancelWaapi() {
|
|
1386
|
+
if (!this.currentWaapi) return;
|
|
1387
|
+
const entry = this.currentWaapi;
|
|
1388
|
+
this.currentWaapi = null;
|
|
1389
|
+
entry.stop();
|
|
1390
|
+
try {
|
|
1391
|
+
entry.anim.cancel();
|
|
1392
|
+
} catch {
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1387
1395
|
cancel() {
|
|
1388
1396
|
this.currentTween?.cancel();
|
|
1389
1397
|
this.currentSpring?.cancel();
|
|
1390
|
-
|
|
1391
|
-
const entry = this.currentWaapi;
|
|
1392
|
-
this.currentWaapi = null;
|
|
1393
|
-
entry.stop();
|
|
1394
|
-
try {
|
|
1395
|
-
entry.anim.cancel();
|
|
1396
|
-
} catch {
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1398
|
+
this.cancelWaapi();
|
|
1399
1399
|
}
|
|
1400
1400
|
async animateTo(target, velocityPxPerMs) {
|
|
1401
1401
|
if (target === this.getSize()) {
|
|
@@ -1406,6 +1406,7 @@ var AnimationRunner = class {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
this.currentTween?.cancel();
|
|
1408
1408
|
this.currentSpring?.cancel();
|
|
1409
|
+
this.cancelWaapi();
|
|
1409
1410
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1410
1411
|
this.element.style.willChange = "transform";
|
|
1411
1412
|
if (this.reducedMotion) {
|
|
@@ -3398,12 +3399,19 @@ var BottomSheetCore = class {
|
|
|
3398
3399
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3399
3400
|
},
|
|
3400
3401
|
setIsTop: (isTop) => {
|
|
3402
|
+
if (this.isTopSheet === isTop) return;
|
|
3401
3403
|
this.isTopSheet = isTop;
|
|
3404
|
+
this.repaintScrim();
|
|
3402
3405
|
},
|
|
3403
3406
|
isOpen: () => this.size > 0 || this.opening,
|
|
3404
3407
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3405
3408
|
}));
|
|
3406
3409
|
}
|
|
3410
|
+
repaintScrim() {
|
|
3411
|
+
if (this.destroyed) return;
|
|
3412
|
+
this.scrim.invalidateOpacityCache();
|
|
3413
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3414
|
+
}
|
|
3407
3415
|
applyStackDepth(depth) {
|
|
3408
3416
|
if (!this.stackEffectEnabled) return;
|
|
3409
3417
|
this.element.setAttribute("data-stack-depth", String(depth));
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { B as BottomSheetEngine } from './BottomSheetEngine-
|
|
2
|
-
import { d as SnapPoint, b as SheetMode, c as EngineOptions, P as PhysicalSheetMode, g as ScrimOverlayPosition } from './BottomSheetCore-
|
|
3
|
-
export { h as AnchorAnimationPreset, i as AnchorAnimationSpec, j as AnchorHandle, A as AnchorOptions, k as AnchorPosition, l as AnchorState, B as BottomSheetCore, C as CloseReason, f as EngineFeature, m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage, E as EngineState, L as LogicalSheetMode, p as Plugin, q as SCRIM_PRESETS, r as ScrimOverlayOptions, s as ScrimPreset, t as ScrimPresetConfig, u as ScrimStageDef, e as ScrimStagesOptions, v as ScrimUpdate, S as SheetEventMap, w as SnapId, a as SnapPointDef, T as TeardownScope, x as runAnchorTransition } from './BottomSheetCore-
|
|
1
|
+
export { B as BottomSheetEngine } from './BottomSheetEngine-hLSAxzla.cjs';
|
|
2
|
+
import { d as SnapPoint, b as SheetMode, c as EngineOptions, P as PhysicalSheetMode, g as ScrimOverlayPosition } from './BottomSheetCore-CK8Rh1He.cjs';
|
|
3
|
+
export { h as AnchorAnimationPreset, i as AnchorAnimationSpec, j as AnchorHandle, A as AnchorOptions, k as AnchorPosition, l as AnchorState, B as BottomSheetCore, C as CloseReason, f as EngineFeature, m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage, E as EngineState, L as LogicalSheetMode, p as Plugin, q as SCRIM_PRESETS, r as ScrimOverlayOptions, s as ScrimPreset, t as ScrimPresetConfig, u as ScrimStageDef, e as ScrimStagesOptions, v as ScrimUpdate, S as SheetEventMap, w as SnapId, a as SnapPointDef, T as TeardownScope, x as runAnchorTransition } from './BottomSheetCore-CK8Rh1He.cjs';
|
|
4
4
|
export { autoCollapseFeature, contentSwipeFeature, defaultEngineFeatures, persistFeature, routeFeature, visualViewportFeature } from './features.cjs';
|
|
5
|
-
export { R as ResolvedSnap, r as resolveSnapList } from './index-
|
|
5
|
+
export { R as ResolvedSnap, r as resolveSnapList } from './index-BEX-NHRJ.cjs';
|
|
6
6
|
import './transform-jVfAikE9.cjs';
|
|
7
7
|
|
|
8
8
|
declare const resolveSnap: (point: SnapPoint | string, mode: SheetMode, measureFit?: () => number) => number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { B as BottomSheetEngine } from './BottomSheetEngine-
|
|
2
|
-
import { d as SnapPoint, b as SheetMode, c as EngineOptions, P as PhysicalSheetMode, g as ScrimOverlayPosition } from './BottomSheetCore-
|
|
3
|
-
export { h as AnchorAnimationPreset, i as AnchorAnimationSpec, j as AnchorHandle, A as AnchorOptions, k as AnchorPosition, l as AnchorState, B as BottomSheetCore, C as CloseReason, f as EngineFeature, m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage, E as EngineState, L as LogicalSheetMode, p as Plugin, q as SCRIM_PRESETS, r as ScrimOverlayOptions, s as ScrimPreset, t as ScrimPresetConfig, u as ScrimStageDef, e as ScrimStagesOptions, v as ScrimUpdate, S as SheetEventMap, w as SnapId, a as SnapPointDef, T as TeardownScope, x as runAnchorTransition } from './BottomSheetCore-
|
|
1
|
+
export { B as BottomSheetEngine } from './BottomSheetEngine-CZglPsTF.js';
|
|
2
|
+
import { d as SnapPoint, b as SheetMode, c as EngineOptions, P as PhysicalSheetMode, g as ScrimOverlayPosition } from './BottomSheetCore-CIijwtdi.js';
|
|
3
|
+
export { h as AnchorAnimationPreset, i as AnchorAnimationSpec, j as AnchorHandle, A as AnchorOptions, k as AnchorPosition, l as AnchorState, B as BottomSheetCore, C as CloseReason, f as EngineFeature, m as EngineFeatureContext, n as EngineFeatureOptions, o as EngineFeatureStage, E as EngineState, L as LogicalSheetMode, p as Plugin, q as SCRIM_PRESETS, r as ScrimOverlayOptions, s as ScrimPreset, t as ScrimPresetConfig, u as ScrimStageDef, e as ScrimStagesOptions, v as ScrimUpdate, S as SheetEventMap, w as SnapId, a as SnapPointDef, T as TeardownScope, x as runAnchorTransition } from './BottomSheetCore-CIijwtdi.js';
|
|
4
4
|
export { autoCollapseFeature, contentSwipeFeature, defaultEngineFeatures, persistFeature, routeFeature, visualViewportFeature } from './features.js';
|
|
5
|
-
export { R as ResolvedSnap, r as resolveSnapList } from './index-
|
|
5
|
+
export { R as ResolvedSnap, r as resolveSnapList } from './index-BqLHKOeM.js';
|
|
6
6
|
import './transform-jVfAikE9.js';
|
|
7
7
|
|
|
8
8
|
declare const resolveSnap: (point: SnapPoint | string, mode: SheetMode, measureFit?: () => number) => number;
|
package/dist/index.js
CHANGED
|
@@ -836,13 +836,11 @@ var ScrimController = class {
|
|
|
836
836
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
837
837
|
return;
|
|
838
838
|
}
|
|
839
|
-
if (this.backdrop
|
|
839
|
+
if (this.backdrop) {
|
|
840
840
|
const [s, e] = this.backdropRange;
|
|
841
841
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
1
|
|
845
|
-
);
|
|
842
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
843
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
846
844
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
847
845
|
backdropOpacity,
|
|
848
846
|
OPACITY_WRITE_EPSILON
|
|
@@ -1382,18 +1380,20 @@ var AnimationRunner = class {
|
|
|
1382
1380
|
get isAnimating() {
|
|
1383
1381
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1384
1382
|
}
|
|
1383
|
+
cancelWaapi() {
|
|
1384
|
+
if (!this.currentWaapi) return;
|
|
1385
|
+
const entry = this.currentWaapi;
|
|
1386
|
+
this.currentWaapi = null;
|
|
1387
|
+
entry.stop();
|
|
1388
|
+
try {
|
|
1389
|
+
entry.anim.cancel();
|
|
1390
|
+
} catch {
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1385
1393
|
cancel() {
|
|
1386
1394
|
this.currentTween?.cancel();
|
|
1387
1395
|
this.currentSpring?.cancel();
|
|
1388
|
-
|
|
1389
|
-
const entry = this.currentWaapi;
|
|
1390
|
-
this.currentWaapi = null;
|
|
1391
|
-
entry.stop();
|
|
1392
|
-
try {
|
|
1393
|
-
entry.anim.cancel();
|
|
1394
|
-
} catch {
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1396
|
+
this.cancelWaapi();
|
|
1397
1397
|
}
|
|
1398
1398
|
async animateTo(target, velocityPxPerMs) {
|
|
1399
1399
|
if (target === this.getSize()) {
|
|
@@ -1404,6 +1404,7 @@ var AnimationRunner = class {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
this.currentTween?.cancel();
|
|
1406
1406
|
this.currentSpring?.cancel();
|
|
1407
|
+
this.cancelWaapi();
|
|
1407
1408
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1408
1409
|
this.element.style.willChange = "transform";
|
|
1409
1410
|
if (this.reducedMotion) {
|
|
@@ -3396,12 +3397,19 @@ var BottomSheetCore = class {
|
|
|
3396
3397
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3397
3398
|
},
|
|
3398
3399
|
setIsTop: (isTop) => {
|
|
3400
|
+
if (this.isTopSheet === isTop) return;
|
|
3399
3401
|
this.isTopSheet = isTop;
|
|
3402
|
+
this.repaintScrim();
|
|
3400
3403
|
},
|
|
3401
3404
|
isOpen: () => this.size > 0 || this.opening,
|
|
3402
3405
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3403
3406
|
}));
|
|
3404
3407
|
}
|
|
3408
|
+
repaintScrim() {
|
|
3409
|
+
if (this.destroyed) return;
|
|
3410
|
+
this.scrim.invalidateOpacityCache();
|
|
3411
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3412
|
+
}
|
|
3405
3413
|
applyStackDepth(depth) {
|
|
3406
3414
|
if (!this.stackEffectEnabled) return;
|
|
3407
3415
|
this.element.setAttribute("data-stack-depth", String(depth));
|
package/dist/preact.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BottomSheet, BottomSheetFromConfig, BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, Overlay, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn, useBottomSheet, useOverlay } from './react.cjs';
|
|
2
|
-
export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetCore-
|
|
2
|
+
export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetCore-CK8Rh1He.cjs';
|
|
3
3
|
export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.cjs';
|
|
4
4
|
import 'react';
|
|
5
|
-
import './BottomSheetEngine-
|
|
5
|
+
import './BottomSheetEngine-hLSAxzla.cjs';
|
|
6
6
|
import './teleport-7uYNiEAT.cjs';
|
|
7
7
|
import './transform-jVfAikE9.cjs';
|
package/dist/preact.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BottomSheet, BottomSheetFromConfig, BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, Overlay, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn, useBottomSheet, useOverlay } from './react.js';
|
|
2
|
-
export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetCore-
|
|
2
|
+
export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetCore-CIijwtdi.js';
|
|
3
3
|
export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.js';
|
|
4
4
|
import 'react';
|
|
5
|
-
import './BottomSheetEngine-
|
|
5
|
+
import './BottomSheetEngine-CZglPsTF.js';
|
|
6
6
|
import './teleport-7uYNiEAT.js';
|
|
7
7
|
import './transform-jVfAikE9.js';
|
|
@@ -853,10 +853,11 @@ class ScrimController {
|
|
|
853
853
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
854
854
|
return;
|
|
855
855
|
}
|
|
856
|
-
if (this.backdrop
|
|
856
|
+
if (this.backdrop) {
|
|
857
857
|
const [s, e] = this.backdropRange;
|
|
858
858
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
859
|
-
const
|
|
859
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
860
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
860
861
|
if (this.backdropOpacitySentinel.shouldWrite(backdropOpacity, OPACITY_WRITE_EPSILON)) {
|
|
861
862
|
this.backdrop.style.opacity = String(backdropOpacity);
|
|
862
863
|
}
|
|
@@ -1408,18 +1409,20 @@ class AnimationRunner {
|
|
|
1408
1409
|
get isAnimating() {
|
|
1409
1410
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1410
1411
|
}
|
|
1412
|
+
cancelWaapi() {
|
|
1413
|
+
if (!this.currentWaapi) return;
|
|
1414
|
+
const entry = this.currentWaapi;
|
|
1415
|
+
this.currentWaapi = null;
|
|
1416
|
+
entry.stop();
|
|
1417
|
+
try {
|
|
1418
|
+
entry.anim.cancel();
|
|
1419
|
+
} catch {
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1411
1422
|
cancel() {
|
|
1412
1423
|
this.currentTween?.cancel();
|
|
1413
1424
|
this.currentSpring?.cancel();
|
|
1414
|
-
|
|
1415
|
-
const entry = this.currentWaapi;
|
|
1416
|
-
this.currentWaapi = null;
|
|
1417
|
-
entry.stop();
|
|
1418
|
-
try {
|
|
1419
|
-
entry.anim.cancel();
|
|
1420
|
-
} catch {
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1425
|
+
this.cancelWaapi();
|
|
1423
1426
|
}
|
|
1424
1427
|
async animateTo(target, velocityPxPerMs) {
|
|
1425
1428
|
if (target === this.getSize()) {
|
|
@@ -1430,6 +1433,7 @@ class AnimationRunner {
|
|
|
1430
1433
|
}
|
|
1431
1434
|
this.currentTween?.cancel();
|
|
1432
1435
|
this.currentSpring?.cancel();
|
|
1436
|
+
this.cancelWaapi();
|
|
1433
1437
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1434
1438
|
this.element.style.willChange = "transform";
|
|
1435
1439
|
if (this.reducedMotion) {
|
|
@@ -3420,12 +3424,19 @@ class BottomSheetCore {
|
|
|
3420
3424
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3421
3425
|
},
|
|
3422
3426
|
setIsTop: (isTop) => {
|
|
3427
|
+
if (this.isTopSheet === isTop) return;
|
|
3423
3428
|
this.isTopSheet = isTop;
|
|
3429
|
+
this.repaintScrim();
|
|
3424
3430
|
},
|
|
3425
3431
|
isOpen: () => this.size > 0 || this.opening,
|
|
3426
3432
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3427
3433
|
}));
|
|
3428
3434
|
}
|
|
3435
|
+
repaintScrim() {
|
|
3436
|
+
if (this.destroyed) return;
|
|
3437
|
+
this.scrim.invalidateOpacityCache();
|
|
3438
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3439
|
+
}
|
|
3429
3440
|
applyStackDepth(depth) {
|
|
3430
3441
|
if (!this.stackEffectEnabled) return;
|
|
3431
3442
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -4422,6 +4433,12 @@ const BottomSheet = qwik.component$((props) => {
|
|
|
4422
4433
|
}
|
|
4423
4434
|
if (dragFrom !== void 0) engine.setDragFrom(dragFrom);
|
|
4424
4435
|
});
|
|
4436
|
+
qwik.useTask$(({ track }) => {
|
|
4437
|
+
const nextMode = track(() => props.mode);
|
|
4438
|
+
const engine = engineStore.engine;
|
|
4439
|
+
if (!engine || nextMode === void 0) return;
|
|
4440
|
+
engine.setMode(nextMode);
|
|
4441
|
+
});
|
|
4425
4442
|
const showBackdrop = props.backdrop !== false;
|
|
4426
4443
|
const mode = props.mode ?? "bottom";
|
|
4427
4444
|
const ariaLabel = props.ariaLabel ?? "Bottom sheet";
|
|
@@ -851,10 +851,11 @@ class ScrimController {
|
|
|
851
851
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
852
852
|
return;
|
|
853
853
|
}
|
|
854
|
-
if (this.backdrop
|
|
854
|
+
if (this.backdrop) {
|
|
855
855
|
const [s, e] = this.backdropRange;
|
|
856
856
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
857
|
-
const
|
|
857
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
858
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
858
859
|
if (this.backdropOpacitySentinel.shouldWrite(backdropOpacity, OPACITY_WRITE_EPSILON)) {
|
|
859
860
|
this.backdrop.style.opacity = String(backdropOpacity);
|
|
860
861
|
}
|
|
@@ -1406,18 +1407,20 @@ class AnimationRunner {
|
|
|
1406
1407
|
get isAnimating() {
|
|
1407
1408
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1408
1409
|
}
|
|
1410
|
+
cancelWaapi() {
|
|
1411
|
+
if (!this.currentWaapi) return;
|
|
1412
|
+
const entry = this.currentWaapi;
|
|
1413
|
+
this.currentWaapi = null;
|
|
1414
|
+
entry.stop();
|
|
1415
|
+
try {
|
|
1416
|
+
entry.anim.cancel();
|
|
1417
|
+
} catch {
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1409
1420
|
cancel() {
|
|
1410
1421
|
this.currentTween?.cancel();
|
|
1411
1422
|
this.currentSpring?.cancel();
|
|
1412
|
-
|
|
1413
|
-
const entry = this.currentWaapi;
|
|
1414
|
-
this.currentWaapi = null;
|
|
1415
|
-
entry.stop();
|
|
1416
|
-
try {
|
|
1417
|
-
entry.anim.cancel();
|
|
1418
|
-
} catch {
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1423
|
+
this.cancelWaapi();
|
|
1421
1424
|
}
|
|
1422
1425
|
async animateTo(target, velocityPxPerMs) {
|
|
1423
1426
|
if (target === this.getSize()) {
|
|
@@ -1428,6 +1431,7 @@ class AnimationRunner {
|
|
|
1428
1431
|
}
|
|
1429
1432
|
this.currentTween?.cancel();
|
|
1430
1433
|
this.currentSpring?.cancel();
|
|
1434
|
+
this.cancelWaapi();
|
|
1431
1435
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1432
1436
|
this.element.style.willChange = "transform";
|
|
1433
1437
|
if (this.reducedMotion) {
|
|
@@ -3418,12 +3422,19 @@ class BottomSheetCore {
|
|
|
3418
3422
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3419
3423
|
},
|
|
3420
3424
|
setIsTop: (isTop) => {
|
|
3425
|
+
if (this.isTopSheet === isTop) return;
|
|
3421
3426
|
this.isTopSheet = isTop;
|
|
3427
|
+
this.repaintScrim();
|
|
3422
3428
|
},
|
|
3423
3429
|
isOpen: () => this.size > 0 || this.opening,
|
|
3424
3430
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3425
3431
|
}));
|
|
3426
3432
|
}
|
|
3433
|
+
repaintScrim() {
|
|
3434
|
+
if (this.destroyed) return;
|
|
3435
|
+
this.scrim.invalidateOpacityCache();
|
|
3436
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3437
|
+
}
|
|
3427
3438
|
applyStackDepth(depth) {
|
|
3428
3439
|
if (!this.stackEffectEnabled) return;
|
|
3429
3440
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -4420,6 +4431,12 @@ const BottomSheet = component$((props) => {
|
|
|
4420
4431
|
}
|
|
4421
4432
|
if (dragFrom !== void 0) engine.setDragFrom(dragFrom);
|
|
4422
4433
|
});
|
|
4434
|
+
useTask$(({ track }) => {
|
|
4435
|
+
const nextMode = track(() => props.mode);
|
|
4436
|
+
const engine = engineStore.engine;
|
|
4437
|
+
if (!engine || nextMode === void 0) return;
|
|
4438
|
+
engine.setMode(nextMode);
|
|
4439
|
+
});
|
|
4423
4440
|
const showBackdrop = props.backdrop !== false;
|
|
4424
4441
|
const mode = props.mode ?? "bottom";
|
|
4425
4442
|
const ariaLabel = props.ariaLabel ?? "Bottom sheet";
|
package/dist/qwik.cjs
CHANGED
|
@@ -841,13 +841,11 @@ var ScrimController = class {
|
|
|
841
841
|
if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
|
-
if (this.backdrop
|
|
844
|
+
if (this.backdrop) {
|
|
845
845
|
const [s, e] = this.backdropRange;
|
|
846
846
|
const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
1
|
|
850
|
-
);
|
|
847
|
+
const ramp = Math.min(Math.max((progress - s) / range, 0), 1);
|
|
848
|
+
const backdropOpacity = this.isTopSheet() ? ramp : 0;
|
|
851
849
|
if (this.backdropOpacitySentinel.shouldWrite(
|
|
852
850
|
backdropOpacity,
|
|
853
851
|
OPACITY_WRITE_EPSILON
|
|
@@ -1387,18 +1385,20 @@ var AnimationRunner = class {
|
|
|
1387
1385
|
get isAnimating() {
|
|
1388
1386
|
return this.currentTween !== null || this.currentSpring !== null || this.currentWaapi !== null;
|
|
1389
1387
|
}
|
|
1388
|
+
cancelWaapi() {
|
|
1389
|
+
if (!this.currentWaapi) return;
|
|
1390
|
+
const entry = this.currentWaapi;
|
|
1391
|
+
this.currentWaapi = null;
|
|
1392
|
+
entry.stop();
|
|
1393
|
+
try {
|
|
1394
|
+
entry.anim.cancel();
|
|
1395
|
+
} catch {
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1390
1398
|
cancel() {
|
|
1391
1399
|
this.currentTween?.cancel();
|
|
1392
1400
|
this.currentSpring?.cancel();
|
|
1393
|
-
|
|
1394
|
-
const entry = this.currentWaapi;
|
|
1395
|
-
this.currentWaapi = null;
|
|
1396
|
-
entry.stop();
|
|
1397
|
-
try {
|
|
1398
|
-
entry.anim.cancel();
|
|
1399
|
-
} catch {
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1401
|
+
this.cancelWaapi();
|
|
1402
1402
|
}
|
|
1403
1403
|
async animateTo(target, velocityPxPerMs) {
|
|
1404
1404
|
if (target === this.getSize()) {
|
|
@@ -1409,6 +1409,7 @@ var AnimationRunner = class {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
this.currentTween?.cancel();
|
|
1411
1411
|
this.currentSpring?.cancel();
|
|
1412
|
+
this.cancelWaapi();
|
|
1412
1413
|
this.getRootEl()?.setAttribute("data-animating", "true");
|
|
1413
1414
|
this.element.style.willChange = "transform";
|
|
1414
1415
|
if (this.reducedMotion) {
|
|
@@ -3401,12 +3402,19 @@ var BottomSheetCore = class {
|
|
|
3401
3402
|
for (const anchor of this.anchors) anchor.syncZ(z + 1);
|
|
3402
3403
|
},
|
|
3403
3404
|
setIsTop: (isTop) => {
|
|
3405
|
+
if (this.isTopSheet === isTop) return;
|
|
3404
3406
|
this.isTopSheet = isTop;
|
|
3407
|
+
this.repaintScrim();
|
|
3405
3408
|
},
|
|
3406
3409
|
isOpen: () => this.size > 0 || this.opening,
|
|
3407
3410
|
setDepth: (depth) => this.applyStackDepth(depth)
|
|
3408
3411
|
}));
|
|
3409
3412
|
}
|
|
3413
|
+
repaintScrim() {
|
|
3414
|
+
if (this.destroyed) return;
|
|
3415
|
+
this.scrim.invalidateOpacityCache();
|
|
3416
|
+
this.scrim.applyOpacity(this.computeProgress(this.size), true);
|
|
3417
|
+
}
|
|
3410
3418
|
applyStackDepth(depth) {
|
|
3411
3419
|
if (!this.stackEffectEnabled) return;
|
|
3412
3420
|
this.element.setAttribute("data-stack-depth", String(depth));
|
|
@@ -4434,6 +4442,12 @@ var BottomSheet = qwik.component$((props) => {
|
|
|
4434
4442
|
}
|
|
4435
4443
|
if (dragFrom !== void 0) engine.setDragFrom(dragFrom);
|
|
4436
4444
|
});
|
|
4445
|
+
qwik.useTask$(({ track }) => {
|
|
4446
|
+
const nextMode = track(() => props.mode);
|
|
4447
|
+
const engine = engineStore.engine;
|
|
4448
|
+
if (!engine || nextMode === void 0) return;
|
|
4449
|
+
engine.setMode(nextMode);
|
|
4450
|
+
});
|
|
4437
4451
|
const showBackdrop = props.backdrop !== false;
|
|
4438
4452
|
const mode = props.mode ?? "bottom";
|
|
4439
4453
|
const ariaLabel = props.ariaLabel ?? "Bottom sheet";
|
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-CK8Rh1He.cjs';
|
|
5
|
+
export { d as SnapPoint } from './BottomSheetCore-CK8Rh1He.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-CIijwtdi.js';
|
|
5
|
+
export { d as SnapPoint } from './BottomSheetCore-CIijwtdi.js';
|
|
6
6
|
import './transform-jVfAikE9.js';
|
|
7
7
|
|
|
8
8
|
type BottomSheetProps<TId extends string = string> = {
|