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

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.
@@ -1,73 +1,35 @@
1
- import { Platform, StyleSheet } from "react-native";
2
-
3
1
  export const Colors = {
4
2
  light: {
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',
3
+ textPrimary: "#1C1917",
4
+ textSecondary: "#78716c",
5
+ textMuted: "#9CA3AF",
6
+ primary: "#4F46E5", // Indigo-600 - 品牌主色,代表科技与智能
7
+ accent: "#8B5CF6", // Violet-500 - 辅助色,代表创造力
8
+ success: "#10B981", // Emerald-500
9
+ error: "#EF4444",
10
+ backgroundRoot: "#FAFAFA",
11
+ backgroundDefault: "#FFFFFF",
12
+ backgroundTertiary: "#F9FAFB", // 更浅的背景色,用于去线留白
13
+ buttonPrimaryText: "#FFFFFF",
14
+ tabIconSelected: "#4F46E5",
15
+ border: "#E5E7EB",
16
+ borderLight: "#F3F4F6",
37
17
  },
38
18
  dark: {
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',
19
+ textPrimary: "#FAFAF9",
20
+ textSecondary: "#A8A29E",
21
+ textMuted: "#6F767E",
22
+ primary: "#818CF8", // Indigo-400 - 暗色模式品牌主色
23
+ accent: "#A78BFA", // Violet-400
24
+ success: "#34D399",
25
+ error: "#F87171",
26
+ backgroundRoot: "#09090B", // 更深的背景色
27
+ backgroundDefault: "#1C1C1E",
28
+ backgroundTertiary: "#1F1F22", // 暗色模式去线留白背景
29
+ buttonPrimaryText: "#09090B",
30
+ tabIconSelected: "#818CF8",
31
+ border: "#3F3F46",
32
+ borderLight: "#27272A",
71
33
  },
72
34
  };
73
35
 
@@ -82,27 +44,10 @@ export const Spacing = {
82
44
  "4xl": 40,
83
45
  "5xl": 48,
84
46
  "6xl": 64,
85
- inputHeight: 48,
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,
95
47
  };
96
48
 
97
49
  export const BorderRadius = {
98
- xs: 4,
99
- sm: 8,
100
- md: 12,
101
50
  lg: 16,
102
- xl: 20,
103
- "2xl": 24,
104
- "3xl": 40,
105
- full: 9999,
106
51
  };
107
52
 
108
53
  export const Typography = {
@@ -221,302 +166,4 @@ export const Typography = {
221
166
  },
222
167
  };
223
168
 
224
- export const Fonts = Platform.select({
225
- ios: {
226
- sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
227
- },
228
- android: {
229
- sans: "Roboto, 'Segoe UI', Helvetica, Arial, sans-serif",
230
- },
231
- default: {
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
169
  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"],
513
- },
514
- });
515
-
516
- export const createThemedStyles = (theme: Theme) => {
517
- return StyleSheet.create({
518
- container: {
519
- ...CommonStyles.container,
520
- },
521
- });
522
- };
@@ -16,6 +16,7 @@ export default [
16
16
  'src/api/**', // 排除 src 下的自动生成 API
17
17
  '.expo/**', // 排除 Expo 自动生成的文件
18
18
  'tailwind.config.js', // 排除 Tailwind 配置文件
19
+ '**/*.d.ts',
19
20
  ],
20
21
  },
21
22
  regexp.configs["flat/recommended"],
@@ -1,13 +1,33 @@
1
- import { Colors } from "@/constants/theme";
2
- import { useColorScheme } from "@/hooks/useColorScheme";
1
+ import { Colors } from '@/constants/theme';
2
+ import { useColorScheme } from '@/hooks/useColorScheme';
3
3
 
4
- export function useTheme() {
5
- const colorScheme = useColorScheme();
6
- const isDark = colorScheme === "dark";
7
- const theme = Colors[(colorScheme as "light" | "dark") ?? "light"];
4
+ enum COLOR_SCHEME_CHOICE {
5
+ FOLLOW_SYSTEM = 'follow-system', // 跟随系统自动变化
6
+ DARK = 'dark', // 固定为 dark 主题,不随系统变化
7
+ LIGHT = 'light', // 固定为 light 主题,不随系统变化
8
+ };
9
+
10
+ const userPreferColorScheme: COLOR_SCHEME_CHOICE = COLOR_SCHEME_CHOICE.FOLLOW_SYSTEM;
11
+
12
+ function getTheme(colorScheme?: 'dark' | 'light' | null) {
13
+ const isDark = colorScheme === 'dark';
14
+ const theme = Colors[colorScheme ?? 'light'];
8
15
 
9
16
  return {
10
17
  theme,
11
18
  isDark,
12
19
  };
13
20
  }
21
+
22
+ function useTheme() {
23
+ const systemColorScheme = useColorScheme()
24
+ const colorScheme = userPreferColorScheme === COLOR_SCHEME_CHOICE.FOLLOW_SYSTEM ?
25
+ systemColorScheme :
26
+ userPreferColorScheme;
27
+
28
+ return getTheme(colorScheme);
29
+ }
30
+
31
+ export {
32
+ useTheme,
33
+ }
@@ -6,7 +6,8 @@ const port = process.env.PORT || 9091;
6
6
 
7
7
  // Middleware
8
8
  app.use(cors());
9
- app.use(express.json());
9
+ app.use(express.json({ limit: '50mb' }));
10
+ app.use(express.urlencoded({ limit: '50mb', extended: true }));
10
11
 
11
12
  app.get('/api/v1/health', (req, res) => {
12
13
  res.status(200).json({ status: 'ok' });
@@ -43,7 +43,7 @@
43
43
  "class-variance-authority": "^0.7.1",
44
44
  "clsx": "^2.1.1",
45
45
  "cmdk": "^1.1.1",
46
- "coze-coding-dev-sdk": "^0.7.0",
46
+ "coze-coding-dev-sdk": "^0.7.3",
47
47
  "date-fns": "^4.1.0",
48
48
  "drizzle-kit": "^0.31.8",
49
49
  "drizzle-orm": "^0.45.1",
@@ -82,5 +82,10 @@
82
82
  "packageManager": "pnpm@9.0.0",
83
83
  "engines": {
84
84
  "pnpm": ">=9.0.0"
85
+ },
86
+ "pnpm": {
87
+ "overrides": {
88
+ "esbuild": "^0.25.12"
89
+ }
85
90
  }
86
91
  }