react-native-firework-sdk 2.3.1 → 2.4.0-beta.2

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.
Files changed (119) hide show
  1. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +24 -10
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -1
  5. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +1 -1
  7. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  8. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  9. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +24 -10
  10. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -1
  11. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  12. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  13. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +24 -10
  14. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -1
  15. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  16. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -1
  17. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +21 -21
  18. package/android/gradle.properties +1 -1
  19. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +20 -0
  20. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +1 -69
  21. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +3 -1
  22. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +21 -4
  23. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +15 -3
  24. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +2 -1
  25. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +3 -0
  26. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +2 -0
  27. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +3 -1
  28. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +6 -0
  29. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +20 -15
  30. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +45 -16
  31. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +5 -0
  32. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +11 -1
  33. package/android/src/main/java/com/fireworksdk/bridge/utils/FWImageLoaderUtil.kt +16 -0
  34. package/ios/Components/StoryBlock.swift +9 -7
  35. package/ios/Components/StoryBlockConfiguration.swift +13 -0
  36. package/ios/Components/StoryBlockManager.m +6 -1
  37. package/ios/Components/VideoFeed.swift +5 -10
  38. package/ios/Components/VideoFeedManager.m +1 -2
  39. package/ios/Components/VideoPlayerConfiguration.swift +1 -0
  40. package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -26
  41. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +13 -2
  42. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +0 -34
  43. package/ios/FireworkVideoUI/Podfile +1 -1
  44. package/ios/FireworkVideoUI/Podfile.lock +4 -4
  45. package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +1 -0
  46. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +16 -1
  47. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
  48. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +8 -4
  49. package/ios/Modules/Shopping/ShoppingModule.swift +6 -5
  50. package/ios/react_native_firework_sdk.h +0 -1
  51. package/lib/commonjs/FireworkSDK.js.map +1 -1
  52. package/lib/commonjs/components/StoryBlock.js +71 -33
  53. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  54. package/lib/commonjs/components/VideoFeed.js +83 -57
  55. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  56. package/lib/commonjs/index.js.map +1 -1
  57. package/lib/commonjs/models/OpenVideoPlayerConfiguration.js +2 -0
  58. package/lib/commonjs/models/OpenVideoPlayerConfiguration.js.map +1 -0
  59. package/lib/commonjs/models/StoryBlockNativeConfiguration.js +2 -0
  60. package/lib/commonjs/models/StoryBlockNativeConfiguration.js.map +1 -0
  61. package/lib/commonjs/models/VideoPlayerNativeConfiguration.js +2 -0
  62. package/lib/commonjs/models/VideoPlayerNativeConfiguration.js.map +1 -0
  63. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  64. package/lib/module/FireworkSDK.js.map +1 -1
  65. package/lib/module/components/StoryBlock.js +67 -33
  66. package/lib/module/components/StoryBlock.js.map +1 -1
  67. package/lib/module/components/VideoFeed.js +79 -57
  68. package/lib/module/components/VideoFeed.js.map +1 -1
  69. package/lib/module/index.js.map +1 -1
  70. package/lib/module/models/OpenVideoPlayerConfiguration.js +2 -0
  71. package/lib/module/models/OpenVideoPlayerConfiguration.js.map +1 -0
  72. package/lib/module/models/StoryBlockNativeConfiguration.js +2 -0
  73. package/lib/module/models/StoryBlockNativeConfiguration.js.map +1 -0
  74. package/lib/module/models/VideoPlayerNativeConfiguration.js +2 -0
  75. package/lib/module/models/VideoPlayerNativeConfiguration.js.map +1 -0
  76. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  77. package/lib/typescript/FireworkSDK.d.ts +2 -2
  78. package/lib/typescript/components/StoryBlock.d.ts +8 -0
  79. package/lib/typescript/components/VideoFeed.d.ts +8 -1
  80. package/lib/typescript/index.d.ts +2 -1
  81. package/lib/typescript/models/AdBadgeConfiguration.d.ts +3 -0
  82. package/lib/typescript/models/AndroidFontInfo.d.ts +1 -1
  83. package/lib/typescript/models/OpenVideoPlayerConfiguration.d.ts +7 -0
  84. package/lib/typescript/models/Product.d.ts +1 -1
  85. package/lib/typescript/models/ProductUnit.d.ts +1 -1
  86. package/lib/typescript/models/StoryBlockConfiguration.d.ts +1 -1
  87. package/lib/typescript/models/StoryBlockNativeConfiguration.d.ts +7 -0
  88. package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
  89. package/lib/typescript/models/VideoFeedConfiguration.d.ts +29 -4
  90. package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
  91. package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +6 -0
  92. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +10 -1
  93. package/lib/typescript/models/VideoPlayerNativeConfiguration.d.ts +7 -0
  94. package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -2
  95. package/package.json +2 -2
  96. package/react-native-firework-sdk.podspec +1 -1
  97. package/src/FireworkSDK.ts +2 -2
  98. package/src/components/StoryBlock.tsx +65 -36
  99. package/src/components/VideoFeed.tsx +87 -74
  100. package/src/index.ts +2 -0
  101. package/src/models/AdBadgeConfiguration.ts +3 -0
  102. package/src/models/AndroidFontInfo.ts +1 -1
  103. package/src/models/OpenVideoPlayerConfiguration.ts +9 -0
  104. package/src/models/Product.ts +1 -1
  105. package/src/models/ProductUnit.ts +1 -1
  106. package/src/models/StoryBlockConfiguration.ts +1 -1
  107. package/src/models/StoryBlockNativeConfiguration.ts +9 -0
  108. package/src/models/StoryBlockSource.ts +2 -1
  109. package/src/models/VideoFeedConfiguration.ts +29 -4
  110. package/src/models/VideoFeedSource.ts +2 -1
  111. package/src/models/VideoPlayerCTAStyle.ts +6 -0
  112. package/src/models/VideoPlayerConfiguration.ts +10 -1
  113. package/src/models/VideoPlayerNativeConfiguration.ts +9 -0
  114. package/src/modules/FireworkSDKModule.ts +2 -2
  115. package/ios/Modules/Shopping/FWCartViewController.swift +0 -14
  116. package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +0 -31
  117. package/ios/Utils/FWSwizzleLoader.h +0 -15
  118. package/ios/Utils/FWSwizzleLoader.m +0 -21
  119. package/ios/Utils/FWSwizzleLoader.swift +0 -13
