@surdeddd/bottom-sheet 0.11.0 → 0.13.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 +68 -1
- package/dist/{BottomSheetEngine-DzsIwD28.d.cts → BottomSheetCore-CsIjyq7C.d.cts} +61 -5
- package/dist/{BottomSheetEngine-DRjCU73e.d.ts → BottomSheetCore-D16lsa6g.d.ts} +61 -5
- package/dist/BottomSheetEngine-BYjAVrmd.d.cts +7 -0
- package/dist/BottomSheetEngine-YuCNugZn.d.ts +7 -0
- package/dist/core.cjs +3476 -0
- package/dist/core.d.cts +3 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.js +3474 -0
- package/dist/debug.cjs +109 -0
- package/dist/debug.d.cts +22 -0
- package/dist/debug.d.ts +22 -0
- package/dist/debug.js +107 -0
- package/dist/element.cjs +994 -697
- package/dist/element.d.cts +2 -1
- package/dist/element.d.ts +2 -1
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +994 -697
- package/dist/features.cjs +533 -0
- package/dist/features.d.cts +13 -0
- package/dist/features.d.ts +13 -0
- package/dist/features.js +526 -0
- package/dist/index-DdYLOIIT.d.ts +15 -0
- package/dist/index-dfrzw-lI.d.cts +15 -0
- package/dist/index.cjs +823 -542
- package/dist/index.d.cts +6 -15
- package/dist/index.d.ts +6 -15
- package/dist/index.js +817 -543
- 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 +13 -8
- package/dist/overlay.js +13 -8
- package/dist/preact.d.cts +2 -1
- package/dist/preact.d.ts +2 -1
- package/dist/qwik-lib/index.qwik.cjs +4267 -0
- package/dist/qwik-lib/index.qwik.mjs +4267 -0
- package/dist/qwik.cjs +816 -542
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +816 -542
- package/dist/react.cjs +816 -542
- package/dist/react.d.cts +3 -2
- package/dist/react.d.ts +3 -2
- package/dist/react.js +816 -542
- package/dist/solid.cjs +816 -542
- package/dist/solid.d.cts +64 -4
- package/dist/solid.d.ts +64 -4
- package/dist/solid.js +816 -542
- package/dist/solid.source.jsx +816 -542
- package/dist/svelte-core.cjs +816 -542
- package/dist/svelte-core.js +816 -542
- package/dist/svelte.cjs +816 -542
- package/dist/svelte.js +816 -542
- package/dist/vue.cjs +927 -645
- package/dist/vue.js +927 -645
- package/package.json +63 -11
package/dist/overlay.cjs
CHANGED
|
@@ -533,10 +533,14 @@ function installOverlaySwipe(deps) {
|
|
|
533
533
|
var entries = [];
|
|
534
534
|
var subscribers = /* @__PURE__ */ new Set();
|
|
535
535
|
var suppress = 0;
|
|
536
|
-
var
|
|
536
|
+
var pendingRebrands = [];
|
|
537
537
|
var listenerInstalled = false;
|
|
538
538
|
var hasWindow = () => typeof window !== "undefined";
|
|
539
539
|
var hasHistory = () => typeof history !== "undefined";
|
|
540
|
+
var brandMarker = (surface) => ({
|
|
541
|
+
...surface.markerState(),
|
|
542
|
+
__bs: true
|
|
543
|
+
});
|
|
540
544
|
var runInternal = (fn) => {
|
|
541
545
|
try {
|
|
542
546
|
fn();
|
|
@@ -561,8 +565,7 @@ var maybeTeardownListener = () => {
|
|
|
561
565
|
function onPopState() {
|
|
562
566
|
if (suppress > 0) {
|
|
563
567
|
suppress -= 1;
|
|
564
|
-
const rebrand =
|
|
565
|
-
pendingRebrand = null;
|
|
568
|
+
const rebrand = pendingRebrands.shift();
|
|
566
569
|
if (rebrand) rebrand();
|
|
567
570
|
maybeTeardownListener();
|
|
568
571
|
return;
|
|
@@ -606,7 +609,7 @@ function restore(entry) {
|
|
|
606
609
|
entry.live = true;
|
|
607
610
|
runInternal(() => {
|
|
608
611
|
try {
|
|
609
|
-
history.pushState(entry.surface
|
|
612
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
610
613
|
} catch {
|
|
611
614
|
entry.live = false;
|
|
612
615
|
}
|
|
@@ -624,7 +627,7 @@ function pushBackMarker(surface) {
|
|
|
624
627
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
625
628
|
runInternal(() => {
|
|
626
629
|
try {
|
|
627
|
-
history.pushState(surface
|
|
630
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
628
631
|
entry.live = true;
|
|
629
632
|
} catch {
|
|
630
633
|
entry.live = false;
|
|
@@ -644,26 +647,28 @@ function popBackMarker(handle) {
|
|
|
644
647
|
const last = entries.length - 1;
|
|
645
648
|
entry.live = false;
|
|
646
649
|
entries.splice(idx, 1);
|
|
650
|
+
let rebrand = null;
|
|
647
651
|
if (idx !== last) {
|
|
648
652
|
const rebrandSurface = entries[entries.length - 1].surface;
|
|
649
653
|
const rebrandUrl = entry.priorUrl;
|
|
650
|
-
|
|
654
|
+
rebrand = () => {
|
|
651
655
|
runInternal(() => {
|
|
652
656
|
history.replaceState(
|
|
653
|
-
rebrandSurface
|
|
657
|
+
brandMarker(rebrandSurface),
|
|
654
658
|
"",
|
|
655
659
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
656
660
|
);
|
|
657
661
|
});
|
|
658
662
|
};
|
|
659
663
|
}
|
|
664
|
+
pendingRebrands.push(rebrand);
|
|
660
665
|
suppress += 1;
|
|
661
666
|
runInternal(() => {
|
|
662
667
|
try {
|
|
663
668
|
history.back();
|
|
664
669
|
} catch {
|
|
665
670
|
suppress = Math.max(0, suppress - 1);
|
|
666
|
-
|
|
671
|
+
pendingRebrands.pop();
|
|
667
672
|
}
|
|
668
673
|
});
|
|
669
674
|
maybeTeardownListener();
|
package/dist/overlay.js
CHANGED
|
@@ -531,10 +531,14 @@ function installOverlaySwipe(deps) {
|
|
|
531
531
|
var entries = [];
|
|
532
532
|
var subscribers = /* @__PURE__ */ new Set();
|
|
533
533
|
var suppress = 0;
|
|
534
|
-
var
|
|
534
|
+
var pendingRebrands = [];
|
|
535
535
|
var listenerInstalled = false;
|
|
536
536
|
var hasWindow = () => typeof window !== "undefined";
|
|
537
537
|
var hasHistory = () => typeof history !== "undefined";
|
|
538
|
+
var brandMarker = (surface) => ({
|
|
539
|
+
...surface.markerState(),
|
|
540
|
+
__bs: true
|
|
541
|
+
});
|
|
538
542
|
var runInternal = (fn) => {
|
|
539
543
|
try {
|
|
540
544
|
fn();
|
|
@@ -559,8 +563,7 @@ var maybeTeardownListener = () => {
|
|
|
559
563
|
function onPopState() {
|
|
560
564
|
if (suppress > 0) {
|
|
561
565
|
suppress -= 1;
|
|
562
|
-
const rebrand =
|
|
563
|
-
pendingRebrand = null;
|
|
566
|
+
const rebrand = pendingRebrands.shift();
|
|
564
567
|
if (rebrand) rebrand();
|
|
565
568
|
maybeTeardownListener();
|
|
566
569
|
return;
|
|
@@ -604,7 +607,7 @@ function restore(entry) {
|
|
|
604
607
|
entry.live = true;
|
|
605
608
|
runInternal(() => {
|
|
606
609
|
try {
|
|
607
|
-
history.pushState(entry.surface
|
|
610
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
608
611
|
} catch {
|
|
609
612
|
entry.live = false;
|
|
610
613
|
}
|
|
@@ -622,7 +625,7 @@ function pushBackMarker(surface) {
|
|
|
622
625
|
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
623
626
|
runInternal(() => {
|
|
624
627
|
try {
|
|
625
|
-
history.pushState(surface
|
|
628
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
626
629
|
entry.live = true;
|
|
627
630
|
} catch {
|
|
628
631
|
entry.live = false;
|
|
@@ -642,26 +645,28 @@ function popBackMarker(handle) {
|
|
|
642
645
|
const last = entries.length - 1;
|
|
643
646
|
entry.live = false;
|
|
644
647
|
entries.splice(idx, 1);
|
|
648
|
+
let rebrand = null;
|
|
645
649
|
if (idx !== last) {
|
|
646
650
|
const rebrandSurface = entries[entries.length - 1].surface;
|
|
647
651
|
const rebrandUrl = entry.priorUrl;
|
|
648
|
-
|
|
652
|
+
rebrand = () => {
|
|
649
653
|
runInternal(() => {
|
|
650
654
|
history.replaceState(
|
|
651
|
-
rebrandSurface
|
|
655
|
+
brandMarker(rebrandSurface),
|
|
652
656
|
"",
|
|
653
657
|
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
654
658
|
);
|
|
655
659
|
});
|
|
656
660
|
};
|
|
657
661
|
}
|
|
662
|
+
pendingRebrands.push(rebrand);
|
|
658
663
|
suppress += 1;
|
|
659
664
|
runInternal(() => {
|
|
660
665
|
try {
|
|
661
666
|
history.back();
|
|
662
667
|
} catch {
|
|
663
668
|
suppress = Math.max(0, suppress - 1);
|
|
664
|
-
|
|
669
|
+
pendingRebrands.pop();
|
|
665
670
|
}
|
|
666
671
|
});
|
|
667
672
|
maybeTeardownListener();
|
package/dist/preact.d.cts
CHANGED
|
@@ -1,6 +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,
|
|
2
|
+
export { E as EngineState, c as SheetMode, e as SnapPoint, b as SnapPointDef } from './BottomSheetCore-CsIjyq7C.cjs';
|
|
3
3
|
export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.cjs';
|
|
4
4
|
import 'react';
|
|
5
|
+
import './BottomSheetEngine-BYjAVrmd.cjs';
|
|
5
6
|
import './teleport-7uYNiEAT.cjs';
|
|
6
7
|
import './transform-jVfAikE9.cjs';
|
package/dist/preact.d.ts
CHANGED
|
@@ -1,6 +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,
|
|
2
|
+
export { E as EngineState, c as SheetMode, e as SnapPoint, b as SnapPointDef } from './BottomSheetCore-D16lsa6g.js';
|
|
3
3
|
export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.js';
|
|
4
4
|
import 'react';
|
|
5
|
+
import './BottomSheetEngine-YuCNugZn.js';
|
|
5
6
|
import './teleport-7uYNiEAT.js';
|
|
6
7
|
import './transform-jVfAikE9.js';
|