@ray-js/ipc-player-integration 0.0.66-beta.0 → 0.0.67-beta.1

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 (141) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.album.test.d.ts +1 -0
  3. package/lib/ctx/ctx.album.test.js +197 -0
  4. package/lib/ctx/ctx.composition.js +13 -3
  5. package/lib/ctx/ctx.js +48 -35
  6. package/lib/ctx/multiCameraCtx.d.ts +2 -0
  7. package/lib/ctx/multiCameraCtx.js +17 -1
  8. package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
  9. package/lib/ctx/multiCameraCtx.test.js +65 -0
  10. package/lib/i18n/index.d.ts +12 -0
  11. package/lib/i18n/strings.d.ts +6 -0
  12. package/lib/i18n/strings.js +6 -0
  13. package/lib/index.d.ts +0 -4
  14. package/lib/index.js +1 -3
  15. package/lib/interface.d.ts +18 -3
  16. package/lib/ui/absoluteContent.d.ts +2 -0
  17. package/lib/ui/absoluteContent.js +3 -0
  18. package/lib/ui/bottomLeftContent.js +55 -119
  19. package/lib/ui/bottomRightContent.js +3 -6
  20. package/lib/ui/ui.d.ts +0 -5
  21. package/lib/ui/ui.js +98 -89
  22. package/lib/utils/captureResult.d.ts +12 -0
  23. package/lib/utils/captureResult.js +70 -0
  24. package/lib/utils/captureResult.test.d.ts +1 -0
  25. package/lib/utils/captureResult.test.js +223 -0
  26. package/lib/utils/fullLinkTracking.d.ts +5 -0
  27. package/lib/utils/fullLinkTracking.js +71 -0
  28. package/lib/utils/navigation.d.ts +2 -1
  29. package/lib/utils/navigation.js +13 -3
  30. package/lib/widgets/battery/battery.js +5 -7
  31. package/lib/widgets/battery/batteryFull.js +5 -7
  32. package/lib/widgets/captureResult/captureResult.d.ts +16 -0
  33. package/lib/widgets/captureResult/captureResult.js +85 -0
  34. package/lib/widgets/captureResult/captureResult.less +144 -0
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
  36. package/lib/widgets/captureResult/captureResult.test.js +84 -0
  37. package/lib/widgets/captureResult/index.d.ts +2 -0
  38. package/lib/widgets/captureResult/index.js +2 -0
  39. package/lib/widgets/floodlight/floodlight.js +1 -2
  40. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  41. package/lib/widgets/fullScreen/fullScreen.js +4 -18
  42. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  43. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  44. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  45. package/lib/widgets/index.d.ts +1 -0
  46. package/lib/widgets/index.js +2 -1
  47. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  48. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
  49. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  50. package/lib/widgets/multiCamera/index.less +1 -0
  51. package/lib/widgets/multiCamera/landscapeTip.js +1 -2
  52. package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
  53. package/lib/widgets/multiCamera/multiPtz.js +2 -3
  54. package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
  55. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  56. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
  57. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  58. package/lib/widgets/multiCamera/tileTip.js +1 -2
  59. package/lib/widgets/muted/muted.js +1 -2
  60. package/lib/widgets/muted/muted.test.js +52 -66
  61. package/lib/widgets/ptz/ptz.js +1 -2
  62. package/lib/widgets/ptz/ptzControl.js +1 -1
  63. package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
  64. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  65. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  66. package/lib/widgets/recordVideo/recordVideo.js +58 -54
  67. package/lib/widgets/recordVideo/recordVideo.less +17 -74
  68. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
  69. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
  70. package/lib/widgets/recordVideo/recordVideo.test.js +1 -0
  71. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  72. package/lib/widgets/resolution/resolution.js +2 -3
  73. package/lib/widgets/screenshot/screenshot.js +67 -45
  74. package/lib/widgets/screenshot/screenshot.less +1 -40
  75. package/lib/widgets/screenshot/screenshot.test.d.ts +1 -0
  76. package/lib/widgets/screenshot/screenshot.test.js +135 -0
  77. package/lib/widgets/signal4G/signal4G.js +1 -4
  78. package/lib/widgets/siren/siren.js +1 -2
  79. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  80. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  81. package/lib/widgets/trialBadge/index.d.ts +2 -1
  82. package/lib/widgets/trialBadge/index.js +20 -17
  83. package/lib/widgets/trialBadge/index.less +0 -24
  84. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  85. package/lib/widgets/trialBadge/useTrialBadge.js +21 -3
  86. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  87. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  88. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  89. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  90. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  91. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  92. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +0 -2
  93. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
  94. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +18 -31
  95. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -23
  96. package/package.json +7 -15
  97. package/lib/renderer/capabilities.d.ts +0 -8
  98. package/lib/renderer/capabilities.js +0 -19
  99. package/lib/renderer/context.d.ts +0 -5
  100. package/lib/renderer/context.js +0 -6
  101. package/lib/renderer/directionControl.d.ts +0 -6
  102. package/lib/renderer/directionControl.js +0 -3
  103. package/lib/renderer/font.less +0 -5
  104. package/lib/renderer/glyphs.d.ts +0 -1
  105. package/lib/renderer/glyphs.js +0 -256
  106. package/lib/renderer/index.module.less +0 -48
  107. package/lib/renderer/ptzZoom.d.ts +0 -6
  108. package/lib/renderer/ptzZoom.js +0 -3
  109. package/lib/renderer/text.d.ts +0 -4
  110. package/lib/renderer/text.js +0 -32
  111. package/lib/renderer/text.module.less +0 -4
  112. package/lib/renderer/viewport.d.ts +0 -7
  113. package/lib/renderer/viewport.js +0 -24
  114. package/lib/res/lynx-signal/index.d.ts +0 -1
  115. package/lib/res/lynx-signal/index.js +0 -22
  116. package/lib/res/lynx-signal/signalFour0.png +0 -0
  117. package/lib/res/lynx-signal/signalFour1.png +0 -0
  118. package/lib/res/lynx-signal/signalFour2.png +0 -0
  119. package/lib/res/lynx-signal/signalFour3.png +0 -0
  120. package/lib/res/lynx-signal/signalFour4.png +0 -0
  121. package/lib/res/lynx-signal/signalThree0.png +0 -0
  122. package/lib/res/lynx-signal/signalThree1.png +0 -0
  123. package/lib/res/lynx-signal/signalThree2.png +0 -0
  124. package/lib/res/lynx-signal/signalThree3.png +0 -0
  125. package/lib/res/player-charging.png +0 -0
  126. package/lib/res/player-more-arrow.png +0 -0
  127. package/lib/res/player-solar.png +0 -0
  128. package/lib/ui/scrollHintArrow.d.ts +0 -23
  129. package/lib/ui/scrollHintArrow.js +0 -82
  130. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  131. package/lib/widgets/battery/statusIcon.js +0 -36
  132. package/lib/widgets/battery/statusIcon.less +0 -24
  133. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  134. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  135. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  136. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  137. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  138. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  139. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  140. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  141. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
