@flowgram.ai/form-materials 0.4.11 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/display-schema-tree/index.js +2 -2
- package/dist/cjs/components/type-selector/index.js +2 -2
- package/dist/cjs/components/variable-selector/use-variable-tree.js +1 -2
- package/dist/cjs/plugins/json-schema-preset/index.js +3 -13
- package/dist/cjs/plugins/json-schema-preset/react.js +50 -0
- package/dist/esm/components/display-schema-tree/index.mjs +1 -1
- package/dist/esm/components/type-selector/index.mjs +1 -1
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +1 -2
- package/dist/esm/plugins/json-schema-preset/index.mjs +3 -13
- package/dist/esm/plugins/json-schema-preset/react.mjs +13 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/display-schema-tree/index.d.ts +1 -1
- package/dist/types/components/variable-selector/index.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/index.d.ts +3 -7
- package/dist/types/plugins/json-schema-preset/react.d.ts +11 -0
- package/dist/types/validate/validate-flow-value/index.d.ts +1 -1
- package/package.json +47 -9
- package/src/components/display-schema-tree/index.tsx +6 -4
- package/src/components/type-selector/index.tsx +2 -3
- package/src/components/variable-selector/index.tsx +2 -2
- package/src/components/variable-selector/use-variable-tree.tsx +7 -4
- package/src/plugins/json-schema-preset/index.tsx +4 -20
- package/src/plugins/json-schema-preset/react.tsx +28 -0
- package/src/validate/validate-flow-value/index.tsx +1 -2
|
@@ -38,7 +38,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const external_react_namespaceObject = require("react");
|
|
40
40
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
41
|
-
const
|
|
41
|
+
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
42
42
|
const external_styles_js_namespaceObject = require("./styles.js");
|
|
43
43
|
function DisplaySchemaTree(props) {
|
|
44
44
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SchemaTree, {
|
|
@@ -47,7 +47,7 @@ function DisplaySchemaTree(props) {
|
|
|
47
47
|
}
|
|
48
48
|
function SchemaTree(props) {
|
|
49
49
|
const { value: schema = {}, drilldown = true, depth = 0, showIcon = true, parentKey = '' } = props || {};
|
|
50
|
-
const typeManager = (0,
|
|
50
|
+
const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
|
|
51
51
|
const config = typeManager.getTypeBySchema(schema);
|
|
52
52
|
const title = typeManager.getComplexText(schema);
|
|
53
53
|
const icon = typeManager?.getDisplayIcon(schema);
|
|
@@ -31,9 +31,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
31
31
|
});
|
|
32
32
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
+
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
34
35
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
35
36
|
const index_js_namespaceObject = require("../../shared/inject-material/index.js");
|
|
36
|
-
const external_plugins_index_js_namespaceObject = require("../../plugins/index.js");
|
|
37
37
|
const labelStyle = {
|
|
38
38
|
display: 'flex',
|
|
39
39
|
alignItems: 'center',
|
|
@@ -63,7 +63,7 @@ function TypeSelector(props) {
|
|
|
63
63
|
const selectValue = (0, external_react_namespaceObject.useMemo)(()=>getTypeSelectValue(value), [
|
|
64
64
|
value
|
|
65
65
|
]);
|
|
66
|
-
const typeManager = (0,
|
|
66
|
+
const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
|
|
67
67
|
const icon = typeManager.getDisplayIcon(value || {});
|
|
68
68
|
const options = (0, external_react_namespaceObject.useMemo)(()=>typeManager.getTypeRegistriesWithParentType().map((_type)=>{
|
|
69
69
|
const isArray = 'array' === _type.type;
|
|
@@ -31,10 +31,9 @@ const external_react_namespaceObject = require("react");
|
|
|
31
31
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
32
32
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
33
33
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
34
|
-
const index_js_namespaceObject = require("../../plugins/index.js");
|
|
35
34
|
function useVariableTree(params) {
|
|
36
35
|
const { includeSchema, excludeSchema, skipVariable } = params;
|
|
37
|
-
const typeManager = (0,
|
|
36
|
+
const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
|
|
38
37
|
const variables = (0, editor_namespaceObject.useAvailableVariables)();
|
|
39
38
|
const getVariableTypeIcon = (0, external_react_namespaceObject.useCallback)((variable)=>{
|
|
40
39
|
if (variable.meta?.icon) {
|
|
@@ -25,23 +25,13 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
JsonSchemaUtils: ()=>json_schema_namespaceObject.JsonSchemaUtils,
|
|
28
|
-
JsonSchemaTypePresetProvider: ()=>JsonSchemaTypePresetProvider,
|
|
28
|
+
JsonSchemaTypePresetProvider: ()=>external_react_js_namespaceObject.JsonSchemaTypePresetProvider,
|
|
29
29
|
createTypePresetPlugin: ()=>external_create_type_preset_plugin_js_namespaceObject.createTypePresetPlugin,
|
|
30
|
-
useTypeManager: ()=>useTypeManager
|
|
30
|
+
useTypeManager: ()=>external_react_js_namespaceObject.useTypeManager
|
|
31
31
|
});
|
|
32
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
-
require("react");
|
|
34
32
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
35
|
-
const
|
|
33
|
+
const external_react_js_namespaceObject = require("./react.js");
|
|
36
34
|
const external_create_type_preset_plugin_js_namespaceObject = require("./create-type-preset-plugin.js");
|
|
37
|
-
const useTypeManager = ()=>(0, json_schema_namespaceObject.useTypeManager)();
|
|
38
|
-
const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(json_schema_namespaceObject.TypePresetProvider, {
|
|
39
|
-
types: [
|
|
40
|
-
...index_js_namespaceObject.jsonSchemaTypePreset,
|
|
41
|
-
...types
|
|
42
|
-
],
|
|
43
|
-
children: children
|
|
44
|
-
});
|
|
45
35
|
exports.JsonSchemaTypePresetProvider = __webpack_exports__.JsonSchemaTypePresetProvider;
|
|
46
36
|
exports.JsonSchemaUtils = __webpack_exports__.JsonSchemaUtils;
|
|
47
37
|
exports.createTypePresetPlugin = __webpack_exports__.createTypePresetPlugin;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
useTypeManager: ()=>useTypeManager,
|
|
28
|
+
JsonSchemaTypePresetProvider: ()=>JsonSchemaTypePresetProvider
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
require("react");
|
|
32
|
+
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
33
|
+
const index_js_namespaceObject = require("./type-definition/index.js");
|
|
34
|
+
const useTypeManager = ()=>(0, json_schema_namespaceObject.useTypeManager)();
|
|
35
|
+
const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(json_schema_namespaceObject.TypePresetProvider, {
|
|
36
|
+
types: [
|
|
37
|
+
...index_js_namespaceObject.jsonSchemaTypePreset,
|
|
38
|
+
...types
|
|
39
|
+
],
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
exports.JsonSchemaTypePresetProvider = __webpack_exports__.JsonSchemaTypePresetProvider;
|
|
43
|
+
exports.useTypeManager = __webpack_exports__.useTypeManager;
|
|
44
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
45
|
+
"JsonSchemaTypePresetProvider",
|
|
46
|
+
"useTypeManager"
|
|
47
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import react from "react";
|
|
3
|
-
import { useTypeManager } from "
|
|
3
|
+
import { useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
4
|
import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from "./styles.mjs";
|
|
5
5
|
function DisplaySchemaTree(props) {
|
|
6
6
|
return /*#__PURE__*/ jsx(SchemaTree, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
+
import { useTypeManager } from "@flowgram.ai/json-schema";
|
|
3
4
|
import { Cascader, Icon, IconButton } from "@douyinfe/semi-ui";
|
|
4
5
|
import { createInjectMaterial } from "../../shared/inject-material/index.mjs";
|
|
5
|
-
import { useTypeManager } from "../../plugins/index.mjs";
|
|
6
6
|
const labelStyle = {
|
|
7
7
|
display: 'flex',
|
|
8
8
|
alignItems: 'center',
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
3
|
+
import { JsonSchemaUtils, useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
4
|
import { ASTMatch, useAvailableVariables } from "@flowgram.ai/editor";
|
|
5
5
|
import { Icon } from "@douyinfe/semi-ui";
|
|
6
|
-
import { useTypeManager } from "../../plugins/index.mjs";
|
|
7
6
|
function useVariableTree(params) {
|
|
8
7
|
const { includeSchema, excludeSchema, skipVariable } = params;
|
|
9
8
|
const typeManager = useTypeManager();
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "react";
|
|
3
|
-
import { JsonSchemaUtils, TypePresetProvider, useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
|
-
import { jsonSchemaTypePreset } from "./type-definition/index.mjs";
|
|
1
|
+
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
2
|
+
import { JsonSchemaTypePresetProvider, useTypeManager } from "./react.mjs";
|
|
5
3
|
import { createTypePresetPlugin } from "./create-type-preset-plugin.mjs";
|
|
6
|
-
|
|
7
|
-
const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ jsx(TypePresetProvider, {
|
|
8
|
-
types: [
|
|
9
|
-
...jsonSchemaTypePreset,
|
|
10
|
-
...types
|
|
11
|
-
],
|
|
12
|
-
children: children
|
|
13
|
-
});
|
|
14
|
-
export { JsonSchemaTypePresetProvider, JsonSchemaUtils, createTypePresetPlugin, json_schema_preset_useTypeManager as useTypeManager };
|
|
4
|
+
export { JsonSchemaTypePresetProvider, JsonSchemaUtils, createTypePresetPlugin, useTypeManager };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { TypePresetProvider, useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
|
+
import { jsonSchemaTypePreset } from "./type-definition/index.mjs";
|
|
5
|
+
const react_useTypeManager = ()=>useTypeManager();
|
|
6
|
+
const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ jsx(TypePresetProvider, {
|
|
7
|
+
types: [
|
|
8
|
+
...jsonSchemaTypePreset,
|
|
9
|
+
...types
|
|
10
|
+
],
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
export { JsonSchemaTypePresetProvider, react_useTypeManager as useTypeManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/components/index.ts","../src/components/assign-row/index.tsx","../src/components/assign-row/types.ts","../src/components/assign-rows/index.tsx","../src/components/batch-outputs/index.tsx","../src/components/batch-outputs/styles.tsx","../src/components/batch-outputs/types.ts","../src/components/batch-variable-selector/index.tsx","../src/components/blur-input/index.tsx","../src/components/code-editor/editor.tsx","../src/components/code-editor/index.tsx","../src/components/code-editor/init-worker.ts","../src/components/code-editor/language-features.ts","../src/components/code-editor/utils.ts","../src/components/code-editor/theme/dark.ts","../src/components/code-editor/theme/index.ts","../src/components/code-editor/theme/light.ts","../src/components/code-editor-mini/index.tsx","../src/components/condition-row/constants.ts","../src/components/condition-row/index.tsx","../src/components/condition-row/styles.tsx","../src/components/condition-row/types.ts","../src/components/condition-row/hooks/useOp.tsx","../src/components/condition-row/hooks/useRule.ts","../src/components/constant-input/index.tsx","../src/components/constant-input/types.ts","../src/components/coze-editor-extensions/index.tsx","../src/components/coze-editor-extensions/styles.tsx","../src/components/coze-editor-extensions/extensions/inputs-tree.tsx","../src/components/coze-editor-extensions/extensions/variable-tag.tsx","../src/components/coze-editor-extensions/extensions/variable-tree.tsx","../src/components/db-condition-row/index.tsx","../src/components/db-condition-row/styles.tsx","../src/components/db-condition-row/types.ts","../src/components/db-condition-row/hooks/use-left.tsx","../src/components/db-condition-row/hooks/use-op.tsx","../src/components/display-flow-value/index.tsx","../src/components/display-inputs-values/index.tsx","../src/components/display-inputs-values/styles.ts","../src/components/display-outputs/index.tsx","../src/components/display-outputs/styles.ts","../src/components/display-schema-tag/index.tsx","../src/components/display-schema-tag/styles.ts","../src/components/display-schema-tree/index.tsx","../src/components/display-schema-tree/styles.tsx","../src/components/dynamic-value-input/hooks.ts","../src/components/dynamic-value-input/index.tsx","../src/components/dynamic-value-input/styles.tsx","../src/components/inputs-values/index.tsx","../src/components/inputs-values/styles.tsx","../src/components/inputs-values/types.ts","../src/components/inputs-values-tree/index.tsx","../src/components/inputs-values-tree/row.tsx","../src/components/inputs-values-tree/styles.tsx","../src/components/inputs-values-tree/types.ts","../src/components/inputs-values-tree/hooks/use-child-list.tsx","../src/components/json-editor-with-variables/editor.tsx","../src/components/json-editor-with-variables/index.tsx","../src/components/json-schema-editor/default-value.tsx","../src/components/json-schema-editor/hooks.tsx","../src/components/json-schema-editor/index.tsx","../src/components/json-schema-editor/styles.tsx","../src/components/json-schema-editor/types.ts","../src/components/prompt-editor/editor.tsx","../src/components/prompt-editor/index.tsx","../src/components/prompt-editor/styles.tsx","../src/components/prompt-editor/types.tsx","../src/components/prompt-editor/extensions/jinja.tsx","../src/components/prompt-editor/extensions/language-support.tsx","../src/components/prompt-editor/extensions/markdown.tsx","../src/components/prompt-editor-with-inputs/editor.tsx","../src/components/prompt-editor-with-inputs/index.tsx","../src/components/prompt-editor-with-variables/editor.tsx","../src/components/prompt-editor-with-variables/index.tsx","../src/components/type-selector/index.tsx","../src/components/variable-selector/context.tsx","../src/components/variable-selector/index.tsx","../src/components/variable-selector/styles.tsx","../src/components/variable-selector/use-variable-tree.tsx","../src/effects/index.ts","../src/effects/auto-rename-ref/index.ts","../src/effects/listen-ref-schema-change/index.ts","../src/effects/listen-ref-value-change/index.ts","../src/effects/provide-batch-input/index.ts","../src/effects/provide-json-schema-outputs/index.ts","../src/effects/sync-variable-title/index.ts","../src/effects/validate-when-variable-sync/index.ts","../src/form-plugins/index.ts","../src/form-plugins/batch-outputs-plugin/index.ts","../src/form-plugins/infer-assign-plugin/index.ts","../src/form-plugins/infer-inputs-plugin/index.ts","../src/hooks/index.ts","../src/hooks/use-object-list/index.tsx","../src/plugins/index.ts","../src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts","../src/plugins/disable-declaration-plugin/index.tsx","../src/plugins/json-schema-preset/create-type-preset-plugin.tsx","../src/plugins/json-schema-preset/index.tsx","../src/plugins/json-schema-preset/manager.ts","../src/plugins/json-schema-preset/type-definition/array.tsx","../src/plugins/json-schema-preset/type-definition/boolean.tsx","../src/plugins/json-schema-preset/type-definition/date-time.tsx","../src/plugins/json-schema-preset/type-definition/index.tsx","../src/plugins/json-schema-preset/type-definition/integer.tsx","../src/plugins/json-schema-preset/type-definition/number.tsx","../src/plugins/json-schema-preset/type-definition/object.tsx","../src/plugins/json-schema-preset/type-definition/string.tsx","../src/shared/index.ts","../src/shared/flow-value/index.ts","../src/shared/flow-value/schema.ts","../src/shared/flow-value/types.ts","../src/shared/flow-value/utils.ts","../src/shared/format-legacy-refs/index.ts","../src/shared/inject-material/index.tsx","../src/shared/lazy-suspense/index.tsx","../src/shared/polyfill-create-root/index.tsx","../src/validate/index.ts","../src/validate/validate-flow-value/index.tsx"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/components/index.ts","../src/components/assign-row/index.tsx","../src/components/assign-row/types.ts","../src/components/assign-rows/index.tsx","../src/components/batch-outputs/index.tsx","../src/components/batch-outputs/styles.tsx","../src/components/batch-outputs/types.ts","../src/components/batch-variable-selector/index.tsx","../src/components/blur-input/index.tsx","../src/components/code-editor/editor.tsx","../src/components/code-editor/index.tsx","../src/components/code-editor/init-worker.ts","../src/components/code-editor/language-features.ts","../src/components/code-editor/utils.ts","../src/components/code-editor/theme/dark.ts","../src/components/code-editor/theme/index.ts","../src/components/code-editor/theme/light.ts","../src/components/code-editor-mini/index.tsx","../src/components/condition-row/constants.ts","../src/components/condition-row/index.tsx","../src/components/condition-row/styles.tsx","../src/components/condition-row/types.ts","../src/components/condition-row/hooks/useOp.tsx","../src/components/condition-row/hooks/useRule.ts","../src/components/constant-input/index.tsx","../src/components/constant-input/types.ts","../src/components/coze-editor-extensions/index.tsx","../src/components/coze-editor-extensions/styles.tsx","../src/components/coze-editor-extensions/extensions/inputs-tree.tsx","../src/components/coze-editor-extensions/extensions/variable-tag.tsx","../src/components/coze-editor-extensions/extensions/variable-tree.tsx","../src/components/db-condition-row/index.tsx","../src/components/db-condition-row/styles.tsx","../src/components/db-condition-row/types.ts","../src/components/db-condition-row/hooks/use-left.tsx","../src/components/db-condition-row/hooks/use-op.tsx","../src/components/display-flow-value/index.tsx","../src/components/display-inputs-values/index.tsx","../src/components/display-inputs-values/styles.ts","../src/components/display-outputs/index.tsx","../src/components/display-outputs/styles.ts","../src/components/display-schema-tag/index.tsx","../src/components/display-schema-tag/styles.ts","../src/components/display-schema-tree/index.tsx","../src/components/display-schema-tree/styles.tsx","../src/components/dynamic-value-input/hooks.ts","../src/components/dynamic-value-input/index.tsx","../src/components/dynamic-value-input/styles.tsx","../src/components/inputs-values/index.tsx","../src/components/inputs-values/styles.tsx","../src/components/inputs-values/types.ts","../src/components/inputs-values-tree/index.tsx","../src/components/inputs-values-tree/row.tsx","../src/components/inputs-values-tree/styles.tsx","../src/components/inputs-values-tree/types.ts","../src/components/inputs-values-tree/hooks/use-child-list.tsx","../src/components/json-editor-with-variables/editor.tsx","../src/components/json-editor-with-variables/index.tsx","../src/components/json-schema-editor/default-value.tsx","../src/components/json-schema-editor/hooks.tsx","../src/components/json-schema-editor/index.tsx","../src/components/json-schema-editor/styles.tsx","../src/components/json-schema-editor/types.ts","../src/components/prompt-editor/editor.tsx","../src/components/prompt-editor/index.tsx","../src/components/prompt-editor/styles.tsx","../src/components/prompt-editor/types.tsx","../src/components/prompt-editor/extensions/jinja.tsx","../src/components/prompt-editor/extensions/language-support.tsx","../src/components/prompt-editor/extensions/markdown.tsx","../src/components/prompt-editor-with-inputs/editor.tsx","../src/components/prompt-editor-with-inputs/index.tsx","../src/components/prompt-editor-with-variables/editor.tsx","../src/components/prompt-editor-with-variables/index.tsx","../src/components/type-selector/index.tsx","../src/components/variable-selector/context.tsx","../src/components/variable-selector/index.tsx","../src/components/variable-selector/styles.tsx","../src/components/variable-selector/use-variable-tree.tsx","../src/effects/index.ts","../src/effects/auto-rename-ref/index.ts","../src/effects/listen-ref-schema-change/index.ts","../src/effects/listen-ref-value-change/index.ts","../src/effects/provide-batch-input/index.ts","../src/effects/provide-json-schema-outputs/index.ts","../src/effects/sync-variable-title/index.ts","../src/effects/validate-when-variable-sync/index.ts","../src/form-plugins/index.ts","../src/form-plugins/batch-outputs-plugin/index.ts","../src/form-plugins/infer-assign-plugin/index.ts","../src/form-plugins/infer-inputs-plugin/index.ts","../src/hooks/index.ts","../src/hooks/use-object-list/index.tsx","../src/plugins/index.ts","../src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts","../src/plugins/disable-declaration-plugin/index.tsx","../src/plugins/json-schema-preset/create-type-preset-plugin.tsx","../src/plugins/json-schema-preset/index.tsx","../src/plugins/json-schema-preset/manager.ts","../src/plugins/json-schema-preset/react.tsx","../src/plugins/json-schema-preset/type-definition/array.tsx","../src/plugins/json-schema-preset/type-definition/boolean.tsx","../src/plugins/json-schema-preset/type-definition/date-time.tsx","../src/plugins/json-schema-preset/type-definition/index.tsx","../src/plugins/json-schema-preset/type-definition/integer.tsx","../src/plugins/json-schema-preset/type-definition/number.tsx","../src/plugins/json-schema-preset/type-definition/object.tsx","../src/plugins/json-schema-preset/type-definition/string.tsx","../src/shared/index.ts","../src/shared/flow-value/index.ts","../src/shared/flow-value/schema.ts","../src/shared/flow-value/types.ts","../src/shared/flow-value/utils.ts","../src/shared/format-legacy-refs/index.ts","../src/shared/inject-material/index.tsx","../src/shared/lazy-suspense/index.tsx","../src/shared/polyfill-create-root/index.tsx","../src/validate/index.ts","../src/validate/validate-flow-value/index.tsx"],"version":"5.8.3"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { IJsonSchema, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
|
|
6
|
+
import { type IJsonSchema, type JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
|
|
7
7
|
interface PropsType {
|
|
8
8
|
value?: IJsonSchema;
|
|
9
9
|
parentKey?: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
7
|
-
import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
7
|
+
import { type TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
8
8
|
import { useVariableTree } from './use-variable-tree';
|
|
9
9
|
export interface VariableSelectorProps {
|
|
10
10
|
value?: string[];
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type JsonSchemaBasicType, JsonSchemaUtils, type IJsonSchema } from '@flowgram.ai/json-schema';
|
|
6
|
+
import { useTypeManager, JsonSchemaTypePresetProvider } from './react';
|
|
7
|
+
import { ConstantRendererProps, type JsonSchemaTypeRegistry } from './manager';
|
|
8
8
|
import { createTypePresetPlugin } from './create-type-preset-plugin';
|
|
9
|
-
declare const useTypeManager: () => JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
|
|
10
|
-
declare const JsonSchemaTypePresetProvider: ({ types, children, }: React.PropsWithChildren<{
|
|
11
|
-
types: JsonSchemaTypeRegistry[];
|
|
12
|
-
}>) => React.JSX.Element;
|
|
13
9
|
export { createTypePresetPlugin, useTypeManager, JsonSchemaTypePresetProvider, JsonSchemaUtils, type IJsonSchema, type JsonSchemaTypeRegistry, type ConstantRendererProps, type JsonSchemaBasicType, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { type IJsonSchema, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
|
|
7
|
+
import { type JsonSchemaTypeRegistry } from './manager';
|
|
8
|
+
export declare const useTypeManager: () => JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
|
|
9
|
+
export declare const JsonSchemaTypePresetProvider: ({ types, children, }: React.PropsWithChildren<{
|
|
10
|
+
types: JsonSchemaTypeRegistry[];
|
|
11
|
+
}>) => React.JSX.Element;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
import { FeedbackLevel, FlowNodeEntity } from '@flowgram.ai/editor';
|
|
6
|
-
import { IFlowValue } from '../../shared';
|
|
6
|
+
import { type IFlowValue } from '../../shared';
|
|
7
7
|
interface Context {
|
|
8
8
|
node: FlowNodeEntity;
|
|
9
9
|
required?: boolean;
|
package/package.json
CHANGED
|
@@ -1,17 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowgram.ai/form-materials",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"homepage": "https://flowgram.ai/",
|
|
5
5
|
"repository": "https://github.com/bytedance/flowgram.ai",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"import": "./dist/esm/index.mjs",
|
|
11
|
+
"require": "./dist/cjs/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./components/*": {
|
|
14
|
+
"types": "./dist/types/components/*/index.d.ts",
|
|
15
|
+
"import": "./dist/esm/components/*/index.mjs",
|
|
16
|
+
"require": "./dist/cjs/components/*/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./effects/*": {
|
|
19
|
+
"types": "./dist/types/effects/*/index.d.ts",
|
|
20
|
+
"import": "./dist/esm/effects/*/index.mjs",
|
|
21
|
+
"require": "./dist/cjs/effects/*/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./hooks/*": {
|
|
24
|
+
"types": "./dist/types/hooks/*/index.d.ts",
|
|
25
|
+
"import": "./dist/esm/hooks/*/index.mjs",
|
|
26
|
+
"require": "./dist/cjs/hooks/*/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./shared/*": {
|
|
29
|
+
"types": "./dist/types/shared/*/index.d.ts",
|
|
30
|
+
"import": "./dist/esm/shared/*/index.mjs",
|
|
31
|
+
"require": "./dist/cjs/shared/*/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./form-plugins/*": {
|
|
34
|
+
"types": "./dist/types/form-plugins/*/index.d.ts",
|
|
35
|
+
"import": "./dist/esm/form-plugins/*/index.mjs",
|
|
36
|
+
"require": "./dist/cjs/form-plugins/*/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./plugins/*": {
|
|
39
|
+
"types": "./dist/types/plugins/*/index.d.ts",
|
|
40
|
+
"import": "./dist/esm/plugins/*/index.mjs",
|
|
41
|
+
"require": "./dist/cjs/plugins/*/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./validate/*": {
|
|
44
|
+
"types": "./dist/types/validate/*/index.d.ts",
|
|
45
|
+
"import": "./dist/esm/validate/*/index.mjs",
|
|
46
|
+
"require": "./dist/cjs/validate/*/index.js"
|
|
47
|
+
}
|
|
11
48
|
},
|
|
12
49
|
"main": "./dist/cjs/index.js",
|
|
13
50
|
"module": "./dist/esm/index.mjs",
|
|
14
51
|
"types": "./dist/types/index.d.ts",
|
|
52
|
+
"sideEffects": false,
|
|
15
53
|
"bin": {
|
|
16
54
|
"flowgram-form-materials": "./bin/run.sh"
|
|
17
55
|
},
|
|
@@ -30,9 +68,9 @@
|
|
|
30
68
|
"@codemirror/view": "~6.38.0",
|
|
31
69
|
"@codemirror/state": "~6.5.2",
|
|
32
70
|
"zod": "^3.24.4",
|
|
33
|
-
"@flowgram.ai/
|
|
34
|
-
"@flowgram.ai/
|
|
35
|
-
"@flowgram.ai/editor": "0.4.
|
|
71
|
+
"@flowgram.ai/editor": "0.4.12",
|
|
72
|
+
"@flowgram.ai/json-schema": "0.4.12",
|
|
73
|
+
"@flowgram.ai/coze-editor": "0.4.12"
|
|
36
74
|
},
|
|
37
75
|
"devDependencies": {
|
|
38
76
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -50,8 +88,8 @@
|
|
|
50
88
|
"@rslib/core": "~0.12.4",
|
|
51
89
|
"cross-env": "~7.0.3",
|
|
52
90
|
"@rsbuild/plugin-react": "^1.1.1",
|
|
53
|
-
"@flowgram.ai/eslint-config": "0.4.
|
|
54
|
-
"@flowgram.ai/ts-config": "0.4.
|
|
91
|
+
"@flowgram.ai/eslint-config": "0.4.12",
|
|
92
|
+
"@flowgram.ai/ts-config": "0.4.12"
|
|
55
93
|
},
|
|
56
94
|
"peerDependencies": {
|
|
57
95
|
"react": ">=16.8",
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {
|
|
9
|
+
type IJsonSchema,
|
|
10
|
+
type JsonSchemaTypeManager,
|
|
11
|
+
useTypeManager,
|
|
12
|
+
} from '@flowgram.ai/json-schema';
|
|
11
13
|
|
|
12
14
|
import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from './styles';
|
|
13
15
|
|
|
@@ -33,7 +35,7 @@ function SchemaTree(props: PropsType) {
|
|
|
33
35
|
parentKey = '',
|
|
34
36
|
} = props || {};
|
|
35
37
|
|
|
36
|
-
const typeManager = useTypeManager();
|
|
38
|
+
const typeManager = useTypeManager() as JsonSchemaTypeManager;
|
|
37
39
|
|
|
38
40
|
const config = typeManager.getTypeBySchema(schema);
|
|
39
41
|
const title = typeManager.getComplexText(schema);
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
8
|
+
import { IJsonSchema, useTypeManager, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
|
|
9
9
|
import { Cascader, Icon, IconButton } from '@douyinfe/semi-ui';
|
|
10
10
|
|
|
11
11
|
import { createInjectMaterial } from '@/shared/inject-material';
|
|
12
|
-
import { useTypeManager } from '@/plugins';
|
|
13
12
|
|
|
14
13
|
export interface TypeSelectorProps {
|
|
15
14
|
value?: Partial<IJsonSchema>;
|
|
@@ -47,7 +46,7 @@ export function TypeSelector(props: TypeSelectorProps) {
|
|
|
47
46
|
|
|
48
47
|
const selectValue = useMemo(() => getTypeSelectValue(value), [value]);
|
|
49
48
|
|
|
50
|
-
const typeManager = useTypeManager();
|
|
49
|
+
const typeManager = useTypeManager() as JsonSchemaTypeManager;
|
|
51
50
|
|
|
52
51
|
const icon = typeManager.getDisplayIcon(value || {});
|
|
53
52
|
|
|
@@ -7,8 +7,8 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
9
9
|
import { I18n } from '@flowgram.ai/editor';
|
|
10
|
-
import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
11
|
-
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
10
|
+
import { type TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
11
|
+
import { type TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
12
12
|
import { Popover } from '@douyinfe/semi-ui';
|
|
13
13
|
import { IconChevronDownStroked, IconIssueStroked } from '@douyinfe/semi-icons';
|
|
14
14
|
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
IJsonSchema,
|
|
10
|
+
JsonSchemaTypeManager,
|
|
11
|
+
JsonSchemaUtils,
|
|
12
|
+
useTypeManager,
|
|
13
|
+
} from '@flowgram.ai/json-schema';
|
|
9
14
|
import { ASTMatch, BaseVariableField, useAvailableVariables } from '@flowgram.ai/editor';
|
|
10
15
|
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
11
16
|
import { Icon } from '@douyinfe/semi-ui';
|
|
12
17
|
|
|
13
|
-
import { useTypeManager } from '@/plugins';
|
|
14
|
-
|
|
15
18
|
type VariableField = BaseVariableField<{
|
|
16
19
|
icon?: string | JSX.Element;
|
|
17
20
|
title?: string;
|
|
@@ -25,7 +28,7 @@ export function useVariableTree(params: {
|
|
|
25
28
|
}): TreeNodeData[] {
|
|
26
29
|
const { includeSchema, excludeSchema, skipVariable } = params;
|
|
27
30
|
|
|
28
|
-
const typeManager = useTypeManager();
|
|
31
|
+
const typeManager = useTypeManager() as JsonSchemaTypeManager;
|
|
29
32
|
const variables = useAvailableVariables();
|
|
30
33
|
|
|
31
34
|
const getVariableTypeIcon = useCallback((variable: VariableField) => {
|
|
@@ -2,33 +2,17 @@
|
|
|
2
2
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
|
-
import React from 'react';
|
|
6
5
|
|
|
7
6
|
import {
|
|
8
|
-
type IJsonSchema,
|
|
9
|
-
JsonSchemaUtils,
|
|
10
|
-
useTypeManager as useOriginTypeManager,
|
|
11
|
-
TypePresetProvider as OriginTypePresetProvider,
|
|
12
|
-
JsonSchemaTypeManager,
|
|
13
7
|
type JsonSchemaBasicType,
|
|
8
|
+
JsonSchemaUtils,
|
|
9
|
+
type IJsonSchema,
|
|
14
10
|
} from '@flowgram.ai/json-schema';
|
|
15
11
|
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
12
|
+
import { useTypeManager, JsonSchemaTypePresetProvider } from './react';
|
|
13
|
+
import { ConstantRendererProps, type JsonSchemaTypeRegistry } from './manager';
|
|
18
14
|
import { createTypePresetPlugin } from './create-type-preset-plugin';
|
|
19
15
|
|
|
20
|
-
const useTypeManager = () =>
|
|
21
|
-
useOriginTypeManager() as JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
|
|
22
|
-
|
|
23
|
-
const JsonSchemaTypePresetProvider = ({
|
|
24
|
-
types = [],
|
|
25
|
-
children,
|
|
26
|
-
}: React.PropsWithChildren<{ types: JsonSchemaTypeRegistry[] }>) => (
|
|
27
|
-
<OriginTypePresetProvider types={[...jsonSchemaTypePreset, ...types]}>
|
|
28
|
-
{children}
|
|
29
|
-
</OriginTypePresetProvider>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
16
|
export {
|
|
33
17
|
createTypePresetPlugin,
|
|
34
18
|
useTypeManager,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type IJsonSchema,
|
|
10
|
+
useTypeManager as useOriginTypeManager,
|
|
11
|
+
TypePresetProvider as OriginTypePresetProvider,
|
|
12
|
+
JsonSchemaTypeManager,
|
|
13
|
+
} from '@flowgram.ai/json-schema';
|
|
14
|
+
|
|
15
|
+
import { jsonSchemaTypePreset } from './type-definition';
|
|
16
|
+
import { type JsonSchemaTypeRegistry } from './manager';
|
|
17
|
+
|
|
18
|
+
export const useTypeManager = () =>
|
|
19
|
+
useOriginTypeManager() as JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
|
|
20
|
+
|
|
21
|
+
export const JsonSchemaTypePresetProvider = ({
|
|
22
|
+
types = [],
|
|
23
|
+
children,
|
|
24
|
+
}: React.PropsWithChildren<{ types: JsonSchemaTypeRegistry[] }>) => (
|
|
25
|
+
<OriginTypePresetProvider types={[...jsonSchemaTypePreset, ...types]}>
|
|
26
|
+
{children}
|
|
27
|
+
</OriginTypePresetProvider>
|
|
28
|
+
);
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import { isNil } from 'lodash-es';
|
|
7
7
|
import { FeedbackLevel, FlowNodeEntity, getNodeScope } from '@flowgram.ai/editor';
|
|
8
8
|
|
|
9
|
-
import { IFlowValue } from '@/shared';
|
|
10
|
-
import { FlowValueUtils } from '@/shared';
|
|
9
|
+
import { type IFlowValue, FlowValueUtils } from '@/shared';
|
|
11
10
|
|
|
12
11
|
interface Context {
|
|
13
12
|
node: FlowNodeEntity;
|