@leaflink/stash 53.4.4 → 53.4.5

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.
@@ -1,5 +1,5 @@
1
1
  import v from "@leaflink/snitch";
2
- import { a as I } from "./index-B1Gkwuxd.js";
2
+ import { a as I } from "./index-DA70nQCT.js";
3
3
  import { isRef as w, toValue as D, nextTick as A, computed as i, ref as y, watch as S, onMounted as $, onBeforeUnmount as G } from "vue";
4
4
  function O({ list: n, from: s, to: e }) {
5
5
  if (s === e) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflink/stash",
3
- "version": "53.4.4",
3
+ "version": "53.4.5",
4
4
  "description": "LeafLink's design system.",
5
5
  "homepage": "https://stash.leaflink.com",
6
6
  "main": "./dist/index.ts",
@@ -1,277 +0,0 @@
1
- import { isRef as q, shallowRef as v, toValue as S, onMounted as P, nextTick as N, getCurrentScope as U, onScopeDispose as J, watch as W, getCurrentInstance as j, computed as z, unref as K } from "vue";
2
- function F(e, n) {
3
- return U() ? (J(e, n), !0) : !1;
4
- }
5
- const Q = typeof window < "u" && typeof document < "u";
6
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
- const B = (e) => e != null, Z = Object.prototype.toString, _ = (e) => Z.call(e) === "[object Object]", k = () => {
8
- };
9
- function T(e) {
10
- return Array.isArray(e) ? e : [e];
11
- }
12
- function ee(e) {
13
- return j();
14
- }
15
- function V(e, n = !0, i) {
16
- ee() ? P(e, i) : n ? e() : N(e);
17
- }
18
- // @__NO_SIDE_EFFECTS__
19
- function re(e = !1, n = {}) {
20
- const { truthyValue: i = !0, falsyValue: s = !1 } = n, o = q(e), t = v(e);
21
- function r(f) {
22
- if (arguments.length)
23
- return t.value = f, t.value;
24
- {
25
- const c = S(i);
26
- return t.value = t.value === c ? S(s) : c, t.value;
27
- }
28
- }
29
- return o ? r : [t, r];
30
- }
31
- function te(e, n, i) {
32
- return W(e, n, {
33
- ...i,
34
- immediate: !0
35
- });
36
- }
37
- const X = Q ? window : void 0;
38
- function O(e) {
39
- var n;
40
- const i = S(e);
41
- return (n = i == null ? void 0 : i.$el) !== null && n !== void 0 ? n : i;
42
- }
43
- function E(...e) {
44
- const n = (s, o, t, r) => (s.addEventListener(o, t, r), () => s.removeEventListener(o, t, r)), i = z(() => {
45
- const s = T(S(e[0])).filter((o) => o != null);
46
- return s.every((o) => typeof o != "string") ? s : void 0;
47
- });
48
- return te(() => {
49
- var s, o;
50
- return [
51
- (s = (o = i.value) === null || o === void 0 ? void 0 : o.map((t) => O(t))) !== null && s !== void 0 ? s : [X].filter((t) => t != null),
52
- T(S(i.value ? e[1] : e[0])),
53
- T(K(i.value ? e[2] : e[1])),
54
- S(i.value ? e[3] : e[2])
55
- ];
56
- }, ([s, o, t, r], f, c) => {
57
- if (!(s != null && s.length) || !(o != null && o.length) || !(t != null && t.length)) return;
58
- const p = _(r) ? { ...r } : r, l = s.flatMap((u) => o.flatMap((d) => t.map((m) => n(u, d, m, p))));
59
- c(() => {
60
- l.forEach((u) => u());
61
- });
62
- }, { flush: "post" });
63
- }
64
- // @__NO_SIDE_EFFECTS__
65
- function ne() {
66
- const e = v(!1), n = j();
67
- return n && P(() => {
68
- e.value = !0;
69
- }, n), e;
70
- }
71
- // @__NO_SIDE_EFFECTS__
72
- function L(e) {
73
- const n = /* @__PURE__ */ ne();
74
- return z(() => (n.value, !!e()));
75
- }
76
- function D(e, n, i = {}) {
77
- const { window: s = X, ...o } = i;
78
- let t;
79
- const r = /* @__PURE__ */ L(() => s && "MutationObserver" in s), f = () => {
80
- t && (t.disconnect(), t = void 0);
81
- }, c = W(z(() => {
82
- const u = T(S(e)).map(O).filter(B);
83
- return new Set(u);
84
- }), (u) => {
85
- f(), r.value && u.size && (t = new MutationObserver(n), u.forEach((d) => t.observe(d, o)));
86
- }, {
87
- immediate: !0,
88
- flush: "post"
89
- }), p = () => t == null ? void 0 : t.takeRecords(), l = () => {
90
- c(), f();
91
- };
92
- return F(l), {
93
- isSupported: r,
94
- stop: l,
95
- takeRecords: p
96
- };
97
- }
98
- function G(e, n, i = {}) {
99
- const { window: s = X, ...o } = i;
100
- let t;
101
- const r = /* @__PURE__ */ L(() => s && "ResizeObserver" in s), f = () => {
102
- t && (t.disconnect(), t = void 0);
103
- }, c = W(z(() => {
104
- const l = S(e);
105
- return Array.isArray(l) ? l.map((u) => O(u)) : [O(l)];
106
- }), (l) => {
107
- if (f(), r.value && s) {
108
- t = new ResizeObserver(n);
109
- for (const u of l) u && t.observe(u, o);
110
- }
111
- }, {
112
- immediate: !0,
113
- flush: "post"
114
- }), p = () => {
115
- f(), c();
116
- };
117
- return F(p), {
118
- isSupported: r,
119
- stop: p
120
- };
121
- }
122
- function le(e, n = {}) {
123
- const { reset: i = !0, windowResize: s = !0, windowScroll: o = !0, immediate: t = !0, updateTiming: r = "sync" } = n, f = v(0), c = v(0), p = v(0), l = v(0), u = v(0), d = v(0), m = v(0), b = v(0);
124
- function w() {
125
- const y = O(e);
126
- if (!y) {
127
- i && (f.value = 0, c.value = 0, p.value = 0, l.value = 0, u.value = 0, d.value = 0, m.value = 0, b.value = 0);
128
- return;
129
- }
130
- const h = y.getBoundingClientRect();
131
- f.value = h.height, c.value = h.bottom, p.value = h.left, l.value = h.right, u.value = h.top, d.value = h.width, m.value = h.x, b.value = h.y;
132
- }
133
- function g() {
134
- r === "sync" ? w() : r === "next-frame" && requestAnimationFrame(() => w());
135
- }
136
- return G(e, g), W(() => O(e), (y) => !y && g()), D(e, g, { attributeFilter: ["style", "class"] }), o && E("scroll", g, {
137
- capture: !0,
138
- passive: !0
139
- }), s && E("resize", g, { passive: !0 }), V(() => {
140
- t && g();
141
- }), {
142
- height: f,
143
- bottom: c,
144
- left: p,
145
- right: l,
146
- top: u,
147
- width: d,
148
- x: m,
149
- y: b,
150
- update: g
151
- };
152
- }
153
- function ie(e, n, i = {}) {
154
- const { root: s, rootMargin: o = "0px", threshold: t = 0, window: r = X, immediate: f = !0 } = i, c = /* @__PURE__ */ L(() => r && "IntersectionObserver" in r), p = z(() => T(S(e)).map(O).filter(B));
155
- let l = k;
156
- const u = v(f), d = c.value ? W(() => [
157
- p.value,
158
- O(s),
159
- u.value
160
- ], ([b, w]) => {
161
- if (l(), !u.value || !b.length) return;
162
- const g = new IntersectionObserver(n, {
163
- root: O(w),
164
- rootMargin: o,
165
- threshold: t
166
- });
167
- b.forEach((y) => y && g.observe(y)), l = () => {
168
- g.disconnect(), l = k;
169
- };
170
- }, {
171
- immediate: f,
172
- flush: "post"
173
- }) : k, m = () => {
174
- l(), d(), u.value = !1;
175
- };
176
- return F(m), {
177
- isSupported: c,
178
- isActive: u,
179
- pause() {
180
- l(), u.value = !1;
181
- },
182
- resume() {
183
- u.value = !0;
184
- },
185
- stop: m
186
- };
187
- }
188
- const oe = {
189
- page: (e) => [e.pageX, e.pageY],
190
- client: (e) => [e.clientX, e.clientY],
191
- screen: (e) => [e.screenX, e.screenY],
192
- movement: (e) => e instanceof MouseEvent ? [e.movementX, e.movementY] : null
193
- };
194
- function se(e = {}) {
195
- const { type: n = "page", touch: i = !0, resetOnTouchEnds: s = !1, initialValue: o = {
196
- x: 0,
197
- y: 0
198
- }, window: t = X, target: r = t, scroll: f = !0, eventFilter: c } = e;
199
- let p = null, l = 0, u = 0;
200
- const d = v(o.x), m = v(o.y), b = v(null), w = typeof n == "function" ? n : oe[n], g = (a) => {
201
- const x = w(a);
202
- p = a, x && ([d.value, m.value] = x, b.value = "mouse"), t && (l = t.scrollX, u = t.scrollY);
203
- }, y = (a) => {
204
- if (a.touches.length > 0) {
205
- const x = w(a.touches[0]);
206
- x && ([d.value, m.value] = x, b.value = "touch");
207
- }
208
- }, h = () => {
209
- if (!p || !t) return;
210
- const a = w(p);
211
- p instanceof MouseEvent && a && (d.value = a[0] + t.scrollX - l, m.value = a[1] + t.scrollY - u);
212
- }, R = () => {
213
- d.value = o.x, m.value = o.y;
214
- }, $ = c ? (a) => c(() => g(a), {}) : (a) => g(a), M = c ? (a) => c(() => y(a), {}) : (a) => y(a), Y = c ? () => c(() => h(), {}) : () => h();
215
- if (r) {
216
- const a = { passive: !0 };
217
- E(r, ["mousemove", "dragover"], $, a), i && n !== "movement" && (E(r, ["touchstart", "touchmove"], M, a), s && E(r, "touchend", R, a)), f && n === "page" && E(t, "scroll", Y, a);
218
- }
219
- return {
220
- x: d,
221
- y: m,
222
- sourceType: b
223
- };
224
- }
225
- function ce(e, n = {}) {
226
- const { windowResize: i = !0, windowScroll: s = !0, handleOutside: o = !0, window: t = X } = n, r = n.type || "page", { x: f, y: c, sourceType: p } = se(n), l = v(e ?? (t == null ? void 0 : t.document.body)), u = v(0), d = v(0), m = v(0), b = v(0), w = v(0), g = v(0), y = v(!0);
227
- function h() {
228
- if (!t) return;
229
- const M = O(l);
230
- if (!(!M || !(M instanceof Element)))
231
- for (const Y of M.getClientRects()) {
232
- const { left: a, top: x, width: A, height: C } = Y;
233
- m.value = a + (r === "page" ? t.pageXOffset : 0), b.value = x + (r === "page" ? t.pageYOffset : 0), w.value = C, g.value = A;
234
- const H = f.value - m.value, I = c.value - b.value;
235
- if (y.value = A === 0 || C === 0 || H < 0 || I < 0 || H > A || I > C, (o || !y.value) && (u.value = H, d.value = I), !y.value) break;
236
- }
237
- }
238
- const R = [];
239
- function $() {
240
- R.forEach((M) => M()), R.length = 0;
241
- }
242
- if (V(() => {
243
- h();
244
- }), t) {
245
- const { stop: M } = G(l, h), { stop: Y } = D(l, h, { attributeFilter: ["style", "class"] }), a = W([
246
- l,
247
- f,
248
- c
249
- ], h);
250
- R.push(M, Y, a), E(document, "mouseleave", () => y.value = !0, { passive: !0 }), s && R.push(E("scroll", h, {
251
- capture: !0,
252
- passive: !0
253
- })), i && R.push(E("resize", h, { passive: !0 }));
254
- }
255
- return {
256
- x: f,
257
- y: c,
258
- sourceType: p,
259
- elementX: u,
260
- elementY: d,
261
- elementPositionX: m,
262
- elementPositionY: b,
263
- elementHeight: w,
264
- elementWidth: g,
265
- isOutside: y,
266
- stop: $
267
- };
268
- }
269
- export {
270
- O as a,
271
- re as b,
272
- le as c,
273
- G as d,
274
- ie as e,
275
- ce as u
276
- };
277
- //# sourceMappingURL=index-B1Gkwuxd.js.map