@@ -0,0 +1,2 @@
1
+ import type { ComponentConfig, ComponentRenderState } from '../interface';
2
+ export declare function shouldRenderContent<T>(item: ComponentConfig<T>, state: ComponentRenderState): boolean;
@@ -0,0 +1,3 @@
1
+ export function shouldRenderContent(item, state) {
2
+ return !item.hidden && (!item.renderWhen || item.renderWhen(state));
3
+ }
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
2
  import "core-js/modules/esnext.iterator.constructor.js";
4
3
  import "core-js/modules/esnext.iterator.every.js";
@@ -7,10 +6,8 @@ import "core-js/modules/esnext.iterator.find.js";
7
6
  import "core-js/modules/esnext.iterator.map.js";
8
7
  import "core-js/modules/esnext.iterator.reduce.js";
9
8
  import React, { useEffect, useMemo, useRef, useState } from 'react';
10
- import { CoverView, ScrollView, View, getSystemInfoSync } from '@ray-js/ray';
9
+ import { CoverView, ScrollView, View } from '@ray-js/ray';
11
10
  import clsx from 'clsx';
12
- import { ScrollHintArrow, ScrollHintButton, usesNativeHintImage, getHintViewport } from './scrollHintArrow';
13
- import { usePlayerRenderMode } from '../renderer/context';
14
11
  import { useStore } from '../ctx/store';
15
12
  import { useComponentHideState } from './hooks';
16
13
  import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
