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.
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +24 -10
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +24 -10
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +24 -10
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -1
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +21 -21
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +20 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +1 -69
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +3 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +21 -4
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +15 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +3 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +20 -15
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +45 -16
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +11 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWImageLoaderUtil.kt +16 -0
- package/ios/Components/StoryBlock.swift +9 -7
- package/ios/Components/StoryBlockConfiguration.swift +13 -0
- package/ios/Components/StoryBlockManager.m +6 -1
- package/ios/Components/VideoFeed.swift +5 -10
- package/ios/Components/VideoFeedManager.m +1 -2
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -26
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +13 -2
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +0 -34
- package/ios/FireworkVideoUI/Podfile +1 -1
- package/ios/FireworkVideoUI/Podfile.lock +4 -4
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +1 -0
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +16 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +8 -4
- package/ios/Modules/Shopping/ShoppingModule.swift +6 -5
- package/ios/react_native_firework_sdk.h +0 -1
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +71 -33
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +83 -57
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/OpenVideoPlayerConfiguration.js +2 -0
- package/lib/commonjs/models/OpenVideoPlayerConfiguration.js.map +1 -0
- package/lib/commonjs/models/StoryBlockNativeConfiguration.js +2 -0
- package/lib/commonjs/models/StoryBlockNativeConfiguration.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerNativeConfiguration.js +2 -0
- package/lib/commonjs/models/VideoPlayerNativeConfiguration.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/components/StoryBlock.js +67 -33
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +79 -57
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/OpenVideoPlayerConfiguration.js +2 -0
- package/lib/module/models/OpenVideoPlayerConfiguration.js.map +1 -0
- package/lib/module/models/StoryBlockNativeConfiguration.js +2 -0
- package/lib/module/models/StoryBlockNativeConfiguration.js.map +1 -0
- package/lib/module/models/VideoPlayerNativeConfiguration.js +2 -0
- package/lib/module/models/VideoPlayerNativeConfiguration.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +2 -2
- package/lib/typescript/components/StoryBlock.d.ts +8 -0
- package/lib/typescript/components/VideoFeed.d.ts +8 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +3 -0
- package/lib/typescript/models/AndroidFontInfo.d.ts +1 -1
- package/lib/typescript/models/OpenVideoPlayerConfiguration.d.ts +7 -0
- package/lib/typescript/models/Product.d.ts +1 -1
- package/lib/typescript/models/ProductUnit.d.ts +1 -1
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +1 -1
- package/lib/typescript/models/StoryBlockNativeConfiguration.d.ts +7 -0
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +29 -4
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +6 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +10 -1
- package/lib/typescript/models/VideoPlayerNativeConfiguration.d.ts +7 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -2
- package/package.json +2 -2
- package/react-native-firework-sdk.podspec +1 -1
- package/src/FireworkSDK.ts +2 -2
- package/src/components/StoryBlock.tsx +65 -36
- package/src/components/VideoFeed.tsx +87 -74
- package/src/index.ts +2 -0
- package/src/models/AdBadgeConfiguration.ts +3 -0
- package/src/models/AndroidFontInfo.ts +1 -1
- package/src/models/OpenVideoPlayerConfiguration.ts +9 -0
- package/src/models/Product.ts +1 -1
- package/src/models/ProductUnit.ts +1 -1
- package/src/models/StoryBlockConfiguration.ts +1 -1
- package/src/models/StoryBlockNativeConfiguration.ts +9 -0
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedConfiguration.ts +29 -4
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlayerCTAStyle.ts +6 -0
- package/src/models/VideoPlayerConfiguration.ts +10 -1
- package/src/models/VideoPlayerNativeConfiguration.ts +9 -0
- package/src/modules/FireworkSDKModule.ts +2 -2
- package/ios/Modules/Shopping/FWCartViewController.swift +0 -14
- package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +0 -31
- package/ios/Utils/FWSwizzleLoader.h +0 -15
- package/ios/Utils/FWSwizzleLoader.m +0 -21
- package/ios/Utils/FWSwizzleLoader.swift +0 -13
|
@@ -23,7 +23,7 @@ export interface StoryBlockConfiguration {
|
|
|
23
23
|
*/
|
|
24
24
|
ctaDelay?: VideoPlayerCTADelay;
|
|
25
25
|
/**
|
|
26
|
-
* Specifies the delay before the highlight animation occurs.
|
|
26
|
+
* Specifies the delay before the highlight animation occurs.
|
|
27
27
|
*/
|
|
28
28
|
ctaHighlightDelay?: VideoPlayerCTADelay;
|
|
29
29
|
/**
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
}
|
|
@@ -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
|
|
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?:
|
|
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
|
+
"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
|
-
"
|
|
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
|
},
|
package/src/FireworkSDK.ts
CHANGED
|
@@ -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?:
|
|
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
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
const
|
|
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
|
|
214
|
+
adBadgeConfiguration?.androidFontInfo?.isCustom;
|
|
188
215
|
const androidFontTypefaceNameOfAdBadge =
|
|
189
|
-
adBadgeConfiguration
|
|
216
|
+
adBadgeConfiguration?.androidFontInfo?.typefaceName;
|
|
190
217
|
|
|
191
218
|
const {
|
|
192
219
|
source,
|
|
193
|
-
channel
|
|
194
|
-
playlist
|
|
195
|
-
hashtagFilterExpression
|
|
196
|
-
|
|
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
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
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
|
|
222
|
-
const adsFetchTimeout = adConfiguration?.adsFetchTimeout
|
|
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
|
-
{...
|
|
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
|