@ledvance/base 1.1.13 → 1.1.15

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 (65) hide show
  1. package/.prettierrc.js +0 -0
  2. package/package.json +1 -1
  3. package/src/api/native.d.ts +5 -0
  4. package/src/api/native.ts +193 -160
  5. package/src/api/nativeEventEmitter.ts +54 -54
  6. package/src/components/Card.tsx +25 -25
  7. package/src/components/Cell.tsx +32 -32
  8. package/src/components/ColorAdjustView.tsx +44 -44
  9. package/src/components/ColorTempAdjustView.tsx +37 -37
  10. package/src/components/ColorsLine.d.ts +7 -0
  11. package/src/components/ColorsLine.tsx +48 -0
  12. package/src/components/DeleteButton.d.ts +1 -1
  13. package/src/components/DeleteButton.tsx +27 -27
  14. package/src/components/Dialog.tsx +28 -28
  15. package/src/components/FanAdjustView.tsx +115 -105
  16. package/src/components/InfoText.tsx +29 -29
  17. package/src/components/LampAdjustView.tsx +52 -52
  18. package/src/components/LinearGradientLine.tsx +53 -53
  19. package/src/components/MoodColorsLine.d.ts +9 -0
  20. package/src/components/MoodColorsLine.tsx +38 -0
  21. package/src/components/Page.tsx +34 -34
  22. package/src/components/Popup.tsx +17 -17
  23. package/src/components/Segmented.d.ts +2 -2
  24. package/src/components/Segmented.tsx +66 -65
  25. package/src/components/Spacer.tsx +5 -5
  26. package/src/components/Tag.tsx +42 -42
  27. package/src/components/TextButton.d.ts +1 -1
  28. package/src/components/TextButton.tsx +23 -23
  29. package/src/components/TextField.tsx +58 -58
  30. package/src/components/connect.tsx +10 -10
  31. package/src/components/ldvColorBrightness.tsx +12 -12
  32. package/src/components/ldvColorSlider.tsx +109 -109
  33. package/src/components/ldvPickerView.tsx +70 -70
  34. package/src/components/ldvPresetView.tsx +68 -68
  35. package/src/components/ldvSaturation.tsx +14 -14
  36. package/src/components/ldvSlider.d.ts +3 -3
  37. package/src/components/ldvSlider.tsx +93 -93
  38. package/src/components/ldvSwitch.tsx +35 -35
  39. package/src/components/ldvTemperatureSlider.tsx +120 -120
  40. package/src/components/ldvTopBar.tsx +50 -50
  41. package/src/components/ldvTopName.tsx +44 -44
  42. package/src/components/segmentControl.tsx +59 -59
  43. package/src/components/weekSelect.tsx +76 -76
  44. package/src/composeLayout.tsx +165 -165
  45. package/src/i18n/index.ts +12 -12
  46. package/src/i18n/strings.ts +11004 -11004
  47. package/src/main.tsx +4 -4
  48. package/src/models/GlobalParams.ts +7 -7
  49. package/src/models/TuyaApi.d.ts +3 -3
  50. package/src/models/TuyaApi.ts +61 -61
  51. package/src/models/combine.ts +7 -7
  52. package/src/models/configureStore.ts +14 -14
  53. package/src/models/index.ts +4 -4
  54. package/src/models/modules/NativePropsSlice.tsx +170 -169
  55. package/src/models/modules/Result.ts +8 -8
  56. package/src/models/modules/common.ts +90 -90
  57. package/src/res/index.ts +35 -35
  58. package/src/utils/ColorParser.ts +150 -150
  59. package/src/utils/ColorUtils.tsx +414 -414
  60. package/src/utils/Support.d.ts +9 -0
  61. package/src/utils/Support.ts +85 -0
  62. package/src/utils/cctUtils.d.ts +1 -0
  63. package/src/utils/cctUtils.ts +111 -0
  64. package/src/utils/common.ts +186 -174
  65. package/src/utils/index.ts +123 -123
package/src/main.tsx CHANGED
@@ -2,8 +2,8 @@ import {createNavigator, GlobalTheme, NavigationRoute} from 'tuya-panel-kit'
2
2
  import composeLayout from './composeLayout'
3
3
 
4
4
  export function Navigation(router: NavigationRoute[]) {
5
- return composeLayout(createNavigator<{ theme: GlobalTheme }>({
6
- router: router,
7
- screenOptions: {},
8
- }))
5
+ return composeLayout(createNavigator<{ theme: GlobalTheme }>({
6
+ router: router,
7
+ screenOptions: {},
8
+ }))
9
9
  }
@@ -1,15 +1,15 @@
1
1
  interface DpSchemaProperty extends Record<string, any> {
2
- type: string
2
+ type: string
3
3
  }
4
4
 
