@flowgram.ai/form-materials 0.1.0-alpha.14 → 0.1.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.sh +7 -0
- package/dist/cjs/components/assign-row/index.js +112 -0
- package/dist/cjs/components/assign-row/types.js +18 -0
- package/dist/cjs/components/assign-rows/index.js +85 -0
- package/dist/cjs/components/batch-outputs/index.js +91 -0
- package/dist/cjs/components/batch-outputs/styles.js +60 -0
- package/dist/cjs/components/batch-outputs/types.js +18 -0
- package/dist/cjs/components/batch-variable-selector/index.js +53 -0
- package/dist/cjs/components/blur-input/index.js +54 -0
- package/dist/cjs/components/code-editor/editor-all.js +52 -0
- package/dist/cjs/components/code-editor/editor-json.js +71 -0
- package/dist/cjs/components/code-editor/editor-python.js +63 -0
- package/dist/cjs/components/code-editor/editor-shell.js +63 -0
- package/dist/cjs/components/code-editor/editor-sql.js +71 -0
- package/dist/cjs/components/code-editor/editor-ts.js +80 -0
- package/dist/cjs/components/code-editor/editor.js +105 -0
- package/dist/cjs/components/code-editor/factory.js +96 -0
- package/dist/cjs/components/code-editor/index.js +60 -0
- package/dist/cjs/components/code-editor/theme/dark.js +258 -0
- package/dist/cjs/components/code-editor/theme/index.js +11 -0
- package/dist/cjs/components/code-editor/theme/light.js +244 -0
- package/dist/cjs/components/code-editor/utils.js +43 -0
- package/dist/cjs/components/code-editor-mini/index.js +66 -0
- package/dist/cjs/components/condition-context/context.js +59 -0
- package/dist/cjs/components/condition-context/hooks/use-condition.js +97 -0
- package/dist/cjs/components/condition-context/index.js +47 -0
- package/dist/cjs/components/condition-context/op.js +117 -0
- package/dist/cjs/components/condition-context/types.js +18 -0
- package/dist/cjs/components/condition-row/index.js +140 -0
- package/dist/cjs/components/condition-row/styles.js +77 -0
- package/dist/cjs/components/condition-row/types.js +18 -0
- package/dist/cjs/components/constant-input/index.js +80 -0
- package/dist/cjs/components/constant-input/types.js +18 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +172 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +152 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +109 -0
- package/dist/cjs/components/coze-editor-extensions/index.js +86 -0
- package/dist/cjs/components/coze-editor-extensions/styles.js +89 -0
- package/dist/cjs/components/db-condition-row/index.js +140 -0
- package/dist/cjs/components/db-condition-row/styles.js +94 -0
- package/dist/cjs/components/db-condition-row/types.js +18 -0
- package/dist/cjs/components/display-flow-value/index.js +64 -0
- package/dist/cjs/components/display-inputs-values/index.js +76 -0
- package/dist/cjs/components/display-inputs-values/styles.js +51 -0
- package/dist/cjs/components/display-outputs/index.js +72 -0
- package/dist/cjs/components/display-outputs/styles.js +51 -0
- package/dist/cjs/components/display-schema-tag/index.js +77 -0
- package/dist/cjs/components/display-schema-tag/styles.js +71 -0
- package/dist/cjs/components/display-schema-tree/index.js +93 -0
- package/dist/cjs/components/display-schema-tree/styles.js +135 -0
- package/dist/cjs/components/dynamic-value-input/hooks.js +99 -0
- package/dist/cjs/components/dynamic-value-input/index.js +174 -0
- package/dist/cjs/components/dynamic-value-input/styles.js +107 -0
- package/dist/cjs/components/index.js +201 -0
- package/dist/cjs/components/inputs-values/index.js +112 -0
- package/dist/cjs/components/inputs-values/styles.js +60 -0
- package/dist/cjs/components/inputs-values/types.js +18 -0
- package/dist/cjs/components/inputs-values-tree/hooks/use-child-list.js +77 -0
- package/dist/cjs/components/inputs-values-tree/index.js +87 -0
- package/dist/cjs/components/inputs-values-tree/row.js +183 -0
- package/dist/cjs/components/inputs-values-tree/styles.js +177 -0
- package/dist/cjs/components/inputs-values-tree/types.js +18 -0
- package/dist/cjs/components/json-editor-with-variables/editor.js +84 -0
- package/dist/cjs/components/json-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/json-schema-editor/default-value.js +54 -0
- package/dist/cjs/components/json-schema-editor/hooks.js +130 -0
- package/dist/cjs/components/json-schema-editor/index.js +246 -0
- package/dist/cjs/components/json-schema-editor/styles.js +231 -0
- package/dist/cjs/components/json-schema-editor/types.js +18 -0
- package/dist/cjs/components/prompt-editor/editor.js +99 -0
- package/dist/cjs/components/prompt-editor/extensions/jinja.js +73 -0
- package/dist/cjs/components/prompt-editor/extensions/language-support.js +48 -0
- package/dist/cjs/components/prompt-editor/extensions/markdown.js +81 -0
- package/dist/cjs/components/prompt-editor/index.js +57 -0
- package/dist/cjs/components/prompt-editor/styles.js +55 -0
- package/dist/cjs/components/prompt-editor/types.js +7 -0
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +47 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +57 -0
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +48 -0
- package/dist/cjs/components/prompt-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/sql-editor-with-variables/editor.js +53 -0
- package/dist/cjs/components/sql-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/type-selector/index.js +139 -0
- package/dist/cjs/components/variable-selector/context.js +56 -0
- package/dist/cjs/components/variable-selector/index.js +143 -0
- package/dist/cjs/components/variable-selector/styles.js +114 -0
- package/dist/cjs/components/variable-selector/use-variable-tree.js +99 -0
- package/dist/cjs/effects/auto-rename-ref/index.js +98 -0
- package/dist/cjs/effects/index.js +60 -0
- package/dist/cjs/effects/listen-ref-schema-change/index.js +57 -0
- package/dist/cjs/effects/listen-ref-value-change/index.js +54 -0
- package/dist/cjs/effects/provide-batch-input/index.js +64 -0
- package/dist/cjs/effects/provide-json-schema-outputs/index.js +49 -0
- package/dist/cjs/effects/sync-variable-title/index.js +52 -0
- package/dist/cjs/effects/validate-when-variable-sync/index.js +49 -0
- package/dist/cjs/form-plugins/batch-outputs-plugin/index.js +104 -0
- package/dist/cjs/form-plugins/index.js +47 -0
- package/dist/cjs/form-plugins/infer-assign-plugin/index.js +72 -0
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +74 -0
- package/dist/cjs/hooks/index.js +36 -0
- package/dist/cjs/hooks/use-object-list/index.js +136 -0
- package/dist/cjs/index.js +270 -0
- package/dist/cjs/plugins/disable-declaration-plugin/create-disable-declaration-plugin.js +51 -0
- package/dist/cjs/plugins/disable-declaration-plugin/index.js +36 -0
- package/dist/cjs/plugins/index.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +50 -0
- package/dist/cjs/plugins/json-schema-preset/index.js +47 -0
- package/dist/cjs/plugins/json-schema-preset/react.js +51 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +78 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +86 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +81 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +61 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +82 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/map.js +54 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +82 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +54 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +83 -0
- package/dist/cjs/plugins/json-schema-preset/types.js +18 -0
- package/dist/cjs/shared/flow-value/index.js +36 -0
- package/dist/cjs/shared/flow-value/schema.js +82 -0
- package/dist/cjs/shared/flow-value/types.js +18 -0
- package/dist/cjs/shared/flow-value/utils.js +156 -0
- package/dist/cjs/shared/format-legacy-refs/index.js +99 -0
- package/dist/cjs/shared/index.js +73 -0
- package/dist/cjs/shared/inject-material/index.js +66 -0
- package/dist/cjs/shared/lazy-suspense/index.js +58 -0
- package/dist/cjs/shared/polyfill-create-root/index.js +53 -0
- package/dist/cjs/validate/index.js +36 -0
- package/dist/cjs/validate/validate-flow-value/index.js +63 -0
- package/dist/esm/components/assign-row/index.mjs +78 -0
- package/dist/esm/components/assign-row/types.mjs +0 -0
- package/dist/esm/components/assign-rows/index.mjs +51 -0
- package/dist/esm/components/batch-outputs/index.mjs +57 -0
- package/dist/esm/components/batch-outputs/styles.mjs +13 -0
- package/dist/esm/components/batch-outputs/types.mjs +0 -0
- package/dist/esm/components/batch-variable-selector/index.mjs +19 -0
- package/dist/esm/components/blur-input/index.mjs +20 -0
- package/dist/esm/components/code-editor/editor-all.mjs +18 -0
- package/dist/esm/components/code-editor/editor-json.mjs +16 -0
- package/dist/esm/components/code-editor/editor-python.mjs +8 -0
- package/dist/esm/components/code-editor/editor-shell.mjs +8 -0
- package/dist/esm/components/code-editor/editor-sql.mjs +16 -0
- package/dist/esm/components/code-editor/editor-ts.mjs +22 -0
- package/dist/esm/components/code-editor/editor.mjs +60 -0
- package/dist/esm/components/code-editor/factory.mjs +36 -0
- package/dist/esm/components/code-editor/index.mjs +8 -0
- package/dist/esm/components/code-editor/theme/dark.mjs +221 -0
- package/dist/esm/components/code-editor/theme/index.mjs +5 -0
- package/dist/esm/components/code-editor/theme/light.mjs +207 -0
- package/dist/esm/components/code-editor/utils.mjs +9 -0
- package/dist/esm/components/code-editor-mini/index.mjs +22 -0
- package/dist/esm/components/condition-context/context.mjs +19 -0
- package/dist/esm/components/condition-context/hooks/use-condition.mjs +63 -0
- package/dist/esm/components/condition-context/index.mjs +4 -0
- package/dist/esm/components/condition-context/op.mjs +80 -0
- package/dist/esm/components/condition-context/types.mjs +0 -0
- package/dist/esm/components/condition-row/index.mjs +106 -0
- package/dist/esm/components/condition-row/styles.mjs +21 -0
- package/dist/esm/components/condition-row/types.mjs +0 -0
- package/dist/esm/components/constant-input/index.mjs +36 -0
- package/dist/esm/components/constant-input/types.mjs +0 -0
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +135 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +118 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +75 -0
- package/dist/esm/components/coze-editor-extensions/index.mjs +18 -0
- package/{src/components/prompt-editor-with-variables/styles.tsx → dist/esm/components/coze-editor-extensions/styles.mjs} +7 -15
- package/dist/esm/components/db-condition-row/index.mjs +106 -0
- package/dist/esm/components/db-condition-row/styles.mjs +32 -0
- package/dist/esm/components/db-condition-row/types.mjs +0 -0
- package/dist/esm/components/display-flow-value/index.mjs +30 -0
- package/dist/esm/components/display-inputs-values/index.mjs +39 -0
- package/dist/esm/components/display-inputs-values/styles.mjs +7 -0
- package/dist/esm/components/display-outputs/index.mjs +38 -0
- package/dist/esm/components/display-outputs/styles.mjs +7 -0
- package/dist/esm/components/display-schema-tag/index.mjs +33 -0
- package/dist/esm/components/display-schema-tag/styles.mjs +21 -0
- package/dist/esm/components/display-schema-tree/index.mjs +49 -0
- package/dist/esm/components/display-schema-tree/styles.mjs +79 -0
- package/dist/esm/components/dynamic-value-input/hooks.mjs +59 -0
- package/dist/esm/components/dynamic-value-input/index.mjs +137 -0
- package/dist/esm/components/dynamic-value-input/styles.mjs +54 -0
- package/dist/esm/components/index.mjs +29 -0
- package/dist/esm/components/inputs-values/index.mjs +78 -0
- package/dist/esm/components/inputs-values/styles.mjs +13 -0
- package/dist/esm/components/inputs-values/types.mjs +0 -0
- package/dist/esm/components/inputs-values-tree/hooks/use-child-list.mjs +43 -0
- package/dist/esm/components/inputs-values-tree/index.mjs +53 -0
- package/dist/esm/components/inputs-values-tree/row.mjs +149 -0
- package/dist/esm/components/inputs-values-tree/styles.mjs +105 -0
- package/dist/esm/components/inputs-values-tree/types.mjs +0 -0
- package/dist/esm/components/json-editor-with-variables/editor.mjs +50 -0
- package/dist/esm/components/json-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/json-schema-editor/default-value.mjs +20 -0
- package/dist/esm/components/json-schema-editor/hooks.mjs +96 -0
- package/dist/esm/components/json-schema-editor/index.mjs +212 -0
- package/dist/esm/components/json-schema-editor/styles.mjs +138 -0
- package/dist/esm/components/json-schema-editor/types.mjs +0 -0
- package/dist/esm/components/prompt-editor/editor.mjs +52 -0
- package/dist/esm/components/prompt-editor/extensions/jinja.mjs +39 -0
- package/dist/esm/components/prompt-editor/extensions/language-support.mjs +14 -0
- package/dist/esm/components/prompt-editor/extensions/markdown.mjs +47 -0
- package/dist/esm/components/prompt-editor/index.mjs +5 -0
- package/dist/esm/components/prompt-editor/styles.mjs +11 -0
- package/dist/esm/components/prompt-editor/types.mjs +1 -0
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +13 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +5 -0
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +14 -0
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/sql-editor-with-variables/editor.mjs +19 -0
- package/dist/esm/components/sql-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/type-selector/index.mjs +96 -0
- package/dist/esm/components/variable-selector/context.mjs +16 -0
- package/dist/esm/components/variable-selector/index.mjs +100 -0
- package/dist/esm/components/variable-selector/styles.mjs +58 -0
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +65 -0
- package/dist/esm/effects/auto-rename-ref/index.mjs +64 -0
- package/dist/esm/effects/index.mjs +8 -0
- package/dist/esm/effects/listen-ref-schema-change/index.mjs +23 -0
- package/dist/esm/effects/listen-ref-value-change/index.mjs +20 -0
- package/dist/esm/effects/provide-batch-input/index.mjs +30 -0
- package/dist/esm/effects/provide-json-schema-outputs/index.mjs +15 -0
- package/dist/esm/effects/sync-variable-title/index.mjs +18 -0
- package/dist/esm/effects/validate-when-variable-sync/index.mjs +15 -0
- package/dist/esm/form-plugins/batch-outputs-plugin/index.mjs +67 -0
- package/dist/esm/form-plugins/index.mjs +4 -0
- package/dist/esm/form-plugins/infer-assign-plugin/index.mjs +38 -0
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +40 -0
- package/dist/esm/hooks/index.mjs +2 -0
- package/dist/esm/hooks/use-object-list/index.mjs +102 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/plugins/disable-declaration-plugin/create-disable-declaration-plugin.mjs +17 -0
- package/dist/esm/plugins/disable-declaration-plugin/index.mjs +2 -0
- package/dist/esm/plugins/index.mjs +3 -0
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +16 -0
- package/dist/esm/plugins/json-schema-preset/index.mjs +4 -0
- package/dist/esm/plugins/json-schema-preset/react.mjs +14 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +44 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +52 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +47 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +24 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +48 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/map.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +48 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +49 -0
- package/dist/esm/plugins/json-schema-preset/types.mjs +0 -0
- package/dist/esm/shared/flow-value/index.mjs +2 -0
- package/dist/esm/shared/flow-value/schema.mjs +26 -0
- package/dist/esm/shared/flow-value/types.mjs +0 -0
- package/dist/esm/shared/flow-value/utils.mjs +122 -0
- package/dist/esm/shared/format-legacy-refs/index.mjs +50 -0
- package/dist/esm/shared/index.mjs +6 -0
- package/dist/esm/shared/inject-material/index.mjs +22 -0
- package/dist/esm/shared/lazy-suspense/index.mjs +21 -0
- package/dist/esm/shared/polyfill-create-root/index.mjs +16 -0
- package/dist/esm/validate/index.mjs +2 -0
- package/dist/esm/validate/validate-flow-value/index.mjs +29 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/components/assign-row/index.d.ts +8 -0
- package/dist/types/components/assign-row/types.d.ts +20 -0
- package/dist/types/components/assign-rows/index.d.ts +11 -0
- package/dist/types/components/batch-outputs/index.d.ts +7 -0
- package/dist/types/components/batch-outputs/styles.d.ts +6 -0
- package/dist/types/components/batch-outputs/types.d.ts +18 -0
- package/dist/types/components/batch-variable-selector/index.d.ts +7 -0
- package/dist/types/components/blur-input/index.d.ts +13 -0
- package/dist/types/components/code-editor/editor-all.d.ts +8 -0
- package/dist/types/components/code-editor/editor-json.d.ts +6 -0
- package/dist/types/components/code-editor/editor-python.d.ts +6 -0
- package/dist/types/components/code-editor/editor-shell.d.ts +6 -0
- package/dist/types/components/code-editor/editor-sql.d.ts +6 -0
- package/dist/types/components/code-editor/editor-ts.d.ts +6 -0
- package/dist/types/components/code-editor/editor.d.ts +22 -0
- package/dist/types/components/code-editor/factory.d.ts +13 -0
- package/dist/types/components/code-editor/index.d.ts +11 -0
- package/dist/types/components/code-editor/theme/dark.d.ts +35 -0
- package/{src/typings/index.ts → dist/types/components/code-editor/theme/index.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/light.d.ts +30 -0
- package/dist/types/components/code-editor/utils.d.ts +5 -0
- package/dist/types/components/code-editor-mini/index.d.ts +10 -0
- package/dist/types/components/condition-context/context.d.ts +14 -0
- package/dist/types/components/condition-context/hooks/use-condition.d.ts +29 -0
- package/dist/types/components/condition-context/index.d.ts +8 -0
- package/dist/types/components/condition-context/op.d.ts +22 -0
- package/dist/types/components/condition-context/types.d.ts +14 -0
- package/dist/types/components/condition-row/index.d.ts +19 -0
- package/dist/types/components/condition-row/styles.d.ts +9 -0
- package/dist/types/components/condition-row/types.d.ts +10 -0
- package/dist/types/components/constant-input/index.d.ts +8 -0
- package/dist/types/components/constant-input/types.d.ts +16 -0
- package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +14 -0
- package/{src/validate/index.tsx → dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts} +1 -2
- package/dist/types/components/coze-editor-extensions/extensions/variable-tree.d.ts +8 -0
- package/dist/types/components/coze-editor-extensions/index.d.ts +18 -0
- package/dist/types/components/coze-editor-extensions/styles.d.ts +9 -0
- package/dist/types/components/db-condition-row/index.d.ts +20 -0
- package/dist/types/components/db-condition-row/styles.d.ts +12 -0
- package/dist/types/components/db-condition-row/types.d.ts +17 -0
- package/dist/types/components/display-flow-value/index.d.ts +15 -0
- package/dist/types/components/display-inputs-values/index.d.ts +14 -0
- package/dist/types/components/display-inputs-values/styles.d.ts +5 -0
- package/dist/types/components/display-outputs/index.d.ts +14 -0
- package/dist/types/components/display-outputs/styles.d.ts +5 -0
- package/dist/types/components/display-schema-tag/index.d.ts +14 -0
- package/dist/types/components/display-schema-tag/styles.d.ts +8 -0
- package/dist/types/components/display-schema-tree/index.d.ts +16 -0
- package/dist/types/components/display-schema-tree/styles.d.ts +11 -0
- package/dist/types/components/dynamic-value-input/hooks.d.ts +28 -0
- package/dist/types/components/dynamic-value-input/index.d.ts +29 -0
- package/dist/types/components/dynamic-value-input/styles.d.ts +8 -0
- package/dist/types/components/index.d.ts +32 -0
- package/dist/types/components/inputs-values/index.d.ts +7 -0
- package/dist/types/components/inputs-values/styles.d.ts +6 -0
- package/dist/types/components/inputs-values/types.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/hooks/use-child-list.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/index.d.ts +7 -0
- package/dist/types/components/inputs-values-tree/row.d.ts +15 -0
- package/dist/types/components/inputs-values-tree/styles.d.ts +23 -0
- package/dist/types/components/inputs-values-tree/types.d.ts +18 -0
- package/dist/types/components/json-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/json-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/json-schema-editor/default-value.d.ts +17 -0
- package/dist/types/components/json-schema-editor/hooks.d.ts +12 -0
- package/dist/types/components/json-schema-editor/index.d.ts +14 -0
- package/dist/types/components/json-schema-editor/styles.d.ts +30 -0
- package/dist/types/components/json-schema-editor/types.d.ts +20 -0
- package/dist/types/components/prompt-editor/editor.d.ts +15 -0
- package/dist/types/components/prompt-editor/extensions/jinja.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/language-support.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/markdown.d.ts +6 -0
- package/dist/types/components/prompt-editor/index.d.ts +6 -0
- package/dist/types/components/prompt-editor/styles.d.ts +7 -0
- package/dist/types/components/prompt-editor/types.d.ts +16 -0
- package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +10 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/sql-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/sql-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/type-selector/index.d.ts +25 -0
- package/dist/types/components/variable-selector/context.d.ts +16 -0
- package/dist/types/components/variable-selector/index.d.ts +31 -0
- package/dist/types/components/variable-selector/styles.d.ts +14 -0
- package/dist/types/components/variable-selector/use-variable-tree.d.ts +18 -0
- package/dist/types/effects/auto-rename-ref/index.d.ts +17 -0
- package/dist/types/effects/index.d.ts +11 -0
- package/dist/types/effects/listen-ref-schema-change/index.d.ts +22 -0
- package/dist/types/effects/listen-ref-value-change/index.d.ts +22 -0
- package/dist/types/effects/provide-batch-input/index.d.ts +6 -0
- package/dist/types/effects/provide-json-schema-outputs/index.d.ts +6 -0
- package/dist/types/effects/sync-variable-title/index.d.ts +6 -0
- package/dist/types/effects/validate-when-variable-sync/index.d.ts +8 -0
- package/dist/types/form-plugins/batch-outputs-plugin/index.d.ts +16 -0
- package/dist/types/form-plugins/index.d.ts +7 -0
- package/dist/types/form-plugins/infer-assign-plugin/index.d.ts +10 -0
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +15 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/use-object-list/index.d.ts +22 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/plugins/disable-declaration-plugin/create-disable-declaration-plugin.d.ts +5 -0
- package/dist/types/plugins/disable-declaration-plugin/index.d.ts +5 -0
- package/dist/types/plugins/index.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +9 -0
- package/dist/types/plugins/json-schema-preset/index.d.ts +9 -0
- package/dist/types/plugins/json-schema-preset/react.d.ts +11 -0
- package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +7 -0
- package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/map.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/number.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/types.d.ts +22 -0
- package/dist/types/shared/flow-value/index.d.ts +6 -0
- package/dist/types/shared/flow-value/schema.d.ts +107 -0
- package/dist/types/shared/flow-value/types.d.ts +32 -0
- package/dist/types/shared/flow-value/utils.d.ts +67 -0
- package/dist/types/shared/format-legacy-refs/index.d.ts +84 -0
- package/dist/types/shared/index.d.ts +9 -0
- package/dist/types/shared/inject-material/index.d.ts +48 -0
- package/dist/types/shared/lazy-suspense/index.d.ts +7 -0
- package/dist/types/shared/polyfill-create-root/index.d.ts +10 -0
- package/dist/types/validate/index.d.ts +5 -0
- package/dist/types/validate/validate-flow-value/index.d.ts +19 -0
- package/package.json +63 -26
- package/src/components/assign-row/index.tsx +3 -3
- package/src/components/assign-row/types.ts +1 -1
- package/src/components/batch-outputs/types.ts +1 -1
- package/src/components/blur-input/index.tsx +9 -1
- package/src/components/code-editor/editor-all.tsx +30 -0
- package/src/components/code-editor/editor-json.tsx +25 -0
- package/src/components/code-editor/editor-python.tsx +18 -0
- package/src/components/code-editor/editor-shell.tsx +18 -0
- package/src/components/code-editor/editor-sql.tsx +24 -0
- package/src/components/code-editor/editor-ts.tsx +31 -0
- package/src/components/code-editor/editor.tsx +47 -30
- package/src/components/code-editor/factory.tsx +61 -0
- package/src/components/code-editor/index.tsx +7 -7
- package/src/components/code-editor/theme/dark.ts +63 -78
- package/src/components/code-editor/theme/index.ts +1 -1
- package/src/components/code-editor/theme/light.ts +61 -92
- package/src/components/code-editor/utils.ts +4 -0
- package/src/components/code-editor-mini/index.tsx +3 -0
- package/src/components/condition-context/context.tsx +28 -0
- package/src/components/condition-context/hooks/use-condition.tsx +99 -0
- package/src/components/condition-context/index.tsx +14 -0
- package/src/components/condition-context/op.ts +86 -0
- package/src/components/condition-context/types.ts +22 -0
- package/src/components/condition-row/index.tsx +44 -22
- package/src/components/condition-row/types.ts +1 -31
- package/src/components/constant-input/index.tsx +1 -1
- package/src/components/{prompt-editor-with-inputs/inputs-picker.tsx → coze-editor-extensions/extensions/inputs-tree.tsx} +95 -5
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.tsx +7 -4
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +15 -6
- package/src/components/coze-editor-extensions/index.tsx +33 -0
- package/src/components/db-condition-row/index.tsx +76 -24
- package/src/components/db-condition-row/types.ts +1 -14
- package/src/components/display-flow-value/index.tsx +1 -1
- package/src/components/display-schema-tree/index.tsx +6 -4
- package/src/components/dynamic-value-input/hooks.ts +1 -1
- package/src/components/dynamic-value-input/index.tsx +1 -1
- package/src/components/index.ts +78 -25
- package/src/components/inputs-values/index.tsx +1 -1
- package/src/components/inputs-values/types.ts +1 -1
- package/src/components/inputs-values-tree/row.tsx +1 -1
- package/src/components/json-editor-with-variables/editor.tsx +9 -10
- package/src/components/prompt-editor/editor.tsx +2 -2
- package/src/components/prompt-editor/extensions/jinja.tsx +2 -2
- package/src/components/prompt-editor/extensions/language-support.tsx +2 -2
- package/src/components/prompt-editor/extensions/markdown.tsx +2 -2
- package/src/components/prompt-editor/types.tsx +1 -1
- package/src/components/prompt-editor-with-inputs/editor.tsx +2 -3
- package/src/components/prompt-editor-with-variables/editor.tsx +3 -5
- package/src/components/sql-editor-with-variables/editor.tsx +28 -0
- package/src/components/sql-editor-with-variables/index.tsx +12 -0
- package/src/components/type-selector/index.tsx +2 -3
- package/src/components/variable-selector/index.tsx +2 -2
- package/src/components/variable-selector/use-variable-tree.tsx +7 -4
- package/src/effects/auto-rename-ref/index.ts +1 -1
- package/src/effects/index.ts +7 -7
- package/src/effects/listen-ref-schema-change/index.ts +1 -1
- package/src/effects/listen-ref-value-change/index.ts +1 -1
- package/src/effects/provide-batch-input/index.ts +2 -3
- package/src/effects/provide-json-schema-outputs/index.ts +1 -2
- package/src/form-plugins/batch-outputs-plugin/index.ts +65 -47
- package/src/form-plugins/index.ts +3 -3
- package/src/form-plugins/infer-assign-plugin/index.ts +2 -3
- package/src/form-plugins/infer-inputs-plugin/index.ts +62 -14
- package/src/hooks/{index.tsx → index.ts} +1 -1
- package/src/index.ts +117 -8
- package/src/plugins/index.ts +11 -2
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/plugins/json-schema-preset/index.tsx +8 -24
- package/src/plugins/json-schema-preset/react.tsx +31 -0
- package/src/plugins/json-schema-preset/type-definition/array.tsx +13 -4
- package/src/plugins/json-schema-preset/type-definition/boolean.tsx +17 -1
- package/src/plugins/json-schema-preset/type-definition/date-time.tsx +21 -2
- package/src/plugins/json-schema-preset/type-definition/index.tsx +10 -1
- package/src/plugins/json-schema-preset/type-definition/integer.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/map.tsx +31 -0
- package/src/plugins/json-schema-preset/type-definition/number.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/object.tsx +9 -4
- package/src/plugins/json-schema-preset/type-definition/string.tsx +19 -1
- package/src/plugins/json-schema-preset/{manager.ts → types.ts} +7 -0
- package/src/shared/flow-value/index.ts +11 -1
- package/src/shared/flow-value/utils.ts +23 -11
- package/src/shared/index.ts +26 -5
- package/src/shared/inject-material/index.tsx +10 -6
- package/src/validate/index.ts +6 -0
- package/src/validate/validate-flow-value/index.tsx +1 -2
- package/bin/index.ts +0 -80
- package/bin/materials.ts +0 -134
- package/bin/project.ts +0 -95
- package/bin/utils/import.ts +0 -127
- package/bin/utils/traverse-file.ts +0 -60
- package/dist/esm/chunk-727SU246.js +0 -13
- package/dist/esm/chunk-727SU246.js.map +0 -1
- package/dist/esm/chunk-DEZUEMUM.js +0 -284
- package/dist/esm/chunk-DEZUEMUM.js.map +0 -1
- package/dist/esm/chunk-DUOXDOUE.js +0 -477
- package/dist/esm/chunk-DUOXDOUE.js.map +0 -1
- package/dist/esm/editor-6UMULJYB.js +0 -180
- package/dist/esm/editor-6UMULJYB.js.map +0 -1
- package/dist/esm/editor-EYOQTGMT.js +0 -282
- package/dist/esm/editor-EYOQTGMT.js.map +0 -1
- package/dist/esm/editor-OXPGKPF5.js +0 -167
- package/dist/esm/editor-OXPGKPF5.js.map +0 -1
- package/dist/esm/editor-VO6YAXRC.js +0 -249
- package/dist/esm/editor-VO6YAXRC.js.map +0 -1
- package/dist/esm/editor-XYLKTB6L.js +0 -365
- package/dist/esm/editor-XYLKTB6L.js.map +0 -1
- package/dist/esm/index.js +0 -2668
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.mts +0 -1002
- package/dist/index.d.ts +0 -1002
- package/dist/index.js +0 -5100
- package/dist/index.js.map +0 -1
- package/src/components/assign-row/components/blur-input.tsx +0 -27
- package/src/components/code-editor/language-features.ts +0 -44
- package/src/components/condition-row/constants.ts +0 -134
- package/src/components/condition-row/hooks/useOp.tsx +0 -56
- package/src/components/condition-row/hooks/useRule.ts +0 -35
- package/src/components/db-condition-row/hooks/use-left.tsx +0 -66
- package/src/components/db-condition-row/hooks/use-op.tsx +0 -59
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +0 -174
- package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +0 -83
- package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +0 -94
- /package/src/components/{json-editor-with-variables → coze-editor-extensions}/styles.tsx +0 -0
- /package/src/{typings/flow-value/index.ts → shared/flow-value/types.ts} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
6
|
+
import React, { useMemo, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { isPlainObject, last } from 'lodash-es';
|
|
9
9
|
import {
|
|
@@ -13,10 +13,18 @@ import {
|
|
|
13
13
|
type BaseVariableField,
|
|
14
14
|
useScopeAvailable,
|
|
15
15
|
} from '@flowgram.ai/editor';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
import {
|
|
17
|
+
Mention,
|
|
18
|
+
MentionOpenChangeEvent,
|
|
19
|
+
getCurrentMentionReplaceRange,
|
|
20
|
+
useEditor,
|
|
21
|
+
PositionMirror,
|
|
22
|
+
} from '@flowgram.ai/coze-editor/react';
|
|
23
|
+
import { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
|
|
24
|
+
import { type TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
25
|
+
import { Tree, Popover } from '@douyinfe/semi-ui';
|
|
26
|
+
|
|
27
|
+
import { IFlowValue, FlowValueUtils } from '@/shared';
|
|
20
28
|
|
|
21
29
|
type VariableField = BaseVariableField<{ icon?: string | JSX.Element; title?: string }>;
|
|
22
30
|
|
|
@@ -115,3 +123,85 @@ export function InputsPicker({
|
|
|
115
123
|
|
|
116
124
|
return <Tree treeData={treeData} onSelect={(v) => onSelect(v)} />;
|
|
117
125
|
}
|
|
126
|
+
|
|
127
|
+
const DEFAULT_TRIGGER_CHARACTERS = ['{', '{}', '@'];
|
|
128
|
+
|
|
129
|
+
export function InputsTree({
|
|
130
|
+
inputsValues,
|
|
131
|
+
triggerCharacters = DEFAULT_TRIGGER_CHARACTERS,
|
|
132
|
+
}: {
|
|
133
|
+
inputsValues: Record<string, IFlowValue>;
|
|
134
|
+
triggerCharacters?: string[];
|
|
135
|
+
}) {
|
|
136
|
+
const [posKey, setPosKey] = useState('');
|
|
137
|
+
const [visible, setVisible] = useState(false);
|
|
138
|
+
const [position, setPosition] = useState(-1);
|
|
139
|
+
const editor = useEditor<EditorAPI>();
|
|
140
|
+
|
|
141
|
+
function insert(variablePath: string) {
|
|
142
|
+
const range = getCurrentMentionReplaceRange(editor.$view.state);
|
|
143
|
+
|
|
144
|
+
if (!range) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* When user input {{xxxx}}, {{{xxx}}}(more brackets if possible), replace all brackets with {{xxxx}}
|
|
150
|
+
*/
|
|
151
|
+
let { from, to } = range;
|
|
152
|
+
while (editor.$view.state.doc.sliceString(from - 1, from) === '{') {
|
|
153
|
+
from--;
|
|
154
|
+
}
|
|
155
|
+
while (editor.$view.state.doc.sliceString(to, to + 1) === '}') {
|
|
156
|
+
to++;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
editor.replaceText({
|
|
160
|
+
...range,
|
|
161
|
+
text: '{{' + variablePath + '}}',
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
setVisible(false);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function handleOpenChange(e: MentionOpenChangeEvent) {
|
|
168
|
+
setPosition(e.state.selection.main.head);
|
|
169
|
+
setVisible(e.value);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
if (!editor) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
}, [editor, visible]);
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<>
|
|
180
|
+
<Mention triggerCharacters={triggerCharacters} onOpenChange={handleOpenChange} />
|
|
181
|
+
|
|
182
|
+
<Popover
|
|
183
|
+
visible={visible}
|
|
184
|
+
trigger="custom"
|
|
185
|
+
position="topLeft"
|
|
186
|
+
rePosKey={posKey}
|
|
187
|
+
content={
|
|
188
|
+
<div style={{ width: 300, maxHeight: 300, overflowY: 'auto' }}>
|
|
189
|
+
<InputsPicker
|
|
190
|
+
inputsValues={inputsValues}
|
|
191
|
+
onSelect={(v) => {
|
|
192
|
+
insert(v);
|
|
193
|
+
}}
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
}
|
|
197
|
+
>
|
|
198
|
+
{/* PositionMirror allows the Popover to appear at the specified cursor position */}
|
|
199
|
+
<PositionMirror
|
|
200
|
+
position={position}
|
|
201
|
+
// When Doc scroll, update position
|
|
202
|
+
onChange={() => setPosKey(String(Math.random()))}
|
|
203
|
+
/>
|
|
204
|
+
</Popover>
|
|
205
|
+
</>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
Scope,
|
|
14
14
|
useCurrentScope,
|
|
15
15
|
} from '@flowgram.ai/editor';
|
|
16
|
+
import { useInjector } from '@flowgram.ai/coze-editor/react';
|
|
16
17
|
import { Popover } from '@douyinfe/semi-ui';
|
|
17
18
|
import { IconIssueStroked } from '@douyinfe/semi-icons';
|
|
18
|
-
import { useInjector } from '@coze-editor/editor/react';
|
|
19
19
|
import {
|
|
20
20
|
Decoration,
|
|
21
21
|
DecorationSet,
|
|
@@ -63,10 +63,13 @@ class VariableTagWidget extends WidgetType {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const rootField = last(v.parentFields);
|
|
66
|
+
const rootField = last(v.parentFields) || v;
|
|
67
|
+
const isRoot = v === rootField;
|
|
67
68
|
|
|
68
69
|
const rootTitle = (
|
|
69
|
-
<UIRootTitle>
|
|
70
|
+
<UIRootTitle>
|
|
71
|
+
{rootField.meta?.title ? `${rootField.meta.title} ${isRoot ? '' : '-'} ` : ''}
|
|
72
|
+
</UIRootTitle>
|
|
70
73
|
);
|
|
71
74
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
72
75
|
|
|
@@ -82,7 +85,7 @@ class VariableTagWidget extends WidgetType {
|
|
|
82
85
|
>
|
|
83
86
|
<UITag prefixIcon={rootIcon}>
|
|
84
87
|
{rootTitle}
|
|
85
|
-
<UIVarName>{v?.key}</UIVarName>
|
|
88
|
+
{!isRoot && <UIVarName>{v?.key}</UIVarName>}
|
|
86
89
|
</UITag>
|
|
87
90
|
</Popover>
|
|
88
91
|
);
|
|
@@ -5,19 +5,25 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Popover, Tree } from '@douyinfe/semi-ui';
|
|
9
8
|
import {
|
|
10
9
|
Mention,
|
|
11
10
|
MentionOpenChangeEvent,
|
|
12
11
|
getCurrentMentionReplaceRange,
|
|
13
12
|
useEditor,
|
|
14
13
|
PositionMirror,
|
|
15
|
-
} from '@coze-editor/
|
|
16
|
-
import { EditorAPI } from '@coze-editor/
|
|
14
|
+
} from '@flowgram.ai/coze-editor/react';
|
|
15
|
+
import { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
|
|
16
|
+
import { Popover, Tree } from '@douyinfe/semi-ui';
|
|
17
17
|
|
|
18
18
|
import { useVariableTree } from '@/components/variable-selector';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const DEFAULT_TRIGGER_CHARACTER = ['{', '{}', '@'];
|
|
21
|
+
|
|
22
|
+
export function VariableTree({
|
|
23
|
+
triggerCharacters = DEFAULT_TRIGGER_CHARACTER,
|
|
24
|
+
}: {
|
|
25
|
+
triggerCharacters?: string[];
|
|
26
|
+
}) {
|
|
21
27
|
const [posKey, setPosKey] = useState('');
|
|
22
28
|
const [visible, setVisible] = useState(false);
|
|
23
29
|
const [position, setPosition] = useState(-1);
|
|
@@ -65,7 +71,7 @@ export function VariableTree() {
|
|
|
65
71
|
|
|
66
72
|
return (
|
|
67
73
|
<>
|
|
68
|
-
<Mention triggerCharacters={
|
|
74
|
+
<Mention triggerCharacters={triggerCharacters} onOpenChange={handleOpenChange} />
|
|
69
75
|
|
|
70
76
|
<Popover
|
|
71
77
|
visible={visible}
|
|
@@ -73,9 +79,12 @@ export function VariableTree() {
|
|
|
73
79
|
position="topLeft"
|
|
74
80
|
rePosKey={posKey}
|
|
75
81
|
content={
|
|
76
|
-
<div style={{ width: 300 }}>
|
|
82
|
+
<div style={{ width: 300, maxHeight: 300, overflowY: 'auto' }}>
|
|
77
83
|
<Tree
|
|
78
84
|
treeData={treeData}
|
|
85
|
+
onExpand={(v) => {
|
|
86
|
+
setPosKey(String(Math.random()));
|
|
87
|
+
}}
|
|
79
88
|
onSelect={(v) => {
|
|
80
89
|
insert(v);
|
|
81
90
|
}}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { lazy } from 'react';
|
|
7
|
+
|
|
8
|
+
import { createInjectMaterial } from '@/shared';
|
|
9
|
+
|
|
10
|
+
export const EditorVariableTree = createInjectMaterial(
|
|
11
|
+
lazy(() =>
|
|
12
|
+
import('./extensions/variable-tree').then((module) => ({ default: module.VariableTree }))
|
|
13
|
+
),
|
|
14
|
+
{
|
|
15
|
+
renderKey: 'EditorVariableTree',
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const EditorVariableTagInject = createInjectMaterial(
|
|
20
|
+
lazy(() =>
|
|
21
|
+
import('./extensions/variable-tag').then((module) => ({ default: module.VariableTagInject }))
|
|
22
|
+
),
|
|
23
|
+
{
|
|
24
|
+
renderKey: 'EditorVariableTagInject',
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const EditorInputsTree = createInjectMaterial(
|
|
29
|
+
lazy(() => import('./extensions/inputs-tree').then((module) => ({ default: module.InputsTree }))),
|
|
30
|
+
{
|
|
31
|
+
renderKey: 'EditorInputsTree',
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -6,14 +6,27 @@
|
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { I18n } from '@flowgram.ai/editor';
|
|
9
|
-
import { Input } from '@douyinfe/semi-ui';
|
|
9
|
+
import { Button, Icon, Input, Select } from '@douyinfe/semi-ui';
|
|
10
|
+
import { IconChevronDownStroked } from '@douyinfe/semi-icons';
|
|
10
11
|
|
|
12
|
+
import { useTypeManager } from '@/plugins';
|
|
11
13
|
import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
|
|
14
|
+
import {
|
|
15
|
+
useCondition,
|
|
16
|
+
type ConditionOpConfigs,
|
|
17
|
+
type IConditionRule,
|
|
18
|
+
} from '@/components/condition-context';
|
|
12
19
|
|
|
13
|
-
import { DBConditionOptionType, DBConditionRowValueType
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
import { DBConditionOptionType, DBConditionRowValueType } from './types';
|
|
21
|
+
import {
|
|
22
|
+
UIContainer,
|
|
23
|
+
UILeft,
|
|
24
|
+
UIOperator,
|
|
25
|
+
UIOptionLabel,
|
|
26
|
+
UIRight,
|
|
27
|
+
UISelect,
|
|
28
|
+
UIValues,
|
|
29
|
+
} from './styles';
|
|
17
30
|
|
|
18
31
|
interface PropTypes {
|
|
19
32
|
value?: DBConditionRowValueType;
|
|
@@ -22,8 +35,8 @@ interface PropTypes {
|
|
|
22
35
|
options?: DBConditionOptionType[];
|
|
23
36
|
readonly?: boolean;
|
|
24
37
|
ruleConfig?: {
|
|
25
|
-
ops?:
|
|
26
|
-
rules?:
|
|
38
|
+
ops?: ConditionOpConfigs;
|
|
39
|
+
rules?: Record<string, IConditionRule>;
|
|
27
40
|
};
|
|
28
41
|
}
|
|
29
42
|
|
|
@@ -42,26 +55,65 @@ export function DBConditionRow({
|
|
|
42
55
|
}: PropTypes) {
|
|
43
56
|
const { left, operator, right } = value || {};
|
|
44
57
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
58
|
+
const typeManager = useTypeManager();
|
|
59
|
+
|
|
60
|
+
const leftSchema = useMemo(
|
|
61
|
+
() => options?.find((item) => item.value === left)?.schema,
|
|
62
|
+
[left, options]
|
|
63
|
+
);
|
|
52
64
|
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
readonly,
|
|
58
|
-
userOps: ruleConfig.ops,
|
|
65
|
+
const { opConfig, rule, opOptionList, targetSchema } = useCondition({
|
|
66
|
+
leftSchema,
|
|
67
|
+
operator,
|
|
68
|
+
ruleConfig,
|
|
59
69
|
});
|
|
60
70
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
const renderDBOptionSelect = () => (
|
|
72
|
+
<UISelect
|
|
73
|
+
disabled={readonly}
|
|
74
|
+
size="small"
|
|
75
|
+
style={{ width: '100%' }}
|
|
76
|
+
value={left}
|
|
77
|
+
onChange={(v) =>
|
|
78
|
+
onChange({
|
|
79
|
+
...value,
|
|
80
|
+
left: v as string,
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
optionList={
|
|
84
|
+
options?.map((item) => ({
|
|
85
|
+
label: (
|
|
86
|
+
<UIOptionLabel>
|
|
87
|
+
<Icon size="small" svg={typeManager.getDisplayIcon(item.schema)} />
|
|
88
|
+
{item.label}
|
|
89
|
+
</UIOptionLabel>
|
|
90
|
+
),
|
|
91
|
+
value: item.value,
|
|
92
|
+
})) || []
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const renderOpSelect = () => (
|
|
98
|
+
<Select
|
|
99
|
+
style={{ height: 22 }}
|
|
100
|
+
disabled={readonly}
|
|
101
|
+
size="small"
|
|
102
|
+
value={operator}
|
|
103
|
+
optionList={opOptionList}
|
|
104
|
+
onChange={(v) => {
|
|
105
|
+
onChange({
|
|
106
|
+
...value,
|
|
107
|
+
operator: v as string,
|
|
108
|
+
});
|
|
109
|
+
}}
|
|
110
|
+
triggerRender={({ value }) => (
|
|
111
|
+
<Button size="small" disabled={!rule}>
|
|
112
|
+
{opConfig?.abbreviation || <IconChevronDownStroked size="small" />}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
/>
|
|
116
|
+
);
|
|
65
117
|
|
|
66
118
|
return (
|
|
67
119
|
<UIContainer style={style}>
|
|
@@ -5,20 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
7
7
|
|
|
8
|
-
import { IFlowConstantRefValue } from '@/
|
|
9
|
-
|
|
10
|
-
export interface OpConfig {
|
|
11
|
-
label: string;
|
|
12
|
-
abbreviation: string;
|
|
13
|
-
// When right is not a value, display this text
|
|
14
|
-
rightDisplay?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type OpConfigs = Record<string, OpConfig>;
|
|
18
|
-
|
|
19
|
-
export type IRule = Partial<Record<string, string | null>>;
|
|
20
|
-
|
|
21
|
-
export type IRules = Record<string, IRule>;
|
|
8
|
+
import { IFlowConstantRefValue } from '@/shared';
|
|
22
9
|
|
|
23
10
|
export interface DBConditionRowValueType {
|
|
24
11
|
left?: string;
|
|
@@ -8,7 +8,7 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import { JsonSchemaTypeManager, JsonSchemaUtils } from '@flowgram.ai/json-schema';
|
|
9
9
|
import { useScopeAvailable } from '@flowgram.ai/editor';
|
|
10
10
|
|
|
11
|
-
import { IFlowValue } from '@/
|
|
11
|
+
import { IFlowValue } from '@/shared';
|
|
12
12
|
import { FlowValueUtils } from '@/shared';
|
|
13
13
|
import { DisplaySchemaTag } from '@/components/display-schema-tag';
|
|
14
14
|
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {
|
|
9
|
+
type IJsonSchema,
|
|
10
|
+
type JsonSchemaTypeManager,
|
|
11
|
+
useTypeManager,
|
|
12
|
+
} from '@flowgram.ai/json-schema';
|
|
11
13
|
|
|
12
14
|
import { HorizontalLine, TreeItem, TreeLevel, TreeRow, TreeTitle } from './styles';
|
|
13
15
|
|
|
@@ -33,7 +35,7 @@ function SchemaTree(props: PropsType) {
|
|
|
33
35
|
parentKey = '',
|
|
34
36
|
} = props || {};
|
|
35
37
|
|
|
36
|
-
const typeManager = useTypeManager();
|
|
38
|
+
const typeManager = useTypeManager() as JsonSchemaTypeManager;
|
|
37
39
|
|
|
38
40
|
const config = typeManager.getTypeBySchema(schema);
|
|
39
41
|
const title = typeManager.getComplexText(schema);
|
|
@@ -8,7 +8,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
8
8
|
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
9
9
|
import { useScopeAvailable } from '@flowgram.ai/editor';
|
|
10
10
|
|
|
11
|
-
import { IFlowConstantRefValue } from '@/
|
|
11
|
+
import { IFlowConstantRefValue } from '@/shared';
|
|
12
12
|
|
|
13
13
|
export function useRefVariable(value?: IFlowConstantRefValue) {
|
|
14
14
|
const available = useScopeAvailable();
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { IconButton } from '@douyinfe/semi-ui';
|
|
15
15
|
import { IconSetting } from '@douyinfe/semi-icons';
|
|
16
16
|
|
|
17
|
-
import { IFlowConstantRefValue, IFlowConstantValue } from '@/
|
|
17
|
+
import { IFlowConstantRefValue, IFlowConstantValue } from '@/shared';
|
|
18
18
|
import { createInjectMaterial } from '@/shared';
|
|
19
19
|
import { InjectVariableSelector } from '@/components/variable-selector';
|
|
20
20
|
import { TypeSelector } from '@/components/type-selector';
|
package/src/components/index.ts
CHANGED
|
@@ -3,28 +3,81 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
export { AssignRow, type AssignValueType } from './assign-row';
|
|
7
|
+
export { AssignRows } from './assign-rows';
|
|
8
|
+
export { BatchOutputs } from './batch-outputs';
|
|
9
|
+
export { BatchVariableSelector } from './batch-variable-selector';
|
|
10
|
+
export { BlurInput } from './blur-input';
|
|
11
|
+
export {
|
|
12
|
+
BaseCodeEditor,
|
|
13
|
+
CodeEditor,
|
|
14
|
+
JsonCodeEditor,
|
|
15
|
+
PythonCodeEditor,
|
|
16
|
+
SQLCodeEditor,
|
|
17
|
+
ShellCodeEditor,
|
|
18
|
+
TypeScriptCodeEditor,
|
|
19
|
+
type CodeEditorPropsType,
|
|
20
|
+
} from './code-editor';
|
|
21
|
+
export { CodeEditorMini } from './code-editor-mini';
|
|
22
|
+
export {
|
|
23
|
+
ConditionPresetOp,
|
|
24
|
+
ConditionProvider,
|
|
25
|
+
type ConditionOpConfig,
|
|
26
|
+
type ConditionOpConfigs,
|
|
27
|
+
type IConditionRule,
|
|
28
|
+
type IConditionRuleFactory,
|
|
29
|
+
useCondition,
|
|
30
|
+
useConditionContext,
|
|
31
|
+
} from './condition-context';
|
|
32
|
+
export { ConditionRow, type ConditionRowValueType } from './condition-row';
|
|
33
|
+
export { ConstantInput, type ConstantInputStrategy } from './constant-input';
|
|
34
|
+
export {
|
|
35
|
+
EditorInputsTree,
|
|
36
|
+
EditorVariableTagInject,
|
|
37
|
+
EditorVariableTree,
|
|
38
|
+
} from './coze-editor-extensions';
|
|
39
|
+
export {
|
|
40
|
+
DBConditionRow,
|
|
41
|
+
type DBConditionOptionType,
|
|
42
|
+
type DBConditionRowValueType,
|
|
43
|
+
} from './db-condition-row';
|
|
44
|
+
export { DisplayFlowValue } from './display-flow-value';
|
|
45
|
+
export { DisplayInputsValueAllInTag, DisplayInputsValues } from './display-inputs-values';
|
|
46
|
+
export { DisplayOutputs } from './display-outputs';
|
|
47
|
+
export { DisplaySchemaTag } from './display-schema-tag';
|
|
48
|
+
export { DisplaySchemaTree } from './display-schema-tree';
|
|
49
|
+
export { DynamicValueInput, InjectDynamicValueInput } from './dynamic-value-input';
|
|
50
|
+
export { InputsValues } from './inputs-values';
|
|
51
|
+
export { InputsValuesTree } from './inputs-values-tree';
|
|
52
|
+
export {
|
|
53
|
+
JsonEditorWithVariables,
|
|
54
|
+
type JsonEditorWithVariablesProps,
|
|
55
|
+
} from './json-editor-with-variables';
|
|
56
|
+
export { JsonSchemaEditor } from './json-schema-editor';
|
|
57
|
+
export { PromptEditor, type PromptEditorPropsType } from './prompt-editor';
|
|
58
|
+
export {
|
|
59
|
+
PromptEditorWithInputs,
|
|
60
|
+
type PromptEditorWithInputsProps,
|
|
61
|
+
} from './prompt-editor-with-inputs';
|
|
62
|
+
export {
|
|
63
|
+
PromptEditorWithVariables,
|
|
64
|
+
type PromptEditorWithVariablesProps,
|
|
65
|
+
} from './prompt-editor-with-variables';
|
|
66
|
+
export {
|
|
67
|
+
SQLEditorWithVariables,
|
|
68
|
+
type SQLEditorWithVariablesProps,
|
|
69
|
+
} from './sql-editor-with-variables';
|
|
70
|
+
export {
|
|
71
|
+
InjectTypeSelector,
|
|
72
|
+
TypeSelector,
|
|
73
|
+
getTypeSelectValue,
|
|
74
|
+
parseTypeSelectValue,
|
|
75
|
+
type TypeSelectorProps,
|
|
76
|
+
} from './type-selector';
|
|
77
|
+
export {
|
|
78
|
+
InjectVariableSelector,
|
|
79
|
+
VariableSelector,
|
|
80
|
+
VariableSelectorProvider,
|
|
81
|
+
useVariableTree,
|
|
82
|
+
type VariableSelectorProps,
|
|
83
|
+
} from './variable-selector';
|
|
@@ -9,7 +9,7 @@ import { I18n } from '@flowgram.ai/editor';
|
|
|
9
9
|
import { Button, IconButton } from '@douyinfe/semi-ui';
|
|
10
10
|
import { IconDelete, IconPlus } from '@douyinfe/semi-icons';
|
|
11
11
|
|
|
12
|
-
import { IFlowConstantRefValue, IFlowValue } from '@/
|
|
12
|
+
import { IFlowConstantRefValue, IFlowValue } from '@/shared';
|
|
13
13
|
import { useObjectList } from '@/hooks';
|
|
14
14
|
import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
|
|
15
15
|
import { BlurInput } from '@/components/blur-input';
|
|
@@ -9,7 +9,7 @@ import { I18n } from '@flowgram.ai/editor';
|
|
|
9
9
|
import { IconButton, Input } from '@douyinfe/semi-ui';
|
|
10
10
|
import { IconChevronDown, IconChevronRight, IconDelete } from '@douyinfe/semi-icons';
|
|
11
11
|
|
|
12
|
-
import { IFlowConstantValue } from '@/
|
|
12
|
+
import { IFlowConstantValue } from '@/shared';
|
|
13
13
|
import { ConstantInputStrategy } from '@/components/constant-input';
|
|
14
14
|
|
|
15
15
|
import { PropsType } from './types';
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { I18n } from '@flowgram.ai/editor';
|
|
9
|
-
import { transformerCreator } from '@coze-editor/
|
|
10
|
-
import { Text } from '@coze-editor/
|
|
9
|
+
import { transformerCreator } from '@flowgram.ai/coze-editor/preset-code';
|
|
10
|
+
import { Text } from '@flowgram.ai/coze-editor/language-json';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { EditorVariableTree, EditorVariableTagInject } from '@/components/coze-editor-extensions';
|
|
13
|
+
import { JsonCodeEditor, type CodeEditorPropsType } from '@/components/code-editor';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
import { VariableTagInject } from './extensions/variable-tag';
|
|
15
|
+
const TRIGGER_CHARACTERS = ['@'];
|
|
16
16
|
|
|
17
17
|
type Match = { match: string; range: [number, number] };
|
|
18
18
|
function findAllMatches(inputString: string, regex: RegExp): Match[] {
|
|
@@ -53,8 +53,7 @@ export interface JsonEditorWithVariablesProps extends Omit<CodeEditorPropsType,
|
|
|
53
53
|
|
|
54
54
|
export function JsonEditorWithVariables(props: JsonEditorWithVariablesProps) {
|
|
55
55
|
return (
|
|
56
|
-
<
|
|
57
|
-
languageId="json"
|
|
56
|
+
<JsonCodeEditor
|
|
58
57
|
activeLinePlaceholder={I18n.t("Press '@' to Select variable")}
|
|
59
58
|
{...props}
|
|
60
59
|
options={{
|
|
@@ -62,8 +61,8 @@ export function JsonEditorWithVariables(props: JsonEditorWithVariablesProps) {
|
|
|
62
61
|
...(props.options || {}),
|
|
63
62
|
}}
|
|
64
63
|
>
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
</
|
|
64
|
+
<EditorVariableTree triggerCharacters={TRIGGER_CHARACTERS} />
|
|
65
|
+
<EditorVariableTagInject />
|
|
66
|
+
</JsonCodeEditor>
|
|
68
67
|
);
|
|
69
68
|
}
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
EditorProvider,
|
|
11
11
|
ActiveLinePlaceholder,
|
|
12
12
|
InferValues,
|
|
13
|
-
} from '@coze-editor/
|
|
14
|
-
import preset, { EditorAPI } from '@coze-editor/
|
|
13
|
+
} from '@flowgram.ai/coze-editor/react';
|
|
14
|
+
import preset, { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
|
|
15
15
|
|
|
16
16
|
import { PropsType } from './types';
|
|
17
17
|
import { UIContainer } from './styles';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { useLayoutEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useInjector } from '@coze-editor/
|
|
9
|
-
import { astDecorator } from '@coze-editor
|
|
8
|
+
import { useInjector } from '@flowgram.ai/coze-editor/react';
|
|
9
|
+
import { astDecorator } from '@flowgram.ai/coze-editor';
|
|
10
10
|
import { EditorView } from '@codemirror/view';
|
|
11
11
|
|
|
12
12
|
function JinjaHighlight() {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { useLayoutEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useInjector } from '@coze-editor/
|
|
9
|
-
import { languageSupport } from '@coze-editor/
|
|
8
|
+
import { useInjector } from '@flowgram.ai/coze-editor/react';
|
|
9
|
+
import { languageSupport } from '@flowgram.ai/coze-editor/preset-prompt';
|
|
10
10
|
|
|
11
11
|
function LanguageSupport() {
|
|
12
12
|
const injector = useInjector();
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { useLayoutEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useInjector } from '@coze-editor/
|
|
9
|
-
import { astDecorator } from '@coze-editor
|
|
8
|
+
import { useInjector } from '@flowgram.ai/coze-editor/react';
|
|
9
|
+
import { astDecorator } from '@flowgram.ai/coze-editor';
|
|
10
10
|
import { EditorView } from '@codemirror/view';
|
|
11
11
|
|
|
12
12
|
function MarkdownHighlight() {
|