@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.
Files changed (208) 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 +4 -1
  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-mini/index.js +2 -16
  7. package/dist/cjs/components/condition-context/hooks/use-condition.js +17 -1
  8. package/dist/cjs/components/condition-row/index.js +26 -12
  9. package/dist/cjs/components/condition-row/styles.css +19 -0
  10. package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +2 -2
  11. package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +44 -15
  12. package/dist/{esm/components/coze-editor-extensions/styles.mjs → cjs/components/coze-editor-extensions/styles.css} +19 -18
  13. package/dist/cjs/components/db-condition-row/index.js +29 -14
  14. package/dist/cjs/components/db-condition-row/styles.css +30 -0
  15. package/dist/cjs/components/display-inputs-values/index.js +3 -2
  16. package/dist/cjs/components/display-inputs-values/styles.css +6 -0
  17. package/dist/cjs/components/display-outputs/index.js +5 -4
  18. package/dist/cjs/components/display-outputs/styles.css +6 -0
  19. package/dist/cjs/components/display-schema-tag/index.js +7 -4
  20. package/dist/cjs/components/display-schema-tag/styles.css +21 -0
  21. package/dist/cjs/components/display-schema-tree/index.js +12 -7
  22. package/dist/cjs/components/display-schema-tree/styles.css +64 -0
  23. package/dist/cjs/components/dynamic-value-input/index.js +9 -5
  24. package/dist/{esm/components/dynamic-value-input/styles.mjs → cjs/components/dynamic-value-input/styles.css} +23 -30
  25. package/dist/cjs/components/inputs-values/index.js +5 -3
  26. package/dist/cjs/components/inputs-values/styles.css +13 -0
  27. package/dist/cjs/components/inputs-values-tree/icon.js +70 -0
  28. package/dist/cjs/components/inputs-values-tree/index.js +3 -2
  29. package/dist/cjs/components/inputs-values-tree/row.js +19 -15
  30. package/dist/cjs/components/inputs-values-tree/styles.css +85 -0
  31. package/dist/cjs/components/json-schema-editor/default-value.js +2 -2
  32. package/dist/cjs/components/json-schema-editor/icon.js +70 -0
  33. package/dist/cjs/components/json-schema-editor/index.js +37 -25
  34. package/dist/cjs/components/json-schema-editor/styles.css +113 -0
  35. package/dist/cjs/components/prompt-editor/editor.js +16 -6
  36. package/dist/cjs/components/prompt-editor/styles.css +10 -0
  37. package/dist/cjs/components/prompt-editor-with-inputs/index.js +16 -26
  38. package/dist/cjs/components/prompt-editor-with-variables/index.js +17 -26
  39. package/dist/cjs/components/variable-selector/context.js +7 -3
  40. package/dist/cjs/components/variable-selector/index.js +16 -10
  41. package/dist/{esm/components/variable-selector/styles.mjs → cjs/components/variable-selector/styles.css} +37 -29
  42. package/dist/cjs/components/variable-selector/use-variable-tree.js +3 -1
  43. package/dist/cjs/effects/validate-when-variable-sync/index.js +3 -3
  44. package/dist/cjs/shared/inject-material/index.js +1 -1
  45. package/dist/esm/components/batch-outputs/index.mjs +5 -3
  46. package/dist/esm/components/batch-outputs/styles.css +13 -0
  47. package/dist/esm/components/blur-input/index.mjs +4 -1
  48. package/dist/esm/components/code-editor/editor.mjs +16 -11
  49. package/dist/esm/components/code-editor/styles.css +4 -0
  50. package/dist/esm/components/code-editor-mini/index.mjs +2 -6
  51. package/dist/esm/components/condition-context/hooks/use-condition.mjs +18 -2
  52. package/dist/esm/components/condition-row/index.mjs +26 -12
  53. package/dist/esm/components/condition-row/styles.css +19 -0
  54. package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +3 -3
  55. package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +45 -16
  56. package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
  57. package/dist/esm/components/db-condition-row/index.mjs +29 -14
  58. package/dist/esm/components/db-condition-row/styles.css +30 -0
  59. package/dist/esm/components/display-inputs-values/index.mjs +3 -2
  60. package/dist/esm/components/display-inputs-values/styles.css +6 -0
  61. package/dist/esm/components/display-outputs/index.mjs +5 -4
  62. package/dist/esm/components/display-outputs/styles.css +6 -0
  63. package/dist/esm/components/display-schema-tag/index.mjs +8 -5
  64. package/dist/esm/components/display-schema-tag/styles.css +21 -0
  65. package/dist/esm/components/display-schema-tree/index.mjs +12 -7
  66. package/dist/esm/components/display-schema-tree/styles.css +64 -0
  67. package/dist/esm/components/dynamic-value-input/index.mjs +9 -5
  68. package/dist/esm/components/dynamic-value-input/styles.css +48 -0
  69. package/dist/esm/components/inputs-values/index.mjs +5 -3
  70. package/dist/esm/components/inputs-values/styles.css +13 -0
  71. package/dist/esm/components/inputs-values-tree/icon.mjs +26 -0
  72. package/dist/esm/components/inputs-values-tree/index.mjs +3 -2
  73. package/dist/esm/components/inputs-values-tree/row.mjs +18 -14
  74. package/dist/esm/components/inputs-values-tree/styles.css +85 -0
  75. package/dist/esm/components/json-schema-editor/default-value.mjs +2 -2
  76. package/dist/esm/components/json-schema-editor/icon.mjs +26 -0
  77. package/dist/esm/components/json-schema-editor/index.mjs +36 -24
  78. package/dist/esm/components/json-schema-editor/styles.css +113 -0
  79. package/dist/esm/components/prompt-editor/editor.mjs +16 -6
  80. package/dist/esm/components/prompt-editor/styles.css +10 -0
  81. package/dist/esm/components/prompt-editor-with-inputs/index.mjs +12 -4
  82. package/dist/esm/components/prompt-editor-with-variables/index.mjs +13 -4
  83. package/dist/esm/components/variable-selector/context.mjs +7 -3
  84. package/dist/esm/components/variable-selector/index.mjs +17 -11
  85. package/{src/components/variable-selector/styles.tsx → dist/esm/components/variable-selector/styles.css} +35 -38
  86. package/dist/esm/components/variable-selector/use-variable-tree.mjs +3 -1
  87. package/dist/esm/effects/validate-when-variable-sync/index.mjs +3 -3
  88. package/dist/esm/shared/inject-material/index.mjs +1 -1
  89. package/dist/tsconfig.tsbuildinfo +1 -1
  90. package/dist/types/components/batch-outputs/index.d.ts +1 -0
  91. package/dist/types/components/code-editor/editor.d.ts +1 -0
  92. package/dist/types/components/condition-context/hooks/use-condition.d.ts +16 -1
  93. package/dist/types/components/condition-row/index.d.ts +5 -1
  94. package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +1 -0
  95. package/dist/types/components/db-condition-row/index.d.ts +4 -0
  96. package/dist/types/components/db-condition-row/types.d.ts +0 -1
  97. package/dist/types/components/display-inputs-values/index.d.ts +1 -0
  98. package/dist/types/components/display-outputs/index.d.ts +1 -0
  99. package/dist/types/components/display-schema-tag/index.d.ts +1 -0
  100. package/dist/types/components/display-schema-tree/index.d.ts +1 -0
  101. package/dist/types/components/dynamic-value-input/index.d.ts +1 -0
  102. package/dist/types/components/inputs-values/index.d.ts +1 -0
  103. package/dist/types/components/inputs-values-tree/icon.d.ts +6 -0
  104. package/dist/types/components/inputs-values-tree/index.d.ts +1 -0
  105. package/dist/types/components/inputs-values-tree/row.d.ts +1 -0
  106. package/dist/types/components/json-schema-editor/icon.d.ts +6 -0
  107. package/dist/types/components/json-schema-editor/index.d.ts +1 -0
  108. package/dist/types/components/prompt-editor/editor.d.ts +1 -0
  109. package/dist/types/components/prompt-editor-with-inputs/index.d.ts +7 -2
  110. package/dist/types/components/prompt-editor-with-variables/index.d.ts +5 -2
  111. package/dist/types/components/variable-selector/context.d.ts +16 -3
  112. package/dist/types/components/variable-selector/index.d.ts +1 -0
  113. package/package.json +7 -10
  114. package/src/components/batch-outputs/index.tsx +5 -5
  115. package/src/components/batch-outputs/{styles.tsx → styles.css} +4 -6
  116. package/src/components/blur-input/index.tsx +4 -1
  117. package/src/components/code-editor/editor.tsx +19 -14
  118. package/src/components/code-editor/styles.css +11 -0
  119. package/src/components/code-editor-mini/index.tsx +2 -9
  120. package/src/components/condition-context/hooks/use-condition.tsx +51 -7
  121. package/src/components/condition-row/index.tsx +27 -22
  122. package/src/components/condition-row/{styles.tsx → styles.css} +10 -11
  123. package/src/components/coze-editor-extensions/extensions/inputs-tree.tsx +3 -3
  124. package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +35 -22
  125. package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
  126. package/src/components/db-condition-row/index.tsx +29 -26
  127. package/src/components/db-condition-row/{styles.tsx → styles.css} +14 -16
  128. package/src/components/db-condition-row/types.ts +0 -1
  129. package/src/components/display-inputs-values/index.tsx +3 -3
  130. package/src/components/display-inputs-values/{styles.ts → styles.css} +2 -4
  131. package/src/components/display-outputs/index.tsx +5 -5
  132. package/src/components/display-outputs/{styles.ts → styles.css} +2 -4
  133. package/src/components/display-schema-tag/index.tsx +7 -7
  134. package/src/components/display-schema-tag/{styles.ts → styles.css} +7 -10
  135. package/src/components/display-schema-tree/index.tsx +10 -10
  136. package/src/components/display-schema-tree/{styles.tsx → styles.css} +18 -24
  137. package/src/components/dynamic-value-input/index.tsx +6 -6
  138. package/src/components/dynamic-value-input/{styles.tsx → styles.css} +8 -12
  139. package/src/components/inputs-values/index.tsx +5 -5
  140. package/src/components/inputs-values/{styles.tsx → styles.css} +4 -6
  141. package/src/components/inputs-values-tree/icon.tsx +28 -0
  142. package/src/components/inputs-values-tree/index.tsx +3 -3
  143. package/src/components/inputs-values-tree/row.tsx +25 -27
  144. package/src/components/inputs-values-tree/styles.css +94 -0
  145. package/src/components/json-schema-editor/default-value.tsx +2 -4
  146. package/src/components/json-schema-editor/icon.tsx +28 -0
  147. package/src/components/json-schema-editor/index.tsx +45 -50
  148. package/src/components/json-schema-editor/styles.css +135 -0
  149. package/src/components/prompt-editor/editor.tsx +18 -7
  150. package/src/components/prompt-editor/styles.css +14 -0
  151. package/src/components/prompt-editor-with-inputs/index.tsx +18 -5
  152. package/src/components/prompt-editor-with-variables/index.tsx +13 -5
  153. package/src/components/variable-selector/context.tsx +22 -2
  154. package/src/components/variable-selector/index.tsx +24 -14
  155. package/src/components/variable-selector/styles.css +70 -0
  156. package/src/components/variable-selector/use-variable-tree.tsx +9 -1
  157. package/src/effects/validate-when-variable-sync/index.ts +7 -3
  158. package/src/shared/inject-material/index.tsx +1 -1
  159. package/dist/cjs/components/batch-outputs/styles.js +0 -60
  160. package/dist/cjs/components/condition-row/styles.js +0 -78
  161. package/dist/cjs/components/coze-editor-extensions/styles.js +0 -89
  162. package/dist/cjs/components/db-condition-row/styles.js +0 -94
  163. package/dist/cjs/components/display-inputs-values/styles.js +0 -51
  164. package/dist/cjs/components/display-outputs/styles.js +0 -51
  165. package/dist/cjs/components/display-schema-tag/styles.js +0 -71
  166. package/dist/cjs/components/display-schema-tree/styles.js +0 -135
  167. package/dist/cjs/components/dynamic-value-input/styles.js +0 -108
  168. package/dist/cjs/components/inputs-values/styles.js +0 -60
  169. package/dist/cjs/components/inputs-values-tree/styles.js +0 -177
  170. package/dist/cjs/components/json-schema-editor/styles.js +0 -231
  171. package/dist/cjs/components/prompt-editor/styles.js +0 -55
  172. package/dist/cjs/components/prompt-editor-with-inputs/editor.js +0 -47
  173. package/dist/cjs/components/prompt-editor-with-variables/editor.js +0 -48
  174. package/dist/cjs/components/variable-selector/styles.js +0 -114
  175. package/dist/esm/components/batch-outputs/styles.mjs +0 -13
  176. package/dist/esm/components/condition-row/styles.mjs +0 -22
  177. package/dist/esm/components/db-condition-row/styles.mjs +0 -32
  178. package/dist/esm/components/display-inputs-values/styles.mjs +0 -7
  179. package/dist/esm/components/display-outputs/styles.mjs +0 -7
  180. package/dist/esm/components/display-schema-tag/styles.mjs +0 -21
  181. package/dist/esm/components/display-schema-tree/styles.mjs +0 -79
  182. package/dist/esm/components/inputs-values/styles.mjs +0 -13
  183. package/dist/esm/components/inputs-values-tree/styles.mjs +0 -105
  184. package/dist/esm/components/json-schema-editor/styles.mjs +0 -138
  185. package/dist/esm/components/prompt-editor/styles.mjs +0 -11
  186. package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +0 -13
  187. package/dist/esm/components/prompt-editor-with-variables/editor.mjs +0 -14
  188. package/dist/types/components/batch-outputs/styles.d.ts +0 -6
  189. package/dist/types/components/condition-row/styles.d.ts +0 -9
  190. package/dist/types/components/coze-editor-extensions/styles.d.ts +0 -9
  191. package/dist/types/components/db-condition-row/styles.d.ts +0 -12
  192. package/dist/types/components/display-inputs-values/styles.d.ts +0 -5
  193. package/dist/types/components/display-outputs/styles.d.ts +0 -5
  194. package/dist/types/components/display-schema-tag/styles.d.ts +0 -8
  195. package/dist/types/components/display-schema-tree/styles.d.ts +0 -11
  196. package/dist/types/components/dynamic-value-input/styles.d.ts +0 -8
  197. package/dist/types/components/inputs-values/styles.d.ts +0 -6
  198. package/dist/types/components/inputs-values-tree/styles.d.ts +0 -23
  199. package/dist/types/components/json-schema-editor/styles.d.ts +0 -30
  200. package/dist/types/components/prompt-editor/styles.d.ts +0 -7
  201. package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +0 -11
  202. package/dist/types/components/prompt-editor-with-variables/editor.d.ts +0 -9
  203. package/dist/types/components/variable-selector/styles.d.ts +0 -14
  204. package/src/components/inputs-values-tree/styles.tsx +0 -128
  205. package/src/components/json-schema-editor/styles.tsx +0 -168
  206. package/src/components/prompt-editor/styles.tsx +0 -18
  207. package/src/components/prompt-editor-with-inputs/editor.tsx +0 -25
  208. package/src/components/prompt-editor-with-variables/editor.tsx +0 -20