@@ -13,7 +13,7 @@ export default interface Product {
13
13
  */
14
14
  description?: string | null;
15
15
  /**
16
- * The availability of the product. Only supported on iOS.
16
+ * The availability of the product.
17
17
  */
18
18
  isAvailable?: boolean;
19
19
  /**
@@ -28,7 +28,7 @@ export default interface ProductUnit {
28
28
  */
29
29
  price?: ProductPrice;
30
30
  /**
31
- * The availability of the product unit. Only supported on iOS.
31
+ * The availability of the product unit.
32
32
  */
33
33
  isAvailable?: boolean;
34
34
  /**
@@ -23,7 +23,7 @@ export interface StoryBlockConfiguration {
23
23
  */
24
24
  ctaDelay?: VideoPlayerCTADelay;
25
25
  /**
26
- * Specifies the delay before the highlight animation occurs. Only supported on iOS.
26
+ * Specifies the delay before the highlight animation occurs.
27
27
  */
28
28
  ctaHighlightDelay?: VideoPlayerCTADelay;
29
29
  /**
@@ -0,0 +1,7 @@
1
+ import type { StoryBlockConfiguration } from './StoryBlockConfiguration';
2
+ export default interface StoryBlockNativeConfiguration extends StoryBlockConfiguration {
3
+ /**
4
+ * Specifies if Picture in Picture is enabled.
5
+ */
6
+ enablePictureInPicture?: boolean;
7
+ }
@@ -1 +1 @@
1
- export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent' | 'hashtagPlaylist';
1
+ export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent' | 'hashtagPlaylist' | 'sku';
@@ -4,19 +4,23 @@ import type GradientDrawable from './GradientDrawable';
4
4
  export interface VideoFeedTitleConfiguration {
5
5
  /**
6
6
  * Specifies if the video feed title is hidden.
7
+ * Defaults to false.
7
8
  */
8
9
  hidden?: boolean;
9
10
  /**
10
11
  * The text color of video feed title.
12
+ * If you don't set this property, the text color will be white with alpha is 0.98 on iOS and #ffffff on Android.
11
13
  */
12
14
  textColor?: string;
13
15
  /**
14
16
  * The font size of video feed title.
17
+ * If you don't set this property, the font size will be 12 on iOS and 14sp on Android.
15
18
  */
16
19
  fontSize?: number;
17
20
  /**
18
21
  * Specifies the number of allowed lines for the label.
19
22
  * Only supported on iOS.
23
+ * Defaults to 2.
20
24
  */
21
25
  numberOfLines?: number;
22
26
  /**
@@ -44,7 +48,15 @@ export interface VideoFeedTitleConfiguration {
44
48
  gradientDrawable?: GradientDrawable;
45
49
  }
46
50
  export interface VideoFeedPlayIconConfiguration {
51
+ /**
52
+ * Specifies if the play icon is hidden.
53
+ * Defaults to false.
54
+ */
47
55
  hidden?: boolean;
56
+ /**
57
+ * The width of play icon.
58
+ * If you don't set this property, the icon width will be 40 on iOS and 36dp on Android.
59
+ */
48
60
  iconWidth?: number;
49
61
  }
