@ray-js/ipc-player-integration 0.0.45-beta.3 → 0.0.46

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.
@@ -5,128 +5,9 @@
5
5
  "css_prefix_text": "icon-panel-",
6
6
  "description": "IPC 小程序公版",
7
7
  "glyphs": [
8
- {
9
- "icon_id": "48122923",
10
- "name": "v-alarm-light-siren",
11
- "font_class": "v-alarm-light-siren",
12
- "unicode": "e6d5",
13
- "unicode_decimal": 59093
14
- },
15
- {
16
- "icon_id": "48122922",
17
- "name": "v-alarm-light",
18
- "font_class": "v-alarm-light",
19
- "unicode": "e6d6",
20
- "unicode_decimal": 59094
21
- },
22
- {
23
- "icon_id": "48122921",
24
- "name": "stream-standard",
25
- "font_class": "stream-standard",
26
- "unicode": "e6d7",
27
- "unicode_decimal": 59095
28
- },
29
- {
30
- "icon_id": "48122928",
31
- "name": "feature-track",
32
- "font_class": "feature-track",
33
- "unicode": "e6d0",
34
- "unicode_decimal": 59088
35
- },
36
- {
37
- "icon_id": "48122927",
38
- "name": "v-alarm-siren",
39
- "font_class": "v-alarm-siren",
40
- "unicode": "e6d1",
41
- "unicode_decimal": 59089
42
- },
43
- {
44
- "icon_id": "48122925",
45
- "name": "v-alarm-off",
46
- "font_class": "v-alarm-off",
47
- "unicode": "e6d2",
48
- "unicode_decimal": 59090
49
- },
50
- {
51
- "icon_id": "48122926",
52
- "name": "stream-flowing",
53
- "font_class": "stream-flowing",
54
- "unicode": "e6d3",
55
- "unicode_decimal": 59091
56
- },
57
- {
58
- "icon_id": "48122924",
59
- "name": "anti-flicker",
60
- "font_class": "anti-flicker",
61
- "unicode": "e6d4",
62
- "unicode_decimal": 59092
63
- },
64
- {
65
- "icon_id": "48114313",
66
- "name": "Access-Key-Password",
67
- "font_class": "Access-Key-Password",
68
- "unicode": "e643",
69
- "unicode_decimal": 58947
70
- },
71
- {
72
- "icon_id": "48095603",
73
- "name": "Access-Play",
74
- "font_class": "Access-Play",
75
- "unicode": "e6cf",
76
- "unicode_decimal": 59087
77
- },
78
- {
79
- "icon_id": "47934817",
80
- "name": "plant_water_temp",
81
- "font_class": "plant_water_temp",
82
- "unicode": "e6ce",
83
- "unicode_decimal": 59086
84
- },
85
- {
86
- "icon_id": "47934689",
87
- "name": "plant_footer",
88
- "font_class": "plant_footer",
89
- "unicode": "e6cd",
90
- "unicode_decimal": 59085
91
- },
92
- {
93
- "icon_id": "47917149",
94
- "name": "plant_record",
95
- "font_class": "plant_record",
96
- "unicode": "e6cc",
97
- "unicode_decimal": 59084
98
- },
99
- {
100
- "icon_id": "47915428",
101
- "name": "plant_water_level",
102
- "font_class": "plant_water_level",
103
- "unicode": "e6c8",
104
- "unicode_decimal": 59080
105
- },
106
- {
107
- "icon_id": "47915429",
108
- "name": "ECzhi",
109
- "font_class": "ECzhi",
110
- "unicode": "e6c9",
111
- "unicode_decimal": 59081
112
- },
113
- {
114
- "icon_id": "47915427",
115
- "name": "plant_light",
116
- "font_class": "plant_light",
117
- "unicode": "e6ca",
118
- "unicode_decimal": 59082
119
- },
120
- {
121
- "icon_id": "47915426",
122
- "name": "plant_main_switch",
123
- "font_class": "plant_main_switch",
124
- "unicode": "e6cb",
125
- "unicode_decimal": 59083
126
- },
127
8
  {
128
9
  "icon_id": "47777351",
129
- "name": "zhinenghuazhi-guanbi",
10
+ "name": "智能画质-关闭",
130
11
  "font_class": "zhinenghuazhi-guanbi",
131
12
  "unicode": "e6c7",
132
13
  "unicode_decimal": 59079
@@ -411,6 +292,13 @@
411
292
  "unicode": "e6a1",
412
293
  "unicode_decimal": 59041
413
294
  },
295
+ {
296
+ "icon_id": "47073070",
297
+ "name": "Access-Key-Password",
298
+ "font_class": "Access-Key-Password",
299
+ "unicode": "e643",
300
+ "unicode_decimal": 58947
301
+ },
414
302
  {
415
303
  "icon_id": "47073029",
416
304
  "name": "Access-Mobile",
Binary file
Binary file
Binary file
@@ -2,9 +2,6 @@ export declare const TEMP_UNIT_SELECT = "temp_unit_select";
2
2
  export declare const TEMP_REPORT_F = "temp_report_f";
3
3
  export declare const SENSOR_TEMPERATURE = "sensor_temperature";
4
4
  export declare const SENSOR_HUMIDITY = "sensor_humidity";
5
- export declare const IPC_EC = "ipc_ec";
6
- export declare const IPC_WATER_TEMPERATURE = "ipc_water_temperature";
7
- export declare const IPC_WATER_TEMPERATURE_F = "ipc_water_temperature_f";
8
5
  export declare const PTZ_CONTROL = "ptz_control";
9
6
  export declare const GUN_BALL = "ipc_multi_locate_coor";
10
7
  export declare const ZOOM_CONTROL = "zoom_control";
@@ -6,12 +6,6 @@ export const SENSOR_TEMPERATURE = 'sensor_temperature'; // 摄氏度
6
6
 
7
7
  export const SENSOR_HUMIDITY = 'sensor_humidity'; // 湿度
8
8
 
9
- export const IPC_EC = 'ipc_ec'; // EC 值(电导率)
10
-
11
- export const IPC_WATER_TEMPERATURE = 'ipc_water_temperature'; // 水温(摄氏度)
12
-
13
- export const IPC_WATER_TEMPERATURE_F = 'ipc_water_temperature_f'; // 水温(华氏度)
14
-
15
9
  export const PTZ_CONTROL = 'ptz_control'; // ptz
16
10
 
17
11
  export const GUN_BALL = 'ipc_multi_locate_coor'; // 旧枪球联动-定位器
@@ -1,12 +1,8 @@
1
- import "core-js/modules/esnext.iterator.constructor.js";
2
- import "core-js/modules/esnext.iterator.map.js";
3
- import React, { useMemo } from 'react';
1
+ import React from 'react';
4
2
  import { View, Text } from '@ray-js/ray';
5
3
  import clsx from 'clsx';
6
- import { useTemperature, useHumidity, useEc, useWaterTemperature, useDpSupport } from '../../hooks';
7
- import { IPC_EC, IPC_WATER_TEMPERATURE, SENSOR_HUMIDITY, SENSOR_TEMPERATURE } from '../../utils/content/dpCode';
4
+ import { useTemperature, useHumidity } from '../../hooks';
8
5
  import './tempHumidity.less';
9
- const DP_CODES = [IPC_EC, SENSOR_TEMPERATURE, SENSOR_HUMIDITY, IPC_WATER_TEMPERATURE];
10
6
  export const TempHumidity = props => {
11
7
  const {
12
8
  className,
@@ -18,67 +14,48 @@ export const TempHumidity = props => {
18
14
  tempF
19
15
  } = useTemperature(devId);
20
16
  const humidity = useHumidity(devId);
21
- const ec = useEc(devId);
22
- const {
23
- waterTempC,
24
- waterTempF
25
- } = useWaterTemperature(devId);
26
- // 稳定 dpCodes 引用,避免每次渲染都生成新数组导致 useDpSupport 内 getDeviceInfo 被反复触发
27
- const dpCodes = useMemo(() => [...DP_CODES], []);
28
- const dpSupport = useDpSupport({
29
- devId,
30
- dpCodes
31
- });
32
- const items = useMemo(() => {
33
- const list = [];
34
- if (dpSupport[IPC_EC]) {
35
- list.push({
36
- key: 'ec',
37
- iconClass: 'icon-panel-ECzhi',
38
- text: ec || '--'
39
- });
40
- }
41
- if (dpSupport[SENSOR_TEMPERATURE]) {
42
- const tempText = tempUnit === '1' && tempF ? tempF : tempC || '--';
43
- list.push({
44
- key: 'temp',
45
- iconClass: 'icon-panel-temperature',
46
- text: tempText
47
- });
17
+ const tempRender = () => {
18
+ if (tempUnit === '1' && tempF) {
19
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
20
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-temperature"
21
+ }), /*#__PURE__*/React.createElement(Text, {
22
+ className: "tempHumidity"
23
+ }, tempF));
48
24
  }
49
- if (dpSupport[SENSOR_HUMIDITY]) {
50
- list.push({
51
- key: 'humidity',
52
- iconClass: 'icon-panel-humidity',
53
- text: humidity || '--'
54
- });
25
+ if (tempC) {
26
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
27
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-temperature"
28
+ }), /*#__PURE__*/React.createElement(Text, null, tempC));
55
29
  }
56
- if (dpSupport[IPC_WATER_TEMPERATURE]) {
57
- const waterTempText = tempUnit === '1' && waterTempF ? waterTempF : waterTempC || '--';
58
- list.push({
59
- key: 'waterTemp',
60
- iconClass: 'icon-panel-plant_water_temp',
61
- text: waterTempText
62
- });
63
- }
64
- return list;
65
- }, [dpSupport, ec, tempUnit, tempF, tempC, humidity, waterTempC, waterTempF]);
66
- if (!items.length) {
30
+ return null;
31
+ };
32
+ const humRender = () => {
33
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
34
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-humidity"
35
+ }), /*#__PURE__*/React.createElement(Text, {
36
+ className: "tempHumidity"
37
+ }, `${humidity}`));
38
+ };
39
+ // 当无值时返回null
40
+ if (!tempC && !tempF && !humidity) {
67
41
  return null;
68
42
  }
