@flowgram.ai/form-materials 0.4.10 → 0.4.12

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.
Files changed (90) hide show
  1. package/dist/cjs/components/blur-input/index.js +2 -12
  2. package/dist/cjs/components/{prompt-editor-with-inputs/inputs-picker.js → coze-editor-extensions/extensions/inputs-tree.js} +70 -2
  3. package/dist/cjs/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.js +10 -7
  4. package/dist/cjs/components/coze-editor-extensions/index.js +86 -0
  5. package/dist/cjs/components/display-schema-tree/index.js +2 -2
  6. package/dist/cjs/components/index.js +11 -1
  7. package/dist/cjs/components/json-editor-with-variables/editor.js +10 -6
  8. package/dist/cjs/components/prompt-editor-with-inputs/editor.js +2 -2
  9. package/dist/cjs/components/prompt-editor-with-variables/editor.js +3 -4
  10. package/dist/cjs/components/type-selector/index.js +2 -2
  11. package/dist/cjs/components/variable-selector/index.js +1 -0
  12. package/dist/cjs/components/variable-selector/use-variable-tree.js +1 -2
  13. package/dist/cjs/index.js +10 -1
  14. package/dist/cjs/plugins/json-schema-preset/index.js +3 -13
  15. package/dist/cjs/plugins/json-schema-preset/react.js +50 -0
  16. package/dist/cjs/shared/inject-material/index.js +2 -1
  17. package/dist/esm/components/blur-input/index.mjs +2 -2
  18. package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +135 -0
  19. package/dist/esm/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.mjs +10 -7
  20. package/dist/esm/components/coze-editor-extensions/index.mjs +18 -0
  21. package/dist/esm/components/display-schema-tree/index.mjs +1 -1
  22. package/dist/esm/components/index.mjs +2 -1
  23. package/dist/esm/components/json-editor-with-variables/editor.mjs +8 -4
  24. package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +2 -2
  25. package/dist/esm/components/prompt-editor-with-variables/editor.mjs +3 -4
  26. package/dist/esm/components/type-selector/index.mjs +1 -1
  27. package/dist/esm/components/variable-selector/index.mjs +1 -0
  28. package/dist/esm/components/variable-selector/use-variable-tree.mjs +1 -2
  29. package/dist/esm/index.mjs +2 -2
  30. package/dist/esm/plugins/json-schema-preset/index.mjs +3 -13
  31. package/dist/esm/plugins/json-schema-preset/react.mjs +13 -0
  32. package/dist/esm/shared/inject-material/index.mjs +2 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/dist/types/components/blur-input/index.d.ts +7 -1
  35. package/dist/types/components/{prompt-editor-with-inputs/inputs-picker.d.ts → coze-editor-extensions/extensions/inputs-tree.d.ts} +5 -0
  36. package/dist/types/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.d.ts +3 -1
  37. package/dist/types/components/coze-editor-extensions/index.d.ts +18 -0
  38. package/dist/types/components/display-schema-tree/index.d.ts +1 -1
  39. package/dist/types/components/dynamic-value-input/index.d.ts +3 -1
  40. package/dist/types/components/index.d.ts +1 -0
  41. package/dist/types/components/type-selector/index.d.ts +3 -1
  42. package/dist/types/components/variable-selector/index.d.ts +4 -2
  43. package/dist/types/index.d.ts +1 -1
  44. package/dist/types/plugins/json-schema-preset/index.d.ts +3 -7
  45. package/dist/types/plugins/json-schema-preset/react.d.ts +11 -0
  46. package/dist/types/shared/inject-material/index.d.ts +6 -4
  47. package/dist/types/validate/validate-flow-value/index.d.ts +1 -1
  48. package/package.json +51 -12
  49. package/src/components/blur-input/index.tsx +9 -1
  50. package/src/components/{prompt-editor-with-inputs/inputs-picker.tsx → coze-editor-extensions/extensions/inputs-tree.tsx} +95 -5
  51. package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +9 -3
  52. package/src/components/coze-editor-extensions/index.tsx +33 -0
  53. package/src/components/display-schema-tree/index.tsx +6 -4
  54. package/src/components/index.ts +5 -0
  55. package/src/components/json-editor-with-variables/editor.tsx +4 -4
  56. package/src/components/prompt-editor-with-inputs/editor.tsx +2 -3
  57. package/src/components/prompt-editor-with-variables/editor.tsx +3 -5
  58. package/src/components/type-selector/index.tsx +2 -3
  59. package/src/components/variable-selector/index.tsx +4 -2
  60. package/src/components/variable-selector/use-variable-tree.tsx +7 -4
  61. package/src/index.ts +3 -0
  62. package/src/plugins/json-schema-preset/index.tsx +4 -20
  63. package/src/plugins/json-schema-preset/react.tsx +28 -0
  64. package/src/shared/inject-material/index.tsx +10 -6
  65. package/src/validate/validate-flow-value/index.tsx +1 -2
  66. package/dist/cjs/components/json-editor-with-variables/extensions/variable-tree.js +0 -97
  67. package/dist/cjs/components/prompt-editor-with-inputs/extensions/inputs-tree.js +0 -101
  68. package/dist/cjs/components/prompt-editor-with-variables/extensions/variable-tag.js +0 -151
  69. package/dist/cjs/components/prompt-editor-with-variables/styles.js +0 -89
  70. package/dist/esm/components/json-editor-with-variables/extensions/variable-tree.mjs +0 -63
  71. package/dist/esm/components/prompt-editor-with-inputs/extensions/inputs-tree.mjs +0 -67
  72. package/dist/esm/components/prompt-editor-with-inputs/inputs-picker.mjs +0 -70
  73. package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tag.mjs +0 -117
  74. package/dist/esm/components/prompt-editor-with-variables/styles.mjs +0 -36
  75. package/dist/types/components/json-editor-with-variables/extensions/variable-tree.d.ts +0 -6
  76. package/dist/types/components/prompt-editor-with-inputs/extensions/inputs-tree.d.ts +0 -9
  77. package/dist/types/components/prompt-editor-with-variables/extensions/variable-tag.d.ts +0 -5
  78. package/dist/types/components/prompt-editor-with-variables/styles.d.ts +0 -9
  79. package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +0 -83
  80. package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +0 -94
  81. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +0 -174
  82. package/src/components/prompt-editor-with-variables/styles.tsx +0 -44
  83. /package/dist/cjs/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.js +0 -0
  84. /package/dist/cjs/components/{json-editor-with-variables → coze-editor-extensions}/styles.js +0 -0
  85. /package/dist/esm/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.mjs +0 -0
  86. /package/dist/esm/components/{json-editor-with-variables → coze-editor-extensions}/styles.mjs +0 -0
  87. /package/dist/types/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.d.ts +0 -0
  88. /package/dist/types/components/{json-editor-with-variables → coze-editor-extensions}/styles.d.ts +0 -0
  89. /package/src/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.tsx +0 -0
  90. /package/src/components/{json-editor-with-variables → coze-editor-extensions}/styles.tsx +0 -0
