@surdeddd/bottom-sheet 0.11.0 → 0.12.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 +16 -0
- package/dist/{BottomSheetEngine-DzsIwD28.d.cts → BottomSheetEngine-D6oiEfZ4.d.cts} +1 -0
- package/dist/{BottomSheetEngine-DRjCU73e.d.ts → BottomSheetEngine-Dhy0X_e9.d.ts} +1 -0
- package/dist/element.cjs +27 -17
- package/dist/element.d.cts +1 -1
- package/dist/element.d.ts +1 -1
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +27 -17
- package/dist/index.cjs +26 -16
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -16
- 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/overlay.cjs +7 -3
- package/dist/overlay.js +7 -3
- package/dist/preact.d.cts +1 -1
- package/dist/preact.d.ts +1 -1
- package/dist/qwik.cjs +26 -16
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +26 -16
- package/dist/react.cjs +26 -16
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +26 -16
- package/dist/solid.cjs +26 -16
- package/dist/solid.d.cts +1 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +26 -16
- package/dist/solid.source.jsx +26 -16
- package/dist/svelte-core.cjs +26 -16
- package/dist/svelte-core.js +26 -16
- package/dist/svelte.cjs +26 -16
- package/dist/svelte.js +26 -16
- package/dist/vue.cjs +26 -16
- package/dist/vue.js +26 -16
- package/package.json +3 -3
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, d as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-
|
|
2
|
-
export { e as SnapPoint } from './BottomSheetEngine-
|
|
1
|
+
import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, d as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-Dhy0X_e9.js';
|
|
2
|
+
export { e as SnapPoint } from './BottomSheetEngine-Dhy0X_e9.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';
|
package/dist/react.js
CHANGED
|
@@ -460,6 +460,10 @@ var patchedPushState = null;
|
|
|
460
460
|
var patchedReplaceState = null;
|
|
461
461
|
var hasWindow = () => typeof window !== "undefined";
|
|
462
462
|
var hasHistory = () => typeof history !== "undefined";
|
|
463
|
+
var brandMarker = (surface) => ({
|
|
464
|
+
...surface.markerState(),
|
|
465
|
+
__bs: true
|
|
466
|
+
});
|
|
463
467
|
var runInternal = (fn) => {
|
|
464
468
|
internalDepth += 1;
|
|
465
469
|
try {
|
|
@@ -561,7 +565,7 @@ function restore(entry) {
|
|
|
561
565
|
entry.live = true;
|
|
562
566
|
runInternal(() => {
|
|
563
567
|
try {
|
|
564
|
-
history.pushState(entry.surface
|
|
568
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
565
569
|
} catch {
|
|
566
570
|
entry.live = false;
|
|
567
571
|
}
|
|
@@ -579,7 +583,7 @@ function pushBackMarker(surface) {
|
|
|
579
583
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
580
584
|
runInternal(() => {
|
|
581
585
|
try {
|
|
582
|
-
history.pushState(surface
|
|
586
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
583
587
|
entry.live = true;
|
|
584
588
|
} catch {
|
|
585
589
|
entry.live = false;
|
|
@@ -605,7 +609,7 @@ function popBackMarker(handle) {
|
|
|
605
609
|
pendingRebrand = () => {
|
|
606
610
|
runInternal(() => {
|
|
607
611
|
history.replaceState(
|
|
608
|
-
rebrandSurface
|
|
612
|
+
brandMarker(rebrandSurface),
|
|
609
613
|
"",
|
|
610
614
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
611
615
|
);
|
|
@@ -949,11 +953,15 @@ function createMaxHeightController(deps) {
|
|
|
949
953
|
|
|
950
954
|
// src/core/features/fit-measurement.ts
|
|
951
955
|
var measureSheetNatural = (element, content, vertical) => {
|
|
952
|
-
if (!content) {
|
|
953
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
954
|
-
}
|
|
955
956
|
const axis = vertical ? "height" : "width";
|
|
956
957
|
const sheetStyle = element.style;
|
|
958
|
+
if (!content) {
|
|
959
|
+
const prev = sheetStyle[axis];
|
|
960
|
+
sheetStyle[axis] = "auto";
|
|
961
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
962
|
+
sheetStyle[axis] = prev;
|
|
963
|
+
return poked2;
|
|
964
|
+
}
|
|
957
965
|
const cs = content.style;
|
|
958
966
|
const prevSheet = sheetStyle[axis];
|
|
959
967
|
const prevFlex = cs.flex;
|
|
@@ -2874,12 +2882,7 @@ var BottomSheetEngine = class {
|
|
|
2874
2882
|
if (!entry.isIntersecting) continue;
|
|
2875
2883
|
if (this.destroyed) return;
|
|
2876
2884
|
this.snaps.recompute();
|
|
2877
|
-
|
|
2878
|
-
if (current) {
|
|
2879
|
-
this.size = current.size;
|
|
2880
|
-
this.applySize(this.size);
|
|
2881
|
-
this.updateAriaSlider();
|
|
2882
|
-
}
|
|
2885
|
+
this.healActiveSnap();
|
|
2883
2886
|
io.disconnect();
|
|
2884
2887
|
return;
|
|
2885
2888
|
}
|
|
@@ -3043,6 +3046,8 @@ var BottomSheetEngine = class {
|
|
|
3043
3046
|
const vt = document.startViewTransition(() => {
|
|
3044
3047
|
this.applySize(target.size);
|
|
3045
3048
|
});
|
|
3049
|
+
vt.ready?.catch(() => {
|
|
3050
|
+
});
|
|
3046
3051
|
this.currentViewTransition = vt;
|
|
3047
3052
|
try {
|
|
3048
3053
|
await vt.finished;
|
|
@@ -3294,11 +3299,16 @@ var BottomSheetEngine = class {
|
|
|
3294
3299
|
this.maxHeight.clampTo();
|
|
3295
3300
|
this.scrim.invalidateOpacityCache();
|
|
3296
3301
|
if (this.gesture?.isDragging) return;
|
|
3302
|
+
this.healActiveSnap();
|
|
3303
|
+
}
|
|
3304
|
+
healActiveSnap() {
|
|
3297
3305
|
const current = this.snaps.findById(this.activeId);
|
|
3298
|
-
if (current)
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3306
|
+
if (!current) return;
|
|
3307
|
+
this.size = current.size;
|
|
3308
|
+
this.applySize(this.size);
|
|
3309
|
+
this.updateAriaSlider();
|
|
3310
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3311
|
+
this.emitOpenSequence(this.activeId);
|
|
3302
3312
|
}
|
|
3303
3313
|
}
|
|
3304
3314
|
destroy() {
|
package/dist/solid.cjs
CHANGED
|
@@ -455,6 +455,10 @@ var patchedPushState = null;
|
|
|
455
455
|
var patchedReplaceState = null;
|
|
456
456
|
var hasWindow = () => typeof window !== "undefined";
|
|
457
457
|
var hasHistory = () => typeof history !== "undefined";
|
|
458
|
+
var brandMarker = (surface) => ({
|
|
459
|
+
...surface.markerState(),
|
|
460
|
+
__bs: true
|
|
461
|
+
});
|
|
458
462
|
var runInternal = (fn) => {
|
|
459
463
|
internalDepth += 1;
|
|
460
464
|
try {
|
|
@@ -556,7 +560,7 @@ function restore(entry) {
|
|
|
556
560
|
entry.live = true;
|
|
557
561
|
runInternal(() => {
|
|
558
562
|
try {
|
|
559
|
-
history.pushState(entry.surface
|
|
563
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
560
564
|
} catch {
|
|
561
565
|
entry.live = false;
|
|
562
566
|
}
|
|
@@ -574,7 +578,7 @@ function pushBackMarker(surface) {
|
|
|
574
578
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
575
579
|
runInternal(() => {
|
|
576
580
|
try {
|
|
577
|
-
history.pushState(surface
|
|
581
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
578
582
|
entry.live = true;
|
|
579
583
|
} catch {
|
|
580
584
|
entry.live = false;
|
|
@@ -600,7 +604,7 @@ function popBackMarker(handle) {
|
|
|
600
604
|
pendingRebrand = () => {
|
|
601
605
|
runInternal(() => {
|
|
602
606
|
history.replaceState(
|
|
603
|
-
rebrandSurface
|
|
607
|
+
brandMarker(rebrandSurface),
|
|
604
608
|
"",
|
|
605
609
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
606
610
|
);
|
|
@@ -944,11 +948,15 @@ function createMaxHeightController(deps) {
|
|
|
944
948
|
|
|
945
949
|
// src/core/features/fit-measurement.ts
|
|
946
950
|
var measureSheetNatural = (element, content, vertical) => {
|
|
947
|
-
if (!content) {
|
|
948
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
949
|
-
}
|
|
950
951
|
const axis = vertical ? "height" : "width";
|
|
951
952
|
const sheetStyle = element.style;
|
|
953
|
+
if (!content) {
|
|
954
|
+
const prev = sheetStyle[axis];
|
|
955
|
+
sheetStyle[axis] = "auto";
|
|
956
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
957
|
+
sheetStyle[axis] = prev;
|
|
958
|
+
return poked2;
|
|
959
|
+
}
|
|
952
960
|
const cs = content.style;
|
|
953
961
|
const prevSheet = sheetStyle[axis];
|
|
954
962
|
const prevFlex = cs.flex;
|
|
@@ -2869,12 +2877,7 @@ var BottomSheetEngine = class {
|
|
|
2869
2877
|
if (!entry.isIntersecting) continue;
|
|
2870
2878
|
if (this.destroyed) return;
|
|
2871
2879
|
this.snaps.recompute();
|
|
2872
|
-
|
|
2873
|
-
if (current) {
|
|
2874
|
-
this.size = current.size;
|
|
2875
|
-
this.applySize(this.size);
|
|
2876
|
-
this.updateAriaSlider();
|
|
2877
|
-
}
|
|
2880
|
+
this.healActiveSnap();
|
|
2878
2881
|
io.disconnect();
|
|
2879
2882
|
return;
|
|
2880
2883
|
}
|
|
@@ -3038,6 +3041,8 @@ var BottomSheetEngine = class {
|
|
|
3038
3041
|
const vt = document.startViewTransition(() => {
|
|
3039
3042
|
this.applySize(target.size);
|
|
3040
3043
|
});
|
|
3044
|
+
vt.ready?.catch(() => {
|
|
3045
|
+
});
|
|
3041
3046
|
this.currentViewTransition = vt;
|
|
3042
3047
|
try {
|
|
3043
3048
|
await vt.finished;
|
|
@@ -3289,11 +3294,16 @@ var BottomSheetEngine = class {
|
|
|
3289
3294
|
this.maxHeight.clampTo();
|
|
3290
3295
|
this.scrim.invalidateOpacityCache();
|
|
3291
3296
|
if (this.gesture?.isDragging) return;
|
|
3297
|
+
this.healActiveSnap();
|
|
3298
|
+
}
|
|
3299
|
+
healActiveSnap() {
|
|
3292
3300
|
const current = this.snaps.findById(this.activeId);
|
|
3293
|
-
if (current)
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3301
|
+
if (!current) return;
|
|
3302
|
+
this.size = current.size;
|
|
3303
|
+
this.applySize(this.size);
|
|
3304
|
+
this.updateAriaSlider();
|
|
3305
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3306
|
+
this.emitOpenSequence(this.activeId);
|
|
3297
3307
|
}
|
|
3298
3308
|
}
|
|
3299
3309
|
destroy() {
|
package/dist/solid.d.cts
CHANGED
package/dist/solid.d.ts
CHANGED
package/dist/solid.js
CHANGED
|
@@ -453,6 +453,10 @@ var patchedPushState = null;
|
|
|
453
453
|
var patchedReplaceState = null;
|
|
454
454
|
var hasWindow = () => typeof window !== "undefined";
|
|
455
455
|
var hasHistory = () => typeof history !== "undefined";
|
|
456
|
+
var brandMarker = (surface) => ({
|
|
457
|
+
...surface.markerState(),
|
|
458
|
+
__bs: true
|
|
459
|
+
});
|
|
456
460
|
var runInternal = (fn) => {
|
|
457
461
|
internalDepth += 1;
|
|
458
462
|
try {
|
|
@@ -554,7 +558,7 @@ function restore(entry) {
|
|
|
554
558
|
entry.live = true;
|
|
555
559
|
runInternal(() => {
|
|
556
560
|
try {
|
|
557
|
-
history.pushState(entry.surface
|
|
561
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
558
562
|
} catch {
|
|
559
563
|
entry.live = false;
|
|
560
564
|
}
|
|
@@ -572,7 +576,7 @@ function pushBackMarker(surface) {
|
|
|
572
576
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
573
577
|
runInternal(() => {
|
|
574
578
|
try {
|
|
575
|
-
history.pushState(surface
|
|
579
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
576
580
|
entry.live = true;
|
|
577
581
|
} catch {
|
|
578
582
|
entry.live = false;
|
|
@@ -598,7 +602,7 @@ function popBackMarker(handle) {
|
|
|
598
602
|
pendingRebrand = () => {
|
|
599
603
|
runInternal(() => {
|
|
600
604
|
history.replaceState(
|
|
601
|
-
rebrandSurface
|
|
605
|
+
brandMarker(rebrandSurface),
|
|
602
606
|
"",
|
|
603
607
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
604
608
|
);
|
|
@@ -942,11 +946,15 @@ function createMaxHeightController(deps) {
|
|
|
942
946
|
|
|
943
947
|
// src/core/features/fit-measurement.ts
|
|
944
948
|
var measureSheetNatural = (element, content, vertical) => {
|
|
945
|
-
if (!content) {
|
|
946
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
947
|
-
}
|
|
948
949
|
const axis = vertical ? "height" : "width";
|
|
949
950
|
const sheetStyle = element.style;
|
|
951
|
+
if (!content) {
|
|
952
|
+
const prev = sheetStyle[axis];
|
|
953
|
+
sheetStyle[axis] = "auto";
|
|
954
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
955
|
+
sheetStyle[axis] = prev;
|
|
956
|
+
return poked2;
|
|
957
|
+
}
|
|
950
958
|
const cs = content.style;
|
|
951
959
|
const prevSheet = sheetStyle[axis];
|
|
952
960
|
const prevFlex = cs.flex;
|
|
@@ -2867,12 +2875,7 @@ var BottomSheetEngine = class {
|
|
|
2867
2875
|
if (!entry.isIntersecting) continue;
|
|
2868
2876
|
if (this.destroyed) return;
|
|
2869
2877
|
this.snaps.recompute();
|
|
2870
|
-
|
|
2871
|
-
if (current) {
|
|
2872
|
-
this.size = current.size;
|
|
2873
|
-
this.applySize(this.size);
|
|
2874
|
-
this.updateAriaSlider();
|
|
2875
|
-
}
|
|
2878
|
+
this.healActiveSnap();
|
|
2876
2879
|
io.disconnect();
|
|
2877
2880
|
return;
|
|
2878
2881
|
}
|
|
@@ -3036,6 +3039,8 @@ var BottomSheetEngine = class {
|
|
|
3036
3039
|
const vt = document.startViewTransition(() => {
|
|
3037
3040
|
this.applySize(target.size);
|
|
3038
3041
|
});
|
|
3042
|
+
vt.ready?.catch(() => {
|
|
3043
|
+
});
|
|
3039
3044
|
this.currentViewTransition = vt;
|
|
3040
3045
|
try {
|
|
3041
3046
|
await vt.finished;
|
|
@@ -3287,11 +3292,16 @@ var BottomSheetEngine = class {
|
|
|
3287
3292
|
this.maxHeight.clampTo();
|
|
3288
3293
|
this.scrim.invalidateOpacityCache();
|
|
3289
3294
|
if (this.gesture?.isDragging) return;
|
|
3295
|
+
this.healActiveSnap();
|
|
3296
|
+
}
|
|
3297
|
+
healActiveSnap() {
|
|
3290
3298
|
const current = this.snaps.findById(this.activeId);
|
|
3291
|
-
if (current)
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3299
|
+
if (!current) return;
|
|
3300
|
+
this.size = current.size;
|
|
3301
|
+
this.applySize(this.size);
|
|
3302
|
+
this.updateAriaSlider();
|
|
3303
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3304
|
+
this.emitOpenSequence(this.activeId);
|
|
3295
3305
|
}
|
|
3296
3306
|
}
|
|
3297
3307
|
destroy() {
|
package/dist/solid.source.jsx
CHANGED
|
@@ -458,6 +458,10 @@ var patchedPushState = null;
|
|
|
458
458
|
var patchedReplaceState = null;
|
|
459
459
|
var hasWindow = () => typeof window !== "undefined";
|
|
460
460
|
var hasHistory = () => typeof history !== "undefined";
|
|
461
|
+
var brandMarker = (surface) => ({
|
|
462
|
+
...surface.markerState(),
|
|
463
|
+
__bs: true
|
|
464
|
+
});
|
|
461
465
|
var runInternal = (fn) => {
|
|
462
466
|
internalDepth += 1;
|
|
463
467
|
try {
|
|
@@ -559,7 +563,7 @@ function restore(entry) {
|
|
|
559
563
|
entry.live = true;
|
|
560
564
|
runInternal(() => {
|
|
561
565
|
try {
|
|
562
|
-
history.pushState(entry.surface
|
|
566
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
563
567
|
} catch {
|
|
564
568
|
entry.live = false;
|
|
565
569
|
}
|
|
@@ -577,7 +581,7 @@ function pushBackMarker(surface) {
|
|
|
577
581
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
578
582
|
runInternal(() => {
|
|
579
583
|
try {
|
|
580
|
-
history.pushState(surface
|
|
584
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
581
585
|
entry.live = true;
|
|
582
586
|
} catch {
|
|
583
587
|
entry.live = false;
|
|
@@ -603,7 +607,7 @@ function popBackMarker(handle) {
|
|
|
603
607
|
pendingRebrand = () => {
|
|
604
608
|
runInternal(() => {
|
|
605
609
|
history.replaceState(
|
|
606
|
-
rebrandSurface
|
|
610
|
+
brandMarker(rebrandSurface),
|
|
607
611
|
"",
|
|
608
612
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
609
613
|
);
|
|
@@ -947,11 +951,15 @@ function createMaxHeightController(deps) {
|
|
|
947
951
|
|
|
948
952
|
// src/core/features/fit-measurement.ts
|
|
949
953
|
var measureSheetNatural = (element, content, vertical) => {
|
|
950
|
-
if (!content) {
|
|
951
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
952
|
-
}
|
|
953
954
|
const axis = vertical ? "height" : "width";
|
|
954
955
|
const sheetStyle = element.style;
|
|
956
|
+
if (!content) {
|
|
957
|
+
const prev = sheetStyle[axis];
|
|
958
|
+
sheetStyle[axis] = "auto";
|
|
959
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
960
|
+
sheetStyle[axis] = prev;
|
|
961
|
+
return poked2;
|
|
962
|
+
}
|
|
955
963
|
const cs = content.style;
|
|
956
964
|
const prevSheet = sheetStyle[axis];
|
|
957
965
|
const prevFlex = cs.flex;
|
|
@@ -2869,12 +2877,7 @@ var BottomSheetEngine = class {
|
|
|
2869
2877
|
if (!entry.isIntersecting) continue;
|
|
2870
2878
|
if (this.destroyed) return;
|
|
2871
2879
|
this.snaps.recompute();
|
|
2872
|
-
|
|
2873
|
-
if (current) {
|
|
2874
|
-
this.size = current.size;
|
|
2875
|
-
this.applySize(this.size);
|
|
2876
|
-
this.updateAriaSlider();
|
|
2877
|
-
}
|
|
2880
|
+
this.healActiveSnap();
|
|
2878
2881
|
io.disconnect();
|
|
2879
2882
|
return;
|
|
2880
2883
|
}
|
|
@@ -3038,6 +3041,8 @@ var BottomSheetEngine = class {
|
|
|
3038
3041
|
const vt = document.startViewTransition(() => {
|
|
3039
3042
|
this.applySize(target.size);
|
|
3040
3043
|
});
|
|
3044
|
+
vt.ready?.catch(() => {
|
|
3045
|
+
});
|
|
3041
3046
|
this.currentViewTransition = vt;
|
|
3042
3047
|
try {
|
|
3043
3048
|
await vt.finished;
|
|
@@ -3289,11 +3294,16 @@ var BottomSheetEngine = class {
|
|
|
3289
3294
|
this.maxHeight.clampTo();
|
|
3290
3295
|
this.scrim.invalidateOpacityCache();
|
|
3291
3296
|
if (this.gesture?.isDragging) return;
|
|
3297
|
+
this.healActiveSnap();
|
|
3298
|
+
}
|
|
3299
|
+
healActiveSnap() {
|
|
3292
3300
|
const current = this.snaps.findById(this.activeId);
|
|
3293
|
-
if (current)
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3301
|
+
if (!current) return;
|
|
3302
|
+
this.size = current.size;
|
|
3303
|
+
this.applySize(this.size);
|
|
3304
|
+
this.updateAriaSlider();
|
|
3305
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3306
|
+
this.emitOpenSequence(this.activeId);
|
|
3297
3307
|
}
|
|
3298
3308
|
}
|
|
3299
3309
|
destroy() {
|
package/dist/svelte-core.cjs
CHANGED
|
@@ -454,6 +454,10 @@ var patchedPushState = null;
|
|
|
454
454
|
var patchedReplaceState = null;
|
|
455
455
|
var hasWindow = () => typeof window !== "undefined";
|
|
456
456
|
var hasHistory = () => typeof history !== "undefined";
|
|
457
|
+
var brandMarker = (surface) => ({
|
|
458
|
+
...surface.markerState(),
|
|
459
|
+
__bs: true
|
|
460
|
+
});
|
|
457
461
|
var runInternal = (fn) => {
|
|
458
462
|
internalDepth += 1;
|
|
459
463
|
try {
|
|
@@ -555,7 +559,7 @@ function restore(entry) {
|
|
|
555
559
|
entry.live = true;
|
|
556
560
|
runInternal(() => {
|
|
557
561
|
try {
|
|
558
|
-
history.pushState(entry.surface
|
|
562
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
559
563
|
} catch {
|
|
560
564
|
entry.live = false;
|
|
561
565
|
}
|
|
@@ -573,7 +577,7 @@ function pushBackMarker(surface) {
|
|
|
573
577
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
574
578
|
runInternal(() => {
|
|
575
579
|
try {
|
|
576
|
-
history.pushState(surface
|
|
580
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
577
581
|
entry.live = true;
|
|
578
582
|
} catch {
|
|
579
583
|
entry.live = false;
|
|
@@ -599,7 +603,7 @@ function popBackMarker(handle) {
|
|
|
599
603
|
pendingRebrand = () => {
|
|
600
604
|
runInternal(() => {
|
|
601
605
|
history.replaceState(
|
|
602
|
-
rebrandSurface
|
|
606
|
+
brandMarker(rebrandSurface),
|
|
603
607
|
"",
|
|
604
608
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
605
609
|
);
|
|
@@ -943,11 +947,15 @@ function createMaxHeightController(deps) {
|
|
|
943
947
|
|
|
944
948
|
// src/core/features/fit-measurement.ts
|
|
945
949
|
var measureSheetNatural = (element, content, vertical) => {
|
|
946
|
-
if (!content) {
|
|
947
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
948
|
-
}
|
|
949
950
|
const axis = vertical ? "height" : "width";
|
|
950
951
|
const sheetStyle = element.style;
|
|
952
|
+
if (!content) {
|
|
953
|
+
const prev = sheetStyle[axis];
|
|
954
|
+
sheetStyle[axis] = "auto";
|
|
955
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
956
|
+
sheetStyle[axis] = prev;
|
|
957
|
+
return poked2;
|
|
958
|
+
}
|
|
951
959
|
const cs = content.style;
|
|
952
960
|
const prevSheet = sheetStyle[axis];
|
|
953
961
|
const prevFlex = cs.flex;
|
|
@@ -2868,12 +2876,7 @@ var BottomSheetEngine = class {
|
|
|
2868
2876
|
if (!entry.isIntersecting) continue;
|
|
2869
2877
|
if (this.destroyed) return;
|
|
2870
2878
|
this.snaps.recompute();
|
|
2871
|
-
|
|
2872
|
-
if (current) {
|
|
2873
|
-
this.size = current.size;
|
|
2874
|
-
this.applySize(this.size);
|
|
2875
|
-
this.updateAriaSlider();
|
|
2876
|
-
}
|
|
2879
|
+
this.healActiveSnap();
|
|
2877
2880
|
io.disconnect();
|
|
2878
2881
|
return;
|
|
2879
2882
|
}
|
|
@@ -3037,6 +3040,8 @@ var BottomSheetEngine = class {
|
|
|
3037
3040
|
const vt = document.startViewTransition(() => {
|
|
3038
3041
|
this.applySize(target.size);
|
|
3039
3042
|
});
|
|
3043
|
+
vt.ready?.catch(() => {
|
|
3044
|
+
});
|
|
3040
3045
|
this.currentViewTransition = vt;
|
|
3041
3046
|
try {
|
|
3042
3047
|
await vt.finished;
|
|
@@ -3288,11 +3293,16 @@ var BottomSheetEngine = class {
|
|
|
3288
3293
|
this.maxHeight.clampTo();
|
|
3289
3294
|
this.scrim.invalidateOpacityCache();
|
|
3290
3295
|
if (this.gesture?.isDragging) return;
|
|
3296
|
+
this.healActiveSnap();
|
|
3297
|
+
}
|
|
3298
|
+
healActiveSnap() {
|
|
3291
3299
|
const current = this.snaps.findById(this.activeId);
|
|
3292
|
-
if (current)
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3300
|
+
if (!current) return;
|
|
3301
|
+
this.size = current.size;
|
|
3302
|
+
this.applySize(this.size);
|
|
3303
|
+
this.updateAriaSlider();
|
|
3304
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3305
|
+
this.emitOpenSequence(this.activeId);
|
|
3296
3306
|
}
|
|
3297
3307
|
}
|
|
3298
3308
|
destroy() {
|
package/dist/svelte-core.js
CHANGED
|
@@ -452,6 +452,10 @@ var patchedPushState = null;
|
|
|
452
452
|
var patchedReplaceState = null;
|
|
453
453
|
var hasWindow = () => typeof window !== "undefined";
|
|
454
454
|
var hasHistory = () => typeof history !== "undefined";
|
|
455
|
+
var brandMarker = (surface) => ({
|
|
456
|
+
...surface.markerState(),
|
|
457
|
+
__bs: true
|
|
458
|
+
});
|
|
455
459
|
var runInternal = (fn) => {
|
|
456
460
|
internalDepth += 1;
|
|
457
461
|
try {
|
|
@@ -553,7 +557,7 @@ function restore(entry) {
|
|
|
553
557
|
entry.live = true;
|
|
554
558
|
runInternal(() => {
|
|
555
559
|
try {
|
|
556
|
-
history.pushState(entry.surface
|
|
560
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
557
561
|
} catch {
|
|
558
562
|
entry.live = false;
|
|
559
563
|
}
|
|
@@ -571,7 +575,7 @@ function pushBackMarker(surface) {
|
|
|
571
575
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
572
576
|
runInternal(() => {
|
|
573
577
|
try {
|
|
574
|
-
history.pushState(surface
|
|
578
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
575
579
|
entry.live = true;
|
|
576
580
|
} catch {
|
|
577
581
|
entry.live = false;
|
|
@@ -597,7 +601,7 @@ function popBackMarker(handle) {
|
|
|
597
601
|
pendingRebrand = () => {
|
|
598
602
|
runInternal(() => {
|
|
599
603
|
history.replaceState(
|
|
600
|
-
rebrandSurface
|
|
604
|
+
brandMarker(rebrandSurface),
|
|
601
605
|
"",
|
|
602
606
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
603
607
|
);
|
|
@@ -941,11 +945,15 @@ function createMaxHeightController(deps) {
|
|
|
941
945
|
|
|
942
946
|
// src/core/features/fit-measurement.ts
|
|
943
947
|
var measureSheetNatural = (element, content, vertical) => {
|
|
944
|
-
if (!content) {
|
|
945
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
946
|
-
}
|
|
947
948
|
const axis = vertical ? "height" : "width";
|
|
948
949
|
const sheetStyle = element.style;
|
|
950
|
+
if (!content) {
|
|
951
|
+
const prev = sheetStyle[axis];
|
|
952
|
+
sheetStyle[axis] = "auto";
|
|
953
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
954
|
+
sheetStyle[axis] = prev;
|
|
955
|
+
return poked2;
|
|
956
|
+
}
|
|
949
957
|
const cs = content.style;
|
|
950
958
|
const prevSheet = sheetStyle[axis];
|
|
951
959
|
const prevFlex = cs.flex;
|
|
@@ -2866,12 +2874,7 @@ var BottomSheetEngine = class {
|
|
|
2866
2874
|
if (!entry.isIntersecting) continue;
|
|
2867
2875
|
if (this.destroyed) return;
|
|
2868
2876
|
this.snaps.recompute();
|
|
2869
|
-
|
|
2870
|
-
if (current) {
|
|
2871
|
-
this.size = current.size;
|
|
2872
|
-
this.applySize(this.size);
|
|
2873
|
-
this.updateAriaSlider();
|
|
2874
|
-
}
|
|
2877
|
+
this.healActiveSnap();
|
|
2875
2878
|
io.disconnect();
|
|
2876
2879
|
return;
|
|
2877
2880
|
}
|
|
@@ -3035,6 +3038,8 @@ var BottomSheetEngine = class {
|
|
|
3035
3038
|
const vt = document.startViewTransition(() => {
|
|
3036
3039
|
this.applySize(target.size);
|
|
3037
3040
|
});
|
|
3041
|
+
vt.ready?.catch(() => {
|
|
3042
|
+
});
|
|
3038
3043
|
this.currentViewTransition = vt;
|
|
3039
3044
|
try {
|
|
3040
3045
|
await vt.finished;
|
|
@@ -3286,11 +3291,16 @@ var BottomSheetEngine = class {
|
|
|
3286
3291
|
this.maxHeight.clampTo();
|
|
3287
3292
|
this.scrim.invalidateOpacityCache();
|
|
3288
3293
|
if (this.gesture?.isDragging) return;
|
|
3294
|
+
this.healActiveSnap();
|
|
3295
|
+
}
|
|
3296
|
+
healActiveSnap() {
|
|
3289
3297
|
const current = this.snaps.findById(this.activeId);
|
|
3290
|
-
if (current)
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3298
|
+
if (!current) return;
|
|
3299
|
+
this.size = current.size;
|
|
3300
|
+
this.applySize(this.size);
|
|
3301
|
+
this.updateAriaSlider();
|
|
3302
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3303
|
+
this.emitOpenSequence(this.activeId);
|
|
3294
3304
|
}
|
|
3295
3305
|
}
|
|
3296
3306
|
destroy() {
|