embedded-react 0.11.1 → 0.13.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/README.md +162 -4
- package/aot/compile.mjs +1270 -73
- package/aot/style-map.mjs +13 -5
- package/assets/bake-font.mjs +104 -12
- package/assets/bake-svg.mjs +11 -1
- package/assets/build-builtin-font.mjs +6 -12
- package/assets/emit-c.mjs +10 -2
- package/assets/font-config.mjs +49 -0
- package/assets/font-sizes.mjs +652 -0
- package/assets/glyph-coverage.mjs +281 -0
- package/assets/index.mjs +29 -5
- package/build.mjs +11 -21
- package/cli.mjs +13 -1
- package/compile-bin.mjs +71 -0
- package/hotreload/pack-app.mjs +8 -21
- package/hotreload/pack-split.mjs +12 -27
- package/pack-container.mjs +10 -47
- package/package.json +2 -1
- package/sim/embedded-react.wasm +0 -0
- package/sim/index.html +32 -3
- package/sim-server.mjs +33 -27
- package/src/embedded-react/Animated.js +23 -9
- package/src/embedded-react/Button.js +98 -0
- package/src/embedded-react/FlatList.js +88 -0
- package/src/embedded-react/ImageBackground.js +67 -0
- package/src/embedded-react/PanResponder.js +326 -0
- package/src/embedded-react/SectionList.js +148 -0
- package/src/embedded-react/TouchableOpacity.js +152 -0
- package/src/embedded-react/components.js +4 -3
- package/src/embedded-react/index.d.ts +868 -59
- package/src/embedded-react/index.js +7 -2
- package/src/embedded-react/list-child.js +54 -0
- package/src/embedded-react/svg-ops.js +220 -72
- package/src/embedded-react/warn-props.js +80 -0
- package/src/host-config.js +98 -3
- package/src/props.js +47 -0
package/src/props.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// Top-level props NativeUI understands directly (not part of `style`). Everything else style-ish is
|
|
21
21
|
// expected inside props.style. Event handlers (on*) are routed separately via setEvent.
|
|
22
22
|
export const PASSTHROUGH = [
|
|
23
|
+
'delayLongPress',
|
|
23
24
|
'numberOfLines',
|
|
24
25
|
'ellipsizeMode',
|
|
25
26
|
'value',
|
|
@@ -31,6 +32,33 @@ export const PASSTHROUGH = [
|
|
|
31
32
|
'resizeMode',
|
|
32
33
|
'tintColor',
|
|
33
34
|
'imageName',
|
|
35
|
+
// Switch colours.
|
|
36
|
+
'trackColor',
|
|
37
|
+
'thumbColor',
|
|
38
|
+
// <Dial> (the native arc widget, ER_NODE_ARC).
|
|
39
|
+
'min',
|
|
40
|
+
'max',
|
|
41
|
+
'startAngle',
|
|
42
|
+
'sweepAngle',
|
|
43
|
+
'step',
|
|
44
|
+
'gapAngle',
|
|
45
|
+
'thickness',
|
|
46
|
+
'bandThickness',
|
|
47
|
+
'knobSize',
|
|
48
|
+
'knobBorderWidth',
|
|
49
|
+
'indicatorColor',
|
|
50
|
+
'bandColor',
|
|
51
|
+
'knobColor',
|
|
52
|
+
'knobBorderColor',
|
|
53
|
+
'segments',
|
|
54
|
+
'cap',
|
|
55
|
+
'knob',
|
|
56
|
+
'knobImage',
|
|
57
|
+
'adjustable',
|
|
58
|
+
'range',
|
|
59
|
+
'valueStart',
|
|
60
|
+
'minSpan',
|
|
61
|
+
'indicatorGradient',
|
|
34
62
|
];
|
|
35
63
|
|
|
36
64
|
/**
|
|
@@ -168,6 +196,25 @@ export function buildProps(type, props, flatStyle) {
|
|
|
168
196
|
const name = resolveImageSource(props.source);
|
|
169
197
|
if (name != null) flat.imageName = name;
|
|
170
198
|
}
|
|
199
|
+
// <Dial knobImage={require(...)}> takes an asset source like <Image source>; a plain string is an
|
|
200
|
+
// asset name already.
|
|
201
|
+
if (
|
|
202
|
+
type === 'Dial' &&
|
|
203
|
+
props.knobImage != null &&
|
|
204
|
+
typeof props.knobImage !== 'string'
|
|
205
|
+
) {
|
|
206
|
+
const name = resolveImageSource(props.knobImage);
|
|
207
|
+
flat.knobImage = name != null ? name : undefined;
|
|
208
|
+
}
|
|
209
|
+
// `visible` is the Modal's own show/hide prop (it maps to ERProps.modal_visible). On every other
|
|
210
|
+
// component it used to be silently inert; it now means the same thing as `display`, so a subtree can
|
|
211
|
+
// be pruned from layout, raster and hit-testing without unmounting it. An explicit style `display`
|
|
212
|
+
// wins, so the two spellings can't disagree.
|
|
213
|
+
if (type !== 'Modal' && flat.visible !== undefined) {
|
|
214
|
+
if (flat.display === undefined)
|
|
215
|
+
flat.display = flat.visible ? 'flex' : 'none';
|
|
216
|
+
delete flat.visible;
|
|
217
|
+
}
|
|
171
218
|
// <Text> content: flatten string/number/nested-<Text> children into the node's full-text string.
|
|
172
219
|
// The engine renders this when no spans are set; with spans (buildTextSpans) it carries the same
|
|
173
220
|
// text for the plain-text fallback. Non-flattenable children fall back to mounted child instances.
|