@shortkitsdk/react-native 0.2.30 → 0.2.32
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 +77 -3
- package/ios/ShortKitFeedView.swift +1 -12
- package/ios/ShortKitModule.mm +5 -1
- 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 +5652 -972
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +111 -9
- 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 +111 -9
- 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 +5652 -972
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +111 -9
- 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 +111 -9
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +5652 -972
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +111 -9
- 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 +111 -9
- 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/ios/ShortKitWidgetNativeView.swift +23 -0
- package/ios/ShortKitWidgetNativeViewManager.mm +1 -0
- package/package.json +1 -1
- package/src/ShortKitCommands.ts +12 -2
- package/src/ShortKitContext.ts +7 -1
- package/src/ShortKitWidget.tsx +47 -2
- package/src/specs/NativeShortKitModule.ts +9 -1
- package/src/specs/ShortKitWidgetViewNativeComponent.ts +6 -0
- package/src/types.ts +15 -0
- package/ios/DebugPanelView.swift +0 -302
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
import Combine
|
|
7
7
|
import CoreGraphics
|
|
8
|
+
import CoreImage
|
|
9
|
+
import CoreMedia
|
|
10
|
+
import CoreVideo
|
|
8
11
|
import Foundation
|
|
9
12
|
import Network
|
|
10
13
|
import QuartzCore
|
|
@@ -59,6 +62,7 @@ final public class BandwidthMonitor : ShortKitSDK.BandwidthMonitorProtocol {
|
|
|
59
62
|
final public let segmentCache: any ShortKitSDK.SegmentCacheProtocol
|
|
60
63
|
final public var segmentServer: ShortKitSDK.SegmentHTTPServer?
|
|
61
64
|
public init(segmentCache: any ShortKitSDK.SegmentCacheProtocol, session: Foundation.URLSession = .shared)
|
|
65
|
+
@objc deinit
|
|
62
66
|
final public var urlMapping: [Foundation.URL : Foundation.URL] {
|
|
63
67
|
get
|
|
64
68
|
}
|
|
@@ -73,7 +77,6 @@ final public class BandwidthMonitor : ShortKitSDK.BandwidthMonitorProtocol {
|
|
|
73
77
|
final public func cachedRendition(for videoID: Swift.String) -> Swift.String?
|
|
74
78
|
@objc final public func resourceLoader(_ resourceLoader: AVFoundation.AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVFoundation.AVAssetResourceLoadingRequest) -> Swift.Bool
|
|
75
79
|
@objc final public func resourceLoader(_ resourceLoader: AVFoundation.AVAssetResourceLoader, didCancel loadingRequest: AVFoundation.AVAssetResourceLoadingRequest)
|
|
76
|
-
@objc deinit
|
|
77
80
|
}
|
|
78
81
|
public protocol ColdStartManagerProtocol : Swift.Sendable {
|
|
79
82
|
func cachedFeedItems() -> [ShortKitSDK.FeedItem]
|
|
@@ -152,15 +155,11 @@ final public class SegmentHTTPServer {
|
|
|
152
155
|
}
|
|
153
156
|
public protocol SegmentPrefetcherProtocol : AnyObject {
|
|
154
157
|
func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
155
|
-
func pause()
|
|
156
|
-
func resume()
|
|
157
158
|
}
|
|
158
|
-
final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
159
|
+
@_hasMissingDesignatedInitializers final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
159
160
|
public init(cache: any ShortKitSDK.SegmentCacheProtocol, monitor: any ShortKitSDK.BandwidthMonitorProtocol, session: Foundation.URLSession? = nil, targetRenditionHeight: Swift.Int = 720, maxCachedVideos: Swift.Int = 7)
|
|
160
|
-
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
161
|
-
final public func pause()
|
|
162
|
-
final public func resume()
|
|
163
161
|
@objc deinit
|
|
162
|
+
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
164
163
|
}
|
|
165
164
|
public struct CarouselCompletionEvent : Swift.Equatable, Swift.Sendable {
|
|
166
165
|
public let contentItem: ShortKitSDK.ContentItem
|
|
@@ -343,8 +342,46 @@ extension ShortKitSDK.LiveOverlayMode : Swift.Codable {
|
|
|
343
342
|
public init(from decoder: any Swift.Decoder) throws
|
|
344
343
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
345
344
|
}
|
|
345
|
+
public struct DebugAlert {
|
|
346
|
+
public enum Level {
|
|
347
|
+
case warning
|
|
348
|
+
public static func == (a: ShortKitSDK.DebugAlert.Level, b: ShortKitSDK.DebugAlert.Level) -> Swift.Bool
|
|
349
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
350
|
+
public var hashValue: Swift.Int {
|
|
351
|
+
get
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
public let level: ShortKitSDK.DebugAlert.Level
|
|
355
|
+
public let compactLabel: Swift.String
|
|
356
|
+
public let priority: Swift.Int
|
|
357
|
+
public init(level: ShortKitSDK.DebugAlert.Level, compactLabel: Swift.String, priority: Swift.Int)
|
|
358
|
+
}
|
|
359
|
+
public enum DebugAlerts {
|
|
360
|
+
public static func compute(_ m: ShortKitSDK.DebugMetrics) -> [ShortKitSDK.DebugAlert]
|
|
361
|
+
}
|
|
362
|
+
public enum DebugItemStatus {
|
|
363
|
+
case unknown
|
|
364
|
+
case readyToPlay
|
|
365
|
+
case failed
|
|
366
|
+
public static func == (a: ShortKitSDK.DebugItemStatus, b: ShortKitSDK.DebugItemStatus) -> Swift.Bool
|
|
367
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
368
|
+
public var hashValue: Swift.Int {
|
|
369
|
+
get
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
public enum DebugTimeControl {
|
|
373
|
+
case paused
|
|
374
|
+
case waitingToPlayAtSpecifiedRate
|
|
375
|
+
case playing
|
|
376
|
+
public static func == (a: ShortKitSDK.DebugTimeControl, b: ShortKitSDK.DebugTimeControl) -> Swift.Bool
|
|
377
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
378
|
+
public var hashValue: Swift.Int {
|
|
379
|
+
get
|
|
380
|
+
}
|
|
381
|
+
}
|
|
346
382
|
public struct DebugMetrics {
|
|
347
383
|
public var contentId: Swift.String?
|
|
384
|
+
public var playbackId: Swift.String?
|
|
348
385
|
public var feedIndex: Swift.Int
|
|
349
386
|
public var playerState: ShortKitSDK.PlayerState
|
|
350
387
|
public var intentToFrameMs: Swift.Int?
|
|
@@ -366,8 +403,35 @@ public struct DebugMetrics {
|
|
|
366
403
|
public var thumbnailVisible: Swift.Bool
|
|
367
404
|
public var thumbsCachedAhead: Swift.Int
|
|
368
405
|
public var metadataAhead: Swift.Int
|
|
406
|
+
public var itemStatus: ShortKitSDK.DebugItemStatus
|
|
407
|
+
public var playerErrorDescription: Swift.String?
|
|
408
|
+
public var failedItemUrl: Swift.String?
|
|
409
|
+
public var timeControlStatus: ShortKitSDK.DebugTimeControl
|
|
410
|
+
public var waitingReason: Swift.String?
|
|
411
|
+
public var hasCurrentItem: Swift.Bool
|
|
412
|
+
public var hasPlayerLayer: Swift.Bool?
|
|
413
|
+
public var isPlaybackBufferEmpty: Swift.Bool
|
|
414
|
+
public var isPlaybackLikelyToKeepUp: Swift.Bool
|
|
415
|
+
public var isPlaybackBufferFull: Swift.Bool
|
|
416
|
+
public var loadedTimeRangesCount: Swift.Int
|
|
417
|
+
public var loadedTimeRangesEnd: Swift.Double
|
|
418
|
+
public var poolSlotName: Swift.String?
|
|
419
|
+
public var poolReservedIndex: Swift.Int?
|
|
420
|
+
public var segmentServerPort: Swift.UInt16?
|
|
369
421
|
public init(contentId: Swift.String? = nil)
|
|
370
422
|
}
|
|
423
|
+
@objc @_inheritsConvenienceInitializers @_Concurrency.MainActor @preconcurrency final public class DebugPanelView : UIKit.UIView {
|
|
424
|
+
@_Concurrency.MainActor @preconcurrency public static let panelWidth: CoreFoundation.CGFloat
|
|
425
|
+
@_Concurrency.MainActor @preconcurrency public static let panelHeight: CoreFoundation.CGFloat
|
|
426
|
+
@_Concurrency.MainActor @preconcurrency public static let adjacentExpandedHeight: CoreFoundation.CGFloat
|
|
427
|
+
@_Concurrency.MainActor @preconcurrency public static let diagnosticsExpandedHeight: CoreFoundation.CGFloat
|
|
428
|
+
@_Concurrency.MainActor @preconcurrency public static let expandedExtraHeight: CoreFoundation.CGFloat
|
|
429
|
+
@_Concurrency.MainActor @preconcurrency @objc override dynamic public init(frame: CoreFoundation.CGRect)
|
|
430
|
+
@_Concurrency.MainActor @preconcurrency @objc required dynamic public init?(coder: Foundation.NSCoder)
|
|
431
|
+
@_Concurrency.MainActor @preconcurrency final public func subscribe(to subject: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>)
|
|
432
|
+
@_Concurrency.MainActor @preconcurrency final public func subscribeAdjacent(prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>)
|
|
433
|
+
@objc deinit
|
|
434
|
+
}
|
|
371
435
|
public enum SwipeCurve : Swift.Int, Swift.CaseIterable {
|
|
372
436
|
case quarticOut
|
|
373
437
|
case quinticOut
|
|
@@ -398,17 +462,29 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
398
462
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
399
463
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
400
464
|
}
|
|
465
|
+
public enum DownloadPhase : Swift.String, Swift.Sendable {
|
|
466
|
+
case downloading
|
|
467
|
+
case compositing
|
|
468
|
+
case finalizing
|
|
469
|
+
public init?(rawValue: Swift.String)
|
|
470
|
+
public typealias RawValue = Swift.String
|
|
471
|
+
public var rawValue: Swift.String {
|
|
472
|
+
get
|
|
473
|
+
}
|
|
474
|
+
}
|
|
401
475
|
public protocol ShortKitDownloadDelegate : AnyObject {
|
|
402
476
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
403
477
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
404
478
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
405
479
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
480
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
406
481
|
}
|
|
407
482
|
extension ShortKitSDK.ShortKitDownloadDelegate {
|
|
408
483
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
409
484
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
410
485
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
411
486
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
487
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
412
488
|
}
|
|
413
489
|
public enum DownloadMode {
|
|
414
490
|
case nonInterruptive
|
|
@@ -419,12 +495,26 @@ public enum DownloadMode {
|
|
|
419
495
|
get
|
|
420
496
|
}
|
|
421
497
|
}
|
|
422
|
-
public enum
|
|
498
|
+
public enum DownloadOverlayMode {
|
|
499
|
+
case none
|
|
500
|
+
case staticSnapshot(source: any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
501
|
+
}
|
|
502
|
+
public protocol ExportableFeedOverlay : AnyObject {
|
|
503
|
+
func prepareForExport(duration: Foundation.TimeInterval, size: CoreFoundation.CGSize) async
|
|
504
|
+
func snapshotAtTime(_ time: Foundation.TimeInterval) async -> UIKit.UIImage?
|
|
505
|
+
func tearDownAfterExport()
|
|
506
|
+
}
|
|
507
|
+
public enum ShortKitDownloadError : Swift.Error, Foundation.LocalizedError {
|
|
423
508
|
case downloadNotAvailable
|
|
424
509
|
case downloadInProgress
|
|
425
510
|
case networkError(any Swift.Error)
|
|
426
511
|
case httpError(statusCode: Swift.Int)
|
|
427
512
|
case cancelled
|
|
513
|
+
case exportFailed(underlying: any Swift.Error)
|
|
514
|
+
case overlayNotVisibleForSnapshot
|
|
515
|
+
public var errorDescription: Swift.String? {
|
|
516
|
+
get
|
|
517
|
+
}
|
|
428
518
|
}
|
|
429
519
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
430
520
|
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
@@ -492,6 +582,7 @@ public enum ShortKitFeedLifecycle {
|
|
|
492
582
|
@objc get
|
|
493
583
|
}
|
|
494
584
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func motionEnded(_ motion: UIKit.UIEvent.EventSubtype, with event: UIKit.UIEvent?)
|
|
585
|
+
@_Concurrency.MainActor @preconcurrency public func overlayView(forItemId itemId: Swift.String) -> (any UIKit.UIView & ShortKitSDK.FeedOverlay)?
|
|
495
586
|
}
|
|
496
587
|
extension ShortKitSDK.ShortKitFeedViewController : UIKit.UICollectionViewDelegate {
|
|
497
588
|
@_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, willDisplay cell: UIKit.UICollectionViewCell, forItemAt indexPath: Foundation.IndexPath)
|
|
@@ -1098,6 +1189,7 @@ final public class ShortKit {
|
|
|
1098
1189
|
final public let player: ShortKitSDK.ShortKitPlayer
|
|
1099
1190
|
final public let carousel: ShortKitSDK.ShortKitCarousel
|
|
1100
1191
|
final public let debugPanelEnabled: Swift.Bool
|
|
1192
|
+
public static let defaultDebugPanelFactory: (_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView
|
|
1101
1193
|
weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
|
|
1102
1194
|
weak final public var downloadDelegate: (any ShortKitSDK.ShortKitDownloadDelegate)?
|
|
1103
1195
|
final public var loadingViewProvider: (() -> UIKit.UIView)?
|
|
@@ -1109,7 +1201,7 @@ final public class ShortKit {
|
|
|
1109
1201
|
final public func clearUserId()
|
|
1110
1202
|
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
1111
1203
|
final public func clearColdStartCache()
|
|
1112
|
-
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive) async throws -> Foundation.URL
|
|
1204
|
+
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive, overlayMode: ShortKitSDK.DownloadOverlayMode = .none) async throws -> Foundation.URL
|
|
1113
1205
|
final public func cancelDownload()
|
|
1114
1206
|
@objc deinit
|
|
1115
1207
|
}
|
|
@@ -1159,6 +1251,7 @@ extension ShortKitSDK.ShortKitPlayerViewController : UIKit.UIViewControllerTrans
|
|
|
1159
1251
|
}
|
|
1160
1252
|
@objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency final public class ShortKitWidgetViewController : UIKit.UIViewController {
|
|
1161
1253
|
@_Concurrency.MainActor @preconcurrency final public var feedMask: ShortKitSDK.FeedMaskMode
|
|
1254
|
+
@_Concurrency.MainActor @preconcurrency final public var onCardTap: ((Swift.String, Swift.Int) -> Swift.Void)?
|
|
1162
1255
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig, items: [ShortKitSDK.WidgetInput] = [])
|
|
1163
1256
|
@_Concurrency.MainActor @preconcurrency final public func configure(with inputs: [ShortKitSDK.WidgetInput])
|
|
1164
1257
|
@_Concurrency.MainActor @preconcurrency @objc override final public func viewDidLoad()
|
|
@@ -1202,9 +1295,18 @@ extension ShortKitSDK.ScrollAxis : Swift.Hashable {}
|
|
|
1202
1295
|
extension ShortKitSDK.ScrollAxis : Swift.RawRepresentable {}
|
|
1203
1296
|
extension ShortKitSDK.FeedSource : Swift.Hashable {}
|
|
1204
1297
|
extension ShortKitSDK.FeedSource : Swift.RawRepresentable {}
|
|
1298
|
+
extension ShortKitSDK.DebugAlert.Level : Swift.Equatable {}
|
|
1299
|
+
extension ShortKitSDK.DebugAlert.Level : Swift.Hashable {}
|
|
1300
|
+
extension ShortKitSDK.DebugItemStatus : Swift.Equatable {}
|
|
1301
|
+
extension ShortKitSDK.DebugItemStatus : Swift.Hashable {}
|
|
1302
|
+
extension ShortKitSDK.DebugTimeControl : Swift.Equatable {}
|
|
1303
|
+
extension ShortKitSDK.DebugTimeControl : Swift.Hashable {}
|
|
1205
1304
|
extension ShortKitSDK.SwipeCurve : Swift.Equatable {}
|
|
1206
1305
|
extension ShortKitSDK.SwipeCurve : Swift.Hashable {}
|
|
1207
1306
|
extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
|
|
1307
|
+
extension ShortKitSDK.DownloadPhase : Swift.Equatable {}
|
|
1308
|
+
extension ShortKitSDK.DownloadPhase : Swift.Hashable {}
|
|
1309
|
+
extension ShortKitSDK.DownloadPhase : Swift.RawRepresentable {}
|
|
1208
1310
|
extension ShortKitSDK.DownloadMode : Swift.Equatable {}
|
|
1209
1311
|
extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
1210
1312
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
|
Binary file
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
import Combine
|
|
7
7
|
import CoreGraphics
|
|
8
|
+
import CoreImage
|
|
9
|
+
import CoreMedia
|
|
10
|
+
import CoreVideo
|
|
8
11
|
import Foundation
|
|
9
12
|
import Network
|
|
10
13
|
import QuartzCore
|
|
@@ -59,6 +62,7 @@ final public class BandwidthMonitor : ShortKitSDK.BandwidthMonitorProtocol {
|
|
|
59
62
|
final public let segmentCache: any ShortKitSDK.SegmentCacheProtocol
|
|
60
63
|
final public var segmentServer: ShortKitSDK.SegmentHTTPServer?
|
|
61
64
|
public init(segmentCache: any ShortKitSDK.SegmentCacheProtocol, session: Foundation.URLSession = .shared)
|
|
65
|
+
@objc deinit
|
|
62
66
|
final public var urlMapping: [Foundation.URL : Foundation.URL] {
|
|
63
67
|
get
|
|
64
68
|
}
|
|
@@ -73,7 +77,6 @@ final public class BandwidthMonitor : ShortKitSDK.BandwidthMonitorProtocol {
|
|
|
73
77
|
final public func cachedRendition(for videoID: Swift.String) -> Swift.String?
|
|
74
78
|
@objc final public func resourceLoader(_ resourceLoader: AVFoundation.AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVFoundation.AVAssetResourceLoadingRequest) -> Swift.Bool
|
|
75
79
|
@objc final public func resourceLoader(_ resourceLoader: AVFoundation.AVAssetResourceLoader, didCancel loadingRequest: AVFoundation.AVAssetResourceLoadingRequest)
|
|
76
|
-
@objc deinit
|
|
77
80
|
}
|
|
78
81
|
public protocol ColdStartManagerProtocol : Swift.Sendable {
|
|
79
82
|
func cachedFeedItems() -> [ShortKitSDK.FeedItem]
|
|
@@ -152,15 +155,11 @@ final public class SegmentHTTPServer {
|
|
|
152
155
|
}
|
|
153
156
|
public protocol SegmentPrefetcherProtocol : AnyObject {
|
|
154
157
|
func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
155
|
-
func pause()
|
|
156
|
-
func resume()
|
|
157
158
|
}
|
|
158
|
-
final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
159
|
+
@_hasMissingDesignatedInitializers final public class SegmentPrefetcher : ShortKitSDK.SegmentPrefetcherProtocol {
|
|
159
160
|
public init(cache: any ShortKitSDK.SegmentCacheProtocol, monitor: any ShortKitSDK.BandwidthMonitorProtocol, session: Foundation.URLSession? = nil, targetRenditionHeight: Swift.Int = 720, maxCachedVideos: Swift.Int = 7)
|
|
160
|
-
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
161
|
-
final public func pause()
|
|
162
|
-
final public func resume()
|
|
163
161
|
@objc deinit
|
|
162
|
+
final public func updateCurrentIndex(_ index: Swift.Int, feedItems: [ShortKitSDK.FeedItem])
|
|
164
163
|
}
|
|
165
164
|
public struct CarouselCompletionEvent : Swift.Equatable, Swift.Sendable {
|
|
166
165
|
public let contentItem: ShortKitSDK.ContentItem
|
|
@@ -343,8 +342,46 @@ extension ShortKitSDK.LiveOverlayMode : Swift.Codable {
|
|
|
343
342
|
public init(from decoder: any Swift.Decoder) throws
|
|
344
343
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
345
344
|
}
|
|
345
|
+
public struct DebugAlert {
|
|
346
|
+
public enum Level {
|
|
347
|
+
case warning
|
|
348
|
+
public static func == (a: ShortKitSDK.DebugAlert.Level, b: ShortKitSDK.DebugAlert.Level) -> Swift.Bool
|
|
349
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
350
|
+
public var hashValue: Swift.Int {
|
|
351
|
+
get
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
public let level: ShortKitSDK.DebugAlert.Level
|
|
355
|
+
public let compactLabel: Swift.String
|
|
356
|
+
public let priority: Swift.Int
|
|
357
|
+
public init(level: ShortKitSDK.DebugAlert.Level, compactLabel: Swift.String, priority: Swift.Int)
|
|
358
|
+
}
|
|
359
|
+
public enum DebugAlerts {
|
|
360
|
+
public static func compute(_ m: ShortKitSDK.DebugMetrics) -> [ShortKitSDK.DebugAlert]
|
|
361
|
+
}
|
|
362
|
+
public enum DebugItemStatus {
|
|
363
|
+
case unknown
|
|
364
|
+
case readyToPlay
|
|
365
|
+
case failed
|
|
366
|
+
public static func == (a: ShortKitSDK.DebugItemStatus, b: ShortKitSDK.DebugItemStatus) -> Swift.Bool
|
|
367
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
368
|
+
public var hashValue: Swift.Int {
|
|
369
|
+
get
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
public enum DebugTimeControl {
|
|
373
|
+
case paused
|
|
374
|
+
case waitingToPlayAtSpecifiedRate
|
|
375
|
+
case playing
|
|
376
|
+
public static func == (a: ShortKitSDK.DebugTimeControl, b: ShortKitSDK.DebugTimeControl) -> Swift.Bool
|
|
377
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
378
|
+
public var hashValue: Swift.Int {
|
|
379
|
+
get
|
|
380
|
+
}
|
|
381
|
+
}
|
|
346
382
|
public struct DebugMetrics {
|
|
347
383
|
public var contentId: Swift.String?
|
|
384
|
+
public var playbackId: Swift.String?
|
|
348
385
|
public var feedIndex: Swift.Int
|
|
349
386
|
public var playerState: ShortKitSDK.PlayerState
|
|
350
387
|
public var intentToFrameMs: Swift.Int?
|
|
@@ -366,8 +403,35 @@ public struct DebugMetrics {
|
|
|
366
403
|
public var thumbnailVisible: Swift.Bool
|
|
367
404
|
public var thumbsCachedAhead: Swift.Int
|
|
368
405
|
public var metadataAhead: Swift.Int
|
|
406
|
+
public var itemStatus: ShortKitSDK.DebugItemStatus
|
|
407
|
+
public var playerErrorDescription: Swift.String?
|
|
408
|
+
public var failedItemUrl: Swift.String?
|
|
409
|
+
public var timeControlStatus: ShortKitSDK.DebugTimeControl
|
|
410
|
+
public var waitingReason: Swift.String?
|
|
411
|
+
public var hasCurrentItem: Swift.Bool
|
|
412
|
+
public var hasPlayerLayer: Swift.Bool?
|
|
413
|
+
public var isPlaybackBufferEmpty: Swift.Bool
|
|
414
|
+
public var isPlaybackLikelyToKeepUp: Swift.Bool
|
|
415
|
+
public var isPlaybackBufferFull: Swift.Bool
|
|
416
|
+
public var loadedTimeRangesCount: Swift.Int
|
|
417
|
+
public var loadedTimeRangesEnd: Swift.Double
|
|
418
|
+
public var poolSlotName: Swift.String?
|
|
419
|
+
public var poolReservedIndex: Swift.Int?
|
|
420
|
+
public var segmentServerPort: Swift.UInt16?
|
|
369
421
|
public init(contentId: Swift.String? = nil)
|
|
370
422
|
}
|
|
423
|
+
@objc @_inheritsConvenienceInitializers @_Concurrency.MainActor @preconcurrency final public class DebugPanelView : UIKit.UIView {
|
|
424
|
+
@_Concurrency.MainActor @preconcurrency public static let panelWidth: CoreFoundation.CGFloat
|
|
425
|
+
@_Concurrency.MainActor @preconcurrency public static let panelHeight: CoreFoundation.CGFloat
|
|
426
|
+
@_Concurrency.MainActor @preconcurrency public static let adjacentExpandedHeight: CoreFoundation.CGFloat
|
|
427
|
+
@_Concurrency.MainActor @preconcurrency public static let diagnosticsExpandedHeight: CoreFoundation.CGFloat
|
|
428
|
+
@_Concurrency.MainActor @preconcurrency public static let expandedExtraHeight: CoreFoundation.CGFloat
|
|
429
|
+
@_Concurrency.MainActor @preconcurrency @objc override dynamic public init(frame: CoreFoundation.CGRect)
|
|
430
|
+
@_Concurrency.MainActor @preconcurrency @objc required dynamic public init?(coder: Foundation.NSCoder)
|
|
431
|
+
@_Concurrency.MainActor @preconcurrency final public func subscribe(to subject: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>)
|
|
432
|
+
@_Concurrency.MainActor @preconcurrency final public func subscribeAdjacent(prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>)
|
|
433
|
+
@objc deinit
|
|
434
|
+
}
|
|
371
435
|
public enum SwipeCurve : Swift.Int, Swift.CaseIterable {
|
|
372
436
|
case quarticOut
|
|
373
437
|
case quinticOut
|
|
@@ -398,17 +462,29 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
398
462
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
399
463
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
400
464
|
}
|
|
465
|
+
public enum DownloadPhase : Swift.String, Swift.Sendable {
|
|
466
|
+
case downloading
|
|
467
|
+
case compositing
|
|
468
|
+
case finalizing
|
|
469
|
+
public init?(rawValue: Swift.String)
|
|
470
|
+
public typealias RawValue = Swift.String
|
|
471
|
+
public var rawValue: Swift.String {
|
|
472
|
+
get
|
|
473
|
+
}
|
|
474
|
+
}
|
|
401
475
|
public protocol ShortKitDownloadDelegate : AnyObject {
|
|
402
476
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
403
477
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
404
478
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
405
479
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
480
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
406
481
|
}
|
|
407
482
|
extension ShortKitSDK.ShortKitDownloadDelegate {
|
|
408
483
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
409
484
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
410
485
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
411
486
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
487
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
412
488
|
}
|
|
413
489
|
public enum DownloadMode {
|
|
414
490
|
case nonInterruptive
|
|
@@ -419,12 +495,26 @@ public enum DownloadMode {
|
|
|
419
495
|
get
|
|
420
496
|
}
|
|
421
497
|
}
|
|
422
|
-
public enum
|
|
498
|
+
public enum DownloadOverlayMode {
|
|
499
|
+
case none
|
|
500
|
+
case staticSnapshot(source: any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
501
|
+
}
|
|
502
|
+
public protocol ExportableFeedOverlay : AnyObject {
|
|
503
|
+
func prepareForExport(duration: Foundation.TimeInterval, size: CoreFoundation.CGSize) async
|
|
504
|
+
func snapshotAtTime(_ time: Foundation.TimeInterval) async -> UIKit.UIImage?
|
|
505
|
+
func tearDownAfterExport()
|
|
506
|
+
}
|
|
507
|
+
public enum ShortKitDownloadError : Swift.Error, Foundation.LocalizedError {
|
|
423
508
|
case downloadNotAvailable
|
|
424
509
|
case downloadInProgress
|
|
425
510
|
case networkError(any Swift.Error)
|
|
426
511
|
case httpError(statusCode: Swift.Int)
|
|
427
512
|
case cancelled
|
|
513
|
+
case exportFailed(underlying: any Swift.Error)
|
|
514
|
+
case overlayNotVisibleForSnapshot
|
|
515
|
+
public var errorDescription: Swift.String? {
|
|
516
|
+
get
|
|
517
|
+
}
|
|
428
518
|
}
|
|
429
519
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
430
520
|
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
@@ -492,6 +582,7 @@ public enum ShortKitFeedLifecycle {
|
|
|
492
582
|
@objc get
|
|
493
583
|
}
|
|
494
584
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func motionEnded(_ motion: UIKit.UIEvent.EventSubtype, with event: UIKit.UIEvent?)
|
|
585
|
+
@_Concurrency.MainActor @preconcurrency public func overlayView(forItemId itemId: Swift.String) -> (any UIKit.UIView & ShortKitSDK.FeedOverlay)?
|
|
495
586
|
}
|
|
496
587
|
extension ShortKitSDK.ShortKitFeedViewController : UIKit.UICollectionViewDelegate {
|
|
497
588
|
@_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, willDisplay cell: UIKit.UICollectionViewCell, forItemAt indexPath: Foundation.IndexPath)
|
|
@@ -1098,6 +1189,7 @@ final public class ShortKit {
|
|
|
1098
1189
|
final public let player: ShortKitSDK.ShortKitPlayer
|
|
1099
1190
|
final public let carousel: ShortKitSDK.ShortKitCarousel
|
|
1100
1191
|
final public let debugPanelEnabled: Swift.Bool
|
|
1192
|
+
public static let defaultDebugPanelFactory: (_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView
|
|
1101
1193
|
weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
|
|
1102
1194
|
weak final public var downloadDelegate: (any ShortKitSDK.ShortKitDownloadDelegate)?
|
|
1103
1195
|
final public var loadingViewProvider: (() -> UIKit.UIView)?
|
|
@@ -1109,7 +1201,7 @@ final public class ShortKit {
|
|
|
1109
1201
|
final public func clearUserId()
|
|
1110
1202
|
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
1111
1203
|
final public func clearColdStartCache()
|
|
1112
|
-
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive) async throws -> Foundation.URL
|
|
1204
|
+
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive, overlayMode: ShortKitSDK.DownloadOverlayMode = .none) async throws -> Foundation.URL
|
|
1113
1205
|
final public func cancelDownload()
|
|
1114
1206
|
@objc deinit
|
|
1115
1207
|
}
|
|
@@ -1159,6 +1251,7 @@ extension ShortKitSDK.ShortKitPlayerViewController : UIKit.UIViewControllerTrans
|
|
|
1159
1251
|
}
|
|
1160
1252
|
@objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency final public class ShortKitWidgetViewController : UIKit.UIViewController {
|
|
1161
1253
|
@_Concurrency.MainActor @preconcurrency final public var feedMask: ShortKitSDK.FeedMaskMode
|
|
1254
|
+
@_Concurrency.MainActor @preconcurrency final public var onCardTap: ((Swift.String, Swift.Int) -> Swift.Void)?
|
|
1162
1255
|
@_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig, items: [ShortKitSDK.WidgetInput] = [])
|
|
1163
1256
|
@_Concurrency.MainActor @preconcurrency final public func configure(with inputs: [ShortKitSDK.WidgetInput])
|
|
1164
1257
|
@_Concurrency.MainActor @preconcurrency @objc override final public func viewDidLoad()
|
|
@@ -1202,9 +1295,18 @@ extension ShortKitSDK.ScrollAxis : Swift.Hashable {}
|
|
|
1202
1295
|
extension ShortKitSDK.ScrollAxis : Swift.RawRepresentable {}
|
|
1203
1296
|
extension ShortKitSDK.FeedSource : Swift.Hashable {}
|
|
1204
1297
|
extension ShortKitSDK.FeedSource : Swift.RawRepresentable {}
|
|
1298
|
+
extension ShortKitSDK.DebugAlert.Level : Swift.Equatable {}
|
|
1299
|
+
extension ShortKitSDK.DebugAlert.Level : Swift.Hashable {}
|
|
1300
|
+
extension ShortKitSDK.DebugItemStatus : Swift.Equatable {}
|
|
1301
|
+
extension ShortKitSDK.DebugItemStatus : Swift.Hashable {}
|
|
1302
|
+
extension ShortKitSDK.DebugTimeControl : Swift.Equatable {}
|
|
1303
|
+
extension ShortKitSDK.DebugTimeControl : Swift.Hashable {}
|
|
1205
1304
|
extension ShortKitSDK.SwipeCurve : Swift.Equatable {}
|
|
1206
1305
|
extension ShortKitSDK.SwipeCurve : Swift.Hashable {}
|
|
1207
1306
|
extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
|
|
1307
|
+
extension ShortKitSDK.DownloadPhase : Swift.Equatable {}
|
|
1308
|
+
extension ShortKitSDK.DownloadPhase : Swift.Hashable {}
|
|
1309
|
+
extension ShortKitSDK.DownloadPhase : Swift.RawRepresentable {}
|
|
1208
1310
|
extension ShortKitSDK.DownloadMode : Swift.Equatable {}
|
|
1209
1311
|
extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
1210
1312
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
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
|
+
c83UUfp8vl8OKNZgemM5Ckeupdw=
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
17
|
+
YIhDAI7GfkS3Bw8cCovcAQ/5bkc=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
jVb2+supqwkO14hFF9JSxbmcFUI=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
FQPcCHhpOilSUl89AxPXIKCLN/E=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
jVb2+supqwkO14hFF9JSxbmcFUI=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
YIhDAI7GfkS3Bw8cCovcAQ/5bkc=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
lr+Br5j/UDEGV7GBxg48gH/rncc=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
rTbauAd6wfGmUohCAGP+wwgmsNc=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
lr+Br5j/UDEGV7GBxg48gH/rncc=
|
|
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
|
+
v/uw62M6gyB+9mO/YoZTKs+xDZr5p0ehAwX9vFBOrA0=
|
|
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
|
+
rxdNx/TSUVd/Pd8Fok5Kgwj/fUtUaq0HgqKC4JVJUx0=
|
|
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
|
+
khqs3UMVZ5tpEkBvJa5S2d3uTs80aVX+io6b4/TDNPE=
|
|
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
|
+
rxdNx/TSUVd/Pd8Fok5Kgwj/fUtUaq0HgqKC4JVJUx0=
|
|
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
|
+
v/uw62M6gyB+9mO/YoZTKs+xDZr5p0ehAwX9vFBOrA0=
|
|
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
|
+
o9sGqAin0CW2u4q6wc85avBuxWQyEOnzzDME35fQ3ZY=
|
|
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
|
+
HACqT0qILr02nDrz4hMSwIx1+67UnBeq1ote6RrUXWs=
|
|
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
|
+
o9sGqAin0CW2u4q6wc85avBuxWQyEOnzzDME35fQ3ZY=
|
|
119
119
|
</data>
|
|
120
120
|
</dict>
|
|
121
121
|
<key>Modules/module.modulemap</key>
|
|
@@ -25,6 +25,12 @@ import ShortKitSDK
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/// Stable per-instance widget identifier set by the JS wrapper. Echoed
|
|
29
|
+
/// back on `onWidgetCardTap` events so the JS wrapper can route the
|
|
30
|
+
/// global emit to the correct `<ShortKitWidget>` instance when more than
|
|
31
|
+
/// one is mounted simultaneously.
|
|
32
|
+
@objc public var widgetId: String?
|
|
33
|
+
|
|
28
34
|
// MARK: - Child VC
|
|
29
35
|
|
|
30
36
|
private var widgetVC: ShortKitWidgetViewController?
|
|
@@ -66,6 +72,23 @@ import ShortKitSDK
|
|
|
66
72
|
let vc = ShortKitWidgetViewController(shortKit: sdk, config: widgetConfig, items: parsedItems)
|
|
67
73
|
self.widgetVC = vc
|
|
68
74
|
|
|
75
|
+
// Wire host-handleable card-tap callback. When the JS wrapper has
|
|
76
|
+
// an `onCardTap` prop set, it'll have given us a widgetId; we forward
|
|
77
|
+
// each tap through the bridge with that widgetId so the JS wrapper
|
|
78
|
+
// can filter to its own instance. The SDK's widget VC, when it sees
|
|
79
|
+
// a non-nil onCardTap, automatically skips the built-in
|
|
80
|
+
// `clickAction: .feed` modal-presentation path (see
|
|
81
|
+
// ShortKitWidgetViewController docs) — host code is fully in charge.
|
|
82
|
+
if let id = widgetId {
|
|
83
|
+
vc.onCardTap = { playbackId, index in
|
|
84
|
+
ShortKitBridge.shared?.emitOnMain("onWidgetCardTap", body: [
|
|
85
|
+
"widgetId": id,
|
|
86
|
+
"playbackId": playbackId,
|
|
87
|
+
"index": index,
|
|
88
|
+
])
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
69
92
|
parentVC.addChild(vc)
|
|
70
93
|
vc.view.frame = bounds
|
|
71
94
|
vc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
package/package.json
CHANGED
package/src/ShortKitCommands.ts
CHANGED
|
@@ -32,7 +32,17 @@ export const ShortKitCommands = {
|
|
|
32
32
|
NativeShortKitModule?.prefetchStoryboard(playbackId),
|
|
33
33
|
getStoryboardData: (playbackId: string): Promise<string | null> =>
|
|
34
34
|
NativeShortKitModule?.getStoryboardData(playbackId) ?? Promise.resolve(null),
|
|
35
|
-
downloadVideo: (
|
|
36
|
-
|
|
35
|
+
downloadVideo: (
|
|
36
|
+
itemId: string,
|
|
37
|
+
options?: {
|
|
38
|
+
mode?: 'interruptive' | 'nonInterruptive';
|
|
39
|
+
overlayMode?: 'none' | 'static' | 'deterministic';
|
|
40
|
+
}
|
|
41
|
+
): Promise<string> => {
|
|
42
|
+
const mode = options?.mode ?? 'nonInterruptive';
|
|
43
|
+
const overlayMode = options?.overlayMode ?? 'none';
|
|
44
|
+
return NativeShortKitModule?.downloadVideo(itemId, mode, overlayMode)
|
|
45
|
+
?? Promise.reject(new Error('ShortKit not initialized'));
|
|
46
|
+
},
|
|
37
47
|
cancelDownload: () => NativeShortKitModule?.cancelDownload(),
|
|
38
48
|
} as const;
|