@flowgram.ai/form-materials 0.1.0-alpha.13 → 0.1.0-alpha.14

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 (97) hide show
  1. package/bin/index.ts +0 -11
  2. package/bin/materials.ts +29 -2
  3. package/dist/esm/chunk-727SU246.js +13 -0
  4. package/dist/esm/chunk-727SU246.js.map +1 -0
  5. package/dist/esm/chunk-DEZUEMUM.js +284 -0
  6. package/dist/esm/chunk-DEZUEMUM.js.map +1 -0
  7. package/dist/esm/chunk-DUOXDOUE.js +477 -0
  8. package/dist/esm/chunk-DUOXDOUE.js.map +1 -0
  9. package/dist/esm/editor-6UMULJYB.js +180 -0
  10. package/dist/esm/editor-6UMULJYB.js.map +1 -0
  11. package/dist/esm/editor-EYOQTGMT.js +282 -0
  12. package/dist/esm/editor-EYOQTGMT.js.map +1 -0
  13. package/dist/esm/editor-OXPGKPF5.js +167 -0
  14. package/dist/esm/editor-OXPGKPF5.js.map +1 -0
  15. package/dist/esm/editor-VO6YAXRC.js +249 -0
  16. package/dist/esm/editor-VO6YAXRC.js.map +1 -0
  17. package/dist/esm/editor-XYLKTB6L.js +365 -0
  18. package/dist/esm/editor-XYLKTB6L.js.map +1 -0
  19. package/dist/esm/index.js +1110 -2306
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/index.d.mts +298 -59
  22. package/dist/index.d.ts +298 -59
  23. package/dist/index.js +3932 -2681
  24. package/dist/index.js.map +1 -1
  25. package/package.json +9 -8
  26. package/src/components/batch-outputs/index.tsx +3 -2
  27. package/src/components/code-editor/editor.tsx +89 -0
  28. package/src/components/code-editor/index.tsx +5 -89
  29. package/src/components/code-editor/language-features.ts +18 -18
  30. package/src/components/code-editor/theme/dark.ts +49 -30
  31. package/src/components/code-editor/theme/light.ts +56 -32
  32. package/src/components/code-editor-mini/index.tsx +2 -2
  33. package/src/components/condition-row/constants.ts +8 -0
  34. package/src/components/condition-row/index.tsx +4 -0
  35. package/src/components/db-condition-row/hooks/use-left.tsx +66 -0
  36. package/src/components/db-condition-row/hooks/use-op.tsx +59 -0
  37. package/src/components/db-condition-row/index.tsx +93 -0
  38. package/src/components/db-condition-row/styles.tsx +43 -0
  39. package/src/components/db-condition-row/types.ts +34 -0
  40. package/src/components/display-flow-value/index.tsx +2 -12
  41. package/src/components/display-inputs-values/index.tsx +44 -6
  42. package/src/components/dynamic-value-input/hooks.ts +25 -4
  43. package/src/components/dynamic-value-input/index.tsx +21 -12
  44. package/src/components/dynamic-value-input/styles.tsx +14 -4
  45. package/src/components/index.ts +3 -0
  46. package/src/components/inputs-values/index.tsx +14 -3
  47. package/src/components/inputs-values/styles.tsx +1 -1
  48. package/src/components/inputs-values-tree/hooks/use-child-list.tsx +76 -0
  49. package/src/components/inputs-values-tree/index.tsx +62 -0
  50. package/src/components/inputs-values-tree/row.tsx +177 -0
  51. package/src/components/inputs-values-tree/styles.tsx +128 -0
  52. package/src/components/inputs-values-tree/types.ts +21 -0
  53. package/src/components/json-editor-with-variables/editor.tsx +69 -0
  54. package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +6 -5
  55. package/src/components/json-editor-with-variables/index.tsx +5 -59
  56. package/src/components/json-schema-editor/default-value.tsx +1 -3
  57. package/src/components/json-schema-editor/hooks.tsx +14 -3
  58. package/src/components/json-schema-editor/index.tsx +18 -58
  59. package/src/components/json-schema-editor/styles.tsx +12 -55
  60. package/src/components/json-schema-editor/types.ts +0 -1
  61. package/src/components/prompt-editor/editor.tsx +81 -0
  62. package/src/components/prompt-editor/index.tsx +5 -62
  63. package/src/components/prompt-editor-with-inputs/editor.tsx +25 -0
  64. package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +11 -0
  65. package/src/components/prompt-editor-with-inputs/index.tsx +5 -16
  66. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +34 -17
  67. package/src/components/prompt-editor-with-variables/editor.tsx +22 -0
  68. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +12 -20
  69. package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +13 -1
  70. package/src/components/prompt-editor-with-variables/index.tsx +5 -13
  71. package/src/components/type-selector/index.tsx +12 -2
  72. package/src/components/variable-selector/context.tsx +28 -0
  73. package/src/components/variable-selector/index.tsx +10 -1
  74. package/src/components/variable-selector/use-variable-tree.tsx +3 -3
  75. package/src/effects/auto-rename-ref/index.ts +7 -54
  76. package/src/effects/validate-when-variable-sync/index.ts +1 -1
  77. package/src/form-plugins/infer-assign-plugin/index.ts +1 -1
  78. package/src/form-plugins/infer-inputs-plugin/index.ts +4 -76
  79. package/src/hooks/use-object-list/index.tsx +35 -7
  80. package/src/index.ts +1 -0
  81. package/src/plugins/json-schema-preset/manager.ts +1 -0
  82. package/src/plugins/json-schema-preset/type-definition/date-time.tsx +25 -0
  83. package/src/plugins/json-schema-preset/type-definition/index.tsx +2 -0
  84. package/src/plugins/json-schema-preset/type-definition/string.tsx +18 -9
  85. package/src/shared/flow-value/index.ts +6 -0
  86. package/src/shared/flow-value/schema.ts +38 -0
  87. package/src/shared/flow-value/utils.ts +201 -0
  88. package/src/shared/format-legacy-refs/index.ts +1 -1
  89. package/src/shared/index.ts +3 -0
  90. package/src/shared/lazy-suspense/index.tsx +28 -0
  91. package/src/shared/polyfill-create-root/index.tsx +33 -0
  92. package/src/typings/flow-value/index.ts +3 -1
  93. package/src/validate/validate-flow-value/index.tsx +4 -16
  94. package/src/components/json-schema-editor/components/blur-input.tsx +0 -27
  95. package/src/plugins/disable-declaration-plugin/config.json +0 -5
  96. package/src/plugins/json-schema-preset/config.json +0 -9
  97. /package/src/components/{inputs-values/components/blur-input.tsx → blur-input/index.tsx} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/form-materials",
