@opentiny/tiny-robot 0.2.0-alpha.5 → 0.2.0-alpha.7
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/dist/action-group/index.js +69 -67
- package/dist/bubble/index.js +261 -259
- package/dist/dropdown-menu/index.js +33 -30
- package/dist/feedback/index.js +44 -44
- package/dist/flow-layout-buttons/index.js +74 -71
- package/dist/index.d.ts +215 -142
- package/dist/index3.js +233 -202
- package/dist/sender/index.js +898 -712
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +156 -98
- package/dist/suggestion-popover/index.js +68 -65
- package/package.json +3 -3
package/dist/index3.js
CHANGED
|
@@ -1,87 +1,117 @@
|
|
|
1
|
-
import { onMounted as
|
|
1
|
+
import { onMounted as te, nextTick as re, watch as _, getCurrentScope as se, onScopeDispose as ue, isRef as ce, getCurrentInstance as B, toValue as g, hasInjectionContext as ne, inject as ae, shallowRef as S, computed as I, reactive as J, unref as de, watchEffect as fe } from "vue";
|
|
2
2
|
function N(e) {
|
|
3
|
-
return
|
|
3
|
+
return se() ? (ue(e), !0) : !1;
|
|
4
4
|
}
|
|
5
|
-
const H = /* @__PURE__ */ new WeakMap(),
|
|
5
|
+
const H = /* @__PURE__ */ new WeakMap(), ve = (...e) => {
|
|
6
6
|
var t;
|
|
7
7
|
const o = e[0], n = (t = B()) == null ? void 0 : t.proxy;
|
|
8
|
-
if (n == null && !
|
|
8
|
+
if (n == null && !ne())
|
|
9
9
|
throw new Error("injectLocal must be called in setup");
|
|
10
|
-
return n && H.has(n) && o in H.get(n) ? H.get(n)[o] :
|
|
11
|
-
},
|
|
10
|
+
return n && H.has(n) && o in H.get(n) ? H.get(n)[o] : ae(...e);
|
|
11
|
+
}, oe = typeof window < "u" && typeof document < "u";
|
|
12
12
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
13
|
-
const
|
|
14
|
-
},
|
|
15
|
-
function
|
|
13
|
+
const he = (e) => e != null, me = Object.prototype.toString, pe = (e) => me.call(e) === "[object Object]", x = () => {
|
|
14
|
+
}, we = /* @__PURE__ */ be();
|
|
15
|
+
function be() {
|
|
16
16
|
var e, t;
|
|
17
|
-
return
|
|
17
|
+
return oe && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function $(e, t) {
|
|
20
20
|
function o(...n) {
|
|
21
|
-
return new Promise((
|
|
22
|
-
Promise.resolve(e(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(
|
|
21
|
+
return new Promise((v, c) => {
|
|
22
|
+
Promise.resolve(e(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(v).catch(c);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
return o;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const ge = (e) => e();
|
|
28
|
+
function ie(e, t = {}) {
|
|
29
|
+
let o, n, v = x;
|
|
30
|
+
const c = (l) => {
|
|
31
|
+
clearTimeout(l), v(), v = x;
|
|
31
32
|
};
|
|
32
33
|
let d;
|
|
33
34
|
return (l) => {
|
|
34
|
-
const s = g(e),
|
|
35
|
-
return o &&
|
|
36
|
-
|
|
37
|
-
o &&
|
|
38
|
-
},
|
|
39
|
-
n &&
|
|
35
|
+
const s = g(e), h = g(t.maxWait);
|
|
36
|
+
return o && c(o), s <= 0 || h !== void 0 && h <= 0 ? (n && (c(n), n = null), Promise.resolve(l())) : new Promise((r, a) => {
|
|
37
|
+
v = t.rejectOnCancel ? a : r, d = l, h && !n && (n = setTimeout(() => {
|
|
38
|
+
o && c(o), n = null, r(d());
|
|
39
|
+
}, h)), o = setTimeout(() => {
|
|
40
|
+
n && c(n), n = null, r(l());
|
|
40
41
|
}, s);
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
let t = 0, o, n = !0,
|
|
46
|
-
!
|
|
47
|
-
const
|
|
48
|
-
o && (clearTimeout(o), o = void 0,
|
|
45
|
+
function Se(...e) {
|
|
46
|
+
let t = 0, o, n = !0, v = x, c, d, i, l, s;
|
|
47
|
+
!ce(e[0]) && typeof e[0] == "object" ? { delay: d, trailing: i = !0, leading: l = !0, rejectOnCancel: s = !1 } = e[0] : [d, i = !0, l = !0, s = !1] = e;
|
|
48
|
+
const h = () => {
|
|
49
|
+
o && (clearTimeout(o), o = void 0, v(), v = x);
|
|
49
50
|
};
|
|
50
|
-
return (
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
t = Date.now(), n = !0, u(y()),
|
|
55
|
-
}, Math.max(0,
|
|
56
|
-
})), !l && !o && (o = setTimeout(() => n = !0,
|
|
51
|
+
return (a) => {
|
|
52
|
+
const m = g(d), b = Date.now() - t, y = () => c = a();
|
|
53
|
+
return h(), m <= 0 ? (t = Date.now(), y()) : (b > m && (l || !n) ? (t = Date.now(), y()) : i && (c = new Promise((u, f) => {
|
|
54
|
+
v = s ? f : u, o = setTimeout(() => {
|
|
55
|
+
t = Date.now(), n = !0, u(y()), h();
|
|
56
|
+
}, Math.max(0, m - b));
|
|
57
|
+
})), !l && !o && (o = setTimeout(() => n = !0, m)), n = !1, c);
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function K(e) {
|
|
60
61
|
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function D(e) {
|
|
63
64
|
return Array.isArray(e) ? e : [e];
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function ye(e) {
|
|
66
67
|
return B();
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
70
|
-
|
|
69
|
+
function Ee(e, t = 200, o = {}) {
|
|
70
|
+
return $(
|
|
71
|
+
ie(t, o),
|
|
71
72
|
e
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
76
|
-
|
|
75
|
+
function Te(e, t = 200, o = !1, n = !0, v = !1) {
|
|
76
|
+
return $(
|
|
77
|
+
Se(t, o, n, v),
|
|
77
78
|
e
|
|
78
79
|
);
|
|
79
80
|
}
|
|
81
|
+
function xe(e, t, o = {}) {
|
|
82
|
+
const {
|
|
83
|
+
eventFilter: n = ge,
|
|
84
|
+
...v
|
|
85
|
+
} = o;
|
|
86
|
+
return _(
|
|
87
|
+
e,
|
|
88
|
+
$(
|
|
89
|
+
n,
|
|
90
|
+
t
|
|
91
|
+
),
|
|
92
|
+
v
|
|
93
|
+
);
|
|
94
|
+
}
|
|
80
95
|
function V(e, t = !0, o) {
|
|
81
|
-
|
|
96
|
+
ye() ? te(e, o) : t ? e() : re(e);
|
|
82
97
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
98
|
+
function _e(e, t, o = {}) {
|
|
99
|
+
const {
|
|
100
|
+
debounce: n = 0,
|
|
101
|
+
maxWait: v = void 0,
|
|
102
|
+
...c
|
|
103
|
+
} = o;
|
|
104
|
+
return xe(
|
|
105
|
+
e,
|
|
106
|
+
t,
|
|
107
|
+
{
|
|
108
|
+
...c,
|
|
109
|
+
eventFilter: ie(n, { maxWait: v })
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function We(e, t, o) {
|
|
114
|
+
return _(
|
|
85
115
|
e,
|
|
86
116
|
t,
|
|
87
117
|
{
|
|
@@ -90,59 +120,59 @@ function Te(e, t, o) {
|
|
|
90
120
|
}
|
|
91
121
|
);
|
|
92
122
|
}
|
|
93
|
-
const R =
|
|
123
|
+
const R = oe ? window : void 0;
|
|
94
124
|
function E(e) {
|
|
95
125
|
var t;
|
|
96
126
|
const o = g(e);
|
|
97
127
|
return (t = o == null ? void 0 : o.$el) != null ? t : o;
|
|
98
128
|
}
|
|
99
|
-
function
|
|
129
|
+
function W(...e) {
|
|
100
130
|
const t = [], o = () => {
|
|
101
131
|
t.forEach((i) => i()), t.length = 0;
|
|
102
|
-
}, n = (i, l, s,
|
|
103
|
-
const i =
|
|
132
|
+
}, n = (i, l, s, h) => (i.addEventListener(l, s, h), () => i.removeEventListener(l, s, h)), v = I(() => {
|
|
133
|
+
const i = D(g(e[0])).filter((l) => l != null);
|
|
104
134
|
return i.every((l) => typeof l != "string") ? i : void 0;
|
|
105
|
-
}),
|
|
135
|
+
}), c = We(
|
|
106
136
|
() => {
|
|
107
137
|
var i, l;
|
|
108
138
|
return [
|
|
109
|
-
(l = (i =
|
|
110
|
-
|
|
111
|
-
|
|
139
|
+
(l = (i = v.value) == null ? void 0 : i.map((s) => E(s))) != null ? l : [R].filter((s) => s != null),
|
|
140
|
+
D(g(v.value ? e[1] : e[0])),
|
|
141
|
+
D(de(v.value ? e[2] : e[1])),
|
|
112
142
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
113
|
-
g(
|
|
143
|
+
g(v.value ? e[3] : e[2])
|
|
114
144
|
];
|
|
115
145
|
},
|
|
116
|
-
([i, l, s,
|
|
146
|
+
([i, l, s, h]) => {
|
|
117
147
|
if (o(), !(i != null && i.length) || !(l != null && l.length) || !(s != null && s.length))
|
|
118
148
|
return;
|
|
119
|
-
const r =
|
|
149
|
+
const r = pe(h) ? { ...h } : h;
|
|
120
150
|
t.push(
|
|
121
151
|
...i.flatMap(
|
|
122
|
-
(
|
|
123
|
-
(
|
|
152
|
+
(a) => l.flatMap(
|
|
153
|
+
(m) => s.map((b) => n(a, m, b, r))
|
|
124
154
|
)
|
|
125
155
|
)
|
|
126
156
|
);
|
|
127
157
|
},
|
|
128
158
|
{ flush: "post" }
|
|
129
159
|
), d = () => {
|
|
130
|
-
|
|
160
|
+
c(), o();
|
|
131
161
|
};
|
|
132
162
|
return N(o), d;
|
|
133
163
|
}
|
|
134
|
-
let
|
|
135
|
-
function
|
|
136
|
-
const { window: n = R, ignore:
|
|
164
|
+
let Z = !1;
|
|
165
|
+
function Fe(e, t, o = {}) {
|
|
166
|
+
const { window: n = R, ignore: v = [], capture: c = !0, detectIframe: d = !1, controls: i = !1 } = o;
|
|
137
167
|
if (!n)
|
|
138
168
|
return i ? { stop: x, cancel: x, trigger: x } : x;
|
|
139
|
-
if (
|
|
140
|
-
|
|
169
|
+
if (we && !Z) {
|
|
170
|
+
Z = !0;
|
|
141
171
|
const u = { passive: !0 };
|
|
142
|
-
Array.from(n.document.body.children).forEach((f) =>
|
|
172
|
+
Array.from(n.document.body.children).forEach((f) => W(f, "click", x, u)), W(n.document.documentElement, "click", x, u);
|
|
143
173
|
}
|
|
144
174
|
let l = !0;
|
|
145
|
-
const s = (u) => g(
|
|
175
|
+
const s = (u) => g(v).some((f) => {
|
|
146
176
|
if (typeof f == "string")
|
|
147
177
|
return Array.from(n.document.querySelectorAll(f)).some((p) => p === u.target || u.composedPath().includes(p));
|
|
148
178
|
{
|
|
@@ -150,17 +180,17 @@ function Pe(e, t, o = {}) {
|
|
|
150
180
|
return p && (u.target === p || u.composedPath().includes(p));
|
|
151
181
|
}
|
|
152
182
|
});
|
|
153
|
-
function
|
|
183
|
+
function h(u) {
|
|
154
184
|
const f = g(u);
|
|
155
185
|
return f && f.$.subTree.shapeFlag === 16;
|
|
156
186
|
}
|
|
157
187
|
function r(u, f) {
|
|
158
|
-
const p = g(u),
|
|
159
|
-
return
|
|
188
|
+
const p = g(u), F = p.$.subTree && p.$.subTree.children;
|
|
189
|
+
return F == null || !Array.isArray(F) ? !1 : F.some((L) => L.el === f.target || f.composedPath().includes(L.el));
|
|
160
190
|
}
|
|
161
|
-
const
|
|
191
|
+
const a = (u) => {
|
|
162
192
|
const f = E(e);
|
|
163
|
-
if (u.target != null && !(!(f instanceof Element) &&
|
|
193
|
+
if (u.target != null && !(!(f instanceof Element) && h(e) && r(e, u)) && !(!f || f === u.target || u.composedPath().includes(f))) {
|
|
164
194
|
if ("detail" in u && u.detail === 0 && (l = !s(u)), !l) {
|
|
165
195
|
l = !0;
|
|
166
196
|
return;
|
|
@@ -168,18 +198,18 @@ function Pe(e, t, o = {}) {
|
|
|
168
198
|
t(u);
|
|
169
199
|
}
|
|
170
200
|
};
|
|
171
|
-
let
|
|
201
|
+
let m = !1;
|
|
172
202
|
const b = [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}, 0),
|
|
177
|
-
}, { passive: !0, capture:
|
|
178
|
-
|
|
203
|
+
W(n, "click", (u) => {
|
|
204
|
+
m || (m = !0, setTimeout(() => {
|
|
205
|
+
m = !1;
|
|
206
|
+
}, 0), a(u));
|
|
207
|
+
}, { passive: !0, capture: c }),
|
|
208
|
+
W(n, "pointerdown", (u) => {
|
|
179
209
|
const f = E(e);
|
|
180
210
|
l = !s(u) && !!(f && !u.composedPath().includes(f));
|
|
181
211
|
}, { passive: !0 }),
|
|
182
|
-
d &&
|
|
212
|
+
d && W(n, "blur", (u) => {
|
|
183
213
|
setTimeout(() => {
|
|
184
214
|
var f;
|
|
185
215
|
const p = E(e);
|
|
@@ -193,145 +223,145 @@ function Pe(e, t, o = {}) {
|
|
|
193
223
|
l = !1;
|
|
194
224
|
},
|
|
195
225
|
trigger: (u) => {
|
|
196
|
-
l = !0,
|
|
226
|
+
l = !0, a(u), l = !1;
|
|
197
227
|
}
|
|
198
228
|
} : y;
|
|
199
229
|
}
|
|
200
|
-
function
|
|
230
|
+
function Me() {
|
|
201
231
|
const e = S(!1), t = B();
|
|
202
|
-
return t &&
|
|
232
|
+
return t && te(() => {
|
|
203
233
|
e.value = !0;
|
|
204
234
|
}, t), e;
|
|
205
235
|
}
|
|
206
|
-
function
|
|
207
|
-
const t =
|
|
236
|
+
function G(e) {
|
|
237
|
+
const t = Me();
|
|
208
238
|
return I(() => (t.value, !!e()));
|
|
209
239
|
}
|
|
210
|
-
function
|
|
211
|
-
const { window: n = R, ...
|
|
212
|
-
let
|
|
213
|
-
const d =
|
|
214
|
-
|
|
240
|
+
function Oe(e, t, o = {}) {
|
|
241
|
+
const { window: n = R, ...v } = o;
|
|
242
|
+
let c;
|
|
243
|
+
const d = G(() => n && "MutationObserver" in n), i = () => {
|
|
244
|
+
c && (c.disconnect(), c = void 0);
|
|
215
245
|
}, l = I(() => {
|
|
216
|
-
const
|
|
217
|
-
return new Set(
|
|
218
|
-
}), s =
|
|
246
|
+
const a = g(e), m = D(a).map(E).filter(he);
|
|
247
|
+
return new Set(m);
|
|
248
|
+
}), s = _(
|
|
219
249
|
() => l.value,
|
|
220
|
-
(
|
|
221
|
-
i(), d.value &&
|
|
250
|
+
(a) => {
|
|
251
|
+
i(), d.value && a.size && (c = new MutationObserver(t), a.forEach((m) => c.observe(m, v)));
|
|
222
252
|
},
|
|
223
253
|
{ immediate: !0, flush: "post" }
|
|
224
|
-
),
|
|
254
|
+
), h = () => c == null ? void 0 : c.takeRecords(), r = () => {
|
|
225
255
|
s(), i();
|
|
226
256
|
};
|
|
227
257
|
return N(r), {
|
|
228
258
|
isSupported: d,
|
|
229
259
|
stop: r,
|
|
230
|
-
takeRecords:
|
|
260
|
+
takeRecords: h
|
|
231
261
|
};
|
|
232
262
|
}
|
|
233
|
-
const
|
|
234
|
-
function
|
|
235
|
-
const e =
|
|
263
|
+
const Ie = Symbol("vueuse-ssr-width");
|
|
264
|
+
function Re() {
|
|
265
|
+
const e = ne() ? ve(Ie, null) : null;
|
|
236
266
|
return typeof e == "number" ? e : void 0;
|
|
237
267
|
}
|
|
238
|
-
function
|
|
239
|
-
const { window: o = R, ssrWidth: n =
|
|
268
|
+
function Pe(e, t = {}) {
|
|
269
|
+
const { window: o = R, ssrWidth: n = Re() } = t, v = G(() => o && "matchMedia" in o && typeof o.matchMedia == "function"), c = S(typeof n == "number"), d = S(), i = S(!1), l = (s) => {
|
|
240
270
|
i.value = s.matches;
|
|
241
271
|
};
|
|
242
|
-
return
|
|
243
|
-
if (
|
|
244
|
-
|
|
272
|
+
return fe(() => {
|
|
273
|
+
if (c.value) {
|
|
274
|
+
c.value = !v.value;
|
|
245
275
|
const s = g(e).split(",");
|
|
246
|
-
i.value = s.some((
|
|
247
|
-
const r =
|
|
248
|
-
let b = !!(
|
|
249
|
-
return
|
|
276
|
+
i.value = s.some((h) => {
|
|
277
|
+
const r = h.includes("not all"), a = h.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = h.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
278
|
+
let b = !!(a || m);
|
|
279
|
+
return a && b && (b = n >= K(a[1])), m && b && (b = n <= K(m[1])), r ? !b : b;
|
|
250
280
|
});
|
|
251
281
|
return;
|
|
252
282
|
}
|
|
253
|
-
|
|
254
|
-
}),
|
|
283
|
+
v.value && (d.value = o.matchMedia(g(e)), i.value = d.value.matches);
|
|
284
|
+
}), W(d, "change", l, { passive: !0 }), I(() => i.value);
|
|
255
285
|
}
|
|
256
|
-
function
|
|
257
|
-
const { window: n = R, ...
|
|
258
|
-
let
|
|
259
|
-
const d =
|
|
260
|
-
|
|
286
|
+
function le(e, t, o = {}) {
|
|
287
|
+
const { window: n = R, ...v } = o;
|
|
288
|
+
let c;
|
|
289
|
+
const d = G(() => n && "ResizeObserver" in n), i = () => {
|
|
290
|
+
c && (c.disconnect(), c = void 0);
|
|
261
291
|
}, l = I(() => {
|
|
262
292
|
const r = g(e);
|
|
263
|
-
return Array.isArray(r) ? r.map((
|
|
264
|
-
}), s =
|
|
293
|
+
return Array.isArray(r) ? r.map((a) => E(a)) : [E(r)];
|
|
294
|
+
}), s = _(
|
|
265
295
|
l,
|
|
266
296
|
(r) => {
|
|
267
297
|
if (i(), d.value && n) {
|
|
268
|
-
|
|
269
|
-
for (const
|
|
270
|
-
|
|
298
|
+
c = new ResizeObserver(t);
|
|
299
|
+
for (const a of r)
|
|
300
|
+
a && c.observe(a, v);
|
|
271
301
|
}
|
|
272
302
|
},
|
|
273
303
|
{ immediate: !0, flush: "post" }
|
|
274
|
-
),
|
|
304
|
+
), h = () => {
|
|
275
305
|
i(), s();
|
|
276
306
|
};
|
|
277
|
-
return N(
|
|
307
|
+
return N(h), {
|
|
278
308
|
isSupported: d,
|
|
279
|
-
stop:
|
|
309
|
+
stop: h
|
|
280
310
|
};
|
|
281
311
|
}
|
|
282
|
-
function
|
|
312
|
+
function Ce(e, t = {}) {
|
|
283
313
|
const {
|
|
284
314
|
reset: o = !0,
|
|
285
315
|
windowResize: n = !0,
|
|
286
|
-
windowScroll:
|
|
287
|
-
immediate:
|
|
316
|
+
windowScroll: v = !0,
|
|
317
|
+
immediate: c = !0,
|
|
288
318
|
updateTiming: d = "sync"
|
|
289
|
-
} = t, i = S(0), l = S(0), s = S(0),
|
|
319
|
+
} = t, i = S(0), l = S(0), s = S(0), h = S(0), r = S(0), a = S(0), m = S(0), b = S(0);
|
|
290
320
|
function y() {
|
|
291
321
|
const f = E(e);
|
|
292
322
|
if (!f) {
|
|
293
|
-
o && (i.value = 0, l.value = 0, s.value = 0,
|
|
323
|
+
o && (i.value = 0, l.value = 0, s.value = 0, h.value = 0, r.value = 0, a.value = 0, m.value = 0, b.value = 0);
|
|
294
324
|
return;
|
|
295
325
|
}
|
|
296
326
|
const p = f.getBoundingClientRect();
|
|
297
|
-
i.value = p.height, l.value = p.bottom, s.value = p.left,
|
|
327
|
+
i.value = p.height, l.value = p.bottom, s.value = p.left, h.value = p.right, r.value = p.top, a.value = p.width, m.value = p.x, b.value = p.y;
|
|
298
328
|
}
|
|
299
329
|
function u() {
|
|
300
330
|
d === "sync" ? y() : d === "next-frame" && requestAnimationFrame(() => y());
|
|
301
331
|
}
|
|
302
|
-
return
|
|
332
|
+
return le(e, u), _(() => E(e), (f) => !f && u()), Oe(e, u, {
|
|
303
333
|
attributeFilter: ["style", "class"]
|
|
304
|
-
}),
|
|
305
|
-
|
|
334
|
+
}), v && W("scroll", u, { capture: !0, passive: !0 }), n && W("resize", u, { passive: !0 }), V(() => {
|
|
335
|
+
c && u();
|
|
306
336
|
}), {
|
|
307
337
|
height: i,
|
|
308
338
|
bottom: l,
|
|
309
339
|
left: s,
|
|
310
|
-
right:
|
|
340
|
+
right: h,
|
|
311
341
|
top: r,
|
|
312
|
-
width:
|
|
313
|
-
x:
|
|
342
|
+
width: a,
|
|
343
|
+
x: m,
|
|
314
344
|
y: b,
|
|
315
345
|
update: u
|
|
316
346
|
};
|
|
317
347
|
}
|
|
318
|
-
function
|
|
319
|
-
const { window: n = R, box:
|
|
320
|
-
var r,
|
|
321
|
-
return (
|
|
322
|
-
}), d = S(t.width), i = S(t.height), { stop: l } =
|
|
348
|
+
function ke(e, t = { width: 0, height: 0 }, o = {}) {
|
|
349
|
+
const { window: n = R, box: v = "content-box" } = o, c = I(() => {
|
|
350
|
+
var r, a;
|
|
351
|
+
return (a = (r = E(e)) == null ? void 0 : r.namespaceURI) == null ? void 0 : a.includes("svg");
|
|
352
|
+
}), d = S(t.width), i = S(t.height), { stop: l } = le(
|
|
323
353
|
e,
|
|
324
354
|
([r]) => {
|
|
325
|
-
const
|
|
326
|
-
if (n &&
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const b =
|
|
355
|
+
const a = v === "border-box" ? r.borderBoxSize : v === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
|
|
356
|
+
if (n && c.value) {
|
|
357
|
+
const m = E(e);
|
|
358
|
+
if (m) {
|
|
359
|
+
const b = m.getBoundingClientRect();
|
|
330
360
|
d.value = b.width, i.value = b.height;
|
|
331
361
|
}
|
|
332
|
-
} else if (
|
|
333
|
-
const
|
|
334
|
-
d.value =
|
|
362
|
+
} else if (a) {
|
|
363
|
+
const m = D(a);
|
|
364
|
+
d.value = m.reduce((b, { inlineSize: y }) => b + y, 0), i.value = m.reduce((b, { blockSize: y }) => b + y, 0);
|
|
335
365
|
} else
|
|
336
366
|
d.value = r.contentRect.width, i.value = r.contentRect.height;
|
|
337
367
|
},
|
|
@@ -341,28 +371,28 @@ function _e(e, t = { width: 0, height: 0 }, o = {}) {
|
|
|
341
371
|
const r = E(e);
|
|
342
372
|
r && (d.value = "offsetWidth" in r ? r.offsetWidth : t.width, i.value = "offsetHeight" in r ? r.offsetHeight : t.height);
|
|
343
373
|
});
|
|
344
|
-
const s =
|
|
374
|
+
const s = _(
|
|
345
375
|
() => E(e),
|
|
346
376
|
(r) => {
|
|
347
377
|
d.value = r ? t.width : 0, i.value = r ? t.height : 0;
|
|
348
378
|
}
|
|
349
379
|
);
|
|
350
|
-
function
|
|
380
|
+
function h() {
|
|
351
381
|
l(), s();
|
|
352
382
|
}
|
|
353
383
|
return {
|
|
354
384
|
width: d,
|
|
355
385
|
height: i,
|
|
356
|
-
stop:
|
|
386
|
+
stop: h
|
|
357
387
|
};
|
|
358
388
|
}
|
|
359
|
-
const
|
|
360
|
-
function
|
|
389
|
+
const ee = 1;
|
|
390
|
+
function De(e, t = {}) {
|
|
361
391
|
const {
|
|
362
392
|
throttle: o = 0,
|
|
363
393
|
idle: n = 200,
|
|
364
|
-
onStop:
|
|
365
|
-
onScroll:
|
|
394
|
+
onStop: v = x,
|
|
395
|
+
onScroll: c = x,
|
|
366
396
|
offset: d = {
|
|
367
397
|
left: 0,
|
|
368
398
|
right: 0,
|
|
@@ -375,10 +405,10 @@ function Ce(e, t = {}) {
|
|
|
375
405
|
},
|
|
376
406
|
behavior: l = "auto",
|
|
377
407
|
window: s = R,
|
|
378
|
-
onError:
|
|
408
|
+
onError: h = (w) => {
|
|
379
409
|
console.error(w);
|
|
380
410
|
}
|
|
381
|
-
} = t, r = S(0),
|
|
411
|
+
} = t, r = S(0), a = S(0), m = I({
|
|
382
412
|
get() {
|
|
383
413
|
return r.value;
|
|
384
414
|
},
|
|
@@ -387,62 +417,62 @@ function Ce(e, t = {}) {
|
|
|
387
417
|
}
|
|
388
418
|
}), b = I({
|
|
389
419
|
get() {
|
|
390
|
-
return
|
|
420
|
+
return a.value;
|
|
391
421
|
},
|
|
392
422
|
set(w) {
|
|
393
423
|
y(void 0, w);
|
|
394
424
|
}
|
|
395
425
|
});
|
|
396
426
|
function y(w, P) {
|
|
397
|
-
var T,
|
|
427
|
+
var T, C, k, j;
|
|
398
428
|
if (!s)
|
|
399
429
|
return;
|
|
400
|
-
const
|
|
401
|
-
if (!
|
|
430
|
+
const M = g(e);
|
|
431
|
+
if (!M)
|
|
402
432
|
return;
|
|
403
|
-
(
|
|
433
|
+
(k = M instanceof Document ? s.document.body : M) == null || k.scrollTo({
|
|
404
434
|
top: (T = g(P)) != null ? T : b.value,
|
|
405
|
-
left: (
|
|
435
|
+
left: (C = g(w)) != null ? C : m.value,
|
|
406
436
|
behavior: g(l)
|
|
407
437
|
});
|
|
408
|
-
const O = ((
|
|
409
|
-
|
|
438
|
+
const O = ((j = M == null ? void 0 : M.document) == null ? void 0 : j.documentElement) || (M == null ? void 0 : M.documentElement) || M;
|
|
439
|
+
m != null && (r.value = O.scrollLeft), b != null && (a.value = O.scrollTop);
|
|
410
440
|
}
|
|
411
|
-
const u = S(!1), f =
|
|
441
|
+
const u = S(!1), f = J({
|
|
412
442
|
left: !0,
|
|
413
443
|
right: !1,
|
|
414
444
|
top: !0,
|
|
415
445
|
bottom: !1
|
|
416
|
-
}), p =
|
|
446
|
+
}), p = J({
|
|
417
447
|
left: !1,
|
|
418
448
|
right: !1,
|
|
419
449
|
top: !1,
|
|
420
450
|
bottom: !1
|
|
421
|
-
}),
|
|
422
|
-
u.value && (u.value = !1, p.left = !1, p.right = !1, p.top = !1, p.bottom = !1,
|
|
423
|
-
},
|
|
451
|
+
}), F = (w) => {
|
|
452
|
+
u.value && (u.value = !1, p.left = !1, p.right = !1, p.top = !1, p.bottom = !1, v(w));
|
|
453
|
+
}, L = Ee(F, o + n), z = (w) => {
|
|
424
454
|
var P;
|
|
425
455
|
if (!s)
|
|
426
456
|
return;
|
|
427
|
-
const T = ((P = w == null ? void 0 : w.document) == null ? void 0 : P.documentElement) || (w == null ? void 0 : w.documentElement) || E(w), { display:
|
|
457
|
+
const T = ((P = w == null ? void 0 : w.document) == null ? void 0 : P.documentElement) || (w == null ? void 0 : w.documentElement) || E(w), { display: C, flexDirection: k, direction: j } = getComputedStyle(T), M = j === "rtl" ? -1 : 1, O = T.scrollLeft;
|
|
428
458
|
p.left = O < r.value, p.right = O > r.value;
|
|
429
|
-
const
|
|
430
|
-
|
|
459
|
+
const Q = Math.abs(O * M) <= (d.left || 0), X = Math.abs(O * M) + T.clientWidth >= T.scrollWidth - (d.right || 0) - ee;
|
|
460
|
+
C === "flex" && k === "row-reverse" ? (f.left = X, f.right = Q) : (f.left = Q, f.right = X), r.value = O;
|
|
431
461
|
let A = T.scrollTop;
|
|
432
|
-
w === s.document && !A && (A = s.document.body.scrollTop), p.top = A <
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
},
|
|
462
|
+
w === s.document && !A && (A = s.document.body.scrollTop), p.top = A < a.value, p.bottom = A > a.value;
|
|
463
|
+
const U = Math.abs(A) <= (d.top || 0), q = Math.abs(A) + T.clientHeight >= T.scrollHeight - (d.bottom || 0) - ee;
|
|
464
|
+
C === "flex" && k === "column-reverse" ? (f.top = q, f.bottom = U) : (f.top = U, f.bottom = q), a.value = A;
|
|
465
|
+
}, Y = (w) => {
|
|
436
466
|
var P;
|
|
437
467
|
if (!s)
|
|
438
468
|
return;
|
|
439
469
|
const T = (P = w.target.documentElement) != null ? P : w.target;
|
|
440
|
-
z(T), u.value = !0,
|
|
470
|
+
z(T), u.value = !0, L(w), c(w);
|
|
441
471
|
};
|
|
442
|
-
return
|
|
472
|
+
return W(
|
|
443
473
|
e,
|
|
444
474
|
"scroll",
|
|
445
|
-
o ?
|
|
475
|
+
o ? Te(Y, o, !0, !1) : Y,
|
|
446
476
|
i
|
|
447
477
|
), V(() => {
|
|
448
478
|
try {
|
|
@@ -451,15 +481,15 @@ function Ce(e, t = {}) {
|
|
|
451
481
|
return;
|
|
452
482
|
z(w);
|
|
453
483
|
} catch (w) {
|
|
454
|
-
|
|
484
|
+
h(w);
|
|
455
485
|
}
|
|
456
|
-
}),
|
|
486
|
+
}), W(
|
|
457
487
|
e,
|
|
458
488
|
"scrollend",
|
|
459
|
-
|
|
489
|
+
F,
|
|
460
490
|
i
|
|
461
491
|
), {
|
|
462
|
-
x:
|
|
492
|
+
x: m,
|
|
463
493
|
y: b,
|
|
464
494
|
isScrolling: u,
|
|
465
495
|
arrivedState: f,
|
|
@@ -470,36 +500,37 @@ function Ce(e, t = {}) {
|
|
|
470
500
|
}
|
|
471
501
|
};
|
|
472
502
|
}
|
|
473
|
-
function
|
|
503
|
+
function Le(e = {}) {
|
|
474
504
|
const {
|
|
475
505
|
window: t = R,
|
|
476
506
|
initialWidth: o = Number.POSITIVE_INFINITY,
|
|
477
507
|
initialHeight: n = Number.POSITIVE_INFINITY,
|
|
478
|
-
listenOrientation:
|
|
479
|
-
includeScrollbar:
|
|
508
|
+
listenOrientation: v = !0,
|
|
509
|
+
includeScrollbar: c = !0,
|
|
480
510
|
type: d = "inner"
|
|
481
511
|
} = e, i = S(o), l = S(n), s = () => {
|
|
482
512
|
if (t)
|
|
483
513
|
if (d === "outer")
|
|
484
514
|
i.value = t.outerWidth, l.value = t.outerHeight;
|
|
485
515
|
else if (d === "visual" && t.visualViewport) {
|
|
486
|
-
const { width: r, height:
|
|
487
|
-
i.value = Math.round(r *
|
|
488
|
-
} else
|
|
516
|
+
const { width: r, height: a, scale: m } = t.visualViewport;
|
|
517
|
+
i.value = Math.round(r * m), l.value = Math.round(a * m);
|
|
518
|
+
} else c ? (i.value = t.innerWidth, l.value = t.innerHeight) : (i.value = t.document.documentElement.clientWidth, l.value = t.document.documentElement.clientHeight);
|
|
489
519
|
};
|
|
490
520
|
s(), V(s);
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
const r =
|
|
494
|
-
|
|
521
|
+
const h = { passive: !0 };
|
|
522
|
+
if (W("resize", s, h), t && d === "visual" && t.visualViewport && W(t.visualViewport, "resize", s, h), v) {
|
|
523
|
+
const r = Pe("(orientation: portrait)");
|
|
524
|
+
_(r, () => s());
|
|
495
525
|
}
|
|
496
526
|
return { width: i, height: l };
|
|
497
527
|
}
|
|
498
528
|
export {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
529
|
+
ke as a,
|
|
530
|
+
Le as b,
|
|
531
|
+
Pe as c,
|
|
532
|
+
De as d,
|
|
533
|
+
Fe as o,
|
|
534
|
+
Ce as u,
|
|
535
|
+
_e as w
|
|
505
536
|
};
|