@@ -26,7 +23,6 @@ const VERTICAL_FLAT_MAX = 4;
26
23
  // 这段同时也是箭头的落位区 —— 箭头贴着内容压在第 5 项露出的一角上(和改动前的观感一致),
27
24
  // 因此至少要放得下箭头本体 26 + 左右各 4 的间隙。
28
25
  const VERTICAL_PEEK_WIDTH = 34;
29
- const VERTICAL_HINT_EDGE_GAP = 4;
30
26
 
31
27
  // 平铺档内容与右下角按钮之间的最小安全间距
32
28
  const VERTICAL_FLAT_SAFE_GAP = 8;
@@ -83,19 +79,15 @@ const BottomLeftContent = _ref => {
83
79
  const tryExp = bottomLeftContent === null || bottomLeftContent === void 0 ? void 0 : bottomLeftContent.find(item => item.id === 'TryExperience');
84
80
  return (_gRawData = tryExp === null || tryExp === void 0 || (_tryExp$initProps5 = tryExp.initProps) === null || _tryExp$initProps5 === void 0 ? void 0 : _tryExp$initProps5.gRawData) !== null && _gRawData !== void 0 ? _gRawData : false;
85
81
  }, [bottomLeftContent]);
86
- const renderMode = usePlayerRenderMode();
87
- const hintPlatform = useMemo(() => {
88
- var _getSystemInfoSync;
89
- return renderMode === 'lynx' ? ((_getSystemInfoSync = getSystemInfoSync()) === null || _getSystemInfoSync === void 0 ? void 0 : _getSystemInfoSync.platform) || '' : '';
90
- }, [renderMode]);
91
82
  const [shouldHide] = useComponentHideState();
92
83
  const {
93
84
  showTrialBadge,
85
+ handleTrialView,
94
86
  handleTrialSubscribe,
95
87
  handleCountdownEnd
96
- } = useTrialBadge(ctx.event, ctx.devId, trialRemainingSec);
88
+ } = useTrialBadge(ctx.event, ctx.devId, trialRemainingSec, ctx.trialBadgeViewedRef, ctx.trialBadgeRtidRef);
97
89
 
98
- // 横向滚动状态:右侧仍有内容时显示右箭头提示
90
+ // 横向滚动状态:内容溢出且未滑到对应边缘时,显示左 / 右箭头提示
99
91
  const idRef = useRef(++scrollClsSeq);
100
92
  // wrap 是左下角的可用区(left:0 ~ right:reservedRight),宽度不随 ScrollView 收窄而变,
101
93
  // 因此用它、而不是 ScrollView 自身,作为“能摆多宽”的基准,避免收窄与分档互相依赖