3
- "version": "0.1.0-alpha.13",
3
+ "version": "0.1.0-alpha.14",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
@@ -24,21 +24,22 @@
24
24
  "@douyinfe/semi-icons": "^2.80.0",
25
25
  "@douyinfe/semi-illustrations": "^2.80.0",
26
26
  "@douyinfe/semi-ui": "^2.80.0",
27
- "lodash": "^4.17.21",
27
+ "lodash-es": "^4.17.21",
28
28
  "nanoid": "^4.0.2",
29
29
  "commander": "^11.0.0",
30
30
  "chalk": "^5.3.0",
31
31
  "inquirer": "^9.2.7",
32
32
  "immer": "~10.1.1",
33
- "@coze-editor/editor": "0.1.0-alpha.879fbb",
33
+ "@coze-editor/editor": "0.1.0-alpha.5a549c",
34
34
  "@codemirror/view": "~6.38.0",
35
35
  "@codemirror/state": "~6.5.2",
36
36
  "typescript": "^5.8.3",
37
- "@flowgram.ai/editor": "0.1.0-alpha.13",
38
- "@flowgram.ai/json-schema": "0.1.0-alpha.13"
37
+ "zod": "^3.24.4",
38
+ "@flowgram.ai/editor": "0.1.0-alpha.14",
39
+ "@flowgram.ai/json-schema": "0.1.0-alpha.14"
39
40
  },
