@flowgram.ai/form-materials 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1244,7 +1244,7 @@ function JsonSchemaEditor(props) {
1244
1244
  value,
1245
1245
  onChangeProps
1246
1246
  );
1247
- return /* @__PURE__ */ React9.createElement(UIContainer, null, /* @__PURE__ */ React9.createElement(UIProperties, null, propertyList.map((_property, index) => /* @__PURE__ */ React9.createElement(
1247
+ return /* @__PURE__ */ React9.createElement(UIContainer, { className: props.className }, /* @__PURE__ */ React9.createElement(UIProperties, null, propertyList.map((_property, index) => /* @__PURE__ */ React9.createElement(
1248
1248
  PropertyEdit,
1249
1249
  {
1250
1250
  key: _property.key,
@@ -1258,7 +1258,16 @@ function JsonSchemaEditor(props) {
1258
1258
  onRemoveProperty(_property.key);
1259
1259
  }
1260
1260
  }
1261
- ))), /* @__PURE__ */ React9.createElement(Button2, { size: "small", style: { marginTop: 10 }, icon: /* @__PURE__ */ React9.createElement(IconPlus, null), onClick: onAddProperty }, config?.addButtonText ?? "Add"));
1261
+ ))), /* @__PURE__ */ React9.createElement(
1262
+ Button2,
1263
+ {
1264
+ size: "small",
1265
+ style: { marginTop: 10, marginLeft: 16 },
1266
+ icon: /* @__PURE__ */ React9.createElement(IconPlus, null),
1267
+ onClick: onAddProperty
1268
+ },
1269
+ config?.addButtonText ?? "Add"
1270
+ ));
1262
1271
  }
1263
1272
  function PropertyEdit(props) {
1264
1273
  const {
@@ -1911,6 +1920,46 @@ function traverseRef(name, value, cb) {
1911
1920
  }
1912
1921
  return;
1913
1922
  }
1923
+
1924
+ // src/effects/provide-json-schema-outputs/index.ts
1925
+ import {
1926
+ ASTFactory as ASTFactory4,
1927
+ createEffectFromVariableProvider as createEffectFromVariableProvider3,
1928
+ getNodeForm as getNodeForm3
1929
+ } from "@flowgram.ai/editor";
1930
+ var provideJsonSchemaOutputs = createEffectFromVariableProvider3({
1931
+ parse: (value, ctx) => [
1932
+ ASTFactory4.createVariableDeclaration({
1933
+ key: `${ctx.node.id}`,
1934
+ meta: {
1935
+ title: getNodeForm3(ctx.node)?.getValueIn("title") || ctx.node.id,
1936
+ icon: ctx.node.getNodeRegistry().info?.icon
1937
+ },
1938
+ type: JsonSchemaUtils.schemaToAST(value)
1939
+ })
1940
+ ]
1941
+ });
1942
+
1943
+ // src/effects/sync-variable-title/index.ts
1944
+ import {
1945
+ DataEvent as DataEvent2,
1946
+ FlowNodeVariableData
1947
+ } from "@flowgram.ai/editor";
1948
+ var syncVariableTitle = [
1949
+ {
1950
+ event: DataEvent2.onValueChange,
1951
+ effect: ({ value, context }) => {
1952
+ context.node.getData(FlowNodeVariableData).allScopes.forEach((_scope) => {
1953
+ _scope.output.variables.forEach((_var) => {
1954
+ _var.updateMeta({
1955
+ title: value || context.node.id,
1956
+ icon: context.node.getNodeRegistry().info?.icon
1957
+ });
1958
+ });
1959
+ });
1960
+ }
1961
+ }
1962
+ ];
1914
1963
  export {
1915
1964
  ArrayIcons,
1916
1965
  BatchVariableSelector,
@@ -1933,6 +1982,8 @@ export {
1933
1982
  isNewFlowRefValueSchema,
1934
1983
  parseTypeSelectValue,
1935
1984
  provideBatchInputEffect,
1936
- provideBatchOutputsEffect
1985
+ provideBatchOutputsEffect,
1986
+ provideJsonSchemaOutputs,
1987
+ syncVariableTitle
1937
1988
  };
1938
1989
  //# sourceMappingURL=index.js.map