@@ -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,8 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
37
28
  });
38
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
30
  const external_react_namespaceObject = require("react");
40
- const input_namespaceObject = require("@douyinfe/semi-ui/lib/es/input");
41
- var input_default = /*#__PURE__*/ __webpack_require__.n(input_namespaceObject);
31
+ const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
42
32
  function BlurInput(props) {
43
33
  const [value, setValue] = (0, external_react_namespaceObject.useState)('');
44
34
  (0, external_react_namespaceObject.useEffect)(()=>{
@@ -46,7 +36,7 @@ function BlurInput(props) {
46
36
  }, [
47
37
  props.value
48
38
  ]);
49
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_default(), {
39
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Input, {
50
40
  ...props,
51
41
  value: value,
52
42
  onChange: (value)=>{
@@ -24,14 +24,16 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
+ InputsTree: ()=>InputsTree,
27
28
  InputsPicker: ()=>InputsPicker
28
29
  });
29
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
31
  const external_react_namespaceObject = require("react");
31
32
  const external_lodash_es_namespaceObject = require("lodash-es");
32
33
  const editor_namespaceObject = require("@flowgram.ai/editor");
34
+ const react_namespaceObject = require("@flowgram.ai/coze-editor/react");
33
35
  const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
34
- const index_js_namespaceObject = require("../../shared/index.js");
36
+ const index_js_namespaceObject = require("../../../shared/index.js");
35
37
  function InputsPicker({ inputsValues, onSelect }) {
36
38
  const available = (0, editor_namespaceObject.useScopeAvailable)();
37
39
  const getArrayDrilldown = (type, depth = 1)=>{
@@ -95,9 +97,75 @@ function InputsPicker({ inputsValues, onSelect }) {
95
97
  onSelect: (v)=>onSelect(v)
96
98
  });
97
99
  }
100
+ const DEFAULT_TRIGGER_CHARACTERS = [
101
+ '{',
102
+ '{}',
103
+ '@'
104
+ ];
105
+ function InputsTree({ inputsValues, triggerCharacters = DEFAULT_TRIGGER_CHARACTERS }) {
106
+ const [posKey, setPosKey] = (0, external_react_namespaceObject.useState)('');
107
+ const [visible, setVisible] = (0, external_react_namespaceObject.useState)(false);
108
+ const [position, setPosition] = (0, external_react_namespaceObject.useState)(-1);
109
+ const editor = (0, react_namespaceObject.useEditor)();
110
+ function insert(variablePath) {
111
+ const range = (0, react_namespaceObject.getCurrentMentionReplaceRange)(editor.$view.state);
112
+ if (!range) return;
113
+ let { from, to } = range;
114
+ while('{' === editor.$view.state.doc.sliceString(from - 1, from))from--;
115
+ while('}' === editor.$view.state.doc.sliceString(to, to + 1))to++;
116
+ editor.replaceText({
117
+ ...range,
118
+ text: '{{' + variablePath + '}}'
119
+ });
120
+ setVisible(false);
121
+ }
122
+ function handleOpenChange(e) {
123
+ setPosition(e.state.selection.main.head);
124
+ setVisible(e.value);
125
+ }
126
+ (0, external_react_namespaceObject.useEffect)(()=>{
127
+ if (!editor) return;
128
+ }, [
129
+ editor,
130
+ visible
131
+ ]);
132
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
133
+ children: [
134
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.Mention, {
135
+ triggerCharacters: triggerCharacters,
136
+ onOpenChange: handleOpenChange
137
+ }),
138
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Popover, {
139
+ visible: visible,
140
+ trigger: "custom",
141
+ position: "topLeft",
142
+ rePosKey: posKey,
143
+ content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
144
+ style: {
145
+ width: 300,
146
+ maxHeight: 300,
147
+ overflowY: 'auto'
148
+ },
149
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputsPicker, {
150
+ inputsValues: inputsValues,
151
+ onSelect: (v)=>{
152
+ insert(v);
153
+ }
154
+ })
155
+ }),
156
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.PositionMirror, {
157
+ position: position,
158
+ onChange: ()=>setPosKey(String(Math.random()))
159
+ })
160
+ })
161
+ ]
162
+ });
163
+ }
98
164
  exports.InputsPicker = __webpack_exports__.InputsPicker;