5
5
  export interface DpSchema {
6
- name: string
7
- dp: number
8
- type: string
9
- mode: string
10
- property: DpSchemaProperty
6
+ name: string
7
+ dp: number
8
+ type: string
9
+ mode: string
10
+ property: DpSchemaProperty
11
11
  }
12
12
 
13
13
  export class GlobalParams {
14
- static dpSchemaMap: Record<string, DpSchema> = {}
14
+ static dpSchemaMap: Record<string, DpSchema> = {}
15
15
  }
@@ -20,10 +20,10 @@ export interface DpResultByMonthResData {
20
20
  thisDay: string;
21
21
  sum: string;
22
22
  }
23
- export declare function getDpResultByMonth(devId: string, dpId: string, type: "sum" | "minux" | "mac"): Promise<DpResultByMonthResData>;
23
+ export declare function getDpResultByMonth(devId: string, dpId: string, type: 'sum' | 'minux' | 'mac'): Promise<DpResultByMonthResData>;
24
24
  export interface DpResultByDataWithSpecifiedResData {
25
25
  result: object;
26
26
  min: string;
27
27
  }
28
- export declare function getDataWithSpecified(devId: string, dpId: string, startDay: string, endDay: string, type: "sum" | "minux" | "avg"): Promise<DpResultByDataWithSpecifiedResData>;
29
- export declare function getDpResultByHour(devId: string, dpId: string, date: string, type: "sum" | "minux" | "avg"): Promise<DpResultByDataWithSpecifiedResData>;
28
+ export declare function getDataWithSpecified(devId: string, dpId: string, startDay: string, endDay: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
29
+ export declare function getDpResultByHour(devId: string, dpId: string, date: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
@@ -1,93 +1,93 @@
1
1
  import {commonApi} from '@tuya/tuya-panel-api'
2
2
 
3
3
  export interface PagingResult<T> {
4
- data: T
5
- hasNext: boolean
6
- currentOffset: number
4
+ data: T
5
+ hasNext: boolean
6
+ currentOffset: number
7
7
  }
8
8
 
9
9
  export interface DpReportSataResData {
10
- dps: DpReportSataData[]
11
- hasNext: boolean
12
- total: number
10
+ dps: DpReportSataData[]
11
+ hasNext: boolean
12
+ total: number
13
13
  }
14
14
 
15
15
  export interface DpReportSataData {
16
- timeStamp: number
17
- dpId: number
18
- timeStr: string
19
- value: string
16
+ timeStamp: number
17
+ dpId: number
18
+ timeStr: string
19
+ value: string
20
20
  }
21
21
 
22
22
  export async function getDpReportSataData(
23
- deviceId: string,
24
- dpIds: string[],
25
- offset: number,
26
- limit: number,
27
- sortType?: 'ASC' | 'DESC',
23
+ deviceId: string,
24
+ dpIds: string[],
25
+ offset: number,
26
+ limit: number,
27
+ sortType?: 'ASC' | 'DESC',
28
28
  ): Promise<DpReportSataResData> {
29
- const params = {
30
- devId: deviceId,
31
- dpIds: dpIds.join(','),
32
- offset: offset,
33
- limit: limit,
34
- sortType: sortType || 'DESC',
35
- }
36
- return commonApi.statApi.getDpReportLog(params)
29
+ const params = {
30
+ devId: deviceId,
31
+ dpIds: dpIds.join(','),
32
+ offset: offset,
33
+ limit: limit,
34
+ sortType: sortType || 'DESC',
35
+ }
36
+ return commonApi.statApi.getDpReportLog(params)
37
37
  }
38
38
 
39
39
  export interface DpResultByMonthResData {
40
- years: object;
41
- thisDay: string;
42
- sum: string;
40
+ years: object;
41
+ thisDay: string;
42
+ sum: string;
43
43
  }
44
44
 
45
45
  export async function getDpResultByMonth(
46
- devId: string,
47
- dpId: string,
48
- type: "sum" | "minux" | "mac"
46
+ devId: string,
47
+ dpId: string,
48
+ type: 'sum' | 'minux' | 'mac',
49
49
  ): Promise<DpResultByMonthResData> {
50
- const params = {
51
- devId,
52
- dpId,
53
- type
54
- }
55
- return commonApi.statApi.getDpResultByMonth(params) as any
50
+ const params = {
51
+ devId,
52
+ dpId,
53
+ type,
54
+ }
55
+ return commonApi.statApi.getDpResultByMonth(params) as any
56
56
  }
57
57
 
58
58
  export interface DpResultByDataWithSpecifiedResData {
59
- result: object;
60
- min: string;
59
+ result: object;
60
+ min: string;
61
61
  }
62
62
 
63
63
  export async function getDataWithSpecified(
64
- devId: string,
65
- dpId: string,
66
- startDay: string,
67
- endDay: string,
68
- type: "sum" | "minux" | "avg"
64
+ devId: string,
65
+ dpId: string,
66
+ startDay: string,
67
+ endDay: string,
68
+ type: 'sum' | 'minux' | 'avg',
69
69
  ): Promise<DpResultByDataWithSpecifiedResData> {
70
- const params = {
71
- devId,
72
- dpId,
73
- startDay,
74
- endDay,
75
- type,
76
- }
77
- return commonApi.statApi.getDataWithSpecified(params) as any
70
+ const params = {
71
+ devId,
72
+ dpId,
73
+ startDay,
74
+ endDay,
75
+ type,
76
+ }
77
+ return commonApi.statApi.getDataWithSpecified(params) as any
78
78
  }
79
79
 
80
80
  export async function getDpResultByHour(
81
- devId: string,
82
- dpId: string,
83
- date: string,
84
- type: "sum" | "minux" | "avg"
81
+ devId: string,
82
+ dpId: string,
83
+ date: string,
84
+ type: 'sum' | 'minux' | 'avg',
85
85
  ): Promise<DpResultByDataWithSpecifiedResData> {
86
- const params = {
87
- devId,
88
- dpId,
89
- date,
90
- type
91
- }
92
- return commonApi.statApi.getDpResultByHour(params) as any
86
+ const params = {
87
+ devId,
88
+ dpId,
89
+ date,
90
+ type,
91
+ }
92
+ return commonApi.statApi.getDpResultByHour(params) as any
93
93
  }
@@ -1,17 +1,17 @@
1
- import { combineReducers } from 'redux';
2
- import { combineEpics } from 'redux-observable';
3
- import { reducers as commonReducers, epics as commonEpics } from './modules/common';
1
+ import {combineReducers} from 'redux'
2
+ import {combineEpics} from 'redux-observable'
3
+ import {epics as commonEpics, reducers as commonReducers} from './modules/common'
4
4
 
5
5
  export const reducers = {
6
6
  ...commonReducers,
7
- };
7
+ }
8
8
 
9
9
  type Reducers = typeof reducers;
10
10
 
11
11
  export type ReduxState = { [K in keyof Reducers]: ReturnType<Reducers[K]> };
12
12
 
13
- export const rootReducers = combineReducers(reducers);
13
+ export const rootReducers = combineReducers(reducers)
14
14
 
15
- const allEpics = [...commonEpics];
15
+ const allEpics = [...commonEpics]
16
16
 
17
- export const rootEpics = combineEpics(...allEpics);
17
+ export const rootEpics = combineEpics(...allEpics)
@@ -9,25 +9,25 @@ const mWindow: any = window
9
9
 
10
10
  const isDebuggingInChrome = __DEV__ && !!mWindow.navigator.userAgent
11
11
  const logger = createLogger({
12
- predicate: () => isDebuggingInChrome,
13
- collapsed: true,
14
- duration: true,
12
+ predicate: () => isDebuggingInChrome,
13
+ collapsed: true,
14
+ duration: true,
15
15
  })
16
16
 
17
17
  const middleware = isDebuggingInChrome ? [epicMiddleware, logger] : [epicMiddleware]
18
18
 
19
19
  export default function configureStore(initialState?: Partial<ReduxState>) {
20
- const appliedMiddleware = applyMiddleware(...middleware)
20
+ const appliedMiddleware = applyMiddleware(...middleware)
21
21
 
22
- const store = createStore(
23
- rootReducers,
24
- initialState,
25
- compose(
26
- appliedMiddleware,
27
- isDebuggingInChrome && mWindow.devToolsExtension ? mWindow.devToolsExtension() : (f: any) => f,
28
- ),
29
- )
22
+ const store = createStore(
23
+ rootReducers,
24
+ initialState,
25
+ compose(
26
+ appliedMiddleware,
27
+ isDebuggingInChrome && mWindow.devToolsExtension ? mWindow.devToolsExtension() : (f: any) => f,
28
+ ),
29
+ )
30
30
 
31
- epicMiddleware.run(rootEpics)
32
- return store
31
+ epicMiddleware.run(rootEpics)
32
+ return store
33
33
  }
@@ -7,7 +7,7 @@ export * from './combine'
7
7
  export * from './configureStore'
8
8
 
9
9
  const actions = {
10
- common: CommonActions,
10
+ common: CommonActions,
11
11
  }
12
12
 
13
13
  export {actions}
@@ -15,8 +15,8 @@ export {actions}
15
15
  export const store = configureStore()
16
16
 
17
17
  export function useSelector<TSelected>(
18
- selector: (state: ReduxState) => TSelected,
19
- equalityFn?: (left: TSelected, right: TSelected) => boolean,
18
+ selector: (state: ReduxState) => TSelected,
19
+ equalityFn?: (left: TSelected, right: TSelected) => boolean,
20
20
  ) {
21
- return useSelectorBase<ReduxState, TSelected>(selector, equalityFn || shallowEqual)
21
+ return useSelectorBase<ReduxState, TSelected>(selector, equalityFn || shallowEqual)
22
22
  }