@shortkitsdk/react-native 0.2.31 → 0.2.33
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/android/src/main/java/com/shortkit/reactnative/ShortKitBridge.kt +26 -5
- package/android/src/main/java/com/shortkit/reactnative/ShortKitModule.kt +19 -5
- package/ios/FeedMaskHostView.swift +190 -0
- package/ios/ShortKitBridge.swift +111 -3
- package/ios/ShortKitModule.mm +5 -1
- package/ios/ShortKitPlayerNativeView.swift +31 -0
- package/ios/ShortKitPlayerNativeViewManager.mm +1 -0
- package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
- 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 +3060 -259
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +84 -7
- 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 +84 -7
- 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 +3060 -259
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +84 -7
- 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 +84 -7
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +3060 -259
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +84 -7
- 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 +84 -7
- 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 +153 -6
- package/ios/ShortKitWidgetNativeViewManager.mm +2 -0
- package/package.json +1 -1
- package/src/ShortKitCommands.ts +12 -2
- package/src/ShortKitContext.ts +7 -1
- package/src/ShortKitFeedMaskSurface.tsx +132 -0
- package/src/ShortKitPlayer.tsx +15 -2
- package/src/ShortKitWidget.tsx +16 -2
- package/src/index.ts +8 -1
- package/src/serialization.ts +15 -0
- package/src/specs/NativeShortKitModule.ts +2 -1
- package/src/specs/ShortKitPlayerViewNativeComponent.ts +7 -0
- package/src/specs/ShortKitWidgetViewNativeComponent.ts +15 -0
- package/src/types.ts +99 -0
package/src/types.ts
CHANGED
|
@@ -52,6 +52,35 @@ export type VideoCarouselOverlayConfig =
|
|
|
52
52
|
| 'none'
|
|
53
53
|
| { type: 'custom'; name: string; component: React.ComponentType<VideoCarouselOverlayProps> };
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Custom feed mask config for `<ShortKitPlayer>` / `<ShortKitWidget>`.
|
|
57
|
+
*
|
|
58
|
+
* When set to `{type: 'custom', name, component}`, the SDK presents the
|
|
59
|
+
* expanded feed embedded inside the host-supplied React component rather
|
|
60
|
+
* than full-screen. The mask renders chrome (e.g. a footer pill) AROUND
|
|
61
|
+
* the feed; the feed itself occupies the `<ShortKitFeedRegion>` placeholder
|
|
62
|
+
* the host puts somewhere in the mask's tree.
|
|
63
|
+
*
|
|
64
|
+
* iOS only. On Android the prop is currently a no-op.
|
|
65
|
+
*/
|
|
66
|
+
export type FeedMaskConfig =
|
|
67
|
+
| 'none'
|
|
68
|
+
| { type: 'custom'; name: string; component: React.ComponentType<FeedMaskProps> };
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Props passed to the host-supplied feed mask component as the user pages
|
|
72
|
+
* through the expanded feed. Mirrors a subset of `OverlayProps` —
|
|
73
|
+
* additional fields (playback state, time, etc.) can be added later.
|
|
74
|
+
*/
|
|
75
|
+
export interface FeedMaskProps {
|
|
76
|
+
/** The currently-active feed item. Re-renders the mask when paging. */
|
|
77
|
+
item: ContentItem;
|
|
78
|
+
/** Active item's index in the feed, when known. */
|
|
79
|
+
activeIndex?: number;
|
|
80
|
+
/** Total feed length, when known (paginated feeds may grow). */
|
|
81
|
+
totalCount?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
55
84
|
// --- Data Models ---
|
|
56
85
|
|
|
57
86
|
export interface ContentItem {
|
|
@@ -73,6 +102,10 @@ export interface ContentItem {
|
|
|
73
102
|
|
|
74
103
|
export type DownloadStatus = 'idle' | 'downloading' | 'completed' | 'failed';
|
|
75
104
|
|
|
105
|
+
export type DownloadOverlayMode = 'none' | 'static' | 'deterministic';
|
|
106
|
+
|
|
107
|
+
export type DownloadPhase = 'downloading' | 'compositing' | 'finalizing';
|
|
108
|
+
|
|
76
109
|
export interface DownloadState {
|
|
77
110
|
status: DownloadStatus;
|
|
78
111
|
/** ID of the content item being downloaded, if any. */
|
|
@@ -434,6 +467,12 @@ export interface PlayerConfig {
|
|
|
434
467
|
muteOnStart?: boolean;
|
|
435
468
|
overlay?: OverlayConfig;
|
|
436
469
|
feedConfig?: FeedConfig;
|
|
470
|
+
/**
|
|
471
|
+
* Optional feed mask. When `{type: 'custom', ...}`, the SDK embeds the
|
|
472
|
+
* expanded feed inside the host's React component instead of presenting
|
|
473
|
+
* full-screen. iOS only. See `FeedMaskConfig` for full semantics.
|
|
474
|
+
*/
|
|
475
|
+
feedMask?: FeedMaskConfig;
|
|
437
476
|
}
|
|
438
477
|
|
|
439
478
|
// --- Widget Config ---
|
|
@@ -450,6 +489,24 @@ export interface WidgetConfig {
|
|
|
450
489
|
overlay?: OverlayConfig;
|
|
451
490
|
filter?: FeedFilter;
|
|
452
491
|
feedConfig?: FeedConfig;
|
|
492
|
+
/**
|
|
493
|
+
* Optional feed mask, same shape as `PlayerConfig.feedMask`. iOS only.
|
|
494
|
+
*/
|
|
495
|
+
feedMask?: FeedMaskConfig;
|
|
496
|
+
/**
|
|
497
|
+
* How the widget schedules preview playback across cells.
|
|
498
|
+
* - `'singleVisibleRotating'` (default): one visible card plays at a
|
|
499
|
+
* time using an HLS Instant Clip; advances to the next visible card
|
|
500
|
+
* on natural EOS, wrapping at the end. Off-screen cards never play.
|
|
501
|
+
* - `'allVisibleSimultaneous'`: every visible card plays simultaneously,
|
|
502
|
+
* hard-capped at 3. Each card loops its own preview in place.
|
|
503
|
+
*/
|
|
504
|
+
playbackMode?: 'singleVisibleRotating' | 'allVisibleSimultaneous';
|
|
505
|
+
/**
|
|
506
|
+
* Length of the looping preview window in seconds. Used to construct the
|
|
507
|
+
* Mux Instant Clip URL for each card. Defaults to 5.
|
|
508
|
+
*/
|
|
509
|
+
previewDuration?: number;
|
|
453
510
|
}
|
|
454
511
|
|
|
455
512
|
/**
|
|
@@ -469,6 +526,22 @@ export interface ShortKitPlayerProps {
|
|
|
469
526
|
* returns to thumbnail-only mode without tearing down the view. Defaults to
|
|
470
527
|
* the value of `config.autoplay` (which itself defaults to `true`). */
|
|
471
528
|
active?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Optional list of items used to seed the expanded feed when the user
|
|
531
|
+
* taps the player and `config.clickAction === 'feed'`. The inline
|
|
532
|
+
* player's own `contentItem` is automatically prepended (deduped by
|
|
533
|
+
* playback ID), so the modal-zoom transition lands on the inline
|
|
534
|
+
* clip and the host's items follow.
|
|
535
|
+
*
|
|
536
|
+
* Combine with `config.feedConfig.feedSource`:
|
|
537
|
+
* - `'algorithmic'` (default) → expanded feed plays the seeded
|
|
538
|
+
* items, then continues paginating via `/v1/feed`.
|
|
539
|
+
* - `'custom'` → expanded feed plays only the seeded items and
|
|
540
|
+
* stops at the end (closed list).
|
|
541
|
+
*
|
|
542
|
+
* Has no effect when `clickAction !== 'feed'`.
|
|
543
|
+
*/
|
|
544
|
+
feedItems?: FeedInput[];
|
|
472
545
|
style?: ViewStyle;
|
|
473
546
|
onTap?: () => void;
|
|
474
547
|
}
|
|
@@ -495,6 +568,32 @@ export interface ShortKitWidgetProps {
|
|
|
495
568
|
* regardless (per-cell mute toggle runs alongside `onCardTap`).
|
|
496
569
|
*/
|
|
497
570
|
onCardTap?: (playbackId: string, index: number) => void;
|
|
571
|
+
/**
|
|
572
|
+
* Whether the widget is currently allowed to play. Defaults to `true`.
|
|
573
|
+
* When `false`, the widget stops its rotation timer and deactivates
|
|
574
|
+
* whichever card was active — releasing its tile back to the SDK
|
|
575
|
+
* player pool. Use this for viewport-aware playback orchestration
|
|
576
|
+
* (e.g. tab-focus gating: `active={isFocused}`). Mirrors
|
|
577
|
+
* `<ShortKitFeed>`'s same-named prop.
|
|
578
|
+
*/
|
|
579
|
+
active?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Optional list of items used to seed the expanded feed when the user
|
|
582
|
+
* taps a card and `config.clickAction === 'feed'`. The widget's own
|
|
583
|
+
* `items` (the carousel cards) are automatically prepended (deduped
|
|
584
|
+
* by playback ID), so the modal-zoom transition lands on the tapped
|
|
585
|
+
* clip and the host's items follow.
|
|
586
|
+
*
|
|
587
|
+
* Combine with `config.feedConfig.feedSource`:
|
|
588
|
+
* - `'algorithmic'` (default) → expanded feed plays the seeded
|
|
589
|
+
* items, then continues paginating via `/v1/feed`.
|
|
590
|
+
* - `'custom'` → expanded feed plays only the seeded items and
|
|
591
|
+
* stops at the end (closed list).
|
|
592
|
+
*
|
|
593
|
+
* Has no effect when `clickAction !== 'feed'`. Mirrors the
|
|
594
|
+
* `feedItems` prop on `<ShortKitPlayer>`.
|
|
595
|
+
*/
|
|
596
|
+
feedItems?: FeedInput[];
|
|
498
597
|
style?: ViewStyle;
|
|
499
598
|
}
|
|
500
599
|
|