165
+ exports.InputsTree = __webpack_exports__.InputsTree;
99
166
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
100
- "InputsPicker"
167
+ "InputsPicker",
168
+ "InputsTree"
101
169
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
102
170
  Object.defineProperty(exports, '__esModule', {
103
171
  value: true
@@ -31,7 +31,12 @@ const external_react_namespaceObject = require("react");
31
31
  const react_namespaceObject = require("@flowgram.ai/coze-editor/react");
32
32
  const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
33
33
  const index_js_namespaceObject = require("../../variable-selector/index.js");
34
- function VariableTree() {
34
+ const DEFAULT_TRIGGER_CHARACTER = [
35
+ '{',
36
+ '{}',
37
+ '@'
38
+ ];
39
+ function VariableTree({ triggerCharacters = DEFAULT_TRIGGER_CHARACTER }) {
35
40
  const [posKey, setPosKey] = (0, external_react_namespaceObject.useState)('');
36
41
  const [visible, setVisible] = (0, external_react_namespaceObject.useState)(false);
37
42
  const [position, setPosition] = (0, external_react_namespaceObject.useState)(-1);
@@ -63,11 +68,7 @@ function VariableTree() {
63
68
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
64
69
  children: [
65
70
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.Mention, {
66
- triggerCharacters: [
67
- '{',
68
- '{}',
69
- '@'
70
- ],
71
+ triggerCharacters: triggerCharacters,
71
72
  onOpenChange: handleOpenChange
72
73
  }),
73
74
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Popover, {
@@ -77,7 +78,9 @@ function VariableTree() {
77
78
  rePosKey: posKey,
78
79
  content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
79
80
  style: {
80
- width: 300
81
+ width: 300,
82
+ maxHeight: 300,
83
+ overflowY: 'auto'
81
84
  },
82
85
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Tree, {
83
86
  treeData: treeData,
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "./extensions/inputs-tree": function(module) {
4
+ module.exports = import("./extensions/inputs-tree.js").then(function(module) {
5
+ return module;
6
+ });
7
+ },
8
+ "./extensions/variable-tag": function(module) {
9
+ module.exports = import("./extensions/variable-tag.js").then(function(module) {
10
+ return module;
11
+ });
12
+ },
13
+ "./extensions/variable-tree": function(module) {
14
+ module.exports = import("./extensions/variable-tree.js").then(function(module) {
15
+ return module;
16
+ });
17
+ }
18
+ };
19
+ var __webpack_module_cache__ = {};
20
+ function __webpack_require__(moduleId) {
21
+ var cachedModule = __webpack_module_cache__[moduleId];
22
+ if (void 0 !== cachedModule) return cachedModule.exports;
23
+ var module = __webpack_module_cache__[moduleId] = {
24
+ exports: {}
25
+ };
26
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
27
+ return module.exports;
28
+ }
29
+ (()=>{
30
+ __webpack_require__.d = (exports1, definition)=>{
31
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
32
+ enumerable: true,
33
+ get: definition[key]
34
+ });
35
+ };
36
+ })();
37
+ (()=>{
38
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
39
+ })();
40
+ (()=>{
41
+ __webpack_require__.r = (exports1)=>{
42
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
43
+ value: 'Module'
44
+ });
45
+ Object.defineProperty(exports1, '__esModule', {
46
+ value: true
47
+ });
48
+ };
49
+ })();
50
+ var __webpack_exports__ = {};
51
+ (()=>{
52
+ __webpack_require__.r(__webpack_exports__);
53
+ __webpack_require__.d(__webpack_exports__, {
54
+ EditorInputsTree: ()=>EditorInputsTree,
55
+ EditorVariableTagInject: ()=>EditorVariableTagInject,
56
+ EditorVariableTree: ()=>EditorVariableTree
57
+ });
58
+ const external_react_namespaceObject = require("react");
59
+ const index_js_namespaceObject = require("../../shared/index.js");
60
+ const EditorVariableTree = (0, index_js_namespaceObject.createInjectMaterial)(/*#__PURE__*/ (0, external_react_namespaceObject.lazy)(()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./extensions/variable-tree")).then((module)=>({
61
+ default: module.VariableTree
62
+ }))), {
63
+ renderKey: 'EditorVariableTree'
64
+ });
65
+ const EditorVariableTagInject = (0, index_js_namespaceObject.createInjectMaterial)(/*#__PURE__*/ (0, external_react_namespaceObject.lazy)(()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./extensions/variable-tag")).then((module)=>({
66
+ default: module.VariableTagInject
67
+ }))), {
68
+ renderKey: 'EditorVariableTagInject'
69
+ });
70
+ const EditorInputsTree = (0, index_js_namespaceObject.createInjectMaterial)(/*#__PURE__*/ (0, external_react_namespaceObject.lazy)(()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./extensions/inputs-tree")).then((module)=>({
71
+ default: module.InputsTree
72
+ }))), {
73
+ renderKey: 'EditorInputsTree'
74
+ });
75
+ })();
76
+ exports.EditorInputsTree = __webpack_exports__.EditorInputsTree;
77
+ exports.EditorVariableTagInject = __webpack_exports__.EditorVariableTagInject;
78
+ exports.EditorVariableTree = __webpack_exports__.EditorVariableTree;
79
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
80
+ "EditorInputsTree",
81
+ "EditorVariableTagInject",
82
+ "EditorVariableTree"
83
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
84
+ Object.defineProperty(exports, '__esModule', {
85
+ value: true
86
+ });
@@ -38,7 +38,7 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  const external_react_namespaceObject = require("react");
40
40
  var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
