react-native-firework-sdk 2.13.0 → 2.14.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/android/.idea/codeStyles/Project.xml +124 -0
- package/android/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWDataTrackingLevel.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWSwitchLanguageBehavior.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +19 -7
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +6 -4
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +29 -19
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +41 -17
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +25 -13
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +57 -15
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWModelUtils.kt +9 -1
- package/ios/Components/StoryBlock.swift +14 -3
- package/ios/Components/VideoFeed.swift +4 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +1 -0
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +6 -2
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +13 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +8 -16
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +9 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +96 -31
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +9 -0
- package/ios/Modules/Shopping/ShoppingModule.swift +12 -3
- package/ios/Utils/Extensions/NumberFormatter+AppLanguage.swift +27 -0
- package/lib/commonjs/FireworkSDK.js +66 -12
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +15 -0
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +6 -0
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +14 -6
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +14 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/DataTrackingLevel.js +2 -0
- package/lib/commonjs/models/DataTrackingLevel.js.map +1 -0
- package/lib/commonjs/models/FWComponentType.js +14 -0
- package/lib/commonjs/models/FWComponentType.js.map +1 -0
- package/lib/commonjs/models/FWEventName.js +1 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/utils/FWGlobalState.js +2 -0
- package/lib/commonjs/utils/FWGlobalState.js.map +1 -1
- package/lib/module/FireworkSDK.js +64 -11
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/VideoShopping.js +15 -0
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +5 -0
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +13 -6
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +6 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/DataTrackingLevel.js +2 -0
- package/lib/module/models/DataTrackingLevel.js.map +1 -0
- package/lib/module/models/FWComponentType.js +7 -0
- package/lib/module/models/FWComponentType.js.map +1 -0
- package/lib/module/models/FWEventName.js +1 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/utils/FWGlobalState.js +2 -0
- package/lib/module/utils/FWGlobalState.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +22 -1
- package/lib/typescript/VideoShopping.d.ts +8 -1
- package/lib/typescript/index.d.ts +15 -13
- package/lib/typescript/models/DataTrackingLevel.d.ts +1 -0
- package/lib/typescript/models/FWComponentType.d.ts +4 -0
- package/lib/typescript/models/FWEventName.d.ts +2 -1
- package/lib/typescript/models/FWEvents.d.ts +18 -1
- package/lib/typescript/models/FeedItemDetails.d.ts +0 -1
- package/lib/typescript/models/LiveStreamEventDetails.d.ts +1 -0
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +0 -2
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +0 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +1 -1
- package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -0
- package/lib/typescript/utils/FWGlobalState.d.ts +2 -0
- package/package.json +1 -1
- package/react-native-firework-sdk.podspec +4 -3
- package/src/FireworkSDK.ts +59 -14
- package/src/VideoShopping.ts +24 -0
- package/src/components/StoryBlock.tsx +8 -0
- package/src/components/VideoFeed.tsx +11 -1
- package/src/index.ts +38 -30
- package/src/models/DataTrackingLevel.ts +1 -0
- package/src/models/FWComponentType.ts +4 -0
- package/src/models/FWEventName.ts +1 -0
- package/src/models/FWEvents.ts +19 -1
- package/src/models/FeedItemDetails.ts +0 -1
- package/src/models/LiveStreamEventDetails.ts +1 -0
- package/src/models/StoryBlockConfiguration.ts +0 -2
- package/src/models/VideoFeedConfiguration.ts +0 -1
- package/src/models/VideoPlayerConfiguration.ts +1 -1
- package/src/modules/FireworkSDKModule.ts +2 -0
- package/src/utils/FWGlobalState.ts +3 -0
|
@@ -25,6 +25,8 @@ var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
|
25
25
|
|
|
26
26
|
var _FWVideoFeed = _interopRequireDefault(require("./FWVideoFeed"));
|
|
27
27
|
|
|
28
|
+
var _FWComponentType = require("../models/FWComponentType");
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
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); }
|
|
@@ -201,6 +203,10 @@ class VideoFeed extends _react.default.Component {
|
|
|
201
203
|
feedId
|
|
202
204
|
} = event.nativeEvent;
|
|
203
205
|
|
|
206
|
+
if (feedId) {
|
|
207
|
+
_FWGlobalState.default.getInstance().componentTypeByFeedIdMap.set(feedId, _FWComponentType.FWComponentType.videoFeed);
|
|
208
|
+
}
|
|
209
|
+
|
|
204
210
|
if (onVideoFeedGetFeedId) {
|
|
205
211
|
onVideoFeedGetFeedId(feedId !== null && feedId !== void 0 ? feedId : '');
|
|
206
212
|
}
|
|
@@ -317,14 +323,15 @@ class VideoFeed extends _react.default.Component {
|
|
|
317
323
|
const titleHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.title) === null || _videoFeedConfigurati2 === void 0 ? void 0 : (_videoFeedConfigurati3 = _videoFeedConfigurati2.hidden) === null || _videoFeedConfigurati3 === void 0 ? void 0 : _videoFeedConfigurati3.toString();
|
|
318
324
|
const titleTextColor = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati4 = videoFeedConfiguration.title) === null || _videoFeedConfigurati4 === void 0 ? void 0 : _videoFeedConfigurati4.textColor;
|
|
319
325
|
const titleFontSize = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati5 = videoFeedConfiguration.title) === null || _videoFeedConfigurati5 === void 0 ? void 0 : (_videoFeedConfigurati6 = _videoFeedConfigurati5.fontSize) === null || _videoFeedConfigurati6 === void 0 ? void 0 : _videoFeedConfigurati6.toFixed(5);
|
|
320
|
-
const
|
|
321
|
-
const
|
|
326
|
+
const titleNumberOfLines = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati7 = videoFeedConfiguration.title) === null || _videoFeedConfigurati7 === void 0 ? void 0 : _videoFeedConfigurati7.numberOfLines;
|
|
327
|
+
const titleAndroidFontInfo = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati8 = videoFeedConfiguration.title) === null || _videoFeedConfigurati8 === void 0 ? void 0 : _videoFeedConfigurati8.androidFontInfo;
|
|
328
|
+
const titleGradientDrawable = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati9 = videoFeedConfiguration.title) === null || _videoFeedConfigurati9 === void 0 ? void 0 : _videoFeedConfigurati9.gradientDrawable;
|
|
322
329
|
const titlePosition = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition;
|
|
323
|
-
const playIconHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (
|
|
324
|
-
const playIconWidth = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (
|
|
325
|
-
const showAdBadge = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (
|
|
330
|
+
const playIconHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati10 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati10 === void 0 ? void 0 : _videoFeedConfigurati10.hidden;
|
|
331
|
+
const playIconWidth = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati11 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati11 === void 0 ? void 0 : (_videoFeedConfigurati12 = _videoFeedConfigurati11.iconWidth) === null || _videoFeedConfigurati12 === void 0 ? void 0 : _videoFeedConfigurati12.toFixed(5);
|
|
332
|
+
const showAdBadge = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati13 = videoFeedConfiguration.showAdBadge) === null || _videoFeedConfigurati13 === void 0 ? void 0 : _videoFeedConfigurati13.toString();
|
|
326
333
|
const enableAutoplay = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.enableAutoplay;
|
|
327
|
-
const gridColumns = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 :
|
|
334
|
+
const gridColumns = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.gridColumns;
|
|
328
335
|
const itemSpacing = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati14 = videoFeedConfiguration.itemSpacing) === null || _videoFeedConfigurati14 === void 0 ? void 0 : _videoFeedConfigurati14.toFixed(5);
|
|
329
336
|
|
|
330
337
|
const videoPlayerConfiguration = this._getVideoPlayerConfiguration();
|
|
@@ -387,6 +394,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
387
394
|
key += `_cornerRadius:${cornerRadius}`;
|
|
388
395
|
key += `_titleTextColor:${titleTextColor}`;
|
|
389
396
|
key += `_titleFontSize:${titleFontSize}`;
|
|
397
|
+
key += `_titleNumberOfLines:${titleNumberOfLines}`;
|
|
390
398
|
key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : titleAndroidFontInfo.isCustom}`;
|
|
391
399
|
key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : titleAndroidFontInfo.typefaceName}`;
|
|
392
400
|
key += `_titleGradientDrawable.orientation:${titleGradientDrawable === null || titleGradientDrawable === void 0 ? void 0 : titleGradientDrawable.orientation}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","constructor","props","createRef","FWLoggerUtil","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","UIManager","getViewManagerConfig","Commands","refresh","Platform","OS","toString","reactTag","dispatchViewManagerCommand","event","onVideoFeedLoadFinished","onVideoFeedEmpty","name","reason","action","nativeEvent","error","_loaded","FWNativeErrorAction","loadingFirstPage","onVideoFeedDidStartPictureInPicture","onVideoFeedDidStopPictureInPicture","onVideoFeedGetFeedId","feedId","state","sdkInitCalled","FWGlobalState","getInstance","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","playlistGroup","hashtagFilterExpression","productIds","contentId","mode","enablePictureInPicture","adConfiguration","dynamicContentParametersString","_generateDynamicContentParametersString","videoFeedConfiguration","_getVideoFeedConfiguration","cornerRadius","toFixed","titleHidden","title","hidden","titleTextColor","titleFontSize","fontSize","titleAndroidFontInfo","titleGradientDrawable","gradientDrawable","titlePosition","playIconHidden","playIcon","playIconWidth","iconWidth","showAdBadge","enableAutoplay","gridColumns","itemSpacing","videoPlayerConfiguration","_getVideoPlayerConfiguration","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","countdownTimerConfigurationJsonKey","countdownTimerConfiguration","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","replayBadgeVideoFeedConfigurationJsonKey","replayBadge","replayBadgeVideoPlayerConfigurationJsonKey","replayBadgeConfiguration","shadowVideoFeedConfigurationJsonKey","shadow","key","join","orientation","colors","_generateButtonInfoString","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","undefined","_onVideoFeedLoadFinished","_onVideoFeedEmpty","_onVideoFeedDidStartPictureInPicture","_onVideoFeedDidStopPictureInPicture","_onVideoFeedGetFeedId","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","buttonInfo","imageName","systemImageName","tintColor","resultVideoFeedConfiguration","Math","floor","numberOfLines","resultVideoPlayerConfiguration"],"mappings":";;;;;;;AAAA;;AAEA;;AAUA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAqGA,MAAMA,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAA0E;AACxE;AACF;AACA;AAWEC,EAAAA,WAAW,CAACC,KAAD,EAAyB;AAClC,UAAMA,KAAN;;AADkC,8DANNH,eAAMI,SAAN,EAMM;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AA8B,GAAG,EAC/B,GAAGA,8BAD4B;AAE/B9F,QAAAA;AAF+B,OAAjC;AAID;;AAED,WAAO8F,8BAAP;AACD;;AAlhBuE;;gBAApEvL,S,kBAIkB;AACpBwF,EAAAA,IAAI,EAAE;AADc,C;;eAihBTxF,S","sourcesContent":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport { FWNativeErrorAction } from '../models/FWNativeErrorAction';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS.\n * Defaults to discover.\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n * Required when the source is set as hashtagPlaylist.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id. Only supported on iOS.\n */\n contentId?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n /**\n * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onVideoFeedLoadFinished will also be triggered when onVideoFeedEmpty is triggered.\n */\n onVideoFeedEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onVideoFeedGetFeedId?: (feedId: string) => void;\n}\n\ninterface IVideoFeedState {\n sdkInitCalled: boolean;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n private _loaded: boolean = false;\n\n constructor(props: IVideoFeedProps) {\n super(props);\n this.state = {\n sdkInitCalled: FWGlobalState.getInstance().sdkInitCalled,\n };\n }\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `VideoFeed refresh commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n const { onVideoFeedLoadFinished, onVideoFeedEmpty } = this.props;\n\n const { name, reason, action } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n if (Platform.OS === 'android') {\n if (!this._loaded) {\n onVideoFeedLoadFinished(error);\n }\n if (\n action === FWNativeErrorAction.loadingFirstPage ||\n !this._loaded\n ) {\n onVideoFeedEmpty?.(error);\n }\n } else {\n onVideoFeedLoadFinished(error);\n if (!this._loaded) {\n onVideoFeedEmpty?.(error);\n }\n }\n } else {\n if (Platform.OS === 'android') {\n if (!this._loaded) {\n onVideoFeedLoadFinished();\n }\n } else {\n onVideoFeedLoadFinished();\n }\n this._loaded = true;\n }\n }\n };\n\n private _onVideoFeedEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedEmpty } = this.props;\n\n if (onVideoFeedEmpty) {\n onVideoFeedEmpty();\n }\n };\n\n private _onVideoFeedDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStartPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStartPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStartPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStartPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStopPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStopPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStopPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStopPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed onVideoFeedGetFeedId ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedGetFeedId } = this.props;\n\n const { feedId } = event.nativeEvent;\n\n if (onVideoFeedGetFeedId) {\n onVideoFeedGetFeedId(feedId ?? '');\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n if (!this.state.sdkInitCalled) {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.setState({ sdkInitCalled: true });\n });\n }\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAppLanguageUpdated);\n }\n\n /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n if (!this.state.sdkInitCalled) {\n return null;\n }\n\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom?.toString();\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n playlistGroup,\n hashtagFilterExpression,\n productIds,\n contentId,\n mode,\n enablePictureInPicture,\n adConfiguration,\n } = this.props;\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const cornerRadius = videoFeedConfiguration?.cornerRadius?.toFixed(5);\n\n const titleHidden = videoFeedConfiguration?.title?.hidden?.toString();\n const titleTextColor = videoFeedConfiguration?.title?.textColor;\n const titleFontSize = videoFeedConfiguration?.title?.fontSize?.toFixed(5);\n const titleAndroidFontInfo = videoFeedConfiguration?.title?.androidFontInfo;\n const titleGradientDrawable =\n videoFeedConfiguration?.title?.gradientDrawable;\n const titlePosition = videoFeedConfiguration?.titlePosition;\n const playIconHidden = videoFeedConfiguration?.playIcon?.hidden;\n const playIconWidth =\n videoFeedConfiguration?.playIcon?.iconWidth?.toFixed(5);\n const showAdBadge = videoFeedConfiguration?.showAdBadge?.toString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay;\n const gridColumns = videoFeedConfiguration?.gridColumns?.toFixed(5);\n const itemSpacing = videoFeedConfiguration?.itemSpacing?.toFixed(5);\n\n const videoPlayerConfiguration = this._getVideoPlayerConfiguration();\n const playerStyle = videoPlayerConfiguration?.playerStyle;\n const videoCompleteAction = videoPlayerConfiguration?.videoCompleteAction;\n const showShareButton = videoPlayerConfiguration?.showShareButton;\n const showPlaybackButton = videoPlayerConfiguration?.showPlaybackButton;\n const showMuteButton = videoPlayerConfiguration?.showMuteButton;\n const showBranding = videoPlayerConfiguration?.showBranding;\n const ctaDelayType = videoPlayerConfiguration?.ctaDelay?.type;\n const ctaDelayValue = videoPlayerConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n videoPlayerConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n videoPlayerConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = videoPlayerConfiguration?.shareBaseURL;\n const ctaWidth = videoPlayerConfiguration?.ctaWidth;\n const buttonConfiguration = videoPlayerConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.videoPlayerLogoConfiguration\n );\n const countdownTimerConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.countdownTimerConfiguration\n );\n const showVideoDetailTitle = videoPlayerConfiguration?.showVideoDetailTitle;\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\n const replayBadgeVideoFeedConfigurationJsonKey = gennerateJsonKey(\n videoFeedConfiguration?.replayBadge\n );\n const replayBadgeVideoPlayerConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.replayBadgeConfiguration\n );\n const shadowVideoFeedConfigurationJsonKey = gennerateJsonKey(\n videoFeedConfiguration?.shadow\n );\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_mode:${mode}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_titleHidden:${titleHidden}`;\n if (Platform.OS === 'android') {\n key += `_cornerRadius:${cornerRadius}`;\n key += `_titleTextColor:${titleTextColor}`;\n key += `_titleFontSize:${titleFontSize}`;\n key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo?.isCustom}`;\n key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo?.typefaceName}`;\n key += `_titleGradientDrawable.orientation:${titleGradientDrawable?.orientation}`;\n key += `_titleGradientDrawable.colors:${titleGradientDrawable?.colors?.join(\n ','\n )}`;\n key += `_playIconHidden:${playIconHidden}`;\n key += `_playIconWidth:${playIconWidth}`;\n key += `_showAdBadge:${showAdBadge}`;\n }\n\n key += `_titlePosition:${titlePosition}`;\n if (Platform.OS === 'android') {\n key += `_enableAutoplay:${enableAutoplay}`;\n }\n key += `_gridColumns:${gridColumns}`;\n key += `_itemSpacing:${itemSpacing}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${this._generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${this._generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${this._generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${this._generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_replayBadgeVideoFeedConfiguration:${replayBadgeVideoFeedConfigurationJsonKey}`;\n key += `_replayBadgeVideoPlayerConfiguration:${replayBadgeVideoPlayerConfigurationJsonKey}`;\n key += `_shadowVideoFeedConfiguration:${shadowVideoFeedConfigurationJsonKey}`;\n console.log('video feed key', key);\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n enablePictureInPicture={undefined}\n videoFeedConfiguration={videoFeedConfiguration}\n videoPlayerConfiguration={videoPlayerConfiguration}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n onVideoFeedEmpty={this._onVideoFeedEmpty}\n onVideoFeedDidStartPictureInPicture={\n this._onVideoFeedDidStartPictureInPicture\n }\n onVideoFeedDidStopPictureInPicture={\n this._onVideoFeedDidStopPictureInPicture\n }\n onVideoFeedGetFeedId={this._onVideoFeedGetFeedId}\n mode={mode ?? 'row'}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string | undefined {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes;\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _generateButtonInfoString(buttonInfo?: ButtonInfo): string {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n let resultVideoFeedConfiguration = videoFeedConfiguration;\n\n if (\n resultVideoFeedConfiguration.gridColumns &&\n Math.floor(resultVideoFeedConfiguration.gridColumns) !==\n resultVideoFeedConfiguration.gridColumns\n ) {\n const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n gridColumns,\n };\n }\n\n if (\n resultVideoFeedConfiguration.title &&\n resultVideoFeedConfiguration.title.numberOfLines &&\n Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !==\n resultVideoFeedConfiguration.title.numberOfLines\n ) {\n const numberOfLines = Math.floor(\n resultVideoFeedConfiguration.title.numberOfLines\n );\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n title: {\n ...resultVideoFeedConfiguration.title,\n numberOfLines,\n },\n };\n }\n\n return resultVideoFeedConfiguration;\n }\n\n private _getVideoPlayerConfiguration():\n | VideoPlayerNativeConfiguration\n | undefined {\n const { videoPlayerConfiguration, enablePictureInPicture } = this.props;\n\n let resultVideoPlayerConfiguration:\n | VideoPlayerNativeConfiguration\n | undefined = videoPlayerConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultVideoPlayerConfiguration) {\n resultVideoPlayerConfiguration = {};\n }\n resultVideoPlayerConfiguration = {\n ...resultVideoPlayerConfiguration,\n enablePictureInPicture,\n };\n }\n\n return resultVideoPlayerConfiguration;\n }\n}\n\nexport default VideoFeed;\n"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","constructor","props","createRef","FWLoggerUtil","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","UIManager","getViewManagerConfig","Commands","refresh","Platform","OS","toString","reactTag","dispatchViewManagerCommand","event","onVideoFeedLoadFinished","onVideoFeedEmpty","name","reason","action","nativeEvent","error","_loaded","FWNativeErrorAction","loadingFirstPage","onVideoFeedDidStartPictureInPicture","onVideoFeedDidStopPictureInPicture","onVideoFeedGetFeedId","feedId","FWGlobalState","getInstance","componentTypeByFeedIdMap","set","FWComponentType","videoFeed","state","sdkInitCalled","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","playlistGroup","hashtagFilterExpression","productIds","contentId","mode","enablePictureInPicture","adConfiguration","dynamicContentParametersString","_generateDynamicContentParametersString","videoFeedConfiguration","_getVideoFeedConfiguration","cornerRadius","toFixed","titleHidden","title","hidden","titleTextColor","titleFontSize","fontSize","titleNumberOfLines","numberOfLines","titleAndroidFontInfo","titleGradientDrawable","gradientDrawable","titlePosition","playIconHidden","playIcon","playIconWidth","iconWidth","showAdBadge","enableAutoplay","gridColumns","itemSpacing","videoPlayerConfiguration","_getVideoPlayerConfiguration","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","countdownTimerConfigurationJsonKey","countdownTimerConfiguration","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","replayBadgeVideoFeedConfigurationJsonKey","replayBadge","replayBadgeVideoPlayerConfigurationJsonKey","replayBadgeConfiguration","shadowVideoFeedConfigurationJsonKey","shadow","key","join","orientation","colors","_generateButtonInfoString","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","undefined","_onVideoFeedLoadFinished","_onVideoFeedEmpty","_onVideoFeedDidStartPictureInPicture","_onVideoFeedDidStopPictureInPicture","_onVideoFeedGetFeedId","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","buttonInfo","imageName","systemImageName","tintColor","resultVideoFeedConfiguration","Math","floor","resultVideoPlayerConfiguration"],"mappings":";;;;;;;AAAA;;AAEA;;AAUA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAqGA,MAAMA,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAA0E;AACxE;AACF;AACA;AAWEC,EAAAA,WAAW,CAACC,KAAD,EAAyB;AAClC,UAAMA,KAAN;;AADkC,8DANNH,eAAMI,SAAN,EAMM;;AAAA,4CAJY,EAIZ;;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5B,MAAAA;AAA5B,QAAuD,KAAKzF,KAAlE;AAEA,QAAIwL,8BAES,GAAGnE,wBAFhB;;AAGA,QAAI,OAAO5B,sBAAP,KAAkC,SAAtC,EAAiD;AAC/C,UAAI,CAAC+F,8BAAL,EAAqC;AACnCA,QAAAA,8BAA8B,GAAG,EAAjC;AACD;;AACDA,MAAAA,8BAA8B,GAAG,EAC/B,GAAGA,8BAD4B;AAE/B/F,QAAAA;AAF+B,OAAjC;AAID;;AAED,WAAO+F,8BAAP;AACD;;AA3hBuE;;gBAApE5L,S,kBAIkB;AACpB4F,EAAAA,IAAI,EAAE;AADc,C;;eA0hBT5F,S","sourcesContent":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport { FWNativeErrorAction } from '../models/FWNativeErrorAction';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\nimport { FWComponentType } from '../models/FWComponentType';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS.\n * Defaults to discover.\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n * Required when the source is set as hashtagPlaylist.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id. Only supported on iOS.\n */\n contentId?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n /**\n * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onVideoFeedLoadFinished will also be triggered when onVideoFeedEmpty is triggered.\n */\n onVideoFeedEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onVideoFeedGetFeedId?: (feedId: string) => void;\n}\n\ninterface IVideoFeedState {\n sdkInitCalled: boolean;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n private _loaded: boolean = false;\n\n constructor(props: IVideoFeedProps) {\n super(props);\n this.state = {\n sdkInitCalled: FWGlobalState.getInstance().sdkInitCalled,\n };\n }\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `VideoFeed refresh commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n const { onVideoFeedLoadFinished, onVideoFeedEmpty } = this.props;\n\n const { name, reason, action } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n if (Platform.OS === 'android') {\n if (!this._loaded) {\n onVideoFeedLoadFinished(error);\n }\n if (\n action === FWNativeErrorAction.loadingFirstPage ||\n !this._loaded\n ) {\n onVideoFeedEmpty?.(error);\n }\n } else {\n onVideoFeedLoadFinished(error);\n if (!this._loaded) {\n onVideoFeedEmpty?.(error);\n }\n }\n } else {\n if (Platform.OS === 'android') {\n if (!this._loaded) {\n onVideoFeedLoadFinished();\n }\n } else {\n onVideoFeedLoadFinished();\n }\n this._loaded = true;\n }\n }\n };\n\n private _onVideoFeedEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedEmpty } = this.props;\n\n if (onVideoFeedEmpty) {\n onVideoFeedEmpty();\n }\n };\n\n private _onVideoFeedDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStartPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStartPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStartPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStartPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStopPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStopPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStopPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStopPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed onVideoFeedGetFeedId ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedGetFeedId } = this.props;\n\n const { feedId } = event.nativeEvent;\n\n if (feedId) {\n FWGlobalState.getInstance().componentTypeByFeedIdMap.set(\n feedId,\n FWComponentType.videoFeed\n );\n }\n\n if (onVideoFeedGetFeedId) {\n onVideoFeedGetFeedId(feedId ?? '');\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n if (!this.state.sdkInitCalled) {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.setState({ sdkInitCalled: true });\n });\n }\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAppLanguageUpdated);\n }\n\n /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n if (!this.state.sdkInitCalled) {\n return null;\n }\n\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom?.toString();\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n playlistGroup,\n hashtagFilterExpression,\n productIds,\n contentId,\n mode,\n enablePictureInPicture,\n adConfiguration,\n } = this.props;\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const cornerRadius = videoFeedConfiguration?.cornerRadius?.toFixed(5);\n\n const titleHidden = videoFeedConfiguration?.title?.hidden?.toString();\n const titleTextColor = videoFeedConfiguration?.title?.textColor;\n const titleFontSize = videoFeedConfiguration?.title?.fontSize?.toFixed(5);\n const titleNumberOfLines = videoFeedConfiguration?.title?.numberOfLines;\n const titleAndroidFontInfo = videoFeedConfiguration?.title?.androidFontInfo;\n const titleGradientDrawable =\n videoFeedConfiguration?.title?.gradientDrawable;\n const titlePosition = videoFeedConfiguration?.titlePosition;\n const playIconHidden = videoFeedConfiguration?.playIcon?.hidden;\n const playIconWidth =\n videoFeedConfiguration?.playIcon?.iconWidth?.toFixed(5);\n const showAdBadge = videoFeedConfiguration?.showAdBadge?.toString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay;\n const gridColumns = videoFeedConfiguration?.gridColumns;\n const itemSpacing = videoFeedConfiguration?.itemSpacing?.toFixed(5);\n\n const videoPlayerConfiguration = this._getVideoPlayerConfiguration();\n const playerStyle = videoPlayerConfiguration?.playerStyle;\n const videoCompleteAction = videoPlayerConfiguration?.videoCompleteAction;\n const showShareButton = videoPlayerConfiguration?.showShareButton;\n const showPlaybackButton = videoPlayerConfiguration?.showPlaybackButton;\n const showMuteButton = videoPlayerConfiguration?.showMuteButton;\n const showBranding = videoPlayerConfiguration?.showBranding;\n const ctaDelayType = videoPlayerConfiguration?.ctaDelay?.type;\n const ctaDelayValue = videoPlayerConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n videoPlayerConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n videoPlayerConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = videoPlayerConfiguration?.shareBaseURL;\n const ctaWidth = videoPlayerConfiguration?.ctaWidth;\n const buttonConfiguration = videoPlayerConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.videoPlayerLogoConfiguration\n );\n const countdownTimerConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.countdownTimerConfiguration\n );\n const showVideoDetailTitle = videoPlayerConfiguration?.showVideoDetailTitle;\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\n const replayBadgeVideoFeedConfigurationJsonKey = gennerateJsonKey(\n videoFeedConfiguration?.replayBadge\n );\n const replayBadgeVideoPlayerConfigurationJsonKey = gennerateJsonKey(\n videoPlayerConfiguration?.replayBadgeConfiguration\n );\n const shadowVideoFeedConfigurationJsonKey = gennerateJsonKey(\n videoFeedConfiguration?.shadow\n );\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_mode:${mode}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_titleHidden:${titleHidden}`;\n if (Platform.OS === 'android') {\n key += `_cornerRadius:${cornerRadius}`;\n key += `_titleTextColor:${titleTextColor}`;\n key += `_titleFontSize:${titleFontSize}`;\n key += `_titleNumberOfLines:${titleNumberOfLines}`;\n key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo?.isCustom}`;\n key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo?.typefaceName}`;\n key += `_titleGradientDrawable.orientation:${titleGradientDrawable?.orientation}`;\n key += `_titleGradientDrawable.colors:${titleGradientDrawable?.colors?.join(\n ','\n )}`;\n key += `_playIconHidden:${playIconHidden}`;\n key += `_playIconWidth:${playIconWidth}`;\n key += `_showAdBadge:${showAdBadge}`;\n }\n\n key += `_titlePosition:${titlePosition}`;\n if (Platform.OS === 'android') {\n key += `_enableAutoplay:${enableAutoplay}`;\n }\n key += `_gridColumns:${gridColumns}`;\n key += `_itemSpacing:${itemSpacing}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${this._generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${this._generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${this._generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${this._generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_replayBadgeVideoFeedConfiguration:${replayBadgeVideoFeedConfigurationJsonKey}`;\n key += `_replayBadgeVideoPlayerConfiguration:${replayBadgeVideoPlayerConfigurationJsonKey}`;\n key += `_shadowVideoFeedConfiguration:${shadowVideoFeedConfigurationJsonKey}`;\n console.log('video feed key', key);\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n enablePictureInPicture={undefined}\n videoFeedConfiguration={videoFeedConfiguration}\n videoPlayerConfiguration={videoPlayerConfiguration}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n onVideoFeedEmpty={this._onVideoFeedEmpty}\n onVideoFeedDidStartPictureInPicture={\n this._onVideoFeedDidStartPictureInPicture\n }\n onVideoFeedDidStopPictureInPicture={\n this._onVideoFeedDidStopPictureInPicture\n }\n onVideoFeedGetFeedId={this._onVideoFeedGetFeedId}\n mode={mode ?? 'row'}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string | undefined {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes;\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _generateButtonInfoString(buttonInfo?: ButtonInfo): string {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n let resultVideoFeedConfiguration = videoFeedConfiguration;\n\n if (\n resultVideoFeedConfiguration.gridColumns &&\n Math.floor(resultVideoFeedConfiguration.gridColumns) !==\n resultVideoFeedConfiguration.gridColumns\n ) {\n const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n gridColumns,\n };\n }\n\n if (\n resultVideoFeedConfiguration.title &&\n resultVideoFeedConfiguration.title.numberOfLines &&\n Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !==\n resultVideoFeedConfiguration.title.numberOfLines\n ) {\n const numberOfLines = Math.floor(\n resultVideoFeedConfiguration.title.numberOfLines\n );\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n title: {\n ...resultVideoFeedConfiguration.title,\n numberOfLines,\n },\n };\n }\n\n return resultVideoFeedConfiguration;\n }\n\n private _getVideoPlayerConfiguration():\n | VideoPlayerNativeConfiguration\n | undefined {\n const { videoPlayerConfiguration, enablePictureInPicture } = this.props;\n\n let resultVideoPlayerConfiguration:\n | VideoPlayerNativeConfiguration\n | undefined = videoPlayerConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultVideoPlayerConfiguration) {\n resultVideoPlayerConfiguration = {};\n }\n resultVideoPlayerConfiguration = {\n ...resultVideoPlayerConfiguration,\n enablePictureInPicture,\n };\n }\n\n return resultVideoPlayerConfiguration;\n }\n}\n\nexport default VideoFeed;\n"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "FWComponentType", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _FWComponentType.FWComponentType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "FWNavigator", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -65,17 +71,17 @@ Object.defineProperty(exports, "VideoShopping", {
|
|
|
65
71
|
});
|
|
66
72
|
exports.default = void 0;
|
|
67
73
|
|
|
68
|
-
var
|
|
74
|
+
var _StoryBlock = _interopRequireDefault(require("./components/StoryBlock"));
|
|
69
75
|
|
|
70
|
-
var
|
|
76
|
+
var _VideoFeed = _interopRequireDefault(require("./components/VideoFeed"));
|
|
71
77
|
|
|
72
|
-
var
|
|
78
|
+
var _FireworkSDK = _interopRequireDefault(require("./FireworkSDK"));
|
|
73
79
|
|
|
74
|
-
var
|
|
80
|
+
var _FWNavigator = _interopRequireDefault(require("./FWNavigator"));
|
|
75
81
|
|
|
76
|
-
var
|
|
82
|
+
var _LiveStream = _interopRequireDefault(require("./LiveStream"));
|
|
77
83
|
|
|
78
|
-
var
|
|
84
|
+
var _FWComponentType = require("./models/FWComponentType");
|
|
79
85
|
|
|
80
86
|
var _LiveStreamChatEventName = _interopRequireDefault(require("./models/LiveStreamChatEventName"));
|
|
81
87
|
|
|
@@ -85,6 +91,8 @@ var _VideoPlaybackEventName = _interopRequireDefault(require("./models/VideoPlay
|
|
|
85
91
|
|
|
86
92
|
var _VideoFeedUtil = _interopRequireDefault(require("./utils/VideoFeedUtil"));
|
|
87
93
|
|
|
94
|
+
var _VideoShopping = _interopRequireDefault(require("./VideoShopping"));
|
|
95
|
+
|
|
88
96
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
89
97
|
|
|
90
98
|
var _default = _FireworkSDK.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAOA;;AACA;;AAKA;;AAWA;;AAwBA;;AAEA;;AAsCA;;AAgBA;;AASA;;;;eAEeA,oB","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type ButtonInfo from './models/ButtonInfo';\nimport type CountdownTimerConfiguration from './models/CountdownTimerConfiguration';\nimport type { CountdownTimerAppearanceMode } from './models/CountdownTimerConfiguration';\nimport type { DataTrackingLevel } from './models/DataTrackingLevel';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport { FWComponentType } from './models/FWComponentType';\nimport type FWError from './models/FWError';\nimport type {\n ClickProductEvent,\n CustomClickCartIconEvent,\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n CustomTapProductCardEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n PlayerHandler,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\nimport type { RNAppProps } from './models/PushRNContainerParams';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type VideoPlayerButtonConfiguration from './models/VideoPlayerButtonConfiguration';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type { VideoPlayerLivestreamCountdownTimerTheme } from './models/VideoPlayerLivestreamCountdownTimerTheme';\nimport type {\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n} from './models/VideoPlayerLogoConfiguration';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport VideoFeedUtil from './utils/VideoFeedUtil';\nimport type {\n ClickProductCallback,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomTapProductCardCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n ButtonInfo,\n ClickProductCallback,\n ClickProductEvent,\n CountdownTimerAppearanceMode,\n CountdownTimerConfiguration,\n CustomClickCartIconCallback,\n CustomClickCartIconEvent,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomTapProductCardCallback,\n CustomTapProductCardEvent,\n DataTrackingLevel,\n FeedItemDetails,\n FireworkSDK,\n FWComponentType,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n OpenVideoPlayerConfiguration,\n PlayerHandler,\n Product,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n PushRNContainerParams,\n RNAppProps,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoFeedUtil,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerButtonConfiguration,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerLivestreamCountdownTimerTheme,\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FWComponentType = void 0;
|
|
7
|
+
let FWComponentType;
|
|
8
|
+
exports.FWComponentType = FWComponentType;
|
|
9
|
+
|
|
10
|
+
(function (FWComponentType) {
|
|
11
|
+
FWComponentType["videoFeed"] = "videoFeed";
|
|
12
|
+
FWComponentType["storyBlock"] = "storyBlock";
|
|
13
|
+
})(FWComponentType || (exports.FWComponentType = FWComponentType = {}));
|
|
14
|
+
//# sourceMappingURL=FWComponentType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FWComponentType.ts"],"names":["FWComponentType"],"mappings":";;;;;;IAAYA,e;;;WAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;GAAAA,e,+BAAAA,e","sourcesContent":["export enum FWComponentType {\n videoFeed = 'videoFeed',\n storyBlock = 'storyBlock',\n}\n"]}
|
|
@@ -27,5 +27,6 @@ exports.FWEventName = FWEventName;
|
|
|
27
27
|
FWEventName["CustomLinkButtonClick"] = "fw:shopping:custom-link-button-click";
|
|
28
28
|
FWEventName["CustomProductCardTap"] = "fw:shopping:custom-product-card-tap";
|
|
29
29
|
FWEventName["ProductInfoViewConfigurationUpdated"] = "fw:product-info-view-configuration-updated";
|
|
30
|
+
FWEventName["ProductClick"] = "fw:shopping:product-click";
|
|
30
31
|
})(FWEventName || (exports.FWEventName = FWEventName = {}));
|
|
31
32
|
//# sourceMappingURL=FWEventName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n AppLanguageUpdated = 'fw:app-language-updated',\n NativeAppLanguageUpdated = 'fw:native-app-language-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n CustomProductCardTap = 'fw:shopping:custom-product-card-tap',\n ProductInfoViewConfigurationUpdated = 'fw:product-info-view-configuration-updated',\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n AppLanguageUpdated = 'fw:app-language-updated',\n NativeAppLanguageUpdated = 'fw:native-app-language-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n CustomProductCardTap = 'fw:shopping:custom-product-card-tap',\n ProductInfoViewConfigurationUpdated = 'fw:product-info-view-configuration-updated',\n ProductClick = 'fw:shopping:product-click',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR","FireworkSDKModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;
|
|
1
|
+
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR","FireworkSDKModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAOA,MAAMA,iBAAiB,GAAGC,2BAAcC,WAAd,GACtBD,2BAAcC,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AA2BA,MAAMC,6BAA6B,GAAG,IAAIC,+BAAJ,CAAuBR,iBAAvB,CAAtC;;eAEeA,iB","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\nimport type SDKInitOptions from '../models/SDKInitOptions';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport type { DataTrackingLevel } from 'src/models/DataTrackingLevel';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(options?: SDKInitOptions): Promise<any>;\n markInitCalled(): Promise<boolean>;\n openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;\n setVideoFeedClickCallbackEnabled(enabled: boolean): void; // Only supported on iOS\n setCustomCTAClickEnabled(enabled: boolean): void;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language?: string | null): Promise<boolean>;\n pausePlayer(callbackId: number | string): void; // Only supported on iOS\n resumePlayer(callbackId: number | string): void; // Only supported on iOS\n setDataTrackingLevel(level?: DataTrackingLevel): void; // Only supported on iOS\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWGlobalState.ts"],"names":["FWGlobalState","getInstance","_instance","constructor","sdkInitCalledPromise","Promise","resolve","sdkInitCalledResolveFunc","resolveSdkInitCalled","undefined","sdkInitCalled"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["FWGlobalState.ts"],"names":["FWGlobalState","getInstance","_instance","constructor","Map","sdkInitCalledPromise","Promise","resolve","sdkInitCalledResolveFunc","resolveSdkInitCalled","undefined","sdkInitCalled"],"mappings":";;;;;;;;;AAEA,MAAMA,aAAN,CAAoB;AAOA,SAAXC,WAAW,GAAG;AACnB,QAAI,CAACD,aAAa,CAACE,SAAnB,EAA8B;AAC5BF,MAAAA,aAAa,CAACE,SAAd,GAA0B,IAAIF,aAAJ,EAA1B;AACD;;AAED,WAAOA,aAAa,CAACE,SAArB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AAAA,2CAXG,KAWH;;AAAA,sDAVK,IAAIC,GAAJ,EAUL;;AACpB,SAAKC,oBAAL,GAA4B,IAAIC,OAAJ,CAAaC,OAAD,IAAa;AACnD,WAAKC,wBAAL,GAAgCD,OAAhC;AACD,KAF2B,CAA5B;AAGD;;AAEDE,EAAAA,oBAAoB,GAAG;AACrB,QAAI,KAAKD,wBAAT,EAAmC;AACjC;AACA,WAAKA,wBAAL;AACA,WAAKA,wBAAL,GAAgCE,SAAhC;AACD;;AACD,SAAKC,aAAL,GAAqB,IAArB;AACD;;AA5BiB;;gBAAdX,a;;eA+BSA,a","sourcesContent":["import type { FWComponentType } from 'src/models/FWComponentType';\n\nclass FWGlobalState {\n private static _instance?: FWGlobalState;\n private sdkInitCalledResolveFunc?: () => void;\n sdkInitCalledPromise: Promise<void>;\n sdkInitCalled: boolean = false;\n componentTypeByFeedIdMap = new Map<string, FWComponentType>();\n\n static getInstance() {\n if (!FWGlobalState._instance) {\n FWGlobalState._instance = new FWGlobalState();\n }\n\n return FWGlobalState._instance!;\n }\n\n private constructor() {\n this.sdkInitCalledPromise = new Promise((resolve) => {\n this.sdkInitCalledResolveFunc = resolve;\n });\n }\n\n resolveSdkInitCalled() {\n if (this.sdkInitCalledResolveFunc) {\n // only call once\n this.sdkInitCalledResolveFunc();\n this.sdkInitCalledResolveFunc = undefined;\n }\n this.sdkInitCalled = true;\n }\n}\n\nexport default FWGlobalState;\n"]}
|
|
@@ -96,6 +96,18 @@ class FireworkSDK {
|
|
|
96
96
|
return this._appLanguage;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The configuration for data tracking level.
|
|
101
|
+
*/
|
|
102
|
+
get dataTrackingLevel() {
|
|
103
|
+
return this._dataTrackingLevel;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
set dataTrackingLevel(value) {
|
|
107
|
+
this._dataTrackingLevel = value;
|
|
108
|
+
FireworkSDKModule.setDataTrackingLevel(value);
|
|
109
|
+
}
|
|
110
|
+
|
|
99
111
|
/**
|
|
100
112
|
* Defaults to false.
|
|
101
113
|
* You can enable debug logs by setting this property to true.
|
|
@@ -169,6 +181,8 @@ class FireworkSDK {
|
|
|
169
181
|
|
|
170
182
|
_defineProperty(this, "_appLanguage", void 0);
|
|
171
183
|
|
|
184
|
+
_defineProperty(this, "_dataTrackingLevel", 'all');
|
|
185
|
+
|
|
172
186
|
_defineProperty(this, "_videoLaunchBehavior", void 0);
|
|
173
187
|
|
|
174
188
|
_defineProperty(this, "_shopping", VideoShopping.getInstance());
|
|
@@ -177,12 +191,22 @@ class FireworkSDK {
|
|
|
177
191
|
|
|
178
192
|
_defineProperty(this, "_navigator", FWNavigator.getInstance());
|
|
179
193
|
|
|
194
|
+
_defineProperty(this, "hasCalledSDKInitCallback", false);
|
|
195
|
+
|
|
180
196
|
FWLoggerUtil.log('FireworkSDK constructor');
|
|
181
197
|
this.eventEmitter.addListener(FWEventName.SDKInit, event => {
|
|
182
198
|
FWLoggerUtil.log(`Receive SDKInit event ${event === null || event === void 0 ? void 0 : event.error}`);
|
|
183
199
|
|
|
184
|
-
if (
|
|
185
|
-
this.
|
|
200
|
+
if (event && !event.error) {
|
|
201
|
+
this.completeRemainingInitialization();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (!this.hasCalledSDKInitCallback) {
|
|
205
|
+
this.hasCalledSDKInitCallback = true;
|
|
206
|
+
|
|
207
|
+
if (this.onSDKInit && event) {
|
|
208
|
+
this.onSDKInit(event);
|
|
209
|
+
}
|
|
186
210
|
}
|
|
187
211
|
});
|
|
188
212
|
this.eventEmitter.addListener(FWEventName.LogMessage, event => {
|
|
@@ -247,25 +271,34 @@ class FireworkSDK {
|
|
|
247
271
|
}
|
|
248
272
|
|
|
249
273
|
await FireworkSDKModule.init(options);
|
|
250
|
-
await
|
|
251
|
-
await LiveStreamModule.init();
|
|
252
|
-
FWGlobalState.getInstance().resolveSdkInitCalled();
|
|
274
|
+
await this.completeRemainingInitialization();
|
|
253
275
|
}
|
|
254
276
|
/**
|
|
255
277
|
* You only need to call this method when you call init method in native side instead of JS side.
|
|
256
278
|
*/
|
|
257
279
|
|
|
280
|
+
/**
|
|
281
|
+
* You need to call this method when you call init method in native side.
|
|
282
|
+
* @param nativeLazyInit
|
|
283
|
+
* Genenally, you should call naitve init in application(:, didFinishLaunchingWithOptions:) -> Bool on iOS
|
|
284
|
+
* and MainApplication.onCreate on Android. If not, you should pass nativeLazyInit as true.
|
|
285
|
+
*/
|
|
286
|
+
|
|
258
287
|
|
|
259
288
|
async markInitCalled() {
|
|
289
|
+
let nativeLazyInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
260
290
|
FWLoggerUtil.log('Call FireworkSDK markInitCalled method');
|
|
261
|
-
const hasCalledSDKInitFromNative = await FireworkSDKModule.markInitCalled();
|
|
262
291
|
|
|
263
|
-
if (
|
|
264
|
-
await
|
|
265
|
-
await
|
|
266
|
-
}
|
|
292
|
+
if (!nativeLazyInit) {
|
|
293
|
+
await this.completeRemainingInitialization();
|
|
294
|
+
await FireworkSDKModule.markInitCalled();
|
|
295
|
+
} else {
|
|
296
|
+
const hasCalledSDKInit = await FireworkSDKModule.markInitCalled();
|
|
267
297
|
|
|
268
|
-
|
|
298
|
+
if (hasCalledSDKInit) {
|
|
299
|
+
await this.completeRemainingInitialization();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
269
302
|
}
|
|
270
303
|
/**
|
|
271
304
|
* Open Video URL.
|
|
@@ -320,6 +353,16 @@ class FireworkSDK {
|
|
|
320
353
|
|
|
321
354
|
return result;
|
|
322
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Get the component type based on feedId.
|
|
358
|
+
* @param {string} feedId
|
|
359
|
+
* @returns {string | undefined} The component type based on feedId.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
getComponentType(feedId) {
|
|
364
|
+
return FWGlobalState.getInstance().componentTypeByFeedIdMap.get(feedId);
|
|
365
|
+
}
|
|
323
366
|
|
|
324
367
|
updateInternalAppLanguage(language) {
|
|
325
368
|
const valueHasChanged = this._appLanguage !== language;
|
|
@@ -339,6 +382,16 @@ class FireworkSDK {
|
|
|
339
382
|
}
|
|
340
383
|
}
|
|
341
384
|
|
|
385
|
+
async completeRemainingInitialization() {
|
|
386
|
+
if (FWGlobalState.getInstance().sdkInitCalled) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
FWGlobalState.getInstance().resolveSdkInitCalled();
|
|
391
|
+
await ShoppingModule.init();
|
|
392
|
+
await LiveStreamModule.init();
|
|
393
|
+
}
|
|
394
|
+
|
|
342
395
|
}
|
|
343
396
|
|
|
344
397
|
_defineProperty(FireworkSDK, "_instance", void 0);
|