@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
|
@@ -33,15 +33,17 @@ const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
|
33
33
|
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
34
34
|
const index_js_namespaceObject = require("../../hooks/index.js");
|
|
35
35
|
const external_variable_selector_index_js_namespaceObject = require("../variable-selector/index.js");
|
|
36
|
-
|
|
36
|
+
require("./styles.css");
|
|
37
37
|
function BatchOutputs(props) {
|
|
38
38
|
const { readonly, style } = props;
|
|
39
39
|
const { list, add, updateKey, updateValue, remove } = (0, index_js_namespaceObject.useObjectList)(props);
|
|
40
40
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
41
41
|
children: [
|
|
42
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
42
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
43
|
+
className: "gedit-m-batch-outputs-rows",
|
|
43
44
|
style: style,
|
|
44
|
-
children: list.map((item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
45
|
+
children: list.map((item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
46
|
+
className: "gedit-m-batch-outputs-row",
|
|
45
47
|
children: [
|
|
46
48
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Input, {
|
|
47
49
|
style: {
|
|
@@ -43,7 +43,10 @@ function BlurInput(props) {
|
|
|
43
43
|
onChange: (value)=>{
|
|
44
44
|
setValue(value);
|
|
45
45
|
},
|
|
46
|
-
onBlur: (e)=>
|
|
46
|
+
onBlur: (e)=>{
|
|
47
|
+
props.onChange?.(value, e);
|
|
48
|
+
props.onBlur?.(e);
|
|
49
|
+
}
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
exports.BlurInput = __webpack_exports__.BlurInput;
|
|
@@ -37,13 +37,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
37
|
});
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const external_react_namespaceObject = require("react");
|
|
40
|
-
const external_styled_components_namespaceObject = require("styled-components");
|
|
41
|
-
var external_styled_components_default = /*#__PURE__*/ __webpack_require__.n(external_styled_components_namespaceObject);
|
|
42
40
|
const react_namespaceObject = require("@flowgram.ai/coze-editor/react");
|
|
43
41
|
const preset_code_namespaceObject = require("@flowgram.ai/coze-editor/preset-code");
|
|
44
42
|
var preset_code_default = /*#__PURE__*/ __webpack_require__.n(preset_code_namespaceObject);
|
|
45
43
|
const view_namespaceObject = require("@codemirror/view");
|
|
46
44
|
const external_utils_js_namespaceObject = require("./utils.js");
|
|
45
|
+
require("./styles.css");
|
|
47
46
|
const OriginCodeEditor = (0, react_namespaceObject.createRenderer)(preset_code_default(), [
|
|
48
47
|
view_namespaceObject.EditorView.theme({
|
|
49
48
|
'&.cm-focused': {
|
|
@@ -51,23 +50,28 @@ const OriginCodeEditor = (0, react_namespaceObject.createRenderer)(preset_code_d
|
|
|
51
50
|
}
|
|
52
51
|
})
|
|
53
52
|
]);
|
|
54
|
-
const UIContainer = external_styled_components_default().div`
|
|
55
|
-
${({ $mini })=>$mini && (0, external_styled_components_namespaceObject.css)`
|
|
56
|
-
height: 24px;
|
|
57
|
-
`}
|
|
58
|
-
`;
|
|
59
53
|
function BaseCodeEditor({ value, onChange, languageId = 'python', theme = 'light', children, placeholder, activeLinePlaceholder, options, readonly, mini }) {
|
|
60
54
|
const editorRef = (0, external_react_namespaceObject.useRef)(null);
|
|
55
|
+
const editorValue = String(value || '');
|
|
61
56
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
62
|
-
if (editorRef.current?.getValue() !==
|
|
57
|
+
if (editorRef.current?.getValue() !== editorValue) {
|
|
58
|
+
const editorView = editorRef.current?.$view;
|
|
59
|
+
editorView?.dispatch({
|
|
60
|
+
changes: {
|
|
61
|
+
from: 0,
|
|
62
|
+
to: editorView?.state.doc.length,
|
|
63
|
+
insert: editorValue
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
63
67
|
}, [
|
|
64
|
-
|
|
68
|
+
editorValue
|
|
65
69
|
]);
|
|
66
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
67
|
-
$mini:
|
|
70
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
71
|
+
className: `gedit-m-code-editor-container ${mini ? 'mini' : ''}`,
|
|
68
72
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.EditorProvider, {
|
|
69
73
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(OriginCodeEditor, {
|
|
70
|
-
defaultValue:
|
|
74
|
+
defaultValue: editorValue,
|
|
71
75
|
options: {
|
|
72
76
|
uri: `file:///untitled${(0, external_utils_js_namespaceObject.getSuffixByLanguageId)(languageId)}`,
|
|
73
77
|
languageId,
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
3
|
(()=>{
|
|
13
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
14
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -37,15 +28,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
28
|
});
|
|
38
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
30
|
require("react");
|
|
40
|
-
const external_styled_components_namespaceObject = require("styled-components");
|
|
41
|
-
var external_styled_components_default = /*#__PURE__*/ __webpack_require__.n(external_styled_components_namespaceObject);
|
|
42
31
|
const index_js_namespaceObject = require("../code-editor/index.js");
|
|
43
|
-
const UIMini = external_styled_components_default().div`
|
|
44
|
-
.ͼ1 .cm-content {
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
32
|
function CodeEditorMini(props) {
|
|
48
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
33
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
34
|
+
className: "gedit-m-code-editor-mini",
|
|
49
35
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.CodeEditor, {
|
|
50
36
|
...props,
|
|
51
37
|
options: {
|
|
@@ -30,7 +30,7 @@ const external_react_namespaceObject = require("react");
|
|
|
30
30
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
31
31
|
const index_js_namespaceObject = require("../../../plugins/index.js");
|
|
32
32
|
const external_context_js_namespaceObject = require("../context.js");
|
|
33
|
-
function useCondition({ leftSchema, operator, ruleConfig }) {
|
|
33
|
+
function useCondition({ leftSchema, operator, onClearOp, onClearRight, ruleConfig }) {
|
|
34
34
|
const typeManager = (0, index_js_namespaceObject.useTypeManager)();
|
|
35
35
|
const { rules: contextRules, ops: contextOps } = (0, external_context_js_namespaceObject.useConditionContext)();
|
|
36
36
|
const userRules = (0, external_react_namespaceObject.useMemo)(()=>ruleConfig?.rules || contextRules || {}, [
|
|
@@ -63,6 +63,14 @@ function useCondition({ leftSchema, operator, ruleConfig }) {
|
|
|
63
63
|
rule,
|
|
64
64
|
allOps
|
|
65
65
|
]);
|
|
66
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
67
|
+
if (!operator || !rule) return;
|
|
68
|
+
if (!opOptionList.find((item)=>item.value === operator)) onClearOp?.();
|
|
69
|
+
}, [
|
|
70
|
+
operator,
|
|
71
|
+
opOptionList,
|
|
72
|
+
onClearOp
|
|
73
|
+
]);
|
|
66
74
|
const targetSchema = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
67
75
|
const targetType = rule?.[operator || ''] || null;
|
|
68
76
|
if (!targetType) return;
|
|
@@ -77,6 +85,14 @@ function useCondition({ leftSchema, operator, ruleConfig }) {
|
|
|
77
85
|
rule,
|
|
78
86
|
operator
|
|
79
87
|
]);
|
|
88
|
+
const prevTargetSchemaRef = (0, external_react_namespaceObject.useRef)(void 0);
|
|
89
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
90
|
+
if (prevTargetSchemaRef.current?.type !== targetSchema?.type) onClearRight?.();
|
|
91
|
+
prevTargetSchemaRef.current = targetSchema;
|
|
92
|
+
}, [
|
|
93
|
+
targetSchema,
|
|
94
|
+
onClearRight
|
|
95
|
+
]);
|
|
80
96
|
const opConfig = (0, external_react_namespaceObject.useMemo)(()=>allOps[operator || ''], [
|
|
81
97
|
operator,
|
|
82
98
|
allOps
|
|
@@ -35,12 +35,8 @@ const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
|
35
35
|
const index_js_namespaceObject = require("../variable-selector/index.js");
|
|
36
36
|
const external_dynamic_value_input_index_js_namespaceObject = require("../dynamic-value-input/index.js");
|
|
37
37
|
const external_condition_context_index_js_namespaceObject = require("../condition-context/index.js");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
ops: {},
|
|
41
|
-
rules: {}
|
|
42
|
-
};
|
|
43
|
-
function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRuleConfig }) {
|
|
38
|
+
require("./styles.css");
|
|
39
|
+
function ConditionRow({ style, value, onChange, readonly, ruleConfig }) {
|
|
44
40
|
const { left, operator, right } = value || {};
|
|
45
41
|
const available = (0, editor_namespaceObject.useScopeAvailable)();
|
|
46
42
|
const variable = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
@@ -60,7 +56,20 @@ function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRu
|
|
|
60
56
|
]);
|
|
61
57
|
const { rule, opConfig, opOptionList, targetSchema } = (0, external_condition_context_index_js_namespaceObject.useCondition)({
|
|
62
58
|
leftSchema,
|
|
63
|
-
operator
|
|
59
|
+
operator,
|
|
60
|
+
ruleConfig,
|
|
61
|
+
onClearOp () {
|
|
62
|
+
onChange({
|
|
63
|
+
...value,
|
|
64
|
+
operator: void 0
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
onClearRight () {
|
|
68
|
+
onChange({
|
|
69
|
+
...value,
|
|
70
|
+
right: void 0
|
|
71
|
+
});
|
|
72
|
+
}
|
|
64
73
|
});
|
|
65
74
|
const renderOpSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
66
75
|
style: {
|
|
@@ -84,15 +93,19 @@ function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRu
|
|
|
84
93
|
})
|
|
85
94
|
})
|
|
86
95
|
});
|
|
87
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
96
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
97
|
+
className: "gedit-m-condition-row-container",
|
|
88
98
|
style: style,
|
|
89
99
|
children: [
|
|
90
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
100
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
101
|
+
className: "gedit-m-condition-row-operator",
|
|
91
102
|
children: renderOpSelect()
|
|
92
103
|
}),
|
|
93
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
104
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
105
|
+
className: "gedit-m-condition-row-values",
|
|
94
106
|
children: [
|
|
95
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
107
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
108
|
+
className: "gedit-m-condition-row-left",
|
|
96
109
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.InjectVariableSelector, {
|
|
97
110
|
readonly: readonly,
|
|
98
111
|
style: {
|
|
@@ -108,7 +121,8 @@ function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRu
|
|
|
108
121
|
})
|
|
109
122
|
})
|
|
110
123
|
}),
|
|
111
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
124
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
125
|
+
className: "gedit-m-condition-row-right",
|
|
112
126
|
children: targetSchema ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dynamic_value_input_index_js_namespaceObject.InjectDynamicValueInput, {
|
|
113
127
|
readonly: readonly || !rule,
|
|
114
128
|
value: right,
|
|
@@ -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
|
+
|
|
@@ -35,7 +35,7 @@ const react_namespaceObject = require("@flowgram.ai/coze-editor/react");
|
|
|
35
35
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
36
36
|
const index_js_namespaceObject = require("../../../shared/index.js");
|
|
37
37
|
function InputsPicker({ inputsValues, onSelect }) {
|
|
38
|
-
const
|
|
38
|
+
const scope = (0, editor_namespaceObject.useCurrentScope)();
|
|
39
39
|
const getArrayDrilldown = (type, depth = 1)=>{
|
|
40
40
|
if (editor_namespaceObject.ASTMatch.isArray(type.items)) return getArrayDrilldown(type.items, depth + 1);
|
|
41
41
|
return {
|
|
@@ -70,7 +70,7 @@ function InputsPicker({ inputsValues, onSelect }) {
|
|
|
70
70
|
const currKey = keyPath.join('.');
|
|
71
71
|
if (index_js_namespaceObject.FlowValueUtils.isFlowValue(value)) {
|
|
72
72
|
if (index_js_namespaceObject.FlowValueUtils.isRef(value)) {
|
|
73
|
-
const variable = available
|
|
73
|
+
const variable = scope?.available?.getByKeyPath(value.content || []);
|
|
74
74
|
if (variable) return renderVariable(variable, keyPath);
|
|
75
75
|
}
|
|
76
76
|
return {
|
|
@@ -35,7 +35,7 @@ const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
|
35
35
|
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
36
36
|
const view_namespaceObject = require("@codemirror/view");
|
|
37
37
|
const index_js_namespaceObject = require("../../../shared/index.js");
|
|
38
|
-
|
|
38
|
+
require("../styles.css");
|
|
39
39
|
class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
40
40
|
constructor({ keyPath, scope }){
|
|
41
41
|
super(), this.toDispose = new editor_namespaceObject.DisposableCollection(), this.renderIcon = (icon)=>{
|
|
@@ -53,32 +53,50 @@ class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
|
53
53
|
this.scope = scope;
|
|
54
54
|
}
|
|
55
55
|
renderVariable(v) {
|
|
56
|
-
if (!v) return void this.root.render(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
57
|
-
|
|
56
|
+
if (!v) return void this.root.render(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(semi_ui_namespaceObject.Tag, {
|
|
57
|
+
className: "gedit-m-coze-editor-tag",
|
|
58
58
|
color: "amber",
|
|
59
|
-
children:
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconIssueStroked, {
|
|
61
|
+
style: {
|
|
62
|
+
marginRight: '4px'
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
66
|
+
children: "Unknown"
|
|
67
|
+
})
|
|
68
|
+
]
|
|
60
69
|
}));
|
|
61
70
|
const rootField = (0, external_lodash_es_namespaceObject.last)(v.parentFields) || v;
|
|
62
71
|
const isRoot = v === rootField;
|
|
63
|
-
const rootTitle = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
72
|
+
const rootTitle = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
73
|
+
className: "gedit-m-coze-editor-root-title",
|
|
64
74
|
children: rootField.meta?.title ? `${rootField.meta.title} ${isRoot ? '' : '-'} ` : ''
|
|
65
75
|
});
|
|
66
76
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
67
77
|
this.root.render(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Popover, {
|
|
68
|
-
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
78
|
+
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
79
|
+
className: "gedit-m-coze-editor-popover-content",
|
|
69
80
|
children: [
|
|
70
81
|
rootIcon,
|
|
71
82
|
rootTitle,
|
|
72
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
83
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
84
|
+
className: "gedit-m-coze-editor-var-name",
|
|
73
85
|
children: v?.keyPath.slice(1).join('.')
|
|
74
86
|
})
|
|
75
87
|
]
|
|
76
88
|
}),
|
|
77
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
78
|
-
|
|
89
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(semi_ui_namespaceObject.Tag, {
|
|
90
|
+
className: "gedit-m-coze-editor-tag",
|
|
91
|
+
style: {
|
|
92
|
+
display: 'inline-flex',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
},
|
|
79
95
|
children: [
|
|
96
|
+
rootIcon,
|
|
80
97
|
rootTitle,
|
|
81
|
-
!isRoot && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
98
|
+
!isRoot && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
99
|
+
className: "gedit-m-coze-editor-var-name",
|
|
82
100
|
children: v?.key
|
|
83
101
|
})
|
|
84
102
|
]
|
|
@@ -91,12 +109,21 @@ class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
|
91
109
|
this.toDispose.push(editor_namespaceObject.Disposable.create(()=>{
|
|
92
110
|
this.root.unmount();
|
|
93
111
|
}));
|
|
94
|
-
|
|
95
|
-
this.renderVariable(
|
|
96
|
-
}
|
|
112
|
+
const refresh = ()=>{
|
|
113
|
+
this.renderVariable(this.scope.available.getByKeyPath(this.keyPath));
|
|
114
|
+
};
|
|
115
|
+
this.toDispose.push(this.scope.available.trackByKeyPath(this.keyPath, refresh, {
|
|
116
|
+
triggerOnInit: false
|
|
117
|
+
}));
|
|
118
|
+
if (this.keyPath?.[0]) this.toDispose.push(this.scope.available.trackByKeyPath([
|
|
119
|
+
this.keyPath[0]
|
|
120
|
+
], refresh, {
|
|
121
|
+
selector: (curr)=>({
|
|
122
|
+
...curr?.meta
|
|
123
|
+
}),
|
|
97
124
|
triggerOnInit: false
|
|
98
125
|
}));
|
|
99
|
-
|
|
126
|
+
refresh();
|
|
100
127
|
return dom;
|
|
101
128
|
}
|
|
102
129
|
eq(other) {
|
|
@@ -111,7 +138,9 @@ class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
|
111
138
|
}
|
|
112
139
|
function VariableTagInject() {
|
|
113
140
|
const injector = (0, react_namespaceObject.useInjector)();
|
|
114
|
-
const scope = (0, editor_namespaceObject.useCurrentScope)(
|
|
141
|
+
const scope = (0, editor_namespaceObject.useCurrentScope)({
|
|
142
|
+
strict: true
|
|
143
|
+
});
|
|
115
144
|
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
116
145
|
const atMatcher = new view_namespaceObject.MatchDecorator({
|
|
117
146
|
regexp: /\{\{([^\}\{]+)\}\}/g,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import { Tag } from "@douyinfe/semi-ui";
|
|
3
|
-
const UIRootTitle = styled_components.div`
|
|
4
|
-
margin-right: 4px;
|
|
5
|
-
min-width: 20px;
|
|
6
|
-
overflow: hidden;
|
|
1
|
+
.gedit-m-coze-editor-root-title {
|
|
7
2
|
text-overflow: ellipsis;
|
|
8
3
|
white-space: nowrap;
|
|
4
|
+
min-width: 20px;
|
|
9
5
|
color: var(--semi-color-text-2);
|
|
10
|
-
|
|
11
|
-
const UIVarName = styled_components.div`
|
|
6
|
+
margin-right: 4px;
|
|
12
7
|
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.gedit-m-coze-editor-var-name {
|
|
13
11
|
text-overflow: ellipsis;
|
|
14
12
|
white-space: nowrap;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.gedit-m-coze-editor-tag {
|
|
19
17
|
justify-content: flex-start;
|
|
18
|
+
align-items: center;
|
|
20
19
|
max-width: 300px;
|
|
20
|
+
display: inline-flex;
|
|
21
21
|
|
|
22
22
|
& .semi-tag-content-center {
|
|
23
23
|
justify-content: flex-start;
|
|
@@ -26,11 +26,12 @@ const UITag = styled_components(Tag)`
|
|
|
26
26
|
&.semi-tag {
|
|
27
27
|
margin: 0 5px;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gedit-m-coze-editor-popover-content {
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
align-items: center;
|
|
31
34
|
padding: 10px;
|
|
32
35
|
display: inline-flex;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`;
|
|
36
|
-
export { UIPopoverContent, UIRootTitle, UITag, UIVarName };
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -34,12 +34,8 @@ const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
|
34
34
|
const index_js_namespaceObject = require("../../plugins/index.js");
|
|
35
35
|
const external_dynamic_value_input_index_js_namespaceObject = require("../dynamic-value-input/index.js");
|
|
36
36
|
const external_condition_context_index_js_namespaceObject = require("../condition-context/index.js");
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ops: {},
|
|
40
|
-
rules: {}
|
|
41
|
-
};
|
|
42
|
-
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig = defaultRuleConfig }) {
|
|
37
|
+
require("./styles.css");
|
|
38
|
+
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig }) {
|
|
43
39
|
const { left, operator, right } = value || {};
|
|
44
40
|
const typeManager = (0, index_js_namespaceObject.useTypeManager)();
|
|
45
41
|
const leftSchema = (0, external_react_namespaceObject.useMemo)(()=>options?.find((item)=>item.value === left)?.schema, [
|
|
@@ -49,9 +45,22 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
49
45
|
const { opConfig, rule, opOptionList, targetSchema } = (0, external_condition_context_index_js_namespaceObject.useCondition)({
|
|
50
46
|
leftSchema,
|
|
51
47
|
operator,
|
|
52
|
-
ruleConfig
|
|
48
|
+
ruleConfig,
|
|
49
|
+
onClearOp () {
|
|
50
|
+
onChange({
|
|
51
|
+
...value,
|
|
52
|
+
operator: void 0
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
onClearRight () {
|
|
56
|
+
onChange({
|
|
57
|
+
...value,
|
|
58
|
+
right: void 0
|
|
59
|
+
});
|
|
60
|
+
}
|
|
53
61
|
});
|
|
54
|
-
const renderDBOptionSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
62
|
+
const renderDBOptionSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
63
|
+
className: "gedit-m-db-condition-row-select",
|
|
55
64
|
disabled: readonly,
|
|
56
65
|
size: "small",
|
|
57
66
|
style: {
|
|
@@ -63,7 +72,8 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
63
72
|
left: v
|
|
64
73
|
}),
|
|
65
74
|
optionList: options?.map((item)=>({
|
|
66
|
-
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
75
|
+
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
76
|
+
className: "gedit-m-db-condition-row-option-label",
|
|
67
77
|
children: [
|
|
68
78
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Icon, {
|
|
69
79
|
size: "small",
|
|
@@ -97,18 +107,23 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
97
107
|
})
|
|
98
108
|
})
|
|
99
109
|
});
|
|
100
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
110
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
111
|
+
className: "gedit-m-db-condition-row-container",
|
|
101
112
|
style: style,
|
|
102
113
|
children: [
|
|
103
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
114
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
115
|
+
className: "gedit-m-db-condition-row-operator",
|
|
104
116
|
children: renderOpSelect()
|
|
105
117
|
}),
|
|
106
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
118
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
119
|
+
className: "gedit-m-db-condition-row-values",
|
|
107
120
|
children: [
|
|
108
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
121
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
122
|
+
className: "gedit-m-db-condition-row-left",
|
|
109
123
|
children: renderDBOptionSelect()
|
|
110
124
|
}),
|
|
111
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
125
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
126
|
+
className: "gedit-m-db-condition-row-right",
|
|
112
127
|
children: targetSchema ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dynamic_value_input_index_js_namespaceObject.InjectDynamicValueInput, {
|
|
113
128
|
readonly: readonly || !rule,
|
|
114
129
|
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
|
+
|
|
@@ -33,11 +33,12 @@ const external_lodash_es_namespaceObject = require("lodash-es");
|
|
|
33
33
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
34
34
|
const index_js_namespaceObject = require("../../shared/index.js");
|
|
35
35
|
const external_display_flow_value_index_js_namespaceObject = require("../display-flow-value/index.js");
|
|
36
|
-
|
|
36
|
+
require("./styles.css");
|
|
37
37
|
const external_display_schema_tag_index_js_namespaceObject = require("../display-schema-tag/index.js");
|
|
38
38
|
function DisplayInputsValues({ value, showIconInTree }) {
|
|
39
39
|
const childEntries = Object.entries(value || {});
|
|
40
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
40
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
41
|
+
className: "gedit-m-display-inputs-wrapper",
|
|
41
42
|
children: childEntries.map(([key, value])=>{
|
|
42
43
|
if (index_js_namespaceObject.FlowValueUtils.isFlowValue(value)) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_display_flow_value_index_js_namespaceObject.DisplayFlowValue, {
|
|
43
44
|
title: key,
|
|
@@ -31,12 +31,12 @@ const external_react_namespaceObject = require("react");
|
|
|
31
31
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
32
32
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
33
33
|
const index_js_namespaceObject = require("../display-schema-tag/index.js");
|
|
34
|
-
|
|
34
|
+
require("./styles.css");
|
|
35
35
|
function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
36
36
|
const scope = (0, editor_namespaceObject.useCurrentScope)();
|
|
37
37
|
const refresh = (0, editor_namespaceObject.useRefresh)();
|
|
38
38
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
39
|
-
if (!displayFromScope) return ()=>null;
|
|
39
|
+
if (!displayFromScope || !scope) return ()=>null;
|
|
40
40
|
const disposable = scope.output.onListOrAnyVarChange(()=>{
|
|
41
41
|
refresh();
|
|
42
42
|
});
|
|
@@ -46,7 +46,7 @@ function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
|
46
46
|
}, [
|
|
47
47
|
displayFromScope
|
|
48
48
|
]);
|
|
49
|
-
const properties = displayFromScope ? scope
|
|
49
|
+
const properties = displayFromScope ? (scope?.output.variables || []).reduce((acm, curr)=>{
|
|
50
50
|
acm = {
|
|
51
51
|
...acm,
|
|
52
52
|
...json_schema_namespaceObject.JsonSchemaUtils.astToSchema(curr.type)?.properties || {}
|
|
@@ -54,7 +54,8 @@ function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
|
54
54
|
return acm;
|
|
55
55
|
}, {}) : value?.properties || {};
|
|
56
56
|
const childEntries = Object.entries(properties || {});
|
|
57
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
57
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
58
|
+
className: "gedit-m-display-outputs-wrapper",
|
|
58
59
|
children: childEntries.map(([key, schema])=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.DisplaySchemaTag, {
|
|
59
60
|
title: key,
|
|
60
61
|
value: schema,
|