50
62
  export type VideoFeedTitlePosition = 'stacked' | 'nested';
@@ -56,11 +68,13 @@ export interface VideoFeedPadding {
56
68
  }
57
69
  export default interface VideoFeedConfiguration {
58
70
  /**
59
- * Background color of video feed.
71
+ * Background color of video feed, such as #c0c0c0.
72
+ * If you don't set this property, the background will be transparent.
60
73
  */
61
74
  backgroundColor?: string;
62
75
  /**
63
76
  * Corner radius of video feed item.
77
+ * Defaults to 10 on iOS. Defaults to 0 on Android.
64
78
  */
65
79
  cornerRadius?: number;
66
80
  /**
@@ -69,10 +83,13 @@ export default interface VideoFeedConfiguration {
69
83
  title?: VideoFeedTitleConfiguration;
70
84
  /**
71
85
  * Title position of video feed item.
86
+ * Defaults to nested.
72
87
  */
73
88
  titlePosition?: VideoFeedTitlePosition;
74
89
  /**
75
- * The padding of video feed title. Only supported on iOS.
90
+ * The padding of video feed title.
91
+ * Defaults to { top: 8, right: 8, bottom: 8, left: 8 }.
92
+ * Only supported on iOS.
76
93
  */
77
94
  titlePadding?: VideoFeedPadding;
78
95
  /**
@@ -81,28 +98,36 @@ export default interface VideoFeedConfiguration {
81
98
  playIcon?: VideoFeedPlayIconConfiguration;
82
99
  /**
83
100
  * Indicates if the video feed item shows ad badge.
101
+ * Defaults to false.
84
102
  */
85
103
  showAdBadge?: boolean;
86
104
  /**
87
- * The aspect ratio(width / height) for video feed item. Only supported on iOS.
105
+ * The aspect ratio(width / height) for video feed item.
106
+ * Defaults to 4 / 6.
107
+ * Only supported on iOS.
88
108
  */
89
109
  aspectRatio?: number;
90
110
  /**
91
- * The padding of video feed content. Only supported on iOS.
111
+ * The padding of video feed content.
112
+ * Defaults to { top: 10, right: 10, bottom: 10, left: 10 }.
113
+ * Only supported on iOS.
92
114
  */
93
115
  contentPadding?: VideoFeedPadding;
94
116
  /**
95
117
  * The item spacing for video feed.
118
+ * If you don't set this property, the item spacing will be 10 on iOS and 4px on Android.
96
119
  */
97
120
  itemSpacing?: number;
98
121
  /**
99
122
  * Specifies if autoplay is enabled.
123
+ * Defaults to false.
100
124
  */
101
125
  enableAutoplay?: boolean;
102
126
  /**
103
127
  * The number of feed items to be displayed per row.
104
128
  * The property only takes effect when video feed mode is grid.
105
129
  * The property value needs to be an integer and greater than 0.
130
+ * Defaults to 2.
106
131
  */
107
132
  gridColumns?: number;
108
133
  }
@@ -1 +1 @@
1
- export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent' | 'hashtagPlaylist';
1
+ export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent' | 'hashtagPlaylist' | 'sku';
@@ -1,15 +1,21 @@
1
1
  import type IOSFontInfo from './IOSFontInfo';
