react-native-firework-sdk 2.3.0 → 2.4.0-beta.1
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/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
- package/lib/commonjs/FWNavigator.js +0 -75
- package/lib/commonjs/FWNavigator.js.map +0 -1
- package/lib/commonjs/FireworkSDK.js +0 -341
- package/lib/commonjs/FireworkSDK.js.map +0 -1
- package/lib/commonjs/LiveStream.js +0 -66
- package/lib/commonjs/LiveStream.js.map +0 -1
- package/lib/commonjs/VideoShopping.js +0 -247
- package/lib/commonjs/VideoShopping.js.map +0 -1
- package/lib/commonjs/components/FWStoryBlock.js +0 -18
- package/lib/commonjs/components/FWStoryBlock.js.map +0 -1
- package/lib/commonjs/components/FWVideoFeed.js +0 -18
- package/lib/commonjs/components/FWVideoFeed.js.map +0 -1
- package/lib/commonjs/components/StoryBlock.js +0 -319
- package/lib/commonjs/components/StoryBlock.js.map +0 -1
- package/lib/commonjs/components/VideoFeed.js +0 -390
- package/lib/commonjs/components/VideoFeed.js.map +0 -1
- package/lib/commonjs/constants/FWErrorMessage.js +0 -15
- package/lib/commonjs/constants/FWErrorMessage.js.map +0 -1
- package/lib/commonjs/index.js +0 -84
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/models/AdBadgeConfiguration.js +0 -2
- package/lib/commonjs/models/AdBadgeConfiguration.js.map +0 -1
- package/lib/commonjs/models/AdConfiguration.js +0 -2
- package/lib/commonjs/models/AdConfiguration.js.map +0 -1
- package/lib/commonjs/models/AndroidFontInfo.js +0 -2
- package/lib/commonjs/models/AndroidFontInfo.js.map +0 -1
- package/lib/commonjs/models/FWError.js +0 -2
- package/lib/commonjs/models/FWError.js.map +0 -1
- package/lib/commonjs/models/FWEventName.js +0 -29
- package/lib/commonjs/models/FWEventName.js.map +0 -1
- package/lib/commonjs/models/FWEvents.js +0 -6
- package/lib/commonjs/models/FWEvents.js.map +0 -1
- package/lib/commonjs/models/FeedItemDetails.js +0 -2
- package/lib/commonjs/models/FeedItemDetails.js.map +0 -1
- package/lib/commonjs/models/GradientDrawable.js +0 -2
- package/lib/commonjs/models/GradientDrawable.js.map +0 -1
- package/lib/commonjs/models/IOSFontInfo.js +0 -2
- package/lib/commonjs/models/IOSFontInfo.js.map +0 -1
- package/lib/commonjs/models/LiveStreamChatEventName.js +0 -15
- package/lib/commonjs/models/LiveStreamChatEventName.js.map +0 -1
- package/lib/commonjs/models/LiveStreamEventDetails.js +0 -2
- package/lib/commonjs/models/LiveStreamEventDetails.js.map +0 -1
- package/lib/commonjs/models/LiveStreamEventName.js +0 -17
- package/lib/commonjs/models/LiveStreamEventName.js.map +0 -1
- package/lib/commonjs/models/LiveStreamMessageDetails.js +0 -2
- package/lib/commonjs/models/LiveStreamMessageDetails.js.map +0 -1
- package/lib/commonjs/models/Product.js +0 -2
- package/lib/commonjs/models/Product.js.map +0 -1
- package/lib/commonjs/models/ProductInfoViewConfiguration.js +0 -2
- package/lib/commonjs/models/ProductInfoViewConfiguration.js.map +0 -1
- package/lib/commonjs/models/ProductUnit.js +0 -2
- package/lib/commonjs/models/ProductUnit.js.map +0 -1
- package/lib/commonjs/models/SDKInitOptions.js +0 -2
- package/lib/commonjs/models/SDKInitOptions.js.map +0 -1
- package/lib/commonjs/models/ShoppingCTAResult.js +0 -2
- package/lib/commonjs/models/ShoppingCTAResult.js.map +0 -1
- package/lib/commonjs/models/StoryBlockConfiguration.js +0 -6
- package/lib/commonjs/models/StoryBlockConfiguration.js.map +0 -1
- package/lib/commonjs/models/StoryBlockSource.js +0 -2
- package/lib/commonjs/models/StoryBlockSource.js.map +0 -1
- package/lib/commonjs/models/TrackPurchaseParameters.js +0 -2
- package/lib/commonjs/models/TrackPurchaseParameters.js.map +0 -1
- package/lib/commonjs/models/VideoFeedConfiguration.js +0 -2
- package/lib/commonjs/models/VideoFeedConfiguration.js.map +0 -1
- package/lib/commonjs/models/VideoFeedSource.js +0 -2
- package/lib/commonjs/models/VideoFeedSource.js.map +0 -1
- package/lib/commonjs/models/VideoPlaybackDetails.js +0 -2
- package/lib/commonjs/models/VideoPlaybackDetails.js.map +0 -1
- package/lib/commonjs/models/VideoPlaybackEventName.js +0 -26
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerCTADelay.js +0 -2
- package/lib/commonjs/models/VideoPlayerCTADelay.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerCTAStyle.js +0 -6
- package/lib/commonjs/models/VideoPlayerCTAStyle.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerCTAWidth.js +0 -2
- package/lib/commonjs/models/VideoPlayerCTAWidth.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerCompleteAction.js +0 -2
- package/lib/commonjs/models/VideoPlayerCompleteAction.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerConfiguration.js +0 -2
- package/lib/commonjs/models/VideoPlayerConfiguration.js.map +0 -1
- package/lib/commonjs/models/VideoPlayerStyle.js +0 -2
- package/lib/commonjs/models/VideoPlayerStyle.js.map +0 -1
- package/lib/commonjs/modules/FWNavigatorModule.js +0 -22
- package/lib/commonjs/modules/FWNavigatorModule.js.map +0 -1
- package/lib/commonjs/modules/FireworkSDKModule.js +0 -22
- package/lib/commonjs/modules/FireworkSDKModule.js.map +0 -1
- package/lib/commonjs/modules/LiveStreamModule.js +0 -22
- package/lib/commonjs/modules/LiveStreamModule.js.map +0 -1
- package/lib/commonjs/modules/ShoppingModule.js +0 -22
- package/lib/commonjs/modules/ShoppingModule.js.map +0 -1
- package/lib/commonjs/utils/FWGlobalState.js +0 -47
- package/lib/commonjs/utils/FWGlobalState.js.map +0 -1
- package/lib/commonjs/utils/FWLoggerUtil.js +0 -45
- package/lib/commonjs/utils/FWLoggerUtil.js.map +0 -1
- package/lib/module/FWNavigator.js +0 -58
- package/lib/module/FWNavigator.js.map +0 -1
- package/lib/module/FireworkSDK.js +0 -310
- package/lib/module/FireworkSDK.js.map +0 -1
- package/lib/module/LiveStream.js +0 -53
- package/lib/module/LiveStream.js.map +0 -1
- package/lib/module/VideoShopping.js +0 -222
- package/lib/module/VideoShopping.js.map +0 -1
- package/lib/module/components/FWStoryBlock.js +0 -8
- package/lib/module/components/FWStoryBlock.js.map +0 -1
- package/lib/module/components/FWVideoFeed.js +0 -8
- package/lib/module/components/FWVideoFeed.js.map +0 -1
- package/lib/module/components/StoryBlock.js +0 -282
- package/lib/module/components/StoryBlock.js.map +0 -1
- package/lib/module/components/VideoFeed.js +0 -365
- package/lib/module/components/VideoFeed.js.map +0 -1
- package/lib/module/constants/FWErrorMessage.js +0 -7
- package/lib/module/constants/FWErrorMessage.js.map +0 -1
- package/lib/module/index.js +0 -12
- package/lib/module/index.js.map +0 -1
- package/lib/module/models/AdBadgeConfiguration.js +0 -2
- package/lib/module/models/AdBadgeConfiguration.js.map +0 -1
- package/lib/module/models/AdConfiguration.js +0 -2
- package/lib/module/models/AdConfiguration.js.map +0 -1
- package/lib/module/models/AndroidFontInfo.js +0 -2
- package/lib/module/models/AndroidFontInfo.js.map +0 -1
- package/lib/module/models/FWError.js +0 -2
- package/lib/module/models/FWError.js.map +0 -1
- package/lib/module/models/FWEventName.js +0 -22
- package/lib/module/models/FWEventName.js.map +0 -1
- package/lib/module/models/FWEvents.js +0 -2
- package/lib/module/models/FWEvents.js.map +0 -1
- package/lib/module/models/FeedItemDetails.js +0 -2
- package/lib/module/models/FeedItemDetails.js.map +0 -1
- package/lib/module/models/GradientDrawable.js +0 -2
- package/lib/module/models/GradientDrawable.js.map +0 -1
- package/lib/module/models/IOSFontInfo.js +0 -2
- package/lib/module/models/IOSFontInfo.js.map +0 -1
- package/lib/module/models/LiveStreamChatEventName.js +0 -8
- package/lib/module/models/LiveStreamChatEventName.js.map +0 -1
- package/lib/module/models/LiveStreamEventDetails.js +0 -2
- package/lib/module/models/LiveStreamEventDetails.js.map +0 -1
- package/lib/module/models/LiveStreamEventName.js +0 -10
- package/lib/module/models/LiveStreamEventName.js.map +0 -1
- package/lib/module/models/LiveStreamMessageDetails.js +0 -2
- package/lib/module/models/LiveStreamMessageDetails.js.map +0 -1
- package/lib/module/models/Product.js +0 -2
- package/lib/module/models/Product.js.map +0 -1
- package/lib/module/models/ProductInfoViewConfiguration.js +0 -2
- package/lib/module/models/ProductInfoViewConfiguration.js.map +0 -1
- package/lib/module/models/ProductUnit.js +0 -2
- package/lib/module/models/ProductUnit.js.map +0 -1
- package/lib/module/models/SDKInitOptions.js +0 -2
- package/lib/module/models/SDKInitOptions.js.map +0 -1
- package/lib/module/models/ShoppingCTAResult.js +0 -2
- package/lib/module/models/ShoppingCTAResult.js.map +0 -1
- package/lib/module/models/StoryBlockConfiguration.js +0 -2
- package/lib/module/models/StoryBlockConfiguration.js.map +0 -1
- package/lib/module/models/StoryBlockSource.js +0 -2
- package/lib/module/models/StoryBlockSource.js.map +0 -1
- package/lib/module/models/TrackPurchaseParameters.js +0 -2
- package/lib/module/models/TrackPurchaseParameters.js.map +0 -1
- package/lib/module/models/VideoFeedConfiguration.js +0 -2
- package/lib/module/models/VideoFeedConfiguration.js.map +0 -1
- package/lib/module/models/VideoFeedSource.js +0 -2
- package/lib/module/models/VideoFeedSource.js.map +0 -1
- package/lib/module/models/VideoPlaybackDetails.js +0 -2
- package/lib/module/models/VideoPlaybackDetails.js.map +0 -1
- package/lib/module/models/VideoPlaybackEventName.js +0 -19
- package/lib/module/models/VideoPlaybackEventName.js.map +0 -1
- package/lib/module/models/VideoPlayerCTADelay.js +0 -2
- package/lib/module/models/VideoPlayerCTADelay.js.map +0 -1
- package/lib/module/models/VideoPlayerCTAStyle.js +0 -2
- package/lib/module/models/VideoPlayerCTAStyle.js.map +0 -1
- package/lib/module/models/VideoPlayerCTAWidth.js +0 -2
- package/lib/module/models/VideoPlayerCTAWidth.js.map +0 -1
- package/lib/module/models/VideoPlayerCompleteAction.js +0 -2
- package/lib/module/models/VideoPlayerCompleteAction.js.map +0 -1
- package/lib/module/models/VideoPlayerConfiguration.js +0 -2
- package/lib/module/models/VideoPlayerConfiguration.js.map +0 -1
- package/lib/module/models/VideoPlayerStyle.js +0 -2
- package/lib/module/models/VideoPlayerStyle.js.map +0 -1
- package/lib/module/modules/FWNavigatorModule.js +0 -13
- package/lib/module/modules/FWNavigatorModule.js.map +0 -1
- package/lib/module/modules/FireworkSDKModule.js +0 -12
- package/lib/module/modules/FireworkSDKModule.js.map +0 -1
- package/lib/module/modules/LiveStreamModule.js +0 -12
- package/lib/module/modules/LiveStreamModule.js.map +0 -1
- package/lib/module/modules/ShoppingModule.js +0 -12
- package/lib/module/modules/ShoppingModule.js.map +0 -1
- package/lib/module/utils/FWGlobalState.js +0 -39
- package/lib/module/utils/FWGlobalState.js.map +0 -1
- package/lib/module/utils/FWLoggerUtil.js +0 -36
- package/lib/module/utils/FWLoggerUtil.js.map +0 -1
- package/lib/typescript/FWNavigator.d.ts +0 -26
- package/lib/typescript/FireworkSDK.d.ts +0 -113
- package/lib/typescript/LiveStream.d.ts +0 -21
- package/lib/typescript/VideoShopping.d.ts +0 -74
- package/lib/typescript/components/FWStoryBlock.d.ts +0 -2
- package/lib/typescript/components/FWVideoFeed.d.ts +0 -2
- package/lib/typescript/components/StoryBlock.d.ts +0 -65
- package/lib/typescript/components/VideoFeed.d.ts +0 -105
- package/lib/typescript/constants/FWErrorMessage.d.ts +0 -2
- package/lib/typescript/index.d.ts +0 -52
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +0 -22
- package/lib/typescript/models/AdConfiguration.d.ts +0 -22
- package/lib/typescript/models/AndroidFontInfo.d.ts +0 -14
- package/lib/typescript/models/FWError.d.ts +0 -10
- package/lib/typescript/models/FWEventName.d.ts +0 -19
- package/lib/typescript/models/FWEvents.d.ts +0 -70
- package/lib/typescript/models/FeedItemDetails.d.ts +0 -54
- package/lib/typescript/models/GradientDrawable.d.ts +0 -5
- package/lib/typescript/models/IOSFontInfo.d.ts +0 -21
- package/lib/typescript/models/LiveStreamChatEventName.d.ts +0 -7
- package/lib/typescript/models/LiveStreamEventDetails.d.ts +0 -3
- package/lib/typescript/models/LiveStreamEventName.d.ts +0 -15
- package/lib/typescript/models/LiveStreamMessageDetails.d.ts +0 -14
- package/lib/typescript/models/Product.d.ts +0 -23
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +0 -38
- package/lib/typescript/models/ProductUnit.d.ts +0 -38
- package/lib/typescript/models/SDKInitOptions.d.ts +0 -11
- package/lib/typescript/models/ShoppingCTAResult.d.ts +0 -11
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +0 -37
- package/lib/typescript/models/StoryBlockSource.d.ts +0 -1
- package/lib/typescript/models/TrackPurchaseParameters.d.ts +0 -26
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +0 -108
- package/lib/typescript/models/VideoFeedSource.d.ts +0 -1
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +0 -47
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +0 -51
- package/lib/typescript/models/VideoPlayerCTADelay.d.ts +0 -11
- package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +0 -21
- package/lib/typescript/models/VideoPlayerCTAWidth.d.ts +0 -1
- package/lib/typescript/models/VideoPlayerCompleteAction.d.ts +0 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +0 -51
- package/lib/typescript/models/VideoPlayerStyle.d.ts +0 -1
- package/lib/typescript/modules/FWNavigatorModule.d.ts +0 -11
- package/lib/typescript/modules/FireworkSDKModule.d.ts +0 -19
- package/lib/typescript/modules/LiveStreamModule.d.ts +0 -8
- package/lib/typescript/modules/ShoppingModule.d.ts +0 -18
- package/lib/typescript/utils/FWGlobalState.d.ts +0 -10
- package/lib/typescript/utils/FWLoggerUtil.d.ts +0 -6
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
var _FWEventName = require("./models/FWEventName");
|
|
11
|
-
|
|
12
|
-
var _ShoppingModule = _interopRequireWildcard(require("./modules/ShoppingModule"));
|
|
13
|
-
|
|
14
|
-
var _FWLoggerUtil = _interopRequireDefault(require("./utils/FWLoggerUtil"));
|
|
15
|
-
|
|
16
|
-
var _FWGlobalState = _interopRequireDefault(require("./utils/FWGlobalState"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The entry class of video shopping.
|
|
28
|
-
*/
|
|
29
|
-
class VideoShopping {
|
|
30
|
-
/**
|
|
31
|
-
* This callback is triggered when the user clicks the "Add to cart" or "Shop now" button.
|
|
32
|
-
* The host app can return a ShoppingCTAResult object to tell SDK how to handle the result.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* This callback is triggered when the user clicks the shopping cart icon.
|
|
37
|
-
*
|
|
38
|
-
* The host app can customize the click event processing logic of
|
|
39
|
-
* the shopping cart icon by setting the callback.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* This callback is triggered when the video will be shown.
|
|
44
|
-
*
|
|
45
|
-
* The host app can return a Product list to update the latest product information.
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* This callback is triggered when the user clicks
|
|
50
|
-
* the link button next to Add to cart button.
|
|
51
|
-
*
|
|
52
|
-
* The host app can customize the click event processing logic of
|
|
53
|
-
* the link button by setting the callback.
|
|
54
|
-
*/
|
|
55
|
-
get onCustomClickLinkButton() {
|
|
56
|
-
return this._onCustomClickLinkButton;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
set onCustomClickLinkButton(value) {
|
|
60
|
-
this._onCustomClickLinkButton = value;
|
|
61
|
-
|
|
62
|
-
_ShoppingModule.default.setCustomClickLinkButtonEnabled(!!value);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Defaults to true.
|
|
67
|
-
* You can hide the cart icon by setting this property to false.
|
|
68
|
-
*/
|
|
69
|
-
get cartIconVisible() {
|
|
70
|
-
return this._cartIconVisible;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
set cartIconVisible(value) {
|
|
74
|
-
this._cartIconVisible = value;
|
|
75
|
-
|
|
76
|
-
if (_FWGlobalState.default.getInstance().sdkInitCalled) {
|
|
77
|
-
_ShoppingModule.default.setCartIconVisible(value);
|
|
78
|
-
} else {
|
|
79
|
-
_FWGlobalState.default.getInstance().sdkInitCalledPromise.then(() => {
|
|
80
|
-
_ShoppingModule.default.setCartIconVisible(value);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The configuration of product info view.
|
|
87
|
-
* Please refer to {@link ProductInfoViewConfiguration} for more details.
|
|
88
|
-
*/
|
|
89
|
-
get productInfoViewConfiguration() {
|
|
90
|
-
return this._productInfoViewConfiguration;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
set productInfoViewConfiguration(value) {
|
|
94
|
-
this._productInfoViewConfiguration = value;
|
|
95
|
-
|
|
96
|
-
if (_FWGlobalState.default.getInstance().sdkInitCalled) {
|
|
97
|
-
_ShoppingModule.default.setProductInfoViewConfiguration(value !== null && value !== void 0 ? value : {});
|
|
98
|
-
} else {
|
|
99
|
-
_FWGlobalState.default.getInstance().sdkInitCalledPromise.then(() => {
|
|
100
|
-
_ShoppingModule.default.setProductInfoViewConfiguration(value !== null && value !== void 0 ? value : {});
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
get eventEmitter() {
|
|
106
|
-
return _ShoppingModule.ShoppingModuleEventEmitter;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
static getInstance() {
|
|
110
|
-
_FWLoggerUtil.default.log('VideoShopping constructor');
|
|
111
|
-
|
|
112
|
-
if (!VideoShopping._instance) {
|
|
113
|
-
VideoShopping._instance = new VideoShopping();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return VideoShopping._instance;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
constructor() {
|
|
120
|
-
_defineProperty(this, "onShoppingCTA", void 0);
|
|
121
|
-
|
|
122
|
-
_defineProperty(this, "onCustomClickCartIcon", void 0);
|
|
123
|
-
|
|
124
|
-
_defineProperty(this, "onUpdateProductDetails", void 0);
|
|
125
|
-
|
|
126
|
-
_defineProperty(this, "_onCustomClickLinkButton", void 0);
|
|
127
|
-
|
|
128
|
-
_defineProperty(this, "_cartIconVisible", true);
|
|
129
|
-
|
|
130
|
-
_defineProperty(this, "_productInfoViewConfiguration", void 0);
|
|
131
|
-
|
|
132
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.ShoppingCTAButtonClick, event => {
|
|
133
|
-
_FWLoggerUtil.default.log(`Receive ShoppingCTA event productId: ${event === null || event === void 0 ? void 0 : event.productId} unitId: ${event === null || event === void 0 ? void 0 : event.unitId} url: ${event === null || event === void 0 ? void 0 : event.url}`);
|
|
134
|
-
|
|
135
|
-
this.handleShoppingCTAEvent(event);
|
|
136
|
-
});
|
|
137
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.ClickCartIcon, () => {
|
|
138
|
-
_FWLoggerUtil.default.log('Receive ClickCartIcon event');
|
|
139
|
-
|
|
140
|
-
this.handleClickCartIconEvent();
|
|
141
|
-
});
|
|
142
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.UpdateProductDetails, event => {
|
|
143
|
-
_FWLoggerUtil.default.log(`Receive UpdateProductDetails event productIds: ${event === null || event === void 0 ? void 0 : event.productIds}`);
|
|
144
|
-
|
|
145
|
-
this.handleUpdateProductDetailsEvent(event);
|
|
146
|
-
});
|
|
147
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.LogMessage, () => {});
|
|
148
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.CustomLinkButtonClick, event => {
|
|
149
|
-
_FWLoggerUtil.default.log(`Receive CustomLinkButtonClick event url: ${event === null || event === void 0 ? void 0 : event.url}`);
|
|
150
|
-
|
|
151
|
-
this.handleCustomLinkButtonClickEvent(event);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
*
|
|
156
|
-
* @param {number} count The number of items in the host app cart.
|
|
157
|
-
* The count should be greater than or equal to 0.
|
|
158
|
-
* We just use count to show or hide red indicator on the cart icon.
|
|
159
|
-
* If cound > 0, we will show the red indicator on the cart icon.
|
|
160
|
-
* Otherwise, we will hide the red indicator on the cart icon.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
async setCartItemCount(count) {
|
|
165
|
-
if (!_FWGlobalState.default.getInstance().sdkInitCalled) {
|
|
166
|
-
await _FWGlobalState.default.getInstance().sdkInitCalledPromise;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
_ShoppingModule.default.setCartItemCount(count);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async handleShoppingCTAEvent(event) {
|
|
173
|
-
const callbackId = event.callbackId;
|
|
174
|
-
delete event.callbackId;
|
|
175
|
-
|
|
176
|
-
if (this.onShoppingCTA) {
|
|
177
|
-
const result = await this.onShoppingCTA(event);
|
|
178
|
-
|
|
179
|
-
if (callbackId) {
|
|
180
|
-
_ShoppingModule.default.updateShoppingCTAResult(result, callbackId);
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
if (callbackId) {
|
|
184
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
185
|
-
_ShoppingModule.default.clearCallbackId(callbackId, _FWEventName.FWEventName.ShoppingCTAButtonClick);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
async handleClickCartIconEvent() {
|
|
192
|
-
if (this.onCustomClickCartIcon) {
|
|
193
|
-
this.onCustomClickCartIcon();
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async handleUpdateProductDetailsEvent(event) {
|
|
198
|
-
const callbackId = event.callbackId;
|
|
199
|
-
delete event.callbackId;
|
|
200
|
-
|
|
201
|
-
if (this.onUpdateProductDetails) {
|
|
202
|
-
_FWLoggerUtil.default.log(`Call onUpdateProductDetails callback productIds: ${event.productIds} callbackId: ${callbackId}`);
|
|
203
|
-
|
|
204
|
-
const productList = await this.onUpdateProductDetails(event);
|
|
205
|
-
const productIds = (productList || []).map(product => {
|
|
206
|
-
var _product$productId;
|
|
207
|
-
|
|
208
|
-
return (_product$productId = product.productId) !== null && _product$productId !== void 0 ? _product$productId : '';
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
_FWLoggerUtil.default.log(`Get result from onUpdateProductDetails callback productIds: ${productIds} productListLength: ${(productList || []).length}`);
|
|
212
|
-
|
|
213
|
-
if (productList) {
|
|
214
|
-
if (callbackId) {
|
|
215
|
-
_ShoppingModule.default.updateVideoProducts(productList, callbackId);
|
|
216
|
-
}
|
|
217
|
-
} else {
|
|
218
|
-
if (callbackId) {
|
|
219
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
220
|
-
_ShoppingModule.default.clearCallbackId(callbackId, _FWEventName.FWEventName.UpdateProductDetails);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
} else {
|
|
225
|
-
_FWLoggerUtil.default.log('onUpdateProductDetails callback is not set.');
|
|
226
|
-
|
|
227
|
-
if (callbackId) {
|
|
228
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
229
|
-
_ShoppingModule.default.clearCallbackId(callbackId, _FWEventName.FWEventName.UpdateProductDetails);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
async handleCustomLinkButtonClickEvent(event) {
|
|
236
|
-
if (this.onCustomClickLinkButton) {
|
|
237
|
-
this.onCustomClickLinkButton(event);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
_defineProperty(VideoShopping, "_instance", void 0);
|
|
244
|
-
|
|
245
|
-
var _default = VideoShopping;
|
|
246
|
-
exports.default = _default;
|
|
247
|
-
//# sourceMappingURL=VideoShopping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","onCustomClickLinkButton","_onCustomClickLinkButton","value","ShoppingModule","setCustomClickLinkButtonEnabled","cartIconVisible","_cartIconVisible","FWGlobalState","getInstance","sdkInitCalled","setCartIconVisible","sdkInitCalledPromise","then","productInfoViewConfiguration","_productInfoViewConfiguration","setProductInfoViewConfiguration","eventEmitter","ShoppingModuleEventEmitter","FWLoggerUtil","log","_instance","constructor","addListener","FWEventName","ShoppingCTAButtonClick","event","productId","unitId","url","handleShoppingCTAEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","productIds","handleUpdateProductDetailsEvent","LogMessage","CustomLinkButtonClick","handleCustomLinkButtonClickEvent","setCartItemCount","count","callbackId","onShoppingCTA","result","updateShoppingCTAResult","Platform","OS","clearCallbackId","onCustomClickCartIcon","onUpdateProductDetails","productList","map","product","length","updateVideoProducts"],"mappings":"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","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomClickLinkButtonEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n} from './models/FWEvents';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport ShoppingModule, {\n ShoppingModuleEventEmitter,\n} from './modules/ShoppingModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport FWGlobalState from './utils/FWGlobalState';\n\nexport type ShoppingCTACallback = (\n event: ShoppingCTAEvent\n) => Promise<ShoppingCTAResult> | ShoppingCTAResult;\n\nexport type CustomClickCartIconCallback = () => Promise<void> | void;\n\nexport type UpdateProductDetailsCallbackResult = Product[] | undefined | null;\nexport type UpdateProductDetailsCallback = (\n event: UpdateProductDetailsEvent\n) =>\n | Promise<UpdateProductDetailsCallbackResult>\n | UpdateProductDetailsCallbackResult;\n\nexport type CustomClickLinkButtonCallback = (\n event: CustomClickLinkButtonEvent\n) => Promise<void> | void;\n\n/**\n * The entry class of video shopping.\n */\nclass VideoShopping {\n private static _instance?: VideoShopping;\n\n /**\n * This callback is triggered when the user clicks the \"Add to cart\" or \"Shop now\" button.\n * The host app can return a ShoppingCTAResult object to tell SDK how to handle the result.\n */\n public onShoppingCTA?: ShoppingCTACallback;\n\n /**\n * This callback is triggered when the user clicks the shopping cart icon.\n *\n * The host app can customize the click event processing logic of\n * the shopping cart icon by setting the callback.\n */\n public onCustomClickCartIcon?: CustomClickCartIconCallback | undefined;\n\n /**\n * This callback is triggered when the video will be shown.\n *\n * The host app can return a Product list to update the latest product information.\n */\n public onUpdateProductDetails?: UpdateProductDetailsCallback;\n\n /**\n * This callback is triggered when the user clicks\n * the link button next to Add to cart button.\n *\n * The host app can customize the click event processing logic of\n * the link button by setting the callback.\n */\n public get onCustomClickLinkButton():\n | CustomClickLinkButtonCallback\n | undefined {\n return this._onCustomClickLinkButton;\n }\n public set onCustomClickLinkButton(\n value: CustomClickLinkButtonCallback | undefined\n ) {\n this._onCustomClickLinkButton = value;\n ShoppingModule.setCustomClickLinkButtonEnabled(!!value);\n }\n private _onCustomClickLinkButton?: CustomClickLinkButtonCallback | undefined;\n\n /**\n * Defaults to true.\n * You can hide the cart icon by setting this property to false.\n */\n public get cartIconVisible(): boolean {\n return this._cartIconVisible;\n }\n public set cartIconVisible(value: boolean) {\n this._cartIconVisible = value;\n if (FWGlobalState.getInstance().sdkInitCalled) {\n ShoppingModule.setCartIconVisible(value);\n } else {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n ShoppingModule.setCartIconVisible(value);\n });\n }\n }\n private _cartIconVisible: boolean = true;\n\n /**\n * The configuration of product info view.\n * Please refer to {@link ProductInfoViewConfiguration} for more details.\n */\n public get productInfoViewConfiguration():\n | ProductInfoViewConfiguration\n | undefined {\n return this._productInfoViewConfiguration;\n }\n\n public set productInfoViewConfiguration(\n value: ProductInfoViewConfiguration | undefined\n ) {\n this._productInfoViewConfiguration = value;\n if (FWGlobalState.getInstance().sdkInitCalled) {\n ShoppingModule.setProductInfoViewConfiguration(value ?? {});\n } else {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n ShoppingModule.setProductInfoViewConfiguration(value ?? {});\n });\n }\n }\n\n private _productInfoViewConfiguration?:\n | ProductInfoViewConfiguration\n | undefined;\n\n private get eventEmitter(): NativeEventEmitter {\n return ShoppingModuleEventEmitter;\n }\n\n public static getInstance() {\n FWLoggerUtil.log('VideoShopping constructor');\n if (!VideoShopping._instance) {\n VideoShopping._instance = new VideoShopping();\n }\n\n return VideoShopping._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(\n FWEventName.ShoppingCTAButtonClick,\n (event) => {\n FWLoggerUtil.log(\n `Receive ShoppingCTA event productId: ${event?.productId} unitId: ${event?.unitId} url: ${event?.url}`\n );\n this.handleShoppingCTAEvent(event);\n }\n );\n\n this.eventEmitter.addListener(FWEventName.ClickCartIcon, () => {\n FWLoggerUtil.log('Receive ClickCartIcon event');\n this.handleClickCartIconEvent();\n });\n\n this.eventEmitter.addListener(FWEventName.UpdateProductDetails, (event) => {\n FWLoggerUtil.log(\n `Receive UpdateProductDetails event productIds: ${event?.productIds}`\n );\n this.handleUpdateProductDetailsEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, () => {});\n\n this.eventEmitter.addListener(\n FWEventName.CustomLinkButtonClick,\n (event) => {\n FWLoggerUtil.log(\n `Receive CustomLinkButtonClick event url: ${event?.url}`\n );\n this.handleCustomLinkButtonClickEvent(event);\n }\n );\n }\n\n /**\n *\n * @param {number} count The number of items in the host app cart.\n * The count should be greater than or equal to 0.\n * We just use count to show or hide red indicator on the cart icon.\n * If cound > 0, we will show the red indicator on the cart icon.\n * Otherwise, we will hide the red indicator on the cart icon.\n */\n public async setCartItemCount(count: number): Promise<void> {\n if (!FWGlobalState.getInstance().sdkInitCalled) {\n await FWGlobalState.getInstance().sdkInitCalledPromise;\n }\n ShoppingModule.setCartItemCount(count);\n }\n\n private async handleShoppingCTAEvent(event: any) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n\n if (this.onShoppingCTA) {\n const result = await this.onShoppingCTA(event as ShoppingCTAEvent);\n if (callbackId) {\n ShoppingModule.updateShoppingCTAResult(result, callbackId);\n }\n } else {\n if (callbackId) {\n if (Platform.OS === 'ios') {\n ShoppingModule.clearCallbackId(\n callbackId,\n FWEventName.ShoppingCTAButtonClick\n );\n }\n }\n }\n }\n\n private async handleClickCartIconEvent() {\n if (this.onCustomClickCartIcon) {\n this.onCustomClickCartIcon();\n }\n }\n\n private async handleUpdateProductDetailsEvent(event: any) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n if (this.onUpdateProductDetails) {\n FWLoggerUtil.log(\n `Call onUpdateProductDetails callback productIds: ${event.productIds} callbackId: ${callbackId}`\n );\n const productList = await this.onUpdateProductDetails(\n event as UpdateProductDetailsEvent\n );\n\n const productIds = (productList || []).map(\n (product) => product.productId ?? ''\n );\n\n FWLoggerUtil.log(\n `Get result from onUpdateProductDetails callback productIds: ${productIds} productListLength: ${\n (productList || []).length\n }`\n );\n\n if (productList) {\n if (callbackId) {\n ShoppingModule.updateVideoProducts(productList, callbackId);\n }\n } else {\n if (callbackId) {\n if (Platform.OS === 'ios') {\n ShoppingModule.clearCallbackId(\n callbackId,\n FWEventName.UpdateProductDetails\n );\n }\n }\n }\n } else {\n FWLoggerUtil.log('onUpdateProductDetails callback is not set.');\n if (callbackId) {\n if (Platform.OS === 'ios') {\n ShoppingModule.clearCallbackId(\n callbackId,\n FWEventName.UpdateProductDetails\n );\n }\n }\n }\n }\n\n private async handleCustomLinkButtonClickEvent(\n event: CustomClickLinkButtonEvent\n ) {\n if (this.onCustomClickLinkButton) {\n this.onCustomClickLinkButton(event);\n }\n }\n}\n\nexport default VideoShopping;\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
var _FWErrorMessage = require("../constants/FWErrorMessage");
|
|
11
|
-
|
|
12
|
-
const NativeComponentName = 'FWStoryBlock';
|
|
13
|
-
const FWStoryBlock = _reactNative.UIManager.getViewManagerConfig(NativeComponentName) != null ? (0, _reactNative.requireNativeComponent)(NativeComponentName) : () => {
|
|
14
|
-
throw new Error(_FWErrorMessage.LINKING_ERROR);
|
|
15
|
-
};
|
|
16
|
-
var _default = FWStoryBlock;
|
|
17
|
-
exports.default = _default;
|
|
18
|
-
//# sourceMappingURL=FWStoryBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["FWStoryBlock.tsx"],"names":["NativeComponentName","FWStoryBlock","UIManager","getViewManagerConfig","Error","LINKING_ERROR"],"mappings":";;;;;;;AAAA;;AACA;;AACA,MAAMA,mBAAmB,GAAG,cAA5B;AACA,MAAMC,YAAY,GAChBC,uBAAUC,oBAAV,CAA+BH,mBAA/B,KAAuD,IAAvD,GACI,yCAA4BA,mBAA5B,CADJ,GAEI,MAAM;AACJ,QAAM,IAAII,KAAJ,CAAUC,6BAAV,CAAN;AACD,CALP;eAMeJ,Y","sourcesContent":["import { requireNativeComponent, UIManager } from 'react-native';\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nconst NativeComponentName = 'FWStoryBlock';\nconst FWStoryBlock =\n UIManager.getViewManagerConfig(NativeComponentName) != null\n ? requireNativeComponent<any>(NativeComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\nexport default FWStoryBlock;\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
var _FWErrorMessage = require("../constants/FWErrorMessage");
|
|
11
|
-
|
|
12
|
-
const NativeComponentName = 'FWVideoFeed';
|
|
13
|
-
const FWVideoFeed = _reactNative.UIManager.getViewManagerConfig(NativeComponentName) != null ? (0, _reactNative.requireNativeComponent)(NativeComponentName) : () => {
|
|
14
|
-
throw new Error(_FWErrorMessage.LINKING_ERROR);
|
|
15
|
-
};
|
|
16
|
-
var _default = FWVideoFeed;
|
|
17
|
-
exports.default = _default;
|
|
18
|
-
//# sourceMappingURL=FWVideoFeed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["FWVideoFeed.tsx"],"names":["NativeComponentName","FWVideoFeed","UIManager","getViewManagerConfig","Error","LINKING_ERROR"],"mappings":";;;;;;;AAAA;;AACA;;AACA,MAAMA,mBAAmB,GAAG,aAA5B;AACA,MAAMC,WAAW,GACfC,uBAAUC,oBAAV,CAA+BH,mBAA/B,KAAuD,IAAvD,GACI,yCAA4BA,mBAA5B,CADJ,GAEI,MAAM;AACJ,QAAM,IAAII,KAAJ,CAAUC,6BAAV,CAAN;AACD,CALP;eAMeJ,W","sourcesContent":["import { requireNativeComponent, UIManager } from 'react-native';\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nconst NativeComponentName = 'FWVideoFeed';\nconst FWVideoFeed =\n UIManager.getViewManagerConfig(NativeComponentName) != null\n ? requireNativeComponent<any>(NativeComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\nexport default FWVideoFeed;\n"]}
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _FireworkSDK = _interopRequireDefault(require("../FireworkSDK"));
|
|
13
|
-
|
|
14
|
-
var _FWEventName = require("../models/FWEventName");
|
|
15
|
-
|
|
16
|
-
var _FireworkSDKModule = require("../modules/FireworkSDKModule");
|
|
17
|
-
|
|
18
|
-
var _FWGlobalState = _interopRequireDefault(require("../utils/FWGlobalState"));
|
|
19
|
-
|
|
20
|
-
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
21
|
-
|
|
22
|
-
var _FWStoryBlock = _interopRequireDefault(require("./FWStoryBlock"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
|
-
|
|
32
|
-
const NativeComponentName = 'FWStoryBlock';
|
|
33
|
-
|
|
34
|
-
const StoryBlock = (props, forwardedRef) => {
|
|
35
|
-
const nativeComponentRef = (0, _react.useRef)(null);
|
|
36
|
-
const [isFullscreenState, setIsFullscreenState] = (0, _react.useState)(false);
|
|
37
|
-
const [sdkInitCalled, setSdkInitCalled] = (0, _react.useState)(_FWGlobalState.default.getInstance().sdkInitCalled);
|
|
38
|
-
const [, forceUpdate] = (0, _react.useReducer)(x => x + 1, 0);
|
|
39
|
-
|
|
40
|
-
const handleStoryBlockLoadFinished = event => {
|
|
41
|
-
_FWLoggerUtil.default.log(`StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`);
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
onStoryBlockLoadFinished
|
|
45
|
-
} = props;
|
|
46
|
-
const {
|
|
47
|
-
name,
|
|
48
|
-
reason
|
|
49
|
-
} = event.nativeEvent;
|
|
50
|
-
|
|
51
|
-
if (onStoryBlockLoadFinished) {
|
|
52
|
-
if (name) {
|
|
53
|
-
if (reason) {
|
|
54
|
-
onStoryBlockLoadFinished({
|
|
55
|
-
name,
|
|
56
|
-
reason
|
|
57
|
-
});
|
|
58
|
-
} else {
|
|
59
|
-
onStoryBlockLoadFinished({
|
|
60
|
-
name
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
onStoryBlockLoadFinished();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const handleStoryBlockFullScreenStateChanged = event => {
|
|
70
|
-
_FWLoggerUtil.default.log(`StoryBlock handleStoryBlockFullScreenStateChanged ${event.nativeEvent.isFullScreen}`);
|
|
71
|
-
|
|
72
|
-
const {
|
|
73
|
-
isFullScreen
|
|
74
|
-
} = event.nativeEvent;
|
|
75
|
-
setIsFullscreenState(isFullScreen);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const generateDynamicContentParametersString = () => {
|
|
79
|
-
const {
|
|
80
|
-
dynamicContentParameters
|
|
81
|
-
} = props;
|
|
82
|
-
|
|
83
|
-
if (!dynamicContentParameters) {
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
let resultString = '';
|
|
88
|
-
const sortedKeyList = Object.keys(dynamicContentParameters).sort();
|
|
89
|
-
|
|
90
|
-
for (const key of sortedKeyList) {
|
|
91
|
-
const value = dynamicContentParameters[key];
|
|
92
|
-
const valueString = value.join(',');
|
|
93
|
-
|
|
94
|
-
if (resultString.length > 0) {
|
|
95
|
-
resultString += '_';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
resultString += `${key}:${valueString}`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return resultString;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const generateVastAttributesString = () => {
|
|
105
|
-
var _adConfiguration$vast;
|
|
106
|
-
|
|
107
|
-
const {
|
|
108
|
-
adConfiguration
|
|
109
|
-
} = props;
|
|
110
|
-
const vastAttributes = (_adConfiguration$vast = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.vastAttributes) !== null && _adConfiguration$vast !== void 0 ? _adConfiguration$vast : '';
|
|
111
|
-
|
|
112
|
-
if (!vastAttributes) {
|
|
113
|
-
return '';
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let resultString = '';
|
|
117
|
-
|
|
118
|
-
for (const attribute of vastAttributes) {
|
|
119
|
-
var _attribute$name;
|
|
120
|
-
|
|
121
|
-
if (resultString.length > 0) {
|
|
122
|
-
resultString += '_';
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
resultString += `${(_attribute$name = attribute.name) !== null && _attribute$name !== void 0 ? _attribute$name : ''}:${attribute.value}`;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return resultString;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const generateKey = () => {
|
|
132
|
-
var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _FireworkSDK$getInsta4, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _adBadgeConfiguration4, _adBadgeConfiguration5, _adBadgeConfiguration6, _adBadgeConfiguration7, _adBadgeConfiguration8, _storyBlockConfigurat, _storyBlockConfigurat2, _storyBlockConfigurat3, _storyBlockConfigurat4, _storyBlockConfigurat5, _storyBlockConfigurat6, _storyBlockConfigurat7, _storyBlockConfigurat8, _storyBlockConfigurat9, _storyBlockConfigurat10, _storyBlockConfigurat11, _storyBlockConfigurat12, _storyBlockConfigurat13, _storyBlockConfigurat14, _storyBlockConfigurat15, _storyBlockConfigurat16, _storyBlockConfigurat17, _storyBlockConfigurat18, _storyBlockConfigurat19, _adConfiguration$requ, _adConfiguration$requ2, _adConfiguration$adsF;
|
|
133
|
-
|
|
134
|
-
const gShareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
135
|
-
const appLanguage = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : '';
|
|
136
|
-
const videoLaunchBehavior = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().videoLaunchBehavior) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : '';
|
|
137
|
-
const adBadgeConfiguration = (_FireworkSDK$getInsta4 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta4 !== void 0 ? _FireworkSDK$getInsta4 : {};
|
|
138
|
-
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
139
|
-
const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
|
|
140
|
-
const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
|
|
141
|
-
const androidFontIsCustomOfAdBadge = (_adBadgeConfiguration4 = (_adBadgeConfiguration5 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration5 === void 0 ? void 0 : (_adBadgeConfiguration6 = _adBadgeConfiguration5.isCustom) === null || _adBadgeConfiguration6 === void 0 ? void 0 : _adBadgeConfiguration6.toString()) !== null && _adBadgeConfiguration4 !== void 0 ? _adBadgeConfiguration4 : '';
|
|
142
|
-
const androidFontTypefaceNameOfAdBadge = (_adBadgeConfiguration7 = (_adBadgeConfiguration8 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration8 === void 0 ? void 0 : _adBadgeConfiguration8.typefaceName) !== null && _adBadgeConfiguration7 !== void 0 ? _adBadgeConfiguration7 : '';
|
|
143
|
-
const {
|
|
144
|
-
source,
|
|
145
|
-
channel = '',
|
|
146
|
-
playlist = '',
|
|
147
|
-
hashtagFilterExpression = '',
|
|
148
|
-
enablePictureInPicture = false,
|
|
149
|
-
adConfiguration,
|
|
150
|
-
storyBlockConfiguration
|
|
151
|
-
} = props;
|
|
152
|
-
const dynamicContentParametersString = generateDynamicContentParametersString();
|
|
153
|
-
const videoCompleteAction = (_storyBlockConfigurat = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.videoCompleteAction) !== null && _storyBlockConfigurat !== void 0 ? _storyBlockConfigurat : '';
|
|
154
|
-
const showShareButton = (_storyBlockConfigurat2 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat3 = storyBlockConfiguration.showShareButton) === null || _storyBlockConfigurat3 === void 0 ? void 0 : _storyBlockConfigurat3.toString()) !== null && _storyBlockConfigurat2 !== void 0 ? _storyBlockConfigurat2 : '';
|
|
155
|
-
const showPlaybackButton = (_storyBlockConfigurat4 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat5 = storyBlockConfiguration.showPlaybackButton) === null || _storyBlockConfigurat5 === void 0 ? void 0 : _storyBlockConfigurat5.toString()) !== null && _storyBlockConfigurat4 !== void 0 ? _storyBlockConfigurat4 : '';
|
|
156
|
-
const showBranding = (_storyBlockConfigurat6 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat7 = storyBlockConfiguration.showBranding) === null || _storyBlockConfigurat7 === void 0 ? void 0 : _storyBlockConfigurat7.toString()) !== null && _storyBlockConfigurat6 !== void 0 ? _storyBlockConfigurat6 : '';
|
|
157
|
-
const ctaDelayType = (_storyBlockConfigurat8 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat9 = storyBlockConfiguration.ctaDelay) === null || _storyBlockConfigurat9 === void 0 ? void 0 : _storyBlockConfigurat9.type) !== null && _storyBlockConfigurat8 !== void 0 ? _storyBlockConfigurat8 : '';
|
|
158
|
-
const ctaDelayValue = (_storyBlockConfigurat10 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat11 = storyBlockConfiguration.ctaDelay) === null || _storyBlockConfigurat11 === void 0 ? void 0 : (_storyBlockConfigurat12 = _storyBlockConfigurat11.value) === null || _storyBlockConfigurat12 === void 0 ? void 0 : _storyBlockConfigurat12.toFixed(5)) !== null && _storyBlockConfigurat10 !== void 0 ? _storyBlockConfigurat10 : '';
|
|
159
|
-
const ctaHighlightDelayType = (_storyBlockConfigurat13 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat14 = storyBlockConfiguration.ctaHighlightDelay) === null || _storyBlockConfigurat14 === void 0 ? void 0 : _storyBlockConfigurat14.type) !== null && _storyBlockConfigurat13 !== void 0 ? _storyBlockConfigurat13 : '';
|
|
160
|
-
const ctaHighlightDelayValue = (_storyBlockConfigurat15 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat16 = storyBlockConfiguration.ctaHighlightDelay) === null || _storyBlockConfigurat16 === void 0 ? void 0 : (_storyBlockConfigurat17 = _storyBlockConfigurat16.value) === null || _storyBlockConfigurat17 === void 0 ? void 0 : _storyBlockConfigurat17.toFixed(5)) !== null && _storyBlockConfigurat15 !== void 0 ? _storyBlockConfigurat15 : '';
|
|
161
|
-
const shareBaseURL = (_storyBlockConfigurat18 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.shareBaseURL) !== null && _storyBlockConfigurat18 !== void 0 ? _storyBlockConfigurat18 : '';
|
|
162
|
-
const ctaWidth = (_storyBlockConfigurat19 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.ctaWidth) !== null && _storyBlockConfigurat19 !== void 0 ? _storyBlockConfigurat19 : '';
|
|
163
|
-
const requiresAds = (_adConfiguration$requ = adConfiguration === null || adConfiguration === void 0 ? void 0 : (_adConfiguration$requ2 = adConfiguration.requiresAds) === null || _adConfiguration$requ2 === void 0 ? void 0 : _adConfiguration$requ2.toString()) !== null && _adConfiguration$requ !== void 0 ? _adConfiguration$requ : '';
|
|
164
|
-
const adsFetchTimeout = (_adConfiguration$adsF = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.adsFetchTimeout) !== null && _adConfiguration$adsF !== void 0 ? _adConfiguration$adsF : 10;
|
|
165
|
-
const vastAttributesString = generateVastAttributesString();
|
|
166
|
-
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
167
|
-
|
|
168
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
169
|
-
key += `_appLanguage:${appLanguage}`;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
173
|
-
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
174
|
-
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
175
|
-
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
176
|
-
|
|
177
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
178
|
-
key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
|
|
179
|
-
key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
key += `_source:${source}`;
|
|
183
|
-
key += `_channel:${channel}`;
|
|
184
|
-
key += `_playlist:${playlist}`;
|
|
185
|
-
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
186
|
-
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
187
|
-
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
188
|
-
key += `_shareBaseURL:${shareBaseURL}`;
|
|
189
|
-
|
|
190
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
191
|
-
key += `_videoCompleteAction:${videoCompleteAction}`;
|
|
192
|
-
key += `_showShareButton:${showShareButton}`;
|
|
193
|
-
key += `_showPlaybackButton:${showPlaybackButton}`;
|
|
194
|
-
key += `_showBranding:${showBranding}`;
|
|
195
|
-
key += `_ctaDelayType:${ctaDelayType}`;
|
|
196
|
-
key += `_ctaDelayValue:${ctaDelayValue}`;
|
|
197
|
-
key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
|
|
198
|
-
key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
|
|
199
|
-
key += `_ctaWidth:${ctaWidth}`;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
key += `_requiresAds:${requiresAds}`;
|
|
203
|
-
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
204
|
-
key += `_vastAttributes:${vastAttributesString}`;
|
|
205
|
-
return key;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const key = generateKey();
|
|
209
|
-
(0, _react.useImperativeHandle)(forwardedRef, () => {
|
|
210
|
-
const sendCommand = command => {
|
|
211
|
-
const nativeNodeHandle = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
212
|
-
|
|
213
|
-
let commandId = _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands[command];
|
|
214
|
-
|
|
215
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
216
|
-
commandId = commandId.toString();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
_reactNative.UIManager.dispatchViewManagerCommand((0, _reactNative.findNodeHandle)(nativeNodeHandle), commandId, []);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
play: () => {
|
|
224
|
-
sendCommand('play');
|
|
225
|
-
},
|
|
226
|
-
pause: () => {
|
|
227
|
-
sendCommand('pause');
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
}, []);
|
|
231
|
-
(0, _react.useEffect)(() => {
|
|
232
|
-
const subscriptionOfShareBaseURLUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.ShareBaseURLUpdated, () => {
|
|
233
|
-
_FWLoggerUtil.default.log('Receive FWEventName.ShareBaseURLUpdated');
|
|
234
|
-
|
|
235
|
-
forceUpdate();
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
const subscriptionOfAdBadgeConfigurationUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AdBadgeConfigurationUpdated, () => {
|
|
239
|
-
_FWLoggerUtil.default.log('Receive FWEventName.AdBadgeConfigurationUpdated');
|
|
240
|
-
|
|
241
|
-
forceUpdate();
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
const subscriptionOfVideoLaunchBehaviorUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.VideoLaunchBehaviorUpdated, () => {
|
|
245
|
-
_FWLoggerUtil.default.log('Receive FWEventName.VideoLaunchBehaviorUpdated');
|
|
246
|
-
|
|
247
|
-
forceUpdate();
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
const subscriptionOfAppLanguageUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AppLanguageUpdated, () => {
|
|
251
|
-
_FWLoggerUtil.default.log('Receive FWEventName.AppLanguageUpdated');
|
|
252
|
-
|
|
253
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
254
|
-
forceUpdate();
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
return () => {
|
|
259
|
-
subscriptionOfShareBaseURLUpdated.remove();
|
|
260
|
-
subscriptionOfAdBadgeConfigurationUpdated.remove();
|
|
261
|
-
subscriptionOfVideoLaunchBehaviorUpdated.remove();
|
|
262
|
-
subscriptionOfAppLanguageUpdated.remove();
|
|
263
|
-
};
|
|
264
|
-
}, []);
|
|
265
|
-
(0, _react.useEffect)(() => {
|
|
266
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
267
|
-
setTimeout(() => {
|
|
268
|
-
const viewId = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
269
|
-
|
|
270
|
-
_FWLoggerUtil.default.log(`StoryBlock createFragment viewId: ${viewId}`);
|
|
271
|
-
|
|
272
|
-
_reactNative.UIManager.dispatchViewManagerCommand(viewId, _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.create.toString(), [viewId]);
|
|
273
|
-
}, 500);
|
|
274
|
-
}
|
|
275
|
-
}, [key]);
|
|
276
|
-
(0, _react.useEffect)(() => {
|
|
277
|
-
_FWGlobalState.default.getInstance().sdkInitCalledPromise.then(() => {
|
|
278
|
-
setSdkInitCalled(true);
|
|
279
|
-
});
|
|
280
|
-
}, []);
|
|
281
|
-
(0, _react.useEffect)(() => {
|
|
282
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
283
|
-
const onBackPress = () => {
|
|
284
|
-
if (isFullscreenState) {
|
|
285
|
-
_FireworkSDK.default.getInstance().navigator.popNativeContainer();
|
|
286
|
-
|
|
287
|
-
return true;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return false;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
|
294
|
-
|
|
295
|
-
return () => {
|
|
296
|
-
subscription.remove();
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return;
|
|
301
|
-
}, [isFullscreenState]);
|
|
302
|
-
|
|
303
|
-
if (!sdkInitCalled) {
|
|
304
|
-
return null;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return /*#__PURE__*/_react.default.createElement(_FWStoryBlock.default, _extends({
|
|
308
|
-
ref: nativeComponentRef,
|
|
309
|
-
key: key
|
|
310
|
-
}, props, {
|
|
311
|
-
onStoryBlockLoadFinished: handleStoryBlockLoadFinished,
|
|
312
|
-
onStoryBlockFullScreenStateChanged: handleStoryBlockFullScreenStateChanged
|
|
313
|
-
}));
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(StoryBlock);
|
|
317
|
-
|
|
318
|
-
exports.default = _default;
|
|
319
|
-
//# sourceMappingURL=StoryBlock.js.map
|