@shortkitsdk/react-native 0.2.25 → 0.2.26
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/libs/shortkit-release.aar +0 -0
- package/ios/ShortKitBridge.swift +42 -4
- package/ios/ShortKitFeedView.swift +50 -4
- package/ios/ShortKitFeedViewManager.mm +2 -0
- package/ios/ShortKitModule.mm +13 -3
- 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 +1946 -218
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +51 -6
- 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 +51 -6
- 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 +1946 -218
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +51 -6
- 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 +51 -6
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1946 -218
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +51 -6
- 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 +51 -6
- 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/ShortKitFeed.tsx +42 -3
- package/src/ShortKitProvider.tsx +2 -1
- package/src/specs/NativeShortKitModule.ts +17 -1
- package/src/specs/ShortKitFeedViewNativeComponent.ts +3 -0
- package/src/types.ts +58 -2
|
@@ -244,6 +244,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
244
244
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
245
245
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
246
246
|
public var liveOverlay: ShortKitSDK.LiveOverlayMode
|
|
247
|
+
public var liveRoomMask: ShortKitSDK.LiveRoomMaskMode
|
|
247
248
|
public var muteOnStart: Swift.Bool
|
|
248
249
|
public var autoplay: Swift.Bool
|
|
249
250
|
public var feedSource: ShortKitSDK.FeedSource
|
|
@@ -251,9 +252,9 @@ public struct FeedConfig : Swift.Codable {
|
|
|
251
252
|
public var pullToRefreshEnabled: Swift.Bool
|
|
252
253
|
public var filter: ShortKitSDK.FeedFilter?
|
|
253
254
|
public var preload: ShortKitSDK.FeedPreload?
|
|
254
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, liveOverlay: ShortKitSDK.LiveOverlayMode = .default, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, pullToRefreshEnabled: Swift.Bool = true, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
255
|
-
public func encode(to encoder: any Swift.Encoder) throws
|
|
255
|
+
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, liveOverlay: ShortKitSDK.LiveOverlayMode = .default, liveRoomMask: ShortKitSDK.LiveRoomMaskMode = .none, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, pullToRefreshEnabled: Swift.Bool = true, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
256
256
|
public init(from decoder: any Swift.Decoder) throws
|
|
257
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
257
258
|
}
|
|
258
259
|
public enum FeedMaskMode {
|
|
259
260
|
case none
|
|
@@ -262,6 +263,13 @@ public enum FeedMaskMode {
|
|
|
262
263
|
extension ShortKitSDK.FeedMaskMode : Swift.Equatable {
|
|
263
264
|
public static func == (lhs: ShortKitSDK.FeedMaskMode, rhs: ShortKitSDK.FeedMaskMode) -> Swift.Bool
|
|
264
265
|
}
|
|
266
|
+
public enum LiveRoomMaskMode {
|
|
267
|
+
case none
|
|
268
|
+
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.LiveRoomMask)
|
|
269
|
+
}
|
|
270
|
+
extension ShortKitSDK.LiveRoomMaskMode : Swift.Equatable {
|
|
271
|
+
public static func == (lhs: ShortKitSDK.LiveRoomMaskMode, rhs: ShortKitSDK.LiveRoomMaskMode) -> Swift.Bool
|
|
272
|
+
}
|
|
265
273
|
public enum VideoOverlayMode {
|
|
266
274
|
case none
|
|
267
275
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
@@ -419,6 +427,7 @@ public enum ShortKitDownloadError : Swift.Error {
|
|
|
419
427
|
case cancelled
|
|
420
428
|
}
|
|
421
429
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
430
|
+
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
422
431
|
@objc deinit
|
|
423
432
|
}
|
|
424
433
|
@_Concurrency.MainActor @preconcurrency public struct ShortKitFeedView : SwiftUI.UIViewControllerRepresentable {
|
|
@@ -438,9 +447,17 @@ public enum ShortKitDownloadError : Swift.Error {
|
|
|
438
447
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
439
448
|
@_Concurrency.MainActor @preconcurrency public var onRemainingContentCountChange: ((Swift.Int) -> Swift.Void)?
|
|
440
449
|
@_Concurrency.MainActor @preconcurrency public var onFeedReady: (() -> Swift.Void)?
|
|
450
|
+
public struct VideoCarouselCellTapPayload {
|
|
451
|
+
public let id: Swift.String
|
|
452
|
+
public let index: Swift.Int
|
|
453
|
+
public let pageIndex: Swift.Int
|
|
454
|
+
}
|
|
455
|
+
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
|
|
456
|
+
@_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
|
|
441
457
|
@_Concurrency.MainActor @preconcurrency public var seedThumbnail: UIKit.UIImage?
|
|
442
458
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil)
|
|
443
|
-
@_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
459
|
+
@_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput], startAtId: Swift.String? = nil)
|
|
460
|
+
@_Concurrency.MainActor public func scrollToItem(id: Swift.String, animated: Swift.Bool)
|
|
444
461
|
@_Concurrency.MainActor public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
445
462
|
@_Concurrency.MainActor public func applyFilter(_ filter: ShortKitSDK.FeedFilter?)
|
|
446
463
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLoad()
|
|
@@ -579,7 +596,8 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
579
596
|
public var liveStreamId: Swift.String?
|
|
580
597
|
public var liveStreamStatus: ShortKitSDK.LiveStreamStatus?
|
|
581
598
|
public var startedAt: Swift.String?
|
|
582
|
-
public
|
|
599
|
+
public var currentViewers: Swift.Int
|
|
600
|
+
public init(id: Swift.String, playbackId: Swift.String? = nil, title: Swift.String, description: Swift.String? = nil, duration: Swift.Double, streamingUrl: Swift.String, thumbnailUrl: Swift.String, captionTracks: [ShortKitSDK.CaptionTrack] = [], customMetadata: [Swift.String : ShortKitSDK.JSONValue]? = nil, author: Swift.String? = nil, articleUrl: Swift.String? = nil, commentCount: Swift.Int? = nil, fallbackUrl: Swift.String? = nil, downloadUrl: Swift.String? = nil, isLive: Swift.Bool = false, liveStreamId: Swift.String? = nil, liveStreamStatus: ShortKitSDK.LiveStreamStatus? = nil, startedAt: Swift.String? = nil, currentViewers: Swift.Int = 0)
|
|
583
601
|
public init(from decoder: any Swift.Decoder) throws
|
|
584
602
|
public static func == (a: ShortKitSDK.ContentItem, b: ShortKitSDK.ContentItem) -> Swift.Bool
|
|
585
603
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
@@ -840,10 +858,23 @@ public protocol LiveOverlay : AnyObject {
|
|
|
840
858
|
func configure(with item: ShortKitSDK.ContentItem)
|
|
841
859
|
func activate()
|
|
842
860
|
func deactivate()
|
|
843
|
-
func
|
|
861
|
+
func liveStreamStatusDidChange(to status: ShortKitSDK.LiveStreamStatus)
|
|
862
|
+
func expand()
|
|
863
|
+
func collapse()
|
|
844
864
|
}
|
|
845
865
|
extension ShortKitSDK.LiveOverlay {
|
|
846
|
-
public func
|
|
866
|
+
public func liveStreamStatusDidChange(to status: ShortKitSDK.LiveStreamStatus)
|
|
867
|
+
public func expand()
|
|
868
|
+
public func collapse()
|
|
869
|
+
}
|
|
870
|
+
public protocol LiveRoomMask : AnyObject {
|
|
871
|
+
var liveRegion: UIKit.UIView { get }
|
|
872
|
+
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
873
|
+
func configure(with item: ShortKitSDK.ContentItem)
|
|
874
|
+
func willDismiss()
|
|
875
|
+
}
|
|
876
|
+
extension ShortKitSDK.LiveRoomMask {
|
|
877
|
+
public func willDismiss()
|
|
847
878
|
}
|
|
848
879
|
public protocol SurveyOverlay : AnyObject {
|
|
849
880
|
var onSurveyResponse: ((Swift.String, ShortKitSDK.SurveyOption) -> Swift.Void)? { get set }
|
|
@@ -975,6 +1006,19 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
975
1006
|
final public var remainingContentCount: Combine.AnyPublisher<Swift.Int, Swift.Never> {
|
|
976
1007
|
get
|
|
977
1008
|
}
|
|
1009
|
+
final public var isLiveRoomExpanded: Combine.AnyPublisher<Swift.Bool, Swift.Never> {
|
|
1010
|
+
get
|
|
1011
|
+
}
|
|
1012
|
+
final public var isLiveRoomExpandedValue: Swift.Bool {
|
|
1013
|
+
get
|
|
1014
|
+
}
|
|
1015
|
+
final public var liveStreamStatus: Combine.AnyPublisher<ShortKitSDK.LiveStreamStatus?, Swift.Never> {
|
|
1016
|
+
get
|
|
1017
|
+
}
|
|
1018
|
+
final public var liveStreamStatusValue: ShortKitSDK.LiveStreamStatus? {
|
|
1019
|
+
get
|
|
1020
|
+
}
|
|
1021
|
+
final public func currentProgramDate() -> Foundation.Date?
|
|
978
1022
|
final public var currentItemValue: ShortKitSDK.ContentItem? {
|
|
979
1023
|
get
|
|
980
1024
|
}
|
|
@@ -993,6 +1037,7 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
993
1037
|
final public func setMaxBitrate(_ bps: Swift.Int)
|
|
994
1038
|
final public func setCaptionsEnabled(_ enabled: Swift.Bool)
|
|
995
1039
|
final public func selectCaptionTrack(language: Swift.String)
|
|
1040
|
+
final public func dismissLiveRoom()
|
|
996
1041
|
final public func seekThumbnail(at time: Swift.Double) -> UIKit.UIImage?
|
|
997
1042
|
@objc deinit
|
|
998
1043
|
}
|
|
Binary file
|
|
@@ -244,6 +244,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
244
244
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
245
245
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
246
246
|
public var liveOverlay: ShortKitSDK.LiveOverlayMode
|
|
247
|
+
public var liveRoomMask: ShortKitSDK.LiveRoomMaskMode
|
|
247
248
|
public var muteOnStart: Swift.Bool
|
|
248
249
|
public var autoplay: Swift.Bool
|
|
249
250
|
public var feedSource: ShortKitSDK.FeedSource
|
|
@@ -251,9 +252,9 @@ public struct FeedConfig : Swift.Codable {
|
|
|
251
252
|
public var pullToRefreshEnabled: Swift.Bool
|
|
252
253
|
public var filter: ShortKitSDK.FeedFilter?
|
|
253
254
|
public var preload: ShortKitSDK.FeedPreload?
|
|
254
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, liveOverlay: ShortKitSDK.LiveOverlayMode = .default, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, pullToRefreshEnabled: Swift.Bool = true, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
255
|
-
public func encode(to encoder: any Swift.Encoder) throws
|
|
255
|
+
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, liveOverlay: ShortKitSDK.LiveOverlayMode = .default, liveRoomMask: ShortKitSDK.LiveRoomMaskMode = .none, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, pullToRefreshEnabled: Swift.Bool = true, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
256
256
|
public init(from decoder: any Swift.Decoder) throws
|
|
257
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
257
258
|
}
|
|
258
259
|
public enum FeedMaskMode {
|
|
259
260
|
case none
|
|
@@ -262,6 +263,13 @@ public enum FeedMaskMode {
|
|
|
262
263
|
extension ShortKitSDK.FeedMaskMode : Swift.Equatable {
|
|
263
264
|
public static func == (lhs: ShortKitSDK.FeedMaskMode, rhs: ShortKitSDK.FeedMaskMode) -> Swift.Bool
|
|
264
265
|
}
|
|
266
|
+
public enum LiveRoomMaskMode {
|
|
267
|
+
case none
|
|
268
|
+
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.LiveRoomMask)
|
|
269
|
+
}
|
|
270
|
+
extension ShortKitSDK.LiveRoomMaskMode : Swift.Equatable {
|
|
271
|
+
public static func == (lhs: ShortKitSDK.LiveRoomMaskMode, rhs: ShortKitSDK.LiveRoomMaskMode) -> Swift.Bool
|
|
272
|
+
}
|
|
265
273
|
public enum VideoOverlayMode {
|
|
266
274
|
case none
|
|
267
275
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
@@ -419,6 +427,7 @@ public enum ShortKitDownloadError : Swift.Error {
|
|
|
419
427
|
case cancelled
|
|
420
428
|
}
|
|
421
429
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
430
|
+
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
422
431
|
@objc deinit
|
|
423
432
|
}
|
|
424
433
|
@_Concurrency.MainActor @preconcurrency public struct ShortKitFeedView : SwiftUI.UIViewControllerRepresentable {
|
|
@@ -438,9 +447,17 @@ public enum ShortKitDownloadError : Swift.Error {
|
|
|
438
447
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
439
448
|
@_Concurrency.MainActor @preconcurrency public var onRemainingContentCountChange: ((Swift.Int) -> Swift.Void)?
|
|
440
449
|
@_Concurrency.MainActor @preconcurrency public var onFeedReady: (() -> Swift.Void)?
|
|
450
|
+
public struct VideoCarouselCellTapPayload {
|
|
451
|
+
public let id: Swift.String
|
|
452
|
+
public let index: Swift.Int
|
|
453
|
+
public let pageIndex: Swift.Int
|
|
454
|
+
}
|
|
455
|
+
@_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
|
|
456
|
+
@_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
|
|
441
457
|
@_Concurrency.MainActor @preconcurrency public var seedThumbnail: UIKit.UIImage?
|
|
442
458
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil)
|
|
443
|
-
@_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
459
|
+
@_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput], startAtId: Swift.String? = nil)
|
|
460
|
+
@_Concurrency.MainActor public func scrollToItem(id: Swift.String, animated: Swift.Bool)
|
|
444
461
|
@_Concurrency.MainActor public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
445
462
|
@_Concurrency.MainActor public func applyFilter(_ filter: ShortKitSDK.FeedFilter?)
|
|
446
463
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLoad()
|
|
@@ -579,7 +596,8 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
579
596
|
public var liveStreamId: Swift.String?
|
|
580
597
|
public var liveStreamStatus: ShortKitSDK.LiveStreamStatus?
|
|
581
598
|
public var startedAt: Swift.String?
|
|
582
|
-
public
|
|
599
|
+
public var currentViewers: Swift.Int
|
|
600
|
+
public init(id: Swift.String, playbackId: Swift.String? = nil, title: Swift.String, description: Swift.String? = nil, duration: Swift.Double, streamingUrl: Swift.String, thumbnailUrl: Swift.String, captionTracks: [ShortKitSDK.CaptionTrack] = [], customMetadata: [Swift.String : ShortKitSDK.JSONValue]? = nil, author: Swift.String? = nil, articleUrl: Swift.String? = nil, commentCount: Swift.Int? = nil, fallbackUrl: Swift.String? = nil, downloadUrl: Swift.String? = nil, isLive: Swift.Bool = false, liveStreamId: Swift.String? = nil, liveStreamStatus: ShortKitSDK.LiveStreamStatus? = nil, startedAt: Swift.String? = nil, currentViewers: Swift.Int = 0)
|
|
583
601
|
public init(from decoder: any Swift.Decoder) throws
|
|
584
602
|
public static func == (a: ShortKitSDK.ContentItem, b: ShortKitSDK.ContentItem) -> Swift.Bool
|
|
585
603
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
@@ -840,10 +858,23 @@ public protocol LiveOverlay : AnyObject {
|
|
|
840
858
|
func configure(with item: ShortKitSDK.ContentItem)
|
|
841
859
|
func activate()
|
|
842
860
|
func deactivate()
|
|
843
|
-
func
|
|
861
|
+
func liveStreamStatusDidChange(to status: ShortKitSDK.LiveStreamStatus)
|
|
862
|
+
func expand()
|
|
863
|
+
func collapse()
|
|
844
864
|
}
|
|
845
865
|
extension ShortKitSDK.LiveOverlay {
|
|
846
|
-
public func
|
|
866
|
+
public func liveStreamStatusDidChange(to status: ShortKitSDK.LiveStreamStatus)
|
|
867
|
+
public func expand()
|
|
868
|
+
public func collapse()
|
|
869
|
+
}
|
|
870
|
+
public protocol LiveRoomMask : AnyObject {
|
|
871
|
+
var liveRegion: UIKit.UIView { get }
|
|
872
|
+
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
873
|
+
func configure(with item: ShortKitSDK.ContentItem)
|
|
874
|
+
func willDismiss()
|
|
875
|
+
}
|
|
876
|
+
extension ShortKitSDK.LiveRoomMask {
|
|
877
|
+
public func willDismiss()
|
|
847
878
|
}
|
|
848
879
|
public protocol SurveyOverlay : AnyObject {
|
|
849
880
|
var onSurveyResponse: ((Swift.String, ShortKitSDK.SurveyOption) -> Swift.Void)? { get set }
|
|
@@ -975,6 +1006,19 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
975
1006
|
final public var remainingContentCount: Combine.AnyPublisher<Swift.Int, Swift.Never> {
|
|
976
1007
|
get
|
|
977
1008
|
}
|
|
1009
|
+
final public var isLiveRoomExpanded: Combine.AnyPublisher<Swift.Bool, Swift.Never> {
|
|
1010
|
+
get
|
|
1011
|
+
}
|
|
1012
|
+
final public var isLiveRoomExpandedValue: Swift.Bool {
|
|
1013
|
+
get
|
|
1014
|
+
}
|
|
1015
|
+
final public var liveStreamStatus: Combine.AnyPublisher<ShortKitSDK.LiveStreamStatus?, Swift.Never> {
|
|
1016
|
+
get
|
|
1017
|
+
}
|
|
1018
|
+
final public var liveStreamStatusValue: ShortKitSDK.LiveStreamStatus? {
|
|
1019
|
+
get
|
|
1020
|
+
}
|
|
1021
|
+
final public func currentProgramDate() -> Foundation.Date?
|
|
978
1022
|
final public var currentItemValue: ShortKitSDK.ContentItem? {
|
|
979
1023
|
get
|
|
980
1024
|
}
|
|
@@ -993,6 +1037,7 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
993
1037
|
final public func setMaxBitrate(_ bps: Swift.Int)
|
|
994
1038
|
final public func setCaptionsEnabled(_ enabled: Swift.Bool)
|
|
995
1039
|
final public func selectCaptionTrack(language: Swift.String)
|
|
1040
|
+
final public func dismissLiveRoom()
|
|
996
1041
|
final public func seekThumbnail(at time: Swift.Double) -> UIKit.UIImage?
|
|
997
1042
|
@objc deinit
|
|
998
1043
|
}
|
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
|
+
Iq8WNAyualDO11/gg6nPxoT/uLo=
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
17
|
+
Gzr/etd10eddI2LBjZqt4DbbwAo=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
SY4J8Ap5bvNmlGr2eHB/mIEc9/4=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
Jifa8RGekCm+oLvj1vexV+qHBxg=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
SY4J8Ap5bvNmlGr2eHB/mIEc9/4=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
Gzr/etd10eddI2LBjZqt4DbbwAo=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
RSB+lYIOsHV+EHcf6nw6updgwoE=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
4SaiyfqnnCuP3NHBedJ86U5WUvk=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
RSB+lYIOsHV+EHcf6nw6updgwoE=
|
|
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
|
+
isVaXgRh+uHcpvhnLI/Xw6vyUa6t68QJDw+sElYsnNw=
|
|
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
|
+
1/jxH+/lRA97UGj3ZA78cxyVLWeDthh0KFAHyutYAGs=
|
|
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
|
+
1ZNQBox7b3AwcLy9/eOdX9J9kLPO6aiDoKklf4b+uDw=
|
|
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
|
+
1/jxH+/lRA97UGj3ZA78cxyVLWeDthh0KFAHyutYAGs=
|
|
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
|
+
isVaXgRh+uHcpvhnLI/Xw6vyUa6t68QJDw+sElYsnNw=
|
|
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
|
+
LcZQmnn2zALd1t49D1Ky9DkTE/qLtiA/Y8X7G8X0tpA=
|
|
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
|
+
rFL1rnzbA6I/ynZT99TT87vcqERbX/oj+lvvjIITisM=
|
|
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
|
+
LcZQmnn2zALd1t49D1Ky9DkTE/qLtiA/Y8X7G8X0tpA=
|
|
119
119
|
</data>
|
|
120
120
|
</dict>
|
|
121
121
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/src/ShortKitFeed.tsx
CHANGED
|
@@ -31,6 +31,8 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
31
31
|
const {
|
|
32
32
|
config,
|
|
33
33
|
preloadId,
|
|
34
|
+
feedItems,
|
|
35
|
+
active,
|
|
34
36
|
style,
|
|
35
37
|
startAtItemId,
|
|
36
38
|
seedThumbnailUrl,
|
|
@@ -44,6 +46,7 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
44
46
|
onRemainingContentCountChange,
|
|
45
47
|
onFeedReady,
|
|
46
48
|
onCarouselActiveVideoCompleted,
|
|
49
|
+
onVideoCarouselCellTap,
|
|
47
50
|
} = props;
|
|
48
51
|
|
|
49
52
|
const isInitialized = useContext(ShortKitInitContext);
|
|
@@ -57,8 +60,15 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
57
60
|
|
|
58
61
|
// Expose per-feed imperative methods on the ref
|
|
59
62
|
useImperativeHandle(ref, () => ({
|
|
60
|
-
setFeedItems: (items: FeedInput[]) => {
|
|
61
|
-
NativeShortKitModule?.setFeedItems(
|
|
63
|
+
setFeedItems: (items: FeedInput[], options?: { startAt?: string }) => {
|
|
64
|
+
NativeShortKitModule?.setFeedItems(
|
|
65
|
+
feedId,
|
|
66
|
+
serializeFeedInputs(items),
|
|
67
|
+
options?.startAt ?? null,
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
scrollToItem: (id: string, options?: { animated?: boolean }) => {
|
|
71
|
+
NativeShortKitModule?.scrollFeedToItem(feedId, id, options?.animated ?? false);
|
|
62
72
|
},
|
|
63
73
|
appendFeedItems: (items: FeedInput[]) => {
|
|
64
74
|
NativeShortKitModule?.appendFeedItems(feedId, serializeFeedInputs(items));
|
|
@@ -95,6 +105,23 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
95
105
|
return () => subscription.remove();
|
|
96
106
|
}, [feedId, onFeedReady]);
|
|
97
107
|
|
|
108
|
+
// Subscribe to per-feed video-carousel cell-tap events
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!NativeShortKitModule || !onVideoCarouselCellTap) return;
|
|
111
|
+
|
|
112
|
+
const subscription = NativeShortKitModule.onVideoCarouselCellTap((event) => {
|
|
113
|
+
if (event.feedId === feedId) {
|
|
114
|
+
onVideoCarouselCellTap({
|
|
115
|
+
id: event.id,
|
|
116
|
+
index: event.index,
|
|
117
|
+
pageIndex: event.pageIndex,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
return () => subscription.remove();
|
|
123
|
+
}, [feedId, onVideoCarouselCellTap]);
|
|
124
|
+
|
|
98
125
|
// Register overlay components before native view mounts.
|
|
99
126
|
// useLayoutEffect fires after commit but before paint — before
|
|
100
127
|
// didMoveToWindow/onAttachedToWindow on the native view.
|
|
@@ -115,6 +142,13 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
115
142
|
[config],
|
|
116
143
|
);
|
|
117
144
|
|
|
145
|
+
// Serialize feedItems once — only the initial value matters (mount-time
|
|
146
|
+
// prop). Post-mount item updates use the imperative ref methods.
|
|
147
|
+
const feedItemsJSON = useMemo(
|
|
148
|
+
() => (feedItems && feedItems.length > 0 ? serializeFeedInputs(feedItems) : undefined),
|
|
149
|
+
[feedItems],
|
|
150
|
+
);
|
|
151
|
+
|
|
118
152
|
// ---------------------------------------------------------------------------
|
|
119
153
|
// Subscribe to feed-level events and forward to callback props
|
|
120
154
|
// ---------------------------------------------------------------------------
|
|
@@ -176,7 +210,10 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
176
210
|
|
|
177
211
|
if (onRefreshStateChanged) {
|
|
178
212
|
subscriptions.push(
|
|
179
|
-
NativeShortKitModule.
|
|
213
|
+
NativeShortKitModule.onRefreshStateChangedPerFeed((event) => {
|
|
214
|
+
// Filter to this feed instance — prevents other feeds' refresh
|
|
215
|
+
// events from triggering this consumer's refresh handler.
|
|
216
|
+
if (event.feedId !== feedId && event.feedId !== '') return;
|
|
180
217
|
const state: ShortKitRefreshState =
|
|
181
218
|
event.status === 'pulling'
|
|
182
219
|
? { status: 'pulling', progress: event.progress }
|
|
@@ -246,6 +283,8 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
246
283
|
startAtItemId={startAtItemId}
|
|
247
284
|
preloadId={preloadId}
|
|
248
285
|
seedThumbnailUrl={seedThumbnailUrl}
|
|
286
|
+
feedItemsJSON={feedItemsJSON}
|
|
287
|
+
active={active}
|
|
249
288
|
/>
|
|
250
289
|
</View>
|
|
251
290
|
);
|
package/src/ShortKitProvider.tsx
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
} from './types';
|
|
20
20
|
import {
|
|
21
21
|
serializeFeedConfig,
|
|
22
|
+
serializeFeedInputs,
|
|
22
23
|
deserializePlayerState,
|
|
23
24
|
deserializeContentItem,
|
|
24
25
|
deserializePlayerTime,
|
|
@@ -466,7 +467,7 @@ export function ShortKitProvider({
|
|
|
466
467
|
const preloadFeedCmd = useCallback(async (config?: Partial<FeedConfig>, items?: FeedInput[]): Promise<string> => {
|
|
467
468
|
if (!NativeShortKitModule) return '';
|
|
468
469
|
const configJSON = config ? serializeFeedConfig(config as FeedConfig) : '{}';
|
|
469
|
-
const itemsJSON = items ?
|
|
470
|
+
const itemsJSON = items ? serializeFeedInputs(items) : null;
|
|
470
471
|
return NativeShortKitModule.preloadFeed(configJSON, itemsJSON);
|
|
471
472
|
}, []);
|
|
472
473
|
|
|
@@ -96,6 +96,12 @@ type RefreshStateChangedEvent = Readonly<{
|
|
|
96
96
|
progress: Double;
|
|
97
97
|
}>;
|
|
98
98
|
|
|
99
|
+
type RefreshStateChangedPerFeedEvent = Readonly<{
|
|
100
|
+
feedId: string;
|
|
101
|
+
status: string;
|
|
102
|
+
progress: Double;
|
|
103
|
+
}>;
|
|
104
|
+
|
|
99
105
|
type DidFetchContentItemsEvent = Readonly<{
|
|
100
106
|
items: string; // JSON-serialized ContentItem[]
|
|
101
107
|
}>;
|
|
@@ -109,6 +115,13 @@ type FeedReadyEvent = Readonly<{
|
|
|
109
115
|
feedId: string;
|
|
110
116
|
}>;
|
|
111
117
|
|
|
118
|
+
type VideoCarouselCellTapEvent = Readonly<{
|
|
119
|
+
feedId: string;
|
|
120
|
+
id: string;
|
|
121
|
+
index: Int32;
|
|
122
|
+
pageIndex: Int32;
|
|
123
|
+
}>;
|
|
124
|
+
|
|
112
125
|
type DownloadStartedEvent = Readonly<{
|
|
113
126
|
itemId: string;
|
|
114
127
|
}>;
|
|
@@ -266,7 +279,8 @@ export interface Spec extends TurboModule {
|
|
|
266
279
|
setMaxBitrate(bitrate: Double): void;
|
|
267
280
|
|
|
268
281
|
// --- Custom feed ---
|
|
269
|
-
setFeedItems(feedId: string, items: string): void;
|
|
282
|
+
setFeedItems(feedId: string, items: string, startAtId: string | null): void;
|
|
283
|
+
scrollFeedToItem(feedId: string, id: string, animated: boolean): void;
|
|
270
284
|
appendFeedItems(feedId: string, items: string): void;
|
|
271
285
|
fetchContent(limit: Int32, filterJSON: string | null): Promise<string>;
|
|
272
286
|
applyFilter(feedId: string, filterJSON: string | null): void;
|
|
@@ -302,8 +316,10 @@ export interface Spec extends TurboModule {
|
|
|
302
316
|
readonly onContentTapped: EventEmitter<ContentTappedEvent>;
|
|
303
317
|
readonly onDismiss: EventEmitter<DismissEvent>;
|
|
304
318
|
readonly onRefreshStateChanged: EventEmitter<RefreshStateChangedEvent>;
|
|
319
|
+
readonly onRefreshStateChangedPerFeed: EventEmitter<RefreshStateChangedPerFeedEvent>;
|
|
305
320
|
readonly onDidFetchContentItems: EventEmitter<DidFetchContentItemsEvent>;
|
|
306
321
|
readonly onFeedReady: EventEmitter<FeedReadyEvent>;
|
|
322
|
+
readonly onVideoCarouselCellTap: EventEmitter<VideoCarouselCellTapEvent>;
|
|
307
323
|
|
|
308
324
|
// --- Overlay per-surface events ---
|
|
309
325
|
readonly onOverlayActiveChanged: EventEmitter<OverlayActiveEvent>;
|
|
@@ -14,6 +14,9 @@ export interface NativeProps extends ViewProps {
|
|
|
14
14
|
* latency. Falls back to network fetch for non-SDWebImage clients.
|
|
15
15
|
*/
|
|
16
16
|
seedThumbnailUrl?: string;
|
|
17
|
+
/** JSON-serialized FeedInput[] for initial custom-feed items at mount time. */
|
|
18
|
+
feedItemsJSON?: string;
|
|
19
|
+
active?: boolean;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export default codegenNativeComponent<NativeProps>(
|
package/src/types.ts
CHANGED
|
@@ -314,6 +314,34 @@ export interface ShortKitFeedProps {
|
|
|
314
314
|
* apps on React Native's core <Image> or other image libraries.
|
|
315
315
|
*/
|
|
316
316
|
seedThumbnailUrl?: string;
|
|
317
|
+
/**
|
|
318
|
+
* Initial feed items for custom feed mode (`feedSource: 'custom'`).
|
|
319
|
+
*
|
|
320
|
+
* Items are delivered to the native view as construction-time props so the
|
|
321
|
+
* SDK renders the first cell on the very first run-loop tick — no
|
|
322
|
+
* ref-attach race, no async bridge hop, no loading-state flash.
|
|
323
|
+
*
|
|
324
|
+
* Use for supplying known items at mount (e.g. a cached last-watched
|
|
325
|
+
* video). For post-mount updates (pagination, refresh), use the imperative
|
|
326
|
+
* `setFeedItems()` / `appendFeedItems()` methods on the ref.
|
|
327
|
+
*
|
|
328
|
+
* When both `feedItems` and `preloadId` are set, `preloadId` takes
|
|
329
|
+
* precedence (it carries prefetched HLS manifests / segment 0).
|
|
330
|
+
*/
|
|
331
|
+
feedItems?: FeedInput[];
|
|
332
|
+
/**
|
|
333
|
+
* Whether the feed is the active/focused surface. When `false`, the SDK
|
|
334
|
+
* suspends playback and yields players so an adjacent feed (e.g. another
|
|
335
|
+
* tab) can use them without cross-surface contamination.
|
|
336
|
+
*
|
|
337
|
+
* Pass `useIsFocused()` from React Navigation. When omitted, the SDK
|
|
338
|
+
* infers suspension from UIKit's `willMove(toWindow:)` lifecycle —
|
|
339
|
+
* which works for push/pop navigation but NOT for tab/pager navigation
|
|
340
|
+
* where the view stays in the window hierarchy.
|
|
341
|
+
*
|
|
342
|
+
* @default true
|
|
343
|
+
*/
|
|
344
|
+
active?: boolean;
|
|
317
345
|
onLoop?: (event: LoopEvent) => void;
|
|
318
346
|
onFeedTransition?: (event: FeedTransitionEvent) => void;
|
|
319
347
|
onFormatChange?: (event: FormatChangeEvent) => void;
|
|
@@ -339,6 +367,17 @@ export interface ShortKitFeedProps {
|
|
|
339
367
|
wasLast: boolean;
|
|
340
368
|
willAutoAdvance: boolean;
|
|
341
369
|
}) => void;
|
|
370
|
+
/**
|
|
371
|
+
* Fires when the user taps a video-carousel cell without triggering the
|
|
372
|
+
* cell's horizontal pan. Use with `useShortKit().setMuted(...)` to
|
|
373
|
+
* implement tap-to-mute on video-carousel overlays. Single-video and
|
|
374
|
+
* image-carousel cells don't need this — JS `<Pressable>` works for them.
|
|
375
|
+
*/
|
|
376
|
+
onVideoCarouselCellTap?: (event: {
|
|
377
|
+
id: string;
|
|
378
|
+
index: number;
|
|
379
|
+
pageIndex: number;
|
|
380
|
+
}) => void;
|
|
342
381
|
}
|
|
343
382
|
|
|
344
383
|
/**
|
|
@@ -346,8 +385,25 @@ export interface ShortKitFeedProps {
|
|
|
346
385
|
* Obtained via `ref` on `<ShortKitFeed>`.
|
|
347
386
|
*/
|
|
348
387
|
export interface ShortKitFeedHandle {
|
|
349
|
-
/**
|
|
350
|
-
|
|
388
|
+
/**
|
|
389
|
+
* Replace the feed's items atomically.
|
|
390
|
+
*
|
|
391
|
+
* @param items The new feed contents.
|
|
392
|
+
* @param options Optional. `startAt` specifies the item id to focus after
|
|
393
|
+
* the items apply. Overrides the `startAtItemId` prop for
|
|
394
|
+
* this call only — the prop's value is preserved for
|
|
395
|
+
* subsequent calls that omit this option.
|
|
396
|
+
*/
|
|
397
|
+
setFeedItems: (items: FeedInput[], options?: { startAt?: string }) => void;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Imperatively scroll the feed to the item with the given id. Silently
|
|
401
|
+
* no-ops if the id is not in the current items. Call after `onFeedReady`
|
|
402
|
+
* for the initial mount; for an atomic set-and-scroll, use
|
|
403
|
+
* `setFeedItems(items, { startAt })` instead.
|
|
404
|
+
*/
|
|
405
|
+
scrollToItem: (id: string, options?: { animated?: boolean }) => void;
|
|
406
|
+
|
|
351
407
|
/** Append items to this feed instance. */
|
|
352
408
|
appendFeedItems: (items: FeedInput[]) => void;
|
|
353
409
|
/** Apply a content filter to this feed instance. Pass null to clear. */
|