@lynx-js/web-core-server 0.15.5 → 0.15.7
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 +8 -0
- package/dist/index.js +120 -99
- package/dist/legacy-wasm-chunk.js +77 -35
- package/dist/static/wasm/43143691.module.wasm +0 -0
- package/dist/static/wasm/57807697.module.wasm +0 -0
- package/package.json +6 -4
- package/dist/static/wasm/1d0f646c207811d4.module.wasm +0 -0
- package/dist/static/wasm/8e708eec9c98f88c.module.wasm +0 -0
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -8,12 +8,10 @@ var __webpack_modules__ = {
|
|
|
8
8
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
9
|
C2: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.C2,
|
|
10
10
|
Or: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.Or,
|
|
11
|
-
Y1: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.Y1,
|
|
12
11
|
a9: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.a9,
|
|
13
|
-
|
|
12
|
+
h4: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.h4,
|
|
14
13
|
oT: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.oT,
|
|
15
14
|
pE: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.pE,
|
|
16
|
-
sy: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.sy,
|
|
17
15
|
xJ: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.xJ,
|
|
18
16
|
xQ: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.xQ
|
|
19
17
|
});
|
|
@@ -35,12 +33,10 @@ var __webpack_modules__ = {
|
|
|
35
33
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
34
|
C2: ()=>__wbg_push_737cfc8c1432c2c6,
|
|
37
35
|
Or: ()=>__wbindgen_throw,
|
|
38
|
-
Y1: ()=>malloc,
|
|
39
36
|
a9: ()=>__wbg_new_78feb108b6472713,
|
|
40
|
-
|
|
37
|
+
h4: ()=>__wbindgen_string_new,
|
|
41
38
|
oT: ()=>__wbg_set_wasm,
|
|
42
39
|
pE: ()=>transform_raw_u16_inline_style_ptr_parsed,
|
|
43
|
-
sy: ()=>__wbg_fromCharCode_5493f9b25e1ce0a1,
|
|
44
40
|
xJ: ()=>transform_raw_u16_inline_style_ptr,
|
|
45
41
|
xQ: ()=>__wbindgen_init_externref_table
|
|
46
42
|
});
|
|
@@ -49,15 +45,6 @@ var __webpack_modules__ = {
|
|
|
49
45
|
function __wbg_set_wasm(val) {
|
|
50
46
|
wasm = val;
|
|
51
47
|
}
|
|
52
|
-
let cachedUint16ArrayMemory0 = null;
|
|
53
|
-
function getUint16ArrayMemory0() {
|
|
54
|
-
if (null === cachedUint16ArrayMemory0 || 0 === cachedUint16ArrayMemory0.byteLength) cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
|
|
55
|
-
return cachedUint16ArrayMemory0;
|
|
56
|
-
}
|
|
57
|
-
function getArrayU16FromWasm0(ptr, len) {
|
|
58
|
-
ptr >>>= 0;
|
|
59
|
-
return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
|
|
60
|
-
}
|
|
61
48
|
const lTextDecoder = 'undefined' == typeof TextDecoder ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
62
49
|
let cachedTextDecoder = new lTextDecoder('utf-8', {
|
|
63
50
|
ignoreBOM: true,
|
|
@@ -73,23 +60,64 @@ var __webpack_modules__ = {
|
|
|
73
60
|
ptr >>>= 0;
|
|
74
61
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
75
62
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
let WASM_VECTOR_LEN = 0;
|
|
64
|
+
const lTextEncoder = 'undefined' == typeof TextEncoder ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
65
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
66
|
+
const encodeString = 'function' == typeof cachedTextEncoder.encodeInto ? function(arg, view) {
|
|
67
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
68
|
+
} : function(arg, view) {
|
|
69
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
70
|
+
view.set(buf);
|
|
71
|
+
return {
|
|
72
|
+
read: arg.length,
|
|
73
|
+
written: buf.length
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
77
|
+
if (void 0 === realloc) {
|
|
78
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
79
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
80
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
81
|
+
WASM_VECTOR_LEN = buf.length;
|
|
82
|
+
return ptr;
|
|
83
|
+
}
|
|
84
|
+
let len = arg.length;
|
|
85
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
86
|
+
const mem = getUint8ArrayMemory0();
|
|
87
|
+
let offset = 0;
|
|
88
|
+
for(; offset < len; offset++){
|
|
89
|
+
const code = arg.charCodeAt(offset);
|
|
90
|
+
if (code > 0x7F) break;
|
|
91
|
+
mem[ptr + offset] = code;
|
|
92
|
+
}
|
|
93
|
+
if (offset !== len) {
|
|
94
|
+
if (0 !== offset) arg = arg.slice(offset);
|
|
95
|
+
ptr = realloc(ptr, len, len = offset + 3 * arg.length, 1) >>> 0;
|
|
96
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
97
|
+
const ret = encodeString(arg, view);
|
|
98
|
+
offset += ret.written;
|
|
99
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
100
|
+
}
|
|
101
|
+
WASM_VECTOR_LEN = offset;
|
|
102
|
+
return ptr;
|
|
87
103
|
}
|
|
88
|
-
function
|
|
89
|
-
wasm.
|
|
104
|
+
function transform_raw_u16_inline_style_ptr(str) {
|
|
105
|
+
const ptr0 = passStringToWasm0(str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106
|
+
const len0 = WASM_VECTOR_LEN;
|
|
107
|
+
const ret = wasm.transform_raw_u16_inline_style_ptr(ptr0, len0);
|
|
108
|
+
let v2;
|
|
109
|
+
if (0 !== ret[0]) {
|
|
110
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
111
|
+
wasm.__wbindgen_free(ret[0], +ret[1], 1);
|
|
112
|
+
}
|
|
113
|
+
return v2;
|
|
90
114
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
115
|
+
function transform_raw_u16_inline_style_ptr_parsed(name, value) {
|
|
116
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
117
|
+
const len0 = WASM_VECTOR_LEN;
|
|
118
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
119
|
+
const len1 = WASM_VECTOR_LEN;
|
|
120
|
+
const ret = wasm.transform_raw_u16_inline_style_ptr_parsed(ptr0, len0, ptr1, len1);
|
|
93
121
|
return ret;
|
|
94
122
|
}
|
|
95
123
|
function __wbg_new_78feb108b6472713() {
|
|
@@ -109,6 +137,10 @@ var __webpack_modules__ = {
|
|
|
109
137
|
table.set(offset + 2, true);
|
|
110
138
|
table.set(offset + 3, false);
|
|
111
139
|
}
|
|
140
|
+
function __wbindgen_string_new(arg0, arg1) {
|
|
141
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
142
|
+
return ret;
|
|
143
|
+
}
|
|
112
144
|
function __wbindgen_throw(arg0, arg1) {
|
|
113
145
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
114
146
|
}
|
|
@@ -118,25 +150,20 @@ var __webpack_modules__ = {
|
|
|
118
150
|
try {
|
|
119
151
|
__webpack_require__.r(__webpack_exports__);
|
|
120
152
|
__webpack_require__.d(__webpack_exports__, {
|
|
121
|
-
__wbg_fromCharCode_5493f9b25e1ce0a1: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.sy,
|
|
122
153
|
__wbg_new_78feb108b6472713: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.a9,
|
|
123
154
|
__wbg_push_737cfc8c1432c2c6: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.C2,
|
|
124
155
|
__wbg_set_wasm: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.oT,
|
|
125
156
|
__wbindgen_init_externref_table: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.xQ,
|
|
157
|
+
__wbindgen_string_new: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.h4,
|
|
126
158
|
__wbindgen_throw: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.Or,
|
|
127
|
-
free: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.gd,
|
|
128
|
-
malloc: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.Y1,
|
|
129
|
-
memory: ()=>_dist_standard_bg_wasm__WEBPACK_IMPORTED_MODULE_1__.memory,
|
|
130
159
|
transform_raw_u16_inline_style_ptr: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.xJ,
|
|
131
160
|
transform_raw_u16_inline_style_ptr_parsed: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.pE
|
|
132
161
|
});
|
|
133
162
|
var _dist_standard_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../web-style-transformer/dist/standard.js");
|
|
134
|
-
var _dist_standard_bg_wasm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../web-style-transformer/dist/standard_bg.wasm");
|
|
135
163
|
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([
|
|
136
|
-
_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__
|
|
137
|
-
_dist_standard_bg_wasm__WEBPACK_IMPORTED_MODULE_1__
|
|
164
|
+
_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__
|
|
138
165
|
]);
|
|
139
|
-
|
|
166
|
+
_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
140
167
|
__webpack_async_result__();
|
|
141
168
|
} catch (e) {
|
|
142
169
|
__webpack_async_result__(e);
|
|
@@ -145,10 +172,10 @@ var __webpack_modules__ = {
|
|
|
145
172
|
},
|
|
146
173
|
"../web-style-transformer/dist/standard_bg.wasm": function(module, exports, __webpack_require__) {
|
|
147
174
|
var WEBPACK_IMPORTED_MODULE_0 = __webpack_require__("../web-style-transformer/dist/standard_bg.js");
|
|
148
|
-
module.exports = __webpack_require__.v(exports, module.id, "
|
|
175
|
+
module.exports = __webpack_require__.v(exports, module.id, "431436911960378f", {
|
|
149
176
|
"./standard_bg.js": {
|
|
150
|
-
__wbg_fromCharCode_5493f9b25e1ce0a1: WEBPACK_IMPORTED_MODULE_0.sy,
|
|
151
177
|
__wbg_new_78feb108b6472713: WEBPACK_IMPORTED_MODULE_0.a9,
|
|
178
|
+
__wbindgen_string_new: WEBPACK_IMPORTED_MODULE_0.h4,
|
|
152
179
|
__wbg_push_737cfc8c1432c2c6: WEBPACK_IMPORTED_MODULE_0.C2,
|
|
153
180
|
__wbindgen_throw: WEBPACK_IMPORTED_MODULE_0.Or,
|
|
154
181
|
__wbindgen_init_externref_table: WEBPACK_IMPORTED_MODULE_0.xQ
|
|
@@ -299,7 +326,7 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
299
326
|
import('fs'),
|
|
300
327
|
import('url')
|
|
301
328
|
]).then(([{ readFile }, { URL }])=>new Promise((resolve, reject)=>{
|
|
302
|
-
readFile(new URL("static/wasm/" + wasmModuleHash + ".module.wasm", import.meta.url), (err, buffer)=>{
|
|
329
|
+
readFile(new URL("static/wasm/" + wasmModuleHash.slice(0, 8) + ".module.wasm", import.meta.url), (err, buffer)=>{
|
|
303
330
|
if (err) return reject(err);
|
|
304
331
|
resolve({
|
|
305
332
|
arrayBuffer () {
|
|
@@ -391,6 +418,10 @@ const inShadowRootStyles = [
|
|
|
391
418
|
overflow: visible;
|
|
392
419
|
}`
|
|
393
420
|
];
|
|
421
|
+
const constants_globalDisallowedVars = [
|
|
422
|
+
'navigator',
|
|
423
|
+
'postMessage'
|
|
424
|
+
];
|
|
394
425
|
const W3cEventNameToLynx = {
|
|
395
426
|
click: 'tap',
|
|
396
427
|
lynxscroll: 'scroll',
|
|
@@ -730,7 +761,9 @@ const mainThreadInjectVars = [
|
|
|
730
761
|
'__SetDataset',
|
|
731
762
|
'__SetID',
|
|
732
763
|
'__UpdateComponentID',
|
|
764
|
+
'__UpdateComponentInfo',
|
|
733
765
|
'__GetConfig',
|
|
766
|
+
'__GetAttributeByName',
|
|
734
767
|
'__UpdateListCallbacks',
|
|
735
768
|
'__AppendElement',
|
|
736
769
|
'__ElementIsEqual',
|
|
@@ -787,7 +820,7 @@ const backgroundInjectWithBind = [
|
|
|
787
820
|
'Card',
|
|
788
821
|
'Component'
|
|
789
822
|
];
|
|
790
|
-
const generateModuleContent = (content, injectVars, injectWithBind, muteableVars, isESM)=>[
|
|
823
|
+
const generateModuleContent = (content, injectVars, injectWithBind, muteableVars, globalDisallowedVars, isESM)=>[
|
|
791
824
|
'//# allFunctionsCalledOnLoad\n',
|
|
792
825
|
isESM ? 'export default ' : 'globalThis.module.exports =',
|
|
793
826
|
'function(lynx_runtime) {',
|
|
@@ -797,6 +830,7 @@ const generateModuleContent = (content, injectVars, injectWithBind, muteableVars
|
|
|
797
830
|
'} = lynx_runtime;',
|
|
798
831
|
...injectWithBind.map((nm)=>`const ${nm} = lynx_runtime.${nm}?.bind(lynx_runtime);`),
|
|
799
832
|
';var globDynamicComponentEntry = \'__Card__\';',
|
|
833
|
+
0 !== globalDisallowedVars.length ? `var ${globalDisallowedVars.join('=')}=undefined;` : '',
|
|
800
834
|
'var {__globalProps} = lynx;',
|
|
801
835
|
'lynx_runtime._updateVars=()=>{',
|
|
802
836
|
...muteableVars.map((nm)=>`${nm} = lynx_runtime.__lynxGlobalBindingValues.${nm};`),
|
|
@@ -804,18 +838,18 @@ const generateModuleContent = (content, injectVars, injectWithBind, muteableVars
|
|
|
804
838
|
content,
|
|
805
839
|
'\n return module.exports;}'
|
|
806
840
|
].join('');
|
|
807
|
-
async function generateJavascriptUrl(obj, injectVars, injectWithBind, muteableVars, createJsModuleUrl, isESM, templateName) {
|
|
841
|
+
async function generateJavascriptUrl(obj, injectVars, injectWithBind, muteableVars, globalDisallowedVars, createJsModuleUrl, isESM, templateName) {
|
|
808
842
|
const processEntry = async ([name, content])=>[
|
|
809
843
|
name,
|
|
810
|
-
await createJsModuleUrl(generateModuleContent(content, injectVars.concat(muteableVars), injectWithBind, muteableVars, isESM), `${templateName}-${name.replaceAll('/', '')}.js`)
|
|
844
|
+
await createJsModuleUrl(generateModuleContent(content, injectVars.concat(muteableVars), injectWithBind, muteableVars, globalDisallowedVars, isESM), `${templateName}-${name.replaceAll('/', '')}.js`)
|
|
811
845
|
];
|
|
812
846
|
return Promise.all(Object.entries(obj).filter(([_, content])=>'string' == typeof content).map(processEntry)).then(Object.fromEntries);
|
|
813
847
|
}
|
|
814
848
|
async function generateTemplate(template, createJsModuleUrl, templateName) {
|
|
815
849
|
return {
|
|
816
850
|
...template,
|
|
817
|
-
lepusCode: await generateJavascriptUrl(template.lepusCode, mainThreadInjectVars, [], globalMuteableVars, createJsModuleUrl, true, templateName),
|
|
818
|
-
manifest: await generateJavascriptUrl(template.manifest, backgroundInjectVars, backgroundInjectWithBind, [], createJsModuleUrl, false, templateName)
|
|
851
|
+
lepusCode: await generateJavascriptUrl(template.lepusCode, mainThreadInjectVars, [], globalMuteableVars, templateName ? [] : constants_globalDisallowedVars, createJsModuleUrl, true, templateName),
|
|
852
|
+
manifest: await generateJavascriptUrl(template.manifest, backgroundInjectVars, backgroundInjectWithBind, [], templateName ? [] : constants_globalDisallowedVars, createJsModuleUrl, false, templateName)
|
|
819
853
|
};
|
|
820
854
|
}
|
|
821
855
|
function registerCallLepusMethodHandler(rpc, runtime) {
|
|
@@ -826,7 +860,7 @@ function registerCallLepusMethodHandler(rpc, runtime) {
|
|
|
826
860
|
function registerGetCustomSectionHandler(rpc, customSections) {
|
|
827
861
|
rpc.registerHandler(getCustomSectionsEndpoint, (key)=>customSections[key]?.content);
|
|
828
862
|
}
|
|
829
|
-
function createMainThreadLynx(config) {
|
|
863
|
+
function createMainThreadLynx(config, SystemInfo) {
|
|
830
864
|
return {
|
|
831
865
|
getJSContext () {
|
|
832
866
|
return config.jsContext;
|
|
@@ -841,7 +875,8 @@ function createMainThreadLynx(config) {
|
|
|
841
875
|
getCustomSectionSync (key) {
|
|
842
876
|
return config.customSections[key]?.content;
|
|
843
877
|
},
|
|
844
|
-
markPipelineTiming: config.callbacks.markTiming
|
|
878
|
+
markPipelineTiming: config.callbacks.markTiming,
|
|
879
|
+
SystemInfo
|
|
845
880
|
};
|
|
846
881
|
}
|
|
847
882
|
const referenceTypes = async ()=>WebAssembly.validate(new Uint8Array([
|
|
@@ -878,51 +913,22 @@ async function initWasm() {
|
|
|
878
913
|
const supportsReferenceTypes = await referenceTypes();
|
|
879
914
|
wasm = supportsReferenceTypes ? await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../web-style-transformer/standard.js")) : await __webpack_require__.e("501").then(__webpack_require__.bind(__webpack_require__, "../web-style-transformer/legacy.js"));
|
|
880
915
|
}
|
|
881
|
-
let HEAPU16;
|
|
882
|
-
const stringToUTF16 = (str)=>{
|
|
883
|
-
const len = str.length;
|
|
884
|
-
const ptr = wasm.malloc(len << 1);
|
|
885
|
-
if (!HEAPU16 || 0 == HEAPU16.byteLength) HEAPU16 = new Uint16Array(wasm.memory.buffer);
|
|
886
|
-
for(let i = 0; i < len; i++)HEAPU16[(ptr >> 1) + i] = str.charCodeAt(i);
|
|
887
|
-
return {
|
|
888
|
-
ptr,
|
|
889
|
-
len
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
916
|
function transformInlineStyleString(str) {
|
|
893
|
-
|
|
894
|
-
try {
|
|
895
|
-
const transformedStyle = wasm.transform_raw_u16_inline_style_ptr(ptr, len) ?? str;
|
|
896
|
-
wasm.free(ptr, len << 1);
|
|
897
|
-
return transformedStyle;
|
|
898
|
-
} catch (e) {
|
|
899
|
-
wasm.free(ptr, len << 1);
|
|
900
|
-
throw e;
|
|
901
|
-
}
|
|
917
|
+
return wasm.transform_raw_u16_inline_style_ptr(str) ?? str;
|
|
902
918
|
}
|
|
903
919
|
function transformParsedStyles(styles) {
|
|
904
920
|
let childStyle = [];
|
|
905
921
|
let transformedStyle = [];
|
|
906
922
|
for (const [property, value] of styles){
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
if (childStyleForCurrent) childStyle = childStyle.concat(childStyleForCurrent);
|
|
917
|
-
} else transformedStyle.push([
|
|
918
|
-
property,
|
|
919
|
-
value
|
|
920
|
-
]);
|
|
921
|
-
} catch (e) {
|
|
922
|
-
wasm.free(propertyPtr, propertyLen << 1);
|
|
923
|
-
wasm.free(valuePtr, valueLen << 1);
|
|
924
|
-
throw e;
|
|
925
|
-
}
|
|
923
|
+
const transformedResult = wasm.transform_raw_u16_inline_style_ptr_parsed(property, value);
|
|
924
|
+
if (transformedResult) {
|
|
925
|
+
const [transformedStyleForCurrent, childStyleForCurrent] = transformedResult;
|
|
926
|
+
transformedStyle = transformedStyle.concat(transformedStyleForCurrent);
|
|
927
|
+
if (childStyleForCurrent) childStyle = childStyle.concat(childStyleForCurrent);
|
|
928
|
+
} else transformedStyle.push([
|
|
929
|
+
property,
|
|
930
|
+
value
|
|
931
|
+
]);
|
|
926
932
|
}
|
|
927
933
|
return {
|
|
928
934
|
childStyle,
|
|
@@ -1320,6 +1326,7 @@ const __GetElementConfig = /*#__PURE__*/ (element)=>{
|
|
|
1320
1326
|
const currentComponentConfigString = element.getAttribute(lynxComponentConfigAttribute);
|
|
1321
1327
|
return currentComponentConfigString ? JSON.parse(decodeURIComponent(currentComponentConfigString)) : {};
|
|
1322
1328
|
};
|
|
1329
|
+
const __GetAttributeByName = /*#__PURE__*/ (element, name)=>element.getAttribute(name);
|
|
1323
1330
|
const __GetElementUniqueID = /*#__PURE__*/ (element)=>element && element.getAttribute ? Number(element.getAttribute(lynxUniqueIdAttribute)) : -1;
|
|
1324
1331
|
const __GetID = /*#__PURE__*/ (element)=>element.getAttribute('id');
|
|
1325
1332
|
const __SetID = /*#__PURE__*/ (element, id)=>id ? element.setAttribute('id', id) : element.removeAttribute('id');
|
|
@@ -1333,6 +1340,11 @@ const __SetDataset = /*#__PURE__*/ (element, dataset)=>{
|
|
|
1333
1340
|
};
|
|
1334
1341
|
const __UpdateComponentID = /*#__PURE__*/ (element, componentID)=>element.setAttribute(componentIdAttribute, componentID);
|
|
1335
1342
|
const __GetClasses = /*#__PURE__*/ (element)=>(element.getAttribute('class') ?? '').split(' ').filter((e)=>e);
|
|
1343
|
+
const __UpdateComponentInfo = /*#__PURE__*/ (element, params)=>{
|
|
1344
|
+
void 0 !== params.componentID && __UpdateComponentID(element, params.componentID);
|
|
1345
|
+
void 0 !== params.cssID && element.setAttribute(cssIdAttribute, params.cssID + '');
|
|
1346
|
+
void 0 !== params.name && element.setAttribute('name', params.name);
|
|
1347
|
+
};
|
|
1336
1348
|
const __SetCSSId = /*#__PURE__*/ (elements, cssId)=>{
|
|
1337
1349
|
for (const element of elements)element.setAttribute(cssIdAttribute, cssId + '');
|
|
1338
1350
|
};
|
|
@@ -1740,21 +1752,25 @@ function createMainThreadGlobalThis(config) {
|
|
|
1740
1752
|
const createElementForElementTemplateData = (data, parentComponentUniId)=>{
|
|
1741
1753
|
const element = __CreateElement(data.type, parentComponentUniId);
|
|
1742
1754
|
__SetID(element, data.id);
|
|
1743
|
-
__SetClasses(element, data.class.join(' '));
|
|
1744
|
-
for (const [key, value] of Object.entries(data.attributes))__SetAttribute(element, key, value);
|
|
1745
|
-
for (const [key, value] of Object.entries(data.builtinAttributes
|
|
1746
|
-
|
|
1755
|
+
data.class && __SetClasses(element, data.class.join(' '));
|
|
1756
|
+
for (const [key, value] of Object.entries(data.attributes || {}))__SetAttribute(element, key, value);
|
|
1757
|
+
for (const [key, value] of Object.entries(data.builtinAttributes || {})){
|
|
1758
|
+
if ('dirtyID' === key && value === data.id) __MarkPartElement(element, value);
|
|
1759
|
+
__SetAttribute(element, key, value);
|
|
1760
|
+
}
|
|
1761
|
+
for (const childData of data.children || [])__AppendElement(element, createElementForElementTemplateData(childData, parentComponentUniId));
|
|
1762
|
+
void 0 !== data.dataset && __SetDataset(element, data.dataset);
|
|
1747
1763
|
return element;
|
|
1748
1764
|
};
|
|
1749
1765
|
const applyEventsForElementTemplate = (data, element)=>{
|
|
1750
1766
|
const uniqueId = uniqueIdInc++;
|
|
1751
1767
|
element.setAttribute(lynxUniqueIdAttribute, uniqueId + '');
|
|
1752
|
-
for (const event of data.events){
|
|
1768
|
+
for (const event of data.events || []){
|
|
1753
1769
|
const { type, name, value } = event;
|
|
1754
1770
|
__AddEvent(element, type, name, value);
|
|
1755
1771
|
}
|
|
1756
|
-
for(let ii = 0; ii < data.children.length; ii++){
|
|
1757
|
-
const childData = data.children[ii];
|
|
1772
|
+
for(let ii = 0; ii < (data.children || []).length; ii++){
|
|
1773
|
+
const childData = (data.children || [])[ii];
|
|
1758
1774
|
const childElement = element.children[ii];
|
|
1759
1775
|
if (childData && childElement) applyEventsForElementTemplate(childData, childElement);
|
|
1760
1776
|
}
|
|
@@ -1779,12 +1795,17 @@ function createMainThreadGlobalThis(config) {
|
|
|
1779
1795
|
const element = clonedElements[ii];
|
|
1780
1796
|
if (data && element) applyEventsForElementTemplate(data, element);
|
|
1781
1797
|
}
|
|
1798
|
+
clonedElements.forEach(__MarkTemplateElement);
|
|
1782
1799
|
return clonedElements;
|
|
1783
1800
|
}
|
|
1784
1801
|
return [];
|
|
1785
1802
|
};
|
|
1786
1803
|
let release = '';
|
|
1787
1804
|
const isCSSOG = !pageConfig.enableCSSSelector;
|
|
1805
|
+
const SystemInfo = {
|
|
1806
|
+
...systemInfo,
|
|
1807
|
+
...config.browserConfig
|
|
1808
|
+
};
|
|
1788
1809
|
const mtsGlobalThis = {
|
|
1789
1810
|
__ElementFromBinary,
|
|
1790
1811
|
__GetTemplateParts: rootDom.querySelectorAll ? __GetTemplateParts : void 0,
|
|
@@ -1819,6 +1840,7 @@ function createMainThreadGlobalThis(config) {
|
|
|
1819
1840
|
__SetDataset: __SetDataset,
|
|
1820
1841
|
__SetID: __SetID,
|
|
1821
1842
|
__UpdateComponentID: __UpdateComponentID,
|
|
1843
|
+
__UpdateComponentInfo: __UpdateComponentInfo,
|
|
1822
1844
|
__CreateElement,
|
|
1823
1845
|
__CreateView,
|
|
1824
1846
|
__CreateText,
|
|
@@ -1833,6 +1855,7 @@ function createMainThreadGlobalThis(config) {
|
|
|
1833
1855
|
__SwapElement,
|
|
1834
1856
|
__UpdateListCallbacks,
|
|
1835
1857
|
__GetConfig: __GetElementConfig,
|
|
1858
|
+
__GetAttributeByName: __GetAttributeByName,
|
|
1836
1859
|
__GetClasses: __GetClasses,
|
|
1837
1860
|
__AddClass: isCSSOG ? __AddClassForCSSOG : __AddClass,
|
|
1838
1861
|
__SetClasses: isCSSOG ? __SetClassesForCSSOG : __SetClasses,
|
|
@@ -1842,11 +1865,8 @@ function createMainThreadGlobalThis(config) {
|
|
|
1842
1865
|
__LoadLepusChunk,
|
|
1843
1866
|
__GetPageElement,
|
|
1844
1867
|
__globalProps: globalProps,
|
|
1845
|
-
SystemInfo
|
|
1846
|
-
|
|
1847
|
-
...config.browserConfig
|
|
1848
|
-
},
|
|
1849
|
-
lynx: createMainThreadLynx(config),
|
|
1868
|
+
SystemInfo,
|
|
1869
|
+
lynx: createMainThreadLynx(config, SystemInfo),
|
|
1850
1870
|
_ReportError: (err, _)=>callbacks._ReportError(err, _, release),
|
|
1851
1871
|
_SetSourceMapRelease: (errInfo)=>release = errInfo?.release,
|
|
1852
1872
|
__OnLifecycleEvent: callbacks.__OnLifecycleEvent,
|
|
@@ -1867,6 +1887,7 @@ function createMainThreadGlobalThis(config) {
|
|
|
1867
1887
|
};
|
|
1868
1888
|
mtsGlobalThis.globalThis = new Proxy(mtsGlobalThis, {
|
|
1869
1889
|
get: (target, prop)=>{
|
|
1890
|
+
if ('string' == typeof prop && constants_globalDisallowedVars.includes(prop)) return;
|
|
1870
1891
|
if ('globalThis' === prop) return target;
|
|
1871
1892
|
return target[prop] ?? globalThis[prop];
|
|
1872
1893
|
},
|
|
@@ -8,12 +8,10 @@ export const __webpack_modules__ = {
|
|
|
8
8
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
9
|
C2: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.C2,
|
|
10
10
|
Or: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.Or,
|
|
11
|
-
Y1: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.Y1,
|
|
12
11
|
a9: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.a9,
|
|
13
|
-
|
|
12
|
+
h4: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.h4,
|
|
14
13
|
oT: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.oT,
|
|
15
14
|
pE: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.pE,
|
|
16
|
-
sy: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.sy,
|
|
17
15
|
ug: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.ug,
|
|
18
16
|
xJ: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.xJ
|
|
19
17
|
});
|
|
@@ -34,12 +32,10 @@ export const __webpack_modules__ = {
|
|
|
34
32
|
__webpack_require__.d(__webpack_exports__, {
|
|
35
33
|
C2: ()=>__wbg_push_737cfc8c1432c2c6,
|
|
36
34
|
Or: ()=>__wbindgen_throw,
|
|
37
|
-
Y1: ()=>malloc,
|
|
38
35
|
a9: ()=>__wbg_new_78feb108b6472713,
|
|
39
|
-
|
|
36
|
+
h4: ()=>__wbindgen_string_new,
|
|
40
37
|
oT: ()=>__wbg_set_wasm,
|
|
41
38
|
pE: ()=>transform_raw_u16_inline_style_ptr_parsed,
|
|
42
|
-
sy: ()=>__wbg_fromCharCode_5493f9b25e1ce0a1,
|
|
43
39
|
ug: ()=>__wbindgen_object_drop_ref,
|
|
44
40
|
xJ: ()=>transform_raw_u16_inline_style_ptr
|
|
45
41
|
});
|
|
@@ -48,15 +44,6 @@ export const __webpack_modules__ = {
|
|
|
48
44
|
function __wbg_set_wasm(val) {
|
|
49
45
|
wasm = val;
|
|
50
46
|
}
|
|
51
|
-
let cachedUint16ArrayMemory0 = null;
|
|
52
|
-
function getUint16ArrayMemory0() {
|
|
53
|
-
if (null === cachedUint16ArrayMemory0 || 0 === cachedUint16ArrayMemory0.byteLength) cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
|
|
54
|
-
return cachedUint16ArrayMemory0;
|
|
55
|
-
}
|
|
56
|
-
function getArrayU16FromWasm0(ptr, len) {
|
|
57
|
-
ptr >>>= 0;
|
|
58
|
-
return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
|
|
59
|
-
}
|
|
60
47
|
const heap = new Array(128).fill(void 0);
|
|
61
48
|
heap.push(void 0, null, true, false);
|
|
62
49
|
let heap_next = heap.length;
|
|
@@ -95,24 +82,77 @@ export const __webpack_modules__ = {
|
|
|
95
82
|
ptr >>>= 0;
|
|
96
83
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
97
84
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
let WASM_VECTOR_LEN = 0;
|
|
86
|
+
const lTextEncoder = 'undefined' == typeof TextEncoder ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
87
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
88
|
+
const encodeString = 'function' == typeof cachedTextEncoder.encodeInto ? function(arg, view) {
|
|
89
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
90
|
+
} : function(arg, view) {
|
|
91
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
92
|
+
view.set(buf);
|
|
93
|
+
return {
|
|
94
|
+
read: arg.length,
|
|
95
|
+
written: buf.length
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
99
|
+
if (void 0 === realloc) {
|
|
100
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
101
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
102
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
103
|
+
WASM_VECTOR_LEN = buf.length;
|
|
104
|
+
return ptr;
|
|
105
|
+
}
|
|
106
|
+
let len = arg.length;
|
|
107
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
108
|
+
const mem = getUint8ArrayMemory0();
|
|
109
|
+
let offset = 0;
|
|
110
|
+
for(; offset < len; offset++){
|
|
111
|
+
const code = arg.charCodeAt(offset);
|
|
112
|
+
if (code > 0x7F) break;
|
|
113
|
+
mem[ptr + offset] = code;
|
|
114
|
+
}
|
|
115
|
+
if (offset !== len) {
|
|
116
|
+
if (0 !== offset) arg = arg.slice(offset);
|
|
117
|
+
ptr = realloc(ptr, len, len = offset + 3 * arg.length, 1) >>> 0;
|
|
118
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
119
|
+
const ret = encodeString(arg, view);
|
|
120
|
+
offset += ret.written;
|
|
121
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
122
|
+
}
|
|
123
|
+
WASM_VECTOR_LEN = offset;
|
|
124
|
+
return ptr;
|
|
105
125
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
126
|
+
let cachedDataViewMemory0 = null;
|
|
127
|
+
function getDataViewMemory0() {
|
|
128
|
+
if (null === cachedDataViewMemory0 || true === cachedDataViewMemory0.buffer.detached || void 0 === cachedDataViewMemory0.buffer.detached && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
129
|
+
return cachedDataViewMemory0;
|
|
109
130
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
131
|
+
function transform_raw_u16_inline_style_ptr(str) {
|
|
132
|
+
try {
|
|
133
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
134
|
+
const ptr0 = passStringToWasm0(str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
135
|
+
const len0 = WASM_VECTOR_LEN;
|
|
136
|
+
wasm.transform_raw_u16_inline_style_ptr(retptr, ptr0, len0);
|
|
137
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
138
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
139
|
+
let v2;
|
|
140
|
+
if (0 !== r0) {
|
|
141
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
142
|
+
wasm.__wbindgen_export_2(r0, +r1, 1);
|
|
143
|
+
}
|
|
144
|
+
return v2;
|
|
145
|
+
} finally{
|
|
146
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
147
|
+
}
|
|
112
148
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
149
|
+
function transform_raw_u16_inline_style_ptr_parsed(name, value) {
|
|
150
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
151
|
+
const len0 = WASM_VECTOR_LEN;
|
|
152
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
153
|
+
const len1 = WASM_VECTOR_LEN;
|
|
154
|
+
const ret = wasm.transform_raw_u16_inline_style_ptr_parsed(ptr0, len0, ptr1, len1);
|
|
155
|
+
return takeObject(ret);
|
|
116
156
|
}
|
|
117
157
|
function __wbg_new_78feb108b6472713() {
|
|
118
158
|
const ret = new Array();
|
|
@@ -125,6 +165,10 @@ export const __webpack_modules__ = {
|
|
|
125
165
|
function __wbindgen_object_drop_ref(arg0) {
|
|
126
166
|
takeObject(arg0);
|
|
127
167
|
}
|
|
168
|
+
function __wbindgen_string_new(arg0, arg1) {
|
|
169
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
170
|
+
return addHeapObject(ret);
|
|
171
|
+
}
|
|
128
172
|
function __wbindgen_throw(arg0, arg1) {
|
|
129
173
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
130
174
|
}
|
|
@@ -134,14 +178,12 @@ export const __webpack_modules__ = {
|
|
|
134
178
|
try {
|
|
135
179
|
__webpack_require__.r(__webpack_exports__);
|
|
136
180
|
__webpack_require__.d(__webpack_exports__, {
|
|
137
|
-
__wbg_fromCharCode_5493f9b25e1ce0a1: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.sy,
|
|
138
181
|
__wbg_new_78feb108b6472713: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.a9,
|
|
139
182
|
__wbg_push_737cfc8c1432c2c6: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.C2,
|
|
140
183
|
__wbg_set_wasm: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.oT,
|
|
141
184
|
__wbindgen_object_drop_ref: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.ug,
|
|
185
|
+
__wbindgen_string_new: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.h4,
|
|
142
186
|
__wbindgen_throw: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.Or,
|
|
143
|
-
free: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.gd,
|
|
144
|
-
malloc: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.Y1,
|
|
145
187
|
memory: ()=>_dist_legacy_bg_wasm__WEBPACK_IMPORTED_MODULE_1__.memory,
|
|
146
188
|
transform_raw_u16_inline_style_ptr: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.xJ,
|
|
147
189
|
transform_raw_u16_inline_style_ptr_parsed: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.pE
|
|
@@ -161,10 +203,10 @@ export const __webpack_modules__ = {
|
|
|
161
203
|
},
|
|
162
204
|
"../web-style-transformer/dist/legacy_bg.wasm": function(module, exports, __webpack_require__) {
|
|
163
205
|
var WEBPACK_IMPORTED_MODULE_0 = __webpack_require__("../web-style-transformer/dist/legacy_bg.js");
|
|
164
|
-
module.exports = __webpack_require__.v(exports, module.id, "
|
|
206
|
+
module.exports = __webpack_require__.v(exports, module.id, "578076972e1e5ffd", {
|
|
165
207
|
"./legacy_bg.js": {
|
|
166
|
-
__wbg_fromCharCode_5493f9b25e1ce0a1: WEBPACK_IMPORTED_MODULE_0.sy,
|
|
167
208
|
__wbg_new_78feb108b6472713: WEBPACK_IMPORTED_MODULE_0.a9,
|
|
209
|
+
__wbindgen_string_new: WEBPACK_IMPORTED_MODULE_0.h4,
|
|
168
210
|
__wbg_push_737cfc8c1432c2c6: WEBPACK_IMPORTED_MODULE_0.C2,
|
|
169
211
|
__wbindgen_object_drop_ref: WEBPACK_IMPORTED_MODULE_0.ug,
|
|
170
212
|
__wbindgen_throw: WEBPACK_IMPORTED_MODULE_0.Or
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-server",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
27
|
+
"rsbuild-plugin-publint": "0.3.3",
|
|
26
28
|
"@lynx-js/offscreen-document": "0.1.3",
|
|
27
|
-
"@lynx-js/web-constants": "0.15.5",
|
|
28
29
|
"@lynx-js/web-elements-template": "0.8.4",
|
|
29
|
-
"@lynx-js/web-mainthread-apis": "0.15.
|
|
30
|
-
"@lynx-js/web-worker-rpc": "0.15.
|
|
30
|
+
"@lynx-js/web-mainthread-apis": "0.15.7",
|
|
31
|
+
"@lynx-js/web-worker-rpc": "0.15.7",
|
|
32
|
+
"@lynx-js/web-constants": "0.15.7"
|
|
31
33
|
},
|
|
32
34
|
"scripts": {
|
|
33
35
|
"build": "rslib build",
|
|
Binary file
|
|
Binary file
|