@ray-js/ipc-player-integration 0.0.59-beta.0 → 0.0.60-beta.0

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 (91) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.js +3 -0
  3. package/lib/index.d.ts +0 -4
  4. package/lib/index.js +1 -3
  5. package/lib/interface.d.ts +1 -0
  6. package/lib/ui/bottomLeftContent.js +55 -119
  7. package/lib/ui/bottomRightContent.js +3 -6
  8. package/lib/ui/ui.d.ts +0 -5
  9. package/lib/ui/ui.js +19 -37
  10. package/lib/utils/fullLinkTracking.d.ts +5 -0
  11. package/lib/utils/fullLinkTracking.js +71 -0
  12. package/lib/utils/navigation.d.ts +2 -1
  13. package/lib/utils/navigation.js +13 -3
  14. package/lib/widgets/battery/battery.js +1 -2
  15. package/lib/widgets/battery/batteryFull.js +1 -2
  16. package/lib/widgets/floodlight/floodlight.js +1 -2
  17. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  18. package/lib/widgets/fullScreen/fullScreen.js +1 -2
  19. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  20. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  21. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  22. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  23. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
  24. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  25. package/lib/widgets/multiCamera/landscapeTip.js +1 -2
  26. package/lib/widgets/multiCamera/moveablePtzControl.js +1 -1
  27. package/lib/widgets/multiCamera/multiPtz.js +1 -2
  28. package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
  29. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  30. package/lib/widgets/multiCamera/tileMultiPtz.js +1 -2
  31. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  32. package/lib/widgets/multiCamera/tileTip.js +1 -2
  33. package/lib/widgets/muted/muted.js +1 -2
  34. package/lib/widgets/ptz/ptz.js +1 -2
  35. package/lib/widgets/ptz/ptzControl.js +1 -1
  36. package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
  37. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  38. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  39. package/lib/widgets/recordVideo/recordVideo.js +1 -2
  40. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  41. package/lib/widgets/resolution/resolution.js +2 -3
  42. package/lib/widgets/screenshot/screenshot.js +1 -2
  43. package/lib/widgets/signal4G/signal4G.js +1 -4
  44. package/lib/widgets/siren/siren.js +1 -2
  45. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  46. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  47. package/lib/widgets/trialBadge/index.d.ts +2 -1
  48. package/lib/widgets/trialBadge/index.js +20 -17
  49. package/lib/widgets/trialBadge/index.less +0 -24
  50. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  51. package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
  52. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  53. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  54. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  55. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  56. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  57. package/lib/widgets/zoomTurntable/turntable/index.js +1 -2
  58. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +1 -2
  59. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +1 -2
  60. package/package.json +7 -15
  61. package/lib/renderer/capabilities.d.ts +0 -8
  62. package/lib/renderer/capabilities.js +0 -19
  63. package/lib/renderer/context.d.ts +0 -5
  64. package/lib/renderer/context.js +0 -6
  65. package/lib/renderer/directionControl.d.ts +0 -6
  66. package/lib/renderer/directionControl.js +0 -3
  67. package/lib/renderer/font.less +0 -5
  68. package/lib/renderer/glyphs.d.ts +0 -1
  69. package/lib/renderer/glyphs.js +0 -256
  70. package/lib/renderer/index.module.less +0 -48
  71. package/lib/renderer/ptzZoom.d.ts +0 -6
  72. package/lib/renderer/ptzZoom.js +0 -3
  73. package/lib/renderer/text.d.ts +0 -4
  74. package/lib/renderer/text.js +0 -32
  75. package/lib/renderer/text.module.less +0 -4
  76. package/lib/renderer/viewport.d.ts +0 -7
  77. package/lib/renderer/viewport.js +0 -24
  78. package/lib/res/lynx-signal/index.d.ts +0 -1
  79. package/lib/res/lynx-signal/index.js +0 -22
  80. package/lib/res/lynx-signal/signalFour0.png +0 -0
  81. package/lib/res/lynx-signal/signalFour1.png +0 -0
  82. package/lib/res/lynx-signal/signalFour2.png +0 -0
  83. package/lib/res/lynx-signal/signalFour3.png +0 -0
  84. package/lib/res/lynx-signal/signalFour4.png +0 -0
  85. package/lib/res/lynx-signal/signalThree0.png +0 -0
  86. package/lib/res/lynx-signal/signalThree1.png +0 -0
  87. package/lib/res/lynx-signal/signalThree2.png +0 -0
  88. package/lib/res/lynx-signal/signalThree3.png +0 -0
  89. package/lib/res/player-more-arrow.png +0 -0
  90. package/lib/ui/scrollHintArrow.d.ts +0 -23
  91. package/lib/ui/scrollHintArrow.js +0 -82