2
+ /**
3
+ * Only supported on iOS.
4
+ */
2
5
  export interface VideoPlayerCTAStyle {
3
6
  /**
4
7
  * The background color of CTA button.
8
+ * Defaults to #3A86FF.
5
9
  */
6
10
  backgroundColor?: string;
7
11
  /**
8
12
  * The text color of CTA button.
13
+ * Defaults to #FFFFFF.
9
14
  */
10
15
  textColor?: string;
11
16
  /**
12
17
  * The font size of CTA button.
18
+ * Defaults to 14.
13
19
  */
14
20
  fontSize?: number;
15
21
  /**
@@ -6,14 +6,17 @@ import type { VideoPlayerStyle } from './VideoPlayerStyle';
6
6
  export default interface VideoPlayerConfiguration {
7
7
  /**
8
8
  * Sets the proportion of the video player to its container.
9
+ * Defaults to full.
9
10
  */
10
11
  playerStyle?: VideoPlayerStyle;
11
12
  /**
12
13
  * Behavior occurring after video is complete.
14
+ * Defaults to advanceToNext.
13
15
  */
14
16
  videoCompleteAction?: VideoPlayerCompleteAction;
15
17
  /**
16
18
  * Indicates if the video player shows share button.
19
+ * Defaults to true.
17
20
  */
18
21
  showShareButton?: boolean;
19
22
  /**
@@ -22,22 +25,27 @@ export default interface VideoPlayerConfiguration {
22
25
  ctaButtonStyle?: VideoPlayerCTAStyle;
23
26
  /**
24
27
  * Indicates if the video player shows playback button.
28
+ * Defaults to false on iOS. Default to true on Android.
25
29
  */
26
30
  showPlaybackButton?: boolean;
27
31
  /**
28
32
  * Indicates if the video player shows mute button.
33
+ * Defaults to true.
29
34
  */
30
35
  showMuteButton?: boolean;
31
36
  /**
32
37
  * Indicates if Firework branding should be showed or not.
38
+ * Defaults to true.
33
39
  */
34
40
  showBranding?: boolean;
35
41
  /**
36
42
  * Specifies the delay before showing the CTA.
43
+ * Defaults to { type: constant, value: 3 }.
37
44
  */
38
45
  ctaDelay?: VideoPlayerCTADelay;
39
46
  /**
40
- * Specifies the delay before the highlight animation occurs. Only supported on iOS.
47
+ * Specifies the delay before the highlight animation occurs.
48
+ * Defaults to { type: constant, value: 2 }.
41
49
  */
42
50
  ctaHighlightDelay?: VideoPlayerCTADelay;
43
51
  /**
@@ -46,6 +54,7 @@ export default interface VideoPlayerConfiguration {
46
54
  shareBaseURL?: string;
47
55
  /**
48
56
  * Specifies the desired width for the Video Player CTA button.
57
+ * Defaults to fullWidth.
49
58
  */
50
59
  ctaWidth?: VideoPlayerCTAWidth;
51
60
  }
@@ -0,0 +1,7 @@
1
+ import type VideoPlayerConfiguration from './VideoPlayerConfiguration';
2
+ export default interface VideoPlayerNativeConfiguration extends VideoPlayerConfiguration {
3
+ /**
4
+ * Specifies if Picture in Picture is enabled.
5
+ */
6
+ enablePictureInPicture?: boolean;
7
+ }
@@ -2,10 +2,10 @@ import { NativeEventEmitter, NativeModule } from 'react-native';
2
2
  import type AdBadgeConfiguration from '../models/AdBadgeConfiguration';
3
3
  import type SDKInitOptions from '../models/SDKInitOptions';
4
4
  import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
5
- import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
5
+ import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';
6
6
  interface IFireworkSDKModule extends NativeModule {
7
7
  init(options?: SDKInitOptions): Promise<any>;
8
- openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;
8
+ openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;
9
9
  setCustomCTAClickEnabled(enabled: boolean): void;
10
10
  setShareBaseURL(url?: string): Promise<any>;
11
11
  setVideoPlaybackEventEnabled(enabled: boolean): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "2.3.1",
3
+ "version": "2.4.0-beta.2",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -31,7 +31,7 @@
31
31
  "test": "jest",
32
32
  "typescript": "tsc --noEmit",
33
33
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
34
- "prepare": "bob build",
34
+ "build": "bob build",
35
35
  "generate-doc": "rm -rf docs && npx typedoc",
36
36
  "prettier": "npx prettier --write \"{src,example}/**/*.{ts,tsx}\""
37
37
  },
@@ -35,5 +35,5 @@ fi
35
35
 
36
36
  s.static_framework = true
37
37
  s.dependency 'React-Core'
38
- s.dependency 'FireworkVideo', '1.10.0'
38
+ s.dependency 'FireworkVideo', '1.11.0'
39
39
  end
