plotline-engage 4.1.2 → 4.1.5

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.
@@ -39,6 +39,6 @@ repositories {
39
39
 
40
40
  dependencies {
41
41
  implementation 'com.facebook.react:react-native:+'
42
- implementation 'com.gitlab.plotline:plotline-android-sdk:3.2.8'
42
+ implementation 'com.gitlab.plotline:plotline-android-sdk:3.3.4'
43
43
  }
44
44
 
@@ -8,7 +8,6 @@ import so.plotline.insights.PlotlineWidget;
8
8
 
9
9
  public class PlotlineViewManager extends ViewGroupManager<PlotlineWrapperView> {
10
10
  public static final String REACT_CLASS = "PlotlineView";
11
- private String testId;
12
11
 
13
12
  @Override
14
13
  public String getName() {
@@ -19,14 +18,12 @@ public class PlotlineViewManager extends ViewGroupManager<PlotlineWrapperView> {
19
18
  public void setTestId(PlotlineWrapperView view, String testID) {
20
19
  PlotlineWidget widget = (PlotlineWidget) view.getContentView();
21
20
  widget.setElementId(testID);
22
- widget.setTag(testID);
23
- this.testId = testID;
24
21
  }
25
22
 
26
23
  @Override
27
24
  protected PlotlineWrapperView createViewInstance(ThemedReactContext reactContext) {
28
25
  PlotlineWrapperView wrapperView = new PlotlineWrapperView(reactContext);
29
- PlotlineWidget plotlineWidget = new PlotlineWidget(reactContext, testId);
26
+ PlotlineWidget plotlineWidget = new PlotlineWidget(reactContext);
30
27
  wrapperView.setContentView(plotlineWidget);
31
28
  return wrapperView;
32
29
  }
package/index.js CHANGED
@@ -186,8 +186,10 @@ const PlotlineWidget = ({ testID }) => {
186
186
  const subscription = plotlineEvents.addListener(
187
187
  'onPlotlineWidgetReady',
188
188
  (event) => {
189
- const { width, height } = event;
190
- setSize({ width, height });
189
+ const { width, height, sizeForTestID } = event;
190
+ if (sizeForTestID === testID) {
191
+ setSize({ width, height });
192
+ }
191
193
  }
192
194
  );
193
195
 
@@ -40,7 +40,7 @@
40
40
 
41
41
  - (void)onWidgetReadyWithWidth:(CGFloat)width height:(CGFloat)height {
42
42
  PlotlineWidgetEventEmitter *plotlineWidgetEventEmitter = [self.eventBridge moduleForClass:[PlotlineWidgetEventEmitter class]];
43
- [plotlineWidgetEventEmitter sendSizeEventWithWidth:width height:height];
43
+ [plotlineWidgetEventEmitter sendSizeEventWithWidth:width height:height sizeForTestID:self.testID];
44
44
  }
45
45
 
46
46
  @end
@@ -9,7 +9,7 @@
9
9
 
10
10
  @interface PlotlineWidgetEventEmitter : RCTEventEmitter
11
11
  @property (nonatomic) BOOL hasListeners;
12
- - (void)sendSizeEventWithWidth:(CGFloat)width height:(CGFloat)height;
12
+ - (void)sendSizeEventWithWidth:(CGFloat)width height:(CGFloat)height sizeForTestID:(NSString *)sizeForTestID;
13
13
  @end
14
14
 
15
15
 
@@ -15,9 +15,13 @@ RCT_EXPORT_MODULE(PlotlineWidgetEventEmitter)
15
15
  return @[@"onPlotlineWidgetReady"];
16
16
  }
17
17
 
18
- - (void)sendSizeEventWithWidth:(CGFloat)width height:(CGFloat)height {
18
+ - (void)sendSizeEventWithWidth:(CGFloat)width height:(CGFloat)height sizeForTestID:(NSString *)sizeForTestID {
19
19
  if (self.hasListeners) {
20
- [self sendEventWithName:@"onPlotlineWidgetReady" body:@{@"width": @(width), @"height": @(height)}];
20
+ [self sendEventWithName:@"onPlotlineWidgetReady" body:@{
21
+ @"width": @(width),
22
+ @"height": @(height),
23
+ @"sizeForTestID": sizeForTestID
24
+ }];
21
25
  }
22
26
  }
23
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotline-engage",
3
- "version": "4.1.2",
3
+ "version": "4.1.5",
4
4
  "description": "React Native plugin for Plotline",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"