@flowgram.ai/form-materials 0.5.5 → 0.5.6
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.
- package/dist/cjs/components/batch-outputs/index.js +5 -3
- package/dist/cjs/components/batch-outputs/styles.css +13 -0
- package/dist/cjs/components/code-editor/editor.js +16 -12
- package/dist/cjs/components/code-editor/styles.css +4 -0
- package/dist/cjs/components/code-editor-mini/index.js +2 -16
- package/dist/cjs/components/condition-row/index.js +14 -12
- package/dist/cjs/components/condition-row/styles.css +19 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +28 -10
- package/dist/{esm/components/coze-editor-extensions/styles.mjs → cjs/components/coze-editor-extensions/styles.css} +19 -18
- package/dist/cjs/components/db-condition-row/index.js +16 -13
- package/dist/cjs/components/db-condition-row/styles.css +30 -0
- package/dist/cjs/components/display-inputs-values/index.js +3 -2
- package/dist/cjs/components/display-inputs-values/styles.css +6 -0
- package/dist/cjs/components/display-outputs/index.js +3 -2
- package/dist/cjs/components/display-outputs/styles.css +6 -0
- package/dist/cjs/components/display-schema-tag/index.js +7 -4
- package/dist/cjs/components/display-schema-tag/styles.css +21 -0
- package/dist/cjs/components/display-schema-tree/index.js +12 -7
- package/dist/cjs/components/display-schema-tree/styles.css +64 -0
- package/dist/cjs/components/dynamic-value-input/index.js +9 -5
- package/dist/{esm/components/dynamic-value-input/styles.mjs → cjs/components/dynamic-value-input/styles.css} +23 -30
- package/dist/cjs/components/inputs-values/index.js +5 -3
- package/dist/cjs/components/inputs-values/styles.css +13 -0
- package/dist/cjs/components/inputs-values-tree/icon.js +70 -0
- package/dist/cjs/components/inputs-values-tree/index.js +3 -2
- package/dist/cjs/components/inputs-values-tree/row.js +19 -15
- package/dist/cjs/components/inputs-values-tree/styles.css +85 -0
- package/dist/cjs/components/json-schema-editor/default-value.js +2 -2
- package/dist/cjs/components/json-schema-editor/icon.js +70 -0
- package/dist/cjs/components/json-schema-editor/index.js +37 -25
- package/dist/cjs/components/json-schema-editor/styles.css +113 -0
- package/dist/cjs/components/prompt-editor/editor.js +16 -6
- package/dist/cjs/components/prompt-editor/styles.css +10 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +16 -26
- package/dist/cjs/components/prompt-editor-with-variables/index.js +17 -26
- package/dist/cjs/components/variable-selector/context.js +7 -3
- package/dist/cjs/components/variable-selector/index.js +16 -10
- package/dist/{esm/components/variable-selector/styles.mjs → cjs/components/variable-selector/styles.css} +37 -29
- package/dist/cjs/components/variable-selector/use-variable-tree.js +3 -1
- package/dist/esm/components/batch-outputs/index.mjs +5 -3
- package/dist/esm/components/batch-outputs/styles.css +13 -0
- package/dist/esm/components/code-editor/editor.mjs +16 -11
- package/dist/esm/components/code-editor/styles.css +4 -0
- package/dist/esm/components/code-editor-mini/index.mjs +2 -6
- package/dist/esm/components/condition-row/index.mjs +14 -12
- package/dist/esm/components/condition-row/styles.css +19 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +29 -11
- package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
- package/dist/esm/components/db-condition-row/index.mjs +16 -13
- package/dist/esm/components/db-condition-row/styles.css +30 -0
- package/dist/esm/components/display-inputs-values/index.mjs +3 -2
- package/dist/esm/components/display-inputs-values/styles.css +6 -0
- package/dist/esm/components/display-outputs/index.mjs +3 -2
- package/dist/esm/components/display-outputs/styles.css +6 -0
- package/dist/esm/components/display-schema-tag/index.mjs +8 -5
- package/dist/esm/components/display-schema-tag/styles.css +21 -0
- package/dist/esm/components/display-schema-tree/index.mjs +12 -7
- package/dist/esm/components/display-schema-tree/styles.css +64 -0
- package/dist/esm/components/dynamic-value-input/index.mjs +9 -5
- package/dist/esm/components/dynamic-value-input/styles.css +48 -0
- package/dist/esm/components/inputs-values/index.mjs +5 -3
- package/dist/esm/components/inputs-values/styles.css +13 -0
- package/dist/esm/components/inputs-values-tree/icon.mjs +26 -0
- package/dist/esm/components/inputs-values-tree/index.mjs +3 -2
- package/dist/esm/components/inputs-values-tree/row.mjs +18 -14
- package/dist/esm/components/inputs-values-tree/styles.css +85 -0
- package/dist/esm/components/json-schema-editor/default-value.mjs +2 -2
- package/dist/esm/components/json-schema-editor/icon.mjs +26 -0
- package/dist/esm/components/json-schema-editor/index.mjs +36 -24
- package/dist/esm/components/json-schema-editor/styles.css +113 -0
- package/dist/esm/components/prompt-editor/editor.mjs +16 -6
- package/dist/esm/components/prompt-editor/styles.css +10 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +12 -4
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +13 -4
- package/dist/esm/components/variable-selector/context.mjs +7 -3
- package/dist/esm/components/variable-selector/index.mjs +17 -11
- package/{src/components/variable-selector/styles.tsx → dist/esm/components/variable-selector/styles.css} +35 -38
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/batch-outputs/index.d.ts +1 -0
- package/dist/types/components/code-editor/editor.d.ts +1 -0
- package/dist/types/components/condition-row/index.d.ts +5 -1
- package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +1 -0
- package/dist/types/components/db-condition-row/index.d.ts +4 -0
- package/dist/types/components/db-condition-row/types.d.ts +0 -1
- package/dist/types/components/display-inputs-values/index.d.ts +1 -0
- package/dist/types/components/display-outputs/index.d.ts +1 -0
- package/dist/types/components/display-schema-tag/index.d.ts +1 -0
- package/dist/types/components/display-schema-tree/index.d.ts +1 -0
- package/dist/types/components/dynamic-value-input/index.d.ts +1 -0
- package/dist/types/components/inputs-values/index.d.ts +1 -0
- package/dist/types/components/inputs-values-tree/icon.d.ts +6 -0
- package/dist/types/components/inputs-values-tree/index.d.ts +1 -0
- package/dist/types/components/inputs-values-tree/row.d.ts +1 -0
- package/dist/types/components/json-schema-editor/icon.d.ts +6 -0
- package/dist/types/components/json-schema-editor/index.d.ts +1 -0
- package/dist/types/components/prompt-editor/editor.d.ts +1 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +7 -2
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +5 -2
- package/dist/types/components/variable-selector/context.d.ts +16 -3
- package/dist/types/components/variable-selector/index.d.ts +1 -0
- package/package.json +7 -10
- package/src/components/batch-outputs/index.tsx +5 -5
- package/src/components/batch-outputs/{styles.tsx → styles.css} +4 -6
- package/src/components/code-editor/editor.tsx +19 -14
- package/src/components/code-editor/styles.css +11 -0
- package/src/components/code-editor-mini/index.tsx +2 -9
- package/src/components/condition-row/index.tsx +15 -22
- package/src/components/condition-row/{styles.tsx → styles.css} +10 -11
- package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +18 -13
- package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
- package/src/components/db-condition-row/index.tsx +17 -26
- package/src/components/db-condition-row/{styles.tsx → styles.css} +14 -16
- package/src/components/db-condition-row/types.ts +0 -1
- package/src/components/display-inputs-values/index.tsx +3 -3
- package/src/components/display-inputs-values/{styles.ts → styles.css} +2 -4
- package/src/components/display-outputs/index.tsx +3 -3
- package/src/components/display-outputs/{styles.ts → styles.css} +2 -4
- package/src/components/display-schema-tag/index.tsx +7 -7
- package/src/components/display-schema-tag/{styles.ts → styles.css} +7 -10
- package/src/components/display-schema-tree/index.tsx +10 -10
- package/src/components/display-schema-tree/{styles.tsx → styles.css} +18 -24
- package/src/components/dynamic-value-input/index.tsx +6 -6
- package/src/components/dynamic-value-input/{styles.tsx → styles.css} +8 -12
- package/src/components/inputs-values/index.tsx +5 -5
- package/src/components/inputs-values/{styles.tsx → styles.css} +4 -6
- package/src/components/inputs-values-tree/icon.tsx +28 -0
- package/src/components/inputs-values-tree/index.tsx +3 -3
- package/src/components/inputs-values-tree/row.tsx +25 -27
- package/src/components/inputs-values-tree/styles.css +94 -0
- package/src/components/json-schema-editor/default-value.tsx +2 -4
- package/src/components/json-schema-editor/icon.tsx +28 -0
- package/src/components/json-schema-editor/index.tsx +45 -50
- package/src/components/json-schema-editor/styles.css +135 -0
- package/src/components/prompt-editor/editor.tsx +18 -7
- package/src/components/prompt-editor/styles.css +14 -0
- package/src/components/prompt-editor-with-inputs/index.tsx +18 -5
- package/src/components/prompt-editor-with-variables/index.tsx +13 -5
- package/src/components/variable-selector/context.tsx +22 -2
- package/src/components/variable-selector/index.tsx +24 -14
- package/src/components/variable-selector/styles.css +70 -0
- package/src/components/variable-selector/use-variable-tree.tsx +9 -1
- package/dist/cjs/components/batch-outputs/styles.js +0 -60
- package/dist/cjs/components/condition-row/styles.js +0 -78
- package/dist/cjs/components/coze-editor-extensions/styles.js +0 -89
- package/dist/cjs/components/db-condition-row/styles.js +0 -94
- package/dist/cjs/components/display-inputs-values/styles.js +0 -51
- package/dist/cjs/components/display-outputs/styles.js +0 -51
- package/dist/cjs/components/display-schema-tag/styles.js +0 -71
- package/dist/cjs/components/display-schema-tree/styles.js +0 -135
- package/dist/cjs/components/dynamic-value-input/styles.js +0 -108
- package/dist/cjs/components/inputs-values/styles.js +0 -60
- package/dist/cjs/components/inputs-values-tree/styles.js +0 -177
- package/dist/cjs/components/json-schema-editor/styles.js +0 -231
- package/dist/cjs/components/prompt-editor/styles.js +0 -55
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +0 -47
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +0 -48
- package/dist/cjs/components/variable-selector/styles.js +0 -114
- package/dist/esm/components/batch-outputs/styles.mjs +0 -13
- package/dist/esm/components/condition-row/styles.mjs +0 -22
- package/dist/esm/components/db-condition-row/styles.mjs +0 -32
- package/dist/esm/components/display-inputs-values/styles.mjs +0 -7
- package/dist/esm/components/display-outputs/styles.mjs +0 -7
- package/dist/esm/components/display-schema-tag/styles.mjs +0 -21
- package/dist/esm/components/display-schema-tree/styles.mjs +0 -79
- package/dist/esm/components/inputs-values/styles.mjs +0 -13
- package/dist/esm/components/inputs-values-tree/styles.mjs +0 -105
- package/dist/esm/components/json-schema-editor/styles.mjs +0 -138
- package/dist/esm/components/prompt-editor/styles.mjs +0 -11
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +0 -13
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +0 -14
- package/dist/types/components/batch-outputs/styles.d.ts +0 -6
- package/dist/types/components/condition-row/styles.d.ts +0 -9
- package/dist/types/components/coze-editor-extensions/styles.d.ts +0 -9
- package/dist/types/components/db-condition-row/styles.d.ts +0 -12
- package/dist/types/components/display-inputs-values/styles.d.ts +0 -5
- package/dist/types/components/display-outputs/styles.d.ts +0 -5
- package/dist/types/components/display-schema-tag/styles.d.ts +0 -8
- package/dist/types/components/display-schema-tree/styles.d.ts +0 -11
- package/dist/types/components/dynamic-value-input/styles.d.ts +0 -8
- package/dist/types/components/inputs-values/styles.d.ts +0 -6
- package/dist/types/components/inputs-values-tree/styles.d.ts +0 -23
- package/dist/types/components/json-schema-editor/styles.d.ts +0 -30
- package/dist/types/components/prompt-editor/styles.d.ts +0 -7
- package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +0 -11
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +0 -9
- package/dist/types/components/variable-selector/styles.d.ts +0 -14
- package/src/components/inputs-values-tree/styles.tsx +0 -128
- package/src/components/json-schema-editor/styles.tsx +0 -168
- package/src/components/prompt-editor/styles.tsx +0 -18
- package/src/components/prompt-editor-with-inputs/editor.tsx +0 -25
- package/src/components/prompt-editor-with-variables/editor.tsx +0 -20
|
@@ -15,31 +15,23 @@ import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
|
|
|
15
15
|
import { IConditionRule, ConditionOpConfigs, useCondition } from '@/components/condition-context';
|
|
16
16
|
|
|
17
17
|
import { ConditionRowValueType } from './types';
|
|
18
|
-
import
|
|
18
|
+
import './styles.css';
|
|
19
19
|
|
|
20
20
|
interface PropTypes {
|
|
21
21
|
value?: ConditionRowValueType;
|
|
22
22
|
onChange: (value?: ConditionRowValueType) => void;
|
|
23
23
|
style?: React.CSSProperties;
|
|
24
24
|
readonly?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated use ConditionContext instead to pass ruleConfig to multiple
|
|
27
|
+
*/
|
|
25
28
|
ruleConfig?: {
|
|
26
29
|
ops?: ConditionOpConfigs;
|
|
27
30
|
rules?: Record<string, IConditionRule>;
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
ops: {},
|
|
33
|
-
rules: {},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export function ConditionRow({
|
|
37
|
-
style,
|
|
38
|
-
value,
|
|
39
|
-
onChange,
|
|
40
|
-
readonly,
|
|
41
|
-
ruleConfig = defaultRuleConfig,
|
|
42
|
-
}: PropTypes) {
|
|
34
|
+
export function ConditionRow({ style, value, onChange, readonly, ruleConfig }: PropTypes) {
|
|
43
35
|
const { left, operator, right } = value || {};
|
|
44
36
|
|
|
45
37
|
const available = useScopeAvailable();
|
|
@@ -57,6 +49,7 @@ export function ConditionRow({
|
|
|
57
49
|
const { rule, opConfig, opOptionList, targetSchema } = useCondition({
|
|
58
50
|
leftSchema,
|
|
59
51
|
operator,
|
|
52
|
+
ruleConfig,
|
|
60
53
|
});
|
|
61
54
|
|
|
62
55
|
const renderOpSelect = () => (
|
|
@@ -81,10 +74,10 @@ export function ConditionRow({
|
|
|
81
74
|
);
|
|
82
75
|
|
|
83
76
|
return (
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
<
|
|
77
|
+
<div className="gedit-m-condition-row-container" style={style}>
|
|
78
|
+
<div className="gedit-m-condition-row-operator">{renderOpSelect()}</div>
|
|
79
|
+
<div className="gedit-m-condition-row-values">
|
|
80
|
+
<div className="gedit-m-condition-row-left">
|
|
88
81
|
<InjectVariableSelector
|
|
89
82
|
readonly={readonly}
|
|
90
83
|
style={{ width: '100%' }}
|
|
@@ -99,8 +92,8 @@ export function ConditionRow({
|
|
|
99
92
|
})
|
|
100
93
|
}
|
|
101
94
|
/>
|
|
102
|
-
</
|
|
103
|
-
<
|
|
95
|
+
</div>
|
|
96
|
+
<div className="gedit-m-condition-row-right">
|
|
104
97
|
{targetSchema ? (
|
|
105
98
|
<InjectDynamicValueInput
|
|
106
99
|
readonly={readonly || !rule}
|
|
@@ -116,9 +109,9 @@ export function ConditionRow({
|
|
|
116
109
|
value={opConfig?.rightDisplay || I18n.t('Empty')}
|
|
117
110
|
/>
|
|
118
111
|
)}
|
|
119
|
-
</
|
|
120
|
-
</
|
|
121
|
-
</
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
122
115
|
);
|
|
123
116
|
}
|
|
124
117
|
|
|
@@ -3,29 +3,28 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const UIContainer = styled.div`
|
|
6
|
+
.gedit-m-condition-row-container {
|
|
9
7
|
display: flex;
|
|
10
8
|
align-items: center;
|
|
11
9
|
gap: 4px;
|
|
12
|
-
|
|
10
|
+
}
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
.gedit-m-condition-row-operator {
|
|
13
|
+
}
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
.gedit-m-condition-row-left {
|
|
17
16
|
width: 100%;
|
|
18
|
-
|
|
17
|
+
}
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
.gedit-m-condition-row-right {
|
|
21
20
|
width: 100%;
|
|
22
|
-
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
.gedit-m-condition-row-values {
|
|
25
24
|
flex-grow: 1;
|
|
26
25
|
display: flex;
|
|
27
26
|
flex-direction: column;
|
|
28
27
|
align-items: center;
|
|
29
28
|
gap: 4px;
|
|
30
29
|
overflow: hidden;
|
|
31
|
-
|
|
30
|
+
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useCurrentScope,
|
|
15
15
|
} from '@flowgram.ai/editor';
|
|
16
16
|
import { useInjector } from '@flowgram.ai/coze-editor/react';
|
|
17
|
-
import { Popover } from '@douyinfe/semi-ui';
|
|
17
|
+
import { Popover, Tag } from '@douyinfe/semi-ui';
|
|
18
18
|
import { IconIssueStroked } from '@douyinfe/semi-icons';
|
|
19
19
|
import {
|
|
20
20
|
Decoration,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
|
|
28
28
|
import { IPolyfillRoot, polyfillCreateRoot } from '@/shared';
|
|
29
29
|
|
|
30
|
-
import
|
|
30
|
+
import '../styles.css';
|
|
31
31
|
|
|
32
32
|
class VariableTagWidget extends WidgetType {
|
|
33
33
|
keyPath?: string[];
|
|
@@ -56,9 +56,10 @@ class VariableTagWidget extends WidgetType {
|
|
|
56
56
|
renderVariable(v?: BaseVariableField) {
|
|
57
57
|
if (!v) {
|
|
58
58
|
this.root.render(
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
<Tag className="gedit-m-coze-editor-tag" color="amber">
|
|
60
|
+
<IconIssueStroked style={{ marginRight: '4px' }} />
|
|
61
|
+
<span>Unknown</span>
|
|
62
|
+
</Tag>
|
|
62
63
|
);
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
@@ -67,26 +68,30 @@ class VariableTagWidget extends WidgetType {
|
|
|
67
68
|
const isRoot = v === rootField;
|
|
68
69
|
|
|
69
70
|
const rootTitle = (
|
|
70
|
-
<
|
|
71
|
+
<span className="gedit-m-coze-editor-root-title">
|
|
71
72
|
{rootField.meta?.title ? `${rootField.meta.title} ${isRoot ? '' : '-'} ` : ''}
|
|
72
|
-
</
|
|
73
|
+
</span>
|
|
73
74
|
);
|
|
74
75
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
75
76
|
|
|
76
77
|
this.root.render(
|
|
77
78
|
<Popover
|
|
78
79
|
content={
|
|
79
|
-
<
|
|
80
|
+
<div className="gedit-m-coze-editor-popover-content">
|
|
80
81
|
{rootIcon}
|
|
81
82
|
{rootTitle}
|
|
82
|
-
<
|
|
83
|
-
</
|
|
83
|
+
<span className="gedit-m-coze-editor-var-name">{v?.keyPath.slice(1).join('.')}</span>
|
|
84
|
+
</div>
|
|
84
85
|
}
|
|
85
86
|
>
|
|
86
|
-
<
|
|
87
|
+
<Tag
|
|
88
|
+
className="gedit-m-coze-editor-tag"
|
|
89
|
+
style={{ display: 'inline-flex', alignItems: 'center' }}
|
|
90
|
+
>
|
|
91
|
+
{rootIcon}
|
|
87
92
|
{rootTitle}
|
|
88
|
-
{!isRoot && <
|
|
89
|
-
</
|
|
93
|
+
{!isRoot && <span className="gedit-m-coze-editor-var-name">{v?.key}</span>}
|
|
94
|
+
</Tag>
|
|
90
95
|
</Popover>
|
|
91
96
|
);
|
|
92
97
|
}
|
|
@@ -3,25 +3,22 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
44
|
+
ruleConfig,
|
|
55
45
|
}: PropTypes) {
|
|
56
46
|
const { left, operator, right } = value || {};
|
|
57
47
|
|
|
@@ -69,7 +59,8 @@ export function DBConditionRow({
|
|
|
69
59
|
});
|
|
70
60
|
|
|
71
61
|
const renderDBOptionSelect = () => (
|
|
72
|
-
<
|
|
62
|
+
<Select
|
|
63
|
+
className="gedit-m-db-condition-row-select"
|
|
73
64
|
disabled={readonly}
|
|
74
65
|
size="small"
|
|
75
66
|
style={{ width: '100%' }}
|
|
@@ -83,10 +74,10 @@ export function DBConditionRow({
|
|
|
83
74
|
optionList={
|
|
84
75
|
options?.map((item) => ({
|
|
85
76
|
label: (
|
|
86
|
-
<
|
|
77
|
+
<div className="gedit-m-db-condition-row-option-label">
|
|
87
78
|
<Icon size="small" svg={typeManager.getDisplayIcon(item.schema)} />
|
|
88
79
|
{item.label}
|
|
89
|
-
</
|
|
80
|
+
</div>
|
|
90
81
|
),
|
|
91
82
|
value: item.value,
|
|
92
83
|
})) || []
|
|
@@ -116,11 +107,11 @@ export function DBConditionRow({
|
|
|
116
107
|
);
|
|
117
108
|
|
|
118
109
|
return (
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<
|
|
122
|
-
<
|
|
123
|
-
<
|
|
110
|
+
<div className="gedit-m-db-condition-row-container" style={style}>
|
|
111
|
+
<div className="gedit-m-db-condition-row-operator">{renderOpSelect()}</div>
|
|
112
|
+
<div className="gedit-m-db-condition-row-values">
|
|
113
|
+
<div className="gedit-m-db-condition-row-left">{renderDBOptionSelect()}</div>
|
|
114
|
+
<div className="gedit-m-db-condition-row-right">
|
|
124
115
|
{targetSchema ? (
|
|
125
116
|
<InjectDynamicValueInput
|
|
126
117
|
readonly={readonly || !rule}
|
|
@@ -136,9 +127,9 @@ export function DBConditionRow({
|
|
|
136
127
|
value={opConfig?.rightDisplay || I18n.t('Empty')}
|
|
137
128
|
/>
|
|
138
129
|
)}
|
|
139
|
-
</
|
|
140
|
-
</
|
|
141
|
-
</
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
142
133
|
);
|
|
143
134
|
}
|
|
144
135
|
|
|
@@ -3,41 +3,39 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
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
|
-
|
|
12
|
+
.gedit-m-db-condition-row-operator {
|
|
13
|
+
}
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
.gedit-m-db-condition-row-left {
|
|
18
16
|
width: 100%;
|
|
19
|
-
|
|
17
|
+
}
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
.gedit-m-db-condition-row-right {
|
|
22
20
|
width: 100%;
|
|
23
|
-
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
+
.gedit-m-db-condition-row-select {
|
|
40
38
|
& .semi-select-selection {
|
|
41
39
|
margin-left: 5px;
|
|
42
40
|
}
|
|
43
|
-
|
|
41
|
+
}
|
|
@@ -12,7 +12,7 @@ import { IInputsValues } from '@/shared/flow-value';
|
|
|
12
12
|
import { FlowValueUtils } from '@/shared';
|
|
13
13
|
import { DisplayFlowValue } from '@/components/display-flow-value';
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import './styles.css';
|
|
16
16
|
import { DisplaySchemaTag } from '../display-schema-tag';
|
|
17
17
|
|
|
18
18
|
interface PropsType {
|
|
@@ -24,7 +24,7 @@ export function DisplayInputsValues({ value, showIconInTree }: PropsType) {
|
|
|
24
24
|
const childEntries = Object.entries(value || {});
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
27
|
+
<div className="gedit-m-display-inputs-wrapper">
|
|
28
28
|
{childEntries.map(([key, value]) => {
|
|
29
29
|
if (FlowValueUtils.isFlowValue(value)) {
|
|
30
30
|
return (
|
|
@@ -45,7 +45,7 @@ export function DisplayInputsValues({ value, showIconInTree }: PropsType) {
|
|
|
45
45
|
|
|
46
46
|
return null;
|
|
47
47
|
})}
|
|
48
|
-
</
|
|
48
|
+
</div>
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -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
|
|
13
|
+
import './styles.css';
|
|
14
14
|
|
|
15
15
|
interface PropsType {
|
|
16
16
|
value?: IJsonSchema;
|
|
@@ -50,7 +50,7 @@ export function DisplayOutputs({ value, showIconInTree, displayFromScope }: Prop
|
|
|
50
50
|
const childEntries = Object.entries(properties || {});
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<
|
|
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
|
-
</
|
|
63
|
+
</div>
|
|
64
64
|
);
|
|
65
65
|
}
|
|
@@ -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
|
|
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
|
-
<
|
|
31
|
+
<div className="gedit-m-display-schema-tag-popover-content">
|
|
32
32
|
<DisplaySchemaTree value={value} typeManager={typeManager} showIcon={showIconInTree} />
|
|
33
|
-
</
|
|
33
|
+
</div>
|
|
34
34
|
}
|
|
35
35
|
>
|
|
36
|
-
<
|
|
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 && <
|
|
42
|
-
</
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
<
|
|
49
|
-
<
|
|
50
|
-
{depth !== 0 && <
|
|
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
|
-
<
|
|
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
|
-
</
|
|
67
|
-
</
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
68
|
{childEntries?.length ? (
|
|
69
|
-
<
|
|
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
|
-
</
|
|
73
|
+
</div>
|
|
74
74
|
) : null}
|
|
75
|
-
</
|
|
75
|
+
</div>
|
|
76
76
|
);
|
|
77
77
|
}
|