@coze-arch/cli 0.0.1-alpha.c53937 → 0.0.1-alpha.c7a03c

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 (75) hide show
  1. package/lib/__templates__/expo/.coze +3 -3
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +220 -0
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +3 -4
  6. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +45 -0
  7. package/lib/__templates__/expo/README.md +68 -7
  8. package/lib/__templates__/expo/_gitignore +1 -1
  9. package/lib/__templates__/expo/_npmrc +2 -4
  10. package/lib/__templates__/expo/client/app/_layout.tsx +14 -14
  11. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  12. package/lib/__templates__/expo/client/app.config.ts +76 -0
  13. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  14. package/lib/__templates__/expo/client/components/ThemedView.tsx +38 -0
  15. package/lib/__templates__/expo/client/constants/theme.ts +454 -60
  16. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  17. package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +13 -10
  18. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +34 -1
  19. package/lib/__templates__/expo/client/metro.config.js +121 -0
  20. package/lib/__templates__/expo/client/package.json +93 -0
  21. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  22. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  23. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  24. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  25. package/lib/__templates__/expo/client/utils/index.ts +22 -0
  26. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  27. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +2486 -0
  28. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +155 -0
  29. package/lib/__templates__/expo/package.json +8 -107
  30. package/lib/__templates__/expo/pnpm-lock.yaml +451 -867
  31. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  32. package/lib/__templates__/expo/server/build.js +21 -0
  33. package/lib/__templates__/expo/server/package.json +32 -0
  34. package/lib/__templates__/expo/{src → server/src}/index.ts +8 -2
  35. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  36. package/lib/__templates__/expo/template.config.js +1 -0
  37. package/lib/__templates__/expo/tsconfig.json +1 -24
  38. package/lib/__templates__/nextjs/.coze +1 -0
  39. package/lib/__templates__/nextjs/_npmrc +1 -0
  40. package/lib/__templates__/nextjs/next.config.ts +12 -0
  41. package/lib/__templates__/nextjs/package.json +3 -2
  42. package/lib/__templates__/nextjs/pnpm-lock.yaml +13 -5
  43. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  44. package/lib/__templates__/nextjs/src/app/globals.css +109 -89
  45. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -12
  46. package/lib/__templates__/nextjs/src/app/page.tsx +35 -23
  47. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  48. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  49. package/lib/__templates__/nextjs/template.config.js +30 -0
  50. package/lib/__templates__/templates.json +61 -43
  51. package/lib/__templates__/vite/.coze +1 -0
  52. package/lib/__templates__/vite/_npmrc +1 -0
  53. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  54. package/lib/__templates__/vite/package.json +5 -1
  55. package/lib/__templates__/vite/pnpm-lock.yaml +3481 -14
  56. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  57. package/lib/__templates__/vite/src/main.ts +1 -2
  58. package/lib/__templates__/vite/template.config.js +28 -4
  59. package/lib/cli.js +201 -57
  60. package/package.json +8 -3
  61. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -109
  62. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -235
  63. package/lib/__templates__/expo/app.json +0 -63
  64. package/lib/__templates__/expo/babel.config.js +0 -19
  65. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  66. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  67. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  68. package/lib/__templates__/expo/client/app/+not-found.tsx +0 -79
  69. package/lib/__templates__/expo/client/index.js +0 -12
  70. package/lib/__templates__/expo/client/screens/home/index.tsx +0 -51
  71. package/lib/__templates__/expo/client/screens/home/styles.ts +0 -60
  72. package/lib/__templates__/expo/metro.config.js +0 -51
  73. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  74. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  75. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
@@ -1,40 +1,73 @@
1
- import { Platform } from "react-native";
2
-
3
- const tintColorLight = "#007AFF";
4
- const tintColorDark = "#0A84FF";
1
+ import { Platform, StyleSheet } from "react-native";
5
2
 