@@ -1,29 +1,32 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import react from "react";
3
- import { Popover } from "@douyinfe/semi-ui";
3
+ import { Popover, Tag } from "@douyinfe/semi-ui";
4
4
  import { useTypeManager } from "../../plugins/index.mjs";
5
5
  import { DisplaySchemaTree } from "../display-schema-tree/index.mjs";
6
- import { PopoverContent, StyledTag, TitleSpan } from "./styles.mjs";
6
+ import "./styles.css";
7
7
  function DisplaySchemaTag({ value = {}, showIconInTree, title, warning }) {
8
8
  const typeManager = useTypeManager();
9
9
  const icon = typeManager?.getDisplayIcon(value) || typeManager.getDisplayIcon({
10
10
  type: 'unknown'
11
11
  });
12
12
  return /*#__PURE__*/ jsx(Popover, {
13
- content: /*#__PURE__*/ jsx(PopoverContent, {
13
+ content: /*#__PURE__*/ jsx("div", {
14
+ className: "gedit-m-display-schema-tag-popover-content",
14
15
  children: /*#__PURE__*/ jsx(DisplaySchemaTree, {
15
16
  value: value,
16
17
  typeManager: typeManager,
17
18
  showIcon: showIconInTree
18
19
  })
19
20
  }),
20
- children: /*#__PURE__*/ jsxs(StyledTag, {
21
+ children: /*#__PURE__*/ jsxs(Tag, {
21
22
  color: warning ? 'amber' : 'white',
23
+ className: "gedit-m-display-schema-tag-tag",
22
24
  children: [
23
25
  icon && /*#__PURE__*/ react.cloneElement(icon, {
24
26
  className: 'tag-icon'
25
27
  }),
26
- title && /*#__PURE__*/ jsx(TitleSpan, {
28
+ title && /*#__PURE__*/ jsx("span", {
29
+ className: "gedit-m-display-schema-tag-title",
27
30
  children: title
28
31
  })
29
32
  ]
@@ -0,0 +1,21 @@
1
+ .gedit-m-display-schema-tag-popover-content {
2
+ padding: 10px;
3
+ }
4
+
5
+ .gedit-m-display-schema-tag-tag {
6
+ padding: 4px;
7
+
8
+ & .tag-icon {
9
+ width: 12px;
10
+ height: 12px;
11
+ }
12
+ }
13
+
14
+ .gedit-m-display-schema-tag-title {
15
+ text-overflow: ellipsis;
16
+ margin-top: -1px;
17
+ margin-left: 4px;
18
+ display: inline-block;
19
+ overflow: hidden;
20
+ }
21
+
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import react from "react";
3
3
  import { useTypeManager } from "@flowgram.ai/json-schema";
4
- import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from "./styles.mjs";
4
+ import "./styles.css";
5
5
  function DisplaySchemaTree(props) {
6
6
  return /*#__PURE__*/ jsx(SchemaTree, {
7
7
  ...props
@@ -15,16 +15,20 @@ function SchemaTree(props) {
15
15
  const icon = typeManager?.getDisplayIcon(schema);
16
16
  let properties = drilldown && config ? config.getTypeSchemaProperties(schema) : {};
17
17
  const childEntries = Object.entries(properties || {});
18
- return /*#__PURE__*/ jsxs(TreeItem, {
19
- depth: depth,
18
+ return /*#__PURE__*/ jsxs("div", {
19
+ className: `gedit-m-display-schema-tree-item depth-${depth}`,
20
20
  children: [
21
- /*#__PURE__*/ jsxs(TreeRow, {
21
+ /*#__PURE__*/ jsxs("div", {
22
+ className: "gedit-m-display-schema-tree-row",
22
23
  children: [
23
- 0 !== depth && /*#__PURE__*/ jsx(HorizontalLine, {}),
24
+ 0 !== depth && /*#__PURE__*/ jsx("div", {
25
+ className: "gedit-m-display-schema-tree-horizontal-line"
26
+ }),
24
27
  showIcon && icon && /*#__PURE__*/ react.cloneElement(icon, {
25
28
  className: 'tree-icon'
26
29
  }),
27
- /*#__PURE__*/ jsx(TreeTitle, {
30
+ /*#__PURE__*/ jsx("div", {
31
+ className: "gedit-m-display-schema-tree-title",
28
32
  children: parentKey ? /*#__PURE__*/ jsxs(Fragment, {
29
33
  children: [
30
34
  `${parentKey} (`,
@@ -35,7 +39,8 @@ function SchemaTree(props) {
35
39
  })
36
40
  ]
37
41
  }),
38
- childEntries?.length ? /*#__PURE__*/ jsx(TreeLevel, {
42
+ childEntries?.length ? /*#__PURE__*/ jsx("div", {
43
+ className: "gedit-m-display-schema-tree-level",
39
44
  children: childEntries.map(([key, value])=>/*#__PURE__*/ jsx(SchemaTree, {
40
45
  ...props,
41
46
  parentKey: key,
@@ -0,0 +1,64 @@
1
+ .gedit-m-display-schema-tree-row {
2
+ align-items: center;
3
+ display: flex;
4
+
5
+ & .tree-icon {
6
+ width: 14px;
7
+ height: 14px;
8
+ margin-right: 8px;
9
+ }
10
+
11
+ white-space: nowrap;
12
+ height: 27px;
13
+ }
14
+
15
+ .gedit-m-display-schema-tree-horizontal-line {
16
+ position: relative;
17
+
18
+ &:before, &:after {
19
+ content: "";
20
+ background-color: var(--semi-color-text-3);
21
+ position: absolute;
22
+ }
23
+
24
+ &:after {
25
+ width: 15px;
26
+ height: 1px;
27
+ top: 0;
28
+ right: 6px;
29
+ }
30
+ }
31
+
32
+ .gedit-m-display-schema-tree-level {
33
+ padding-left: 30px;
34
+ position: relative;
35
+ }
36
+
37
+ .gedit-m-display-schema-tree-item {
38
+ position: relative;
39
+
40
+ &:before {
41
+ content: "";
42
+ background-color: var(--semi-color-text-3);
43
+ position: absolute;
44
+ }
45
+
46
+ &:not(:last-child):before {
47
+ width: 1px;
48
+ top: 0;
49
+ bottom: 0;
50
+ left: -22px;
51
+ }
52
+
53
+ &:last-child:before {
54
+ width: 1px;
55
+ height: 14px;
56
+ top: 0;
57
+ left: -22px;
58
+ }
59
+
60
+ &.depth-0:before {
61
+ width: 0 !important;
62
+ }
63
+ }
64
+
@@ -7,7 +7,7 @@ import { createInjectMaterial } from "../../shared/index.mjs";
7
7
  import { InjectVariableSelector } from "../variable-selector/index.mjs";
8
8
  import { TypeSelector } from "../type-selector/index.mjs";
9
9
  import { ConstantInput } from "../constant-input/index.mjs";
10
- import { UIContainer, UIMain, UITrigger, UIType } from "./styles.mjs";
10
+ import "./styles.css";
11
11
  import { useIncludeSchema, useRefVariable, useSelectSchema } from "./hooks.mjs";
12
12
  const DEFAULT_VALUE = {
13
13
  type: 'constant',
@@ -117,16 +117,20 @@ function DynamicValueInput({ value, onChange, readonly, style, schema: schemaFro
117
117
  })
118
118
  })
119
119
  });
120
- return /*#__PURE__*/ jsxs(UIContainer, {
120
+ return /*#__PURE__*/ jsxs("div", {
121
+ className: "gedit-m-dynamic-value-input-container",
121
122
  style: style,
122
123
  children: [
123
- /*#__PURE__*/ jsx(UIType, {
124
+ /*#__PURE__*/ jsx("div", {
125
+ className: "gedit-m-dynamic-value-input-type",
124
126
  children: renderTypeSelector()
125
127
  }),
126
- /*#__PURE__*/ jsx(UIMain, {
128
+ /*#__PURE__*/ jsx("div", {
129
+ className: "gedit-m-dynamic-value-input-main",
127
130
  children: renderMain()
128
131
  }),
129
- /*#__PURE__*/ jsx(UITrigger, {
132
+ /*#__PURE__*/ jsx("div", {
133
+ className: "gedit-m-dynamic-value-input-trigger",
130
134
  children: renderTrigger()
131
135
  })
132
136
  ]
@@ -0,0 +1,48 @@
1
+ .gedit-m-dynamic-value-input-container {
2
+ border: 1px solid var(--semi-color-border);
3
+ background-color: var(--semi-color-fill-0);
4
+ border-radius: 4px;
5
+ align-items: center;
6
+ line-height: normal;
7
+ display: flex;
8
+ overflow: hidden;
9
+ }
10
+
11
+ .gedit-m-dynamic-value-input-main {
12
+ border-left: 1px solid var(--semi-color-border);
13
+ border-right: 1px solid var(--semi-color-border);
14
+ flex-grow: 1;
15
+ min-width: 0;
16
+ overflow: hidden;
17
+
18
+ & .semi-tree-select, & .semi-input-number, & .semi-select {
19
+ border: none;
20
+ border-radius: 0;
21
+ width: 100%;
22
+ }
23
+
24
+ & .semi-input-wrapper, & .semi-input-textarea-wrapper {
25
+ border: none;
26
+ border-radius: 0;
27
+ }
28
+
29
+ & .semi-input-textarea {
30
+ word-break: break-all;
31
+ border: none;
32
+ border-radius: 0;
33
+ padding: 2px 6px;
34
+ }
35
+ }
36
+
37
+ .gedit-m-dynamic-value-input-type {
38
+ & .semi-button {
39
+ border-radius: 0;
40
+ }
41
+ }
42
+
43
+ .gedit-m-dynamic-value-input-trigger {
44
+ & .semi-button {
45
+ border-radius: 0;
46
+ }
47
+ }
48
+
@@ -6,7 +6,7 @@ import { IconDelete, IconPlus } from "@douyinfe/semi-icons";
6
6
  import { useObjectList } from "../../hooks/index.mjs";
7
7
  import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
8
8
  import { BlurInput } from "../blur-input/index.mjs";
9
- import { UIRow, UIRows } from "./styles.mjs";
9
+ import "./styles.css";
10
10
  function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError }) {
11
11
  const { list, updateKey, updateValue, remove, add } = useObjectList({
12
12
  value,
@@ -15,9 +15,11 @@ function InputsValues({ value, onChange, style, readonly, constantProps, schema,
15
15
  });
16
16
  return /*#__PURE__*/ jsxs("div", {
17
17
  children: [
18
- /*#__PURE__*/ jsx(UIRows, {
18
+ /*#__PURE__*/ jsx("div", {
19
+ className: "gedit-m-inputs-values-rows",
19
20
  style: style,
20
- children: list.map((item)=>/*#__PURE__*/ jsxs(UIRow, {
21
+ children: list.map((item)=>/*#__PURE__*/ jsxs("div", {
22
+ className: "gedit-m-inputs-values-row",
21
23
  children: [
22
24
  /*#__PURE__*/ jsx(BlurInput, {
23
25
  style: {
@@ -0,0 +1,13 @@
1
+ .gedit-m-inputs-values-rows {
2
+ flex-direction: column;
3
+ gap: 10px;
4
+ margin-bottom: 10px;
5
+ display: flex;
6
+ }
7
+
8
+ .gedit-m-inputs-values-row {
9
+ align-items: flex-start;
10
+ gap: 5px;
11
+ display: flex;
12
+ }
13
+
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import semi_icons from "@douyinfe/semi-icons";
4
+ const iconAddChildrenSvg = /*#__PURE__*/ jsxs("svg", {
5
+ className: "icon-icon icon-icon-coz_add_node ",
6
+ width: "1em",
7
+ height: "1em",
8
+ viewBox: "0 0 24 24",
9
+ fill: "currentColor",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ children: [
12
+ /*#__PURE__*/ jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M11 6.49988C11 8.64148 9.50397 10.4337 7.49995 10.8884V15.4998C7.49995 16.0521 7.94767 16.4998 8.49995 16.4998H11.208C11.0742 16.8061 11 17.1443 11 17.4998C11 17.8554 11.0742 18.1936 11.208 18.4998H8.49995C6.8431 18.4998 5.49995 17.1567 5.49995 15.4998V10.8884C3.49599 10.4336 2 8.64145 2 6.49988C2 4.0146 4.01472 1.99988 6.5 1.99988C8.98528 1.99988 11 4.0146 11 6.49988ZM6.5 8.99988C7.88071 8.99988 9 7.88059 9 6.49988C9 5.11917 7.88071 3.99988 6.5 3.99988C5.11929 3.99988 4 5.11917 4 6.49988C4 7.88059 5.11929 8.99988 6.5 8.99988Z"
16
+ }),
17
+ /*#__PURE__*/ jsx("path", {
18
+ d: "M17.5 12.4999C18.0523 12.4999 18.5 12.9476 18.5 13.4999V16.4999H21.5C22.0523 16.4999 22.5 16.9476 22.5 17.4999C22.5 18.0522 22.0523 18.4999 21.5 18.4999H18.5V21.4999C18.5 22.0522 18.0523 22.4999 17.5 22.4999C16.9477 22.4999 16.5 22.0522 16.5 21.4999V18.4999H13.5C12.9477 18.4999 12.5 18.0522 12.5 17.4999C12.5 16.9476 12.9477 16.4999 13.5 16.4999H16.5V13.4999C16.5 12.9476 16.9477 12.4999 17.5 12.4999Z"
19
+ })
20
+ ]
21
+ });
22
+ const IconAddChildren = ()=>/*#__PURE__*/ jsx(semi_icons, {
23
+ size: "small",
24
+ svg: iconAddChildrenSvg
25
+ });
26
+ export { IconAddChildren };
@@ -5,7 +5,7 @@ import { Button } from "@douyinfe/semi-ui";
5
5
  import { IconPlus } from "@douyinfe/semi-icons";
6
6
  import { FlowValueUtils } from "../../shared/index.mjs";
7
7
  import { useObjectList } from "../../hooks/index.mjs";
8
- import { UITreeItems } from "./styles.mjs";
8
+ import "./styles.css";
9
9
  import { InputValueRow } from "./row.mjs";
10
10
  function InputsValuesTree(props) {
11
11
  const { value, onChange, readonly, hasError, constantProps } = props;
@@ -16,7 +16,8 @@ function InputsValuesTree(props) {
16
16
  });
17
17
  return /*#__PURE__*/ jsxs("div", {
18
18
  children: [
19
- /*#__PURE__*/ jsx(UITreeItems, {
19
+ /*#__PURE__*/ jsx("div", {
20
+ className: "gedit-m-inputs-values-tree-tree-items",
20
21
  children: list.map((item)=>/*#__PURE__*/ jsx(InputValueRow, {
21
22
  keyName: item.key,
22
23
  value: item.value,
@@ -3,10 +3,11 @@ import { useMemo, useState } from "react";
3
3
  import { I18n } from "@flowgram.ai/editor";
4
4
  import { IconButton, Input } from "@douyinfe/semi-ui";
5
5
  import { IconChevronDown, IconChevronRight, IconDelete } from "@douyinfe/semi-icons";
6
- import { IconAddChildren, UIActions, UICollapseTrigger, UICollapsible, UIRow, UITreeItemLeft, UITreeItemMain, UITreeItemRight, UITreeItems } from "./styles.mjs";
6
+ import "./styles.css";
7
7
  import { useChildList } from "./hooks/use-child-list.mjs";
8
8
  import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
9
9
  import { BlurInput } from "../blur-input/index.mjs";
10
+ import { IconAddChildren } from "./icon.mjs";
10
11
  const AddObjectChildStrategy = {
11
12
  hit: (schema)=>'object' === schema.type,
12
13
  Renderer: ()=>/*#__PURE__*/ jsx(Input, {
@@ -42,11 +43,10 @@ function InputValueRow(props) {
42
43
  ]);
43
44
  return /*#__PURE__*/ jsxs(Fragment, {
44
45
  children: [
45
- /*#__PURE__*/ jsx(UITreeItemLeft, {
46
- $isLast: $isLast,
47
- $showLine: $level > 0,
48
- $showCollapse: hasChildren,
49
- children: hasChildren && /*#__PURE__*/ jsx(UICollapseTrigger, {
46
+ /*#__PURE__*/ jsx("div", {
47
+ className: `gedit-m-inputs-values-tree-tree-item-left ${$level > 0 ? 'show-line' : ''} ${$isLast ? 'is-last' : ''} ${hasChildren ? 'show-collapse' : ''}`,
48
+ children: hasChildren && /*#__PURE__*/ jsx("div", {
49
+ className: "gedit-m-inputs-values-tree-collapse-trigger",
50
50
  onClick: ()=>setCollapse((_collapse)=>!_collapse),
51
51
  children: collapse ? /*#__PURE__*/ jsx(IconChevronDown, {
52
52
  size: "small"
@@ -55,10 +55,13 @@ function InputValueRow(props) {
55
55
  })
56
56
  })
57
57
  }),
58
- /*#__PURE__*/ jsxs(UITreeItemRight, {
58
+ /*#__PURE__*/ jsxs("div", {
59
+ className: "gedit-m-inputs-values-tree-tree-item-right",
59
60
  children: [
60
- /*#__PURE__*/ jsx(UITreeItemMain, {
61
- children: /*#__PURE__*/ jsxs(UIRow, {
61
+ /*#__PURE__*/ jsx("div", {
62
+ className: "gedit-m-inputs-values-tree-tree-item-main",
63
+ children: /*#__PURE__*/ jsxs("div", {
64
+ className: "gedit-m-inputs-values-tree-row",
62
65
  children: [
63
66
  /*#__PURE__*/ jsx(BlurInput, {
64
67
  style: {
@@ -85,7 +88,8 @@ function InputValueRow(props) {
85
88
  strategies
86
89
  }
87
90
  }),
88
- /*#__PURE__*/ jsxs(UIActions, {
91
+ /*#__PURE__*/ jsxs("div", {
92
+ className: "gedit-m-inputs-values-tree-actions",
89
93
  children: [
90
94
  canAddField && /*#__PURE__*/ jsx(IconButton, {
91
95
  disabled: readonly,
@@ -117,10 +121,10 @@ function InputValueRow(props) {
117
121
  ]
118
122
  })
119
123
  }),
120
- hasChildren && /*#__PURE__*/ jsx(UICollapsible, {
121
- $collapse: collapse,
122
- children: /*#__PURE__*/ jsx(UITreeItems, {
123
- $shrink: true,
124
+ hasChildren && /*#__PURE__*/ jsx("div", {
125
+ className: `gedit-m-inputs-values-tree-collapsible ${collapse ? 'collapse' : ''}`,
126
+ children: /*#__PURE__*/ jsx("div", {
127
+ className: "gedit-m-inputs-values-tree-tree-items shrink",
124
128
  children: list.map((_item, index)=>/*#__PURE__*/ jsx(InputValueRow, {
125
129
  readonly: readonly,
126
130
  hasError: hasError,
@@ -0,0 +1,85 @@
1
+ .gedit-m-inputs-values-tree-row {
2
+ align-items: flex-start;
3
+ gap: 5px;
4
+ display: flex;
5
+ }
6
+
7
+ .gedit-m-inputs-values-tree-collapse-trigger {
8
+ cursor: pointer;
9
+ margin-right: 5px;
10
+ }
11
+
12
+ .gedit-m-inputs-values-tree-tree-items {
13
+ grid-template-columns: auto 1fr;
14
+ display: grid;
15
+ }
16
+
17
+ .gedit-m-inputs-values-tree-tree-items.shrink {
18
+ margin-top: 10px;
19
+ padding-left: 3px;
20
+ }
21
+
22
+ .gedit-m-inputs-values-tree-tree-item-left {
23
+ grid-column: 1;
24
+ width: 16px;
25
+ position: relative;
26
+ }
27
+
28
+ .gedit-m-inputs-values-tree-tree-item-left.show-line:before {
29
+ content: "";
30
+ height: var(--line-height, 100%);
31
+ background: #d9d9d9;
32
+ width: 1px;
33
+ display: block;
34
+ position: absolute;
35
+ top: -16px;
36
+ left: -14px;
37
+ }
38
+
39
+ .gedit-m-inputs-values-tree-tree-item-left.show-line:after {
40
+ content: "";
41
+ width: var(--line-width, 30px);
42
+ background: #d9d9d9;
43
+ height: 1px;
44
+ display: block;
45
+ position: absolute;
46
+ top: 8px;
47
+ left: -14px;
48
+ }
49
+
50
+ .gedit-m-inputs-values-tree-tree-item-left.show-line.is-last:before {
51
+ height: 24px;
52
+ }
53
+
54
+ .gedit-m-inputs-values-tree-tree-item-left.show-line.show-collapse:after {
55
+ width: 12px;
56
+ }
57
+
58
+ .gedit-m-inputs-values-tree-tree-item-right {
59
+ grid-column: 2;
60
+ margin-bottom: 10px;
61
+
62
+ &:last-child {
63
+ margin-bottom: 0;
64
+ }
65
+ }
66
+
67
+ .gedit-m-inputs-values-tree-tree-item-main {
68
+ flex-direction: column;
69
+ gap: 10px;
70
+ display: flex;
71
+ position: relative;
72
+ }
73
+
74
+ .gedit-m-inputs-values-tree-collapsible {
75
+ display: none;
76
+ }
77
+
78
+ .gedit-m-inputs-values-tree-collapsible.collapse {
79
+ display: block;
80
+ }
81
+
82
+ .gedit-m-inputs-values-tree-actions {
83
+ white-space: nowrap;
84
+ }
85
+
@@ -2,10 +2,10 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { I18n } from "@flowgram.ai/editor";
4
4
  import { ConstantInput } from "../constant-input/index.mjs";
5
- import { ConstantInputWrapper } from "./styles.mjs";
6
5
  function DefaultValue(props) {
7
6
  const { value, schema, onChange, placeholder } = props;
8
- return /*#__PURE__*/ jsx(ConstantInputWrapper, {
7
+ return /*#__PURE__*/ jsx("div", {
8
+ className: "gedit-m-json-schema-editor-constant-input-wrapper",
9
9
  children: /*#__PURE__*/ jsx(ConstantInput, {
10
10
  value: value,
11
11
  onChange: (_v)=>onChange(_v),
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import semi_icons from "@douyinfe/semi-icons";
4
+ const iconAddChildrenSvg = /*#__PURE__*/ jsxs("svg", {
5
+ className: "icon-icon icon-icon-coz_add_node ",
6
+ width: "1em",
7
+ height: "1em",
8
+ viewBox: "0 0 24 24",
9
+ fill: "currentColor",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ children: [
12
+ /*#__PURE__*/ jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M11 6.49988C11 8.64148 9.50397 10.4337 7.49995 10.8884V15.4998C7.49995 16.0521 7.94767 16.4998 8.49995 16.4998H11.208C11.0742 16.8061 11 17.1443 11 17.4998C11 17.8554 11.0742 18.1936 11.208 18.4998H8.49995C6.8431 18.4998 5.49995 17.1567 5.49995 15.4998V10.8884C3.49599 10.4336 2 8.64145 2 6.49988C2 4.0146 4.01472 1.99988 6.5 1.99988C8.98528 1.99988 11 4.0146 11 6.49988ZM6.5 8.99988C7.88071 8.99988 9 7.88059 9 6.49988C9 5.11917 7.88071 3.99988 6.5 3.99988C5.11929 3.99988 4 5.11917 4 6.49988C4 7.88059 5.11929 8.99988 6.5 8.99988Z"
16
+ }),
17
+ /*#__PURE__*/ jsx("path", {
18
+ d: "M17.5 12.4999C18.0523 12.4999 18.5 12.9476 18.5 13.4999V16.4999H21.5C22.0523 16.4999 22.5 16.9476 22.5 17.4999C22.5 18.0522 22.0523 18.4999 21.5 18.4999H18.5V21.4999C18.5 22.0522 18.0523 22.4999 17.5 22.4999C16.9477 22.4999 16.5 22.0522 16.5 21.4999V18.4999H13.5C12.9477 18.4999 12.5 18.0522 12.5 17.4999C12.5 16.9476 12.9477 16.4999 13.5 16.4999H16.5V13.4999C16.5 12.9476 16.9477 12.4999 17.5 12.4999Z"
19
+ })
20
+ ]
21
+ });
22
+ const IconAddChildren = ()=>/*#__PURE__*/ jsx(semi_icons, {
23
+ size: "small",
24
+ svg: iconAddChildrenSvg
25
+ });
26
+ export { IconAddChildren };