@flowgram.ai/form-materials 0.1.0-alpha.14 → 0.1.0-alpha.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/bin/run.sh +7 -0
- package/dist/cjs/components/assign-row/index.js +112 -0
- package/dist/cjs/components/assign-row/types.js +18 -0
- package/dist/cjs/components/assign-rows/index.js +85 -0
- package/dist/cjs/components/batch-outputs/index.js +91 -0
- package/dist/cjs/components/batch-outputs/styles.js +60 -0
- package/dist/cjs/components/batch-outputs/types.js +18 -0
- package/dist/cjs/components/batch-variable-selector/index.js +53 -0
- package/dist/cjs/components/blur-input/index.js +54 -0
- package/dist/cjs/components/code-editor/editor-all.js +52 -0
- package/dist/cjs/components/code-editor/editor-json.js +71 -0
- package/dist/cjs/components/code-editor/editor-python.js +63 -0
- package/dist/cjs/components/code-editor/editor-shell.js +63 -0
- package/dist/cjs/components/code-editor/editor-sql.js +71 -0
- package/dist/cjs/components/code-editor/editor-ts.js +80 -0
- package/dist/cjs/components/code-editor/editor.js +105 -0
- package/dist/cjs/components/code-editor/factory.js +96 -0
- package/dist/cjs/components/code-editor/index.js +60 -0
- package/dist/cjs/components/code-editor/theme/dark.js +258 -0
- package/dist/cjs/components/code-editor/theme/index.js +11 -0
- package/dist/cjs/components/code-editor/theme/light.js +244 -0
- package/dist/cjs/components/code-editor/utils.js +43 -0
- package/dist/cjs/components/code-editor-mini/index.js +66 -0
- package/dist/cjs/components/condition-context/context.js +59 -0
- package/dist/cjs/components/condition-context/hooks/use-condition.js +97 -0
- package/dist/cjs/components/condition-context/index.js +47 -0
- package/dist/cjs/components/condition-context/op.js +117 -0
- package/dist/cjs/components/condition-context/types.js +18 -0
- package/dist/cjs/components/condition-row/index.js +140 -0
- package/dist/cjs/components/condition-row/styles.js +77 -0
- package/dist/cjs/components/condition-row/types.js +18 -0
- package/dist/cjs/components/constant-input/index.js +80 -0
- package/dist/cjs/components/constant-input/types.js +18 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +172 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +152 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +109 -0
- package/dist/cjs/components/coze-editor-extensions/index.js +86 -0
- package/dist/cjs/components/coze-editor-extensions/styles.js +89 -0
- package/dist/cjs/components/db-condition-row/index.js +140 -0
- package/dist/cjs/components/db-condition-row/styles.js +94 -0
- package/dist/cjs/components/db-condition-row/types.js +18 -0
- package/dist/cjs/components/display-flow-value/index.js +64 -0
- package/dist/cjs/components/display-inputs-values/index.js +76 -0
- package/dist/cjs/components/display-inputs-values/styles.js +51 -0
- package/dist/cjs/components/display-outputs/index.js +72 -0
- package/dist/cjs/components/display-outputs/styles.js +51 -0
- package/dist/cjs/components/display-schema-tag/index.js +77 -0
- package/dist/cjs/components/display-schema-tag/styles.js +71 -0
- package/dist/cjs/components/display-schema-tree/index.js +93 -0
- package/dist/cjs/components/display-schema-tree/styles.js +135 -0
- package/dist/cjs/components/dynamic-value-input/hooks.js +99 -0
- package/dist/cjs/components/dynamic-value-input/index.js +174 -0
- package/dist/cjs/components/dynamic-value-input/styles.js +107 -0
- package/dist/cjs/components/index.js +201 -0
- package/dist/cjs/components/inputs-values/index.js +112 -0
- package/dist/cjs/components/inputs-values/styles.js +60 -0
- package/dist/cjs/components/inputs-values/types.js +18 -0
- package/dist/cjs/components/inputs-values-tree/hooks/use-child-list.js +77 -0
- package/dist/cjs/components/inputs-values-tree/index.js +87 -0
- package/dist/cjs/components/inputs-values-tree/row.js +183 -0
- package/dist/cjs/components/inputs-values-tree/styles.js +177 -0
- package/dist/cjs/components/inputs-values-tree/types.js +18 -0
- package/dist/cjs/components/json-editor-with-variables/editor.js +84 -0
- package/dist/cjs/components/json-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/json-schema-editor/default-value.js +54 -0
- package/dist/cjs/components/json-schema-editor/hooks.js +130 -0
- package/dist/cjs/components/json-schema-editor/index.js +246 -0
- package/dist/cjs/components/json-schema-editor/styles.js +231 -0
- package/dist/cjs/components/json-schema-editor/types.js +18 -0
- package/dist/cjs/components/prompt-editor/editor.js +99 -0
- package/dist/cjs/components/prompt-editor/extensions/jinja.js +73 -0
- package/dist/cjs/components/prompt-editor/extensions/language-support.js +48 -0
- package/dist/cjs/components/prompt-editor/extensions/markdown.js +81 -0
- package/dist/cjs/components/prompt-editor/index.js +57 -0
- package/dist/cjs/components/prompt-editor/styles.js +55 -0
- package/dist/cjs/components/prompt-editor/types.js +7 -0
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +47 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +57 -0
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +48 -0
- package/dist/cjs/components/prompt-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/sql-editor-with-variables/editor.js +53 -0
- package/dist/cjs/components/sql-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/type-selector/index.js +139 -0
- package/dist/cjs/components/variable-selector/context.js +56 -0
- package/dist/cjs/components/variable-selector/index.js +143 -0
- package/dist/cjs/components/variable-selector/styles.js +114 -0
- package/dist/cjs/components/variable-selector/use-variable-tree.js +99 -0
- package/dist/cjs/effects/auto-rename-ref/index.js +98 -0
- package/dist/cjs/effects/index.js +60 -0
- package/dist/cjs/effects/listen-ref-schema-change/index.js +57 -0
- package/dist/cjs/effects/listen-ref-value-change/index.js +54 -0
- package/dist/cjs/effects/provide-batch-input/index.js +64 -0
- package/dist/cjs/effects/provide-json-schema-outputs/index.js +49 -0
- package/dist/cjs/effects/sync-variable-title/index.js +52 -0
- package/dist/cjs/effects/validate-when-variable-sync/index.js +49 -0
- package/dist/cjs/form-plugins/batch-outputs-plugin/index.js +104 -0
- package/dist/cjs/form-plugins/index.js +47 -0
- package/dist/cjs/form-plugins/infer-assign-plugin/index.js +72 -0
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +74 -0
- package/dist/cjs/hooks/index.js +36 -0
- package/dist/cjs/hooks/use-object-list/index.js +136 -0
- package/dist/cjs/index.js +270 -0
- package/dist/cjs/plugins/disable-declaration-plugin/create-disable-declaration-plugin.js +51 -0
- package/dist/cjs/plugins/disable-declaration-plugin/index.js +36 -0
- package/dist/cjs/plugins/index.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +50 -0
- package/dist/cjs/plugins/json-schema-preset/index.js +47 -0
- package/dist/cjs/plugins/json-schema-preset/react.js +51 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +78 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +86 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +81 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +61 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +82 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/map.js +54 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +82 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +54 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +83 -0
- package/dist/cjs/plugins/json-schema-preset/types.js +18 -0
- package/dist/cjs/shared/flow-value/index.js +36 -0
- package/dist/cjs/shared/flow-value/schema.js +82 -0
- package/dist/cjs/shared/flow-value/types.js +18 -0
- package/dist/cjs/shared/flow-value/utils.js +156 -0
- package/dist/cjs/shared/format-legacy-refs/index.js +99 -0
- package/dist/cjs/shared/index.js +73 -0
- package/dist/cjs/shared/inject-material/index.js +66 -0
- package/dist/cjs/shared/lazy-suspense/index.js +58 -0
- package/dist/cjs/shared/polyfill-create-root/index.js +53 -0
- package/dist/cjs/validate/index.js +36 -0
- package/dist/cjs/validate/validate-flow-value/index.js +63 -0
- package/dist/esm/components/assign-row/index.mjs +78 -0
- package/dist/esm/components/assign-row/types.mjs +0 -0
- package/dist/esm/components/assign-rows/index.mjs +51 -0
- package/dist/esm/components/batch-outputs/index.mjs +57 -0
- package/dist/esm/components/batch-outputs/styles.mjs +13 -0
- package/dist/esm/components/batch-outputs/types.mjs +0 -0
- package/dist/esm/components/batch-variable-selector/index.mjs +19 -0
- package/dist/esm/components/blur-input/index.mjs +20 -0
- package/dist/esm/components/code-editor/editor-all.mjs +18 -0
- package/dist/esm/components/code-editor/editor-json.mjs +16 -0
- package/dist/esm/components/code-editor/editor-python.mjs +8 -0
- package/dist/esm/components/code-editor/editor-shell.mjs +8 -0
- package/dist/esm/components/code-editor/editor-sql.mjs +16 -0
- package/dist/esm/components/code-editor/editor-ts.mjs +22 -0
- package/dist/esm/components/code-editor/editor.mjs +60 -0
- package/dist/esm/components/code-editor/factory.mjs +36 -0
- package/dist/esm/components/code-editor/index.mjs +8 -0
- package/dist/esm/components/code-editor/theme/dark.mjs +221 -0
- package/dist/esm/components/code-editor/theme/index.mjs +5 -0
- package/dist/esm/components/code-editor/theme/light.mjs +207 -0
- package/dist/esm/components/code-editor/utils.mjs +9 -0
- package/dist/esm/components/code-editor-mini/index.mjs +22 -0
- package/dist/esm/components/condition-context/context.mjs +19 -0
- package/dist/esm/components/condition-context/hooks/use-condition.mjs +63 -0
- package/dist/esm/components/condition-context/index.mjs +4 -0
- package/dist/esm/components/condition-context/op.mjs +80 -0
- package/dist/esm/components/condition-context/types.mjs +0 -0
- package/dist/esm/components/condition-row/index.mjs +106 -0
- package/dist/esm/components/condition-row/styles.mjs +21 -0
- package/dist/esm/components/condition-row/types.mjs +0 -0
- package/dist/esm/components/constant-input/index.mjs +36 -0
- package/dist/esm/components/constant-input/types.mjs +0 -0
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +135 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +118 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +75 -0
- package/dist/esm/components/coze-editor-extensions/index.mjs +18 -0
- package/{src/components/prompt-editor-with-variables/styles.tsx → dist/esm/components/coze-editor-extensions/styles.mjs} +7 -15
- package/dist/esm/components/db-condition-row/index.mjs +106 -0
- package/dist/esm/components/db-condition-row/styles.mjs +32 -0
- package/dist/esm/components/db-condition-row/types.mjs +0 -0
- package/dist/esm/components/display-flow-value/index.mjs +30 -0
- package/dist/esm/components/display-inputs-values/index.mjs +39 -0
- package/dist/esm/components/display-inputs-values/styles.mjs +7 -0
- package/dist/esm/components/display-outputs/index.mjs +38 -0
- package/dist/esm/components/display-outputs/styles.mjs +7 -0
- package/dist/esm/components/display-schema-tag/index.mjs +33 -0
- package/dist/esm/components/display-schema-tag/styles.mjs +21 -0
- package/dist/esm/components/display-schema-tree/index.mjs +49 -0
- package/dist/esm/components/display-schema-tree/styles.mjs +79 -0
- package/dist/esm/components/dynamic-value-input/hooks.mjs +59 -0
- package/dist/esm/components/dynamic-value-input/index.mjs +137 -0
- package/dist/esm/components/dynamic-value-input/styles.mjs +54 -0
- package/dist/esm/components/index.mjs +29 -0
- package/dist/esm/components/inputs-values/index.mjs +78 -0
- package/dist/esm/components/inputs-values/styles.mjs +13 -0
- package/dist/esm/components/inputs-values/types.mjs +0 -0
- package/dist/esm/components/inputs-values-tree/hooks/use-child-list.mjs +43 -0
- package/dist/esm/components/inputs-values-tree/index.mjs +53 -0
- package/dist/esm/components/inputs-values-tree/row.mjs +149 -0
- package/dist/esm/components/inputs-values-tree/styles.mjs +105 -0
- package/dist/esm/components/inputs-values-tree/types.mjs +0 -0
- package/dist/esm/components/json-editor-with-variables/editor.mjs +50 -0
- package/dist/esm/components/json-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/json-schema-editor/default-value.mjs +20 -0
- package/dist/esm/components/json-schema-editor/hooks.mjs +96 -0
- package/dist/esm/components/json-schema-editor/index.mjs +212 -0
- package/dist/esm/components/json-schema-editor/styles.mjs +138 -0
- package/dist/esm/components/json-schema-editor/types.mjs +0 -0
- package/dist/esm/components/prompt-editor/editor.mjs +52 -0
- package/dist/esm/components/prompt-editor/extensions/jinja.mjs +39 -0
- package/dist/esm/components/prompt-editor/extensions/language-support.mjs +14 -0
- package/dist/esm/components/prompt-editor/extensions/markdown.mjs +47 -0
- package/dist/esm/components/prompt-editor/index.mjs +5 -0
- package/dist/esm/components/prompt-editor/styles.mjs +11 -0
- package/dist/esm/components/prompt-editor/types.mjs +1 -0
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +13 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +5 -0
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +14 -0
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/sql-editor-with-variables/editor.mjs +19 -0
- package/dist/esm/components/sql-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/type-selector/index.mjs +96 -0
- package/dist/esm/components/variable-selector/context.mjs +16 -0
- package/dist/esm/components/variable-selector/index.mjs +100 -0
- package/dist/esm/components/variable-selector/styles.mjs +58 -0
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +65 -0
- package/dist/esm/effects/auto-rename-ref/index.mjs +64 -0
- package/dist/esm/effects/index.mjs +8 -0
- package/dist/esm/effects/listen-ref-schema-change/index.mjs +23 -0
- package/dist/esm/effects/listen-ref-value-change/index.mjs +20 -0
- package/dist/esm/effects/provide-batch-input/index.mjs +30 -0
- package/dist/esm/effects/provide-json-schema-outputs/index.mjs +15 -0
- package/dist/esm/effects/sync-variable-title/index.mjs +18 -0
- package/dist/esm/effects/validate-when-variable-sync/index.mjs +15 -0
- package/dist/esm/form-plugins/batch-outputs-plugin/index.mjs +67 -0
- package/dist/esm/form-plugins/index.mjs +4 -0
- package/dist/esm/form-plugins/infer-assign-plugin/index.mjs +38 -0
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +40 -0
- package/dist/esm/hooks/index.mjs +2 -0
- package/dist/esm/hooks/use-object-list/index.mjs +102 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/plugins/disable-declaration-plugin/create-disable-declaration-plugin.mjs +17 -0
- package/dist/esm/plugins/disable-declaration-plugin/index.mjs +2 -0
- package/dist/esm/plugins/index.mjs +3 -0
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +16 -0
- package/dist/esm/plugins/json-schema-preset/index.mjs +4 -0
- package/dist/esm/plugins/json-schema-preset/react.mjs +14 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +44 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +52 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +47 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +24 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +48 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/map.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +48 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +49 -0
- package/dist/esm/plugins/json-schema-preset/types.mjs +0 -0
- package/dist/esm/shared/flow-value/index.mjs +2 -0
- package/dist/esm/shared/flow-value/schema.mjs +26 -0
- package/dist/esm/shared/flow-value/types.mjs +0 -0
- package/dist/esm/shared/flow-value/utils.mjs +122 -0
- package/dist/esm/shared/format-legacy-refs/index.mjs +50 -0
- package/dist/esm/shared/index.mjs +6 -0
- package/dist/esm/shared/inject-material/index.mjs +22 -0
- package/dist/esm/shared/lazy-suspense/index.mjs +21 -0
- package/dist/esm/shared/polyfill-create-root/index.mjs +16 -0
- package/dist/esm/validate/index.mjs +2 -0
- package/dist/esm/validate/validate-flow-value/index.mjs +29 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/components/assign-row/index.d.ts +8 -0
- package/dist/types/components/assign-row/types.d.ts +20 -0
- package/dist/types/components/assign-rows/index.d.ts +11 -0
- package/dist/types/components/batch-outputs/index.d.ts +7 -0
- package/dist/types/components/batch-outputs/styles.d.ts +6 -0
- package/dist/types/components/batch-outputs/types.d.ts +18 -0
- package/dist/types/components/batch-variable-selector/index.d.ts +7 -0
- package/dist/types/components/blur-input/index.d.ts +13 -0
- package/dist/types/components/code-editor/editor-all.d.ts +8 -0
- package/dist/types/components/code-editor/editor-json.d.ts +6 -0
- package/dist/types/components/code-editor/editor-python.d.ts +6 -0
- package/dist/types/components/code-editor/editor-shell.d.ts +6 -0
- package/dist/types/components/code-editor/editor-sql.d.ts +6 -0
- package/dist/types/components/code-editor/editor-ts.d.ts +6 -0
- package/dist/types/components/code-editor/editor.d.ts +22 -0
- package/dist/types/components/code-editor/factory.d.ts +13 -0
- package/dist/types/components/code-editor/index.d.ts +11 -0
- package/dist/types/components/code-editor/theme/dark.d.ts +35 -0
- package/{src/typings/index.ts → dist/types/components/code-editor/theme/index.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/light.d.ts +30 -0
- package/dist/types/components/code-editor/utils.d.ts +5 -0
- package/dist/types/components/code-editor-mini/index.d.ts +10 -0
- package/dist/types/components/condition-context/context.d.ts +14 -0
- package/dist/types/components/condition-context/hooks/use-condition.d.ts +29 -0
- package/dist/types/components/condition-context/index.d.ts +8 -0
- package/dist/types/components/condition-context/op.d.ts +22 -0
- package/dist/types/components/condition-context/types.d.ts +14 -0
- package/dist/types/components/condition-row/index.d.ts +19 -0
- package/dist/types/components/condition-row/styles.d.ts +9 -0
- package/dist/types/components/condition-row/types.d.ts +10 -0
- package/dist/types/components/constant-input/index.d.ts +8 -0
- package/dist/types/components/constant-input/types.d.ts +16 -0
- package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +14 -0
- package/{src/validate/index.tsx → dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts} +1 -2
- package/dist/types/components/coze-editor-extensions/extensions/variable-tree.d.ts +8 -0
- package/dist/types/components/coze-editor-extensions/index.d.ts +18 -0
- package/dist/types/components/coze-editor-extensions/styles.d.ts +9 -0
- package/dist/types/components/db-condition-row/index.d.ts +20 -0
- package/dist/types/components/db-condition-row/styles.d.ts +12 -0
- package/dist/types/components/db-condition-row/types.d.ts +17 -0
- package/dist/types/components/display-flow-value/index.d.ts +15 -0
- package/dist/types/components/display-inputs-values/index.d.ts +14 -0
- package/dist/types/components/display-inputs-values/styles.d.ts +5 -0
- package/dist/types/components/display-outputs/index.d.ts +14 -0
- package/dist/types/components/display-outputs/styles.d.ts +5 -0
- package/dist/types/components/display-schema-tag/index.d.ts +14 -0
- package/dist/types/components/display-schema-tag/styles.d.ts +8 -0
- package/dist/types/components/display-schema-tree/index.d.ts +16 -0
- package/dist/types/components/display-schema-tree/styles.d.ts +11 -0
- package/dist/types/components/dynamic-value-input/hooks.d.ts +28 -0
- package/dist/types/components/dynamic-value-input/index.d.ts +29 -0
- package/dist/types/components/dynamic-value-input/styles.d.ts +8 -0
- package/dist/types/components/index.d.ts +32 -0
- package/dist/types/components/inputs-values/index.d.ts +7 -0
- package/dist/types/components/inputs-values/styles.d.ts +6 -0
- package/dist/types/components/inputs-values/types.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/hooks/use-child-list.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/index.d.ts +7 -0
- package/dist/types/components/inputs-values-tree/row.d.ts +15 -0
- package/dist/types/components/inputs-values-tree/styles.d.ts +23 -0
- package/dist/types/components/inputs-values-tree/types.d.ts +18 -0
- package/dist/types/components/json-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/json-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/json-schema-editor/default-value.d.ts +17 -0
- package/dist/types/components/json-schema-editor/hooks.d.ts +12 -0
- package/dist/types/components/json-schema-editor/index.d.ts +14 -0
- package/dist/types/components/json-schema-editor/styles.d.ts +30 -0
- package/dist/types/components/json-schema-editor/types.d.ts +20 -0
- package/dist/types/components/prompt-editor/editor.d.ts +15 -0
- package/dist/types/components/prompt-editor/extensions/jinja.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/language-support.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/markdown.d.ts +6 -0
- package/dist/types/components/prompt-editor/index.d.ts +6 -0
- package/dist/types/components/prompt-editor/styles.d.ts +7 -0
- package/dist/types/components/prompt-editor/types.d.ts +16 -0
- package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +10 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/sql-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/sql-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/type-selector/index.d.ts +25 -0
- package/dist/types/components/variable-selector/context.d.ts +16 -0
- package/dist/types/components/variable-selector/index.d.ts +31 -0
- package/dist/types/components/variable-selector/styles.d.ts +14 -0
- package/dist/types/components/variable-selector/use-variable-tree.d.ts +18 -0
- package/dist/types/effects/auto-rename-ref/index.d.ts +17 -0
- package/dist/types/effects/index.d.ts +11 -0
- package/dist/types/effects/listen-ref-schema-change/index.d.ts +22 -0
- package/dist/types/effects/listen-ref-value-change/index.d.ts +22 -0
- package/dist/types/effects/provide-batch-input/index.d.ts +6 -0
- package/dist/types/effects/provide-json-schema-outputs/index.d.ts +6 -0
- package/dist/types/effects/sync-variable-title/index.d.ts +6 -0
- package/dist/types/effects/validate-when-variable-sync/index.d.ts +8 -0
- package/dist/types/form-plugins/batch-outputs-plugin/index.d.ts +16 -0
- package/dist/types/form-plugins/index.d.ts +7 -0
- package/dist/types/form-plugins/infer-assign-plugin/index.d.ts +10 -0
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +15 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/use-object-list/index.d.ts +22 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/plugins/disable-declaration-plugin/create-disable-declaration-plugin.d.ts +5 -0
- package/dist/types/plugins/disable-declaration-plugin/index.d.ts +5 -0
- package/dist/types/plugins/index.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +9 -0
- package/dist/types/plugins/json-schema-preset/index.d.ts +9 -0
- package/dist/types/plugins/json-schema-preset/react.d.ts +11 -0
- package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +7 -0
- package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/map.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/number.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/types.d.ts +22 -0
- package/dist/types/shared/flow-value/index.d.ts +6 -0
- package/dist/types/shared/flow-value/schema.d.ts +107 -0
- package/dist/types/shared/flow-value/types.d.ts +32 -0
- package/dist/types/shared/flow-value/utils.d.ts +67 -0
- package/dist/types/shared/format-legacy-refs/index.d.ts +84 -0
- package/dist/types/shared/index.d.ts +9 -0
- package/dist/types/shared/inject-material/index.d.ts +48 -0
- package/dist/types/shared/lazy-suspense/index.d.ts +7 -0
- package/dist/types/shared/polyfill-create-root/index.d.ts +10 -0
- package/dist/types/validate/index.d.ts +5 -0
- package/dist/types/validate/validate-flow-value/index.d.ts +19 -0
- package/package.json +63 -26
- package/src/components/assign-row/index.tsx +3 -3
- package/src/components/assign-row/types.ts +1 -1
- package/src/components/batch-outputs/types.ts +1 -1
- package/src/components/blur-input/index.tsx +9 -1
- package/src/components/code-editor/editor-all.tsx +30 -0
- package/src/components/code-editor/editor-json.tsx +25 -0
- package/src/components/code-editor/editor-python.tsx +18 -0
- package/src/components/code-editor/editor-shell.tsx +18 -0
- package/src/components/code-editor/editor-sql.tsx +24 -0
- package/src/components/code-editor/editor-ts.tsx +31 -0
- package/src/components/code-editor/editor.tsx +47 -30
- package/src/components/code-editor/factory.tsx +61 -0
- package/src/components/code-editor/index.tsx +7 -7
- package/src/components/code-editor/theme/dark.ts +63 -78
- package/src/components/code-editor/theme/index.ts +1 -1
- package/src/components/code-editor/theme/light.ts +61 -92
- package/src/components/code-editor/utils.ts +4 -0
- package/src/components/code-editor-mini/index.tsx +3 -0
- package/src/components/condition-context/context.tsx +28 -0
- package/src/components/condition-context/hooks/use-condition.tsx +99 -0
- package/src/components/condition-context/index.tsx +14 -0
- package/src/components/condition-context/op.ts +86 -0
- package/src/components/condition-context/types.ts +22 -0
- package/src/components/condition-row/index.tsx +44 -22
- package/src/components/condition-row/types.ts +1 -31
- package/src/components/constant-input/index.tsx +1 -1
- package/src/components/{prompt-editor-with-inputs/inputs-picker.tsx → coze-editor-extensions/extensions/inputs-tree.tsx} +95 -5
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.tsx +7 -4
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +15 -6
- package/src/components/coze-editor-extensions/index.tsx +33 -0
- package/src/components/db-condition-row/index.tsx +76 -24
- package/src/components/db-condition-row/types.ts +1 -14
- package/src/components/display-flow-value/index.tsx +1 -1
- package/src/components/display-schema-tree/index.tsx +6 -4
- package/src/components/dynamic-value-input/hooks.ts +1 -1
- package/src/components/dynamic-value-input/index.tsx +1 -1
- package/src/components/index.ts +78 -25
- package/src/components/inputs-values/index.tsx +1 -1
- package/src/components/inputs-values/types.ts +1 -1
- package/src/components/inputs-values-tree/row.tsx +1 -1
- package/src/components/json-editor-with-variables/editor.tsx +9 -10
- package/src/components/prompt-editor/editor.tsx +2 -2
- package/src/components/prompt-editor/extensions/jinja.tsx +2 -2
- package/src/components/prompt-editor/extensions/language-support.tsx +2 -2
- package/src/components/prompt-editor/extensions/markdown.tsx +2 -2
- package/src/components/prompt-editor/types.tsx +1 -1
- package/src/components/prompt-editor-with-inputs/editor.tsx +2 -3
- package/src/components/prompt-editor-with-variables/editor.tsx +3 -5
- package/src/components/sql-editor-with-variables/editor.tsx +28 -0
- package/src/components/sql-editor-with-variables/index.tsx +12 -0
- 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/effects/auto-rename-ref/index.ts +1 -1
- package/src/effects/index.ts +7 -7
- package/src/effects/listen-ref-schema-change/index.ts +1 -1
- package/src/effects/listen-ref-value-change/index.ts +1 -1
- package/src/effects/provide-batch-input/index.ts +2 -3
- package/src/effects/provide-json-schema-outputs/index.ts +1 -2
- package/src/form-plugins/batch-outputs-plugin/index.ts +65 -47
- package/src/form-plugins/index.ts +3 -3
- package/src/form-plugins/infer-assign-plugin/index.ts +2 -3
- package/src/form-plugins/infer-inputs-plugin/index.ts +62 -14
- package/src/hooks/{index.tsx → index.ts} +1 -1
- package/src/index.ts +117 -8
- package/src/plugins/index.ts +11 -2
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/plugins/json-schema-preset/index.tsx +8 -24
- package/src/plugins/json-schema-preset/react.tsx +31 -0
- package/src/plugins/json-schema-preset/type-definition/array.tsx +13 -4
- package/src/plugins/json-schema-preset/type-definition/boolean.tsx +17 -1
- package/src/plugins/json-schema-preset/type-definition/date-time.tsx +21 -2
- package/src/plugins/json-schema-preset/type-definition/index.tsx +10 -1
- package/src/plugins/json-schema-preset/type-definition/integer.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/map.tsx +31 -0
- package/src/plugins/json-schema-preset/type-definition/number.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/object.tsx +9 -4
- package/src/plugins/json-schema-preset/type-definition/string.tsx +19 -1
- package/src/plugins/json-schema-preset/{manager.ts → types.ts} +7 -0
- package/src/shared/flow-value/index.ts +11 -1
- package/src/shared/flow-value/utils.ts +23 -11
- package/src/shared/index.ts +26 -5
- package/src/shared/inject-material/index.tsx +10 -6
- package/src/validate/index.ts +6 -0
- package/src/validate/validate-flow-value/index.tsx +1 -2
- package/bin/index.ts +0 -80
- package/bin/materials.ts +0 -134
- package/bin/project.ts +0 -95
- package/bin/utils/import.ts +0 -127
- package/bin/utils/traverse-file.ts +0 -60
- package/dist/esm/chunk-727SU246.js +0 -13
- package/dist/esm/chunk-727SU246.js.map +0 -1
- package/dist/esm/chunk-DEZUEMUM.js +0 -284
- package/dist/esm/chunk-DEZUEMUM.js.map +0 -1
- package/dist/esm/chunk-DUOXDOUE.js +0 -477
- package/dist/esm/chunk-DUOXDOUE.js.map +0 -1
- package/dist/esm/editor-6UMULJYB.js +0 -180
- package/dist/esm/editor-6UMULJYB.js.map +0 -1
- package/dist/esm/editor-EYOQTGMT.js +0 -282
- package/dist/esm/editor-EYOQTGMT.js.map +0 -1
- package/dist/esm/editor-OXPGKPF5.js +0 -167
- package/dist/esm/editor-OXPGKPF5.js.map +0 -1
- package/dist/esm/editor-VO6YAXRC.js +0 -249
- package/dist/esm/editor-VO6YAXRC.js.map +0 -1
- package/dist/esm/editor-XYLKTB6L.js +0 -365
- package/dist/esm/editor-XYLKTB6L.js.map +0 -1
- package/dist/esm/index.js +0 -2668
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.mts +0 -1002
- package/dist/index.d.ts +0 -1002
- package/dist/index.js +0 -5100
- package/dist/index.js.map +0 -1
- package/src/components/assign-row/components/blur-input.tsx +0 -27
- package/src/components/code-editor/language-features.ts +0 -44
- package/src/components/condition-row/constants.ts +0 -134
- package/src/components/condition-row/hooks/useOp.tsx +0 -56
- package/src/components/condition-row/hooks/useRule.ts +0 -35
- package/src/components/db-condition-row/hooks/use-left.tsx +0 -66
- package/src/components/db-condition-row/hooks/use-op.tsx +0 -59
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +0 -174
- package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +0 -83
- package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +0 -94
- /package/src/components/{json-editor-with-variables → coze-editor-extensions}/styles.tsx +0 -0
- /package/src/{typings/flow-value/index.ts → shared/flow-value/types.ts} +0 -0
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
|
|
9
|
-
|
|
10
|
-
import { InputsTree } from './extensions/inputs-tree';
|
|
9
|
+
import { EditorInputsTree } from '@/components/coze-editor-extensions';
|
|
11
10
|
|
|
12
11
|
export interface PromptEditorWithInputsProps extends PromptEditorPropsType {
|
|
13
12
|
inputsValues: any;
|
|
@@ -19,7 +18,7 @@ export function PromptEditorWithInputs({
|
|
|
19
18
|
}: PromptEditorWithInputsProps) {
|
|
20
19
|
return (
|
|
21
20
|
<PromptEditor {...restProps}>
|
|
22
|
-
<
|
|
21
|
+
<EditorInputsTree inputsValues={inputsValues} />
|
|
23
22
|
</PromptEditor>
|
|
24
23
|
);
|
|
25
24
|
}
|
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
|
|
9
|
-
|
|
10
|
-
import { VariableTree } from './extensions/variable-tree';
|
|
11
|
-
import { VariableTagInject } from './extensions/variable-tag';
|
|
9
|
+
import { EditorVariableTree, EditorVariableTagInject } from '@/components/coze-editor-extensions';
|
|
12
10
|
|
|
13
11
|
export interface PromptEditorWithVariablesProps extends PromptEditorPropsType {}
|
|
14
12
|
|
|
15
13
|
export function PromptEditorWithVariables(props: PromptEditorWithVariablesProps) {
|
|
16
14
|
return (
|
|
17
15
|
<PromptEditor {...props}>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
16
|
+
<EditorVariableTree />
|
|
17
|
+
<EditorVariableTagInject />
|
|
20
18
|
</PromptEditor>
|
|
21
19
|
);
|
|
22
20
|
}
|
|
@@ -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 { I18n } from '@flowgram.ai/editor';
|
|
9
|
+
|
|
10
|
+
import { EditorVariableTree, EditorVariableTagInject } from '@/components/coze-editor-extensions';
|
|
11
|
+
import { SQLCodeEditor, type CodeEditorPropsType } from '@/components/code-editor';
|
|
12
|
+
|
|
13
|
+
export interface SQLEditorWithVariablesProps extends Omit<CodeEditorPropsType, 'languageId'> {}
|
|
14
|
+
|
|
15
|
+
export function SQLEditorWithVariables(props: SQLEditorWithVariablesProps) {
|
|
16
|
+
return (
|
|
17
|
+
<SQLCodeEditor
|
|
18
|
+
activeLinePlaceholder={I18n.t("Press '@' to Select variable")}
|
|
19
|
+
{...props}
|
|
20
|
+
options={{
|
|
21
|
+
...(props.options || {}),
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
<EditorVariableTree />
|
|
25
|
+
<EditorVariableTagInject />
|
|
26
|
+
</SQLCodeEditor>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { lazySuspense } from '@/shared';
|
|
7
|
+
|
|
8
|
+
export const SQLEditorWithVariables = lazySuspense(() =>
|
|
9
|
+
import('./editor').then((module) => ({ default: module.SQLEditorWithVariables }))
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export type { SQLEditorWithVariablesProps } from './editor';
|
|
@@ -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) => {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
VariableFieldKeyRenameService,
|
|
11
11
|
} from '@flowgram.ai/editor';
|
|
12
12
|
|
|
13
|
-
import { IFlowRefValue, IFlowTemplateValue } from '@/
|
|
13
|
+
import { IFlowRefValue, IFlowTemplateValue } from '@/shared';
|
|
14
14
|
import { FlowValueUtils } from '@/shared';
|
|
15
15
|
|
|
16
16
|
/**
|
package/src/effects/index.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
6
|
+
export { autoRenameRefEffect } from './auto-rename-ref';
|
|
7
|
+
export { listenRefSchemaChange } from './listen-ref-schema-change';
|
|
8
|
+
export { listenRefValueChange } from './listen-ref-value-change';
|
|
9
|
+
export { provideBatchInputEffect } from './provide-batch-input';
|
|
10
|
+
export { provideJsonSchemaOutputs } from './provide-json-schema-outputs';
|
|
11
|
+
export { syncVariableTitle } from './sync-variable-title';
|
|
12
|
+
export { validateWhenVariableSync } from './validate-when-variable-sync';
|
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
EffectOptions,
|
|
9
9
|
FlowNodeRegistry,
|
|
10
10
|
createEffectFromVariableProvider,
|
|
11
|
-
getNodeForm,
|
|
12
11
|
} from '@flowgram.ai/editor';
|
|
13
12
|
|
|
14
|
-
import { IFlowRefValue } from '@/
|
|
13
|
+
import { IFlowRefValue } from '@/shared';
|
|
15
14
|
|
|
16
15
|
export const provideBatchInputEffect: EffectOptions[] = createEffectFromVariableProvider({
|
|
17
16
|
private: true,
|
|
@@ -19,7 +18,7 @@ export const provideBatchInputEffect: EffectOptions[] = createEffectFromVariable
|
|
|
19
18
|
ASTFactory.createVariableDeclaration({
|
|
20
19
|
key: `${ctx.node.id}_locals`,
|
|
21
20
|
meta: {
|
|
22
|
-
title:
|
|
21
|
+
title: ctx.node.form?.getValueIn('title'),
|
|
23
22
|
icon: ctx.node.getNodeRegistry<FlowNodeRegistry>().info?.icon,
|
|
24
23
|
},
|
|
25
24
|
type: ASTFactory.createObject({
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
EffectOptions,
|
|
10
10
|
FlowNodeRegistry,
|
|
11
11
|
createEffectFromVariableProvider,
|
|
12
|
-
getNodeForm,
|
|
13
12
|
} from '@flowgram.ai/editor';
|
|
14
13
|
|
|
15
14
|
export const provideJsonSchemaOutputs: EffectOptions[] = createEffectFromVariableProvider({
|
|
@@ -17,7 +16,7 @@ export const provideJsonSchemaOutputs: EffectOptions[] = createEffectFromVariabl
|
|
|
17
16
|
ASTFactory.createVariableDeclaration({
|
|
18
17
|
key: `${ctx.node.id}`,
|
|
19
18
|
meta: {
|
|
20
|
-
title:
|
|
19
|
+
title: ctx.node.form?.getValueIn('title') || ctx.node.id,
|
|
21
20
|
icon: ctx.node.getNodeRegistry<FlowNodeRegistry>().info?.icon,
|
|
22
21
|
},
|
|
23
22
|
type: JsonSchemaUtils.schemaToAST(value),
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { set } from 'lodash-es';
|
|
7
|
+
import { JsonSchemaUtils } from '@flowgram.ai/json-schema';
|
|
6
8
|
import {
|
|
7
9
|
ASTFactory,
|
|
8
10
|
createEffectFromVariableProvider,
|
|
9
11
|
defineFormPluginCreator,
|
|
10
12
|
FlowNodeRegistry,
|
|
11
|
-
getNodeForm,
|
|
12
13
|
getNodePrivateScope,
|
|
13
14
|
getNodeScope,
|
|
14
15
|
ScopeChainTransformService,
|
|
@@ -17,14 +18,14 @@ import {
|
|
|
17
18
|
FlowNodeScopeType,
|
|
18
19
|
} from '@flowgram.ai/editor';
|
|
19
20
|
|
|
20
|
-
import { IFlowRefValue } from '@/
|
|
21
|
+
import { IFlowRefValue } from '@/shared';
|
|
21
22
|
|
|
22
23
|
export const provideBatchOutputsEffect: EffectOptions[] = createEffectFromVariableProvider({
|
|
23
24
|
parse: (value: Record<string, IFlowRefValue>, ctx) => [
|
|
24
25
|
ASTFactory.createVariableDeclaration({
|
|
25
26
|
key: `${ctx.node.id}`,
|
|
26
27
|
meta: {
|
|
27
|
-
title:
|
|
28
|
+
title: ctx.node.form?.getValueIn('title'),
|
|
28
29
|
icon: ctx.node.getNodeRegistry<FlowNodeRegistry>().info?.icon,
|
|
29
30
|
},
|
|
30
31
|
type: ASTFactory.createObject({
|
|
@@ -46,59 +47,76 @@ export const provideBatchOutputsEffect: EffectOptions[] = createEffectFromVariab
|
|
|
46
47
|
/**
|
|
47
48
|
* Free Layout only right now
|
|
48
49
|
*/
|
|
49
|
-
export const createBatchOutputsFormPlugin: FormPluginCreator<{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
export const createBatchOutputsFormPlugin: FormPluginCreator<{
|
|
51
|
+
outputKey: string;
|
|
52
|
+
/**
|
|
53
|
+
* if set, infer json schema to inferTargetKey when submit
|
|
54
|
+
*/
|
|
55
|
+
inferTargetKey?: string;
|
|
56
|
+
}> = defineFormPluginCreator({
|
|
57
|
+
name: 'batch-outputs-plugin',
|
|
58
|
+
onSetupFormMeta({ mergeEffect, addFormatOnSubmit }, { outputKey, inferTargetKey }) {
|
|
59
|
+
mergeEffect({
|
|
60
|
+
[outputKey]: provideBatchOutputsEffect,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (inferTargetKey) {
|
|
64
|
+
addFormatOnSubmit((formData, ctx) => {
|
|
65
|
+
const outputVariable = getNodeScope(ctx.node).output.variables?.[0];
|
|
66
|
+
|
|
67
|
+
if (outputVariable?.type) {
|
|
68
|
+
set(formData, inferTargetKey, JsonSchemaUtils.astToSchema(outputVariable?.type));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return formData;
|
|
55
72
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
onInit(ctx, { outputKey }) {
|
|
76
|
+
const chainTransformService = ctx.node.getService(ScopeChainTransformService);
|
|
59
77
|
|
|
60
|
-
|
|
78
|
+
const batchNodeType = ctx.node.flowNodeType;
|
|
61
79
|
|
|
62
|
-
|
|
80
|
+
const transformerId = `${batchNodeType}-outputs`;
|
|
63
81
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
82
|
+
if (chainTransformService.hasTransformer(transformerId)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
67
85
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
chainTransformService.registerTransformer(transformerId, {
|
|
87
|
+
transformCovers: (covers, ctx) => {
|
|
88
|
+
const node = ctx.scope.meta?.node;
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
// Child Node's variable can cover parent
|
|
91
|
+
if (node?.parent?.flowNodeType === batchNodeType) {
|
|
92
|
+
return [...covers, getNodeScope(node.parent)];
|
|
93
|
+
}
|
|
76
94
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
95
|
+
return covers;
|
|
96
|
+
},
|
|
97
|
+
transformDeps(scopes, ctx) {
|
|
98
|
+
const scopeMeta = ctx.scope.meta;
|
|
81
99
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
100
|
+
if (scopeMeta?.type === FlowNodeScopeType.private) {
|
|
101
|
+
return scopes;
|
|
102
|
+
}
|
|
85
103
|
|
|
86
|
-
|
|
104
|
+
const node = scopeMeta?.node;
|
|
87
105
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
// Public of Loop Node depends on child Node
|
|
107
|
+
if (node?.flowNodeType === batchNodeType) {
|
|
108
|
+
// Get all child blocks
|
|
109
|
+
const childBlocks = node.blocks;
|
|
92
110
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
// public scope of all child blocks
|
|
112
|
+
return [
|
|
113
|
+
getNodePrivateScope(node),
|
|
114
|
+
...childBlocks.map((_childBlock) => getNodeScope(_childBlock)),
|
|
115
|
+
];
|
|
116
|
+
}
|
|
99
117
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
118
|
+
return scopes;
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
});
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
6
|
+
export { createBatchOutputsFormPlugin, provideBatchOutputsEffect } from './batch-outputs-plugin';
|
|
7
|
+
export { createInferAssignPlugin } from './infer-assign-plugin';
|
|
8
|
+
export { createInferInputsPlugin } from './infer-inputs-plugin';
|
|
@@ -10,11 +10,10 @@ import {
|
|
|
10
10
|
createEffectFromVariableProvider,
|
|
11
11
|
defineFormPluginCreator,
|
|
12
12
|
FlowNodeRegistry,
|
|
13
|
-
getNodeForm,
|
|
14
13
|
getNodeScope,
|
|
15
14
|
} from '@flowgram.ai/editor';
|
|
16
15
|
|
|
17
|
-
import { IFlowRefValue, IFlowValue } from '@/
|
|
16
|
+
import { IFlowRefValue, IFlowValue } from '@/shared';
|
|
18
17
|
|
|
19
18
|
type AssignValueType =
|
|
20
19
|
| {
|
|
@@ -51,7 +50,7 @@ export const createInferAssignPlugin = defineFormPluginCreator<InputConfig>({
|
|
|
51
50
|
ASTFactory.createVariableDeclaration({
|
|
52
51
|
key: `${ctx.node.id}`,
|
|
53
52
|
meta: {
|
|
54
|
-
title:
|
|
53
|
+
title: ctx.node.form?.getValueIn('title'),
|
|
55
54
|
icon: ctx.node.getNodeRegistry<FlowNodeRegistry>().info?.icon,
|
|
56
55
|
},
|
|
57
56
|
type: ASTFactory.createObject({
|
|
@@ -3,34 +3,82 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { get, set } from 'lodash-es';
|
|
6
|
+
import { get, omit, set } from 'lodash-es';
|
|
7
|
+
import { Immer } from 'immer';
|
|
7
8
|
import { defineFormPluginCreator, getNodePrivateScope, getNodeScope } from '@flowgram.ai/editor';
|
|
8
9
|
|
|
9
10
|
import { FlowValueUtils } from '@/shared';
|
|
10
11
|
|
|
12
|
+
const { produce } = new Immer({ autoFreeze: false });
|
|
13
|
+
|
|
11
14
|
interface InputConfig {
|
|
12
15
|
sourceKey: string;
|
|
13
16
|
targetKey: string;
|
|
14
17
|
scope?: 'private' | 'public';
|
|
18
|
+
/**
|
|
19
|
+
* For backend runtime, constant schema is redundant, so we can choose to ignore it
|
|
20
|
+
*/
|
|
21
|
+
ignoreConstantSchema?: boolean;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export const createInferInputsPlugin = defineFormPluginCreator<InputConfig>({
|
|
18
|
-
onSetupFormMeta(
|
|
25
|
+
onSetupFormMeta(
|
|
26
|
+
{ addFormatOnSubmit, addFormatOnInit },
|
|
27
|
+
{ sourceKey, targetKey, scope, ignoreConstantSchema }
|
|
28
|
+
) {
|
|
19
29
|
if (!sourceKey || !targetKey) {
|
|
20
30
|
return;
|
|
21
31
|
}
|
|
22
32
|
|
|
23
|
-
addFormatOnSubmit((formData, ctx) =>
|
|
24
|
-
|
|
25
|
-
formData,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
addFormatOnSubmit((formData, ctx) =>
|
|
34
|
+
produce(formData, (draft: any) => {
|
|
35
|
+
const sourceData = get(formData, sourceKey);
|
|
36
|
+
|
|
37
|
+
set(
|
|
38
|
+
draft,
|
|
39
|
+
targetKey,
|
|
40
|
+
FlowValueUtils.inferJsonSchema(
|
|
41
|
+
sourceData,
|
|
42
|
+
scope === 'private' ? getNodePrivateScope(ctx.node) : getNodeScope(ctx.node)
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
if (ignoreConstantSchema) {
|
|
47
|
+
for (const { value, path } of FlowValueUtils.traverse(sourceData, {
|
|
48
|
+
includeTypes: ['constant'],
|
|
49
|
+
})) {
|
|
50
|
+
if (FlowValueUtils.isConstant(value) && value?.schema) {
|
|
51
|
+
set(formData, `${sourceKey}.${path}`, omit(value, ['schema']));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
if (ignoreConstantSchema) {
|
|
59
|
+
// Revert Schema in frontend
|
|
60
|
+
addFormatOnInit((formData, ctx) => {
|
|
61
|
+
const targetSchema = get(formData, targetKey);
|
|
62
|
+
|
|
63
|
+
if (!targetSchema) {
|
|
64
|
+
return formData;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// For backend data, it's not necessary to use immer
|
|
68
|
+
for (const { value, pathArr } of FlowValueUtils.traverse(get(formData, sourceKey), {
|
|
69
|
+
includeTypes: ['constant'],
|
|
70
|
+
})) {
|
|
71
|
+
if (FlowValueUtils.isConstant(value) && !value?.schema) {
|
|
72
|
+
const schemaPath = pathArr.map((_item) => `properties.${_item}`).join('.');
|
|
73
|
+
const schema = get(targetSchema, schemaPath);
|
|
74
|
+
if (schema) {
|
|
75
|
+
set(value, 'schema', schema);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return formData;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
35
83
|
},
|
|
36
84
|
});
|
package/src/index.ts
CHANGED
|
@@ -3,11 +3,120 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export {
|
|
7
|
+
AssignRow,
|
|
8
|
+
AssignRows,
|
|
9
|
+
BaseCodeEditor,
|
|
10
|
+
BatchOutputs,
|
|
11
|
+
BatchVariableSelector,
|
|
12
|
+
BlurInput,
|
|
13
|
+
CodeEditor,
|
|
14
|
+
CodeEditorMini,
|
|
15
|
+
ConditionPresetOp,
|
|
16
|
+
ConditionProvider,
|
|
17
|
+
ConditionRow,
|
|
18
|
+
ConstantInput,
|
|
19
|
+
DBConditionRow,
|
|
20
|
+
DisplayFlowValue,
|
|
21
|
+
DisplayInputsValueAllInTag,
|
|
22
|
+
DisplayInputsValues,
|
|
23
|
+
DisplayOutputs,
|
|
24
|
+
DisplaySchemaTag,
|
|
25
|
+
DisplaySchemaTree,
|
|
26
|
+
DynamicValueInput,
|
|
27
|
+
EditorInputsTree,
|
|
28
|
+
EditorVariableTagInject,
|
|
29
|
+
EditorVariableTree,
|
|
30
|
+
InjectDynamicValueInput,
|
|
31
|
+
InjectTypeSelector,
|
|
32
|
+
InjectVariableSelector,
|
|
33
|
+
InputsValues,
|
|
34
|
+
InputsValuesTree,
|
|
35
|
+
JsonCodeEditor,
|
|
36
|
+
JsonEditorWithVariables,
|
|
37
|
+
JsonSchemaEditor,
|
|
38
|
+
PromptEditor,
|
|
39
|
+
PromptEditorWithInputs,
|
|
40
|
+
PromptEditorWithVariables,
|
|
41
|
+
PythonCodeEditor,
|
|
42
|
+
SQLCodeEditor,
|
|
43
|
+
SQLEditorWithVariables,
|
|
44
|
+
ShellCodeEditor,
|
|
45
|
+
TypeScriptCodeEditor,
|
|
46
|
+
TypeSelector,
|
|
47
|
+
VariableSelector,
|
|
48
|
+
VariableSelectorProvider,
|
|
49
|
+
getTypeSelectValue,
|
|
50
|
+
parseTypeSelectValue,
|
|
51
|
+
type AssignValueType,
|
|
52
|
+
type CodeEditorPropsType,
|
|
53
|
+
type ConditionOpConfig,
|
|
54
|
+
type ConditionOpConfigs,
|
|
55
|
+
type ConditionRowValueType,
|
|
56
|
+
type ConstantInputStrategy,
|
|
57
|
+
type DBConditionOptionType,
|
|
58
|
+
type DBConditionRowValueType,
|
|
59
|
+
type IConditionRule,
|
|
60
|
+
type IConditionRuleFactory,
|
|
61
|
+
type JsonEditorWithVariablesProps,
|
|
62
|
+
type PromptEditorPropsType,
|
|
63
|
+
type PromptEditorWithInputsProps,
|
|
64
|
+
type PromptEditorWithVariablesProps,
|
|
65
|
+
type SQLEditorWithVariablesProps,
|
|
66
|
+
type TypeSelectorProps,
|
|
67
|
+
type VariableSelectorProps,
|
|
68
|
+
useCondition,
|
|
69
|
+
useConditionContext,
|
|
70
|
+
useVariableTree,
|
|
71
|
+
} from './components';
|
|
72
|
+
export {
|
|
73
|
+
autoRenameRefEffect,
|
|
74
|
+
listenRefSchemaChange,
|
|
75
|
+
listenRefValueChange,
|
|
76
|
+
provideBatchInputEffect,
|
|
77
|
+
provideJsonSchemaOutputs,
|
|
78
|
+
syncVariableTitle,
|
|
79
|
+
validateWhenVariableSync,
|
|
80
|
+
} from './effects';
|
|
81
|
+
export {
|
|
82
|
+
createBatchOutputsFormPlugin,
|
|
83
|
+
createInferAssignPlugin,
|
|
84
|
+
createInferInputsPlugin,
|
|
85
|
+
provideBatchOutputsEffect,
|
|
86
|
+
} from './form-plugins';
|
|
87
|
+
export { useObjectList } from './hooks';
|
|
88
|
+
export {
|
|
89
|
+
JsonSchemaTypePresetProvider,
|
|
90
|
+
JsonSchemaUtils,
|
|
91
|
+
createDisableDeclarationPlugin,
|
|
92
|
+
createTypePresetPlugin,
|
|
93
|
+
type ConstantRendererProps,
|
|
94
|
+
type IJsonSchema,
|
|
95
|
+
type JsonSchemaBasicType,
|
|
96
|
+
type JsonSchemaTypeRegistry,
|
|
97
|
+
useTypeManager,
|
|
98
|
+
} from './plugins';
|
|
99
|
+
export {
|
|
100
|
+
FlowValueUtils,
|
|
101
|
+
createInjectMaterial,
|
|
102
|
+
formatLegacyRefOnInit,
|
|
103
|
+
formatLegacyRefOnSubmit,
|
|
104
|
+
formatLegacyRefToNewRef,
|
|
105
|
+
formatNewRefToLegacyRef,
|
|
106
|
+
isLegacyFlowRefValueSchema,
|
|
107
|
+
isNewFlowRefValueSchema,
|
|
108
|
+
lazySuspense,
|
|
109
|
+
polyfillCreateRoot,
|
|
110
|
+
type FlowValueType,
|
|
111
|
+
type IFlowConstantRefValue,
|
|
112
|
+
type IFlowConstantValue,
|
|
113
|
+
type IFlowExpressionValue,
|
|
114
|
+
type IFlowRefValue,
|
|
115
|
+
type IFlowTemplateValue,
|
|
116
|
+
type IFlowValue,
|
|
117
|
+
type IFlowValueExtra,
|
|
118
|
+
type IPolyfillRoot,
|
|
119
|
+
unstableSetCreateRoot,
|
|
120
|
+
withSuspense,
|
|
121
|
+
} from './shared';
|
|
122
|
+
export { validateFlowValue } from './validate';
|