@flowgram.ai/form-materials 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (227) hide show
  1. package/dist/cjs/components/batch-outputs/index.js +5 -3
  2. package/dist/cjs/components/batch-outputs/styles.css +13 -0
  3. package/dist/cjs/components/blur-input/index.js +1 -0
  4. package/dist/cjs/components/code-editor/editor.js +16 -12
  5. package/dist/cjs/components/code-editor/styles.css +4 -0
  6. package/dist/cjs/components/code-editor/theme/dark.js +1 -1
  7. package/dist/cjs/components/code-editor/theme/light.js +1 -1
  8. package/dist/cjs/components/code-editor-mini/index.js +2 -16
  9. package/dist/cjs/components/condition-context/hooks/use-condition.js +17 -1
  10. package/dist/cjs/components/condition-row/index.js +26 -12
  11. package/dist/cjs/components/condition-row/styles.css +19 -0
  12. package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +2 -2
  13. package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +31 -11
  14. package/dist/{esm/components/coze-editor-extensions/styles.mjs → cjs/components/coze-editor-extensions/styles.css} +19 -18
  15. package/dist/cjs/components/db-condition-row/index.js +29 -14
  16. package/dist/cjs/components/db-condition-row/styles.css +30 -0
  17. package/dist/cjs/components/display-inputs-values/index.js +3 -2
  18. package/dist/cjs/components/display-inputs-values/styles.css +6 -0
  19. package/dist/cjs/components/display-outputs/index.js +5 -4
  20. package/dist/cjs/components/display-outputs/styles.css +6 -0
  21. package/dist/cjs/components/display-schema-tag/index.js +7 -4
  22. package/dist/cjs/components/display-schema-tag/styles.css +21 -0
  23. package/dist/cjs/components/display-schema-tree/index.js +12 -7
  24. package/dist/cjs/components/display-schema-tree/styles.css +64 -0
  25. package/dist/cjs/components/dynamic-value-input/index.js +9 -5
  26. package/dist/{esm/components/dynamic-value-input/styles.mjs → cjs/components/dynamic-value-input/styles.css} +24 -30
  27. package/dist/cjs/components/inputs-values/index.js +5 -3
  28. package/dist/cjs/components/inputs-values/styles.css +13 -0
  29. package/dist/cjs/components/inputs-values-tree/icon.js +70 -0
  30. package/dist/cjs/components/inputs-values-tree/index.js +4 -3
  31. package/dist/cjs/components/inputs-values-tree/row.js +19 -15
  32. package/dist/cjs/components/inputs-values-tree/styles.css +85 -0
  33. package/dist/cjs/components/json-schema-editor/default-value.js +2 -2
  34. package/dist/cjs/components/json-schema-editor/hooks.js +55 -48
  35. package/dist/cjs/components/json-schema-editor/icon.js +70 -0
  36. package/dist/cjs/components/json-schema-editor/index.js +37 -25
  37. package/dist/cjs/components/json-schema-editor/styles.css +113 -0
  38. package/dist/cjs/components/prompt-editor/editor.js +16 -6
  39. package/dist/cjs/components/prompt-editor/styles.css +10 -0
  40. package/dist/cjs/components/prompt-editor-with-inputs/index.js +16 -26
  41. package/dist/cjs/components/prompt-editor-with-variables/index.js +17 -26
  42. package/dist/cjs/components/variable-selector/context.js +7 -3
  43. package/dist/cjs/components/variable-selector/index.js +16 -10
  44. package/dist/{esm/components/variable-selector/styles.mjs → cjs/components/variable-selector/styles.css} +37 -29
  45. package/dist/cjs/components/variable-selector/use-variable-tree.js +3 -1
  46. package/dist/cjs/shared/inject-material/index.js +1 -1
  47. package/dist/esm/components/batch-outputs/index.mjs +5 -3
  48. package/dist/esm/components/batch-outputs/styles.css +13 -0
  49. package/dist/esm/components/blur-input/index.mjs +1 -0
  50. package/dist/esm/components/code-editor/editor.mjs +16 -11
  51. package/dist/esm/components/code-editor/styles.css +4 -0
  52. package/dist/esm/components/code-editor/theme/dark.mjs +1 -1
  53. package/dist/esm/components/code-editor/theme/light.mjs +1 -1
  54. package/dist/esm/components/code-editor-mini/index.mjs +2 -6
  55. package/dist/esm/components/condition-context/hooks/use-condition.mjs +18 -2
  56. package/dist/esm/components/condition-row/index.mjs +26 -12
  57. package/dist/esm/components/condition-row/styles.css +19 -0
  58. package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +3 -3
  59. package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +32 -12
  60. package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
  61. package/dist/esm/components/db-condition-row/index.mjs +29 -14
  62. package/dist/esm/components/db-condition-row/styles.css +30 -0
  63. package/dist/esm/components/display-inputs-values/index.mjs +3 -2
  64. package/dist/esm/components/display-inputs-values/styles.css +6 -0
  65. package/dist/esm/components/display-outputs/index.mjs +5 -4
  66. package/dist/esm/components/display-outputs/styles.css +6 -0
  67. package/dist/esm/components/display-schema-tag/index.mjs +8 -5
  68. package/dist/esm/components/display-schema-tag/styles.css +21 -0
  69. package/dist/esm/components/display-schema-tree/index.mjs +12 -7
  70. package/dist/esm/components/display-schema-tree/styles.css +64 -0
  71. package/dist/esm/components/dynamic-value-input/index.mjs +9 -5
  72. package/dist/esm/components/dynamic-value-input/styles.css +48 -0
  73. package/dist/esm/components/inputs-values/index.mjs +5 -3
  74. package/dist/esm/components/inputs-values/styles.css +13 -0
  75. package/dist/esm/components/inputs-values-tree/icon.mjs +26 -0
  76. package/dist/esm/components/inputs-values-tree/index.mjs +4 -3
  77. package/dist/esm/components/inputs-values-tree/row.mjs +18 -14
  78. package/dist/esm/components/inputs-values-tree/styles.css +85 -0
  79. package/dist/esm/components/json-schema-editor/default-value.mjs +2 -2
  80. package/dist/esm/components/json-schema-editor/hooks.mjs +55 -48
  81. package/dist/esm/components/json-schema-editor/icon.mjs +26 -0
  82. package/dist/esm/components/json-schema-editor/index.mjs +36 -24
  83. package/dist/esm/components/json-schema-editor/styles.css +113 -0
  84. package/dist/esm/components/prompt-editor/editor.mjs +16 -6
  85. package/dist/esm/components/prompt-editor/styles.css +10 -0
  86. package/dist/esm/components/prompt-editor-with-inputs/index.mjs +12 -4
  87. package/dist/esm/components/prompt-editor-with-variables/index.mjs +13 -4
  88. package/dist/esm/components/variable-selector/context.mjs +7 -3
  89. package/dist/esm/components/variable-selector/index.mjs +17 -11
  90. package/{src/components/variable-selector/styles.tsx → dist/esm/components/variable-selector/styles.css} +35 -38
  91. package/dist/esm/components/variable-selector/use-variable-tree.mjs +3 -1
  92. package/dist/esm/shared/inject-material/index.mjs +1 -1
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/dist/types/components/batch-outputs/index.d.ts +1 -0
  95. package/dist/types/components/blur-input/index.d.ts +1 -1
  96. package/dist/types/components/code-editor/editor.d.ts +1 -0
  97. package/dist/types/components/condition-context/hooks/use-condition.d.ts +16 -1
  98. package/dist/types/components/condition-row/index.d.ts +5 -1
  99. package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +3 -3
  100. package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +1 -0
  101. package/dist/types/components/coze-editor-extensions/index.d.ts +1 -1
  102. package/dist/types/components/db-condition-row/index.d.ts +4 -0
  103. package/dist/types/components/db-condition-row/types.d.ts +0 -1
  104. package/dist/types/components/display-inputs-values/index.d.ts +3 -1
  105. package/dist/types/components/display-outputs/index.d.ts +1 -0
  106. package/dist/types/components/display-schema-tag/index.d.ts +1 -0
  107. package/dist/types/components/display-schema-tree/index.d.ts +1 -0
  108. package/dist/types/components/dynamic-value-input/index.d.ts +1 -0
  109. package/dist/types/components/inputs-values/index.d.ts +1 -0
  110. package/dist/types/components/inputs-values-tree/icon.d.ts +6 -0
  111. package/dist/types/components/inputs-values-tree/index.d.ts +1 -0
  112. package/dist/types/components/inputs-values-tree/row.d.ts +1 -0
  113. package/dist/types/components/inputs-values-tree/types.d.ts +3 -2
  114. package/dist/types/components/json-schema-editor/icon.d.ts +6 -0
  115. package/dist/types/components/json-schema-editor/index.d.ts +1 -0
  116. package/dist/types/components/prompt-editor/editor.d.ts +1 -0
  117. package/dist/types/components/prompt-editor-with-inputs/index.d.ts +7 -2
  118. package/dist/types/components/prompt-editor-with-variables/index.d.ts +5 -2
  119. package/dist/types/components/variable-selector/context.d.ts +16 -3
  120. package/dist/types/components/variable-selector/index.d.ts +1 -0
  121. package/dist/types/index.d.ts +1 -1
  122. package/dist/types/shared/flow-value/index.d.ts +1 -1
  123. package/dist/types/shared/flow-value/types.d.ts +3 -0
  124. package/dist/types/shared/index.d.ts +1 -1
  125. package/package.json +7 -10
  126. package/src/components/batch-outputs/index.tsx +5 -5
  127. package/src/components/batch-outputs/{styles.tsx → styles.css} +4 -6
  128. package/src/components/blur-input/index.tsx +2 -1
  129. package/src/components/code-editor/editor.tsx +19 -14
  130. package/src/components/code-editor/styles.css +11 -0
  131. package/src/components/code-editor/theme/dark.ts +1 -1
  132. package/src/components/code-editor/theme/light.ts +1 -1
  133. package/src/components/code-editor-mini/index.tsx +2 -9
  134. package/src/components/condition-context/hooks/use-condition.tsx +51 -7
  135. package/src/components/condition-row/index.tsx +27 -22
  136. package/src/components/condition-row/{styles.tsx → styles.css} +11 -11
  137. package/src/components/coze-editor-extensions/extensions/inputs-tree.tsx +7 -6
  138. package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +19 -14
  139. package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
  140. package/src/components/db-condition-row/index.tsx +29 -26
  141. package/src/components/db-condition-row/{styles.tsx → styles.css} +14 -16
  142. package/src/components/db-condition-row/types.ts +0 -1
  143. package/src/components/display-inputs-values/index.tsx +5 -4
  144. package/src/components/display-inputs-values/{styles.ts → styles.css} +2 -4
  145. package/src/components/display-outputs/index.tsx +5 -5
  146. package/src/components/display-outputs/{styles.ts → styles.css} +2 -4
  147. package/src/components/display-schema-tag/index.tsx +7 -7
  148. package/src/components/display-schema-tag/{styles.ts → styles.css} +7 -10
  149. package/src/components/display-schema-tree/index.tsx +10 -10
  150. package/src/components/display-schema-tree/{styles.tsx → styles.css} +18 -24
  151. package/src/components/dynamic-value-input/index.tsx +6 -6
  152. package/src/components/dynamic-value-input/{styles.tsx → styles.css} +9 -12
  153. package/src/components/inputs-values/index.tsx +5 -5
  154. package/src/components/inputs-values/{styles.tsx → styles.css} +4 -6
  155. package/src/components/inputs-values-tree/icon.tsx +28 -0
  156. package/src/components/inputs-values-tree/index.tsx +8 -6
  157. package/src/components/inputs-values-tree/row.tsx +25 -27
  158. package/src/components/inputs-values-tree/styles.css +94 -0
  159. package/src/components/inputs-values-tree/types.ts +3 -2
  160. package/src/components/json-schema-editor/default-value.tsx +2 -4
  161. package/src/components/json-schema-editor/hooks.tsx +60 -53
  162. package/src/components/json-schema-editor/icon.tsx +28 -0
  163. package/src/components/json-schema-editor/index.tsx +45 -50
  164. package/src/components/json-schema-editor/styles.css +135 -0
  165. package/src/components/prompt-editor/editor.tsx +18 -7
  166. package/src/components/prompt-editor/styles.css +14 -0
  167. package/src/components/prompt-editor-with-inputs/index.tsx +18 -5
  168. package/src/components/prompt-editor-with-variables/index.tsx +13 -5
  169. package/src/components/variable-selector/context.tsx +22 -2
  170. package/src/components/variable-selector/index.tsx +24 -14
  171. package/src/components/variable-selector/styles.css +70 -0
  172. package/src/components/variable-selector/use-variable-tree.tsx +9 -1
  173. package/src/index.ts +1 -0
  174. package/src/shared/flow-value/index.ts +1 -0
  175. package/src/shared/flow-value/types.ts +4 -0
  176. package/src/shared/index.ts +1 -0
  177. package/src/shared/inject-material/index.tsx +1 -1
  178. package/dist/cjs/components/batch-outputs/styles.js +0 -60
  179. package/dist/cjs/components/condition-row/styles.js +0 -77
  180. package/dist/cjs/components/coze-editor-extensions/styles.js +0 -89
  181. package/dist/cjs/components/db-condition-row/styles.js +0 -94
  182. package/dist/cjs/components/display-inputs-values/styles.js +0 -51
  183. package/dist/cjs/components/display-outputs/styles.js +0 -51
  184. package/dist/cjs/components/display-schema-tag/styles.js +0 -71
  185. package/dist/cjs/components/display-schema-tree/styles.js +0 -135
  186. package/dist/cjs/components/dynamic-value-input/styles.js +0 -107
  187. package/dist/cjs/components/inputs-values/styles.js +0 -60
  188. package/dist/cjs/components/inputs-values-tree/styles.js +0 -177
  189. package/dist/cjs/components/json-schema-editor/styles.js +0 -231
  190. package/dist/cjs/components/prompt-editor/styles.js +0 -55
  191. package/dist/cjs/components/prompt-editor-with-inputs/editor.js +0 -47
  192. package/dist/cjs/components/prompt-editor-with-variables/editor.js +0 -48
  193. package/dist/cjs/components/variable-selector/styles.js +0 -114
  194. package/dist/esm/components/batch-outputs/styles.mjs +0 -13
  195. package/dist/esm/components/condition-row/styles.mjs +0 -21
  196. package/dist/esm/components/db-condition-row/styles.mjs +0 -32
  197. package/dist/esm/components/display-inputs-values/styles.mjs +0 -7
  198. package/dist/esm/components/display-outputs/styles.mjs +0 -7
  199. package/dist/esm/components/display-schema-tag/styles.mjs +0 -21
  200. package/dist/esm/components/display-schema-tree/styles.mjs +0 -79
  201. package/dist/esm/components/inputs-values/styles.mjs +0 -13
  202. package/dist/esm/components/inputs-values-tree/styles.mjs +0 -105
  203. package/dist/esm/components/json-schema-editor/styles.mjs +0 -138
  204. package/dist/esm/components/prompt-editor/styles.mjs +0 -11
  205. package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +0 -13
  206. package/dist/esm/components/prompt-editor-with-variables/editor.mjs +0 -14
  207. package/dist/types/components/batch-outputs/styles.d.ts +0 -6
  208. package/dist/types/components/condition-row/styles.d.ts +0 -9
  209. package/dist/types/components/coze-editor-extensions/styles.d.ts +0 -9
  210. package/dist/types/components/db-condition-row/styles.d.ts +0 -12
  211. package/dist/types/components/display-inputs-values/styles.d.ts +0 -5
  212. package/dist/types/components/display-outputs/styles.d.ts +0 -5
  213. package/dist/types/components/display-schema-tag/styles.d.ts +0 -8
  214. package/dist/types/components/display-schema-tree/styles.d.ts +0 -11
  215. package/dist/types/components/dynamic-value-input/styles.d.ts +0 -8
  216. package/dist/types/components/inputs-values/styles.d.ts +0 -6
  217. package/dist/types/components/inputs-values-tree/styles.d.ts +0 -23
  218. package/dist/types/components/json-schema-editor/styles.d.ts +0 -30
  219. package/dist/types/components/prompt-editor/styles.d.ts +0 -7
  220. package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +0 -10
  221. package/dist/types/components/prompt-editor-with-variables/editor.d.ts +0 -9
  222. package/dist/types/components/variable-selector/styles.d.ts +0 -14
  223. package/src/components/inputs-values-tree/styles.tsx +0 -128
  224. package/src/components/json-schema-editor/styles.tsx +0 -168
  225. package/src/components/prompt-editor/styles.tsx +0 -18
  226. package/src/components/prompt-editor-with-inputs/editor.tsx +0 -24
  227. package/src/components/prompt-editor-with-variables/editor.tsx +0 -20