40
41
  "devDependencies": {
41
- "@types/lodash": "^4.14.137",
42
+ "@types/lodash-es": "^4.17.12",
42
43
  "@types/node": "^18",
43
44
  "@types/react": "^18",
44
45
  "@types/react-dom": "^18",
@@ -51,8 +52,8 @@
51
52
  "tsup": "^8.0.1",
52
53
  "typescript": "^5.8.3",
53
54
  "vitest": "^0.34.6",
54
- "@flowgram.ai/eslint-config": "0.1.0-alpha.13",
55
- "@flowgram.ai/ts-config": "0.1.0-alpha.13"
55
+ "@flowgram.ai/eslint-config": "0.1.0-alpha.14",
56
+ "@flowgram.ai/ts-config": "0.1.0-alpha.14"
56
57
  },
57
58
  "peerDependencies": {
58
59
  "react": ">=16.8",
@@ -5,6 +5,7 @@
5
5
 
6
6
  import React from 'react';
7
7
 
8
+ import { I18n } from '@flowgram.ai/editor';
8
9
  import { Button, Input } from '@douyinfe/semi-ui';
9
10
  import { IconDelete, IconPlus } from '@douyinfe/semi-icons';
10
11
 
@@ -46,8 +47,8 @@ export function BatchOutputs(props: PropsType) {
46
47
  </UIRow>
47
48
  ))}
48
49
  </UIRows>
49
- <Button disabled={readonly} icon={<IconPlus />} size="small" onClick={add}>
50
- Add
50
+ <Button disabled={readonly} icon={<IconPlus />} size="small" onClick={() => add()}>
51
+ {I18n.t('Add')}
51
52
  </Button>
52
53
  </div>
53
54
  );
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import React, { useEffect, useRef } from 'react';
7
+
8
+ import {
9
+ ActiveLinePlaceholder,
10
+ createRenderer,
11
+ EditorProvider,
12
+ InferValues,
13
+ } from '@coze-editor/editor/react';
14
+ import preset, { type EditorAPI } from '@coze-editor/editor/preset-code';
15
+ import { EditorView } from '@codemirror/view';
16
+
17
+ import { getSuffixByLanguageId } from './utils';
18
+
19
+ import './theme';
20
+ import './language-features';
21
+
22
+ const OriginCodeEditor = createRenderer(preset, [
23
+ EditorView.theme({
24
+ '&.cm-focused': {
25
+ outline: 'none',
26
+ },
27
+ }),
28
+ ]);
29
+
30
+ type Preset = typeof preset;
31
+ type Options = Partial<InferValues<Preset[number]>>;
32
+
33
+ export interface CodeEditorPropsType extends React.PropsWithChildren<{}> {
34
+ value?: string;
35
+ onChange?: (value: string) => void;
36
+ languageId: 'python' | 'typescript' | 'shell' | 'json';
37
+ theme?: 'dark' | 'light';
38
+ placeholder?: string;
39
+ activeLinePlaceholder?: string;
40
+ readonly?: boolean;
41
+ options?: Options;
42
+ }
43
+
44
+ export function CodeEditor({
45
+ value,
46
+ onChange,
47
+ languageId = 'python',
48
+ theme = 'light',
49
+ children,
50
+ placeholder,
51
+ activeLinePlaceholder,
52
+ options,
53
+ readonly,
54
+ }: CodeEditorPropsType) {
55
+ const editorRef = useRef<EditorAPI | null>(null);
56
+
57
+ useEffect(() => {
58
+ // listen to value change
59
+ if (editorRef.current?.getValue() !== value) {
60
+ editorRef.current?.setValue(String(value || ''));
61
+ }
62
+ }, [value]);
63
+
64
+ return (
65
+ <EditorProvider>
66
+ <OriginCodeEditor
67
+ defaultValue={String(value || '')}
68
+ options={{
69
+ uri: `file:///untitled${getSuffixByLanguageId(languageId)}`,
70
+ languageId,
71
+ theme,
72
+ placeholder,
73
+ readOnly: readonly,
74
+ editable: !readonly,
75
+ ...(options || {}),
76
+ }}
77
+ didMount={(editor: EditorAPI) => {
78
+ editorRef.current = editor;
79
+ }}
80
+ onChange={(e) => onChange?.(e.value)}
81
+ >
82
+ {activeLinePlaceholder && (
83
+ <ActiveLinePlaceholder>{activeLinePlaceholder}</ActiveLinePlaceholder>
84
+ )}
85
+ {children}
86
+ </OriginCodeEditor>
87
+ </EditorProvider>
88
+ );
89
+ }
@@ -3,94 +3,10 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import React, { useEffect, useRef } from 'react';
6
+ import { lazySuspense } from '@/shared';
7
7
 
