react-native-firework-sdk 2.1.0 → 2.2.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/FireworkVideoUI.xcframework/Info.plist +40 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
- package/README.md +1 -1
- package/android/build.gradle +1 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +10 -6
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +7 -4
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +6 -0
- package/ios/Components/StoryBlock.swift +5 -6
- package/ios/Components/StoryBlockManager.m +1 -0
- package/ios/Components/StoryBlockManager.swift +4 -0
- package/ios/Components/VideoFeed.swift +12 -8
- package/ios/Components/VideoFeedManager.m +1 -0
- package/ios/Components/VideoFeedManager.swift +4 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +261 -471
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
- package/ios/{Utils/AppLanguage/Bundle+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/NumberFormatter+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift} +5 -5
- package/ios/{Utils/AppLanguage/URLSession+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/UIImageView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift} +8 -8
- package/ios/{Utils/AppLanguage/UILabel+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift} +17 -17
- package/ios/{Utils/AppLanguage/UITextField+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift} +16 -16
- package/ios/{Utils/AppLanguage/UITextView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift} +16 -16
- package/ios/{Utils/AppLanguage/UIView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/UIViewController+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift} +19 -5
- package/ios/{Utils/AppLanguage/UIWindow+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift} +5 -5
- package/ios/{Utils/AppLanguage/FWLanguageUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift} +4 -4
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
- package/ios/{Utils/Extensions/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +4 -4
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
- package/ios/{Utils/Extensions/UIView+FWUIHierarchy.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift} +4 -5
- package/ios/{Utils/FWSwizzleUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift} +2 -2
- package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
- package/ios/FireworkVideoUI/Podfile +15 -0
- package/ios/FireworkVideoUI/Podfile.lock +16 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +4 -0
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +8 -100
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +23 -7
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +0 -8
- package/ios/Modules/Shopping/ShoppingModule.swift +0 -18
- package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +4 -6
- package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +4 -1
- package/ios/scripts/react_native_firework_sdk_pods.rb +22 -26
- package/lib/commonjs/FireworkSDK.js +40 -17
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +1 -1
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +9 -9
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +6 -4
- 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/VideoPlaybackEventName.js +3 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/FireworkSDK.js +39 -17
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +2 -2
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +1 -1
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +9 -7
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +6 -4
- 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/VideoPlaybackEventName.js +3 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +8 -4
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +1 -1
- package/lib/typescript/components/StoryBlock.d.ts +7 -0
- package/lib/typescript/components/VideoFeed.d.ts +7 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/models/FWEventName.d.ts +1 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +0 -31
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
- package/package.json +7 -2
- package/react-native-firework-sdk.podspec +10 -5
- package/src/FireworkSDK.ts +41 -15
- package/src/LiveStream.ts +2 -2
- package/src/VideoShopping.ts +1 -1
- package/src/components/StoryBlock.tsx +12 -3
- package/src/components/VideoFeed.tsx +12 -4
- package/src/index.ts +0 -2
- package/src/models/FWEventName.ts +1 -0
- package/src/models/ProductInfoViewConfiguration.ts +0 -32
- package/src/models/SDKInitOptions.ts +6 -1
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlaybackDetails.ts +16 -0
- package/src/models/VideoPlaybackEventName.ts +13 -1
- package/src/models/VideoPlayerConfiguration.ts +4 -0
- package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +0 -139
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +0 -25
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +0 -75
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +0 -124
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +0 -11
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +0 -86
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +0 -55
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +0 -39
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +0 -54
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +0 -141
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +0 -20
- package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +0 -52
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +0 -19
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +0 -49
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +0 -38
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +0 -43
- /package/ios/Support/MultiHostStreaming/{src → Sources}/MultiHostStreamingSDK.swift +0 -0
|
@@ -64,6 +64,13 @@ export interface IStoryBlockProps {
|
|
|
64
64
|
* The dynamic content parameters of the story block. Required when the source is set as dynamicContent.
|
|
65
65
|
*/
|
|
66
66
|
dynamicContentParameters?: { [key: string]: string[] };
|
|
67
|
+
/**
|
|
68
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
69
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
70
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
71
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
72
|
+
*/
|
|
73
|
+
hashtagFilterExpression?: string;
|
|
67
74
|
/**
|
|
68
75
|
* Specifies if Picture in Picture is enabled. Only supported on iOS.
|
|
69
76
|
*/
|
|
@@ -250,11 +257,12 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
250
257
|
playlist = '',
|
|
251
258
|
enablePictureInPicture = false,
|
|
252
259
|
adConfiguration,
|
|
260
|
+
hashtagFilterExpression = '',
|
|
253
261
|
} = props;
|
|
254
262
|
|
|
255
|
-
const
|
|
263
|
+
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
256
264
|
const videoLaunchBehavior =
|
|
257
|
-
FireworkSDK.getInstance().
|
|
265
|
+
FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
|
|
258
266
|
const adBadgeConfiguration =
|
|
259
267
|
FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
|
|
260
268
|
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
@@ -270,7 +278,7 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
270
278
|
let key = `source:${source}`;
|
|
271
279
|
key += `_channel:${channel}`;
|
|
272
280
|
key += `_playlist:${playlist}`;
|
|
273
|
-
key += `
|
|
281
|
+
key += `_gShareBaseURL:${gShareBaseURL}`;
|
|
274
282
|
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
275
283
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
276
284
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
@@ -281,6 +289,7 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
281
289
|
key += `_requiresAds:${requiresAds}`;
|
|
282
290
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
283
291
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
292
|
+
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
284
293
|
|
|
285
294
|
return key;
|
|
286
295
|
};
|
|
@@ -51,6 +51,13 @@ export interface IVideoFeedProps {
|
|
|
51
51
|
* The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
|
|
52
52
|
*/
|
|
53
53
|
dynamicContentParameters?: { [key: string]: string[] };
|
|
54
|
+
/**
|
|
55
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
56
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
57
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
58
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
59
|
+
*/
|
|
60
|
+
hashtagFilterExpression?: string;
|
|
54
61
|
/**
|
|
55
62
|
* One of three available display modes. Defaults to row.
|
|
56
63
|
*/
|
|
@@ -210,11 +217,12 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
210
217
|
mode = 'row',
|
|
211
218
|
adConfiguration,
|
|
212
219
|
enablePictureInPicture = false,
|
|
220
|
+
hashtagFilterExpression = '',
|
|
213
221
|
} = this.props;
|
|
214
222
|
const videoFeedConfiguration = this._getVideoFeedConfiguration();
|
|
215
223
|
const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
|
|
216
224
|
const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
|
|
217
|
-
const
|
|
225
|
+
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
218
226
|
const adBadgeConfiguration =
|
|
219
227
|
FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
|
|
220
228
|
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
@@ -230,9 +238,8 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
230
238
|
const vastAttributesString = this._generateVastAttributesString();
|
|
231
239
|
const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;
|
|
232
240
|
const videoLaunchBehavior =
|
|
233
|
-
FireworkSDK.getInstance().
|
|
241
|
+
FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
|
|
234
242
|
const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
|
|
235
|
-
|
|
236
243
|
let key = `source:${source}`;
|
|
237
244
|
key += `_channel:${channel}`;
|
|
238
245
|
key += `_playlist:${playlist}`;
|
|
@@ -240,7 +247,7 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
240
247
|
key += `_mode:${mode}`;
|
|
241
248
|
key += `_titleHidden:${titleHidden}`;
|
|
242
249
|
key += `_titlePosition:${titlePosition}`;
|
|
243
|
-
key += `
|
|
250
|
+
key += `_gShareBaseURL:${gShareBaseURL}`;
|
|
244
251
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
245
252
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
246
253
|
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
@@ -254,6 +261,7 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
254
261
|
key += `_showAdBadge:${showAdBadge}`;
|
|
255
262
|
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
256
263
|
key += `_appLanguage:${appLanguage}`;
|
|
264
|
+
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
257
265
|
|
|
258
266
|
return (
|
|
259
267
|
<FWVideoFeed
|
package/src/index.ts
CHANGED
|
@@ -48,7 +48,6 @@ import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
|
48
48
|
import type Product from './models/Product';
|
|
49
49
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
50
50
|
import type {
|
|
51
|
-
AddToCartButtonConfiguration,
|
|
52
51
|
LinkButtonConfiguration,
|
|
53
52
|
ShoppingCTAButtonConfiguration,
|
|
54
53
|
ShoppingCTAButtonText,
|
|
@@ -93,7 +92,6 @@ export {
|
|
|
93
92
|
AdBadgeConfiguration,
|
|
94
93
|
AdBadgeTextType,
|
|
95
94
|
AdConfiguration,
|
|
96
|
-
AddToCartButtonConfiguration,
|
|
97
95
|
AndroidFontInfo,
|
|
98
96
|
CustomClickCartIconCallback,
|
|
99
97
|
CustomClickLinkButtonCallback,
|
|
@@ -13,6 +13,7 @@ export enum FWEventName {
|
|
|
13
13
|
VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',
|
|
14
14
|
AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',
|
|
15
15
|
AppLanguageUpdated = 'fw:app-language-updated',
|
|
16
|
+
NativeAppLanguageUpdated = 'fw:native-app-language-updated',
|
|
16
17
|
LogMessage = 'fw:log-message',
|
|
17
18
|
CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',
|
|
18
19
|
}
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated The interface will be removed since RN SDK V2.1.
|
|
5
|
-
* Use {@link ShoppingCTAButtonConfiguration} instead.
|
|
6
|
-
*/
|
|
7
|
-
export interface AddToCartButtonConfiguration {
|
|
8
|
-
/**
|
|
9
|
-
* The background color of "Add to cart" button.
|
|
10
|
-
*/
|
|
11
|
-
backgroundColor?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The text color of "Add to cart" button.
|
|
14
|
-
*/
|
|
15
|
-
textColor?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The font size of "Add to cart" button.
|
|
18
|
-
*/
|
|
19
|
-
fontSize?: number;
|
|
20
|
-
/**
|
|
21
|
-
* The iOS font info of "Add to cart" button.
|
|
22
|
-
* The property is ignored when fontSize is not set.
|
|
23
|
-
* Only supported on iOS.
|
|
24
|
-
*/
|
|
25
|
-
iOSFontInfo?: IOSFontInfo;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
3
|
export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
|
|
29
4
|
|
|
30
5
|
export interface ShoppingCTAButtonConfiguration {
|
|
@@ -56,13 +31,6 @@ export interface LinkButtonConfiguration {
|
|
|
56
31
|
}
|
|
57
32
|
|
|
58
33
|
export default interface ProductInfoViewConfiguration {
|
|
59
|
-
/**
|
|
60
|
-
* Configuration of "Add to cart" button. Only supported on iOS.
|
|
61
|
-
*
|
|
62
|
-
* @deprecated The property will be removed since RN SDK V2.1.
|
|
63
|
-
* Use {@link ctaButton} instead.
|
|
64
|
-
*/
|
|
65
|
-
addToCartButton?: AddToCartButtonConfiguration;
|
|
66
34
|
/**
|
|
67
35
|
* Configuration of shopping CTA button. Only supported on iOS.
|
|
68
36
|
*/
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
2
2
|
|
|
3
3
|
export default interface SDKInitOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Custom value to identify the current user.
|
|
6
|
+
*/
|
|
4
7
|
userId?: string;
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Behavior occurring after video is launched.
|
|
10
|
+
*/
|
|
6
11
|
videoLaunchBehavior?: VideoLaunchBehavior;
|
|
7
12
|
}
|
|
@@ -28,4 +28,20 @@ export default interface VideoPlaybackDetails {
|
|
|
28
28
|
* Indicates if the video is associated with a call-to-action (CTA).
|
|
29
29
|
*/
|
|
30
30
|
hasCTA?: boolean | null;
|
|
31
|
+
/**
|
|
32
|
+
* The amount of time the video was playing at the time of the event.
|
|
33
|
+
*/
|
|
34
|
+
progress?: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* The type of the CTA button clicked: "buy" "download" "view" "book".
|
|
37
|
+
*/
|
|
38
|
+
ctaActionType?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The url of the CTA button clicked.
|
|
41
|
+
*/
|
|
42
|
+
ctaActionURL?: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* The associated feed ID
|
|
45
|
+
*/
|
|
46
|
+
feedId?: string | null;
|
|
31
47
|
}
|
|
@@ -7,6 +7,14 @@ enum VideoPlaybackEventName {
|
|
|
7
7
|
* Video started.
|
|
8
8
|
*/
|
|
9
9
|
Start = 'fw:video:start',
|
|
10
|
+
/**
|
|
11
|
+
* Video paused.
|
|
12
|
+
*/
|
|
13
|
+
Pause = 'fw:video:pause',
|
|
14
|
+
/**
|
|
15
|
+
* Video resume.
|
|
16
|
+
*/
|
|
17
|
+
Resume = 'fw:video:resume',
|
|
10
18
|
/**
|
|
11
19
|
* Video reached 25%.
|
|
12
20
|
*/
|
|
@@ -24,7 +32,11 @@ enum VideoPlaybackEventName {
|
|
|
24
32
|
*/
|
|
25
33
|
Complete = 'fw:video:complete',
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
35
|
+
* Ad video started playing.
|
|
36
|
+
*/
|
|
37
|
+
AdStart = 'fw:video:ad-start',
|
|
38
|
+
/**
|
|
39
|
+
* Ad video completed playing.
|
|
28
40
|
*/
|
|
29
41
|
AdEnd = 'fw:video:ad-end',
|
|
30
42
|
/**
|
|
@@ -72,4 +72,8 @@ export default interface VideoPlayerConfiguration {
|
|
|
72
72
|
* Specifies the delay before the highlight animation occurs. Only supported on iOS.
|
|
73
73
|
*/
|
|
74
74
|
ctaHighlightDelay?: VideoPlayerCTADelay;
|
|
75
|
+
/**
|
|
76
|
+
* The share base URL of the video.
|
|
77
|
+
*/
|
|
78
|
+
shareBaseURL?: string;
|
|
75
79
|
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FWAppLanguageManager.swift
|
|
3
|
-
//
|
|
4
|
-
// Created by linjie jiang on 2023/2/7.
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
import Foundation
|
|
8
|
-
|
|
9
|
-
private let appLanguageStorageKey = "firework_sdk_app_language_storage_key"
|
|
10
|
-
|
|
11
|
-
public enum AppLanguageLayoutDirection: Int {
|
|
12
|
-
case ltr, rtl, unsupported
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public class FWAppLanguageManager {
|
|
16
|
-
public static let shared = FWAppLanguageManager()
|
|
17
|
-
|
|
18
|
-
private var _systemLanguage: String?
|
|
19
|
-
private var _systemLanguageCode: String? {
|
|
20
|
-
guard let language = _systemLanguage else {
|
|
21
|
-
return nil
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return FWLanguageUtil.getLanguageCode(language)
|
|
25
|
-
}
|
|
26
|
-
private var _hasInitialized: Bool = false
|
|
27
|
-
|
|
28
|
-
public var appLanguage: String? {
|
|
29
|
-
didSet {
|
|
30
|
-
if appLanguage != nil {
|
|
31
|
-
FWAppLanguageManager.swizzelMethods()
|
|
32
|
-
FWRTLManager.sharedInstance().enableHorizontalFlip = shouldHorizontalFlip
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public var appLanguageCode: String? {
|
|
38
|
-
guard let language = appLanguage else {
|
|
39
|
-
return nil
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return FWLanguageUtil.getLanguageCode(language)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public var appLanguageLayoutDirection: AppLanguageLayoutDirection? {
|
|
46
|
-
guard let languageCode = appLanguageCode else {
|
|
47
|
-
return nil
|
|
48
|
-
}
|
|
49
|
-
let direction = Locale.characterDirection(forLanguage: languageCode)
|
|
50
|
-
switch direction {
|
|
51
|
-
case .leftToRight:
|
|
52
|
-
return .ltr
|
|
53
|
-
case .rightToLeft:
|
|
54
|
-
return .rtl
|
|
55
|
-
default:
|
|
56
|
-
return .unsupported
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public var shouldHorizontalFlip: Bool {
|
|
61
|
-
guard let appLanguageCode = appLanguageCode else {
|
|
62
|
-
return false
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
guard let systemLanguageCode = _systemLanguageCode else {
|
|
66
|
-
return false
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let appLanguageDirection = Locale.characterDirection(forLanguage: appLanguageCode)
|
|
70
|
-
let systemLanguageDirection = Locale.characterDirection(forLanguage: systemLanguageCode)
|
|
71
|
-
|
|
72
|
-
if appLanguageDirection == .leftToRight, systemLanguageDirection == .rightToLeft {
|
|
73
|
-
return true
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if appLanguageDirection == .rightToLeft, systemLanguageDirection == .leftToRight {
|
|
77
|
-
return true
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return false
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private static func swizzelMethods() {
|
|
84
|
-
DispatchQueue.once {
|
|
85
|
-
UIViewController.swizzleMethodsForViewController()
|
|
86
|
-
Bundle.swizzleMethodsForBundle()
|
|
87
|
-
URLSession.swizzleMethodsForURLSession()
|
|
88
|
-
NumberFormatter.swizzleMethodsForNumberFormatter()
|
|
89
|
-
UIImageView.swizzleMethodsForImageView()
|
|
90
|
-
UILabel.swizzleMethodsForLabel()
|
|
91
|
-
UITextField.swizzleMethodsForTextField()
|
|
92
|
-
UITextView.swizzleMethodsForTextView()
|
|
93
|
-
UIWindow.swizzleMethodsForWindow()
|
|
94
|
-
UIView.swizzleMethodsForView()
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
private init() {
|
|
99
|
-
initializeManager()
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public func initializeManager() {
|
|
103
|
-
guard !_hasInitialized else {
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
_hasInitialized = true
|
|
107
|
-
|
|
108
|
-
self._systemLanguage = Locale.preferredLanguages.first
|
|
109
|
-
let cachedAppLanguage = UserDefaults.standard.object(forKey: appLanguageStorageKey) as? String
|
|
110
|
-
if FWLanguageUtil.isValidLanguage(cachedAppLanguage) {
|
|
111
|
-
self.appLanguage = cachedAppLanguage
|
|
112
|
-
}
|
|
113
|
-
#if DEBUG
|
|
114
|
-
print("""
|
|
115
|
-
FWAppLanguageManager init method
|
|
116
|
-
current app language: \(self.appLanguage ?? "")
|
|
117
|
-
system language: \(self._systemLanguage ?? "")
|
|
118
|
-
""")
|
|
119
|
-
#endif
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public func changeAppLanguage(_ language: String?) -> Bool {
|
|
123
|
-
guard let language = language, language.count > 0 else {
|
|
124
|
-
appLanguage = nil
|
|
125
|
-
UserDefaults.standard.removeObject(forKey: appLanguageStorageKey)
|
|
126
|
-
UserDefaults.standard.synchronize()
|
|
127
|
-
return true
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if FWLanguageUtil.isValidLanguage(language) {
|
|
131
|
-
appLanguage = language
|
|
132
|
-
UserDefaults.standard.set(language, forKey: appLanguageStorageKey)
|
|
133
|
-
UserDefaults.standard.synchronize()
|
|
134
|
-
return true
|
|
135
|
-
} else {
|
|
136
|
-
return false
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FWRTLManager.h
|
|
3
|
-
// FWRTL
|
|
4
|
-
//
|
|
5
|
-
// Created by ByteDance on 2018/9/10.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
-
|
|
12
|
-
@interface FWRTLManager : NSObject
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Turn on / off FWRTL via this property.
|
|
16
|
-
*/
|
|
17
|
-
@property (nonatomic, assign) BOOL enableHorizontalFlip;
|
|
18
|
-
|
|
19
|
-
+ (instancetype)sharedInstance;
|
|
20
|
-
|
|
21
|
-
- (void)registerUIElement:(UIView *)element;
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FWRTLManager.m
|
|
3
|
-
// FWRTL
|
|
4
|
-
//
|
|
5
|
-
// Created by ByteDance on 2018/9/10.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "FWRTLManager.h"
|
|
9
|
-
#import "UIView+FWRTL.h"
|
|
10
|
-
#import "NSObject+FWRTLReloadBlock.h"
|
|
11
|
-
#import "FWRTLDefinitions.h"
|
|
12
|
-
|
|
13
|
-
@interface FWRTLManager ()
|
|
14
|
-
|
|
15
|
-
@property (nonatomic, strong) NSPointerArray *registeredUIElements;
|
|
16
|
-
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
@implementation FWRTLManager
|
|
20
|
-
|
|
21
|
-
+ (instancetype)sharedInstance
|
|
22
|
-
{
|
|
23
|
-
static FWRTLManager *manager;
|
|
24
|
-
static dispatch_once_t onceToken;
|
|
25
|
-
dispatch_once(&onceToken, ^{
|
|
26
|
-
manager = [[FWRTLManager alloc] init];
|
|
27
|
-
manager.registeredUIElements = [NSPointerArray pointerArrayWithOptions:NSPointerFunctionsWeakMemory];
|
|
28
|
-
});
|
|
29
|
-
return manager;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
- (void)registerUIElement:(UIView *)element
|
|
33
|
-
{
|
|
34
|
-
[self.registeredUIElements addPointer:(__bridge void * _Nullable)(element)];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
- (void)setEnableHorizontalFlip:(BOOL)enableHorizontalFlip
|
|
38
|
-
{
|
|
39
|
-
if (enableHorizontalFlip == _enableHorizontalFlip) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
_enableHorizontalFlip = enableHorizontalFlip;
|
|
43
|
-
NSInteger count = self.registeredUIElements.count;
|
|
44
|
-
NSMutableSet<UIView *> *rootViews = [NSMutableSet set];
|
|
45
|
-
for (NSInteger i = 0; i < count; i++) {
|
|
46
|
-
UIView *element = (UIView *)[self.registeredUIElements pointerAtIndex:i];
|
|
47
|
-
[element fwrtl_performReload];
|
|
48
|
-
if (!element) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
if (element.window && element.window != element) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[rootViews addObject:[self rootViewForView:element]];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[rootViews enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, BOOL * _Nonnull stop) {
|
|
59
|
-
[obj fwrtl_renewLayerTransformForceRecursively:YES];
|
|
60
|
-
}];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
- (UIView *)rootViewForView:(UIView *)view
|
|
64
|
-
{
|
|
65
|
-
if (view.window) {
|
|
66
|
-
return view.window;
|
|
67
|
-
}
|
|
68
|
-
UIView *rootView = view;
|
|
69
|
-
while (rootView.superview) {
|
|
70
|
-
rootView = rootView.superview;
|
|
71
|
-
}
|
|
72
|
-
return rootView;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CALayer+FWRTL.h
|
|
3
|
-
// FWRTL
|
|
4
|
-
//
|
|
5
|
-
// Created by ByteDance on 2018/9/10.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <QuartzCore/QuartzCore.h>
|
|
9
|
-
|
|
10
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
-
|
|
12
|
-
@interface CALayer (FWRTL)
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Additional property for CALayer, which will be multiplied to the original transform before set.
|
|
16
|
-
*/
|
|
17
|
-
@property (nonatomic, assign) CGAffineTransform fwrtl_basicTransform;
|
|
18
|
-
|
|
19
|
-
@end
|
|
20
|
-
|
|
21
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CALayer+FWRTL.m
|
|
3
|
-
// FWRTL
|
|
4
|
-
//
|
|
5
|
-
// Created by ByteDance on 2018/9/10.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "CALayer+FWRTL.h"
|
|
9
|
-
#import "FWRTLDefinitions.h"
|
|
10
|
-
#import "FWRTLManager.h"
|
|
11
|
-
|
|
12
|
-
static BOOL shouldEnableHorizontalFlip = NO;
|
|
13
|
-
|
|
14
|
-
@implementation CALayer (FWRTL)
|
|
15
|
-
|
|
16
|
-
+ (void)load
|
|
17
|
-
{
|
|
18
|
-
FWSwizzle(self, setAffineTransform:, fwrtl_setAffineTransform:);
|
|
19
|
-
FWSwizzle(self, affineTransform, fwrtl_affineTransform);
|
|
20
|
-
FWSwizzle(self, addAnimation:forKey:, fwrtl_addAnimation:forKey:);
|
|
21
|
-
FWSwizzle(self, renderInContext:, fwrtl_renderInContext:);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
- (void)setFwrtl_basicTransform:(CGAffineTransform)fwrtl_basicTransform
|
|
25
|
-
{
|
|
26
|
-
if (!objc_getAssociatedObject(self, @selector(fwrtl_basicTransform)) && CGAffineTransformIsIdentity(fwrtl_basicTransform)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
objc_setAssociatedObject(self, @selector(fwrtl_basicTransform), [NSValue valueWithCGAffineTransform:fwrtl_basicTransform], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
30
|
-
self.affineTransform = self.affineTransform;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (CGAffineTransform)fwrtl_basicTransform
|
|
34
|
-
{
|
|
35
|
-
NSValue *value = objc_getAssociatedObject(self, _cmd);
|
|
36
|
-
return value ? [value CGAffineTransformValue] : CGAffineTransformIdentity;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
- (void)setFwrtl_isRenderStartLayer:(BOOL)fwrtl_isRenderStartLayer
|
|
40
|
-
{
|
|
41
|
-
objc_setAssociatedObject(self, @selector(fwrtl_isRenderStartLayer), @(fwrtl_isRenderStartLayer), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
- (BOOL)fwrtl_isRenderStartLayer
|
|
45
|
-
{
|
|
46
|
-
return [objc_getAssociatedObject(self, _cmd) boolValue];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
- (void)fwrtl_setAffineTransform:(CGAffineTransform)m
|
|
50
|
-
{
|
|
51
|
-
if (!shouldEnableHorizontalFlip && [FWRTLManager sharedInstance].enableHorizontalFlip) {
|
|
52
|
-
shouldEnableHorizontalFlip = YES;
|
|
53
|
-
}
|
|
54
|
-
if (shouldEnableHorizontalFlip) {
|
|
55
|
-
objc_setAssociatedObject(self, @selector(fwrtl_affineTransform), [NSValue valueWithCGAffineTransform:m], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
56
|
-
[self fwrtl_setAffineTransform:CGAffineTransformConcat(self.fwrtl_basicTransform, m)];
|
|
57
|
-
} else {
|
|
58
|
-
[self fwrtl_setAffineTransform:m];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
- (CGAffineTransform)fwrtl_affineTransform
|
|
63
|
-
{
|
|
64
|
-
if (!shouldEnableHorizontalFlip && [FWRTLManager sharedInstance].enableHorizontalFlip) {
|
|
65
|
-
shouldEnableHorizontalFlip = YES;
|
|
66
|
-
}
|
|
67
|
-
if (shouldEnableHorizontalFlip) {
|
|
68
|
-
NSValue *value = objc_getAssociatedObject(self, @selector(fwrtl_affineTransform));
|
|
69
|
-
return value ? [value CGAffineTransformValue] : [self fwrtl_affineTransform];
|
|
70
|
-
} else {
|
|
71
|
-
return [self fwrtl_affineTransform];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
- (void)fwrtl_addAnimation:(CAAnimation *)anim forKey:(NSString *)key
|
|
76
|
-
{
|
|
77
|
-
if ([anim isKindOfClass:[CABasicAnimation class]]) {
|
|
78
|
-
CABasicAnimation *basicAnim = (CABasicAnimation *)anim;
|
|
79
|
-
if ([basicAnim.keyPath hasPrefix:@"transform.scale"] && self.fwrtl_basicTransform.a == -1) {
|
|
80
|
-
basicAnim.fromValue = @([basicAnim.fromValue floatValue] * -1);
|
|
81
|
-
basicAnim.toValue = @([basicAnim.toValue floatValue] * -1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
[self fwrtl_addAnimation:anim forKey:key];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
- (void)fwrtl_renderInContext:(CGContextRef)ctx
|
|
88
|
-
{
|
|
89
|
-
if (!shouldEnableHorizontalFlip && [FWRTLManager sharedInstance].enableHorizontalFlip) {
|
|
90
|
-
shouldEnableHorizontalFlip = YES;
|
|
91
|
-
}
|
|
92
|
-
if (shouldEnableHorizontalFlip) {
|
|
93
|
-
BOOL isRenderStartLayer = YES;
|
|
94
|
-
CGAffineTransform allSuperLayerTransform = self.fwrtl_basicTransform;
|
|
95
|
-
CALayer *layer = self;
|
|
96
|
-
while (layer.superlayer) {
|
|
97
|
-
layer = layer.superlayer;
|
|
98
|
-
if ([layer fwrtl_isRenderStartLayer]) {
|
|
99
|
-
isRenderStartLayer = NO;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
allSuperLayerTransform = CGAffineTransformConcat(layer.fwrtl_basicTransform, allSuperLayerTransform);
|
|
103
|
-
}
|
|
104
|
-
if (isRenderStartLayer) {
|
|
105
|
-
[self setFwrtl_isRenderStartLayer:YES];
|
|
106
|
-
if (allSuperLayerTransform.a == -1) {
|
|
107
|
-
CGContextSaveGState(ctx);
|
|
108
|
-
CGContextConcatCTM(ctx, CGAffineTransformMakeScale(-1, 1));
|
|
109
|
-
CGContextTranslateCTM(ctx, -self.bounds.size.width, 0);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
[self fwrtl_renderInContext:ctx];
|
|
113
|
-
if (isRenderStartLayer) {
|
|
114
|
-
[self setFwrtl_isRenderStartLayer:NO];
|
|
115
|
-
if (allSuperLayerTransform.a == -1) {
|
|
116
|
-
CGContextRestoreGState(ctx);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
[self fwrtl_renderInContext:ctx];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
@end
|