@shortkitsdk/react-native 0.2.4 → 0.2.6
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/ShortKitModule.kt +49 -11
- package/ios/ShortKitBridge.swift +85 -7
- package/ios/ShortKitCarouselOverlayBridge.swift +177 -12
- package/ios/ShortKitFeedView.swift +48 -25
- package/ios/ShortKitModule.mm +29 -4
- package/ios/ShortKitOverlayBridge.swift +2 -4
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +1 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +1635 -457
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +50 -16
- 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 +50 -16
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/Headers/ShortKitSDK-Swift.h +1 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1635 -457
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +50 -16
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +50 -16
- package/ios/ShortKitSDK.xcframework/ios-arm64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/package.json +1 -1
- package/plugin/build/withShortKitIOS.js +11 -2
- package/src/CarouselOverlayManager.tsx +0 -1
- package/src/OverlayManager.tsx +1 -1
- package/src/ShortKitContext.ts +11 -6
- package/src/ShortKitProvider.tsx +140 -66
- package/src/index.ts +4 -1
- package/src/serialization.ts +3 -3
- package/src/specs/NativeShortKitModule.ts +18 -16
- package/src/types.ts +26 -3
- package/src/useShortKitCarousel.ts +2 -2
- package/src/useShortKitPlayer.ts +0 -1
|
@@ -159,7 +159,6 @@ final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
|
159
159
|
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
160
160
|
final public func pause()
|
|
161
161
|
final public func resume()
|
|
162
|
-
public static func selectTargets(currentIndex: Swift.Int, feedItems: [ShortKitSDK.FeedItem], cache: any ShortKitSDK.SegmentCacheProtocol, maxCount: Swift.Int) -> [ShortKitSDK.ContentItem]
|
|
163
162
|
@objc deinit
|
|
164
163
|
}
|
|
165
164
|
public enum FeedHeight : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
@@ -185,9 +184,10 @@ public struct FeedConfig : Swift.Codable {
|
|
|
185
184
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
186
185
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
187
186
|
public var muteOnStart: Swift.Bool
|
|
187
|
+
public var autoplay: Swift.Bool
|
|
188
188
|
public var feedSource: ShortKitSDK.FeedSource
|
|
189
189
|
public var coldStartEnabled: Swift.Bool
|
|
190
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, muteOnStart: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool? = nil)
|
|
190
|
+
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, 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? = nil)
|
|
191
191
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
192
192
|
public init(from decoder: any Swift.Decoder) throws
|
|
193
193
|
}
|
|
@@ -195,6 +195,9 @@ public enum VideoOverlayMode {
|
|
|
195
195
|
case none
|
|
196
196
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
197
197
|
}
|
|
198
|
+
extension ShortKitSDK.VideoOverlayMode {
|
|
199
|
+
public static func swiftUI<Content>(@SwiftUICore.ViewBuilder content: @escaping @Sendable (ShortKitSDK.ShortKitPlayer, ShortKitSDK.CellContent) -> Content) -> ShortKitSDK.VideoOverlayMode where Content : SwiftUICore.View
|
|
200
|
+
}
|
|
198
201
|
extension ShortKitSDK.VideoOverlayMode : Swift.Equatable {
|
|
199
202
|
public static func == (lhs: ShortKitSDK.VideoOverlayMode, rhs: ShortKitSDK.VideoOverlayMode) -> Swift.Bool
|
|
200
203
|
}
|
|
@@ -238,10 +241,12 @@ extension ShortKitSDK.AdOverlayMode : Swift.Codable {
|
|
|
238
241
|
public protocol ShortKitDelegate : AnyObject {
|
|
239
242
|
func shortKitDidRequestRefresh(_ shortKit: ShortKitSDK.ShortKit)
|
|
240
243
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
244
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
241
245
|
}
|
|
242
246
|
extension ShortKitSDK.ShortKitDelegate {
|
|
243
247
|
public func shortKitDidRequestRefresh(_ shortKit: ShortKitSDK.ShortKit)
|
|
244
248
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
249
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
245
250
|
}
|
|
246
251
|
@_Concurrency.MainActor @preconcurrency public struct ShortKitFeedView : SwiftUI.UIViewControllerRepresentable {
|
|
247
252
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit)
|
|
@@ -255,6 +260,7 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
255
260
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
256
261
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, startAtItemId: Swift.String? = nil)
|
|
257
262
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLoad()
|
|
263
|
+
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLayoutSubviews()
|
|
258
264
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillAppear(_ animated: Swift.Bool)
|
|
259
265
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidAppear(_ animated: Swift.Bool)
|
|
260
266
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillDisappear(_ animated: Swift.Bool)
|
|
@@ -356,12 +362,13 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
356
362
|
public let author: Swift.String?
|
|
357
363
|
public let articleUrl: Swift.String?
|
|
358
364
|
public let commentCount: Swift.Int?
|
|
365
|
+
public var fallbackUrl: Swift.String?
|
|
359
366
|
public static func == (a: ShortKitSDK.ContentItem, b: ShortKitSDK.ContentItem) -> Swift.Bool
|
|
360
367
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
361
368
|
public init(from decoder: any Swift.Decoder) throws
|
|
362
369
|
}
|
|
363
|
-
public enum
|
|
364
|
-
case video(playbackId: Swift.String)
|
|
370
|
+
public enum FeedInput : Swift.Sendable {
|
|
371
|
+
case video(playbackId: Swift.String, fallbackUrl: Swift.String? = nil)
|
|
365
372
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
366
373
|
}
|
|
367
374
|
public enum FeedItem : Swift.Sendable {
|
|
@@ -503,30 +510,46 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
503
510
|
public protocol AdOverlay : AnyObject {
|
|
504
511
|
func configure(with content: ShortKitSDK.NativeAdContent)
|
|
505
512
|
func resetState()
|
|
506
|
-
func fadeOutForTransition()
|
|
507
|
-
func restoreFromTransition()
|
|
508
513
|
}
|
|
509
514
|
public protocol CarouselOverlay : AnyObject {
|
|
515
|
+
var cachedImage: ((Swift.String) -> UIKit.UIImage?)? { get set }
|
|
510
516
|
func configure(with item: ShortKitSDK.ImageCarouselItem)
|
|
511
517
|
func resetState()
|
|
512
|
-
|
|
513
|
-
|
|
518
|
+
}
|
|
519
|
+
extension ShortKitSDK.CarouselOverlay {
|
|
520
|
+
public var cachedImage: ((Swift.String) -> UIKit.UIImage?)? {
|
|
521
|
+
get
|
|
522
|
+
set
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
final public class CellContent : Combine.ObservableObject {
|
|
526
|
+
@Combine.Published @_projectedValueProperty($item) final public var item: ShortKitSDK.ContentItem? {
|
|
527
|
+
get
|
|
528
|
+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
529
|
+
set
|
|
530
|
+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
531
|
+
_modify
|
|
532
|
+
}
|
|
533
|
+
final public var $item: Combine.Published<ShortKitSDK.ContentItem?>.Publisher {
|
|
534
|
+
get
|
|
535
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
|
|
536
|
+
set
|
|
537
|
+
}
|
|
538
|
+
public init()
|
|
539
|
+
public typealias ObjectWillChangePublisher = Combine.ObservableObjectPublisher
|
|
540
|
+
@objc deinit
|
|
514
541
|
}
|
|
515
542
|
public protocol FeedOverlay : AnyObject {
|
|
516
543
|
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
517
544
|
func configure(with item: ShortKitSDK.ContentItem)
|
|
518
545
|
func resetPlaybackProgress()
|
|
519
546
|
func activatePlayback()
|
|
520
|
-
func fadeOutForTransition()
|
|
521
|
-
func restoreFromTransition()
|
|
522
547
|
}
|
|
523
548
|
public protocol SurveyOverlay : AnyObject {
|
|
524
549
|
var onSurveyResponse: ((Swift.String, ShortKitSDK.SurveyOption) -> Swift.Void)? { get set }
|
|
525
550
|
var onAutoAdvance: (() -> Swift.Void)? { get set }
|
|
526
551
|
func configure(with item: ShortKitSDK.SurveyItem)
|
|
527
552
|
func resetState()
|
|
528
|
-
func fadeOutForTransition()
|
|
529
|
-
func restoreFromTransition()
|
|
530
553
|
}
|
|
531
554
|
public struct PlayerTime : Swift.Equatable, Swift.Sendable {
|
|
532
555
|
public let current: Swift.Double
|
|
@@ -582,6 +605,11 @@ public struct FormatChangeEvent : Swift.Equatable, Swift.Sendable {
|
|
|
582
605
|
public let toResolution: Swift.String
|
|
583
606
|
public static func == (a: ShortKitSDK.FormatChangeEvent, b: ShortKitSDK.FormatChangeEvent) -> Swift.Bool
|
|
584
607
|
}
|
|
608
|
+
public enum FeedScrollPhase : Swift.Equatable, Swift.Sendable {
|
|
609
|
+
case dragging(from: Swift.String)
|
|
610
|
+
case settled
|
|
611
|
+
public static func == (a: ShortKitSDK.FeedScrollPhase, b: ShortKitSDK.FeedScrollPhase) -> Swift.Bool
|
|
612
|
+
}
|
|
585
613
|
public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
586
614
|
case positive
|
|
587
615
|
case negative
|
|
@@ -607,6 +635,9 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
607
635
|
final public var feedTransition: Combine.AnyPublisher<ShortKitSDK.FeedTransitionEvent, Swift.Never> {
|
|
608
636
|
get
|
|
609
637
|
}
|
|
638
|
+
final public var feedScrollPhase: Combine.AnyPublisher<ShortKitSDK.FeedScrollPhase, Swift.Never> {
|
|
639
|
+
get
|
|
640
|
+
}
|
|
610
641
|
final public var formatChange: Combine.AnyPublisher<ShortKitSDK.FormatChangeEvent, Swift.Never> {
|
|
611
642
|
get
|
|
612
643
|
}
|
|
@@ -631,6 +662,9 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
631
662
|
final public var remainingContentCount: Combine.AnyPublisher<Swift.Int, Swift.Never> {
|
|
632
663
|
get
|
|
633
664
|
}
|
|
665
|
+
final public var feedReady: Combine.AnyPublisher<Swift.Void, Swift.Never> {
|
|
666
|
+
get
|
|
667
|
+
}
|
|
634
668
|
final public var currentItemValue: ShortKitSDK.ContentItem? {
|
|
635
669
|
get
|
|
636
670
|
}
|
|
@@ -690,13 +724,13 @@ public enum ShortKitVersion {
|
|
|
690
724
|
final public class ShortKit {
|
|
691
725
|
final public let player: ShortKitSDK.ShortKitPlayer
|
|
692
726
|
weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
|
|
693
|
-
public init(apiKey: Swift.String, config: ShortKitSDK.FeedConfig,
|
|
727
|
+
public init(apiKey: Swift.String, config: ShortKitSDK.FeedConfig, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, feedItems: [ShortKitSDK.FeedInput]? = nil)
|
|
694
728
|
final public func fetchContent(limit: Swift.Int = 10) async throws -> [ShortKitSDK.ContentItem]
|
|
695
729
|
final public func setUserId(_ id: Swift.String)
|
|
696
730
|
final public func clearUserId()
|
|
697
|
-
@_Concurrency.MainActor final public func setFeedItems(_ items: [ShortKitSDK.
|
|
698
|
-
@_Concurrency.MainActor final public func appendFeedItems(_ items: [ShortKitSDK.
|
|
699
|
-
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.
|
|
731
|
+
@_Concurrency.MainActor final public func setFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
732
|
+
@_Concurrency.MainActor final public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
733
|
+
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
700
734
|
final public func clearColdStartCache()
|
|
701
735
|
@objc deinit
|
|
702
736
|
}
|
|
Binary file
|
|
@@ -159,7 +159,6 @@ final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
|
159
159
|
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
160
160
|
final public func pause()
|
|
161
161
|
final public func resume()
|
|
162
|
-
public static func selectTargets(currentIndex: Swift.Int, feedItems: [ShortKitSDK.FeedItem], cache: any ShortKitSDK.SegmentCacheProtocol, maxCount: Swift.Int) -> [ShortKitSDK.ContentItem]
|
|
163
162
|
@objc deinit
|
|
164
163
|
}
|
|
165
164
|
public enum FeedHeight : Swift.Codable, Swift.Equatable, Swift.Sendable {
|
|
@@ -185,9 +184,10 @@ public struct FeedConfig : Swift.Codable {
|
|
|
185
184
|
public var surveyOverlay: ShortKitSDK.SurveyOverlayMode
|
|
186
185
|
public var adOverlay: ShortKitSDK.AdOverlayMode
|
|
187
186
|
public var muteOnStart: Swift.Bool
|
|
187
|
+
public var autoplay: Swift.Bool
|
|
188
188
|
public var feedSource: ShortKitSDK.FeedSource
|
|
189
189
|
public var coldStartEnabled: Swift.Bool
|
|
190
|
-
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, videoOverlay: ShortKitSDK.VideoOverlayMode = .none, carouselOverlay: ShortKitSDK.CarouselOverlayMode = .none, surveyOverlay: ShortKitSDK.SurveyOverlayMode = .none, adOverlay: ShortKitSDK.AdOverlayMode = .none, muteOnStart: Swift.Bool = true, feedSource: ShortKitSDK.FeedSource = .algorithmic, coldStartEnabled: Swift.Bool? = nil)
|
|
190
|
+
public init(feedHeight: ShortKitSDK.FeedHeight = .fullscreen, 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? = nil)
|
|
191
191
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
192
192
|
public init(from decoder: any Swift.Decoder) throws
|
|
193
193
|
}
|
|
@@ -195,6 +195,9 @@ public enum VideoOverlayMode {
|
|
|
195
195
|
case none
|
|
196
196
|
case custom(@Sendable () -> any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
197
197
|
}
|
|
198
|
+
extension ShortKitSDK.VideoOverlayMode {
|
|
199
|
+
public static func swiftUI<Content>(@SwiftUICore.ViewBuilder content: @escaping @Sendable (ShortKitSDK.ShortKitPlayer, ShortKitSDK.CellContent) -> Content) -> ShortKitSDK.VideoOverlayMode where Content : SwiftUICore.View
|
|
200
|
+
}
|
|
198
201
|
extension ShortKitSDK.VideoOverlayMode : Swift.Equatable {
|
|
199
202
|
public static func == (lhs: ShortKitSDK.VideoOverlayMode, rhs: ShortKitSDK.VideoOverlayMode) -> Swift.Bool
|
|
200
203
|
}
|
|
@@ -238,10 +241,12 @@ extension ShortKitSDK.AdOverlayMode : Swift.Codable {
|
|
|
238
241
|
public protocol ShortKitDelegate : AnyObject {
|
|
239
242
|
func shortKitDidRequestRefresh(_ shortKit: ShortKitSDK.ShortKit)
|
|
240
243
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
244
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
241
245
|
}
|
|
242
246
|
extension ShortKitSDK.ShortKitDelegate {
|
|
243
247
|
public func shortKitDidRequestRefresh(_ shortKit: ShortKitSDK.ShortKit)
|
|
244
248
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
249
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
245
250
|
}
|
|
246
251
|
@_Concurrency.MainActor @preconcurrency public struct ShortKitFeedView : SwiftUI.UIViewControllerRepresentable {
|
|
247
252
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit)
|
|
@@ -255,6 +260,7 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
255
260
|
@_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
|
|
256
261
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, startAtItemId: Swift.String? = nil)
|
|
257
262
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLoad()
|
|
263
|
+
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidLayoutSubviews()
|
|
258
264
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillAppear(_ animated: Swift.Bool)
|
|
259
265
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidAppear(_ animated: Swift.Bool)
|
|
260
266
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillDisappear(_ animated: Swift.Bool)
|
|
@@ -356,12 +362,13 @@ public struct ContentItem : Swift.Codable, Swift.Equatable, @unchecked Swift.Sen
|
|
|
356
362
|
public let author: Swift.String?
|
|
357
363
|
public let articleUrl: Swift.String?
|
|
358
364
|
public let commentCount: Swift.Int?
|
|
365
|
+
public var fallbackUrl: Swift.String?
|
|
359
366
|
public static func == (a: ShortKitSDK.ContentItem, b: ShortKitSDK.ContentItem) -> Swift.Bool
|
|
360
367
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
361
368
|
public init(from decoder: any Swift.Decoder) throws
|
|
362
369
|
}
|
|
363
|
-
public enum
|
|
364
|
-
case video(playbackId: Swift.String)
|
|
370
|
+
public enum FeedInput : Swift.Sendable {
|
|
371
|
+
case video(playbackId: Swift.String, fallbackUrl: Swift.String? = nil)
|
|
365
372
|
case imageCarousel(ShortKitSDK.ImageCarouselItem)
|
|
366
373
|
}
|
|
367
374
|
public enum FeedItem : Swift.Sendable {
|
|
@@ -503,30 +510,46 @@ public struct VTTCue : Swift.Equatable, Swift.Sendable {
|
|
|
503
510
|
public protocol AdOverlay : AnyObject {
|
|
504
511
|
func configure(with content: ShortKitSDK.NativeAdContent)
|
|
505
512
|
func resetState()
|
|
506
|
-
func fadeOutForTransition()
|
|
507
|
-
func restoreFromTransition()
|
|
508
513
|
}
|
|
509
514
|
public protocol CarouselOverlay : AnyObject {
|
|
515
|
+
var cachedImage: ((Swift.String) -> UIKit.UIImage?)? { get set }
|
|
510
516
|
func configure(with item: ShortKitSDK.ImageCarouselItem)
|
|
511
517
|
func resetState()
|
|
512
|
-
|
|
513
|
-
|
|
518
|
+
}
|
|
519
|
+
extension ShortKitSDK.CarouselOverlay {
|
|
520
|
+
public var cachedImage: ((Swift.String) -> UIKit.UIImage?)? {
|
|
521
|
+
get
|
|
522
|
+
set
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
final public class CellContent : Combine.ObservableObject {
|
|
526
|
+
@Combine.Published @_projectedValueProperty($item) final public var item: ShortKitSDK.ContentItem? {
|
|
527
|
+
get
|
|
528
|
+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
529
|
+
set
|
|
530
|
+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
531
|
+
_modify
|
|
532
|
+
}
|
|
533
|
+
final public var $item: Combine.Published<ShortKitSDK.ContentItem?>.Publisher {
|
|
534
|
+
get
|
|
535
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
|
|
536
|
+
set
|
|
537
|
+
}
|
|
538
|
+
public init()
|
|
539
|
+
public typealias ObjectWillChangePublisher = Combine.ObservableObjectPublisher
|
|
540
|
+
@objc deinit
|
|
514
541
|
}
|
|
515
542
|
public protocol FeedOverlay : AnyObject {
|
|
516
543
|
func attach(player: ShortKitSDK.ShortKitPlayer)
|
|
517
544
|
func configure(with item: ShortKitSDK.ContentItem)
|
|
518
545
|
func resetPlaybackProgress()
|
|
519
546
|
func activatePlayback()
|
|
520
|
-
func fadeOutForTransition()
|
|
521
|
-
func restoreFromTransition()
|
|
522
547
|
}
|
|
523
548
|
public protocol SurveyOverlay : AnyObject {
|
|
524
549
|
var onSurveyResponse: ((Swift.String, ShortKitSDK.SurveyOption) -> Swift.Void)? { get set }
|
|
525
550
|
var onAutoAdvance: (() -> Swift.Void)? { get set }
|
|
526
551
|
func configure(with item: ShortKitSDK.SurveyItem)
|
|
527
552
|
func resetState()
|
|
528
|
-
func fadeOutForTransition()
|
|
529
|
-
func restoreFromTransition()
|
|
530
553
|
}
|
|
531
554
|
public struct PlayerTime : Swift.Equatable, Swift.Sendable {
|
|
532
555
|
public let current: Swift.Double
|
|
@@ -582,6 +605,11 @@ public struct FormatChangeEvent : Swift.Equatable, Swift.Sendable {
|
|
|
582
605
|
public let toResolution: Swift.String
|
|
583
606
|
public static func == (a: ShortKitSDK.FormatChangeEvent, b: ShortKitSDK.FormatChangeEvent) -> Swift.Bool
|
|
584
607
|
}
|
|
608
|
+
public enum FeedScrollPhase : Swift.Equatable, Swift.Sendable {
|
|
609
|
+
case dragging(from: Swift.String)
|
|
610
|
+
case settled
|
|
611
|
+
public static func == (a: ShortKitSDK.FeedScrollPhase, b: ShortKitSDK.FeedScrollPhase) -> Swift.Bool
|
|
612
|
+
}
|
|
585
613
|
public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
586
614
|
case positive
|
|
587
615
|
case negative
|
|
@@ -607,6 +635,9 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
607
635
|
final public var feedTransition: Combine.AnyPublisher<ShortKitSDK.FeedTransitionEvent, Swift.Never> {
|
|
608
636
|
get
|
|
609
637
|
}
|
|
638
|
+
final public var feedScrollPhase: Combine.AnyPublisher<ShortKitSDK.FeedScrollPhase, Swift.Never> {
|
|
639
|
+
get
|
|
640
|
+
}
|
|
610
641
|
final public var formatChange: Combine.AnyPublisher<ShortKitSDK.FormatChangeEvent, Swift.Never> {
|
|
611
642
|
get
|
|
612
643
|
}
|
|
@@ -631,6 +662,9 @@ public enum ContentSignal : Swift.Equatable, Swift.Sendable {
|
|
|
631
662
|
final public var remainingContentCount: Combine.AnyPublisher<Swift.Int, Swift.Never> {
|
|
632
663
|
get
|
|
633
664
|
}
|
|
665
|
+
final public var feedReady: Combine.AnyPublisher<Swift.Void, Swift.Never> {
|
|
666
|
+
get
|
|
667
|
+
}
|
|
634
668
|
final public var currentItemValue: ShortKitSDK.ContentItem? {
|
|
635
669
|
get
|
|
636
670
|
}
|
|
@@ -690,13 +724,13 @@ public enum ShortKitVersion {
|
|
|
690
724
|
final public class ShortKit {
|
|
691
725
|
final public let player: ShortKitSDK.ShortKitPlayer
|
|
692
726
|
weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
|
|
693
|
-
public init(apiKey: Swift.String, config: ShortKitSDK.FeedConfig,
|
|
727
|
+
public init(apiKey: Swift.String, config: ShortKitSDK.FeedConfig, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, feedItems: [ShortKitSDK.FeedInput]? = nil)
|
|
694
728
|
final public func fetchContent(limit: Swift.Int = 10) async throws -> [ShortKitSDK.ContentItem]
|
|
695
729
|
final public func setUserId(_ id: Swift.String)
|
|
696
730
|
final public func clearUserId()
|
|
697
|
-
@_Concurrency.MainActor final public func setFeedItems(_ items: [ShortKitSDK.
|
|
698
|
-
@_Concurrency.MainActor final public func appendFeedItems(_ items: [ShortKitSDK.
|
|
699
|
-
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.
|
|
731
|
+
@_Concurrency.MainActor final public func setFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
732
|
+
@_Concurrency.MainActor final public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
|
|
733
|
+
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
700
734
|
final public func clearColdStartCache()
|
|
701
735
|
@objc deinit
|
|
702
736
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -9,9 +9,17 @@ const config_plugins_1 = require("@expo/config-plugins");
|
|
|
9
9
|
* - No special permissions are required for video streaming playback.
|
|
10
10
|
*/
|
|
11
11
|
const withShortKitIOS = (config) => {
|
|
12
|
-
|
|
12
|
+
// Set the Podfile deployment target (used by CocoaPods during pod install)
|
|
13
|
+
config = (0, config_plugins_1.withPodfileProperties)(config, (mod) => {
|
|
14
|
+
const current = parseFloat(mod.modResults['ios.deploymentTarget'] || '0');
|
|
15
|
+
if (current < 16.0) {
|
|
16
|
+
mod.modResults['ios.deploymentTarget'] = '16.0';
|
|
17
|
+
}
|
|
18
|
+
return mod;
|
|
19
|
+
});
|
|
20
|
+
// Set the Xcode project deployment target (used during xcodebuild)
|
|
21
|
+
config = (0, config_plugins_1.withXcodeProject)(config, (mod) => {
|
|
13
22
|
const project = mod.modResults;
|
|
14
|
-
// Ensure minimum deployment target is iOS 16.0
|
|
15
23
|
const buildConfigs = project.pbxXCBuildConfigurationSection();
|
|
16
24
|
for (const key of Object.keys(buildConfigs)) {
|
|
17
25
|
const buildConfig = buildConfigs[key];
|
|
@@ -25,5 +33,6 @@ const withShortKitIOS = (config) => {
|
|
|
25
33
|
}
|
|
26
34
|
return mod;
|
|
27
35
|
});
|
|
36
|
+
return config;
|
|
28
37
|
};
|
|
29
38
|
exports.withShortKitIOS = withShortKitIOS;
|
|
@@ -57,7 +57,6 @@ function NextCarouselOverlayProvider({ children }: { children: React.ReactNode }
|
|
|
57
57
|
...context,
|
|
58
58
|
currentCarouselItem: context.nextCarouselItem,
|
|
59
59
|
isCarouselActive: context.nextCarouselItem != null,
|
|
60
|
-
isCarouselTransitioning: false,
|
|
61
60
|
};
|
|
62
61
|
}, [context]);
|
|
63
62
|
|
package/src/OverlayManager.tsx
CHANGED
|
@@ -70,7 +70,7 @@ function NextOverlayProvider({ children }: { children: React.ReactNode }) {
|
|
|
70
70
|
buffered: 0,
|
|
71
71
|
},
|
|
72
72
|
playerState: 'idle' as PlayerState,
|
|
73
|
-
|
|
73
|
+
feedScrollPhase: null,
|
|
74
74
|
activeCue: null,
|
|
75
75
|
lastOverlayTap: 0,
|
|
76
76
|
lastOverlayDoubleTap: null,
|
package/src/ShortKitContext.ts
CHANGED
|
@@ -2,13 +2,15 @@ import { createContext } from 'react';
|
|
|
2
2
|
import type {
|
|
3
3
|
ContentItem,
|
|
4
4
|
ImageCarouselItem,
|
|
5
|
-
|
|
5
|
+
FeedInput,
|
|
6
6
|
PlayerTime,
|
|
7
7
|
PlayerState,
|
|
8
8
|
CaptionTrack,
|
|
9
|
+
FeedScrollPhase,
|
|
9
10
|
ContentSignal,
|
|
10
11
|
OverlayConfig,
|
|
11
12
|
CarouselOverlayConfig,
|
|
13
|
+
StoryboardData,
|
|
12
14
|
} from './types';
|
|
13
15
|
|
|
14
16
|
export interface ShortKitContextValue {
|
|
@@ -25,7 +27,7 @@ export interface ShortKitContextValue {
|
|
|
25
27
|
prefetchedAheadCount: number;
|
|
26
28
|
remainingContentCount: number;
|
|
27
29
|
isActive: boolean;
|
|
28
|
-
|
|
30
|
+
feedScrollPhase: FeedScrollPhase | null;
|
|
29
31
|
lastOverlayTap: number;
|
|
30
32
|
lastOverlayDoubleTap: { x: number; y: number; id: number } | null;
|
|
31
33
|
|
|
@@ -46,16 +48,19 @@ export interface ShortKitContextValue {
|
|
|
46
48
|
// SDK operations
|
|
47
49
|
setUserId: (id: string) => void;
|
|
48
50
|
clearUserId: () => void;
|
|
49
|
-
setFeedItems: (items:
|
|
50
|
-
appendFeedItems: (items:
|
|
51
|
+
setFeedItems: (items: FeedInput[]) => void;
|
|
52
|
+
appendFeedItems: (items: FeedInput[]) => void;
|
|
51
53
|
fetchContent: (limit?: number) => Promise<ContentItem[]>;
|
|
52
54
|
|
|
55
|
+
// Storyboard / seek thumbnails
|
|
56
|
+
prefetchStoryboard: (playbackId: string) => void;
|
|
57
|
+
getStoryboardData: (playbackId: string) => Promise<StoryboardData | null>;
|
|
58
|
+
|
|
53
59
|
// Carousel overlay state
|
|
54
60
|
currentCarouselItem: ImageCarouselItem | null;
|
|
55
61
|
nextCarouselItem: ImageCarouselItem | null;
|
|
56
62
|
isCarouselActive: boolean;
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
currentCarouselPage: number;
|
|
59
64
|
// Active cell type — used by overlay managers to show/hide
|
|
60
65
|
activeCellType: 'video' | 'carousel' | null;
|
|
61
66
|
|