6
3
  export const Colors = {
7
4
  light: {
8
- text: "#11181C",
9
- textPrimary: "#11181C",
10
- textSecondary: "#687076",
11
- textMuted: "#9BA1A6",
12
- buttonText: "#FFFFFF",
13
- tabIconDefault: "#687076",
14
- tabIconSelected: tintColorLight,
15
- primary: tintColorLight,
16
- link: "#007AFF",
17
- backgroundRoot: "#FFFFFF", // Elevation 0
18
- backgroundDefault: "#F2F2F2", // Elevation 1
19
- backgroundSecondary: "#E6E6E6", // Elevation 2
20
- backgroundTertiary: "#D9D9D9", // Elevation 3
21
- border: "#E6E6E6",
5
+ background: '#ffffff',
6
+ foreground: '#0a0a0a',
7
+ card: '#ffffff',
8
+ cardForeground: '#0a0a0a',
9
+ popover: '#ffffff',
10
+ popoverForeground: '#0a0a0a',
11
+ primary: '#171717',
12
+ primaryForeground: '#fafafa',
13
+ secondary: '#f5f5f5',
14
+ secondaryForeground: '#171717',
15
+ muted: '#f5f5f5',
16
+ mutedForeground: '#737373',
17
+ accent: '#f5f5f5',
18
+ accentForeground: '#171717',
19
+ destructive: '#e7000b',
20
+ destructiveForeground: '#ffffff',
21
+ border: '#e5e5e5',
22
+ input: '#e5e5e5',
23
+ ring: '#a1a1a1',
24
+ chart1: '#91c5ff',
25
+ chart2: '#3a81f6',
26
+ chart3: '#2563ef',
27
+ chart4: '#1a4eda',
28
+ chart5: '#1f3fad',
29
+ sidebar: '#fafafa',
30
+ sidebarForeground: '#0a0a0a',
31
+ sidebarPrimary: '#171717',
32
+ sidebarPrimaryForeground: '#fafafa',
33
+ sidebarAccent: '#f5f5f5',
34
+ sidebarAccentForeground: '#171717',
35
+ sidebarBorder: '#e5e5e5',
36
+ sidebarRing: '#a1a1a1',
22
37
  },
23
38
  dark: {
24
- text: "#ECEDEE",
25
- textPrimary: "#ECEDEE",
26
- textSecondary: "#9BA1A6",
27
- textMuted: "#6F767E",
28
- buttonText: "#FFFFFF",
29
- tabIconDefault: "#9BA1A6",
30
- tabIconSelected: tintColorDark,
31
- primary: tintColorDark,
32
- link: "#0A84FF",
33
- backgroundRoot: "#1F2123", // Elevation 0
34
- backgroundDefault: "#2A2C2E", // Elevation 1
35
- backgroundSecondary: "#353739", // Elevation 2
36
- backgroundTertiary: "#404244", // Elevation 3
37
- border: "#353739",
39
+ background: '#0a0a0a',
40
+ foreground: '#fafafa',
41
+ card: '#171717',
42
+ cardForeground: '#fafafa',
43
+ popover: '#262626',
44
+ popoverForeground: '#fafafa',
45
+ primary: '#e5e5e5',
46
+ primaryForeground: '#171717',
47
+ secondary: '#262626',
48
+ secondaryForeground: '#fafafa',
49
+ muted: '#262626',
50
+ mutedForeground: '#a1a1a1',
51
+ accent: '#404040',
52
+ accentForeground: '#fafafa',
53
+ destructive: '#ff6467',
54
+ destructiveForeground: '#fafafa',
55
+ border: '#282828',
56
+ input: '#343434',
57
+ ring: '#737373',
58
+ chart1: '#91c5ff',
59
+ chart2: '#3a81f6',
60
+ chart3: '#2563ef',
61
+ chart4: '#1a4eda',
62
+ chart5: '#1f3fad',
63
+ sidebar: '#171717',
64
+ sidebarForeground: '#fafafa',
65
+ sidebarPrimary: '#1447e6',
66
+ sidebarPrimaryForeground: '#fafafa',
67
+ sidebarAccent: '#262626',
68
+ sidebarAccentForeground: '#fafafa',
69
+ sidebarBorder: '#282828',
70
+ sidebarRing: '#525252',
38
71
  },
39
72
  };
40
73
 
@@ -48,22 +81,48 @@ export const Spacing = {
48
81
  "3xl": 32,
49
82
  "4xl": 40,
50
83
  "5xl": 48,
84
+ "6xl": 64,
51
85
  inputHeight: 48,
52
- buttonHeight: 52,
86
+ buttonHeight: 48,
87
+ avatarSize: 40,
88
+ iconButtonSize: 32,
89
+ contentPaddingHorizontal: 32,
90
+ sectionGap: 40,
91
+ sectionGapLarge: 48,
92
+ itemGap: 8,
93
+ detailGap: 48,
94
+ chartHeight: 128,
53
95
  };
54
96
 
