@ledvance/ui-biz-bundle 1.1.87 → 1.1.89
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/modules/flags/FlagHash.ts +346 -0
- package/src/modules/flags/FlagPage.tsx +10 -2
- package/src/modules/history/HistoryPage.tsx +233 -223
- package/src/modules/history/SwitchHistoryPageActions.ts +5 -5
- package/src/modules/timer/TimerPage.tsx +2 -2
- package/src/modules/timer/TimerPageAction.ts +2 -2
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +1 -1
- package/src/newModules/biorhythm/BiorhythmPage.tsx +1 -1
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +5 -5
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +4 -4
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +1 -1
- package/src/newModules/energyConsumption/component/Overview.tsx +1 -1
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +9 -11
- package/src/newModules/mood/MoodActions.ts +13 -6
- package/src/newModules/mood/MoodInfo.ts +170 -18
- package/src/newModules/mood/MoodPage.tsx +69 -53
- package/src/newModules/mood/StaticMoodEditorPage.tsx +8 -0
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +2 -1
- package/src/newModules/randomTime/RandomTimePage.tsx +1 -1
- package/src/newModules/sleepWakeUp/Interface.ts +2 -0
- package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +21 -6
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +10 -33
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +4 -3
- package/src/newModules/swithInching/SwithInching.tsx +4 -4
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +1 -1
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
export function fnv1aHash(str: string): number {
|
|
2
|
+
let hash = 2166136261;
|
|
3
|
+
for (let i = 0; i < str.length; i++) {
|
|
4
|
+
hash ^= str.charCodeAt(i);
|
|
5
|
+
hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);
|
|
6
|
+
}
|
|
7
|
+
return hash >>> 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const defFlagHash = {
|
|
11
|
+
"66098761": {
|
|
12
|
+
"id": 196,
|
|
13
|
+
"EN": "Colombia",
|
|
14
|
+
i18nKey: 'country_CO'
|
|
15
|
+
},
|
|
16
|
+
"81070731": {
|
|
17
|
+
"id": 210,
|
|
18
|
+
"EN": "El Salvador",
|
|
19
|
+
i18nKey: 'country_SV'
|
|
20
|
+
},
|
|
21
|
+
"149323814": {
|
|
22
|
+
"id": 171,
|
|
23
|
+
"EN": "Uganda",
|
|
24
|
+
i18nKey: 'country_UG'
|
|
25
|
+
},
|
|
26
|
+
"151203979": {
|
|
27
|
+
"id": 251,
|
|
28
|
+
"EN": "Scotland",
|
|
29
|
+
i18nKey: 'country_scotland'
|
|
30
|
+
},
|
|
31
|
+
"165006235": {
|
|
32
|
+
"id": 218,
|
|
33
|
+
"EN": "Argentina",
|
|
34
|
+
i18nKey: 'country_AR'
|
|
35
|
+
},
|
|
36
|
+
"194878605": {
|
|
37
|
+
"id": 221,
|
|
38
|
+
"EN": "Australia",
|
|
39
|
+
i18nKey: 'country_AU'
|
|
40
|
+
},
|
|
41
|
+
"201242100": {
|
|
42
|
+
"id": 252,
|
|
43
|
+
"EN": "Portugal",
|
|
44
|
+
i18nKey: 'country_PT'
|
|
45
|
+
},
|
|
46
|
+
"222901821": {
|
|
47
|
+
"id": 197,
|
|
48
|
+
"EN": "Kenya",
|
|
49
|
+
i18nKey: 'country_KE'
|
|
50
|
+
},
|
|
51
|
+
"289695406": {
|
|
52
|
+
"id": 188,
|
|
53
|
+
"EN": "Malta",
|
|
54
|
+
i18nKey: 'country_MT'
|
|
55
|
+
},
|
|
56
|
+
"301529279": {
|
|
57
|
+
"id": 238,
|
|
58
|
+
"EN": "Italy",
|
|
59
|
+
i18nKey: 'country_IT'
|
|
60
|
+
},
|
|
61
|
+
"346083900": {
|
|
62
|
+
"id": 219,
|
|
63
|
+
"EN": "Brazil",
|
|
64
|
+
i18nKey: 'country_BR'
|
|
65
|
+
},
|
|
66
|
+
"366387328": {
|
|
67
|
+
"id": 187,
|
|
68
|
+
"EN": "Morocco",
|
|
69
|
+
i18nKey: 'country_MA'
|
|
70
|
+
},
|
|
71
|
+
"486106676": {
|
|
72
|
+
"id": 223,
|
|
73
|
+
"EN": "Saudi Arabia",
|
|
74
|
+
i18nKey: 'country_SA'
|
|
75
|
+
},
|
|
76
|
+
"502179744": {
|
|
77
|
+
"id": 241,
|
|
78
|
+
"EN": "Romania",
|
|
79
|
+
i18nKey: 'country_RO'
|
|
80
|
+
},
|
|
81
|
+
"662396822": {
|
|
82
|
+
"id": 176,
|
|
83
|
+
"EN": "Russia",
|
|
84
|
+
i18nKey: 'country_RU'
|
|
85
|
+
},
|
|
86
|
+
"755911901": {
|
|
87
|
+
"id": 192,
|
|
88
|
+
"EN": "Libya",
|
|
89
|
+
i18nKey: 'country_LY'
|
|
90
|
+
},
|
|
91
|
+
"756811327": {
|
|
92
|
+
"id": 199,
|
|
93
|
+
"EN": "Cyprus",
|
|
94
|
+
i18nKey: 'country_CY'
|
|
95
|
+
},
|
|
96
|
+
"808440946": {
|
|
97
|
+
"id": 245,
|
|
98
|
+
"EN": "Slovakia",
|
|
99
|
+
i18nKey: 'country_SK'
|
|
100
|
+
},
|
|
101
|
+
"903099198": {
|
|
102
|
+
"id": 194,
|
|
103
|
+
"EN": "Cuba",
|
|
104
|
+
i18nKey: 'country_cu'
|
|
105
|
+
},
|
|
106
|
+
"906034457": {
|
|
107
|
+
"id": 213,
|
|
108
|
+
"EN": "Bolivia",
|
|
109
|
+
i18nKey: 'country_BO'
|
|
110
|
+
},
|
|
111
|
+
"965148539": {
|
|
112
|
+
"id": 240,
|
|
113
|
+
"EN": "Switzerland",
|
|
114
|
+
i18nKey: 'country_CH'
|
|
115
|
+
},
|
|
116
|
+
"1106195532": {
|
|
117
|
+
"id": 231,
|
|
118
|
+
"EN": "Bayer 04 Leverkusen",
|
|
119
|
+
i18nKey: 'flag_leverkusen'
|
|
120
|
+
},
|
|
121
|
+
"1280053156": {
|
|
122
|
+
"id": 185,
|
|
123
|
+
"EN": "Namibia",
|
|
124
|
+
i18nKey: 'country_NA'
|
|
125
|
+
},
|
|
126
|
+
"1310991704": {
|
|
127
|
+
"id": 175,
|
|
128
|
+
"EN": "South Africa",
|
|
129
|
+
i18nKey: 'country_ZA'
|
|
130
|
+
},
|
|
131
|
+
"1353047229": {
|
|
132
|
+
"id": 191,
|
|
133
|
+
"EN": "Lithuania",
|
|
134
|
+
i18nKey: 'country_LT'
|
|
135
|
+
},
|
|
136
|
+
"1376193431": {
|
|
137
|
+
"id": 190,
|
|
138
|
+
"EN": "Luxembourg",
|
|
139
|
+
i18nKey: 'country_LU'
|
|
140
|
+
},
|
|
141
|
+
"1430100020": {
|
|
142
|
+
"id": 244,
|
|
143
|
+
"EN": "Albania",
|
|
144
|
+
i18nKey: 'country_AL'
|
|
145
|
+
},
|
|
146
|
+
"1531080660": {
|
|
147
|
+
"id": 202,
|
|
148
|
+
"EN": "Iran",
|
|
149
|
+
i18nKey: 'country_ir'
|
|
150
|
+
},
|
|
151
|
+
"1539292971": {
|
|
152
|
+
"id": 169,
|
|
153
|
+
"EN": "Venezuela",
|
|
154
|
+
i18nKey: 'country_VE'
|
|
155
|
+
},
|
|
156
|
+
"1546646355": {
|
|
157
|
+
"id": 234,
|
|
158
|
+
"EN": "Sweden",
|
|
159
|
+
i18nKey: 'country_SE'
|
|
160
|
+
},
|
|
161
|
+
"1556409901": {
|
|
162
|
+
"id": 220,
|
|
163
|
+
"EN": "Japan",
|
|
164
|
+
i18nKey: 'country_JP'
|
|
165
|
+
},
|
|
166
|
+
"1662232150": {
|
|
167
|
+
"id": 230,
|
|
168
|
+
"EN": "Ukraine",
|
|
169
|
+
i18nKey: 'country_UA'
|
|
170
|
+
},
|
|
171
|
+
"1689942684": {
|
|
172
|
+
"id": 222,
|
|
173
|
+
"EN": "United Arab Emirates",
|
|
174
|
+
i18nKey: 'country_AE'
|
|
175
|
+
},
|
|
176
|
+
"1703364329": {
|
|
177
|
+
"id": 224,
|
|
178
|
+
"EN": "Mexico",
|
|
179
|
+
i18nKey: 'country_MX'
|
|
180
|
+
},
|
|
181
|
+
"1874167468": {
|
|
182
|
+
"id": 246,
|
|
183
|
+
"EN": "Hungary",
|
|
184
|
+
i18nKey: 'country_HU'
|
|
185
|
+
},
|
|
186
|
+
"1890782205": {
|
|
187
|
+
"id": 208,
|
|
188
|
+
"EN": "Ghana",
|
|
189
|
+
i18nKey: 'country_GH'
|
|
190
|
+
},
|
|
191
|
+
"2055517010": {
|
|
192
|
+
"id": 173,
|
|
193
|
+
"EN": "Thailand",
|
|
194
|
+
i18nKey: 'country_TH'
|
|
195
|
+
},
|
|
196
|
+
"2057461151": {
|
|
197
|
+
"id": 228,
|
|
198
|
+
"EN": "Ireland",
|
|
199
|
+
i18nKey: ''
|
|
200
|
+
},
|
|
201
|
+
"2294762822": {
|
|
202
|
+
"id": 214,
|
|
203
|
+
"EN": "Barbados",
|
|
204
|
+
i18nKey: 'country_IE'
|
|
205
|
+
},
|
|
206
|
+
"2311243158": {
|
|
207
|
+
"id": 242,
|
|
208
|
+
"EN": "Netherlands",
|
|
209
|
+
i18nKey: 'country_NL'
|
|
210
|
+
},
|
|
211
|
+
"2537149279": {
|
|
212
|
+
"id": 239,
|
|
213
|
+
"EN": "Serbia",
|
|
214
|
+
i18nKey: 'country_RS'
|
|
215
|
+
},
|
|
216
|
+
"2598618314": {
|
|
217
|
+
"id": 206,
|
|
218
|
+
"EN": "Guatemala",
|
|
219
|
+
i18nKey: 'country_GT'
|
|
220
|
+
},
|
|
221
|
+
"2651034679": {
|
|
222
|
+
"id": 181,
|
|
223
|
+
"EN": "Palestine",
|
|
224
|
+
i18nKey: 'country_PS'
|
|
225
|
+
},
|
|
226
|
+
"2701401761": {
|
|
227
|
+
"id": 253,
|
|
228
|
+
"EN": "France",
|
|
229
|
+
i18nKey: 'country_FR'
|
|
230
|
+
},
|
|
231
|
+
"2781889007": {
|
|
232
|
+
"id": 250,
|
|
233
|
+
"EN": "Spain",
|
|
234
|
+
i18nKey: 'country_ES'
|
|
235
|
+
},
|
|
236
|
+
"2925431440": {
|
|
237
|
+
"id": 237,
|
|
238
|
+
"EN": "Czechia",
|
|
239
|
+
i18nKey: 'country_CZ'
|
|
240
|
+
},
|
|
241
|
+
"2966336072": {
|
|
242
|
+
"id": 235,
|
|
243
|
+
"EN": "Croatia",
|
|
244
|
+
i18nKey: ''
|
|
245
|
+
},
|
|
246
|
+
"3052274301": {
|
|
247
|
+
"id": 255,
|
|
248
|
+
"EN": "Germany",
|
|
249
|
+
i18nKey: 'country_HR'
|
|
250
|
+
},
|
|
251
|
+
"3352528673": {
|
|
252
|
+
"id": 254,
|
|
253
|
+
"EN": "Belgium",
|
|
254
|
+
i18nKey: 'country_BE'
|
|
255
|
+
},
|
|
256
|
+
"3439765973": {
|
|
257
|
+
"id": 170,
|
|
258
|
+
"EN": "Uruguay",
|
|
259
|
+
i18nKey: 'country_UY'
|
|
260
|
+
},
|
|
261
|
+
"3461550795": {
|
|
262
|
+
"id": 233,
|
|
263
|
+
"EN": "Norway",
|
|
264
|
+
i18nKey: 'country_NO'
|
|
265
|
+
},
|
|
266
|
+
"3504487531": {
|
|
267
|
+
"id": 179,
|
|
268
|
+
"EN": "Peru",
|
|
269
|
+
i18nKey: 'country_pe'
|
|
270
|
+
},
|
|
271
|
+
"3565420822": {
|
|
272
|
+
"id": 189,
|
|
273
|
+
"EN": "Madagascar",
|
|
274
|
+
i18nKey: 'country_MG'
|
|
275
|
+
},
|
|
276
|
+
"3730111035": {
|
|
277
|
+
"id": 216,
|
|
278
|
+
"EN": "Egypt",
|
|
279
|
+
i18nKey: 'country_EG'
|
|
280
|
+
},
|
|
281
|
+
"3782078155": {
|
|
282
|
+
"id": 249,
|
|
283
|
+
"EN": "Turkey",
|
|
284
|
+
i18nKey: 'country_TR'
|
|
285
|
+
},
|
|
286
|
+
"3838888999": {
|
|
287
|
+
"id": 182,
|
|
288
|
+
"EN": "Pakistan",
|
|
289
|
+
i18nKey: 'country_PK'
|
|
290
|
+
},
|
|
291
|
+
"3862071273": {
|
|
292
|
+
"id": 200,
|
|
293
|
+
"EN": "Jamaica",
|
|
294
|
+
i18nKey: 'country_JM'
|
|
295
|
+
},
|
|
296
|
+
"3969683553": {
|
|
297
|
+
"id": 186,
|
|
298
|
+
"EN": "Vietnam",
|
|
299
|
+
i18nKey: 'country_VN'
|
|
300
|
+
},
|
|
301
|
+
"4005462662": {
|
|
302
|
+
"id": 201,
|
|
303
|
+
"EN": "Iceland",
|
|
304
|
+
i18nKey: 'country_IS'
|
|
305
|
+
},
|
|
306
|
+
"4008493259": {
|
|
307
|
+
"id": 183,
|
|
308
|
+
"EN": "Nigeria",
|
|
309
|
+
i18nKey: 'country_NG'
|
|
310
|
+
},
|
|
311
|
+
"4035251111": {
|
|
312
|
+
"id": 195,
|
|
313
|
+
"EN": "Congo (Brazzaville)",
|
|
314
|
+
i18nKey: 'country_CG'
|
|
315
|
+
},
|
|
316
|
+
"4052911610": {
|
|
317
|
+
"id": 177,
|
|
318
|
+
"EN": "Puerto Rico",
|
|
319
|
+
i18nKey: 'country_PR'
|
|
320
|
+
},
|
|
321
|
+
"4157380582": {
|
|
322
|
+
"id": 236,
|
|
323
|
+
"EN": "Slovenia",
|
|
324
|
+
i18nKey: 'country_SI'
|
|
325
|
+
},
|
|
326
|
+
"4157856637": {
|
|
327
|
+
"id": 174,
|
|
328
|
+
"EN": "Syria",
|
|
329
|
+
i18nKey: 'country_sy'
|
|
330
|
+
},
|
|
331
|
+
"4254727995": {
|
|
332
|
+
"id": 184,
|
|
333
|
+
"EN": "New Zealand",
|
|
334
|
+
i18nKey: 'country_NZ'
|
|
335
|
+
},
|
|
336
|
+
"4257758714": {
|
|
337
|
+
"id": 172,
|
|
338
|
+
"EN": "Tunisia",
|
|
339
|
+
i18nKey: 'country_TN'
|
|
340
|
+
},
|
|
341
|
+
"4269289991": {
|
|
342
|
+
"id": 247,
|
|
343
|
+
"EN": "England",
|
|
344
|
+
i18nKey: 'country_england'
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -20,6 +20,8 @@ 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";
|
|
24
|
+
import { NativeApi } from "@ledvance/base/src/api/native";
|
|
23
25
|
const cx = Utils.RatioUtils.convertX
|
|
24
26
|
|
|
25
27
|
export interface FlagPageProps {
|
|
@@ -82,7 +84,6 @@ const FlagPage = () => {
|
|
|
82
84
|
return -1
|
|
83
85
|
}, [JSON.stringify(flagState), JSON.stringify(state.flags), flagMode])
|
|
84
86
|
|
|
85
|
-
console.log(flags, '< --- flags')
|
|
86
87
|
useEffect(() => {
|
|
87
88
|
if(!devInfo.devId) return
|
|
88
89
|
if(!flags?.length){
|
|
@@ -239,8 +240,15 @@ const FlagPage = () => {
|
|
|
239
240
|
colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v)).reverse()}
|
|
240
241
|
onSwitch={async (enable) => {
|
|
241
242
|
if (enable) {
|
|
242
|
-
state.loading = true
|
|
243
|
+
state.loading = true
|
|
243
244
|
await setFlag(item)
|
|
245
|
+
const flagHash = fnv1aHash(JSON.stringify(item.colors))
|
|
246
|
+
if (defFlagHash[flagHash]){
|
|
247
|
+
NativeApi.putFlagFirebase({
|
|
248
|
+
country_flag: defFlagHash[flagHash].EN,
|
|
249
|
+
id: defFlagHash[flagHash].id
|
|
250
|
+
}).then()
|
|
251
|
+
}
|
|
244
252
|
state.loading = false
|
|
245
253
|
updateFlagMode(true, item)
|
|
246
254
|
}
|