@lynx-js/web-core-server-canary 0.19.6-canary-20260114-a7a2ad79 → 0.19.6-canary-20260116-179f9844
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 +51 -36
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/27.js
CHANGED
|
@@ -484,6 +484,55 @@ __webpack_require__.add({
|
|
|
484
484
|
exposureChangedElements.clear();
|
|
485
485
|
callbacks.flushElementTree(options, timingFlagsCopied, exposureChangedElementsArray);
|
|
486
486
|
};
|
|
487
|
+
const __InvokeUIMethod = (element, method, params, callback)=>{
|
|
488
|
+
try {
|
|
489
|
+
if ('boundingClientRect' === method) {
|
|
490
|
+
const rect = element.getBoundingClientRect();
|
|
491
|
+
callback({
|
|
492
|
+
code: _lynx_js_web_constants__rspack_import_0.O4.SUCCESS,
|
|
493
|
+
data: {
|
|
494
|
+
id: element.id,
|
|
495
|
+
width: rect.width,
|
|
496
|
+
height: rect.height,
|
|
497
|
+
left: rect.left,
|
|
498
|
+
right: rect.right,
|
|
499
|
+
top: rect.top,
|
|
500
|
+
bottom: rect.bottom
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if ('function' == typeof element[method]) {
|
|
506
|
+
const data = element[method](params);
|
|
507
|
+
callback({
|
|
508
|
+
code: _lynx_js_web_constants__rspack_import_0.O4.SUCCESS,
|
|
509
|
+
data
|
|
510
|
+
});
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
callback({
|
|
514
|
+
code: _lynx_js_web_constants__rspack_import_0.O4.METHOD_NOT_FOUND
|
|
515
|
+
});
|
|
516
|
+
} catch (e) {
|
|
517
|
+
console.error("[lynx-web] invokeUIMethod: apply method failed with", e, element);
|
|
518
|
+
callback({
|
|
519
|
+
code: _lynx_js_web_constants__rspack_import_0.O4.PARAM_INVALID
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
const __QuerySelector = (element, selector)=>{
|
|
524
|
+
if (!element) return null;
|
|
525
|
+
const el = element.querySelector(selector);
|
|
526
|
+
if (el) {
|
|
527
|
+
if (!el.invoke) el.invoke = (method, params)=>new Promise((resolve, reject)=>{
|
|
528
|
+
__InvokeUIMethod(el, method, params, (res)=>{
|
|
529
|
+
if (res.code === _lynx_js_web_constants__rspack_import_0.O4.SUCCESS) resolve(res.data);
|
|
530
|
+
else reject(res);
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
return el;
|
|
535
|
+
};
|
|
487
536
|
const __GetPageElement = ()=>pageElement;
|
|
488
537
|
const templateIdToTemplate = {};
|
|
489
538
|
const createElementForElementTemplateData = (data, parentComponentUniId)=>{
|
|
@@ -612,42 +661,8 @@ __webpack_require__.add({
|
|
|
612
661
|
_I18nResourceTranslation: callbacks._I18nResourceTranslation,
|
|
613
662
|
_AddEventListener: ()=>{},
|
|
614
663
|
renderPage: void 0,
|
|
615
|
-
__InvokeUIMethod
|
|
616
|
-
|
|
617
|
-
if ('boundingClientRect' === method) {
|
|
618
|
-
const rect = element.getBoundingClientRect();
|
|
619
|
-
callback({
|
|
620
|
-
code: _lynx_js_web_constants__rspack_import_0.O4.SUCCESS,
|
|
621
|
-
data: {
|
|
622
|
-
id: element.id,
|
|
623
|
-
width: rect.width,
|
|
624
|
-
height: rect.height,
|
|
625
|
-
left: rect.left,
|
|
626
|
-
right: rect.right,
|
|
627
|
-
top: rect.top,
|
|
628
|
-
bottom: rect.bottom
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
if ('function' == typeof element[method]) {
|
|
634
|
-
const data = element[method](params);
|
|
635
|
-
callback({
|
|
636
|
-
code: _lynx_js_web_constants__rspack_import_0.O4.SUCCESS,
|
|
637
|
-
data
|
|
638
|
-
});
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
callback({
|
|
642
|
-
code: _lynx_js_web_constants__rspack_import_0.O4.METHOD_NOT_FOUND
|
|
643
|
-
});
|
|
644
|
-
} catch (e) {
|
|
645
|
-
console.error("[lynx-web] invokeUIMethod: apply method failed with", e, element);
|
|
646
|
-
callback({
|
|
647
|
-
code: _lynx_js_web_constants__rspack_import_0.O4.PARAM_INVALID
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
}
|
|
664
|
+
__InvokeUIMethod,
|
|
665
|
+
__QuerySelector
|
|
651
666
|
};
|
|
652
667
|
Object.assign(mtsRealm.globalWindow, mtsGlobalThis);
|
|
653
668
|
Object.defineProperty(mtsRealm.globalWindow, 'renderPage', {
|
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-20260116-179f9844",
|
|
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-constants": "npm:@lynx-js/web-constants-canary@0.19.6-canary-
|
|
30
|
-
"@lynx-js/web-
|
|
31
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.6-canary-
|
|
32
|
-
"@lynx-js/web-
|
|
29
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.6-canary-20260116-179f9844",
|
|
30
|
+
"@lynx-js/web-elements": "npm:@lynx-js/web-elements-canary@0.11.0",
|
|
31
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.6-canary-20260116-179f9844",
|
|
32
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.6-canary-20260116-179f9844"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rslib build",
|