8
- import {
9
- ActiveLinePlaceholder,
10
- createRenderer,
11
- EditorProvider,
12
- InferValues,
13
- } from '@coze-editor/editor/react';
14
- import preset, { type EditorAPI } from '@coze-editor/editor/preset-code';
15
- import { EditorView } from '@codemirror/view';
8
+ export const CodeEditor = lazySuspense(() =>
9
+ import('./editor').then((module) => ({ default: module.CodeEditor }))
10
+ );
16
11
 
17
- import { getSuffixByLanguageId } from './utils';
18
- import { initTsWorker } from './language-features';
19
-
20
- import './theme';
21
- import './language-features';
22
-
23
- const OriginCodeEditor = createRenderer(preset, [
24
- EditorView.theme({
25
- '&.cm-focused': {
26
- outline: 'none',
27
- },
28
- }),
29
- ]);
30
-
31
- type Preset = typeof preset;
32
- type Options = Partial<InferValues<Preset[number]>>;
33
-
34
- export interface CodeEditorPropsType extends React.PropsWithChildren<{}> {
35
- value?: string;
36
- onChange?: (value: string) => void;
37
- languageId: 'python' | 'typescript' | 'shell' | 'json';
38
- theme?: 'dark' | 'light';
39
- placeholder?: string;
40
- activeLinePlaceholder?: string;
41
- readonly?: boolean;
42
- options?: Options;
43
- }
44
-
45
- export function CodeEditor({
46
- value,
47
- onChange,
48
- languageId = 'python',
49
- theme = 'light',
50
- children,
51
- placeholder,
52
- activeLinePlaceholder,
53
- options,
54
- readonly,
55
- }: CodeEditorPropsType) {
56
- const editorRef = useRef<EditorAPI | null>(null);
57
-
58
- useEffect(() => {
59
- if (languageId === 'typescript') {
60
- initTsWorker();
61
- }
62
- }, [languageId]);
63
-
64
- useEffect(() => {
65
- // listen to value change
66
- if (editorRef.current?.getValue() !== value) {
67
- editorRef.current?.setValue(String(value || ''));
68
- }
69
- }, [value]);
70
-
71
- return (
72
- <EditorProvider>
73
- <OriginCodeEditor
74
- defaultValue={value}
75
- options={{
76
- uri: `file:///untitled${getSuffixByLanguageId(languageId)}`,
77
- languageId,
78
- theme,
79
- placeholder,
80
- readOnly: readonly,
81
- editable: !readonly,
82
- ...(options || {}),
83
- }}
84
- didMount={(editor: EditorAPI) => {
85
- editorRef.current = editor;
86
- }}
87
- onChange={(e) => onChange?.(e.value)}
88
- >
89
- {activeLinePlaceholder && (
90
- <ActiveLinePlaceholder>{activeLinePlaceholder}</ActiveLinePlaceholder>
91
- )}
92
- {children}
93
- </OriginCodeEditor>
94
- </EditorProvider>
95
- );
96
- }
12
+ export type { CodeEditorPropsType } from './editor';
@@ -22,23 +22,23 @@ languages.register('json', {
22
22
  languageService: json.languageService,
23
23
  });
24
24
 
25
- let tsWorkerInit = false;
25
+ // let tsWorkerInit = false;
26
26
 
