matsuri-hooks 4.2.26 → 4.2.27-alpha-e4a49e9.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/MatsuriError.js +1 -1
- package/{chunk-VE65KYR3.js → chunk-BPWNWVBA.js} +6135 -2343
- package/chunk-BPWNWVBA.js.map +1 -0
- package/{chunk-7DND5YAV.js → chunk-FSZYXURU.js} +23 -8
- package/chunk-FSZYXURU.js.map +1 -0
- package/{chunk-YHDEEULA.js → chunk-O5EETWNW.js} +7503 -8453
- package/chunk-O5EETWNW.js.map +1 -0
- package/{chunk-2TUXWMP5.js → chunk-UN725CXD.js} +12 -2
- package/dist-E57JDFJM.js +1571 -0
- package/dist-E57JDFJM.js.map +1 -0
- package/fetcher.js +1 -1
- package/index.js +1 -1
- package/package.json +18 -17
- package/useClipboardCopy.js +1 -1
- package/useFetch.js +1 -1
- package/useIntersectionObserver.js +1 -1
- package/useKeyboardShortcut.js +1 -1
- package/useOnClickOutside.js +1 -1
- package/useRequest.js +1 -1
- package/utils/isBrowser.js +1 -1
- package/chunk-7DND5YAV.js.map +0 -1
- package/chunk-VE65KYR3.js.map +0 -1
- package/chunk-YHDEEULA.js.map +0 -1
- package/dist-2LZZP7DH.js +0 -546
- package/dist-2LZZP7DH.js.map +0 -1
- package/magic-string.es-DF22A5OL.js +0 -1314
- package/magic-string.es-DF22A5OL.js.map +0 -1
- /package/{chunk-2TUXWMP5.js.map → chunk-UN725CXD.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BPWNWVBA.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UN725CXD.js";
|
|
7
7
|
|
|
8
8
|
// node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js
|
|
9
9
|
function isElementType(element, tag, props) {
|
|
@@ -113,9 +113,12 @@ var DataTransferItemStub = class {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
+
function toAsciiLowercase(value) {
|
|
117
|
+
return value.replace(/[A-Z]/g, (char) => char.toLowerCase());
|
|
118
|
+
}
|
|
116
119
|
var DataTransferItemListStub = class extends Array {
|
|
117
120
|
add(...args) {
|
|
118
|
-
const item = new DataTransferItemStub(args[0], args[1]);
|
|
121
|
+
const item = typeof args[0] === "string" ? new DataTransferItemStub(args[0], toAsciiLowercase(args[1])) : new DataTransferItemStub(args[0]);
|
|
119
122
|
this.push(item);
|
|
120
123
|
return item;
|
|
121
124
|
}
|
|
@@ -126,6 +129,10 @@ var DataTransferItemListStub = class extends Array {
|
|
|
126
129
|
this.splice(index, 1);
|
|
127
130
|
}
|
|
128
131
|
};
|
|
132
|
+
function normalizeFormat(format) {
|
|
133
|
+
const type3 = toAsciiLowercase(format);
|
|
134
|
+
return type3 === "text" ? "text/plain" : type3 === "url" ? "text/uri-list" : type3;
|
|
135
|
+
}
|
|
129
136
|
function getTypeMatcher(type3, exact) {
|
|
130
137
|
const [group, sub] = type3.split("/");
|
|
131
138
|
const isGroup = !sub || sub === "*";
|
|
@@ -137,7 +144,8 @@ function createDataTransferStub(window) {
|
|
|
137
144
|
return new class DataTransferStub {
|
|
138
145
|
getData(format) {
|
|
139
146
|
var _this_items_find;
|
|
140
|
-
const
|
|
147
|
+
const type3 = normalizeFormat(format);
|
|
148
|
+
const match = (_this_items_find = this.items.find(getTypeMatcher(type3, true))) !== null && _this_items_find !== void 0 ? _this_items_find : this.items.find(getTypeMatcher(type3, false));
|
|
141
149
|
let text = "";
|
|
142
150
|
match === null || match === void 0 ? void 0 : match.getAsString((t) => {
|
|
143
151
|
text = t;
|
|
@@ -145,8 +153,9 @@ function createDataTransferStub(window) {
|
|
|
145
153
|
return text;
|
|
146
154
|
}
|
|
147
155
|
setData(format, data) {
|
|
148
|
-
const
|
|
149
|
-
const
|
|
156
|
+
const type3 = normalizeFormat(format);
|
|
157
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(type3, true));
|
|
158
|
+
const item = new DataTransferItemStub(data, type3);
|
|
150
159
|
if (matchIndex >= 0) {
|
|
151
160
|
this.items.splice(matchIndex, 1, item);
|
|
152
161
|
} else {
|
|
@@ -155,7 +164,8 @@ function createDataTransferStub(window) {
|
|
|
155
164
|
}
|
|
156
165
|
clearData(format) {
|
|
157
166
|
if (format) {
|
|
158
|
-
const
|
|
167
|
+
const type3 = normalizeFormat(format);
|
|
168
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(type3, true));
|
|
159
169
|
if (matchIndex >= 0) {
|
|
160
170
|
this.items.remove(matchIndex);
|
|
161
171
|
}
|
|
@@ -426,6 +436,11 @@ function getActiveElement(document) {
|
|
|
426
436
|
if (activeElementInShadowTree) {
|
|
427
437
|
return activeElementInShadowTree;
|
|
428
438
|
}
|
|
439
|
+
} else if (activeElement && isElementType(activeElement, "iframe")) {
|
|
440
|
+
const contentDocument = activeElement.contentDocument;
|
|
441
|
+
if (contentDocument) {
|
|
442
|
+
return getActiveElement(contentDocument);
|
|
443
|
+
}
|
|
429
444
|
}
|
|
430
445
|
if (isDisabled(activeElement)) {
|
|
431
446
|
return document.ownerDocument ? (
|
|
@@ -4189,4 +4204,4 @@ var userEvent = {
|
|
|
4189
4204
|
export {
|
|
4190
4205
|
userEvent
|
|
4191
4206
|
};
|
|
4192
|
-
//# sourceMappingURL=chunk-
|
|
4207
|
+
//# sourceMappingURL=chunk-FSZYXURU.js.map
|