@xhub-reels/sdk 0.1.15 → 0.1.18
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/README.md +11 -11
- package/dist/index.cjs +347 -346
- package/dist/index.d.cts +89 -38
- package/dist/index.d.ts +89 -38
- package/dist/index.js +347 -346
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# xhub-reels-sdk
|
|
2
2
|
|
|
3
3
|
High-performance Short Video / Reels SDK for React — optimized for Flutter WebView.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/xhub-reels-sdk)
|
|
6
|
+
[](https://bundlephobia.com/package/xhub-reels-sdk)
|
|
7
|
+
[](LICENSE)
|
|
8
8
|
|
|
9
9
|
## Why?
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ Built as a leaner, faster alternative focused on solving real-world WebView perf
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install
|
|
25
|
+
npm install xhub-reels-sdk
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
**Peer dependencies:**
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
ReelsProvider,
|
|
38
38
|
MockDataSource,
|
|
39
39
|
MockInteraction,
|
|
40
|
-
} from '
|
|
40
|
+
} from 'xhub-reels-sdk';
|
|
41
41
|
import { MyFeed } from './MyFeed';
|
|
42
42
|
|
|
43
43
|
export function App() {
|
|
@@ -57,7 +57,7 @@ export function App() {
|
|
|
57
57
|
## With Your Own Data Source
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
|
-
import type { IDataSource, FeedPage } from '
|
|
60
|
+
import type { IDataSource, FeedPage } from 'xhub-reels-sdk';
|
|
61
61
|
|
|
62
62
|
class MyAPIDataSource implements IDataSource {
|
|
63
63
|
async fetchFeed(cursor?: string | null): Promise<FeedPage> {
|
|
@@ -75,7 +75,7 @@ class MyAPIDataSource implements IDataSource {
|
|
|
75
75
|
## Hooks
|
|
76
76
|
|
|
77
77
|
```tsx
|
|
78
|
-
import { useFeed, usePlayer, useResource } from '
|
|
78
|
+
import { useFeed, usePlayer, useResource } from 'xhub-reels-sdk';
|
|
79
79
|
|
|
80
80
|
function MyFeed() {
|
|
81
81
|
const { items, loading, loadInitial, loadMore } = useFeed();
|
|
@@ -89,7 +89,7 @@ function MyFeed() {
|
|
|
89
89
|
## Gesture Engine
|
|
90
90
|
|
|
91
91
|
```tsx
|
|
92
|
-
import { usePointerGesture, useSnapAnimation } from '
|
|
92
|
+
import { usePointerGesture, useSnapAnimation } from 'xhub-reels-sdk';
|
|
93
93
|
|
|
94
94
|
function SwipeableFeed() {
|
|
95
95
|
const { animateSnap, animateBounceBack } = useSnapAnimation();
|
|
@@ -114,7 +114,7 @@ function SwipeableFeed() {
|
|
|
114
114
|
## Architecture
|
|
115
115
|
|
|
116
116
|
```
|
|
117
|
-
|
|
117
|
+
xhub-reels-sdk
|
|
118
118
|
├── types/ ← Pure TypeScript interfaces (no deps)
|
|
119
119
|
├── domain/ ← Business logic (zustand/vanilla, no React)
|
|
120
120
|
│ ├── PlayerEngine — State machine + Circuit Breaker
|
|
@@ -147,7 +147,7 @@ function SwipeableFeed() {
|
|
|
147
147
|
|
|
148
148
|
| Package | Limit |
|
|
149
149
|
|---|---|
|
|
150
|
-
|
|
|
150
|
+
| `xhub-reels-sdk` | 35KB gzip |
|
|
151
151
|
|
|
152
152
|
## Development
|
|
153
153
|
|