@flowgram.ai/form-materials 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.sh +6 -0
- package/dist/cjs/components/assign-row/index.js +112 -0
- package/dist/cjs/components/assign-row/types.js +18 -0
- package/dist/cjs/components/assign-rows/index.js +85 -0
- package/dist/cjs/components/batch-outputs/index.js +91 -0
- package/dist/cjs/components/batch-outputs/styles.js +60 -0
- package/dist/cjs/components/batch-outputs/types.js +18 -0
- package/dist/cjs/components/batch-variable-selector/index.js +53 -0
- package/dist/cjs/components/blur-input/index.js +54 -0
- package/dist/cjs/components/code-editor/editor.js +117 -0
- package/dist/cjs/components/code-editor/index.js +57 -0
- package/dist/cjs/components/code-editor/init-worker.js +56 -0
- package/dist/cjs/components/code-editor/language-features.js +21 -0
- package/dist/cjs/components/code-editor/theme/dark.js +188 -0
- package/dist/cjs/components/code-editor/theme/index.js +11 -0
- package/dist/cjs/components/code-editor/theme/light.js +195 -0
- package/dist/cjs/components/code-editor/utils.js +42 -0
- package/dist/cjs/components/code-editor-mini/index.js +66 -0
- package/dist/cjs/components/condition-row/constants.js +165 -0
- package/dist/cjs/components/condition-row/hooks/useOp.js +78 -0
- package/dist/cjs/components/condition-row/hooks/useRule.js +68 -0
- package/dist/cjs/components/condition-row/index.js +123 -0
- package/dist/cjs/components/condition-row/styles.js +77 -0
- package/dist/cjs/components/condition-row/types.js +52 -0
- package/dist/cjs/components/constant-input/index.js +80 -0
- package/dist/cjs/components/constant-input/types.js +18 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +172 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +151 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +106 -0
- package/dist/cjs/components/coze-editor-extensions/index.js +86 -0
- package/dist/cjs/components/coze-editor-extensions/styles.js +89 -0
- package/dist/cjs/components/db-condition-row/hooks/use-left.js +86 -0
- package/dist/cjs/components/db-condition-row/hooks/use-op.js +79 -0
- package/dist/cjs/components/db-condition-row/index.js +115 -0
- package/dist/cjs/components/db-condition-row/styles.js +94 -0
- package/dist/cjs/components/db-condition-row/types.js +18 -0
- package/dist/cjs/components/display-flow-value/index.js +64 -0
- package/dist/cjs/components/display-inputs-values/index.js +76 -0
- package/dist/cjs/components/display-inputs-values/styles.js +51 -0
- package/dist/cjs/components/display-outputs/index.js +72 -0
- package/dist/cjs/components/display-outputs/styles.js +51 -0
- package/dist/cjs/components/display-schema-tag/index.js +77 -0
- package/dist/cjs/components/display-schema-tag/styles.js +71 -0
- package/dist/cjs/components/display-schema-tree/index.js +93 -0
- package/dist/cjs/components/display-schema-tree/styles.js +135 -0
- package/dist/cjs/components/dynamic-value-input/hooks.js +99 -0
- package/dist/cjs/components/dynamic-value-input/index.js +174 -0
- package/dist/cjs/components/dynamic-value-input/styles.js +107 -0
- package/dist/cjs/components/index.js +166 -0
- package/dist/cjs/components/inputs-values/index.js +112 -0
- package/dist/cjs/components/inputs-values/styles.js +60 -0
- package/dist/cjs/components/inputs-values/types.js +18 -0
- package/dist/cjs/components/inputs-values-tree/hooks/use-child-list.js +77 -0
- package/dist/cjs/components/inputs-values-tree/index.js +87 -0
- package/dist/cjs/components/inputs-values-tree/row.js +183 -0
- package/dist/cjs/components/inputs-values-tree/styles.js +177 -0
- package/dist/cjs/components/inputs-values-tree/types.js +18 -0
- package/dist/cjs/components/json-editor-with-variables/editor.js +85 -0
- package/dist/cjs/components/json-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/json-schema-editor/default-value.js +54 -0
- package/dist/cjs/components/json-schema-editor/hooks.js +130 -0
- package/dist/cjs/components/json-schema-editor/index.js +246 -0
- package/dist/cjs/components/json-schema-editor/styles.js +231 -0
- package/dist/cjs/components/json-schema-editor/types.js +18 -0
- package/dist/cjs/components/prompt-editor/editor.js +99 -0
- package/dist/cjs/components/prompt-editor/extensions/jinja.js +73 -0
- package/dist/cjs/components/prompt-editor/extensions/language-support.js +48 -0
- package/dist/cjs/components/prompt-editor/extensions/markdown.js +81 -0
- package/dist/cjs/components/prompt-editor/index.js +57 -0
- package/dist/cjs/components/prompt-editor/styles.js +55 -0
- package/dist/cjs/components/prompt-editor/types.js +7 -0
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +47 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +57 -0
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +48 -0
- package/dist/cjs/components/prompt-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/type-selector/index.js +139 -0
- package/dist/cjs/components/variable-selector/context.js +56 -0
- package/dist/cjs/components/variable-selector/index.js +144 -0
- package/dist/cjs/components/variable-selector/styles.js +114 -0
- package/dist/cjs/components/variable-selector/use-variable-tree.js +100 -0
- package/dist/cjs/effects/auto-rename-ref/index.js +98 -0
- package/dist/cjs/effects/index.js +60 -0
- package/dist/cjs/effects/listen-ref-schema-change/index.js +57 -0
- package/dist/cjs/effects/listen-ref-value-change/index.js +54 -0
- package/dist/cjs/effects/provide-batch-input/index.js +64 -0
- package/dist/cjs/effects/provide-json-schema-outputs/index.js +49 -0
- package/dist/cjs/effects/sync-variable-title/index.js +52 -0
- package/dist/cjs/effects/validate-when-variable-sync/index.js +49 -0
- package/dist/cjs/form-plugins/batch-outputs-plugin/index.js +97 -0
- package/dist/cjs/form-plugins/index.js +47 -0
- package/dist/cjs/form-plugins/infer-assign-plugin/index.js +72 -0
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +47 -0
- package/dist/cjs/hooks/index.js +36 -0
- package/dist/cjs/hooks/use-object-list/index.js +136 -0
- package/dist/cjs/index.js +237 -0
- package/dist/cjs/plugins/disable-declaration-plugin/create-disable-declaration-plugin.js +51 -0
- package/dist/cjs/plugins/disable-declaration-plugin/index.js +36 -0
- package/dist/cjs/plugins/index.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/index.js +57 -0
- package/dist/cjs/plugins/json-schema-preset/manager.js +18 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +63 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +52 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +53 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +49 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +54 -0
- package/dist/cjs/shared/flow-value/index.js +36 -0
- package/dist/cjs/shared/flow-value/schema.js +82 -0
- package/dist/cjs/shared/flow-value/types.js +18 -0
- package/dist/cjs/shared/flow-value/utils.js +142 -0
- package/dist/cjs/shared/format-legacy-refs/index.js +99 -0
- package/dist/cjs/shared/index.js +73 -0
- package/dist/cjs/shared/inject-material/index.js +66 -0
- package/dist/cjs/shared/lazy-suspense/index.js +58 -0
- package/dist/cjs/shared/polyfill-create-root/index.js +53 -0
- package/dist/cjs/validate/index.js +36 -0
- package/dist/cjs/validate/validate-flow-value/index.js +63 -0
- package/dist/esm/components/assign-row/index.mjs +78 -0
- package/dist/esm/components/assign-row/types.mjs +0 -0
- package/dist/esm/components/assign-rows/index.mjs +51 -0
- package/dist/esm/components/batch-outputs/index.mjs +57 -0
- package/dist/esm/components/batch-outputs/styles.mjs +13 -0
- package/dist/esm/components/batch-outputs/types.mjs +0 -0
- package/dist/esm/components/batch-variable-selector/index.mjs +19 -0
- package/dist/esm/components/blur-input/index.mjs +20 -0
- package/dist/esm/components/code-editor/editor.mjs +55 -0
- package/dist/esm/components/code-editor/index.mjs +5 -0
- package/dist/esm/components/code-editor/init-worker.mjs +19 -0
- package/dist/esm/components/code-editor/language-features.mjs +15 -0
- package/dist/esm/components/code-editor/theme/dark.mjs +154 -0
- package/dist/esm/components/code-editor/theme/index.mjs +5 -0
- package/dist/esm/components/code-editor/theme/light.mjs +161 -0
- package/dist/esm/components/code-editor/utils.mjs +8 -0
- package/dist/esm/components/code-editor-mini/index.mjs +22 -0
- package/dist/esm/components/condition-row/constants.mjs +128 -0
- package/dist/esm/components/condition-row/hooks/useOp.mjs +44 -0
- package/dist/esm/components/condition-row/hooks/useRule.mjs +34 -0
- package/dist/esm/components/condition-row/index.mjs +89 -0
- package/dist/esm/components/condition-row/styles.mjs +21 -0
- package/dist/esm/components/condition-row/types.mjs +18 -0
- package/dist/esm/components/constant-input/index.mjs +36 -0
- package/dist/esm/components/constant-input/types.mjs +0 -0
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +135 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +117 -0
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +72 -0
- package/dist/esm/components/coze-editor-extensions/index.mjs +18 -0
- package/{src/components/prompt-editor-with-variables/styles.tsx → dist/esm/components/coze-editor-extensions/styles.mjs} +7 -15
- package/dist/esm/components/db-condition-row/hooks/use-left.mjs +52 -0
- package/dist/esm/components/db-condition-row/hooks/use-op.mjs +45 -0
- package/dist/esm/components/db-condition-row/index.mjs +81 -0
- package/dist/esm/components/db-condition-row/styles.mjs +32 -0
- package/dist/esm/components/db-condition-row/types.mjs +0 -0
- package/dist/esm/components/display-flow-value/index.mjs +30 -0
- package/dist/esm/components/display-inputs-values/index.mjs +39 -0
- package/dist/esm/components/display-inputs-values/styles.mjs +7 -0
- package/dist/esm/components/display-outputs/index.mjs +38 -0
- package/dist/esm/components/display-outputs/styles.mjs +7 -0
- package/dist/esm/components/display-schema-tag/index.mjs +33 -0
- package/dist/esm/components/display-schema-tag/styles.mjs +21 -0
- package/dist/esm/components/display-schema-tree/index.mjs +49 -0
- package/dist/esm/components/display-schema-tree/styles.mjs +79 -0
- package/dist/esm/components/dynamic-value-input/hooks.mjs +59 -0
- package/dist/esm/components/dynamic-value-input/index.mjs +137 -0
- package/dist/esm/components/dynamic-value-input/styles.mjs +54 -0
- package/dist/esm/components/index.mjs +27 -0
- package/dist/esm/components/inputs-values/index.mjs +78 -0
- package/dist/esm/components/inputs-values/styles.mjs +13 -0
- package/dist/esm/components/inputs-values/types.mjs +0 -0
- package/dist/esm/components/inputs-values-tree/hooks/use-child-list.mjs +43 -0
- package/dist/esm/components/inputs-values-tree/index.mjs +53 -0
- package/dist/esm/components/inputs-values-tree/row.mjs +149 -0
- package/dist/esm/components/inputs-values-tree/styles.mjs +105 -0
- package/dist/esm/components/inputs-values-tree/types.mjs +0 -0
- package/dist/esm/components/json-editor-with-variables/editor.mjs +51 -0
- package/dist/esm/components/json-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/json-schema-editor/default-value.mjs +20 -0
- package/dist/esm/components/json-schema-editor/hooks.mjs +96 -0
- package/dist/esm/components/json-schema-editor/index.mjs +212 -0
- package/dist/esm/components/json-schema-editor/styles.mjs +138 -0
- package/dist/esm/components/json-schema-editor/types.mjs +0 -0
- package/dist/esm/components/prompt-editor/editor.mjs +52 -0
- package/dist/esm/components/prompt-editor/extensions/jinja.mjs +39 -0
- package/dist/esm/components/prompt-editor/extensions/language-support.mjs +14 -0
- package/dist/esm/components/prompt-editor/extensions/markdown.mjs +47 -0
- package/dist/esm/components/prompt-editor/index.mjs +5 -0
- package/dist/esm/components/prompt-editor/styles.mjs +11 -0
- package/dist/esm/components/prompt-editor/types.mjs +1 -0
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +13 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +5 -0
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +14 -0
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +5 -0
- package/dist/esm/components/type-selector/index.mjs +96 -0
- package/dist/esm/components/variable-selector/context.mjs +16 -0
- package/dist/esm/components/variable-selector/index.mjs +101 -0
- package/dist/esm/components/variable-selector/styles.mjs +58 -0
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +66 -0
- package/dist/esm/effects/auto-rename-ref/index.mjs +64 -0
- package/dist/esm/effects/index.mjs +8 -0
- package/dist/esm/effects/listen-ref-schema-change/index.mjs +23 -0
- package/dist/esm/effects/listen-ref-value-change/index.mjs +20 -0
- package/dist/esm/effects/provide-batch-input/index.mjs +30 -0
- package/dist/esm/effects/provide-json-schema-outputs/index.mjs +15 -0
- package/dist/esm/effects/sync-variable-title/index.mjs +18 -0
- package/dist/esm/effects/validate-when-variable-sync/index.mjs +15 -0
- package/dist/esm/form-plugins/batch-outputs-plugin/index.mjs +60 -0
- package/dist/esm/form-plugins/index.mjs +4 -0
- package/dist/esm/form-plugins/infer-assign-plugin/index.mjs +38 -0
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +13 -0
- package/dist/esm/hooks/index.mjs +2 -0
- package/dist/esm/hooks/use-object-list/index.mjs +102 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/plugins/disable-declaration-plugin/create-disable-declaration-plugin.mjs +17 -0
- package/dist/esm/plugins/disable-declaration-plugin/index.mjs +2 -0
- package/dist/esm/plugins/index.mjs +3 -0
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/index.mjs +14 -0
- package/dist/esm/plugins/json-schema-preset/manager.mjs +0 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +29 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +18 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +19 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +15 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +20 -0
- package/dist/esm/shared/flow-value/index.mjs +2 -0
- package/dist/esm/shared/flow-value/schema.mjs +26 -0
- package/dist/esm/shared/flow-value/types.mjs +0 -0
- package/dist/esm/shared/flow-value/utils.mjs +108 -0
- package/dist/esm/shared/format-legacy-refs/index.mjs +50 -0
- package/dist/esm/shared/index.mjs +6 -0
- package/dist/esm/shared/inject-material/index.mjs +22 -0
- package/dist/esm/shared/lazy-suspense/index.mjs +21 -0
- package/dist/esm/shared/polyfill-create-root/index.mjs +16 -0
- package/dist/esm/validate/index.mjs +2 -0
- package/dist/esm/validate/validate-flow-value/index.mjs +29 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/components/assign-row/index.d.ts +8 -0
- package/dist/types/components/assign-row/types.d.ts +20 -0
- package/dist/types/components/assign-rows/index.d.ts +11 -0
- package/dist/types/components/batch-outputs/index.d.ts +7 -0
- package/dist/types/components/batch-outputs/styles.d.ts +6 -0
- package/dist/types/components/batch-outputs/types.d.ts +18 -0
- package/dist/types/components/batch-variable-selector/index.d.ts +7 -0
- package/dist/types/components/blur-input/index.d.ts +13 -0
- package/dist/types/components/code-editor/editor.d.ts +23 -0
- package/dist/types/components/code-editor/index.d.ts +6 -0
- package/{src/validate/index.tsx → dist/types/components/code-editor/init-worker.d.ts} +1 -2
- package/{src/typings/index.ts → dist/types/components/code-editor/language-features.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/dark.d.ts +6 -0
- package/{src/hooks/index.tsx → dist/types/components/code-editor/theme/index.d.ts} +1 -2
- package/dist/types/components/code-editor/theme/light.d.ts +6 -0
- package/dist/types/components/code-editor/utils.d.ts +5 -0
- package/dist/types/components/code-editor-mini/index.d.ts +7 -0
- package/dist/types/components/condition-row/constants.d.ts +7 -0
- package/dist/types/components/condition-row/hooks/useOp.d.ts +18 -0
- package/dist/types/components/condition-row/hooks/useRule.d.ts +9 -0
- package/dist/types/components/condition-row/index.d.ts +22 -0
- package/dist/types/components/condition-row/styles.d.ts +9 -0
- package/dist/types/components/condition-row/types.d.ts +34 -0
- package/dist/types/components/constant-input/index.d.ts +8 -0
- package/dist/types/components/constant-input/types.d.ts +16 -0
- package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +14 -0
- package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +5 -0
- package/dist/types/components/coze-editor-extensions/extensions/variable-tree.d.ts +8 -0
- package/dist/types/components/coze-editor-extensions/index.d.ts +18 -0
- package/dist/types/components/coze-editor-extensions/styles.d.ts +9 -0
- package/dist/types/components/db-condition-row/hooks/use-left.d.ts +18 -0
- package/dist/types/components/db-condition-row/hooks/use-op.d.ts +18 -0
- package/dist/types/components/db-condition-row/index.d.ts +19 -0
- package/dist/types/components/db-condition-row/styles.d.ts +12 -0
- package/dist/types/components/db-condition-row/types.d.ts +25 -0
- package/dist/types/components/display-flow-value/index.d.ts +15 -0
- package/dist/types/components/display-inputs-values/index.d.ts +14 -0
- package/dist/types/components/display-inputs-values/styles.d.ts +5 -0
- package/dist/types/components/display-outputs/index.d.ts +14 -0
- package/dist/types/components/display-outputs/styles.d.ts +5 -0
- package/dist/types/components/display-schema-tag/index.d.ts +14 -0
- package/dist/types/components/display-schema-tag/styles.d.ts +8 -0
- package/dist/types/components/display-schema-tree/index.d.ts +16 -0
- package/dist/types/components/display-schema-tree/styles.d.ts +11 -0
- package/dist/types/components/dynamic-value-input/hooks.d.ts +28 -0
- package/dist/types/components/dynamic-value-input/index.d.ts +29 -0
- package/dist/types/components/dynamic-value-input/styles.d.ts +8 -0
- package/dist/types/components/index.d.ts +30 -0
- package/dist/types/components/inputs-values/index.d.ts +7 -0
- package/dist/types/components/inputs-values/styles.d.ts +6 -0
- package/dist/types/components/inputs-values/types.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/hooks/use-child-list.d.ts +19 -0
- package/dist/types/components/inputs-values-tree/index.d.ts +7 -0
- package/dist/types/components/inputs-values-tree/row.d.ts +15 -0
- package/dist/types/components/inputs-values-tree/styles.d.ts +23 -0
- package/dist/types/components/inputs-values-tree/types.d.ts +18 -0
- package/dist/types/components/json-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/json-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/json-schema-editor/default-value.d.ts +17 -0
- package/dist/types/components/json-schema-editor/hooks.d.ts +12 -0
- package/dist/types/components/json-schema-editor/index.d.ts +14 -0
- package/dist/types/components/json-schema-editor/styles.d.ts +30 -0
- package/dist/types/components/json-schema-editor/types.d.ts +20 -0
- package/dist/types/components/prompt-editor/editor.d.ts +15 -0
- package/dist/types/components/prompt-editor/extensions/jinja.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/language-support.d.ts +6 -0
- package/dist/types/components/prompt-editor/extensions/markdown.d.ts +6 -0
- package/dist/types/components/prompt-editor/index.d.ts +6 -0
- package/dist/types/components/prompt-editor/styles.d.ts +7 -0
- package/dist/types/components/prompt-editor/types.d.ts +16 -0
- package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +10 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +6 -0
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +9 -0
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +6 -0
- package/dist/types/components/type-selector/index.d.ts +25 -0
- package/dist/types/components/variable-selector/context.d.ts +16 -0
- package/dist/types/components/variable-selector/index.d.ts +31 -0
- package/dist/types/components/variable-selector/styles.d.ts +14 -0
- package/dist/types/components/variable-selector/use-variable-tree.d.ts +18 -0
- package/dist/types/effects/auto-rename-ref/index.d.ts +17 -0
- package/dist/types/effects/index.d.ts +11 -0
- package/dist/types/effects/listen-ref-schema-change/index.d.ts +22 -0
- package/dist/types/effects/listen-ref-value-change/index.d.ts +22 -0
- package/dist/types/effects/provide-batch-input/index.d.ts +6 -0
- package/dist/types/effects/provide-json-schema-outputs/index.d.ts +6 -0
- package/dist/types/effects/sync-variable-title/index.d.ts +6 -0
- package/dist/types/effects/validate-when-variable-sync/index.d.ts +8 -0
- package/dist/types/form-plugins/batch-outputs-plugin/index.d.ts +12 -0
- package/dist/types/form-plugins/index.d.ts +7 -0
- package/dist/types/form-plugins/infer-assign-plugin/index.d.ts +10 -0
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +11 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/use-object-list/index.d.ts +22 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/plugins/disable-declaration-plugin/create-disable-declaration-plugin.d.ts +5 -0
- package/dist/types/plugins/disable-declaration-plugin/index.d.ts +5 -0
- package/dist/types/plugins/index.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +9 -0
- package/dist/types/plugins/json-schema-preset/index.d.ts +13 -0
- package/dist/types/plugins/json-schema-preset/manager.d.ts +17 -0
- package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +5 -0
- package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/number.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +6 -0
- package/dist/types/shared/flow-value/index.d.ts +6 -0
- package/dist/types/shared/flow-value/schema.d.ts +107 -0
- package/dist/types/shared/flow-value/types.d.ts +32 -0
- package/dist/types/shared/flow-value/utils.d.ts +65 -0
- package/dist/types/shared/format-legacy-refs/index.d.ts +84 -0
- package/dist/types/shared/index.d.ts +9 -0
- package/dist/types/shared/inject-material/index.d.ts +48 -0
- package/dist/types/shared/lazy-suspense/index.d.ts +7 -0
- package/dist/types/shared/polyfill-create-root/index.d.ts +10 -0
- package/dist/types/validate/index.d.ts +5 -0
- package/dist/types/validate/validate-flow-value/index.d.ts +19 -0
- package/package.json +20 -21
- package/src/components/assign-row/index.tsx +3 -3
- package/src/components/assign-row/types.ts +1 -1
- package/src/components/batch-outputs/types.ts +1 -1
- package/src/components/blur-input/index.tsx +9 -1
- package/src/components/code-editor/editor.tsx +10 -9
- package/src/components/code-editor/init-worker.ts +27 -0
- package/src/components/code-editor/language-features.ts +6 -27
- package/src/components/code-editor/theme/dark.ts +1 -1
- package/src/components/code-editor/theme/index.ts +1 -1
- package/src/components/code-editor/theme/light.ts +1 -1
- package/src/components/condition-row/hooks/useRule.ts +1 -1
- package/src/components/condition-row/types.ts +1 -1
- package/src/components/constant-input/index.tsx +1 -1
- package/src/components/{prompt-editor-with-inputs/inputs-picker.tsx → coze-editor-extensions/extensions/inputs-tree.tsx} +95 -5
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.tsx +1 -1
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +12 -6
- package/src/components/coze-editor-extensions/index.tsx +33 -0
- package/src/components/db-condition-row/types.ts +1 -1
- package/src/components/display-flow-value/index.tsx +1 -1
- package/src/components/dynamic-value-input/hooks.ts +1 -1
- package/src/components/dynamic-value-input/index.tsx +1 -1
- package/src/components/index.ts +55 -25
- package/src/components/inputs-values/index.tsx +1 -1
- package/src/components/inputs-values/types.ts +1 -1
- package/src/components/inputs-values-tree/row.tsx +1 -1
- package/src/components/json-editor-with-variables/editor.tsx +6 -6
- package/src/components/prompt-editor/editor.tsx +2 -2
- package/src/components/prompt-editor/extensions/jinja.tsx +2 -2
- package/src/components/prompt-editor/extensions/language-support.tsx +2 -2
- package/src/components/prompt-editor/extensions/markdown.tsx +2 -2
- package/src/components/prompt-editor/types.tsx +1 -1
- package/src/components/prompt-editor-with-inputs/editor.tsx +2 -3
- package/src/components/prompt-editor-with-variables/editor.tsx +3 -5
- package/src/components/variable-selector/index.tsx +2 -0
- package/src/effects/auto-rename-ref/index.ts +1 -1
- package/src/effects/index.ts +7 -7
- package/src/effects/listen-ref-schema-change/index.ts +1 -1
- package/src/effects/listen-ref-value-change/index.ts +1 -1
- package/src/effects/provide-batch-input/index.ts +1 -1
- package/src/form-plugins/batch-outputs-plugin/index.ts +1 -1
- package/src/form-plugins/index.ts +3 -3
- package/src/form-plugins/infer-assign-plugin/index.ts +1 -1
- package/src/hooks/index.ts +6 -0
- package/src/index.ts +101 -8
- package/src/plugins/index.ts +11 -2
- package/src/plugins/json-schema-preset/index.tsx +4 -4
- package/src/shared/flow-value/index.ts +11 -1
- package/src/shared/flow-value/utils.ts +1 -2
- package/src/shared/index.ts +26 -5
- package/src/shared/inject-material/index.tsx +10 -6
- package/src/validate/index.ts +6 -0
- package/src/validate/validate-flow-value/index.tsx +1 -1
- package/bin/index.ts +0 -80
- package/bin/materials.ts +0 -134
- package/bin/project.ts +0 -95
- package/bin/utils/import.ts +0 -127
- package/bin/utils/traverse-file.ts +0 -60
- package/dist/esm/chunk-727SU246.js +0 -13
- package/dist/esm/chunk-727SU246.js.map +0 -1
- package/dist/esm/chunk-DEZUEMUM.js +0 -284
- package/dist/esm/chunk-DEZUEMUM.js.map +0 -1
- package/dist/esm/chunk-IHOHRV5V.js +0 -477
- package/dist/esm/chunk-IHOHRV5V.js.map +0 -1
- package/dist/esm/editor-4X7K477H.js +0 -282
- package/dist/esm/editor-4X7K477H.js.map +0 -1
- package/dist/esm/editor-6UMULJYB.js +0 -180
- package/dist/esm/editor-6UMULJYB.js.map +0 -1
- package/dist/esm/editor-E2BQTPCD.js +0 -388
- package/dist/esm/editor-E2BQTPCD.js.map +0 -1
- package/dist/esm/editor-OXPGKPF5.js +0 -167
- package/dist/esm/editor-OXPGKPF5.js.map +0 -1
- package/dist/esm/editor-Z24WLBPO.js +0 -249
- package/dist/esm/editor-Z24WLBPO.js.map +0 -1
- package/dist/esm/index.js +0 -2668
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.mts +0 -1002
- package/dist/index.d.ts +0 -1002
- package/dist/index.js +0 -5127
- package/dist/index.js.map +0 -1
- package/src/components/assign-row/components/blur-input.tsx +0 -27
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +0 -174
- package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +0 -83
- package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +0 -94
- /package/src/components/{json-editor-with-variables → coze-editor-extensions}/styles.tsx +0 -0
- /package/src/{typings/flow-value/index.ts → shared/flow-value/types.ts} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
6
|
+
export interface IFlowValueExtra {
|
|
7
|
+
index?: number;
|
|
8
|
+
}
|
|
9
|
+
export type FlowValueType = 'constant' | 'ref' | 'expression' | 'template';
|
|
10
|
+
export interface IFlowConstantValue {
|
|
11
|
+
type: 'constant';
|
|
12
|
+
content?: any;
|
|
13
|
+
schema?: IJsonSchema;
|
|
14
|
+
extra?: IFlowValueExtra;
|
|
15
|
+
}
|
|
16
|
+
export interface IFlowRefValue {
|
|
17
|
+
type: 'ref';
|
|
18
|
+
content?: string[];
|
|
19
|
+
extra?: IFlowValueExtra;
|
|
20
|
+
}
|
|
21
|
+
export interface IFlowExpressionValue {
|
|
22
|
+
type: 'expression';
|
|
23
|
+
content?: string;
|
|
24
|
+
extra?: IFlowValueExtra;
|
|
25
|
+
}
|
|
26
|
+
export interface IFlowTemplateValue {
|
|
27
|
+
type: 'template';
|
|
28
|
+
content?: string;
|
|
29
|
+
extra?: IFlowValueExtra;
|
|
30
|
+
}
|
|
31
|
+
export type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
|
|
32
|
+
export type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
6
|
+
import { Scope } from '@flowgram.ai/editor';
|
|
7
|
+
import { IFlowConstantValue, IFlowRefValue, IFlowExpressionValue, IFlowTemplateValue, IFlowValue, IFlowConstantRefValue, FlowValueType } from './types';
|
|
8
|
+
export declare namespace FlowValueUtils {
|
|
9
|
+
/**
|
|
10
|
+
* Check if the value is a constant type
|
|
11
|
+
*/
|
|
12
|
+
function isConstant(value: any): value is IFlowConstantValue;
|
|
13
|
+
/**
|
|
14
|
+
* Check if the value is a reference type
|
|
15
|
+
*/
|
|
16
|
+
function isRef(value: any): value is IFlowRefValue;
|
|
17
|
+
/**
|
|
18
|
+
* Check if the value is an expression type
|
|
19
|
+
*/
|
|
20
|
+
function isExpression(value: any): value is IFlowExpressionValue;
|
|
21
|
+
/**
|
|
22
|
+
* Check if the value is a template type
|
|
23
|
+
*/
|
|
24
|
+
function isTemplate(value: any): value is IFlowTemplateValue;
|
|
25
|
+
/**
|
|
26
|
+
* Check if the value is either a constant or reference type
|
|
27
|
+
*/
|
|
28
|
+
function isConstantOrRef(value: any): value is IFlowConstantRefValue;
|
|
29
|
+
/**
|
|
30
|
+
* Check if the value is a valid flow value type
|
|
31
|
+
*/
|
|
32
|
+
function isFlowValue(value: any): value is IFlowValue;
|
|
33
|
+
/**
|
|
34
|
+
* Traverse all flow values in the given value
|
|
35
|
+
* @param value The value to traverse
|
|
36
|
+
* @param options The options to traverse
|
|
37
|
+
* @returns A generator of flow values
|
|
38
|
+
*/
|
|
39
|
+
function traverse(value: any, options: {
|
|
40
|
+
includeTypes?: FlowValueType[];
|
|
41
|
+
path?: string;
|
|
42
|
+
}): Generator<{
|
|
43
|
+
value: IFlowValue;
|
|
44
|
+
path: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Get all key paths in the template value
|
|
48
|
+
* @param value The template value
|
|
49
|
+
* @returns A list of key paths
|
|
50
|
+
*/
|
|
51
|
+
function getTemplateKeyPaths(value: IFlowTemplateValue): string[][];
|
|
52
|
+
/**
|
|
53
|
+
* Infer the schema of the constant value
|
|
54
|
+
* @param value
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
function inferConstantJsonSchema(value: IFlowConstantValue): IJsonSchema | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Infer the schema of the flow value
|
|
60
|
+
* @param values The flow value or object contains flow value
|
|
61
|
+
* @param scope
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
function inferJsonSchema(values: any, scope: Scope): IJsonSchema | undefined;
|
|
65
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
interface LegacyFlowRefValueSchema {
|
|
6
|
+
type: 'ref';
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
interface NewFlowRefValueSchema {
|
|
10
|
+
type: 'ref';
|
|
11
|
+
content: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
15
|
+
* the FlowRefValueSchema type definition is updated:
|
|
16
|
+
*
|
|
17
|
+
* interface LegacyFlowRefValueSchema {
|
|
18
|
+
* type: 'ref';
|
|
19
|
+
* content: string;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* interface NewFlowRefValueSchema {
|
|
23
|
+
* type: 'ref';
|
|
24
|
+
* content: string[];
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
29
|
+
*
|
|
30
|
+
* How to use:
|
|
31
|
+
*
|
|
32
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
33
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
34
|
+
*
|
|
35
|
+
* Example:
|
|
36
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
37
|
+
* formMeta: {
|
|
38
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
39
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatLegacyRefOnSubmit(value: any): any;
|
|
43
|
+
/**
|
|
44
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
45
|
+
* the FlowRefValueSchema type definition is updated:
|
|
46
|
+
*
|
|
47
|
+
* interface LegacyFlowRefValueSchema {
|
|
48
|
+
* type: 'ref';
|
|
49
|
+
* content: string;
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* interface NewFlowRefValueSchema {
|
|
53
|
+
* type: 'ref';
|
|
54
|
+
* content: string[];
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
59
|
+
*
|
|
60
|
+
* How to use:
|
|
61
|
+
*
|
|
62
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
63
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
64
|
+
*
|
|
65
|
+
* Example:
|
|
66
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
67
|
+
*
|
|
68
|
+
* formMeta: {
|
|
69
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
70
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
71
|
+
* }
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatLegacyRefOnInit(value: any): any;
|
|
74
|
+
export declare function isLegacyFlowRefValueSchema(value: any): value is LegacyFlowRefValueSchema;
|
|
75
|
+
export declare function isNewFlowRefValueSchema(value: any): value is NewFlowRefValueSchema;
|
|
76
|
+
export declare function formatLegacyRefToNewRef(value: LegacyFlowRefValueSchema): {
|
|
77
|
+
type: string;
|
|
78
|
+
content: string[];
|
|
79
|
+
};
|
|
80
|
+
export declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
|
|
81
|
+
type: string;
|
|
82
|
+
content: string;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export { FlowValueUtils, type FlowValueType, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, } from './flow-value';
|
|
6
|
+
export { formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, } from './format-legacy-refs';
|
|
7
|
+
export { createInjectMaterial } from './inject-material';
|
|
8
|
+
export { lazySuspense, withSuspense } from './lazy-suspense';
|
|
9
|
+
export { polyfillCreateRoot, unstableSetCreateRoot, type IPolyfillRoot, } from './polyfill-create-root';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
type WithRenderKey<T> = T & {
|
|
7
|
+
renderKey?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a material component wrapper with dependency injection support
|
|
11
|
+
*
|
|
12
|
+
* This Higher-Order Component (HOC) implements a dynamic component replacement mechanism
|
|
13
|
+
* for material components. It automatically checks if a custom renderer is registered
|
|
14
|
+
* in the editor context, using the injected component if available, otherwise
|
|
15
|
+
* falling back to the default component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // 1.Create an injectable material component
|
|
20
|
+
* const InjectVariableSelector = createInjectMaterial(VariableSelector)
|
|
21
|
+
*
|
|
22
|
+
* // 2. Register custom components in editor
|
|
23
|
+
* // Configure in use-editor-props.tsx:
|
|
24
|
+
* const editorProps = {
|
|
25
|
+
* materials: {
|
|
26
|
+
* components: {
|
|
27
|
+
* [VariableSelector.renderKey]: YourCustomVariableSelector
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @description
|
|
34
|
+
* Data flow explanation:
|
|
35
|
+
* - Register components to FlowRendererRegistry in use-editor-props
|
|
36
|
+
* - InjectMaterial reads renderers from FlowRendererRegistry
|
|
37
|
+
* - If registered renderer exists and type is REACT, use injected component
|
|
38
|
+
* - If not exists or type mismatch, fallback to default component
|
|
39
|
+
*
|
|
40
|
+
* @param Component - Default React component
|
|
41
|
+
* @param params - Optional parameters
|
|
42
|
+
* @param params.renderKey - Custom render key name, highest priority
|
|
43
|
+
* @returns Wrapper component with dependency injection support
|
|
44
|
+
*/
|
|
45
|
+
export declare function createInjectMaterial<Props>(Component: WithRenderKey<React.FC<Props> | React.ExoticComponent<Props>>, params?: {
|
|
46
|
+
renderKey?: string;
|
|
47
|
+
}): WithRenderKey<React.FC<Props>>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import React, { ComponentType, lazy } from 'react';
|
|
6
|
+
export declare function withSuspense<T extends ComponentType<any>>(Component: T, fallback?: React.ReactNode): T;
|
|
7
|
+
export declare function lazySuspense<T extends ComponentType<any>>(params: Parameters<typeof lazy<T>>[0], fallback?: React.ReactNode): React.LazyExoticComponent<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export interface IPolyfillRoot {
|
|
6
|
+
render(children: React.ReactNode): void;
|
|
7
|
+
unmount(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot;
|
|
10
|
+
export declare function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { FeedbackLevel, FlowNodeEntity } from '@flowgram.ai/editor';
|
|
6
|
+
import { IFlowValue } from '../../shared';
|
|
7
|
+
interface Context {
|
|
8
|
+
node: FlowNodeEntity;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
errorMessages?: {
|
|
11
|
+
required?: string;
|
|
12
|
+
unknownVariable?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context): {
|
|
16
|
+
level: FeedbackLevel;
|
|
17
|
+
message: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowgram.ai/form-materials",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"homepage": "https://flowgram.ai/",
|
|
5
5
|
"repository": "https://github.com/bytedance/flowgram.ai",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/esm/index.
|
|
10
|
-
"require": "./dist/index.js"
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"import": "./dist/esm/index.mjs",
|
|
10
|
+
"require": "./dist/cjs/index.js"
|
|
11
11
|
},
|
|
12
|
-
"main": "./dist/index.js",
|
|
13
|
-
"module": "./dist/esm/index.
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
12
|
+
"main": "./dist/cjs/index.js",
|
|
13
|
+
"module": "./dist/esm/index.mjs",
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
15
|
"bin": {
|
|
16
|
-
"flowgram-form-materials": "./bin/
|
|
16
|
+
"flowgram-form-materials": "./bin/run.sh"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
@@ -26,17 +26,13 @@
|
|
|
26
26
|
"@douyinfe/semi-ui": "^2.80.0",
|
|
27
27
|
"lodash-es": "^4.17.21",
|
|
28
28
|
"nanoid": "^4.0.2",
|
|
29
|
-
"commander": "^11.0.0",
|
|
30
|
-
"chalk": "^5.3.0",
|
|
31
|
-
"inquirer": "^9.2.7",
|
|
32
29
|
"immer": "~10.1.1",
|
|
33
|
-
"@coze-editor/editor": "0.1.0-alpha.5a549c",
|
|
34
30
|
"@codemirror/view": "~6.38.0",
|
|
35
31
|
"@codemirror/state": "~6.5.2",
|
|
36
|
-
"typescript": "^5.8.3",
|
|
37
32
|
"zod": "^3.24.4",
|
|
38
|
-
"@flowgram.ai/
|
|
39
|
-
"@flowgram.ai/
|
|
33
|
+
"@flowgram.ai/json-schema": "0.4.11",
|
|
34
|
+
"@flowgram.ai/coze-editor": "0.4.11",
|
|
35
|
+
"@flowgram.ai/editor": "0.4.11"
|
|
40
36
|
},
|
|
41
37
|
"devDependencies": {
|
|
42
38
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -49,11 +45,13 @@
|
|
|
49
45
|
"react": "^18",
|
|
50
46
|
"react-dom": "^18",
|
|
51
47
|
"styled-components": "^5",
|
|
52
|
-
"tsup": "^8.0.1",
|
|
53
48
|
"typescript": "^5.8.3",
|
|
54
49
|
"vitest": "^0.34.6",
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
50
|
+
"@rslib/core": "~0.12.4",
|
|
51
|
+
"cross-env": "~7.0.3",
|
|
52
|
+
"@rsbuild/plugin-react": "^1.1.1",
|
|
53
|
+
"@flowgram.ai/eslint-config": "0.4.11",
|
|
54
|
+
"@flowgram.ai/ts-config": "0.4.11"
|
|
57
55
|
},
|
|
58
56
|
"peerDependencies": {
|
|
59
57
|
"react": ">=16.8",
|
|
@@ -65,9 +63,10 @@
|
|
|
65
63
|
"registry": "https://registry.npmjs.org/"
|
|
66
64
|
},
|
|
67
65
|
"scripts": {
|
|
68
|
-
"build": "
|
|
69
|
-
"build:fast": "
|
|
70
|
-
"build:watch": "npm run build:fast
|
|
66
|
+
"build": "cross-env NODE_ENV=production rslib build",
|
|
67
|
+
"build:fast": "cross-env NODE_ENV=development rslib build",
|
|
68
|
+
"build:watch": "npm run build:fast",
|
|
69
|
+
"name-export": "node scripts/name-export.js",
|
|
71
70
|
"clean": "rimraf dist",
|
|
72
71
|
"test": "exit 0",
|
|
73
72
|
"test:cov": "exit 0",
|
|
@@ -8,12 +8,12 @@ import React from 'react';
|
|
|
8
8
|
import { IconButton } from '@douyinfe/semi-ui';
|
|
9
9
|
import { IconMinus } from '@douyinfe/semi-icons';
|
|
10
10
|
|
|
11
|
-
import { IFlowConstantRefValue } from '@/
|
|
11
|
+
import { IFlowConstantRefValue } from '@/shared';
|
|
12
12
|
import { InjectVariableSelector } from '@/components/variable-selector';
|
|
13
13
|
import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
|
|
14
|
+
import { BlurInput } from '@/components/blur-input';
|
|
14
15
|
|
|
15
16
|
import { AssignRowProps } from './types';
|
|
16
|
-
import { BlurInput } from './components/blur-input';
|
|
17
17
|
|
|
18
18
|
export function AssignRow(props: AssignRowProps) {
|
|
19
19
|
const {
|
|
@@ -81,4 +81,4 @@ export function AssignRow(props: AssignRowProps) {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export { AssignValueType } from './types';
|
|
84
|
+
export { type AssignValueType } from './types';
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/* eslint-disable react/prop-types */
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
9
|
+
* SPDX-License-Identifier: MIT
|
|
10
|
+
*/
|
|
11
|
+
|
|
6
12
|
import React, { useEffect, useState } from 'react';
|
|
7
13
|
|
|
8
|
-
import
|
|
14
|
+
import { Input } from '@douyinfe/semi-ui';
|
|
15
|
+
|
|
16
|
+
type InputProps = React.ComponentPropsWithoutRef<typeof Input>;
|
|
9
17
|
|
|
10
18
|
export function BlurInput(props: InputProps) {
|
|
11
19
|
const [value, setValue] = useState('');
|
|
@@ -10,12 +10,11 @@ import {
|
|
|
10
10
|
createRenderer,
|
|
11
11
|
EditorProvider,
|
|
12
12
|
InferValues,
|
|
13
|
-
} from '@coze-editor/
|
|
14
|
-
import preset, { type EditorAPI } from '@coze-editor/
|
|
13
|
+
} from '@flowgram.ai/coze-editor/react';
|
|
14
|
+
import preset, { type EditorAPI } from '@flowgram.ai/coze-editor/preset-code';
|
|
15
15
|
import { EditorView } from '@codemirror/view';
|
|
16
16
|
|
|
17
17
|
import { getSuffixByLanguageId } from './utils';
|
|
18
|
-
import { initTsWorker } from './language-features';
|
|
19
18
|
|
|
20
19
|
import './theme';
|
|
21
20
|
import './language-features';
|
|
@@ -55,12 +54,6 @@ export function CodeEditor({
|
|
|
55
54
|
}: CodeEditorPropsType) {
|
|
56
55
|
const editorRef = useRef<EditorAPI | null>(null);
|
|
57
56
|
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (languageId === 'typescript') {
|
|
60
|
-
initTsWorker();
|
|
61
|
-
}
|
|
62
|
-
}, [languageId]);
|
|
63
|
-
|
|
64
57
|
useEffect(() => {
|
|
65
58
|
// listen to value change
|
|
66
59
|
if (editorRef.current?.getValue() !== value) {
|
|
@@ -68,6 +61,14 @@ export function CodeEditor({
|
|
|
68
61
|
}
|
|
69
62
|
}, [value]);
|
|
70
63
|
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (languageId === 'typescript') {
|
|
66
|
+
import('./init-worker').then((module) => {
|
|
67
|
+
module.initTsWorker();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, [languageId]);
|
|
71
|
+
|
|
71
72
|
return (
|
|
72
73
|
<EditorProvider>
|
|
73
74
|
<OriginCodeEditor
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { typescript } from '@flowgram.ai/coze-editor/language-typescript';
|
|
7
|
+
|
|
8
|
+
let tsWorkerInit = false;
|
|
9
|
+
|
|
10
|
+
export const initTsWorker = () => {
|
|
11
|
+
if (tsWorkerInit) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
tsWorkerInit = true;
|
|
15
|
+
|
|
16
|
+
const tsWorker = new Worker(
|
|
17
|
+
new URL(`@flowgram.ai/coze-editor/language-typescript/worker`, import.meta.url),
|
|
18
|
+
{ type: 'module' }
|
|
19
|
+
);
|
|
20
|
+
typescript.languageService.initialize(tsWorker, {
|
|
21
|
+
compilerOptions: {
|
|
22
|
+
// eliminate Promise error
|
|
23
|
+
lib: ['es2015', 'dom'],
|
|
24
|
+
noImplicitAny: false,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { languages } from '@coze-editor/
|
|
7
|
-
import { typescript } from '@coze-editor/
|
|
8
|
-
import { shell } from '@coze-editor/
|
|
9
|
-
import { python } from '@coze-editor/
|
|
10
|
-
import { json } from '@coze-editor/
|
|
11
|
-
import { mixLanguages } from '@coze-editor
|
|
6
|
+
import { languages } from '@flowgram.ai/coze-editor/preset-code';
|
|
7
|
+
import { typescript } from '@flowgram.ai/coze-editor/language-typescript';
|
|
8
|
+
import { shell } from '@flowgram.ai/coze-editor/language-shell';
|
|
9
|
+
import { python } from '@flowgram.ai/coze-editor/language-python';
|
|
10
|
+
import { json } from '@flowgram.ai/coze-editor/language-json';
|
|
11
|
+
import { mixLanguages } from '@flowgram.ai/coze-editor';
|
|
12
12
|
|
|
13
13
|
languages.register('python', python);
|
|
14
14
|
languages.register('shell', shell);
|
|
@@ -21,24 +21,3 @@ languages.register('json', {
|
|
|
21
21
|
}),
|
|
22
22
|
languageService: json.languageService,
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
let tsWorkerInit = false;
|
|
26
|
-
|
|
27
|
-
export const initTsWorker = () => {
|
|
28
|
-
if (tsWorkerInit) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
tsWorkerInit = true;
|
|
32
|
-
|
|
33
|
-
const tsWorker = new Worker(
|
|
34
|
-
new URL(`@coze-editor/editor/language-typescript/worker`, import.meta.url),
|
|
35
|
-
{ type: 'module' }
|
|
36
|
-
);
|
|
37
|
-
typescript.languageService.initialize(tsWorker, {
|
|
38
|
-
compilerOptions: {
|
|
39
|
-
// eliminate Promise error
|
|
40
|
-
lib: ['es2015', 'dom'],
|
|
41
|
-
noImplicitAny: false,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createTheme, tags as t } from '@coze-editor/
|
|
6
|
+
import { createTheme, tags as t } from '@flowgram.ai/coze-editor/preset-code';
|
|
7
7
|
import { type Extension } from '@codemirror/state';
|
|
8
8
|
|
|
9
9
|
const colors = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createTheme, tags as t } from '@coze-editor/
|
|
6
|
+
import { createTheme, tags as t } from '@flowgram.ai/coze-editor/preset-code';
|
|
7
7
|
import { type Extension } from '@codemirror/state';
|
|
8
8
|
|
|
9
9
|
const colors = {
|
|
@@ -8,7 +8,7 @@ import { useMemo } from 'react';
|
|
|
8
8
|
import { JsonSchemaUtils, JsonSchemaBasicType } from '@flowgram.ai/json-schema';
|
|
9
9
|
import { useScopeAvailable } from '@flowgram.ai/editor';
|
|
10
10
|
|
|
11
|
-
import { IFlowRefValue } from '@/
|
|
11
|
+
import { IFlowRefValue } from '@/shared';
|
|
12
12
|
|
|
13
13
|
import { IRules } from '../types';
|
|
14
14
|
import { defaultRules } from '../constants';
|
|
@@ -12,7 +12,7 @@ import { useTypeManager } from '@/plugins';
|
|
|
12
12
|
|
|
13
13
|
import { PropsType, Strategy as ConstantInputStrategy } from './types';
|
|
14
14
|
|
|
15
|
-
export { ConstantInputStrategy };
|
|
15
|
+
export { type ConstantInputStrategy };
|
|
16
16
|
|
|
17
17
|
export function ConstantInput(props: PropsType) {
|
|
18
18
|
const { value, onChange, schema, strategies, fallbackRenderer, readonly, ...rest } = props;
|