@flowgram.ai/form-materials 0.4.9 → 0.4.11
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 +6 -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.js +117 -0
- package/dist/cjs/components/code-editor/index.js +57 -0
- package/dist/cjs/components/code-editor/init-worker.js +56 -0
- package/dist/cjs/components/code-editor/language-features.js +21 -0
- package/dist/cjs/components/code-editor/theme/dark.js +188 -0
- package/dist/cjs/components/code-editor/theme/index.js +11 -0
- package/dist/cjs/components/code-editor/theme/light.js +195 -0
- package/dist/cjs/components/code-editor/utils.js +42 -0
- package/dist/cjs/components/code-editor-mini/index.js +66 -0
- package/dist/cjs/components/condition-row/constants.js +165 -0
- package/dist/cjs/components/condition-row/hooks/useOp.js +78 -0
- package/dist/cjs/components/condition-row/hooks/useRule.js +68 -0
- package/dist/cjs/components/condition-row/index.js +123 -0
- package/dist/cjs/components/condition-row/styles.js +77 -0
- package/dist/cjs/components/condition-row/types.js +52 -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 +151 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +106 -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/hooks/use-left.js +86 -0
- package/dist/cjs/components/db-condition-row/hooks/use-op.js +79 -0
- package/dist/cjs/components/db-condition-row/index.js +115 -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 +166 -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 +85 -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/type-selector/index.js +139 -0
- package/dist/cjs/components/variable-selector/context.js +56 -0
- package/dist/cjs/components/variable-selector/index.js +144 -0
- package/dist/cjs/components/variable-selector/styles.js +114 -0
- package/dist/cjs/components/variable-selector/use-variable-tree.js +100 -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 +97 -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 +47 -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 +237 -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 +49 -0
- package/dist/cjs/plugins/json-schema-preset/index.js +57 -0
- package/dist/cjs/plugins/json-schema-preset/manager.js +18 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +63 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +52 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +53 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +54 -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 +142 -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.mjs +55 -0
- package/dist/esm/components/code-editor/index.mjs +5 -0
- package/dist/esm/components/code-editor/init-worker.mjs +19 -0
- package/dist/esm/components/code-editor/language-features.mjs +15 -0
- package/dist/esm/components/code-editor/theme/dark.mjs +154 -0
- package/dist/esm/components/code-editor/theme/index.mjs +5 -0
- package/dist/esm/components/code-editor/theme/light.mjs +161 -0
- package/dist/esm/components/code-editor/utils.mjs +8 -0
- package/dist/esm/components/code-editor-mini/index.mjs +22 -0
- package/dist/esm/components/condition-row/constants.mjs +128 -0
- package/dist/esm/components/condition-row/hooks/useOp.mjs +44 -0
- package/dist/esm/components/condition-row/hooks/useRule.mjs +34 -0
- package/dist/esm/components/condition-row/index.mjs +89 -0
- package/dist/esm/components/condition-row/styles.mjs +21 -0
- package/dist/esm/components/condition-row/types.mjs +18 -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 +117 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +72 -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/hooks/use-left.mjs +52 -0
- package/dist/esm/components/db-condition-row/hooks/use-op.mjs +45 -0
- package/dist/esm/components/db-condition-row/index.mjs +81 -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 +27 -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 +51 -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/type-selector/index.mjs +96 -0
- package/dist/esm/components/variable-selector/context.mjs +16 -0
- package/dist/esm/components/variable-selector/index.mjs +101 -0
- package/dist/esm/components/variable-selector/styles.mjs +58 -0
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +66 -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 +60 -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 +13 -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 +15 -0
- package/dist/esm/plugins/json-schema-preset/index.mjs +14 -0
- package/dist/esm/plugins/json-schema-preset/manager.mjs +0 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +29 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +18 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +19 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +20 -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 +108 -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.d.ts +23 -0
- package/dist/types/components/code-editor/index.d.ts +6 -0
- package/{src/validate/index.tsx → dist/types/components/code-editor/init-worker.d.ts} +1 -2
- package/{src/typings/index.ts → dist/types/components/code-editor/language-features.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/dark.d.ts +6 -0
- package/{src/hooks/index.tsx → dist/types/components/code-editor/theme/index.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/light.d.ts +6 -0
- package/dist/types/components/code-editor/utils.d.ts +5 -0
- package/dist/types/components/code-editor-mini/index.d.ts +7 -0
- package/dist/types/components/condition-row/constants.d.ts +7 -0
- package/dist/types/components/condition-row/hooks/useOp.d.ts +18 -0
- package/dist/types/components/condition-row/hooks/useRule.d.ts +9 -0
- package/dist/types/components/condition-row/index.d.ts +22 -0
- package/dist/types/components/condition-row/styles.d.ts +9 -0
- package/dist/types/components/condition-row/types.d.ts +34 -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/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +5 -0
- 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/hooks/use-left.d.ts +18 -0
- package/dist/types/components/db-condition-row/hooks/use-op.d.ts +18 -0
- package/dist/types/components/db-condition-row/index.d.ts +19 -0
- package/dist/types/components/db-condition-row/styles.d.ts +12 -0
- package/dist/types/components/db-condition-row/types.d.ts +25 -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 +30 -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/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 +12 -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 +11 -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 +13 -0
- package/dist/types/plugins/json-schema-preset/manager.d.ts +17 -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 +5 -0
- package/dist/types/plugins/json-schema-preset/type-definition/integer.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/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 +65 -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 +20 -21
- 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.tsx +10 -9
- package/src/components/code-editor/init-worker.ts +27 -0
- package/src/components/code-editor/language-features.ts +6 -27
- package/src/components/code-editor/theme/dark.ts +1 -1
- package/src/components/code-editor/theme/index.ts +1 -1
- package/src/components/code-editor/theme/light.ts +1 -1
- package/src/components/condition-row/hooks/useRule.ts +1 -1
- package/src/components/condition-row/types.ts +1 -1
- 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 +1 -1
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +12 -6
- package/src/components/coze-editor-extensions/index.tsx +33 -0
- package/src/components/db-condition-row/types.ts +1 -1
- package/src/components/display-flow-value/index.tsx +1 -1
- 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 +55 -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 +6 -6
- 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/variable-selector/index.tsx +2 -0
- 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 +1 -1
- package/src/form-plugins/batch-outputs-plugin/index.ts +1 -1
- package/src/form-plugins/index.ts +3 -3
- package/src/form-plugins/infer-assign-plugin/index.ts +1 -1
- package/src/hooks/index.ts +6 -0
- package/src/index.ts +101 -8
- package/src/plugins/index.ts +11 -2
- package/src/plugins/json-schema-preset/index.tsx +4 -4
- package/src/shared/flow-value/index.ts +11 -1
- package/src/shared/flow-value/utils.ts +1 -2
- 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 -1
- 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-IHOHRV5V.js +0 -477
- package/dist/esm/chunk-IHOHRV5V.js.map +0 -1
- package/dist/esm/editor-4X7K477H.js +0 -282
- package/dist/esm/editor-4X7K477H.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-E2BQTPCD.js +0 -388
- package/dist/esm/editor-E2BQTPCD.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-Z24WLBPO.js +0 -249
- package/dist/esm/editor-Z24WLBPO.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 -5127
- package/dist/index.js.map +0 -1
- package/src/components/assign-row/components/blur-input.tsx +0 -27
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DataEvent, getNodeScope } from "@flowgram.ai/editor";
|
|
2
|
+
const listenRefValueChange = (cb)=>[
|
|
3
|
+
{
|
|
4
|
+
event: DataEvent.onValueInitOrChange,
|
|
5
|
+
effect: (params)=>{
|
|
6
|
+
const { context, value } = params;
|
|
7
|
+
if (value?.type !== 'ref') return ()=>null;
|
|
8
|
+
const disposable = getNodeScope(context.node).available.trackByKeyPath(value?.content || [], (v)=>{
|
|
9
|
+
cb({
|
|
10
|
+
...params,
|
|
11
|
+
variable: v
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
return ()=>{
|
|
15
|
+
disposable.dispose();
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
export { listenRefValueChange };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ASTFactory, createEffectFromVariableProvider, getNodeForm } from "@flowgram.ai/editor";
|
|
2
|
+
const provideBatchInputEffect = createEffectFromVariableProvider({
|
|
3
|
+
private: true,
|
|
4
|
+
parse: (value, ctx)=>[
|
|
5
|
+
ASTFactory.createVariableDeclaration({
|
|
6
|
+
key: `${ctx.node.id}_locals`,
|
|
7
|
+
meta: {
|
|
8
|
+
title: getNodeForm(ctx.node)?.getValueIn('title'),
|
|
9
|
+
icon: ctx.node.getNodeRegistry().info?.icon
|
|
10
|
+
},
|
|
11
|
+
type: ASTFactory.createObject({
|
|
12
|
+
properties: [
|
|
13
|
+
ASTFactory.createProperty({
|
|
14
|
+
key: 'item',
|
|
15
|
+
initializer: ASTFactory.createEnumerateExpression({
|
|
16
|
+
enumerateFor: ASTFactory.createKeyPathExpression({
|
|
17
|
+
keyPath: value.content || []
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
}),
|
|
21
|
+
ASTFactory.createProperty({
|
|
22
|
+
key: 'index',
|
|
23
|
+
type: ASTFactory.createNumber()
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
export { provideBatchInputEffect };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
2
|
+
import { ASTFactory, createEffectFromVariableProvider, getNodeForm } from "@flowgram.ai/editor";
|
|
3
|
+
const provideJsonSchemaOutputs = createEffectFromVariableProvider({
|
|
4
|
+
parse: (value, ctx)=>[
|
|
5
|
+
ASTFactory.createVariableDeclaration({
|
|
6
|
+
key: `${ctx.node.id}`,
|
|
7
|
+
meta: {
|
|
8
|
+
title: getNodeForm(ctx.node)?.getValueIn('title') || ctx.node.id,
|
|
9
|
+
icon: ctx.node.getNodeRegistry().info?.icon
|
|
10
|
+
},
|
|
11
|
+
type: JsonSchemaUtils.schemaToAST(value)
|
|
12
|
+
})
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
export { provideJsonSchemaOutputs };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataEvent, FlowNodeVariableData } from "@flowgram.ai/editor";
|
|
2
|
+
const syncVariableTitle = [
|
|
3
|
+
{
|
|
4
|
+
event: DataEvent.onValueChange,
|
|
5
|
+
effect: ({ value, context })=>{
|
|
6
|
+
context.node.getData(FlowNodeVariableData).allScopes.forEach((_scope)=>{
|
|
7
|
+
_scope.output.variables.forEach((_var)=>{
|
|
8
|
+
_var.updateMeta({
|
|
9
|
+
..._var.meta || {},
|
|
10
|
+
title: value || context.node.id,
|
|
11
|
+
icon: context.node.getNodeRegistry().info?.icon
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
export { syncVariableTitle };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isEmpty } from "lodash-es";
|
|
2
|
+
import { DataEvent, getNodePrivateScope, getNodeScope } from "@flowgram.ai/editor";
|
|
3
|
+
const validateWhenVariableSync = ({ scope } = {})=>[
|
|
4
|
+
{
|
|
5
|
+
event: DataEvent.onValueInit,
|
|
6
|
+
effect: ({ context, form })=>{
|
|
7
|
+
const nodeScope = 'private' === scope ? getNodePrivateScope(context.node) : getNodeScope(context.node);
|
|
8
|
+
const disposable = nodeScope.available.onListOrAnyVarChange(()=>{
|
|
9
|
+
if (!isEmpty(form.state.errors)) form.validate();
|
|
10
|
+
});
|
|
11
|
+
return ()=>disposable.dispose();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
export { validateWhenVariableSync };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ASTFactory, FlowNodeScopeType, ScopeChainTransformService, createEffectFromVariableProvider, defineFormPluginCreator, getNodeForm, getNodePrivateScope, getNodeScope } from "@flowgram.ai/editor";
|
|
2
|
+
const provideBatchOutputsEffect = createEffectFromVariableProvider({
|
|
3
|
+
parse: (value, ctx)=>[
|
|
4
|
+
ASTFactory.createVariableDeclaration({
|
|
5
|
+
key: `${ctx.node.id}`,
|
|
6
|
+
meta: {
|
|
7
|
+
title: getNodeForm(ctx.node)?.getValueIn('title'),
|
|
8
|
+
icon: ctx.node.getNodeRegistry().info?.icon
|
|
9
|
+
},
|
|
10
|
+
type: ASTFactory.createObject({
|
|
11
|
+
properties: Object.entries(value).map(([_key, value])=>ASTFactory.createProperty({
|
|
12
|
+
key: _key,
|
|
13
|
+
initializer: ASTFactory.createWrapArrayExpression({
|
|
14
|
+
wrapFor: ASTFactory.createKeyPathExpression({
|
|
15
|
+
keyPath: value?.content || []
|
|
16
|
+
})
|
|
17
|
+
})
|
|
18
|
+
}))
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
const createBatchOutputsFormPlugin = defineFormPluginCreator({
|
|
24
|
+
name: 'batch-outputs-plugin',
|
|
25
|
+
onSetupFormMeta ({ mergeEffect }, { outputKey }) {
|
|
26
|
+
mergeEffect({
|
|
27
|
+
[outputKey]: provideBatchOutputsEffect
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
onInit (ctx, { outputKey }) {
|
|
31
|
+
const chainTransformService = ctx.node.getService(ScopeChainTransformService);
|
|
32
|
+
const batchNodeType = ctx.node.flowNodeType;
|
|
33
|
+
const transformerId = `${batchNodeType}-outputs`;
|
|
34
|
+
if (chainTransformService.hasTransformer(transformerId)) return;
|
|
35
|
+
chainTransformService.registerTransformer(transformerId, {
|
|
36
|
+
transformCovers: (covers, ctx)=>{
|
|
37
|
+
const node = ctx.scope.meta?.node;
|
|
38
|
+
if (node?.parent?.flowNodeType === batchNodeType) return [
|
|
39
|
+
...covers,
|
|
40
|
+
getNodeScope(node.parent)
|
|
41
|
+
];
|
|
42
|
+
return covers;
|
|
43
|
+
},
|
|
44
|
+
transformDeps (scopes, ctx) {
|
|
45
|
+
const scopeMeta = ctx.scope.meta;
|
|
46
|
+
if (scopeMeta?.type === FlowNodeScopeType["private"]) return scopes;
|
|
47
|
+
const node = scopeMeta?.node;
|
|
48
|
+
if (node?.flowNodeType === batchNodeType) {
|
|
49
|
+
const childBlocks = node.blocks;
|
|
50
|
+
return [
|
|
51
|
+
getNodePrivateScope(node),
|
|
52
|
+
...childBlocks.map((_childBlock)=>getNodeScope(_childBlock))
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
return scopes;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export { createBatchOutputsFormPlugin, provideBatchOutputsEffect };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createBatchOutputsFormPlugin, provideBatchOutputsEffect } from "./batch-outputs-plugin/index.mjs";
|
|
2
|
+
import { createInferAssignPlugin } from "./infer-assign-plugin/index.mjs";
|
|
3
|
+
import { createInferInputsPlugin } from "./infer-inputs-plugin/index.mjs";
|
|
4
|
+
export { createBatchOutputsFormPlugin, createInferAssignPlugin, createInferInputsPlugin, provideBatchOutputsEffect };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { set, uniqBy } from "lodash-es";
|
|
2
|
+
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
3
|
+
import { ASTFactory, createEffectFromVariableProvider, defineFormPluginCreator, getNodeForm, getNodeScope } from "@flowgram.ai/editor";
|
|
4
|
+
const createInferAssignPlugin = defineFormPluginCreator({
|
|
5
|
+
onSetupFormMeta ({ addFormatOnSubmit, mergeEffect }, { assignKey, outputKey }) {
|
|
6
|
+
if (!assignKey || !outputKey) return;
|
|
7
|
+
mergeEffect({
|
|
8
|
+
[assignKey]: createEffectFromVariableProvider({
|
|
9
|
+
parse: (value, ctx)=>{
|
|
10
|
+
const declareRows = uniqBy(value.filter((_v)=>'declare' === _v.operator && _v.left && _v.right), 'left');
|
|
11
|
+
return [
|
|
12
|
+
ASTFactory.createVariableDeclaration({
|
|
13
|
+
key: `${ctx.node.id}`,
|
|
14
|
+
meta: {
|
|
15
|
+
title: getNodeForm(ctx.node)?.getValueIn('title'),
|
|
16
|
+
icon: ctx.node.getNodeRegistry().info?.icon
|
|
17
|
+
},
|
|
18
|
+
type: ASTFactory.createObject({
|
|
19
|
+
properties: declareRows.map((_v)=>ASTFactory.createProperty({
|
|
20
|
+
key: _v.left,
|
|
21
|
+
type: _v.right?.type === 'constant' ? JsonSchemaUtils.schemaToAST(_v.right?.schema || {}) : void 0,
|
|
22
|
+
initializer: _v.right?.type === 'ref' ? ASTFactory.createKeyPathExpression({
|
|
23
|
+
keyPath: _v.right?.content || []
|
|
24
|
+
}) : {}
|
|
25
|
+
}))
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
addFormatOnSubmit((formData, ctx)=>{
|
|
33
|
+
set(formData, outputKey, JsonSchemaUtils.astToSchema(getNodeScope(ctx.node).output.variables?.[0]?.type));
|
|
34
|
+
return formData;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export { createInferAssignPlugin };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { get, set } from "lodash-es";
|
|
2
|
+
import { defineFormPluginCreator, getNodePrivateScope, getNodeScope } from "@flowgram.ai/editor";
|
|
3
|
+
import { FlowValueUtils } from "../../shared/index.mjs";
|
|
4
|
+
const createInferInputsPlugin = defineFormPluginCreator({
|
|
5
|
+
onSetupFormMeta ({ addFormatOnSubmit }, { sourceKey, targetKey, scope }) {
|
|
6
|
+
if (!sourceKey || !targetKey) return;
|
|
7
|
+
addFormatOnSubmit((formData, ctx)=>{
|
|
8
|
+
set(formData, targetKey, FlowValueUtils.inferJsonSchema(get(formData, sourceKey), 'private' === scope ? getNodePrivateScope(ctx.node) : getNodeScope(ctx.node)));
|
|
9
|
+
return formData;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export { createInferInputsPlugin };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { nanoid } from "nanoid";
|
|
3
|
+
import { difference, get, isObject, set } from "lodash-es";
|
|
4
|
+
function genId() {
|
|
5
|
+
return nanoid();
|
|
6
|
+
}
|
|
7
|
+
function useObjectList({ value, onChange, sortIndexKey }) {
|
|
8
|
+
const [list, setList] = useState([]);
|
|
9
|
+
const effectVersion = useRef(0);
|
|
10
|
+
const changeVersion = useRef(0);
|
|
11
|
+
const getSortIndex = (value)=>{
|
|
12
|
+
if ('function' == typeof sortIndexKey) return get(value, sortIndexKey(value)) || 0;
|
|
13
|
+
return get(value, sortIndexKey || '') || 0;
|
|
14
|
+
};
|
|
15
|
+
useEffect(()=>{
|
|
16
|
+
effectVersion.current = effectVersion.current + 1;
|
|
17
|
+
if (effectVersion.current === changeVersion.current) return;
|
|
18
|
+
effectVersion.current = changeVersion.current;
|
|
19
|
+
setList((_prevList)=>{
|
|
20
|
+
const newKeys = Object.entries(value || {}).sort((a, b)=>getSortIndex(a[1]) - getSortIndex(b[1])).map(([key])=>key);
|
|
21
|
+
const oldKeys = _prevList.map((item)=>item.key).filter(Boolean);
|
|
22
|
+
const addKeys = difference(newKeys, oldKeys);
|
|
23
|
+
return _prevList.filter((item)=>!item.key || newKeys.includes(item.key)).map((item)=>({
|
|
24
|
+
id: item.id,
|
|
25
|
+
key: item.key,
|
|
26
|
+
value: item.key ? value?.[item.key] : item.value
|
|
27
|
+
})).concat(addKeys.map((_key)=>({
|
|
28
|
+
id: genId(),
|
|
29
|
+
key: _key,
|
|
30
|
+
value: value?.[_key]
|
|
31
|
+
})));
|
|
32
|
+
});
|
|
33
|
+
}, [
|
|
34
|
+
value
|
|
35
|
+
]);
|
|
36
|
+
const add = (defaultValue)=>{
|
|
37
|
+
setList((prevList)=>[
|
|
38
|
+
...prevList,
|
|
39
|
+
{
|
|
40
|
+
id: genId(),
|
|
41
|
+
value: defaultValue
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
const updateValue = (itemId, value)=>{
|
|
46
|
+
changeVersion.current = changeVersion.current + 1;
|
|
47
|
+
setList((prevList)=>{
|
|
48
|
+
const nextList = prevList.map((_item)=>{
|
|
49
|
+
if (_item.id === itemId) return {
|
|
50
|
+
..._item,
|
|
51
|
+
value
|
|
52
|
+
};
|
|
53
|
+
return _item;
|
|
54
|
+
});
|
|
55
|
+
onChange(Object.fromEntries(nextList.filter((item)=>item.key).map((item)=>[
|
|
56
|
+
item.key,
|
|
57
|
+
item.value
|
|
58
|
+
]).map((_res, idx)=>{
|
|
59
|
+
const indexKey = 'function' == typeof sortIndexKey ? sortIndexKey(_res[1]) : sortIndexKey;
|
|
60
|
+
if (isObject(_res[1]) && indexKey) set(_res[1], indexKey, idx);
|
|
61
|
+
return _res;
|
|
62
|
+
})));
|
|
63
|
+
return nextList;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const updateKey = (itemId, key)=>{
|
|
67
|
+
changeVersion.current = changeVersion.current + 1;
|
|
68
|
+
setList((prevList)=>{
|
|
69
|
+
const nextList = prevList.map((_item)=>{
|
|
70
|
+
if (_item.id === itemId) return {
|
|
71
|
+
..._item,
|
|
72
|
+
key
|
|
73
|
+
};
|
|
74
|
+
return _item;
|
|
75
|
+
});
|
|
76
|
+
onChange(Object.fromEntries(nextList.filter((item)=>item.key).map((item)=>[
|
|
77
|
+
item.key,
|
|
78
|
+
item.value
|
|
79
|
+
])));
|
|
80
|
+
return nextList;
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const remove = (itemId)=>{
|
|
84
|
+
changeVersion.current = changeVersion.current + 1;
|
|
85
|
+
setList((prevList)=>{
|
|
86
|
+
const nextList = prevList.filter((_item)=>_item.id !== itemId);
|
|
87
|
+
onChange(Object.fromEntries(nextList.filter((item)=>item.key).map((item)=>[
|
|
88
|
+
item.key,
|
|
89
|
+
item.value
|
|
90
|
+
])));
|
|
91
|
+
return nextList;
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
list,
|
|
96
|
+
add,
|
|
97
|
+
updateKey,
|
|
98
|
+
updateValue,
|
|
99
|
+
remove
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export { useObjectList };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AssignRow, AssignRows, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, ConditionRow, ConstantInput, DBConditionRow, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, EditorInputsTree, EditorVariableTagInject, EditorVariableTree, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, PromptEditor, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, VariableSelector, VariableSelectorProvider, getTypeSelectValue, parseTypeSelectValue, useVariableTree } from "./components/index.mjs";
|
|
2
|
+
import { autoRenameRefEffect, listenRefSchemaChange, listenRefValueChange, provideBatchInputEffect, provideJsonSchemaOutputs, syncVariableTitle, validateWhenVariableSync } from "./effects/index.mjs";
|
|
3
|
+
import { createBatchOutputsFormPlugin, createInferAssignPlugin, createInferInputsPlugin, provideBatchOutputsEffect } from "./form-plugins/index.mjs";
|
|
4
|
+
import { useObjectList } from "./hooks/index.mjs";
|
|
5
|
+
import { JsonSchemaTypePresetProvider, JsonSchemaUtils, createDisableDeclarationPlugin, createTypePresetPlugin, useTypeManager } from "./plugins/index.mjs";
|
|
6
|
+
import { FlowValueUtils, createInjectMaterial, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, lazySuspense, polyfillCreateRoot, unstableSetCreateRoot, withSuspense } from "./shared/index.mjs";
|
|
7
|
+
import { validateFlowValue } from "./validate/index.mjs";
|
|
8
|
+
export { AssignRow, AssignRows, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, ConditionRow, ConstantInput, DBConditionRow, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, EditorInputsTree, EditorVariableTagInject, EditorVariableTree, FlowValueUtils, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, JsonSchemaUtils, PromptEditor, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, VariableSelector, VariableSelectorProvider, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, lazySuspense, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync, withSuspense };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ASTMatch, VariableEngine, definePluginCreator } from "@flowgram.ai/editor";
|
|
2
|
+
const createDisableDeclarationPlugin = definePluginCreator({
|
|
3
|
+
onInit (ctx) {
|
|
4
|
+
const variableEngine = ctx.get(VariableEngine);
|
|
5
|
+
const handleEvent = (action)=>{
|
|
6
|
+
if (ASTMatch.isVariableDeclaration(action.ast)) {
|
|
7
|
+
if (!action.ast.meta?.disabled) action.ast.updateMeta({
|
|
8
|
+
...action.ast.meta || {},
|
|
9
|
+
disabled: true
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
variableEngine.onGlobalEvent('NewAST', handleEvent);
|
|
14
|
+
variableEngine.onGlobalEvent('UpdateAST', handleEvent);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { createDisableDeclarationPlugin };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createDisableDeclarationPlugin } from "./disable-declaration-plugin/index.mjs";
|
|
2
|
+
import { JsonSchemaTypePresetProvider, JsonSchemaUtils, createTypePresetPlugin, useTypeManager } from "./json-schema-preset/index.mjs";
|
|
3
|
+
export { JsonSchemaTypePresetProvider, JsonSchemaUtils, createDisableDeclarationPlugin, createTypePresetPlugin, useTypeManager };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseTypeManager, jsonSchemaContainerModule } from "@flowgram.ai/json-schema";
|
|
2
|
+
import { definePluginCreator } from "@flowgram.ai/editor";
|
|
3
|
+
import { jsonSchemaTypePreset } from "./type-definition/index.mjs";
|
|
4
|
+
const createTypePresetPlugin = definePluginCreator({
|
|
5
|
+
onInit (ctx, opts) {
|
|
6
|
+
const typeManager = ctx.get(BaseTypeManager);
|
|
7
|
+
jsonSchemaTypePreset.forEach((_type)=>typeManager.register(_type));
|
|
8
|
+
opts.types?.forEach((_type)=>typeManager.register(_type));
|
|
9
|
+
opts.unregisterTypes?.forEach((_type)=>typeManager.unregister(_type));
|
|
10
|
+
},
|
|
11
|
+
containerModules: [
|
|
12
|
+
jsonSchemaContainerModule
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
export { createTypePresetPlugin };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { JsonSchemaUtils, TypePresetProvider, useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
|
+
import { jsonSchemaTypePreset } from "./type-definition/index.mjs";
|
|
5
|
+
import { createTypePresetPlugin } from "./create-type-preset-plugin.mjs";
|
|
6
|
+
const json_schema_preset_useTypeManager = ()=>useTypeManager();
|
|
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 };
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { CodeEditorMini } from "../../../components/code-editor-mini/index.mjs";
|
|
5
|
+
const arrayRegistry = {
|
|
6
|
+
type: 'array',
|
|
7
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(CodeEditorMini, {
|
|
8
|
+
value: props.value,
|
|
9
|
+
languageId: "json",
|
|
10
|
+
onChange: (v)=>props.onChange?.(v),
|
|
11
|
+
placeholder: I18n.t('Please Input Array'),
|
|
12
|
+
readonly: props.readonly
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
export { arrayRegistry };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { Select } from "@douyinfe/semi-ui";
|
|
5
|
+
const booleanRegistry = {
|
|
6
|
+
type: 'boolean',
|
|
7
|
+
ConstantRenderer: (props)=>{
|
|
8
|
+
const { value, onChange, ...rest } = props;
|
|
9
|
+
return /*#__PURE__*/ jsx(Select, {
|
|
10
|
+
placeholder: I18n.t('Please Select Boolean'),
|
|
11
|
+
size: "small",
|
|
12
|
+
disabled: props.readonly,
|
|
13
|
+
optionList: [
|
|
14
|
+
{
|
|
15
|
+
label: I18n.t('True'),
|
|
16
|
+
value: 1
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: I18n.t('False'),
|
|
20
|
+
value: 0
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
value: value ? 1 : 0,
|
|
24
|
+
onChange: (value)=>onChange?.(!!value),
|
|
25
|
+
...rest
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export { booleanRegistry };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { DatePicker } from "@douyinfe/semi-ui";
|
|
4
|
+
const dateTimeRegistry = {
|
|
5
|
+
type: 'date-time',
|
|
6
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(DatePicker, {
|
|
7
|
+
size: "small",
|
|
8
|
+
type: "dateTime",
|
|
9
|
+
density: "compact",
|
|
10
|
+
style: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
...props.style || {}
|
|
13
|
+
},
|
|
14
|
+
disabled: props.readonly,
|
|
15
|
+
...props
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
export { dateTimeRegistry };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsonSchemaTypeManager } from "@flowgram.ai/json-schema";
|
|
2
|
+
import { stringRegistry } from "./string.mjs";
|
|
3
|
+
import { objectRegistry } from "./object.mjs";
|
|
4
|
+
import { numberRegistry } from "./number.mjs";
|
|
5
|
+
import { integerRegistry } from "./integer.mjs";
|
|
6
|
+
import { dateTimeRegistry } from "./date-time.mjs";
|
|
7
|
+
import { booleanRegistry } from "./boolean.mjs";
|
|
8
|
+
import { arrayRegistry } from "./array.mjs";
|
|
9
|
+
const jsonSchemaTypePreset = [
|
|
10
|
+
stringRegistry,
|
|
11
|
+
objectRegistry,
|
|
12
|
+
numberRegistry,
|
|
13
|
+
integerRegistry,
|
|
14
|
+
booleanRegistry,
|
|
15
|
+
arrayRegistry,
|
|
16
|
+
dateTimeRegistry
|
|
17
|
+
];
|
|
18
|
+
jsonSchemaTypePreset.forEach((_type)=>jsonSchemaTypeManager.register(_type));
|
|
19
|
+
export { jsonSchemaTypePreset };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { InputNumber } from "@douyinfe/semi-ui";
|
|
5
|
+
const integerRegistry = {
|
|
6
|
+
type: 'integer',
|
|
7
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(InputNumber, {
|
|
8
|
+
placeholder: I18n.t('Please Input Integer'),
|
|
9
|
+
size: "small",
|
|
10
|
+
disabled: props.readonly,
|
|
11
|
+
precision: 0,
|
|
12
|
+
...props
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
export { integerRegistry };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { InputNumber } from "@douyinfe/semi-ui";
|
|
5
|
+
const numberRegistry = {
|
|
6
|
+
type: 'number',
|
|
7
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(InputNumber, {
|
|
8
|
+
placeholder: I18n.t('Please Input Number'),
|
|
9
|
+
size: "small",
|
|
10
|
+
disabled: props.readonly,
|
|
11
|
+
hideButtons: true,
|
|
12
|
+
...props
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
export { numberRegistry };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { CodeEditorMini } from "../../../components/code-editor-mini/index.mjs";
|
|
5
|
+
const objectRegistry = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(CodeEditorMini, {
|
|
8
|
+
value: props.value,
|
|
9
|
+
onChange: (v)=>props.onChange?.(v),
|
|
10
|
+
languageId: "json",
|
|
11
|
+
placeholder: I18n.t('Please Input Object'),
|
|
12
|
+
readonly: props.readonly
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
export { objectRegistry };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { Input, TextArea } from "@douyinfe/semi-ui";
|
|
5
|
+
const stringRegistry = {
|
|
6
|
+
type: 'string',
|
|
7
|
+
ConstantRenderer: (props)=>props?.enableMultiLineStr ? /*#__PURE__*/ jsx(TextArea, {
|
|
8
|
+
autosize: true,
|
|
9
|
+
rows: 1,
|
|
10
|
+
placeholder: I18n.t('Please Input String'),
|
|
11
|
+
disabled: props.readonly,
|
|
12
|
+
...props
|
|
13
|
+
}) : /*#__PURE__*/ jsx(Input, {
|
|
14
|
+
size: "small",
|
|
15
|
+
placeholder: I18n.t('Please Input String'),
|
|
16
|
+
disabled: props.readonly,
|
|
17
|
+
...props
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
export { stringRegistry };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
const extraSchema = zod.object({
|
|
3
|
+
index: zod.number().optional()
|
|
4
|
+
}).optional();
|
|
5
|
+
const constantSchema = zod.object({
|
|
6
|
+
type: zod.literal('constant'),
|
|
7
|
+
content: zod.any().optional(),
|
|
8
|
+
schema: zod.any().optional(),
|
|
9
|
+
extra: extraSchema
|
|
10
|
+
});
|
|
11
|
+
const refSchema = zod.object({
|
|
12
|
+
type: zod.literal('ref'),
|
|
13
|
+
content: zod.array(zod.string()).optional(),
|
|
14
|
+
extra: extraSchema
|
|
15
|
+
});
|
|
16
|
+
const expressionSchema = zod.object({
|
|
17
|
+
type: zod.literal('expression'),
|
|
18
|
+
content: zod.string().optional(),
|
|
19
|
+
extra: extraSchema
|
|
20
|
+
});
|
|
21
|
+
const templateSchema = zod.object({
|
|
22
|
+
type: zod.literal('template'),
|
|
23
|
+
content: zod.string().optional(),
|
|
24
|
+
extra: extraSchema
|
|
25
|
+
});
|
|
26
|
+
export { constantSchema, expressionSchema, extraSchema, refSchema, templateSchema };
|
|
File without changes
|