react-native-firework-sdk 1.2.0-beta.6 → 1.2.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +16 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWCustomCTALinkContentContainerActivity.kt +55 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +1 -0
- package/lib/commonjs/FWNavigator.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +2 -2
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/CartContainer.js +1 -1
- package/lib/commonjs/components/CartContainer.js.map +1 -1
- package/lib/commonjs/components/CustomCTALinkContentContainer.js +4 -0
- package/lib/commonjs/components/CustomCTALinkContentContainer.js.map +1 -1
- package/lib/commonjs/components/FWVideoFeed.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/constants/FWErrorMessage.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +2 -2
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/VideoFeedSource.js +0 -4
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -1
- package/lib/module/FWNavigator.js.map +1 -1
- package/lib/module/LiveStream.js +4 -4
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +2 -2
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/CartContainer.js +1 -1
- package/lib/module/components/CartContainer.js.map +1 -1
- package/lib/module/components/CustomCTALinkContentContainer.js +2 -0
- package/lib/module/components/CustomCTALinkContentContainer.js.map +1 -1
- package/lib/module/components/FWVideoFeed.js +1 -1
- package/lib/module/components/FWVideoFeed.js.map +1 -1
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/constants/FWErrorMessage.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +2 -2
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/VideoFeedSource.js +1 -1
- package/lib/module/modules/LiveStreamModule.js.map +1 -1
- package/lib/typescript/LiveStream.d.ts +1 -1
- package/lib/typescript/components/VideoFeed.d.ts +1 -1
- package/lib/typescript/constants/FWErrorMessage.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/models/FWEventName.d.ts +2 -2
- package/lib/typescript/models/FeedItemDetails.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -2
- package/package.json +3 -1
- package/src/FWNavigator.tsx +6 -5
- package/src/LiveStream.ts +9 -7
- package/src/VideoShopping.ts +6 -4
- package/src/components/CartContainer.tsx +1 -1
- package/src/components/CustomCTALinkContentContainer.tsx +2 -0
- package/src/components/FWVideoFeed.tsx +5 -5
- package/src/components/VideoFeed.tsx +1 -1
- package/src/constants/FWErrorMessage.ts +1 -3
- package/src/index.tsx +1 -1
- package/src/models/AdBadgeConfiguration.ts +1 -1
- package/src/models/FWError.ts +1 -1
- package/src/models/FWEventName.ts +2 -2
- package/src/models/FWEvents.ts +1 -1
- package/src/models/FeedItemDetails.ts +2 -2
- package/src/models/LiveStreamEventDetails.ts +1 -1
- package/src/models/LiveStreamMessageDetails.ts +1 -1
- package/src/models/VideoFeedConfiguration.ts +2 -2
- package/src/models/VideoFeedSource.ts +6 -2
- package/src/models/VideoPlayerConfiguration.ts +2 -2
- package/src/modules/LiveStreamModule.ts +1 -5
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
android:name="com.fireworksdk.bridge.reactnative.pages.FWContainerActivity"
|
|
16
16
|
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
|
17
17
|
/>
|
|
18
|
+
<activity
|
|
19
|
+
android:name="com.fireworksdk.bridge.reactnative.pages.FWCustomCTALinkContentContainerActivity"
|
|
20
|
+
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
|
21
|
+
/>
|
|
18
22
|
<provider
|
|
19
23
|
android:authorities="com.fireworksdk.bridge.reactnative"
|
|
20
24
|
android:name=".reactnative.FWInitializationProvider"
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt
CHANGED
|
@@ -10,5 +10,6 @@ interface FireworkSDKInterface {
|
|
|
10
10
|
fun setShareBaseURL(url: String?, promise: Promise)
|
|
11
11
|
fun setAdBadgeConfiguration(config: ReadableMap?, promise: Promise)
|
|
12
12
|
fun setCustomCTAClickEnabled(value: Boolean?)
|
|
13
|
+
fun setCustomCTALinkContentRenderEnabled(value: Boolean?)
|
|
13
14
|
fun setVideoPlaybackEventEnabled(value: Boolean?)
|
|
14
15
|
}
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt
CHANGED
|
@@ -11,7 +11,9 @@ import com.fireworksdk.bridge.utils.*
|
|
|
11
11
|
import org.json.JSONObject
|
|
12
12
|
import com.facebook.react.bridge.ReactMethod
|
|
13
13
|
import com.fireworksdk.bridge.models.FWAdBadgeConfigModel
|
|
14
|
+
import com.fireworksdk.bridge.reactnative.FWInitializationProvider
|
|
14
15
|
import com.fireworksdk.bridge.reactnative.models.FireworkSDKInterface
|
|
16
|
+
import com.fireworksdk.bridge.reactnative.pages.FWCustomCTALinkContentContainerActivity
|
|
15
17
|
import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
16
18
|
import com.loopnow.fireworklibrary.*
|
|
17
19
|
import java.util.*
|
|
@@ -38,6 +40,8 @@ class FireworkSDKModule(
|
|
|
38
40
|
@ReactMethod
|
|
39
41
|
override fun init(userId: String?) {
|
|
40
42
|
initSdk(userId)
|
|
43
|
+
|
|
44
|
+
handleCustomCTAClick()
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
/**
|
|
@@ -98,7 +102,11 @@ class FireworkSDKModule(
|
|
|
98
102
|
@ReactMethod
|
|
99
103
|
override fun setCustomCTAClickEnabled(value: Boolean?) {
|
|
100
104
|
FWVideoPlayerUtils.customCTAClickEnabled = value?:false
|
|
101
|
-
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@ReactMethod
|
|
108
|
+
override fun setCustomCTALinkContentRenderEnabled(value: Boolean?) {
|
|
109
|
+
FWVideoPlayerUtils.customCTALinkContentRenderEnabled = value?:false
|
|
102
110
|
}
|
|
103
111
|
|
|
104
112
|
@ReactMethod
|
|
@@ -171,7 +179,13 @@ class FireworkSDKModule(
|
|
|
171
179
|
FWEventUtils.sendLogMessageEvent(reactApplicationContext, "[Android] Receive CustomCTAClick event ${FWDateUtils.getDateString(Date())}")
|
|
172
180
|
|
|
173
181
|
FWEventUtils.sendCustomCTAClickEvent(reactApplicationContext, actionUrl)
|
|
174
|
-
|
|
182
|
+
|
|
183
|
+
if (FWVideoPlayerUtils.customCTALinkContentRenderEnabled) {
|
|
184
|
+
val activity = FWInitializationProvider.INSTANCE.resumedActivity
|
|
185
|
+
activity?.startActivity(FWCustomCTALinkContentContainerActivity.createIntent(activity, actionUrl))
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return FWVideoPlayerUtils.customCTAClickEnabled || FWVideoPlayerUtils.customCTALinkContentRenderEnabled
|
|
175
189
|
}
|
|
176
190
|
}
|
|
177
191
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.pages
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
7
|
+
import androidx.fragment.app.Fragment
|
|
8
|
+
import com.facebook.react.ReactFragment
|
|
9
|
+
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
10
|
+
import com.fireworksdk.bridge.R
|
|
11
|
+
|
|
12
|
+
class FWCustomCTALinkContentContainerActivity : AppCompatActivity(), DefaultHardwareBackBtnHandler {
|
|
13
|
+
|
|
14
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
15
|
+
super.onCreate(savedInstanceState)
|
|
16
|
+
setContentView(R.layout.fw_bridge_fragment_container)
|
|
17
|
+
|
|
18
|
+
val url = intent.getStringExtra(KEY_URL)
|
|
19
|
+
|
|
20
|
+
val reactNativeFragment: Fragment = ReactFragment.Builder()
|
|
21
|
+
.setComponentName(COMPONENT_NAME)
|
|
22
|
+
.setLaunchOptions(getLaunchOptions(url))
|
|
23
|
+
.build()
|
|
24
|
+
|
|
25
|
+
supportFragmentManager
|
|
26
|
+
.beginTransaction()
|
|
27
|
+
.add(R.id.fw_bridge_container, reactNativeFragment)
|
|
28
|
+
.commit()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private fun getLaunchOptions(url: String?) = Bundle().apply {
|
|
32
|
+
if (!url.isNullOrEmpty()) {
|
|
33
|
+
putString(KEY_URL, url)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
companion object {
|
|
38
|
+
|
|
39
|
+
private const val KEY_URL = "url"
|
|
40
|
+
private const val COMPONENT_NAME = "FWCustomCTALinkContentContainer"
|
|
41
|
+
|
|
42
|
+
fun createIntent(activity: Activity, url: String?): Intent {
|
|
43
|
+
val intent = Intent(activity, FWCustomCTALinkContentContainerActivity::class.java)
|
|
44
|
+
intent.putExtra(KEY_URL, url)
|
|
45
|
+
intent.flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
|
|
46
|
+
activity.overridePendingTransition(0, 0)
|
|
47
|
+
return intent
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun invokeDefaultOnBackPressed() {
|
|
52
|
+
super.onBackPressed();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -16,6 +16,7 @@ import com.loopnow.fireworklibrary.views.VideoFeedView
|
|
|
16
16
|
object FWVideoPlayerUtils {
|
|
17
17
|
|
|
18
18
|
var customCTAClickEnabled: Boolean = false
|
|
19
|
+
var customCTALinkContentRenderEnabled: Boolean = false
|
|
19
20
|
var videoPlaybackEventEnabled: Boolean = false
|
|
20
21
|
|
|
21
22
|
private var hasAssignedLaunchAppWithMute = false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWNavigator","getInstance","_instance","constructor","Map","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","pushNativeContainer","page","FWLoggerUtil","log","_currentCallbackId","callbackId","navigatorPages","set","FWNavigatorModule","popNativeContainer"],"mappings":";;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWNavigator","getInstance","_instance","constructor","Map","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","pushNativeContainer","page","FWLoggerUtil","log","_currentCallbackId","callbackId","navigatorPages","set","FWNavigatorModule","popNativeContainer"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAKS,SAAXC,WAAW,GAAgB;AACvC,QAAI,CAACD,WAAW,CAACE,SAAjB,EAA4B;AAC1BF,MAAAA,WAAW,CAACE,SAAZ,GAAwB,IAAIF,WAAJ,EAAxB;AACD;;AACD,WAAOA,WAAW,CAACE,SAAnB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA,gDAVe,CAUf;;AAAA,4CATE,IAAIC,GAAJ,EASF;;AACpBC,qDAA8BC,WAA9B,CAA0CC,yBAAYC,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSC,EAAAA,mBAAmB,CAACC,IAAD,EAA0C;AAClEC,0BAAaC,GAAb,CAAkB,2BAAlB;;AACA,SAAKC,kBAAL,GAA0B,KAAKA,kBAAL,GAA0B,CAApD;AACA,UAAMC,UAAU,GAAI,GAAE,KAAKD,kBAAmB,EAA9C;AACA,SAAKE,cAAL,CAAoBC,GAApB,CAAwBF,UAAxB,EAAoCJ,IAApC;AACA,WAAOO,2BAAkBR,mBAAlB,CAAsCK,UAAtC,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACSI,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOD,2BAAkBC,kBAAlB,EAAP;AACD;;AAnCe;;gBAAZlB,W;;eAsCSA,W","sourcesContent":["import { FWEventName } from './models/FWEventName';\nimport FWNavigatorModule, {\n FWNavigatorModuleEventEmitter,\n} from './modules/FWNavigatorModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\n/**\n * You can use this class for pushing RN page from the native page.\n */\nclass FWNavigator {\n private static _instance?: FWNavigator;\n private _currentCallbackId: number = 0;\n public navigatorPages = new Map<string, React.ReactNode>();\n\n public static getInstance(): FWNavigator {\n if (!FWNavigator._instance) {\n FWNavigator._instance = new FWNavigator();\n }\n return FWNavigator._instance!;\n }\n\n private constructor() {\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Push RN page from native page. The RN page is embedded in a native container.\n * @param {React.ReactNode} page The RN page.\n * @returns {Promise<boolean>} The result of pushing RN page from native page\n */\n public pushNativeContainer(page: React.ReactNode): Promise<boolean> {\n FWLoggerUtil.log(`Enter pushNativeContainer`);\n this._currentCallbackId = this._currentCallbackId + 1;\n const callbackId = `${this._currentCallbackId}`;\n this.navigatorPages.set(callbackId, page);\n return FWNavigatorModule.pushNativeContainer(callbackId);\n }\n\n /**\n * Pop top-most native container. The native container embed the RN page.\n * @returns {Promise<boolean>} The result of poping top-most native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n}\n\nexport default FWNavigator;\n"]}
|
|
@@ -39,12 +39,12 @@ class LiveStream {
|
|
|
39
39
|
|
|
40
40
|
_defineProperty(this, "onLiveStreamChatEvent", void 0);
|
|
41
41
|
|
|
42
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.
|
|
42
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.LiveStream, event => {
|
|
43
43
|
if (this.onLiveStreamEvent) {
|
|
44
44
|
this.onLiveStreamEvent(event !== null && event !== void 0 ? event : {});
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
this.eventEmitter.addListener(_FWEventName.FWEventName.
|
|
47
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.LiveStreamChat, event => {
|
|
48
48
|
if (this.onLiveStreamChatEvent) {
|
|
49
49
|
this.onLiveStreamChatEvent(event !== null && event !== void 0 ? event : {});
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LiveStream.ts"],"names":["LiveStream","eventEmitter","LiveStreamModuleEventEmitter","getInstance","_instance","constructor","addListener","FWEventName","onLiveStreamEvent","
|
|
1
|
+
{"version":3,"sources":["LiveStream.ts"],"names":["LiveStream","eventEmitter","LiveStreamModuleEventEmitter","getInstance","_instance","constructor","addListener","FWEventName","event","onLiveStreamEvent","LiveStreamChat","onLiveStreamChatEvent"],"mappings":";;;;;;;AACA;;AAEA;;;;AAOA;AACA;AACA;AACA,MAAMA,UAAN,CAAiB;AAGf;AACF;AACA;;AAEE;AACF;AACA;AAG0B,MAAZC,YAAY,GAAuB;AAC7C,WAAOC,8CAAP;AACD;;AAEwB,SAAXC,WAAW,GAAG;AAC1B,QAAI,CAACH,UAAU,CAACI,SAAhB,EAA2B;AACzBJ,MAAAA,UAAU,CAACI,SAAX,GAAuB,IAAIJ,UAAJ,EAAvB;AACD;;AAED,WAAOA,UAAU,CAACI,SAAlB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AACpB,SAAKJ,YAAL,CAAkBK,WAAlB,CAA8BC,yBAAYP,UAA1C,EAAuDQ,KAAD,IAAW;AAC/D,UAAI,KAAKC,iBAAT,EAA4B;AAC1B,aAAKA,iBAAL,CAAuBD,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC;AACD;AACF,KAJD;AAMA,SAAKP,YAAL,CAAkBK,WAAlB,CAA8BC,yBAAYG,cAA1C,EAA2DF,KAAD,IAAW;AACnE,UAAI,KAAKG,qBAAT,EAAgC;AAC9B,aAAKA,qBAAL,CAA2BH,KAA3B,aAA2BA,KAA3B,cAA2BA,KAA3B,GAAoC,EAApC;AACD;AACF,KAJD;AAKD;;AApCc;;gBAAXR,U;;eAuCSA,U","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport { FWEventName } from './models/FWEventName';\nimport type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';\nimport { LiveStreamModuleEventEmitter } from './modules/LiveStreamModule';\n\nexport type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;\nexport type onLiveStreamChatEventCallback = (\n event: LiveStreamChatEvent\n) => void;\n\n/**\n * The entry class of live stream.\n */\nclass LiveStream {\n private static _instance?: LiveStream;\n\n /**\n * The callback of live stream event.\n */\n public onLiveStreamEvent?: onLiveStreamEventCallback;\n /**\n * The callback of live stream chat event.\n */\n public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;\n\n private get eventEmitter(): NativeEventEmitter {\n return LiveStreamModuleEventEmitter;\n }\n\n public static getInstance() {\n if (!LiveStream._instance) {\n LiveStream._instance = new LiveStream();\n }\n\n return LiveStream._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.LiveStream, (event) => {\n if (this.onLiveStreamEvent) {\n this.onLiveStreamEvent(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LiveStreamChat, (event) => {\n if (this.onLiveStreamChatEvent) {\n this.onLiveStreamChatEvent(event ?? {});\n }\n });\n }\n}\n\nexport default LiveStream;\n"]}
|
|
@@ -44,7 +44,7 @@ class VideoShopping {
|
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Defaults to true. You can hide the cart icon by setting this property to false.
|
|
47
|
+
* Defaults to true. You can hide the cart icon by setting this property to false.
|
|
48
48
|
*/
|
|
49
49
|
get cartIconVisible() {
|
|
50
50
|
return this._cartIconVisible;
|
|
@@ -105,7 +105,7 @@ class VideoShopping {
|
|
|
105
105
|
_ShoppingModule.default.exitCartPage();
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
*
|
|
109
109
|
* @param {number} count The number of items in the host app cart
|
|
110
110
|
*/
|
|
111
111
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","cartIconVisible","_cartIconVisible","value","ShoppingModule","setCartIconVisible","eventEmitter","ShoppingModuleEventEmitter","getInstance","_instance","constructor","addListener","FWEventName","AddToCart","event","handleAddToCartEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","handleUpdateProductDetailsEvent","WillDisplayProduct","handleWillDisplayProductEvent","exitCartPage","setCartItemCount","count","onAddToCart","callbackId","result","updateAddToCartStatus","res","tips","onClickCartIcon","cartPage","currentCartPage","jumpToCartPage","onUpdateProductDetails","productList","updateVideoProducts","onWillDisplayProduct","config","updateProductViewConfig"],"mappings":";;;;;;;AAQA;;AAGA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","cartIconVisible","_cartIconVisible","value","ShoppingModule","setCartIconVisible","eventEmitter","ShoppingModuleEventEmitter","getInstance","_instance","constructor","addListener","FWEventName","AddToCart","event","handleAddToCartEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","handleUpdateProductDetailsEvent","WillDisplayProduct","handleWillDisplayProductEvent","exitCartPage","setCartItemCount","count","onAddToCart","callbackId","result","updateAddToCartStatus","res","tips","onClickCartIcon","cartPage","currentCartPage","jumpToCartPage","onUpdateProductDetails","productList","updateVideoProducts","onWillDisplayProduct","config","update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I,KAAKwB,oBAAT,EAA+B;AAC7B,YAAMZ,UAAU,GAAGZ,KAAK,CAACY,UAAzB;AACA,aAAOZ,KAAK,CAACY,UAAb;AACA,YAAMa,MAAM,GAAG,MAAM,KAAKD,oBAAL,CACnBxB,KADmB,CAArB;;AAGA,UAAIyB,MAAJ,EAAY;AACVnC,gCAAeoC,uBAAf,CAAuCD,MAAvC,EAA+Cb,UAA/C;AACD;AACF;AACF;;AApJiB;;gBAAd1B,a;;eAuJSA,a","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\n\nimport type AddToCartResult from './models/AddToCartResult';\nimport type {\n AddToCartEvent,\n UpdateProductDetailsEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport { FWEventName } from './models/FWEventName';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport ShoppingModule, {\n ShoppingModuleEventEmitter,\n} from './modules/ShoppingModule';\n\nexport type AddToCartCallback = (\n event: AddToCartEvent\n) => Promise<AddToCartResult | undefined | null>;\n\nexport type ClickCartIconCallback = () => Promise<\n React.ReactNode | undefined | null\n>;\n\nexport type UpdateProductDetailsCallback = (\n event: UpdateProductDetailsEvent\n) => Promise<Product[] | undefined | null>;\n\nexport type WillDisplayProductCallback = (\n event: WillDisplayProductEvent\n) => Promise<ProductInfoViewConfiguration | undefined | null>;\n\ntype CallbackInfo = { callbackId?: number | string };\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\" button.\n *\n * The host app can return an AddToCartResult object to tell FireworkSDK the result of adding to cart.\n */\n public onAddToCart?: AddToCartCallback;\n\n /**\n * This callback is triggered when the user clicks the shopping cart icon.\n *\n * The host app can return a React.Node to integrate custom cart page to shopping flow.\n */\n public onClickCartIcon?: ClickCartIconCallback;\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 product will be shown.\n *\n * The host app can return a ProductInfoViewConfiguration object to configure \"Add to cart\" button style and cart icon style.\n */\n public onWillDisplayProduct?: WillDisplayProductCallback;\n\n /**\n * Defaults to true. 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 ShoppingModule.setCartIconVisible(value);\n }\n private _cartIconVisible: boolean = true;\n\n public currentCartPage?: React.ReactNode;\n\n private get eventEmitter(): NativeEventEmitter {\n return ShoppingModuleEventEmitter;\n }\n\n public static getInstance() {\n if (!VideoShopping._instance) {\n VideoShopping._instance = new VideoShopping();\n }\n\n return VideoShopping._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.AddToCart, (event) => {\n this.handleAddToCartEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.ClickCartIcon, (event) => {\n this.handleClickCartIconEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.UpdateProductDetails, (event) => {\n this.handleUpdateProductDetailsEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.WillDisplayProduct, (event) => {\n this.handleWillDisplayProductEvent(event);\n });\n }\n\n /**\n * Exit Cart Page.\n *\n * The host app can call this method to exit their cart page.\n */\n public exitCartPage() {\n ShoppingModule.exitCartPage();\n }\n\n /**\n *\n * @param {number} count The number of items in the host app cart\n */\n public setCartItemCount(count: number) {\n ShoppingModule.setCartItemCount(count);\n }\n\n private async handleAddToCartEvent(event: AddToCartEvent & CallbackInfo) {\n if (this.onAddToCart) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const result = await this.onAddToCart(event as AddToCartEvent);\n if (result) {\n ShoppingModule.updateAddToCartStatus(\n result.res,\n result.tips,\n callbackId!\n );\n }\n }\n }\n\n private async handleClickCartIconEvent(event: CallbackInfo) {\n if (this.onClickCartIcon) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const cartPage = await this.onClickCartIcon();\n this.currentCartPage = cartPage;\n\n if (cartPage) {\n ShoppingModule.jumpToCartPage(callbackId!);\n }\n }\n }\n\n private async handleUpdateProductDetailsEvent(\n event: UpdateProductDetailsEvent & CallbackInfo\n ) {\n if (this.onUpdateProductDetails) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const productList = await this.onUpdateProductDetails(\n event as UpdateProductDetailsEvent\n );\n if (productList) {\n ShoppingModule.updateVideoProducts(productList, callbackId!);\n }\n }\n }\n\n private async handleWillDisplayProductEvent(\n event: WillDisplayProductEvent & CallbackInfo\n ) {\n if (this.onWillDisplayProduct) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const config = await this.onWillDisplayProduct(\n event as WillDisplayProductEvent\n );\n if (config) {\n ShoppingModule.updateProductViewConfig(config, callbackId!);\n }\n }\n }\n}\n\nexport default VideoShopping;\n"]}
|
|
@@ -18,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
20
|
const CartContainer = () => {
|
|
21
|
-
const [cartPage
|
|
21
|
+
const [cartPage] = (0, _react.useState)(_VideoShopping.default.getInstance().currentCartPage);
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
23
23
|
style: styles.container
|
|
24
24
|
}, cartPage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["CartContainer.tsx"],"names":["CartContainer","cartPage","
|
|
1
|
+
{"version":3,"sources":["CartContainer.tsx"],"names":["CartContainer","cartPage","VideoShopping","getInstance","currentCartPage","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;;;;;;;AAEA,MAAMA,aAAa,GAAG,MAAM;AAC1B,QAAM,CAACC,QAAD,IAAa,qBACjBC,uBAAcC,WAAd,GAA4BC,eADX,CAAnB;AAGA,sBAAO,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,KAAgCL,QAAhC,CAAP;AACD,CALD;;AAOA,MAAMI,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AACTG,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf;;eAMeT,a","sourcesContent":["import React, { useState } from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport VideoShopping from '../VideoShopping';\n\nconst CartContainer = () => {\n const [cartPage] = useState<React.ReactNode>(\n VideoShopping.getInstance().currentCartPage\n );\n return <View style={styles.container}>{cartPage}</View>;\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n\nexport default CartContainer;\n"]}
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
+
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
13
|
+
|
|
12
14
|
var _FireworkSDK = _interopRequireDefault(require("../FireworkSDK"));
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -18,6 +20,8 @@ const CustomCTALinkContentContainer = _ref => {
|
|
|
18
20
|
url = ''
|
|
19
21
|
} = _ref;
|
|
20
22
|
|
|
23
|
+
_FWLoggerUtil.default.log(`CustomCTALinkContentContainer url: ${url}`);
|
|
24
|
+
|
|
21
25
|
const customCTALinkContentRender = _FireworkSDK.default.getInstance().customCTALinkContentRender;
|
|
22
26
|
|
|
23
27
|
let content = customCTALinkContentRender === null || customCTALinkContentRender === void 0 ? void 0 : customCTALinkContentRender({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["CustomCTALinkContentContainer.tsx"],"names":["CustomCTALinkContentContainer","url","customCTALinkContentRender","FireworkSDK","getInstance","content","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;;;AAMA,MAAMA,6BAA6B,GAAG,QAEK;AAAA,MAFJ;AACrCC,IAAAA,GAAG,GAAG;AAD+B,GAEI;;
|
|
1
|
+
{"version":3,"sources":["CustomCTALinkContentContainer.tsx"],"names":["CustomCTALinkContentContainer","url","FWLoggerUtil","log","customCTALinkContentRender","FireworkSDK","getInstance","content","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;;;AAMA,MAAMA,6BAA6B,GAAG,QAEK;AAAA,MAFJ;AACrCC,IAAAA,GAAG,GAAG;AAD+B,GAEI;;AACzCC,wBAAaC,GAAb,CAAkB,sCAAqCF,GAAI,EAA3D;;AACA,QAAMG,0BAA0B,GAC9BC,qBAAYC,WAAZ,GAA0BF,0BAD5B;;AAEA,MAAIG,OAAO,GAAGH,0BAAH,aAAGA,0BAAH,uBAAGA,0BAA0B,CAAG;AAAEH,IAAAA;AAAF,GAAH,CAAxC;AACA,sBAAO,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEO,MAAM,CAACC;AAApB,KAAgCF,OAAhC,CAAP;AACD,CARD;;eAUeP,6B;;;AAEf,MAAMQ,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AACTG,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\n\nimport FireworkSDK from '../FireworkSDK';\n\nexport interface ICustomCTALinkContentContainerProps {\n url?: string;\n}\n\nconst CustomCTALinkContentContainer = ({\n url = '',\n}: ICustomCTALinkContentContainerProps) => {\n FWLoggerUtil.log(`CustomCTALinkContentContainer url: ${url}`);\n const customCTALinkContentRender =\n FireworkSDK.getInstance().customCTALinkContentRender;\n let content = customCTALinkContentRender?.({ url });\n return <View style={styles.container}>{content}</View>;\n};\n\nexport default CustomCTALinkContentContainer;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWVideoFeed.tsx"],"names":["NativeComponentName","FWVideoFeed","UIManager","getViewManagerConfig","Error","LINKING_ERROR"],"mappings":";;;;;;;AAAA;;AACA;;AACA,MAAMA,mBAAmB,GAAG,aAA5B;AACA,MAAMC,WAAW,GACfC,uBAAUC,oBAAV,CAA+BH,mBAA/B,KAAuD,IAAvD,GACI,yCAA4BA,mBAA5B,CADJ,GAEI,MAAM;
|
|
1
|
+
{"version":3,"sources":["FWVideoFeed.tsx"],"names":["NativeComponentName","FWVideoFeed","UIManager","getViewManagerConfig","Error","LINKING_ERROR"],"mappings":";;;;;;;AAAA;;AACA;;AACA,MAAMA,mBAAmB,GAAG,aAA5B;AACA,MAAMC,WAAW,GACfC,uBAAUC,oBAAV,CAA+BH,mBAA/B,KAAuD,IAAvD,GACI,yCAA4BA,mBAA5B,CADJ,GAEI,MAAM;AACJ,QAAM,IAAII,KAAJ,CAAUC,6BAAV,CAAN;AACD,CALP;eAMeJ,W","sourcesContent":["import { requireNativeComponent, UIManager } from 'react-native';\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nconst NativeComponentName = 'FWVideoFeed';\nconst FWVideoFeed =\n UIManager.getViewManagerConfig(NativeComponentName) != null\n ? requireNativeComponent<any>(NativeComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\nexport default FWVideoFeed;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;;AAuDA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDD,eAAME,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrB,YAAMC,gBAAgB,GAAG,iCAAe,KAAKC,kBAAL,CAAwBC,OAAvC,CAAzB;;AAEAC,6BAAUC,0BAAV,CACE,iCAAeJ,gBAAf,CADF,EAEEG,uBAAUE,oBAAV,CAA+BV,mBAA/B,EAAoDW,QAApD,CAA6DC,OAF/D,EAGE,EAHF;AAKD,KApBqE;;AAAA,sDAuBpEC,KADiC,IAE9B;AACH,YAAM;A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JhC;AAKE,MAAA,IAAI,EAAEnB,IALR;AAME,MAAA,KAAK,EAAEoB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,KAAK3C,KAAL,CAAW4C,KAA7B,EAAoC;AAAEC,QAAAA,MAAM,EAAE,CAAC;AAAX,OAApC;AANT,OADF;AAUD;;AAEON,EAAAA,uCAAuC,GAAW;AACxD,UAAM;AAAEO,MAAAA;AAAF,QAA+B,KAAK9C,KAA1C;;AACA,QAAI,CAAC8C,wBAAL,EAA+B;AAC7B,aAAO,EAAP;AACD;;AAED,QAAIC,YAAY,GAAG,EAAnB;AACA,UAAMC,aAAa,GAAGN,MAAM,CAACO,IAAP,CAAYH,wBAAZ,EAAsCI,IAAtC,EAAtB;;AACA,SAAK,MAAMV,GAAX,IAAkBQ,aAAlB,EAAiC;AAC/B,YAAMjC,KAAK,GAAG+B,wBAAwB,CAACN,GAAD,CAAtC;AACA,YAAMW,WAAW,GAAGpC,KAAK,CAACqC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AA/HqE;;;;gBAAnD/D,S,kBACG;AACpBsC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\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 FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\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"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;;AAuDA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDD,eAAME,SAAN,EALiD;;AAAA,2CA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nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\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 FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWErrorMessage.ts"],"names":["LINKING_ERROR","Platform","select","ios","default"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,oFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF","sourcesContent":["import { Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-firework-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\
|
|
1
|
+
{"version":3,"sources":["FWErrorMessage.ts"],"names":["LINKING_ERROR","Platform","select","ios","default"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,oFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF","sourcesContent":["import { Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-firework-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nexport { LINKING_ERROR };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["AppRegistry","registerComponent","CartContainer","NavigationContainer","CustomCTALinkContentContainer","FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAEA;;AAQA;;AACA;;AAKA;;AAgBA;;AAEA;;AAgBA;;AAcA;;;;AAEAA,yBAAYC,iBAAZ,CAA8B,oBAA9B,EAAoD,MAAMC,sBAA1D;;AACAF,yBAAYC,iBAAZ,CACE,uBADF,EAEE,MAAME,4BAFR;;AAIAH,yBAAYC,iBAAZ,CACE,iCADF,EAEE,MAAMG,sCAFR;;eAKeC,oB","sourcesContent":["import { AppRegistry } from 'react-native';\n\nimport CartContainer from './components/CartContainer';\nimport CustomCTALinkContentContainer from './components/CustomCTALinkContentContainer';\nimport NavigationContainer from './components/NavigationContainer';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n CustomCTALinkContentRender,\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 AddToCartResult from './models/AddToCartResult';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n AddToCartEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n UpdateProductDetailsEvent,\n VideoPlaybackEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type { AddToCartButtonConfiguration } from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice } from './models/ProductUnit';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\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 VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoLaunchBehavior,\n VideoPlayerCompleteAction,\n VideoPlayerCTAStyle,\n VideoPlayerStyle,\n} from './models/VideoPlayerConfiguration';\nimport type {\n AddToCartCallback,\n ClickCartIconCallback,\n UpdateProductDetailsCallback,\n WillDisplayProductCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nAppRegistry.registerComponent('FWShoppingCartPage', () => CartContainer);\nAppRegistry.registerComponent(\n 'FWNavigationContainer',\n () => NavigationContainer\n);\nAppRegistry.registerComponent(\n 'FWCustomCTALinkContentContainer',\n () => CustomCTALinkContentContainer\n);\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AddToCartButtonConfiguration,\n AddToCartCallback,\n AddToCartEvent,\n AddToCartResult,\n ClickCartIconCallback,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomCTALinkContentRender,\n FeedItemDetails,\n FWError,\n FWNavigator,\n IVideoFeedProps,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n SDKInitCallback,\n SDKInitEvent,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTAStyle,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n WillDisplayProductCallback,\n WillDisplayProductEvent,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["AppRegistry","registerComponent","CartContainer","NavigationContainer","CustomCTALinkContentContainer","FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAEA;;AAQA;;AACA;;AAKA;;AAgBA;;AAEA;;AAgBA;;AAcA;;;;AAEAA,yBAAYC,iBAAZ,CAA8B,oBAA9B,EAAoD,MAAMC,sBAA1D;;AACAF,yBAAYC,iBAAZ,CACE,uBADF,EAEE,MAAME,4BAFR;;AAIAH,yBAAYC,iBAAZ,CACE,iCADF,EAEE,MAAMG,sCAFR;;eAKeC,oB","sourcesContent":["import { AppRegistry } from 'react-native';\n\nimport CartContainer from './components/CartContainer';\nimport CustomCTALinkContentContainer from './components/CustomCTALinkContentContainer';\nimport NavigationContainer from './components/NavigationContainer';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n CustomCTALinkContentRender,\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 AddToCartResult from './models/AddToCartResult';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n AddToCartEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n UpdateProductDetailsEvent,\n VideoPlaybackEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type { AddToCartButtonConfiguration } from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice } from './models/ProductUnit';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\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 VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoLaunchBehavior,\n VideoPlayerCompleteAction,\n VideoPlayerCTAStyle,\n VideoPlayerStyle,\n} from './models/VideoPlayerConfiguration';\nimport type {\n AddToCartCallback,\n ClickCartIconCallback,\n UpdateProductDetailsCallback,\n WillDisplayProductCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nAppRegistry.registerComponent('FWShoppingCartPage', () => CartContainer);\nAppRegistry.registerComponent(\n 'FWNavigationContainer',\n () => NavigationContainer\n);\nAppRegistry.registerComponent(\n 'FWCustomCTALinkContentContainer',\n () => CustomCTALinkContentContainer\n);\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AddToCartButtonConfiguration,\n AddToCartCallback,\n AddToCartEvent,\n AddToCartResult,\n ClickCartIconCallback,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomCTALinkContentRender,\n FeedItemDetails,\n FWError,\n FWNavigator,\n IVideoFeedProps,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n SDKInitCallback,\n SDKInitEvent,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTAStyle,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n WillDisplayProductCallback,\n WillDisplayProductEvent,\n};\n"]}
|
|
@@ -16,8 +16,8 @@ exports.FWEventName = FWEventName;
|
|
|
16
16
|
FWEventName["ClickCartIcon"] = "fw:shopping:click-cart-icon";
|
|
17
17
|
FWEventName["UpdateProductDetails"] = "fw:shopping:update-product-details";
|
|
18
18
|
FWEventName["WillDisplayProduct"] = "fw:shopping:will-display-product";
|
|
19
|
-
FWEventName["
|
|
20
|
-
FWEventName["
|
|
19
|
+
FWEventName["LiveStream"] = "fw:livestream";
|
|
20
|
+
FWEventName["LiveStreamChat"] = "fw:livestream-chat";
|
|
21
21
|
FWEventName["ShareBaseURLUpdated"] = "fw:share-base-url-updated";
|
|
22
22
|
FWEventName["AdBadgeConfigurationUpdated"] = "fw:ad-badge-configuration-updated";
|
|
23
23
|
FWEventName["LogMessage"] = "fw:log-message";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n WillDisplayProduct = 'fw:shopping:will-display-product',\n
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n WillDisplayProduct = 'fw:shopping:will-display-product',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n LogMessage = 'fw:log-message',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LiveStreamModule.ts"],"names":["LiveStreamModule","NativeModules","Proxy","get","Error","LINKING_ERROR","LiveStreamModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["LiveStreamModule.ts"],"names":["LiveStreamModule","NativeModules","Proxy","get","Error","LINKING_ERROR","LiveStreamModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA,MAAMA,gBAAgB,GAAGC,2BAAcD,gBAAd,GACrBC,2BAAcD,gBADO,GAErB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAcA,MAAMC,4BAA4B,GAAG,IAAIC,+BAAJ,CAAuBP,gBAAvB,CAArC;;eAGeA,gB","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\n\nconst LiveStreamModule = NativeModules.LiveStreamModule\n ? NativeModules.LiveStreamModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface ILiveStreamModule extends NativeModule {\n init(): void;\n}\nconst LiveStreamModuleEventEmitter = new NativeEventEmitter(LiveStreamModule);\nexport { LiveStreamModuleEventEmitter };\n\nexport default LiveStreamModule as ILiveStreamModule;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWEventName","FWNavigatorModule","FWNavigatorModuleEventEmitter","FWLoggerUtil","FWNavigator","getInstance","_instance","constructor","Map","addListener","LogMessage","pushNativeContainer","page","log","_currentCallbackId","callbackId","navigatorPages","set","popNativeContainer"],"mappings":";;AAAA,SAASA,WAAT,QAA4B,sBAA5B;AACA,OAAOC,iBAAP,
|
|
1
|
+
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWEventName","FWNavigatorModule","FWNavigatorModuleEventEmitter","FWLoggerUtil","FWNavigator","getInstance","_instance","constructor","Map","addListener","LogMessage","pushNativeContainer","page","log","_currentCallbackId","callbackId","navigatorPages","set","popNativeContainer"],"mappings":";;AAAA,SAASA,WAAT,QAA4B,sBAA5B;AACA,OAAOC,iBAAP,IACEC,6BADF,QAEO,6BAFP;AAGA,OAAOC,YAAP,MAAyB,sBAAzB;AAEA;AACA;AACA;;AACA,MAAMC,WAAN,CAAkB;AAKS,SAAXC,WAAW,GAAgB;AACvC,QAAI,CAACD,WAAW,CAACE,SAAjB,EAA4B;AAC1BF,MAAAA,WAAW,CAACE,SAAZ,GAAwB,IAAIF,WAAJ,EAAxB;AACD;;AACD,WAAOA,WAAW,CAACE,SAAnB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA,gDAVe,CAUf;;AAAA,4CATE,IAAIC,GAAJ,EASF;;AACpBN,IAAAA,6BAA6B,CAACO,WAA9B,CAA0CT,WAAW,CAACU,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSC,EAAAA,mBAAmB,CAACC,IAAD,EAA0C;AAClET,IAAAA,YAAY,CAACU,GAAb,CAAkB,2BAAlB;AACA,SAAKC,kBAAL,GAA0B,KAAKA,kBAAL,GAA0B,CAApD;AACA,UAAMC,UAAU,GAAI,GAAE,KAAKD,kBAAmB,EAA9C;AACA,SAAKE,cAAL,CAAoBC,GAApB,CAAwBF,UAAxB,EAAoCH,IAApC;AACA,WAAOX,iBAAiB,CAACU,mBAAlB,CAAsCI,UAAtC,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACSG,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOjB,iBAAiB,CAACiB,kBAAlB,EAAP;AACD;;AAnCe;;gBAAZd,W;;AAsCN,eAAeA,WAAf","sourcesContent":["import { FWEventName } from './models/FWEventName';\nimport FWNavigatorModule, {\n FWNavigatorModuleEventEmitter,\n} from './modules/FWNavigatorModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\n/**\n * You can use this class for pushing RN page from the native page.\n */\nclass FWNavigator {\n private static _instance?: FWNavigator;\n private _currentCallbackId: number = 0;\n public navigatorPages = new Map<string, React.ReactNode>();\n\n public static getInstance(): FWNavigator {\n if (!FWNavigator._instance) {\n FWNavigator._instance = new FWNavigator();\n }\n return FWNavigator._instance!;\n }\n\n private constructor() {\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Push RN page from native page. The RN page is embedded in a native container.\n * @param {React.ReactNode} page The RN page.\n * @returns {Promise<boolean>} The result of pushing RN page from native page\n */\n public pushNativeContainer(page: React.ReactNode): Promise<boolean> {\n FWLoggerUtil.log(`Enter pushNativeContainer`);\n this._currentCallbackId = this._currentCallbackId + 1;\n const callbackId = `${this._currentCallbackId}`;\n this.navigatorPages.set(callbackId, page);\n return FWNavigatorModule.pushNativeContainer(callbackId);\n }\n\n /**\n * Pop top-most native container. The native container embed the RN page.\n * @returns {Promise<boolean>} The result of poping top-most native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n}\n\nexport default FWNavigator;\n"]}
|
package/lib/module/LiveStream.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
import { FWEventName } from
|
|
4
|
-
import { LiveStreamModuleEventEmitter } from
|
|
3
|
+
import { FWEventName } from './models/FWEventName';
|
|
4
|
+
import { LiveStreamModuleEventEmitter } from './modules/LiveStreamModule';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The entry class of live stream.
|
|
@@ -31,12 +31,12 @@ class LiveStream {
|
|
|
31
31
|
|
|
32
32
|
_defineProperty(this, "onLiveStreamChatEvent", void 0);
|
|
33
33
|
|
|
34
|
-
this.eventEmitter.addListener(FWEventName.
|
|
34
|
+
this.eventEmitter.addListener(FWEventName.LiveStream, event => {
|
|
35
35
|
if (this.onLiveStreamEvent) {
|
|
36
36
|
this.onLiveStreamEvent(event !== null && event !== void 0 ? event : {});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
this.eventEmitter.addListener(FWEventName.
|
|
39
|
+
this.eventEmitter.addListener(FWEventName.LiveStreamChat, event => {
|
|
40
40
|
if (this.onLiveStreamChatEvent) {
|
|
41
41
|
this.onLiveStreamChatEvent(event !== null && event !== void 0 ? event : {});
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LiveStream.ts"],"names":["FWEventName","LiveStreamModuleEventEmitter","LiveStream","eventEmitter","getInstance","_instance","constructor","addListener","onLiveStreamEvent","
|
|
1
|
+
{"version":3,"sources":["LiveStream.ts"],"names":["FWEventName","LiveStreamModuleEventEmitter","LiveStream","eventEmitter","getInstance","_instance","constructor","addListener","event","onLiveStreamEvent","LiveStreamChat","onLiveStreamChatEvent"],"mappings":";;AACA,SAASA,WAAT,QAA4B,sBAA5B;AAEA,SAASC,4BAAT,QAA6C,4BAA7C;;AAOA;AACA;AACA;AACA,MAAMC,UAAN,CAAiB;AAGf;AACF;AACA;;AAEE;AACF;AACA;AAG0B,MAAZC,YAAY,GAAuB;AAC7C,WAAOF,4BAAP;AACD;;AAEwB,SAAXG,WAAW,GAAG;AAC1B,QAAI,CAACF,UAAU,CAACG,SAAhB,EAA2B;AACzBH,MAAAA,UAAU,CAACG,SAAX,GAAuB,IAAIH,UAAJ,EAAvB;AACD;;AAED,WAAOA,UAAU,CAACG,SAAlB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AACpB,SAAKH,YAAL,CAAkBI,WAAlB,CAA8BP,WAAW,CAACE,UAA1C,EAAuDM,KAAD,IAAW;AAC/D,UAAI,KAAKC,iBAAT,EAA4B;AAC1B,aAAKA,iBAAL,CAAuBD,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC;AACD;AACF,KAJD;AAMA,SAAKL,YAAL,CAAkBI,WAAlB,CAA8BP,WAAW,CAACU,cAA1C,EAA2DF,KAAD,IAAW;AACnE,UAAI,KAAKG,qBAAT,EAAgC;AAC9B,aAAKA,qBAAL,CAA2BH,KAA3B,aAA2BA,KAA3B,cAA2BA,KAA3B,GAAoC,EAApC;AACD;AACF,KAJD;AAKD;;AApCc;;gBAAXN,U;;AAuCN,eAAeA,UAAf","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport { FWEventName } from './models/FWEventName';\nimport type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';\nimport { LiveStreamModuleEventEmitter } from './modules/LiveStreamModule';\n\nexport type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;\nexport type onLiveStreamChatEventCallback = (\n event: LiveStreamChatEvent\n) => void;\n\n/**\n * The entry class of live stream.\n */\nclass LiveStream {\n private static _instance?: LiveStream;\n\n /**\n * The callback of live stream event.\n */\n public onLiveStreamEvent?: onLiveStreamEventCallback;\n /**\n * The callback of live stream chat event.\n */\n public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;\n\n private get eventEmitter(): NativeEventEmitter {\n return LiveStreamModuleEventEmitter;\n }\n\n public static getInstance() {\n if (!LiveStream._instance) {\n LiveStream._instance = new LiveStream();\n }\n\n return LiveStream._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.LiveStream, (event) => {\n if (this.onLiveStreamEvent) {\n this.onLiveStreamEvent(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LiveStreamChat, (event) => {\n if (this.onLiveStreamChatEvent) {\n this.onLiveStreamChatEvent(event ?? {});\n }\n });\n }\n}\n\nexport default LiveStream;\n"]}
|
|
@@ -32,7 +32,7 @@ class VideoShopping {
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Defaults to true. You can hide the cart icon by setting this property to false.
|
|
35
|
+
* Defaults to true. You can hide the cart icon by setting this property to false.
|
|
36
36
|
*/
|
|
37
37
|
get cartIconVisible() {
|
|
38
38
|
return this._cartIconVisible;
|
|
@@ -92,7 +92,7 @@ class VideoShopping {
|
|
|
92
92
|
ShoppingModule.exitCartPage();
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
*
|
|
96
96
|
* @param {number} count The number of items in the host app cart
|
|
97
97
|
*/
|
|
98
98
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoShopping.ts"],"names":["FWEventName","ShoppingModule","ShoppingModuleEventEmitter","VideoShopping","cartIconVisible","_cartIconVisible","value","setCartIconVisible","eventEmitter","getInstance","_instance","constructor","addListener","AddToCart","event","handleAddToCartEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","handleUpdateProductDetailsEvent","WillDisplayProduct","handleWillDisplayProductEvent","exitCartPage","setCartItemCount","count","onAddToCart","callbackId","result","updateAddToCartStatus","res","tips","onClickCartIcon","cartPage","currentCartPage","jumpToCartPage","onUpdateProductDetails","productList","updateVideoProducts","onWillDisplayProduct","config","updateProductViewConfig"],"mappings":";;AAQA,SAASA,WAAT,QAA4B,sBAA5B;AAGA,OAAOC,cAAP,
|
|
1
|
+
{"version":3,"sources":["VideoShopping.ts"],"names":["FWEventName","ShoppingModule","ShoppingModuleEventEmitter","VideoShopping","cartIconVisible","_cartIconVisible","value","setCartIconVisible","eventEmitter","getInstance","_instance","constructor","addListener","AddToCart","event","handleAddToCartEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","handleUpdateProductDetailsEvent","WillDisplayProduct","handleWillDisplayProductEvent","exitCartPage","setCartItemCount","count","onAddToCart","callbackId","result","updateAddToCartStatus","res","tips","onClickCartIcon","cartPage","currentCartPage","jumpToCartPage","onUpdateProductDetails","productList","updateVideoProducts","onWillDisplayProduct","config","updateProductViewConfig"],"mappings":";;AAQA,SAASA,WAAT,QAA4B,sBAA5B;AAGA,OAAOC,cAAP,IACEC,0BADF,QAEO,0BAFP;;AAsBA;AACA;AACA;AACA,MAAMC,aAAN,CAAoB;AAGlB;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;;AAGE;AACF;AACA;AAC4B,MAAfC,eAAe,GAAY;AACpC,WAAO,KAAKC,gBA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AGA,UAAIyB,MAAJ,EAAY;AACVtC,QAAAA,cAAc,CAACuC,uBAAf,CAAuCD,MAAvC,EAA+Cb,UAA/C;AACD;AACF;AACF;;AApJiB;;gBAAdvB,a;;AAuJN,eAAeA,aAAf","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\n\nimport type AddToCartResult from './models/AddToCartResult';\nimport type {\n AddToCartEvent,\n UpdateProductDetailsEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport { FWEventName } from './models/FWEventName';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport ShoppingModule, {\n ShoppingModuleEventEmitter,\n} from './modules/ShoppingModule';\n\nexport type AddToCartCallback = (\n event: AddToCartEvent\n) => Promise<AddToCartResult | undefined | null>;\n\nexport type ClickCartIconCallback = () => Promise<\n React.ReactNode | undefined | null\n>;\n\nexport type UpdateProductDetailsCallback = (\n event: UpdateProductDetailsEvent\n) => Promise<Product[] | undefined | null>;\n\nexport type WillDisplayProductCallback = (\n event: WillDisplayProductEvent\n) => Promise<ProductInfoViewConfiguration | undefined | null>;\n\ntype CallbackInfo = { callbackId?: number | string };\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\" button.\n *\n * The host app can return an AddToCartResult object to tell FireworkSDK the result of adding to cart.\n */\n public onAddToCart?: AddToCartCallback;\n\n /**\n * This callback is triggered when the user clicks the shopping cart icon.\n *\n * The host app can return a React.Node to integrate custom cart page to shopping flow.\n */\n public onClickCartIcon?: ClickCartIconCallback;\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 product will be shown.\n *\n * The host app can return a ProductInfoViewConfiguration object to configure \"Add to cart\" button style and cart icon style.\n */\n public onWillDisplayProduct?: WillDisplayProductCallback;\n\n /**\n * Defaults to true. 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 ShoppingModule.setCartIconVisible(value);\n }\n private _cartIconVisible: boolean = true;\n\n public currentCartPage?: React.ReactNode;\n\n private get eventEmitter(): NativeEventEmitter {\n return ShoppingModuleEventEmitter;\n }\n\n public static getInstance() {\n if (!VideoShopping._instance) {\n VideoShopping._instance = new VideoShopping();\n }\n\n return VideoShopping._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.AddToCart, (event) => {\n this.handleAddToCartEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.ClickCartIcon, (event) => {\n this.handleClickCartIconEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.UpdateProductDetails, (event) => {\n this.handleUpdateProductDetailsEvent(event);\n });\n\n this.eventEmitter.addListener(FWEventName.WillDisplayProduct, (event) => {\n this.handleWillDisplayProductEvent(event);\n });\n }\n\n /**\n * Exit Cart Page.\n *\n * The host app can call this method to exit their cart page.\n */\n public exitCartPage() {\n ShoppingModule.exitCartPage();\n }\n\n /**\n *\n * @param {number} count The number of items in the host app cart\n */\n public setCartItemCount(count: number) {\n ShoppingModule.setCartItemCount(count);\n }\n\n private async handleAddToCartEvent(event: AddToCartEvent & CallbackInfo) {\n if (this.onAddToCart) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const result = await this.onAddToCart(event as AddToCartEvent);\n if (result) {\n ShoppingModule.updateAddToCartStatus(\n result.res,\n result.tips,\n callbackId!\n );\n }\n }\n }\n\n private async handleClickCartIconEvent(event: CallbackInfo) {\n if (this.onClickCartIcon) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const cartPage = await this.onClickCartIcon();\n this.currentCartPage = cartPage;\n\n if (cartPage) {\n ShoppingModule.jumpToCartPage(callbackId!);\n }\n }\n }\n\n private async handleUpdateProductDetailsEvent(\n event: UpdateProductDetailsEvent & CallbackInfo\n ) {\n if (this.onUpdateProductDetails) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const productList = await this.onUpdateProductDetails(\n event as UpdateProductDetailsEvent\n );\n if (productList) {\n ShoppingModule.updateVideoProducts(productList, callbackId!);\n }\n }\n }\n\n private async handleWillDisplayProductEvent(\n event: WillDisplayProductEvent & CallbackInfo\n ) {\n if (this.onWillDisplayProduct) {\n const callbackId = event.callbackId;\n delete event.callbackId;\n const config = await this.onWillDisplayProduct(\n event as WillDisplayProductEvent\n );\n if (config) {\n ShoppingModule.updateProductViewConfig(config, callbackId!);\n }\n }\n }\n}\n\nexport default VideoShopping;\n"]}
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import VideoShopping from '../VideoShopping';
|
|
4
4
|
|
|
5
5
|
const CartContainer = () => {
|
|
6
|
-
const [cartPage
|
|
6
|
+
const [cartPage] = useState(VideoShopping.getInstance().currentCartPage);
|
|
7
7
|
return /*#__PURE__*/React.createElement(View, {
|
|
8
8
|
style: styles.container
|
|
9
9
|
}, cartPage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["CartContainer.tsx"],"names":["React","useState","StyleSheet","View","VideoShopping","CartContainer","cartPage","
|
|
1
|
+
{"version":3,"sources":["CartContainer.tsx"],"names":["React","useState","StyleSheet","View","VideoShopping","CartContainer","cartPage","getInstance","currentCartPage","styles","container","create","flex"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAEA,OAAOC,aAAP,MAA0B,kBAA1B;;AAEA,MAAMC,aAAa,GAAG,MAAM;AAC1B,QAAM,CAACC,QAAD,IAAaL,QAAQ,CACzBG,aAAa,CAACG,WAAd,GAA4BC,eADH,CAA3B;AAGA,sBAAO,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,KAAgCJ,QAAhC,CAAP;AACD,CALD;;AAOA,MAAMG,MAAM,GAAGP,UAAU,CAACS,MAAX,CAAkB;AAC/BD,EAAAA,SAAS,EAAE;AACTE,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf;AAMA,eAAeP,aAAf","sourcesContent":["import React, { useState } from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport VideoShopping from '../VideoShopping';\n\nconst CartContainer = () => {\n const [cartPage] = useState<React.ReactNode>(\n VideoShopping.getInstance().currentCartPage\n );\n return <View style={styles.container}>{cartPage}</View>;\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n\nexport default CartContainer;\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import FWLoggerUtil from '../utils/FWLoggerUtil';
|
|
3
4
|
import FireworkSDK from '../FireworkSDK';
|
|
4
5
|
|
|
5
6
|
const CustomCTALinkContentContainer = _ref => {
|
|
6
7
|
let {
|
|
7
8
|
url = ''
|
|
8
9
|
} = _ref;
|
|
10
|
+
FWLoggerUtil.log(`CustomCTALinkContentContainer url: ${url}`);
|
|
9
11
|
const customCTALinkContentRender = FireworkSDK.getInstance().customCTALinkContentRender;
|
|
10
12
|
let content = customCTALinkContentRender === null || customCTALinkContentRender === void 0 ? void 0 : customCTALinkContentRender({
|
|
11
13
|
url
|