react-native-firework-sdk 1.9.0 → 1.10.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +40 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +1327 -0
  7. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
  8. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  9. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
  10. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  11. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  12. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
  13. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  14. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  15. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +1327 -0
  16. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
  17. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
  19. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
  20. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
  21. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
  23. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  24. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
  25. package/ios/Components/StoryBlock.swift +5 -6
  26. package/ios/Components/StoryBlockManager.m +1 -0
  27. package/ios/Components/StoryBlockManager.swift +4 -0
  28. package/ios/Components/VideoFeed.swift +8 -7
  29. package/ios/Components/VideoFeedManager.m +1 -0
  30. package/ios/Components/VideoFeedManager.swift +4 -0
  31. package/ios/FireworkSdk.xcodeproj/project.pbxproj +1 -171
  32. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
  33. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
  34. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
  35. package/ios/{Utils/AppLanguage/Bundle+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift} +7 -7
  36. package/ios/{Utils/AppLanguage/NumberFormatter+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift} +5 -5
  37. package/ios/{Utils/AppLanguage/URLSession+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift} +7 -7
  38. package/ios/{Utils/AppLanguage/UIImageView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift} +8 -8
  39. package/ios/{Utils/AppLanguage/UILabel+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift} +17 -17
  40. package/ios/{Utils/AppLanguage/UITextField+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift} +16 -16
  41. package/ios/{Utils/AppLanguage/UITextView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift} +16 -16
  42. package/ios/{Utils/AppLanguage/UIView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift} +7 -7
  43. package/ios/{Utils/AppLanguage/UIViewController+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift} +19 -5
  44. package/ios/{Utils/AppLanguage/UIWindow+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift} +5 -5
  45. package/ios/{Utils/AppLanguage/FWLanguageUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift} +4 -4
  46. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
  47. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
  48. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
  49. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
  50. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
  51. package/ios/{Utils/Extensions/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +4 -4
  52. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
  53. package/ios/{Utils/Extensions/UIView+FWUIHierarchy.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift} +4 -5
  54. package/ios/{Utils/FWSwizzleUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift} +2 -2
  55. package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +764 -0
  56. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
  57. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  58. package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
  59. package/ios/FireworkVideoUI/Podfile +15 -0
  60. package/ios/FireworkVideoUI/Podfile.lock +16 -0
  61. package/ios/Models/NativeToRN/FireworkEventName.swift +4 -0
  62. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
  63. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
  64. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +8 -98
  65. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
  66. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +23 -6
  67. package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
  68. package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +4 -6
  69. package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +4 -1
  70. package/ios/scripts/react_native_firework_sdk_pods.rb +22 -26
  71. package/lib/commonjs/FireworkSDK.js +19 -6
  72. package/lib/commonjs/FireworkSDK.js.map +1 -1
  73. package/lib/commonjs/VideoShopping.js +1 -1
  74. package/lib/commonjs/VideoShopping.js.map +1 -1
  75. package/lib/commonjs/components/StoryBlock.js +3 -1
  76. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  77. package/lib/commonjs/components/VideoFeed.js +3 -1
  78. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  79. package/lib/commonjs/models/FWEventName.js +1 -0
  80. package/lib/commonjs/models/FWEventName.js.map +1 -1
  81. package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
  82. package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
  83. package/lib/module/FireworkSDK.js +18 -6
  84. package/lib/module/FireworkSDK.js.map +1 -1
  85. package/lib/module/VideoShopping.js +1 -1
  86. package/lib/module/VideoShopping.js.map +1 -1
  87. package/lib/module/components/StoryBlock.js +3 -1
  88. package/lib/module/components/StoryBlock.js.map +1 -1
  89. package/lib/module/components/VideoFeed.js +3 -1
  90. package/lib/module/components/VideoFeed.js.map +1 -1
  91. package/lib/module/models/FWEventName.js +1 -0
  92. package/lib/module/models/FWEventName.js.map +1 -1
  93. package/lib/module/models/VideoPlaybackEventName.js +3 -0
  94. package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
  95. package/lib/typescript/FireworkSDK.d.ts +1 -0
  96. package/lib/typescript/VideoShopping.d.ts +1 -1
  97. package/lib/typescript/components/StoryBlock.d.ts +8 -0
  98. package/lib/typescript/components/VideoFeed.d.ts +8 -0
  99. package/lib/typescript/models/FWEventName.d.ts +1 -0
  100. package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
  101. package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
  102. package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
  103. package/package.json +5 -1
  104. package/react-native-firework-sdk.podspec +10 -5
  105. package/src/FireworkSDK.ts +22 -5
  106. package/src/VideoShopping.ts +1 -1
  107. package/src/components/StoryBlock.tsx +10 -0
  108. package/src/components/VideoFeed.tsx +10 -0
  109. package/src/models/FWEventName.ts +1 -0
  110. package/src/models/StoryBlockSource.ts +2 -1
  111. package/src/models/VideoFeedSource.ts +2 -1
  112. package/src/models/VideoPlaybackEventName.ts +13 -1
  113. package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +0 -139
  114. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +0 -25
  115. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +0 -75
  116. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +0 -21
  117. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +0 -124
  118. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +0 -11
  119. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +0 -86
  120. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +0 -16
  121. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +0 -55
  122. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +0 -18
  123. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +0 -39
  124. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +0 -54
  125. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +0 -141
  126. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +0 -16
  127. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +0 -20
  128. package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +0 -52
  129. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +0 -19
  130. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +0 -49
  131. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +0 -21
  132. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +0 -38
  133. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +0 -18
  134. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +0 -43
  135. /package/ios/Support/MultiHostStreaming/{src → Sources}/MultiHostStreamingSDK.swift +0 -0
@@ -0,0 +1,199 @@
1
+ //
2
+ // UIView+LayoutFlip.swift
3
+ //
4
+ // Created by linjie jiang on 4/25/23.
5
+ //
6
+
7
+ import UIKit
8
+ import WebKit
9
+
10
+ private let gNoFlipClasses: [Any] = [
11
+ UILabel.self,
12
+ UITextView.self,
13
+ UITextField.self,
14
+ WKWebView.self,
15
+ UIImageView.self,
16
+ UISearchBar.self,
17
+ "PUPhotosSectionHeaderContentView",
18
+ "UITableViewIndex",
19
+ "UIWebView",
20
+ "X1VJUmVtb3RlVmlldw==".decodeBase64String(), // _UIRemoteView
21
+ "VUlBdXRvY29ycmVjdFRleHRWaWV3".decodeBase64String() // UIAutocorrectTextView
22
+ ]
23
+
24
+ enum LayoutFlipViewType: Int {
25
+ case auto
26
+ case inherit
27
+ case normal
28
+ case flip
29
+ case normalWithAllDescendants
30
+ case flipWithAllDescendants
31
+ }
32
+
33
+ extension UIView {
34
+ private struct AssociatedKeys {
35
+ static var viewType = "viewType"
36
+ static var calculatedViewType = "calculatedViewType"
37
+ static var lastType = "lastType"
38
+ }
39
+
40
+ static func swizzleViewMethodsForLayoutFlip() {
41
+ Swizzle.swizzleSelector(
42
+ cls: self,
43
+ originalSelector: #selector(UIView.didMoveToSuperview),
44
+ customSelector: #selector(UIView.fw_didMoveToSuperview))
45
+ Swizzle.swizzleSelector(
46
+ cls: self,
47
+ originalSelector: #selector(UIView.didMoveToWindow),
48
+ customSelector: #selector(UIView.fw_didMoveToWindow))
49
+ Swizzle.swizzleSelector(
50
+ cls: self,
51
+ originalSelector: #selector(UIView.snapshotView(afterScreenUpdates:)),
52
+ customSelector: #selector(UIView.fw_snapshotView(afterScreenUpdates:)))
53
+ }
54
+
55
+ var viewType: LayoutFlipViewType {
56
+ get {
57
+ let rawValue = objc_getAssociatedObject(self, &AssociatedKeys.viewType) as? Int ?? 0
58
+ let type = LayoutFlipViewType(rawValue: rawValue) ?? .auto
59
+
60
+ return type
61
+ }
62
+
63
+ set {
64
+ if viewType == newValue {
65
+ return
66
+ }
67
+
68
+ objc_setAssociatedObject(
69
+ self,
70
+ &AssociatedKeys.viewType,
71
+ newValue.rawValue,
72
+ .OBJC_ASSOCIATION_RETAIN_NONATOMIC
73
+ )
74
+ renewLayerTransformForceRecursively(false)
75
+ }
76
+ }
77
+
78
+ private(set) var calculatedViewType: LayoutFlipViewType {
79
+ get {
80
+ let rawValue = objc_getAssociatedObject(self, &AssociatedKeys.calculatedViewType) as? Int ?? 0
81
+ var type = LayoutFlipViewType(rawValue: rawValue) ?? .auto
82
+ if type == .auto {
83
+ if self.window != nil {
84
+ updateCalculatedViewType()
85
+ let newRawValue = objc_getAssociatedObject(self, &AssociatedKeys.calculatedViewType) as? Int ?? 0
86
+ type = LayoutFlipViewType(rawValue: newRawValue) ?? .auto
87
+ } else {
88
+ type = .normal
89
+ }
90
+ }
91
+
92
+ return type
93
+ }
94
+
95
+ set {
96
+ objc_setAssociatedObject(
97
+ self,
98
+ &AssociatedKeys.calculatedViewType,
99
+ newValue.rawValue,
100
+ .OBJC_ASSOCIATION_RETAIN_NONATOMIC
101
+ )
102
+ }
103
+ }
104
+
105
+ private var lastType: LayoutFlipViewType {
106
+ get {
107
+ let rawValue = objc_getAssociatedObject(self, &AssociatedKeys.lastType) as? Int ?? 0
108
+ let type = LayoutFlipViewType(rawValue: rawValue) ?? .auto
109
+
110
+ return type
111
+ }
112
+
113
+ set {
114
+ objc_setAssociatedObject(
115
+ self,
116
+ &AssociatedKeys.lastType,
117
+ newValue.rawValue,
118
+ .OBJC_ASSOCIATION_RETAIN_NONATOMIC
119
+ )
120
+ }
121
+ }
122
+
123
+ @objc func fw_didMoveToSuperview() {
124
+ fw_didMoveToSuperview()
125
+ renewLayerTransformForceRecursively(false)
126
+ }
127
+
128
+ @objc func fw_didMoveToWindow() {
129
+ fw_didMoveToWindow()
130
+ renewLayerTransformForceRecursively(false)
131
+ LayoutFlipManager.shared.registerUIElement(self)
132
+ }
133
+
134
+ @objc func fw_snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? {
135
+ let view = fw_snapshotView(afterScreenUpdates: afterUpdates)
136
+ view?.viewType = calculatedViewType
137
+ return view
138
+ }
139
+
140
+ func renewLayerTransformForceRecursively(_ forceRecursively: Bool) {
141
+ updateCalculatedViewType()
142
+ let updatedViewType = calculatedViewType
143
+ let superViewCalculatedViewType = superview?.calculatedViewType ?? .auto
144
+ let shouldFlipCurrentView = updatedViewType == .flip || updatedViewType == .flipWithAllDescendants
145
+ let shouldFlipSuperview = superViewCalculatedViewType == .flip
146
+ || superViewCalculatedViewType == .flipWithAllDescendants
147
+
148
+ let shouldSetFlipTransform = shouldFlipSuperview != shouldFlipCurrentView
149
+
150
+ if shouldSetFlipTransform && LayoutFlipManager.shared.enableHorizontalFlip {
151
+ layer.basicTransform = CGAffineTransformMakeScale(-1, 1)
152
+ } else {
153
+ layer.basicTransform = CGAffineTransformIdentity
154
+ }
155
+
156
+ if updatedViewType != lastType || forceRecursively {
157
+ for subView in subviews {
158
+ subView.renewLayerTransformForceRecursively(forceRecursively)
159
+ }
160
+ }
161
+
162
+ lastType = updatedViewType
163
+ }
164
+
165
+ private func automaticViewType() -> LayoutFlipViewType {
166
+ if self is UIWindow {
167
+ return .normal
168
+ }
169
+
170
+ for element in gNoFlipClasses {
171
+ if let cls = element as? AnyClass,
172
+ self.isKind(of: cls) {
173
+ return .normal
174
+
175
+ } else if let className = element as? String,
176
+ let cls = NSClassFromString(className),
177
+ self.isKind(of: cls) {
178
+ return .normal
179
+ }
180
+ }
181
+
182
+ return superview != nil ? .inherit : .normal
183
+ }
184
+
185
+ private func updateCalculatedViewType() {
186
+ var resultCalculatedViewType = viewType
187
+ if resultCalculatedViewType == .auto {
188
+ resultCalculatedViewType = automaticViewType()
189
+ }
190
+ let superViewCalculatedViewType = superview?.calculatedViewType ?? .auto
191
+ if superViewCalculatedViewType == .flipWithAllDescendants
192
+ || superViewCalculatedViewType == .normalWithAllDescendants
193
+ || resultCalculatedViewType == .inherit {
194
+ calculatedViewType = superViewCalculatedViewType
195
+ } else {
196
+ calculatedViewType = resultCalculatedViewType
197
+ }
198
+ }
199
+ }
@@ -0,0 +1,59 @@
1
+ //
2
+ // LayoutFlipManager.swift
3
+ //
4
+ // Created by linjie jiang on 4/25/23.
5
+ //
6
+
7
+ import UIKit
8
+
9
+ class LayoutFlipManager {
10
+ static let shared = LayoutFlipManager()
11
+
12
+ static func swizzelMethods() {
13
+ DispatchQueue.once {
14
+ UIView.swizzleViewMethodsForLayoutFlip()
15
+ CALayer.swizzleLayerMethodsForLayoutFlip()
16
+ }
17
+ }
18
+
19
+ var enableHorizontalFlip: Bool = false {
20
+ didSet {
21
+ if enableHorizontalFlip == oldValue {
22
+ return
23
+ }
24
+
25
+ var rootViews: Set<UIView> = Set()
26
+ for element in registeredUIElements.allObjects {
27
+ element.performReload()
28
+
29
+ if element.window != nil && element.window != element {
30
+ continue
31
+ }
32
+ rootViews.insert(rootViewForView(element))
33
+ }
34
+
35
+ for rootView in rootViews {
36
+ rootView.renewLayerTransformForceRecursively(true)
37
+ }
38
+ }
39
+ }
40
+
41
+ private var registeredUIElements: NSHashTable<UIView> = NSHashTable.weakObjects()
42
+
43
+ func registerUIElement(_ element: UIView) {
44
+ self.registeredUIElements.add(element)
45
+ }
46
+
47
+ private func rootViewForView(_ view: UIView) -> UIView {
48
+ if let window = view.window {
49
+ return window
50
+ }
51
+
52
+ var rootView: UIView = view
53
+ while let superview = rootView.superview {
54
+ rootView = superview
55
+ }
56
+
57
+ return rootView
58
+ }
59
+ }
@@ -1,16 +1,16 @@
1
1
  //
2
- // DispatchQueue+FWOnce.swift
2
+ // DispatchQueue+Once.swift
3
3
  //
4
4
  // Created by Jeff Zheng on 2022/3/1.
5
5
  //
6
6
 
7
7
  import Foundation
8
8
 
9
- extension DispatchQueue {
9
+ public extension DispatchQueue {
10
10
  private static var _onceContainer = [String]()
11
11
 
12
12
  /// Execute a block only once.
13
- public class func once(
13
+ class func once(
14
14
  file: String = #file, function: String = #function, line: Int = #line, block: () -> Void
15
15
  ) {
16
16
  let token = file + ":" + function + ":" + String(line)
@@ -18,7 +18,7 @@ extension DispatchQueue {
18
18
  }
19
19
 
20
20
  /// Execute a block only once.
21
- public class func once(token: String, block: () -> Void) {
21
+ class func once(token: String, block: () -> Void) {
22
22
  objc_sync_enter(self)
23
23
  defer { objc_sync_exit(self) }
24
24
 
@@ -0,0 +1,18 @@
1
+ //
2
+ // String+Base64.swift
3
+ //
4
+ // Created by linjie jiang on 4/25/23.
5
+ //
6
+
7
+ import Foundation
8
+
9
+ extension String {
10
+ func decodeBase64String() -> String {
11
+ if let decodedData = Data(base64Encoded: self),
12
+ let decodedString = String(data: decodedData, encoding: .utf8) {
13
+ return decodedString
14
+ }
15
+
16
+ return ""
17
+ }
18
+ }
@@ -1,6 +1,5 @@
1
1
  //
2
- // View+ParentViewController.swift
3
- // react-native-firework-sdk
2
+ // UIView+UIHierarchy.swift
4
3
  //
5
4
  // Created by Jeff Zheng on 2021/12/22.
6
5
  //
@@ -8,8 +7,8 @@
8
7
  import UIKit
9
8
  import FireworkVideo
10
9
 
11
- extension UIView {
12
- var fwParentViewController: UIViewController? {
10
+ public extension UIView {
11
+ var parentViewController: UIViewController? {
13
12
  var parentResponder: UIResponder? = self
14
13
  while parentResponder != nil {
15
14
  parentResponder = parentResponder!.next
@@ -25,7 +24,7 @@ extension UIView {
25
24
  guard self.window != nil else {
26
25
  return false
27
26
  }
28
- guard let parentVC = self.fwParentViewController else {
27
+ guard let parentVC = self.parentViewController else {
29
28
  return false
30
29
  }
31
30
  let iOSSDKBundle = Bundle(for: FireworkVideoSDK.self)
@@ -1,12 +1,12 @@
1
1
  //
2
- // FWSwizzleUtil.swift
2
+ // Swizzle.swift
3
3
  //
4
4
  // Created by linjie jiang on 2023/2/7.
5
5
  //
6
6
 
7
7
  import Foundation
8
8
 
9
- public class FWSwizzleUtil {
9
+ public class Swizzle {
10
10
  public static func swizzleSelector(cls: AnyClass, originalSelector: Selector, customSelector: Selector) {
11
11
  guard let originalMethod = class_getInstanceMethod(cls, originalSelector) else { return }
12
12
  guard let customMethod = class_getInstanceMethod(cls, customSelector) else { return }