@@ -13,7 +13,6 @@ import type {
13
13
  import type SDKInitOptions from './models/SDKInitOptions';
14
14
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
15
15
  import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
16
- import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
17
16
  import FireworkSDKModule, {
18
17
  FireworkSDKModuleEventEmitter,
19
18
  } from './modules/FireworkSDKModule';
@@ -22,6 +21,7 @@ import ShoppingModule from './modules/ShoppingModule';
22
21
  import FWLoggerUtil from './utils/FWLoggerUtil';
23
22
  import VideoShopping from './VideoShopping';
24
23
  import FWGlobalState from './utils/FWGlobalState';
24
+ import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
25
25
 
26
26
  export type SDKInitCallback = (event: SDKInitEvent) => Promise<void> | void;
27
27
  export type CustomCTAClickCallback = (
@@ -256,7 +256,7 @@ class FireworkSDK {
256
256
  */
257
257
  public async openVideoPlayer(
258
258
  url: string,
259
- config?: VideoPlayerConfiguration
259
+ config?: OpenVideoPlayerConfiguration
260
260
  ): Promise<void> {
261
261
  if (!FWGlobalState.getInstance().sdkInitCalled) {
262
262
  await FWGlobalState.getInstance().sdkInitCalledPromise;
@@ -23,6 +23,7 @@ import type AdConfiguration from '../models/AdConfiguration';
23
23
  import type FWError from '../models/FWError';
24
24
  import { FWEventName } from '../models/FWEventName';
25
25
  import type { StoryBlockConfiguration } from '../models/StoryBlockConfiguration';
26
+ import type StoryBlockNativeConfiguration from '../models/StoryBlockNativeConfiguration';
26
27
  import type { StoryBlockSource } from '../models/StoryBlockSource';
27
28
  import { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';
28
29
  import FWGlobalState from '../utils/FWGlobalState';
@@ -73,10 +74,18 @@ export interface IStoryBlockProps {
73
74
  * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
74
75
  */
75
76
  hashtagFilterExpression?: string;
77
+ /**
78
+ * Product ids used to generate the sku feed
79
+ */
80
+ productIds?: string[];
76
81
  /**
77
82
  * Specifies if Picture in Picture is enabled. Only supported on iOS.
78
83
  */
79
84
  enablePictureInPicture?: boolean;
85
+ /**
86
+ * The corner radius of story block.
87
+ */
88
+ cornerRadius?: number;
80
89
  /**
81
90
  * Ad configuration of the feed. Only supported on iOS.
82
91
  */
@@ -157,7 +166,7 @@ const StoryBlock: ForwardRefRenderFunction<
157
166
 
158
167
  const generateVastAttributesString = () => {
159
168
  const { adConfiguration } = props;
160
- const vastAttributes = adConfiguration?.vastAttributes ?? '';
169
+ const vastAttributes = adConfiguration?.vastAttributes;
161
170
  if (!vastAttributes) {
162
171
  return '';
163
172
  }
@@ -173,53 +182,67 @@ const StoryBlock: ForwardRefRenderFunction<
173
182
  return resultString;
174
183
  };
175
184
 
185
+ const getStoryBlockConfiguration: () =>
186
+ | StoryBlockNativeConfiguration
187
+ | undefined = () => {
188
+ const { storyBlockConfiguration, enablePictureInPicture } = props;
189
+ let resultStoryBlockConfiguration:
190
+ | StoryBlockNativeConfiguration
191
+ | undefined = storyBlockConfiguration;
192
+ if (typeof enablePictureInPicture === 'boolean') {
193
+ if (!resultStoryBlockConfiguration) {
194
+ resultStoryBlockConfiguration = {};
195
+ }
196
+ resultStoryBlockConfiguration = {
197
+ ...resultStoryBlockConfiguration,
198
+ enablePictureInPicture,
199
+ };
200
+ }
201
+ return resultStoryBlockConfiguration;
202
+ };
203
+ const storyBlockConfiguration = getStoryBlockConfiguration();
204
+
176
205
  const generateKey = (): string => {
177
- const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
178
- const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
179
- const videoLaunchBehavior =
180
- FireworkSDK.getInstance().videoLaunchBehavior ?? '';
181
- const adBadgeConfiguration =
182
- FireworkSDK.getInstance().adBadgeConfiguration ?? {};
183
- const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
184
- const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
185
- const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
206
+ const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;
207
+ const appLanguage = FireworkSDK.getInstance().appLanguage;
208
+ const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;
209
+ const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;
210
+ const adBadgeTextType = adBadgeConfiguration?.badgeTextType;
211
+ const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;
212
+ const textColorOfAdBadge = adBadgeConfiguration?.textColor;
186
213
  const androidFontIsCustomOfAdBadge =
187
- adBadgeConfiguration.androidFontInfo?.isCustom?.toString() ?? '';
214
+ adBadgeConfiguration?.androidFontInfo?.isCustom;
188
215
  const androidFontTypefaceNameOfAdBadge =
189
- adBadgeConfiguration.androidFontInfo?.typefaceName ?? '';
216
+ adBadgeConfiguration?.androidFontInfo?.typefaceName;
190
217
 
191
218
  const {
192
219
  source,
193
- channel = '',
194
- playlist = '',
195
- hashtagFilterExpression = '',
196
- enablePictureInPicture = false,
220
+ channel,
221
+ playlist,
222
+ hashtagFilterExpression,
223
+ productIds,
224
+ enablePictureInPicture,
225
+ cornerRadius,
197
226
  adConfiguration,
198
- storyBlockConfiguration,
199
227
  } = props;
200
228
  const dynamicContentParametersString =
201
229
  generateDynamicContentParametersString();
202
230
 
203
- const videoCompleteAction =
204
- storyBlockConfiguration?.videoCompleteAction ?? '';
205
- const showShareButton =
206
- storyBlockConfiguration?.showShareButton?.toString() ?? '';
207
- const showPlaybackButton =
208
- storyBlockConfiguration?.showPlaybackButton?.toString() ?? '';
209
- const showBranding =
210
- storyBlockConfiguration?.showBranding?.toString() ?? '';
211
- const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type ?? '';
212
- const ctaDelayValue =
213
- storyBlockConfiguration?.ctaDelay?.value?.toFixed(5) ?? '';
231
+ const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;
232
+ const showShareButton = storyBlockConfiguration?.showShareButton;
233
+ const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;
234
+ const showBranding = storyBlockConfiguration?.showBranding;
235
+ const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type;
236
+ const ctaDelayValue = storyBlockConfiguration?.ctaDelay?.value?.toFixed(5);
214
237
  const ctaHighlightDelayType =
215
- storyBlockConfiguration?.ctaHighlightDelay?.type ?? '';
238
+ storyBlockConfiguration?.ctaHighlightDelay?.type;
216
239
  const ctaHighlightDelayValue =
217
- storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5) ?? '';
218
- const shareBaseURL = storyBlockConfiguration?.shareBaseURL ?? '';
219
- const ctaWidth = storyBlockConfiguration?.ctaWidth ?? '';
240
+ storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);
241
+ const shareBaseURL = storyBlockConfiguration?.shareBaseURL;
242
+ const ctaWidth = storyBlockConfiguration?.ctaWidth;
220
243
 
221
- const requiresAds = adConfiguration?.requiresAds?.toString() ?? '';
222
- const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
244
+ const requiresAds = adConfiguration?.requiresAds;
245
+ const adsFetchTimeout = adConfiguration?.adsFetchTimeout;
223
246
  const vastAttributesString = generateVastAttributesString();
224
247
 
225
248
  let key = `gShareBaseURL:${gShareBaseURL}`;
@@ -240,7 +263,9 @@ const StoryBlock: ForwardRefRenderFunction<
240
263
  key += `_playlist:${playlist}`;
241
264
  key += `_dynamicContentParameters:${dynamicContentParametersString}`;
242
265
  key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
266
+ key += `productIds:${productIds?.join(',')}`;
243
267
  key += `_enablePictureInPicture:${enablePictureInPicture}`;
268
+ key += `_cornerRadius:${cornerRadius}`;
244
269
 
245
270
  key += `_shareBaseURL:${shareBaseURL}`;
246
271
  if (Platform.OS === 'android') {
@@ -386,12 +411,16 @@ const StoryBlock: ForwardRefRenderFunction<
386
411
  if (!sdkInitCalled) {
387
412
  return null;
388
413
  }
389
-
414
+ const { style, cornerRadius, ...otherProps } = props;
390
415
  return (
391
416
  <FWStoryBlock
392
417
  ref={nativeComponentRef}
393
418
  key={key}
394
- {...props}
419
+ {...otherProps}
420
+ cornerRadius={cornerRadius}
421
+ style={Object.assign({ borderRadius: cornerRadius }, style)}
422
+ storyBlockConfiguration={storyBlockConfiguration}
423
+ enablePictureInPicture={undefined}
395
424
  onStoryBlockLoadFinished={handleStoryBlockLoadFinished}
396
425
  onStoryBlockFullScreenStateChanged={
397
426
  handleStoryBlockFullScreenStateChanged