@xhub-short/sdk 0.1.0-beta.5 → 0.1.0-beta.7
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/dist/index.d.ts +10 -0
- package/dist/index.js +9 -15
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1373,6 +1373,16 @@ interface SDKConfig {
|
|
|
1373
1373
|
* endpoints: {
|
|
1374
1374
|
* feed: { list: '/videos', detail: '/videos/:id' },
|
|
1375
1375
|
* interaction: { like: '/videos/:id/like', ... },
|
|
1376
|
+
* // View tracking (per-video) - optional
|
|
1377
|
+
* viewTracking: {
|
|
1378
|
+
* notify: '/reels/:id/notify-views',
|
|
1379
|
+
* },
|
|
1380
|
+
* },
|
|
1381
|
+
* // View tracking behavior config (optional)
|
|
1382
|
+
* viewTracking: {
|
|
1383
|
+
* viewEventValue: 'seek',
|
|
1384
|
+
* heartbeatInterval: 10000,
|
|
1385
|
+
* minWatchTime: 3,
|
|
1376
1386
|
* },
|
|
1377
1387
|
* },
|
|
1378
1388
|
* }}>
|
package/dist/index.js
CHANGED
|
@@ -1234,19 +1234,6 @@ function TranslatedCommentInput(props) {
|
|
|
1234
1234
|
},
|
|
1235
1235
|
role: "button",
|
|
1236
1236
|
tabIndex: 0,
|
|
1237
|
-
style: {
|
|
1238
|
-
padding: "16px",
|
|
1239
|
-
borderTop: "1px solid rgba(0,0,0,0.1)",
|
|
1240
|
-
display: "flex",
|
|
1241
|
-
alignItems: "center",
|
|
1242
|
-
justifyContent: "center",
|
|
1243
|
-
cursor: "pointer",
|
|
1244
|
-
background: "var(--sv-bg-surface, #fff)",
|
|
1245
|
-
color: "var(--sv-color-primary, #fe2c55)",
|
|
1246
|
-
fontWeight: 600,
|
|
1247
|
-
fontSize: "14px",
|
|
1248
|
-
width: "100%"
|
|
1249
|
-
},
|
|
1250
1237
|
children: i18n?.t("guest.loginToComment") ?? "Log in to comment"
|
|
1251
1238
|
}
|
|
1252
1239
|
);
|
|
@@ -2210,7 +2197,7 @@ function VideoFeed({
|
|
|
2210
2197
|
endText: endTextProp,
|
|
2211
2198
|
autoLoad = true,
|
|
2212
2199
|
autoLoadMore = true,
|
|
2213
|
-
swipeThreshold = "
|
|
2200
|
+
swipeThreshold = "15%",
|
|
2214
2201
|
velocityThreshold = 0.3,
|
|
2215
2202
|
snapDuration = 300,
|
|
2216
2203
|
onSwipe,
|
|
@@ -3209,6 +3196,7 @@ var DefaultSlot = memo(function DefaultSlot2({
|
|
|
3209
3196
|
}) {
|
|
3210
3197
|
const i18n = useOptionalTranslation();
|
|
3211
3198
|
const { toggleLike } = useOptimistic();
|
|
3199
|
+
const { handleGuestAction } = useGuestMode();
|
|
3212
3200
|
const [isBookmarked, setIsBookmarked] = useState(false);
|
|
3213
3201
|
const [isCommentSheetOpen, setIsCommentSheetOpen] = useState(false);
|
|
3214
3202
|
const handleOpenComments = useCallback(
|
|
@@ -3251,11 +3239,17 @@ var DefaultSlot = memo(function DefaultSlot2({
|
|
|
3251
3239
|
[onBookmarkToggle]
|
|
3252
3240
|
);
|
|
3253
3241
|
const handleDoubleTapLike = useCallback(() => {
|
|
3242
|
+
if (handleGuestAction("like", {
|
|
3243
|
+
resourceType: "video",
|
|
3244
|
+
resourceId: video.id
|
|
3245
|
+
})) {
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3254
3248
|
if (!video.isLiked) {
|
|
3255
3249
|
toggleLike(video.id);
|
|
3256
3250
|
onLikeToggle?.(true, video.id);
|
|
3257
3251
|
}
|
|
3258
|
-
}, [video.id, video.isLiked, toggleLike, onLikeToggle]);
|
|
3252
|
+
}, [video.id, video.isLiked, toggleLike, onLikeToggle, handleGuestAction]);
|
|
3259
3253
|
const defaultErrorRenderer = useCallback(
|
|
3260
3254
|
(error, retry) => /* @__PURE__ */ jsx(
|
|
3261
3255
|
DefaultErrorRenderer,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xhub-short/sdk",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@xhub-short/
|
|
24
|
-
"@xhub-short/
|
|
25
|
-
"@xhub-short/core": "0.1.0-beta.
|
|
26
|
-
"@xhub-short/ui": "0.1.0-beta.
|
|
23
|
+
"@xhub-short/adapters": "0.1.0-beta.7",
|
|
24
|
+
"@xhub-short/contracts": "0.1.0-beta.7",
|
|
25
|
+
"@xhub-short/core": "0.1.0-beta.7",
|
|
26
|
+
"@xhub-short/ui": "0.1.0-beta.7"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@xhub-short/bridge": "0.0.1-beta.
|
|
29
|
+
"@xhub-short/bridge": "0.0.1-beta.7"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^19.0.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"tsup": "^8.3.0",
|
|
43
43
|
"typescript": "^5.7.0",
|
|
44
44
|
"vitest": "^2.1.0",
|
|
45
|
-
"@xhub-short/
|
|
46
|
-
"@xhub-short/
|
|
45
|
+
"@xhub-short/tsconfig": "0.0.0",
|
|
46
|
+
"@xhub-short/vitest-config": "0.0.1-beta.6"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup",
|