@xto/core 1.0.3 → 1.2.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/es/hooks/index.mjs +30 -14
- package/es/index.mjs +807 -75
- package/es/theme/index.mjs +165 -45
- package/es/utils/index.mjs +181 -105
- package/lib/hooks/index.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/utils/index.cjs +1 -1
- package/package.json +12 -7
package/es/hooks/index.mjs
CHANGED
|
@@ -88,7 +88,7 @@ function O(t) {
|
|
|
88
88
|
document.removeEventListener("keydown", e);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function T(t, e) {
|
|
92
92
|
let s = null;
|
|
93
93
|
const n = () => {
|
|
94
94
|
s && (s.disconnect(), s = null);
|
|
@@ -104,7 +104,7 @@ function F(t, e) {
|
|
|
104
104
|
{ immediate: !0 }
|
|
105
105
|
), i(n);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function F(t, e = {
|
|
108
108
|
attributes: !0,
|
|
109
109
|
childList: !0,
|
|
110
110
|
subtree: !0
|
|
@@ -120,7 +120,7 @@ function I(t, e = {
|
|
|
120
120
|
n == null || n.disconnect();
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function I(t, e) {
|
|
124
124
|
const s = () => {
|
|
125
125
|
const n = t.value;
|
|
126
126
|
if (n && n !== window) {
|
|
@@ -137,7 +137,7 @@ function M(t, e) {
|
|
|
137
137
|
(n = t.value) == null || n.removeEventListener("scroll", s);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function M(t, e) {
|
|
141
141
|
const s = l(!1), n = () => {
|
|
142
142
|
s.value = !0, e == null || e(!0);
|
|
143
143
|
}, u = () => {
|
|
@@ -156,34 +156,50 @@ function T(t, e) {
|
|
|
156
156
|
focused: s
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function D(t, e, s = {
|
|
160
160
|
threshold: 0
|
|
161
161
|
}) {
|
|
162
162
|
let n = null;
|
|
163
163
|
c(
|
|
164
164
|
t,
|
|
165
165
|
(u) => {
|
|
166
|
-
n && n.disconnect(), u && typeof IntersectionObserver < "u" && (n = new IntersectionObserver(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
n && n.disconnect(), u && typeof IntersectionObserver < "u" && (n = new IntersectionObserver(
|
|
167
|
+
(o) => {
|
|
168
|
+
const r = o[0];
|
|
169
|
+
e(r.isIntersecting);
|
|
170
|
+
},
|
|
171
|
+
s
|
|
172
|
+
), n.observe(u));
|
|
170
173
|
},
|
|
171
174
|
{ immediate: !0 }
|
|
172
175
|
), i(() => {
|
|
173
176
|
n == null || n.disconnect();
|
|
174
177
|
});
|
|
175
178
|
}
|
|
179
|
+
function R(t = 300) {
|
|
180
|
+
let e = null;
|
|
181
|
+
const s = (u) => {
|
|
182
|
+
n(), e = setTimeout(u, t);
|
|
183
|
+
}, n = () => {
|
|
184
|
+
e && (clearTimeout(e), e = null);
|
|
185
|
+
};
|
|
186
|
+
return i(n), {
|
|
187
|
+
execute: s,
|
|
188
|
+
cancel: n
|
|
189
|
+
};
|
|
190
|
+
}
|
|
176
191
|
export {
|
|
177
192
|
y as useClickOutside,
|
|
178
|
-
|
|
193
|
+
F as useDOMObserver,
|
|
194
|
+
R as useDelayedAction,
|
|
179
195
|
p as useDisabled,
|
|
180
196
|
O as useEscape,
|
|
181
|
-
|
|
182
|
-
|
|
197
|
+
M as useFocus,
|
|
198
|
+
D as useIntersectionObserver,
|
|
183
199
|
E as useLoading,
|
|
184
200
|
L as useModel,
|
|
185
|
-
|
|
186
|
-
|
|
201
|
+
T as useResize,
|
|
202
|
+
I as useScroll,
|
|
187
203
|
w as useToggle,
|
|
188
204
|
b as useVisible
|
|
189
205
|
};
|