@ray-js/ipc-player-integration 0.0.35-beta.27 → 0.0.35-beta.29
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.
|
@@ -6,8 +6,17 @@ import clsx from 'clsx';
|
|
|
6
6
|
import { useStore } from '../ctx/store';
|
|
7
7
|
import { useComponentHideState } from './hooks';
|
|
8
8
|
import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 右侧透明渐变 mask,用于提示横向可滑动。
|
|
11
|
+
* - 竖屏容器窄,48px 渐变区已足够明显
|
|
12
|
+
* - 横屏容器约占 65% 宽度(≥ 500px),且单个按钮就有 ~72px,
|
|
13
|
+
* 渐变区需大于一个按钮宽度才能让最右侧按钮"半隐半现",
|
|
14
|
+
* 暗示后面还有内容
|
|
15
|
+
*/
|
|
16
|
+
const getFadeMask = screenType => {
|
|
17
|
+
const fadeWidth = screenType === 'vertical' ? 60 : 120;
|
|
18
|
+
return `linear-gradient(to right, #000 calc(100% - ${fadeWidth}px), transparent 100%)`;
|
|
19
|
+
};
|
|
11
20
|
const BottomLeftContent = _ref => {
|
|
12
21
|
let {
|
|
13
22
|
ctx,
|
|
@@ -58,11 +67,12 @@ const BottomLeftContent = _ref => {
|
|
|
58
67
|
} = useTrialBadge(ctx.event, ctx.devId, trialRemainingSec);
|
|
59
68
|
const paddingLeftPx = screenType === 'vertical' ? 0 : 25;
|
|
60
69
|
const showBadge = showSmartImageQuality && showTrialBadge && canOpenSettings && gRawData && !isLowPhone && buttonState === 1 && trialRemainingSec > 0;
|
|
61
|
-
const coverHeight = screenType === 'vertical' ? 48 : 83;
|
|
70
|
+
const coverHeight = screenType === 'vertical' ? shouldHide ? 49 : 48 : shouldHide ? 84 : 83;
|
|
62
71
|
const containerHeight = screenType === 'vertical' ? 48 : 58;
|
|
63
72
|
|
|
64
73
|
// reservedRight 兼容 number(px)与 string(任意 CSS 长度,例如 "35%")
|
|
65
74
|
const rightCss = typeof reservedRight === 'number' ? `${reservedRight}px` : reservedRight;
|
|
75
|
+
const fadeMask = getFadeMask(screenType);
|
|
66
76
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
67
77
|
className: clsx('ipc-player-bottom-left-content-wrap'),
|
|
68
78
|
style: {
|
|
@@ -96,8 +106,8 @@ const BottomLeftContent = _ref => {
|
|
|
96
106
|
overflowY: 'hidden',
|
|
97
107
|
whiteSpace: 'nowrap',
|
|
98
108
|
WebkitOverflowScrolling: 'touch',
|
|
99
|
-
WebkitMaskImage:
|
|
100
|
-
maskImage:
|
|
109
|
+
WebkitMaskImage: fadeMask,
|
|
110
|
+
maskImage: fadeMask
|
|
101
111
|
},
|
|
102
112
|
className: clsx('ipc-player-bottom-left-content-container')
|
|
103
113
|
}, children));
|
package/lib/ui/ui.js
CHANGED
|
@@ -455,6 +455,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
455
455
|
// canOpenSettings: true,
|
|
456
456
|
// };
|
|
457
457
|
const getNgRes = await getNgRawData();
|
|
458
|
+
console.log('res===getSmartImageQualityState', res);
|
|
458
459
|
updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience', {
|
|
459
460
|
isPurchase: res.isPurchase,
|
|
460
461
|
buttonState: res.buttonState,
|
|
@@ -96,10 +96,10 @@ export const TryExperience = props => {
|
|
|
96
96
|
}
|
|
97
97
|
lockRef.current = true;
|
|
98
98
|
try {
|
|
99
|
-
const getAI = await getAIFrameFeature(devId);
|
|
100
|
-
if (!getAI) return;
|
|
101
99
|
if (buttonState === TryExperienceStatus.Open) {
|
|
102
100
|
var _getAI$aiFrameFeature, _getAI$aiFrameFeature2, _getAI$aiFrameFeature3, _props$event;
|
|
101
|
+
const getAI = await getAIFrameFeature(devId);
|
|
102
|
+
if (!getAI) return;
|
|
103
103
|
// 由开变关的时候,只关inPreview
|
|
104
104
|
const scope = _objectSpread(_objectSpread({}, (_getAI$aiFrameFeature = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature === void 0 ? void 0 : _getAI$aiFrameFeature.scope), {}, {
|
|
105
105
|
inPreview: false
|
|
@@ -118,6 +118,8 @@ export const TryExperience = props => {
|
|
|
118
118
|
(_props$event = props.event) === null || _props$event === void 0 || _props$event.emit(refreshSmartImageQualityEvent);
|
|
119
119
|
} else if (buttonState === TryExperienceStatus.Close && isPurchase || buttonState === TryExperienceStatus.Close && trialRemainingSec < 300 && trialRemainingSec > 0) {
|
|
120
120
|
var _getAI$aiFrameFeature4, _getAI$aiFrameFeature5, _getAI$aiFrameFeature6, _props$event2;
|
|
121
|
+
const getAI = await getAIFrameFeature(devId);
|
|
122
|
+
if (!getAI) return;
|
|
121
123
|
const scope = _objectSpread(_objectSpread({}, (_getAI$aiFrameFeature4 = getAI.aiFrameFeature) === null || _getAI$aiFrameFeature4 === void 0 ? void 0 : _getAI$aiFrameFeature4.scope), {}, {
|
|
122
124
|
inPreview: true
|
|
123
125
|
});
|