embedded-react 0.20.0 → 0.22.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/NOTICE +5 -0
- package/README.md +3 -2
- package/aot/app-file-loader.mjs +116 -0
- package/aot/compile.mjs +17 -47
- package/aot/compiler/alerts.mjs +604 -0
- package/aot/compiler/animations.mjs +299 -57
- package/aot/compiler/boot.mjs +27 -2
- package/aot/compiler/check.mjs +62 -10
- package/aot/compiler/collect.mjs +517 -137
- package/aot/compiler/contexts.mjs +391 -0
- package/aot/compiler/control-flow.mjs +276 -117
- package/aot/compiler/custom-hooks.mjs +686 -0
- package/aot/compiler/elements/button.mjs +182 -0
- package/aot/compiler/elements/image-background.mjs +76 -0
- package/aot/compiler/elements/image.mjs +2 -1
- package/aot/compiler/elements/props.mjs +47 -8
- package/aot/compiler/elements/rewrite.mjs +118 -0
- package/aot/compiler/elements/section-list.mjs +370 -0
- package/aot/compiler/expressions.mjs +1378 -97
- package/aot/compiler/handlers.mjs +1807 -354
- package/aot/compiler/helper-values.mjs +312 -0
- package/aot/compiler/ir/nodes.mjs +40 -1
- package/aot/compiler/ir/reads.mjs +206 -5
- package/aot/compiler/ir/text.mjs +5 -1
- package/aot/compiler/ir/types.mjs +12 -0
- package/aot/compiler/kept-states.mjs +177 -0
- package/aot/compiler/keyboard-dismiss.mjs +99 -0
- package/aot/compiler/keyboard.mjs +1 -1
- package/aot/compiler/list-items.mjs +226 -0
- package/aot/compiler/list-order.mjs +586 -0
- package/aot/compiler/list-split.mjs +259 -0
- package/aot/compiler/loops.mjs +582 -0
- package/aot/compiler/lower.mjs +203 -53
- package/aot/compiler/native-files.mjs +439 -0
- package/aot/compiler/native-header.mjs +335 -0
- package/aot/compiler/native-modules.mjs +1173 -0
- package/aot/compiler/nodes.mjs +45 -31
- package/aot/compiler/options.mjs +3 -2
- package/aot/compiler/out.mjs +18 -1
- package/aot/compiler/package/animations.mjs +133 -23
- package/aot/compiler/package/assemble.mjs +2 -4
- package/aot/compiler/package/bytecode.mjs +37 -8
- package/aot/compiler/package/checks.mjs +4 -0
- package/aot/compiler/package/codegen.mjs +906 -33
- package/aot/compiler/package/enums.mjs +10 -0
- package/aot/compiler/package/format.mjs +16 -3
- package/aot/compiler/package/lower.mjs +707 -176
- package/aot/compiler/package/string-caps.mjs +515 -0
- package/aot/compiler/package/tables.mjs +24 -0
- package/aot/compiler/package/writer.mjs +22 -0
- package/aot/compiler/parse.mjs +3 -1
- package/aot/compiler/record-shapes.mjs +246 -0
- package/aot/compiler/records.mjs +654 -0
- package/aot/compiler/reducers.mjs +272 -0
- package/aot/compiler/scroll-to.mjs +112 -0
- package/aot/compiler/static-eval.mjs +315 -7
- package/aot/compiler/style-text.mjs +20 -5
- package/aot/compiler/svg.mjs +13 -7
- package/aot/compiler/switch-cases.mjs +198 -0
- package/aot/compiler/tagged-records.mjs +450 -0
- package/aot/compiler/typing.mjs +307 -0
- package/aot/compiler/updaters.mjs +321 -0
- package/aot/compiler/window-dimensions.mjs +94 -0
- package/aot/compiler/worked-values.mjs +319 -0
- package/aot/demo-file.mjs +30 -0
- package/aot/style-map.mjs +94 -3
- package/assets/bake-font.mjs +187 -244
- package/assets/bake-image.mjs +47 -71
- package/assets/bake-svg.mjs +465 -533
- package/assets/build-builtin-font.mjs +14 -27
- package/assets/emit-c.mjs +124 -204
- package/assets/emit-container.mjs +129 -197
- package/assets/emit-pack.mjs +92 -136
- package/assets/font-config.mjs +19 -27
- package/assets/font-sizes.mjs +432 -507
- package/assets/glyph-coverage.mjs +170 -214
- package/assets/index.mjs +52 -97
- package/assets/rasterize.mjs +173 -194
- package/assets/svg-loader.mjs +42 -48
- package/build.mjs +85 -94
- package/cli.mjs +490 -586
- package/compile-bin.mjs +24 -36
- package/flash.mjs +297 -401
- package/hotreload/dev-device.mjs +229 -270
- package/hotreload/pack-app.mjs +118 -159
- package/hotreload/pack-split.mjs +146 -213
- package/hotreload/package-transfer.mjs +128 -131
- package/hotreload/protocol.mjs +118 -118
- package/hotreload/uploader.mjs +132 -159
- package/hotreload/watch-tree.mjs +56 -65
- package/pack-container.mjs +94 -116
- package/package.json +19 -16
- package/persist-transform.mjs +89 -105
- package/qjsc-wasm.mjs +47 -72
- package/sim/embedded-react.wasm +0 -0
- package/sim/index.html +1 -1
- package/sim-server.mjs +260 -354
- package/src/embedded-react/Alert.mjs +112 -0
- package/src/embedded-react/Animated.mjs +412 -0
- package/src/embedded-react/{AppRegistry.js → AppRegistry.mjs} +26 -25
- package/src/embedded-react/{Button.js → Button.mjs} +29 -53
- package/src/embedded-react/Dimensions.mjs +32 -0
- package/src/embedded-react/Easing.mjs +34 -0
- package/src/embedded-react/{FlatList.js → FlatList.mjs} +25 -42
- package/src/embedded-react/{ImageBackground.js → ImageBackground.mjs} +11 -22
- package/src/embedded-react/Keyboard.mjs +82 -0
- package/src/embedded-react/{LayoutAnimation.js → LayoutAnimation.mjs} +17 -28
- package/src/embedded-react/PanResponder.mjs +256 -0
- package/src/embedded-react/{Platform.js → Platform.mjs} +8 -9
- package/src/embedded-react/{Pressable.js → Pressable.mjs} +12 -25
- package/src/embedded-react/SectionList.mjs +103 -0
- package/src/embedded-react/{StyleSheet.js → StyleSheet.mjs} +16 -20
- package/src/embedded-react/{TouchableOpacity.js → TouchableOpacity.mjs} +47 -83
- package/src/embedded-react/background-image.mjs +321 -0
- package/src/embedded-react/{components.js → components.mjs} +1 -3
- package/src/embedded-react/{imperative.js → imperative.mjs} +27 -38
- package/src/embedded-react/index.d.ts +238 -5
- package/src/embedded-react/index.js +26 -17
- package/src/embedded-react/layout-anim-config.mjs +85 -0
- package/src/embedded-react/{list-child.js → list-child.mjs} +11 -20
- package/src/embedded-react/{named-colors.js → named-colors.mjs} +2 -6
- package/src/embedded-react/nativeModule.mjs +371 -0
- package/src/embedded-react/split-style.mjs +57 -0
- package/src/embedded-react/svg-ops.mjs +1075 -0
- package/src/embedded-react/{useHostValue.js → useHostValue.mjs} +2 -4
- package/src/embedded-react/{usePersistentState.js → usePersistentState.mjs} +34 -38
- package/src/embedded-react/{warn-props.js → warn-props.mjs} +32 -39
- package/src/host-config.mjs +512 -0
- package/src/{native-ui.js → native-ui.mjs} +1 -8
- package/src/props.mjs +341 -0
- package/src/{renderer.js → renderer.mjs} +30 -44
- package/src/embedded-react/Animated.js +0 -440
- package/src/embedded-react/Easing.js +0 -39
- package/src/embedded-react/PanResponder.js +0 -330
- package/src/embedded-react/SectionList.js +0 -148
- package/src/embedded-react/layout-anim-config.js +0 -101
- package/src/embedded-react/split-style.js +0 -58
- package/src/embedded-react/svg-ops.js +0 -1295
- package/src/host-config.js +0 -548
- package/src/props.js +0 -306
|
@@ -102,6 +102,13 @@ export function internedStates(app) {
|
|
|
102
102
|
if (!isRead(node.initializer)) {
|
|
103
103
|
walk(node.initializer);
|
|
104
104
|
}
|
|
105
|
+
walk(node.text);
|
|
106
|
+
return;
|
|
107
|
+
case 'assignLocal':
|
|
108
|
+
if (!isRead(node.value)) {
|
|
109
|
+
walk(node.value);
|
|
110
|
+
}
|
|
111
|
+
walk(node.text);
|
|
105
112
|
return;
|
|
106
113
|
}
|
|
107
114
|
// A text's value part prints the state's string, which the set holds.
|
|
@@ -123,6 +130,7 @@ export function internedStates(app) {
|
|
|
123
130
|
nodesOf(app.root),
|
|
124
131
|
output.handlers,
|
|
125
132
|
output.timerFunctions,
|
|
133
|
+
output.nativeEventHandlers,
|
|
126
134
|
output.effectFunctions,
|
|
127
135
|
output.mountEffects,
|
|
128
136
|
output.dependencyEffects,
|
|
@@ -130,6 +138,8 @@ export function internedStates(app) {
|
|
|
130
138
|
output.panResponders,
|
|
131
139
|
output.vectors,
|
|
132
140
|
app.boot,
|
|
141
|
+
app.state.flatMap(state => state.kind === 'list' && state.derived ? [state.derived] : []),
|
|
142
|
+
app.state.flatMap(state => state.kind === 'scalar' && state.worked ? [state.worked] : []),
|
|
133
143
|
]);
|
|
134
144
|
for (const state of refused) {
|
|
135
145
|
values.delete(state);
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
- Versions and container
|
|
24
24
|
---------------------------------------------------------------------------------------------------------------------*/
|
|
25
25
|
export const FORMAT_MAJOR = 1;
|
|
26
|
-
export const FORMAT_MINOR =
|
|
26
|
+
export const FORMAT_MINOR = 16;
|
|
27
27
|
/** The engine ABI level the package is built against (er_scene.h's ER_ABI). */
|
|
28
|
-
export const ENGINE_ABI =
|
|
28
|
+
export const ENGINE_ABI = 2;
|
|
29
29
|
export const PACKAGE_TAG = 'erb';
|
|
30
30
|
export const SECTION_PROGRAM = 4;
|
|
31
31
|
export const SECTION_DEBUG = 5;
|
|
@@ -95,6 +95,7 @@ export const Table = {
|
|
|
95
95
|
interpolations: 18,
|
|
96
96
|
keyboard: 19,
|
|
97
97
|
checks: 20,
|
|
98
|
+
nativeEvents: 21,
|
|
98
99
|
};
|
|
99
100
|
/** Arena region kinds, written in this order. */
|
|
100
101
|
export const Region = {
|
|
@@ -211,6 +212,7 @@ export const FunctionKind = {
|
|
|
211
212
|
boot: 0x83,
|
|
212
213
|
helper: 0x84,
|
|
213
214
|
animationDone: 0x85,
|
|
215
|
+
nativeEvent: 0x86,
|
|
214
216
|
};
|
|
215
217
|
/** Event data fields EVT reads. */
|
|
216
218
|
export const EventField = {
|
|
@@ -448,8 +450,18 @@ export const OPCODES = [
|
|
|
448
450
|
['VGRAD', 'abc', 1],
|
|
449
451
|
['VCOMMITP', 'abx', 1],
|
|
450
452
|
['SCREEN', 'abx', 1],
|
|
453
|
+
['FMTUPPER', 'abc', 1],
|
|
454
|
+
['FMTSLICE', 'abc', 1],
|
|
455
|
+
['SHAS', 'abc', 1],
|
|
456
|
+
['REMOVE', 'abx', 1],
|
|
457
|
+
['SCMP', 'abc', 1],
|
|
458
|
+
['SPLIT', 'abc', 2],
|
|
459
|
+
['AVAIL', 'abx', 1],
|
|
460
|
+
['CALLNS', 'abx', 2],
|
|
461
|
+
['FMTLOG', 'abc', 1],
|
|
462
|
+
['SCROLLAT', 'abc', 1],
|
|
451
463
|
];
|
|
452
|
-
/** The props with ids 1 to
|
|
464
|
+
/** The props with ids 1 to 151, in id order, as erb_props.c lists them, with each enum's largest value. */
|
|
453
465
|
const PROPS_IN_ORDER = [
|
|
454
466
|
['left', 'i16'],
|
|
455
467
|
['top', 'i16'],
|
|
@@ -601,6 +613,7 @@ const PROPS_IN_ORDER = [
|
|
|
601
613
|
['gradient_stops[1].position', 'float'],
|
|
602
614
|
['gradient_stops[2].position', 'float'],
|
|
603
615
|
['gradient_stops[3].position', 'float'],
|
|
616
|
+
['gradient_corner', 'enum', 4],
|
|
604
617
|
];
|
|
605
618
|
/** Span props start at this id, SPAN_STRIDE ids per span. */
|
|
606
619
|
export const SPAN_PROP_FIRST = 160;
|