@flowgram.ai/form-materials 0.5.4 → 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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.gedit-m-condition-row-container {
|
|
2
|
+
align-items: center;
|
|
3
|
+
gap: 4px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.gedit-m-condition-row-left, .gedit-m-condition-row-right {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.gedit-m-condition-row-values {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
flex-grow: 1;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 4px;
|
|
16
|
+
display: flex;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
@@ -3,11 +3,11 @@ import { useLayoutEffect } from "react";
|
|
|
3
3
|
import { isEqual, last } from "lodash-es";
|
|
4
4
|
import { Disposable, DisposableCollection, useCurrentScope } from "@flowgram.ai/editor";
|
|
5
5
|
import { useInjector } from "@flowgram.ai/coze-editor/react";
|
|
6
|
-
import { Popover } from "@douyinfe/semi-ui";
|
|
6
|
+
import { Popover, Tag } from "@douyinfe/semi-ui";
|
|
7
7
|
import { IconIssueStroked } from "@douyinfe/semi-icons";
|
|
8
8
|
import { Decoration, EditorView, MatchDecorator, ViewPlugin, WidgetType } from "@codemirror/view";
|
|
9
9
|
import { polyfillCreateRoot } from "../../../shared/index.mjs";
|
|
10
|
-
import
|
|
10
|
+
import "../styles.css";
|
|
11
11
|
class VariableTagWidget extends WidgetType {
|
|
12
12
|
constructor({ keyPath, scope }){
|
|
13
13
|
super(), this.toDispose = new DisposableCollection(), this.renderIcon = (icon)=>{
|
|
@@ -25,32 +25,50 @@ class VariableTagWidget extends WidgetType {
|
|
|
25
25
|
this.scope = scope;
|
|
26
26
|
}
|
|
27
27
|
renderVariable(v) {
|
|
28
|
-
if (!v) return void this.root.render(/*#__PURE__*/
|
|
29
|
-
|
|
28
|
+
if (!v) return void this.root.render(/*#__PURE__*/ jsxs(Tag, {
|
|
29
|
+
className: "gedit-m-coze-editor-tag",
|
|
30
30
|
color: "amber",
|
|
31
|
-
children:
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx(IconIssueStroked, {
|
|
33
|
+
style: {
|
|
34
|
+
marginRight: '4px'
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ jsx("span", {
|
|
38
|
+
children: "Unknown"
|
|
39
|
+
})
|
|
40
|
+
]
|
|
32
41
|
}));
|
|
33
42
|
const rootField = last(v.parentFields) || v;
|
|
34
43
|
const isRoot = v === rootField;
|
|
35
|
-
const rootTitle = /*#__PURE__*/ jsx(
|
|
44
|
+
const rootTitle = /*#__PURE__*/ jsx("span", {
|
|
45
|
+
className: "gedit-m-coze-editor-root-title",
|
|
36
46
|
children: rootField.meta?.title ? `${rootField.meta.title} ${isRoot ? '' : '-'} ` : ''
|
|
37
47
|
});
|
|
38
48
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
39
49
|
this.root.render(/*#__PURE__*/ jsx(Popover, {
|
|
40
|
-
content: /*#__PURE__*/ jsxs(
|
|
50
|
+
content: /*#__PURE__*/ jsxs("div", {
|
|
51
|
+
className: "gedit-m-coze-editor-popover-content",
|
|
41
52
|
children: [
|
|
42
53
|
rootIcon,
|
|
43
54
|
rootTitle,
|
|
44
|
-
/*#__PURE__*/ jsx(
|
|
55
|
+
/*#__PURE__*/ jsx("span", {
|
|
56
|
+
className: "gedit-m-coze-editor-var-name",
|
|
45
57
|
children: v?.keyPath.slice(1).join('.')
|
|
46
58
|
})
|
|
47
59
|
]
|
|
48
60
|
}),
|
|
49
|
-
children: /*#__PURE__*/ jsxs(
|
|
50
|
-
|
|
61
|
+
children: /*#__PURE__*/ jsxs(Tag, {
|
|
62
|
+
className: "gedit-m-coze-editor-tag",
|
|
63
|
+
style: {
|
|
64
|
+
display: 'inline-flex',
|
|
65
|
+
alignItems: 'center'
|
|
66
|
+
},
|
|
51
67
|
children: [
|
|
68
|
+
rootIcon,
|
|
52
69
|
rootTitle,
|
|
53
|
-
!isRoot && /*#__PURE__*/ jsx(
|
|
70
|
+
!isRoot && /*#__PURE__*/ jsx("span", {
|
|
71
|
+
className: "gedit-m-coze-editor-var-name",
|
|
54
72
|
children: v?.key
|
|
55
73
|
})
|
|
56
74
|
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.gedit-m-coze-editor-root-title {
|
|
2
|
+
text-overflow: ellipsis;
|
|
3
|
+
white-space: nowrap;
|
|
4
|
+
min-width: 20px;
|
|
5
|
+
color: var(--semi-color-text-2);
|
|
6
|
+
margin-right: 4px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.gedit-m-coze-editor-var-name {
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.gedit-m-coze-editor-tag {
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
align-items: center;
|
|
19
|
+
max-width: 300px;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
|
|
22
|
+
& .semi-tag-content-center {
|
|
23
|
+
justify-content: flex-start;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.semi-tag {
|
|
27
|
+
margin: 0 5px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gedit-m-coze-editor-popover-content {
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
align-items: center;
|
|
34
|
+
padding: 10px;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -6,12 +6,8 @@ import { IconChevronDownStroked } from "@douyinfe/semi-icons";
|
|
|
6
6
|
import { useTypeManager } from "../../plugins/index.mjs";
|
|
7
7
|
import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
|
|
8
8
|
import { useCondition } from "../condition-context/index.mjs";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
ops: {},
|
|
12
|
-
rules: {}
|
|
13
|
-
};
|
|
14
|
-
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig = defaultRuleConfig }) {
|
|
9
|
+
import "./styles.css";
|
|
10
|
+
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig }) {
|
|
15
11
|
const { left, operator, right } = value || {};
|
|
16
12
|
const typeManager = useTypeManager();
|
|
17
13
|
const leftSchema = useMemo(()=>options?.find((item)=>item.value === left)?.schema, [
|
|
@@ -23,7 +19,8 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
23
19
|
operator,
|
|
24
20
|
ruleConfig
|
|
25
21
|
});
|
|
26
|
-
const renderDBOptionSelect = ()=>/*#__PURE__*/ jsx(
|
|
22
|
+
const renderDBOptionSelect = ()=>/*#__PURE__*/ jsx(Select, {
|
|
23
|
+
className: "gedit-m-db-condition-row-select",
|
|
27
24
|
disabled: readonly,
|
|
28
25
|
size: "small",
|
|
29
26
|
style: {
|
|
@@ -35,7 +32,8 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
35
32
|
left: v
|
|
36
33
|
}),
|
|
37
34
|
optionList: options?.map((item)=>({
|
|
38
|
-
label: /*#__PURE__*/ jsxs(
|
|
35
|
+
label: /*#__PURE__*/ jsxs("div", {
|
|
36
|
+
className: "gedit-m-db-condition-row-option-label",
|
|
39
37
|
children: [
|
|
40
38
|
/*#__PURE__*/ jsx(Icon, {
|
|
41
39
|
size: "small",
|
|
@@ -69,18 +67,23 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
69
67
|
})
|
|
70
68
|
})
|
|
71
69
|
});
|
|
72
|
-
return /*#__PURE__*/ jsxs(
|
|
70
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
71
|
+
className: "gedit-m-db-condition-row-container",
|
|
73
72
|
style: style,
|
|
74
73
|
children: [
|
|
75
|
-
/*#__PURE__*/ jsx(
|
|
74
|
+
/*#__PURE__*/ jsx("div", {
|
|
75
|
+
className: "gedit-m-db-condition-row-operator",
|
|
76
76
|
children: renderOpSelect()
|
|
77
77
|
}),
|
|
78
|
-
/*#__PURE__*/ jsxs(
|
|
78
|
+
/*#__PURE__*/ jsxs("div", {
|
|
79
|
+
className: "gedit-m-db-condition-row-values",
|
|
79
80
|
children: [
|
|
80
|
-
/*#__PURE__*/ jsx(
|
|
81
|
+
/*#__PURE__*/ jsx("div", {
|
|
82
|
+
className: "gedit-m-db-condition-row-left",
|
|
81
83
|
children: renderDBOptionSelect()
|
|
82
84
|
}),
|
|
83
|
-
/*#__PURE__*/ jsx(
|
|
85
|
+
/*#__PURE__*/ jsx("div", {
|
|
86
|
+
className: "gedit-m-db-condition-row-right",
|
|
84
87
|
children: targetSchema ? /*#__PURE__*/ jsx(InjectDynamicValueInput, {
|
|
85
88
|
readonly: readonly || !rule,
|
|
86
89
|
value: right,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.gedit-m-db-condition-row-container {
|
|
2
|
+
align-items: center;
|
|
3
|
+
gap: 4px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.gedit-m-db-condition-row-left, .gedit-m-db-condition-row-right {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.gedit-m-db-condition-row-values {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
flex-grow: 1;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 4px;
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.gedit-m-db-condition-row-option-label {
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
display: flex;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.gedit-m-db-condition-row-select {
|
|
26
|
+
& .semi-select-selection {
|
|
27
|
+
margin-left: 5px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -4,11 +4,12 @@ import { isPlainObject } from "lodash-es";
|
|
|
4
4
|
import { useScopeAvailable } from "@flowgram.ai/editor";
|
|
5
5
|
import { FlowValueUtils } from "../../shared/index.mjs";
|
|
6
6
|
import { DisplayFlowValue } from "../display-flow-value/index.mjs";
|
|
7
|
-
import
|
|
7
|
+
import "./styles.css";
|
|
8
8
|
import { DisplaySchemaTag } from "../display-schema-tag/index.mjs";
|
|
9
9
|
function DisplayInputsValues({ value, showIconInTree }) {
|
|
10
10
|
const childEntries = Object.entries(value || {});
|
|
11
|
-
return /*#__PURE__*/ jsx(
|
|
11
|
+
return /*#__PURE__*/ jsx("div", {
|
|
12
|
+
className: "gedit-m-display-inputs-wrapper",
|
|
12
13
|
children: childEntries.map(([key, value])=>{
|
|
13
14
|
if (FlowValueUtils.isFlowValue(value)) return /*#__PURE__*/ jsx(DisplayFlowValue, {
|
|
14
15
|
title: key,
|
|
@@ -3,7 +3,7 @@ import { useEffect } from "react";
|
|
|
3
3
|
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
4
4
|
import { useCurrentScope, useRefresh } from "@flowgram.ai/editor";
|
|
5
5
|
import { DisplaySchemaTag } from "../display-schema-tag/index.mjs";
|
|
6
|
-
import
|
|
6
|
+
import "./styles.css";
|
|
7
7
|
function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
8
8
|
const scope = useCurrentScope();
|
|
9
9
|
const refresh = useRefresh();
|
|
@@ -26,7 +26,8 @@ function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
|
26
26
|
return acm;
|
|
27
27
|
}, {}) : value?.properties || {};
|
|
28
28
|
const childEntries = Object.entries(properties || {});
|
|
29
|
-
return /*#__PURE__*/ jsx(
|
|
29
|
+
return /*#__PURE__*/ jsx("div", {
|
|
30
|
+
className: "gedit-m-display-outputs-wrapper",
|
|
30
31
|
children: childEntries.map(([key, schema])=>/*#__PURE__*/ jsx(DisplaySchemaTag, {
|
|
31
32
|
title: key,
|
|
32
33
|
value: schema,
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import react from "react";
|
|
3
|
-
import { Popover } from "@douyinfe/semi-ui";
|
|
3
|
+
import { Popover, Tag } from "@douyinfe/semi-ui";
|
|
4
4
|
import { useTypeManager } from "../../plugins/index.mjs";
|
|
5
5
|
import { DisplaySchemaTree } from "../display-schema-tree/index.mjs";
|
|
6
|
-
import
|
|
6
|
+
import "./styles.css";
|
|
7
7
|
function DisplaySchemaTag({ value = {}, showIconInTree, title, warning }) {
|
|
8
8
|
const typeManager = useTypeManager();
|
|
9
9
|
const icon = typeManager?.getDisplayIcon(value) || typeManager.getDisplayIcon({
|
|
10
10
|
type: 'unknown'
|
|
11
11
|
});
|
|
12
12
|
return /*#__PURE__*/ jsx(Popover, {
|
|
13
|
-
content: /*#__PURE__*/ jsx(
|
|
13
|
+
content: /*#__PURE__*/ jsx("div", {
|
|
14
|
+
className: "gedit-m-display-schema-tag-popover-content",
|
|
14
15
|
children: /*#__PURE__*/ jsx(DisplaySchemaTree, {
|
|
15
16
|
value: value,
|
|
16
17
|
typeManager: typeManager,
|
|
17
18
|
showIcon: showIconInTree
|
|
18
19
|
})
|
|
19
20
|
}),
|
|
20
|
-
children: /*#__PURE__*/ jsxs(
|
|
21
|
+
children: /*#__PURE__*/ jsxs(Tag, {
|
|
21
22
|
color: warning ? 'amber' : 'white',
|
|
23
|
+
className: "gedit-m-display-schema-tag-tag",
|
|
22
24
|
children: [
|
|
23
25
|
icon && /*#__PURE__*/ react.cloneElement(icon, {
|
|
24
26
|
className: 'tag-icon'
|
|
25
27
|
}),
|
|
26
|
-
title && /*#__PURE__*/ jsx(
|
|
28
|
+
title && /*#__PURE__*/ jsx("span", {
|
|
29
|
+
className: "gedit-m-display-schema-tag-title",
|
|
27
30
|
children: title
|
|
28
31
|
})
|
|
29
32
|
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.gedit-m-display-schema-tag-popover-content {
|
|
2
|
+
padding: 10px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.gedit-m-display-schema-tag-tag {
|
|
6
|
+
padding: 4px;
|
|
7
|
+
|
|
8
|
+
& .tag-icon {
|
|
9
|
+
width: 12px;
|
|
10
|
+
height: 12px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.gedit-m-display-schema-tag-title {
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
margin-top: -1px;
|
|
17
|
+
margin-left: 4px;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import react from "react";
|
|
3
3
|
import { useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
|
-
import
|
|
4
|
+
import "./styles.css";
|
|
5
5
|
function DisplaySchemaTree(props) {
|
|
6
6
|
return /*#__PURE__*/ jsx(SchemaTree, {
|
|
7
7
|
...props
|
|
@@ -15,16 +15,20 @@ function SchemaTree(props) {
|
|
|
15
15
|
const icon = typeManager?.getDisplayIcon(schema);
|
|
16
16
|
let properties = drilldown && config ? config.getTypeSchemaProperties(schema) : {};
|
|
17
17
|
const childEntries = Object.entries(properties || {});
|
|
18
|
-
return /*#__PURE__*/ jsxs(
|
|
19
|
-
|
|
18
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
19
|
+
className: `gedit-m-display-schema-tree-item depth-${depth}`,
|
|
20
20
|
children: [
|
|
21
|
-
/*#__PURE__*/ jsxs(
|
|
21
|
+
/*#__PURE__*/ jsxs("div", {
|
|
22
|
+
className: "gedit-m-display-schema-tree-row",
|
|
22
23
|
children: [
|
|
23
|
-
0 !== depth && /*#__PURE__*/ jsx(
|
|
24
|
+
0 !== depth && /*#__PURE__*/ jsx("div", {
|
|
25
|
+
className: "gedit-m-display-schema-tree-horizontal-line"
|
|
26
|
+
}),
|
|
24
27
|
showIcon && icon && /*#__PURE__*/ react.cloneElement(icon, {
|
|
25
28
|
className: 'tree-icon'
|
|
26
29
|
}),
|
|
27
|
-
/*#__PURE__*/ jsx(
|
|
30
|
+
/*#__PURE__*/ jsx("div", {
|
|
31
|
+
className: "gedit-m-display-schema-tree-title",
|
|
28
32
|
children: parentKey ? /*#__PURE__*/ jsxs(Fragment, {
|
|
29
33
|
children: [
|
|
30
34
|
`${parentKey} (`,
|
|
@@ -35,7 +39,8 @@ function SchemaTree(props) {
|
|
|
35
39
|
})
|
|
36
40
|
]
|
|
37
41
|
}),
|
|
38
|
-
childEntries?.length ? /*#__PURE__*/ jsx(
|
|
42
|
+
childEntries?.length ? /*#__PURE__*/ jsx("div", {
|
|
43
|
+
className: "gedit-m-display-schema-tree-level",
|
|
39
44
|
children: childEntries.map(([key, value])=>/*#__PURE__*/ jsx(SchemaTree, {
|
|
40
45
|
...props,
|
|
41
46
|
parentKey: key,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.gedit-m-display-schema-tree-row {
|
|
2
|
+
align-items: center;
|
|
3
|
+
display: flex;
|
|
4
|
+
|
|
5
|
+
& .tree-icon {
|
|
6
|
+
width: 14px;
|
|
7
|
+
height: 14px;
|
|
8
|
+
margin-right: 8px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
height: 27px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.gedit-m-display-schema-tree-horizontal-line {
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
&:before, &:after {
|
|
19
|
+
content: "";
|
|
20
|
+
background-color: var(--semi-color-text-3);
|
|
21
|
+
position: absolute;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:after {
|
|
25
|
+
width: 15px;
|
|
26
|
+
height: 1px;
|
|
27
|
+
top: 0;
|
|
28
|
+
right: 6px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.gedit-m-display-schema-tree-level {
|
|
33
|
+
padding-left: 30px;
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.gedit-m-display-schema-tree-item {
|
|
38
|
+
position: relative;
|
|
39
|
+
|
|
40
|
+
&:before {
|
|
41
|
+
content: "";
|
|
42
|
+
background-color: var(--semi-color-text-3);
|
|
43
|
+
position: absolute;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:not(:last-child):before {
|
|
47
|
+
width: 1px;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
left: -22px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:last-child:before {
|
|
54
|
+
width: 1px;
|
|
55
|
+
height: 14px;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: -22px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.depth-0:before {
|
|
61
|
+
width: 0 !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -7,7 +7,7 @@ import { createInjectMaterial } from "../../shared/index.mjs";
|
|
|
7
7
|
import { InjectVariableSelector } from "../variable-selector/index.mjs";
|
|
8
8
|
import { TypeSelector } from "../type-selector/index.mjs";
|
|
9
9
|
import { ConstantInput } from "../constant-input/index.mjs";
|
|
10
|
-
import
|
|
10
|
+
import "./styles.css";
|
|
11
11
|
import { useIncludeSchema, useRefVariable, useSelectSchema } from "./hooks.mjs";
|
|
12
12
|
const DEFAULT_VALUE = {
|
|
13
13
|
type: 'constant',
|
|
@@ -117,16 +117,20 @@ function DynamicValueInput({ value, onChange, readonly, style, schema: schemaFro
|
|
|
117
117
|
})
|
|
118
118
|
})
|
|
119
119
|
});
|
|
120
|
-
return /*#__PURE__*/ jsxs(
|
|
120
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
121
|
+
className: "gedit-m-dynamic-value-input-container",
|
|
121
122
|
style: style,
|
|
122
123
|
children: [
|
|
123
|
-
/*#__PURE__*/ jsx(
|
|
124
|
+
/*#__PURE__*/ jsx("div", {
|
|
125
|
+
className: "gedit-m-dynamic-value-input-type",
|
|
124
126
|
children: renderTypeSelector()
|
|
125
127
|
}),
|
|
126
|
-
/*#__PURE__*/ jsx(
|
|
128
|
+
/*#__PURE__*/ jsx("div", {
|
|
129
|
+
className: "gedit-m-dynamic-value-input-main",
|
|
127
130
|
children: renderMain()
|
|
128
131
|
}),
|
|
129
|
-
/*#__PURE__*/ jsx(
|
|
132
|
+
/*#__PURE__*/ jsx("div", {
|
|
133
|
+
className: "gedit-m-dynamic-value-input-trigger",
|
|
130
134
|
children: renderTrigger()
|
|
131
135
|
})
|
|
132
136
|
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.gedit-m-dynamic-value-input-container {
|
|
2
|
+
border: 1px solid var(--semi-color-border);
|
|
3
|
+
background-color: var(--semi-color-fill-0);
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
line-height: normal;
|
|
7
|
+
display: flex;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.gedit-m-dynamic-value-input-main {
|
|
12
|
+
border-left: 1px solid var(--semi-color-border);
|
|
13
|
+
border-right: 1px solid var(--semi-color-border);
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
|
|
18
|
+
& .semi-tree-select, & .semi-input-number, & .semi-select {
|
|
19
|
+
border: none;
|
|
20
|
+
border-radius: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& .semi-input-wrapper, & .semi-input-textarea-wrapper {
|
|
25
|
+
border: none;
|
|
26
|
+
border-radius: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& .semi-input-textarea {
|
|
30
|
+
word-break: break-all;
|
|
31
|
+
border: none;
|
|
32
|
+
border-radius: 0;
|
|
33
|
+
padding: 2px 6px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.gedit-m-dynamic-value-input-type {
|
|
38
|
+
& .semi-button {
|
|
39
|
+
border-radius: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.gedit-m-dynamic-value-input-trigger {
|
|
44
|
+
& .semi-button {
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
@@ -6,7 +6,7 @@ import { IconDelete, IconPlus } from "@douyinfe/semi-icons";
|
|
|
6
6
|
import { useObjectList } from "../../hooks/index.mjs";
|
|
7
7
|
import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
|
|
8
8
|
import { BlurInput } from "../blur-input/index.mjs";
|
|
9
|
-
import
|
|
9
|
+
import "./styles.css";
|
|
10
10
|
function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError }) {
|
|
11
11
|
const { list, updateKey, updateValue, remove, add } = useObjectList({
|
|
12
12
|
value,
|
|
@@ -15,9 +15,11 @@ function InputsValues({ value, onChange, style, readonly, constantProps, schema,
|
|
|
15
15
|
});
|
|
16
16
|
return /*#__PURE__*/ jsxs("div", {
|
|
17
17
|
children: [
|
|
18
|
-
/*#__PURE__*/ jsx(
|
|
18
|
+
/*#__PURE__*/ jsx("div", {
|
|
19
|
+
className: "gedit-m-inputs-values-rows",
|
|
19
20
|
style: style,
|
|
20
|
-
children: list.map((item)=>/*#__PURE__*/ jsxs(
|
|
21
|
+
children: list.map((item)=>/*#__PURE__*/ jsxs("div", {
|
|
22
|
+
className: "gedit-m-inputs-values-row",
|
|
21
23
|
children: [
|
|
22
24
|
/*#__PURE__*/ jsx(BlurInput, {
|
|
23
25
|
style: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import semi_icons from "@douyinfe/semi-icons";
|
|
4
|
+
const iconAddChildrenSvg = /*#__PURE__*/ jsxs("svg", {
|
|
5
|
+
className: "icon-icon icon-icon-coz_add_node ",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx("path", {
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
clipRule: "evenodd",
|
|
15
|
+
d: "M11 6.49988C11 8.64148 9.50397 10.4337 7.49995 10.8884V15.4998C7.49995 16.0521 7.94767 16.4998 8.49995 16.4998H11.208C11.0742 16.8061 11 17.1443 11 17.4998C11 17.8554 11.0742 18.1936 11.208 18.4998H8.49995C6.8431 18.4998 5.49995 17.1567 5.49995 15.4998V10.8884C3.49599 10.4336 2 8.64145 2 6.49988C2 4.0146 4.01472 1.99988 6.5 1.99988C8.98528 1.99988 11 4.0146 11 6.49988ZM6.5 8.99988C7.88071 8.99988 9 7.88059 9 6.49988C9 5.11917 7.88071 3.99988 6.5 3.99988C5.11929 3.99988 4 5.11917 4 6.49988C4 7.88059 5.11929 8.99988 6.5 8.99988Z"
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx("path", {
|
|
18
|
+
d: "M17.5 12.4999C18.0523 12.4999 18.5 12.9476 18.5 13.4999V16.4999H21.5C22.0523 16.4999 22.5 16.9476 22.5 17.4999C22.5 18.0522 22.0523 18.4999 21.5 18.4999H18.5V21.4999C18.5 22.0522 18.0523 22.4999 17.5 22.4999C16.9477 22.4999 16.5 22.0522 16.5 21.4999V18.4999H13.5C12.9477 18.4999 12.5 18.0522 12.5 17.4999C12.5 16.9476 12.9477 16.4999 13.5 16.4999H16.5V13.4999C16.5 12.9476 16.9477 12.4999 17.5 12.4999Z"
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
const IconAddChildren = ()=>/*#__PURE__*/ jsx(semi_icons, {
|
|
23
|
+
size: "small",
|
|
24
|
+
svg: iconAddChildrenSvg
|
|
25
|
+
});
|
|
26
|
+
export { IconAddChildren };
|
|
@@ -5,7 +5,7 @@ import { Button } from "@douyinfe/semi-ui";
|
|
|
5
5
|
import { IconPlus } from "@douyinfe/semi-icons";
|
|
6
6
|
import { FlowValueUtils } from "../../shared/index.mjs";
|
|
7
7
|
import { useObjectList } from "../../hooks/index.mjs";
|
|
8
|
-
import
|
|
8
|
+
import "./styles.css";
|
|
9
9
|
import { InputValueRow } from "./row.mjs";
|
|
10
10
|
function InputsValuesTree(props) {
|
|
11
11
|
const { value, onChange, readonly, hasError, constantProps } = props;
|
|
@@ -16,7 +16,8 @@ function InputsValuesTree(props) {
|
|
|
16
16
|
});
|
|
17
17
|
return /*#__PURE__*/ jsxs("div", {
|
|
18
18
|
children: [
|
|
19
|
-
/*#__PURE__*/ jsx(
|
|
19
|
+
/*#__PURE__*/ jsx("div", {
|
|
20
|
+
className: "gedit-m-inputs-values-tree-tree-items",
|
|
20
21
|
children: list.map((item)=>/*#__PURE__*/ jsx(InputValueRow, {
|
|
21
22
|
keyName: item.key,
|
|
22
23
|
value: item.value,
|