@flowgram.ai/form-materials 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (227) hide show
  1. package/dist/cjs/components/batch-outputs/index.js +5 -3
  2. package/dist/cjs/components/batch-outputs/styles.css +13 -0
  3. package/dist/cjs/components/blur-input/index.js +1 -0
  4. package/dist/cjs/components/code-editor/editor.js +16 -12
  5. package/dist/cjs/components/code-editor/styles.css +4 -0
  6. package/dist/cjs/components/code-editor/theme/dark.js +1 -1
  7. package/dist/cjs/components/code-editor/theme/light.js +1 -1
  8. package/dist/cjs/components/code-editor-mini/index.js +2 -16
  9. package/dist/cjs/components/condition-context/hooks/use-condition.js +17 -1
  10. package/dist/cjs/components/condition-row/index.js +26 -12
  11. package/dist/cjs/components/condition-row/styles.css +19 -0
  12. package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +2 -2
  13. package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +31 -11
  14. package/dist/{esm/components/coze-editor-extensions/styles.mjs → cjs/components/coze-editor-extensions/styles.css} +19 -18
  15. package/dist/cjs/components/db-condition-row/index.js +29 -14
  16. package/dist/cjs/components/db-condition-row/styles.css +30 -0
  17. package/dist/cjs/components/display-inputs-values/index.js +3 -2
  18. package/dist/cjs/components/display-inputs-values/styles.css +6 -0
  19. package/dist/cjs/components/display-outputs/index.js +5 -4
  20. package/dist/cjs/components/display-outputs/styles.css +6 -0
  21. package/dist/cjs/components/display-schema-tag/index.js +7 -4
  22. package/dist/cjs/components/display-schema-tag/styles.css +21 -0
  23. package/dist/cjs/components/display-schema-tree/index.js +12 -7
  24. package/dist/cjs/components/display-schema-tree/styles.css +64 -0
  25. package/dist/cjs/components/dynamic-value-input/index.js +9 -5
  26. package/dist/{esm/components/dynamic-value-input/styles.mjs → cjs/components/dynamic-value-input/styles.css} +24 -30
  27. package/dist/cjs/components/inputs-values/index.js +5 -3
  28. package/dist/cjs/components/inputs-values/styles.css +13 -0
  29. package/dist/cjs/components/inputs-values-tree/icon.js +70 -0
  30. package/dist/cjs/components/inputs-values-tree/index.js +4 -3
  31. package/dist/cjs/components/inputs-values-tree/row.js +19 -15
  32. package/dist/cjs/components/inputs-values-tree/styles.css +85 -0
  33. package/dist/cjs/components/json-schema-editor/default-value.js +2 -2
  34. package/dist/cjs/components/json-schema-editor/hooks.js +55 -48
  35. package/dist/cjs/components/json-schema-editor/icon.js +70 -0
  36. package/dist/cjs/components/json-schema-editor/index.js +37 -25
  37. package/dist/cjs/components/json-schema-editor/styles.css +113 -0
  38. package/dist/cjs/components/prompt-editor/editor.js +16 -6
  39. package/dist/cjs/components/prompt-editor/styles.css +10 -0
  40. package/dist/cjs/components/prompt-editor-with-inputs/index.js +16 -26
  41. package/dist/cjs/components/prompt-editor-with-variables/index.js +17 -26
  42. package/dist/cjs/components/variable-selector/context.js +7 -3
  43. package/dist/cjs/components/variable-selector/index.js +16 -10
  44. package/dist/{esm/components/variable-selector/styles.mjs → cjs/components/variable-selector/styles.css} +37 -29
  45. package/dist/cjs/components/variable-selector/use-variable-tree.js +3 -1
  46. package/dist/cjs/shared/inject-material/index.js +1 -1
  47. package/dist/esm/components/batch-outputs/index.mjs +5 -3
  48. package/dist/esm/components/batch-outputs/styles.css +13 -0
  49. package/dist/esm/components/blur-input/index.mjs +1 -0
  50. package/dist/esm/components/code-editor/editor.mjs +16 -11
  51. package/dist/esm/components/code-editor/styles.css +4 -0
  52. package/dist/esm/components/code-editor/theme/dark.mjs +1 -1
  53. package/dist/esm/components/code-editor/theme/light.mjs +1 -1
  54. package/dist/esm/components/code-editor-mini/index.mjs +2 -6
  55. package/dist/esm/components/condition-context/hooks/use-condition.mjs +18 -2
  56. package/dist/esm/components/condition-row/index.mjs +26 -12
  57. package/dist/esm/components/condition-row/styles.css +19 -0
  58. package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +3 -3
  59. package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +32 -12
  60. package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
  61. package/dist/esm/components/db-condition-row/index.mjs +29 -14
  62. package/dist/esm/components/db-condition-row/styles.css +30 -0
  63. package/dist/esm/components/display-inputs-values/index.mjs +3 -2
  64. package/dist/esm/components/display-inputs-values/styles.css +6 -0
  65. package/dist/esm/components/display-outputs/index.mjs +5 -4
  66. package/dist/esm/components/display-outputs/styles.css +6 -0
  67. package/dist/esm/components/display-schema-tag/index.mjs +8 -5
  68. package/dist/esm/components/display-schema-tag/styles.css +21 -0
  69. package/dist/esm/components/display-schema-tree/index.mjs +12 -7
  70. package/dist/esm/components/display-schema-tree/styles.css +64 -0
  71. package/dist/esm/components/dynamic-value-input/index.mjs +9 -5
  72. package/dist/esm/components/dynamic-value-input/styles.css +48 -0
  73. package/dist/esm/components/inputs-values/index.mjs +5 -3
  74. package/dist/esm/components/inputs-values/styles.css +13 -0
  75. package/dist/esm/components/inputs-values-tree/icon.mjs +26 -0
  76. package/dist/esm/components/inputs-values-tree/index.mjs +4 -3
  77. package/dist/esm/components/inputs-values-tree/row.mjs +18 -14
  78. package/dist/esm/components/inputs-values-tree/styles.css +85 -0
  79. package/dist/esm/components/json-schema-editor/default-value.mjs +2 -2
  80. package/dist/esm/components/json-schema-editor/hooks.mjs +55 -48
  81. package/dist/esm/components/json-schema-editor/icon.mjs +26 -0
  82. package/dist/esm/components/json-schema-editor/index.mjs +36 -24
  83. package/dist/esm/components/json-schema-editor/styles.css +113 -0
  84. package/dist/esm/components/prompt-editor/editor.mjs +16 -6
  85. package/dist/esm/components/prompt-editor/styles.css +10 -0
  86. package/dist/esm/components/prompt-editor-with-inputs/index.mjs +12 -4
  87. package/dist/esm/components/prompt-editor-with-variables/index.mjs +13 -4
  88. package/dist/esm/components/variable-selector/context.mjs +7 -3
  89. package/dist/esm/components/variable-selector/index.mjs +17 -11
  90. package/{src/components/variable-selector/styles.tsx → dist/esm/components/variable-selector/styles.css} +35 -38
  91. package/dist/esm/components/variable-selector/use-variable-tree.mjs +3 -1
  92. package/dist/esm/shared/inject-material/index.mjs +1 -1
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/dist/types/components/batch-outputs/index.d.ts +1 -0
  95. package/dist/types/components/blur-input/index.d.ts +1 -1
  96. package/dist/types/components/code-editor/editor.d.ts +1 -0
  97. package/dist/types/components/condition-context/hooks/use-condition.d.ts +16 -1
  98. package/dist/types/components/condition-row/index.d.ts +5 -1
  99. package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +3 -3
  100. package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +1 -0
  101. package/dist/types/components/coze-editor-extensions/index.d.ts +1 -1
  102. package/dist/types/components/db-condition-row/index.d.ts +4 -0
  103. package/dist/types/components/db-condition-row/types.d.ts +0 -1
  104. package/dist/types/components/display-inputs-values/index.d.ts +3 -1
  105. package/dist/types/components/display-outputs/index.d.ts +1 -0
  106. package/dist/types/components/display-schema-tag/index.d.ts +1 -0
  107. package/dist/types/components/display-schema-tree/index.d.ts +1 -0
  108. package/dist/types/components/dynamic-value-input/index.d.ts +1 -0
  109. package/dist/types/components/inputs-values/index.d.ts +1 -0
  110. package/dist/types/components/inputs-values-tree/icon.d.ts +6 -0
  111. package/dist/types/components/inputs-values-tree/index.d.ts +1 -0
  112. package/dist/types/components/inputs-values-tree/row.d.ts +1 -0
  113. package/dist/types/components/inputs-values-tree/types.d.ts +3 -2
  114. package/dist/types/components/json-schema-editor/icon.d.ts +6 -0
  115. package/dist/types/components/json-schema-editor/index.d.ts +1 -0
  116. package/dist/types/components/prompt-editor/editor.d.ts +1 -0
  117. package/dist/types/components/prompt-editor-with-inputs/index.d.ts +7 -2
  118. package/dist/types/components/prompt-editor-with-variables/index.d.ts +5 -2
  119. package/dist/types/components/variable-selector/context.d.ts +16 -3
  120. package/dist/types/components/variable-selector/index.d.ts +1 -0
  121. package/dist/types/index.d.ts +1 -1
  122. package/dist/types/shared/flow-value/index.d.ts +1 -1
  123. package/dist/types/shared/flow-value/types.d.ts +3 -0
  124. package/dist/types/shared/index.d.ts +1 -1
  125. package/package.json +7 -10
  126. package/src/components/batch-outputs/index.tsx +5 -5
  127. package/src/components/batch-outputs/{styles.tsx → styles.css} +4 -6
  128. package/src/components/blur-input/index.tsx +2 -1
  129. package/src/components/code-editor/editor.tsx +19 -14
  130. package/src/components/code-editor/styles.css +11 -0
  131. package/src/components/code-editor/theme/dark.ts +1 -1
  132. package/src/components/code-editor/theme/light.ts +1 -1
  133. package/src/components/code-editor-mini/index.tsx +2 -9
  134. package/src/components/condition-context/hooks/use-condition.tsx +51 -7
  135. package/src/components/condition-row/index.tsx +27 -22
  136. package/src/components/condition-row/{styles.tsx → styles.css} +11 -11
  137. package/src/components/coze-editor-extensions/extensions/inputs-tree.tsx +7 -6
  138. package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +19 -14
  139. package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
  140. package/src/components/db-condition-row/index.tsx +29 -26
  141. package/src/components/db-condition-row/{styles.tsx → styles.css} +14 -16
  142. package/src/components/db-condition-row/types.ts +0 -1
  143. package/src/components/display-inputs-values/index.tsx +5 -4
  144. package/src/components/display-inputs-values/{styles.ts → styles.css} +2 -4
  145. package/src/components/display-outputs/index.tsx +5 -5
  146. package/src/components/display-outputs/{styles.ts → styles.css} +2 -4
  147. package/src/components/display-schema-tag/index.tsx +7 -7
  148. package/src/components/display-schema-tag/{styles.ts → styles.css} +7 -10
  149. package/src/components/display-schema-tree/index.tsx +10 -10
  150. package/src/components/display-schema-tree/{styles.tsx → styles.css} +18 -24
  151. package/src/components/dynamic-value-input/index.tsx +6 -6
  152. package/src/components/dynamic-value-input/{styles.tsx → styles.css} +9 -12
  153. package/src/components/inputs-values/index.tsx +5 -5
  154. package/src/components/inputs-values/{styles.tsx → styles.css} +4 -6
  155. package/src/components/inputs-values-tree/icon.tsx +28 -0
  156. package/src/components/inputs-values-tree/index.tsx +8 -6
  157. package/src/components/inputs-values-tree/row.tsx +25 -27
  158. package/src/components/inputs-values-tree/styles.css +94 -0
  159. package/src/components/inputs-values-tree/types.ts +3 -2
  160. package/src/components/json-schema-editor/default-value.tsx +2 -4
  161. package/src/components/json-schema-editor/hooks.tsx +60 -53
  162. package/src/components/json-schema-editor/icon.tsx +28 -0
  163. package/src/components/json-schema-editor/index.tsx +45 -50
  164. package/src/components/json-schema-editor/styles.css +135 -0
  165. package/src/components/prompt-editor/editor.tsx +18 -7
  166. package/src/components/prompt-editor/styles.css +14 -0
  167. package/src/components/prompt-editor-with-inputs/index.tsx +18 -5
  168. package/src/components/prompt-editor-with-variables/index.tsx +13 -5
  169. package/src/components/variable-selector/context.tsx +22 -2
  170. package/src/components/variable-selector/index.tsx +24 -14
  171. package/src/components/variable-selector/styles.css +70 -0
  172. package/src/components/variable-selector/use-variable-tree.tsx +9 -1
  173. package/src/index.ts +1 -0
  174. package/src/shared/flow-value/index.ts +1 -0
  175. package/src/shared/flow-value/types.ts +4 -0
  176. package/src/shared/index.ts +1 -0
  177. package/src/shared/inject-material/index.tsx +1 -1
  178. package/dist/cjs/components/batch-outputs/styles.js +0 -60
  179. package/dist/cjs/components/condition-row/styles.js +0 -77
  180. package/dist/cjs/components/coze-editor-extensions/styles.js +0 -89
  181. package/dist/cjs/components/db-condition-row/styles.js +0 -94
  182. package/dist/cjs/components/display-inputs-values/styles.js +0 -51
  183. package/dist/cjs/components/display-outputs/styles.js +0 -51
  184. package/dist/cjs/components/display-schema-tag/styles.js +0 -71
  185. package/dist/cjs/components/display-schema-tree/styles.js +0 -135
  186. package/dist/cjs/components/dynamic-value-input/styles.js +0 -107
  187. package/dist/cjs/components/inputs-values/styles.js +0 -60
  188. package/dist/cjs/components/inputs-values-tree/styles.js +0 -177
  189. package/dist/cjs/components/json-schema-editor/styles.js +0 -231
  190. package/dist/cjs/components/prompt-editor/styles.js +0 -55
  191. package/dist/cjs/components/prompt-editor-with-inputs/editor.js +0 -47
  192. package/dist/cjs/components/prompt-editor-with-variables/editor.js +0 -48
  193. package/dist/cjs/components/variable-selector/styles.js +0 -114
  194. package/dist/esm/components/batch-outputs/styles.mjs +0 -13
  195. package/dist/esm/components/condition-row/styles.mjs +0 -21
  196. package/dist/esm/components/db-condition-row/styles.mjs +0 -32
  197. package/dist/esm/components/display-inputs-values/styles.mjs +0 -7
  198. package/dist/esm/components/display-outputs/styles.mjs +0 -7
  199. package/dist/esm/components/display-schema-tag/styles.mjs +0 -21
  200. package/dist/esm/components/display-schema-tree/styles.mjs +0 -79
  201. package/dist/esm/components/inputs-values/styles.mjs +0 -13
  202. package/dist/esm/components/inputs-values-tree/styles.mjs +0 -105
  203. package/dist/esm/components/json-schema-editor/styles.mjs +0 -138
  204. package/dist/esm/components/prompt-editor/styles.mjs +0 -11
  205. package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +0 -13
  206. package/dist/esm/components/prompt-editor-with-variables/editor.mjs +0 -14
  207. package/dist/types/components/batch-outputs/styles.d.ts +0 -6
  208. package/dist/types/components/condition-row/styles.d.ts +0 -9
  209. package/dist/types/components/coze-editor-extensions/styles.d.ts +0 -9
  210. package/dist/types/components/db-condition-row/styles.d.ts +0 -12
  211. package/dist/types/components/display-inputs-values/styles.d.ts +0 -5
  212. package/dist/types/components/display-outputs/styles.d.ts +0 -5
  213. package/dist/types/components/display-schema-tag/styles.d.ts +0 -8
  214. package/dist/types/components/display-schema-tree/styles.d.ts +0 -11
  215. package/dist/types/components/dynamic-value-input/styles.d.ts +0 -8
  216. package/dist/types/components/inputs-values/styles.d.ts +0 -6
  217. package/dist/types/components/inputs-values-tree/styles.d.ts +0 -23
  218. package/dist/types/components/json-schema-editor/styles.d.ts +0 -30
  219. package/dist/types/components/prompt-editor/styles.d.ts +0 -7
  220. package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +0 -10
  221. package/dist/types/components/prompt-editor-with-variables/editor.d.ts +0 -9
  222. package/dist/types/components/variable-selector/styles.d.ts +0 -14
  223. package/src/components/inputs-values-tree/styles.tsx +0 -128
  224. package/src/components/json-schema-editor/styles.tsx +0 -168
  225. package/src/components/prompt-editor/styles.tsx +0 -18
  226. package/src/components/prompt-editor-with-inputs/editor.tsx +0 -24
  227. package/src/components/prompt-editor-with-variables/editor.tsx +0 -20
