@ledvance/ui-biz-bundle 1.1.39 → 1.1.41

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.39",
7
+ "version": "1.1.41",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -5,11 +5,12 @@ import {FlatList, StyleSheet, Text, View} from 'react-native'
5
5
  import {Utils} from 'tuya-panel-kit'
6
6
  import RecommendMoodItem, {ColorsLineProps} from './RecommendMoodItem'
7
7
  import Spacer from '@ledvance/base/src/components/Spacer'
8
- import {useReactive} from 'ahooks'
8
+ import {useReactive, useCreation} from 'ahooks'
9
9
  import {useNavigation, useRoute} from '@react-navigation/native'
10
10
  import {SceneNodeTransitionMode, SceneUIState} from '../scene/SceneInfo'
11
11
  import {toDynamicMoodEditorPage, toStaticMoodEditorPage} from '../../navigation/tools'
12
12
  import {MoodPageProps} from './MoodPage'
13
+ import { difference, head, map, range } from 'lodash'
13
14
 
14
15
  const cx = Utils.RatioUtils.convertX
15
16
 
@@ -28,6 +29,11 @@ const AddMoodPage = () => {
28
29
  const navigation = useNavigation()
29
30
  const routeParams = useRoute().params as AddMoodPageParams
30
31
  const moduleParams = routeParams.moduleParams
32
+ const moodId = useCreation(() => {
33
+ const useIds = map(routeParams.moods, 'id')
34
+ const idRange = range(0, 256)
35
+ return Math.max(head(difference(idRange, useIds)) || 0, 0)
36
+ }, [routeParams.moods])
31
37
  const state = useReactive<AddMoodPageState>({
32
38
  data: getRecommendMoods(
33
39
  routeParams.isStatic,
@@ -36,16 +42,15 @@ const AddMoodPage = () => {
36
42
  ),
37
43
  })
38
44
  const recommendMood2SceneUIState = useCallback((recommendMood: RecommendMood) => {
39
- const id = routeParams.moods.length > 0 ? Math.max(...routeParams.moods.map(m => m.id)) + 1 : 0
40
45
  return {
41
- id: id,
46
+ id: moodId,
42
47
  image: '',
43
48
  fanEnable: recommendMood.fanEnable,
44
49
  fanSpeed: recommendMood.fanSpeed,
45
50
  name: recommendMood.name,
46
51
  nodes: recommendMood.moodColorsLineProps?.nodes || [],
47
52
  }
48
- }, [routeParams, routeParams.moods])
53
+ }, [routeParams, routeParams.moods, moodId])
49
54
 
