@ledvance/ui-biz-bundle 1.1.92 → 1.1.94

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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagEditPage.tsx +13 -12
  3. package/src/modules/flags/FlagItem.tsx +4 -3
  4. package/src/modules/flags/FlagPage.tsx +59 -41
  5. package/src/modules/history/HistoryPage.tsx +11 -10
  6. package/src/modules/mood/MixMood/AddMixMoodPage.tsx +2 -2
  7. package/src/modules/mood/MixMood/MixMoodEditPage.tsx +4 -4
  8. package/src/modules/mood/MixMood/MixMoodPage.tsx +4 -4
  9. package/src/modules/music/MusicPage.tsx +10 -8
  10. package/src/modules/sleepWakeup/DeviceState.tsx +4 -4
  11. package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +2 -2
  12. package/src/modules/timer/TimerPage.tsx +18 -17
  13. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +13 -12
  14. package/src/newModules/biorhythm/BiorhythmPage.tsx +23 -22
  15. package/src/newModules/biorhythm/IconSelect.tsx +7 -5
  16. package/src/newModules/childLock/ChildLockPage.tsx +7 -6
  17. package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +3 -2
  18. package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +16 -15
  19. package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +16 -15
  20. package/src/newModules/energyConsumption/component/BarChart.tsx +18 -5
  21. package/src/newModules/energyConsumption/component/EnergyModal.tsx +26 -25
  22. package/src/newModules/energyConsumption/component/Overview.tsx +10 -9
  23. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +23 -22
  24. package/src/newModules/fixedTime/FixedTimePage.tsx +12 -11
  25. package/src/newModules/lightMode/LightModePage.tsx +9 -8
  26. package/src/newModules/mood/AddMoodPage.tsx +3 -2
  27. package/src/newModules/mood/DynamicMoodEditorPage.tsx +13 -12
  28. package/src/newModules/mood/MixDynamicMoodEditor.tsx +19 -18
  29. package/src/newModules/mood/MoodActions.ts +17 -4
  30. package/src/newModules/mood/MoodInfo.ts +0 -7
  31. package/src/newModules/mood/MoodItem.tsx +5 -4
  32. package/src/newModules/mood/MoodPage.tsx +9 -4
  33. package/src/newModules/mood/RecommendMoodItem.tsx +4 -3
  34. package/src/newModules/mood/StaticMoodEditorPage.tsx +5 -4
  35. package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +6 -5
  36. package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +10 -9
  37. package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +8 -7
  38. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +15 -14
  39. package/src/newModules/randomTime/RandomTimePage.tsx +12 -11
  40. package/src/newModules/randomTime/Summary.tsx +7 -6
  41. package/src/newModules/remoteControl/RemoteControlPage.tsx +3 -2
  42. package/src/newModules/select/SelectPage.tsx +10 -9
  43. package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +24 -23
  44. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +15 -14
  45. package/src/newModules/switchGradient/SwitchGradientPage.tsx +4 -3
  46. package/src/newModules/swithInching/SwithInching.tsx +7 -6
  47. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +20 -19
  48. package/src/newModules/timeSchedule/TimeSchedulePage.tsx +8 -7
  49. package/src/newModules/timeSchedule/components/ManuaSettings.tsx +9 -9
  50. package/src/newModules/timeSchedule/components/ScheduleCard.tsx +6 -4
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.92",
7
+ "version": "1.1.94",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -21,6 +21,7 @@ import { FlagPageProps } from './FlagPage'
21
21
  import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView'
22
22
  import { showDialog } from '@ledvance/base/src/utils/common'
23
23
  import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
24
+ import ThemeType from '@ledvance/base/src/config/themeType'
24
25
 
25
26
  const cx = Utils.RatioUtils.convertX
26
27
  const { withTheme } = Utils.ThemeUtils
@@ -33,7 +34,7 @@ export interface FlagEditParams {
33
34
  modDeleteFlag: (mode: 'add' | 'edit' | 'del', currentMood: FlagUiInfo, options?: FlagOption) => Promise<Result<any>>
34
35
  }
35
36
 