@@ -3,25 +3,22 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
- import { Tag } from '@douyinfe/semi-ui';
8
-
9
- export const UIRootTitle = styled.div`
6
+ .gedit-m-coze-editor-root-title {
10
7
  margin-right: 4px;
11
8
  min-width: 20px;
12
9
  overflow: hidden;
13
10
  text-overflow: ellipsis;
14
11
  white-space: nowrap;
15
12
  color: var(--semi-color-text-2);
16
- `;
13
+ }
17
14
 
18
- export const UIVarName = styled.div`
15
+ .gedit-m-coze-editor-var-name {
19
16
  overflow: hidden;
20
17
  text-overflow: ellipsis;
21
18
  white-space: nowrap;
22
- `;
19
+ }
23
20
 
24
- export const UITag = styled(Tag)`
21
+ .gedit-m-coze-editor-tag {
25
22
  display: inline-flex;
26
23
  align-items: center;
27
24
  justify-content: flex-start;
@@ -34,11 +31,11 @@ export const UITag = styled(Tag)`
34
31
  &.semi-tag {
35
32
  margin: 0 5px;
36
33
  }
37
- `;
34
+ }
38
35
 
39
- export const UIPopoverContent = styled.div`
36
+ .gedit-m-coze-editor-popover-content {
40
37
  padding: 10px;
41
38
  display: inline-flex;
42
39
  align-items: center;
43
40
  justify-content: flex-start;
44
- `;
41
+ }
@@ -18,15 +18,7 @@ import {
18
18
  } from '@/components/condition-context';
19
19
 
20
20
  import { DBConditionOptionType, DBConditionRowValueType } from './types';
21
- import {
22
- UIContainer,
23
- UILeft,
24
- UIOperator,
25
- UIOptionLabel,
26
- UIRight,
27
- UISelect,
28
- UIValues,
29
- } from './styles';
21
+ import './styles.css';
30
22
 
31
23
  interface PropTypes {
32
24
  value?: DBConditionRowValueType;
@@ -34,24 +26,22 @@ interface PropTypes {
34
26
  style?: React.CSSProperties;
35
27
  options?: DBConditionOptionType[];
36
28
  readonly?: boolean;
29
+ /**
30
+ * @deprecated use ConditionContext instead to pass ruleConfig to multiple
31
+ */
37
32
  ruleConfig?: {
38
33
  ops?: ConditionOpConfigs;
39
34
  rules?: Record<string, IConditionRule>;
40
35
  };
41
36
  }
42
37
 
43
- const defaultRuleConfig = {
44
- ops: {},
45
- rules: {},
46
- };
47
-
48
38
  export function DBConditionRow({
49
39
  style,
50
40
  value,
51
41
  onChange,
52
42
  readonly,
53
43
  options,
54
- ruleConfig = defaultRuleConfig,
44
+ ruleConfig,
55
45
  }: PropTypes) {
56
46
  const { left, operator, right } = value || {};
57
47
 
@@ -66,10 +56,23 @@ export function DBConditionRow({
66
56
  leftSchema,
67
57
  operator,
68
58
  ruleConfig,
59
+ onClearOp() {
60
+ onChange({
61
+ ...value,
62
+ operator: undefined,
63
+ });
64
+ },
65
+ onClearRight() {
66
+ onChange({
67
+ ...value,
68
+ right: undefined,
69
+ });
70
+ },
69
71
  });
70
72
 
71
73
  const renderDBOptionSelect = () => (
72
- <UISelect
74
+ <Select
75
+ className="gedit-m-db-condition-row-select"
73
76
  disabled={readonly}
74
77
  size="small"
75
78
  style={{ width: '100%' }}
@@ -83,10 +86,10 @@ export function DBConditionRow({
83
86
  optionList={
84
87
  options?.map((item) => ({
85
88
  label: (
86
- <UIOptionLabel>
89
+ <div className="gedit-m-db-condition-row-option-label">
87
90
  <Icon size="small" svg={typeManager.getDisplayIcon(item.schema)} />
88
91
  {item.label}
89
- </UIOptionLabel>
92
+ </div>
90
93
  ),
91
94
  value: item.value,
92
95
  })) || []
@@ -116,11 +119,11 @@ export function DBConditionRow({
116
119
  );
117
120
 
118
121
  return (
119
- <UIContainer style={style}>
120
- <UIOperator>{renderOpSelect()}</UIOperator>
121
- <UIValues>
122
- <UILeft>{renderDBOptionSelect()}</UILeft>
123
- <UIRight>
122
+ <div className="gedit-m-db-condition-row-container" style={style}>
123
+ <div className="gedit-m-db-condition-row-operator">{renderOpSelect()}</div>
124
+ <div className="gedit-m-db-condition-row-values">
125
+ <div className="gedit-m-db-condition-row-left">{renderDBOptionSelect()}</div>
126
+ <div className="gedit-m-db-condition-row-right">
124
127
  {targetSchema ? (
125
128
  <InjectDynamicValueInput
126
129
  readonly={readonly || !rule}
@@ -136,9 +139,9 @@ export function DBConditionRow({
136
139
  value={opConfig?.rightDisplay || I18n.t('Empty')}
137
140
  />
138
141
  )}
139
- </UIRight>
140
- </UIValues>
141
- </UIContainer>
142
+ </div>
143
+ </div>
144
+ </div>
142
145
  );
143
146
  }
144
147
 
@@ -3,41 +3,39 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
- import { Select } from '@douyinfe/semi-ui';
8
-
9
- export const UIContainer = styled.div`
6
+ .gedit-m-db-condition-row-container {
10
7
  display: flex;
11
8
  align-items: center;
12
9
  gap: 4px;
13
- `;
10
+ }
14
11
 
15
- export const UIOperator = styled.div``;
12
+ .gedit-m-db-condition-row-operator {
13
+ }
16
14
 
17
- export const UILeft = styled.div`
15
+ .gedit-m-db-condition-row-left {
18
16
  width: 100%;
19
- `;
17
+ }
20
18
 
21
- export const UIRight = styled.div`
19
+ .gedit-m-db-condition-row-right {
22
20
  width: 100%;
23
- `;
21
+ }
24
22
 
25
- export const UIValues = styled.div`
23
+ .gedit-m-db-condition-row-values {
26
24
  flex-grow: 1;
27
25
  display: flex;
28
26
  flex-direction: column;
29
27
  align-items: center;
30
28
  gap: 4px;
31
- `;
29
+ }
32
30
 
33
- export const UIOptionLabel = styled.div`
31
+ .gedit-m-db-condition-row-option-label {
34
32
  display: flex;
35
33
  align-items: center;
36
34
  gap: 10px;
37
- `;
35
+ }
38
36
 
39
- export const UISelect = styled(Select)`
37
+ .gedit-m-db-condition-row-select {
40
38
  & .semi-select-selection {
41
39
  margin-left: 5px;
42
40
  }
43
- `;
41
+ }
@@ -9,7 +9,6 @@ import { IFlowConstantRefValue } from '@/shared';
9
9
 
10
10
  export interface DBConditionRowValueType {
11
11
  left?: string;
12
- schema?: IJsonSchema;
13
12
  operator?: string;
14
13
  right?: IFlowConstantRefValue;
15
14
  }
@@ -8,14 +8,15 @@ import React, { useMemo } from 'react';
8
8
  import { isPlainObject } from 'lodash-es';
9
9
  import { useScopeAvailable } from '@flowgram.ai/editor';
10
10
 
11
+ import { IInputsValues } from '@/shared/flow-value';
11
12
  import { FlowValueUtils } from '@/shared';
12
13
  import { DisplayFlowValue } from '@/components/display-flow-value';
13
14
 
14
- import { DisplayInputsWrapper } from './styles';
15
+ import './styles.css';
15
16
  import { DisplaySchemaTag } from '../display-schema-tag';
16
17
 
17
18
  interface PropsType {
18
- value?: any;
19
+ value?: IInputsValues;
19
20
  showIconInTree?: boolean;
20
21
  }
21
22
 
@@ -23,7 +24,7 @@ export function DisplayInputsValues({ value, showIconInTree }: PropsType) {
23
24
  const childEntries = Object.entries(value || {});
24
25
 
25
26
  return (
26
- <DisplayInputsWrapper>
27
+ <div className="gedit-m-display-inputs-wrapper">
27
28
  {childEntries.map(([key, value]) => {
28
29
  if (FlowValueUtils.isFlowValue(value)) {
29
30
  return (
@@ -44,7 +45,7 @@ export function DisplayInputsValues({ value, showIconInTree }: PropsType) {
44
45
 
45
46
  return null;
46
47
  })}
47
- </DisplayInputsWrapper>
48
+ </div>
48
49
  );
49
50
  }
50
51
 
@@ -3,10 +3,8 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
-
8
- export const DisplayInputsWrapper = styled.div`
6
+ .gedit-m-display-inputs-wrapper {
9
7
  display: flex;
10
8
  gap: 5px;
11
9
  flex-wrap: wrap;
12
- `;
10
+ }
@@ -10,7 +10,7 @@ import { useCurrentScope, useRefresh } from '@flowgram.ai/editor';
10
10
 
11
11
  import { DisplaySchemaTag } from '@/components/display-schema-tag';
12
12
 
13
- import { DisplayOutputsWrapper } from './styles';
13
+ import './styles.css';
14
14
 
15
15
  interface PropsType {
16
16
  value?: IJsonSchema;
@@ -24,7 +24,7 @@ export function DisplayOutputs({ value, showIconInTree, displayFromScope }: Prop
24
24
  const refresh = useRefresh();
25
25
 
26
26
  useEffect(() => {
27
- if (!displayFromScope) {
27
+ if (!displayFromScope || !scope) {
28
28
  return () => null;
29
29
  }
30
30
 
@@ -38,7 +38,7 @@ export function DisplayOutputs({ value, showIconInTree, displayFromScope }: Prop
38
38
  }, [displayFromScope]);
39
39
 
40
40
  const properties: IJsonSchema['properties'] = displayFromScope
41
- ? scope.output.variables?.reduce((acm, curr) => {
41
+ ? (scope?.output.variables || []).reduce((acm, curr) => {
42
42
  acm = {
43
43
  ...acm,
44
44
  ...(JsonSchemaUtils.astToSchema(curr.type)?.properties || {}),
@@ -50,7 +50,7 @@ export function DisplayOutputs({ value, showIconInTree, displayFromScope }: Prop
50
50
  const childEntries = Object.entries(properties || {});
51
51
 
52
52
  return (
53
- <DisplayOutputsWrapper>
53
+ <div className="gedit-m-display-outputs-wrapper">
54
54
  {childEntries.map(([key, schema]) => (
55
55
  <DisplaySchemaTag
56
56
  key={key}
@@ -60,6 +60,6 @@ export function DisplayOutputs({ value, showIconInTree, displayFromScope }: Prop
60
60
  warning={!schema}
61
61
  />
62
62
  ))}
63
- </DisplayOutputsWrapper>
63
+ </div>
64
64
  );
65
65
  }
@@ -3,10 +3,8 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
-
8
- export const DisplayOutputsWrapper = styled.div`
6
+ .gedit-m-display-outputs-wrapper {
9
7
  display: flex;
10
8
  gap: 5px;
11
9
  flex-wrap: wrap;
12
- `;
10
+ }
@@ -6,12 +6,12 @@
6
6
  import React from 'react';
7
7
 
8
8
  import { IJsonSchema } from '@flowgram.ai/json-schema';
9
- import { Popover } from '@douyinfe/semi-ui';
9
+ import { Popover, Tag } from '@douyinfe/semi-ui';
10
10
 
11
11
  import { useTypeManager } from '@/plugins';
12
12
  import { DisplaySchemaTree } from '@/components/display-schema-tree';
13
13
 
14
- import { PopoverContent, StyledTag, TitleSpan } from './styles';
14
+ import './styles.css';
15
15
 
16
16
  interface PropsType {
17
17
  title?: JSX.Element | string;
@@ -28,18 +28,18 @@ export function DisplaySchemaTag({ value = {}, showIconInTree, title, warning }:
28
28
  return (
29
29
  <Popover
30
30
  content={
31
- <PopoverContent>
31
+ <div className="gedit-m-display-schema-tag-popover-content">
32
32
  <DisplaySchemaTree value={value} typeManager={typeManager} showIcon={showIconInTree} />
33
- </PopoverContent>
33
+ </div>
34
34
  }
35
35
  >
36
- <StyledTag color={warning ? 'amber' : 'white'}>
36
+ <Tag color={warning ? 'amber' : 'white'} className="gedit-m-display-schema-tag-tag">
37
37
  {icon &&
38
38
  React.cloneElement(icon, {
39
39
  className: 'tag-icon',
40
40
  })}
41
- {title && <TitleSpan>{title}</TitleSpan>}
42
- </StyledTag>
41
+ {title && <span className="gedit-m-display-schema-tag-title">{title}</span>}
42
+ </Tag>
43
43
  </Popover>
44
44
  );
45
45
  }
@@ -3,26 +3,23 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
- import { Tag } from '@douyinfe/semi-ui';
8
-
9
- export const PopoverContent = styled.div`
6
+ .gedit-m-display-schema-tag-popover-content {
10
7
  padding: 10px;
11
- `;
8
+ }
12
9
 
13
- export const StyledTag = styled(Tag)`
10
+ .gedit-m-display-schema-tag-tag {
14
11
  padding: 4px;
15
12
 
16
- .tag-icon {
13
+ & .tag-icon {
17
14
  width: 12px;
18
15
  height: 12px;
19
16
  }
20
- `;
17
+ }
21
18
 
22
- export const TitleSpan = styled.span`
19
+ .gedit-m-display-schema-tag-title {
23
20
  display: inline-block;
24
21
  margin-left: 4px;
25
22
  margin-top: -1px;
26
23
  overflow: hidden;
27
24
  text-overflow: ellipsis;
28
- `;
25
+ }
@@ -11,7 +11,7 @@ import {
11
11
  useTypeManager,
12
12
  } from '@flowgram.ai/json-schema';
13
13
 
14
- import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from './styles';
14
+ import './styles.css';
15
15
 
16
16
  interface PropsType {
17
17
  value?: IJsonSchema;
@@ -45,15 +45,15 @@ function SchemaTree(props: PropsType) {
45
45
  const childEntries = Object.entries(properties || {});
46
46
 
47
47
  return (
48
- <TreeItem depth={depth} key={parentKey || 'root'}>
49
- <TreeRow>
50
- {depth !== 0 && <HorizontalLine />}
48
+ <div className={`gedit-m-display-schema-tree-item depth-${depth}`} key={parentKey || 'root'}>
49
+ <div className="gedit-m-display-schema-tree-row">
50
+ {depth !== 0 && <div className="gedit-m-display-schema-tree-horizontal-line" />}
51
51
  {showIcon &&
52
52
  icon &&
53
53
  React.cloneElement(icon, {
54
54
  className: 'tree-icon',
55
55
  })}
56
- <TreeTitle>
56
+ <div className="gedit-m-display-schema-tree-title">
57
57
  {parentKey ? (
58
58
  <>
59
59
  {`${parentKey} (`}
@@ -63,15 +63,15 @@ function SchemaTree(props: PropsType) {
63
63
  ) : (
64
64
  title
65
65
  )}
66
- </TreeTitle>
67
- </TreeRow>
66
+ </div>
67
+ </div>
68
68
  {childEntries?.length ? (
69
- <TreeLevel>
69
+ <div className="gedit-m-display-schema-tree-level">
70
70
  {childEntries.map(([key, value]) => (
71
71
  <SchemaTree key={key} {...props} parentKey={key} value={value} depth={depth + 1} />
72
72
  ))}
73
- </TreeLevel>
73
+ </div>
74
74
  ) : null}
75
- </TreeItem>
75
+ </div>
76
76
  );
77
77
  }
@@ -3,13 +3,11 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled, { css } from 'styled-components';
7
-
8
- export const TreeRow = styled.div`
6
+ .gedit-m-display-schema-tree-row {
9
7
  display: flex;
10
8
  align-items: center;
11
9
 
12
- .tree-icon {
10
+ & .tree-icon {
13
11
  margin-right: 8px;
14
12
  width: 14px;
15
13
  height: 14px;
@@ -17,14 +15,14 @@ export const TreeRow = styled.div`
17
15
 
18
16
  height: 27px;
19
17
  white-space: nowrap;
20
- `;
18
+ }
21
19
 
22
- export const HorizontalLine = styled.div`
20
+ .gedit-m-display-schema-tree-horizontal-line {
23
21
  position: relative;
24
22
 
25
23
  &::before,
26
24
  &::after {
27
- content: '';
25
+ content: "";
28
26
  position: absolute;
29
27
  background-color: var(--semi-color-text-3);
30
28
  }
@@ -35,14 +33,14 @@ export const HorizontalLine = styled.div`
35
33
  width: 15px;
36
34
  height: 1px;
37
35
  }
38
- `;
36
+ }
39
37
 
40
- export const TreeTitle = styled.div`
41
- // overflow: hidden;
42
- // text-overflow: ellipsis;
43
- `;
38
+ .gedit-m-display-schema-tree-title {
39
+ /* overflow: hidden;
40
+ text-overflow: ellipsis; */
41
+ }
44
42
 
45
- export const TreeLevel = styled.div`
43
+ .gedit-m-display-schema-tree-level {
46
44
  padding-left: 30px;
47
45
  position: relative;
48
46
 
@@ -55,13 +53,13 @@ export const TreeLevel = styled.div`
55
53
  left: -22px;
56
54
  width: 1px;
57
55
  } */
58
- `;
56
+ }
59
57
 
60
- export const TreeItem = styled.div<{ depth: number }>`
58
+ .gedit-m-display-schema-tree-item {
61
59
  position: relative;
62
60
 
63
61
  &::before {
64
- content: '';
62
+ content: "";
65
63
  position: absolute;
66
64
  background-color: var(--semi-color-text-3);
67
65
  }
@@ -80,11 +78,7 @@ export const TreeItem = styled.div<{ depth: number }>`
80
78
  left: -22px;
81
79
  }
82
80
 
83
- ${(props) =>
84
- props.depth === 0 &&
85
- css`
86
- &::before {
87
- width: 0px !important;
88
- }
89
- `}
90
- `;
81
+ &.depth-0::before {
82
+ width: 0px !important;
83
+ }
84
+ }
@@ -20,7 +20,7 @@ import { InjectVariableSelector } from '@/components/variable-selector';
20
20
  import { TypeSelector } from '@/components/type-selector';
21
21
  import { ConstantInput, ConstantInputStrategy } from '@/components/constant-input';
22
22
 
23
- import { UIContainer, UIMain, UITrigger, UIType } from './styles';
23
+ import './styles.css';
24
24
  import { useIncludeSchema, useRefVariable, useSelectSchema } from './hooks';
25
25
 
26
26
  interface PropsType {
@@ -144,11 +144,11 @@ export function DynamicValueInput({
144
144
  );
145
145
 
146
146
  return (
147
- <UIContainer style={style}>
148
- <UIType>{renderTypeSelector()}</UIType>
149
- <UIMain>{renderMain()}</UIMain>
150
- <UITrigger>{renderTrigger()}</UITrigger>
151
- </UIContainer>
147
+ <div className="gedit-m-dynamic-value-input-container" style={style}>
148
+ <div className="gedit-m-dynamic-value-input-type">{renderTypeSelector()}</div>
149
+ <div className="gedit-m-dynamic-value-input-main">{renderMain()}</div>
150
+ <div className="gedit-m-dynamic-value-input-trigger">{renderTrigger()}</div>
151
+ </div>
152
152
  );
153
153
  }
154
154
 
@@ -3,20 +3,17 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
-
8
- export const UIContainer = styled.div`
6
+ .gedit-m-dynamic-value-input-container {
9
7
  display: flex;
10
8
  align-items: center;
11
9
  border-radius: 4px;
12
10
  border: 1px solid var(--semi-color-border);
13
-
11
+ line-height: normal;
14
12
  overflow: hidden;
15
-
16
13
  background-color: var(--semi-color-fill-0);
17
- `;
14
+ }
18
15
 
19
- export const UIMain = styled.div`
16
+ .gedit-m-dynamic-value-input-main {
20
17
  flex-grow: 1;
21
18
  overflow: hidden;
22
19
  min-width: 0;
@@ -47,16 +44,16 @@ export const UIMain = styled.div`
47
44
  border-radius: 0;
48
45
  word-break: break-all;
49
46
  }
50
- `;
47
+ }
51
48
 
52
- export const UIType = styled.div`
49
+ .gedit-m-dynamic-value-input-type {
53
50
  & .semi-button {
54
51
  border-radius: 0;
55
52
  }
56
- `;
53
+ }
57
54
 
58
- export const UITrigger = styled.div`
55
+ .gedit-m-dynamic-value-input-trigger {
59
56
  & .semi-button {
60
57
  border-radius: 0;
61
58
  }
62
- `;
59
+ }
@@ -15,7 +15,7 @@ import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
15
15
  import { BlurInput } from '@/components/blur-input';
16
16
 
17
17
  import { PropsType } from './types';
18
- import { UIRow, UIRows } from './styles';
18
+ import './styles.css';
19
19
 
20
20
  export function InputsValues({
21
21
  value,
@@ -34,9 +34,9 @@ export function InputsValues({
34
34
 
35
35
  return (
36
36
  <div>
37
- <UIRows style={style}>
37
+ <div className="gedit-m-inputs-values-rows" style={style}>
38
38
  {list.map((item) => (
39
- <UIRow key={item.id}>
39
+ <div className="gedit-m-inputs-values-row" key={item.id}>
40
40
  <BlurInput
41
41
  style={{ width: 100, minWidth: 100, maxWidth: 100 }}
42
42
  disabled={readonly}
@@ -64,9 +64,9 @@ export function InputsValues({
64
64
  size="small"
65
65
  onClick={() => remove(item.id)}
66
66
  />
67
- </UIRow>
67
+ </div>
68
68
  ))}
69
- </UIRows>
69
+ </div>
70
70
  <Button
71
71
  disabled={readonly}
72
72
  icon={<IconPlus />}
@@ -3,17 +3,15 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import styled from 'styled-components';
7
-
8
- export const UIRows = styled.div`
6
+ .gedit-m-inputs-values-rows {
9
7
  display: flex;
10
8
  flex-direction: column;
11
9
  gap: 10px;
12
10
  margin-bottom: 10px;
13
- `;
11
+ }
14
12
 
15
- export const UIRow = styled.div`
13
+ .gedit-m-inputs-values-row {
16
14
  display: flex;
17
15
  align-items: flex-start;
18
16
  gap: 5px;
19
- `;
17
+ }