plotline-engage 4.1.4 → 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.
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
|
-
|
|
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:@{
|
|
20
|
+
[self sendEventWithName:@"onPlotlineWidgetReady" body:@{
|
|
21
|
+
@"width": @(width),
|
|
22
|
+
@"height": @(height),
|
|
23
|
+
@"sizeForTestID": sizeForTestID
|
|
24
|
+
}];
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
|