@shortkitsdk/react-native 0.2.27 → 0.2.29

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 (38) hide show
  1. package/android/libs/shortkit-release.aar +0 -0
  2. package/android/src/main/java/com/shortkit/reactnative/ShortKitBridge.kt +8 -0
  3. package/android/src/main/java/com/shortkit/reactnative/ShortKitModule.kt +10 -0
  4. package/android/src/main/java/com/shortkit/reactnative/ShortKitPlayerNativeView.kt +4 -0
  5. package/android/src/main/java/com/shortkit/reactnative/ShortKitWidgetNativeView.kt +45 -33
  6. package/ios/ReactVideoCarouselOverlayHost.swift +6 -0
  7. package/ios/ShortKitBridge.swift +142 -35
  8. package/ios/ShortKitFeedView.swift +43 -44
  9. package/ios/ShortKitModule.mm +11 -0
  10. package/ios/ShortKitPlayerNativeView.swift +7 -1
  11. package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
  12. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
  13. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +950 -126
  14. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +26 -3
  15. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  16. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +26 -3
  17. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
  18. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
  19. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
  20. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +950 -126
  21. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +26 -3
  22. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  23. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +26 -3
  24. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +950 -126
  25. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +26 -3
  26. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  27. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +26 -3
  28. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
  29. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
  30. package/ios/ShortKitWidgetNativeView.swift +33 -12
  31. package/package.json +1 -1
  32. package/src/ShortKitFeed.tsx +34 -0
  33. package/src/ShortKitPlayer.tsx +25 -15
  34. package/src/ShortKitWidget.tsx +24 -18
  35. package/src/index.ts +1 -0
  36. package/src/serialization.ts +38 -0
  37. package/src/specs/NativeShortKitModule.ts +7 -0
  38. package/src/types.ts +19 -1
@@ -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;
@@ -284,6 +290,7 @@ export interface Spec extends TurboModule {
284
290
  appendFeedItems(feedId: string, items: string): void;
285
291
  fetchContent(limit: Int32, filterJSON: string | null): Promise<string>;
286
292
  applyFilter(feedId: string, filterJSON: string | null): void;
293
+ refresh(feedId: string): void;
287
294
  preloadFeed(configJSON: string, itemsJSON: string | null): Promise<string>;
288
295
 
289
296
  // --- Storyboard / seek thumbnails ---
package/src/types.ts CHANGED
@@ -408,6 +408,8 @@ export interface ShortKitFeedHandle {
408
408
  appendFeedItems: (items: FeedInput[]) => void;
409
409
  /** Apply a content filter to this feed instance. Pass null to clear. */
410
410
  applyFilter: (filter: FeedFilter | null) => void;
411
+ /** Programmatically trigger a feed refresh. No-op if already refreshing. */
412
+ refresh: () => void;
411
413
  }
412
414
 
413
415
  // --- Single Player Config ---
@@ -421,6 +423,7 @@ export interface PlayerConfig {
421
423
  loop?: boolean;
422
424
  muteOnStart?: boolean;
423
425
  overlay?: OverlayConfig;
426
+ feedConfig?: FeedConfig;
424
427
  }
425
428
 
426
429
  // --- Widget Config ---
@@ -436,8 +439,17 @@ export interface WidgetConfig {
436
439
  clickAction?: PlayerClickAction;
437
440
  overlay?: OverlayConfig;
438
441
  filter?: FeedFilter;
442
+ feedConfig?: FeedConfig;
439
443
  }
440
444
 
445
+ /**
446
+ * Compact input for widget items. Mirrors the video variant of `FeedInput` —
447
+ * host apps pass a playback ID and the SDK hydrates it into a full
448
+ * `ContentItem` internally (same resolver the feed uses).
449
+ */
450
+ export type WidgetInput =
451
+ | { type: 'video'; playbackId: string; origin?: ContentOrigin; fallbackUrl?: string };
452
+
441
453
  // --- Single Player Props ---
442
454
 
443
455
  export interface ShortKitPlayerProps {
@@ -455,7 +467,13 @@ export interface ShortKitPlayerProps {
455
467
 
456
468
  export interface ShortKitWidgetProps {
457
469
  config?: WidgetConfig;
458
- items?: ContentItem[];
470
+ /**
471
+ * Optional list of widget items to render. When provided, the widget
472
+ * skips its internal server fetch and renders these videos in order.
473
+ * Compact playback-ID form — the SDK hydrates URLs internally, matching
474
+ * how `<ShortKitFeed feedItems={...} />` works.
475
+ */
476
+ items?: WidgetInput[];
459
477
  style?: ViewStyle;
460
478
  }
461
479