@shortkitsdk/react-native 0.2.12 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/shortkit/reactnative/ReactCarouselOverlayHost.kt +47 -4
- package/android/src/main/java/com/shortkit/reactnative/ReactVideoCarouselOverlayHost.kt +431 -0
- package/android/src/main/java/com/shortkit/reactnative/ShortKitBridge.kt +117 -2
- package/android/src/main/java/com/shortkit/reactnative/ShortKitModule.kt +7 -5
- package/ios/ReactCarouselOverlayHost.swift +67 -35
- package/ios/ReactOverlayHost.swift +85 -75
- package/ios/ReactVideoCarouselOverlayHost.swift +283 -0
- package/ios/ShortKitBridge.swift +122 -20
- package/ios/ShortKitModule.mm +15 -5
- package/ios/ShortKitSDK.xcframework/Info.plist +5 -4
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +1 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +5 -1
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +2488 -281
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +65 -5
- 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 +65 -5
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +168 -0
- package/ios/{ShortKitSDK.xcframework.bak/ios-arm64-simulator → ShortKitSDK.xcframework/ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +2 -1
- package/ios/ShortKitSDK.xcframework/{ios-arm64-simulator → ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Info.plist +5 -1
- package/ios/{ShortKitSDK.xcframework.bak/ios-arm64-simulator → ShortKitSDK.xcframework/ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +8233 -3592
- package/ios/{ShortKitSDK.xcframework.bak/ios-arm64-simulator → ShortKitSDK.xcframework/ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +120 -19
- package/ios/{ShortKitSDK.xcframework.bak/ios-arm64-simulator → ShortKitSDK.xcframework/ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/{ShortKitSDK.xcframework.bak/ios-arm64-simulator → ShortKitSDK.xcframework/ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +120 -19
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +33558 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +925 -0
- 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 +925 -0
- 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 +212 -0
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +1 -1
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +7338 -3272
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +106 -15
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +106 -15
- package/ios/ShortKitSDK.xcframework.dev-backup/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework.dev-backup/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +168 -0
- package/ios/{ShortKitSDK.xcframework → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1838 -206
- package/ios/{ShortKitSDK.xcframework → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +51 -1
- package/ios/{ShortKitSDK.xcframework → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/{ShortKitSDK.xcframework → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -1
- package/ios/ShortKitSDK.xcframework.dev-backup/ios-arm64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework.dev-backup/ios-arm64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +168 -0
- package/package.json +1 -1
- package/src/ShortKitCarouselOverlaySurface.tsx +57 -2
- package/src/ShortKitContext.ts +11 -0
- package/src/ShortKitFeed.tsx +25 -10
- package/src/ShortKitOverlaySurface.tsx +24 -11
- package/src/ShortKitProvider.tsx +4 -2
- package/src/ShortKitVideoCarouselOverlaySurface.tsx +156 -0
- package/src/ShortKitWidget.tsx +3 -3
- package/src/index.ts +5 -1
- package/src/serialization.ts +7 -0
- package/src/specs/NativeShortKitModule.ts +18 -2
- package/src/types.ts +48 -3
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework.bak/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework.bak/ios-arm64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/{ios-arm64-simulator → ios-arm64_x86_64-simulator}/ShortKitSDK.framework/Modules/module.modulemap +0 -0
- package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/Info.plist +4 -4
- /package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Info.plist +0 -0
- /package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64/ShortKitSDK.framework/Modules/module.modulemap +0 -0
- /package/ios/{ShortKitSDK.xcframework → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +0 -0
- /package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Info.plist +0 -0
- /package/ios/{ShortKitSDK.xcframework.bak → ShortKitSDK.xcframework.dev-backup}/ios-arm64-simulator/ShortKitSDK.framework/Modules/module.modulemap +0 -0
|
@@ -203,6 +203,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
203
203
|
public var scrollAxis: ShortKitSDK.ScrollAxis
|
|
204
204
|
public var videoOverlay: ShortKitSDK.VideoOverlayMode
|
|
205
205
|
public var carouselOverlay: ShortKitSDK.CarouselOverlayMode
|
|
206
|
+
public var videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode
|
|
206
207
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
207
208
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
208
209
|
public var muteOnStart: Swift.Bool
|
|
@@ -211,7 +212,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
211
212
|
public var coldStartEnabled: Swift.Bool
|
|
212
213
|
public var filter: ShortKitSDK.FeedFilter?
|
|
213
214
|
public var preload: ShortKitSDK.FeedPreload?
|
|
214
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
215
|
+
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, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
215
216
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
216
217
|
public init(from decoder: any Swift.Decoder) throws
|
|
217
218
|
}
|
|
@@ -240,6 +241,17 @@ extension ShortKitSDK.CarouselOverlayMode : Swift.Codable {
|
|
|
240
241
|
public init(from decoder: any Swift.Decoder) throws
|
|
241
242
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
242
243
|
}
|
|
244
|
+
public enum VideoCarouselOverlayMode {
|
|
245
|
+
case none
|
|
246
|
+
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.VideoCarouselOverlay)
|
|
247
|
+
}
|
|
248
|
+
extension ShortKitSDK.VideoCarouselOverlayMode : Swift.Equatable {
|
|
249
|
+
public static func == (lhs: ShortKitSDK.VideoCarouselOverlayMode, rhs: ShortKitSDK.VideoCarouselOverlayMode) -> Swift.Bool
|
|
250
|
+
}
|
|
251
|
+
extension ShortKitSDK.VideoCarouselOverlayMode : Swift.Codable {
|
|
252
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
253
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
254
|
+
}
|
|
243
255
|
public enum SurveyOverlayMode {
|
|
244
256
|
case none
|
|
245
257
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.SurveyOverlay)
|
|
@@ -409,12 +421,14 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
409
421
|
public enum FeedInput : Swift.Sendable {
|
|
410
422
|
case video(playbackId: Swift.String, fallbackUrl: Swift.String? = nil)
|
|
411
423
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
424
|
+
case videoCarousel(ShortKitSDK.VideoCarouselItem)
|
|
412
425
|
}
|
|
413
426
|
public enum FeedItem : Swift.Sendable {
|
|
414
427
|
case content(ShortKitSDK.ContentItem)
|
|
415
428
|
case adSlot(ShortKitSDK.AdSlot)
|
|
416
429
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
417
430
|
case survey(ShortKitSDK.SurveyItem)
|
|
431
|
+
case videoCarousel(ShortKitSDK.VideoCarouselItem)
|
|
418
432
|
public var isContent: Swift.Bool {
|
|
419
433
|
get
|
|
420
434
|
}
|
|
@@ -427,6 +441,9 @@ public enum FeedItem : Swift.Sendable {
|
|
|
427
441
|
public var isSurvey: Swift.Bool {
|
|
428
442
|
get
|
|
429
443
|
}
|
|
444
|
+
public var isVideoCarousel: Swift.Bool {
|
|
445
|
+
get
|
|
446
|
+
}
|
|
430
447
|
public var isNonVideo: Swift.Bool {
|
|
431
448
|
get
|
|
432
449
|
}
|
|
@@ -442,6 +459,9 @@ public enum FeedItem : Swift.Sendable {
|
|
|
442
459
|
public var surveyItem: ShortKitSDK.SurveyItem? {
|
|
443
460
|
get
|
|
444
461
|
}
|
|
462
|
+
public var videoCarouselItem: ShortKitSDK.VideoCarouselItem? {
|
|
463
|
+
get
|
|
464
|
+
}
|
|
445
465
|
public var id: Swift.String {
|
|
446
466
|
get
|
|
447
467
|
}
|
|
@@ -545,6 +565,19 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
545
565
|
public init(startTime: Swift.Double, endTime: Swift.Double, text: Swift.String)
|
|
546
566
|
public static func == (a: ShortKitSDK.VTTCue, b: ShortKitSDK.VTTCue) -> Swift.Bool
|
|
547
567
|
}
|
|
568
|
+
public struct VideoCarouselItem : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
569
|
+
public let id: Swift.String
|
|
570
|
+
public let videos: [ShortKitSDK.ContentItem]
|
|
571
|
+
public let title: Swift.String?
|
|
572
|
+
public let description: Swift.String?
|
|
573
|
+
public let author: Swift.String?
|
|
574
|
+
public let section: Swift.String?
|
|
575
|
+
public let articleUrl: Swift.String?
|
|
576
|
+
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)
|
|
577
|
+
public static func == (a: ShortKitSDK.VideoCarouselItem, b: ShortKitSDK.VideoCarouselItem) -> Swift.Bool
|
|
578
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
579
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
580
|
+
}
|
|
548
581
|
public protocol AdOverlay : AnyObject {
|
|
549
582
|
func configure(with content: ShortKitSDK.NativeAdContent)
|
|
550
583
|
func resetState()
|
|
@@ -554,6 +587,8 @@ public protocol CarouselOverlay : AnyObject {
|
|
|
554
587
|
func configure(with item: ShortKitSDK.ImageCarouselItem)
|
|
555
588
|
func resetState()
|
|
556
589
|
var wantsNativeImagePrefetch: Swift.Bool { get }
|
|
590
|
+
func activatePlayback()
|
|
591
|
+
func updateActiveImage(index: Swift.Int)
|
|
557
592
|
}
|
|
558
593
|
extension ShortKitSDK.CarouselOverlay {
|
|
559
594
|
public var cachedImage: ((Swift.String) -> UIKit.UIImage?)? {
|
|
@@ -563,6 +598,8 @@ extension ShortKitSDK.CarouselOverlay {
|
|
|
563
598
|
public var wantsNativeImagePrefetch: Swift.Bool {
|
|
564
599
|
get
|
|
565
600
|
}
|
|
601
|
+
public func activatePlayback()
|
|
602
|
+
public func updateActiveImage(index: Swift.Int)
|
|
566
603
|
}
|
|
567
604
|
final public class CellContent : Combine.ObservableObject {
|
|
568
605
|
@Combine.Published @_projectedValueProperty($item) final public var item: ShortKitSDK.ContentItem? {
|
|
@@ -592,6 +629,19 @@ public protocol SurveyOverlay : AnyObject {
|
|
|
592
629
|
func configure(with item: ShortKitSDK.SurveyItem)
|
|
593
630
|
func resetState()
|
|
594
631
|
}
|
|
632
|
+
public protocol VideoCarouselOverlay : AnyObject {
|
|
633
|
+
func configure(with item: ShortKitSDK.VideoCarouselItem)
|
|
634
|
+
func updateActiveVideo(index: Swift.Int, item: ShortKitSDK.ContentItem)
|
|
635
|
+
func resetState()
|
|
636
|
+
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
637
|
+
func activatePlayback()
|
|
638
|
+
func deactivatePlayback()
|
|
639
|
+
}
|
|
640
|
+
extension ShortKitSDK.VideoCarouselOverlay {
|
|
641
|
+
public func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
642
|
+
public func activatePlayback()
|
|
643
|
+
public func deactivatePlayback()
|
|
644
|
+
}
|
|
595
645
|
public struct PlayerTime : Swift.Equatable, Swift.Sendable {
|
|
596
646
|
public let current: Swift.Double
|
|
597
647
|
public let duration: Swift.Double
|
|
@@ -203,6 +203,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
203
203
|
public var scrollAxis: ShortKitSDK.ScrollAxis
|
|
204
204
|
public var videoOverlay: ShortKitSDK.VideoOverlayMode
|
|
205
205
|
public var carouselOverlay: ShortKitSDK.CarouselOverlayMode
|
|
206
|
+
public var videoCarouselOverlay: ShortKitSDK.VideoCarouselOverlayMode
|
|
206
207
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
207
208
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
208
209
|
public var muteOnStart: Swift.Bool
|
|
@@ -211,7 +212,7 @@ public struct FeedConfig : Swift.Codable {
|
|
|
211
212
|
public var coldStartEnabled: Swift.Bool
|
|
212
213
|
public var filter: ShortKitSDK.FeedFilter?
|
|
213
214
|
public var preload: ShortKitSDK.FeedPreload?
|
|
214
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, scrollAxis: ShortKitSDK.ScrollAxis = .vertical, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
215
|
+
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, muteOnStart: Swift.Bool = true, autoplay: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool = false, filter: ShortKitSDK.FeedFilter? = nil, preload: ShortKitSDK.FeedPreload? = nil)
|
|
215
216
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
216
217
|
public init(from decoder: any Swift.Decoder) throws
|
|
217
218
|
}
|
|
@@ -240,6 +241,17 @@ extension ShortKitSDK.CarouselOverlayMode : Swift.Codable {
|
|
|
240
241
|
public init(from decoder: any Swift.Decoder) throws
|
|
241
242
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
242
243
|
}
|
|
244
|
+
public enum VideoCarouselOverlayMode {
|
|
245
|
+
case none
|
|
246
|
+
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.VideoCarouselOverlay)
|
|
247
|
+
}
|
|
248
|
+
extension ShortKitSDK.VideoCarouselOverlayMode : Swift.Equatable {
|
|
249
|
+
public static func == (lhs: ShortKitSDK.VideoCarouselOverlayMode, rhs: ShortKitSDK.VideoCarouselOverlayMode) -> Swift.Bool
|
|
250
|
+
}
|
|
251
|
+
extension ShortKitSDK.VideoCarouselOverlayMode : Swift.Codable {
|
|
252
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
253
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
254
|
+
}
|
|
243
255
|
public enum SurveyOverlayMode {
|
|
244
256
|
case none
|
|
245
257
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.SurveyOverlay)
|
|
@@ -409,12 +421,14 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
409
421
|
public enum FeedInput : Swift.Sendable {
|
|
410
422
|
case video(playbackId: Swift.String, fallbackUrl: Swift.String? = nil)
|
|
411
423
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
424
|
+
case videoCarousel(ShortKitSDK.VideoCarouselItem)
|
|
412
425
|
}
|
|
413
426
|
public enum FeedItem : Swift.Sendable {
|
|
414
427
|
case content(ShortKitSDK.ContentItem)
|
|
415
428
|
case adSlot(ShortKitSDK.AdSlot)
|
|
416
429
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
417
430
|
case survey(ShortKitSDK.SurveyItem)
|
|
431
|
+
case videoCarousel(ShortKitSDK.VideoCarouselItem)
|
|
418
432
|
public var isContent: Swift.Bool {
|
|
419
433
|
get
|
|
420
434
|
}
|
|
@@ -427,6 +441,9 @@ public enum FeedItem : Swift.Sendable {
|
|
|
427
441
|
public var isSurvey: Swift.Bool {
|
|
428
442
|
get
|
|
429
443
|
}
|
|
444
|
+
public var isVideoCarousel: Swift.Bool {
|
|
445
|
+
get
|
|
446
|
+
}
|
|
430
447
|
public var isNonVideo: Swift.Bool {
|
|
431
448
|
get
|
|
432
449
|
}
|
|
@@ -442,6 +459,9 @@ public enum FeedItem : Swift.Sendable {
|
|
|
442
459
|
public var surveyItem: ShortKitSDK.SurveyItem? {
|
|
443
460
|
get
|
|
444
461
|
}
|
|
462
|
+
public var videoCarouselItem: ShortKitSDK.VideoCarouselItem? {
|
|
463
|
+
get
|
|
464
|
+
}
|
|
445
465
|
public var id: Swift.String {
|
|
446
466
|
get
|
|
447
467
|
}
|
|
@@ -545,6 +565,19 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
545
565
|
public init(startTime: Swift.Double, endTime: Swift.Double, text: Swift.String)
|
|
546
566
|
public static func == (a: ShortKitSDK.VTTCue, b: ShortKitSDK.VTTCue) -> Swift.Bool
|
|
547
567
|
}
|
|
568
|
+
public struct VideoCarouselItem : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
569
|
+
public let id: Swift.String
|
|
570
|
+
public let videos: [ShortKitSDK.ContentItem]
|
|
571
|
+
public let title: Swift.String?
|
|
572
|
+
public let description: Swift.String?
|
|
573
|
+
public let author: Swift.String?
|
|
574
|
+
public let section: Swift.String?
|
|
575
|
+
public let articleUrl: Swift.String?
|
|
576
|
+
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)
|
|
577
|
+
public static func == (a: ShortKitSDK.VideoCarouselItem, b: ShortKitSDK.VideoCarouselItem) -> Swift.Bool
|
|
578
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
579
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
580
|
+
}
|
|
548
581
|
public protocol AdOverlay : AnyObject {
|
|
549
582
|
func configure(with content: ShortKitSDK.NativeAdContent)
|
|
550
583
|
func resetState()
|
|
@@ -554,6 +587,8 @@ public protocol CarouselOverlay : AnyObject {
|
|
|
554
587
|
func configure(with item: ShortKitSDK.ImageCarouselItem)
|
|
555
588
|
func resetState()
|
|
556
589
|
var wantsNativeImagePrefetch: Swift.Bool { get }
|
|
590
|
+
func activatePlayback()
|
|
591
|
+
func updateActiveImage(index: Swift.Int)
|
|
557
592
|
}
|
|
558
593
|
extension ShortKitSDK.CarouselOverlay {
|
|
559
594
|
public var cachedImage: ((Swift.String) -> UIKit.UIImage?)? {
|
|
@@ -563,6 +598,8 @@ extension ShortKitSDK.CarouselOverlay {
|
|
|
563
598
|
public var wantsNativeImagePrefetch: Swift.Bool {
|
|
564
599
|
get
|
|
565
600
|
}
|
|
601
|
+
public func activatePlayback()
|
|
602
|
+
public func updateActiveImage(index: Swift.Int)
|
|
566
603
|
}
|
|
567
604
|
final public class CellContent : Combine.ObservableObject {
|
|
568
605
|
@Combine.Published @_projectedValueProperty($item) final public var item: ShortKitSDK.ContentItem? {
|
|
@@ -592,6 +629,19 @@ public protocol SurveyOverlay : AnyObject {
|
|
|
592
629
|
func configure(with item: ShortKitSDK.SurveyItem)
|
|
593
630
|
func resetState()
|
|
594
631
|
}
|
|
632
|
+
public protocol VideoCarouselOverlay : AnyObject {
|
|
633
|
+
func configure(with item: ShortKitSDK.VideoCarouselItem)
|
|
634
|
+
func updateActiveVideo(index: Swift.Int, item: ShortKitSDK.ContentItem)
|
|
635
|
+
func resetState()
|
|
636
|
+
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
637
|
+
func activatePlayback()
|
|
638
|
+
func deactivatePlayback()
|
|
639
|
+
}
|
|
640
|
+
extension ShortKitSDK.VideoCarouselOverlay {
|
|
641
|
+
public func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
642
|
+
public func activatePlayback()
|
|
643
|
+
public func deactivatePlayback()
|
|
644
|
+
}
|
|
595
645
|
public struct PlayerTime : Swift.Equatable, Swift.Sendable {
|
|
596
646
|
public let current: Swift.Double
|
|
597
647
|
public let duration: Swift.Double
|
package/ios/ShortKitSDK.xcframework.dev-backup/ios-arm64-simulator/ShortKitSDK.framework/ShortKitSDK
ADDED
|
Binary file
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Headers/ShortKitSDK-Swift.h</key>
|
|
8
|
+
<data>
|
|
9
|
+
3bbpoSImjQOVLQbSfh6sAEp9NqY=
|
|
10
|
+
</data>
|
|
11
|
+
<key>Info.plist</key>
|
|
12
|
+
<data>
|
|
13
|
+
Ley678FJu8DKkhiCwrDCSa/fREc=
|
|
14
|
+
</data>
|
|
15
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
|
+
<data>
|
|
17
|
+
UXy9TKZ3jOo1h3yIihNnV4dQp7U=
|
|
18
|
+
</data>
|
|
19
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
|
+
<data>
|
|
21
|
+
yxz4ANQUVWM4+pNexcbMhEtvg30=
|
|
22
|
+
</data>
|
|
23
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
|
+
<data>
|
|
25
|
+
DK7MvgzrcSHBHViTj0Ef3+LnBmc=
|
|
26
|
+
</data>
|
|
27
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
|
+
<data>
|
|
29
|
+
yxz4ANQUVWM4+pNexcbMhEtvg30=
|
|
30
|
+
</data>
|
|
31
|
+
<key>Modules/module.modulemap</key>
|
|
32
|
+
<data>
|
|
33
|
+
QthRxkVp/MRBzYVNLtX05t2Csso=
|
|
34
|
+
</data>
|
|
35
|
+
</dict>
|
|
36
|
+
<key>files2</key>
|
|
37
|
+
<dict>
|
|
38
|
+
<key>Headers/ShortKitSDK-Swift.h</key>
|
|
39
|
+
<dict>
|
|
40
|
+
<key>hash2</key>
|
|
41
|
+
<data>
|
|
42
|
+
V+jQ2eNebJRtNpq31u6WQqjInnpmCU26LytMq5YTXJk=
|
|
43
|
+
</data>
|
|
44
|
+
</dict>
|
|
45
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
46
|
+
<dict>
|
|
47
|
+
<key>hash2</key>
|
|
48
|
+
<data>
|
|
49
|
+
xc/3beYtE9m0Lo6S3wpA6SlO9HYbjsJ985rl98j1eIY=
|
|
50
|
+
</data>
|
|
51
|
+
</dict>
|
|
52
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
53
|
+
<dict>
|
|
54
|
+
<key>hash2</key>
|
|
55
|
+
<data>
|
|
56
|
+
9qbyNESX9aF8c95D7gm8GHd/uU6E3/oxbLjeUhcWqYg=
|
|
57
|
+
</data>
|
|
58
|
+
</dict>
|
|
59
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
60
|
+
<dict>
|
|
61
|
+
<key>hash2</key>
|
|
62
|
+
<data>
|
|
63
|
+
UyIgXF6hWtTcHaIdLiGNttWuQWMuQqJ9FVoBTa0cDds=
|
|
64
|
+
</data>
|
|
65
|
+
</dict>
|
|
66
|
+
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
67
|
+
<dict>
|
|
68
|
+
<key>hash2</key>
|
|
69
|
+
<data>
|
|
70
|
+
9qbyNESX9aF8c95D7gm8GHd/uU6E3/oxbLjeUhcWqYg=
|
|
71
|
+
</data>
|
|
72
|
+
</dict>
|
|
73
|
+
<key>Modules/module.modulemap</key>
|
|
74
|
+
<dict>
|
|
75
|
+
<key>hash2</key>
|
|
76
|
+
<data>
|
|
77
|
+
K4gZcRkdlvQBo5cnduiRMooPuUS6dWAP1E7dBJRuHL4=
|
|
78
|
+
</data>
|
|
79
|
+
</dict>
|
|
80
|
+
</dict>
|
|
81
|
+
<key>rules</key>
|
|
82
|
+
<dict>
|
|
83
|
+
<key>^.*</key>
|
|
84
|
+
<true/>
|
|
85
|
+
<key>^.*\.lproj/</key>
|
|
86
|
+
<dict>
|
|
87
|
+
<key>optional</key>
|
|
88
|
+
<true/>
|
|
89
|
+
<key>weight</key>
|
|
90
|
+
<real>1000</real>
|
|
91
|
+
</dict>
|
|
92
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
93
|
+
<dict>
|
|
94
|
+
<key>omit</key>
|
|
95
|
+
<true/>
|
|
96
|
+
<key>weight</key>
|
|
97
|
+
<real>1100</real>
|
|
98
|
+
</dict>
|
|
99
|
+
<key>^Base\.lproj/</key>
|
|
100
|
+
<dict>
|
|
101
|
+
<key>weight</key>
|
|
102
|
+
<real>1010</real>
|
|
103
|
+
</dict>
|
|
104
|
+
<key>^version.plist$</key>
|
|
105
|
+
<true/>
|
|
106
|
+
</dict>
|
|
107
|
+
<key>rules2</key>
|
|
108
|
+
<dict>
|
|
109
|
+
<key>.*\.dSYM($|/)</key>
|
|
110
|
+
<dict>
|
|
111
|
+
<key>weight</key>
|
|
112
|
+
<real>11</real>
|
|
113
|
+
</dict>
|
|
114
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
115
|
+
<dict>
|
|
116
|
+
<key>omit</key>
|
|
117
|
+
<true/>
|
|
118
|
+
<key>weight</key>
|
|
119
|
+
<real>2000</real>
|
|
120
|
+
</dict>
|
|
121
|
+
<key>^.*</key>
|
|
122
|
+
<true/>
|
|
123
|
+
<key>^.*\.lproj/</key>
|
|
124
|
+
<dict>
|
|
125
|
+
<key>optional</key>
|
|
126
|
+
<true/>
|
|
127
|
+
<key>weight</key>
|
|
128
|
+
<real>1000</real>
|
|
129
|
+
</dict>
|
|
130
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
131
|
+
<dict>
|
|
132
|
+
<key>omit</key>
|
|
133
|
+
<true/>
|
|
134
|
+
<key>weight</key>
|
|
135
|
+
<real>1100</real>
|
|
136
|
+
</dict>
|
|
137
|
+
<key>^Base\.lproj/</key>
|
|
138
|
+
<dict>
|
|
139
|
+
<key>weight</key>
|
|
140
|
+
<real>1010</real>
|
|
141
|
+
</dict>
|
|
142
|
+
<key>^Info\.plist$</key>
|
|
143
|
+
<dict>
|
|
144
|
+
<key>omit</key>
|
|
145
|
+
<true/>
|
|
146
|
+
<key>weight</key>
|
|
147
|
+
<real>20</real>
|
|
148
|
+
</dict>
|
|
149
|
+
<key>^PkgInfo$</key>
|
|
150
|
+
<dict>
|
|
151
|
+
<key>omit</key>
|
|
152
|
+
<true/>
|
|
153
|
+
<key>weight</key>
|
|
154
|
+
<real>20</real>
|
|
155
|
+
</dict>
|
|
156
|
+
<key>^embedded\.provisionprofile$</key>
|
|
157
|
+
<dict>
|
|
158
|
+
<key>weight</key>
|
|
159
|
+
<real>20</real>
|
|
160
|
+
</dict>
|
|
161
|
+
<key>^version\.plist$</key>
|
|
162
|
+
<dict>
|
|
163
|
+
<key>weight</key>
|
|
164
|
+
<real>20</real>
|
|
165
|
+
</dict>
|
|
166
|
+
</dict>
|
|
167
|
+
</dict>
|
|
168
|
+
</plist>
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { AppRegistry } from 'react-native';
|
|
3
3
|
import type { CarouselOverlayProps, ImageCarouselItem } from './types';
|
|
4
|
+
import NativeShortKitModule from './specs/NativeShortKitModule';
|
|
4
5
|
|
|
5
6
|
const _carouselRegistry = new Map<string, React.ComponentType<CarouselOverlayProps>>();
|
|
6
7
|
|
|
@@ -24,7 +25,30 @@ export function registerCarouselOverlayComponent(
|
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/** Subscribe to a named native event, filtered by surfaceId. */
|
|
29
|
+
function useOverlayEvent<T extends { surfaceId: string }>(
|
|
30
|
+
eventName: string,
|
|
31
|
+
surfaceId: string | undefined,
|
|
32
|
+
handler: (event: T) => void,
|
|
33
|
+
) {
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!surfaceId) return;
|
|
36
|
+
|
|
37
|
+
let sub: { remove: () => void } | undefined;
|
|
38
|
+
const emitter = NativeShortKitModule?.[eventName as keyof typeof NativeShortKitModule];
|
|
39
|
+
if (typeof emitter === 'function') {
|
|
40
|
+
sub = (emitter as (cb: (e: T) => void) => { remove: () => void })((e: T) => {
|
|
41
|
+
if (e.surfaceId !== surfaceId) return;
|
|
42
|
+
handler(e);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return () => sub?.remove();
|
|
47
|
+
}, [surfaceId]);
|
|
48
|
+
}
|
|
49
|
+
|
|
27
50
|
interface RawCarouselSurfaceProps {
|
|
51
|
+
surfaceId?: string;
|
|
28
52
|
item?: string;
|
|
29
53
|
}
|
|
30
54
|
|
|
@@ -38,6 +62,31 @@ function CarouselSurfaceInner(props: InnerProps) {
|
|
|
38
62
|
return null;
|
|
39
63
|
}
|
|
40
64
|
|
|
65
|
+
const sid = props.surfaceId;
|
|
66
|
+
|
|
67
|
+
const [isActive, setIsActive] = useState(false);
|
|
68
|
+
const [activeImageIndex, setActiveImageIndex] = useState(0);
|
|
69
|
+
|
|
70
|
+
// isActive delivered via onOverlayFullState (same event as video overlay)
|
|
71
|
+
useOverlayEvent<{
|
|
72
|
+
surfaceId: string;
|
|
73
|
+
isActive: boolean;
|
|
74
|
+
playerState: string;
|
|
75
|
+
isMuted: boolean;
|
|
76
|
+
playbackRate: number;
|
|
77
|
+
captionsEnabled: boolean;
|
|
78
|
+
activeCue: string | null;
|
|
79
|
+
feedScrollPhase: string | null;
|
|
80
|
+
}>('onOverlayFullState', sid, (e) => {
|
|
81
|
+
setIsActive(e.isActive);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// activeImageIndex delivered via dedicated event
|
|
85
|
+
useOverlayEvent<{ surfaceId: string; activeImageIndex: number }>(
|
|
86
|
+
'onCarouselActiveImageChanged', sid,
|
|
87
|
+
(e) => setActiveImageIndex(e.activeImageIndex),
|
|
88
|
+
);
|
|
89
|
+
|
|
41
90
|
const item: ImageCarouselItem | null = useMemo(() => {
|
|
42
91
|
if (!props.item) {
|
|
43
92
|
return null;
|
|
@@ -51,5 +100,11 @@ function CarouselSurfaceInner(props: InnerProps) {
|
|
|
51
100
|
|
|
52
101
|
if (!item) return null;
|
|
53
102
|
|
|
54
|
-
return
|
|
103
|
+
return (
|
|
104
|
+
<Component
|
|
105
|
+
item={item}
|
|
106
|
+
isActive={isActive}
|
|
107
|
+
activeImageIndex={activeImageIndex}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
55
110
|
}
|
package/src/ShortKitContext.ts
CHANGED
|
@@ -54,3 +54,14 @@ export interface ShortKitContextValue {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export const ShortKitContext = createContext<ShortKitContextValue | null>(null);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Lightweight context that only signals "a ShortKitProvider is mounted".
|
|
60
|
+
* Components that need the provider but don't consume player state (e.g.
|
|
61
|
+
* ShortKitFeed, ShortKitWidget) should subscribe to this instead of
|
|
62
|
+
* ShortKitContext to avoid re-rendering on every TIME/PLAYER_STATE dispatch.
|
|
63
|
+
*
|
|
64
|
+
* The value is set once in ShortKitProvider and never changes, so
|
|
65
|
+
* subscribers never re-render from this context.
|
|
66
|
+
*/
|
|
67
|
+
export const ShortKitInitContext = createContext<boolean>(false);
|
package/src/ShortKitFeed.tsx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, forwardRef } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import type { ShortKitFeedProps, FeedInput, FeedFilter, ShortKitFeedHandle } from './types';
|
|
3
|
+
import type { ShortKitFeedProps, FeedInput, FeedFilter, ShortKitFeedHandle, ShortKitRefreshState } from './types';
|
|
4
4
|
import ShortKitFeedView from './specs/ShortKitFeedViewNativeComponent';
|
|
5
5
|
import NativeShortKitModule from './specs/NativeShortKitModule';
|
|
6
|
-
import {
|
|
6
|
+
import { ShortKitInitContext } from './ShortKitContext';
|
|
7
7
|
import { deserializeContentItem, serializeFeedConfig, serializeFeedInputs } from './serialization';
|
|
8
8
|
import { registerOverlayComponent } from './ShortKitOverlaySurface';
|
|
9
9
|
import { registerCarouselOverlayComponent } from './ShortKitCarouselOverlaySurface';
|
|
10
|
+
import { registerVideoCarouselOverlayComponent } from './ShortKitVideoCarouselOverlaySurface';
|
|
10
11
|
|
|
11
12
|
function generateFeedId(): string {
|
|
12
13
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
|
@@ -38,17 +39,24 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
38
39
|
onFormatChange,
|
|
39
40
|
onContentTapped,
|
|
40
41
|
onDismiss,
|
|
41
|
-
|
|
42
|
+
onRefreshStateChanged,
|
|
42
43
|
onDidFetchContentItems,
|
|
43
44
|
onRemainingContentCountChange,
|
|
44
45
|
onFeedReady,
|
|
45
46
|
} = props;
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
48
|
+
const isInitialized = useContext(ShortKitInitContext);
|
|
49
|
+
if (!isInitialized) {
|
|
49
50
|
throw new Error('ShortKitFeed must be used within a ShortKitProvider');
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
// ⚡ TEMP — remove after verifying. Should only log on mount, not on every swipe/time update.
|
|
54
|
+
const renderCount = useRef(0);
|
|
55
|
+
renderCount.current++;
|
|
56
|
+
if (renderCount.current <= 3 || renderCount.current % 100 === 0) {
|
|
57
|
+
console.log(`[SK:Feed] render #${renderCount.current}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
// Stable feed instance ID — survives re-renders and React fast refresh
|
|
53
61
|
const feedIdRef = useRef(generateFeedId());
|
|
54
62
|
const feedId = feedIdRef.current;
|
|
@@ -103,7 +111,10 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
103
111
|
if (config?.carouselOverlay && config.carouselOverlay !== 'none') {
|
|
104
112
|
registerCarouselOverlayComponent(config.carouselOverlay.name, config.carouselOverlay.component);
|
|
105
113
|
}
|
|
106
|
-
|
|
114
|
+
if (config?.videoCarouselOverlay && config.videoCarouselOverlay !== 'none') {
|
|
115
|
+
registerVideoCarouselOverlayComponent(config.videoCarouselOverlay.name, config.videoCarouselOverlay.component);
|
|
116
|
+
}
|
|
117
|
+
}, [config?.overlay, config?.carouselOverlay, config?.videoCarouselOverlay]);
|
|
107
118
|
|
|
108
119
|
const serializedConfig = useMemo(
|
|
109
120
|
() => (config ? serializeFeedConfig(config) : '{}'),
|
|
@@ -180,10 +191,14 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
180
191
|
);
|
|
181
192
|
}
|
|
182
193
|
|
|
183
|
-
if (
|
|
194
|
+
if (onRefreshStateChanged) {
|
|
184
195
|
subscriptions.push(
|
|
185
|
-
NativeShortKitModule.
|
|
186
|
-
|
|
196
|
+
NativeShortKitModule.onRefreshStateChanged((event) => {
|
|
197
|
+
const state: ShortKitRefreshState =
|
|
198
|
+
event.status === 'pulling'
|
|
199
|
+
? { status: 'pulling', progress: event.progress }
|
|
200
|
+
: { status: event.status as 'idle' | 'triggered' | 'refreshing' };
|
|
201
|
+
onRefreshStateChanged(state);
|
|
187
202
|
}),
|
|
188
203
|
);
|
|
189
204
|
}
|
|
@@ -213,7 +228,7 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
|
|
|
213
228
|
onFormatChange,
|
|
214
229
|
onContentTapped,
|
|
215
230
|
onDismiss,
|
|
216
|
-
|
|
231
|
+
onRefreshStateChanged,
|
|
217
232
|
onDidFetchContentItems,
|
|
218
233
|
]);
|
|
219
234
|
|