@flowgram.ai/form-materials 0.5.5 → 0.5.7
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/blur-input/index.js +4 -1
- 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-context/hooks/use-condition.js +17 -1
- package/dist/cjs/components/condition-row/index.js +26 -12
- package/dist/cjs/components/condition-row/styles.css +19 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +2 -2
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +44 -15
- 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 +29 -14
- 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 +5 -4
- 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/cjs/effects/validate-when-variable-sync/index.js +3 -3
- package/dist/cjs/shared/inject-material/index.js +1 -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/blur-input/index.mjs +4 -1
- 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-context/hooks/use-condition.mjs +18 -2
- package/dist/esm/components/condition-row/index.mjs +26 -12
- package/dist/esm/components/condition-row/styles.css +19 -0
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +3 -3
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +45 -16
- package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
- package/dist/esm/components/db-condition-row/index.mjs +29 -14
- 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 +5 -4
- 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/esm/effects/validate-when-variable-sync/index.mjs +3 -3
- package/dist/esm/shared/inject-material/index.mjs +1 -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-context/hooks/use-condition.d.ts +16 -1
- 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/blur-input/index.tsx +4 -1
- 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-context/hooks/use-condition.tsx +51 -7
- package/src/components/condition-row/index.tsx +27 -22
- package/src/components/condition-row/{styles.tsx → styles.css} +10 -11
- package/src/components/coze-editor-extensions/extensions/inputs-tree.tsx +3 -3
- package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +35 -22
- package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
- package/src/components/db-condition-row/index.tsx +29 -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 +5 -5
- 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/src/effects/validate-when-variable-sync/index.ts +7 -3
- package/src/shared/inject-material/index.tsx +1 -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
|
@@ -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,
|
|
@@ -3,10 +3,11 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
4
|
import { IconButton, Input } from "@douyinfe/semi-ui";
|
|
5
5
|
import { IconChevronDown, IconChevronRight, IconDelete } from "@douyinfe/semi-icons";
|
|
6
|
-
import
|
|
6
|
+
import "./styles.css";
|
|
7
7
|
import { useChildList } from "./hooks/use-child-list.mjs";
|
|
8
8
|
import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
|
|
9
9
|
import { BlurInput } from "../blur-input/index.mjs";
|
|
10
|
+
import { IconAddChildren } from "./icon.mjs";
|
|
10
11
|
const AddObjectChildStrategy = {
|
|
11
12
|
hit: (schema)=>'object' === schema.type,
|
|
12
13
|
Renderer: ()=>/*#__PURE__*/ jsx(Input, {
|
|
@@ -42,11 +43,10 @@ function InputValueRow(props) {
|
|
|
42
43
|
]);
|
|
43
44
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
44
45
|
children: [
|
|
45
|
-
/*#__PURE__*/ jsx(
|
|
46
|
-
$isLast: $
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children: hasChildren && /*#__PURE__*/ jsx(UICollapseTrigger, {
|
|
46
|
+
/*#__PURE__*/ jsx("div", {
|
|
47
|
+
className: `gedit-m-inputs-values-tree-tree-item-left ${$level > 0 ? 'show-line' : ''} ${$isLast ? 'is-last' : ''} ${hasChildren ? 'show-collapse' : ''}`,
|
|
48
|
+
children: hasChildren && /*#__PURE__*/ jsx("div", {
|
|
49
|
+
className: "gedit-m-inputs-values-tree-collapse-trigger",
|
|
50
50
|
onClick: ()=>setCollapse((_collapse)=>!_collapse),
|
|
51
51
|
children: collapse ? /*#__PURE__*/ jsx(IconChevronDown, {
|
|
52
52
|
size: "small"
|
|
@@ -55,10 +55,13 @@ function InputValueRow(props) {
|
|
|
55
55
|
})
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
58
|
-
/*#__PURE__*/ jsxs(
|
|
58
|
+
/*#__PURE__*/ jsxs("div", {
|
|
59
|
+
className: "gedit-m-inputs-values-tree-tree-item-right",
|
|
59
60
|
children: [
|
|
60
|
-
/*#__PURE__*/ jsx(
|
|
61
|
-
|
|
61
|
+
/*#__PURE__*/ jsx("div", {
|
|
62
|
+
className: "gedit-m-inputs-values-tree-tree-item-main",
|
|
63
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
64
|
+
className: "gedit-m-inputs-values-tree-row",
|
|
62
65
|
children: [
|
|
63
66
|
/*#__PURE__*/ jsx(BlurInput, {
|
|
64
67
|
style: {
|
|
@@ -85,7 +88,8 @@ function InputValueRow(props) {
|
|
|
85
88
|
strategies
|
|
86
89
|
}
|
|
87
90
|
}),
|
|
88
|
-
/*#__PURE__*/ jsxs(
|
|
91
|
+
/*#__PURE__*/ jsxs("div", {
|
|
92
|
+
className: "gedit-m-inputs-values-tree-actions",
|
|
89
93
|
children: [
|
|
90
94
|
canAddField && /*#__PURE__*/ jsx(IconButton, {
|
|
91
95
|
disabled: readonly,
|
|
@@ -117,10 +121,10 @@ function InputValueRow(props) {
|
|
|
117
121
|
]
|
|
118
122
|
})
|
|
119
123
|
}),
|
|
120
|
-
hasChildren && /*#__PURE__*/ jsx(
|
|
121
|
-
$collapse:
|
|
122
|
-
children: /*#__PURE__*/ jsx(
|
|
123
|
-
|
|
124
|
+
hasChildren && /*#__PURE__*/ jsx("div", {
|
|
125
|
+
className: `gedit-m-inputs-values-tree-collapsible ${collapse ? 'collapse' : ''}`,
|
|
126
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
127
|
+
className: "gedit-m-inputs-values-tree-tree-items shrink",
|
|
124
128
|
children: list.map((_item, index)=>/*#__PURE__*/ jsx(InputValueRow, {
|
|
125
129
|
readonly: readonly,
|
|
126
130
|
hasError: hasError,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.gedit-m-inputs-values-tree-row {
|
|
2
|
+
align-items: flex-start;
|
|
3
|
+
gap: 5px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.gedit-m-inputs-values-tree-collapse-trigger {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
margin-right: 5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.gedit-m-inputs-values-tree-tree-items {
|
|
13
|
+
grid-template-columns: auto 1fr;
|
|
14
|
+
display: grid;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.gedit-m-inputs-values-tree-tree-items.shrink {
|
|
18
|
+
margin-top: 10px;
|
|
19
|
+
padding-left: 3px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.gedit-m-inputs-values-tree-tree-item-left {
|
|
23
|
+
grid-column: 1;
|
|
24
|
+
width: 16px;
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.gedit-m-inputs-values-tree-tree-item-left.show-line:before {
|
|
29
|
+
content: "";
|
|
30
|
+
height: var(--line-height, 100%);
|
|
31
|
+
background: #d9d9d9;
|
|
32
|
+
width: 1px;
|
|
33
|
+
display: block;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: -16px;
|
|
36
|
+
left: -14px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.gedit-m-inputs-values-tree-tree-item-left.show-line:after {
|
|
40
|
+
content: "";
|
|
41
|
+
width: var(--line-width, 30px);
|
|
42
|
+
background: #d9d9d9;
|
|
43
|
+
height: 1px;
|
|
44
|
+
display: block;
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 8px;
|
|
47
|
+
left: -14px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.gedit-m-inputs-values-tree-tree-item-left.show-line.is-last:before {
|
|
51
|
+
height: 24px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.gedit-m-inputs-values-tree-tree-item-left.show-line.show-collapse:after {
|
|
55
|
+
width: 12px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.gedit-m-inputs-values-tree-tree-item-right {
|
|
59
|
+
grid-column: 2;
|
|
60
|
+
margin-bottom: 10px;
|
|
61
|
+
|
|
62
|
+
&:last-child {
|
|
63
|
+
margin-bottom: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.gedit-m-inputs-values-tree-tree-item-main {
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: 10px;
|
|
70
|
+
display: flex;
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.gedit-m-inputs-values-tree-collapsible {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.gedit-m-inputs-values-tree-collapsible.collapse {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.gedit-m-inputs-values-tree-actions {
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -2,10 +2,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
4
|
import { ConstantInput } from "../constant-input/index.mjs";
|
|
5
|
-
import { ConstantInputWrapper } from "./styles.mjs";
|
|
6
5
|
function DefaultValue(props) {
|
|
7
6
|
const { value, schema, onChange, placeholder } = props;
|
|
8
|
-
return /*#__PURE__*/ jsx(
|
|
7
|
+
return /*#__PURE__*/ jsx("div", {
|
|
8
|
+
className: "gedit-m-json-schema-editor-constant-input-wrapper",
|
|
9
9
|
children: /*#__PURE__*/ jsx(ConstantInput, {
|
|
10
10
|
value: value,
|
|
11
11
|
onChange: (_v)=>onChange(_v),
|
|
@@ -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 };
|