react-native-firework-sdk 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +2 -40
- package/android/build.gradle +6 -3
- package/android/gradle.properties +2 -1
- package/android/proguard-rules.pro +22 -0
- package/android/publish.gradle +4 -3
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +5 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +226 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWCommandConstant.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWVideoPlayerConstant.kt +13 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +9 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWEventName.kt +10 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +11 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +28 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedItemDetailsModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +18 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedSource.kt +2 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedTitlePosition.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoPlaybackDetails.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +23 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoShoppingProduct.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/WeakProperty.kt +19 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/FireworkSDKPackage.kt +10 -5
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +175 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWLiveStreamInterface.kt +5 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FWVideoShoppingInterface.kt +3 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FireworkSDKInterface.kt +4 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +88 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FWVideoShoppingModule.kt +53 -39
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FireworkSDKModule.kt +23 -22
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/pages/FWVideoShoppingCartActivity.kt +4 -4
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/utils/FWEventUtils.kt +61 -7
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWJsonUtils.kt +29 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWLogUtils.kt +2 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWUrlUtils.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +94 -0
- package/android/src/main/res/layout/fw_bridge_fragment_playlistfeed.xml +18 -0
- package/android/src/main/res/layout/{fwrn_fragment_shoppingcart.xml → fw_bridge_fragment_shoppingcart.xml} +1 -1
- package/android/src/main/res/layout/{fwrn_fragment_videofeed.xml → fw_bridge_fragment_videofeed.xml} +2 -1
- package/android/src/main/res/values/colors.xml +4 -0
- package/ios/{Component → Components}/VideoFeed.swift +60 -3
- package/ios/{Component → Components}/VideoFeedConfiguration.swift +2 -0
- package/ios/{Component → Components}/VideoFeedManager.m +2 -0
- package/ios/{Component → Components}/VideoFeedManager.swift +0 -0
- package/ios/{Component → Components}/VideoPlayerConfiguration.swift +7 -0
- package/ios/Models/{FireworkJsEvent.swift → NativeToRN/FireworkEventName.swift} +20 -0
- package/ios/Models/{FireworkSDK+JsModel.swift → NativeToRN/FireworkSDK+Json.swift} +33 -3
- package/ios/Models/{RCTConvert+FireworkSDKModule.swift → RNToNative/RCTConvert+FireworkSDKModule.swift} +20 -0
- package/ios/Models/{RCTConvert+Shopping.swift → RNToNative/RCTConvert+Shopping.swift} +15 -0
- package/ios/Models/{RCTConvert+VideoFeed.swift → RNToNative/RCTConvert+VideoFeed.swift} +2 -1
- package/ios/Modules/FireworkSDKModule/AdBadgeConfiguration.swift +18 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +10 -14
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +16 -4
- package/ios/Modules/LiveStream/LiveStreamModule.m +14 -0
- package/ios/Modules/LiveStream/LiveStreamModule.swift +43 -0
- package/ios/Modules/Shopping/ShoppingModule.m +1 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +10 -9
- package/lib/commonjs/FireworkSDK.js +61 -38
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +60 -0
- package/lib/commonjs/LiveStream.js.map +1 -0
- package/lib/commonjs/VideoShopping.js +20 -18
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +47 -2
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/AdBadgeConfiguration.js +2 -0
- package/lib/commonjs/models/{ADConfig.js.map → AdBadgeConfiguration.js.map} +0 -0
- package/lib/commonjs/models/AdConfig.js +2 -0
- package/lib/{module/models/ADConfig.js.map → commonjs/models/AdConfig.js.map} +0 -0
- package/lib/commonjs/models/FWEventName.js +24 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -0
- package/lib/commonjs/models/FWEvents.js +0 -14
- package/lib/commonjs/models/FWEvents.js.map +1 -1
- package/lib/commonjs/models/LiveStreamChatEventName.js +15 -0
- package/lib/commonjs/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventName.js +17 -0
- package/lib/commonjs/models/LiveStreamEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/commonjs/models/VideoFeedSource.js +6 -0
- package/lib/commonjs/models/VideoFeedSource.js.map +1 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js +3 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/LiveStreamModule.js +22 -0
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -0
- package/lib/commonjs/modules/ShoppingModule.js +3 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +50 -34
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +51 -0
- package/lib/module/LiveStream.js.map +1 -0
- package/lib/module/VideoShopping.js +14 -13
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/VideoFeed.js +42 -3
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/AdBadgeConfiguration.js +2 -0
- package/lib/module/models/AdBadgeConfiguration.js.map +1 -0
- package/lib/module/models/AdConfig.js +2 -0
- package/lib/module/models/AdConfig.js.map +1 -0
- package/lib/module/models/FWEventName.js +17 -0
- package/lib/module/models/FWEventName.js.map +1 -0
- package/lib/module/models/FWEvents.js +1 -12
- package/lib/module/models/FWEvents.js.map +1 -1
- package/lib/module/models/LiveStreamChatEventName.js +8 -0
- package/lib/module/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/module/models/LiveStreamEventDetails.js +2 -0
- package/lib/module/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/module/models/LiveStreamEventName.js +10 -0
- package/lib/module/models/LiveStreamEventName.js.map +1 -0
- package/lib/module/models/LiveStreamMessageDetails.js +2 -0
- package/lib/module/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/module/models/VideoFeedSource.js +2 -0
- package/lib/module/models/VideoFeedSource.js.map +1 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js +3 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/LiveStreamModule.js +12 -0
- package/lib/module/modules/LiveStreamModule.js.map +1 -0
- package/lib/module/modules/ShoppingModule.js +3 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +26 -24
- package/lib/typescript/LiveStream.d.ts +21 -0
- package/lib/typescript/VideoShopping.d.ts +6 -6
- package/lib/typescript/components/VideoFeed.d.ts +11 -4
- package/lib/typescript/index.d.ts +15 -6
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +15 -0
- package/lib/typescript/models/{ADConfig.d.ts → AdConfig.d.ts} +1 -1
- package/lib/typescript/models/FWEventName.d.ts +14 -0
- package/lib/typescript/models/FWEvents.d.ts +15 -12
- package/lib/typescript/models/FeedItemDetails.d.ts +11 -4
- package/lib/typescript/models/LiveStreamChatEventName.d.ts +7 -0
- package/lib/typescript/models/LiveStreamEventDetails.d.ts +3 -0
- package/lib/typescript/models/LiveStreamEventName.d.ts +15 -0
- package/lib/typescript/models/LiveStreamMessageDetails.d.ts +14 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +7 -3
- package/lib/typescript/models/VideoFeedSource.d.ts +2 -0
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -2
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +13 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +8 -4
- package/lib/typescript/modules/LiveStreamModule.d.ts +8 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +4 -2
- package/package.json +3 -4
- package/react-native-firework-sdk.podspec +3 -1
- package/src/FireworkSDK.ts +49 -33
- package/src/LiveStream.ts +51 -0
- package/src/VideoShopping.ts +15 -13
- package/src/components/VideoFeed.tsx +69 -7
- package/src/index.tsx +32 -15
- package/src/models/AdBadgeConfiguration.ts +16 -0
- package/src/models/{ADConfig.ts → AdConfig.ts} +1 -1
- package/src/models/FWEventName.ts +14 -0
- package/src/models/FWEvents.ts +17 -13
- package/src/models/FeedItemDetails.ts +12 -4
- package/src/models/LiveStreamChatEventName.ts +8 -0
- package/src/models/LiveStreamEventDetails.ts +4 -0
- package/src/models/LiveStreamEventName.ts +16 -0
- package/src/models/LiveStreamMessageDetails.ts +14 -0
- package/src/models/VideoFeedConfiguration.ts +7 -3
- package/src/models/VideoFeedSource.ts +2 -0
- package/src/models/VideoPlaybackDetails.ts +1 -3
- package/src/models/VideoPlaybackEventName.ts +1 -1
- package/src/models/VideoPlayerConfiguration.ts +14 -0
- package/src/modules/FireworkSDKModule.ts +10 -4
- package/src/modules/LiveStreamModule.ts +26 -0
- package/src/modules/ShoppingModule.ts +14 -7
- package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +0 -124
- package/android/src/main/java/com/reactnativefireworksdk/manager/FWVideoFeedManager.kt +0 -88
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedConfigModel.kt +0 -27
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedMode.kt +0 -7
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlayerConfigModel.kt +0 -20
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +0 -18
- package/lib/commonjs/models/ADConfig.js +0 -2
- package/lib/module/models/ADConfig.js +0 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _FWEventName = require("./models/FWEventName");
|
|
9
|
+
|
|
10
|
+
var _LiveStreamModule = require("./modules/LiveStreamModule");
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The entry class of live stream.
|
|
16
|
+
*/
|
|
17
|
+
class LiveStream {
|
|
18
|
+
/**
|
|
19
|
+
* The callback of live stream event.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The callback of live stream chat event.
|
|
24
|
+
*/
|
|
25
|
+
get eventEmitter() {
|
|
26
|
+
return _LiveStreamModule.LiveStreamModuleEventEmitter;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static getInstance() {
|
|
30
|
+
if (!LiveStream._instance) {
|
|
31
|
+
LiveStream._instance = new LiveStream();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return LiveStream._instance;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
_defineProperty(this, "onLiveStreamEvent", void 0);
|
|
39
|
+
|
|
40
|
+
_defineProperty(this, "onLiveStreamChatEvent", void 0);
|
|
41
|
+
|
|
42
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.onLiveStreamEvent, event => {
|
|
43
|
+
if (this.onLiveStreamEvent) {
|
|
44
|
+
this.onLiveStreamEvent(event !== null && event !== void 0 ? event : {});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.onLiveStreamChatEvent, event => {
|
|
48
|
+
if (this.onLiveStreamChatEvent) {
|
|
49
|
+
this.onLiveStreamChatEvent(event !== null && event !== void 0 ? event : {});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_defineProperty(LiveStream, "_instance", void 0);
|
|
57
|
+
|
|
58
|
+
var _default = LiveStream;
|
|
59
|
+
exports.default = _default;
|
|
60
|
+
//# sourceMappingURL=LiveStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["LiveStream.ts"],"names":["LiveStream","eventEmitter","LiveStreamModuleEventEmitter","getInstance","_instance","constructor","addListener","FWEventName","onLiveStreamEvent","event","onLiveStreamChatEvent"],"mappings":";;;;;;;AACA;;AAEA;;;;AAKA;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,yBAAYC,iBAA1C,EAA8DC,KAAD,IAAW;AACtE,UAAI,KAAKD,iBAAT,EAA4B;AAC1B,aAAKA,iBAAL,CAAuBC,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC;AACD;AACF,KAJD;AAMA,SAAKR,YAAL,CAAkBK,WAAlB,CAA8BC,yBAAYG,qBAA1C,EAAkED,KAAD,IAAW;AAC1E,UAAI,KAAKC,qBAAT,EAAgC;AAC9B,aAAKA,qBAAL,CAA2BD,KAA3B,aAA2BA,KAA3B,cAA2BA,KAA3B,GAAoC,EAApC;AACD;AACF,KAJD;AAKD;;AApCc;;gBAAXT,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 = (event: LiveStreamChatEvent) => 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.onLiveStreamEvent, (event) => {\n if (this.onLiveStreamEvent) {\n this.onLiveStreamEvent(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.onLiveStreamChatEvent, (event) => {\n if (this.onLiveStreamChatEvent) {\n this.onLiveStreamChatEvent(event ?? {});\n }\n });\n }\n}\n\nexport default LiveStream;\n"]}
|
|
@@ -5,18 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _FWEventName = require("./models/FWEventName");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _ShoppingModule = _interopRequireWildcard(require("./modules/ShoppingModule"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
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; }
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The entry class of video shopping.
|
|
20
20
|
*/
|
|
21
21
|
class VideoShopping {
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ class VideoShopping {
|
|
|
34
34
|
/**
|
|
35
35
|
* This callback is triggered when the video will be shown.
|
|
36
36
|
*
|
|
37
|
-
* The host app can return a Product
|
|
37
|
+
* The host app can return a Product list to update the latest product information.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -56,6 +56,10 @@ class VideoShopping {
|
|
|
56
56
|
_ShoppingModule.default.setCartIconVisible(value);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
get eventEmitter() {
|
|
60
|
+
return _ShoppingModule.ShoppingModuleEventEmitter;
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
static getInstance() {
|
|
60
64
|
if (!VideoShopping._instance) {
|
|
61
65
|
VideoShopping._instance = new VideoShopping();
|
|
@@ -65,8 +69,6 @@ class VideoShopping {
|
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
constructor() {
|
|
68
|
-
_defineProperty(this, "_cartIconVisible", true);
|
|
69
|
-
|
|
70
72
|
_defineProperty(this, "onAddToCart", void 0);
|
|
71
73
|
|
|
72
74
|
_defineProperty(this, "onClickCartIcon", void 0);
|
|
@@ -75,21 +77,20 @@ class VideoShopping {
|
|
|
75
77
|
|
|
76
78
|
_defineProperty(this, "onWillDisplayProduct", void 0);
|
|
77
79
|
|
|
78
|
-
_defineProperty(this, "
|
|
80
|
+
_defineProperty(this, "_cartIconVisible", true);
|
|
79
81
|
|
|
80
|
-
_defineProperty(this, "
|
|
82
|
+
_defineProperty(this, "currentCartPage", void 0);
|
|
81
83
|
|
|
82
|
-
this.eventEmitter
|
|
83
|
-
this.eventEmitter.addListener(_FWEvents.FWEventName.AddToCart, event => {
|
|
84
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.AddToCart, event => {
|
|
84
85
|
this.handleAddToCartEvent(event);
|
|
85
86
|
});
|
|
86
|
-
this.eventEmitter.addListener(
|
|
87
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.ClickCartIcon, event => {
|
|
87
88
|
this.handleClickCartIconEvent(event);
|
|
88
89
|
});
|
|
89
|
-
this.eventEmitter.addListener(
|
|
90
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.UpdateProductDetails, event => {
|
|
90
91
|
this.handleUpdateProductDetailsEvent(event);
|
|
91
92
|
});
|
|
92
|
-
this.eventEmitter.addListener(
|
|
93
|
+
this.eventEmitter.addListener(_FWEventName.FWEventName.WillDisplayProduct, event => {
|
|
93
94
|
this.handleWillDisplayProductEvent(event);
|
|
94
95
|
});
|
|
95
96
|
}
|
|
@@ -142,10 +143,11 @@ class VideoShopping {
|
|
|
142
143
|
if (this.onUpdateProductDetails) {
|
|
143
144
|
const callbackId = event.callbackId;
|
|
144
145
|
delete event.callbackId;
|
|
145
|
-
const
|
|
146
|
+
const productList = await this.onUpdateProductDetails(event);
|
|
147
|
+
console.log('handleUpdateProductDetailsEvent productList', JSON.stringify(productList));
|
|
146
148
|
|
|
147
|
-
if (
|
|
148
|
-
_ShoppingModule.default.
|
|
149
|
+
if (productList) {
|
|
150
|
+
_ShoppingModule.default.updateVideoProducts(productList, callbackId);
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","cartIconVisible","_cartIconVisible","value","ShoppingModule","setCartIconVisible","
|
|
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","console","log","JSON","stringify","updateVideoProducts","onWillDisplayProduct","config","updateProductViewConfig"],"mappings":";;;;;;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;AACD;AACF;AACF;;AAE0C,QAA7BL,6BAA6B,CACzCP,KADyC,EAEzC;AACA,QAAI,KAAK4B,oBAAT,EAA+B;AAC7B,YAAMhB,UAAU,GAAGZ,KAAK,CAACY,UAAzB;AACA,aAAOZ,KAAK,CAACY,UAAb;AACA,YAAMiB,MAAM,GAAG,MAAM,KAAKD,oBAAL,CACnB5B,KADmB,CAArB;;AAGA,UAAI6B,MAAJ,EAAY;AACVvC,gCAAewC,uBAAf,CAAuCD,MAAvC,EAA+CjB,UAA/C;AACD;AACF;AACF;;AArJiB;;gBAAd1B,a;;eAwJSA,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, { ShoppingModuleEventEmitter } 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 console.log('handleUpdateProductDetailsEvent productList', JSON.stringify(productList));\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"]}
|
|
@@ -9,6 +9,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
+
var _FireworkSDK = _interopRequireDefault(require("../FireworkSDK"));
|
|
13
|
+
|
|
14
|
+
var _FWEventName = require("../models/FWEventName");
|
|
15
|
+
|
|
16
|
+
var _FireworkSDKModule = require("../modules/FireworkSDKModule");
|
|
17
|
+
|
|
12
18
|
var _FWVideoFeed = _interopRequireDefault(require("./FWVideoFeed"));
|
|
13
19
|
|
|
14
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -25,6 +31,8 @@ class VideoFeed extends _react.default.Component {
|
|
|
25
31
|
|
|
26
32
|
_defineProperty(this, "nativeComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
27
33
|
|
|
34
|
+
_defineProperty(this, "subscriptions", []);
|
|
35
|
+
|
|
28
36
|
_defineProperty(this, "refresh", () => {
|
|
29
37
|
const nativeNodeHandle = (0, _reactNative.findNodeHandle)(this.nativeComponentRef.current);
|
|
30
38
|
|
|
@@ -50,19 +58,56 @@ class VideoFeed extends _react.default.Component {
|
|
|
50
58
|
});
|
|
51
59
|
}
|
|
52
60
|
|
|
61
|
+
componentDidMount() {
|
|
62
|
+
const subscriptionOfShareBaseURLUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.ShareBaseURLUpdated, () => {
|
|
63
|
+
this.setState({});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
this.subscriptions.push(subscriptionOfShareBaseURLUpdated);
|
|
67
|
+
|
|
68
|
+
const subscriptionOfAdBadgeConfigurationUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AdBadgeConfigurationUpdated, () => {
|
|
69
|
+
this.setState({});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
componentWillUnmount() {
|
|
76
|
+
this.subscriptions.forEach(value => {
|
|
77
|
+
value.remove();
|
|
78
|
+
});
|
|
79
|
+
this.subscriptions = [];
|
|
80
|
+
}
|
|
81
|
+
|
|
53
82
|
render() {
|
|
54
|
-
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3;
|
|
83
|
+
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3;
|
|
55
84
|
|
|
56
85
|
const {
|
|
57
86
|
source,
|
|
58
87
|
channel = '',
|
|
59
88
|
playlist = '',
|
|
89
|
+
playlistGroup = '',
|
|
60
90
|
mode = 'row',
|
|
61
91
|
videoFeedConfiguration
|
|
62
92
|
} = this.props;
|
|
63
93
|
const titleHidden = (_videoFeedConfigurati = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.title) === null || _videoFeedConfigurati2 === void 0 ? void 0 : _videoFeedConfigurati2.hidden) !== null && _videoFeedConfigurati !== void 0 ? _videoFeedConfigurati : false;
|
|
64
94
|
const titlePosition = (_videoFeedConfigurati3 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : 'nested';
|
|
65
|
-
const
|
|
95
|
+
const shareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
96
|
+
const adBadgeConfiguration = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : {};
|
|
97
|
+
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
98
|
+
const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
|
|
99
|
+
const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
|
|
100
|
+
let key = `source:${source}`;
|
|
101
|
+
key += `_channel:${channel}`;
|
|
102
|
+
key += `_playlist:${playlist}`;
|
|
103
|
+
key += `_playlistGroup:${playlistGroup}`;
|
|
104
|
+
key += `_mode:${mode}`;
|
|
105
|
+
key += `_titleHidden:${titleHidden}`;
|
|
106
|
+
key += `_titlePosition:${titlePosition}`;
|
|
107
|
+
key += `_shareBaseURL:${shareBaseURL}`;
|
|
108
|
+
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
109
|
+
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
110
|
+
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
66
111
|
return /*#__PURE__*/_react.default.createElement(_FWVideoFeed.default, _extends({
|
|
67
112
|
key: key
|
|
68
113
|
}, this.props, {
|
|
@@ -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","render","source","channel","playlist","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex"],"mappings":";;;;;;;AAAA;;AACA
|
|
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","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;;AAiDA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC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BAAmBN,eAAgB,EAA3C;AACAM,IAAAA,GAAG,IAAK,6BAA4BJ,wBAAyB,EAA7D;AACAI,IAAAA,GAAG,IAAK,uBAAsBF,kBAAmB,EAAjD;AAEA,wBACE,6BAAC,oBAAD;AACE,MAAA,GAAG,EAAEE;AADP,OAEM,KAAKtC,KAFX;AAGE,MAAA,GAAG,EAAE,KAAKX,kBAHZ;AAIE,MAAA,uBAAuB,EAAE,KAAKkD,wBAJhC;AAKE,MAAA,IAAI,EAAEjB,IALR;AAME,MAAA,KAAK,EAAEkB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,KAAKzC,KAAL,CAAW0C,KAA7B,EAAoC;AAAEC,QAAAA,MAAM,EAAE,CAAC;AAAX,OAApC;AANT,OADF;AAUD;;AArGqE;;;;gBAAnD3D,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 * 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 = FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated = 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\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\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"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "LiveStream", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _LiveStream.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "LiveStreamChatEventName", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _LiveStreamChatEventName.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "LiveStreamEventName", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _LiveStreamEventName.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
6
24
|
Object.defineProperty(exports, "VideoFeed", {
|
|
7
25
|
enumerable: true,
|
|
8
26
|
get: function () {
|
|
@@ -31,6 +49,12 @@ var _VideoFeed = _interopRequireDefault(require("./components/VideoFeed"));
|
|
|
31
49
|
|
|
32
50
|
var _FireworkSDK = _interopRequireDefault(require("./FireworkSDK"));
|
|
33
51
|
|
|
52
|
+
var _LiveStream = _interopRequireDefault(require("./LiveStream"));
|
|
53
|
+
|
|
54
|
+
var _LiveStreamEventName = _interopRequireDefault(require("./models/LiveStreamEventName"));
|
|
55
|
+
|
|
56
|
+
var _LiveStreamChatEventName = _interopRequireDefault(require("./models/LiveStreamChatEventName"));
|
|
57
|
+
|
|
34
58
|
var _VideoPlaybackEventName = _interopRequireDefault(require("./models/VideoPlaybackEventName"));
|
|
35
59
|
|
|
36
60
|
var _VideoShopping = _interopRequireDefault(require("./VideoShopping"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["AppRegistry","registerComponent","CartContainer","FireworkSDK"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["AppRegistry","registerComponent","CartContainer","FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AAEA;;AAOA;;AAKA;;AAkBA;;AAEA;;AAeA;;AAcA;;;;AAEAA,yBAAYC,iBAAZ,CAA8B,oBAA9B,EAAoD,MAAMC,sBAA1D;;eAEeC,oB","sourcesContent":["import { AppRegistry } from 'react-native';\n\nimport CartContainer from './components/CartContainer';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport 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 AdConfig from './models/AdConfig';\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 type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\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);\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfig,\n AddToCartButtonConfiguration,\n AddToCartCallback,\n AddToCartEvent,\n AddToCartResult,\n ClickCartIconCallback,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FWError,\n IVideoFeedProps,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n LiveStreamChatEventName,\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"]}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FWEventName = void 0;
|
|
7
|
+
let FWEventName;
|
|
8
|
+
exports.FWEventName = FWEventName;
|
|
9
|
+
|
|
10
|
+
(function (FWEventName) {
|
|
11
|
+
FWEventName["SDKInit"] = "fw:sdk-init";
|
|
12
|
+
FWEventName["CustomCTAClick"] = "fw:custom-cta-click";
|
|
13
|
+
FWEventName["VideoPlayback"] = "fw:video-playback";
|
|
14
|
+
FWEventName["VideoFeedClick"] = "fw:video-feed-click";
|
|
15
|
+
FWEventName["AddToCart"] = "fw:shopping:add-to-cart";
|
|
16
|
+
FWEventName["ClickCartIcon"] = "fw:shopping:click-cart-icon";
|
|
17
|
+
FWEventName["UpdateProductDetails"] = "fw:shopping:update-product-details";
|
|
18
|
+
FWEventName["WillDisplayProduct"] = "fw:shopping:will-display-product";
|
|
19
|
+
FWEventName["onLiveStreamEvent"] = "fw:livestream";
|
|
20
|
+
FWEventName["onLiveStreamChatEvent"] = "fw:livestream-chat";
|
|
21
|
+
FWEventName["ShareBaseURLUpdated"] = "fw:share-base-url-updated";
|
|
22
|
+
FWEventName["AdBadgeConfigurationUpdated"] = "fw:ad-badge-configuration-updated";
|
|
23
|
+
})(FWEventName || (exports.FWEventName = FWEventName = {}));
|
|
24
|
+
//# sourceMappingURL=FWEventName.js.map
|
|
@@ -0,0 +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;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 onLiveStreamEvent = 'fw:livestream',\n onLiveStreamChatEvent = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n}\n"]}
|
|
@@ -3,18 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FWEventName = void 0;
|
|
7
|
-
let FWEventName;
|
|
8
|
-
exports.FWEventName = FWEventName;
|
|
9
|
-
|
|
10
|
-
(function (FWEventName) {
|
|
11
|
-
FWEventName["SDKInit"] = "fw:sdk-init";
|
|
12
|
-
FWEventName["CustomCTAClick"] = "fw:custom-cta-click";
|
|
13
|
-
FWEventName["VideoPlayback"] = "fw:video-playback";
|
|
14
|
-
FWEventName["VideoFeedClick"] = "fw:video-feed-click";
|
|
15
|
-
FWEventName["AddToCart"] = "fw:shopping:add-to-cart";
|
|
16
|
-
FWEventName["ClickCartIcon"] = "fw:shopping:click-cart-icon";
|
|
17
|
-
FWEventName["UpdateProductDetails"] = "fw:shopping:update-product-details";
|
|
18
|
-
FWEventName["WillDisplayProduct"] = "fw:shopping:will-display-product";
|
|
19
|
-
})(FWEventName || (exports.FWEventName = FWEventName = {}));
|
|
20
6
|
//# sourceMappingURL=FWEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var LiveStreamChatEventName;
|
|
8
|
+
|
|
9
|
+
(function (LiveStreamChatEventName) {
|
|
10
|
+
LiveStreamChatEventName["userSendChat"] = "fw:livestream:user-send-chat";
|
|
11
|
+
})(LiveStreamChatEventName || (LiveStreamChatEventName = {}));
|
|
12
|
+
|
|
13
|
+
var _default = LiveStreamChatEventName;
|
|
14
|
+
exports.default = _default;
|
|
15
|
+
//# sourceMappingURL=LiveStreamChatEventName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["LiveStreamChatEventName.ts"],"names":["LiveStreamChatEventName"],"mappings":";;;;;;IAAKA,uB;;WAAAA,uB;AAAAA,EAAAA,uB;GAAAA,uB,KAAAA,uB;;eAOUA,uB","sourcesContent":["enum LiveStreamChatEventName {\n /**\n * Called when a user sends messages to an active live stream.\n */\n userSendChat = 'fw:livestream:user-send-chat',\n}\n\nexport default LiveStreamChatEventName;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var LiveStreamEventName;
|
|
8
|
+
|
|
9
|
+
(function (LiveStreamEventName) {
|
|
10
|
+
LiveStreamEventName["userDidjoin"] = "fw:livestream:user-join";
|
|
11
|
+
LiveStreamEventName["userDidLeave"] = "fw:livestream:user-leave";
|
|
12
|
+
LiveStreamEventName["userSendLike"] = "fw:livestream:user-send-like";
|
|
13
|
+
})(LiveStreamEventName || (LiveStreamEventName = {}));
|
|
14
|
+
|
|
15
|
+
var _default = LiveStreamEventName;
|
|
16
|
+
exports.default = _default;
|
|
17
|
+
//# sourceMappingURL=LiveStreamEventName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["LiveStreamEventName.ts"],"names":["LiveStreamEventName"],"mappings":";;;;;;IAAKA,mB;;WAAAA,mB;AAAAA,EAAAA,mB;AAAAA,EAAAA,mB;AAAAA,EAAAA,mB;GAAAA,mB,KAAAA,mB;;eAeUA,mB","sourcesContent":["enum LiveStreamEventName {\n /**\n * Called when a user joins an active live stream.\n */\n userDidjoin = 'fw:livestream:user-join',\n /**\n * Called when the user leaves an active live stream.\n */\n userDidLeave = 'fw:livestream:user-leave',\n /**\n * Called when a user sends a like to an active live stream.\n */\n userSendLike = 'fw:livestream:user-send-like',\n}\n\nexport default LiveStreamEventName;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":";;;;;;IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;eAuCUA,sB","sourcesContent":["enum VideoPlaybackEventName {\n /**\n * When video is shown to the user.\n */\n Impression = 'fw:video:impression',\n /**\n * Video started.\n */\n Start = 'fw:video:start',\n /**\n * Video reached 25%.\n */\n FirstQuartile = 'fw:video:first-quartile',\n /**\n * Video reached 50%.\n */\n Midpoint = 'fw:video:midpoint',\n /**\n * Video reached 75%.\n */\n ThirdQuartile = 'fw:video:third-quartile',\n /**\n * Video reached 100%.\n */\n Complete = 'fw:video:complete',\n /**\n * When ad video finishes playing
|
|
1
|
+
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":";;;;;;IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;eAuCUA,sB","sourcesContent":["enum VideoPlaybackEventName {\n /**\n * When video is shown to the user.\n */\n Impression = 'fw:video:impression',\n /**\n * Video started.\n */\n Start = 'fw:video:start',\n /**\n * Video reached 25%.\n */\n FirstQuartile = 'fw:video:first-quartile',\n /**\n * Video reached 50%.\n */\n Midpoint = 'fw:video:midpoint',\n /**\n * Video reached 75%.\n */\n ThirdQuartile = 'fw:video:third-quartile',\n /**\n * Video reached 100%.\n */\n Complete = 'fw:video:complete',\n /**\n * When ad video finishes playing.\n */\n AdEnd = 'fw:video:ad-end',\n /**\n * When a visitor clicks on CTA button (if available).\n */\n ClickCTA = 'fw:video:click-cta',\n /**\n * When user clicks on \"Share\" button.\n */\n ClickShare = 'fw:video:click-share',\n}\n\nexport default VideoPlaybackEventName;\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.FireworkSDKModuleEventEmitter = void 0;
|
|
7
7
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
|
|
@@ -15,6 +15,8 @@ const FireworkSDKModule = _reactNative.NativeModules.FireworkSDK ? _reactNative.
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
});
|
|
18
|
+
const FireworkSDKModuleEventEmitter = new _reactNative.NativeEventEmitter(FireworkSDKModule);
|
|
19
|
+
exports.FireworkSDKModuleEventEmitter = FireworkSDKModuleEventEmitter;
|
|
18
20
|
var _default = FireworkSDKModule;
|
|
19
21
|
exports.default = _default;
|
|
20
22
|
//# sourceMappingURL=FireworkSDKModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR","FireworkSDKModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAIA;;AAIA,MAAMA,iBAAiB,GAAGC,2BAAcC,WAAd,GACtBD,2BAAcC,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAoBA,MAAMC,6BAA6B,GAAG,IAAIC,+BAAJ,CAAuBR,iBAAvB,CAAtC;;eAIeA,iB","sourcesContent":["import { NativeEventEmitter, NativeModule } from 'react-native';\nimport { NativeModules } from 'react-native';\nimport type AdBadgeConfiguration from 'src/models/AdBadgeConfiguration';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type AdConfig from '../models/AdConfig';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(userId?: string, adConfig?: AdConfig): void;\n openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;\n setCustomCTAClickEnabled(enabled: boolean): void;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport {\n FireworkSDKModuleEventEmitter,\n}\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.LiveStreamModuleEventEmitter = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _FWErrorMessage = require("../constants/FWErrorMessage");
|
|
11
|
+
|
|
12
|
+
const LiveStreamModule = _reactNative.NativeModules.LiveStreamModule ? _reactNative.NativeModules.LiveStreamModule : new Proxy({}, {
|
|
13
|
+
get() {
|
|
14
|
+
throw new Error(_FWErrorMessage.LINKING_ERROR);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
});
|
|
18
|
+
const LiveStreamModuleEventEmitter = new _reactNative.NativeEventEmitter(LiveStreamModule);
|
|
19
|
+
exports.LiveStreamModuleEventEmitter = LiveStreamModuleEventEmitter;
|
|
20
|
+
var _default = LiveStreamModule;
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
//# sourceMappingURL=LiveStreamModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["LiveStreamModule.ts"],"names":["LiveStreamModule","NativeModules","Proxy","get","Error","LINKING_ERROR","LiveStreamModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAMA;;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 {\n NativeEventEmitter,\n NativeModule,\n NativeModules,\n} 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"]}
|