@ledvance/ui-biz-bundle 1.1.76 → 1.1.77
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/package.json +1 -1
- package/src/newModules/biorhythm/BiorhythmActions.ts +1 -1
- package/src/newModules/fixedTime/FixedTimeActions.ts +1 -1
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +1 -1
- package/src/newModules/mood/MoodActions.ts +1 -2
- package/src/newModules/mood/MoodItem.tsx +1 -1
- package/src/newModules/mood/MoodPage.tsx +2 -3
- package/src/newModules/mood/RecommendMoodItem.tsx +1 -1
- package/src/newModules/mood/StaticMoodEditorPage.tsx +51 -6
- package/src/newModules/randomTime/RandomTimeActions.ts +1 -1
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { Utils } from 'tuya-panel-kit';
|
|
12
12
|
import { useReactive } from 'ahooks';
|
|
13
|
-
import { cloneDeep,
|
|
13
|
+
import { cloneDeep, isEqual } from 'lodash';
|
|
14
14
|
import Page from '@ledvance/base/src/components/Page';
|
|
15
15
|
import Strings from '@ledvance/base/src/i18n';
|
|
16
16
|
import { StaticMoodEditorPageParams } from './StaticMoodEditorPage';
|
|
@@ -170,7 +170,7 @@ export const useMoodScene = (params: MoodPageParams): [MoodInfo, (moodInfo: Mood
|
|
|
170
170
|
const secondaryDps = {}
|
|
171
171
|
if (moodInfo) {
|
|
172
172
|
const { mainLamp, secondaryLamp } = moodInfo
|
|
173
|
-
if (mainLamp?.nodes?.length) {
|
|
173
|
+
if (params.isMixLight || mainLamp?.nodes?.length) {
|
|
174
174
|
const mainHex = getMoodDp(params.isCeilingLight ? {...moodInfo, id: mainLamp.id!} : moodInfo, params);
|
|
175
175
|
mainDps[params.mainDp] = mainHex
|
|
176
176
|
mainDps[params.mainWorkMode] = WorkMode.Scene;
|
|
@@ -184,7 +184,6 @@ export const useMoodScene = (params: MoodPageParams): [MoodInfo, (moodInfo: Mood
|
|
|
184
184
|
id: secondaryLamp.id!,
|
|
185
185
|
version: 1
|
|
186
186
|
});
|
|
187
|
-
console.log(secondaryHex, secondaryLamp, 'hexxxxx')
|
|
188
187
|
secondaryDps[params.secondaryDp] = secondaryHex
|
|
189
188
|
secondaryDps[params.secondaryWorkMode!] = WorkMode.Scene
|
|
190
189
|
secondaryDps[params.secondarySwitch!] = true
|
|
@@ -54,7 +54,7 @@ const MoodItem = (props: MoodItemProps) => {
|
|
|
54
54
|
</View>
|
|
55
55
|
<Spacer />
|
|
56
56
|
<MixMoodColorsLine mixSubLight={mood.mainLamp} isMix={isMix} type={(mood.mainLamp.mode === gradientMode && !deviceTypeOption?.isCeilingLight) ? 'gradient' : 'separate'}/>
|
|
57
|
-
{(isMix && !!mood.secondaryLamp.nodes.length) && (
|
|
57
|
+
{(deviceTypeOption?.isMixLight || (isMix && !!mood.secondaryLamp.nodes.length)) && (
|
|
58
58
|
<>
|
|
59
59
|
<Spacer height={cx(7)} />
|
|
60
60
|
<MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === (deviceTypeOption?.isMixLight ? MoodJumpGradientMode.SourceGradient : MoodJumpGradientMode.StripGradient) ? 'gradient' : 'separate'}/>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useFlagMode,
|
|
9
9
|
useMoods,
|
|
10
10
|
} from '@ledvance/base/src/models/modules/NativePropsSlice';
|
|
11
|
-
import { useReactive
|
|
11
|
+
import { useReactive } from 'ahooks';
|
|
12
12
|
import Strings from '@ledvance/base/src/i18n';
|
|
13
13
|
import res from '@ledvance/base/src/res';
|
|
14
14
|
import { FlatList, StyleSheet, View, Platform } from 'react-native';
|
|
@@ -41,7 +41,7 @@ const MoodPage = () => {
|
|
|
41
41
|
const [secondaryWork, setSecondaryWork] = useWorkMode(params.secondaryWorkMode!);
|
|
42
42
|
const [switchLed] = useSwitchLed(params.switchLedDp)
|
|
43
43
|
const [flagMode, setFlagMode] = useFlagMode();
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
const state = useReactive<MoodPageState>({
|
|
46
46
|
currentMood: undefined,
|
|
47
47
|
staticTagChecked: true,
|
|
@@ -70,7 +70,6 @@ const MoodPage = () => {
|
|
|
70
70
|
).then(res => {
|
|
71
71
|
state.loading = false
|
|
72
72
|
if (res.success && Array.isArray(res.data)) {
|
|
73
|
-
console.log(res.data, ' <--- res.data')
|
|
74
73
|
state.originMoods = cloneDeep(res.data);
|
|
75
74
|
}
|
|
76
75
|
});
|
|
@@ -48,7 +48,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
|
48
48
|
<View style={styles.lineStyle}>
|
|
49
49
|
<MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={(mood.mainLamp.mode === gradientMode && !deviceTypeOption?.isCeilingLight) ? 'gradient' : 'separate'}/>
|
|
50
50
|
<Spacer height={cx(7)} />
|
|
51
|
-
{(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === (deviceTypeOption?.isMixLight ? MoodJumpGradientMode.SourceGradient : MoodJumpGradientMode.StripGradient) ? 'gradient' : 'separate'}/>}
|
|
51
|
+
{(deviceTypeOption?.isMixLight || (isMix && !!mood.secondaryLamp.nodes.length)) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === (deviceTypeOption?.isMixLight ? MoodJumpGradientMode.SourceGradient : MoodJumpGradientMode.StripGradient) ? 'gradient' : 'separate'}/>}
|
|
52
52
|
</View>
|
|
53
53
|
<Spacer height={cx(24)} />
|
|
54
54
|
</>
|
|
@@ -22,6 +22,7 @@ import LampAdjustView2 from '@ledvance/base/src/components/LampAdjustView2';
|
|
|
22
22
|
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
23
23
|
import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
|
|
24
24
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
25
|
+
import ColorAdjustView from '@ledvance/base/src/components/ColorAdjustView';
|
|
25
26
|
|
|
26
27
|
const cx = Utils.RatioUtils.convertX;
|
|
27
28
|
|
|
@@ -54,7 +55,7 @@ const StaticMoodEditorPage = () => {
|
|
|
54
55
|
secondaryNode: params.currentMood?.secondaryLamp?.nodes?.[0],
|
|
55
56
|
loading: false,
|
|
56
57
|
});
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
useEffect(() => {
|
|
59
60
|
state.headline = I18n.getLang(
|
|
60
61
|
params.mode === 'add' ? 'add_new_static_mood_headline_text' : 'edit_static_mood_headline_text'
|
|
@@ -90,10 +91,10 @@ const StaticMoodEditorPage = () => {
|
|
|
90
91
|
nodes: [cloneDeep(state.secondaryNode)],
|
|
91
92
|
};
|
|
92
93
|
newMood.mainLamp.type = 2
|
|
93
|
-
if(moduleParams.isSupportBrightness && !moduleParams.isSupportTemperature){
|
|
94
|
+
if (moduleParams.isSupportBrightness && !moduleParams.isSupportTemperature) {
|
|
94
95
|
newMood.mainLamp.type = 1
|
|
95
96
|
}
|
|
96
|
-
if(moduleParams.isSupportColor){
|
|
97
|
+
if (moduleParams.isSupportColor) {
|
|
97
98
|
newMood.secondaryLamp.type = 3
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -108,11 +109,11 @@ const StaticMoodEditorPage = () => {
|
|
|
108
109
|
return params.nameRepeat(state.mood)
|
|
109
110
|
}, [state.mood.name]);
|
|
110
111
|
|
|
111
|
-
const checkMoodChanged = useMemo(() =>{
|
|
112
|
+
const checkMoodChanged = useMemo(() => {
|
|
112
113
|
return isEqual(state.mood, params.currentMood)
|
|
113
114
|
}, [JSON.stringify(state.mood), params.currentMood])
|
|
114
115
|
|
|
115
|
-
const canSaveMoodData = useMemo(() =>{
|
|
116
|
+
const canSaveMoodData = useMemo(() => {
|
|
116
117
|
return state.mood.name.length > 0 && state.mood.name.length < 33 && !nameRepeat && (params.mode === 'add' || !checkMoodChanged)
|
|
117
118
|
}, [nameRepeat, state.mood.name, checkMoodChanged, params.mode])
|
|
118
119
|
|
|
@@ -194,6 +195,50 @@ const StaticMoodEditorPage = () => {
|
|
|
194
195
|
/>
|
|
195
196
|
)}
|
|
196
197
|
</Card>
|
|
198
|
+
{moduleParams.isMixLight && <Card style={styles.adjustCard}>
|
|
199
|
+
<LdvSwitch
|
|
200
|
+
title={I18n.getLang('add_new_trigger_time_field_headline_text3')}
|
|
201
|
+
color={''}
|
|
202
|
+
colorAlpha={1}
|
|
203
|
+
enable={!!state.mood.secondaryLamp.enable}
|
|
204
|
+
setEnable={(enable: boolean) => {
|
|
205
|
+
if (enable && state.mood.secondaryLamp.nodes.length === 0) {
|
|
206
|
+
state.mood.secondaryLamp.nodes.push(
|
|
207
|
+
{
|
|
208
|
+
h: 0,
|
|
209
|
+
s: 100,
|
|
210
|
+
v: 100,
|
|
211
|
+
brightness: 100,
|
|
212
|
+
colorTemp: 0,
|
|
213
|
+
isColorNode: true,
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
state.mood.secondaryLamp.type = 3
|
|
218
|
+
state.secondaryNode = state.mood.secondaryLamp.nodes[0]
|
|
219
|
+
state.mood.secondaryLamp.enable = enable
|
|
220
|
+
}} />
|
|
221
|
+
{state.mood.secondaryLamp.enable &&
|
|
222
|
+
<>
|
|
223
|
+
<ColorAdjustView
|
|
224
|
+
reserveSV={true}
|
|
225
|
+
h={state.secondaryNode.h}
|
|
226
|
+
s={state.secondaryNode.s}
|
|
227
|
+
v={state.secondaryNode.v}
|
|
228
|
+
onHSVChange={(h, s, v) => {
|
|
229
|
+
state.secondaryNode.h = h
|
|
230
|
+
state.secondaryNode.s = s
|
|
231
|
+
state.secondaryNode.v = v
|
|
232
|
+
}}
|
|
233
|
+
onHSVChangeComplete={(h, s, v) => {
|
|
234
|
+
state.secondaryNode.h = h
|
|
235
|
+
state.secondaryNode.s = s
|
|
236
|
+
state.secondaryNode.v = v
|
|
237
|
+
}} />
|
|
238
|
+
<Spacer />
|
|
239
|
+
</>
|
|
240
|
+
}
|
|
241
|
+
</Card>}
|
|
197
242
|
<Spacer />
|
|
198
243
|
{!!(moduleParams.isFanLight || moduleParams.isUVCFan) && (
|
|
199
244
|
<FanAdjustView
|
|
@@ -223,7 +268,7 @@ const StaticMoodEditorPage = () => {
|
|
|
223
268
|
method: 'confirm',
|
|
224
269
|
title: I18n.getLang('string_light_pp_dialog_sm_ed_headline_d'),
|
|
225
270
|
subTitle: I18n.getLang(`strip_light_static_mood_edit_dialog_text`),
|
|
226
|
-
onConfirm: async (_, {close})=>{
|
|
271
|
+
onConfirm: async (_, { close }) => {
|
|
227
272
|
close();
|
|
228
273
|
state.loading = true;
|
|
229
274
|
const res = await params.modDeleteMood('del', state.mood);
|