@ledvance/ui-biz-bundle 1.1.46 → 1.1.49
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
|
@@ -162,9 +162,17 @@ const FlagPage = () => {
|
|
|
162
162
|
if (res.success) {
|
|
163
163
|
state.flags = cloneDeep(newScene)
|
|
164
164
|
setFlags(cloneDeep(newScene))
|
|
165
|
-
if(mode === 'del'
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
if(mode === 'del'){
|
|
166
|
+
const isDrawTool = !!(params.isCeilingLight || params.isStripLight)
|
|
167
|
+
if(!isDrawTool && (dps[params.workModeCode] !== WORK_MODE.SCENE || currentMood.id !== flagId)){
|
|
168
|
+
return {
|
|
169
|
+
success: true
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if(isDrawTool && !flagMode.flagMode){
|
|
173
|
+
return {
|
|
174
|
+
success: true
|
|
175
|
+
}
|
|
168
176
|
}
|
|
169
177
|
}
|
|
170
178
|
if(mood){
|
|
@@ -225,7 +233,7 @@ const FlagPage = () => {
|
|
|
225
233
|
enable={flagMode?.flagMode && dps[params.workModeCode] === (params.isCeilingLight ? WORK_MODE.WHITE : params.isStripLight ? WORK_MODE.COLOUR : WORK_MODE.SCENE) && flagId === item.id}
|
|
226
234
|
title={item.name}
|
|
227
235
|
icon={item.icon}
|
|
228
|
-
colors={
|
|
236
|
+
colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v)).reverse()}
|
|
229
237
|
onSwitch={async (enable) => {
|
|
230
238
|
if (enable) {
|
|
231
239
|
await setFlag(item)
|
|
@@ -133,6 +133,27 @@ const FantasyMoodEditPage = () => {
|
|
|
133
133
|
routeParams.onSave()
|
|
134
134
|
}, [params.moods])
|
|
135
135
|
|
|
136
|
+
const onPreview = async () => {
|
|
137
|
+
const maxModeObject = maxBy(params.moods, 'id');
|
|
138
|
+
const currentMood = {
|
|
139
|
+
...state.mood,
|
|
140
|
+
nodes: state.mood.nodes.map(node => {
|
|
141
|
+
if (node.isColorNode) {
|
|
142
|
+
node.brightness = 0;
|
|
143
|
+
node.colorTemp = 0;
|
|
144
|
+
} else {
|
|
145
|
+
node.h = 0
|
|
146
|
+
node.s = 0
|
|
147
|
+
node.v = 0
|
|
148
|
+
}
|
|
149
|
+
return node
|
|
150
|
+
}),
|
|
151
|
+
id: params.mode === 'add' ? maxModeObject && maxModeObject.id > 200 ? maxModeObject.id + 1 : 201 : state.mood.id
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
await setFantasyScene(currentMood)
|
|
155
|
+
}
|
|
156
|
+
|
|
136
157
|
const createSelectModeData = useCallback(() => {
|
|
137
158
|
return Object.values(state.sceneMode).map(scene => {
|
|
138
159
|
return {
|
|
@@ -154,7 +175,7 @@ const FantasyMoodEditPage = () => {
|
|
|
154
175
|
}, [state.mood.expand])
|
|
155
176
|
|
|
156
177
|
const getSelectOther = useCallback((otherData) =>{
|
|
157
|
-
const currentOther = otherData.find(other => other.value === state.mood.expand)
|
|
178
|
+
const currentOther = otherData.find(other => other.value === state.mood.expand)
|
|
158
179
|
return currentOther.label
|
|
159
180
|
}, [state.mood.expand])
|
|
160
181
|
|
|
@@ -212,10 +233,11 @@ const FantasyMoodEditPage = () => {
|
|
|
212
233
|
errorText={I18n.getLang(nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text')} />
|
|
213
234
|
<Card style={styles.adjustCard}>
|
|
214
235
|
<Spacer height={cx(16)} />
|
|
215
|
-
<View style={styles.
|
|
236
|
+
<View style={styles.lightPreviewLine}>
|
|
216
237
|
<Text style={styles.light}>
|
|
217
238
|
{I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
218
239
|
</Text>
|
|
240
|
+
<TextButton text={I18n.getLang('mood_preview')} onPress={onPreview} />
|
|
219
241
|
</View>
|
|
220
242
|
<Spacer height={cx(18)} />
|
|
221
243
|
<TextFieldStyleButton
|
|
@@ -256,7 +278,7 @@ const FantasyMoodEditPage = () => {
|
|
|
256
278
|
]}
|
|
257
279
|
onChange={(v) => state.mood.direction = Number(v)}
|
|
258
280
|
/>
|
|
259
|
-
<Spacer />
|
|
281
|
+
<Spacer />
|
|
260
282
|
</View>}
|
|
261
283
|
{state.sceneMode[state.mood.mode]?.paragraph && <View style={styles.transitionMode}>
|
|
262
284
|
<Segmented
|
|
@@ -478,8 +500,14 @@ const styles = StyleSheet.create({
|
|
|
478
500
|
marginHorizontal: cx(24),
|
|
479
501
|
},
|
|
480
502
|
lightLine: {
|
|
503
|
+
flexDirection: 'row',
|
|
504
|
+
marginHorizontal: cx(16)
|
|
505
|
+
},
|
|
506
|
+
lightPreviewLine: {
|
|
481
507
|
flexDirection: 'row',
|
|
482
508
|
marginHorizontal: cx(16),
|
|
509
|
+
justifyContent: 'space-between',
|
|
510
|
+
alignItems: 'center'
|
|
483
511
|
},
|
|
484
512
|
light: {
|
|
485
513
|
color: '#000',
|
|
@@ -553,4 +581,4 @@ const styles = StyleSheet.create({
|
|
|
553
581
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
554
582
|
},
|
|
555
583
|
})
|
|
556
|
-
export default FantasyMoodEditPage
|
|
584
|
+
export default FantasyMoodEditPage
|
|
@@ -93,7 +93,7 @@ export interface StripLightSceneMode {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export const CeilingLightSceneMode: StripLightSceneMode = {
|
|
96
|
-
'1': { title: I18n.getLang('strip_lights_modes_flash_text'), mode: 1 },
|
|
96
|
+
'1': { title: I18n.getLang('strip_lights_modes_flash_text'), mode: 1 },
|
|
97
97
|
'2': { title: I18n.getLang('strip_lights_modes_breath_text'), mode: 2 },
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -115,10 +115,11 @@ export const stripLightSceneMode: StripLightSceneMode = {
|
|
|
115
115
|
'4': { title: I18n.getLang('string_lights_modes_blink_text'), mode: 4, paragraph: true }, // 闪烁
|
|
116
116
|
'10': { title: I18n.getLang('strip_lights_modes_flow_text'), mode: 10, turnOn: true }, // 流水
|
|
117
117
|
'11': { title: I18n.getLang('strip_lights_modes_rainbow_text'), mode: 11, turnOn: true }, // 彩虹
|
|
118
|
-
'5': {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
'5': {
|
|
119
|
+
title: I18n.getLang('strip_lights_modes_meteor_text'), mode: 5, turnOn: true, other: [
|
|
120
|
+
{ label: I18n.getLang('strip_lights_modes_meteor_text'), value: 0 },
|
|
121
|
+
{ label: I18n.getLang('add_new_dynamic_mood_strip_lights_selectionfield2_value_text'), value: 1 },
|
|
122
|
+
{ label: I18n.getLang('strip_lights_modes_magic_meteor'), value: 2 }]
|
|
122
123
|
}, // 流星
|
|
123
124
|
'6': { title: I18n.getLang('strip_lights_modes_pileup_text'), mode: 6, turnOn: true, paragraph: true }, // 堆积
|
|
124
125
|
'7': { title: I18n.getLang('strip_lights_modes_fall_text'), mode: 7, turnOn: true, paragraph: true }, // 飘落
|
|
@@ -128,9 +129,10 @@ export const stripLightSceneMode: StripLightSceneMode = {
|
|
|
128
129
|
'13': { title: I18n.getLang('strip_lights_modes_rebound_text'), mode: 13, other: [{ label: I18n.getLang('strip_lights_modes_rebound_text'), value: 0 }, { label: I18n.getLang('strip_lights_modes_magic_rebound_text'), value: 1 }] }, // 反弹
|
|
129
130
|
'14': { title: I18n.getLang('strip_lights_modes_shuttle_text'), mode: 14, }, // 穿梭
|
|
130
131
|
'15': { title: I18n.getLang('strip_lights_modes_random_text'), mode: 15 }, // 乱闪
|
|
131
|
-
'16': {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
'16': {
|
|
133
|
+
title: I18n.getLang('strip_lights_modes_switch_text'), mode: 16, other: [
|
|
134
|
+
{ label: I18n.getLang('add_new_dynamic_mood_strip_lights_switch_tab_text5'), value: 0 },
|
|
135
|
+
{ label: I18n.getLang('add_new_dynamic_mood_strip_lights_switch_tab_text6'), value: 1 }]
|
|
134
136
|
} // 开合
|
|
135
137
|
}
|
|
136
138
|
|
|
@@ -321,13 +323,6 @@ function getOnlyRGBDefSceneList(): RemoteSceneInfo[] {
|
|
|
321
323
|
t: 0,
|
|
322
324
|
e: false,
|
|
323
325
|
},
|
|
324
|
-
{
|
|
325
|
-
n: I18n.getLang('mesh_device_detail_lighting_read'),
|
|
326
|
-
i: '010e0d000084000003e800000000',
|
|
327
|
-
s: '',
|
|
328
|
-
t: 0,
|
|
329
|
-
e: false,
|
|
330
|
-
},
|
|
331
326
|
{
|
|
332
327
|
n: I18n.getLang('mesh_device_detail_lighting_work'),
|
|
333
328
|
i: '020e0d00001403e803e800000000',
|
|
@@ -349,13 +344,6 @@ function getOnlyRGBDefSceneList(): RemoteSceneInfo[] {
|
|
|
349
344
|
t: 0,
|
|
350
345
|
e: false,
|
|
351
346
|
},
|
|
352
|
-
{
|
|
353
|
-
n: I18n.getLang('mesh_device_detail_lighting_white_mode'),
|
|
354
|
-
i: '0646460100000000000003e8000046460100000000000003e8019046460100000000000003e803e8',
|
|
355
|
-
s: '',
|
|
356
|
-
t: 0,
|
|
357
|
-
e: false,
|
|
358
|
-
},
|
|
359
347
|
...defColorSceneList
|
|
360
348
|
]
|
|
361
349
|
}
|
|
@@ -50,7 +50,7 @@ const MoodSetting = (props: MoodSettingProps) => {
|
|
|
50
50
|
getRemoteFantasyScene(fantasyFeatureId, devId, { isStringLight, isStripLight }).then(res => {
|
|
51
51
|
if (res.success && res.data) {
|
|
52
52
|
state.scenes = res.data
|
|
53
|
-
setMoods(res.data)
|
|
53
|
+
setMoods(cloneDeep(res.data))
|
|
54
54
|
if (isEmpty(actionScene)) state.currentScene = res.data[0]
|
|
55
55
|
setSendDps(state.currentScene, 'actionScene')
|
|
56
56
|
}
|
|
@@ -225,4 +225,4 @@ const styles = StyleSheet.create({
|
|
|
225
225
|
},
|
|
226
226
|
})
|
|
227
227
|
|
|
228
|
-
export default memo(MoodSetting)
|
|
228
|
+
export default memo(MoodSetting)
|