@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,19 +33,21 @@ 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("../type-selector/index.js");
|
|
35
35
|
const external_blur_input_index_js_namespaceObject = require("../blur-input/index.js");
|
|
36
|
-
const
|
|
36
|
+
const external_icon_js_namespaceObject = require("./icon.js");
|
|
37
37
|
const external_hooks_js_namespaceObject = require("./hooks.js");
|
|
38
38
|
const external_default_value_js_namespaceObject = require("./default-value.js");
|
|
39
|
+
require("./styles.css");
|
|
39
40
|
const DEFAULT = {
|
|
40
41
|
type: 'object'
|
|
41
42
|
};
|
|
42
43
|
function JsonSchemaEditor(props) {
|
|
43
44
|
const { value = DEFAULT, config = {}, onChange: onChangeProps, readonly } = props;
|
|
44
45
|
const { propertyList, onAddProperty, onRemoveProperty, onEditProperty } = (0, external_hooks_js_namespaceObject.usePropertiesEdit)(value, onChangeProps);
|
|
45
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
46
|
-
className:
|
|
46
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
47
|
+
className: "gedit-m-json-schema-editor-container",
|
|
47
48
|
children: [
|
|
48
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
49
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
50
|
+
className: "gedit-m-json-schema-editor-tree-items",
|
|
49
51
|
children: propertyList.map((_property)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PropertyEdit, {
|
|
50
52
|
readonly: readonly,
|
|
51
53
|
value: _property,
|
|
@@ -94,11 +96,10 @@ function PropertyEdit(props) {
|
|
|
94
96
|
const showCollapse = canAddField && propertyList.length > 0;
|
|
95
97
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
96
98
|
children: [
|
|
97
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
98
|
-
$isLast: $
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children: showCollapse && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UICollapseTrigger, {
|
|
99
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
100
|
+
className: `gedit-m-json-schema-editor-tree-item-left ${$level > 0 ? 'show-line' : ''} ${$isLast ? 'is-last' : ''} ${showCollapse ? 'show-collapse' : ''}`,
|
|
101
|
+
children: showCollapse && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
102
|
+
className: "gedit-m-json-schema-editor-collapse-trigger",
|
|
102
103
|
onClick: ()=>setCollapse((_collapse)=>!_collapse),
|
|
103
104
|
children: collapse ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconChevronDown, {
|
|
104
105
|
size: "small"
|
|
@@ -107,13 +108,17 @@ function PropertyEdit(props) {
|
|
|
107
108
|
})
|
|
108
109
|
})
|
|
109
110
|
}),
|
|
110
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
111
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
112
|
+
className: "gedit-m-json-schema-editor-tree-item-right",
|
|
111
113
|
children: [
|
|
112
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
114
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
115
|
+
className: "gedit-m-json-schema-editor-tree-item-main",
|
|
113
116
|
children: [
|
|
114
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
117
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
118
|
+
className: "gedit-m-json-schema-editor-row",
|
|
115
119
|
children: [
|
|
116
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
120
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
121
|
+
className: "gedit-m-json-schema-editor-name",
|
|
117
122
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_blur_input_index_js_namespaceObject.BlurInput, {
|
|
118
123
|
disabled: readonly,
|
|
119
124
|
placeholder: config?.placeholder ?? editor_namespaceObject.I18n.t('Input Variable Name'),
|
|
@@ -122,7 +127,8 @@ function PropertyEdit(props) {
|
|
|
122
127
|
onChange: (value)=>onChange('name', value)
|
|
123
128
|
})
|
|
124
129
|
}),
|
|
125
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
130
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
131
|
+
className: "gedit-m-json-schema-editor-type",
|
|
126
132
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.InjectTypeSelector, {
|
|
127
133
|
value: typeSelectorValue,
|
|
128
134
|
readonly: readonly,
|
|
@@ -134,14 +140,16 @@ function PropertyEdit(props) {
|
|
|
134
140
|
}
|
|
135
141
|
})
|
|
136
142
|
}),
|
|
137
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
143
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
144
|
+
className: "gedit-m-json-schema-editor-required",
|
|
138
145
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Checkbox, {
|
|
139
146
|
disabled: readonly,
|
|
140
147
|
checked: isPropertyRequired,
|
|
141
148
|
onChange: (e)=>onChange('isPropertyRequired', e.target.checked)
|
|
142
149
|
})
|
|
143
150
|
}),
|
|
144
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
151
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
152
|
+
className: "gedit-m-json-schema-editor-actions",
|
|
145
153
|
children: [
|
|
146
154
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.IconButton, {
|
|
147
155
|
disabled: readonly,
|
|
@@ -160,7 +168,7 @@ function PropertyEdit(props) {
|
|
|
160
168
|
disabled: readonly,
|
|
161
169
|
size: "small",
|
|
162
170
|
theme: "borderless",
|
|
163
|
-
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
171
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_js_namespaceObject.IconAddChildren, {}),
|
|
164
172
|
onClick: ()=>{
|
|
165
173
|
onAddProperty();
|
|
166
174
|
setCollapse(true);
|
|
@@ -179,9 +187,11 @@ function PropertyEdit(props) {
|
|
|
179
187
|
})
|
|
180
188
|
]
|
|
181
189
|
}),
|
|
182
|
-
expand && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
190
|
+
expand && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
191
|
+
className: "gedit-m-json-schema-editor-expand-detail",
|
|
183
192
|
children: [
|
|
184
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
193
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
194
|
+
className: "gedit-m-json-schema-editor-label",
|
|
185
195
|
children: config?.descTitle ?? editor_namespaceObject.I18n.t("Description")
|
|
186
196
|
}),
|
|
187
197
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_blur_input_index_js_namespaceObject.BlurInput, {
|
|
@@ -193,13 +203,15 @@ function PropertyEdit(props) {
|
|
|
193
203
|
}),
|
|
194
204
|
0 === $level && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
195
205
|
children: [
|
|
196
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
206
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
207
|
+
className: "gedit-m-json-schema-editor-label",
|
|
197
208
|
style: {
|
|
198
209
|
marginTop: 10
|
|
199
210
|
},
|
|
200
211
|
children: config?.defaultValueTitle ?? editor_namespaceObject.I18n.t('Default Value')
|
|
201
212
|
}),
|
|
202
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
213
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
214
|
+
className: "gedit-m-json-schema-editor-default-value-wrapper",
|
|
203
215
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_default_value_js_namespaceObject.DefaultValue, {
|
|
204
216
|
value: defaultValue,
|
|
205
217
|
schema: value,
|
|
@@ -213,10 +225,10 @@ function PropertyEdit(props) {
|
|
|
213
225
|
})
|
|
214
226
|
]
|
|
215
227
|
}),
|
|
216
|
-
showCollapse && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
217
|
-
$collapse:
|
|
218
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
219
|
-
|
|
228
|
+
showCollapse && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
229
|
+
className: `gedit-m-json-schema-editor-collapsible ${collapse ? 'collapse' : ''}`,
|
|
230
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
231
|
+
className: "gedit-m-json-schema-editor-tree-items shrink",
|
|
220
232
|
children: propertyList.map((_property, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PropertyEdit, {
|
|
221
233
|
readonly: readonly,
|
|
222
234
|
value: _property,
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.gedit-m-json-schema-editor-row {
|
|
2
|
+
align-items: center;
|
|
3
|
+
gap: 6px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.gedit-m-json-schema-editor-collapse-trigger {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
margin-right: 5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.gedit-m-json-schema-editor-expand-detail {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.gedit-m-json-schema-editor-label {
|
|
18
|
+
color: #999;
|
|
19
|
+
margin-bottom: 2px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.gedit-m-json-schema-editor-tree-items {
|
|
25
|
+
grid-template-columns: auto 1fr;
|
|
26
|
+
display: grid;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.gedit-m-json-schema-editor-tree-items.shrink {
|
|
30
|
+
margin-top: 10px;
|
|
31
|
+
padding-left: 3px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.gedit-m-json-schema-editor-tree-item-left {
|
|
35
|
+
grid-column: 1;
|
|
36
|
+
width: 16px;
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.gedit-m-json-schema-editor-tree-item-left.show-line:before {
|
|
41
|
+
content: "";
|
|
42
|
+
height: var(--line-height, 100%);
|
|
43
|
+
background: #d9d9d9;
|
|
44
|
+
width: 1px;
|
|
45
|
+
display: block;
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: -16px;
|
|
48
|
+
left: -14px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.gedit-m-json-schema-editor-tree-item-left.show-line:after {
|
|
52
|
+
content: "";
|
|
53
|
+
width: var(--line-width, 30px);
|
|
54
|
+
background: #d9d9d9;
|
|
55
|
+
height: 1px;
|
|
56
|
+
display: block;
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 8px;
|
|
59
|
+
left: -14px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.gedit-m-json-schema-editor-tree-item-left.show-line.is-last:before {
|
|
63
|
+
height: 24px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.gedit-m-json-schema-editor-tree-item-left.show-line.show-collapse:after {
|
|
67
|
+
width: 12px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.gedit-m-json-schema-editor-tree-item-right {
|
|
71
|
+
grid-column: 2;
|
|
72
|
+
margin-bottom: 10px;
|
|
73
|
+
|
|
74
|
+
&:last-child {
|
|
75
|
+
margin-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.gedit-m-json-schema-editor-tree-item-main {
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 10px;
|
|
82
|
+
display: flex;
|
|
83
|
+
position: relative;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.gedit-m-json-schema-editor-collapsible {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.gedit-m-json-schema-editor-collapsible.collapse {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.gedit-m-json-schema-editor-name {
|
|
95
|
+
flex-grow: 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.gedit-m-json-schema-editor-actions {
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.gedit-m-json-schema-editor-default-value-wrapper {
|
|
103
|
+
margin: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.gedit-m-json-schema-editor-constant-input-wrapper {
|
|
107
|
+
flex-grow: 1;
|
|
108
|
+
|
|
109
|
+
& .semi-tree-select, & .semi-input-number, & .semi-select {
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
@@ -40,23 +40,33 @@ const external_react_namespaceObject = require("react");
|
|
|
40
40
|
const react_namespaceObject = require("@flowgram.ai/coze-editor/react");
|
|
41
41
|
const preset_prompt_namespaceObject = require("@flowgram.ai/coze-editor/preset-prompt");
|
|
42
42
|
var preset_prompt_default = /*#__PURE__*/ __webpack_require__.n(preset_prompt_namespaceObject);
|
|
43
|
-
const external_styles_js_namespaceObject = require("./styles.js");
|
|
44
43
|
const markdown_js_namespaceObject = require("./extensions/markdown.js");
|
|
45
44
|
var markdown_js_default = /*#__PURE__*/ __webpack_require__.n(markdown_js_namespaceObject);
|
|
46
45
|
const language_support_js_namespaceObject = require("./extensions/language-support.js");
|
|
47
46
|
var language_support_js_default = /*#__PURE__*/ __webpack_require__.n(language_support_js_namespaceObject);
|
|
48
47
|
const jinja_js_namespaceObject = require("./extensions/jinja.js");
|
|
49
48
|
var jinja_js_default = /*#__PURE__*/ __webpack_require__.n(jinja_js_namespaceObject);
|
|
49
|
+
require("./styles.css");
|
|
50
50
|
function PromptEditor(props) {
|
|
51
51
|
const { value, onChange, readonly, placeholder, activeLinePlaceholder, style, hasError, children, disableMarkdownHighlight, options } = props || {};
|
|
52
52
|
const editorRef = (0, external_react_namespaceObject.useRef)(null);
|
|
53
|
+
const editorValue = String(value?.content || '');
|
|
53
54
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
54
|
-
if (editorRef.current?.getValue() !==
|
|
55
|
+
if (editorRef.current?.getValue() !== editorValue) {
|
|
56
|
+
const editorView = editorRef.current?.$view;
|
|
57
|
+
editorView?.dispatch({
|
|
58
|
+
changes: {
|
|
59
|
+
from: 0,
|
|
60
|
+
to: editorView?.state.doc.length,
|
|
61
|
+
insert: editorValue
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
55
65
|
}, [
|
|
56
|
-
|
|
66
|
+
editorValue
|
|
57
67
|
]);
|
|
58
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
59
|
-
$hasError:
|
|
68
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
69
|
+
className: `gedit-m-prompt-editor-container ${hasError ? 'has-error' : ''}`,
|
|
60
70
|
style: style,
|
|
61
71
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_namespaceObject.EditorProvider, {
|
|
62
72
|
children: [
|
|
@@ -65,7 +75,7 @@ function PromptEditor(props) {
|
|
|
65
75
|
editorRef.current = editor;
|
|
66
76
|
},
|
|
67
77
|
plugins: preset_prompt_default(),
|
|
68
|
-
defaultValue:
|
|
78
|
+
defaultValue: editorValue,
|
|
69
79
|
options: {
|
|
70
80
|
readOnly: readonly,
|
|
71
81
|
editable: !readonly,
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
"./editor": function(module) {
|
|
4
|
-
module.exports = import("./editor.js").then(function(module) {
|
|
5
|
-
return module;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
var __webpack_module_cache__ = {};
|
|
10
|
-
function __webpack_require__(moduleId) {
|
|
11
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
13
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
14
|
-
exports: {}
|
|
15
|
-
};
|
|
16
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
17
|
-
return module.exports;
|
|
18
|
-
}
|
|
2
|
+
var __webpack_require__ = {};
|
|
19
3
|
(()=>{
|
|
20
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
21
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -38,16 +22,22 @@ function __webpack_require__(moduleId) {
|
|
|
38
22
|
};
|
|
39
23
|
})();
|
|
40
24
|
var __webpack_exports__ = {};
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
PromptEditorWithInputs: ()=>PromptEditorWithInputs
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("react");
|
|
31
|
+
const index_js_namespaceObject = require("../prompt-editor/index.js");
|
|
32
|
+
const external_coze_editor_extensions_index_js_namespaceObject = require("../coze-editor-extensions/index.js");
|
|
33
|
+
function PromptEditorWithInputs({ inputsValues, ...restProps }) {
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.PromptEditor, {
|
|
35
|
+
...restProps,
|
|
36
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_coze_editor_extensions_index_js_namespaceObject.EditorInputsTree, {
|
|
37
|
+
inputsValues: inputsValues
|
|
38
|
+
})
|
|
45
39
|
});
|
|
46
|
-
|
|
47
|
-
const PromptEditorWithInputs = (0, index_js_namespaceObject.lazySuspense)(()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./editor")).then((module)=>({
|
|
48
|
-
default: module.PromptEditorWithInputs
|
|
49
|
-
})));
|
|
50
|
-
})();
|
|
40
|
+
}
|
|
51
41
|
exports.PromptEditorWithInputs = __webpack_exports__.PromptEditorWithInputs;
|
|
52
42
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
53
43
|
"PromptEditorWithInputs"
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
"./editor": function(module) {
|
|
4
|
-
module.exports = import("./editor.js").then(function(module) {
|
|
5
|
-
return module;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
var __webpack_module_cache__ = {};
|
|
10
|
-
function __webpack_require__(moduleId) {
|
|
11
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
13
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
14
|
-
exports: {}
|
|
15
|
-
};
|
|
16
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
17
|
-
return module.exports;
|
|
18
|
-
}
|
|
2
|
+
var __webpack_require__ = {};
|
|
19
3
|
(()=>{
|
|
20
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
21
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -38,16 +22,23 @@ function __webpack_require__(moduleId) {
|
|
|
38
22
|
};
|
|
39
23
|
})();
|
|
40
24
|
var __webpack_exports__ = {};
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
PromptEditorWithVariables: ()=>PromptEditorWithVariables
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("react");
|
|
31
|
+
const index_js_namespaceObject = require("../prompt-editor/index.js");
|
|
32
|
+
const external_coze_editor_extensions_index_js_namespaceObject = require("../coze-editor-extensions/index.js");
|
|
33
|
+
function PromptEditorWithVariables(props) {
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_js_namespaceObject.PromptEditor, {
|
|
35
|
+
...props,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_coze_editor_extensions_index_js_namespaceObject.EditorVariableTree, {}),
|
|
38
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_coze_editor_extensions_index_js_namespaceObject.EditorVariableTagInject, {})
|
|
39
|
+
]
|
|
45
40
|
});
|
|
46
|
-
|
|
47
|
-
const PromptEditorWithVariables = (0, index_js_namespaceObject.lazySuspense)(()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./editor")).then((module)=>({
|
|
48
|
-
default: module.PromptEditorWithVariables
|
|
49
|
-
})));
|
|
50
|
-
})();
|
|
41
|
+
}
|
|
51
42
|
exports.PromptEditorWithVariables = __webpack_exports__.PromptEditorWithVariables;
|
|
52
43
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
53
44
|
"PromptEditorWithVariables"
|
|
@@ -32,11 +32,15 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
33
|
const VariableSelectorContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({});
|
|
34
34
|
const useVariableSelectorContext = ()=>(0, external_react_namespaceObject.useContext)(VariableSelectorContext);
|
|
35
|
-
const VariableSelectorProvider = ({ children, skipVariable })=>{
|
|
35
|
+
const VariableSelectorProvider = ({ children, skipVariable, includeSchema, excludeSchema })=>{
|
|
36
36
|
const context = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
37
|
-
skipVariable
|
|
37
|
+
skipVariable,
|
|
38
|
+
includeSchema,
|
|
39
|
+
excludeSchema
|
|
38
40
|
}), [
|
|
39
|
-
skipVariable
|
|
41
|
+
skipVariable,
|
|
42
|
+
includeSchema,
|
|
43
|
+
excludeSchema
|
|
40
44
|
]);
|
|
41
45
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VariableSelectorContext.Provider, {
|
|
42
46
|
value: context,
|
|
@@ -36,8 +36,8 @@ const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
|
36
36
|
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
37
37
|
const index_js_namespaceObject = require("../../shared/index.js");
|
|
38
38
|
const external_use_variable_tree_js_namespaceObject = require("./use-variable-tree.js");
|
|
39
|
-
const external_styles_js_namespaceObject = require("./styles.js");
|
|
40
39
|
const external_context_js_namespaceObject = require("./context.js");
|
|
40
|
+
require("./styles.css");
|
|
41
41
|
const VariableSelector = ({ value, config = {}, onChange, style, readonly = false, includeSchema, excludeSchema, hasError, triggerRender })=>{
|
|
42
42
|
const { skipVariable } = (0, external_context_js_namespaceObject.useVariableSelectorContext)();
|
|
43
43
|
const treeData = (0, external_use_variable_tree_js_namespaceObject.useVariableTree)({
|
|
@@ -66,21 +66,23 @@ const VariableSelector = ({ value, config = {}, onChange, style, readonly = fals
|
|
|
66
66
|
return icon;
|
|
67
67
|
};
|
|
68
68
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
69
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
69
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.TreeSelect, {
|
|
70
|
+
className: `gedit-m-variable-selector-tree-select ${hasError ? 'error' : ''}`,
|
|
70
71
|
dropdownMatchSelectWidth: false,
|
|
71
72
|
disabled: readonly,
|
|
72
73
|
treeData: treeData,
|
|
73
74
|
size: "small",
|
|
74
75
|
value: treeValue,
|
|
75
76
|
clearIcon: null,
|
|
76
|
-
$error: hasError,
|
|
77
77
|
style: style,
|
|
78
78
|
validateStatus: hasError ? 'error' : void 0,
|
|
79
|
+
dropdownClassName: "gedit-m-variable-selector-dropdown",
|
|
79
80
|
onChange: (_, _config)=>{
|
|
80
81
|
onChange(_config.keyPath);
|
|
81
82
|
},
|
|
82
83
|
renderSelectedItem: (_option)=>{
|
|
83
|
-
if (!_option?.keyPath) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
84
|
+
if (!_option?.keyPath) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Tag, {
|
|
85
|
+
className: "gedit-m-variable-selector-tag",
|
|
84
86
|
prefixIcon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconIssueStroked, {}),
|
|
85
87
|
color: "amber",
|
|
86
88
|
closable: !readonly,
|
|
@@ -88,28 +90,32 @@ const VariableSelector = ({ value, config = {}, onChange, style, readonly = fals
|
|
|
88
90
|
children: config?.notFoundContent ?? 'Undefined'
|
|
89
91
|
});
|
|
90
92
|
const rootIcon = renderIcon(_option.rootMeta?.icon || _option?.icon);
|
|
91
|
-
const rootTitle = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
93
|
+
const rootTitle = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
94
|
+
className: "gedit-m-variable-selector-root-title",
|
|
92
95
|
children: _option.rootMeta?.title ? `${_option.rootMeta?.title} ${_option.isRoot ? '' : '-'} ` : null
|
|
93
96
|
});
|
|
94
97
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
95
98
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Popover, {
|
|
96
|
-
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
99
|
+
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
+
className: "gedit-m-variable-selector-tag-pop",
|
|
97
101
|
children: [
|
|
98
102
|
rootIcon,
|
|
99
103
|
rootTitle,
|
|
100
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
104
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
105
|
+
className: "gedit-m-variable-selector-var-name",
|
|
101
106
|
children: _option.keyPath.slice(1).join('.')
|
|
102
107
|
})
|
|
103
108
|
]
|
|
104
109
|
}),
|
|
105
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
110
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(semi_ui_namespaceObject.Tag, {
|
|
111
|
+
className: "gedit-m-variable-selector-tag",
|
|
106
112
|
prefixIcon: rootIcon,
|
|
107
113
|
closable: !readonly,
|
|
108
114
|
onClose: ()=>onChange(void 0),
|
|
109
115
|
children: [
|
|
110
116
|
rootTitle,
|
|
111
|
-
!_option.isRoot && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
112
|
-
|
|
117
|
+
!_option.isRoot && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
118
|
+
className: "gedit-m-variable-selector-var-name in-selector",
|
|
113
119
|
children: _option.label
|
|
114
120
|
})
|
|
115
121
|
]
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import { Tag, TreeSelect } from "@douyinfe/semi-ui";
|
|
3
|
-
const UIRootTitle = styled_components.div`
|
|
4
|
-
margin-right: 4px;
|
|
5
|
-
min-width: 20px;
|
|
6
|
-
overflow: hidden;
|
|
1
|
+
.gedit-m-variable-selector-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-variable-selector-var-name {
|
|
13
11
|
text-overflow: ellipsis;
|
|
14
12
|
white-space: nowrap;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
|
|
15
|
+
&.in-selector {
|
|
16
|
+
min-width: 50%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`;
|
|
20
|
-
const UITag = styled_components(Tag)`
|
|
20
|
+
.gedit-m-variable-selector-tag {
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
align-items: center;
|
|
21
23
|
width: 100%;
|
|
24
|
+
height: 22px;
|
|
25
|
+
margin: 0;
|
|
22
26
|
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: flex-start;
|
|
25
27
|
|
|
26
28
|
& .semi-tag-content-center {
|
|
27
29
|
justify-content: flex-start;
|
|
28
30
|
}
|
|
31
|
+
}
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
.gedit-m-variable-selector-tree-select {
|
|
34
|
+
outline: none;
|
|
35
|
+
|
|
36
|
+
&.error {
|
|
37
|
+
outline: 1px solid red;
|
|
33
38
|
}
|
|
34
|
-
`;
|
|
35
|
-
const UITreeSelect = styled_components(TreeSelect)`
|
|
36
|
-
outline: ${({ $error })=>$error ? '1px solid red' : 'none'};
|
|
37
39
|
|
|
38
40
|
& .semi-tree-select-selection {
|
|
39
|
-
padding: 0px;
|
|
40
41
|
height: 22px;
|
|
42
|
+
padding: 0;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
& .semi-tree-select-selection-content {
|
|
@@ -47,12 +49,18 @@ const UITreeSelect = styled_components(TreeSelect)`
|
|
|
47
49
|
& .semi-tree-select-selection-placeholder {
|
|
48
50
|
padding-left: 10px;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.gedit-m-variable-selector-tag-pop {
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
justify-content: flex-start;
|
|
57
|
+
align-items: center;
|
|
52
58
|
padding: 10px;
|
|
53
59
|
display: inline-flex;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.gedit-m-variable-selector-dropdown {
|
|
63
|
+
max-height: 300px;
|
|
64
|
+
overflow: auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
@@ -31,8 +31,10 @@ 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 semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
34
|
+
const external_context_js_namespaceObject = require("./context.js");
|
|
34
35
|
function useVariableTree(params) {
|
|
35
|
-
const
|
|
36
|
+
const context = (0, external_context_js_namespaceObject.useVariableSelectorContext)();
|
|
37
|
+
const { includeSchema = context.includeSchema, excludeSchema = context.excludeSchema, skipVariable = context.skipVariable } = params;
|
|
36
38
|
const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
|
|
37
39
|
const variables = (0, editor_namespaceObject.useAvailableVariables)();
|
|
38
40
|
const getVariableTypeIcon = (0, external_react_namespaceObject.useCallback)((variable)=>{
|