@lynx-js/web-core-server-canary 0.19.6-canary-20260120-2bc3e7ef → 0.19.6-canary-20260121-9d8f2629
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/CHANGELOG.md +1 -1
- package/dist/27.js +46 -25
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/27.js
CHANGED
|
@@ -242,23 +242,27 @@ __webpack_require__.add({
|
|
|
242
242
|
const lynxEventName = _lynx_js_web_constants__rspack_import_0.$4[event.type] ?? event.type;
|
|
243
243
|
const runtimeInfo = elementToRuntimeInfoMap.get(currentTarget);
|
|
244
244
|
if (runtimeInfo) {
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
crossThreadEvent
|
|
260
|
-
|
|
245
|
+
const handlerInfos = isCapture ? runtimeInfo.eventHandlerMap[lynxEventName]?.capture : runtimeInfo.eventHandlerMap[lynxEventName]?.bind;
|
|
246
|
+
let stopPropagation = false;
|
|
247
|
+
if (handlerInfos) for (const handlerInfo of handlerInfos){
|
|
248
|
+
const hname = handlerInfo.handler;
|
|
249
|
+
const crossThreadEvent = (0, _utils_createCrossThreadEvent_js__rspack_import_3.X)(event, lynxEventName);
|
|
250
|
+
if ('string' == typeof hname) {
|
|
251
|
+
const parentComponentUniqueId = Number(currentTarget.getAttribute(_lynx_js_web_constants__rspack_import_0.er));
|
|
252
|
+
const parentComponent = lynxUniqueIdToElement[parentComponentUniqueId].deref();
|
|
253
|
+
const componentId = parentComponent?.getAttribute(_lynx_js_web_constants__rspack_import_0.Gq) !== 'page' ? parentComponent?.getAttribute(_lynx_js_web_constants__rspack_import_0.pP) ?? void 0 : void 0;
|
|
254
|
+
if (componentId) callbacks.publicComponentEvent(componentId, hname, crossThreadEvent);
|
|
255
|
+
else callbacks.publishEvent(hname, crossThreadEvent);
|
|
256
|
+
if (1 === handlerInfos.length) stopPropagation = true;
|
|
257
|
+
} else if (hname) {
|
|
258
|
+
crossThreadEvent.target.elementRefptr = event.target;
|
|
259
|
+
if (crossThreadEvent.currentTarget) crossThreadEvent.currentTarget.elementRefptr = event.currentTarget;
|
|
260
|
+
mtsRealm.globalWindow.runWorklet?.(hname.value, [
|
|
261
|
+
crossThreadEvent
|
|
262
|
+
]);
|
|
263
|
+
}
|
|
261
264
|
}
|
|
265
|
+
return stopPropagation;
|
|
262
266
|
}
|
|
263
267
|
return false;
|
|
264
268
|
};
|
|
@@ -287,7 +291,8 @@ __webpack_require__.add({
|
|
|
287
291
|
componentAtIndex: void 0,
|
|
288
292
|
enqueueComponent: void 0
|
|
289
293
|
};
|
|
290
|
-
const
|
|
294
|
+
const handlerList = isCapture ? runtimeInfo.eventHandlerMap[eventName]?.capture : runtimeInfo.eventHandlerMap[eventName]?.bind;
|
|
295
|
+
const currentHandler = handlerList && handlerList.length > 0;
|
|
291
296
|
const currentRegisteredHandler = isCatch ? isCapture ? catchCaptureHandler : defaultCatchHandler : isCapture ? captureHandler : defaultHandler;
|
|
292
297
|
if (currentHandler) {
|
|
293
298
|
if (!newEventHandler) {
|
|
@@ -296,6 +301,8 @@ __webpack_require__.add({
|
|
|
296
301
|
});
|
|
297
302
|
const isExposure = 'uiappear' === eventName || 'uidisappear' === eventName;
|
|
298
303
|
if (isExposure && '-1' === element.getAttribute('exposure-id')) mtsGlobalThis.__SetAttribute(element, 'exposure-id', null);
|
|
304
|
+
if (runtimeInfo.eventHandlerMap[eventName]) if (isCapture) runtimeInfo.eventHandlerMap[eventName].capture = void 0;
|
|
305
|
+
else runtimeInfo.eventHandlerMap[eventName].bind = void 0;
|
|
299
306
|
}
|
|
300
307
|
} else if (newEventHandler) {
|
|
301
308
|
const htmlEventName = _lynx_js_web_constants__rspack_import_0.vQ[element.tagName]?.[eventName] ?? _lynx_js_web_constants__rspack_import_0.im[eventName] ?? eventName;
|
|
@@ -314,8 +321,16 @@ __webpack_require__.add({
|
|
|
314
321
|
capture: void 0,
|
|
315
322
|
bind: void 0
|
|
316
323
|
};
|
|
317
|
-
|
|
318
|
-
|
|
324
|
+
let targetList = isCapture ? runtimeInfo.eventHandlerMap[eventName].capture : runtimeInfo.eventHandlerMap[eventName].bind;
|
|
325
|
+
if (!Array.isArray(targetList)) targetList = targetList ? [
|
|
326
|
+
targetList
|
|
327
|
+
] : [];
|
|
328
|
+
const typeOfNew = typeof newEventHandler;
|
|
329
|
+
const index = targetList.findIndex((h)=>typeof h.handler === typeOfNew);
|
|
330
|
+
if (-1 !== index) targetList[index] = info;
|
|
331
|
+
else targetList.push(info);
|
|
332
|
+
if (isCapture) runtimeInfo.eventHandlerMap[eventName].capture = targetList;
|
|
333
|
+
else runtimeInfo.eventHandlerMap[eventName].bind = targetList;
|
|
319
334
|
}
|
|
320
335
|
elementToRuntimeInfoMap.set(element, runtimeInfo);
|
|
321
336
|
};
|
|
@@ -326,6 +341,7 @@ __webpack_require__.add({
|
|
|
326
341
|
eventName = eventName.toLowerCase();
|
|
327
342
|
const isCapture = eventType.startsWith('capture');
|
|
328
343
|
const handler = isCapture ? runtimeInfo.eventHandlerMap[eventName]?.capture : runtimeInfo.eventHandlerMap[eventName]?.bind;
|
|
344
|
+
if (Array.isArray(handler)) return handler[0]?.handler;
|
|
329
345
|
return handler?.handler;
|
|
330
346
|
}
|
|
331
347
|
};
|
|
@@ -336,12 +352,17 @@ __webpack_require__.add({
|
|
|
336
352
|
info.bind,
|
|
337
353
|
info.capture
|
|
338
354
|
])if (atomInfo) {
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
355
|
+
const handlerList = Array.isArray(atomInfo) ? atomInfo : [
|
|
356
|
+
atomInfo
|
|
357
|
+
];
|
|
358
|
+
for (const item of handlerList){
|
|
359
|
+
const { type, handler } = item;
|
|
360
|
+
if (handler) eventInfos.push({
|
|
361
|
+
type: type,
|
|
362
|
+
name: lynxEventName,
|
|
363
|
+
function: handler
|
|
364
|
+
});
|
|
365
|
+
}
|
|
345
366
|
}
|
|
346
367
|
return eventInfos;
|
|
347
368
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-server-canary",
|
|
3
|
-
"version": "0.19.6-canary-
|
|
3
|
+
"version": "0.19.6-canary-20260121-9d8f2629",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
27
27
|
"rsbuild-plugin-publint": "0.3.3",
|
|
28
28
|
"@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
|
|
29
|
-
"@lynx-js/web-
|
|
30
|
-
"@lynx-js/web-
|
|
31
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.6-canary-
|
|
32
|
-
"@lynx-js/web-
|
|
29
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.6-canary-20260121-9d8f2629",
|
|
30
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.6-canary-20260121-9d8f2629",
|
|
31
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.6-canary-20260121-9d8f2629",
|
|
32
|
+
"@lynx-js/web-elements": "npm:@lynx-js/web-elements-canary@0.11.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rslib build",
|