@ray-js/lamp-schedule-core 1.0.0-beta-1

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 (246) hide show
  1. package/README.md +565 -0
  2. package/lib/config/dpCodes.d.ts +27 -0
  3. package/lib/config/dpCodes.js +30 -0
  4. package/lib/config/index.d.ts +2 -0
  5. package/lib/config/index.js +2 -0
  6. package/lib/config/rhythms/defaultValue.d.ts +18 -0
  7. package/lib/config/rhythms/defaultValue.js +72 -0
  8. package/lib/config/rhythms/index.d.ts +10 -0
  9. package/lib/config/rhythms/index.js +35 -0
  10. package/lib/conflict/ConflictResolver.d.ts +2 -0
  11. package/lib/conflict/ConflictResolver.js +284 -0
  12. package/lib/conflict/__test__/ConflictResolver.test.d.ts +1 -0
  13. package/lib/conflict/__test__/ConflictResolver.test.js +183 -0
  14. package/lib/conflict/__test__/index.test.d.ts +1 -0
  15. package/lib/conflict/__test__/index.test.js +385 -0
  16. package/lib/conflict/__test__/scheduleDataManager.test.d.ts +1 -0
  17. package/lib/conflict/__test__/scheduleDataManager.test.js +170 -0
  18. package/lib/conflict/__test__/transform.test.d.ts +1 -0
  19. package/lib/conflict/__test__/transform.test.js +454 -0
  20. package/lib/conflict/__test__/updateDeviceDp.d.ts +1 -0
  21. package/lib/conflict/__test__/updateDeviceDp.js +114 -0
  22. package/lib/conflict/index.d.ts +42 -0
  23. package/lib/conflict/index.js +103 -0
  24. package/lib/conflict/scheduleDataManager.d.ts +12 -0
  25. package/lib/conflict/scheduleDataManager.js +79 -0
  26. package/lib/conflict/transform.d.ts +71 -0
  27. package/lib/conflict/transform.js +251 -0
  28. package/lib/conflict/type.d.ts +55 -0
  29. package/lib/conflict/type.js +17 -0
  30. package/lib/conflict/updateDeviceDp.d.ts +1 -0
  31. package/lib/conflict/updateDeviceDp.js +41 -0
  32. package/lib/constant/index.d.ts +5 -0
  33. package/lib/constant/index.js +5 -0
  34. package/lib/context/index.d.ts +3 -0
  35. package/lib/context/index.js +3 -0
  36. package/lib/context/rhythms/actions.d.ts +20 -0
  37. package/lib/context/rhythms/actions.js +52 -0
  38. package/lib/context/rhythms/index.d.ts +5 -0
  39. package/lib/context/rhythms/index.js +51 -0
  40. package/lib/context/rhythms/reducer.d.ts +24 -0
  41. package/lib/context/rhythms/reducer.js +38 -0
  42. package/lib/context/schedule/actions.d.ts +7 -0
  43. package/lib/context/schedule/actions.js +51 -0
  44. package/lib/context/schedule/context.d.ts +6 -0
  45. package/lib/context/schedule/context.js +52 -0
  46. package/lib/context/schedule/index.d.ts +1 -0
  47. package/lib/context/schedule/index.js +1 -0
  48. package/lib/context/schedule/reducer.d.ts +16 -0
  49. package/lib/context/schedule/reducer.js +104 -0
  50. package/lib/context/schedule/type.d.ts +41 -0
  51. package/lib/context/schedule/type.js +11 -0
  52. package/lib/context/timer/actions.d.ts +8 -0
  53. package/lib/context/timer/actions.js +52 -0
  54. package/lib/context/timer/context.d.ts +10 -0
  55. package/lib/context/timer/context.js +53 -0
  56. package/lib/context/timer/index.d.ts +1 -0
  57. package/lib/context/timer/index.js +1 -0
  58. package/lib/context/timer/reducer.d.ts +15 -0
  59. package/lib/context/timer/reducer.js +70 -0
  60. package/lib/context/timer/type.d.ts +46 -0
  61. package/lib/context/timer/type.js +24 -0
  62. package/lib/dpParser/README.md +63 -0
  63. package/lib/dpParser/__test__/cycle.test.d.ts +1 -0
  64. package/lib/dpParser/__test__/cycle.test.js +258 -0
  65. package/lib/dpParser/__test__/random.test.d.ts +1 -0
  66. package/lib/dpParser/__test__/random.test.js +211 -0
  67. package/lib/dpParser/__test__/rhythms.test.d.ts +1 -0
  68. package/lib/dpParser/__test__/rhythms.test.js +71 -0
  69. package/lib/dpParser/__test__/rtcTimer.test.d.ts +1 -0
  70. package/lib/dpParser/__test__/rtcTimer.test.js +235 -0
  71. package/lib/dpParser/__test__/sleep.test.d.ts +1 -0
  72. package/lib/dpParser/__test__/sleep.test.js +71 -0
  73. package/lib/dpParser/__test__/sleepCommon.test.d.ts +1 -0
  74. package/lib/dpParser/__test__/sleepCommon.test.js +197 -0
  75. package/lib/dpParser/__test__/timerReport.test.d.ts +1 -0
  76. package/lib/dpParser/__test__/timerReport.test.js +100 -0
  77. package/lib/dpParser/__test__/wakeup.test.d.ts +1 -0
  78. package/lib/dpParser/__test__/wakeup.test.js +69 -0
  79. package/lib/dpParser/__test__/wakeupCommon.test.d.ts +1 -0
  80. package/lib/dpParser/__test__/wakeupCommon.test.js +131 -0
  81. package/lib/dpParser/cycle/index.d.ts +15 -0
  82. package/lib/dpParser/cycle/index.js +134 -0
  83. package/lib/dpParser/index.d.ts +23 -0
  84. package/lib/dpParser/index.js +43 -0
  85. package/lib/dpParser/random/index.d.ts +15 -0
  86. package/lib/dpParser/random/index.js +127 -0
  87. package/lib/dpParser/rhythms.d.ts +41 -0
  88. package/lib/dpParser/rhythms.js +116 -0
  89. package/lib/dpParser/rtcTimer.d.ts +17 -0
  90. package/lib/dpParser/rtcTimer.js +300 -0
  91. package/lib/dpParser/sleep/index.d.ts +9 -0
  92. package/lib/dpParser/sleep/index.js +29 -0
  93. package/lib/dpParser/sleep/sleepCommon.d.ts +11 -0
  94. package/lib/dpParser/sleep/sleepCommon.js +117 -0
  95. package/lib/dpParser/sleep/sleepSigmesh.d.ts +0 -0
  96. package/lib/dpParser/sleep/sleepSigmesh.js +101 -0
  97. package/lib/dpParser/timerReport.d.ts +11 -0
  98. package/lib/dpParser/timerReport.js +43 -0
  99. package/lib/dpParser/utils.d.ts +27 -0
  100. package/lib/dpParser/utils.js +53 -0
  101. package/lib/dpParser/wakeup/index.d.ts +10 -0
  102. package/lib/dpParser/wakeup/index.js +34 -0
  103. package/lib/dpParser/wakeup/wakeupCommon.d.ts +11 -0
  104. package/lib/dpParser/wakeup/wakeupCommon.js +106 -0
  105. package/lib/dpParser/wakeup/wakeupSigmesh.d.ts +15 -0
  106. package/lib/dpParser/wakeup/wakeupSigmesh.js +86 -0
  107. package/lib/hooks/__test__/useCommon.test.d.ts +1 -0
  108. package/lib/hooks/__test__/useCommon.test.js +72 -0
  109. package/lib/hooks/__test__/useCountdownDp.test.d.ts +1 -0
  110. package/lib/hooks/__test__/useCountdownDp.test.js +82 -0
  111. package/lib/hooks/__test__/useCycleDp.test.d.ts +1 -0
  112. package/lib/hooks/__test__/useCycleDp.test.js +92 -0
  113. package/lib/hooks/__test__/useRandomDp.test.d.ts +1 -0
  114. package/lib/hooks/__test__/useRandomDp.test.js +88 -0
  115. package/lib/hooks/__test__/useRhythmsDp.test.d.ts +1 -0
  116. package/lib/hooks/__test__/useRhythmsDp.test.js +81 -0
  117. package/lib/hooks/__test__/useSleepDp.test.d.ts +1 -0
  118. package/lib/hooks/__test__/useSleepDp.test.js +127 -0
  119. package/lib/hooks/__test__/useTimeFlush.test.d.ts +1 -0
  120. package/lib/hooks/__test__/useTimeFlush.test.js +109 -0
  121. package/lib/hooks/__test__/useTimerDp.test.d.ts +1 -0
  122. package/lib/hooks/__test__/useTimerDp.test.js +79 -0
  123. package/lib/hooks/__test__/useTimerOperate.test.d.ts +1 -0
  124. package/lib/hooks/__test__/useTimerOperate.test.js +286 -0
  125. package/lib/hooks/__test__/useTimerOperateCloud.test.d.ts +1 -0
  126. package/lib/hooks/__test__/useTimerOperateCloud.test.js +190 -0
  127. package/lib/hooks/__test__/useTimerOperateLocal.test.d.ts +1 -0
  128. package/lib/hooks/__test__/useTimerOperateLocal.test.js +216 -0
  129. package/lib/hooks/__test__/useTimerReportDp.test.d.ts +1 -0
  130. package/lib/hooks/__test__/useTimerReportDp.test.js +93 -0
  131. package/lib/hooks/__test__/useTimerSupport.test.d.ts +1 -0
  132. package/lib/hooks/__test__/useTimerSupport.test.js +110 -0
  133. package/lib/hooks/__test__/useWakeUpDp.test.d.ts +1 -0
  134. package/lib/hooks/__test__/useWakeUpDp.test.js +129 -0
  135. package/lib/hooks/useBaseLightDp.d.ts +21 -0
  136. package/lib/hooks/useBaseLightDp.js +165 -0
  137. package/lib/hooks/useCommon.d.ts +29 -0
  138. package/lib/hooks/useCommon.js +59 -0
  139. package/lib/hooks/useCommonSupport.d.ts +25 -0
  140. package/lib/hooks/useCommonSupport.js +241 -0
  141. package/lib/hooks/useCountdownDp.d.ts +13 -0
  142. package/lib/hooks/useCountdownDp.js +28 -0
  143. package/lib/hooks/useCountdownSupport.d.ts +9 -0
  144. package/lib/hooks/useCountdownSupport.js +13 -0
  145. package/lib/hooks/useCycleDp.d.ts +7 -0
  146. package/lib/hooks/useCycleDp.js +21 -0
  147. package/lib/hooks/useCycleSupport.d.ts +12 -0
  148. package/lib/hooks/useCycleSupport.js +16 -0
  149. package/lib/hooks/useRandomDp.d.ts +7 -0
  150. package/lib/hooks/useRandomDp.js +21 -0
  151. package/lib/hooks/useRandomSupport.d.ts +12 -0
  152. package/lib/hooks/useRandomSupport.js +16 -0
  153. package/lib/hooks/useRhythmsDp.d.ts +7 -0
  154. package/lib/hooks/useRhythmsDp.js +23 -0
  155. package/lib/hooks/useSleepDp.d.ts +6 -0
  156. package/lib/hooks/useSleepDp.js +21 -0
  157. package/lib/hooks/useSleepSupport.d.ts +8 -0
  158. package/lib/hooks/useSleepSupport.js +13 -0
  159. package/lib/hooks/useTimeFlush.d.ts +8 -0
  160. package/lib/hooks/useTimeFlush.js +31 -0
  161. package/lib/hooks/useTimerDp.d.ts +5 -0
  162. package/lib/hooks/useTimerDp.js +25 -0
  163. package/lib/hooks/useTimerFlushList.d.ts +11 -0
  164. package/lib/hooks/useTimerFlushList.js +53 -0
  165. package/lib/hooks/useTimerOperate.d.ts +68 -0
  166. package/lib/hooks/useTimerOperate.js +403 -0
  167. package/lib/hooks/useTimerOperateCloud.d.ts +31 -0
  168. package/lib/hooks/useTimerOperateCloud.js +233 -0
  169. package/lib/hooks/useTimerOperateLocal.d.ts +40 -0
  170. package/lib/hooks/useTimerOperateLocal.js +310 -0
  171. package/lib/hooks/useTimerReportDp.d.ts +15 -0
  172. package/lib/hooks/useTimerReportDp.js +48 -0
  173. package/lib/hooks/useTimerSupport.d.ts +13 -0
  174. package/lib/hooks/useTimerSupport.js +38 -0
  175. package/lib/hooks/useWakeUpDp.d.ts +6 -0
  176. package/lib/hooks/useWakeUpDp.js +21 -0
  177. package/lib/hooks/useWakeUpSupport.d.ts +8 -0
  178. package/lib/hooks/useWakeUpSupport.js +13 -0
  179. package/lib/hooks/useWakeupDp.d.ts +6 -0
  180. package/lib/hooks/useWakeupDp.js +21 -0
  181. package/lib/hooks/useWakeupSupport.d.ts +8 -0
  182. package/lib/hooks/useWakeupSupport.js +13 -0
  183. package/lib/i18n/index.d.ts +142 -0
  184. package/lib/i18n/index.js +7 -0
  185. package/lib/i18n/rhythms.d.ts +73 -0
  186. package/lib/i18n/rhythms.js +72 -0
  187. package/lib/i18n/strings.d.ts +73 -0
  188. package/lib/i18n/strings.js +6 -0
  189. package/lib/index.d.ts +51 -0
  190. package/lib/index.js +64 -0
  191. package/lib/types/countdown.d.ts +3 -0
  192. package/lib/types/countdown.js +1 -0
  193. package/lib/types/cycle.d.ts +22 -0
  194. package/lib/types/cycle.js +1 -0
  195. package/lib/types/global.d.ts +9 -0
  196. package/lib/types/index.d.ts +331 -0
  197. package/lib/types/index.js +76 -0
  198. package/lib/types/random.d.ts +20 -0
  199. package/lib/types/random.js +1 -0
  200. package/lib/types/rhythms.d.ts +79 -0
  201. package/lib/types/rhythms.js +15 -0
  202. package/lib/types/sleep.d.ts +36 -0
  203. package/lib/types/sleep.js +1 -0
  204. package/lib/types/timer.d.ts +107 -0
  205. package/lib/types/timer.js +1 -0
  206. package/lib/types/wakeup.d.ts +38 -0
  207. package/lib/types/wakeup.js +1 -0
  208. package/lib/utils/ScheduleCache.d.ts +19 -0
  209. package/lib/utils/ScheduleCache.js +39 -0
  210. package/lib/utils/ScheduleCloudProperty.d.ts +75 -0
  211. package/lib/utils/ScheduleCloudProperty.js +220 -0
  212. package/lib/utils/ScheduleDataSync.d.ts +82 -0
  213. package/lib/utils/ScheduleDataSync.js +127 -0
  214. package/lib/utils/ScheduleEmit.d.ts +67 -0
  215. package/lib/utils/ScheduleEmit.js +61 -0
  216. package/lib/utils/ScheduleLogger.d.ts +19 -0
  217. package/lib/utils/ScheduleLogger.js +71 -0
  218. package/lib/utils/ScheduleSupport.d.ts +131 -0
  219. package/lib/utils/ScheduleSupport.js +373 -0
  220. package/lib/utils/ScheduleUtils.d.ts +12 -0
  221. package/lib/utils/ScheduleUtils.js +51 -0
  222. package/lib/utils/__test__/ScheduleCloudProperty.test.d.ts +1 -0
  223. package/lib/utils/__test__/ScheduleCloudProperty.test.js +320 -0
  224. package/lib/utils/__test__/ScheduleSupport.test.d.ts +1 -0
  225. package/lib/utils/__test__/ScheduleSupport.test.js +211 -0
  226. package/lib/utils/__test__/ScheduleUtils.test.d.ts +1 -0
  227. package/lib/utils/__test__/ScheduleUtils.test.js +119 -0
  228. package/lib/utils/__test__/common.test.d.ts +1 -0
  229. package/lib/utils/__test__/common.test.js +147 -0
  230. package/lib/utils/__test__/storage.test.d.ts +1 -0
  231. package/lib/utils/__test__/storage.test.js +98 -0
  232. package/lib/utils/__test__/time.test.d.ts +1 -0
  233. package/lib/utils/__test__/time.test.js +146 -0
  234. package/lib/utils/common.d.ts +23 -0
  235. package/lib/utils/common.js +109 -0
  236. package/lib/utils/dpState.d.ts +5 -0
  237. package/lib/utils/dpState.js +27 -0
  238. package/lib/utils/getCachedSystemInfo.d.ts +39 -0
  239. package/lib/utils/getCachedSystemInfo.js +20 -0
  240. package/lib/utils/isInIDE.d.ts +1 -0
  241. package/lib/utils/isInIDE.js +5 -0
  242. package/lib/utils/storage.d.ts +5 -0
  243. package/lib/utils/storage.js +32 -0
  244. package/lib/utils/time.d.ts +40 -0
  245. package/lib/utils/time.js +84 -0
  246. package/package.json +78 -0