41
- const index_js_namespaceObject = require("../../plugins/index.js");
41
+ const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
42
42
  const external_styles_js_namespaceObject = require("./styles.js");
43
43
  function DisplaySchemaTree(props) {
44
44
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SchemaTree, {
@@ -47,7 +47,7 @@ function DisplaySchemaTree(props) {
47
47
  }
48
48
  function SchemaTree(props) {
49
49
  const { value: schema = {}, drilldown = true, depth = 0, showIcon = true, parentKey = '' } = props || {};
50
- const typeManager = (0, index_js_namespaceObject.useTypeManager)();
50
+ const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
51
51
  const config = typeManager.getTypeBySchema(schema);
52
52
  const title = typeManager.getComplexText(schema);
53
53
  const icon = typeManager?.getDisplayIcon(schema);
@@ -32,6 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  DynamicValueInput: ()=>external_dynamic_value_input_index_js_namespaceObject.DynamicValueInput,
33
33
  AssignRows: ()=>external_assign_rows_index_js_namespaceObject.AssignRows,
34
34
  ConditionRow: ()=>external_condition_row_index_js_namespaceObject.ConditionRow,
35
+ EditorInputsTree: ()=>external_coze_editor_extensions_index_js_namespaceObject.EditorInputsTree,
35
36
  InjectDynamicValueInput: ()=>external_dynamic_value_input_index_js_namespaceObject.InjectDynamicValueInput,
36
37
  PromptEditorWithVariables: ()=>external_prompt_editor_with_variables_index_js_namespaceObject.PromptEditorWithVariables,
37
38
  JsonEditorWithVariables: ()=>external_json_editor_with_variables_index_js_namespaceObject.JsonEditorWithVariables,
@@ -48,11 +49,13 @@ __webpack_require__.d(__webpack_exports__, {
48
49
  VariableSelectorProvider: ()=>external_variable_selector_index_js_namespaceObject.VariableSelectorProvider,
49
50
  DisplayFlowValue: ()=>external_display_flow_value_index_js_namespaceObject.DisplayFlowValue,
50
51
  JsonSchemaEditor: ()=>external_json_schema_editor_index_js_namespaceObject.JsonSchemaEditor,
51
- PromptEditorWithInputs: ()=>external_prompt_editor_with_inputs_index_js_namespaceObject.PromptEditorWithInputs,
52
+ EditorVariableTagInject: ()=>external_coze_editor_extensions_index_js_namespaceObject.EditorVariableTagInject,
52
53
  InputsValuesTree: ()=>external_inputs_values_tree_index_js_namespaceObject.InputsValuesTree,
54
+ PromptEditorWithInputs: ()=>external_prompt_editor_with_inputs_index_js_namespaceObject.PromptEditorWithInputs,
53
55
  parseTypeSelectValue: ()=>external_type_selector_index_js_namespaceObject.parseTypeSelectValue,
54
56
  CodeEditor: ()=>external_code_editor_index_js_namespaceObject.CodeEditor,
55
57
  DisplayInputsValueAllInTag: ()=>external_display_inputs_values_index_js_namespaceObject.DisplayInputsValueAllInTag,
58
+ EditorVariableTree: ()=>external_coze_editor_extensions_index_js_namespaceObject.EditorVariableTree,
56
59
  getTypeSelectValue: ()=>external_type_selector_index_js_namespaceObject.getTypeSelectValue,
57
60
  DisplayInputsValues: ()=>external_display_inputs_values_index_js_namespaceObject.DisplayInputsValues,
58
61
  BatchOutputs: ()=>external_batch_outputs_index_js_namespaceObject.BatchOutputs,
@@ -67,6 +70,7 @@ const external_code_editor_index_js_namespaceObject = require("./code-editor/ind
67
70
  const external_code_editor_mini_index_js_namespaceObject = require("./code-editor-mini/index.js");
68
71
  const external_condition_row_index_js_namespaceObject = require("./condition-row/index.js");
69
72
  const external_constant_input_index_js_namespaceObject = require("./constant-input/index.js");
73
+ const external_coze_editor_extensions_index_js_namespaceObject = require("./coze-editor-extensions/index.js");
70
74
  const external_db_condition_row_index_js_namespaceObject = require("./db-condition-row/index.js");
71
75
  const external_display_flow_value_index_js_namespaceObject = require("./display-flow-value/index.js");
72
76
  const external_display_inputs_values_index_js_namespaceObject = require("./display-inputs-values/index.js");
@@ -100,6 +104,9 @@ exports.DisplayOutputs = __webpack_exports__.DisplayOutputs;
100
104
  exports.DisplaySchemaTag = __webpack_exports__.DisplaySchemaTag;
101
105
  exports.DisplaySchemaTree = __webpack_exports__.DisplaySchemaTree;
102
106
  exports.DynamicValueInput = __webpack_exports__.DynamicValueInput;
107
+ exports.EditorInputsTree = __webpack_exports__.EditorInputsTree;
108
+ exports.EditorVariableTagInject = __webpack_exports__.EditorVariableTagInject;
109
+ exports.EditorVariableTree = __webpack_exports__.EditorVariableTree;
103
110
  exports.InjectDynamicValueInput = __webpack_exports__.InjectDynamicValueInput;
104
111
  exports.InjectTypeSelector = __webpack_exports__.InjectTypeSelector;
105
112
  exports.InjectVariableSelector = __webpack_exports__.InjectVariableSelector;
@@ -134,6 +141,9 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
134
141
  "DisplaySchemaTag",
135
142
  "DisplaySchemaTree",
136
143
  "DynamicValueInput",
144
+ "EditorInputsTree",
145
+ "EditorVariableTagInject",
146
+ "EditorVariableTree",
137
147
  "InjectDynamicValueInput",
138
148
  "InjectTypeSelector",
139
149
  "InjectVariableSelector",
@@ -30,9 +30,11 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  require("react");
31
31
  const editor_namespaceObject = require("@flowgram.ai/editor");
32
32
  const preset_code_namespaceObject = require("@flowgram.ai/coze-editor/preset-code");
33
- const index_js_namespaceObject = require("../code-editor/index.js");
34
- const variable_tree_js_namespaceObject = require("./extensions/variable-tree.js");
35
- const variable_tag_js_namespaceObject = require("./extensions/variable-tag.js");
33
+ const index_js_namespaceObject = require("../coze-editor-extensions/index.js");
34
+ const external_code_editor_index_js_namespaceObject = require("../code-editor/index.js");
35
+ const TRIGGER_CHARACTERS = [
36
+ '@'
37
+ ];
36
38
  function findAllMatches(inputString, regex) {
37
39
  const globalRegex = new RegExp(regex, regex.flags.includes('g') ? regex.flags : regex.flags + 'g');
38
40
  let match;
@@ -58,7 +60,7 @@ const transformer = (0, preset_code_namespaceObject.transformerCreator)((text)=>
58
60
  return text;
59
61
  });
60
62
  function JsonEditorWithVariables(props) {
61
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_js_namespaceObject.CodeEditor, {
63
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_code_editor_index_js_namespaceObject.CodeEditor, {
62
64
  languageId: "json",
63
65
  activeLinePlaceholder: editor_namespaceObject.I18n.t("Press '@' to Select variable"),
64
66
  ...props,
@@ -67,8 +69,10 @@ function JsonEditorWithVariables(props) {
67
69
  ...props.options || {}
68
70
  },
69
71
  children: [
70
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(variable_tree_js_namespaceObject.VariableTree, {}),
71
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(variable_tag_js_namespaceObject.VariableTagInject, {})
72
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.EditorVariableTree, {
73
+ triggerCharacters: TRIGGER_CHARACTERS
74
+ }),
75
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.EditorVariableTagInject, {})
72
76
  ]
73
77
  });
74
78
  }
@@ -29,11 +29,11 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  require("react");
31
31
  const index_js_namespaceObject = require("../prompt-editor/index.js");
32
- const inputs_tree_js_namespaceObject = require("./extensions/inputs-tree.js");
32
+ const external_coze_editor_extensions_index_js_namespaceObject = require("../coze-editor-extensions/index.js");
33
33
  function PromptEditorWithInputs({ inputsValues, ...restProps }) {
34
34
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.PromptEditor, {
35
35
  ...restProps,
36
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(inputs_tree_js_namespaceObject.InputsTree, {
36
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_coze_editor_extensions_index_js_namespaceObject.EditorInputsTree, {
37
37
  inputsValues: inputsValues
38
38
  })
39
39
  });
@@ -29,14 +29,13 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  require("react");
31
31
  const index_js_namespaceObject = require("../prompt-editor/index.js");
32
- const variable_tree_js_namespaceObject = require("./extensions/variable-tree.js");
33
- const variable_tag_js_namespaceObject = require("./extensions/variable-tag.js");
32
+ const external_coze_editor_extensions_index_js_namespaceObject = require("../coze-editor-extensions/index.js");
34
33
  function PromptEditorWithVariables(props) {
35
34
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_js_namespaceObject.PromptEditor, {
36
35
  ...props,
37
36
  children: [
38
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(variable_tree_js_namespaceObject.VariableTree, {}),
39
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(variable_tag_js_namespaceObject.VariableTagInject, {})
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, {})
40
39
  ]
41
40
  });
42
41
  }
@@ -31,9 +31,9 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  });
32
32
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
33
  const external_react_namespaceObject = require("react");
34
+ const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
34
35
  const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
35
36
  const index_js_namespaceObject = require("../../shared/inject-material/index.js");
36
- const external_plugins_index_js_namespaceObject = require("../../plugins/index.js");
37
37
  const labelStyle = {
38
38
  display: 'flex',
39
39
  alignItems: 'center',
@@ -63,7 +63,7 @@ function TypeSelector(props) {
63
63
  const selectValue = (0, external_react_namespaceObject.useMemo)(()=>getTypeSelectValue(value), [
64
64
  value
65
65
  ]);
66
- const typeManager = (0, external_plugins_index_js_namespaceObject.useTypeManager)();
66
+ const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
67
67
  const icon = typeManager.getDisplayIcon(value || {});
68
68
  const options = (0, external_react_namespaceObject.useMemo)(()=>typeManager.getTypeRegistriesWithParentType().map((_type)=>{
69
69
  const isArray = 'array' === _type.type;
@@ -65,6 +65,7 @@ const VariableSelector = ({ value, config = {}, onChange, style, readonly = fals
65
65
  });
66
66
  return icon;
67
67
  };
68
+ console.log('debugger treeValue', treeValue);
68
69
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
69
70
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UITreeSelect, {
70
71
  dropdownMatchSelectWidth: false,
@@ -31,10 +31,9 @@ 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 index_js_namespaceObject = require("../../plugins/index.js");
35
34
  function useVariableTree(params) {
36
35
  const { includeSchema, excludeSchema, skipVariable } = params;
37
- const typeManager = (0, index_js_namespaceObject.useTypeManager)();
36
+ const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
38
37
  const variables = (0, editor_namespaceObject.useAvailableVariables)();
39
38
  const getVariableTypeIcon = (0, external_react_namespaceObject.useCallback)((variable)=>{
40
39
  if (variable.meta?.icon) {
package/dist/cjs/index.js CHANGED
@@ -45,6 +45,7 @@ __webpack_require__.d(__webpack_exports__, {
45
45
  useVariableTree: ()=>index_js_namespaceObject.useVariableTree,
46
46
  formatLegacyRefOnSubmit: ()=>external_shared_index_js_namespaceObject.formatLegacyRefOnSubmit,
47
47
  DisplayFlowValue: ()=>index_js_namespaceObject.DisplayFlowValue,
48
+ EditorVariableTagInject: ()=>index_js_namespaceObject.EditorVariableTagInject,
48
49
  formatLegacyRefToNewRef: ()=>external_shared_index_js_namespaceObject.formatLegacyRefToNewRef,
49
50
  formatLegacyRefOnInit: ()=>external_shared_index_js_namespaceObject.formatLegacyRefOnInit,
50
51
  CodeEditor: ()=>index_js_namespaceObject.CodeEditor,
@@ -59,10 +60,11 @@ __webpack_require__.d(__webpack_exports__, {
59
60
  CodeEditorMini: ()=>index_js_namespaceObject.CodeEditorMini,
60
61
  DBConditionRow: ()=>index_js_namespaceObject.DBConditionRow,
61
62
  DynamicValueInput: ()=>index_js_namespaceObject.DynamicValueInput,
63
+ EditorInputsTree: ()=>index_js_namespaceObject.EditorInputsTree,
62
64
  PromptEditorWithVariables: ()=>index_js_namespaceObject.PromptEditorWithVariables,
63
65
  lazySuspense: ()=>external_shared_index_js_namespaceObject.lazySuspense,
64
- unstableSetCreateRoot: ()=>external_shared_index_js_namespaceObject.unstableSetCreateRoot,
65
66
  provideJsonSchemaOutputs: ()=>external_effects_index_js_namespaceObject.provideJsonSchemaOutputs,
67
+ unstableSetCreateRoot: ()=>external_shared_index_js_namespaceObject.unstableSetCreateRoot,
66
68
  createInferInputsPlugin: ()=>external_form_plugins_index_js_namespaceObject.createInferInputsPlugin,
67
69
  InjectVariableSelector: ()=>index_js_namespaceObject.InjectVariableSelector,
68
70
  DisplayOutputs: ()=>index_js_namespaceObject.DisplayOutputs,
@@ -82,6 +84,7 @@ __webpack_require__.d(__webpack_exports__, {
82
84
  InputsValuesTree: ()=>index_js_namespaceObject.InputsValuesTree,
83
85
  parseTypeSelectValue: ()=>index_js_namespaceObject.parseTypeSelectValue,
84
86
  syncVariableTitle: ()=>external_effects_index_js_namespaceObject.syncVariableTitle,
87
+ EditorVariableTree: ()=>index_js_namespaceObject.EditorVariableTree,
85
88
  JsonSchemaUtils: ()=>external_plugins_index_js_namespaceObject.JsonSchemaUtils,
86
89
  DisplayInputsValues: ()=>index_js_namespaceObject.DisplayInputsValues,
87
90
  autoRenameRefEffect: ()=>external_effects_index_js_namespaceObject.autoRenameRefEffect,
@@ -112,6 +115,9 @@ exports.DisplayOutputs = __webpack_exports__.DisplayOutputs;
112
115
  exports.DisplaySchemaTag = __webpack_exports__.DisplaySchemaTag;
113
116
  exports.DisplaySchemaTree = __webpack_exports__.DisplaySchemaTree;
114
117
  exports.DynamicValueInput = __webpack_exports__.DynamicValueInput;
118
+ exports.EditorInputsTree = __webpack_exports__.EditorInputsTree;
119
+ exports.EditorVariableTagInject = __webpack_exports__.EditorVariableTagInject;
120
+ exports.EditorVariableTree = __webpack_exports__.EditorVariableTree;
115
121
  exports.FlowValueUtils = __webpack_exports__.FlowValueUtils;
116
122
  exports.InjectDynamicValueInput = __webpack_exports__.InjectDynamicValueInput;
117
123
  exports.InjectTypeSelector = __webpack_exports__.InjectTypeSelector;
@@ -176,6 +182,9 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
176
182
  "DisplaySchemaTag",
177
183
  "DisplaySchemaTree",
178
184
  "DynamicValueInput",
185
+ "EditorInputsTree",
186
+ "EditorVariableTagInject",
187
+ "EditorVariableTree",
179
188
  "FlowValueUtils",
180
189
  "InjectDynamicValueInput",
181
190
  "InjectTypeSelector",
@@ -25,23 +25,13 @@ var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  JsonSchemaUtils: ()=>json_schema_namespaceObject.JsonSchemaUtils,
28
- JsonSchemaTypePresetProvider: ()=>JsonSchemaTypePresetProvider,
28
+ JsonSchemaTypePresetProvider: ()=>external_react_js_namespaceObject.JsonSchemaTypePresetProvider,
29
29
  createTypePresetPlugin: ()=>external_create_type_preset_plugin_js_namespaceObject.createTypePresetPlugin,
30
- useTypeManager: ()=>useTypeManager
30
+ useTypeManager: ()=>external_react_js_namespaceObject.useTypeManager
31
31
  });
32
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
- require("react");
34
32
  const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
35
- const index_js_namespaceObject = require("./type-definition/index.js");
33
+ const external_react_js_namespaceObject = require("./react.js");
36
34
  const external_create_type_preset_plugin_js_namespaceObject = require("./create-type-preset-plugin.js");
37
- const useTypeManager = ()=>(0, json_schema_namespaceObject.useTypeManager)();
38
- const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(json_schema_namespaceObject.TypePresetProvider, {
39
- types: [
40
- ...index_js_namespaceObject.jsonSchemaTypePreset,
41
- ...types
42
- ],
43
- children: children
44
- });
45
35
  exports.JsonSchemaTypePresetProvider = __webpack_exports__.JsonSchemaTypePresetProvider;
46
36
  exports.JsonSchemaUtils = __webpack_exports__.JsonSchemaUtils;
47
37
  exports.createTypePresetPlugin = __webpack_exports__.createTypePresetPlugin;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useTypeManager: ()=>useTypeManager,
28
+ JsonSchemaTypePresetProvider: ()=>JsonSchemaTypePresetProvider
29
+ });
30
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ require("react");
32
+ const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
33
+ const index_js_namespaceObject = require("./type-definition/index.js");
34
+ const useTypeManager = ()=>(0, json_schema_namespaceObject.useTypeManager)();
35
+ const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(json_schema_namespaceObject.TypePresetProvider, {
36
+ types: [
37
+ ...index_js_namespaceObject.jsonSchemaTypePreset,
38
+ ...types
39
+ ],
40
+ children: children
41
+ });
42
+ exports.JsonSchemaTypePresetProvider = __webpack_exports__.JsonSchemaTypePresetProvider;
43
+ exports.useTypeManager = __webpack_exports__.useTypeManager;
44
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
45
+ "JsonSchemaTypePresetProvider",
46
+ "useTypeManager"
47
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
48
+ Object.defineProperty(exports, '__esModule', {
49
+ value: true
50
+ });
@@ -39,13 +39,13 @@ const external_react_namespaceObject = require("react");
39
39
  var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
40
40
  const editor_namespaceObject = require("@flowgram.ai/editor");
41
41
  function createInjectMaterial(Component, params) {
42
+ const renderKey = params?.renderKey || Component.renderKey || Component.name || '';
42
43
  const InjectComponent = (props)=>{
43
44
  const container = (0, editor_namespaceObject.usePlaygroundContainer)();
44
45
  if (!container?.isBound(editor_namespaceObject.FlowRendererRegistry)) return /*#__PURE__*/ external_react_default().createElement(Component, {
45
46
  ...props
46
47
  });
47
48
  const rendererRegistry = container.get(editor_namespaceObject.FlowRendererRegistry);
48
- const renderKey = params?.renderKey || Component.renderKey || Component.name || '';
49
49
  const renderer = rendererRegistry.tryToGetRendererComponent(renderKey);
50
50
  if (renderer?.type !== editor_namespaceObject.FlowRendererComponentType.REACT) return /*#__PURE__*/ external_react_default().createElement(Component, {
51
51
  ...props
@@ -54,6 +54,7 @@ function createInjectMaterial(Component, params) {
54
54
  ...props
55
55
  });
56
56
  };
57
+ InjectComponent.renderKey = renderKey;
57
58
  return InjectComponent;
58
59
  }
59
60
  exports.createInjectMaterial = __webpack_exports__.createInjectMaterial;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
- import input from "@douyinfe/semi-ui/lib/es/input";
3
+ import { Input } from "@douyinfe/semi-ui";
4
4
  function BlurInput(props) {
5
5
  const [value, setValue] = useState('');
6
6
  useEffect(()=>{
@@ -8,7 +8,7 @@ function BlurInput(props) {
8
8
  }, [
9
9
  props.value
10
10
  ]);
11
- return /*#__PURE__*/ jsx(input, {
11
+ return /*#__PURE__*/ jsx(Input, {
12
12
  ...props,
13
13
  value: value,
14
14
  onChange: (value)=>{