69
43
  return /*#__PURE__*/React.createElement(View, {
70
44
  className: clsx(className)
71
45
  }, /*#__PURE__*/React.createElement(View, {
72
46
  className: clsx('ipc-player-plugin-tempHumidity')
73
- }, items.map((item, index) => /*#__PURE__*/React.createElement(React.Fragment, {
74
- key: item.key
75
- }, index > 0 && /*#__PURE__*/React.createElement(View, {
76
- className: "ipc-player-plugin-tempHumidity-divider"
77
- }), /*#__PURE__*/React.createElement(View, {
78
- className: "ipc-player-plugin-tempHumidity-item"
79
- }, /*#__PURE__*/React.createElement(Text, {
80
- className: clsx('ipc-player-plugin-tempHumidity-text-icon', 'icon-panel', item.iconClass)
81
- }), /*#__PURE__*/React.createElement(Text, {
82
- className: "tempHumidity"
83
- }, item.text))))));
47
+ }, (() => {
48
+ if ((tempC || tempUnit === '1' && tempF) && humidity) {
49
+ return /*#__PURE__*/React.createElement(React.Fragment, null, tempRender(), /*#__PURE__*/React.createElement(View, {
50
+ className: "ipc-player-plugin-tempHumidity-divider"
51
+ }), humRender());
52
+ }
53
+ if (tempC || tempUnit === '1' && tempF) {
54
+ return /*#__PURE__*/React.createElement(React.Fragment, null, tempRender());
55
+ }
56
+ if (humidity) {
57
+ return /*#__PURE__*/React.createElement(React.Fragment, null, humRender());
58
+ }
59
+ return null;
60
+ })()));
84
61
  };
