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/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.