36
- const FlagEditPage = (props: { theme?: any }) => {
37
+ const FlagEditPage = (props: { theme?: ThemeType }) => {
37
38
  const navigation = useNavigation()
38
39
  const params = cloneDeep(useRoute().params as FlagEditParams)
39
40
  const state = useReactive({
@@ -100,7 +101,7 @@ const FlagEditPage = (props: { theme?: any }) => {
100
101
  marginHorizontal: cx(16),
101
102
  },
102
103
  light: {
103
- color: props.theme.global.fontColor,
104
+ color: props.theme?.global.fontColor,
104
105
  fontSize: cx(18),
105
106
  fontFamily: 'helvetica_neue_lt_std_bd',
106
107
  },
@@ -138,7 +139,7 @@ const FlagEditPage = (props: { theme?: any }) => {
138
139
  height: cx(40),
139
140
  borderRadius: cx(8),
140
141
  borderWidth: 1,
141
- borderColor: props.theme.card.border
142
+ borderColor: props.theme?.card.border
142
143
  },
143
144
  nodeDeleteBtn: {
144
145
  width: cx(24),
@@ -158,17 +159,17 @@ const FlagEditPage = (props: { theme?: any }) => {
158
159
  borderRadius: cx(8),
159
160
  borderWidth: cx(1),
160
161
  borderStyle: 'dashed',
161
- borderColor: props.theme.addNode.border,
162
- backgroundColor: props.theme.addNode.background,
162
+ borderColor: props.theme?.addNode.border,
163
+ backgroundColor: props.theme?.addNode.background,
163
164
  },
164
165
  deleteBtn: {
165
166
  width: '100%',
166
167
  height: cx(50),
167
- backgroundColor: props.theme.button.delete,
168
+ backgroundColor: props.theme?.button.delete,
168
169
  borderRadius: cx(8),
169
170
  },
170
171
  deleteBtnText: {
171
- color: props.theme.button.fontColor,
172
+ color: props.theme?.button.fontColor,
172
173
  fontSize: cx(16),
173
174
  fontFamily: 'helvetica_neue_lt_std_bd',
174
175
  },
@@ -211,7 +212,7 @@ const FlagEditPage = (props: { theme?: any }) => {
211
212
  }}
212
213
  maxLength={33}
213
214
  showError={state.mood.name.length > 32 || nameRepeat}
214
- tipColor={nameRepeat ? props.theme.global.error : undefined}
215
+ tipColor={nameRepeat ? props.theme?.global.error : undefined}
215
216
  tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
216
217
  errorText={I18n.getLang(nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text')} />
217
218
  {(params.moduleParams.isSupportMixScene || params.moduleParams.isCeilingLight) && <><Card style={styles.adjustCard}>
@@ -288,7 +289,7 @@ const FlagEditPage = (props: { theme?: any }) => {
288
289
  state.colorPaintBucketSelected = true
289
290
  }}>
290
291
  <Image
291
- style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme.icon.primary : props.theme.icon.normal }]}
292
+ style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal }]}
292
293
  source={res.ic_paint_bucket} />
293
294
  </TouchableOpacity>
294
295
  <TouchableOpacity
@@ -296,7 +297,7 @@ const FlagEditPage = (props: { theme?: any }) => {
296
297
  state.colorPaintBucketSelected = false
297
298
  }}>
298
299
  <Image
299
- style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme.icon.normal : props.theme.icon.primary }]}
300
+ style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary }]}
300
301
  source={res.ic_colorize} />
301
302
  </TouchableOpacity>
302
303
  </View>
