react-native-firework-sdk 2.12.1 → 2.14.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.
Files changed (117) hide show
  1. package/android/.idea/codeStyles/Project.xml +124 -0
  2. package/android/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/android/build.gradle +3 -2
  4. package/android/gradle.properties +4 -3
  5. package/android/src/main/AndroidManifest.xml +14 -0
  6. package/android/src/main/java/com/fireworksdk/bridge/FWInitializationProvider.kt +4 -0
  7. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +1 -2
  8. package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +1 -0
  9. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +1 -0
  10. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +3 -0
  11. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelSerializer.kt +2 -0
  12. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModel.kt +1 -0
  13. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelDeserializer.kt +3 -0
  14. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelSerializer.kt +2 -0
  15. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWDataTrackingLevel.kt +7 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +2 -1
  17. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWSwitchLanguageBehavior.kt +6 -0
  18. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +19 -7
  19. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +2 -0
  20. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -0
  21. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +6 -4
  22. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +26 -0
  23. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +29 -19
  24. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +43 -19
  25. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +25 -13
  26. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +25 -2
  27. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +5 -0
  28. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +57 -15
  29. package/android/src/main/java/com/fireworksdk/bridge/utils/FWModelUtils.kt +16 -8
  30. package/ios/Components/StoryBlock.swift +5 -8
  31. package/ios/Components/VideoFeed.swift +1 -5
  32. package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
  33. package/ios/Models/NativeToRN/FireworkEventName.swift +1 -0
  34. package/ios/Models/NativeToRN/FireworkSDK+Json.swift +6 -2
  35. package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +13 -0
  36. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +8 -16
  37. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +9 -1
  38. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
  39. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +96 -31
  40. package/ios/Modules/Shopping/ShoppingModule.swift +12 -3
  41. package/ios/Utils/Extensions/NumberFormatter+AppLanguage.swift +27 -0
  42. package/lib/commonjs/FireworkSDK.js +66 -12
  43. package/lib/commonjs/FireworkSDK.js.map +1 -1
  44. package/lib/commonjs/VideoShopping.js +15 -0
  45. package/lib/commonjs/VideoShopping.js.map +1 -1
  46. package/lib/commonjs/components/StoryBlock.js +6 -0
  47. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  48. package/lib/commonjs/components/VideoFeed.js +29 -12
  49. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  50. package/lib/commonjs/index.js +14 -6
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/models/DataTrackingLevel.js +2 -0
  53. package/lib/commonjs/models/DataTrackingLevel.js.map +1 -0
  54. package/lib/commonjs/models/FWComponentType.js +14 -0
  55. package/lib/commonjs/models/FWComponentType.js.map +1 -0
  56. package/lib/commonjs/models/FWEventName.js +1 -0
  57. package/lib/commonjs/models/FWEventName.js.map +1 -1
  58. package/lib/commonjs/models/VideoPlayerLivestreamCountdownTimerTheme.js +2 -0
  59. package/lib/commonjs/models/VideoPlayerLivestreamCountdownTimerTheme.js.map +1 -0
  60. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  61. package/lib/commonjs/utils/FWGlobalState.js +2 -0
  62. package/lib/commonjs/utils/FWGlobalState.js.map +1 -1
  63. package/lib/module/FireworkSDK.js +64 -11
  64. package/lib/module/FireworkSDK.js.map +1 -1
  65. package/lib/module/VideoShopping.js +15 -0
  66. package/lib/module/VideoShopping.js.map +1 -1
  67. package/lib/module/components/StoryBlock.js +5 -0
  68. package/lib/module/components/StoryBlock.js.map +1 -1
  69. package/lib/module/components/VideoFeed.js +28 -11
  70. package/lib/module/components/VideoFeed.js.map +1 -1
  71. package/lib/module/index.js +6 -5
  72. package/lib/module/index.js.map +1 -1
  73. package/lib/module/models/DataTrackingLevel.js +2 -0
  74. package/lib/module/models/DataTrackingLevel.js.map +1 -0
  75. package/lib/module/models/FWComponentType.js +7 -0
  76. package/lib/module/models/FWComponentType.js.map +1 -0
  77. package/lib/module/models/FWEventName.js +1 -0
  78. package/lib/module/models/FWEventName.js.map +1 -1
  79. package/lib/module/models/VideoPlayerLivestreamCountdownTimerTheme.js +2 -0
  80. package/lib/module/models/VideoPlayerLivestreamCountdownTimerTheme.js.map +1 -0
  81. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  82. package/lib/module/utils/FWGlobalState.js +2 -0
  83. package/lib/module/utils/FWGlobalState.js.map +1 -1
  84. package/lib/typescript/FireworkSDK.d.ts +22 -1
  85. package/lib/typescript/VideoShopping.d.ts +8 -1
  86. package/lib/typescript/index.d.ts +16 -13
  87. package/lib/typescript/models/DataTrackingLevel.d.ts +1 -0
  88. package/lib/typescript/models/FWComponentType.d.ts +4 -0
  89. package/lib/typescript/models/FWEventName.d.ts +2 -1
  90. package/lib/typescript/models/FWEvents.d.ts +18 -1
  91. package/lib/typescript/models/FeedItemDetails.d.ts +0 -1
  92. package/lib/typescript/models/LiveStreamEventDetails.d.ts +1 -0
  93. package/lib/typescript/models/ReplayBadgeConfiguration.d.ts +1 -1
  94. package/lib/typescript/models/StoryBlockConfiguration.d.ts +0 -2
  95. package/lib/typescript/models/VideoFeedConfiguration.d.ts +0 -1
  96. package/lib/typescript/models/VideoPlayerLivestreamCountdownTimerTheme.d.ts +1 -0
  97. package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -0
  98. package/lib/typescript/utils/FWGlobalState.d.ts +2 -0
  99. package/package.json +1 -1
  100. package/react-native-firework-sdk.podspec +4 -3
  101. package/src/FireworkSDK.ts +59 -14
  102. package/src/VideoShopping.ts +24 -0
  103. package/src/components/StoryBlock.tsx +8 -0
  104. package/src/components/VideoFeed.tsx +24 -7
  105. package/src/index.ts +40 -30
  106. package/src/models/DataTrackingLevel.ts +1 -0
  107. package/src/models/FWComponentType.ts +4 -0
  108. package/src/models/FWEventName.ts +1 -0
  109. package/src/models/FWEvents.ts +19 -1
  110. package/src/models/FeedItemDetails.ts +0 -1
  111. package/src/models/LiveStreamEventDetails.ts +1 -0
  112. package/src/models/ReplayBadgeConfiguration.ts +1 -1
  113. package/src/models/StoryBlockConfiguration.ts +0 -2
  114. package/src/models/VideoFeedConfiguration.ts +0 -1
  115. package/src/models/VideoPlayerLivestreamCountdownTimerTheme.ts +1 -0
  116. package/src/modules/FireworkSDKModule.ts +2 -0
  117. package/src/utils/FWGlobalState.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","onCustomClickLinkButton","_onCustomClickLinkButton","value","ShoppingModule","setCustomClickLinkButtonEnabled","onCustomTapProductCard","_onCustomTapProductCard","setCustomTapProductCardEnabled","cartIconVisible","_cartIconVisible","FWGlobalState","getInstance","sdkInitCalled","setCartIconVisible","sdkInitCalledPromise","then","productInfoViewConfiguration","_productInfoViewConfiguration","valueHasChanged","updateNativeProductInfoViewConfiguration","setProductInfoViewConfiguration","eventEmitter","emit","FWEventName","ProductInfoViewConfigurationUpdated","FWLoggerUtil","log","ShoppingModuleEventEmitter","_instance","constructor","addListener","ShoppingCTAButtonClick","event","productId","unitId","url","handleShoppingCTAEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","productIds","handleUpdateProductDetailsEvent","LogMessage","CustomLinkButtonClick","handleCustomLinkButtonClickEvent","CustomProductCardTap","callbackId","Platform","OS","playerHandler","pause","pausePlayer","resume","resumePlayer","handleCustomProductCardTapEvent","setCartItemCount","count","onShoppingCTA","result","updateShoppingCTAResult","clearCallbackId","onCustomClickCartIcon","onUpdateProductDetails","productList","map","product","length","updateVideoProducts"],"mappings":";;;;;;;AAAA;;AAEA;;AAUA;;AAGA;;AAEA;;;;;;;;;;AAyBA;AACA;AACA;AACA,MAAMA,aAAN,CAAoB;AAGlB;AACF;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACoC,MAAvBC,uBAAuB,GAEpB;AACZ,WAAO,KAAKC,wBAAZ;AACD;;AACiC,MAAvBD,uBAAuB,CAChCE,KADgC,EAEhC;AACA,SAAKD,wBAAL,GAAgCC,KAAhC;;AACAC,4BAAeC,+BAAf,CAA+C,CAAC,CAACF,KAAjD;AACD;;AAGD;AACF;AACA;AACA;AACA;AACA;A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nC,EAAgDjB,UAAhD;AACD;AACF,OAJD,MAIO;AACL,YAAIA,UAAJ,EAAgB;AACd,cAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB7C,oCAAeyD,eAAf,CACEd,UADF,EAEEvB,yBAAYgB,oBAFd;AAID;AACF;AACF;AACF,KAhCD,MAgCO;AACLd,4BAAaC,GAAb,CAAiB,6CAAjB;;AACA,UAAIoB,UAAJ,EAAgB;AACd,YAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB7C,kCAAeyD,eAAf,CACEd,UADF,EAEEvB,yBAAYgB,oBAFd;AAID;AACF;AACF;AACF;;AAE6C,QAAhCK,gCAAgC,CAC5CZ,KAD4C,EAE5C;AACA,QAAI,KAAKhC,uBAAT,EAAkC;AAChC,WAAKA,uBAAL,CAA6BgC,KAA7B;AACD;AACF;;AAE4C,QAA/BsB,+BAA+B,CAC3CtB,KAD2C,EAE3C;AACA,QAAI,KAAK3B,sBAAT,EAAiC;AAC/B,WAAKA,sBAAL,CAA4B2B,KAA5B;AACD;AACF;;AApSiB;;gBAAdjC,a;;eAuSSA,a","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomClickCartIconEvent,\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 = (\n event: CustomClickCartIconEvent\n) => 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 *\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 ShoppingModule.setCustomTapProductCardEnabled(!!value);\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 const valueHasChanged = this._productInfoViewConfiguration !== value;\n this._productInfoViewConfiguration = value;\n if (FWGlobalState.getInstance().sdkInitCalled) {\n this.updateNativeProductInfoViewConfiguration(value, valueHasChanged);\n } else {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.updateNativeProductInfoViewConfiguration(value, valueHasChanged);\n });\n }\n }\n\n private updateNativeProductInfoViewConfiguration(\n value: ProductInfoViewConfiguration | undefined,\n valueHasChanged: Boolean\n ) {\n ShoppingModule.setProductInfoViewConfiguration(value ?? {}).then(() => {\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.ProductInfoViewConfigurationUpdated);\n FWLoggerUtil.log('eventEmitter ProductInfoViewConfigurationUpdated');\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, (event) => {\n FWLoggerUtil.log('Receive ClickCartIcon event');\n this.handleClickCartIconEvent(event);\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 if (event) {\n if (event.callbackId) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n if (Platform.OS === 'ios') {\n event.playerHandler = {\n pause: () => ShoppingModule.pausePlayer(callbackId),\n resume: () => ShoppingModule.resumePlayer(callbackId),\n };\n }\n }\n this.handleCustomProductCardTapEvent(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(event: any) {\n if (this.onCustomClickCartIcon) {\n this.onCustomClickCartIcon(event as CustomClickCartIconEvent);\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"]}
1
+ {"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","onCustomClickLinkButton","_onCustomClickLinkButton","value","ShoppingModule","setCustomClickLinkButtonEnabled","onCustomTapProductCard","_onCustomTapProductCard","setCustomTapProductCardEnabled","cartIconVisible","_cartIconVisible","FWGlobalState","getInstance","sdkInitCalled","setCartIconVisible","sdkInitCalledPromise","then","productInfoViewConfiguration","_productInfoViewConfiguration","valueHasChanged","updateNativeProductInfoViewConfiguration","setProductInfoViewConfiguration","eventEmitter","emit","FWEventName","ProductInfoViewConfigurationUpdated","FWLoggerUtil","log","ShoppingModuleEventEmitter","_instance","constructor","addListener","ShoppingCTAButtonClick","event","productId","unitId","url","handleShoppingCTAEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","productIds","handleUpdateProductDetailsEvent","LogMessage","CustomLinkButtonClick","handleCustomLinkButtonClickEvent","CustomProductCardTap","callbackId","Platform","OS","playerHandler","pause","pausePlayer","resume","resumePlayer","handleCustomProductCardTapEvent","ProductClick","handleProductClickEvent","setCartItemCount","count","onShoppingCTA","result","updateShoppingCTAResult","clearCallbackId","onCustomClickCartIcon","onUpdateProductDetails","productList","map","product","length","updateVideoProducts","onClickProduct"],"mappings":";;;;;;;AAAA;;AAEA;;AAWA;;AAGA;;AAEA;;;;;;;;;;AA6BA;AACA;AACA;AACA,MAAMA,aAAN,CAAoB;AAGlB;AACF;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACoC,MAAvBC,uBAAuB,GAEpB;AACZ,WAAO,KAAKC,wBAAZ;AACD;;AACiC,MAAvBD,uBAAuB,CAChCE,KADgC,EAEhC;AACA,SAAKD,wBAAL,GAAgCC,KAAhC;;AACAC,4BAAeC,+BAAf,CAA+C,CAAC,CAACF,KAAjD;AACD;;AAGD;AACF;AACA;AACA;AACA;AACA;AACmC,MAAtBG,sBAAsB,GAEnB;AACZ,WAAO,KAAKC,uBAAZ;AACD;;AACgC,MAAtBD,sBAAsB,CAC/BH,KAD+B,EAE/B;AACA,SAAKI,uBAAL,GAA+BJ,KAA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,EAAhB,EAAoBG,MACrB,EAHH;;AAMA,UAAIH,WAAJ,EAAiB;AACf,YAAInB,UAAJ,EAAgB;AACd3C,kCAAekE,mBAAf,CAAmCJ,WAAnC,EAAgDnB,UAAhD;AACD;AACF,OAJD,MAIO;AACL,YAAIA,UAAJ,EAAgB;AACd,cAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB7C,oCAAe2D,eAAf,CACEhB,UADF,EAEEvB,yBAAYgB,oBAFd;AAID;AACF;AACF;AACF,KAhCD,MAgCO;AACLd,4BAAaC,GAAb,CAAiB,6CAAjB;;AACA,UAAIoB,UAAJ,EAAgB;AACd,YAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB7C,kCAAe2D,eAAf,CACEhB,UADF,EAEEvB,yBAAYgB,oBAFd;AAID;AACF;AACF;AACF;;AAE6C,QAAhCK,gCAAgC,CAC5CZ,KAD4C,EAE5C;AACA,QAAI,KAAKhC,uBAAT,EAAkC;AAChC,WAAKA,uBAAL,CAA6BgC,KAA7B;AACD;AACF;;AAE4C,QAA/BsB,+BAA+B,CAC3CtB,KAD2C,EAE3C;AACA,QAAI,KAAK3B,sBAAT,EAAiC;AAC/B,WAAKA,sBAAL,CAA4B2B,KAA5B;AACD;AACF;;AAEoC,QAAvBwB,uBAAuB,CAACxB,KAAD,EAA2B;AAC9D,QAAI,KAAKsC,cAAT,EAAyB;AACvB,WAAKA,cAAL,CAAoBtC,KAApB;AACD;AACF;;AAvTiB;;gBAAdjC,a;;eA0TSA,a","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport { FWEventName } from './models/FWEventName';\nimport type {\n ClickProductEvent,\n CustomClickCartIconEvent,\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 = (\n event: CustomClickCartIconEvent\n) => 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\nexport type ClickProductCallback = (\n event: ClickProductEvent\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 *\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 ShoppingModule.setCustomTapProductCardEnabled(!!value);\n }\n private _onCustomTapProductCard?: CustomTapProductCardCallback | undefined;\n\n /**\n * This callback is triggered when the user clicks product card.\n * Only supported on iOS\n */\n public onClickProduct?: ClickProductCallback;\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 const valueHasChanged = this._productInfoViewConfiguration !== value;\n this._productInfoViewConfiguration = value;\n if (FWGlobalState.getInstance().sdkInitCalled) {\n this.updateNativeProductInfoViewConfiguration(value, valueHasChanged);\n } else {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.updateNativeProductInfoViewConfiguration(value, valueHasChanged);\n });\n }\n }\n\n private updateNativeProductInfoViewConfiguration(\n value: ProductInfoViewConfiguration | undefined,\n valueHasChanged: Boolean\n ) {\n ShoppingModule.setProductInfoViewConfiguration(value ?? {}).then(() => {\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.ProductInfoViewConfigurationUpdated);\n FWLoggerUtil.log('eventEmitter ProductInfoViewConfigurationUpdated');\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, (event) => {\n FWLoggerUtil.log('Receive ClickCartIcon event');\n this.handleClickCartIconEvent(event);\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 if (event) {\n if (event.callbackId) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n if (Platform.OS === 'ios') {\n event.playerHandler = {\n pause: () => ShoppingModule.pausePlayer(callbackId),\n resume: () => ShoppingModule.resumePlayer(callbackId),\n };\n }\n }\n this.handleCustomProductCardTapEvent(event);\n }\n });\n\n this.eventEmitter.addListener(FWEventName.ProductClick, (event) => {\n FWLoggerUtil.log(`Receive ProductClick event url: ${event?.url}`);\n if (event) {\n this.handleProductClickEvent(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(event: any) {\n if (this.onCustomClickCartIcon) {\n this.onCustomClickCartIcon(event as CustomClickCartIconEvent);\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 private async handleProductClickEvent(event: ClickProductEvent) {\n if (this.onClickProduct) {\n this.onClickProduct(event);\n }\n }\n}\n\nexport default VideoShopping;\n"]}
@@ -23,6 +23,8 @@ var _FWStoryBlock = _interopRequireDefault(require("./FWStoryBlock"));
23
23
 
24
24
  var _FWJsonUtil = _interopRequireDefault(require("../utils/FWJsonUtil"));
25
25
 
26
+ var _FWComponentType = require("../models/FWComponentType");
27
+
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
29
 
28
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -153,6 +155,10 @@ const StoryBlock = (props, forwardedRef) => {
153
155
  feedId
154
156
  } = event.nativeEvent;
155
157
 
158
+ if (feedId) {
159
+ _FWGlobalState.default.getInstance().componentTypeByFeedIdMap.set(feedId, _FWComponentType.FWComponentType.storyBlock);
160
+ }
161
+
156
162
  if (onStoryBlockGetFeedId) {
157
163
  onStoryBlockGetFeedId(feedId !== null && feedId !== void 0 ? feedId : '');
158
164
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","sdkInitCalled","setSdkInitCalled","FWGlobalState","getInstance","loadedRef","forceUpdate","x","handleStoryBlockLoadFinished","event","FWLoggerUtil","log","nativeEvent","name","onStoryBlockLoadFinished","onStoryBlockEmpty","reason","error","current","handleStoryBlockEmpty","handleStoryBlockDidStartPictureInPicture","JSON","stringify","onStoryBlockDidStartPictureInPicture","handleStoryBlockDidStopPictureInPicture","onStoryBlockDidStopPictureInPicture","handleStoryBlockGetFeedId","onStoryBlockGetFeedId","feedId","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateButtonInfoString","buttonInfo","imageName","systemImageName","tintColor","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","contentId","cornerRadius","dynamicContentParametersString","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","ctaWidth","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","productInfoViewConfigurationJsonKey","shopping","productInfoViewConfiguration","replayBadgeConfigurationJsonKey","replayBadgeConfiguration","countdownTimerConfigurationJsonKey","countdownTimerConfiguration","Platform","OS","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","sendCommand","command","nativeNodeHandle","commandId","UIManager","getViewManagerConfig","Commands","toString","reactTag","dispatchViewManagerCommand","play","pause","openFullscreen","onViewportEntered","onViewportLeft","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","subscriptionOfProductInfoViewConfigurationUpdated","ProductInfoViewConfigurationUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","style","otherProps","assign","borderRadius","undefined"],"mappings":";;;;;;;AACA;;AASA;;AASA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,cAA5B;;AAgHA,MAAMC,UAGL,GAAG,CAACC,KAAD,EAA0BC,YAA1B,KAA2C;AAC7C,QAAMC,kBAAkB,GAAG,mBAAO,IAAP,CAA3B;AACA,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxCC,uBAAcC,WAAd,GAA4BH,aADY,CAA1C;AAGA,QAAMI,SAAS,GAAG,mBAAgB,KAAhB,CAAlB;AACA,QAAM,GAAGC,WAAH,IAAkB,uBAAYC,CAAD,IAAOA,CAAC,GAAG,CAAtB,EAAyB,CAAzB,CAAxB;;AAEA,QAAMC,4BAA4B,GAAIC,KAAD,IAAsC;AACzEC,0BAAaC,GAAb,CACG,2CAA0CF,KAAK,CAACG,WAAN,CAAkBC,IAAK,EADpE;;AAIA,UAAM;AAAEC,MAAAA,wBAAF;AAA4BC,MAAAA;AAA5B,QAAkDjB,KAAxD;AACA,UAAM;AAAEe,MAAAA,IAAF;AAAQG,MAAAA;AAAR,QAAmBP,KAAK,CAACG,WAA/B;;AAEA,QAAIE,wBAAJ,EAA8B;AAC5B,UAAID,IAAJ,EAAU;AACR,YAAII,KAAc,GAAG;AAAEJ,UAAAA;AAAF,SAArB;;AACA,YAAIG,MAAJ,EAAY;AACVC,UAAAA,KAAK,C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D1B,+BAAUK,0BAAV,CACEqB,MADF,EAEE1B,uBAAUC,oBAAV,CACE/H,mBADF,EAEEgI,QAFF,CAEWyB,MAFX,CAEkBxB,QAFlB,EAFF,EAKE,CAACuB,MAAD,CALF;AAOD,OAbS,EAaP,GAbO,CAAV;AAcD;AACF,GAjBD,EAiBG,CAAChH,GAAD,CAjBH;AAmBA,wBAAU,MAAM;AACdjC,2BAAcC,WAAd,GAA4BkJ,oBAA5B,CAAiDC,IAAjD,CAAsD,MAAM;AAC1DrJ,MAAAA,gBAAgB,CAAC,IAAD,CAAhB;AACD,KAFD;AAGD,GAJD,EAIG,EAJH;;AAMA,MAAI,CAACD,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AACD,QAAM;AAAEuJ,IAAAA,KAAF;AAAS1E,IAAAA,YAAT;AAAuB,OAAG2E;AAA1B,MAAyC3J,KAA/C;AACA,sBACE,6BAAC,qBAAD;AACE,IAAA,GAAG,EAAEE,kBADP;AAEE,IAAA,GAAG,EAAEoC;AAFP,KAGMqH,UAHN;AAIE,IAAA,YAAY,EAAE3E,YAJhB;AAKE,IAAA,KAAK,EAAE7C,MAAM,CAACyH,MAAP,CAAc;AAAEC,MAAAA,YAAY,EAAE7E;AAAhB,KAAd,EAA8C0E,KAA9C,CALT;AAME,IAAA,uBAAuB,EAAErG,uBAN3B;AAOE,IAAA,sBAAsB,EAAEyG,SAP1B;AAQE,IAAA,wBAAwB,EAAEpJ,4BAR5B;AASE,IAAA,iBAAiB,EAAEW,qBATrB;AAUE,IAAA,oCAAoC,EAClCC,wCAXJ;AAaE,IAAA,mCAAmC,EACjCI,uCAdJ;AAgBE,IAAA,qBAAqB,EAAEE;AAhBzB,KADF;AAoBD,CA5cD;;4BA8ce,uBAAW7B,UAAX,C","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 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';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\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 * Open the fullscreen story block.\n * Only supported on Android.\n */\n openFullscreen: () => void;\n /**\n * Triggered when the story block enters the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportEntered: () => void;\n /**\n * Triggered when the story block leaves the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportLeft: () => 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.\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.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block. */\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 * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.\n */\n onStoryBlockEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onStoryBlockGetFeedId?: (feedId: string) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const loadedRef = useRef<boolean>(false);\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, onStoryBlockEmpty } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n onStoryBlockLoadFinished(error);\n if (!loadedRef.current) {\n onStoryBlockEmpty?.(error);\n }\n } else {\n onStoryBlockLoadFinished();\n loadedRef.current = true;\n }\n }\n };\n\n const handleStoryBlockEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(`StoryBlock handleStoryBlockEmpty ${event.nativeEvent}`);\n\n const { onStoryBlockEmpty } = props;\n\n if (onStoryBlockEmpty) {\n onStoryBlockEmpty();\n }\n };\n\n const handleStoryBlockDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStartPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStartPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStartPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStartPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStopPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStopPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStopPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStopPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockGetFeedId ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockGetFeedId } = props;\n\n const { feedId } = event.nativeEvent;\n\n if (onStoryBlockGetFeedId) {\n onStoryBlockGetFeedId(feedId ?? '');\n }\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 generateButtonInfoString = (buttonInfo?: ButtonInfo) => {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\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 playerStyle = storyBlockConfiguration?.playerStyle;\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showMuteButton = storyBlockConfiguration?.showMuteButton;\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 buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.videoPlayerLogoConfiguration\n );\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\n const productInfoViewConfigurationJsonKey = gennerateJsonKey(\n FireworkSDK.getInstance().shopping.productInfoViewConfiguration\n );\n const replayBadgeConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.replayBadgeConfiguration\n );\n const countdownTimerConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.countdownTimerConfiguration\n );\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 key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n if (Platform.OS === 'android') {\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n }\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;\n key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;\n key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;\n\n return key;\n };\n\n const key = generateKey();\n\n console.log('story block key', key);\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 let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `StoryBlock sendCommand: ${command} commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n openFullscreen: () => {\n sendCommand('openFullscreen');\n },\n onViewportEntered: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportEntered');\n },\n onViewportLeft: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportLeft');\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 forceUpdate();\n }\n );\n\n const subscriptionOfProductInfoViewConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ProductInfoViewConfigurationUpdated,\n () => {\n FWLoggerUtil.log(\n 'Receive FWEventName.ProductInfoViewConfigurationUpdated'\n );\n forceUpdate();\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n subscriptionOfProductInfoViewConfigurationUpdated.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 if (!viewId) {\n return;\n }\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 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 onStoryBlockEmpty={handleStoryBlockEmpty}\n onStoryBlockDidStartPictureInPicture={\n handleStoryBlockDidStartPictureInPicture\n }\n onStoryBlockDidStopPictureInPicture={\n handleStoryBlockDidStopPictureInPicture\n }\n onStoryBlockGetFeedId={handleStoryBlockGetFeedId}\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
1
+ {"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","sdkInitCalled","setSdkInitCalled","FWGlobalState","getInstance","loadedRef","forceUpdate","x","handleStoryBlockLoadFinished","event","FWLoggerUtil","log","nativeEvent","name","onStoryBlockLoadFinished","onStoryBlockEmpty","reason","error","current","handleStoryBlockEmpty","handleStoryBlockDidStartPictureInPicture","JSON","stringify","onStoryBlockDidStartPictureInPicture","handleStoryBlockDidStopPictureInPicture","onStoryBlockDidStopPictureInPicture","handleStoryBlockGetFeedId","onStoryBlockGetFeedId","feedId","componentTypeByFeedIdMap","set","FWComponentType","storyBlock","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateButtonInfoString","buttonInfo","imageName","systemImageName","tintColor","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","contentId","cornerRadius","dynamicContentParametersString","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","ctaWidth","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","productInfoViewConfigurationJsonKey","shopping","productInfoViewConfiguration","replayBadgeConfigurationJsonKey","replayBadgeConfiguration","countdownTimerConfigurationJsonKey","countdownTimerConfiguration","Platform","OS","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","sendCommand","command","nativeNodeHandle","commandId","UIManager","getViewManagerConfig","Commands","toString","reactTag","dispatchViewManagerCommand","play","pause","openFullscreen","onViewportEntered","onViewportLeft","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","subscriptionOfProductInfoViewConfigurationUpdated","ProductInfoViewConfigurationUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","style","otherProps","assign","borderRadius","undefined"],"mappings":";;;;;;;AACA;;AASA;;AASA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,m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zJ,MAAAA,gBAAgB,CAAC,IAAD,CAAhB;AACD,KAFD;AAGD,GAJD,EAIG,EAJH;;AAMA,MAAI,CAACD,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AACD,QAAM;AAAE2J,IAAAA,KAAF;AAAS1E,IAAAA,YAAT;AAAuB,OAAG2E;AAA1B,MAAyC/J,KAA/C;AACA,sBACE,6BAAC,qBAAD;AACE,IAAA,GAAG,EAAEE,kBADP;AAEE,IAAA,GAAG,EAAEwC;AAFP,KAGMqH,UAHN;AAIE,IAAA,YAAY,EAAE3E,YAJhB;AAKE,IAAA,KAAK,EAAE7C,MAAM,CAACyH,MAAP,CAAc;AAAEC,MAAAA,YAAY,EAAE7E;AAAhB,KAAd,EAA8C0E,KAA9C,CALT;AAME,IAAA,uBAAuB,EAAErG,uBAN3B;AAOE,IAAA,sBAAsB,EAAEyG,SAP1B;AAQE,IAAA,wBAAwB,EAAExJ,4BAR5B;AASE,IAAA,iBAAiB,EAAEW,qBATrB;AAUE,IAAA,oCAAoC,EAClCC,wCAXJ;AAaE,IAAA,mCAAmC,EACjCI,uCAdJ;AAgBE,IAAA,qBAAqB,EAAEE;AAhBzB,KADF;AAoBD,CAndD;;4BAqde,uBAAW7B,UAAX,C","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 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';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\nimport { FWComponentType } from '../models/FWComponentType';\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 * Open the fullscreen story block.\n * Only supported on Android.\n */\n openFullscreen: () => void;\n /**\n * Triggered when the story block enters the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportEntered: () => void;\n /**\n * Triggered when the story block leaves the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportLeft: () => 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.\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.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block. */\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 * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.\n */\n onStoryBlockEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onStoryBlockGetFeedId?: (feedId: string) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const loadedRef = useRef<boolean>(false);\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, onStoryBlockEmpty } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n onStoryBlockLoadFinished(error);\n if (!loadedRef.current) {\n onStoryBlockEmpty?.(error);\n }\n } else {\n onStoryBlockLoadFinished();\n loadedRef.current = true;\n }\n }\n };\n\n const handleStoryBlockEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(`StoryBlock handleStoryBlockEmpty ${event.nativeEvent}`);\n\n const { onStoryBlockEmpty } = props;\n\n if (onStoryBlockEmpty) {\n onStoryBlockEmpty();\n }\n };\n\n const handleStoryBlockDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStartPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStartPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStartPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStartPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStopPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStopPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStopPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStopPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockGetFeedId ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockGetFeedId } = props;\n\n const { feedId } = event.nativeEvent;\n\n if (feedId) {\n FWGlobalState.getInstance().componentTypeByFeedIdMap.set(\n feedId,\n FWComponentType.storyBlock\n );\n }\n\n if (onStoryBlockGetFeedId) {\n onStoryBlockGetFeedId(feedId ?? '');\n }\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 generateButtonInfoString = (buttonInfo?: ButtonInfo) => {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\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 playerStyle = storyBlockConfiguration?.playerStyle;\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showMuteButton = storyBlockConfiguration?.showMuteButton;\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 buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.videoPlayerLogoConfiguration\n );\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\n const productInfoViewConfigurationJsonKey = gennerateJsonKey(\n FireworkSDK.getInstance().shopping.productInfoViewConfiguration\n );\n const replayBadgeConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.replayBadgeConfiguration\n );\n const countdownTimerConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.countdownTimerConfiguration\n );\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 key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n if (Platform.OS === 'android') {\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n }\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;\n key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;\n key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;\n\n return key;\n };\n\n const key = generateKey();\n\n console.log('story block key', key);\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 let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `StoryBlock sendCommand: ${command} commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n openFullscreen: () => {\n sendCommand('openFullscreen');\n },\n onViewportEntered: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportEntered');\n },\n onViewportLeft: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportLeft');\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 forceUpdate();\n }\n );\n\n const subscriptionOfProductInfoViewConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ProductInfoViewConfigurationUpdated,\n () => {\n FWLoggerUtil.log(\n 'Receive FWEventName.ProductInfoViewConfigurationUpdated'\n );\n forceUpdate();\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n subscriptionOfProductInfoViewConfigurationUpdated.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 if (!viewId) {\n return;\n }\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 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 onStoryBlockEmpty={handleStoryBlockEmpty}\n onStoryBlockDidStartPictureInPicture={\n handleStoryBlockDidStartPictureInPicture\n }\n onStoryBlockDidStopPictureInPicture={\n handleStoryBlockDidStopPictureInPicture\n }\n onStoryBlockGetFeedId={handleStoryBlockGetFeedId}\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
@@ -25,6 +25,8 @@ var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
25
25
 
26
26
  var _FWVideoFeed = _interopRequireDefault(require("./FWVideoFeed"));
27
27
 
28
+ var _FWComponentType = require("../models/FWComponentType");
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
30
32
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -62,7 +64,7 @@ class VideoFeed extends _react.default.Component {
62
64
 
63
65
  let reactTag = (0, _reactNative.findNodeHandle)(nativeNodeHandle);
64
66
 
65
- _FWLoggerUtil.default.log(`StoryBlock refresh commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`);
67
+ _FWLoggerUtil.default.log(`VideoFeed refresh commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`);
66
68
 
67
69
  if (!nativeNodeHandle || !reactTag) {
68
70
  return;
@@ -72,8 +74,6 @@ class VideoFeed extends _react.default.Component {
72
74
  });
73
75
 
74
76
  _defineProperty(this, "_onVideoFeedLoadFinished", event => {
75
- _FWLoggerUtil.default.log(`VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`);
76
-
77
77
  const {
78
78
  onVideoFeedLoadFinished,
79
79
  onVideoFeedEmpty
@@ -94,19 +94,30 @@ class VideoFeed extends _react.default.Component {
94
94
  error.reason = reason;
95
95
  }
96
96
 
97
- onVideoFeedLoadFinished(error);
98
-
99
97
  if (_reactNative.Platform.OS === 'android') {
98
+ if (!this._loaded) {
99
+ onVideoFeedLoadFinished(error);
100
+ }
101
+
100
102
  if (action === _FWNativeErrorAction.FWNativeErrorAction.loadingFirstPage || !this._loaded) {
101
103
  onVideoFeedEmpty === null || onVideoFeedEmpty === void 0 ? void 0 : onVideoFeedEmpty(error);
102
104
  }
103
105
  } else {
106
+ onVideoFeedLoadFinished(error);
107
+
104
108
  if (!this._loaded) {
105
109
  onVideoFeedEmpty === null || onVideoFeedEmpty === void 0 ? void 0 : onVideoFeedEmpty(error);
106
110
  }
107
111
  }
108
112
  } else {
109
- onVideoFeedLoadFinished();
113
+ if (_reactNative.Platform.OS === 'android') {
114
+ if (!this._loaded) {
115
+ onVideoFeedLoadFinished();
116
+ }
117
+ } else {
118
+ onVideoFeedLoadFinished();
119
+ }
120
+
110
121
  this._loaded = true;
111
122
  }
112
123
  }
@@ -192,6 +203,10 @@ class VideoFeed extends _react.default.Component {
192
203
  feedId
193
204
  } = event.nativeEvent;
194
205
 
206
+ if (feedId) {
207
+ _FWGlobalState.default.getInstance().componentTypeByFeedIdMap.set(feedId, _FWComponentType.FWComponentType.videoFeed);
208
+ }
209
+
195
210
  if (onVideoFeedGetFeedId) {
196
211
  onVideoFeedGetFeedId(feedId !== null && feedId !== void 0 ? feedId : '');
197
212
  }
@@ -308,14 +323,15 @@ class VideoFeed extends _react.default.Component {
308
323
  const titleHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.title) === null || _videoFeedConfigurati2 === void 0 ? void 0 : (_videoFeedConfigurati3 = _videoFeedConfigurati2.hidden) === null || _videoFeedConfigurati3 === void 0 ? void 0 : _videoFeedConfigurati3.toString();
309
324
  const titleTextColor = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati4 = videoFeedConfiguration.title) === null || _videoFeedConfigurati4 === void 0 ? void 0 : _videoFeedConfigurati4.textColor;
310
325
  const titleFontSize = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati5 = videoFeedConfiguration.title) === null || _videoFeedConfigurati5 === void 0 ? void 0 : (_videoFeedConfigurati6 = _videoFeedConfigurati5.fontSize) === null || _videoFeedConfigurati6 === void 0 ? void 0 : _videoFeedConfigurati6.toFixed(5);
311
- const titleAndroidFontInfo = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati7 = videoFeedConfiguration.title) === null || _videoFeedConfigurati7 === void 0 ? void 0 : _videoFeedConfigurati7.androidFontInfo;
312
- const titleGradientDrawable = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati8 = videoFeedConfiguration.title) === null || _videoFeedConfigurati8 === void 0 ? void 0 : _videoFeedConfigurati8.gradientDrawable;
326
+ const titleNumberOfLines = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati7 = videoFeedConfiguration.title) === null || _videoFeedConfigurati7 === void 0 ? void 0 : _videoFeedConfigurati7.numberOfLines;
327
+ const titleAndroidFontInfo = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati8 = videoFeedConfiguration.title) === null || _videoFeedConfigurati8 === void 0 ? void 0 : _videoFeedConfigurati8.androidFontInfo;
328
+ const titleGradientDrawable = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati9 = videoFeedConfiguration.title) === null || _videoFeedConfigurati9 === void 0 ? void 0 : _videoFeedConfigurati9.gradientDrawable;
313
329
  const titlePosition = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition;
