Comparing version 0.1.1 to 0.1.2
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('[vaul-drawer]{touch-action:none;transform:translate3d(0,100%,0);transition:transform .5s cubic-bezier(.32,.72,0,1)}.vaul-dragging .vaul-scrollable{overflow-y:hidden!important}[vaul-drawer][vaul-drawer-visible=true]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;top:100%;background:inherit;background-color:inherit;left:0;right:0;height:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{-webkit-user-select:none;user-select:none}}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
import { getCurrentInstance as He, ref as S, watch as z, nextTick as he, computed as H, onMounted as Le, onUnmounted as Me, watchEffect as je, defineComponent as Z, toRefs as Ve, openBlock as F, createBlock as ee, unref as N, withCtx as oe, renderSlot as ie, mergeProps as ze, normalizeStyle as We } from "vue"; | ||
import { createContext as ke, DialogRoot as Ie, useForwardPropsEmits as Ye, DialogOverlay as qe, DialogContent as Ge } from "radix-vue"; | ||
import { DialogClose as vt, DialogDescription as pt, DialogPortal as mt, DialogTitle as gt, DialogTrigger as wt } from "radix-vue"; | ||
import { DialogClose as pt, DialogDescription as mt, DialogPortal as gt, DialogTitle as wt, DialogTrigger as ht } from "radix-vue"; | ||
const Je = typeof window < "u" && typeof document < "u"; | ||
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; | ||
const Je = (t) => typeof t < "u"; | ||
function Ke(t) { | ||
const Ke = (t) => typeof t < "u"; | ||
function Xe(t) { | ||
return JSON.parse(JSON.stringify(t)); | ||
@@ -22,3 +23,3 @@ } | ||
e || (e = "modelValue"), r = r || `update:${e.toString()}`; | ||
const l = (f) => $ ? typeof $ == "function" ? $(f) : Ke(f) : f, c = () => Je(t[e]) ? l(t[e]) : d, T = (f) => { | ||
const l = (f) => $ ? typeof $ == "function" ? $(f) : Xe(f) : f, c = () => Ke(t[e]) ? l(t[e]) : d, T = (f) => { | ||
C ? C(f) && B(r, f) : B(r, f); | ||
@@ -51,3 +52,3 @@ }; | ||
} | ||
const [le, Xe] = ke("DrawerRoot"), be = /* @__PURE__ */ new WeakMap(); | ||
const [le, Qe] = ke("DrawerRoot"), be = /* @__PURE__ */ new WeakMap(); | ||
function h(t, e, i = !1) { | ||
@@ -78,3 +79,3 @@ if (!t || !(t instanceof HTMLElement) || !e) | ||
} | ||
function Qe(t) { | ||
function Ze(t) { | ||
return 8 * (Math.log(t + 1) - 2); | ||
@@ -86,3 +87,3 @@ } | ||
}, ye = 0.4; | ||
function Ze({ | ||
function Fe({ | ||
activeSnapPoint: t, | ||
@@ -218,3 +219,3 @@ snapPoints: e, | ||
let q = null; | ||
function Fe(t) { | ||
function et(t) { | ||
const { isOpen: e, modal: i, nested: s, hasBeenOpened: n } = t, w = S(typeof window < "u" ? window.location.href : ""), b = S(0); | ||
@@ -263,7 +264,7 @@ function $() { | ||
} | ||
const et = 0.25, tt = 100, ge = 8, V = 16, nt = 26, we = "vaul-dragging"; | ||
function at(t, e) { | ||
const tt = 0.25, nt = 100, ge = 8, V = 16, at = 26, we = "vaul-dragging"; | ||
function ot(t, e) { | ||
return t && t.value ? t : e; | ||
} | ||
function ot(t) { | ||
function it(t) { | ||
const { | ||
@@ -291,3 +292,3 @@ emitDrag: e, | ||
return ((a = v.value) == null ? void 0 : a.$el.getBoundingClientRect().height) || 0; | ||
}), U = at( | ||
}), U = ot( | ||
t.snapPoints, | ||
@@ -302,3 +303,3 @@ S(void 0) | ||
getPercentageDragged: Se | ||
} = Ze({ | ||
} = Fe({ | ||
snapPoints: U, | ||
@@ -314,3 +315,3 @@ activeSnapPoint: u, | ||
} | ||
const { restorePositionSetting: Re } = Fe({ | ||
const { restorePositionSetting: Re } = et({ | ||
isOpen: r, | ||
@@ -322,3 +323,3 @@ modal: o, | ||
function J() { | ||
return (window.innerWidth - nt) / window.innerWidth; | ||
return (window.innerWidth - at) / window.innerWidth; | ||
} | ||
@@ -364,3 +365,3 @@ function ce(a, p) { | ||
}), U.value && Oe({ draggedDistance: K }), te && !U.value) { | ||
const ae = Qe(K); | ||
const ae = Ze(K); | ||
h((E = v.value) == null ? void 0 : E.$el, { | ||
@@ -443,3 +444,3 @@ transform: `translate3d(0, ${Math.min(ae * -1, 0)}px, 0)` | ||
je(() => { | ||
if (!r.value && y.value) { | ||
if (!r.value && y.value && Je) { | ||
const a = setTimeout(() => { | ||
@@ -586,9 +587,9 @@ X(document.body); | ||
} | ||
const it = /* @__PURE__ */ Z({ | ||
const lt = /* @__PURE__ */ Z({ | ||
__name: "DrawerRoot", | ||
props: { | ||
activeSnapPoint: { default: void 0 }, | ||
closeThreshold: { default: et }, | ||
closeThreshold: { default: tt }, | ||
shouldScaleBackground: { type: Boolean, default: void 0 }, | ||
scrollLockTimeout: { default: tt }, | ||
scrollLockTimeout: { default: nt }, | ||
fixed: { type: Boolean, default: void 0 }, | ||
@@ -617,4 +618,4 @@ dismissible: { type: Boolean, default: !0 }, | ||
} | ||
}, { closeDrawer: g, hasBeenOpened: o, modal: y, isOpen: d } = Xe( | ||
ot({ | ||
}, { closeDrawer: g, hasBeenOpened: o, modal: y, isOpen: d } = Qe( | ||
it({ | ||
...$, | ||
@@ -645,3 +646,3 @@ ...Ve(i), | ||
} | ||
}), st = /* @__PURE__ */ Z({ | ||
}), ut = /* @__PURE__ */ Z({ | ||
__name: "DrawerRootNested", | ||
@@ -675,3 +676,3 @@ props: { | ||
const y = Ye(i, s); | ||
return (d, C) => (F(), ee(it, ze(N(y), { | ||
return (d, C) => (F(), ee(lt, ze(N(y), { | ||
nested: "", | ||
@@ -689,3 +690,3 @@ onClose: $, | ||
} | ||
}), ut = /* @__PURE__ */ Z({ | ||
}), ct = /* @__PURE__ */ Z({ | ||
__name: "DrawerOverlay", | ||
@@ -706,3 +707,3 @@ setup(t) { | ||
} | ||
}), ct = /* @__PURE__ */ Z({ | ||
}), dt = /* @__PURE__ */ Z({ | ||
__name: "DrawerContent", | ||
@@ -762,11 +763,11 @@ setup(t) { | ||
export { | ||
vt as DrawerClose, | ||
ct as DrawerContent, | ||
pt as DrawerDescription, | ||
ut as DrawerOverlay, | ||
mt as DrawerPortal, | ||
it as DrawerRoot, | ||
st as DrawerRootNested, | ||
gt as DrawerTitle, | ||
wt as DrawerTrigger | ||
pt as DrawerClose, | ||
dt as DrawerContent, | ||
mt as DrawerDescription, | ||
ct as DrawerOverlay, | ||
gt as DrawerPortal, | ||
lt as DrawerRoot, | ||
ut as DrawerRootNested, | ||
wt as DrawerTitle, | ||
ht as DrawerTrigger | ||
}; |
{ | ||
"name": "vaul-vue", | ||
"type": "module", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": "https://github.com/Elliot-Alexander/vaul-vue", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
60207
1195
0