55
97
  export const BorderRadius = {
56
- xs: 8,
57
- sm: 12,
58
- md: 18,
59
- lg: 24,
60
- xl: 30,
61
- "2xl": 40,
62
- "3xl": 50,
98
+ xs: 4,
99
+ sm: 8,
100
+ md: 12,
101
+ lg: 16,
102
+ xl: 20,
103
+ "2xl": 24,
104
+ "3xl": 40,
63
105
  full: 9999,
64
106
  };
65
107
 
66
108
  export const Typography = {
109
+ display: {
110
+ fontSize: 112,
111
+ lineHeight: 112,
112
+ fontWeight: "200" as const,
113
+ letterSpacing: -4,
114
+ },
115
+ displayLarge: {
116
+ fontSize: 112,
117
+ lineHeight: 112,
118
+ fontWeight: "200" as const,
119
+ letterSpacing: -2,
120
+ },
121
+ displayMedium: {
122
+ fontSize: 48,
123
+ lineHeight: 56,
124
+ fontWeight: "200" as const,
125
+ },
67
126
  h1: {
68
127
  fontSize: 32,
69
128
  lineHeight: 40,
@@ -77,52 +136,387 @@ export const Typography = {
77
136
  h3: {
78
137
  fontSize: 24,
79
138
  lineHeight: 32,
80
- fontWeight: "600" as const,
139
+ fontWeight: "300" as const,
81
140
  },
82
141
  h4: {
83
142
  fontSize: 20,
84
143
  lineHeight: 28,
85
144
  fontWeight: "600" as const,
86
145
  },
146
+ title: {
147
+ fontSize: 18,
148
+ lineHeight: 24,
149
+ fontWeight: "700" as const,
150
+ },
87
151
  body: {
88
152
  fontSize: 16,
89
153
  lineHeight: 24,
90
154
  fontWeight: "400" as const,
91
155
  },
156
+ bodyMedium: {
157
+ fontSize: 16,
158
+ lineHeight: 24,
159
+ fontWeight: "500" as const,
160
+ },
92
161
  small: {
93
162
  fontSize: 14,
94
163
  lineHeight: 20,
95
164
  fontWeight: "400" as const,
96
165
  },
166
+ smallMedium: {
167
+ fontSize: 14,
168
+ lineHeight: 20,
169
+ fontWeight: "500" as const,
170
+ },
171
+ caption: {
172
+ fontSize: 12,
173
+ lineHeight: 16,
174
+ fontWeight: "400" as const,
175
+ },
176
+ captionMedium: {
177
+ fontSize: 12,
178
+ lineHeight: 16,
179
+ fontWeight: "500" as const,
180
+ },
181
+ label: {
182
+ fontSize: 14,
183
+ lineHeight: 20,
184
+ fontWeight: "500" as const,
185
+ letterSpacing: 2,
186
+ textTransform: "uppercase" as const,
187
+ },
188
+ labelSmall: {
189
+ fontSize: 12,
190
+ lineHeight: 16,
191
+ fontWeight: "500" as const,
192
+ letterSpacing: 1,
193
+ textTransform: "uppercase" as const,
194
+ },
195
+ labelTitle: {
196
+ fontSize: 14,
197
+ lineHeight: 20,
198
+ fontWeight: "700" as const,
199
+ letterSpacing: 2,
200
+ textTransform: "uppercase" as const,
201
+ },
97
202
  link: {
98
203
  fontSize: 16,
99
204
  lineHeight: 24,
100
205
  fontWeight: "400" as const,
101
206
  },
207
+ stat: {
208
+ fontSize: 30,
209
+ lineHeight: 36,
210
+ fontWeight: "300" as const,
211
+ },
212
+ tiny: {
213
+ fontSize: 10,
214
+ lineHeight: 14,
215
+ fontWeight: "400" as const,
216
+ },
217
+ navLabel: {
218
+ fontSize: 10,
219
+ lineHeight: 14,
220
+ fontWeight: "500" as const,
221
+ },
102
222
  };
103
223
 
104
224
  export const Fonts = Platform.select({
105
225
  ios: {
106
- /** iOS `UIFontDescriptorSystemDesignDefault` */
107
- sans: "system-ui",
108
- /** iOS `UIFontDescriptorSystemDesignSerif` */
109
- serif: "ui-serif",
110
- /** iOS `UIFontDescriptorSystemDesignRounded` */
111
- rounded: "ui-rounded",
112
- /** iOS `UIFontDescriptorSystemDesignMonospaced` */
113
- mono: "ui-monospace",
226
+ sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
227
+ },
228
+ android: {
229
+ sans: "Roboto, 'Segoe UI', Helvetica, Arial, sans-serif",
114
230
  },
115
231
  default: {
116
- sans: "normal",
117
- serif: "serif",
118
- rounded: "normal",
119
- mono: "monospace",
120
- },
121
- web: {
122
- sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
123
- serif: "Georgia, 'Times New Roman', serif",
124
- rounded:
125
- "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif",
126
- mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
232
+ sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
233
+ },
234
+ });
235
+
236
+ export const Shadow = {
237
+ none: {},
238
+ minimal: Platform.select({
239
+ ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 2 },
240
+ android: { elevation: 1 },
241
+ default: {},
242
+ }),
243
+ sm: Platform.select({
244
+ ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 2 },
245
+ android: { elevation: 1 },
246
+ default: {},
247
+ }),
248
+ md: Platform.select({
249
+ ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 4 },
250
+ android: { elevation: 3 },
251
+ default: {},
252
+ }),
253
+ lg: Platform.select({
254
+ ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.15, shadowRadius: 8 },
255
+ android: { elevation: 6 },
256
+ default: {},
257
+ }),
258
+ island: Platform.select({
259
+ ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.1, shadowRadius: 20 },
260
+ android: { elevation: 8 },
261
+ default: {},
262
+ }),
263
+ };
264
+
265
+ export const Duration = {
266
+ fast: 150,
267
+ normal: 250,
268
+ slow: 400,
269
+ };
270
+
271
+ export const ZIndex = {
272
+ base: 0,
273
+ dropdown: 100,
274
+ sticky: 200,
275
+ modal: 300,
276
+ toast: 400,
277
+ overlay: 500,
278
+ };
279
+
280
+ export type Theme = typeof Colors.light;
281
+
282
+ export const CommonStyles = StyleSheet.create({
283
+ container: {
284
+ flex: 1,
285
+ },
286
+ scrollContent: {
287
+ paddingHorizontal: Spacing.contentPaddingHorizontal,
288
+ },
289
+ centerContent: {
290
+ justifyContent: "center",
291
+ alignItems: "center",
292
+ },
293
+ row: {
294
+ flexDirection: "row",
295
+ alignItems: "center",
296
+ },
297
+ rowGap: {
298
+ flexDirection: "row",
299
+ alignItems: "center",
300
+ gap: Spacing.sm,
301
+ },
302
+ rowBetween: {
303
+ flexDirection: "row",
304
+ justifyContent: "space-between",
305
+ alignItems: "center",
306
+ },
307
+ rowBetweenEnd: {
308
+ flexDirection: "row",
309
+ justifyContent: "space-between",
310
+ alignItems: "flex-end",
311
+ },
312
+ rowBetweenStart: {
313
+ flexDirection: "row",
314
+ justifyContent: "space-between",
315
+ alignItems: "flex-start",
316
+ },
317
+ rowCenter: {
318
+ flexDirection: "row",
319
+ justifyContent: "center",
320
+ alignItems: "center",
321
+ },
322
+ rowCenterGap: {
323
+ flexDirection: "row",
324
+ justifyContent: "center",
325
+ alignItems: "center",
326
+ gap: Spacing.detailGap,
327
+ },
328
+ column: {
329
+ flexDirection: "column",
330
+ },
331
+ columnCenter: {
332
+ flexDirection: "column",
333
+ alignItems: "center",
334
+ },
335
+ flex1: {
336
+ flex: 1,
337
+ },
338
+ textCenter: {
339
+ textAlign: "center",
340
+ },
341
+ avatar: {
342
+ width: Spacing.avatarSize,
343
+ height: Spacing.avatarSize,
344
+ borderRadius: Spacing.avatarSize / 2,
345
+ borderWidth: 1,
346
+ justifyContent: "center",
347
+ alignItems: "center",
348
+ },
349
+ iconButton: {
350
+ width: Spacing.iconButtonSize,
351
+ height: Spacing.iconButtonSize,
352
+ borderRadius: Spacing.iconButtonSize / 2,
353
+ justifyContent: "center",
354
+ alignItems: "center",
355
+ },
356
+ button: {
357
+ flexDirection: "row",
358
+ alignItems: "center",
359
+ justifyContent: "center",
360
+ gap: Spacing.sm,
361
+ paddingHorizontal: Spacing.contentPaddingHorizontal,
362
+ paddingVertical: Spacing.md,
363
+ borderWidth: 1,
364
+ borderRadius: BorderRadius.full,
365
+ },
366
+ buttonSmall: {
367
+ flexDirection: "row",
368
+ alignItems: "center",
369
+ justifyContent: "center",
370
+ gap: Spacing.sm,
371
+ paddingHorizontal: Spacing.lg,
372
+ paddingVertical: Spacing.sm,
373
+ borderRadius: BorderRadius.sm,
374
+ },
375
+ card: {
376
+ borderRadius: BorderRadius.xl,
377
+ padding: Spacing.sm,
378
+ },
379
+ chartContainer: {
380
+ height: Spacing.chartHeight,
381
+ borderRadius: BorderRadius.xl,
382
+ padding: Spacing.sm,
383
+ borderWidth: 1,
384
+ position: "relative",
385
+ },
386
+ chartGrid: {
387
+ position: "absolute",
388
+ top: 0,
389
+ left: 0,
390
+ right: 0,
391
+ bottom: 0,
392
+ padding: Spacing.lg,
393
+ justifyContent: "space-between",
394
+ },
395
+ chartEmpty: {
396
+ flex: 1,
397
+ justifyContent: "center",
398
+ alignItems: "center",
399
+ },
400
+ progressBar: {
401
+ width: "100%",
402
+ height: 2,
403
+ borderRadius: 1,
404
+ overflow: "hidden",
405
+ marginTop: Spacing.sm,
406
+ },
407
+ progressFill: {
408
+ height: "100%",
409
+ borderRadius: 1,
410
+ },
411
+ divider: {
412
+ height: 1,
413
+ width: "100%",
414
+ },
415
+ dividerVertical: {
416
+ width: 1,
417
+ height: "100%",
418
+ },
419
+ dot: {
420
+ width: 4,
421
+ height: 4,
422
+ borderRadius: 2,
423
+ },
424
+ absoluteFill: {
425
+ position: "absolute",
426
+ top: 0,
427
+ left: 0,
428
+ right: 0,
429
+ bottom: 0,
430
+ },
431
+ tooltip: {
432
+ paddingHorizontal: Spacing.sm,
433
+ paddingVertical: Spacing.xs,
434
+ borderRadius: BorderRadius.xs,
435
+ },
436
+ emptyState: {
437
+ alignItems: "center",
438
+ paddingVertical: Spacing["2xl"],
439
+ },
440
+ section: {
441
+ marginBottom: Spacing.sectionGap,
442
+ },
443
+ sectionLarge: {
444
+ marginBottom: Spacing.sectionGapLarge,
445
+ },
446
+ sectionHeader: {
447
+ flexDirection: "row",
448
+ justifyContent: "space-between",
449
+ alignItems: "flex-end",
450
+ marginBottom: Spacing["2xl"],
451
+ },
452
+ gridLine: {
453
+ width: "100%",
454
+ height: 1,
455
+ borderTopWidth: 1,
456
+ borderStyle: "dashed",
457
+ },
458
+ statsGrid: {
459
+ flexDirection: "row",
460
+ },
461
+ statsColumn: {
462
+ flex: 1,
463
+ },
464
+ statsColumnLeft: {
465
+ paddingRight: Spacing.lg,
466
+ },
467
+ statsColumnRight: {
468
+ paddingLeft: Spacing.contentPaddingHorizontal,
469
+ borderLeftWidth: 1,
470
+ },
471
+ statsHeader: {
472
+ flexDirection: "row",
473
+ justifyContent: "space-between",
474
+ alignItems: "flex-start",
475
+ marginBottom: Spacing.lg,
476
+ },
477
+ detailItem: {
478
+ alignItems: "center",
479
+ },
480
+ header: {
481
+ flexDirection: "row",
482
+ justifyContent: "space-between",
483
+ alignItems: "flex-end",
484
+ paddingBottom: Spacing.lg,
485
+ },
486
+ loadingContainer: {
487
+ flex: 1,
488
+ justifyContent: "center",
489
+ alignItems: "center",
490
+ },
491
+ glucoseSection: {
492
+ marginTop: Spacing["2xl"],
493
+ marginBottom: Spacing.sectionGap,
494
+ alignItems: "center",
495
+ },
496
+ glucoseHeader: {
497
+ flexDirection: "row",
498
+ alignItems: "center",
499
+ gap: Spacing.sm,
500
+ marginBottom: Spacing.sm,
501
+ },
502
+ glucoseUnit: {
503
+ flexDirection: "row",
504
+ alignItems: "center",
505
+ gap: Spacing.sm,
506
+ marginTop: Spacing.sm,
507
+ },
508
+ glucoseDetails: {
509
+ flexDirection: "row",
510
+ justifyContent: "center",
511
+ gap: Spacing.detailGap,
512
+ marginTop: Spacing["2xl"],
127
513
  },
128
514
  });