@@ -39,68 +39,72 @@ function usePropertiesEdit(value, onChange) {
39
39
  const drilldownSchema = typeManager.getPropertiesParent(value || {});
40
40
  const canAddField = typeManager.canAddField(value || {});
41
41
  const [propertyList, setPropertyList] = (0, external_react_namespaceObject.useState)([]);
42
+ const latestPropertyListRef = (0, external_react_namespaceObject.useRef)(propertyList);
42
43
  const effectVersion = (0, external_react_namespaceObject.useRef)(0);
43
44
  const changeVersion = (0, external_react_namespaceObject.useRef)(0);
44
45
  (0, external_react_namespaceObject.useEffect)(()=>{
45
46
  effectVersion.current = effectVersion.current + 1;
46
47
  if (effectVersion.current === changeVersion.current) return;
47
48
  effectVersion.current = changeVersion.current;
48
- setPropertyList((_list)=>{
49
- const newNames = Object.entries(drilldownSchema?.properties || {}).sort(([, a], [, b])=>(a.extra?.index ?? 0) - (b.extra?.index ?? 0)).map(([key])=>key);
50
- const oldNames = _list.map((item)=>item.name).filter(Boolean);
51
- const addNames = (0, external_lodash_es_namespaceObject.difference)(newNames, oldNames);
52
- return _list.filter((item)=>!item.name || newNames.includes(item.name)).map((item)=>({
53
- key: item.key,
54
- name: item.name,
55
- isPropertyRequired: drilldownSchema?.required?.includes(item.name || '') || false,
56
- ...drilldownSchema?.properties?.[item.name || ''] || item || {}
57
- })).concat(addNames.map((_name)=>({
58
- key: genId(),
59
- name: _name,
60
- isPropertyRequired: drilldownSchema?.required?.includes(_name) || false,
61
- ...drilldownSchema?.properties?.[_name] || {}
62
- })));
63
- });
49
+ const _list = latestPropertyListRef.current;
50
+ const newNames = Object.entries(drilldownSchema?.properties || {}).sort(([, a], [, b])=>(a.extra?.index ?? 0) - (b.extra?.index ?? 0)).map(([key])=>key);
51
+ const oldNames = _list.map((item)=>item.name).filter(Boolean);
52
+ const addNames = (0, external_lodash_es_namespaceObject.difference)(newNames, oldNames);
53
+ const next = _list.filter((item)=>!item.name || newNames.includes(item.name)).map((item)=>({
54
+ key: item.key,
55
+ name: item.name,
56
+ isPropertyRequired: drilldownSchema?.required?.includes(item.name || '') || false,
57
+ ...drilldownSchema?.properties?.[item.name || ''] || item || {}
58
+ })).concat(addNames.map((_name)=>({
59
+ key: genId(),
60
+ name: _name,
61
+ isPropertyRequired: drilldownSchema?.required?.includes(_name) || false,
62
+ ...drilldownSchema?.properties?.[_name] || {}
63
+ })));
64
+ latestPropertyListRef.current = next;
65
+ setPropertyList(next);
64
66
  }, [
65
67
  drilldownSchema
66
68
  ]);
67
69
  const updatePropertyList = (updater)=>{
68
70
  changeVersion.current = changeVersion.current + 1;
69
- setPropertyList((_list)=>{
70
- const next = updater(_list);
71
- const nextProperties = {};
72
- const nextRequired = [];
73
- for (const _property of next)if (_property.name) {
74
- nextProperties[_property.name] = (0, external_lodash_es_namespaceObject.omit)(_property, [
75
- 'key',
76
- 'name',
77
- 'isPropertyRequired'
78
- ]);
79
- if (_property.isPropertyRequired) nextRequired.push(_property.name);
71
+ const next = updater(latestPropertyListRef.current);
72
+ latestPropertyListRef.current = next;
73
+ setPropertyList(next);
74
+ const nextProperties = {};
75
+ const nextRequired = [];
76
+ for (const _property of next)if (_property.name) {
77
+ nextProperties[_property.name] = (0, external_lodash_es_namespaceObject.omit)(_property, [
78
+ 'key',
79
+ 'name',
80
+ 'isPropertyRequired'
81
+ ]);
82
+ if (_property.isPropertyRequired) nextRequired.push(_property.name);
83
+ }
84
+ onChange?.((0, external_immer_namespaceObject.produce)(value || {}, (draft)=>{
85
+ const propertiesParent = typeManager.getPropertiesParent(draft);
86
+ if (propertiesParent) {
87
+ propertiesParent.properties = nextProperties;
88
+ propertiesParent.required = nextRequired;
89
+ return;
80
90
  }
81
- onChange?.((0, external_immer_namespaceObject.produce)(value || {}, (draft)=>{
82
- const propertiesParent = typeManager.getPropertiesParent(draft);
83
- if (propertiesParent) {
84
- propertiesParent.properties = nextProperties;
85
- propertiesParent.required = nextRequired;
86
- return;
87
- }
88
- }));
89
- return next;
90
- });
91
+ }));
91
92
  };
92
93
  const onAddProperty = ()=>{
93
- setPropertyList((_list)=>[
94
- ..._list,
95
- {
96
- key: genId(),
97
- name: '',
98
- type: 'string',
99
- extra: {
100
- index: _list.length + 1
101
- }
94
+ const _list = latestPropertyListRef.current;
95
+ const next = [
96
+ ..._list,
97
+ {
98
+ key: genId(),
99
+ name: '',
100
+ type: 'string',
101
+ extra: {
102
+ index: _list.length + 1
102
103
  }
103
- ]);
104
+ }
105
+ ];
106
+ latestPropertyListRef.current = next;
107
+ setPropertyList(next);
104
108
  };
105
109
  const onRemoveProperty = (key)=>{
106
110
  updatePropertyList((_list)=>_list.filter((_property)=>_property.key !== key));
@@ -109,7 +113,10 @@ function usePropertiesEdit(value, onChange) {
109
113
  updatePropertyList((_list)=>_list.map((_property)=>_property.key === key ? nextValue : _property));
110
114
  };
111
115
  (0, external_react_namespaceObject.useEffect)(()=>{
112
- if (!canAddField) setPropertyList([]);
116
+ if (!canAddField) {
117
+ latestPropertyListRef.current = [];
118
+ setPropertyList([]);
119
+ }
113
120
  }, [
114
121
  canAddField
115
122
  ]);
@@ -0,0 +1,70 @@
1
+ "use strict";
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
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ IconAddChildren: ()=>IconAddChildren
37
+ });
38
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
+ require("react");
40
+ const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
41
+ var semi_icons_default = /*#__PURE__*/ __webpack_require__.n(semi_icons_namespaceObject);
42
+ const iconAddChildrenSvg = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
43
+ className: "icon-icon icon-icon-coz_add_node ",
44
+ width: "1em",
45
+ height: "1em",
46
+ viewBox: "0 0 24 24",
47
+ fill: "currentColor",
48
+ xmlns: "http://www.w3.org/2000/svg",
49
+ children: [
50
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
51
+ fillRule: "evenodd",
52
+ clipRule: "evenodd",
53
+ d: "M11 6.49988C11 8.64148 9.50397 10.4337 7.49995 10.8884V15.4998C7.49995 16.0521 7.94767 16.4998 8.49995 16.4998H11.208C11.0742 16.8061 11 17.1443 11 17.4998C11 17.8554 11.0742 18.1936 11.208 18.4998H8.49995C6.8431 18.4998 5.49995 17.1567 5.49995 15.4998V10.8884C3.49599 10.4336 2 8.64145 2 6.49988C2 4.0146 4.01472 1.99988 6.5 1.99988C8.98528 1.99988 11 4.0146 11 6.49988ZM6.5 8.99988C7.88071 8.99988 9 7.88059 9 6.49988C9 5.11917 7.88071 3.99988 6.5 3.99988C5.11929 3.99988 4 5.11917 4 6.49988C4 7.88059 5.11929 8.99988 6.5 8.99988Z"
54
+ }),
55
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
56
+ d: "M17.5 12.4999C18.0523 12.4999 18.5 12.9476 18.5 13.4999V16.4999H21.5C22.0523 16.4999 22.5 16.9476 22.5 17.4999C22.5 18.0522 22.0523 18.4999 21.5 18.4999H18.5V21.4999C18.5 22.0522 18.0523 22.4999 17.5 22.4999C16.9477 22.4999 16.5 22.0522 16.5 21.4999V18.4999H13.5C12.9477 18.4999 12.5 18.0522 12.5 17.4999C12.5 16.9476 12.9477 16.4999 13.5 16.4999H16.5V13.4999C16.5 12.9476 16.9477 12.4999 17.5 12.4999Z"
57
+ })
58
+ ]
59
+ });
60
+ const IconAddChildren = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_default(), {
61
+ size: "small",
62
+ svg: iconAddChildrenSvg
63
+ });
64
+ exports.IconAddChildren = __webpack_exports__.IconAddChildren;
65
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
66
+ "IconAddChildren"
67
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
68
+ Object.defineProperty(exports, '__esModule', {
69
+ value: true
70
+ });
@@ -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 external_styles_js_namespaceObject = require("./styles.js");
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)(external_styles_js_namespaceObject.UIContainer, {
46
- className: props.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)(external_styles_js_namespaceObject.UITreeItems, {
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)(external_styles_js_namespaceObject.UITreeItemLeft, {
98
- $isLast: $isLast,
99
- $showLine: $level > 0,
100
- $showCollapse: showCollapse,
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)(external_styles_js_namespaceObject.UITreeItemRight, {
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)(external_styles_js_namespaceObject.UITreeItemMain, {
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)(external_styles_js_namespaceObject.UIRow, {
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)(external_styles_js_namespaceObject.UIName, {
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)(external_styles_js_namespaceObject.UIType, {
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)(external_styles_js_namespaceObject.UIRequired, {
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)(external_styles_js_namespaceObject.UIActions, {
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)(external_styles_js_namespaceObject.IconAddChildren, {}),
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)(external_styles_js_namespaceObject.UIExpandDetail, {
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)(external_styles_js_namespaceObject.UILabel, {
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)(external_styles_js_namespaceObject.UILabel, {
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)(external_styles_js_namespaceObject.DefaultValueWrapper, {
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)(external_styles_js_namespaceObject.UICollapsible, {
217
- $collapse: collapse,
218
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UITreeItems, {
219
- $shrink: true,
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() !== value?.content) editorRef.current?.setValue(String(value?.content || ''));
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
- value
66
+ editorValue
57
67
  ]);
58
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UIContainer, {
59
- $hasError: 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: String(value?.content),
78
+ defaultValue: editorValue,
69
79
  options: {
70
80
  readOnly: readonly,
71
81
  editable: !readonly,
@@ -0,0 +1,10 @@
1
+ .gedit-m-prompt-editor-container {
2
+ background-color: var(--semi-color-fill-0);
3
+ padding-left: 10px;
4
+ padding-right: 6px;
5
+ }
6
+
7
+ .gedit-m-prompt-editor-container.has-error {
8
+ border: 1px solid var(--semi-color-danger-6);
9
+ }
10
+
@@ -1,21 +1,5 @@
1
1
  "use strict";
2
- var __webpack_modules__ = {
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
- __webpack_require__.r(__webpack_exports__);
43
- __webpack_require__.d(__webpack_exports__, {
44
- PromptEditorWithInputs: ()=>PromptEditorWithInputs
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
- const index_js_namespaceObject = require("../../shared/index.js");
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 __webpack_modules__ = {
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
- __webpack_require__.r(__webpack_exports__);
43
- __webpack_require__.d(__webpack_exports__, {
44
- PromptEditorWithVariables: ()=>PromptEditorWithVariables
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
- const index_js_namespaceObject = require("../../shared/index.js");
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,