@@ -116,8 +108,6 @@ const BottomLeftContent = _ref => {
116
108
  // 点击箭头时的受控滚动目标;仅在程序化滚动期间为数值,结束后置回 undefined,
117
109
  // 避免持续受控导致用户手动拖动被回弹
118
110
  const [scrollTo, setScrollTo] = useState(undefined);
119
- const [lynxAtEnd, setLynxAtEnd] = useState(false);
120
- const endPageTouchRef = useRef(null);
121
111
  // 横竖屏切换后,强制 ScrollView 重新挂载并把滚动状态重置为初始值
122
112
  const [scrollResetKey, setScrollResetKey] = useState(0);
123
113
  // 用户在某种屏幕模式下拖动过一次之后,该模式不再展示箭头(竖屏 / 横屏各自独立记录)
@@ -140,12 +130,10 @@ const BottomLeftContent = _ref => {
140
130
  const scrollEndTimerRef = useRef();
141
131
  // 测量时需要叠加当前滚动量,用 ref 避免闭包拿到过期值
142
132
  const scrollLeftRef = useRef(0);
143
- const pageOffsetRef = useRef(0);
144
133
  useEffect(() => {
145
134
  setScrollResetKey(k => k + 1);
146
135
  setScrollLeft(0);
147
136
  setScrollTo(undefined);
148
- setLynxAtEnd(false);
149
137
  scrollLeftRef.current = 0;
150
138
  // 清零上一屏的测量值,避免用旧 clientWidth/contentWidth 在重新测量前误判溢出导致箭头闪现
151
139
  setClientWidth(0);
@@ -306,7 +294,7 @@ const BottomLeftContent = _ref => {
306
294
  // 这样即使内容容器被撑满到可视内盒宽,也能拿到真实内容宽;哨兵不可用时回退到容器宽。
307
295
  let tw = 0;
308
296
  if (scrollRect && endRect && typeof endRect.left === 'number') {
309
- tw = endRect.left - scrollRect.left - paddingLeftPx + scrollLeftRef.current + pageOffsetRef.current;
297
+ tw = endRect.left - scrollRect.left - paddingLeftPx + scrollLeftRef.current;
310
298
  }
311
299
  if (!(tw > 0)) {
312
300
  tw = (contentRect === null || contentRect === void 0 ? void 0 : contentRect.width) || 0;
@@ -315,11 +303,11 @@ const BottomLeftContent = _ref => {
315
303
  setContentWidth(tw);
316
304
  }
317
305
  attempts += 1;
318
- // Lynx 首轮加密测量以尽快收敛,WebView 保持原有 400ms/15 次节奏。
319
- if (attempts >= (renderMode === 'lynx' ? 20 : 15)) {
306
+ // 最多轮询 15 次(约 6s)兜底,避免无限轮询
307
+ if (attempts >= 15) {
320
308
  return;
321
309
  }
322
- timer = setTimeout(measure, renderMode === 'lynx' && attempts < 8 ? 150 : 400);
310
+ timer = setTimeout(measure, 400);
323
311
  });
324
312
  };
325
313
 
@@ -335,7 +323,7 @@ const BottomLeftContent = _ref => {
335
323
  // playState:视频就绪后 overlay 可能重新布局,需重新测量
336
324
  playState, bottomLeftContent === null || bottomLeftContent === void 0 ? void 0 : bottomLeftContent.length, shouldHide, showBadge, wrapCls, scrollCls, contentCls, scrollResetKey, resizeSignal,
337
325
  // 收紧后各项 padding 变小,必须重测一遍逐项宽,否则分档还在用收紧前的旧值
338
- tightened, renderMode]);
326
+ tightened]);
339
327
 
340
328
  // 子元素主动上报宽度变化 → 重跑测量,及时更新横滑箭头与右边缘淡出
341
329
  useEffect(() => {
@@ -365,37 +353,19 @@ const BottomLeftContent = _ref => {
365
353
  const totalContentWidth = naturalWidth > 0 ? paddingLeftPx + naturalWidth + paddingRightPx : 0;
366
354
  // 竖屏由“个数”决定是否溢出(平铺档恒不溢出);横屏保持原来的像素比对
367
355
  const isOverflow = isVertical ? !isFlat : totalContentWidth > clientWidth + 1;
368
- const isButtonHint = scrollHintMode === 'button';
369
- const hintSize = isButtonHint ? 26 : 16;
370
- // Once the end is reached there is no hint to mask: restore the WebView layout budget.
371
-
372
- const hintViewport = getHintViewport(renderMode, hintPlatform, isScrollMode, verticalScrollWidth, usesNativeHintImage(renderMode, hintPlatform) ? availableWidth : clientWidth, hintSize, VERTICAL_HINT_EDGE_GAP, lynxAtEnd);
373
- const scrollViewWidth = hintViewport.visibleWidth;
374
- const atEnd = lynxAtEnd || !isOverflow || scrollLeft + scrollViewWidth >= totalContentWidth - 2;
375
- // Lynx 不响应 ScrollView 的受控 scrollLeft / scrollIntoView,点击时平移现有内容。
376
- // 保留原节点;末页通过右滑返回,不增加 WebView 没有的反向箭头。
377
- const pageOffset = renderMode === 'lynx' && lynxAtEnd ? Math.max(0, totalContentWidth - scrollViewWidth - scrollLeft) : 0;
378
- pageOffsetRef.current = pageOffset;
356
+ const scrollViewWidth = verticalScrollWidth > 0 ? verticalScrollWidth : clientWidth;
357
+ const atEnd = !isOverflow || scrollLeft + scrollViewWidth >= totalContentWidth - 2;
379
358
  const isDismissed = dismissed[screenType];
359
+ const isButtonHint = scrollHintMode === 'button';
380
360
  // button 模式:溢出且未到末端即常显(不受 dismissed 影响);pulse 模式:保留拖动后消失的旧逻辑。
381
361
  // compact 档(<= 4 个但摆不下)不出箭头:那点空间要留给元素本身,箭头只会遮更多
382
362
 
383
363
  // 右侧还有未滚到头的内容时,启用右边缘淡出,把没完全露出的元素渐隐隐藏(横竖屏都生效)
384
364
  const fadeRightEdge = isOverflow && !atEnd;
385
365
 
386
- // Lynx 用子节点 id 定位末端:其受控 scrollLeft 属性不会可靠地驱动原生横滑。
387
- // WebView 仍以有限的实际最大偏移滚动。
366
+ // 点击右箭头:直接滚动到最右端。
367
+ // 给一个足够大的目标值,交由 ScrollView 自身夹取到真实最右端,避免测量误差导致滚不到底。
388
368
 
389
- const readTouch = event => {
390
- var _event$touches, _event$changedTouches, _event$origin, _event$origin2, _touch$clientX, _touch$clientY;
391
- const touch = (event === null || event === void 0 || (_event$touches = event.touches) === null || _event$touches === void 0 ? void 0 : _event$touches[0]) || (event === null || event === void 0 || (_event$changedTouches = event.changedTouches) === null || _event$changedTouches === void 0 ? void 0 : _event$changedTouches[0]) || (event === null || event === void 0 || (_event$origin = event.origin) === null || _event$origin === void 0 || (_event$origin = _event$origin.touches) === null || _event$origin === void 0 ? void 0 : _event$origin[0]) || (event === null || event === void 0 || (_event$origin2 = event.origin) === null || _event$origin2 === void 0 || (_event$origin2 = _event$origin2.changedTouches) === null || _event$origin2 === void 0 ? void 0 : _event$origin2[0]);
392
- const x = (_touch$clientX = touch === null || touch === void 0 ? void 0 : touch.clientX) !== null && _touch$clientX !== void 0 ? _touch$clientX : touch === null || touch === void 0 ? void 0 : touch.pageX;
393
- const y = (_touch$clientY = touch === null || touch === void 0 ? void 0 : touch.clientY) !== null && _touch$clientY !== void 0 ? _touch$clientY : touch === null || touch === void 0 ? void 0 : touch.pageY;
394
- return typeof x === 'number' && typeof y === 'number' ? {
395
- x,
396
- y
397
- } : null;
398
- };
399
369
  const coverHeight = screenType === 'vertical' ? shouldHide ? 49 : 48 : shouldHide ? 59 : 58;
400
370
  const containerHeight = screenType === 'vertical' ? 48 : 58;
401
371
 
@@ -408,50 +378,44 @@ const BottomLeftContent = _ref => {
408
378
  // 竖屏: 0 + 24 = 24 → bottom = 16
409
379
  // 横屏: 25 + 16.5 = 41.5 → bottom = 33.5
410
380
  const visibleRowHeight = containerHeight - paddingBottomPx;
411
-
412
381
  // button 模式用半透明圆做点击热区,比 pulse 提示大;下移半个差值以保持图标中心不变
413
-
382
+ const hintSize = isButtonHint ? 26 : 16;
414
383
  // 竖屏:箭头贴着可视区右缘、压在第 5 项露出的那一角上(改动前就是这个观感)。
415
384
  // 箭头右缘距可视区右缘 4px => right = 可用宽 - 可视宽 + 4
416
385
  // 可视宽是“前 4 项 + 34 露出区”,箭头宽 26,因此箭头左缘落在第 4 项之后 4px,碰不到它。
417
386
  // 横屏维持原来的 6px
418
387
  const hintRight = (() => {
419
388
  if (!isVertical) return 6;
420
- if (!(availableWidth > 0) || !(hintViewport.layoutWidth > 0)) return VERTICAL_HINT_EDGE_GAP;
421
- return Math.max(availableWidth - hintViewport.layoutWidth + VERTICAL_HINT_EDGE_GAP, VERTICAL_HINT_EDGE_GAP);
389
+ if (!(availableWidth > 0) || !(scrollViewWidth > 0)) return 4;
390
+ return Math.max(availableWidth - scrollViewWidth + 4, 4);
422
391
  })();
423
392
  return /*#__PURE__*/React.createElement(CoverView, {
424
393
  className: clsx('ipc-player-bottom-left-content-wrap', wrapCls),
425
- style: _objectSpread(_objectSpread({
394
+ style: {
426
395
  right: rightCss,
427
396
  height: showBadge ? `${coverHeight + 30}px` : `${coverHeight}px`,
428
397
  display: 'flex',
429
398
  flexDirection: 'column',
430
399
  justifyContent: 'flex-start',
431
- opacity: shouldHide ? 0 : 1
432
- }, renderMode === 'lynx' ? {
433
- transition: 'opacity 0.3s ease'
434
- } : {}), {}, {
400
+ opacity: shouldHide ? 0 : 1,
435
401
  pointerEvents: shouldHide ? 'none' : 'auto'
436
- })
402
+ }
437
403
  }, showBadge && /*#__PURE__*/React.createElement(View, {
438
404
  style: {
439
405
  height: '32px',
440
406
  marginLeft: screenType === 'vertical' ? '12px' : '25px'
441
407
  }
442
408
  }, /*#__PURE__*/React.createElement(TrialBadge, {
409
+ onView: handleTrialView,
443
410
  brandColor: brandColor,
444
411
  trialRemainingSec: trialRemainingSec,
445
412
  onSubscribe: handleTrialSubscribe,
446
413
  onCountdownEnd: handleCountdownEnd
447
- })), /*#__PURE__*/React.createElement(ScrollView, _extends({
414
+ })), /*#__PURE__*/React.createElement(ScrollView, {
448
415
  key: scrollResetKey,
449
- scrollX: renderMode !== 'lynx' || !lynxAtEnd,
416
+ scrollX: true,
450
417
  scrollLeft: scrollTo,
451
- scrollWithAnimation: true
452
- }, usesNativeHintImage(renderMode, hintPlatform) ? {
453
- bounces: false
454
- } : {}, {
418
+ scrollWithAnimation: true,
455
419
  onScroll: e => {
456
420
  var _e$detail;
457
421
  // 滑动开始时暂停自动隐藏(仅在一次滑动会话内触发一次),滑动停止后恢复
@@ -472,13 +436,8 @@ const BottomLeftContent = _ref => {
472
436
  // Ray ScrollView 在不同实现下,scrollLeft 可能直接挂在事件上,也可能在 detail 内
473
437
  const sl = typeof (e === null || e === void 0 ? void 0 : e.scrollLeft) === 'number' ? e.scrollLeft : e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.scrollLeft;
474
438
  if (typeof sl === 'number') {
475
- // Android's boundary events can overshoot the range; never use elastic offsets as page state.
476
- const nextScrollLeft = usesNativeHintImage(renderMode, hintPlatform) ? Math.max(0, Math.min(sl, Math.max(0, totalContentWidth - clientWidth))) : sl;
477
- scrollLeftRef.current = nextScrollLeft;
478
- setScrollLeft(nextScrollLeft);
479
- if (usesNativeHintImage(renderMode, hintPlatform) && isScrollMode && !lynxAtEnd && nextScrollLeft > 0 && clientWidth > 0 && nextScrollLeft + clientWidth >= totalContentWidth - 2) {
480
- setLynxAtEnd(true);
481
- }
439
+ scrollLeftRef.current = sl;
440
+ setScrollLeft(sl);
482
441
  // 一旦真的拖动过(>2px 阈值过滤抖动 / 重置触发的 0 值),当前屏幕模式下不再展示箭头
483
442
  if (sl > 2 && !dismissed[screenType]) {
484
443
  setDismissed(d => _objectSpread(_objectSpread({}, d), {}, {
@@ -495,45 +454,26 @@ const BottomLeftContent = _ref => {
495
454
  // 横屏 isScrollMode 恒为 false,仍走 72px 宽渐变,行为不变。
496
455
  'ipc-player-bottom-left-scroll-fademask--narrow': fadeRightEdge && isScrollMode
497
456
  }),
498
- style: _objectSpread(_objectSpread({
457
+ style: {
499
458
  paddingBottom: `${paddingBottomPx}px`,
500
459
  paddingLeft: `${paddingLeftPx}px`,
501
460
  paddingRight: `${paddingRightPx}px`,
502
- width: hintViewport.width
503
- }, usesNativeHintImage(renderMode, hintPlatform) && isScrollMode ? {
504
- clipPath: 'none'
505
- } : {}), {}, {
461
+ width: verticalScrollWidth > 0 ? `${verticalScrollWidth}px` : '100%',
506
462
  height: `${containerHeight}px`,
507
463
  marginTop: showBadge ? '-2px' : 0,
508
464
  whiteSpace: 'nowrap'
509
- })
510
- }), /*#__PURE__*/React.createElement(View, {
511
- onTouchStart: renderMode === 'lynx' ? event => {
512
- endPageTouchRef.current = renderMode === 'lynx' && lynxAtEnd ? readTouch(event) : null;
513
- } : undefined,
514
- onTouchEnd: renderMode === 'lynx' ? event => {
515
- const start = endPageTouchRef.current;
516
- const end = readTouch(event);
517
- endPageTouchRef.current = null;
518
- if (!start || !end || renderMode !== 'lynx' || !lynxAtEnd) return;
519
- const dx = end.x - start.x;
520
- if (dx > 24 && dx > Math.abs(end.y - start.y)) setLynxAtEnd(false);
521
- } : undefined,
522
- onTouchCancel: () => {
523
- endPageTouchRef.current = null;
524
- },
465
+ }
466
+ }, /*#__PURE__*/React.createElement(View, {
525
467
  className: clsx('ipc-player-bottom-left-content-container', contentCls, {
526
468
  'ipc-player-bottom-left-content-container-tight': tightened
527
469
  }),
528
- style: _objectSpread({
529
- display: renderMode === 'lynx' ? 'flex' : 'inline-flex',
470
+ style: {
471
+ display: 'inline-flex',
530
472
  flexDirection: 'row',
531
473
  height: `${visibleRowHeight}px`,
532
474
  alignItems: 'center',
533
475
  paddingLeft: `${contentPaddingLeftPx}px`
534
- }, pageOffset > 0 ? {
535
- transform: `translateX(-${pageOffset}px)`
536
- } : {})
476
+ }
537
477
  }, children, /*#__PURE__*/React.createElement(View, {
538
478
  className: endCls,
539
479
  style: {
@@ -541,26 +481,11 @@ const BottomLeftContent = _ref => {
541
481
  height: '1px',
542
482
  flexShrink: 0
543
483
  }
544
- }))), isOverflow && !atEnd && !isCompact && (!isVertical || isScrollMode) && (isButtonHint || !isDismissed) && /*#__PURE__*/React.createElement(ScrollHintButton, {
545
- renderMode: renderMode,
546
- platform: hintPlatform,
547
- onPress: isButtonHint ? () => {
548
- if (!isOverflow) {
549
- return;
550
- }
551
- if (renderMode === 'lynx') {
552
- var _ctx$event6, _ctx$event7;
553
- (_ctx$event6 = ctx.event) === null || _ctx$event6 === void 0 || _ctx$event6.emit(pauseTimeToHideAllComponent);
554
- setLynxAtEnd(true);
555
- (_ctx$event7 = ctx.event) === null || _ctx$event7 === void 0 || _ctx$event7.emit(startTimeToHideAllComponent);
556
- return;
557
- }
558
- setScrollTo(Math.max(0, Math.ceil(totalContentWidth - scrollViewWidth)));
559
- } : undefined,
484
+ }))), isOverflow && !atEnd && !isCompact && (!isVertical || isScrollMode) && (isButtonHint || !isDismissed) && /*#__PURE__*/React.createElement(CoverView, {
560
485
  className: clsx('ipc-player-bottom-left-scroll-hint', {
561
486
  'ipc-player-bottom-left-scroll-hint--button': isButtonHint
562
487
  }),
563
- style: _objectSpread({
488
+ style: {
564
489
  position: 'absolute',
565
490
  right: `${hintRight}px`,
566
491
  bottom: `${paddingBottomPx + visibleRowHeight / 2 - 8 - (hintSize - 16) / 2}px`,
@@ -570,15 +495,26 @@ const BottomLeftContent = _ref => {
570
495
  alignItems: 'center',
571
496
  justifyContent: 'center',
572
497
  pointerEvents: isButtonHint ? 'auto' : 'none'
573
- }, usesNativeHintImage(renderMode, hintPlatform) && isButtonHint ? {
574
- backgroundColor: 'rgba(0, 0, 0, 0.45)',
575
- backgroundImage: 'none',
576
- borderRadius: '50%'
577
- } : {})
578
- }, /*#__PURE__*/React.createElement(ScrollHintArrow, {
579
- renderMode: renderMode,
580
- platform: hintPlatform,
581
- button: isButtonHint
498
+ },
499
+ onClick: isButtonHint ? () => {
500
+ if (!isOverflow) {
501
+ return;
502
+ }
503
+ setScrollTo(totalContentWidth + clientWidth + 9999);
504
+ } : undefined
505
+ }, /*#__PURE__*/React.createElement(View, {
506
+ className: clsx('ipc-player-bottom-left-scroll-hint-arrow', {
507
+ 'ipc-player-bottom-left-scroll-hint-arrow--right': true,
508
+ 'ipc-player-bottom-left-scroll-hint-arrow--light': isButtonHint,
509
+ 'ipc-player-bottom-left-scroll-hint-arrow--static': isButtonHint
510
+ })
511
+ // 右向 chevron 由 top+right 描边旋转而成,视觉重心偏右;放大并整体左移使其在圆内居中
512
+ ,
513
+ style: isButtonHint ? {
514
+ width: '9px',
515
+ height: '9px',
516
+ transform: 'translate(-1px, 0) rotate(45deg)'
517
+ } : undefined
582
518
  })));
583
519
  };
584
520
  export default BottomLeftContent;
@@ -2,7 +2,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useEffect, useRef } from 'react';
3
3
  import { CoverView, View } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
- import { usePlayerRenderMode } from '../renderer/context';
6
5
  import { useStore } from '../ctx/store';
7
6
  import { useComponentHideState } from './hooks';
8
7
 
@@ -25,7 +24,6 @@ const BottomRightContent = _ref => {
25
24
  bottomRightContent: ctx.bottomRightContent
26
25
  });
27
26
  const [shouldHide] = useComponentHideState();
28
- const renderMode = usePlayerRenderMode();
29
27
  const idRef = useRef(++rightClsSeq);
30
28
  const wrapCls = `ipc-br-wrap-${idRef.current}`;
31
29
  const lastWidthRef = useRef(0);
@@ -46,18 +44,17 @@ const BottomRightContent = _ref => {
46
44
  onWidthChange === null || onWidthChange === void 0 || onWidthChange(w);
47
45
  }
48
46
  attempts += 1;
49
- // Lynx 首轮加密测量以尽快收敛,WebView 保持原有节奏。
50
- if (attempts >= (renderMode === 'lynx' ? 20 : 15)) {
47
+ if (attempts >= 15) {
51
48
  return;
52
49
  }
53
- timer = setTimeout(measure, renderMode === 'lynx' && attempts < 8 ? 150 : 400);
50
+ timer = setTimeout(measure, 400);
54
51
  });
55
52
  };
56
53
  timer = setTimeout(measure, 60);
57
54
  return () => {
58
55
  if (timer) clearTimeout(timer);
59
56
  };
60
- }, [screenType, playState, bottomRightContent === null || bottomRightContent === void 0 ? void 0 : bottomRightContent.length, shouldHide, wrapCls, onWidthChange, renderMode]);
57
+ }, [screenType, playState, bottomRightContent === null || bottomRightContent === void 0 ? void 0 : bottomRightContent.length, shouldHide, wrapCls, onWidthChange]);
61
58
  const containerHeight = screenType === 'vertical' ? 48 : 58;
62
59
 
63
60
  // 将 width 统一规范成 CSS 合法值。number → "${n}px",string → 原样透传。
package/lib/ui/ui.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- import { PlayerRenderMode } from '../renderer/context';
3
- import { LynxPlayerAdapters } from '../renderer/capabilities';
4
2
  import { PlayStatusData, UseCtx, EventInstance } from '../interface';
5
3
  import './ui.less';
6
4
  type CtxInstance = ReturnType<UseCtx>;
@@ -16,9 +14,6 @@ type CSSVariable = {
16
14
  '--fontSize': string;
17
15
  };
18
16
  type Props = {
19
- renderMode?: PlayerRenderMode;
20
- /** Required when Lynx enables widgets backed by WebView-only renderers. */
21
- lynxAdapters?: LynxPlayerAdapters;
22
17
  devId: string;
23
18
  /** 未提供 instance 时,传给播放器内部的 useCtx。null 表示配置查询中。 */
24
19
  autoClarityDisabled?: boolean | null;