27
- export const initTsWorker = () => {
28
- if (tsWorkerInit) {
29
- return;
30
- }
31
- tsWorkerInit = true;
27
+ // export const initTsWorker = () => {
28
+ // if (tsWorkerInit) {
29
+ // return;
30
+ // }
31
+ // tsWorkerInit = true;
32
32
 
33
- const tsWorker = new Worker(
34
- new URL(`@coze-editor/editor/language-typescript/worker`, import.meta.url),
35
- { type: 'module' }
36
- );
37
- typescript.languageService.initialize(tsWorker, {
38
- compilerOptions: {
39
- // eliminate Promise error
40
- lib: ['es2015', 'dom'],
41
- noImplicitAny: false,
42
- },
43
- });
44
- };
33
+ // const tsWorker = new Worker(
34
+ // new URL(`@coze-editor/editor/language-typescript/worker`, import.meta.url),
35
+ // { type: 'module' }
36
+ // );
37
+ // typescript.languageService.initialize(tsWorker, {
38
+ // compilerOptions: {
39
+ // // eliminate Promise error
40
+ // lib: ['es2015', 'dom'],
41
+ // noImplicitAny: false,
42
+ // },
43
+ // });
44
+ // };
@@ -7,55 +7,56 @@ import { createTheme, tags as t } from '@coze-editor/editor/preset-code';
7
7
  import { type Extension } from '@codemirror/state';
8
8
 
9
9
  const colors = {
10
- background: '#151B27',
11
- // syntax
12
- comment: '#FFFFFF63',
13
- key: '#39E5D7',
14
- string: '#FF94D2',
15
- number: '#FF9933',
16
- boolean: '#78B0FF',
17
- null: '#78B0FF',
18
- separator: '#FFFFFFC9',
10
+ background: '#0D1117',
11
+ // syntax - 现代化暗色主题配色
12
+ comment: '#8B949E',
13
+ key: '#7DD3FC',
14
+ variable: '#F472B6',
15
+ string: '#34D399',
16
+ number: '#FBBF24',
17
+ boolean: '#A78BFA',
18
+ null: '#A78BFA',
19
+ separator: '#E6EDF3',
19
20
  };
20
21
 