@@ -328,7 +329,7 @@ const FlagEditPage = (props: { theme?: any }) => {
328
329
  style={[
329
330
  styles.nodeDeleteIcon,
330
331
  {
331
- tintColor: state.mood.colors.length < 3 ? props.theme.icon.disable : props.theme.icon.normal,
332
+ tintColor: state.mood.colors.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
332
333
  },
333
334
  ]}
334
335
  source={res.ic_mood_del} />
@@ -359,7 +360,7 @@ const FlagEditPage = (props: { theme?: any }) => {
359
360
  style={{
360
361
  width: cx(18),
361
362
  height: cx(18),
362
- tintColor: props.theme.global.fontColor,
363
+ tintColor: props.theme?.global.fontColor,
363
364
  }}
364
365
  source={{ uri: res.add }} />
365
366
  </TouchableOpacity>
@@ -4,12 +4,13 @@ import Card from '@ledvance/base/src/components/Card'
4
4
  import { SwitchButton, Utils } from 'tuya-panel-kit'
5
5
  import MoodColorsLine from '@ledvance/base/src/components/MoodColorsLine'
6
6
  import Spacer from '@ledvance/base/src/components/Spacer'
7
+ import ThemeType from '@ledvance/base/src/config/themeType'
7
8
 
8
9
  const cx = Utils.RatioUtils.convertX
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  interface RecommendMoodItemProps {
12
- theme?: any
13
+ theme?: ThemeType
13
14
  enable: boolean
14
15
  title: string
15
16
  colors: string[]
@@ -32,7 +33,7 @@ function FlagItem(props: RecommendMoodItemProps) {
32
33
  justifyContent: 'space-between',
33
34
  },
34
35
  headText: {
35
- color: props.theme.global.fontColor,
36
+ color: props.theme?.global.fontColor,
36
37
  fontSize: cx(16),
37
38
  fontFamily: 'helvetica_neue_lt_std_bd',
38
39
  lineHeight: cx(20),
@@ -63,7 +64,7 @@ function FlagItem(props: RecommendMoodItemProps) {
63
64
  <View style={styles.gradientItem}>
64
65
  <MoodColorsLine
65
66
  type={'separate'}
66
- nodeStyle={{ borderColor: props.theme.card.border, borderWidth: 1 }}
67
+ nodeStyle={{ borderColor: props.theme?.card.border, borderWidth: 1 }}
67
68
  colors={props.colors} />
68
69
  </View>
69
70
  <Spacer height={cx(16)} />
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useMemo } from "react";
1
+ import React, { useCallback, useEffect, useMemo } from "react";
2
2
  import Page from "@ledvance/base/src/components/Page";
3
3
  import { useDeviceId, useDeviceInfo, useFlagMode, useFlags, useMoods } from "@ledvance/base/src/models/modules/NativePropsSlice";
4
4
  import { FlatList, Image, TouchableOpacity, View } from "react-native";
@@ -11,7 +11,7 @@ import { useRoute, useNavigation } from '@react-navigation/core'
11
11
  import I18n from "@ledvance/base/src/i18n";
12
12
  import { useReactive, useUpdateEffect } from "ahooks";
13
13
  import { cloneDeep, difference, isEqual, last, map, range } from "lodash";
14
- import { ui_biz_routerKey} from "../../navigation/Routers";
14
+ import { ui_biz_routerKey } from "../../navigation/Routers";
15
15
  import res from "@ledvance/base/src/res";
16
16
  import { hsv2Hex } from "@ledvance/base/src/utils";
17
17
  import { SceneNodeTransitionMode } from "@ledvance/ui-biz-bundle/src/modules/scene/SceneInfo";
@@ -20,8 +20,12 @@ import { useDps } from "@ledvance/base/src/models/modules/NativePropsSlice";
20
20
  import { ColorUtils, WORK_MODE } from "@tuya/tuya-panel-lamp-sdk/lib/utils";
21
21
  import TextField from "@ledvance/base/src/components/TextField";
22
22
  import { showDialog } from "@ledvance/base/src/utils/common";
23
- import { defFlagHash, fnv1aHash } from "@ledvance/ui-biz-bundle/src/modules/flags/FlagHash";
23
+ import { defFlagHash, fnv1aHash } from "./FlagHash";
24
24
  import { NativeApi } from "@ledvance/base/src/api/native";
25
+ import { useSceneStatusId } from "@ledvance/ui-biz-bundle/src/newModules/mood/MoodActions";
26
+ import { SceneStatusType } from "@ledvance/base/src/utils/interface";
27
+ import ThemeType from '@ledvance/base/src/config/themeType'
28
+
25
29
  const cx = Utils.RatioUtils.convertX
26
30
  const { withTheme } = Utils.ThemeUtils
27
31
 
@@ -33,6 +37,7 @@ export interface FlagPageProps {
33
37
  isStripLight?: boolean
34
38
  isCeilingLight?: boolean
35
39
  isSupportMixScene?: boolean
40
+ isSupportSceneStatus?: boolean
36
41
  drawToolLight?: {
37
42
  drawToolCode: string
38
43
  drawToolObj2dp: (colors: any[]) => string[]
@@ -42,14 +47,14 @@ export interface FlagPageProps {
42
47
  sceneDataCode?: string
43
48
  workModeCode: string
44
49
  switchLedCode: string
45
- whiteSwitchCode?:string
50
+ whiteSwitchCode?: string
46
51
  rgbcWorkModeCode?: string
47
52
  rgbcSwitchLedCode?: string
48
53
  brightValueCode?: string
49
54
  temperatureCode?: string
50
55
  }
51
56
 
52
- const FlagPage = (props: { theme?: any }) => {
57
+ const FlagPage = (props: { theme?: ThemeType }) => {
53
58
  const params = useRoute().params as FlagPageProps
54
59
  const devInfo = useDeviceInfo()
55
60
  const devId = useDeviceId()
@@ -64,35 +69,39 @@ const FlagPage = (props: { theme?: any }) => {
64
69
  isCeilingLight: params.isCeilingLight,
65
70
  ...params
66
71
  })
72
+ const [sceneStatusId, setSceneStatusId] = useSceneStatusId({
73
+ isSupportSceneStatus: params.isSupportSceneStatus,
74
+ sceneStatusType: SceneStatusType.Flag
75
+ });
67
76
  const state = useReactive({
68
77
  loading: false,
69
78
  flags: cloneDeep(flags) as FlagUiInfo[],
70
79
  moods: params.isStripLight ? [] : cloneDeep(moods),
71
80
  searchText: ''
72
81
  })
73
- const flagId = useMemo(() =>{
74
- if(flagState.colors !== undefined){
75
- if(flagMode?.flagId !== undefined) return flagMode.flagId
82
+ const flagId = useMemo(() => {
83
+ if (flagState.colors !== undefined) {
84
+ if (flagMode?.flagId !== undefined) return flagMode.flagId
76
85
  const flag = state.flags.find(item => {
77
86
  const hexColors = item.colors.map(c => ColorUtils.hsv2hex(c.h, c.s, c.v).toLocaleUpperCase())
78
87
  return isEqual(hexColors, flagState.colors)
79
88
  })
80
89
  return flag?.id
81
90
  }
82
- if(flagState.id !== undefined){
91
+ if (flagState.id !== undefined) {
83
92
  return flagState.id
84
93
  }
85
94
  return -1
86
95
  }, [JSON.stringify(flagState), JSON.stringify(state.flags), flagMode])
87
96
 
88
97
  useEffect(() => {
89
- if(!devInfo.devId) return
90
- if(!flags?.length){
98
+ if (!devInfo.devId) return
99
+ if (!flags?.length) {
91
100
  getRemoteFlagInfo().then()
92
101
  }
93
- if(params.getRemoteMoodList && !moods?.length){
94
- params.getRemoteMoodList(devInfo.devId).then(res =>{
95
- if(res.success && Array.isArray(res.data)){
102
+ if (params.getRemoteMoodList && !moods?.length) {
103
+ params.getRemoteMoodList(devInfo.devId).then(res => {
104
+ if (res.success && Array.isArray(res.data)) {
96
105
  state.moods = res.data
97
106
  setMoods(cloneDeep(res.data))
98
107
  }
@@ -100,15 +109,15 @@ const FlagPage = (props: { theme?: any }) => {
100
109
  }
101
110
  }, [devInfo.devId])
102
111
 
103
- useUpdateEffect(() =>{
112
+ useUpdateEffect(() => {
104
113
  state.moods = params.isStripLight ? [] : cloneDeep(moods)
105
114
  }, [JSON.stringify(moods)])
106
115
 
107
- useUpdateEffect(() =>{
116
+ useUpdateEffect(() => {
108
117
  state.flags = cloneDeep(flags)
109
118
  }, [JSON.stringify(flags)])
110
119
 
111
- useUpdateEffect(() =>{
120
+ useUpdateEffect(() => {
112
121
  state.flags = state.searchText !== '' ? cloneDeep(flags).filter(flag => (flag.name ?? '').toLowerCase().includes(state.searchText.toLowerCase())) : cloneDeep(flags)
113
122
  }, [state.searchText, flags])
114
123
 
@@ -158,17 +167,17 @@ const FlagPage = (props: { theme?: any }) => {
158
167
  if (res.success) {
159
168
  setFlags(cloneDeep(newScene))
160
169
  state.flags = cloneDeep(newScene)
161
- if (mood){
162
- if (mode === 'del' && (!flagMode?.flagMode || currentMood.id !== flagId || !dps[params.switchLedCode])){
170
+ if (mood) {
171
+ if (mode === 'del' && (!flagMode?.flagMode || currentMood.id !== flagId || !dps[params.switchLedCode])) {
163
172
  return {
164
173
  success: true
165
174
  }
166
175
  }
167
176
  updateFlagMode(true, mood)
168
177
  return setFlag(mood)
169
- }else{
178
+ } else {
170
179
  updateFlagMode(false)
171
- return setDps({[params.workModeCode!!]: params.isSupportColor ? WORK_MODE.COLOUR : WORK_MODE.WHITE})
180
+ return setDps({ [params.workModeCode!!]: params.isSupportColor ? WORK_MODE.COLOUR : WORK_MODE.WHITE })
172
181
  }
173
182
  }
174
183
  return {
@@ -176,7 +185,7 @@ const FlagPage = (props: { theme?: any }) => {
176
185
  }
177
186
  }
178
187
 
179
- const updateFlagMode = (flagMode: boolean, flag?:FlagUiInfo) =>{
188
+ const updateFlagMode = (flagMode: boolean, flag?: FlagUiInfo) => {
180
189
  saveFlagMode(devId, JSON.stringify({
181
190
  flagMode,
182
191
  flagId: flag?.id
@@ -187,6 +196,14 @@ const FlagPage = (props: { theme?: any }) => {
187
196
  })
188
197
  }
189
198
 
199
+ const getItemEnable = useCallback((flagItem: FlagUiInfo) =>{
200
+ if (params.isSupportSceneStatus && sceneStatusId !== -1){
201
+ return flagMode?.flagMode && sceneStatusId === flagItem.id && dps[params.workModeCode] === WORK_MODE.SCENE && dps[params.switchLedCode]
202
+ }else{
203
+ return flagMode?.flagMode && dps[params.workModeCode] === (params.isCeilingLight ? WORK_MODE.WHITE : params.isStripLight ? WORK_MODE.COLOUR : WORK_MODE.SCENE) && flagId === flagItem.id && dps[params.switchLedCode]
204
+ }
205
+ }, [params.isSupportSceneStatus, sceneStatusId, dps[params.workModeCode], dps[params.switchLedCode], flagId])
206
+
190
207
  return (
191
208
  <Page
192
209
  headlineText={I18n.getLang('Feature_devicepanel_flags')}
@@ -200,12 +217,12 @@ const FlagPage = (props: { theme?: any }) => {
200
217
  ], 'id')
201
218
  const idRange = range(0, 256)
202
219
  const unuseId = last(difference(idRange, useIds))
203
- if(unuseId !== undefined){
220
+ if (unuseId !== undefined) {
204
221
  navigationRoute('add', newFlag(unuseId))
205
222
  }
206
223
  }}
207
224
  >
208
- <View style={{flexDirection: 'row', display: 'flex', alignItems: 'center'}}>
225
+ <View style={{ flexDirection: 'row', display: 'flex', alignItems: 'center' }}>
209
226
  <TextField
210
227
  value={state.searchText}
211
228
  onChangeText={text => {
@@ -214,28 +231,28 @@ const FlagPage = (props: { theme?: any }) => {
214
231
  placeholder={I18n.getLang('country_selection_textfield_headline_search')}
215
232
  style={{ marginHorizontal: cx(24), flex: 1 }}
216
233
  />
217
- <TouchableOpacity style={{paddingRight: cx(24)}}
218
- onPress={() =>{
219
- showDialog({
220
- method: 'confirm',
221
- title: I18n.getLang('flag_resetbutton'),
222
- subTitle: I18n.getLang('flag_resetdescription'),
223
- onConfirm: async (_, {close}) =>{
224
- close()
225
- state.loading = true
226
- await getRemoteFlagInfo(true)
227
- state.loading = false
228
- }
229
- })
230
- }}
234
+ <TouchableOpacity style={{ paddingRight: cx(24) }}
235
+ onPress={() => {
236
+ showDialog({
237
+ method: 'confirm',
238
+ title: I18n.getLang('flag_resetbutton'),
239
+ subTitle: I18n.getLang('flag_resetdescription'),
240
+ onConfirm: async (_, { close }) => {
241
+ close()
242
+ state.loading = true
243
+ await getRemoteFlagInfo(true)
244
+ state.loading = false
245
+ }
246
+ })
247
+ }}
231
248
  >
232
- <Image source={res.ic_refresh} style={{width: cx(24), height: cx(24), tintColor: props.theme.global.fontColor}}/>
249
+ <Image source={res.ic_refresh} style={{ width: cx(24), height: cx(24), tintColor: props.theme?.global.fontColor }} />
233
250
  </TouchableOpacity>
234
251
  </View>
235
252
  <FlatList
236
253
  data={state.flags}
237
254
  renderItem={({ item }) => <FlagItem
238
- enable={flagMode?.flagMode && dps[params.workModeCode] === (params.isCeilingLight ? WORK_MODE.WHITE : params.isStripLight ? WORK_MODE.COLOUR : WORK_MODE.SCENE) && flagId === item.id && dps[params.switchLedCode]}
255
+ enable={getItemEnable(item)}
239
256
  title={item.name}
240
257
  icon={item.icon}
241
258
  colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v)).reverse()}
@@ -243,8 +260,9 @@ const FlagPage = (props: { theme?: any }) => {
243
260
  if (enable) {
244
261
  state.loading = true
245
262
  await setFlag(item)
263
+ await setSceneStatusId(item.id)
246
264
  const flagHash = fnv1aHash(JSON.stringify(item.colors))
247
- if (defFlagHash[flagHash]){
265
+ if (defFlagHash[flagHash]) {
248
266
  NativeApi.putFlagFirebase({
249
267
  country_flag: defFlagHash[flagHash].EN,
250
268
  id: defFlagHash[flagHash].id
@@ -12,6 +12,7 @@ import { isEmpty } from 'lodash'
12
12
  import Tag from "@ledvance/base/src/components/Tag"
13
13
  import { exportHistoryFile } from '@ledvance/base/src/utils/common'
14
14
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
15
+ import ThemeType from '@ledvance/base/src/config/themeType'
15
16
 
16
17
  const cx = Utils.RatioUtils.convertX
17
18
  const { withTheme } = Utils.ThemeUtils
@@ -25,7 +26,7 @@ export type SwitchHistoryPageRouteParams = {
25
26
  getActionsText: (dpData: any) => I18nKey
26
27
  }
27
28
 
28
- const SwitchHistoryPage = (props: { theme?: any }) => {
29
+ const SwitchHistoryPage = (props: { theme?: ThemeType }) => {
29
30
  const deviceInfo = useDeviceInfo()
30
31
  const { dpIds, tags, headlineText, backText, showLimit, getActionsText } = useParams<SwitchHistoryPageRouteParams>()
31
32
 
@@ -101,16 +102,16 @@ const SwitchHistoryPage = (props: { theme?: any }) => {
101
102
  listEmptyTextIcon: {
102
103
  width: cx(16),
103
104
  height: cx(16),
104
- tintColor: props.theme.global.fontColor,
105
+ tintColor: props.theme?.global.fontColor,
105
106
  },
106
107
  listEmptyText: {
107
- color: props.theme.global.fontColor,
108
+ color: props.theme?.global.fontColor,
108
109
  fontSize: cx(12),
109
110
  fontFamily: 'helvetica_neue_lt_std_roman',
110
111
  },
111
112
  titleText: {
112
113
  marginHorizontal: cx(24),
113
- color: props.theme.global.fontColor,
114
+ color: props.theme?.global.fontColor,
114
115
  fontSize: cx(16),
115
116
  fontFamily: 'helvetica_neue_lt_std_roman',
116
117
  },
@@ -118,7 +119,7 @@ const SwitchHistoryPage = (props: { theme?: any }) => {
118
119
  marginHorizontal: cx(24),
119
120
  },
120
121
  switchHistoryItemTitle: {
121
- color: props.theme.global.fontColor,
122
+ color: props.theme?.global.fontColor,
122
123
  fontSize: cx(18),
123
124
  fontFamily: 'helvetica_neue_lt_std_bd',
124
125
  },
@@ -136,31 +137,31 @@ const SwitchHistoryPage = (props: { theme?: any }) => {
136
137
  switchHistoryItemActionItemLine: {
137
138
  width: cx(1),
138
139
  flex: 1,
139
- backgroundColor: props.theme.container.divider,
140
+ backgroundColor: props.theme?.container.divider,
140
141
  },
141
142
  switchHistoryItemActionItemPoint: {
142
143
  width: cx(7),
143
144
  height: cx(7),
144
- backgroundColor: props.theme.icon.primary,
145
+ backgroundColor: props.theme?.icon.primary,
145
146
  borderRadius: cx(4),
146
147
  position: 'absolute',
147
148
  top: '50%',
148
149
  transform: [{ translateY: cx(-3) }]
149
150
  },
150
151
  switchHistoryItemActionItemText: {
151
- color: props.theme.global.fontColor,
152
+ color: props.theme?.global.fontColor,
152
153
  fontSize: cx(16),
153
154
  fontFamily: 'helvetica_neue_lt_std_roman',
154
155
  },
155
156
  switchHistoryItemTag: {
156
157
  paddingHorizontal: cx(10),
157
158
  borderRadius: cx(10),
158
- backgroundColor: props.theme.tag.background,
159
+ backgroundColor: props.theme?.tag.background,
159
160
  marginLeft: cx(5),
160
161
  },
161
162
  switchHistoryItemTagText: {
162
163
  fontSize: cx(14),
163
- color: props.theme.tag.fontColor
164
+ color: props.theme?.tag.fontColor
164
165
  }
165
166
  })
166
167
 
@@ -8,7 +8,7 @@ import { useCreation, useReactive } from 'ahooks'
8
8
  import I18n from '@ledvance/base/src/i18n'
9
9
  import Spacer from '@ledvance/base/src/components/Spacer'
10
10
  import RecommendMixMoodItem from './RecommendMixMoodItem'
11
- import { SceneNodeTransitionMode } from '@ledvance/ui-biz-bundle/src/modules/scene/SceneInfo'
11
+ import { SceneNodeTransitionMode } from '../../scene/SceneInfo'
12
12
  import { ui_biz_routerKey } from '../../../navigation/Routers'
13
13
  import { difference, head, map, range } from 'lodash'
14
14
  import { Result } from '@ledvance/base/src/models/modules/Result'
@@ -245,4 +245,4 @@ const styles = StyleSheet.create({
245
245
  },
246
246
  })
247
247
 
248
- export default AddMixMoodPage
248
+ export default AddMixMoodPage
@@ -20,7 +20,7 @@ import { MixSceneInfo, MixMainLampInfo, MixSceneNodeInfo } from './MixSceneBeans
20
20
  import TextFieldStyleButton from '@ledvance/base/src/components/TextFieldStyleButton'
21
21
  import { SelectPageParams } from '../../select/SelectPage'
22
22
  import { ui_biz_routerKey } from '../../../navigation/Routers'
23
- import { MixMoodPageProps } from '@ledvance/ui-biz-bundle/src/modules/mood/MixMood/MixMoodPage'
23
+ import { MixMoodPageProps } from './MixMoodPage'
24
24
  import Segmented from '@ledvance/base/src/components/Segmented'
25
25
  import LdvSwitch from '@ledvance/base/src/components/ldvSwitch'
26
26
  import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView'
@@ -579,9 +579,9 @@ const RgbcMoodEditPage = () => {
579
579
  subTitle: I18n.getLang('strip_light_static_mood_edit_dialog_text'),
580
580
  onConfirm: async (_, { close }) => {
581
581
  close()
582
- state.loading = true
582
+ state.loading = true
583
583
  const res = await params.modDeleteFlag('del', state.mood)
584
- state.loading = false
584
+ state.loading = false
585
585
  if(res.success){
586
586
  navigation.navigate(ui_biz_routerKey.ui_biz_mix_mood)
587
587
  }
@@ -719,4 +719,4 @@ export const defColorNode: StripNodeInfo[] = [
719
719
  { h: 0, s: 100, v: 100, brightness: 0, colorTemp: 0, isColorNode: true },
720
720
  ]
721
721
 
722
- export default RgbcMoodEditPage
722
+ export default RgbcMoodEditPage
@@ -17,7 +17,7 @@ import { MixSceneInfo, MixMainLampInfo } from './MixSceneBeans'
17
17
  import { SceneInfo } from '../../scene/SceneInfo'
18
18
  import MixMoodItem from './MixMoodItem'
19
19
  import { useNavigation, useRoute } from '@react-navigation/core'
20
- import { saveFlagMode } from '@ledvance/ui-biz-bundle/src/modules/flags/FlagActions'
20
+ import { saveFlagMode } from '../../flags/FlagActions'
21
21
  import { ui_biz_routerKey } from '../../../navigation/Routers'
22
22
  import { WORK_MODE } from '@tuya/tuya-panel-lamp-sdk/lib/utils'
23
23
  import { cloneDeep } from 'lodash'
@@ -206,7 +206,7 @@ const MixMoodPage = () => {
206
206
  state.scenes = cloneDeep(list)
207
207
  return { success: true }
208
208
  }
209
-
209
+
210
210
  return { success: false }
211
211
  }
212
212
 
@@ -252,7 +252,7 @@ const MixMoodPage = () => {
252
252
  renderItem={({ item }) => {
253
253
  return (
254
254
  <MixMoodItem
255
- enable={checkedCurMoodInAllMoods(item) && isMoodMode}
255
+ enable={checkedCurMoodInAllMoods(item) && isMoodMode}
256
256
  mixMood={item}
257
257
  onPress={() => {
258
258
  navigation.navigate(ui_biz_routerKey.ui_biz_mix_mood_edit, {
@@ -324,4 +324,4 @@ const styles = StyleSheet.create({
324
324
  },
325
325
  })
326
326
 
327
- export default MixMoodPage
327
+ export default MixMoodPage
@@ -15,9 +15,11 @@ import { JudgeTimeScheduleProps } from "../timeSchedule/TimeScheduleBean"
15
15
  import Spacer from '@ledvance/base/src/components/Spacer'
16
16
  import LdvSlider from '@ledvance/base/src/components/ldvSlider'
17
17
  import TextFieldStyleButton from '@ledvance/base/src/components/TextFieldStyleButton'
18
- import { SelectPageParams } from '@ledvance/ui-biz-bundle/src/modules/select/SelectPage'
19
- import { ui_biz_routerKey } from '@ledvance/ui-biz-bundle/src/navigation/Routers'
18
+ import { SelectPageParams } from '../select/SelectPage'
19
+ import { ui_biz_routerKey } from '../../navigation/Routers'
20
20
  import { cloneDeep } from 'lodash'
21
+ import ThemeType from '@ledvance/base/src/config/themeType'
22
+
21
23
  const { convertX: cx } = Utils.RatioUtils
22
24
  const { withTheme } = Utils.ThemeUtils
23
25
 
@@ -30,7 +32,7 @@ export interface MusicPageRouterParams extends JudgeTimeScheduleProps {
30
32
  dreamMusicDp?: string
31
33
  }
32
34
 
33
- const MusicPage = (props: { theme?: any }) => {
35
+ const MusicPage = (props: { theme?: ThemeType }) => {
34
36
  const deviceInfo = useDeviceInfo()
35
37
  const deviceId = useDeviceId()
36
38
  const navigation = useNavigation()
@@ -243,7 +245,7 @@ const MusicPage = (props: { theme?: any }) => {
243
245
  marginBottom: cx(24)
244
246
  },
245
247
  tiptext: {
246
- color: props.theme.global.fontColor,
248
+ color: props.theme?.global.fontColor,
247
249
  fontSize: cx(14),
248
250
  lineHeight: cx(14),
249
251
  }
@@ -284,10 +286,10 @@ const MusicPage = (props: { theme?: any }) => {
284
286
  {params.dreamMusicDp && <TabBar
285
287
  type='radio'
286
288
  tabs={musicTabs}
287
- style={{ borderRadius: cx(8), backgroundColor: props.theme.segment.background, height: cx(36) }}
288
- tabTextStyle={{ color: props.theme.segment.fontColor, fontSize: cx(14) }}
289
- tabActiveTextStyle={{ color: props.theme.segment.fontColor, fontSize: cx(14), fontWeight: 'bold' }}
290
- activeColor={props.theme.segment.active}
289
+ style={{ borderRadius: cx(8), backgroundColor: props.theme?.segment.background, height: cx(36) }}
290
+ tabTextStyle={{ color: props.theme?.segment.fontColor, fontSize: cx(14) }}
291
+ tabActiveTextStyle={{ color: props.theme?.segment.fontColor, fontSize: cx(14), fontWeight: 'bold' }}
292
+ activeColor={props.theme?.segment.active}
291
293
  activeKey={state.musicType}
292
294
  onChange={async (v) => {
293
295
  state.musicType = Number(v)
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from "react";
2
2
  import LampAdjustView from "@ledvance/base/src/components/LampAdjustView";
3
- import { JudgeTimeScheduleProps } from "@ledvance/ui-biz-bundle/src/modules/timeSchedule/TimeScheduleBean";
3
+ import { JudgeTimeScheduleProps } from "../timeSchedule/TimeScheduleBean";
4
4
  import MixLightView from "../timeSchedule/mix/MixLightView";
5
5
  import Card from "@ledvance/base/src/components/Card";
6
6
  import LdvSwitch from "@ledvance/base/src/components/ldvSwitch";
@@ -64,11 +64,11 @@ const DeviceState = (props: DeviceStateProps) => {
64
64
  props.isMixRGBWLamp ?
65
65
  <MixLightView
66
66
  mixActions={props.mixActions}
67
- setSendDps={(v) => props.editMixFn(v)}
67
+ setSendDps={(v) => props.editMixFn(v)}
68
68
  mutuallyExclusive={true}
69
69
  /> :
70
70
  <Card style={{marginHorizontal: cx(24)}}>
71
- <LdvSwitch
71
+ <LdvSwitch
72
72
  title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
73
73
  color={getColorBlockColor()}
74
74
  colorAlpha={1}
@@ -97,4 +97,4 @@ const DeviceState = (props: DeviceStateProps) => {
97
97
  )
98
98
  }
99
99
 
100
- export default DeviceState
100
+ export default DeviceState
@@ -18,7 +18,7 @@ import { JudgeTimeScheduleProps } from "../timeSchedule/TimeScheduleBean";
18
18
  import { useSleepPlan, useWakeUpPlan } from "./SleepWakeUpActions";
19
19
  import { ui_biz_routerKey } from "../../navigation/Routers";
20
20
  import { findConflicts } from '@ledvance/base/src/utils/loopsCompare'
21
- import { useBiorhythm } from '@ledvance/ui-biz-bundle/src/modules/biorhythm/BiorhythmActions'
21
+ import { useBiorhythm } from '../biorhythm/BiorhythmActions'
22
22
  import { cloneDeep } from "lodash";
23
23
 
24
24
  const cx = Utils.RatioUtils.convertX
@@ -422,4 +422,4 @@ const styles = StyleSheet.create({
422
422
  },
423
423
  })
424
424
 
425
- export default SleepWakeUpPage
425
+ export default SleepWakeUpPage