@@ -1,9 +1,8 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.map.js";
3
3
  import React, { useMemo } from 'react';
4
- import { View } from '@ray-js/ray';
4
+ import { View, Text } from '@ray-js/ray';
5
5
  import clsx from 'clsx';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { useTemperature, useHumidity, useEc, useWaterTemperature, useDpSupport } from '../../hooks';
8
7
  import { IPC_EC, IPC_WATER_TEMPERATURE, SENSOR_HUMIDITY, SENSOR_TEMPERATURE } from '../../utils/content/dpCode';
9
8
  import './tempHumidity.less';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { Text, View } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React from 'react';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import './toggleVerticalFull.less';
7
6
  export function ToggleVerticalFull(props) {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import './index.less';
3
3
  type Props = {
4
4
  className?: string;
5
+ onView?: () => void;
5
6
  /** 主题色(用于「开通」按钮背景)。默认与 player brandColor 一致 */
6
7
  brandColor?: string;
7
8
  /** 试看倒计时初始秒数,来源于 smartImageQualityState.trialRemainingSec */
@@ -11,5 +12,5 @@ type Props = {
11
12
  /** 倒计时归零时触发,本组件保证整个生命周期内只回调一次 */
12
13
  onCountdownEnd?: () => void;
13
14
  };
14
- export declare const TrialBadge: ({ className, brandColor, trialRemainingSec, onSubscribe, onCountdownEnd, }: Props) => React.JSX.Element;
15
+ export declare const TrialBadge: ({ className, onView, brandColor, trialRemainingSec, onSubscribe, onCountdownEnd, }: Props) => React.JSX.Element;
15
16
  export { useTrialBadge } from './useTrialBadge';
@@ -1,8 +1,6 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { Image, View } from '@ray-js/ray';
2
+ import { Image, Text, View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { usePlayerRenderMode } from '../../renderer/context';
5
- import { PlayerText as Text } from '../../renderer/text';
6
4
  import Strings from '../../i18n';
7
5
  import tryOpen from '../../res/try/try_open.png';
8
6
  import './index.less';
@@ -18,12 +16,15 @@ const formatCountdown = seconds => {
18
16
  export const TrialBadge = _ref => {
19
17
  let {
20
18
  className,
19
+ onView,
21
20
  brandColor = FALLBACK_BRAND_COLOR,
22
21
  trialRemainingSec = 0,
23
22
  onSubscribe,
24
23
  onCountdownEnd
25
24
  } = _ref;
26
- const renderMode = usePlayerRenderMode();
25
+ useEffect(() => {
26
+ onView === null || onView === void 0 || onView();
27
+ }, [onView]);
27
28
  const [remainingSec, setRemainingSec] = useState(Math.max(0, Math.floor(trialRemainingSec)));
28
29
  const endedRef = useRef(false);
29
30
  const onCountdownEndRef = useRef(onCountdownEnd);
@@ -63,16 +64,14 @@ export const TrialBadge = _ref => {
63
64
  }, [trialRemainingSec]);
64
65
  const countdownText = formatCountdown(remainingSec);
65
66
  return /*#__PURE__*/React.createElement(View, {
66
- className: clsx('ipc-player-trial-badge', className, {
67
- 'ipc-player-trial-badge--lynx': renderMode === 'lynx'
68
- })
67
+ className: clsx('ipc-player-trial-badge', className)
69
68
  }, /*#__PURE__*/React.createElement(Image, {
70
69
  className: "ipc-player-trial-badge-icon",
71
70
  src: tryOpen,
72
71
  mode: "heightFix"
73
72
  }), /*#__PURE__*/React.createElement(Text, {
74
73
  className: "ipc-player-trial-badge-status"
75
- }, Strings.getLang('ipc_player_trial_in_use').replace(/\s*[||]\s*$/, '')), /*#__PURE__*/React.createElement(Text, {
74
+ }, Strings.getLang('ipc_player_trial_in_use')), /*#__PURE__*/React.createElement(Text, {
76
75
  className: "ipc-player-trial-badge-divider"
77
76
  }, "|"), /*#__PURE__*/React.createElement(Text, {
78
77
  className: "ipc-player-trial-badge-preview"
@@ -82,15 +81,19 @@ export const TrialBadge = _ref => {
82
81
  backgroundColor: brandColor
83
82
  },
84
83
  onClick: () => {
85
- ty.event({
86
- eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
87
- event: {
88
- business_type: 'ipc',
89
- scene_type: 'smart_image_quality',
90
- feat_type: 'go_pay',
91
- biz: 'preview_mini'
92
- }
93
- });
84
+ try {
85
+ ty.event({
86
+ eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
87
+ event: {
88
+ business_type: 'ipc',
89
+ scene_type: 'smart_image_quality',
90
+ feat_type: 'go_pay',
91
+ biz: 'preview_mini'
92
+ }
93
+ });
94
+ } catch (error) {
95
+ console.warn('[IPC] trial subscription tracking failed:', error);
96
+ }
94
97
  onSubscribe === null || onSubscribe === void 0 || onSubscribe();
95
98
  }
96
99
  }, /*#__PURE__*/React.createElement(Text, {
@@ -66,27 +66,3 @@
66
66
  font-weight: 600;
67
67
  line-height: 1;
68
68
  }
69
-
70
- // Lynx 不支持 inline-flex 的 WebView 排版语义,显式声明横向 flex。
71
- .ipc-player-trial-badge--lynx {
72
- // Match WebView inline-flex: size to content instead of stretching across its parent.
73
- align-self: flex-start;
74
- display: flex;
75
- flex-direction: row;
76
- background-color: rgba(0, 0, 0, 0.65);
77
-
78
- .ipc-player-trial-badge-icon {
79
- width: 20px;
80
- }
81
-
82
- .ipc-player-trial-badge-status,
83
- .ipc-player-trial-badge-divider,
84
- .ipc-player-trial-badge-preview {
85
- flex-shrink: 0;
86
- }
87
-
88
- .ipc-player-trial-badge-cta {
89
- display: flex;
90
- flex-direction: row;
91
- }
92
- }
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
1
+ import type { MutableRefObject } from 'react';
2
2
  import type { EventInstance } from '../../interface';
3
- export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number) => {
3
+ export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number, viewedRef?: MutableRefObject<boolean>) => {
4
4
  showTrialBadge: boolean;
5
5
  setShowTrialBadge: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
+ handleTrialView: () => void;
6
7
  handleTrialSubscribe: () => Promise<void>;
7
8
  handleCountdownEnd: () => Promise<void>;
8
9
  };
@@ -3,7 +3,10 @@ import { setTrailFinish } from '../../utils/ttt';
3
3
  import { gotoSecurityCloudService2 } from '../../utils';
4
4
  import { trialCountdownEnd } from '../../ui/constant';
5
5
  import Strings from '../../i18n';
6
- export const useTrialBadge = (event, devId, trialRemainingSec) => {
6
+ import { createEntryTracking, reportEntryClick, reportEntryView } from '../../utils/fullLinkTracking';
7
+ export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef) => {
8
+ const localViewedRef = useRef(false);
9
+ const pageViewedRef = viewedRef || localViewedRef;
7
10
  const [showTrialBadge, setShowTrialBadge] = useState(false);
8
11
  const prevTrialSecRef = useRef(trialRemainingSec);
9
12
  useEffect(() => {
@@ -14,9 +17,16 @@ export const useTrialBadge = (event, devId, trialRemainingSec) => {
14
17
  }
15
18
  prevTrialSecRef.current = trialRemainingSec;
16
19
  }, [trialRemainingSec]);
20
+ const handleTrialView = useCallback(() => {
21
+ if (pageViewedRef.current) return;
22
+ pageViewedRef.current = true;
23
+ reportEntryView(devId, createEntryTracking());
24
+ }, [devId, pageViewedRef]);
17
25
  const handleTrialSubscribe = useCallback(async () => {
18
26
  try {
19
- await gotoSecurityCloudService2(devId);
27
+ const tracking = createEntryTracking();
28
+ await reportEntryClick(devId, tracking);
29
+ await gotoSecurityCloudService2(devId, tracking);
20
30
  } catch (error) {
21
31
  ty.showToast({
22
32
  title: Strings.getLang('ipc_player_fetch_error'),
@@ -51,6 +61,7 @@ export const useTrialBadge = (event, devId, trialRemainingSec) => {
51
61
  return {
52
62
  showTrialBadge,
53
63
  setShowTrialBadge,
64
+ handleTrialView,
54
65
  handleTrialSubscribe,
55
66
  handleCountdownEnd
56
67
  };
@@ -1,8 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View, Image, getSystemInfoSync, showToast } from '@ray-js/ray';
2
+ import { View, Image, getSystemInfoSync, showToast, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React, { useState, useEffect, useCallback, useRef } from 'react';
5
- import { PlayerText as Text } from '../../renderer/text';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import Strings from '../../i18n';
8
7
  import { getAIFrameFeature, gotoAIDrawMiniProgram, setAIFrameFeature } from '../../utils';
@@ -1,9 +1,8 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, usePageEvent } from '@ray-js/ray';
2
+ import { View, Text, usePageEvent } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import { getVideoBitrateKbps, requestWifiSignal } from '@ray-js/ray-ipc-utils';
5
5
  import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { PlayState } from '../../interface';
8
7
  import './videoBitKBP.less';
9
8
  import { useStore } from '../../ctx/store';
@@ -1,11 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useRef, useContext, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
3
- import { View, Image, Text, getSystemInfoSync } from '@ray-js/ray';
3
+ import { View, Image, getSystemInfoSync } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import { useStore, getDefaultStore, updateAtom } from '../../ctx/store';
6
6
  import './voiceIntercom.less';
7
- import { usePlayerRenderMode } from '../../renderer/context';
8
- import { PlayerText } from '../../renderer/text';
9
7
  import { PlayerStreamStatus, IntercomMode, PlayState } from '../../interface';
10
8
  import { UIEventContext } from '../../ui/context';
11
9
  import { radialGradient } from '../../utils';
@@ -39,7 +37,6 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
39
37
  const {
40
38
  event
41
39
  } = useContext(UIEventContext);
42
- const renderMode = usePlayerRenderMode();
43
40
  const {
44
41
  recording,
45
42
  mute,
@@ -198,45 +195,23 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
198
195
  }, intercomClassName),
199
196
  onTouchStart: handTouchStart,
200
197
  onTouchEnd: onTouchEnd
201
- }, intercom ? (() => {
202
- if (renderMode === 'lynx') {
203
- return /*#__PURE__*/React.createElement(View, {
204
- className: clsx('lynx-talking-bars', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName),
205
- style: {
206
- transform: `scale(${scale})`,
207
- transformOrigin: 'center'
208
- }
209
- }, [0, 1, 2, 3, 4].map(index => {
210
- const baseHeight = [5, 10, 16, 10, 5][index];
211
- const factor = 1 + Math.sin((frame + index) / 5) * 0.2;
212
- return /*#__PURE__*/React.createElement(View, {
213
- key: index,
214
- className: "lynx-talking-bar",
215
- style: {
216
- height: `${baseHeight * factor}px`,
217
- background: talkingColor
218
- }
219
- });
220
- }));
198
+ }, intercom ? (() => /*#__PURE__*/React.createElement(View, {
199
+ className: clsx({
200
+ 'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
201
+ })
202
+ }, /*#__PURE__*/React.createElement(View, {
203
+ className: clsx('bars'),
204
+ style: {
205
+ transform: `scale(${scale})`,
206
+ transformOrigin: 'center'
221
207
  }
222
- return /*#__PURE__*/React.createElement(View, {
223
- className: clsx({
224
- 'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
225
- })
226
- }, /*#__PURE__*/React.createElement(View, {
227
- className: clsx('bars'),
228
- style: {
229
- transform: `scale(${scale})`,
230
- transformOrigin: 'center'
231
- }
232
- }, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
233
- key: index,
234
- className: clsx('bar'),
235
- style: {
236
- background: talkingColor
237
- }
238
- }))));
239
- })() : (() => {
208
+ }, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
209
+ key: index,
210
+ className: clsx('bar'),
211
+ style: {
212
+ background: talkingColor
213
+ }
214
+ })))))() : (() => {
240
215
  if (icon) {
241
216
  if (typeof icon === 'string') {
242
217
  return /*#__PURE__*/React.createElement(View, {
@@ -250,14 +225,13 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
250
225
  className: clsx('icon-image-default-container', iconClassName)
251
226
  }, icon);
252
227
  }
253
- const className = clsx('icon-panel',
254
- // 按 iconfont 的 font_class 使用 yuyin,而不是 name one-way-intercom。
255
- 'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName);
256
- if (renderMode === 'lynx') return /*#__PURE__*/React.createElement(PlayerText, {
257
- className: className
258
- });
259
- return /*#__PURE__*/React.createElement(Text, {
260
- className: className
228
+ return /*#__PURE__*/React.createElement(View, {
229
+ className: clsx('icon-panel',
230
+ // 类名按 iconfont 的 font_class 取,不是 name —— 图标库里这枚图标的
231
+ // name 是「one-way-intercom」(单向对讲)、font_class 是「yuyin」(unicode e63c),
232
+ // 而 CSS 类是按 font_class 生成的。曾经按 name 拼类名,字形永远找不到,
233
+ // 重新导出多少次都不会有那个类。别再"顺手改成语义化名字"。
234
+ 'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName)
261
235
  });
262
236
  })());
263
237
  });
@@ -32,22 +32,6 @@
32
32
  align-items: center;
33
33
  height: 100%;
34
34
  }
35
-
36
- // Lynx 对讲中状态使用内联帧高度,避开 :nth-child 与 CSS animation 在 Lynx 下的兼容差异。
37
- .lynx-talking-bars {
38
- padding: 0 1px;
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- }
43
-
44
- .lynx-talking-bar {
45
- width: 2px;
46
- margin: 0 1px;
47
- border-radius: 5px;
48
- transition: height 30ms linear;
49
- }
50
-
51
35
  .ipc-player-plugin-voice-intercom-img {
52
36
  width: calc(@size * var(--ipc-player-size-scale, 1));
53
37
  height: calc(@size * var(--ipc-player-size-scale, 1));
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ZoomTurntableProps } from './type';
3
3
  import './index.less';
4
- declare const _default: {
5
- (props: ZoomTurntableProps): React.JSX.Element;
6
- displayName: string;
7
- };
8
- export default _default;
4
+ /**
5
+ * 焦距转盘渲染层。
6
+ * 内嵌自 ray-zoom-turntable,实际绘制与手势在 rjs(render 线程)内完成,
7
+ * 拖动不过桥,保证跟手。
8
+ */
9
+ declare const ZoomTurntable: React.FC<ZoomTurntableProps>;
10
+ export default ZoomTurntable;
@@ -2,7 +2,6 @@ import React, { useRef } from 'react';
2
2
  // @ts-ignore rjs 原生组件,无类型声明
3
3
  import Component from './rjs/index.js';
4
4
  import './index.less';
5
- import { withPlayerRenderer } from '../../../renderer/capabilities';
6
5
  let canvasIdCounter = 0;
7
6
 
8
7
  /**
@@ -82,4 +81,4 @@ const ZoomTurntable = props => {
82
81
  }
83
82
  });
84
83
  };
85
- export default withPlayerRenderer('zoomTurntable', ZoomTurntable);
84
+ export default ZoomTurntable;
@@ -2,10 +2,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import "core-js/modules/esnext.iterator.constructor.js";
3
3
  import "core-js/modules/esnext.iterator.map.js";
4
4
  import React, { useContext, useEffect, useRef, useState } from 'react';
5
- import { View, usePageEvent } from '@ray-js/ray';
5
+ import { View, Text, usePageEvent } from '@ray-js/ray';
6
6
  import clsx from 'clsx';
7
7
  import { useMemoizedFn } from 'ahooks';
8
- import { PlayerText as Text } from '../../renderer/text';
9
8
  import { useStore } from '../../ctx/store';
10
9
  import { UIEventContext } from '../../ui/context';
11
10
  import { PlayState } from '../../interface';
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { CoverView, View } from '@ray-js/ray';
2
+ import { CoverView, Text, View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { PlayState } from '../../interface';
7
6
  import { widgetClick, widgetLabs } from '../../ui/constant';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.59-beta.0",
3
+ "version": "0.0.60-beta.0",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -29,18 +29,16 @@
29
29
  "start:web": "ray start ./example -t web",
30
30
  "prepublishOnly": "yarn build",
31
31
  "release-it": "standard-version",
32
- "test": "yarn jest",
33
- "test:lynx": "node --test tests/*.test.cjs",
34
- "test:features": "jest --runInBand --runTestsByPath tests/master-features.test.tsx src/utils/authorize/album.test.ts src/widgets/recordVideo/recordVideo.test.tsx src/widgets/zoomTurntable/lensModel.test.ts"
32
+ "test": "yarn jest"
35
33
  },
36
34
  "peerDependencies": {
37
35
  "ahooks": "^3.1.6"
38
36
  },
39
37
  "dependencies": {
40
- "@ray-js/direction-control": "0.0.13-beta.0",
41
- "@ray-js/ipc-ptz-zoom": "0.0.5-beta.0",
42
- "@ray-js/ray-ipc-player": "2.1.6-beta.0",
43
- "@ray-js/ray-ipc-utils": "^1.1.18",
38
+ "@ray-js/direction-control": "^0.0.8",
39
+ "@ray-js/ipc-ptz-zoom": "^0.0.3",
40
+ "@ray-js/ray-ipc-player": "^2.1.4",
41
+ "@ray-js/ray-ipc-utils": "^1.1.16",
44
42
  "@ray-js/svg": "0.2.0",
45
43
  "clsx": "^1.2.1",
46
44
  "color": "^5.0.2",
@@ -58,13 +56,7 @@
58
56
  "eslint-config-tuya-panel": "^0.4.2",
59
57
  "husky": "^1.2.0",
60
58
  "lint-staged": "^10.2.11",
61
- "standard-version": "9.3.2",
62
- "react": "17.0.2",
63
- "react-dom": "17.0.2",
64
- "typescript": "4.9.5",
65
- "jest": "29.7.0",
66
- "ts-jest": "29.2.6",
67
- "jest-environment-jsdom": "29.7.0"
59
+ "standard-version": "9.3.2"
68
60
  },
69
61
  "resolutions": {
70
62
  "@ray-js/builder-mp": "^1.7.62"
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export type LynxPlayerAdapters = Partial<Record<'zoomTurntable' | 'ptzZoom' | 'directionControl', React.ComponentType<any>>>;
3
- export declare const LynxPlayerAdaptersContext: React.Context<Partial<Record<"zoomTurntable" | "ptzZoom" | "directionControl", React.ComponentType<any>>>>;
4
- /** Never mount a WebView-only RJS renderer in the Lynx tree. */
5
- export declare function withPlayerRenderer<P>(capability: keyof LynxPlayerAdapters, WebViewComponent: React.ComponentType<P>): {
6
- (props: P): React.JSX.Element;
7
- displayName: string;
8
- };
@@ -1,19 +0,0 @@
1
- import React, { createContext, useContext } from 'react';
2
- import { usePlayerRenderMode } from './context';
3
- export const LynxPlayerAdaptersContext = /*#__PURE__*/createContext({});
4
-
5
- /** Never mount a WebView-only RJS renderer in the Lynx tree. */
6
- export function withPlayerRenderer(capability, WebViewComponent) {
7
- const RendererComponent = props => {
8
- const mode = usePlayerRenderMode();
9
- const adapters = useContext(LynxPlayerAdaptersContext);
10
- if (mode !== 'lynx') return /*#__PURE__*/React.createElement(WebViewComponent, props);
11
- const Adapter = adapters[capability];
12
- if (!Adapter) {
13
- throw new Error(`IPC_LYNX_CAPABILITY_MISSING:${capability}. Supply a supported Native/WebView adapter before enabling this widget.`);
14
- }
15
- return /*#__PURE__*/React.createElement(Adapter, props);
16
- };
17
- RendererComponent.displayName = `PlayerRenderer(${String(capability)})`;
18
- return RendererComponent;
19
- }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const PlayerControlVisibilityContext: import("react").Context<boolean | undefined>;
3
- export type PlayerRenderMode = 'webview' | 'lynx';
4
- export declare const PlayerRenderModeContext: import("react").Context<PlayerRenderMode>;
5
- export declare const usePlayerRenderMode: () => PlayerRenderMode;
@@ -1,6 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
-
3
- // Scoped to the control bars, not absolute widgets or the standalone intercom.
4
- export const PlayerControlVisibilityContext = /*#__PURE__*/createContext(undefined);
5
- export const PlayerRenderModeContext = /*#__PURE__*/createContext('webview');
6
- export const usePlayerRenderMode = () => useContext(PlayerRenderModeContext);
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: {
3
- (props: import("@ray-js/direction-control").IProps): import("react").JSX.Element;
4
- displayName: string;
5
- };
6
- export default _default;
@@ -1,3 +0,0 @@
1
- import WebViewDirectionControl from '@ray-js/direction-control';
2
- import { withPlayerRenderer } from './capabilities';
3
- export default withPlayerRenderer('directionControl', WebViewDirectionControl);