@flowgram.ai/form-materials 0.2.14 → 0.2.16
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 +54 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +50 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/condition-row/index.tsx +1 -1
- package/src/components/json-schema-editor/index.tsx +8 -2
- package/src/effects/index.ts +2 -0
- package/src/effects/provide-json-schema-outputs/config.json +8 -0
- package/src/effects/provide-json-schema-outputs/index.ts +23 -0
- package/src/effects/sync-variable-title/config.json +5 -0
- package/src/effects/sync-variable-title/index.ts +23 -0
package/dist/index.d.mts
CHANGED
|
@@ -91,6 +91,7 @@ declare function JsonSchemaEditor(props: {
|
|
|
91
91
|
value?: IJsonSchema;
|
|
92
92
|
onChange?: (value: IJsonSchema) => void;
|
|
93
93
|
config?: ConfigType;
|
|
94
|
+
className?: string;
|
|
94
95
|
}): React$1.JSX.Element;
|
|
95
96
|
|
|
96
97
|
declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JSX.Element;
|
|
@@ -173,6 +174,10 @@ declare const provideBatchOutputsEffect: EffectOptions[];
|
|
|
173
174
|
*/
|
|
174
175
|
declare const autoRenameRefEffect: EffectOptions[];
|
|
175
176
|
|
|
177
|
+
declare const provideJsonSchemaOutputs: EffectOptions[];
|
|
178
|
+
|
|
179
|
+
declare const syncVariableTitle: EffectOptions[];
|
|
180
|
+
|
|
176
181
|
interface LegacyFlowRefValueSchema {
|
|
177
182
|
type: 'ref';
|
|
178
183
|
content: string;
|
|
@@ -282,4 +287,4 @@ declare namespace JsonSchemaUtils {
|
|
|
282
287
|
function isASTMatchSchema(typeAST: BaseType, schema: IJsonSchema | IJsonSchema[]): boolean;
|
|
283
288
|
}
|
|
284
289
|
|
|
285
|
-
export { ArrayIcons, BatchVariableSelector, ConditionRow, type ConditionRowValueType, ConstantInput, DynamicValueInput, type IBasicJsonSchema, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IJsonSchema, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect };
|
|
290
|
+
export { ArrayIcons, BatchVariableSelector, ConditionRow, type ConditionRowValueType, ConstantInput, DynamicValueInput, type IBasicJsonSchema, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IJsonSchema, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle };
|
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ declare function JsonSchemaEditor(props: {
|
|
|
91
91
|
value?: IJsonSchema;
|
|
92
92
|
onChange?: (value: IJsonSchema) => void;
|
|
93
93
|
config?: ConfigType;
|
|
94
|
+
className?: string;
|
|
94
95
|
}): React$1.JSX.Element;
|
|
95
96
|
|
|
96
97
|
declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JSX.Element;
|
|
@@ -173,6 +174,10 @@ declare const provideBatchOutputsEffect: EffectOptions[];
|
|
|
173
174
|
*/
|
|
174
175
|
declare const autoRenameRefEffect: EffectOptions[];
|
|
175
176
|
|
|
177
|
+
declare const provideJsonSchemaOutputs: EffectOptions[];
|
|
178
|
+
|
|
179
|
+
declare const syncVariableTitle: EffectOptions[];
|
|
180
|
+
|
|
176
181
|
interface LegacyFlowRefValueSchema {
|
|
177
182
|
type: 'ref';
|
|
178
183
|
content: string;
|
|
@@ -282,4 +287,4 @@ declare namespace JsonSchemaUtils {
|
|
|
282
287
|
function isASTMatchSchema(typeAST: BaseType, schema: IJsonSchema | IJsonSchema[]): boolean;
|
|
283
288
|
}
|
|
284
289
|
|
|
285
|
-
export { ArrayIcons, BatchVariableSelector, ConditionRow, type ConditionRowValueType, ConstantInput, DynamicValueInput, type IBasicJsonSchema, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IJsonSchema, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect };
|
|
290
|
+
export { ArrayIcons, BatchVariableSelector, ConditionRow, type ConditionRowValueType, ConstantInput, DynamicValueInput, type IBasicJsonSchema, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IJsonSchema, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle };
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,9 @@ __export(src_exports, {
|
|
|
51
51
|
isNewFlowRefValueSchema: () => isNewFlowRefValueSchema,
|
|
52
52
|
parseTypeSelectValue: () => parseTypeSelectValue,
|
|
53
53
|
provideBatchInputEffect: () => provideBatchInputEffect,
|
|
54
|
-
provideBatchOutputsEffect: () => provideBatchOutputsEffect
|
|
54
|
+
provideBatchOutputsEffect: () => provideBatchOutputsEffect,
|
|
55
|
+
provideJsonSchemaOutputs: () => provideJsonSchemaOutputs,
|
|
56
|
+
syncVariableTitle: () => syncVariableTitle
|
|
55
57
|
});
|
|
56
58
|
module.exports = __toCommonJS(src_exports);
|
|
57
59
|
|
|
@@ -1294,7 +1296,7 @@ function JsonSchemaEditor(props) {
|
|
|
1294
1296
|
value,
|
|
1295
1297
|
onChangeProps
|
|
1296
1298
|
);
|
|
1297
|
-
return /* @__PURE__ */ import_react10.default.createElement(UIContainer,
|
|
1299
|
+
return /* @__PURE__ */ import_react10.default.createElement(UIContainer, { className: props.className }, /* @__PURE__ */ import_react10.default.createElement(UIProperties, null, propertyList.map((_property, index) => /* @__PURE__ */ import_react10.default.createElement(
|
|
1298
1300
|
PropertyEdit,
|
|
1299
1301
|
{
|
|
1300
1302
|
key: _property.key,
|
|
@@ -1308,7 +1310,16 @@ function JsonSchemaEditor(props) {
|
|
|
1308
1310
|
onRemoveProperty(_property.key);
|
|
1309
1311
|
}
|
|
1310
1312
|
}
|
|
1311
|
-
))), /* @__PURE__ */ import_react10.default.createElement(
|
|
1313
|
+
))), /* @__PURE__ */ import_react10.default.createElement(
|
|
1314
|
+
import_semi_ui6.Button,
|
|
1315
|
+
{
|
|
1316
|
+
size: "small",
|
|
1317
|
+
style: { marginTop: 10, marginLeft: 16 },
|
|
1318
|
+
icon: /* @__PURE__ */ import_react10.default.createElement(import_semi_icons5.IconPlus, null),
|
|
1319
|
+
onClick: onAddProperty
|
|
1320
|
+
},
|
|
1321
|
+
config?.addButtonText ?? "Add"
|
|
1322
|
+
));
|
|
1312
1323
|
}
|
|
1313
1324
|
function PropertyEdit(props) {
|
|
1314
1325
|
const {
|
|
@@ -1950,6 +1961,39 @@ function traverseRef(name, value, cb) {
|
|
|
1950
1961
|
}
|
|
1951
1962
|
return;
|
|
1952
1963
|
}
|
|
1964
|
+
|
|
1965
|
+
// src/effects/provide-json-schema-outputs/index.ts
|
|
1966
|
+
var import_editor8 = require("@flowgram.ai/editor");
|
|
1967
|
+
var provideJsonSchemaOutputs = (0, import_editor8.createEffectFromVariableProvider)({
|
|
1968
|
+
parse: (value, ctx) => [
|
|
1969
|
+
import_editor8.ASTFactory.createVariableDeclaration({
|
|
1970
|
+
key: `${ctx.node.id}`,
|
|
1971
|
+
meta: {
|
|
1972
|
+
title: (0, import_editor8.getNodeForm)(ctx.node)?.getValueIn("title") || ctx.node.id,
|
|
1973
|
+
icon: ctx.node.getNodeRegistry().info?.icon
|
|
1974
|
+
},
|
|
1975
|
+
type: JsonSchemaUtils.schemaToAST(value)
|
|
1976
|
+
})
|
|
1977
|
+
]
|
|
1978
|
+
});
|
|
1979
|
+
|
|
1980
|
+
// src/effects/sync-variable-title/index.ts
|
|
1981
|
+
var import_editor9 = require("@flowgram.ai/editor");
|
|
1982
|
+
var syncVariableTitle = [
|
|
1983
|
+
{
|
|
1984
|
+
event: import_editor9.DataEvent.onValueChange,
|
|
1985
|
+
effect: ({ value, context }) => {
|
|
1986
|
+
context.node.getData(import_editor9.FlowNodeVariableData).allScopes.forEach((_scope) => {
|
|
1987
|
+
_scope.output.variables.forEach((_var) => {
|
|
1988
|
+
_var.updateMeta({
|
|
1989
|
+
title: value || context.node.id,
|
|
1990
|
+
icon: context.node.getNodeRegistry().info?.icon
|
|
1991
|
+
});
|
|
1992
|
+
});
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
];
|
|
1953
1997
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1954
1998
|
0 && (module.exports = {
|
|
1955
1999
|
ArrayIcons,
|
|
@@ -1973,6 +2017,8 @@ function traverseRef(name, value, cb) {
|
|
|
1973
2017
|
isNewFlowRefValueSchema,
|
|
1974
2018
|
parseTypeSelectValue,
|
|
1975
2019
|
provideBatchInputEffect,
|
|
1976
|
-
provideBatchOutputsEffect
|
|
2020
|
+
provideBatchOutputsEffect,
|
|
2021
|
+
provideJsonSchemaOutputs,
|
|
2022
|
+
syncVariableTitle
|
|
1977
2023
|
});
|
|
1978
2024
|
//# sourceMappingURL=index.js.map
|