@ledvance/ui-biz-bundle 1.1.70 → 1.1.71
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/mood/AddMoodPage.tsx +194 -194
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +650 -650
- package/src/newModules/mood/Interface.ts +225 -220
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +789 -786
- package/src/newModules/mood/MoodActions.ts +244 -232
- package/src/newModules/mood/MoodInfo.ts +2151 -2151
- package/src/newModules/mood/MoodItem.tsx +160 -160
- package/src/newModules/mood/MoodPage.tsx +402 -386
- package/src/newModules/mood/MoodParse.ts +442 -443
- package/src/newModules/mood/RecommendMoodItem.tsx +81 -81
- package/src/newModules/mood/Router.ts +52 -43
- package/src/newModules/mood/StaticMoodEditorPage.tsx +290 -290
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { Utils } from 'tuya-panel-kit';
|
|
3
|
-
import Card from '@ledvance/base/src/components/Card';
|
|
4
|
-
import { CellContent } from '@ledvance/base/src/components/Cell';
|
|
5
|
-
import { StyleSheet, View } from 'react-native';
|
|
6
|
-
import Spacer from '@ledvance/base/src/components/Spacer';
|
|
7
|
-
import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
|
|
8
|
-
import { MixMoodColorsLine } from './MoodItem';
|
|
9
|
-
|
|
10
|
-
const cx = Utils.RatioUtils.convertX;
|
|
11
|
-
|
|
12
|
-
interface LightCategory {
|
|
13
|
-
isMixLight?: boolean
|
|
14
|
-
isStripLight?: boolean
|
|
15
|
-
isStringLight?: boolean
|
|
16
|
-
isCeilingLight?: boolean
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface RecommendMixMoodItemProps {
|
|
20
|
-
title: string;
|
|
21
|
-
isMix: boolean;
|
|
22
|
-
mood: MoodUIInfo;
|
|
23
|
-
deviceTypeOption?: LightCategory
|
|
24
|
-
onPress: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
28
|
-
const { mood, isMix, deviceTypeOption } = props;
|
|
29
|
-
|
|
30
|
-
const gradientMode = useMemo(() => (
|
|
31
|
-
deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient :
|
|
32
|
-
), [MoodJumpGradientMode, deviceTypeOption])
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Card style={styles.root} onPress={props.onPress}>
|
|
36
|
-
<CellContent
|
|
37
|
-
title={props.title}
|
|
38
|
-
value={''}
|
|
39
|
-
style={styles.content}
|
|
40
|
-
titleStyle={styles.title}
|
|
41
|
-
iconStyle={{
|
|
42
|
-
color: '#000',
|
|
43
|
-
size: cx(16),
|
|
44
|
-
}}
|
|
45
|
-
/>
|
|
46
|
-
{!!(mood.mainLamp) && (
|
|
47
|
-
<>
|
|
48
|
-
<View style={styles.lineStyle}>
|
|
49
|
-
<MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={mood.mainLamp.mode === gradientMode ? 'gradient' : 'separate'}/>
|
|
50
|
-
<Spacer height={cx(7)} />
|
|
51
|
-
{(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode ===
|
|
52
|
-
</View>
|
|
53
|
-
<Spacer height={cx(24)} />
|
|
54
|
-
</>
|
|
55
|
-
)}
|
|
56
|
-
</Card>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const styles = StyleSheet.create({
|
|
61
|
-
root: {
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
marginHorizontal: cx(24),
|
|
65
|
-
},
|
|
66
|
-
content: {
|
|
67
|
-
height: cx(56),
|
|
68
|
-
marginHorizontal: cx(16),
|
|
69
|
-
width: cx(295)
|
|
70
|
-
},
|
|
71
|
-
title: {
|
|
72
|
-
color: '#000',
|
|
73
|
-
fontSize: cx(16),
|
|
74
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
75
|
-
},
|
|
76
|
-
lineStyle: {
|
|
77
|
-
alignItems: 'center',
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export default RecommendMixMoodItem;
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Utils } from 'tuya-panel-kit';
|
|
3
|
+
import Card from '@ledvance/base/src/components/Card';
|
|
4
|
+
import { CellContent } from '@ledvance/base/src/components/Cell';
|
|
5
|
+
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import Spacer from '@ledvance/base/src/components/Spacer';
|
|
7
|
+
import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
|
|
8
|
+
import { MixMoodColorsLine } from './MoodItem';
|
|
9
|
+
|
|
10
|
+
const cx = Utils.RatioUtils.convertX;
|
|
11
|
+
|
|
12
|
+
interface LightCategory {
|
|
13
|
+
isMixLight?: boolean
|
|
14
|
+
isStripLight?: boolean
|
|
15
|
+
isStringLight?: boolean
|
|
16
|
+
isCeilingLight?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface RecommendMixMoodItemProps {
|
|
20
|
+
title: string;
|
|
21
|
+
isMix: boolean;
|
|
22
|
+
mood: MoodUIInfo;
|
|
23
|
+
deviceTypeOption?: LightCategory
|
|
24
|
+
onPress: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
28
|
+
const { mood, isMix, deviceTypeOption } = props;
|
|
29
|
+
|
|
30
|
+
const gradientMode = useMemo(() => (
|
|
31
|
+
deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient : deviceTypeOption?.isStripLight ? MoodJumpGradientMode.StripGradient : MoodJumpGradientMode.SourceGradient
|
|
32
|
+
), [MoodJumpGradientMode, deviceTypeOption])
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Card style={styles.root} onPress={props.onPress}>
|
|
36
|
+
<CellContent
|
|
37
|
+
title={props.title}
|
|
38
|
+
value={''}
|
|
39
|
+
style={styles.content}
|
|
40
|
+
titleStyle={styles.title}
|
|
41
|
+
iconStyle={{
|
|
42
|
+
color: '#000',
|
|
43
|
+
size: cx(16),
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
{!!(mood.mainLamp) && (
|
|
47
|
+
<>
|
|
48
|
+
<View style={styles.lineStyle}>
|
|
49
|
+
<MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={(mood.mainLamp.mode === gradientMode && !deviceTypeOption?.isCeilingLight) ? 'gradient' : 'separate'}/>
|
|
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'}/>}
|
|
52
|
+
</View>
|
|
53
|
+
<Spacer height={cx(24)} />
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</Card>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
root: {
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
marginHorizontal: cx(24),
|
|
65
|
+
},
|
|
66
|
+
content: {
|
|
67
|
+
height: cx(56),
|
|
68
|
+
marginHorizontal: cx(16),
|
|
69
|
+
width: cx(295)
|
|
70
|
+
},
|
|
71
|
+
title: {
|
|
72
|
+
color: '#000',
|
|
73
|
+
fontSize: cx(16),
|
|
74
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
75
|
+
},
|
|
76
|
+
lineStyle: {
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export default RecommendMixMoodItem;
|
|
@@ -1,43 +1,52 @@
|
|
|
1
|
-
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
-
import DynamicMoodEditorPage from "./DynamicMoodEditorPage";
|
|
3
|
-
import StaticMoodEditorPage from "./StaticMoodEditorPage";
|
|
4
|
-
import AddMoodPage from "./AddMoodPage";
|
|
5
|
-
import MoodPage from "./MoodPage";
|
|
6
|
-
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
+
import DynamicMoodEditorPage from "./DynamicMoodEditorPage";
|
|
3
|
+
import StaticMoodEditorPage from "./StaticMoodEditorPage";
|
|
4
|
+
import AddMoodPage from "./AddMoodPage";
|
|
5
|
+
import MoodPage from "./MoodPage";
|
|
6
|
+
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
7
|
+
import MixDynamicMoodEditorPage from "./MixDynamicMoodEditor";
|
|
8
|
+
|
|
9
|
+
const MoodPageRouters: NavigationRoute[] = [
|
|
10
|
+
{
|
|
11
|
+
name: ui_biz_routerKey.ui_biz_dynamic_mood_edit,
|
|
12
|
+
component: DynamicMoodEditorPage,
|
|
13
|
+
options: {
|
|
14
|
+
hideTopbar: true,
|
|
15
|
+
showOfflineView: false,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: ui_biz_routerKey.ui_biz_dynamic_mix_mood_edit,
|
|
20
|
+
component: MixDynamicMoodEditorPage,
|
|
21
|
+
options: {
|
|
22
|
+
hideTopbar: true,
|
|
23
|
+
showOfflineView: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: ui_biz_routerKey.ui_biz_static_mood_edit,
|
|
28
|
+
component: StaticMoodEditorPage,
|
|
29
|
+
options: {
|
|
30
|
+
hideTopbar: true,
|
|
31
|
+
showOfflineView: false,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: ui_biz_routerKey.ui_biz_mood_add,
|
|
36
|
+
component: AddMoodPage,
|
|
37
|
+
options: {
|
|
38
|
+
hideTopbar: true,
|
|
39
|
+
showOfflineView: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: ui_biz_routerKey.ui_biz_mood,
|
|
44
|
+
component: MoodPage,
|
|
45
|
+
options: {
|
|
46
|
+
hideTopbar: true,
|
|
47
|
+
showOfflineView: false,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export default MoodPageRouters
|