@lvce-editor/virtual-dom 9.4.0 → 9.6.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/dist/index.js +20 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -135,9 +135,18 @@ const unwrapItemString = async item => {
|
|
|
135
135
|
};
|
|
136
136
|
const unwrapItemFile = async item => {
|
|
137
137
|
// @ts-ignore
|
|
138
|
-
|
|
138
|
+
if (item.getAsFileSystemHandle) {
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
const file = await item.getAsFileSystemHandle();
|
|
141
|
+
return {
|
|
142
|
+
kind: 'file',
|
|
143
|
+
type: item.type,
|
|
144
|
+
value: file
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const file = item.getAsFile();
|
|
139
148
|
return {
|
|
140
|
-
kind: 'file',
|
|
149
|
+
kind: 'file-legacy',
|
|
141
150
|
type: item.type,
|
|
142
151
|
value: file
|
|
143
152
|
};
|
|
@@ -227,6 +236,15 @@ const getEventListenerArg = (param, event) => {
|
|
|
227
236
|
case 'event.y':
|
|
228
237
|
return event.y;
|
|
229
238
|
default:
|
|
239
|
+
if (typeof param === 'string' && param.startsWith('event.currentTarget.')) {
|
|
240
|
+
const rest = param.slice('event.currentTarget.'.length);
|
|
241
|
+
const parts = rest.split('.');
|
|
242
|
+
let current = event.currentTarget;
|
|
243
|
+
for (const part of parts) {
|
|
244
|
+
current = current[part];
|
|
245
|
+
}
|
|
246
|
+
return current;
|
|
247
|
+
}
|
|
230
248
|
if (typeof param === 'string' && param.startsWith('event.target.dataset')) {
|
|
231
249
|
const rest = param.slice('event.target.dataset.'.length);
|
|
232
250
|
return event.target.dataset[rest];
|