50
55
  return (
51
56
  <Page
@@ -63,13 +68,12 @@ const AddMoodPage = () => {
63
68
  title={item.name}
64
69
  moodColorsLineProps={item.moodColorsLineProps}
65
70
  onPress={() => {
66
- const id = routeParams.moods.length > 0 ? Math.max(...routeParams.moods.map(m => m.id)) + 1 : 0
67
71
  if (routeParams.isStatic) {
68
72
  toStaticMoodEditorPage(navigation,
69
73
  {
70
74
  mode: 'add',
71
75
  currentMood: index === 0 ? newMood(
72
- id,
76
+ moodId,
73
77
  moduleParams.isSupportColor && moduleParams.isSupportTemperature,
74
78
  routeParams.isStatic,
75
79
  moduleParams.isSupportColor,
@@ -83,7 +87,7 @@ const AddMoodPage = () => {
83
87
  {
84
88
  mode: 'add',
85
89
  currentMood: index === 0 ? newMood(
86
- id,
90
+ moodId,
87
91
  moduleParams.isSupportColor && moduleParams.isSupportTemperature,
88
92
  routeParams.isStatic,
89
93
  moduleParams.isSupportColor,
@@ -512,6 +512,8 @@ const styles = StyleSheet.create({
512
512
  flex: 1,
513
513
  height: cx(40),
514
514
  borderRadius: cx(8),
515
+ borderWidth: 1,
516
+ borderColor: '#ccc'
515
517
  },
516
518
  nodeDeleteBtn: {
517
519
  width: cx(24),
@@ -10,7 +10,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
10
10
  import RecommendMixMoodItem from './RecommendMixMoodItem'
11
11
  import { SceneNodeTransitionMode } from '@ledvance/ui-biz-bundle/src/modules/scene/SceneInfo'
12
12
  import { ui_biz_routerKey } from '../../../navigation/Routers'
13
- import { difference, last, map, range } from 'lodash'
13
+ import { difference, head, map, range } from 'lodash'
14
14
  import { Result } from '@ledvance/base/src/models/modules/Result'
15
15
  import { MixMoodPageProps } from './MixMoodPage'
16
16
 
@@ -43,9 +43,9 @@ const AddMixMoodPage = () => {
43
43
  })
44
44
  const useIds = map(mixMoods, 'id')
45
45
  const idRange = range(0, 256)
46
- const mainId: number = last(difference(idRange, useIds)) || -1
46
+ const mainId: number = head(difference(idRange, useIds)) || -1
47
47
  useIds.push(mainId)
48
- const secondlyId: number = last(difference(idRange, useIds)) || -1
48
+ const secondlyId: number = head(difference(idRange, useIds)) || -1
49
49
  return { mainId, secondlyId }
50
50
  }, [routeParams.mixMoods])
51
51
  const state = useReactive<AddMoodPageState>({
@@ -641,6 +641,8 @@ const styles = StyleSheet.create({
641
641
  flex: 1,
642
642
  height: cx(40),
643
643
  borderRadius: cx(8),
644
+ borderWidth: 1,
645
+ borderColor: '#ccc'
644
646
  },
645
647
  nodeDeleteBtn: {
646
648
  width: cx(24),
@@ -67,6 +67,7 @@ export function MixMoodColorsLine(props: { mixSubLight: MixMainLampInfo, colorLi
67
67
  <View style={styles.gradientItem}>
68
68
  <Spacer height={0} width={cx(16)} />
69
69
  <MoodColorsLine
70
+ nodeStyle={{ borderColor: '#ccc', borderWidth: 1 }}
70
71
  width={cx(264)}
71
72
  type={'separate'}
72
73
  colors={lightColors} />
@@ -52,6 +52,7 @@ const MoodItem = (props: MoodItemProps) => {
52
52
  <Spacer />
53
53
  <View style={styles.gradientItem}>
54
54
  <MoodColorsLine
55
+ nodeStyle={{ borderColor: '#ccc', borderWidth: 1 }}
55
56
  type={mood.nodes[0].transitionMode === SceneNodeTransitionMode.Gradient ? 'gradient' : 'separate'}
56
57
  colors={state.colors} />
57
58
  </View>
@@ -44,7 +44,7 @@ export interface MoodPageProps {
44
44
  isSupportBrightness: boolean
45
45
  }
46
46
 
47
- const MAX_MOOD_COUNT = 8
47
+ const MAX_MOOD_COUNT = 256
48
48
 
49
49
  const MoodPage = () => {
50
50
  const routeParams = useRoute().params as MoodPageProps
@@ -134,7 +134,7 @@ export function dp2Obj(dp: string, isFan: boolean = false, isUVCFan?: boolean):
134
134
  v,
135
135
  brightness,
136
136
  colorTemp,
137
- isColorNode: s !== 0, // 色相/饱和度 不为0就是颜色节点
137
+ isColorNode: (h !== 0 || s !== 0 || v !== 0), // 色相/饱和度 不为0就是颜色节点
138
138
  }
139
139
  })
140
140
  return isFan ? { id, fanEnable, fanSpeed, nodes } : { id, nodes }
@@ -92,6 +92,11 @@ export interface StripLightSceneMode {
92
92
  };
93
93
  }
94
94
 
95
+ export const CeilingLightSceneMode: StripLightSceneMode = {
96
+ '1': { title: I18n.getLang('strip_lights_modes_flash_text'), mode: 1 },
97
+ '2': { title: I18n.getLang('strip_lights_modes_breath_text'), mode: 2 },
98
+ }
99
+
95
100
  export const stringLightSceneMode: StripLightSceneMode = {
96
101
  '13': { title: I18n.getLang('strip_lights_modes_flow_text'), mode: 13, turnOn: true }, // 流水
97
102
  '2': { title: I18n.getLang('strip_lights_modes_rainbow_text'), mode: 2, turnOn: true }, // 彩虹
@@ -255,6 +260,7 @@ function getRGBWDefSceneList(): RemoteSceneInfo[] {
255
260
  t: 0,
256
261
  e: false,
257
262
  },
263
+ ...defColorSceneList
258
264
  ]
259
265
  }
260
266
 
@@ -302,6 +308,7 @@ function getRGBDefSceneList(): RemoteSceneInfo[] {
302
308
  t: 0,
303
309
  e: false,
304
310
  },
311
+ ...defColorSceneList
305
312
  ]
306
313
  }
307
314
 
@@ -349,6 +356,7 @@ function getOnlyRGBDefSceneList(): RemoteSceneInfo[] {
349
356
  t: 0,
350
357
  e: false,
351
358
  },
359
+ ...defColorSceneList
352
360
  ]
353
361
  }
354
362
 
@@ -825,6 +833,219 @@ function getStripLightSceneList(): RemoteSceneInfo[] {
825
833
  ]
826
834
  }
827
835
 
836
+ const defColorSceneList: RemoteSceneInfo[] = [
837
+ {
838
+ n: I18n.getLang('dynamicmoods_forest'),
839
+ i: '074b4b01007802f80226000000004b4b01003303e803e8000000004b4b01007803e8018600000000',
840
+ s: '',
841
+ t: 0,
842
+ e: false,
843
+ },
844
+ {
845
+ n: I18n.getLang('dynamicmoods_desert'),
846
+ i: '084b4b010022014a0334000000004b4b01001002b203e8000000004b4b01001003e803e800000000',
847
+ s: '',
848
+ t: 0,
849
+ e: false,
850
+ },
851
+ {
852
+ n: I18n.getLang('dynamicmoods_dreams'),
853
+ i: '094b4b01014b00c803e8000000004b4b0100b4010403a2000000004b4b01001c010e03e800000000',
854
+ s: '',
855
+ t: 0,
856
+ e: false,
857
+ },
858
+ {
859
+ n: I18n.getLang('dynamicmoods_breeze'),
860
+ i: '0a4b4b01002b03520352000000004b4b010000032a02bc000000004b4b01002703e803e800000000',
861
+ s: '',
862
+ t: 0,
863
+ e: false,
864
+ },
865
+ {
866
+ n: I18n.getLang('dynamicmoods_waters'),
867
+ i: '0b4b4b0100c303e803e8000000004b4b0100a001f403e8000000004b4b0100f0030c01b800000000',
868
+ s: '',
869
+ t: 0,
870
+ e: false,
871
+ },
872
+ {
873
+ n: I18n.getLang('dynamicmoods_splash'),
874
+ i: '0c4b4b01003c03e803e8000000004b4b01002703e803e8000000004b4b01001003e803e800000000',
875
+ s: '',
876
+ t: 0,
877
+ e: false,
878
+ },
879
+ {
880
+ n: I18n.getLang("dynamicmoods_sunrise"),
881
+ i: '0d4b4b01000902d003e8000000004b4b010026012203e8000000004b4b01003303e803e800000000',
882
+ s: '',
883
+ t: 0,
884
+ e: false,
885
+ },
886
+ {
887
+ n: I18n.getLang('dynamicmoods_wonderland'),
888
+ i: '0e4b4b01003c03e803e8000000004b4b01002703e803e8000000004b4b01001003e803e800000000',
889
+ s: '',
890
+ t: 0,
891
+ e: false,
892
+ },
893
+ {
894
+ n: I18n.getLang('dynamicmoods_Twilight'),
895
+ i: '0f4b4b01014a024e03e8000000004b4b01002703e803e8000000004b4b0100b403e801f400000000',
896
+ s: '',
897
+ t: 0,
898
+ e: false,
899
+ },
900
+ {
901
+ n: I18n.getLang('dynamicmoods_symphony'),
902
+ i: '104b4b0100d3034803e8000000004b4b010000000003e8000000004b4b01003303e803e800000000',
903
+ s: '',
904
+ t: 0,
905
+ e: false,
906
+ },
907
+ {
908
+ n: I18n.getLang('dynamicmoods_sorbet'),
909
+ i: '114b4b01015e00fa03e8000000004b4b010011020803e8000000004b4b01003c03e803e800000000',
910
+ s: '',
911
+ t: 0,
912
+ e: false,
913
+ },
914
+ {
915
+ n: I18n.getLang('dynamicmoods_mansion'),
916
+ i: '124b4b01012c03e801f4000000004b4b0100b403e803e8000000004b4b01002703e803e800000000',
917
+ s: '',
918
+ t: 0,
919
+ e: false,
920
+ },
921
+ {
922
+ n: I18n.getLang('dynamicmoods_hour'),
923
+ i: '134b4b01003303e803e8000000004b4b01002103e803e8000000004b4b010026012203e800000000',
924
+ s: '',
925
+ t: 0,
926
+ e: false,
927
+ },
928
+ {
929
+ n: I18n.getLang('dynamicmoods_isle'),
930
+ i: '144b4b01007803e801f4000000004b4b010092029e0226000000004b4b01005a03e803de00000000',
931
+ s: '',
932
+ t: 0,
933
+ e: false,
934
+ },
935
+ {
936
+ n: I18n.getLang('dynamicmoods_Beat'),
937
+ i: '154b4b0100b403e803e8000000004b4b01012c03e803e8000000004b4b01003c03e803e800000000',
938
+ s: '',
939
+ t: 0,
940
+ e: false,
941
+ },
942
+ {
943
+ n: I18n.getLang('dynamicmoods_glamour'),
944
+ i: '164b4b01003303e803e8000000004b4b01012c03e801f4000000004b4b01015e00fa03e800000000',
945
+ s: '',
946
+ t: 0,
947
+ e: false,
948
+ },
949
+ {
950
+ n: I18n.getLang('dynamicmoods_edreams'),
951
+ i: '174b4b01012c03e803e8000000004b4b0100b403e803e8000000004b4b01002703e803e800000000',
952
+ s: '',
953
+ t: 0,
954
+ e: false,
955
+ },
956
+ {
957
+ n: I18n.getLang('dynamicmoods_sunset'),
958
+ i: '184b4b01001003e803e8000000004b4b01001d02b203e8000000004b4b01002b0352035200000000',
959
+ s: '',
960
+ t: 0,
961
+ e: false,
962
+ },
963
+ {
964
+ n: I18n.getLang('dynamicmoods_carnival'),
965
+ i: '194b4b01012c03e803e8000000004b4b01002703e803e8000000004b4b01003c03e803e800000000',
966
+ s: '',
967
+ t: 0,
968
+ e: false,
969
+ },
970
+ {
971
+ n: I18n.getLang('dynamicmoods_serenade'),
972
+ i: '1a4b4b0100f0030c01b8000000004b4b0100b4019a0136000000004b4b0100f0005003d400000000',
973
+ s: '',
974
+ t: 0,
975
+ e: false,
976
+ },
977
+ {
978
+ n: I18n.getLang('dynamicmoods_glow'),
979
+ i: '1b4b4b01001e03e803e8000000004b4b01003003e803e8000000004b4b010000032003e800000000',
980
+ s: '',
981
+ t: 0,
982
+ e: false,
983
+ },
984
+ {
985
+ n: I18n.getLang('dynamicmoods_Canopy'),
986
+ i: '1c4b4b01007803e80190000000004b4b010078029e0258000000004b4b01001e029e025800000000',
987
+ s: '',
988
+ t: 0,
989
+ e: false,
990
+ },
991
+ {
992
+ n: I18n.getLang('dynamicmoods_Burst'),
993
+ i: '1d4b4b01000003e803e8000000004b4b01002703e803e8000000004b4b01003c03e803e8000000004b4b01007803e803e8000000004b4b0100d203e803e8000000004b4b01011103e803e800000000',
994
+ s: '',
995
+ t: 0,
996
+ e: false,
997
+ },
998
+ {
999
+ n: I18n.getLang('dynamicmoods_Lights'),
1000
+ i: '1e4b4b01012c03e803e8000000004b4b01003c03e803e8000000004b4b0100b403e803e8000000004b4b01001803e803e800000000',
1001
+ s: '',
1002
+ t: 0,
1003
+ e: false,
1004
+ },
1005
+ {
1006
+ n: I18n.getLang('dynamicmoods_Dreamscape'),
1007
+ i: '1f4b4b01012c00c803e8000000004b4b0100f000c803e8000000004b4b01003c00c803e8000000004b4b0100b400c803e800000000',
1008
+ s: '',
1009
+ t: 0,
1010
+ e: false,
1011
+ },
1012
+ {
1013
+ n: I18n.getLang('dynamicmoods_NLights'),
1014
+ i: '204b4b01009603e803e8000000004b4b0100d203e803e8000000004b4b01010e03e803e800000000',
1015
+ s: '',
1016
+ t: 0,
1017
+ e: false,
1018
+ },
1019
+ {
1020
+ n: I18n.getLang('dynamicmoods_paradise'),
1021
+ i: '214b4b010140025803e8000000004b4b01001e032003e8000000004b4b01003c025803e800000000',
1022
+ s: '',
1023
+ t: 0,
1024
+ e: false,
1025
+ },
1026
+ {
1027
+ n: I18n.getLang('dynamicmoods_ice'),
1028
+ i: '224b4b01001803e803e8000000004b4b010000000003e8000000004b4b0100d803e803e800000000',
1029
+ s: '',
1030
+ t: 0,
1031
+ e: false,
1032
+ },
1033
+ {
1034
+ n: I18n.getLang('dynamicmoods_voyage'),
1035
+ i: '234b4b0100f003e80190000000004b4b01010e03e80190000000004b4b010000000003e800000000',
1036
+ s: '',
1037
+ t: 0,
1038
+ e: false,
1039
+ },
1040
+ {
1041
+ n: I18n.getLang('dynamicmoods_wave'),
1042
+ i: '244b4b0100d203e803e8000000004b4b0100b403e803e8000000004b4b01009603e803e800000000',
1043
+ s: '',
1044
+ t: 0,
1045
+ e: false,
1046
+ },
1047
+ ]
1048
+
828
1049
  export const MAXSCENE = 8
829
1050
 
830
1051
  export const AddScene = {