@@ -0,0 +1,6 @@
1
+ type TDpRes<T> = {
2
+ dpValue: T;
3
+ updateDp: (value: T) => void;
4
+ };
5
+ export declare function useWakeUpDp<T>(dpCode?: "wakeup_mode"): TDpRes<T>;
6
+ export {};
@@ -0,0 +1,21 @@
1
+ import { useMemo } from 'react';
2
+ import { useBaseLightDp } from './useBaseLightDp';
3
+ import { scheduleDpCodes } from '../config/dpCodes';
4
+ import { getWakeUpParser } from '../dpParser/wakeup';
5
+ export function useWakeUpDp() {
6
+ let dpCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scheduleDpCodes.WAKE_UP_MODE;
7
+ const {
8
+ dpValue,
9
+ updateDp
10
+ } = useBaseLightDp(dpCode);
11
+ const wakeUpParser = getWakeUpParser();
12
+ const _dpValue = useMemo(() => {
13
+ return wakeUpParser.parser(dpValue);
14
+ }, [dpValue]);
15
+ return {
16
+ dpValue: _dpValue,
17
+ updateDp: dpData => {
18
+ updateDp(wakeUpParser.formatter(dpData));
19
+ }
20
+ };
21
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description: 判断是否唤醒功能
3
+ * @param dpCodeList: 倒计时 dpCode 列表 string[]
4
+ * @return {isReady: boolean, isSupport: boolean}
5
+ */
6
+ export declare const useWakeUpSupport: (dpCodeList?: string[]) => {
7
+ isSupport: boolean;
8
+ };
@@ -0,0 +1,13 @@
1
+ import { scheduleDpCodes } from '../config/dpCodes';
2
+ import { useCommonSupport } from './useCommonSupport';
3
+
4
+ /**
5
+ * @description: 判断是否唤醒功能
6
+ * @param dpCodeList: 倒计时 dpCode 列表 string[]
7
+ * @return {isReady: boolean, isSupport: boolean}
8
+ */
9
+ export const useWakeUpSupport = function () {
10
+ let dpCodeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11
+ const support = useCommonSupport([scheduleDpCodes.WAKE_UP_MODE], dpCodeList);
12
+ return support;
13
+ };
@@ -0,0 +1,6 @@
1
+ type TDpRes<T> = {
2
+ dpValue: T;
3
+ updateDp: (value: T) => void;
4
+ };
5
+ export declare function useWakeUpDp<T>(dpCode?: "wakeup_mode"): TDpRes<T>;
6
+ export {};
@@ -0,0 +1,21 @@
1
+ import { useMemo } from 'react';
2
+ import { useBaseLightDp } from './useBaseLightDp';
3
+ import { scheduleDpCodes } from '../config/dpCodes';
4
+ import { getWakeUpParser } from '../dpParser/wakeup';
5
+ export function useWakeUpDp() {
6
+ let dpCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scheduleDpCodes.WAKE_UP_MODE;
7
+ const {
8
+ dpValue,
9
+ updateDp
10
+ } = useBaseLightDp(dpCode);
11
+ const wakeUpParser = getWakeUpParser();
12
+ const _dpValue = useMemo(() => {
13
+ return wakeUpParser.parser(dpValue);
14
+ }, [dpValue]);
15
+ return {
16
+ dpValue: _dpValue,
17
+ updateDp: dpData => {
18
+ updateDp(wakeUpParser.formatter(dpData));
19
+ }
20
+ };
21
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description: 判断是否唤醒功能
3
+ * @param dpCodeList: 倒计时 dpCode 列表 string[]
4
+ * @return {isReady: boolean, isSupport: boolean}
5
+ */
6
+ export declare const useWakeUpSupport: (dpCodeList?: string[]) => {
7
+ isSupport: boolean;
8
+ };
@@ -0,0 +1,13 @@
1
+ import { scheduleDpCodes } from '../config/dpCodes';
2
+ import { useCommonSupport } from './useCommonSupport';
3
+
4
+ /**
5
+ * @description: 判断是否唤醒功能
6
+ * @param dpCodeList: 倒计时 dpCode 列表 string[]
7
+ * @return {isReady: boolean, isSupport: boolean}
8
+ */
9
+ export const useWakeUpSupport = function () {
10
+ let dpCodeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11
+ const support = useCommonSupport([scheduleDpCodes.WAKE_UP_MODE], dpCodeList);
12
+ return support;
13
+ };
@@ -0,0 +1,142 @@
1
+ import { kit } from '@ray-js/panel-sdk';
2
+ declare const Strings: kit.I18N<{
3
+ en: {
4
+ rhythms: string;
5
+ tip_rhythms_main: string;
6
+ tip_rhythms_inside: string;
7
+ timing_conflicts_tip: string;
8
+ rhythms_1: string;
9
+ rhythms_2: string;
10
+ rhythms_3: string;
11
+ rhythms_4: string;
12
+ rhythmsMode_0: string;
13
+ rhythmsMode_1: string;
14
+ rhythmsMode_2: string;
15
+ select_location: string;
16
+ city: string;
17
+ position_tip: string;
18
+ longitude: string;
19
+ latitude: string;
20
+ rhythms_reset_tip: string;
21
+ rhythm_time_repeat: string;
22
+ rhythms_delete_tip: string;
23
+ rhythm_valid_tip: string;
24
+ gps_title: string;
25
+ rhythms_main_tip: string;
26
+ no_city_name: string;
27
+ rhythms_default_name_0: string;
28
+ rhythms_default_name_1: string;
29
+ rhythms_default_name_2: string;
30
+ rhythms_default_name_3: string;
31
+ rhythms_default_tip1_0: string;
32
+ rhythms_default_tip1_1: string;
33
+ rhythms_default_tip1_2: string;
34
+ rhythms_default_tip1_3: string;
35
+ iKnow: string;
36
+ rhythm_on_tip: string;
37
+ };
38
+ zh: {
39
+ rhythms: string;
40
+ tip_rhythms_main: string;
41
+ tip_rhythms_inside: string;
42
+ timing_conflicts_tip: string;
43
+ rhythms_1: string;
44
+ rhythms_2: string;
45
+ rhythms_3: string;
46
+ rhythms_4: string;
47
+ rhythmsMode_0: string;
48
+ rhythmsMode_1: string;
49
+ rhythmsMode_2: string;
50
+ select_location: string;
51
+ city: string;
52
+ position_tip: string;
53
+ longitude: string;
54
+ latitude: string;
55
+ rhythms_reset_tip: string;
56
+ rhythm_time_repeat: string;
57
+ rhythms_delete_tip: string;
58
+ rhythm_valid_tip: string;
59
+ gps_title: string;
60
+ rhythms_main_tip: string;
61
+ no_city_name: string;
62
+ rhythms_default_tip1_0: string;
63
+ rhythms_default_tip1_1: string;
64
+ rhythms_default_tip1_2: string;
65
+ rhythms_default_tip1_3: string;
66
+ rhythms_default_name_0: string;
67
+ rhythms_default_name_1: string;
68
+ rhythms_default_name_2: string;
69
+ rhythms_default_name_3: string;
70
+ iKnow: string;
71
+ rhythm_on_tip: string;
72
+ };
73
+ }, {
74
+ rhythms: string;
75
+ tip_rhythms_main: string;
76
+ tip_rhythms_inside: string;
77
+ timing_conflicts_tip: string;
78
+ rhythms_1: string;
79
+ rhythms_2: string;
80
+ rhythms_3: string;
81
+ rhythms_4: string;
82
+ rhythmsMode_0: string;
83
+ rhythmsMode_1: string;
84
+ rhythmsMode_2: string;
85
+ select_location: string;
86
+ city: string;
87
+ position_tip: string;
88
+ longitude: string;
89
+ latitude: string;
90
+ rhythms_reset_tip: string;
91
+ rhythm_time_repeat: string;
92
+ rhythms_delete_tip: string;
93
+ rhythm_valid_tip: string;
94
+ gps_title: string;
95
+ rhythms_main_tip: string;
96
+ no_city_name: string;
97
+ rhythms_default_name_0: string;
98
+ rhythms_default_name_1: string;
99
+ rhythms_default_name_2: string;
100
+ rhythms_default_name_3: string;
101
+ rhythms_default_tip1_0: string;
102
+ rhythms_default_tip1_1: string;
103
+ rhythms_default_tip1_2: string;
104
+ rhythms_default_tip1_3: string;
105
+ iKnow: string;
106
+ rhythm_on_tip: string;
107
+ } | {
108
+ rhythms: string;
109
+ tip_rhythms_main: string;
110
+ tip_rhythms_inside: string;
111
+ timing_conflicts_tip: string;
112
+ rhythms_1: string;
113
+ rhythms_2: string;
114
+ rhythms_3: string;
115
+ rhythms_4: string;
116
+ rhythmsMode_0: string;
117
+ rhythmsMode_1: string;
118
+ rhythmsMode_2: string;
119
+ select_location: string;
120
+ city: string;
121
+ position_tip: string;
122
+ longitude: string;
123
+ latitude: string;
124
+ rhythms_reset_tip: string;
125
+ rhythm_time_repeat: string;
126
+ rhythms_delete_tip: string;
127
+ rhythm_valid_tip: string;
128
+ gps_title: string;
129
+ rhythms_main_tip: string;
130
+ no_city_name: string;
131
+ rhythms_default_tip1_0: string;
132
+ rhythms_default_tip1_1: string;
133
+ rhythms_default_tip1_2: string;
134
+ rhythms_default_tip1_3: string;
135
+ rhythms_default_name_0: string;
136
+ rhythms_default_name_1: string;
137
+ rhythms_default_name_2: string;
138
+ rhythms_default_name_3: string;
139
+ iKnow: string;
140
+ rhythm_on_tip: string;
141
+ }>;
142
+ export default Strings;
@@ -0,0 +1,7 @@
1
+ import { kit } from '@ray-js/panel-sdk';
2
+ import strings from './strings';
3
+ const {
4
+ I18N
5
+ } = kit;
6
+ const Strings = new I18N(strings);
7
+ export default Strings;
@@ -0,0 +1,73 @@
1
+ declare const _default: {
2
+ zh: {
3
+ rhythms: string;
4
+ tip_rhythms_main: string;
5
+ tip_rhythms_inside: string;
6
+ timing_conflicts_tip: string;
7
+ rhythms_1: string;
8
+ rhythms_2: string;
9
+ rhythms_3: string;
10
+ rhythms_4: string;
11
+ rhythmsMode_0: string;
12
+ rhythmsMode_1: string;
13
+ rhythmsMode_2: string;
14
+ select_location: string;
15
+ city: string;
16
+ position_tip: string;
17
+ longitude: string;
18
+ latitude: string;
19
+ rhythms_reset_tip: string;
20
+ rhythm_time_repeat: string;
21
+ rhythms_delete_tip: string;
22
+ rhythm_valid_tip: string;
23
+ gps_title: string;
24
+ rhythms_main_tip: string;
25
+ no_city_name: string;
26
+ rhythms_default_tip1_0: string;
27
+ rhythms_default_tip1_1: string;
28
+ rhythms_default_tip1_2: string;
29
+ rhythms_default_tip1_3: string;
30
+ rhythms_default_name_0: string;
31
+ rhythms_default_name_1: string;
32
+ rhythms_default_name_2: string;
33
+ rhythms_default_name_3: string;
34
+ iKnow: string;
35
+ rhythm_on_tip: string;
36
+ };
37
+ en: {
38
+ rhythms: string;
39
+ tip_rhythms_main: string;
40
+ tip_rhythms_inside: string;
41
+ timing_conflicts_tip: string;
42
+ rhythms_1: string;
43
+ rhythms_2: string;
44
+ rhythms_3: string;
45
+ rhythms_4: string;
46
+ rhythmsMode_0: string;
47
+ rhythmsMode_1: string;
48
+ rhythmsMode_2: string;
49
+ select_location: string;
50
+ city: string;
51
+ position_tip: string;
52
+ longitude: string;
53
+ latitude: string;
54
+ rhythms_reset_tip: string;
55
+ rhythm_time_repeat: string;
56
+ rhythms_delete_tip: string;
57
+ rhythm_valid_tip: string;
58
+ gps_title: string;
59
+ rhythms_main_tip: string;
60
+ no_city_name: string;
61
+ rhythms_default_name_0: string;
62
+ rhythms_default_name_1: string;
63
+ rhythms_default_name_2: string;
64
+ rhythms_default_name_3: string;
65
+ rhythms_default_tip1_0: string;
66
+ rhythms_default_tip1_1: string;
67
+ rhythms_default_tip1_2: string;
68
+ rhythms_default_tip1_3: string;
69
+ iKnow: string;
70
+ rhythm_on_tip: string;
71
+ };
72
+ };
73
+ export default _default;
@@ -0,0 +1,72 @@
1
+ export default {
2
+ zh: {
3
+ rhythms: '生物节律',
4
+ tip_rhythms_main: '生物节律开启后,灯光将在所选日期,全天自然地变化,其他的定时在日期内将不生效',
5
+ tip_rhythms_inside: '调整生物节律可以让灯在不同的时间自动调整让您的照明感受更加舒适',
6
+ timing_conflicts_tip: '打开生物节律则关闭以下定时',
7
+ rhythms_1: '日出',
8
+ rhythms_2: '正午',
9
+ rhythms_3: '日落',
10
+ rhythms_4: '入睡',
11
+ rhythmsMode_0: '默认',
12
+ rhythmsMode_1: '自然',
13
+ rhythmsMode_2: '自定义',
14
+ select_location: '选择位置',
15
+ city: '夏威夷,美国',
16
+ position_tip: '请开启定位',
17
+ longitude: '经度',
18
+ latitude: '纬度',
19
+ rhythms_reset_tip: '您确定要重置生物节律吗?',
20
+ rhythm_time_repeat: '设置的时间与其他有效节点时间相差必须大于等于15分钟',
21
+ rhythms_delete_tip: '您确定删除此节点?',
22
+ rhythm_valid_tip: '操作失败,至少需要有一个启效的节点',
23
+ gps_title: '选择位置',
24
+ rhythms_main_tip: '生物节律功能可以模拟一天当中灯光亮度和色温的变化,让我们感受回归自然的灯光。',
25
+ no_city_name: '该经纬度不支持',
26
+ rhythms_default_tip1_0: '日出时,灯光将在30min内慢慢亮起在日出时间点达到最亮。',
27
+ rhythms_default_tip1_1: '正午时,灯光将慢慢变成冷光,帮助人保持清醒更好地投入工作。',
28
+ rhythms_default_tip1_2: '日落时,灯光将慢慢变成暖光,让人进入休息状态。',
29
+ rhythms_default_tip1_3: '入睡时,灯光将在30min内慢慢变暗,在入睡时间点完全关灯。',
30
+ rhythms_default_name_0: '唤醒',
31
+ rhythms_default_name_1: '阳光',
32
+ rhythms_default_name_2: '舒适',
33
+ rhythms_default_name_3: '夜灯',
34
+ iKnow: '知道了',
35
+ rhythm_on_tip: '如有正在运行的定时,开启生物节律将关闭所有,请确认是否开启'
36
+ },
37
+ en: {
38
+ rhythms: 'Rhythms',
39
+ tip_rhythms_main: 'After the biorhythm is turned on, the light will change naturally throughout the day on the selected date, and other timings will not take effect within the date',
40
+ tip_rhythms_inside: 'Adjusting the biorhythm can make the lights automatically adjust at different times to make your lighting experience more comfortable',
41
+ timing_conflicts_tip: 'When biological rhythm is turned on, the following timings are turned off',
42
+ rhythms_1: 'Sunrise',
43
+ rhythms_2: 'Noon',
44
+ rhythms_3: 'Sunset',
45
+ rhythms_4: 'fall asleep',
46
+ rhythmsMode_0: 'Default',
47
+ rhythmsMode_1: 'Natural',
48
+ rhythmsMode_2: 'Custom',
49
+ select_location: 'Select location',
50
+ city: 'Hawaii,USA',
51
+ position_tip: 'Please turn on position',
52
+ longitude: 'Lon',
53
+ latitude: 'Lat',
54
+ rhythms_reset_tip: 'Are you sure reset rhythms?',
55
+ rhythm_time_repeat: 'The difference between the set time and the time of other valid nodes must be 15 minutes or more.',
56
+ rhythms_delete_tip: 'Are you sure delete rhythm?',
57
+ rhythm_valid_tip: 'Operation failed, at least one active node is required',
58
+ gps_title: 'Select Position',
59
+ rhythms_main_tip: 'The biorhythm function can simulate the changes in the brightness and color temperature of the light during the day, allowing us to feel the light returning to nature.',
60
+ no_city_name: 'The latitude and longitude are not supported',
61
+ rhythms_default_name_0: 'Wake',
62
+ rhythms_default_name_1: 'Sunlight',
63
+ rhythms_default_name_2: 'Comfortable',
64
+ rhythms_default_name_3: 'Night light',
65
+ rhythms_default_tip1_0: 'At sunrise, the lights will slowly turn on within 30 minutes and reach maximum brightness at sunrise time.',
66
+ rhythms_default_tip1_1: 'At noon, the light will slowly turn to cool light, helping people stay awake and work better.',
67
+ rhythms_default_tip1_2: 'At sunset, the light will slowly become warm light, let a person into a state of rest.',
68
+ rhythms_default_tip1_3: 'When you fall asleep, the light will gradually dim in 30 minutes, and completely turn off the light at bedtime.',
69
+ iKnow: 'I Know',
70
+ rhythm_on_tip: 'Turning on biorhythms will turn off all currently executing schedules. Confirm whether you want to turn them on.'
71
+ }
72
+ };
@@ -0,0 +1,73 @@
1
+ declare const _default: {
2
+ en: {
3
+ rhythms: string;
4
+ tip_rhythms_main: string;
5
+ tip_rhythms_inside: string;
6
+ timing_conflicts_tip: string;
7
+ rhythms_1: string;
8
+ rhythms_2: string;
9
+ rhythms_3: string;
10
+ rhythms_4: string;
11
+ rhythmsMode_0: string;
12
+ rhythmsMode_1: string;
13
+ rhythmsMode_2: string;
14
+ select_location: string;
15
+ city: string;
16
+ position_tip: string;
17
+ longitude: string;
18
+ latitude: string;
19
+ rhythms_reset_tip: string;
20
+ rhythm_time_repeat: string;
21
+ rhythms_delete_tip: string;
22
+ rhythm_valid_tip: string;
23
+ gps_title: string;
24
+ rhythms_main_tip: string;
25
+ no_city_name: string;
26
+ rhythms_default_name_0: string;
27
+ rhythms_default_name_1: string;
28
+ rhythms_default_name_2: string;
29
+ rhythms_default_name_3: string;
30
+ rhythms_default_tip1_0: string;
31
+ rhythms_default_tip1_1: string;
32
+ rhythms_default_tip1_2: string;
33
+ rhythms_default_tip1_3: string;
34
+ iKnow: string;
35
+ rhythm_on_tip: string;
36
+ };
37
+ zh: {
38
+ rhythms: string;
39
+ tip_rhythms_main: string;
40
+ tip_rhythms_inside: string;
41
+ timing_conflicts_tip: string;
42
+ rhythms_1: string;
43
+ rhythms_2: string;
44
+ rhythms_3: string;
45
+ rhythms_4: string;
46
+ rhythmsMode_0: string;
47
+ rhythmsMode_1: string;
48
+ rhythmsMode_2: string;
49
+ select_location: string;
50
+ city: string;
51
+ position_tip: string;
52
+ longitude: string;
53
+ latitude: string;
54
+ rhythms_reset_tip: string;
55
+ rhythm_time_repeat: string;
56
+ rhythms_delete_tip: string;
57
+ rhythm_valid_tip: string;
58
+ gps_title: string;
59
+ rhythms_main_tip: string;
60
+ no_city_name: string;
61
+ rhythms_default_tip1_0: string;
62
+ rhythms_default_tip1_1: string;
63
+ rhythms_default_tip1_2: string;
64
+ rhythms_default_tip1_3: string;
65
+ rhythms_default_name_0: string;
66
+ rhythms_default_name_1: string;
67
+ rhythms_default_name_2: string;
68
+ rhythms_default_name_3: string;
69
+ iKnow: string;
70
+ rhythm_on_tip: string;
71
+ };
72
+ };
73
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import rhythms from './rhythms';
3
+ export default {
4
+ en: _objectSpread({}, rhythms.en),
5
+ zh: _objectSpread({}, rhythms.zh)
6
+ };
package/lib/index.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ /** Hooks */
2
+ export { useRhythmsDp } from './hooks/useRhythmsDp';
3
+ export { useCountdownDp } from './hooks/useCountdownDp';
4
+ export { useCountdownDpPull } from './hooks/useCountdownDp';
5
+ export { useCloudTimerListFlush, useRtcTimerListFlush } from './hooks/useTimerFlushList';
6
+ export { useTimerListFlush } from './hooks/useTimerFlushList';
7
+ /** 定时操作 兼容云定时和本地定时 */
8
+ export { useTimerAdd, useTimerAddWithFlush, useTimerRemove, useTimerRemoveWithFlush, useTimerUpdate, useTimerUpdateWithFlush, useTimerUpdateStatus, useTimerUpdateStatusWithFlush, useTimerList, } from './hooks/useTimerOperate';
9
+ /** 云定时 */
10
+ export { useCloudTimerAdd, useCloudTimerList, useCloudTimerRemove, useCloudTimerUpdate, } from './hooks/useTimerOperateCloud';
11
+ /** 本地定时 */
12
+ export { useLocalTimerAdd, useLocalTimerList, useLocalTimerRemove, useLocalTimerUpdate, } from './hooks/useTimerOperateLocal';
13
+ export { useSupportCloudTimer, useSupportLocalTimer } from './hooks/useTimerSupport';
14
+ export { useSupport, useScheduleInit, getSupportIns } from './hooks/useCommonSupport';
15
+ export { useHourType, useSafeArea, useIsIOS, useHideMenu } from './hooks/useCommon';
16
+ export { useTimerDp } from './hooks/useTimerDp';
17
+ export { useSleepDp } from './hooks/useSleepDp';
18
+ export { useWakeUpDp } from './hooks/useWakeUpDp';
19
+ export { useRandomDp } from './hooks/useRandomDp';
20
+ export { useCycleDp } from './hooks/useCycleDp';
21
+ export { useWakeUpSupport } from './hooks/useWakeUpSupport';
22
+ export { useBaseLightDp, useFetchDpDataByMesh, getDpDataByMesh } from './hooks/useBaseLightDp';
23
+ export { useTimerReportDp, useTimerReportDpPull } from './hooks/useTimerReportDp';
24
+ /** Conflict 冲突判断 */
25
+ export { transScheduleListToConflictList } from './conflict/transform';
26
+ export { Conflict } from './conflict';
27
+ /** Utils */
28
+ export { getDpCodeByDpId, getDpIdByDpCode } from './utils/ScheduleUtils';
29
+ export { getCachedSystemInfo } from './utils/getCachedSystemInfo';
30
+ export { ScheduleLogger } from './utils/ScheduleLogger';
31
+ export { emitter } from './utils/ScheduleEmit';
32
+ export { useLocalTimerCloudProperty, useCloudProperty } from './utils/ScheduleCloudProperty';
33
+ export { getBitValue } from './utils/ScheduleSupport';
34
+ /** 定时数据缓存函数 */
35
+ export { ScheduleCache, devIdOrGroupIdCache, getScheduleCache, setScheduleCache, getScheduleCacheAll, clearScheduleCache, removeScheduleCache, } from './utils/ScheduleCache';
36
+ export { initStorage, getStorageIns } from './utils/storage';
37
+ export { getSafeAreaPadding, findMinMissingNum, isNum, isIOS } from './utils/common';
38
+ /** 跳转到定时功能页 */
39
+ export { navigateToSchedule, useScheduleDataFromMiniApp, navigateToMainApp, functionalTransDataEventKey, } from './utils/ScheduleDataSync';
40
+ /** dp 解析函数 */
41
+ export { rtcTimerParser, getSleepParser, getWakeUpParser, getRtcParser, getRhythmParser, getRandomParser, getCycleParser, rhythmParser, randomParser, autoDispatchTransDpFun, } from './dpParser';
42
+ export { timerReportParser } from './dpParser/timerReport';
43
+ /** Context */
44
+ export { ContextProviderTimer as TimerContextProvider, useTimerContext, getTimerState, } from './context/timer/context';
45
+ export { useRhythmContext, getRhythmsState, ContextProvider as RhythmsContextProvider, } from './context/rhythms';
46
+ export { useScheduleContext, ContextProviderSchedule as ScheduleContextProvider, getScheduleState, } from './context/schedule/context';
47
+ /** Constant key */
48
+ export { COMPONENT_NAME, LOG_PREFIX, LOCAL_TIMER_CATEGORY } from './constant';
49
+ /** 其它 */
50
+ export * from './types';
51
+ export { scheduleDpCodes, defaultRhythms } from './config';
package/lib/index.js ADDED
@@ -0,0 +1,64 @@
1
+ /** Hooks */
2
+ export { useRhythmsDp } from './hooks/useRhythmsDp';
3
+ export { useCountdownDp } from './hooks/useCountdownDp';
4
+ export { useCountdownDpPull } from './hooks/useCountdownDp';
5
+ export { useCloudTimerListFlush, useRtcTimerListFlush } from './hooks/useTimerFlushList';
6
+ export { useTimerListFlush } from './hooks/useTimerFlushList';
7
+
8
+ // Hooks 统一操作定时的增删改查
9
+
10
+ /** 定时操作 兼容云定时和本地定时 */
11
+ export { useTimerAdd, useTimerAddWithFlush, useTimerRemove, useTimerRemoveWithFlush, useTimerUpdate, useTimerUpdateWithFlush, useTimerUpdateStatus, useTimerUpdateStatusWithFlush, useTimerList } from './hooks/useTimerOperate';
12
+
13
+ /** 云定时 */
14
+ export { useCloudTimerAdd, useCloudTimerList, useCloudTimerRemove, useCloudTimerUpdate } from './hooks/useTimerOperateCloud';
15
+
16
+ /** 本地定时 */
17
+ export { useLocalTimerAdd, useLocalTimerList, useLocalTimerRemove, useLocalTimerUpdate } from './hooks/useTimerOperateLocal';
18
+ export { useSupportCloudTimer, useSupportLocalTimer } from './hooks/useTimerSupport';
19
+ export { useSupport, useScheduleInit, getSupportIns } from './hooks/useCommonSupport';
20
+ export { useHourType, useSafeArea, useIsIOS, useHideMenu } from './hooks/useCommon';
21
+ export { useTimerDp } from './hooks/useTimerDp';
22
+ export { useSleepDp } from './hooks/useSleepDp';
23
+ export { useWakeUpDp } from './hooks/useWakeUpDp';
24
+ export { useRandomDp } from './hooks/useRandomDp';
25
+ export { useCycleDp } from './hooks/useCycleDp';
26
+ export { useWakeUpSupport } from './hooks/useWakeUpSupport';
27
+ export { useBaseLightDp, useFetchDpDataByMesh, getDpDataByMesh } from './hooks/useBaseLightDp';
28
+ export { useTimerReportDp, useTimerReportDpPull } from './hooks/useTimerReportDp';
29
+
30
+ /** Conflict 冲突判断 */
31
+ export { transScheduleListToConflictList } from './conflict/transform';
32
+ export { Conflict } from './conflict';
33
+
34
+ /** Utils */
35
+ export { getDpCodeByDpId, getDpIdByDpCode } from './utils/ScheduleUtils';
36
+ export { getCachedSystemInfo } from './utils/getCachedSystemInfo';
37
+ export { ScheduleLogger } from './utils/ScheduleLogger';
38
+ export { emitter } from './utils/ScheduleEmit';
39
+ export { useLocalTimerCloudProperty, useCloudProperty } from './utils/ScheduleCloudProperty';
40
+ export { getBitValue } from './utils/ScheduleSupport';
41
+
42
+ /** 定时数据缓存函数 */
43
+ export { ScheduleCache, devIdOrGroupIdCache, getScheduleCache, setScheduleCache, getScheduleCacheAll, clearScheduleCache, removeScheduleCache } from './utils/ScheduleCache';
44
+ export { initStorage, getStorageIns } from './utils/storage';
45
+ export { getSafeAreaPadding, findMinMissingNum, isNum, isIOS } from './utils/common';
46
+
47
+ /** 跳转到定时功能页 */
48
+ export { navigateToSchedule, useScheduleDataFromMiniApp, navigateToMainApp, functionalTransDataEventKey } from './utils/ScheduleDataSync';
49
+
50
+ /** dp 解析函数 */
51
+ export { rtcTimerParser, getSleepParser, getWakeUpParser, getRtcParser, getRhythmParser, getRandomParser, getCycleParser, rhythmParser, randomParser, autoDispatchTransDpFun } from './dpParser';
52
+ export { timerReportParser } from './dpParser/timerReport';
53
+
54
+ /** Context */
55
+ export { ContextProviderTimer as TimerContextProvider, useTimerContext, getTimerState } from './context/timer/context';
56
+ export { useRhythmContext, getRhythmsState, ContextProvider as RhythmsContextProvider } from './context/rhythms';
57
+ export { useScheduleContext, ContextProviderSchedule as ScheduleContextProvider, getScheduleState } from './context/schedule/context';
58
+
59
+ /** Constant key */
60
+ export { COMPONENT_NAME, LOG_PREFIX, LOCAL_TIMER_CATEGORY } from './constant';
61
+
62
+ /** 其它 */
63
+ export * from './types';
64
+ export { scheduleDpCodes, defaultRhythms } from './config';
@@ -0,0 +1,3 @@
1
+ export type TCountdownSchedule = {
2
+ countdown: number;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export type TCycleData = {
2
+ version: number;
3
+ length: number;
4
+ nodes: TCycleNode[];
5
+ };
6
+ export type TCycleNode = {
7
+ onOff: boolean;
8
+ channel: number;
9
+ loops: string;
10
+ startTime: number;
11
+ startTimeDuration: number;
12
+ endTime: number;
13
+ endTimeDuration: number;
14
+ index: number;
15
+ color: {
16
+ hue: number;
17
+ saturation: number;
18
+ value: number;
19
+ brightness: number;
20
+ temperature: number;
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ // 全局类型声明
2
+
3
+ declare global {
4
+ interface Window {
5
+ localStorage: Storage;
6
+ }
7
+ }
8
+
9
+ export {};