@shortkitsdk/react-native 0.2.35 → 0.2.37
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/build.gradle.kts +8 -0
- package/android/libs/shortkit-release.aar +0 -0
- package/android/src/main/java/com/shortkit/reactnative/ReactCarouselOverlayHost.kt +94 -46
- package/android/src/main/java/com/shortkit/reactnative/ReactOverlayHost.kt +46 -7
- package/android/src/main/java/com/shortkit/reactnative/ReactVideoCarouselOverlayHost.kt +233 -27
- package/android/src/main/java/com/shortkit/reactnative/ShortKitBridge.kt +252 -27
- package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedView.kt +135 -6
- package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedViewManager.kt +15 -0
- package/android/src/main/java/com/shortkit/reactnative/ShortKitModule.kt +21 -11
- package/android/src/test/java/com/shortkit/reactnative/ReactCarouselOverlayHostEmitTest.kt +134 -0
- package/android/src/test/java/com/shortkit/reactnative/ReactOverlayHostDragTest.kt +45 -0
- package/android/src/test/java/com/shortkit/reactnative/ReactVideoCarouselOverlayHostDragTest.kt +69 -0
- package/android/src/test/java/com/shortkit/reactnative/ReactVideoCarouselOverlayHostEmitTest.kt +144 -0
- package/android/src/test/java/com/shortkit/reactnative/ShortKitFeedViewActivePropTest.kt +57 -0
- package/ios/ReactOverlayHost.swift +10 -8
- package/ios/ReactVideoCarouselOverlayHost.swift +14 -11
- package/ios/ShortKitBridge.swift +18 -0
- package/ios/ShortKitModule.mm +5 -0
- package/ios/ShortKitPlayerNativeView.swift +36 -0
- package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +932 -84
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +932 -84
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +932 -84
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +26 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
- package/package.json +1 -1
- package/src/ShortKitCommands.ts +20 -0
- package/src/ShortKitFeed.tsx +21 -0
- package/src/specs/NativeShortKitModule.ts +10 -0
- package/src/types.ts +35 -0
|
@@ -556,6 +556,14 @@ public enum ShortKitFeedLifecycle {
|
|
|
556
556
|
get
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
+
public enum VideoCarouselCellLongPressState : Swift.String {
|
|
560
|
+
case began, ended, cancelled
|
|
561
|
+
public init?(rawValue: Swift.String)
|
|
562
|
+
public typealias RawValue = Swift.String
|
|
563
|
+
public var rawValue: Swift.String {
|
|
564
|
+
get
|
|
565
|
+
}
|
|
566
|
+
}
|
|
559
567
|
@objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency public class ShortKitFeedViewController : UIKit.UIViewController {
|
|
560
568
|
@_Concurrency.MainActor @preconcurrency public var debugPanelFactory: ((_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView)?
|
|
561
569
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
@@ -567,6 +575,13 @@ public enum ShortKitFeedLifecycle {
|
|
|
567
575
|
public let pageIndex: Swift.Int
|
|
568
576
|
}
|
|
569
577
|
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
|
|
578
|
+
public struct VideoCarouselCellLongPressPayload {
|
|
579
|
+
public let id: Swift.String
|
|
580
|
+
public let index: Swift.Int
|
|
581
|
+
public let pageIndex: Swift.Int
|
|
582
|
+
public let state: ShortKitSDK.VideoCarouselCellLongPressState
|
|
583
|
+
}
|
|
584
|
+
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellLongPress: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellLongPressPayload) -> Swift.Void)?
|
|
570
585
|
@_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
|
|
571
586
|
@_Concurrency.MainActor @preconcurrency public var onFeedTransition: ((ShortKitSDK.FeedTransitionEvent) -> Swift.Void)?
|
|
572
587
|
@_Concurrency.MainActor @preconcurrency public var isActiveSurface: Swift.Bool {
|
|
@@ -893,12 +908,13 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
893
908
|
public struct VideoCarouselInput : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
894
909
|
public let id: Swift.String
|
|
895
910
|
public let videos: [ShortKitSDK.VideoCarouselVideoInput]
|
|
911
|
+
public let initialPageIndex: Swift.Int?
|
|
896
912
|
public let title: Swift.String?
|
|
897
913
|
public let description: Swift.String?
|
|
898
914
|
public let author: Swift.String?
|
|
899
915
|
public let section: Swift.String?
|
|
900
916
|
public let articleUrl: Swift.String?
|
|
901
|
-
public init(id: Swift.String, videos: [ShortKitSDK.VideoCarouselVideoInput], title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
917
|
+
public init(id: Swift.String, videos: [ShortKitSDK.VideoCarouselVideoInput], initialPageIndex: Swift.Int? = nil, title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
902
918
|
public static func == (a: ShortKitSDK.VideoCarouselInput, b: ShortKitSDK.VideoCarouselInput) -> Swift.Bool
|
|
903
919
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
904
920
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -906,12 +922,16 @@ public struct VideoCarouselInput : Swift.Codable, Swift.Equatable, Swift.Sendabl
|
|
|
906
922
|
public struct VideoCarouselItem : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
907
923
|
public let id: Swift.String
|
|
908
924
|
public let videos: [ShortKitSDK.ContentItem]
|
|
925
|
+
public let initialPageIndex: Swift.Int?
|
|
909
926
|
public let title: Swift.String?
|
|
910
927
|
public let description: Swift.String?
|
|
911
928
|
public let author: Swift.String?
|
|
912
929
|
public let section: Swift.String?
|
|
913
930
|
public let articleUrl: Swift.String?
|
|
914
|
-
public init(id: Swift.String, videos: [ShortKitSDK.ContentItem], title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
931
|
+
public init(id: Swift.String, videos: [ShortKitSDK.ContentItem], initialPageIndex: Swift.Int? = nil, title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
932
|
+
public var clampedInitialPageIndex: Swift.Int {
|
|
933
|
+
get
|
|
934
|
+
}
|
|
915
935
|
public static func == (a: ShortKitSDK.VideoCarouselItem, b: ShortKitSDK.VideoCarouselItem) -> Swift.Bool
|
|
916
936
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
917
937
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -1165,6 +1185,7 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
1165
1185
|
final public func setMaxBitrate(_ bps: Swift.Int)
|
|
1166
1186
|
final public func setCaptionsEnabled(_ enabled: Swift.Bool)
|
|
1167
1187
|
final public func selectCaptionTrack(language: Swift.String)
|
|
1188
|
+
final public func setFeedScrollEnabled(_ enabled: Swift.Bool)
|
|
1168
1189
|
final public func dismissLiveRoom()
|
|
1169
1190
|
final public func seekThumbnail(at time: Swift.Double) -> UIKit.UIImage?
|
|
1170
1191
|
@objc deinit
|
|
@@ -1357,6 +1378,9 @@ extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
|
1357
1378
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
|
1358
1379
|
extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Equatable {}
|
|
1359
1380
|
extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Hashable {}
|
|
1381
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.Equatable {}
|
|
1382
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.Hashable {}
|
|
1383
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.RawRepresentable {}
|
|
1360
1384
|
extension ShortKitSDK.CaptionSource : Swift.Equatable {}
|
|
1361
1385
|
extension ShortKitSDK.CaptionSource : Swift.Hashable {}
|
|
1362
1386
|
extension ShortKitSDK.CaptionSource : Swift.RawRepresentable {}
|
|
Binary file
|
|
@@ -556,6 +556,14 @@ public enum ShortKitFeedLifecycle {
|
|
|
556
556
|
get
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
+
public enum VideoCarouselCellLongPressState : Swift.String {
|
|
560
|
+
case began, ended, cancelled
|
|
561
|
+
public init?(rawValue: Swift.String)
|
|
562
|
+
public typealias RawValue = Swift.String
|
|
563
|
+
public var rawValue: Swift.String {
|
|
564
|
+
get
|
|
565
|
+
}
|
|
566
|
+
}
|
|
559
567
|
@objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency public class ShortKitFeedViewController : UIKit.UIViewController {
|
|
560
568
|
@_Concurrency.MainActor @preconcurrency public var debugPanelFactory: ((_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView)?
|
|
561
569
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
@@ -567,6 +575,13 @@ public enum ShortKitFeedLifecycle {
|
|
|
567
575
|
public let pageIndex: Swift.Int
|
|
568
576
|
}
|
|
569
577
|
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
|
|
578
|
+
public struct VideoCarouselCellLongPressPayload {
|
|
579
|
+
public let id: Swift.String
|
|
580
|
+
public let index: Swift.Int
|
|
581
|
+
public let pageIndex: Swift.Int
|
|
582
|
+
public let state: ShortKitSDK.VideoCarouselCellLongPressState
|
|
583
|
+
}
|
|
584
|
+
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellLongPress: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellLongPressPayload) -> Swift.Void)?
|
|
570
585
|
@_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
|
|
571
586
|
@_Concurrency.MainActor @preconcurrency public var onFeedTransition: ((ShortKitSDK.FeedTransitionEvent) -> Swift.Void)?
|
|
572
587
|
@_Concurrency.MainActor @preconcurrency public var isActiveSurface: Swift.Bool {
|
|
@@ -893,12 +908,13 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
893
908
|
public struct VideoCarouselInput : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
894
909
|
public let id: Swift.String
|
|
895
910
|
public let videos: [ShortKitSDK.VideoCarouselVideoInput]
|
|
911
|
+
public let initialPageIndex: Swift.Int?
|
|
896
912
|
public let title: Swift.String?
|
|
897
913
|
public let description: Swift.String?
|
|
898
914
|
public let author: Swift.String?
|
|
899
915
|
public let section: Swift.String?
|
|
900
916
|
public let articleUrl: Swift.String?
|
|
901
|
-
public init(id: Swift.String, videos: [ShortKitSDK.VideoCarouselVideoInput], title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
917
|
+
public init(id: Swift.String, videos: [ShortKitSDK.VideoCarouselVideoInput], initialPageIndex: Swift.Int? = nil, title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
902
918
|
public static func == (a: ShortKitSDK.VideoCarouselInput, b: ShortKitSDK.VideoCarouselInput) -> Swift.Bool
|
|
903
919
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
904
920
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -906,12 +922,16 @@ public struct VideoCarouselInput : Swift.Codable, Swift.Equatable, Swift.Sendabl
|
|
|
906
922
|
public struct VideoCarouselItem : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
907
923
|
public let id: Swift.String
|
|
908
924
|
public let videos: [ShortKitSDK.ContentItem]
|
|
925
|
+
public let initialPageIndex: Swift.Int?
|
|
909
926
|
public let title: Swift.String?
|
|
910
927
|
public let description: Swift.String?
|
|
911
928
|
public let author: Swift.String?
|
|
912
929
|
public let section: Swift.String?
|
|
913
930
|
public let articleUrl: Swift.String?
|
|
914
|
-
public init(id: Swift.String, videos: [ShortKitSDK.ContentItem], title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
931
|
+
public init(id: Swift.String, videos: [ShortKitSDK.ContentItem], initialPageIndex: Swift.Int? = nil, title: Swift.String? = nil, description: Swift.String? = nil, author: Swift.String? = nil, section: Swift.String? = nil, articleUrl: Swift.String? = nil)
|
|
932
|
+
public var clampedInitialPageIndex: Swift.Int {
|
|
933
|
+
get
|
|
934
|
+
}
|
|
915
935
|
public static func == (a: ShortKitSDK.VideoCarouselItem, b: ShortKitSDK.VideoCarouselItem) -> Swift.Bool
|
|
916
936
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
917
937
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -1165,6 +1185,7 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
1165
1185
|
final public func setMaxBitrate(_ bps: Swift.Int)
|
|
1166
1186
|
final public func setCaptionsEnabled(_ enabled: Swift.Bool)
|
|
1167
1187
|
final public func selectCaptionTrack(language: Swift.String)
|
|
1188
|
+
final public func setFeedScrollEnabled(_ enabled: Swift.Bool)
|
|
1168
1189
|
final public func dismissLiveRoom()
|
|
1169
1190
|
final public func seekThumbnail(at time: Swift.Double) -> UIKit.UIImage?
|
|
1170
1191
|
@objc deinit
|
|
@@ -1357,6 +1378,9 @@ extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
|
1357
1378
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
|
1358
1379
|
extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Equatable {}
|
|
1359
1380
|
extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Hashable {}
|
|
1381
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.Equatable {}
|
|
1382
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.Hashable {}
|
|
1383
|
+
extension ShortKitSDK.VideoCarouselCellLongPressState : Swift.RawRepresentable {}
|
|
1360
1384
|
extension ShortKitSDK.CaptionSource : Swift.Equatable {}
|
|
1361
1385
|
extension ShortKitSDK.CaptionSource : Swift.Hashable {}
|
|
1362
1386
|
extension ShortKitSDK.CaptionSource : Swift.RawRepresentable {}
|
package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK
CHANGED
|
Binary file
|
|
@@ -10,39 +10,39 @@
|
|
|
10
10
|
</data>
|
|
11
11
|
<key>Info.plist</key>
|
|
12
12
|
<data>
|
|
13
|
-
|
|
13
|
+
Rmlks05t/ZAWDJyrlYCLZI2hLt4=
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
17
|
+
o4q5PMYrrSkfEuV3X5DKLlP/Ic8=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
VtQKD6iU2DxNLUgN8Nm9hVEd+LA=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
RYBSyi3j5xH2WhtxZngr8vlpDDM=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
VtQKD6iU2DxNLUgN8Nm9hVEd+LA=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
o4q5PMYrrSkfEuV3X5DKLlP/Ic8=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
l/8aNIdTZYrYfdGjeCunQev+z2s=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
dK384fZQxXLFp6AahpyFqGJOfnY=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
l/8aNIdTZYrYfdGjeCunQev+z2s=
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/module.modulemap</key>
|
|
48
48
|
<data>
|
|
@@ -66,56 +66,56 @@
|
|
|
66
66
|
<dict>
|
|
67
67
|
<key>hash2</key>
|
|
68
68
|
<data>
|
|
69
|
-
|
|
69
|
+
GPD6LqlhW6OfAta/UbVY9JS6SMSbk402F6pveuST4rY=
|
|
70
70
|
</data>
|
|
71
71
|
</dict>
|
|
72
72
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
73
73
|
<dict>
|
|
74
74
|
<key>hash2</key>
|
|
75
75
|
<data>
|
|
76
|
-
|
|
76
|
+
rf7zOX3BNWSgC2Lvt4rs/pTvzoqY4r2easqa7IcD/BY=
|
|
77
77
|
</data>
|
|
78
78
|
</dict>
|
|
79
79
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
80
80
|
<dict>
|
|
81
81
|
<key>hash2</key>
|
|
82
82
|
<data>
|
|
83
|
-
|
|
83
|
+
U33t59L18Q9DqIsgOyi6pcHV+IuHxLRdntw2IQW1DLo=
|
|
84
84
|
</data>
|
|
85
85
|
</dict>
|
|
86
86
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
87
87
|
<dict>
|
|
88
88
|
<key>hash2</key>
|
|
89
89
|
<data>
|
|
90
|
-
|
|
90
|
+
rf7zOX3BNWSgC2Lvt4rs/pTvzoqY4r2easqa7IcD/BY=
|
|
91
91
|
</data>
|
|
92
92
|
</dict>
|
|
93
93
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
94
94
|
<dict>
|
|
95
95
|
<key>hash2</key>
|
|
96
96
|
<data>
|
|
97
|
-
|
|
97
|
+
GPD6LqlhW6OfAta/UbVY9JS6SMSbk402F6pveuST4rY=
|
|
98
98
|
</data>
|
|
99
99
|
</dict>
|
|
100
100
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
101
101
|
<dict>
|
|
102
102
|
<key>hash2</key>
|
|
103
103
|
<data>
|
|
104
|
-
|
|
104
|
+
c3dj4IBlPLhIqbUCIQDEpGHL5WE7f1b16++z2hPOOTU=
|
|
105
105
|
</data>
|
|
106
106
|
</dict>
|
|
107
107
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
108
108
|
<dict>
|
|
109
109
|
<key>hash2</key>
|
|
110
110
|
<data>
|
|
111
|
-
|
|
111
|
+
kFhyC63KxDPM8/iRTzRd5M1FO7ojEQzF0migxa4EIpU=
|
|
112
112
|
</data>
|
|
113
113
|
</dict>
|
|
114
114
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
115
115
|
<dict>
|
|
116
116
|
<key>hash2</key>
|
|
117
117
|
<data>
|
|
118
|
-
|
|
118
|
+
c3dj4IBlPLhIqbUCIQDEpGHL5WE7f1b16++z2hPOOTU=
|
|
119
119
|
</data>
|
|
120
120
|
</dict>
|
|
121
121
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/src/ShortKitCommands.ts
CHANGED
|
@@ -28,6 +28,26 @@ export const ShortKitCommands = {
|
|
|
28
28
|
NativeShortKitModule?.sendContentSignal(signal),
|
|
29
29
|
setMaxBitrate: (bitrate: number) =>
|
|
30
30
|
NativeShortKitModule?.setMaxBitrate(bitrate),
|
|
31
|
+
/**
|
|
32
|
+
* Toggle feed scroll while an overlay-owned gesture is in flight.
|
|
33
|
+
*
|
|
34
|
+
* Hosts use this to grant exclusive priority to an in-flight gesture in
|
|
35
|
+
* an overlay (e.g. a horizontal scrubber drag) so the feed's pan
|
|
36
|
+
* recognizer can't steal the touch mid-drag. Pair the call: pass
|
|
37
|
+
* `false` when the host gesture starts (RN PanResponder grant), `true`
|
|
38
|
+
* when it ends or is cancelled (release / terminate).
|
|
39
|
+
*
|
|
40
|
+
* iOS: toggles the active feed view controller's
|
|
41
|
+
* `collectionView.panGestureRecognizer.isEnabled`. No-op when no feed
|
|
42
|
+
* VC is currently active.
|
|
43
|
+
*
|
|
44
|
+
* Android: fans out across every registered feed (including any masked
|
|
45
|
+
* underlay), toggling each `ViewPager2.isUserInputEnabled`. Intentional
|
|
46
|
+
* divergence from iOS — broader fan-out is simpler and has the same
|
|
47
|
+
* user-visible effect since only the active feed is interactable.
|
|
48
|
+
*/
|
|
49
|
+
setFeedScrollEnabled: (enabled: boolean) =>
|
|
50
|
+
NativeShortKitModule?.setFeedScrollEnabled(enabled),
|
|
31
51
|
prefetchStoryboard: (playbackId: string) =>
|
|
32
52
|
NativeShortKitModule?.prefetchStoryboard(playbackId),
|
|
33
53
|
getStoryboardData: (playbackId: string): Promise<string | null> =>
|
package/src/ShortKitFeed.tsx
CHANGED
|
@@ -47,6 +47,7 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
47
47
|
onFeedReady,
|
|
48
48
|
onCarouselActiveVideoCompleted,
|
|
49
49
|
onVideoCarouselCellTap,
|
|
50
|
+
onVideoCarouselCellLongPress,
|
|
50
51
|
debugPanel,
|
|
51
52
|
} = props;
|
|
52
53
|
|
|
@@ -126,6 +127,26 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
126
127
|
return () => subscription.remove();
|
|
127
128
|
}, [feedId, onVideoCarouselCellTap]);
|
|
128
129
|
|
|
130
|
+
// Subscribe to per-feed video-carousel cell long-press events
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!NativeShortKitModule || !onVideoCarouselCellLongPress) return;
|
|
133
|
+
|
|
134
|
+
const subscription = NativeShortKitModule.onVideoCarouselCellLongPress((event) => {
|
|
135
|
+
if (event.feedId === feedId) {
|
|
136
|
+
// Bridge emits `state` as plain `string` (codegen constraint);
|
|
137
|
+
// the native side only ever emits these three values.
|
|
138
|
+
onVideoCarouselCellLongPress({
|
|
139
|
+
id: event.id,
|
|
140
|
+
index: event.index,
|
|
141
|
+
pageIndex: event.pageIndex,
|
|
142
|
+
state: event.state as 'began' | 'ended' | 'cancelled',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
return () => subscription.remove();
|
|
148
|
+
}, [feedId, onVideoCarouselCellLongPress]);
|
|
149
|
+
|
|
129
150
|
// Register overlay components before native view mounts.
|
|
130
151
|
// useLayoutEffect fires after commit but before paint — before
|
|
131
152
|
// didMoveToWindow/onAttachedToWindow on the native view.
|
|
@@ -127,6 +127,14 @@ type VideoCarouselCellTapEvent = Readonly<{
|
|
|
127
127
|
pageIndex: Int32;
|
|
128
128
|
}>;
|
|
129
129
|
|
|
130
|
+
type VideoCarouselCellLongPressEvent = Readonly<{
|
|
131
|
+
feedId: string;
|
|
132
|
+
id: string;
|
|
133
|
+
index: Int32;
|
|
134
|
+
pageIndex: Int32;
|
|
135
|
+
state: string; // "began" | "ended" | "cancelled" — string for codegen compat
|
|
136
|
+
}>;
|
|
137
|
+
|
|
130
138
|
type WidgetCardTapEvent = Readonly<{
|
|
131
139
|
widgetId: string;
|
|
132
140
|
playbackId: string;
|
|
@@ -292,6 +300,7 @@ export interface Spec extends TurboModule {
|
|
|
292
300
|
selectCaptionTrack(language: string): void;
|
|
293
301
|
sendContentSignal(signal: string): void;
|
|
294
302
|
setMaxBitrate(bitrate: Double): void;
|
|
303
|
+
setFeedScrollEnabled(enabled: boolean): void;
|
|
295
304
|
|
|
296
305
|
// --- Custom feed ---
|
|
297
306
|
setFeedItems(feedId: string, items: string, startAtId: string | null): void;
|
|
@@ -336,6 +345,7 @@ export interface Spec extends TurboModule {
|
|
|
336
345
|
readonly onDidFetchContentItems: EventEmitter<DidFetchContentItemsEvent>;
|
|
337
346
|
readonly onFeedReady: EventEmitter<FeedReadyEvent>;
|
|
338
347
|
readonly onVideoCarouselCellTap: EventEmitter<VideoCarouselCellTapEvent>;
|
|
348
|
+
readonly onVideoCarouselCellLongPress: EventEmitter<VideoCarouselCellLongPressEvent>;
|
|
339
349
|
readonly onWidgetCardTap: EventEmitter<WidgetCardTapEvent>;
|
|
340
350
|
|
|
341
351
|
// --- Overlay per-surface events ---
|
package/src/types.ts
CHANGED
|
@@ -144,6 +144,12 @@ export interface ImageCarouselItem {
|
|
|
144
144
|
export interface VideoCarouselItem {
|
|
145
145
|
id: string;
|
|
146
146
|
videos: ContentItem[];
|
|
147
|
+
/**
|
|
148
|
+
* Zero-based index of the page the carousel landed on. Mirrors
|
|
149
|
+
* `VideoCarouselInput.initialPageIndex` from the host's input. Available
|
|
150
|
+
* to overlay components for reading the active page on first paint.
|
|
151
|
+
*/
|
|
152
|
+
initialPageIndex?: number;
|
|
147
153
|
title?: string;
|
|
148
154
|
description?: string;
|
|
149
155
|
author?: string;
|
|
@@ -175,6 +181,18 @@ export interface VideoCarouselVideoInput {
|
|
|
175
181
|
export interface VideoCarouselInput {
|
|
176
182
|
id: string;
|
|
177
183
|
videos: VideoCarouselVideoInput[];
|
|
184
|
+
/**
|
|
185
|
+
* Zero-based index of the page the carousel should land on the first time
|
|
186
|
+
* it becomes visible (vertical-arrival or initial mount). Defaults to 0.
|
|
187
|
+
* Out-of-range values are clamped to a valid index.
|
|
188
|
+
*
|
|
189
|
+
* **Has no effect after the carousel is first configured.** To move the
|
|
190
|
+
* user imperatively after landing, use
|
|
191
|
+
* `useShortKitCarousel().setActiveIndex(n)`. Re-rendering with a new
|
|
192
|
+
* `initialPageIndex` on the same `id` is ignored — change the `id` to force
|
|
193
|
+
* a re-bind if you genuinely want to land on a different page.
|
|
194
|
+
*/
|
|
195
|
+
initialPageIndex?: number;
|
|
178
196
|
title?: string;
|
|
179
197
|
description?: string;
|
|
180
198
|
author?: string;
|
|
@@ -426,6 +444,23 @@ export interface ShortKitFeedProps {
|
|
|
426
444
|
index: number;
|
|
427
445
|
pageIndex: number;
|
|
428
446
|
}) => void;
|
|
447
|
+
/**
|
|
448
|
+
* Fires for the lifecycle of a video-carousel cell long-press: `began`
|
|
449
|
+
* after a short native press delay, `ended` on touch release, and
|
|
450
|
+
* `cancelled` on user finger movement past ~10pt or when the cell is
|
|
451
|
+
* recycled (e.g. by `setFeedItems`).
|
|
452
|
+
*
|
|
453
|
+
* The recognizer runs simultaneously with the carousel's horizontal pan
|
|
454
|
+
* and the feed's vertical pan — it does not block scrolling. The intended
|
|
455
|
+
* use case is Instagram-style hold-to-pause: pause playback and hide
|
|
456
|
+
* overlay chrome on `began`, restore them on `ended` / `cancelled`.
|
|
457
|
+
*/
|
|
458
|
+
onVideoCarouselCellLongPress?: (event: {
|
|
459
|
+
id: string;
|
|
460
|
+
index: number;
|
|
461
|
+
pageIndex: number;
|
|
462
|
+
state: 'began' | 'ended' | 'cancelled';
|
|
463
|
+
}) => void;
|
|
429
464
|
}
|
|
430
465
|
|
|
431
466
|
/**
|