react-native-firework-sdk 1.0.0-beta
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/README.md +39 -0
- package/android/build.gradle +193 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +5 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/publish.gradle +65 -0
- package/android/src/main/AndroidManifest.xml +16 -0
- package/android/src/main/java/com/reactnativefireworksdk/FireworkSDKPackage.kt +20 -0
- package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +123 -0
- package/android/src/main/java/com/reactnativefireworksdk/constants/FWCommandConstant.kt +6 -0
- package/android/src/main/java/com/reactnativefireworksdk/constants/FWVideoPlayerConstant.kt +20 -0
- package/android/src/main/java/com/reactnativefireworksdk/manager/FWVideoFeedManager.kt +88 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWEventName.kt +35 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedConfigModel.kt +27 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedItemDetailsModel.kt +11 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedMode.kt +7 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedSource.kt +7 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedTitlePosition.kt +7 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlaybackDetails.kt +19 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlayerConfigModel.kt +20 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoShoppingInterface.kt +13 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoShoppingProduct.kt +34 -0
- package/android/src/main/java/com/reactnativefireworksdk/models/FireworkSDKInterface.kt +12 -0
- package/android/src/main/java/com/reactnativefireworksdk/module/FWVideoShoppingModule.kt +190 -0
- package/android/src/main/java/com/reactnativefireworksdk/module/FireworkSDKModule.kt +248 -0
- package/android/src/main/java/com/reactnativefireworksdk/pages/FWVideoShoppingCartActivity.kt +43 -0
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWEventUtils.kt +127 -0
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWJsonUtils.kt +57 -0
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWLogUtils.kt +147 -0
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWUrlUtils.kt +68 -0
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +18 -0
- package/android/src/main/res/layout/fwrn_fragment_shoppingcart.xml +8 -0
- package/android/src/main/res/layout/fwrn_fragment_videofeed.xml +20 -0
- package/android/src/main/res/values/styles.xml +43 -0
- package/ios/Component/VideoFeed.swift +262 -0
- package/ios/Component/VideoFeedConfiguration.swift +32 -0
- package/ios/Component/VideoFeedManager.m +51 -0
- package/ios/Component/VideoFeedManager.swift +40 -0
- package/ios/Component/VideoPlayerConfiguration.swift +30 -0
- package/ios/FireworkSdk-Bridging-Header.h +6 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +291 -0
- package/ios/Models/FireworkJsEvent.swift +34 -0
- package/ios/Models/FireworkSDK+JsModel.swift +62 -0
- package/ios/Models/RCTConvert+FireworkSDKModule.swift +91 -0
- package/ios/Models/RCTConvert+Shopping.swift +49 -0
- package/ios/Models/RCTConvert+VideoFeed.swift +69 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +17 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +74 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +19 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +106 -0
- package/ios/Modules/FireworkSDKModule/MobileADConfiguration.swift +17 -0
- package/ios/Modules/Shopping/CartViewController.swift +98 -0
- package/ios/Modules/Shopping/Product.swift +33 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +24 -0
- package/ios/Modules/Shopping/ShoppingModule.m +19 -0
- package/ios/Modules/Shopping/ShoppingModule.swift +214 -0
- package/ios/Utils/String+Color.swift +38 -0
- package/ios/Utils/UIView+Constraints.swift +91 -0
- package/ios/Utils/UIView+ParentViewController.swift +21 -0
- package/ios/Utils/UIViewController+AttachChild.swift +69 -0
- package/lib/commonjs/FireworkSDK.js +171 -0
- package/lib/commonjs/FireworkSDK.js.map +1 -0
- package/lib/commonjs/VideoShopping.js +146 -0
- package/lib/commonjs/VideoShopping.js.map +1 -0
- package/lib/commonjs/components/CartContainer.js +35 -0
- package/lib/commonjs/components/CartContainer.js.map +1 -0
- package/lib/commonjs/components/FWVideoFeed.js +18 -0
- package/lib/commonjs/components/FWVideoFeed.js.map +1 -0
- package/lib/commonjs/components/VideoFeed.js +82 -0
- package/lib/commonjs/components/VideoFeed.js.map +1 -0
- package/lib/commonjs/constants/FWErrorMessage.js +15 -0
- package/lib/commonjs/constants/FWErrorMessage.js.map +1 -0
- package/lib/commonjs/index.js +44 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/ADConfig.js +2 -0
- package/lib/commonjs/models/ADConfig.js.map +1 -0
- package/lib/commonjs/models/AddToCartResult.js +2 -0
- package/lib/commonjs/models/AddToCartResult.js.map +1 -0
- package/lib/commonjs/models/FWError.js +2 -0
- package/lib/commonjs/models/FWError.js.map +1 -0
- package/lib/commonjs/models/FWEvents.js +20 -0
- package/lib/commonjs/models/FWEvents.js.map +1 -0
- package/lib/commonjs/models/FeedItemDetails.js +2 -0
- package/lib/commonjs/models/FeedItemDetails.js.map +1 -0
- package/lib/commonjs/models/Product.js +2 -0
- package/lib/commonjs/models/Product.js.map +1 -0
- package/lib/commonjs/models/ProductInfoViewConfiguration.js +2 -0
- package/lib/commonjs/models/ProductInfoViewConfiguration.js.map +1 -0
- package/lib/commonjs/models/ProductUnit.js +2 -0
- package/lib/commonjs/models/ProductUnit.js.map +1 -0
- package/lib/commonjs/models/VideoFeedConfiguration.js +2 -0
- package/lib/commonjs/models/VideoFeedConfiguration.js.map +1 -0
- package/lib/commonjs/models/VideoPlaybackDetails.js +2 -0
- package/lib/commonjs/models/VideoPlaybackDetails.js.map +1 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js +23 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerConfiguration.js +2 -0
- package/lib/commonjs/models/VideoPlayerConfiguration.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js +20 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -0
- package/lib/commonjs/modules/ShoppingModule.js +20 -0
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -0
- package/lib/module/FireworkSDK.js +153 -0
- package/lib/module/FireworkSDK.js.map +1 -0
- package/lib/module/VideoShopping.js +134 -0
- package/lib/module/VideoShopping.js.map +1 -0
- package/lib/module/components/CartContainer.js +18 -0
- package/lib/module/components/CartContainer.js.map +1 -0
- package/lib/module/components/FWVideoFeed.js +8 -0
- package/lib/module/components/FWVideoFeed.js.map +1 -0
- package/lib/module/components/VideoFeed.js +66 -0
- package/lib/module/components/VideoFeed.js.map +1 -0
- package/lib/module/constants/FWErrorMessage.js +7 -0
- package/lib/module/constants/FWErrorMessage.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.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/AddToCartResult.js +2 -0
- package/lib/module/models/AddToCartResult.js.map +1 -0
- package/lib/module/models/FWError.js +2 -0
- package/lib/module/models/FWError.js.map +1 -0
- package/lib/module/models/FWEvents.js +13 -0
- package/lib/module/models/FWEvents.js.map +1 -0
- package/lib/module/models/FeedItemDetails.js +2 -0
- package/lib/module/models/FeedItemDetails.js.map +1 -0
- package/lib/module/models/Product.js +2 -0
- package/lib/module/models/Product.js.map +1 -0
- package/lib/module/models/ProductInfoViewConfiguration.js +2 -0
- package/lib/module/models/ProductInfoViewConfiguration.js.map +1 -0
- package/lib/module/models/ProductUnit.js +2 -0
- package/lib/module/models/ProductUnit.js.map +1 -0
- package/lib/module/models/VideoFeedConfiguration.js +2 -0
- package/lib/module/models/VideoFeedConfiguration.js.map +1 -0
- package/lib/module/models/VideoPlaybackDetails.js +2 -0
- package/lib/module/models/VideoPlaybackDetails.js.map +1 -0
- package/lib/module/models/VideoPlaybackEventName.js +16 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -0
- package/lib/module/models/VideoPlayerConfiguration.js +2 -0
- package/lib/module/models/VideoPlayerConfiguration.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js +10 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -0
- package/lib/module/modules/ShoppingModule.js +10 -0
- package/lib/module/modules/ShoppingModule.js.map +1 -0
- package/lib/typescript/FireworkSDK.d.ts +74 -0
- package/lib/typescript/VideoShopping.d.ts +54 -0
- package/lib/typescript/components/CartContainer.d.ts +3 -0
- package/lib/typescript/components/FWVideoFeed.d.ts +2 -0
- package/lib/typescript/components/VideoFeed.d.ts +53 -0
- package/lib/typescript/constants/FWErrorMessage.d.ts +2 -0
- package/lib/typescript/index.d.ts +25 -0
- package/lib/typescript/models/ADConfig.d.ts +10 -0
- package/lib/typescript/models/AddToCartResult.d.ts +10 -0
- package/lib/typescript/models/FWError.d.ts +10 -0
- package/lib/typescript/models/FWEvents.d.ts +55 -0
- package/lib/typescript/models/FeedItemDetails.d.ts +14 -0
- package/lib/typescript/models/Product.d.ts +19 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +18 -0
- package/lib/typescript/models/ProductUnit.d.ts +22 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +32 -0
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +31 -0
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +39 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +25 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +12 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +13 -0
- package/package.json +147 -0
- package/react-native-firework-sdk.podspec +22 -0
- package/src/FireworkSDK.ts +153 -0
- package/src/VideoShopping.ts +165 -0
- package/src/components/CartContainer.tsx +20 -0
- package/src/components/FWVideoFeed.tsx +10 -0
- package/src/components/VideoFeed.tsx +109 -0
- package/src/constants/FWErrorMessage.ts +11 -0
- package/src/index.tsx +109 -0
- package/src/models/ADConfig.ts +10 -0
- package/src/models/AddToCartResult.ts +10 -0
- package/src/models/FWError.ts +10 -0
- package/src/models/FWEvents.ts +63 -0
- package/src/models/FeedItemDetails.ts +14 -0
- package/src/models/Product.ts +20 -0
- package/src/models/ProductInfoViewConfiguration.ts +20 -0
- package/src/models/ProductUnit.ts +23 -0
- package/src/models/VideoFeedConfiguration.ts +35 -0
- package/src/models/VideoPlaybackDetails.ts +33 -0
- package/src/models/VideoPlaybackEventName.ts +40 -0
- package/src/models/VideoPlayerConfiguration.ts +26 -0
- package/src/modules/FireworkSDKModule.ts +27 -0
- package/src/modules/ShoppingModule.ts +29 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// UIViewController+AddChild.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Jeff Zheng on 2021/12/30.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
/// util method for managing child viewcontroller
|
|
11
|
+
public extension UIViewController {
|
|
12
|
+
/// add viewController view to the receiver's viewController.view,
|
|
13
|
+
/// and set the constraints align view.safeAreaLayoutGuide
|
|
14
|
+
/// - Parameter viewController: ViewController to be added
|
|
15
|
+
func attachChild(_ viewController: UIViewController) {
|
|
16
|
+
let constraints = viewController.view.constraints(equalTo: view.safeAreaLayoutGuide)
|
|
17
|
+
attachChild(viewController,
|
|
18
|
+
to: view,
|
|
19
|
+
using: constraints)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// add viewController view to the receiver's viewController.view, and set the constraints on the four sides
|
|
23
|
+
/// - Parameters:
|
|
24
|
+
/// - viewController: UIViewController to be added
|
|
25
|
+
/// - container: the container view to add child view
|
|
26
|
+
func attachChild(
|
|
27
|
+
_ viewController: UIViewController,
|
|
28
|
+
to containerView: UIView
|
|
29
|
+
) {
|
|
30
|
+
let constraints = viewController.view.constraints(equalTo: containerView)
|
|
31
|
+
attachChild(viewController,
|
|
32
|
+
to: containerView,
|
|
33
|
+
using: constraints)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// add viewController view to the receiver's viewController.view, and set the constraints on the four sides
|
|
37
|
+
/// - Parameters:
|
|
38
|
+
/// - viewController: UIViewController to be added
|
|
39
|
+
/// - container: the container view to add child view
|
|
40
|
+
/// - constraints: constraints between container and viewController.view
|
|
41
|
+
func attachChild(
|
|
42
|
+
_ viewController: UIViewController,
|
|
43
|
+
to container: UIView,
|
|
44
|
+
using constraints: [NSLayoutConstraint]
|
|
45
|
+
) {
|
|
46
|
+
guard viewController.parent == nil else { return }
|
|
47
|
+
addChild(viewController)
|
|
48
|
+
container.addSubview(viewController.view)
|
|
49
|
+
viewController.view.translatesAutoresizingMaskIntoConstraints = false
|
|
50
|
+
NSLayoutConstraint.activate(
|
|
51
|
+
constraints
|
|
52
|
+
)
|
|
53
|
+
viewController.didMove(toParent: self)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// remove child viewController from receiver
|
|
57
|
+
/// - Parameters:
|
|
58
|
+
/// - viewController: ViewController to be removed
|
|
59
|
+
/// - animated: Pass true to animate the detach; otherwise, pass false.
|
|
60
|
+
func detachChild(
|
|
61
|
+
_ viewController: UIViewController
|
|
62
|
+
) {
|
|
63
|
+
guard viewController.parent != nil else { return }
|
|
64
|
+
|
|
65
|
+
viewController.willMove(toParent: nil)
|
|
66
|
+
viewController.removeFromParent()
|
|
67
|
+
viewController.view.removeFromSuperview()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _FWEvents = require("./models/FWEvents");
|
|
11
|
+
|
|
12
|
+
var _FireworkSDKModule = _interopRequireDefault(require("./modules/FireworkSDKModule"));
|
|
13
|
+
|
|
14
|
+
var _ShoppingModule = _interopRequireDefault(require("./modules/ShoppingModule"));
|
|
15
|
+
|
|
16
|
+
var _VideoShopping = _interopRequireDefault(require("./VideoShopping"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Entry class of Firework SDK, which supports the sdk initialization and global configuration.
|
|
24
|
+
*/
|
|
25
|
+
class FireworkSDK {
|
|
26
|
+
/**
|
|
27
|
+
* Clicking Video Feed callback
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* SDK initialization callback.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get Custom Clicking CTA callback.
|
|
36
|
+
*/
|
|
37
|
+
get onCustomCTAClick() {
|
|
38
|
+
return this._onCustomCTAClick;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Set Custom Clicking CTA callback.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
set onCustomCTAClick(value) {
|
|
46
|
+
this._onCustomCTAClick = value;
|
|
47
|
+
|
|
48
|
+
_FireworkSDKModule.default.setCustomCTAClickEnabled(value ? true : false);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get Video Playback callback.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
get onVideoPlayback() {
|
|
56
|
+
return this._onVideoPlayback;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Set Video Playback callback.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
set onVideoPlayback(value) {
|
|
64
|
+
this._onVideoPlayback = value;
|
|
65
|
+
|
|
66
|
+
_FireworkSDKModule.default.setVideoPlaybackEventEnabled(value ? true : false);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* get Share Base URL
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
get shareBaseURL() {
|
|
74
|
+
return this._shareBaseURL;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* set Share Base URL
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
set shareBaseURL(value) {
|
|
82
|
+
this._shareBaseURL = value;
|
|
83
|
+
|
|
84
|
+
_FireworkSDKModule.default.setShareBaseURL(value);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get VideoShopping object.
|
|
89
|
+
*/
|
|
90
|
+
get shopping() {
|
|
91
|
+
return _VideoShopping.default.getInstance();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get global single instance of FireworkSDK class.
|
|
95
|
+
* @returns FireworkSDK
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
static getInstance() {
|
|
100
|
+
if (!FireworkSDK._instance) {
|
|
101
|
+
FireworkSDK._instance = new FireworkSDK();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return FireworkSDK._instance;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
constructor() {
|
|
108
|
+
_defineProperty(this, "_onCustomCTAClick", void 0);
|
|
109
|
+
|
|
110
|
+
_defineProperty(this, "_onVideoPlayback", void 0);
|
|
111
|
+
|
|
112
|
+
_defineProperty(this, "onVideoFeedClick", void 0);
|
|
113
|
+
|
|
114
|
+
_defineProperty(this, "_shareBaseURL", void 0);
|
|
115
|
+
|
|
116
|
+
_defineProperty(this, "onSDKInit", void 0);
|
|
117
|
+
|
|
118
|
+
_defineProperty(this, "eventEmitter", void 0);
|
|
119
|
+
|
|
120
|
+
this.eventEmitter = new _reactNative.NativeEventEmitter(_FireworkSDKModule.default);
|
|
121
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.SDKInit, event => {
|
|
122
|
+
if (this.onSDKInit) {
|
|
123
|
+
this.onSDKInit(event !== null && event !== void 0 ? event : {});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.CustomCTAClick, event => {
|
|
127
|
+
if (this.onCustomCTAClick) {
|
|
128
|
+
this.onCustomCTAClick(event !== null && event !== void 0 ? event : {});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.VideoPlayback, event => {
|
|
132
|
+
if (this.onVideoPlayback) {
|
|
133
|
+
this.onVideoPlayback(event !== null && event !== void 0 ? event : {});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.VideoFeedClick, event => {
|
|
137
|
+
if (this.onVideoFeedClick) {
|
|
138
|
+
this.onVideoFeedClick(event !== null && event !== void 0 ? event : {});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Initializes Firework SDK.
|
|
144
|
+
* @param {string?} userId An id to uniquely identify device or user.
|
|
145
|
+
* @param {ADConfig?} adConfig Configuration of Ad.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
init(userId, adConfig) {
|
|
150
|
+
_FireworkSDKModule.default.init(userId, adConfig);
|
|
151
|
+
|
|
152
|
+
_ShoppingModule.default.init();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Open Video URL.
|
|
156
|
+
* @param {string} url
|
|
157
|
+
* @param {VideoPlayerConfiguration} config
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
openVideoPlayer(url, config) {
|
|
162
|
+
_FireworkSDKModule.default.openVideoPlayer(url, config !== null && config !== void 0 ? config : {});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
_defineProperty(FireworkSDK, "_instance", void 0);
|
|
168
|
+
|
|
169
|
+
var _default = FireworkSDK;
|
|
170
|
+
exports.default = _default;
|
|
171
|
+
//# sourceMappingURL=FireworkSDK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FireworkSDK.ts"],"names":["FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","FireworkSDKModule","setCustomCTAClickEnabled","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","setShareBaseURL","shopping","VideoShopping","getInstance","_instance","constructor","eventEmitter","NativeEventEmitter","addListener","FWEventName","SDKInit","event","onSDKInit","CustomCTAClick","VideoPlayback","VideoFeedClick","onVideoFeedClick","init","userId","adConfig","ShoppingModule","openVideoPlayer","url","config"],"mappings":"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","sourcesContent":["import { NativeEventEmitter } from 'react-native';\n\nimport type ADConfig from './models/ADConfig';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport { FWEventName, VideoFeedClickEvent } from './models/FWEvents';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule from './modules/FireworkSDKModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport VideoShopping from './VideoShopping';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Entry class of Firework SDK, which supports the sdk initialization and global configuration.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * Clicking Video Feed callback\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n private _shareBaseURL: string | undefined;\n\n /**\n * SDK initialization callback.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * Get Custom Clicking CTA callback.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n\n /**\n * Set Custom Clicking CTA callback.\n */\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n\n /**\n * Get Video Playback callback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n\n /**\n * Set Video Playback callback.\n */\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n\n /**\n * get Share Base URL\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n\n /**\n * set Share Base URL\n */\n public set shareBaseURL(value: string | undefined) {\n this._shareBaseURL = value;\n FireworkSDKModule.setShareBaseURL(value);\n }\n\n private eventEmitter: NativeEventEmitter;\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return VideoShopping.getInstance();\n }\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n this.eventEmitter = new NativeEventEmitter(FireworkSDKModule);\n\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n }\n\n /**\n * Initializes Firework SDK.\n * @param {string?} userId An id to uniquely identify device or user.\n * @param {ADConfig?} adConfig Configuration of Ad.\n */\n public init(userId?: string, adConfig?: ADConfig) {\n FireworkSDKModule.init(userId, adConfig);\n ShoppingModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url \n * @param {VideoPlayerConfiguration} config \n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n}\n\nexport default FireworkSDK;\n"]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _FWEvents = require("./models/FWEvents");
|
|
11
|
+
|
|
12
|
+
var _ShoppingModule = _interopRequireDefault(require("./modules/ShoppingModule"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
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
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Entry class of Video Shopping
|
|
20
|
+
*/
|
|
21
|
+
class VideoShopping {
|
|
22
|
+
/**
|
|
23
|
+
* This callback is triggered when the user clicks the "Add to cart" button.
|
|
24
|
+
*
|
|
25
|
+
* The host app can return an AddToCartResult object to tell FireworkSDK the result of adding to cart.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This callback is triggered when the user clicks the shopping cart icon.
|
|
30
|
+
*
|
|
31
|
+
* The host app can return a React.Node to integrate custom cart page to shopping flow.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* This callback is triggered when the video will be shown.
|
|
36
|
+
*
|
|
37
|
+
* The host app can return a Product object to update the latest product information.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* This callback is triggered when the product will be shown.
|
|
42
|
+
*
|
|
43
|
+
* The host app can return a ProductInfoViewConfiguration object to configure "Add to cart" button style and cart icon style.
|
|
44
|
+
*/
|
|
45
|
+
static getInstance() {
|
|
46
|
+
if (!VideoShopping._instance) {
|
|
47
|
+
VideoShopping._instance = new VideoShopping();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return VideoShopping._instance;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
constructor() {
|
|
54
|
+
_defineProperty(this, "onAddToCart", void 0);
|
|
55
|
+
|
|
56
|
+
_defineProperty(this, "onClickCartIcon", void 0);
|
|
57
|
+
|
|
58
|
+
_defineProperty(this, "onUpdateProductDetails", void 0);
|
|
59
|
+
|
|
60
|
+
_defineProperty(this, "onWillDisplayProduct", void 0);
|
|
61
|
+
|
|
62
|
+
_defineProperty(this, "currentCartPage", void 0);
|
|
63
|
+
|
|
64
|
+
_defineProperty(this, "eventEmitter", void 0);
|
|
65
|
+
|
|
66
|
+
this.eventEmitter = new _reactNative.NativeEventEmitter(_ShoppingModule.default);
|
|
67
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.AddToCart, event => {
|
|
68
|
+
this.handleAddToCartEvent(event);
|
|
69
|
+
});
|
|
70
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.ClickCartIcon, event => {
|
|
71
|
+
this.handleClickCartIconEvent(event);
|
|
72
|
+
});
|
|
73
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.UpdateProductDetails, event => {
|
|
74
|
+
this.handleUpdateProductDetailsEvent(event);
|
|
75
|
+
});
|
|
76
|
+
this.eventEmitter.addListener(_FWEvents.FWEventName.WillDisplayProduct, event => {
|
|
77
|
+
this.handleWillDisplayProductEvent(event);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Exit Cart Page.
|
|
82
|
+
*
|
|
83
|
+
* The host app can call this method to exit their cart page.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
exitCartPage() {
|
|
88
|
+
_ShoppingModule.default.exitCartPage();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async handleAddToCartEvent(event) {
|
|
92
|
+
if (this.onAddToCart) {
|
|
93
|
+
const callbackId = event.callbackId;
|
|
94
|
+
delete event.callbackId;
|
|
95
|
+
const result = await this.onAddToCart(event);
|
|
96
|
+
|
|
97
|
+
if (result) {
|
|
98
|
+
_ShoppingModule.default.updateAddToCartStatus(result.res, result.tips, callbackId);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async handleClickCartIconEvent(event) {
|
|
104
|
+
if (this.onClickCartIcon) {
|
|
105
|
+
const callbackId = event.callbackId;
|
|
106
|
+
delete event.callbackId;
|
|
107
|
+
const cartPage = await this.onClickCartIcon();
|
|
108
|
+
this.currentCartPage = cartPage;
|
|
109
|
+
|
|
110
|
+
if (cartPage) {
|
|
111
|
+
_ShoppingModule.default.jumpToCartPage(callbackId);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async handleUpdateProductDetailsEvent(event) {
|
|
117
|
+
if (this.onUpdateProductDetails) {
|
|
118
|
+
const callbackId = event.callbackId;
|
|
119
|
+
delete event.callbackId;
|
|
120
|
+
const product = await this.onUpdateProductDetails(event);
|
|
121
|
+
|
|
122
|
+
if (product) {
|
|
123
|
+
_ShoppingModule.default.updateVideoProduct(product, callbackId);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async handleWillDisplayProductEvent(event) {
|
|
129
|
+
if (this.onWillDisplayProduct) {
|
|
130
|
+
const callbackId = event.callbackId;
|
|
131
|
+
delete event.callbackId;
|
|
132
|
+
const config = await this.onWillDisplayProduct(event);
|
|
133
|
+
|
|
134
|
+
if (config) {
|
|
135
|
+
_ShoppingModule.default.updateProductViewConfig(config, callbackId);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_defineProperty(VideoShopping, "_instance", void 0);
|
|
143
|
+
|
|
144
|
+
var _default = VideoShopping;
|
|
145
|
+
exports.default = _default;
|
|
146
|
+
//# sourceMappingURL=VideoShopping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["VideoShopping.ts"],"names":["VideoShopping","getInstance","_instance","constructor","eventEmitter","NativeEventEmitter","ShoppingModule","addListener","FWEventName","AddToCart","event","handleAddToCartEvent","ClickCartIcon","handleClickCartIconEvent","UpdateProductDetails","handleUpdateProductDetailsEvent","WillDisplayProduct","handleWillDisplayProductEvent","exitCartPage","onAddToCart","callbackId","result","updateAddToCartStatus","res","tips","onClickCartIcon","cartPage","currentCartPage","jumpToCartPage","onUpdateProductDetails","product","updateVideoProduct","onWillDisplayProduct","config","updateProductViewConfig"],"mappings":"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","sourcesContent":["import { NativeEventEmitter } from 'react-native';\n\nimport type AddToCartResult from './models/AddToCartResult';\nimport {\n AddToCartEvent,\n FWEventName,\n UpdateProductDetailsEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport ShoppingModule 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 };\n\n/**\n * 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 object 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 public currentCartPage?: React.ReactNode;\n\n private eventEmitter: NativeEventEmitter;\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 = new NativeEventEmitter(ShoppingModule);\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 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 product = await this.onUpdateProductDetails(\n event as UpdateProductDetailsEvent\n );\n if (product) {\n ShoppingModule.updateVideoProduct(product, 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"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _VideoShopping = _interopRequireDefault(require("../VideoShopping"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
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
|
+
|
|
20
|
+
const CartContainer = () => {
|
|
21
|
+
const [cartPage, _] = (0, _react.useState)(_VideoShopping.default.getInstance().currentCartPage);
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
23
|
+
style: styles.container
|
|
24
|
+
}, cartPage);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = _reactNative.StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
flex: 1
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _default = CartContainer;
|
|
34
|
+
exports.default = _default;
|
|
35
|
+
//# sourceMappingURL=CartContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAWC,CAAX,IAAgB,qBACpBC,uBAAcC,WAAd,GAA4BC,eADR,CAAtB;AAGA,sBAAO,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,KAAgCN,QAAhC,CAAP;AACD,CALD;;AAOA,MAAMK,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AACTG,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf;;eAMeV,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"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _FWErrorMessage = require("../constants/FWErrorMessage");
|
|
11
|
+
|
|
12
|
+
const NativeComponentName = 'FWVideoFeed';
|
|
13
|
+
const FWVideoFeed = _reactNative.UIManager.getViewManagerConfig(NativeComponentName) != null ? (0, _reactNative.requireNativeComponent)(NativeComponentName) : () => {
|
|
14
|
+
throw new Error(_FWErrorMessage.LINKING_ERROR);
|
|
15
|
+
};
|
|
16
|
+
var _default = FWVideoFeed;
|
|
17
|
+
exports.default = _default;
|
|
18
|
+
//# sourceMappingURL=FWVideoFeed.js.map
|
|
@@ -0,0 +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;AACN,QAAM,IAAII,KAAJ,CAAUC,6BAAV,CAAN;AACD,CALL;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"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _FWVideoFeed = _interopRequireDefault(require("./FWVideoFeed"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
const NativeComponentName = 'FWVideoFeed';
|
|
21
|
+
|
|
22
|
+
class VideoFeed extends _react.default.Component {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
|
|
26
|
+
_defineProperty(this, "nativeComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
27
|
+
|
|
28
|
+
_defineProperty(this, "refresh", () => {
|
|
29
|
+
const nativeNodeHandle = (0, _reactNative.findNodeHandle)(this.nativeComponentRef.current);
|
|
30
|
+
|
|
31
|
+
_reactNative.UIManager.dispatchViewManagerCommand((0, _reactNative.findNodeHandle)(nativeNodeHandle), _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh, []);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "_onVideoFeedLoadFinished", event => {
|
|
35
|
+
const {
|
|
36
|
+
name,
|
|
37
|
+
reason
|
|
38
|
+
} = event.nativeEvent;
|
|
39
|
+
|
|
40
|
+
if (this.props.onVideoFeedLoadFinished) {
|
|
41
|
+
if (name) {
|
|
42
|
+
this.props.onVideoFeedLoadFinished({
|
|
43
|
+
name,
|
|
44
|
+
reason
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
this.props.onVideoFeedLoadFinished();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3;
|
|
55
|
+
|
|
56
|
+
const {
|
|
57
|
+
source,
|
|
58
|
+
channel = '',
|
|
59
|
+
playlist = '',
|
|
60
|
+
mode = 'row',
|
|
61
|
+
videoFeedConfiguration
|
|
62
|
+
} = this.props;
|
|
63
|
+
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
|
+
const titlePosition = (_videoFeedConfigurati3 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : 'nested';
|
|
65
|
+
const key = `source:${source}_channel:${channel}_playlist:${playlist}_mode:${mode}_titleHidden:${titleHidden}_titlePosition:${titlePosition}`;
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_FWVideoFeed.default, _extends({
|
|
67
|
+
key: key
|
|
68
|
+
}, this.props, {
|
|
69
|
+
ref: this.nativeComponentRef,
|
|
70
|
+
onVideoFeedLoadFinished: this._onVideoFeedLoadFinished,
|
|
71
|
+
mode: mode
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exports.default = VideoFeed;
|
|
78
|
+
|
|
79
|
+
_defineProperty(VideoFeed, "defaultProps", {
|
|
80
|
+
mode: 'row'
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=VideoFeed.js.map
|
|
@@ -0,0 +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"],"mappings":";;;;;;;AAAA;;AACA;;AAKA;;;;;;;;AA6CA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDD,eAAME,SAAN,EALiD;;AAAA,qCASrD,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,KAjBqE;;AAAA,sDAoBpEC,KADiC,IAE9B;AACH,YAAM;AAAEC,QAAAA,IAAF;AAAQC,QAAAA;AAAR,UAAmBF,KAAK,CAACG,WAA/B;;AACA,UAAI,KAAKC,KAAL,CAAWC,uBAAf,EAAwC;AACtC,YAAIJ,IAAJ,EAAU;AACR,eAAKG,KAAL,CAAWC,uBAAX,CAAmC;AAAEJ,YAAAA,IAAF;AAAQC,YAAAA;AAAR,WAAnC;AACD,SAFD,MAEO;AACL,eAAKE,KAAL,CAAWC,uBAAX;AACD;AACF;AACF,KA9BqE;AAAA;;AAgCtEC,EAAAA,MAAM,GAAG;AAAA;;AACP,UAAM;AACJC,MAAAA,MADI;AAEJC,MAAAA,OAAO,GAAG,EAFN;AAGJC,MAAAA,QAAQ,GAAG,EAHP;AAIJC,MAAAA,IAAI,GAAG,KAJH;AAKJC,MAAAA;AALI,QAMF,KAAKP,KANT;AAOA,UAAMQ,WAAW,4BAAGD,sBAAH,aAAGA,sBAAH,iDAAGA,sBAAsB,CAAEE,KAA3B,2DAAG,uBAA+BC,MAAlC,yEAA4C,KAA7D;AACA,UAAMC,aAAa,6BAAGJ,sBAAH,aAAGA,sBAAH,uBAAGA,sBAAsB,CAAEI,aAA3B,2EAA4C,QAA/D;AAEA,UAAMC,GAAG,GAAI,UAAST,MAAO,YAAWC,OAAQ,aAAYC,QAAS,SAAQC,IAAK,gBAAeE,WAAY,kBAAiBG,aAAc,EAA5I;AAEA,wBACE,6BAAC,oBAAD;AACE,MAAA,GAAG,EAAEC;AADP,OAEM,KAAKZ,KAFX;AAGE,MAAA,GAAG,EAAE,KAAKX,kBAHZ;AAIE,MAAA,uBAAuB,EAAE,KAAKwB,wBAJhC;AAKE,MAAA,IAAI,EAAEP;AALR,OADF;AASD;;AAtDqE;;;;gBAAnDtB,S,kBACG;AACpBsB,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\nimport { UIManager, findNodeHandle, StyleProp, ViewStyle } from 'react-native';\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type FWError from '../models/FWError';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedSource = 'discover' | 'channel' | 'playlist';\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 * 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 * 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 render() {\n const {\n source,\n channel = '',\n playlist = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n\n const key = `source:${source}_channel:${channel}_playlist:${playlist}_mode:${mode}_titleHidden:${titleHidden}_titlePosition:${titlePosition}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n />\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LINKING_ERROR = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const LINKING_ERROR = `The package 'react-native-firework-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
11
|
+
ios: "- You have run 'pod install'\n",
|
|
12
|
+
default: ''
|
|
13
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
14
|
+
exports.LINKING_ERROR = LINKING_ERROR;
|
|
15
|
+
//# sourceMappingURL=FWErrorMessage.js.map
|
|
@@ -0,0 +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\n export {\n LINKING_ERROR,\n };\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "VideoFeed", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _VideoFeed.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "VideoPlaybackEventName", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _VideoPlaybackEventName.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "VideoShopping", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _VideoShopping.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
exports.default = void 0;
|
|
25
|
+
|
|
26
|
+
var _reactNative = require("react-native");
|
|
27
|
+
|
|
28
|
+
var _CartContainer = _interopRequireDefault(require("./components/CartContainer"));
|
|
29
|
+
|
|
30
|
+
var _VideoFeed = _interopRequireDefault(require("./components/VideoFeed"));
|
|
31
|
+
|
|
32
|
+
var _FireworkSDK = _interopRequireDefault(require("./FireworkSDK"));
|
|
33
|
+
|
|
34
|
+
var _VideoPlaybackEventName = _interopRequireDefault(require("./models/VideoPlaybackEventName"));
|
|
35
|
+
|
|
36
|
+
var _VideoShopping = _interopRequireDefault(require("./VideoShopping"));
|
|
37
|
+
|
|
38
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
+
|
|
40
|
+
_reactNative.AppRegistry.registerComponent('FWShoppingCartPage', () => _CartContainer.default);
|
|
41
|
+
|
|
42
|
+
var _default = _FireworkSDK.default;
|
|
43
|
+
exports.default = _default;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["AppRegistry","registerComponent","CartContainer","FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AAMA;;AAOA;;AAgCA;;AAaA;;;;AAEAA,yBAAYC,iBAAZ,CAA8B,oBAA9B,EAAoD,MAAMC,sBAA1D;;eAEeC,oB","sourcesContent":["import { AppRegistry } from 'react-native';\n\nimport CartContainer from './components/CartContainer';\nimport type {\n IVideoFeedProps,\n VideoFeedMode,\n VideoFeedSource,\n} 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 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 SDKInitEvent,\n UpdateProductDetailsEvent,\n VideoPlaybackEvent,\n WillDisplayProductEvent,\n} from './models/FWEvents';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n AddToCartButtonConfiguration,\n CartIconConfiguration,\n} 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 VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type {\n VideoBadge,\n VideoPlayerSize,\n} from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\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 ADConfig,\n AddToCartButtonConfiguration,\n AddToCartCallback,\n AddToCartEvent,\n AddToCartResult,\n CartIconConfiguration,\n ClickCartIconCallback,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FWError,\n IVideoFeedProps,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n SDKInitCallback,\n SDKInitEvent,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VideoBadge,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\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"]}
|