@flowgram.ai/form-materials 0.4.8 → 0.4.10
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 +64 -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/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 +156 -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 +81 -0
- package/dist/cjs/components/json-editor-with-variables/extensions/variable-tag.js +151 -0
- package/dist/cjs/components/json-editor-with-variables/extensions/variable-tree.js +97 -0
- package/dist/cjs/components/json-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/json-editor-with-variables/styles.js +89 -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/extensions/inputs-tree.js +101 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +57 -0
- package/dist/cjs/components/prompt-editor-with-inputs/inputs-picker.js +104 -0
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +49 -0
- package/dist/cjs/components/prompt-editor-with-variables/extensions/variable-tag.js +151 -0
- package/dist/cjs/components/prompt-editor-with-variables/extensions/variable-tree.js +103 -0
- package/dist/cjs/components/prompt-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/prompt-editor-with-variables/styles.js +89 -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 +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 +228 -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 +65 -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/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 +26 -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 +47 -0
- package/dist/esm/components/json-editor-with-variables/extensions/variable-tag.mjs +117 -0
- package/dist/esm/components/json-editor-with-variables/extensions/variable-tree.mjs +63 -0
- package/dist/esm/components/json-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/json-editor-with-variables/styles.mjs +36 -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/extensions/inputs-tree.mjs +67 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +5 -0
- package/dist/esm/components/prompt-editor-with-inputs/inputs-picker.mjs +70 -0
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +15 -0
- package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tag.mjs +117 -0
- package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tree.mjs +69 -0
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/prompt-editor-with-variables/styles.mjs +36 -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 +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 +21 -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 +7 -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/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 +27 -0
- package/dist/types/components/dynamic-value-input/styles.d.ts +8 -0
- package/dist/types/components/index.d.ts +29 -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/extensions/variable-tag.d.ts +5 -0
- package/dist/types/components/json-editor-with-variables/extensions/variable-tree.d.ts +6 -0
- package/dist/types/components/json-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/json-editor-with-variables/styles.d.ts +9 -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/extensions/inputs-tree.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-inputs/inputs-picker.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-variables/extensions/variable-tag.d.ts +5 -0
- package/dist/types/components/prompt-editor-with-variables/extensions/variable-tree.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-variables/styles.d.ts +9 -0
- package/dist/types/components/type-selector/index.d.ts +23 -0
- package/dist/types/components/variable-selector/context.d.ts +16 -0
- package/dist/types/components/variable-selector/index.d.ts +29 -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 +46 -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 +19 -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/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/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 +50 -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 +2 -2
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +1 -1
- package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +3 -3
- 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/extensions/inputs-tree.tsx +4 -4
- package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +1 -1
- package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +3 -3
- 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 +98 -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/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/{typings/flow-value/index.ts → shared/flow-value/types.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled_components from "styled-components";
|
|
2
|
+
const UIContainer = styled_components.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 4px;
|
|
6
|
+
`;
|
|
7
|
+
const UIOperator = styled_components.div``;
|
|
8
|
+
const UILeft = styled_components.div`
|
|
9
|
+
width: 100%;
|
|
10
|
+
`;
|
|
11
|
+
const UIRight = styled_components.div`
|
|
12
|
+
width: 100%;
|
|
13
|
+
`;
|
|
14
|
+
const UIValues = styled_components.div`
|
|
15
|
+
flex-grow: 1;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 4px;
|
|
20
|
+
`;
|
|
21
|
+
export { UIContainer, UILeft, UIOperator, UIRight, UIValues };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var types_Op = /*#__PURE__*/ function(Op) {
|
|
2
|
+
Op["EQ"] = "eq";
|
|
3
|
+
Op["NEQ"] = "neq";
|
|
4
|
+
Op["GT"] = "gt";
|
|
5
|
+
Op["GTE"] = "gte";
|
|
6
|
+
Op["LT"] = "lt";
|
|
7
|
+
Op["LTE"] = "lte";
|
|
8
|
+
Op["IN"] = "in";
|
|
9
|
+
Op["NIN"] = "nin";
|
|
10
|
+
Op["CONTAINS"] = "contains";
|
|
11
|
+
Op["NOT_CONTAINS"] = "not_contains";
|
|
12
|
+
Op["IS_EMPTY"] = "is_empty";
|
|
13
|
+
Op["IS_NOT_EMPTY"] = "is_not_empty";
|
|
14
|
+
Op["IS_TRUE"] = "is_true";
|
|
15
|
+
Op["IS_FALSE"] = "is_false";
|
|
16
|
+
return Op;
|
|
17
|
+
}({});
|
|
18
|
+
export { types_Op as Op };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import react, { useMemo } from "react";
|
|
3
|
+
import { Input } from "@douyinfe/semi-ui";
|
|
4
|
+
import { useTypeManager } from "../../plugins/index.mjs";
|
|
5
|
+
function ConstantInput(props) {
|
|
6
|
+
const { value, onChange, schema, strategies, fallbackRenderer, readonly, ...rest } = props;
|
|
7
|
+
const typeManager = useTypeManager();
|
|
8
|
+
const Renderer = useMemo(()=>{
|
|
9
|
+
const strategy = (strategies || []).find((_strategy)=>_strategy.hit(schema));
|
|
10
|
+
if (!strategy) return typeManager.getTypeBySchema(schema)?.ConstantRenderer;
|
|
11
|
+
return strategy?.Renderer;
|
|
12
|
+
}, [
|
|
13
|
+
strategies,
|
|
14
|
+
schema
|
|
15
|
+
]);
|
|
16
|
+
if (!Renderer) {
|
|
17
|
+
if (fallbackRenderer) return /*#__PURE__*/ react.createElement(fallbackRenderer, {
|
|
18
|
+
value,
|
|
19
|
+
onChange,
|
|
20
|
+
readonly,
|
|
21
|
+
...rest
|
|
22
|
+
});
|
|
23
|
+
return /*#__PURE__*/ jsx(Input, {
|
|
24
|
+
size: "small",
|
|
25
|
+
disabled: true,
|
|
26
|
+
placeholder: "Unsupported type"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/ jsx(Renderer, {
|
|
30
|
+
value: value,
|
|
31
|
+
onChange: onChange,
|
|
32
|
+
readonly: readonly,
|
|
33
|
+
...rest
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { ConstantInput };
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useTypeManager } from "@flowgram.ai/json-schema";
|
|
4
|
+
import { Icon } from "@douyinfe/semi-ui";
|
|
5
|
+
import { ConditionRow } from "../../index.mjs";
|
|
6
|
+
import { UIOptionLabel, UISelect } from "../styles.mjs";
|
|
7
|
+
const defaultRules = ConditionRow.defaultRules;
|
|
8
|
+
function useLeft({ left, options, userRules, readonly, onChange }) {
|
|
9
|
+
const rules = useMemo(()=>({
|
|
10
|
+
...defaultRules,
|
|
11
|
+
...userRules || {}
|
|
12
|
+
}), [
|
|
13
|
+
userRules
|
|
14
|
+
]);
|
|
15
|
+
const typeManager = useTypeManager();
|
|
16
|
+
const rule = useMemo(()=>{
|
|
17
|
+
if (!left) return;
|
|
18
|
+
const option = options?.find((item)=>item.value === left);
|
|
19
|
+
if (!option?.schema?.type) return;
|
|
20
|
+
return rules[option.schema.type];
|
|
21
|
+
}, [
|
|
22
|
+
left,
|
|
23
|
+
options,
|
|
24
|
+
rules
|
|
25
|
+
]);
|
|
26
|
+
const renderDBOptionSelect = ()=>/*#__PURE__*/ jsx(UISelect, {
|
|
27
|
+
disabled: readonly,
|
|
28
|
+
size: "small",
|
|
29
|
+
style: {
|
|
30
|
+
width: '100%'
|
|
31
|
+
},
|
|
32
|
+
value: left,
|
|
33
|
+
onChange: (v)=>onChange(v),
|
|
34
|
+
optionList: options?.map((item)=>({
|
|
35
|
+
label: /*#__PURE__*/ jsxs(UIOptionLabel, {
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
38
|
+
size: "small",
|
|
39
|
+
svg: typeManager.getDisplayIcon(item.schema)
|
|
40
|
+
}),
|
|
41
|
+
item.label
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
value: item.value
|
|
45
|
+
})) || []
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
rule,
|
|
49
|
+
renderDBOptionSelect
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export { useLeft };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { Button, Select } from "@douyinfe/semi-ui";
|
|
5
|
+
import { IconChevronDownStroked } from "@douyinfe/semi-icons";
|
|
6
|
+
import { ConditionRow } from "../../index.mjs";
|
|
7
|
+
const defaultOpConfigs = ConditionRow.defaultOpConfigs;
|
|
8
|
+
function useOp({ rule, op, onChange, readonly, userOps }) {
|
|
9
|
+
const options = useMemo(()=>Object.keys(rule || {}).map((_op)=>({
|
|
10
|
+
...defaultOpConfigs[_op] || {},
|
|
11
|
+
...userOps?.[_op] || {},
|
|
12
|
+
value: _op,
|
|
13
|
+
label: I18n.t(userOps?.[_op]?.label || defaultOpConfigs[_op]?.label)
|
|
14
|
+
})), [
|
|
15
|
+
rule,
|
|
16
|
+
userOps
|
|
17
|
+
]);
|
|
18
|
+
const opConfig = useMemo(()=>defaultOpConfigs[op], [
|
|
19
|
+
op
|
|
20
|
+
]);
|
|
21
|
+
const renderOpSelect = ()=>/*#__PURE__*/ jsx(Select, {
|
|
22
|
+
style: {
|
|
23
|
+
height: 22
|
|
24
|
+
},
|
|
25
|
+
disabled: readonly,
|
|
26
|
+
size: "small",
|
|
27
|
+
value: op,
|
|
28
|
+
optionList: options,
|
|
29
|
+
onChange: (v)=>{
|
|
30
|
+
onChange(v);
|
|
31
|
+
},
|
|
32
|
+
triggerRender: ({ value })=>/*#__PURE__*/ jsx(Button, {
|
|
33
|
+
size: "small",
|
|
34
|
+
disabled: !rule,
|
|
35
|
+
children: opConfig?.abbreviation || /*#__PURE__*/ jsx(IconChevronDownStroked, {
|
|
36
|
+
size: "small"
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
renderOpSelect,
|
|
42
|
+
opConfig
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export { useOp };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { Input } from "@douyinfe/semi-ui";
|
|
5
|
+
import { InjectDynamicValueInput } from "../dynamic-value-input/index.mjs";
|
|
6
|
+
import { UIContainer, UILeft, UIOperator, UIRight, UIValues } from "./styles.mjs";
|
|
7
|
+
import { useOp } from "./hooks/use-op.mjs";
|
|
8
|
+
import { useLeft } from "./hooks/use-left.mjs";
|
|
9
|
+
const defaultRuleConfig = {
|
|
10
|
+
ops: {},
|
|
11
|
+
rules: {}
|
|
12
|
+
};
|
|
13
|
+
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig = defaultRuleConfig }) {
|
|
14
|
+
const { left, operator, right } = value || {};
|
|
15
|
+
const { rule, renderDBOptionSelect } = useLeft({
|
|
16
|
+
left,
|
|
17
|
+
options,
|
|
18
|
+
onChange: (leftKey)=>onChange({
|
|
19
|
+
...value,
|
|
20
|
+
left: leftKey
|
|
21
|
+
}),
|
|
22
|
+
readonly,
|
|
23
|
+
userRules: ruleConfig.rules
|
|
24
|
+
});
|
|
25
|
+
const { renderOpSelect, opConfig } = useOp({
|
|
26
|
+
rule,
|
|
27
|
+
op: operator,
|
|
28
|
+
onChange: (v)=>onChange({
|
|
29
|
+
...value,
|
|
30
|
+
operator: v
|
|
31
|
+
}),
|
|
32
|
+
readonly,
|
|
33
|
+
userOps: ruleConfig.ops
|
|
34
|
+
});
|
|
35
|
+
const targetSchema = useMemo(()=>{
|
|
36
|
+
const targetType = rule?.[operator || ''] || null;
|
|
37
|
+
return targetType ? {
|
|
38
|
+
type: targetType,
|
|
39
|
+
extra: {
|
|
40
|
+
weak: true
|
|
41
|
+
}
|
|
42
|
+
} : null;
|
|
43
|
+
}, [
|
|
44
|
+
rule,
|
|
45
|
+
opConfig
|
|
46
|
+
]);
|
|
47
|
+
return /*#__PURE__*/ jsxs(UIContainer, {
|
|
48
|
+
style: style,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ jsx(UIOperator, {
|
|
51
|
+
children: renderOpSelect()
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ jsxs(UIValues, {
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsx(UILeft, {
|
|
56
|
+
children: renderDBOptionSelect()
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ jsx(UIRight, {
|
|
59
|
+
children: targetSchema ? /*#__PURE__*/ jsx(InjectDynamicValueInput, {
|
|
60
|
+
readonly: readonly || !rule,
|
|
61
|
+
value: right,
|
|
62
|
+
schema: targetSchema,
|
|
63
|
+
onChange: (v)=>onChange({
|
|
64
|
+
...value,
|
|
65
|
+
right: v
|
|
66
|
+
})
|
|
67
|
+
}) : /*#__PURE__*/ jsx(Input, {
|
|
68
|
+
size: "small",
|
|
69
|
+
disabled: true,
|
|
70
|
+
style: {
|
|
71
|
+
pointerEvents: 'none'
|
|
72
|
+
},
|
|
73
|
+
value: opConfig?.rightDisplay || I18n.t('Empty')
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export { DBConditionRow };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import styled_components from "styled-components";
|
|
2
|
+
import { Select } from "@douyinfe/semi-ui";
|
|
3
|
+
const UIContainer = styled_components.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 4px;
|
|
7
|
+
`;
|
|
8
|
+
const UIOperator = styled_components.div``;
|
|
9
|
+
const UILeft = styled_components.div`
|
|
10
|
+
width: 100%;
|
|
11
|
+
`;
|
|
12
|
+
const UIRight = styled_components.div`
|
|
13
|
+
width: 100%;
|
|
14
|
+
`;
|
|
15
|
+
const UIValues = styled_components.div`
|
|
16
|
+
flex-grow: 1;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
`;
|
|
22
|
+
const UIOptionLabel = styled_components.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 10px;
|
|
26
|
+
`;
|
|
27
|
+
const UISelect = styled_components(Select)`
|
|
28
|
+
& .semi-select-selection {
|
|
29
|
+
margin-left: 5px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
export { UIContainer, UILeft, UIOperator, UIOptionLabel, UIRight, UISelect, UIValues };
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
4
|
+
import { useScopeAvailable } from "@flowgram.ai/editor";
|
|
5
|
+
import { FlowValueUtils } from "../../shared/index.mjs";
|
|
6
|
+
import { DisplaySchemaTag } from "../display-schema-tag/index.mjs";
|
|
7
|
+
function DisplayFlowValue({ value, title, showIconInTree }) {
|
|
8
|
+
const available = useScopeAvailable();
|
|
9
|
+
const variable = value?.type === 'ref' ? available.getByKeyPath(value?.content) : void 0;
|
|
10
|
+
const schema = useMemo(()=>{
|
|
11
|
+
if (value?.type === 'ref') return JsonSchemaUtils.astToSchema(variable?.type);
|
|
12
|
+
if (value?.type === 'template') return {
|
|
13
|
+
type: 'string'
|
|
14
|
+
};
|
|
15
|
+
if (value?.type === 'constant') return FlowValueUtils.inferConstantJsonSchema(value);
|
|
16
|
+
return {
|
|
17
|
+
type: 'unknown'
|
|
18
|
+
};
|
|
19
|
+
}, [
|
|
20
|
+
value,
|
|
21
|
+
variable?.hash
|
|
22
|
+
]);
|
|
23
|
+
return /*#__PURE__*/ jsx(DisplaySchemaTag, {
|
|
24
|
+
title: title,
|
|
25
|
+
value: schema,
|
|
26
|
+
showIconInTree: showIconInTree,
|
|
27
|
+
warning: value?.type === 'ref' && !variable
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export { DisplayFlowValue };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { isPlainObject } from "lodash-es";
|
|
4
|
+
import { useScopeAvailable } from "@flowgram.ai/editor";
|
|
5
|
+
import { FlowValueUtils } from "../../shared/index.mjs";
|
|
6
|
+
import { DisplayFlowValue } from "../display-flow-value/index.mjs";
|
|
7
|
+
import { DisplayInputsWrapper } from "./styles.mjs";
|
|
8
|
+
import { DisplaySchemaTag } from "../display-schema-tag/index.mjs";
|
|
9
|
+
function DisplayInputsValues({ value, showIconInTree }) {
|
|
10
|
+
const childEntries = Object.entries(value || {});
|
|
11
|
+
return /*#__PURE__*/ jsx(DisplayInputsWrapper, {
|
|
12
|
+
children: childEntries.map(([key, value])=>{
|
|
13
|
+
if (FlowValueUtils.isFlowValue(value)) return /*#__PURE__*/ jsx(DisplayFlowValue, {
|
|
14
|
+
title: key,
|
|
15
|
+
value: value,
|
|
16
|
+
showIconInTree: showIconInTree
|
|
17
|
+
}, key);
|
|
18
|
+
if (isPlainObject(value)) return /*#__PURE__*/ jsx(DisplayInputsValueAllInTag, {
|
|
19
|
+
title: key,
|
|
20
|
+
value: value,
|
|
21
|
+
showIconInTree: showIconInTree
|
|
22
|
+
}, key);
|
|
23
|
+
return null;
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function DisplayInputsValueAllInTag({ value, title, showIconInTree }) {
|
|
28
|
+
const available = useScopeAvailable();
|
|
29
|
+
const schema = useMemo(()=>FlowValueUtils.inferJsonSchema(value, available.scope), [
|
|
30
|
+
available.version,
|
|
31
|
+
value
|
|
32
|
+
]);
|
|
33
|
+
return /*#__PURE__*/ jsx(DisplaySchemaTag, {
|
|
34
|
+
title: title,
|
|
35
|
+
value: schema,
|
|
36
|
+
showIconInTree: showIconInTree
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { DisplayInputsValueAllInTag, DisplayInputsValues };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { JsonSchemaUtils } from "@flowgram.ai/json-schema";
|
|
4
|
+
import { useCurrentScope, useRefresh } from "@flowgram.ai/editor";
|
|
5
|
+
import { DisplaySchemaTag } from "../display-schema-tag/index.mjs";
|
|
6
|
+
import { DisplayOutputsWrapper } from "./styles.mjs";
|
|
7
|
+
function DisplayOutputs({ value, showIconInTree, displayFromScope }) {
|
|
8
|
+
const scope = useCurrentScope();
|
|
9
|
+
const refresh = useRefresh();
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
if (!displayFromScope) return ()=>null;
|
|
12
|
+
const disposable = scope.output.onListOrAnyVarChange(()=>{
|
|
13
|
+
refresh();
|
|
14
|
+
});
|
|
15
|
+
return ()=>{
|
|
16
|
+
disposable.dispose();
|
|
17
|
+
};
|
|
18
|
+
}, [
|
|
19
|
+
displayFromScope
|
|
20
|
+
]);
|
|
21
|
+
const properties = displayFromScope ? scope.output.variables?.reduce((acm, curr)=>{
|
|
22
|
+
acm = {
|
|
23
|
+
...acm,
|
|
24
|
+
...JsonSchemaUtils.astToSchema(curr.type)?.properties || {}
|
|
25
|
+
};
|
|
26
|
+
return acm;
|
|
27
|
+
}, {}) : value?.properties || {};
|
|
28
|
+
const childEntries = Object.entries(properties || {});
|
|
29
|
+
return /*#__PURE__*/ jsx(DisplayOutputsWrapper, {
|
|
30
|
+
children: childEntries.map(([key, schema])=>/*#__PURE__*/ jsx(DisplaySchemaTag, {
|
|
31
|
+
title: key,
|
|
32
|
+
value: schema,
|
|
33
|
+
showIconInTree: showIconInTree,
|
|
34
|
+
warning: !schema
|
|
35
|
+
}, key))
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { DisplayOutputs };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import react from "react";
|
|
3
|
+
import { Popover } from "@douyinfe/semi-ui";
|
|
4
|
+
import { useTypeManager } from "../../plugins/index.mjs";
|
|
5
|
+
import { DisplaySchemaTree } from "../display-schema-tree/index.mjs";
|
|
6
|
+
import { PopoverContent, StyledTag, TitleSpan } from "./styles.mjs";
|
|
7
|
+
function DisplaySchemaTag({ value = {}, showIconInTree, title, warning }) {
|
|
8
|
+
const typeManager = useTypeManager();
|
|
9
|
+
const icon = typeManager?.getDisplayIcon(value) || typeManager.getDisplayIcon({
|
|
10
|
+
type: 'unknown'
|
|
11
|
+
});
|
|
12
|
+
return /*#__PURE__*/ jsx(Popover, {
|
|
13
|
+
content: /*#__PURE__*/ jsx(PopoverContent, {
|
|
14
|
+
children: /*#__PURE__*/ jsx(DisplaySchemaTree, {
|
|
15
|
+
value: value,
|
|
16
|
+
typeManager: typeManager,
|
|
17
|
+
showIcon: showIconInTree
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
children: /*#__PURE__*/ jsxs(StyledTag, {
|
|
21
|
+
color: warning ? 'amber' : 'white',
|
|
22
|
+
children: [
|
|
23
|
+
icon && /*#__PURE__*/ react.cloneElement(icon, {
|
|
24
|
+
className: 'tag-icon'
|
|
25
|
+
}),
|
|
26
|
+
title && /*#__PURE__*/ jsx(TitleSpan, {
|
|
27
|
+
children: title
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { DisplaySchemaTag };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled_components from "styled-components";
|
|
2
|
+
import { Tag } from "@douyinfe/semi-ui";
|
|
3
|
+
const PopoverContent = styled_components.div`
|
|
4
|
+
padding: 10px;
|
|
5
|
+
`;
|
|
6
|
+
const StyledTag = styled_components(Tag)`
|
|
7
|
+
padding: 4px;
|
|
8
|
+
|
|
9
|
+
.tag-icon {
|
|
10
|
+
width: 12px;
|
|
11
|
+
height: 12px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const TitleSpan = styled_components.span`
|
|
15
|
+
display: inline-block;
|
|
16
|
+
margin-left: 4px;
|
|
17
|
+
margin-top: -1px;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
`;
|
|
21
|
+
export { PopoverContent, StyledTag, TitleSpan };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import react from "react";
|
|
3
|
+
import { useTypeManager } from "../../plugins/index.mjs";
|
|
4
|
+
import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from "./styles.mjs";
|
|
5
|
+
function DisplaySchemaTree(props) {
|
|
6
|
+
return /*#__PURE__*/ jsx(SchemaTree, {
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function SchemaTree(props) {
|
|
11
|
+
const { value: schema = {}, drilldown = true, depth = 0, showIcon = true, parentKey = '' } = props || {};
|
|
12
|
+
const typeManager = useTypeManager();
|
|
13
|
+
const config = typeManager.getTypeBySchema(schema);
|
|
14
|
+
const title = typeManager.getComplexText(schema);
|
|
15
|
+
const icon = typeManager?.getDisplayIcon(schema);
|
|
16
|
+
let properties = drilldown && config ? config.getTypeSchemaProperties(schema) : {};
|
|
17
|
+
const childEntries = Object.entries(properties || {});
|
|
18
|
+
return /*#__PURE__*/ jsxs(TreeItem, {
|
|
19
|
+
depth: depth,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsxs(TreeRow, {
|
|
22
|
+
children: [
|
|
23
|
+
0 !== depth && /*#__PURE__*/ jsx(HorizontalLine, {}),
|
|
24
|
+
showIcon && icon && /*#__PURE__*/ react.cloneElement(icon, {
|
|
25
|
+
className: 'tree-icon'
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx(TreeTitle, {
|
|
28
|
+
children: parentKey ? /*#__PURE__*/ jsxs(Fragment, {
|
|
29
|
+
children: [
|
|
30
|
+
`${parentKey} (`,
|
|
31
|
+
title,
|
|
32
|
+
')'
|
|
33
|
+
]
|
|
34
|
+
}) : title
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
childEntries?.length ? /*#__PURE__*/ jsx(TreeLevel, {
|
|
39
|
+
children: childEntries.map(([key, value])=>/*#__PURE__*/ jsx(SchemaTree, {
|
|
40
|
+
...props,
|
|
41
|
+
parentKey: key,
|
|
42
|
+
value: value,
|
|
43
|
+
depth: depth + 1
|
|
44
|
+
}, key))
|
|
45
|
+
}) : null
|
|
46
|
+
]
|
|
47
|
+
}, parentKey || 'root');
|
|
48
|
+
}
|
|
49
|
+
export { DisplaySchemaTree };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import styled_components, { css } from "styled-components";
|
|
2
|
+
const TreeRow = styled_components.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
.tree-icon {
|
|
7
|
+
margin-right: 8px;
|
|
8
|
+
width: 14px;
|
|
9
|
+
height: 14px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
height: 27px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
`;
|
|
15
|
+
const HorizontalLine = styled_components.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
&::before,
|
|
19
|
+
&::after {
|
|
20
|
+
content: '';
|
|
21
|
+
position: absolute;
|
|
22
|
+
background-color: var(--semi-color-text-3);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&::after {
|
|
26
|
+
top: 0px;
|
|
27
|
+
right: 6px;
|
|
28
|
+
width: 15px;
|
|
29
|
+
height: 1px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const TreeTitle = styled_components.div`
|
|
33
|
+
// overflow: hidden;
|
|
34
|
+
// text-overflow: ellipsis;
|
|
35
|
+
`;
|
|
36
|
+
const TreeLevel = styled_components.div`
|
|
37
|
+
padding-left: 30px;
|
|
38
|
+
position: relative;
|
|
39
|
+
|
|
40
|
+
/* &::before {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
background-color: var(--semi-color-text-3);
|
|
44
|
+
top: 0px;
|
|
45
|
+
bottom: 0px;
|
|
46
|
+
left: -22px;
|
|
47
|
+
width: 1px;
|
|
48
|
+
} */
|
|
49
|
+
`;
|
|
50
|
+
const TreeItem = styled_components.div`
|
|
51
|
+
position: relative;
|
|
52
|
+
|
|
53
|
+
&::before {
|
|
54
|
+
content: '';
|
|
55
|
+
position: absolute;
|
|
56
|
+
background-color: var(--semi-color-text-3);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:not(:last-child)::before {
|
|
60
|
+
width: 1px;
|
|
61
|
+
top: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
left: -22px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:last-child::before {
|
|
67
|
+
width: 1px;
|
|
68
|
+
top: 0;
|
|
69
|
+
height: 14px;
|
|
70
|
+
left: -22px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
${(props)=>0 === props.depth && css`
|
|
74
|
+
&::before {
|
|
75
|
+
width: 0px !important;
|
|
76
|
+
}
|
|
77
|
+
`}
|
|
78
|
+
`;
|
|
79
|
+
export { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { useScopeAvailable } from "@flowgram.ai/editor";
|
|
3
|
+
function useRefVariable(value) {
|
|
4
|
+
const available = useScopeAvailable();
|
|
5
|
+
const refVariable = useMemo(()=>{
|
|
6
|
+
if (value?.type === 'ref') return available.getByKeyPath(value.content);
|
|
7
|
+
}, [
|
|
8
|
+
value,
|
|
9
|
+
available
|
|
10
|
+
]);
|
|
11
|
+
return refVariable;
|
|
12
|
+
}
|
|
13
|
+
function useSelectSchema(schemaFromProps, constantProps, value) {
|
|
14
|
+
let defaultSelectSchema = schemaFromProps || constantProps?.schema || {
|
|
15
|
+
type: 'string'
|
|
16
|
+
};
|
|
17
|
+
if (value?.type === 'constant') defaultSelectSchema = value?.schema || defaultSelectSchema;
|
|
18
|
+
const changeVersion = useRef(0);
|
|
19
|
+
const effectVersion = useRef(0);
|
|
20
|
+
const [selectSchema, setSelectSchema] = useState(defaultSelectSchema);
|
|
21
|
+
useEffect(()=>{
|
|
22
|
+
effectVersion.current += 1;
|
|
23
|
+
if (changeVersion.current === effectVersion.current) return;
|
|
24
|
+
effectVersion.current = changeVersion.current;
|
|
25
|
+
if (value?.type === 'constant' && value?.schema) return void setSelectSchema(value?.schema);
|
|
26
|
+
}, [
|
|
27
|
+
value
|
|
28
|
+
]);
|
|
29
|
+
const setSelectSchemaWithVersionUpdate = (schema)=>{
|
|
30
|
+
setSelectSchema(schema);
|
|
31
|
+
changeVersion.current += 1;
|
|
32
|
+
};
|
|
33
|
+
return [
|
|
34
|
+
selectSchema,
|
|
35
|
+
setSelectSchemaWithVersionUpdate
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
function useIncludeSchema(schemaFromProps) {
|
|
39
|
+
const includeSchema = useMemo(()=>{
|
|
40
|
+
if (!schemaFromProps) return;
|
|
41
|
+
if (schemaFromProps?.type === 'number') return [
|
|
42
|
+
schemaFromProps,
|
|
43
|
+
{
|
|
44
|
+
type: 'integer'
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
return {
|
|
48
|
+
...schemaFromProps,
|
|
49
|
+
extra: {
|
|
50
|
+
weak: true,
|
|
51
|
+
...schemaFromProps?.extra
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
schemaFromProps
|
|
56
|
+
]);
|
|
57
|
+
return includeSchema;
|
|
58
|
+
}
|
|
59
|
+
export { useIncludeSchema, useRefVariable, useSelectSchema };
|