plotline-engage 5.7.5 → 5.7.6

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.
@@ -61,24 +61,18 @@ public class PlotlineWrapperView extends FrameLayout {
61
61
  try {
62
62
  ThemedReactContext themedReactContext = (ThemedReactContext) getContext();
63
63
  if (themedReactContext.hasActiveReactInstance()) {
64
- if (UIManagerHelper.getUIManager(themedReactContext, getId()) instanceof FabricUIManager) {
65
-
66
- WritableMap eventData = Arguments.createMap();
67
- eventData.putDouble("width", PixelUtil.toDIPFromPixel(finalWidth));
68
- eventData.putDouble("height", PixelUtil.toDIPFromPixel(finalHeight));
64
+ WritableMap eventData = Arguments.createMap();
65
+ eventData.putDouble("width", PixelUtil.toDIPFromPixel(finalWidth));
66
+ eventData.putDouble("height", PixelUtil.toDIPFromPixel(finalHeight));
69
67
 
68
+ if (UIManagerHelper.getUIManager(themedReactContext, getId()) instanceof FabricUIManager) {
70
69
  EventDispatcher eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(themedReactContext, getId());
71
70
  if (eventDispatcher != null) {
72
71
  eventDispatcher.dispatchEvent(new SizeChangedEvent(UIManagerHelper.getSurfaceId(getContext()), getId(), eventData));
73
72
  }
74
73
  } else {
75
- // LEGACY ARCHITECTURE PATH
76
- themedReactContext.runOnNativeModulesQueueThread(() -> {
77
- UIManagerModule uiManagerModule = themedReactContext.getNativeModule(UIManagerModule.class);
78
- if (uiManagerModule != null) {
79
- uiManagerModule.updateNodeSize(getId(), finalWidth, finalHeight);
80
- }
81
- });
74
+ // LEGACY ARCHITECTURE PATH: same event as Fabric; updateNodeSize pinned the width in points, so the view never followed later parent resizes.
75
+ themedReactContext.getJSModule(RCTEventEmitter.class).receiveEvent(getId(), SizeChangedEvent.EVENT_NAME, eventData);
82
76
  }
83
77
  }
84
78
  } catch (Exception e) {
package/index.js CHANGED
@@ -245,7 +245,8 @@ const PlotlineWidget = ({ testID }) => {
245
245
  const { width, height } = event.nativeEvent;
246
246
 
247
247
  if (width > 0) {
248
- setSize({ width, height });
248
+ // Android: keep the width at 100% so the view follows later parent resizes; the native width only echoes the parent width at measure time.
249
+ setSize({ width: '100%', height });
249
250
  }
250
251
  };
251
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotline-engage",
3
- "version": "5.7.5",
3
+ "version": "5.7.6",
4
4
  "description": "React Native plugin for Plotline",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"