515
+
516
+ export const createThemedStyles = (theme: Theme) => {
517
+ return StyleSheet.create({
518
+ container: {
519
+ ...CommonStyles.container,
520
+ },
521
+ });
522
+ };
@@ -0,0 +1,5 @@
1
+ // declarations.d.ts
2
+
3
+ declare module 'expo-file-system/legacy' {
4
+ export * from 'expo-file-system';
5
+ }
@@ -1,10 +1,11 @@
1
- import js from "@eslint/js";
2
- import globals from "globals";
3
- import tseslint from "typescript-eslint";
4
- import pluginReact from "eslint-plugin-react";
5
- import reactHooks from "eslint-plugin-react-hooks";
6
- import regexp from "eslint-plugin-regexp";
7
- import pluginImport from "eslint-plugin-import";
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import tseslint from 'typescript-eslint';
4
+ import pluginReact from 'eslint-plugin-react';
5
+ import reactHooks from 'eslint-plugin-react-hooks';
6
+ import regexp from 'eslint-plugin-regexp';
7
+ import pluginImport from 'eslint-plugin-import';
8
+ import fontawesome6 from '../eslint-plugins/fontawesome6/index.js';
8
9
 
9
10
  export default [
10
11
  {
@@ -20,14 +21,14 @@ export default [
20
21
  regexp.configs["flat/recommended"],
21
22
  js.configs.recommended,
22
23
  ...tseslint.configs.recommended,
23
-
24
+
24
25
  // React 的推荐配置
25
26
  pluginReact.configs.flat.recommended,
26
27
  pluginReact.configs.flat['jsx-runtime'],
27
28
  reactHooks.configs.flat.recommended,
28
29
  {
29
30
  files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
30
-
31
+
31
32
  // 语言选项:设置全局变量
32
33
  languageOptions: {
33
34
  globals: {
@@ -52,6 +53,7 @@ export default [
52
53
 
53
54
  plugins: {
54
55
  import: pluginImport,
56
+ fontawesome6,
55
57
  },
56
58
  rules: {
57
59
  // 关闭代码风格规则
@@ -70,6 +72,7 @@ export default [
70
72
  'no-prototype-builtins': 'off',
71
73
  'react/react-in-jsx-scope': 'off',
72
74
  'react/jsx-uses-react': 'off',
75
+ 'fontawesome6/valid-name': 'error',
73
76
  },
74
77
  },
75
78
 
@@ -91,7 +94,7 @@ export default [
91
94
  // 在 .js 文件中关闭 TS 规则
92
95
  '@typescript-eslint/no-require-imports': 'off',
93
96
  // 在 Node.js 文件中允许 require
94
- '@typescript-eslint/no-var-requires': 'off',
97
+ '@typescript-eslint/no-var-requires': 'off',
95
98
  'no-undef': 'off',
96
99
  },
97
100
  },
@@ -1 +1,34 @@
1
- export { useColorScheme } from "react-native";
1
+ import { useEffect, useState } from 'react';
2
+ import { ColorSchemeName, useColorScheme as useReactNativeColorScheme, Platform } from 'react-native';
3
+
4
+ export function useColorScheme() {
5
+ const systemColorScheme = useReactNativeColorScheme();
6
+ const [colorScheme, setColorScheme] = useState<ColorSchemeName>(systemColorScheme);
7
+
8
+ useEffect(() => {
9
+ setColorScheme(systemColorScheme);
10
+ }, [systemColorScheme])
11
+
12
+ useEffect(() => {
13
+ function handleMessage(e: MessageEvent<{ event: string; colorScheme: ColorSchemeName; } | undefined>) {
14
+ if (e.data?.event === 'coze.workbench.colorScheme') {
15
+ const cs = e.data.colorScheme;
16
+ if (typeof cs === 'string') {
17
+ setColorScheme(cs);
18
+ }
19
+ }
20
+ }
21
+
22
+ if (Platform.OS === 'web') {
23
+ window.addEventListener('message', handleMessage, false);
24
+ }
25
+
26
+ return () => {
27
+ if (Platform.OS === 'web') {
28
+ window.removeEventListener('message', handleMessage, false);
29
+ }
30
+ }
31
+ }, []);
32
+
33
+ return colorScheme;
34
+ }