@sigx/lynx-runtime-main 0.4.1 → 0.4.3
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/README.md +1 -1
- package/dist/animated-style-mappers.js +20 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Main-thread (Lepus) runtime for [SignalX](https://github.com/signalxjs) on Lynx. Receives the op stream from `@sigx/lynx-runtime`, mutates the native render tree via Lynx PAPI, and runs `'main thread'`-marked worklets at the host's display refresh rate.
|
|
4
4
|
|
|
5
|
-
> Application code rarely imports from this package directly. The build pipeline ([`@sigx/lynx-plugin`](
|
|
5
|
+
> Application code rarely imports from this package directly. The build pipeline ([`@sigx/lynx-plugin`](https://github.com/signalxjs/lynx/tree/main/packages/lynx-plugin)) wires it into the main-thread bundle automatically.
|
|
6
6
|
|
|
7
7
|
## Responsibilities
|
|
8
8
|
|
|
@@ -92,6 +92,22 @@ const mtMappers = {
|
|
|
92
92
|
const offset = p?.offset ?? 0;
|
|
93
93
|
return { transform: `scale(${v + offset})` };
|
|
94
94
|
},
|
|
95
|
+
scaleX: (v, p) => {
|
|
96
|
+
if (isRangeParams(p)) {
|
|
97
|
+
const out = interpolateLinear(v, p.inputRange, p.outputRange, p.extrapolate);
|
|
98
|
+
return { transform: `scaleX(${out})` };
|
|
99
|
+
}
|
|
100
|
+
const offset = p?.offset ?? 0;
|
|
101
|
+
return { transform: `scaleX(${v + offset})` };
|
|
102
|
+
},
|
|
103
|
+
scaleY: (v, p) => {
|
|
104
|
+
if (isRangeParams(p)) {
|
|
105
|
+
const out = interpolateLinear(v, p.inputRange, p.outputRange, p.extrapolate);
|
|
106
|
+
return { transform: `scaleY(${out})` };
|
|
107
|
+
}
|
|
108
|
+
const offset = p?.offset ?? 0;
|
|
109
|
+
return { transform: `scaleY(${v + offset})` };
|
|
110
|
+
},
|
|
95
111
|
opacity: (v, p) => {
|
|
96
112
|
if (isRangeParams(p)) {
|
|
97
113
|
const raw = interpolateLinear(v, p.inputRange, p.outputRange, p.extrapolate);
|
|
@@ -105,6 +121,8 @@ const mtMappers = {
|
|
|
105
121
|
return { opacity: String(out) };
|
|
106
122
|
},
|
|
107
123
|
rotate: (v) => ({ transform: `rotate(${v}deg)` }),
|
|
124
|
+
width: (v, p) => ({ width: `${linearOrRange(v, p)}px` }),
|
|
125
|
+
height: (v, p) => ({ height: `${linearOrRange(v, p)}px` }),
|
|
108
126
|
paddingTop: (v, p) => ({ paddingTop: `${linearOrRange(v, p)}px` }),
|
|
109
127
|
paddingRight: (v, p) => ({ paddingRight: `${linearOrRange(v, p)}px` }),
|
|
110
128
|
paddingBottom: (v, p) => ({ paddingBottom: `${linearOrRange(v, p)}px` }),
|
|
@@ -141,7 +159,8 @@ export function registerMapper(name, mapper) {
|
|
|
141
159
|
* the MT-side resetMainThreadState path (HMR / tests).
|
|
142
160
|
*/
|
|
143
161
|
const BUILTIN_NAMES = new Set([
|
|
144
|
-
'translateX', 'translateY', 'translate', 'scale', 'opacity', 'rotate',
|
|
162
|
+
'translateX', 'translateY', 'translate', 'scale', 'scaleX', 'scaleY', 'opacity', 'rotate',
|
|
163
|
+
'width', 'height',
|
|
145
164
|
'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft',
|
|
146
165
|
'marginTop', 'marginRight', 'marginBottom', 'marginLeft',
|
|
147
166
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigx/lynx-runtime-main",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Main Thread (Lepus) entry and ops applier for SignalX Lynx renderer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"url": "https://github.com/signalxjs/lynx/issues"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sigx/lynx-runtime-internal": "0.4.
|
|
45
|
+
"@sigx/lynx-runtime-internal": "0.4.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@lynx-js/types": ">=3.0.0"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@lynx-js/types": "^3.9.0",
|
|
57
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
57
|
+
"@typescript/native-preview": "7.0.0-dev.20260521.1",
|
|
58
58
|
"typescript": "^6.0.3"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|