@shortkitsdk/react-native 0.2.28 → 0.2.30

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.
Files changed (33) hide show
  1. package/android/libs/shortkit-release.aar +0 -0
  2. package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedView.kt +8 -1
  3. package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedViewManager.kt +6 -0
  4. package/ios/ReactVideoCarouselOverlayHost.swift +6 -0
  5. package/ios/ShortKitBridge.swift +139 -36
  6. package/ios/ShortKitFeedView.swift +51 -45
  7. package/ios/ShortKitFeedViewManager.mm +1 -0
  8. package/ios/ShortKitModule.mm +5 -1
  9. package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
  10. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
  11. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +912 -103
  12. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +21 -2
  13. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  14. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +21 -2
  15. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
  16. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
  17. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
  18. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +912 -103
  19. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +21 -2
  20. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -2
  22. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +912 -103
  23. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +21 -2
  24. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  25. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +21 -2
  26. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
  27. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
  28. package/package.json +1 -1
  29. package/src/ShortKitFeed.tsx +33 -0
  30. package/src/ShortKitProvider.tsx +4 -0
  31. package/src/specs/NativeShortKitModule.ts +8 -0
  32. package/src/specs/ShortKitFeedViewNativeComponent.ts +5 -0
  33. package/src/types.ts +10 -0
@@ -442,6 +442,15 @@ public enum ShortKitDownloadError : Swift.Error {
442
442
  public typealias Body = Swift.Never
443
443
  public typealias UIViewControllerType = ShortKitSDK.ShortKitFeedViewController
444
444
  }
445
+ public enum ShortKitFeedLifecycle {
446
+ case automatic
447
+ case manual
448
+ public static func == (a: ShortKitSDK.ShortKitFeedLifecycle, b: ShortKitSDK.ShortKitFeedLifecycle) -> Swift.Bool
449
+ public func hash(into hasher: inout Swift.Hasher)
450
+ public var hashValue: Swift.Int {
451
+ get
452
+ }
453
+ }
445
454
  @objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency public class ShortKitFeedViewController : UIKit.UIViewController {
446
455
  @_Concurrency.MainActor @preconcurrency public var debugPanelFactory: ((_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView)?
447
456
  @_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
@@ -454,8 +463,12 @@ public enum ShortKitDownloadError : Swift.Error {
454
463
  }
455
464
  @_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
456
465
  @_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
466
+ @_Concurrency.MainActor @preconcurrency public var onFeedTransition: ((ShortKitSDK.FeedTransitionEvent) -> Swift.Void)?
467
+ @_Concurrency.MainActor @preconcurrency public var isActiveSurface: Swift.Bool {
468
+ get
469
+ }
457
470
  @_Concurrency.MainActor @preconcurrency public var seedThumbnail: UIKit.UIImage?
458
- @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil)
471
+ @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil, lifecycle: ShortKitSDK.ShortKitFeedLifecycle = .automatic)
459
472
  @_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput], startAtId: Swift.String? = nil)
460
473
  @_Concurrency.MainActor public func scrollToItem(id: Swift.String, animated: Swift.Bool)
461
474
  @_Concurrency.MainActor public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
