react-native-firework-sdk 2.4.2 → 2.5.0
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/Info.plist +5 -5
- 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_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/_CodeSignature/CodeResources +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +25 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationSerializer.kt +17 -4
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWProductCardCtaButtonTextValue.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWProductCardTheme.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWColorUtil.kt +65 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +7 -8
- package/ios/Components/StoryBlock.swift +4 -1
- package/ios/Components/StoryBlockManager.m +1 -0
- package/ios/Components/VideoFeed.swift +39 -10
- package/ios/Components/VideoFeedManager.m +1 -0
- package/ios/Components/VideoPlayerConfiguration.swift +10 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +6 -6
- package/ios/FireworkVideoUI/Podfile +1 -1
- package/ios/FireworkVideoUI/Podfile.lock +4 -4
- package/ios/Models/Common/ButtonInfo.swift +37 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +1 -0
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +11 -1
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +18 -0
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +4 -4
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +16 -0
- package/ios/Modules/Shopping/ShoppingModule.m +1 -0
- package/ios/Modules/Shopping/ShoppingModule.swift +58 -17
- package/ios/Utils/Extensions/String+Color.swift +53 -27
- package/lib/commonjs/FWNavigator.js +0 -6
- package/lib/commonjs/FWNavigator.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +32 -0
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +2 -0
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +2 -0
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/ButtonInfo.js +2 -0
- package/lib/commonjs/models/ButtonInfo.js.map +1 -0
- package/lib/commonjs/models/FWEventName.js +1 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/VideoPlayerButtonConfiguration.js +2 -0
- package/lib/commonjs/models/VideoPlayerButtonConfiguration.js.map +1 -0
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FWNavigator.js +0 -2
- package/lib/module/FWNavigator.js.map +1 -1
- package/lib/module/VideoShopping.js +31 -0
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +2 -0
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +2 -0
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/ButtonInfo.js +2 -0
- package/lib/module/models/ButtonInfo.js.map +1 -0
- package/lib/module/models/FWEventName.js +1 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/VideoPlayerButtonConfiguration.js +2 -0
- package/lib/module/models/VideoPlayerButtonConfiguration.js.map +1 -0
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/VideoShopping.d.ts +13 -1
- package/lib/typescript/components/StoryBlock.d.ts +4 -0
- package/lib/typescript/components/VideoFeed.d.ts +4 -0
- package/lib/typescript/index.d.ts +3 -3
- package/lib/typescript/models/ButtonInfo.d.ts +18 -0
- package/lib/typescript/models/FWEventName.d.ts +2 -1
- package/lib/typescript/models/FWEvents.d.ts +18 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +16 -0
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerButtonConfiguration.d.ts +39 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +6 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +1 -0
- package/package.json +1 -1
- package/react-native-firework-sdk.podspec +1 -1
- package/src/FWNavigator.ts +0 -2
- package/src/VideoShopping.ts +40 -0
- package/src/components/StoryBlock.tsx +6 -0
- package/src/components/VideoFeed.tsx +6 -0
- package/src/index.ts +8 -0
- package/src/models/ButtonInfo.ts +18 -0
- package/src/models/FWEventName.ts +1 -0
- package/src/models/FWEvents.ts +19 -0
- package/src/models/ProductInfoViewConfiguration.ts +19 -0
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlayerButtonConfiguration.ts +40 -0
- package/src/models/VideoPlayerConfiguration.ts +6 -0
- package/src/modules/ShoppingModule.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoShopping.ts"],"names":["Platform","FWEventName","ShoppingModule","ShoppingModuleEventEmitter","FWLoggerUtil","FWGlobalState","VideoShopping","onCustomClickLinkButton","_onCustomClickLinkButton","value","setCustomClickLinkButtonEnabled","cartIconVisible","_cartIconVisible","getInstance","sdkInitCalled","setCartIconVisible","sdkInitCalledPromise","then","productInfoViewConfiguration","_productInfoViewConfiguration","setProductInfoViewConfiguration","eventEmitter","log","_instance","constructor","addListener","ShoppingCTAButtonClick","event","productId","unitId","url","handleShoppingCTAEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","productIds","handleUpdateProductDetailsEvent","LogMessage","CustomLinkButtonClick","handleCustomLinkButtonClickEvent","setCartItemCount","count","callbackId","onShoppingCTA","result","updateShoppingCTAResult","OS","clearCallbackId","onCustomClickCartIcon","onUpdateProductDetails","productList","map","product","length","updateVideoProducts"],"mappings":";;AAAA,SAA6BA,QAA7B,QAA6C,cAA7C;AAEA,SAASC,WAAT,QAA4B,sBAA5B;AAQA,OAAOC,cAAP,IACEC,0BADF,QAEO,0BAFP;AAGA,OAAOC,YAAP,MAAyB,sBAAzB;AAEA,OAAOC,aAAP,MAA0B,uBAA1B;;AAmBA;AACA;AACA;AACA,MA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;;AA8ON,eAAeA,aAAf","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
|
+
{"version":3,"sources":["VideoShopping.ts"],"names":["Platform","FWEventName","ShoppingModule","ShoppingModuleEventEmitter","FWLoggerUtil","FWGlobalState","VideoShopping","onCustomClickLinkButton","_onCustomClickLinkButton","value","setCustomClickLinkButtonEnabled","onCustomTapProductCard","_onCustomTapProductCard","OS","setCustomTapProductCardEnabled","cartIconVisible","_cartIconVisible","getInstance","sdkInitCalled","setCartIconVisible","sdkInitCalledPromise","then","productInfoViewConfiguration","_productInfoViewConfiguration","setProductInfoViewConfiguration","eventEmitter","log","_instance","constructor","addListener","ShoppingCTAButtonClick","event","productId","unitId","url","handleShoppingCTAEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","productIds","handleUpdateProductDetailsEvent","LogMessage","CustomLinkButtonClick","handleCustomLinkButtonClickEvent","CustomProductCardTap","handleCustomProductCardTapEvent","setCartItemCount","count","callbackId","onShoppingCTA","result","updateShoppingCTAResult","clearCallbackId","onCustomClickCartIcon","onUpdateProductDetails","productList","map","product","length","updateVideoProducts"],"mapp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ACG,+DAA8Da,UAAW,uBACxE,CAACgB,WAAW,IAAI,EAAhB,EAAoBG,MACrB,EAHH;;AAMA,UAAIH,WAAJ,EAAiB;AACf,YAAIP,UAAJ,EAAgB;AACd9C,UAAAA,cAAc,CAACyD,mBAAf,CAAmCJ,WAAnC,EAAgDP,UAAhD;AACD;AACF,OAJD,MAIO;AACL,YAAIA,UAAJ,EAAgB;AACd,cAAIhD,QAAQ,CAACa,EAAT,KAAgB,KAApB,EAA2B;AACzBX,YAAAA,cAAc,CAACkD,eAAf,CACEJ,UADF,EAEE/C,WAAW,CAACqC,oBAFd;AAID;AACF;AACF;AACF,KAhCD,MAgCO;AACLlC,MAAAA,YAAY,CAACsB,GAAb,CAAiB,6CAAjB;;AACA,UAAIsB,UAAJ,EAAgB;AACd,YAAIhD,QAAQ,CAACa,EAAT,KAAgB,KAApB,EAA2B;AACzBX,UAAAA,cAAc,CAACkD,eAAf,CACEJ,UADF,EAEE/C,WAAW,CAACqC,oBAFd;AAID;AACF;AACF;AACF;;AAE6C,QAAhCK,gCAAgC,CAC5CZ,KAD4C,EAE5C;AACA,QAAI,KAAKxB,uBAAT,EAAkC;AAChC,WAAKA,uBAAL,CAA6BwB,KAA7B;AACD;AACF;;AAE4C,QAA/Bc,+BAA+B,CAC3Cd,KAD2C,EAE3C;AACA,QAAI,KAAKpB,sBAAT,EAAiC;AAC/B,WAAKA,sBAAL,CAA4BoB,KAA5B;AACD;AACF;;AA9QiB;;gBAAdzB,a;;AAiRN,eAAeA,aAAf","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomClickLinkButtonEvent,\n CustomTapProductCardEvent,\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\nexport type CustomTapProductCardCallback = (\n event: CustomTapProductCardEvent\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 * This callback is triggered when the user clicks product card.\n * Only supported on iOS.\n *\n * The host app can customize the tap event processing logic of\n * the product card by setting the callback.\n */\n public get onCustomTapProductCard():\n | CustomTapProductCardCallback\n | undefined {\n return this._onCustomTapProductCard;\n }\n public set onCustomTapProductCard(\n value: CustomTapProductCardCallback | undefined\n ) {\n this._onCustomTapProductCard = value;\n if (Platform.OS === 'ios') {\n ShoppingModule.setCustomTapProductCardEnabled(!!value);\n }\n }\n private _onCustomTapProductCard?: CustomTapProductCardCallback | 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 this.eventEmitter.addListener(FWEventName.CustomProductCardTap, (event) => {\n FWLoggerUtil.log(`Receive CustomProductCardTap event url: ${event?.url}`);\n this.handleCustomProductCardTapEvent(event);\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 private async handleCustomProductCardTapEvent(\n event: CustomTapProductCardEvent\n ) {\n if (this.onCustomTapProductCard) {\n this.onCustomTapProductCard(event);\n }\n }\n}\n\nexport default VideoShopping;\n"]}
|
|
@@ -143,6 +143,7 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
143
143
|
playlist,
|
|
144
144
|
hashtagFilterExpression,
|
|
145
145
|
productIds,
|
|
146
|
+
contentId,
|
|
146
147
|
enablePictureInPicture,
|
|
147
148
|
cornerRadius,
|
|
148
149
|
adConfiguration
|
|
@@ -183,6 +184,7 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
183
184
|
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
184
185
|
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
185
186
|
key += `productIds:${productIds === null || productIds === void 0 ? void 0 : productIds.join(',')}`;
|
|
187
|
+
key += `_contentId:${contentId}`;
|
|
186
188
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
187
189
|
key += `_cornerRadius:${cornerRadius}`;
|
|
188
190
|
key += `_shareBaseURL:${shareBaseURL}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StoryBlock.tsx"],"names":["React","forwardRef","useEffect","useImperativeHandle","useReducer","useRef","useState","BackHandler","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWStoryBlock","NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","isFullscreenState","setIsFullscreenState","sdkInitCalled","setSdkInitCalled","getInstance","forceUpdate","x","handleStoryBlockLoadFinished","event","log","nativeEvent","name","onStoryBlockLoadFinished","reason","handleStoryBlockFullScreenStateChanged","isFullScreen","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","cornerRadius","dynamicContentParametersString","videoCompleteAction","showShareButton","showPlaybackButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","requiresAds","adsFetchTimeout","vastAttributesString","OS","sendCommand","command","nativeNodeHandle","current","commandId","getViewManagerConfig","Commands","toString","dispatchViewManagerCommand","play","pause","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","onBackPress","navigator","popNativeContainer","subscription","addEventListener","style","otherProps","assign","borderRadius","undefined"],"mappings":";;AACA,OAAOA,KAAP,IACEC,UADF,EAEEC,SAFF,EAGEC,mBAHF,EAIEC,UAJF,EAKEC,MALF,EAMEC,QANF,QAOO,OAPP;AASA,SACEC,WADF,EAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,MAAMC,mBAAmB,GAAG,cAA5B;;AAsEA,MAAMC,UAGL,GAAG,CAACC,KAAD,EAA0BC,YAA1B,KAA2C;AAC7C,QAAMC,kBAAkB,GAAGhB,MAAM,CAAC,IAAD,CAAjC;AACA,QAAM,CAACiB,iBAAD,EAAoBC,oBAApB,IAA4CjB,QAAQ,CAAU,KAAV,CAA1D;AACA,QAAM,CAACkB,aAAD,EAAgBC,gBAAhB,IAAoCnB,QAAQ,CAChDQ,aAAa,CAACY,WAAd,GAA4BF,aADoB,CAAlD;AAGA,QAAM,GAAGG,WAAH,IAAkBvB,UAAU,CAAEwB,CAAD,IAAOA,CAAC,GAAG,CAAZ,EAAe,CAAf,CAAlC;;AAEA,QAAMC,4BAA4B,GAAIC,KAAD,IAAsC;AACzEf,IAAAA,YAAY,CAACgB,GAAb,CACG,2CAA0CD,KAAK,CAACE,WAAN,CAAkBC,IAAK,E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,CAAhB;AACD,KAFD;AAGD,GAJQ,EAIN,EAJM,CAAT;AAMAvB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIO,QAAQ,CAACyF,EAAT,KAAgB,SAApB,EAA+B;AAC7B,YAAM2B,WAAW,GAAG,MAAM;AACxB,YAAIvG,iBAAJ,EAAuB;AACrBX,UAAAA,WAAW,CAACe,WAAZ,GAA0BoG,SAA1B,CAAoCC,kBAApC;AACA,iBAAO,IAAP;AACD;;AACD,eAAO,KAAP;AACD,OAND;;AAOA,YAAMC,YAAY,GAAGzH,WAAW,CAAC0H,gBAAZ,CACnB,mBADmB,EAEnBJ,WAFmB,CAArB;AAIA,aAAO,MAAM;AACXG,QAAAA,YAAY,CAACT,MAAb;AACD,OAFD;AAGD;;AAED;AACD,GAnBQ,EAmBN,CAACjG,iBAAD,CAnBM,CAAT;;AAqBA,MAAI,CAACE,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AACD,QAAM;AAAE0G,IAAAA,KAAF;AAASlD,IAAAA,YAAT;AAAuB,OAAGmD;AAA1B,MAAyChH,KAA/C;AACA,sBACE,oBAAC,YAAD;AACE,IAAA,GAAG,EAAEE,kBADP;AAEE,IAAA,GAAG,EAAEwB;AAFP,KAGMsF,UAHN;AAIE,IAAA,YAAY,EAAEnD,YAJhB;AAKE,IAAA,KAAK,EAAEtC,MAAM,CAAC0F,MAAP,CAAc;AAAEC,MAAAA,YAAY,EAAErD;AAAhB,KAAd,EAA8CkD,KAA9C,CALT;AAME,IAAA,uBAAuB,EAAE3E,uBAN3B;AAOE,IAAA,sBAAsB,EAAE+E,SAP1B;AAQE,IAAA,wBAAwB,EAAEzG,4BAR5B;AASE,IAAA,kCAAkC,EAChCO;AAVJ,KADF;AAeD,CAvUD;;AAyUA,4BAAenC,UAAU,CAACiB,UAAD,CAAzB","sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n useState,\n} from 'react';\n\nimport {\n BackHandler,\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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type { StoryBlockConfiguration } from '../models/StoryBlockConfiguration';\nimport type StoryBlockNativeConfiguration from '../models/StoryBlockNativeConfiguration';\nimport type { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\n\nconst NativeComponentName = 'FWStoryBlock';\n\nexport interface IStoryBlockMethods {\n /**\n * Play the story block.\n */\n play: () => void;\n /**\n * Pause the story block.\n */\n pause: () => void;\n}\n\n/**\n * The props type of StoryBlock component.\n */\nexport interface IStoryBlockProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of four available story block sources.\n */\n source: StoryBlockSource;\n /**\n * Channel id of the story block. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the story block. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * The dynamic content parameters of the story block. 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 */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * The corner radius of story block.\n */\n cornerRadius?: number;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block.\n Only supported on Android.*/\n storyBlockConfiguration?: StoryBlockConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onStoryBlockLoadFinished?: (error?: FWError) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [isFullscreenState, setIsFullscreenState] = useState<boolean>(false);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`\n );\n\n const { onStoryBlockLoadFinished } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n if (reason) {\n onStoryBlockLoadFinished({ name, reason });\n } else {\n onStoryBlockLoadFinished({ name });\n }\n } else {\n onStoryBlockLoadFinished();\n }\n }\n };\n\n const handleStoryBlockFullScreenStateChanged = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockFullScreenStateChanged ${event.nativeEvent.isFullScreen}`\n );\n const { isFullScreen } = event.nativeEvent;\n setIsFullscreenState(isFullScreen);\n };\n\n const generateDynamicContentParametersString = (): string => {\n const { dynamicContentParameters } = props;\n\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 const generateVastAttributesString = () => {\n const { adConfiguration } = 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 const getStoryBlockConfiguration: () =>\n | StoryBlockNativeConfiguration\n | undefined = () => {\n const { storyBlockConfiguration, enablePictureInPicture } = props;\n let resultStoryBlockConfiguration:\n | StoryBlockNativeConfiguration\n | undefined = storyBlockConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultStoryBlockConfiguration) {\n resultStoryBlockConfiguration = {};\n }\n resultStoryBlockConfiguration = {\n ...resultStoryBlockConfiguration,\n enablePictureInPicture,\n };\n }\n return resultStoryBlockConfiguration;\n };\n const storyBlockConfiguration = getStoryBlockConfiguration();\n\n const generateKey = (): string => {\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;\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n hashtagFilterExpression,\n productIds,\n enablePictureInPicture,\n cornerRadius,\n adConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showBranding = storyBlockConfiguration?.showBranding;\n const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type;\n const ctaDelayValue = storyBlockConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n storyBlockConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = storyBlockConfiguration?.shareBaseURL;\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\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 += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `productIds:${productIds?.join(',')}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_cornerRadius:${cornerRadius}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\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 }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return key;\n };\n\n const key = generateKey();\n\n useImperativeHandle(\n forwardedRef,\n () => {\n const sendCommand = (command: string) => {\n const nativeNodeHandle = findNodeHandle(nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands[command];\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n };\n },\n []\n );\n\n useEffect(() => {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n forceUpdate();\n }\n );\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n if (Platform.OS === 'android') {\n forceUpdate();\n }\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n };\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n setTimeout(() => {\n const viewId = findNodeHandle(nativeComponentRef.current);\n FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);\n UIManager.dispatchViewManagerCommand(\n viewId,\n UIManager.getViewManagerConfig(\n NativeComponentName\n ).Commands.create.toString(),\n [viewId]\n );\n }, 500);\n }\n }, [key]);\n\n useEffect(() => {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n setSdkInitCalled(true);\n });\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const onBackPress = () => {\n if (isFullscreenState) {\n FireworkSDK.getInstance().navigator.popNativeContainer();\n return true;\n }\n return false;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n onBackPress\n );\n return () => {\n subscription.remove();\n };\n }\n\n return;\n }, [isFullscreenState]);\n\n if (!sdkInitCalled) {\n return null;\n }\n const { style, cornerRadius, ...otherProps } = props;\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={key}\n {...otherProps}\n cornerRadius={cornerRadius}\n style={Object.assign({ borderRadius: cornerRadius }, style)}\n storyBlockConfiguration={storyBlockConfiguration}\n enablePictureInPicture={undefined}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockFullScreenStateChanged={\n handleStoryBlockFullScreenStateChanged\n }\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
1
|
+
{"version":3,"sources":["StoryBlock.tsx"],"names":["React","forwardRef","useEffect","useImperativeHandle","useReducer","useRef","useState","BackHandler","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWStoryBlock","NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","isFullscreenState","setIsFullscreenState","sdkInitCalled","setSdkInitCalled","getInstance","forceUpdate","x","handleStoryBlockLoadFinished","event","log","nativeEvent","name","onStoryBlockLoadFinished","reason","handleStoryBlockFullScreenStateChanged","isFullScreen","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","contentId","cornerRadius","dynamicContentParametersString","videoCompleteAction","showShareButton","showPlaybackButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","requiresAds","adsFetchTimeout","vastAttributesString","OS","sendCommand","command","nativeNodeHandle","current","commandId","getViewManagerConfig","Commands","toString","dispatchViewManagerCommand","play","pause","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","onBackPress","navigator","popNativeContainer","subscription","addEventListener","style","otherProps","assign","borderRadius","undefined"],"mappings":";;AACA,OAAOA,KAAP,IACEC,UADF,EAEEC,SAFF,EAGEC,mBAHF,EAIEC,UAJF,EAKEC,MALF,EAMEC,QANF,QAOO,OAPP;AASA,SACEC,WADF,EAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC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AAY,CAACT,MAAb;AACD,OAFD;AAGD;;AAED;AACD,GAnBQ,EAmBN,CAAClG,iBAAD,CAnBM,CAAT;;AAqBA,MAAI,CAACE,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AACD,QAAM;AAAE2G,IAAAA,KAAF;AAASlD,IAAAA,YAAT;AAAuB,OAAGmD;AAA1B,MAAyCjH,KAA/C;AACA,sBACE,oBAAC,YAAD;AACE,IAAA,GAAG,EAAEE,kBADP;AAEE,IAAA,GAAG,EAAEwB;AAFP,KAGMuF,UAHN;AAIE,IAAA,YAAY,EAAEnD,YAJhB;AAKE,IAAA,KAAK,EAAEvC,MAAM,CAAC2F,MAAP,CAAc;AAAEC,MAAAA,YAAY,EAAErD;AAAhB,KAAd,EAA8CkD,KAA9C,CALT;AAME,IAAA,uBAAuB,EAAE5E,uBAN3B;AAOE,IAAA,sBAAsB,EAAEgF,SAP1B;AAQE,IAAA,wBAAwB,EAAE1G,4BAR5B;AASE,IAAA,kCAAkC,EAChCO;AAVJ,KADF;AAeD,CAzUD;;AA2UA,4BAAenC,UAAU,CAACiB,UAAD,CAAzB","sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n useState,\n} from 'react';\n\nimport {\n BackHandler,\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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type { StoryBlockConfiguration } from '../models/StoryBlockConfiguration';\nimport type StoryBlockNativeConfiguration from '../models/StoryBlockNativeConfiguration';\nimport type { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\n\nconst NativeComponentName = 'FWStoryBlock';\n\nexport interface IStoryBlockMethods {\n /**\n * Play the story block.\n */\n play: () => void;\n /**\n * Pause the story block.\n */\n pause: () => void;\n}\n\n/**\n * The props type of StoryBlock component.\n */\nexport interface IStoryBlockProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of four available story block sources.\n */\n source: StoryBlockSource;\n /**\n * Channel id of the story block. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the story block. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * The dynamic content parameters of the story block. 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 */\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 * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * The corner radius of story block.\n */\n cornerRadius?: number;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block.\n Only supported on Android.*/\n storyBlockConfiguration?: StoryBlockConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onStoryBlockLoadFinished?: (error?: FWError) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [isFullscreenState, setIsFullscreenState] = useState<boolean>(false);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`\n );\n\n const { onStoryBlockLoadFinished } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n if (reason) {\n onStoryBlockLoadFinished({ name, reason });\n } else {\n onStoryBlockLoadFinished({ name });\n }\n } else {\n onStoryBlockLoadFinished();\n }\n }\n };\n\n const handleStoryBlockFullScreenStateChanged = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockFullScreenStateChanged ${event.nativeEvent.isFullScreen}`\n );\n const { isFullScreen } = event.nativeEvent;\n setIsFullscreenState(isFullScreen);\n };\n\n const generateDynamicContentParametersString = (): string => {\n const { dynamicContentParameters } = props;\n\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 const generateVastAttributesString = () => {\n const { adConfiguration } = 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 const getStoryBlockConfiguration: () =>\n | StoryBlockNativeConfiguration\n | undefined = () => {\n const { storyBlockConfiguration, enablePictureInPicture } = props;\n let resultStoryBlockConfiguration:\n | StoryBlockNativeConfiguration\n | undefined = storyBlockConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultStoryBlockConfiguration) {\n resultStoryBlockConfiguration = {};\n }\n resultStoryBlockConfiguration = {\n ...resultStoryBlockConfiguration,\n enablePictureInPicture,\n };\n }\n return resultStoryBlockConfiguration;\n };\n const storyBlockConfiguration = getStoryBlockConfiguration();\n\n const generateKey = (): string => {\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;\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n hashtagFilterExpression,\n productIds,\n contentId,\n enablePictureInPicture,\n cornerRadius,\n adConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showBranding = storyBlockConfiguration?.showBranding;\n const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type;\n const ctaDelayValue = storyBlockConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n storyBlockConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = storyBlockConfiguration?.shareBaseURL;\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\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 += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_cornerRadius:${cornerRadius}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\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 }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return key;\n };\n\n const key = generateKey();\n\n useImperativeHandle(\n forwardedRef,\n () => {\n const sendCommand = (command: string) => {\n const nativeNodeHandle = findNodeHandle(nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands[command];\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n };\n },\n []\n );\n\n useEffect(() => {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n forceUpdate();\n }\n );\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n if (Platform.OS === 'android') {\n forceUpdate();\n }\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n };\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n setTimeout(() => {\n const viewId = findNodeHandle(nativeComponentRef.current);\n FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);\n UIManager.dispatchViewManagerCommand(\n viewId,\n UIManager.getViewManagerConfig(\n NativeComponentName\n ).Commands.create.toString(),\n [viewId]\n );\n }, 500);\n }\n }, [key]);\n\n useEffect(() => {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n setSdkInitCalled(true);\n });\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const onBackPress = () => {\n if (isFullscreenState) {\n FireworkSDK.getInstance().navigator.popNativeContainer();\n return true;\n }\n return false;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n onBackPress\n );\n return () => {\n subscription.remove();\n };\n }\n\n return;\n }, [isFullscreenState]);\n\n if (!sdkInitCalled) {\n return null;\n }\n const { style, cornerRadius, ...otherProps } = props;\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={key}\n {...otherProps}\n cornerRadius={cornerRadius}\n style={Object.assign({ borderRadius: cornerRadius }, style)}\n storyBlockConfiguration={storyBlockConfiguration}\n enablePictureInPicture={undefined}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockFullScreenStateChanged={\n handleStoryBlockFullScreenStateChanged\n }\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
@@ -159,6 +159,7 @@ class VideoFeed extends React.Component {
|
|
|
159
159
|
playlistGroup,
|
|
160
160
|
hashtagFilterExpression,
|
|
161
161
|
productIds,
|
|
162
|
+
contentId,
|
|
162
163
|
mode,
|
|
163
164
|
enablePictureInPicture,
|
|
164
165
|
adConfiguration
|
|
@@ -224,6 +225,7 @@ class VideoFeed extends React.Component {
|
|
|
224
225
|
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
225
226
|
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
226
227
|
key += `_productIds:${productIds === null || productIds === void 0 ? void 0 : productIds.join(',')}`;
|
|
228
|
+
key += `_contentId:${contentId}`;
|
|
227
229
|
key += `_mode:${mode}`;
|
|
228
230
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
229
231
|
key += `_titleHidden:${titleHidden}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","constructor","props","createRef","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","state","sdkInitCalled","getInstance","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","playlistGroup","hashtagFilterExpression","productIds","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","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","key","join","orientation","colors","undefined","_onVideoFeedLoadFinished","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","resultVideoFeedConfiguration","Math","floor","numberOfLines","resultVideoPlayerConfiguration"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AA4EA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBX,KAAK,CAACY,SAA9B,CAA0E;AACxE;AACF;AACA;AASEC,EAAAA,WAAW,CAACC,KAAD,EAAyB;AAClC,UAAMA,KAAN;;AADkC,8DAJNd,KAAK,CAACe,SAAN,EAIM;;AAAA,4CAFY,EAEZ;;AAAA,qCAOnB,MAAM;AACrBP,MAAAA,YAAY,CAACQ,GAAb,CAAkB,qBAAoBC,IAAI,CAACC,SAAL,CAAe,KAAKJ,KAApB,CAA2B,EAAjE;AAEA,YAAMK,gBAAgB,GAAGlB,cAAc,CAAC,KAAKmB,mBAAL,CAAyBC,OAA1B,CAAvC;AAEA,UAAIC,SAA0B,GAC5BnB,SAAS,CAACoB,oBAAV,CAA+Bb,mBAA/B,EAAoDc,QAApD,CAA6DC,OAD/D;;AAEA,UAAIvB,QAAQ,CAACwB,EAAT,KAAgB,SAApB,EAA+B;AAC7BJ,QAAAA,SAAS,GAAGA,SAAS,CAACK,QAAV,EAAZ;AACD;;AAEDxB,MAAAA,SAAS,CAACyB,0BAAV,CACE3B,cAAc,CAACkB,gBAAD,CADhB,EAEEG,SAFF,EAGE,EAHF;AAKD,KAvBmC;;AAAA,sDAyBAO,KAAD,IAAsC;AACvErB,MAAAA,YAAY,CAACQ,GAAb,CACG,sCAAqCC,IAAI,CAACC,S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AAE;AADc,C;;AA+XxB,eAAepE,SAAf","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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\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 * 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. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => 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 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\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\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 if (Platform.OS === 'ios') {\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 /**\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 FWLoggerUtil.log(\n `VideoFeed render props ${JSON.stringify(\n this.props\n )} state ${JSON.stringify(this.state)}`\n );\n\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 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\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\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 += `_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 key += `_enableAutoplay:${enableAutoplay}`;\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 }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\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 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 _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":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","constructor","props","createRef","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","state","sdkInitCalled","getInstance","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","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","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","key","join","orientation","colors","undefined","_onVideoFeedLoadFinished","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","resultVideoFeedConfiguration","Math","floor","numberOfLines","resultVideoPlayerConfiguration"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAgFA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBX,KAAK,CAACY,SAA9B,CAA0E;AACxE;AACF;AACA;AASEC,EAAAA,WAAW,CAACC,KAAD,EAAyB;AAClC,UAAMA,KAAN;;AADkC,8DAJNd,KAAK,CAACe,SAAN,EAIM;;AAAA,4CAFY,EAEZ;;AAAA,qCAOnB,MAAM;AACrBP,MAAAA,YAAY,CAACQ,GAAb,CAAkB,qBAAoBC,IAAI,CAACC,SAAL,CAAe,KAAKJ,KAApB,CAA2B,EAAjE;AAEA,YAAMK,gBAAgB,GAAGlB,cAAc,CAAC,KAAKmB,mBAAL,CAAyBC,OAA1B,CAAvC;AAEA,UAAIC,SAA0B,GAC5BnB,S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,4BAAP;AACD;;AAEOnC,EAAAA,4BAA4B,GAEtB;AACZ,UAAM;AAAED,MAAAA,wBAAF;AAA4B1B,MAAAA;AAA5B,QAAuD,KAAKnE,KAAlE;AAEA,QAAIqI,8BAES,GAAGxC,wBAFhB;;AAGA,QAAI,OAAO1B,sBAAP,KAAkC,SAAtC,EAAiD;AAC/C,UAAI,CAACkE,8BAAL,EAAqC;AACnCA,QAAAA,8BAA8B,GAAG,EAAjC;AACD;;AACDA,MAAAA,8BAA8B,GAAG,EAC/B,GAAGA,8BAD4B;AAE/BlE,QAAAA;AAF+B,OAAjC;AAID;;AAED,WAAOkE,8BAAP;AACD;;AAlYuE;;gBAApExI,S,kBAIkB;AACpBqE,EAAAA,IAAI,EAAE;AADc,C;;AAiYxB,eAAerE,SAAf","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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\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. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => 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 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\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\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 if (Platform.OS === 'ios') {\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 /**\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 FWLoggerUtil.log(\n `VideoFeed render props ${JSON.stringify(\n this.props\n )} state ${JSON.stringify(this.state)}`\n );\n\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\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\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 key += `_enableAutoplay:${enableAutoplay}`;\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 }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\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 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 _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/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA0BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA0BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AAiCA,OAAOC,sBAAP,MAAmC,iCAAnC;AAiBA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAYEA,WAZF,EAcEC,WAdF,EAwBEC,UAxBF,EA0BEC,uBA1BF,EA6BEC,mBA7BF,EAoDEN,UApDF,EA2DEC,SA3DF,EAyEEM,sBAzEF,EAkFEC,aAlFF","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 FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\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 ProductCardCTAButtonText,\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 { 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 { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\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 CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomTapProductCardCallback,\n FeedItemDetails,\n FireworkSDK,\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 Product,\n ProductCardConfiguration,\n ProductCardCTAButtonText,\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 VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -18,5 +18,6 @@ export let FWEventName;
|
|
|
18
18
|
FWEventName["NativeAppLanguageUpdated"] = "fw:native-app-language-updated";
|
|
19
19
|
FWEventName["LogMessage"] = "fw:log-message";
|
|
20
20
|
FWEventName["CustomLinkButtonClick"] = "fw:shopping:custom-link-button-click";
|
|
21
|
+
FWEventName["CustomProductCardTap"] = "fw:shopping:custom-product-card-tap";
|
|
21
22
|
})(FWEventName || (FWEventName = {}));
|
|
22
23
|
//# sourceMappingURL=FWEventName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,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,KAAAA,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}\n"]}
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,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,KAAAA,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}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ShoppingModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","ShoppingModule","Proxy","get","Error","ShoppingModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAKA,MAAMC,cAAc,GAAGF,aAAa,CAACE,cAAd,GACnBF,aAAa,CAACE,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;
|
|
1
|
+
{"version":3,"sources":["ShoppingModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","ShoppingModule","Proxy","get","Error","ShoppingModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAKA,MAAMC,cAAc,GAAGF,aAAa,CAACE,cAAd,GACnBF,aAAa,CAACE,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AA0BA,MAAMK,0BAA0B,GAAG,IAAIP,kBAAJ,CAAuBG,cAAvB,CAAnC;AACA,SAASI,0BAAT;AAEA,eAAeJ,cAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type Product from '../models/Product';\nimport type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';\nimport type ShoppingCTAResult from '../models/ShoppingCTAResult';\n\nconst ShoppingModule = NativeModules.ShoppingModule\n ? NativeModules.ShoppingModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IShoppingModule extends NativeModule {\n init(): Promise<any>;\n updateVideoProducts(products: Product[], callbackId: number | string): void;\n updateShoppingCTAResult(\n result: ShoppingCTAResult,\n callbackId: number | string\n ): void;\n setCartIconVisible(visible: boolean): void;\n setCartItemCount(count: number): void;\n clearCallbackId(callbackId: number | string, eventName: string): void; // Only supported on iOS\n setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void;\n setCustomClickLinkButtonEnabled(enabled: boolean): Promise<any>;\n setCustomTapProductCardEnabled(enabled: boolean): Promise<any>; // Only supported on iOS\n}\n\nconst ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);\nexport { ShoppingModuleEventEmitter };\n\nexport default ShoppingModule as IShoppingModule;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomClickLinkButtonEvent, ShoppingCTAEvent, UpdateProductDetailsEvent } from './models/FWEvents';
|
|
1
|
+
import type { CustomClickLinkButtonEvent, CustomTapProductCardEvent, ShoppingCTAEvent, UpdateProductDetailsEvent } from './models/FWEvents';
|
|
2
2
|
import type Product from './models/Product';
|
|
3
3
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
4
4
|
import type ShoppingCTAResult from './models/ShoppingCTAResult';
|
|
@@ -7,6 +7,7 @@ export type CustomClickCartIconCallback = () => Promise<void> | void;
|
|
|
7
7
|
export type UpdateProductDetailsCallbackResult = Product[] | undefined | null;
|
|
8
8
|
export type UpdateProductDetailsCallback = (event: UpdateProductDetailsEvent) => Promise<UpdateProductDetailsCallbackResult> | UpdateProductDetailsCallbackResult;
|
|
9
9
|
export type CustomClickLinkButtonCallback = (event: CustomClickLinkButtonEvent) => Promise<void> | void;
|
|
10
|
+
export type CustomTapProductCardCallback = (event: CustomTapProductCardEvent) => Promise<void> | void;
|
|
10
11
|
/**
|
|
11
12
|
* The entry class of video shopping.
|
|
12
13
|
*/
|
|
@@ -40,6 +41,16 @@ declare class VideoShopping {
|
|
|
40
41
|
get onCustomClickLinkButton(): CustomClickLinkButtonCallback | undefined;
|
|
41
42
|
set onCustomClickLinkButton(value: CustomClickLinkButtonCallback | undefined);
|
|
42
43
|
private _onCustomClickLinkButton?;
|
|
44
|
+
/**
|
|
45
|
+
* This callback is triggered when the user clicks product card.
|
|
46
|
+
* Only supported on iOS.
|
|
47
|
+
*
|
|
48
|
+
* The host app can customize the tap event processing logic of
|
|
49
|
+
* the product card by setting the callback.
|
|
50
|
+
*/
|
|
51
|
+
get onCustomTapProductCard(): CustomTapProductCardCallback | undefined;
|
|
52
|
+
set onCustomTapProductCard(value: CustomTapProductCardCallback | undefined);
|
|
53
|
+
private _onCustomTapProductCard?;
|
|
43
54
|
/**
|
|
44
55
|
* Defaults to true.
|
|
45
56
|
* You can hide the cart icon by setting this property to false.
|
|
@@ -70,5 +81,6 @@ declare class VideoShopping {
|
|
|
70
81
|
private handleClickCartIconEvent;
|
|
71
82
|
private handleUpdateProductDetailsEvent;
|
|
72
83
|
private handleCustomLinkButtonClickEvent;
|
|
84
|
+
private handleCustomProductCardTapEvent;
|
|
73
85
|
}
|
|
74
86
|
export default VideoShopping;
|
|
@@ -51,6 +51,10 @@ export interface IStoryBlockProps {
|
|
|
51
51
|
* Product ids used to generate the sku feed
|
|
52
52
|
*/
|
|
53
53
|
productIds?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* The video or live stream id. Only supported on iOS.
|
|
56
|
+
*/
|
|
57
|
+
contentId?: string;
|
|
54
58
|
/**
|
|
55
59
|
* Specifies if Picture in Picture is enabled. Only supported on iOS.
|
|
56
60
|
*/
|
|
@@ -49,6 +49,10 @@ export interface IVideoFeedProps {
|
|
|
49
49
|
* Product ids used to generate the sku feed
|
|
50
50
|
*/
|
|
51
51
|
productIds?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* The video or live stream id. Only supported on iOS.
|
|
54
|
+
*/
|
|
55
|
+
contentId?: string;
|
|
52
56
|
/**
|
|
53
57
|
* One of three available display modes. Defaults to row.
|
|
54
58
|
*/
|
|
@@ -26,7 +26,7 @@ import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
|
26
26
|
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
27
27
|
import type Product from './models/Product';
|
|
28
28
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
29
|
-
import type { LinkButtonConfiguration, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
|
|
29
|
+
import type { LinkButtonConfiguration, ProductCardConfiguration, ProductCardCTAButtonText, ProductCardTheme, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
|
|
30
30
|
import type ProductUnit from './models/ProductUnit';
|
|
31
31
|
import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
|
|
32
32
|
import type PushRNContainerParams from './models/PushRNContainerParams';
|
|
@@ -49,7 +49,7 @@ import type { VideoPlayerCTADelay, VideoPlayerCTADelayType } from './models/Vide
|
|
|
49
49
|
import type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';
|
|
50
50
|
import type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';
|
|
51
51
|
import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
|
|
52
|
-
import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
52
|
+
import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomTapProductCardCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
53
53
|
import VideoShopping from './VideoShopping';
|
|
54
54
|
export default FireworkSDK;
|
|
55
|
-
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
55
|
+
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductCardConfiguration, ProductCardCTAButtonText, ProductCardTheme, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default interface ButtonInfo {
|
|
2
|
+
/**
|
|
3
|
+
* The name of image in the asset catalogs.
|
|
4
|
+
* For example, you need to add the image in the Images.xcassets(or Assets.xcassets etc.)
|
|
5
|
+
* Only supported on iOS.
|
|
6
|
+
*/
|
|
7
|
+
imageName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The system image name.
|
|
10
|
+
* Only supported on iOS.
|
|
11
|
+
*/
|
|
12
|
+
systemImageName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* This applies only to system image.
|
|
15
|
+
* Only supported on iOS.
|
|
16
|
+
*/
|
|
17
|
+
tintColor?: string;
|
|
18
|
+
}
|