@@ -10,11 +10,6 @@
10
10
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
11
11
  }
12
12
 
13
- .ipc-player-plugin-tempHumidity-item {
14
- display: flex;
15
- align-items: center;
16
- }
17
-
18
13
  .ipc-player-plugin-tempHumidity-divider {
19
14
  margin: calc(6px * var(--ipc-player-size-scale, 1));
20
15
  color: rgba(0,0,0,0.2);
@@ -77,6 +77,15 @@ export const TrialBadge = _ref => {
77
77
  backgroundColor: brandColor
78
78
  },
79
79
  onClick: () => {
80
+ ty.event({
81
+ eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
82
+ event: {
83
+ business_type: 'ipc',
84
+ scene_type: 'smart_image_quality',
85
+ feat_type: 'go_pay',
86
+ biz: 'preview_mini'
87
+ }
88
+ });
80
89
  onSubscribe === null || onSubscribe === void 0 || onSubscribe();
81
90
  }
82
91
  }, /*#__PURE__*/React.createElement(Text, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.45-beta.3",
3
+ "version": "0.0.46",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -1 +0,0 @@
1
- export declare const useEc: (devId: string) => string;
@@ -1,25 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { useDpState } from '../useDpState';
3
- import { IPC_EC } from '../../utils/content/dpCode';
4
- import { showMathPowValue } from '../../utils/device';
5
- export const useEc = devId => {
6
- const [ec, setEc] = useState('');
7
- const [dpState, schemaObj] = useDpState({
8
- devId,
9
- dpCodes: [IPC_EC]
10
- });
11
- useEffect(() => {
12
- var _schema$property;
13
- if (dpState[IPC_EC] === undefined) {
14
- setEc('');
15
- return;
16
- }
17
- const schema = schemaObj === null || schemaObj === void 0 ? void 0 : schemaObj[IPC_EC];
18
- const scale = (schema === null || schema === void 0 || (_schema$property = schema.property) === null || _schema$property === void 0 ? void 0 : _schema$property.scale) || 0;
19
- // const unit = schema?.property?.unit || 'μS/cm';
20
- const value = showMathPowValue(dpState[IPC_EC], scale);
21
- // EC 值始终以整数形式展示(showMathPowValue 在 scale !== 0 时会保留一位小数,如 "0.0")
22
- setEc(`${Math.round(Number(value))}`);
23
- }, [dpState, schemaObj]);
24
- return ec;
25
- };
@@ -1,5 +0,0 @@
1
- export declare const useWaterTemperature: (devId: string) => {
2
- tempUnit: string;
3
- waterTempC: string;
4
- waterTempF: string;
5
- };
@@ -1,38 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { useDpState } from '../useDpState';
3
- import { TEMP_UNIT_SELECT, IPC_WATER_TEMPERATURE, IPC_WATER_TEMPERATURE_F } from '../../utils/content/dpCode';
4
- import { showMathPowValue } from '../../utils/device';
5
- export const useWaterTemperature = devId => {
6
- const [tempUnit, setTempUnit] = useState('');
7
- const [waterTempC, setWaterTempC] = useState('');
8
- const [waterTempF, setWaterTempF] = useState('');
9
- const [dpState, schemaObj] = useDpState({
10
- devId,
11
- dpCodes: [TEMP_UNIT_SELECT, IPC_WATER_TEMPERATURE, IPC_WATER_TEMPERATURE_F]
12
- });
13
- useEffect(() => {
14
- // 1=华氏度 0=摄氏度
15
- if (dpState[TEMP_UNIT_SELECT] !== undefined) {
16
- setTempUnit(dpState[TEMP_UNIT_SELECT] + '');
17
- }
18
- if (dpState[IPC_WATER_TEMPERATURE] !== undefined) {
19
- var _schema$property;
20
- const schema = schemaObj && schemaObj[IPC_WATER_TEMPERATURE];
21
- const scale = (schema === null || schema === void 0 || (_schema$property = schema.property) === null || _schema$property === void 0 ? void 0 : _schema$property.scale) || 0;
22
- const value = showMathPowValue(dpState[IPC_WATER_TEMPERATURE], scale);
23
- setWaterTempC(value + '°C');
24
- }
25
- if (dpState[IPC_WATER_TEMPERATURE_F] !== undefined) {
26
- var _schema$property2;
27
- const schema = schemaObj && schemaObj[IPC_WATER_TEMPERATURE_F];
28
- const scale = (schema === null || schema === void 0 || (_schema$property2 = schema.property) === null || _schema$property2 === void 0 ? void 0 : _schema$property2.scale) || 0;
29
- const value = showMathPowValue(dpState[IPC_WATER_TEMPERATURE_F], scale);
30
- setWaterTempF(value + '°F');
31
- }
32
- }, [dpState]);
33
- return {
34
- tempUnit,
35
- waterTempC,
36
- waterTempF
37
- };
38
- };