react-native-firework-sdk 1.7.1 → 1.8.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/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +11 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +0 -2
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +1 -0
- package/ios/Components/StoryBlock.swift +1 -8
- package/ios/Components/StoryBlockManager.swift +4 -0
- package/ios/Components/VideoFeed.swift +9 -14
- package/ios/Components/VideoFeedConfiguration.swift +2 -0
- package/ios/Components/VideoFeedManager.m +2 -0
- package/ios/Components/VideoFeedManager.swift +4 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +12 -8
- package/ios/Models/Common/FontInfo.swift +57 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +2 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +249 -103
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +0 -2
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +12 -12
- package/ios/Modules/LiveStream/LiveStreamModule.swift +5 -3
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +7 -2
- package/ios/Modules/Shopping/ShoppingModule.m +1 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +72 -63
- package/ios/Utils/FWSwizzleLoader.m +0 -1
- package/lib/commonjs/FWNavigator.js +32 -1
- package/lib/commonjs/FWNavigator.js.map +1 -1
- package/lib/commonjs/FireworkSDK.js +9 -7
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +64 -9
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +14 -5
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +1 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/IOSFontInfo.js +2 -0
- package/lib/commonjs/models/IOSFontInfo.js.map +1 -0
- package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FWNavigator.js +31 -1
- package/lib/module/FWNavigator.js.map +1 -1
- package/lib/module/FireworkSDK.js +10 -6
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/VideoShopping.js +63 -9
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/VideoFeed.js +14 -5
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +1 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/IOSFontInfo.js +2 -0
- package/lib/module/models/IOSFontInfo.js.map +1 -0
- package/lib/module/modules/FWNavigatorModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FWNavigator.d.ts +16 -1
- package/lib/typescript/FireworkSDK.d.ts +2 -0
- package/lib/typescript/VideoShopping.d.ts +28 -6
- package/lib/typescript/components/VideoFeed.d.ts +4 -0
- package/lib/typescript/index.d.ts +6 -4
- package/lib/typescript/models/FWEventName.d.ts +2 -1
- package/lib/typescript/models/FWEvents.d.ts +5 -0
- package/lib/typescript/models/IOSFontInfo.d.ts +19 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +23 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +19 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +16 -0
- package/lib/typescript/modules/FWNavigatorModule.d.ts +2 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -1
- package/package.json +1 -1
- package/react-native-firework-sdk.podspec +1 -1
- package/src/{FWNavigator.tsx → FWNavigator.ts} +29 -1
- package/src/FireworkSDK.ts +10 -7
- package/src/VideoShopping.ts +83 -11
- package/src/components/VideoFeed.tsx +12 -2
- package/src/{index.tsx → index.ts} +17 -1
- package/src/models/FWEventName.ts +1 -0
- package/src/models/FWEvents.ts +6 -0
- package/src/models/IOSFontInfo.ts +29 -0
- package/src/models/ProductInfoViewConfiguration.ts +25 -0
- package/src/models/VideoFeedConfiguration.ts +20 -1
- package/src/models/VideoPlayerConfiguration.ts +17 -0
- package/src/modules/FWNavigatorModule.ts +2 -0
- package/src/modules/ShoppingModule.ts +2 -4
- package/ios/Utils/FWPiPManager.swift +0 -24
- package/ios/Utils/UIButton+FWSwizzle.swift +0 -33
|
@@ -203,7 +203,6 @@ class FWVideoFeed(
|
|
|
203
203
|
LayoutInflater.from(context).inflate(R.layout.fw_bridge_fragment_videofeed, this, false) as ConstraintLayout?
|
|
204
204
|
videoFeedView = videoFeedViewContainer?.findViewById(R.id.fw_bridge_videofeed)
|
|
205
205
|
if (videoFeedView != null) {
|
|
206
|
-
Log.e("videoFeedView", "layoutDirection: " + videoFeedView?.layoutDirection.toString())
|
|
207
206
|
videoFeedView?.layoutDirection = LAYOUT_DIRECTION_LOCALE
|
|
208
207
|
addView(videoFeedViewContainer)
|
|
209
208
|
}
|
|
@@ -35,6 +35,7 @@ enum class FWVideoShoppingEventName(val rawValue: String) {
|
|
|
35
35
|
ClickCartIcon("fw:shopping:click-cart-icon"),
|
|
36
36
|
UpdateProductDetails("fw:shopping:update-product-details"),
|
|
37
37
|
WillDisplayProduct("fw:shopping:will-display-product"),
|
|
38
|
+
CustomLinkButtonClick("fw:shopping:custom-link-button-click"),
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
enum class FWLiveStreamEventName(val rawValue: String) {
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt
CHANGED
|
@@ -8,6 +8,7 @@ import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
|
8
8
|
import com.fireworksdk.bridge.utils.FWDateUtils
|
|
9
9
|
import com.fireworksdk.bridge.utils.FWGsonUtil
|
|
10
10
|
import com.fireworksdk.bridge.utils.FWLogUtils
|
|
11
|
+
import com.fireworksdk.bridge.utils.FWVideoPlayerUtils
|
|
11
12
|
import com.google.gson.reflect.TypeToken
|
|
12
13
|
import com.loopnow.fireworklibrary.baya.Baya
|
|
13
14
|
import com.loopnow.fireworklibrary.baya.UpdateCartStatus
|
|
@@ -214,11 +215,20 @@ class FWVideoShoppingModule(
|
|
|
214
215
|
unitId: String,
|
|
215
216
|
productWebUrl: String?
|
|
216
217
|
): Boolean {
|
|
217
|
-
|
|
218
|
+
if (FWVideoPlayerUtils.customClickLinkButtonEnabled) {
|
|
219
|
+
FWEventUtils.sendCustomLinkButtonClickEvent(reactApplicationContext, productWebUrl, productId, unitId, callbackId)
|
|
220
|
+
}
|
|
221
|
+
return FWVideoPlayerUtils.customClickLinkButtonEnabled
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
224
|
}
|
|
221
225
|
|
|
226
|
+
@ReactMethod
|
|
227
|
+
override fun setCustomClickLinkButtonEnabled(value: Boolean?, promise: Promise) {
|
|
228
|
+
FWVideoPlayerUtils.customClickLinkButtonEnabled = value?:false
|
|
229
|
+
promise.resolve(true)
|
|
230
|
+
}
|
|
231
|
+
|
|
222
232
|
@ReactMethod
|
|
223
233
|
fun addListener(eventName: String?) {
|
|
224
234
|
// Set up any upstream listeners or background tasks as necessary
|
|
@@ -263,4 +263,13 @@ object FWEventUtils {
|
|
|
263
263
|
|
|
264
264
|
sendEvent(reactContext, FWEventName.LiveStreamChat.rawValue, eventMap)
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
fun sendCustomLinkButtonClickEvent(reactContext: ReactContext, url: String?, productId: String?, unitId: String?, callbackId: Int?) {
|
|
268
|
+
val eventMap = Arguments.createMap()
|
|
269
|
+
eventMap.putString("url", url ?: "")
|
|
270
|
+
eventMap.putString("productId", productId)
|
|
271
|
+
eventMap.putString("unitId", unitId)
|
|
272
|
+
eventMap.putInt("callbackId", callbackId?:0)
|
|
273
|
+
sendEvent(reactContext, FWVideoShoppingEventName.CustomLinkButtonClick.rawValue, eventMap)
|
|
274
|
+
}
|
|
266
275
|
}
|
|
@@ -45,8 +45,6 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
private var pipController: PictureInPictureController?
|
|
49
|
-
|
|
50
48
|
public override init(frame: CGRect) {
|
|
51
49
|
super.init(frame: frame)
|
|
52
50
|
self.clipsToBounds = true
|
|
@@ -72,7 +70,7 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
|
|
|
72
70
|
|
|
73
71
|
let storyBlockVC = StoryBlockViewController(source: source)
|
|
74
72
|
if self.enablePictureInPicture {
|
|
75
|
-
|
|
73
|
+
storyBlockVC.isPictureInPictureEnabled = true
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
storyBlockVC.delegate = self
|
|
@@ -83,11 +81,6 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
|
|
|
83
81
|
public override func removeFromSuperview() {
|
|
84
82
|
super.removeFromSuperview()
|
|
85
83
|
|
|
86
|
-
if let pipController = pipController {
|
|
87
|
-
FWPiPManager.shared.addPiPController(pipController)
|
|
88
|
-
self.pipController = nil
|
|
89
|
-
}
|
|
90
|
-
|
|
91
84
|
guard let storyBlockVC = self.storyBlockVC else {
|
|
92
85
|
return
|
|
93
86
|
}
|
|
@@ -21,6 +21,10 @@ class StoryBlockManager: RCTViewManager, StoryBlockViewDelegate {
|
|
|
21
21
|
return true
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
override var methodQueue: DispatchQueue {
|
|
25
|
+
return DispatchQueue.main
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
func storyBlockDidLoadFeed(_ view: StoryBlock) {
|
|
25
29
|
view.onStoryBlockLoadFinished?(nil)
|
|
26
30
|
}
|
|
@@ -53,6 +53,8 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
@objc public var adConfiguration: AdConfiguration?
|
|
56
|
+
@objc public var enablePictureInPicture: Bool = false
|
|
57
|
+
|
|
56
58
|
@objc var onVideoFeedLoadFinished: RCTBubblingEventBlock?
|
|
57
59
|
// @objc var onVideoFeedClick: RCTBubblingEventBlock?
|
|
58
60
|
|
|
@@ -149,8 +151,6 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
149
151
|
return resultAdConfiguration
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
private var pipController: PictureInPictureController?
|
|
153
|
-
|
|
154
154
|
public override func layoutSubviews() {
|
|
155
155
|
super.layoutSubviews()
|
|
156
156
|
|
|
@@ -158,10 +158,7 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
private func embed() {
|
|
161
|
-
guard let parentVC = parentViewController else {
|
|
162
|
-
return
|
|
163
|
-
}
|
|
164
|
-
guard self.feedVC == nil else {
|
|
161
|
+
guard let parentVC = parentViewController, self.feedVC == nil else {
|
|
165
162
|
return
|
|
166
163
|
}
|
|
167
164
|
|
|
@@ -207,8 +204,8 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
207
204
|
|
|
208
205
|
// swiftlint:disable:next notification_center_detachment
|
|
209
206
|
NotificationCenter.default.removeObserver(self)
|
|
210
|
-
if feedViewConfig?.enablePictureInPicture == true {
|
|
211
|
-
|
|
207
|
+
if self.enablePictureInPicture || feedViewConfig?.enablePictureInPicture == true {
|
|
208
|
+
feedVC.isPictureInPictureEnabled = true
|
|
212
209
|
}
|
|
213
210
|
|
|
214
211
|
feedVC.delegate = self
|
|
@@ -220,10 +217,6 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
220
217
|
super.removeFromSuperview()
|
|
221
218
|
// swiftlint:disable:next notification_center_detachment
|
|
222
219
|
NotificationCenter.default.removeObserver(self)
|
|
223
|
-
if let pipController = pipController {
|
|
224
|
-
FWPiPManager.shared.addPiPController(pipController)
|
|
225
|
-
self.pipController = nil
|
|
226
|
-
}
|
|
227
220
|
|
|
228
221
|
guard let feedVC = self.feedVC else {
|
|
229
222
|
return
|
|
@@ -284,7 +277,8 @@ extension VideoFeed {
|
|
|
284
277
|
vfcConfig.title.textColor = textcolor.uicolor()
|
|
285
278
|
}
|
|
286
279
|
if let fontSize = title.fontSize {
|
|
287
|
-
|
|
280
|
+
let iOSFontInfo = title.iOSFontInfo ?? FontInfo()
|
|
281
|
+
vfcConfig.title.font = iOSFontInfo.getFont(fontSize)
|
|
288
282
|
}
|
|
289
283
|
}
|
|
290
284
|
if let playIcon = config.playIcon {
|
|
@@ -353,7 +347,8 @@ extension VideoFeed {
|
|
|
353
347
|
vpcConfig.ctaButton.contentConfiguration.textColor = textcolor.uicolor()
|
|
354
348
|
}
|
|
355
349
|
if let fontSize = ctaButtonStyle.fontSize {
|
|
356
|
-
|
|
350
|
+
let iOSFontInfo = ctaButtonStyle.iOSFontInfo ?? FontInfo()
|
|
351
|
+
vpcConfig.ctaButton.contentConfiguration.font = iOSFontInfo.getFont(fontSize)
|
|
357
352
|
}
|
|
358
353
|
}
|
|
359
354
|
if let showPlaybackButton = config.showPlaybackButton {
|
|
@@ -21,12 +21,14 @@ public class VideoFeedConfiguration: NSObject, Codable {
|
|
|
21
21
|
var itemSpacing: Double?
|
|
22
22
|
var enableAutoplay: Bool?
|
|
23
23
|
var gridColumns: Int?
|
|
24
|
+
// legacy property
|
|
24
25
|
var enablePictureInPicture: Bool?
|
|
25
26
|
|
|
26
27
|
class VideoFeedTitleConfiguration: NSObject, Codable {
|
|
27
28
|
public var hidden: Bool?
|
|
28
29
|
public var textColor: String?
|
|
29
30
|
public var fontSize: Double?
|
|
31
|
+
public var iOSFontInfo: FontInfo?
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
class VideoFeedPlayIconConfiguration: NSObject, Codable {
|
|
@@ -44,6 +44,8 @@ RCT_CUSTOM_VIEW_PROPERTY(adConfiguration, AdConfiguration, VideoFeed) {
|
|
|
44
44
|
view.adConfiguration = config;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
RCT_EXPORT_VIEW_PROPERTY(enablePictureInPicture, BOOL)
|
|
48
|
+
|
|
47
49
|
RCT_EXPORT_VIEW_PROPERTY(onVideoFeedLoadFinished, RCTBubblingEventBlock)
|
|
48
50
|
//RCT_EXPORT_VIEW_PROPERTY(onVideoFeedClick, RCTBubblingEventBlock)
|
|
49
51
|
|
|
@@ -23,6 +23,10 @@ class VideoFeedManager: RCTViewManager, VideoFeedViewDelegate {
|
|
|
23
23
|
return true
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
override var methodQueue: DispatchQueue {
|
|
27
|
+
return DispatchQueue.main
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
// MARK: - FWVideoFeedViewDelegate
|
|
27
31
|
func videoFeedDidLoadFeed(_ view: VideoFeed) {
|
|
28
32
|
view.onVideoFeedLoadFinished?(nil)
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
8953CF5E2993E0D200F7413E /* UINavigationController+FWSwizzle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF5D2993E0D200F7413E /* UINavigationController+FWSwizzle.swift */; };
|
|
12
12
|
8953CF602993E3B200F7413E /* FWSwizzleUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF5F2993E3B200F7413E /* FWSwizzleUtil.swift */; };
|
|
13
13
|
8953CF622993E44E00F7413E /* DispatchQueue+FWOnce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF612993E44E00F7413E /* DispatchQueue+FWOnce.swift */; };
|
|
14
|
-
8953CF642993EF8200F7413E /* UIButton+FWSwizzle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF632993EF8200F7413E /* UIButton+FWSwizzle.swift */; };
|
|
15
|
-
8953CF662993F13800F7413E /* FWPiPManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF652993F13800F7413E /* FWPiPManager.swift */; };
|
|
16
14
|
8953CF6C2993FAAB00F7413E /* FWSwizzleLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 8953CF6B2993FAAB00F7413E /* FWSwizzleLoader.m */; };
|
|
17
15
|
896A8EB928E3DCCA007E51F8 /* AdConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896A8EB828E3DCCA007E51F8 /* AdConfiguration.swift */; };
|
|
18
16
|
8975235E2817DEEE0070EBB6 /* VideoFeedManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523592817DEEE0070EBB6 /* VideoFeedManager.swift */; };
|
|
@@ -45,6 +43,7 @@
|
|
|
45
43
|
8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523832817DEF80070EBB6 /* FireworkSDKModule.m */; };
|
|
46
44
|
8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523852817DEF80070EBB6 /* LiveStreamModule.swift */; };
|
|
47
45
|
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523862817DEF80070EBB6 /* LiveStreamModule.m */; };
|
|
46
|
+
89D6BBF929ACE2DC00C8AA2A /* FontInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D6BBF829ACE2DC00C8AA2A /* FontInfo.swift */; };
|
|
48
47
|
89DF27DD28A53A77003F3CCB /* StoryBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DA28A53A77003F3CCB /* StoryBlock.swift */; };
|
|
49
48
|
89DF27DE28A53A77003F3CCB /* StoryBlockManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DB28A53A77003F3CCB /* StoryBlockManager.swift */; };
|
|
50
49
|
89DF27DF28A53A77003F3CCB /* StoryBlockManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DC28A53A77003F3CCB /* StoryBlockManager.m */; };
|
|
@@ -70,8 +69,6 @@
|
|
|
70
69
|
8953CF5D2993E0D200F7413E /* UINavigationController+FWSwizzle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+FWSwizzle.swift"; sourceTree = "<group>"; };
|
|
71
70
|
8953CF5F2993E3B200F7413E /* FWSwizzleUtil.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWSwizzleUtil.swift; sourceTree = "<group>"; };
|
|
72
71
|
8953CF612993E44E00F7413E /* DispatchQueue+FWOnce.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+FWOnce.swift"; sourceTree = "<group>"; };
|
|
73
|
-
8953CF632993EF8200F7413E /* UIButton+FWSwizzle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+FWSwizzle.swift"; sourceTree = "<group>"; };
|
|
74
|
-
8953CF652993F13800F7413E /* FWPiPManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWPiPManager.swift; sourceTree = "<group>"; };
|
|
75
72
|
8953CF6A2993FAAB00F7413E /* FWSwizzleLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FWSwizzleLoader.h; sourceTree = "<group>"; };
|
|
76
73
|
8953CF6B2993FAAB00F7413E /* FWSwizzleLoader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWSwizzleLoader.m; sourceTree = "<group>"; };
|
|
77
74
|
896A8EB828E3DCCA007E51F8 /* AdConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdConfiguration.swift; sourceTree = "<group>"; };
|
|
@@ -106,6 +103,7 @@
|
|
|
106
103
|
897523832817DEF80070EBB6 /* FireworkSDKModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FireworkSDKModule.m; sourceTree = "<group>"; };
|
|
107
104
|
897523852817DEF80070EBB6 /* LiveStreamModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveStreamModule.swift; sourceTree = "<group>"; };
|
|
108
105
|
897523862817DEF80070EBB6 /* LiveStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveStreamModule.m; sourceTree = "<group>"; };
|
|
106
|
+
89D6BBF829ACE2DC00C8AA2A /* FontInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontInfo.swift; sourceTree = "<group>"; };
|
|
109
107
|
89DF27DA28A53A77003F3CCB /* StoryBlock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryBlock.swift; sourceTree = "<group>"; };
|
|
110
108
|
89DF27DB28A53A77003F3CCB /* StoryBlockManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryBlockManager.swift; sourceTree = "<group>"; };
|
|
111
109
|
89DF27DC28A53A77003F3CCB /* StoryBlockManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoryBlockManager.m; sourceTree = "<group>"; };
|
|
@@ -170,8 +168,6 @@
|
|
|
170
168
|
897523672817DEF80070EBB6 /* String+Color.swift */,
|
|
171
169
|
897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */,
|
|
172
170
|
8953CF5D2993E0D200F7413E /* UINavigationController+FWSwizzle.swift */,
|
|
173
|
-
8953CF632993EF8200F7413E /* UIButton+FWSwizzle.swift */,
|
|
174
|
-
8953CF652993F13800F7413E /* FWPiPManager.swift */,
|
|
175
171
|
8953CF6A2993FAAB00F7413E /* FWSwizzleLoader.h */,
|
|
176
172
|
8953CF6B2993FAAB00F7413E /* FWSwizzleLoader.m */,
|
|
177
173
|
);
|
|
@@ -181,6 +177,7 @@
|
|
|
181
177
|
897523692817DEF80070EBB6 /* Models */ = {
|
|
182
178
|
isa = PBXGroup;
|
|
183
179
|
children = (
|
|
180
|
+
89D6BBF729ACE28300C8AA2A /* Common */,
|
|
184
181
|
8975236A2817DEF80070EBB6 /* RNToNative */,
|
|
185
182
|
8975236E2817DEF80070EBB6 /* NativeToRN */,
|
|
186
183
|
);
|
|
@@ -263,6 +260,14 @@
|
|
|
263
260
|
path = LiveStream;
|
|
264
261
|
sourceTree = "<group>";
|
|
265
262
|
};
|
|
263
|
+
89D6BBF729ACE28300C8AA2A /* Common */ = {
|
|
264
|
+
isa = PBXGroup;
|
|
265
|
+
children = (
|
|
266
|
+
89D6BBF829ACE2DC00C8AA2A /* FontInfo.swift */,
|
|
267
|
+
);
|
|
268
|
+
path = Common;
|
|
269
|
+
sourceTree = "<group>";
|
|
270
|
+
};
|
|
266
271
|
/* End PBXGroup section */
|
|
267
272
|
|
|
268
273
|
/* Begin PBXNativeTarget section */
|
|
@@ -330,15 +335,14 @@
|
|
|
330
335
|
89DF27E128A53A89003F3CCB /* RCTConvert+StoryBlock.swift in Sources */,
|
|
331
336
|
8953CF6C2993FAAB00F7413E /* FWSwizzleLoader.m in Sources */,
|
|
332
337
|
8975235F2817DEEE0070EBB6 /* VideoFeedConfiguration.swift in Sources */,
|
|
338
|
+
89D6BBF929ACE2DC00C8AA2A /* FontInfo.swift in Sources */,
|
|
333
339
|
897523612817DEEE0070EBB6 /* VideoPlayerConfiguration.swift in Sources */,
|
|
334
340
|
897523972817DEF80070EBB6 /* Product.swift in Sources */,
|
|
335
341
|
89DF27DD28A53A77003F3CCB /* StoryBlock.swift in Sources */,
|
|
336
342
|
89DF27DF28A53A77003F3CCB /* StoryBlockManager.m in Sources */,
|
|
337
|
-
8953CF642993EF8200F7413E /* UIButton+FWSwizzle.swift in Sources */,
|
|
338
343
|
897523932817DEF80070EBB6 /* FWNavigatorModule.m in Sources */,
|
|
339
344
|
897523922817DEF80070EBB6 /* FWNavigatorModule.swift in Sources */,
|
|
340
345
|
897523872817DEF80070EBB6 /* UIViewController+AttachChild.swift in Sources */,
|
|
341
|
-
8953CF662993F13800F7413E /* FWPiPManager.swift in Sources */,
|
|
342
346
|
897523902817DEF80070EBB6 /* FWNavigatorProtocol.swift in Sources */,
|
|
343
347
|
897523882817DEF80070EBB6 /* UIView+Constraints.swift in Sources */,
|
|
344
348
|
897523982817DEF80070EBB6 /* ShoppingModule.swift in Sources */,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FontInfo.swift
|
|
3
|
+
//
|
|
4
|
+
// Created by linjie jiang on 2023/2/27.
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import UIKit
|
|
8
|
+
|
|
9
|
+
@objc
|
|
10
|
+
public class FontInfo: NSObject, Codable {
|
|
11
|
+
var fontName: String?
|
|
12
|
+
var systemFontStyle: SystemFontStyle?
|
|
13
|
+
var systemFontWeight: SystemFontWeight?
|
|
14
|
+
|
|
15
|
+
public enum SystemFontStyle: String, Codable {
|
|
16
|
+
case normal, italic
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public enum SystemFontWeight: String, Codable {
|
|
20
|
+
case ultraLight, thin, light, regular, medium, semibold, bold, heavy, black
|
|
21
|
+
|
|
22
|
+
func getFontWeight() -> UIFont.Weight {
|
|
23
|
+
switch self {
|
|
24
|
+
case .ultraLight:
|
|
25
|
+
return .ultraLight
|
|
26
|
+
case .thin:
|
|
27
|
+
return .thin
|
|
28
|
+
case .light:
|
|
29
|
+
return .light
|
|
30
|
+
case .regular:
|
|
31
|
+
return .regular
|
|
32
|
+
case .medium:
|
|
33
|
+
return .medium
|
|
34
|
+
case .semibold:
|
|
35
|
+
return .semibold
|
|
36
|
+
case .bold:
|
|
37
|
+
return .bold
|
|
38
|
+
case .heavy:
|
|
39
|
+
return .heavy
|
|
40
|
+
case .black:
|
|
41
|
+
return .black
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public func getFont(_ fontSize: Double) -> UIFont {
|
|
47
|
+
if let fontName = fontName, let font = UIFont(name: fontName, size: fontSize) {
|
|
48
|
+
return font
|
|
49
|
+
} else if let fontStyle = systemFontStyle, fontStyle == .italic {
|
|
50
|
+
return UIFont.italicSystemFont(ofSize: fontSize)
|
|
51
|
+
} else if let systemFontWeight = systemFontWeight?.getFontWeight() {
|
|
52
|
+
return UIFont.systemFont(ofSize: fontSize, weight: systemFontWeight)
|
|
53
|
+
} else {
|
|
54
|
+
return UIFont.systemFont(ofSize: fontSize)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -14,5 +14,7 @@
|
|
|
14
14
|
RCT_EXTERN_METHOD(pushNativeContainer:(NSDictionary *)props resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
15
15
|
RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
16
16
|
RCT_EXTERN_METHOD(canPopNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
17
|
+
RCT_EXTERN_METHOD(startFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
18
|
+
RCT_EXTERN_METHOD(stopFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
17
19
|
|
|
18
20
|
@end
|