21
22
  export const darkTheme: Extension = createTheme({
22
23
  variant: 'dark',
23
24
  settings: {
24
25
  background: colors.background,
25
- foreground: '#fff',
26
- caret: '#AEAFAD',
27
- selection: '#d9d9d942',
26
+ foreground: '#E6EDF3',
27
+ caret: '#7DD3FC',
28
+ selection: '#264F7833',
28
29
  gutterBackground: colors.background,
29
- gutterForeground: '#FFFFFF63',
30
+ gutterForeground: '#6E7681',
30
31
  gutterBorderColor: 'transparent',
31
32
  gutterBorderWidth: 0,
32
- lineHighlight: '#272e3d36',
33
- bracketColors: ['#FFEF61', '#DD99FF', '#78B0FF'],
33
+ lineHighlight: '#21262D',
34
+ bracketColors: ['#FBBF24', '#A78BFA', '#7DD3FC'],
34
35
  tooltip: {
35
- backgroundColor: '#363D4D',
36
- color: '#fff',
37
- border: 'none',
36
+ backgroundColor: '#21262D',
37
+ color: '#E6EDF3',
38
+ border: '1px solid #30363D',
38
39
  },
39
40
  link: {
40
- color: '#4daafc',
41
+ color: '#58A6FF',
41
42
  },
42
43
  completionItemHover: {
43
- backgroundColor: '#FFFFFF0F',
44
+ backgroundColor: '#21262D',
44
45
  },
45
46
  completionItemSelected: {
46
- backgroundColor: '#FFFFFF17',
47
+ backgroundColor: '#1F6EEB',
47
48
  },
48
49
  completionItemIcon: {
49
- color: '#FFFFFFC9',
50
+ color: '#8B949E',
50
51
  },
51
52
  completionItemLabel: {
52
- color: '#FFFFFFC9',
53
+ color: '#E6EDF3',
53
54
  },
54
55
  completionItemInfo: {
55
- color: '#FFFFFFC9',
56
+ color: '#8B949E',
56
57
  },
57
58
  completionItemDetail: {
58
- color: '#FFFFFF63',
59
+ color: '#6E7681',
59
60
  },
60
61
  },
61
62
  styles: [
@@ -89,31 +90,49 @@ export const darkTheme: Extension = createTheme({
89
90
  color: colors.separator,
90
91
  },
91
92
 
93
+ // js
94
+ {
95
+ tag: [t.definitionKeyword],
96
+ color: '#C084FC',
97
+ },
98
+ {
99
+ tag: [t.modifier],
100
+ color: '#C084FC',
101
+ },
102
+ {
103
+ tag: [t.controlKeyword],
104
+ color: '#C084FC',
105
+ },
106
+ {
107
+ tag: [t.operatorKeyword],
108
+ color: '#C084FC',
109
+ },
110
+
92
111
  // markdown
93
112
  {
94
113
  tag: [t.heading],
95
- color: '#6b6bff',
114
+ color: '#7DD3FC',
96
115
  },
97
116
  {
98
117
  tag: [t.processingInstruction],
99
- color: '#6b6bff',
118
+ color: '#7DD3FC',
100
119
  },
101
120
 
102
121
  // shell
103
122
  // curl
104
123
  {
105
124
  tag: [t.standard(t.variableName)],
106
- color: '#3BEB84',
125
+ color: '#34D399',
107
126
  },
108
127
  // -X
109
128
  {
110
129
  tag: [t.attributeName],
111
- color: '#FF9933',
130
+ color: '#FBBF24',
112
131
  },
113
132
  // url in string (includes quotes), e.g. "https://..."
114
133
  {
115
134
  tag: [t.special(t.string)],
116
- color: '#78B0FF',
135
+ color: '#7DD3FC',
117
136
  },
118
137
  ],
119
138
  });
@@ -7,55 +7,56 @@ import { createTheme, tags as t } from '@coze-editor/editor/preset-code';
7
7
  import { type Extension } from '@codemirror/state';
8
8
 
9
9
  const colors = {
10
- background: '#F7F7FC',
11
- // syntax
12
- comment: '#000A298A',
13
- key: '#00818C',
14
- string: '#D1009D',
15
- number: '#C74200',
16
- boolean: '#2B57D9',
17
- null: '#2B57D9',
18
- separator: '#0F1529D1',
10
+ background: '#FFFFFF',
11
+ comment: '#6B7280',
12
+ key: '#2563EB',
13
+ variable: '#DC2626',
14
+ string: '#059669',
15
+ number: '#EA580C',
16
+ boolean: '#7C3AED',
17
+ null: '#7C3AED',
18
+ separator: '#374151',
19
19
  };
20
20
 
21
21
  export const lightTheme: Extension = createTheme({
22
22
  variant: 'light',
23
23
  settings: {
24
- background: '#fff',
25
- foreground: '#000',
26
- caret: '#000',
27
- selection: '#d9d9d9',
28
- gutterBackground: '#f0f0f0',
29
- gutterForeground: '#666',
24
+ background: '#FFFFFF',
25
+ foreground: '#1F2937',
26
+ caret: '#2563EB',
27
+ selection: '#E5E7EB',
28
+ gutterBackground: '#F9FAFB',
29
+ gutterForeground: '#6B7280',
30
30
  gutterBorderColor: 'transparent',
31
31
  gutterBorderWidth: 0,
32
- lineHighlight: '#e1e1e180',
33
- bracketColors: ['#FFD700', '#DD99FF', '#78B0FF'],
32
+ lineHighlight: '#F3F4F680',
33
+ bracketColors: ['#F59E0B', '#8B5CF6', '#06B6D4'],
34
34
  tooltip: {
35
- backgroundColor: '#f0f0f0',
36
- color: '#000',
37
- border: '1px solid #ccc',
35
+ backgroundColor: '#FFFFFF',
36
+ color: '#1F2937',
37
+ border: '1px solid #E5E7EB',
38
+ boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
38
39
  },
39
40
  link: {
40
- color: '#007bff',
41
+ color: '#2563EB',
41
42
  },
42
43
  completionItemHover: {
43
- backgroundColor: '#f0f0f0',
44
+ backgroundColor: '#F3F4F6',
44
45
  },
45
46
  completionItemSelected: {
46
- backgroundColor: '#e0e0e0',
47
+ backgroundColor: '#E5E7EB',
47
48
  },
48
49
  completionItemIcon: {
49
- color: '#333',
50
+ color: '#4B5563',
50
51
  },
51
52
  completionItemLabel: {
52
- color: '#333',
53
+ color: '#1F2937',
53
54
  },
54
55
  completionItemInfo: {
55
- color: '#333',
56
+ color: '#4B5563',
56
57
  },
57
58
  completionItemDetail: {
58
- color: '#666',
59
+ color: '#6B7280',
59
60
  },
60
61
  },
61
62
  styles: [
@@ -68,6 +69,11 @@ export const lightTheme: Extension = createTheme({
68
69
  tag: [t.propertyName],
69
70
  color: colors.key,
70
71
  },
72
+ {
73
+ tag: [t.variableName],
74
+ color: colors.variable,
75
+ },
76
+
71
77
  {
72
78
  tag: [t.string],
73
79
  color: colors.string,
@@ -92,28 +98,46 @@ export const lightTheme: Extension = createTheme({
92
98
  // markdown
93
99
  {
94
100
  tag: [t.heading],
95
- color: '#3e76ef',
101
+ color: '#2563EB',
96
102
  },
97
103
  {
98
104
  tag: [t.processingInstruction],
99
- color: '#3e76ef',
105
+ color: '#2563EB',
106
+ },
107
+
108
+ // js
109
+ {
110
+ tag: [t.definitionKeyword],
111
+ color: '#9333EA',
112
+ },
113
+ {
114
+ tag: [t.modifier],
115
+ color: '#9333EA',
116
+ },
117
+ {
118
+ tag: [t.controlKeyword],
119
+ color: '#9333EA',
120
+ },
121
+ {
122
+ tag: [t.operatorKeyword],
123
+ color: '#9333EA',
100
124
  },
101
125
 
102
126
  // shell
103
127
  // curl
104
128
  {
105
129
  tag: [t.standard(t.variableName)],
106
- color: '#00804A',
130
+ color: '#059669',
107
131
  },
108
132
  // -X
109
133
  {
110
134
  tag: [t.attributeName],
111
- color: '#C74200',
135
+ color: '#EA580C',
112
136
  },
113
137
  // url in string (includes quotes), e.g. "https://..."
114
138
  {
115
139
  tag: [t.special(t.string)],
116
- color: '#2B57D9',
140
+ color: '#2563EB',
117
141
  },
118
142
  ],
119
143
  });
@@ -7,11 +7,10 @@ import React from 'react';
7
7
 
8
8
  import styled from 'styled-components';
9
9
 
10
- import { CodeEditor, CodeEditorPropsType } from '@/components/code-editor';
10
+ import { CodeEditor, type CodeEditorPropsType } from '@/components/code-editor';
11
11
 
12
12
  const UIMini = styled.div`
13
13
  .ͼ1 .cm-content {
14
- padding: 0;
15
14
  }
16
15
  `;
17
16
 
@@ -23,6 +22,7 @@ export function CodeEditorMini(props: CodeEditorPropsType) {
23
22
  options={{
24
23
  lineNumbersGutter: false,
25
24
  foldGutter: false,
25
+ minHeight: 24,
26
26
  ...(props.options || {}),
27
27
  }}
28
28
  />
@@ -60,6 +60,14 @@ export const defaultRules: IRules = {
60
60
  [Op.IS_EMPTY]: null,
61
61
  [Op.IS_NOT_EMPTY]: null,
62
62
  },
63
+ ['date-time']: {
64
+ [Op.EQ]: 'date-time',
65
+ [Op.NEQ]: 'date-time',
66
+ [Op.GT]: 'date-time',
67
+ [Op.GTE]: 'date-time',
68
+ [Op.LT]: 'date-time',
69
+ [Op.LTE]: 'date-time',
70
+ },
63
71
  };
64
72
 
65
73
  export const defaultOpConfigs: OpConfigs = {
@@ -15,6 +15,7 @@ import { ConditionRowValueType, IRules, OpConfigs } from './types';
15
15
  import { UIContainer, UILeft, UIOperator, UIRight, UIValues } from './styles';
16
16
  import { useRule } from './hooks/useRule';
17
17
  import { useOp } from './hooks/useOp';
18
+ import { defaultOpConfigs, defaultRules } from './constants';
18
19
 
19
20
  interface PropTypes {
20
21
  value?: ConditionRowValueType;
@@ -96,4 +97,7 @@ export function ConditionRow({
96
97
  );
97
98
  }
98
99
 
100
+ ConditionRow.defaultRules = defaultRules;
101
+ ConditionRow.defaultOpConfigs = defaultOpConfigs;
102
+
99
103
  export { type ConditionRowValueType };