314
- const playIconHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati9 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati9 === void 0 ? void 0 : _videoFeedConfigurati9.hidden;
315
- const playIconWidth = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati10 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati10 === void 0 ? void 0 : (_videoFeedConfigurati11 = _videoFeedConfigurati10.iconWidth) === null || _videoFeedConfigurati11 === void 0 ? void 0 : _videoFeedConfigurati11.toFixed(5);
316
- const showAdBadge = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati12 = videoFeedConfiguration.showAdBadge) === null || _videoFeedConfigurati12 === void 0 ? void 0 : _videoFeedConfigurati12.toString();
330
+ const playIconHidden = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati10 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati10 === void 0 ? void 0 : _videoFeedConfigurati10.hidden;
331
+ const playIconWidth = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati11 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati11 === void 0 ? void 0 : (_videoFeedConfigurati12 = _videoFeedConfigurati11.iconWidth) === null || _videoFeedConfigurati12 === void 0 ? void 0 : _videoFeedConfigurati12.toFixed(5);
332
+ const showAdBadge = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati13 = videoFeedConfiguration.showAdBadge) === null || _videoFeedConfigurati13 === void 0 ? void 0 : _videoFeedConfigurati13.toString();
317
333
  const enableAutoplay = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.enableAutoplay;
318
- const gridColumns = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati13 = videoFeedConfiguration.gridColumns) === null || _videoFeedConfigurati13 === void 0 ? void 0 : _videoFeedConfigurati13.toFixed(5);
334
+ const gridColumns = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.gridColumns;
319
335
  const itemSpacing = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati14 = videoFeedConfiguration.itemSpacing) === null || _videoFeedConfigurati14 === void 0 ? void 0 : _videoFeedConfigurati14.toFixed(5);
320
336
 
321
337
  const videoPlayerConfiguration = this._getVideoPlayerConfiguration();
@@ -378,6 +394,7 @@ class VideoFeed extends _react.default.Component {
378
394
  key += `_cornerRadius:${cornerRadius}`;
379
395
  key += `_titleTextColor:${titleTextColor}`;
380
396
  key += `_titleFontSize:${titleFontSize}`;
397
+ key += `_titleNumberOfLines:${titleNumberOfLines}`;
381
398
  key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : titleAndroidFontInfo.isCustom}`;
382
399
  key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : titleAndroidFontInfo.typefaceName}`;
383
400
  key += `_titleGradientDrawable.orientation:${titleGradientDrawable === null || titleGradientDrawable === void 0 ? void 0 : titleGradientDrawable.orientation}`;