@@ -465,6 +478,7 @@ public enum ShortKitDownloadError : Swift.Error {
465
478
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillAppear(_ animated: Swift.Bool)
466
479
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidAppear(_ animated: Swift.Bool)
467
480
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillDisappear(_ animated: Swift.Bool)
481
+ @available(*, deprecated, message: "Pass lifecycle: .manual to ShortKitFeedViewController's initializer instead.")
468
482
  @_Concurrency.MainActor @preconcurrency public func setBridgeManaged()
469
483
  @_Concurrency.MainActor @preconcurrency public func activate()
470
484
  @_Concurrency.MainActor @preconcurrency public func deactivate()
@@ -940,6 +954,9 @@ public struct FeedTransitionEvent : Swift.Equatable, Swift.Sendable {
940
954
  public let from: ShortKitSDK.ContentItem?
941
955
  public let to: ShortKitSDK.ContentItem?
942
956
  public let direction: ShortKitSDK.FeedTransitionEvent.Direction
957
+ public let fromFeedItem: ShortKitSDK.FeedItem?
958
+ public let toFeedItem: ShortKitSDK.FeedItem?
959
+ public init(phase: ShortKitSDK.FeedTransitionEvent.Phase, from: ShortKitSDK.ContentItem?, to: ShortKitSDK.ContentItem?, direction: ShortKitSDK.FeedTransitionEvent.Direction, fromFeedItem: ShortKitSDK.FeedItem? = nil, toFeedItem: ShortKitSDK.FeedItem? = nil)
943
960
  public static func == (a: ShortKitSDK.FeedTransitionEvent, b: ShortKitSDK.FeedTransitionEvent) -> Swift.Bool
944
961
  }
945
962
  public struct FormatChangeEvent : Swift.Equatable, Swift.Sendable {
@@ -1084,7 +1101,7 @@ final public class ShortKit {
1084
1101
  weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
1085
1102
  weak final public var downloadDelegate: (any ShortKitSDK.ShortKitDownloadDelegate)?
1086
1103
  final public var loadingViewProvider: (() -> UIKit.UIView)?
1087
- public init(apiKey: Swift.String, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, loadingViewProvider: (() -> UIKit.UIView)? = nil, debugPanelEnabled: Swift.Bool = false)
1104
+ public init(apiKey: Swift.String, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, loadingViewProvider: (() -> UIKit.UIView)? = nil, debugPanelEnabled: Swift.Bool = false, serverTracingEnabled: Swift.Bool = false, consoleTracingEnabled: Swift.Bool = false)
1088
1105
  final public func preloadFeed(filter: ShortKitSDK.FeedFilter? = nil, limit: Swift.Int = 10) -> ShortKitSDK.FeedPreload
1089
1106
  final public func preloadFeed(items: [ShortKitSDK.FeedInput]) -> ShortKitSDK.FeedPreload
1090
1107
  final public func fetchContent(limit: Swift.Int = 10, filter: ShortKitSDK.FeedFilter? = nil) async throws -> [ShortKitSDK.ContentItem]
@@ -1191,6 +1208,8 @@ extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
1191
1208
  extension ShortKitSDK.DownloadMode : Swift.Equatable {}
1192
1209
  extension ShortKitSDK.DownloadMode : Swift.Hashable {}
1193
1210
  extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
1211
+ extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Equatable {}
1212
+ extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Hashable {}
1194
1213
  extension ShortKitSDK.CaptionSource : Swift.Equatable {}
1195
1214
  extension ShortKitSDK.CaptionSource : Swift.Hashable {}
1196
1215
  extension ShortKitSDK.CaptionSource : Swift.RawRepresentable {}
@@ -442,6 +442,15 @@ public enum ShortKitDownloadError : Swift.Error {
442
442
  public typealias Body = Swift.Never
443
443
  public typealias UIViewControllerType = ShortKitSDK.ShortKitFeedViewController
444
444
  }
445
+ public enum ShortKitFeedLifecycle {
446
+ case automatic
447
+ case manual
448
+ public static func == (a: ShortKitSDK.ShortKitFeedLifecycle, b: ShortKitSDK.ShortKitFeedLifecycle) -> Swift.Bool
449
+ public func hash(into hasher: inout Swift.Hasher)
450
+ public var hashValue: Swift.Int {
451
+ get
452
+ }
453
+ }
445
454
  @objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency public class ShortKitFeedViewController : UIKit.UIViewController {
446
455
  @_Concurrency.MainActor @preconcurrency public var debugPanelFactory: ((_ active: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ prev: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>, _ next: Combine.CurrentValueSubject<ShortKitSDK.DebugMetrics, Swift.Never>) -> UIKit.UIView)?
447
456
  @_Concurrency.MainActor @preconcurrency public var onDismiss: (() -> Swift.Void)?
@@ -454,8 +463,12 @@ public enum ShortKitDownloadError : Swift.Error {
454
463
  }
455
464
  @_Concurrency.MainActor @preconcurrency public var onVideoCarouselCellTap: ((ShortKitSDK.ShortKitFeedViewController.VideoCarouselCellTapPayload) -> Swift.Void)?
456
465
  @_Concurrency.MainActor @preconcurrency public var onRefreshStateChanged: ((ShortKitSDK.ShortKitRefreshState) -> Swift.Void)?
466
+ @_Concurrency.MainActor @preconcurrency public var onFeedTransition: ((ShortKitSDK.FeedTransitionEvent) -> Swift.Void)?
467
+ @_Concurrency.MainActor @preconcurrency public var isActiveSurface: Swift.Bool {
468
+ get
469
+ }
457
470
  @_Concurrency.MainActor @preconcurrency public var seedThumbnail: UIKit.UIImage?
458
- @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil)
471
+ @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.FeedConfig, startAtItemId: Swift.String? = nil, lifecycle: ShortKitSDK.ShortKitFeedLifecycle = .automatic)
459
472
  @_Concurrency.MainActor public func setFeedItems(_ items: [ShortKitSDK.FeedInput], startAtId: Swift.String? = nil)
460
473
  @_Concurrency.MainActor public func scrollToItem(id: Swift.String, animated: Swift.Bool)
461
474
  @_Concurrency.MainActor public func appendFeedItems(_ items: [ShortKitSDK.FeedInput])
@@ -465,6 +478,7 @@ public enum ShortKitDownloadError : Swift.Error {
465
478
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillAppear(_ animated: Swift.Bool)
466
479
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewDidAppear(_ animated: Swift.Bool)
467
480
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public func viewWillDisappear(_ animated: Swift.Bool)
481
+ @available(*, deprecated, message: "Pass lifecycle: .manual to ShortKitFeedViewController's initializer instead.")
468
482
  @_Concurrency.MainActor @preconcurrency public func setBridgeManaged()
469
483
  @_Concurrency.MainActor @preconcurrency public func activate()
470
484
  @_Concurrency.MainActor @preconcurrency public func deactivate()
@@ -940,6 +954,9 @@ public struct FeedTransitionEvent : Swift.Equatable, Swift.Sendable {
940
954
  public let from: ShortKitSDK.ContentItem?
941
955
  public let to: ShortKitSDK.ContentItem?
942
956
  public let direction: ShortKitSDK.FeedTransitionEvent.Direction
957
+ public let fromFeedItem: ShortKitSDK.FeedItem?
958
+ public let toFeedItem: ShortKitSDK.FeedItem?
959
+ public init(phase: ShortKitSDK.FeedTransitionEvent.Phase, from: ShortKitSDK.ContentItem?, to: ShortKitSDK.ContentItem?, direction: ShortKitSDK.FeedTransitionEvent.Direction, fromFeedItem: ShortKitSDK.FeedItem? = nil, toFeedItem: ShortKitSDK.FeedItem? = nil)
943
960
  public static func == (a: ShortKitSDK.FeedTransitionEvent, b: ShortKitSDK.FeedTransitionEvent) -> Swift.Bool
944
961
  }
945
962
  public struct FormatChangeEvent : Swift.Equatable, Swift.Sendable {
@@ -1084,7 +1101,7 @@ final public class ShortKit {
1084
1101
  weak final public var delegate: (any ShortKitSDK.ShortKitDelegate)?
1085
1102
  weak final public var downloadDelegate: (any ShortKitSDK.ShortKitDownloadDelegate)?
1086
1103
  final public var loadingViewProvider: (() -> UIKit.UIView)?
1087
- public init(apiKey: Swift.String, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, loadingViewProvider: (() -> UIKit.UIView)? = nil, debugPanelEnabled: Swift.Bool = false)
1104
+ public init(apiKey: Swift.String, userId: Swift.String? = nil, adProvider: (any ShortKitSDK.ShortKitAdProvider)? = nil, clientAppName: Swift.String? = nil, clientAppVersion: Swift.String? = nil, customDimensions: [Swift.String : Swift.String]? = nil, loadingViewProvider: (() -> UIKit.UIView)? = nil, debugPanelEnabled: Swift.Bool = false, serverTracingEnabled: Swift.Bool = false, consoleTracingEnabled: Swift.Bool = false)
1088
1105
  final public func preloadFeed(filter: ShortKitSDK.FeedFilter? = nil, limit: Swift.Int = 10) -> ShortKitSDK.FeedPreload
1089
1106
  final public func preloadFeed(items: [ShortKitSDK.FeedInput]) -> ShortKitSDK.FeedPreload
1090
1107
  final public func fetchContent(limit: Swift.Int = 10, filter: ShortKitSDK.FeedFilter? = nil) async throws -> [ShortKitSDK.ContentItem]
@@ -1191,6 +1208,8 @@ extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
1191
1208
  extension ShortKitSDK.DownloadMode : Swift.Equatable {}
1192
1209
  extension ShortKitSDK.DownloadMode : Swift.Hashable {}
1193
1210
  extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
1211
+ extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Equatable {}
1212
+ extension ShortKitSDK.ShortKitFeedLifecycle : Swift.Hashable {}
1194
1213
  extension ShortKitSDK.CaptionSource : Swift.Equatable {}
1195
1214
  extension ShortKitSDK.CaptionSource : Swift.Hashable {}
1196
1215
  extension ShortKitSDK.CaptionSource : Swift.RawRepresentable {}
@@ -10,39 +10,39 @@
10
10
  </data>
11
11
  <key>Info.plist</key>
12
12
  <data>
13
- ojzrG3Ap08GJYamHkQPBUeXk/l0=
13
+ TqCi7bLe/rBk0vusKYg3QCnChjw=
14
14
  </data>
15
15
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
16
16
  <data>
17
- 21myiENnbm60Ispq3tQ5ew19FSk=
17
+ T24MZRAcHfhIQj9rhCKZ74+fGDk=
18
18
  </data>
19
19
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
20
20
  <data>
21
- zPo7oMw2NLtjLxfYCxXyViI9stM=
21
+ /tzpn54Ir12p9mlqhhATlo1kMxk=
22
22
  </data>
23
23
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
24
24
  <data>
25
- 40YCNN9uv8BRz93OzhGUKoz3RAA=
25
+ jfLbEEzmKUw8NgxsDqMv/TI2UHA=
26
26
  </data>
27
27
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
28
28
  <data>
29
- zPo7oMw2NLtjLxfYCxXyViI9stM=
29
+ /tzpn54Ir12p9mlqhhATlo1kMxk=
30
30
  </data>
31
31
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
32
32
  <data>
33
- 21myiENnbm60Ispq3tQ5ew19FSk=
33
+ T24MZRAcHfhIQj9rhCKZ74+fGDk=
34
34
  </data>
35
35
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
36
36
  <data>
37
- vcLubVZzFhhcaxIe+CkCl0boQWs=
37
+ gMhrjSn1Z4igYb3yHfulqLRscLs=
38
38
  </data>
39
39
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
40
40
  <data>
41
- /2fiMms53INV4XQrQbZvM6gqOEg=
41
+ feB3WtzjYFsaMexcqDUc4JGDFrg=
42
42
  </data>
43
43
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
44
44
  <data>
45
- vcLubVZzFhhcaxIe+CkCl0boQWs=
45
+ gMhrjSn1Z4igYb3yHfulqLRscLs=
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
- Dsiu+M+BzZQooc8siWOeQ+tS8azZJ7BfE+71duXglXs=
69
+ uLq+hg2h3SAN1deJqLUnULXrfFwB26PttLnWxmx/cGo=
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
- FMAJh9SjpqLB6134JfHMNDpUINiMPb9TP4YXvhZEUug=
76
+ qlEsU4N2hUtQ04us8hP20iPW8Tx3msprPs+sZvdIxQ8=
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
- Cw1QZDVkmMiaSLxpl7OxGadGNlHAFn08jn1ClL2XN6s=
83
+ joqbkrgKjhuksU/+u2V6/QkIEKWcA9LxrnASAJZTWsg=
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
- FMAJh9SjpqLB6134JfHMNDpUINiMPb9TP4YXvhZEUug=
90
+ qlEsU4N2hUtQ04us8hP20iPW8Tx3msprPs+sZvdIxQ8=
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
- Dsiu+M+BzZQooc8siWOeQ+tS8azZJ7BfE+71duXglXs=
97
+ uLq+hg2h3SAN1deJqLUnULXrfFwB26PttLnWxmx/cGo=
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
- 2I1oGbLXn9JJAJEdBxgRR/gyfKA2c1l0bFbNOsCRUNY=
104
+ zJA0JThfoDRwFu0/9WzU1O+cmdnkZ3kcOlW0aju3B+k=
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
- E73Dx8SYkIk9zbpx6V2HLAdRZAIFitk3aKJVzM2p95g=
111
+ ct73W591fp7iumAnIzZPaew7KMArg2zicdfZ4PMWPr8=
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
- 2I1oGbLXn9JJAJEdBxgRR/gyfKA2c1l0bFbNOsCRUNY=
118
+ zJA0JThfoDRwFu0/9WzU1O+cmdnkZ3kcOlW0aju3B+k=
119
119
  </data>
120
120
  </dict>
121
121
  <key>Modules/module.modulemap</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shortkitsdk/react-native",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "ShortKit React Native SDK — short-form video feed",
5
5
  "react-native": "src/index",
6
6
  "source": "src/index",
@@ -47,6 +47,7 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
47
47
  onFeedReady,
48
48
  onCarouselActiveVideoCompleted,
49
49
  onVideoCarouselCellTap,
50
+ debugPanel,
50
51
  } = props;
51
52
 
52
53
  const isInitialized = useContext(ShortKitInitContext);
@@ -163,6 +164,11 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
163
164
  if (onLoop) {
164
165
  subscriptions.push(
165
166
  NativeShortKitModule.onDidLoop((event) => {
167
+ // Filter to this feed instance — onDidLoop is fired from the
168
+ // shared player's global Combine publisher. The native bridge
169
+ // tags the emit with the active surface's feedId; reject events
170
+ // that don't match. Accept empty feedId for forward-compat.
171
+ if (event.feedId !== feedId && event.feedId !== '') return;
166
172
  onLoop({ contentId: event.contentId, loopCount: event.loopCount });
167
173
  }),
168
174
  );
@@ -171,6 +177,16 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
171
177
  if (onFeedTransition) {
172
178
  subscriptions.push(
173
179
  NativeShortKitModule.onFeedTransition((event) => {
180
+ // Filter to this feed instance — `player.feedTransition` is a
181
+ // singleton publisher on the shared player; the native bridge now
182
+ // tags the emit with the active surface's feedId. Without this
183
+ // filter, every <ShortKitFeed> consumer receives every transition,
184
+ // which caused cross-tab state pollution (e.g., sibling tabs'
185
+ // onCurrentItemIdChange handlers firing on the active tab's
186
+ // scroll, leaking that item ID into their own startAtItemId).
187
+ // Accept empty feedId as a fallback for older native builds that
188
+ // don't tag the emit yet — same pattern as other callbacks here.
189
+ if (event.feedId !== feedId && event.feedId !== '') return;
174
190
  onFeedTransition({
175
191
  phase: event.phase as 'began' | 'ended',
176
192
  from: deserializeContentItem(event.fromItem ?? null),
@@ -184,6 +200,10 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
184
200
  if (onFormatChange) {
185
201
  subscriptions.push(
186
202
  NativeShortKitModule.onFormatChange((event) => {
203
+ // Filter to this feed instance — onFormatChange fires from the
204
+ // shared player's global publisher; bridge tags with active
205
+ // surface's feedId. Reject events addressed to other feeds.
206
+ if (event.feedId !== feedId && event.feedId !== '') return;
187
207
  onFormatChange({
188
208
  contentId: event.contentId,
189
209
  fromBitrate: event.fromBitrate,
@@ -198,6 +218,9 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
198
218
  if (onContentTapped) {
199
219
  subscriptions.push(
200
220
  NativeShortKitModule.onContentTapped((event) => {
221
+ // Filter to this feed instance — ShortKitDelegate is a singleton
222
+ // (bridge); native side tags with active surface's feedId.
223
+ if (event.feedId !== feedId && event.feedId !== '') return;
201
224
  onContentTapped(event.contentId, event.index);
202
225
  }),
203
226
  );
@@ -229,6 +252,10 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
229
252
  if (onDidFetchContentItems) {
230
253
  subscriptions.push(
231
254
  NativeShortKitModule.onDidFetchContentItems((event) => {
255
+ // Filter to this feed instance — ShortKitDelegate is a singleton
256
+ // (bridge); native side tags with active surface's feedId (at
257
+ // delegate call time, before any Task/await suspension).
258
+ if (event.feedId !== feedId && event.feedId !== '') return;
232
259
  try {
233
260
  const items = JSON.parse(event.items);
234
261
  onDidFetchContentItems(items);
@@ -242,6 +269,11 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
242
269
  if (onCarouselActiveVideoCompleted) {
243
270
  subscriptions.push(
244
271
  NativeShortKitModule.onCarouselActiveVideoCompleted((event) => {
272
+ // Filter to this feed instance — overlay events were previously
273
+ // unscoped per-feed; native side now tags with active surface's
274
+ // feedId. surfaceId continues to identify the React overlay host
275
+ // (separate concern from feedId).
276
+ if (event.feedId !== feedId && event.feedId !== '') return;
245
277
  try {
246
278
  onCarouselActiveVideoCompleted({
247
279
  surfaceId: event.surfaceId,
@@ -288,6 +320,7 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
288
320
  seedThumbnailUrl={seedThumbnailUrl}
289
321
  feedItemsJSON={feedItemsJSON}
290
322
  active={active}
323
+ debugPanel={debugPanel}
291
324
  />
292
325
  </View>
293
326
  );
@@ -135,6 +135,8 @@ export function ShortKitProvider({
135
135
  customDimensions,
136
136
  loadingViewComponent,
137
137
  debugPanel,
138
+ serverTracingEnabled,
139
+ consoleTracingEnabled,
138
140
  children,
139
141
  }: ShortKitProviderProps): React.JSX.Element {
140
142
  const [state, dispatch] = useReducer(reducer, initialState);
@@ -161,6 +163,8 @@ export function ShortKitProvider({
161
163
  clientAppVersion,
162
164
  serializedDimensions,
163
165
  debugPanel ?? false,
166
+ serverTracingEnabled ?? false,
167
+ consoleTracingEnabled ?? false,
164
168
  );
165
169
 
166
170
  return () => {
@@ -56,11 +56,13 @@ type CueEvent = Readonly<{
56
56
  }>;
57
57
 
58
58
  type LoopEvent = Readonly<{
59
+ feedId: string;
59
60
  contentId: string;
60
61
  loopCount: Int32;
61
62
  }>;
62
63
 
63
64
  type FeedTransitionEvent = Readonly<{
65
+ feedId: string;
64
66
  phase: string;
65
67
  fromItem?: string; // JSON-serialized ContentItem
66
68
  toItem?: string; // JSON-serialized ContentItem
@@ -73,6 +75,7 @@ type FeedScrollPhaseEvent = Readonly<{
73
75
  }>;
74
76
 
75
77
  type FormatChangeEvent = Readonly<{
78
+ feedId: string;
76
79
  contentId: string;
77
80
  fromBitrate: Double;
78
81
  toBitrate: Double;
@@ -103,10 +106,12 @@ type RefreshStateChangedPerFeedEvent = Readonly<{
103
106
  }>;
104
107
 
105
108
  type DidFetchContentItemsEvent = Readonly<{
109
+ feedId: string;
106
110
  items: string; // JSON-serialized ContentItem[]
107
111
  }>;
108
112
 
109
113
  type ContentTappedEvent = Readonly<{
114
+ feedId: string;
110
115
  contentId: string;
111
116
  index: Int32;
112
117
  }>;
@@ -214,6 +219,7 @@ type VideoCarouselItemChangedEvent = Readonly<{
214
219
  }>;
215
220
 
216
221
  type CarouselActiveVideoCompletedEvent = Readonly<{
222
+ feedId: string;
217
223
  surfaceId: string;
218
224
  contentItem: string; // JSON-serialized ContentItem
219
225
  indexInCarousel: Int32;
@@ -254,6 +260,8 @@ export interface Spec extends TurboModule {
254
260
  clientAppVersion?: string,
255
261
  customDimensions?: string, // JSON-serialized Record<string, string>
256
262
  debugPanel?: boolean,
263
+ serverTracingEnabled?: boolean,
264
+ consoleTracingEnabled?: boolean,
257
265
  ): void;
258
266
  setUserId(userId: string): void;
259
267
  clearUserId(): void;
@@ -17,6 +17,11 @@ export interface NativeProps extends ViewProps {
17
17
  /** JSON-serialized FeedInput[] for initial custom-feed items at mount time. */
18
18
  feedItemsJSON?: string;
19
19
  active?: boolean;
20
+ /**
21
+ * Per-surface debug panel override. When unset, the provider-level
22
+ * `debugPanel` flag governs. When set, overrides for this feed instance.
23
+ */
24
+ debugPanel?: boolean;
20
25
  }
21
26
 
22
27
  export default codegenNativeComponent<NativeProps>(
package/src/types.ts CHANGED
@@ -293,6 +293,10 @@ export interface ShortKitProviderProps {
293
293
  loadingViewComponent?: React.ComponentType<{}>;
294
294
  /** Enable the debug panel overlay (shake device to toggle). Defaults to false. */
295
295
  debugPanel?: boolean;
296
+ /** Enable production trace logging to the ShortKit backend. Defaults to false. */
297
+ serverTracingEnabled?: boolean;
298
+ /** Enable [SKTrace] console output. For development only — defaults to false. */
299
+ consoleTracingEnabled?: boolean;
296
300
  }
297
301
 
298
302
  // --- Feed Component Props ---
@@ -342,6 +346,12 @@ export interface ShortKitFeedProps {
342
346
  * @default true
343
347
  */
344
348
  active?: boolean;
349
+ /**
350
+ * Enable the debug panel overlay on this specific feed surface (shake
351
+ * device to toggle). When omitted, falls back to the provider-level
352
+ * `debugPanel` flag on `<ShortKitProvider>`.
353
+ */
354
+ debugPanel?: boolean;
345
355
  onLoop?: (event: LoopEvent) => void;
346
356
  onFeedTransition?: (event: FeedTransitionEvent) => void;
347
357
  onFormatChange?: (event: FormatChangeEvent) => void;