@flowgram.ai/form-materials 0.1.0-alpha.15 → 0.1.0-alpha.17
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 +3 -2
- package/dist/cjs/components/blur-input/index.js +2 -12
- 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 +45 -57
- package/dist/cjs/components/code-editor/factory.js +96 -0
- package/dist/cjs/components/code-editor/index.js +31 -28
- package/dist/cjs/components/code-editor/theme/dark.js +120 -50
- package/dist/cjs/components/code-editor/theme/light.js +110 -61
- package/dist/cjs/components/code-editor/utils.js +1 -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-row/index.js +43 -26
- package/dist/cjs/components/condition-row/types.js +1 -35
- package/dist/cjs/components/{prompt-editor-with-inputs/inputs-picker.js → coze-editor-extensions/extensions/inputs-tree.js} +70 -2
- package/dist/cjs/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.js +4 -3
- package/dist/cjs/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.js +13 -7
- package/dist/cjs/components/coze-editor-extensions/index.js +86 -0
- package/dist/cjs/components/db-condition-row/index.js +59 -34
- package/dist/cjs/components/display-schema-tree/index.js +2 -2
- package/dist/cjs/components/index.js +49 -4
- package/dist/cjs/components/json-editor-with-variables/editor.js +10 -7
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +2 -2
- package/dist/cjs/components/prompt-editor-with-variables/editor.js +3 -4
- package/dist/cjs/components/{condition-row/hooks/useRule.js → sql-editor-with-variables/editor.js} +19 -34
- package/dist/cjs/components/sql-editor-with-variables/index.js +57 -0
- package/dist/cjs/components/type-selector/index.js +2 -2
- package/dist/cjs/components/variable-selector/use-variable-tree.js +1 -2
- package/dist/cjs/effects/provide-batch-input/index.js +1 -1
- package/dist/cjs/effects/provide-json-schema-outputs/index.js +1 -1
- package/dist/cjs/form-plugins/batch-outputs-plugin/index.js +9 -2
- package/dist/cjs/form-plugins/infer-assign-plugin/index.js +1 -1
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +30 -3
- package/dist/cjs/index.js +44 -2
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +1 -0
- package/dist/cjs/plugins/json-schema-preset/index.js +3 -13
- package/dist/cjs/{components/code-editor/init-worker.js → plugins/json-schema-preset/react.js} +18 -23
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +33 -4
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +23 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +31 -2
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +9 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +34 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/map.js +54 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +34 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +9 -4
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +30 -1
- package/dist/cjs/plugins/json-schema-preset/types.js +18 -0
- package/dist/cjs/shared/flow-value/utils.js +22 -8
- package/dist/cjs/shared/inject-material/index.js +2 -1
- package/dist/esm/components/blur-input/index.mjs +2 -2
- 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 +38 -33
- package/dist/esm/components/code-editor/factory.mjs +36 -0
- package/dist/esm/components/code-editor/index.mjs +8 -5
- package/dist/esm/components/code-editor/theme/dark.mjs +117 -50
- package/dist/esm/components/code-editor/theme/light.mjs +108 -62
- package/dist/esm/components/code-editor/utils.mjs +1 -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-row/index.mjs +45 -28
- package/dist/esm/components/condition-row/types.mjs +0 -18
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +135 -0
- package/dist/esm/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.mjs +4 -3
- package/dist/esm/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.mjs +13 -7
- package/dist/esm/components/coze-editor-extensions/index.mjs +18 -0
- package/dist/esm/components/db-condition-row/index.mjs +59 -34
- package/dist/esm/components/display-schema-tree/index.mjs +1 -1
- package/dist/esm/components/index.mjs +5 -2
- package/dist/esm/components/json-editor-with-variables/editor.mjs +10 -7
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +2 -2
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +3 -4
- 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 +1 -1
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +1 -2
- package/dist/esm/effects/provide-batch-input/index.mjs +2 -2
- package/dist/esm/effects/provide-json-schema-outputs/index.mjs +2 -2
- package/dist/esm/form-plugins/batch-outputs-plugin/index.mjs +10 -3
- package/dist/esm/form-plugins/infer-assign-plugin/index.mjs +2 -2
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +31 -4
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +2 -1
- package/dist/esm/plugins/json-schema-preset/index.mjs +3 -13
- package/dist/esm/plugins/json-schema-preset/react.mjs +14 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +33 -4
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +23 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +31 -2
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +7 -2
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +34 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/map.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +34 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +9 -4
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +30 -1
- package/dist/esm/plugins/json-schema-preset/types.mjs +0 -0
- package/dist/esm/shared/flow-value/utils.mjs +22 -8
- package/dist/esm/shared/inject-material/index.mjs +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/blur-input/index.d.ts +7 -1
- 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 +3 -4
- package/dist/types/components/code-editor/factory.d.ts +13 -0
- package/dist/types/components/code-editor/index.d.ts +7 -2
- package/dist/types/components/code-editor/theme/dark.d.ts +29 -0
- package/dist/types/components/code-editor/theme/light.d.ts +24 -0
- package/dist/types/components/code-editor/utils.d.ts +1 -1
- package/dist/types/components/code-editor-mini/index.d.ts +3 -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 +4 -7
- package/dist/types/components/condition-row/types.d.ts +0 -24
- package/dist/types/components/{prompt-editor-with-inputs/inputs-picker.d.ts → coze-editor-extensions/extensions/inputs-tree.d.ts} +5 -0
- package/dist/types/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.d.ts +3 -1
- package/dist/types/components/coze-editor-extensions/index.d.ts +18 -0
- package/dist/types/components/db-condition-row/index.d.ts +4 -3
- package/dist/types/components/db-condition-row/types.d.ts +0 -8
- package/dist/types/components/display-schema-tree/index.d.ts +1 -1
- package/dist/types/components/dynamic-value-input/index.d.ts +3 -1
- package/dist/types/components/index.d.ts +4 -1
- 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 +3 -1
- package/dist/types/components/variable-selector/index.d.ts +4 -2
- package/dist/types/form-plugins/batch-outputs-plugin/index.d.ts +4 -0
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/index.d.ts +3 -7
- package/dist/types/plugins/json-schema-preset/react.d.ts +11 -0
- package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +3 -1
- package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +1 -1
- 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 +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/{manager.d.ts → types.d.ts} +5 -0
- package/dist/types/shared/flow-value/utils.d.ts +3 -1
- package/dist/types/shared/inject-material/index.d.ts +6 -4
- package/dist/types/validate/validate-flow-value/index.d.ts +1 -1
- package/package.json +56 -17
- 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 +45 -36
- 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 +62 -77
- package/src/components/code-editor/theme/light.ts +60 -91
- 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 +0 -30
- 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 +6 -3
- package/src/components/{prompt-editor-with-variables → coze-editor-extensions}/extensions/variable-tree.tsx +12 -3
- 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 +0 -13
- package/src/components/display-schema-tree/index.tsx +6 -4
- package/src/components/index.ts +29 -1
- package/src/components/json-editor-with-variables/editor.tsx +7 -8
- 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/provide-batch-input/index.ts +1 -2
- package/src/effects/provide-json-schema-outputs/index.ts +1 -2
- package/src/form-plugins/batch-outputs-plugin/index.ts +64 -46
- package/src/form-plugins/infer-assign-plugin/index.ts +1 -2
- package/src/form-plugins/infer-inputs-plugin/index.ts +62 -14
- package/src/index.ts +19 -0
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/plugins/json-schema-preset/index.tsx +4 -20
- 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/utils.ts +22 -9
- package/src/shared/inject-material/index.tsx +10 -6
- package/src/validate/validate-flow-value/index.tsx +1 -2
- package/dist/cjs/components/code-editor/language-features.js +0 -21
- package/dist/cjs/components/condition-row/constants.js +0 -165
- package/dist/cjs/components/condition-row/hooks/useOp.js +0 -78
- package/dist/cjs/components/db-condition-row/hooks/use-left.js +0 -86
- package/dist/cjs/components/db-condition-row/hooks/use-op.js +0 -79
- package/dist/cjs/components/json-editor-with-variables/extensions/variable-tag.js +0 -151
- package/dist/cjs/components/json-editor-with-variables/extensions/variable-tree.js +0 -97
- package/dist/cjs/components/prompt-editor-with-inputs/extensions/inputs-tree.js +0 -101
- package/dist/cjs/components/prompt-editor-with-variables/styles.js +0 -89
- package/dist/esm/components/code-editor/init-worker.mjs +0 -19
- package/dist/esm/components/code-editor/language-features.mjs +0 -15
- package/dist/esm/components/condition-row/constants.mjs +0 -128
- package/dist/esm/components/condition-row/hooks/useOp.mjs +0 -44
- package/dist/esm/components/condition-row/hooks/useRule.mjs +0 -34
- package/dist/esm/components/db-condition-row/hooks/use-left.mjs +0 -52
- package/dist/esm/components/db-condition-row/hooks/use-op.mjs +0 -45
- package/dist/esm/components/json-editor-with-variables/extensions/variable-tree.mjs +0 -63
- package/dist/esm/components/prompt-editor-with-inputs/extensions/inputs-tree.mjs +0 -67
- package/dist/esm/components/prompt-editor-with-inputs/inputs-picker.mjs +0 -70
- package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tag.mjs +0 -117
- package/dist/esm/components/prompt-editor-with-variables/styles.mjs +0 -36
- package/dist/types/components/code-editor/init-worker.d.ts +0 -5
- package/dist/types/components/code-editor/language-features.d.ts +0 -5
- package/dist/types/components/condition-row/constants.d.ts +0 -7
- package/dist/types/components/condition-row/hooks/useOp.d.ts +0 -18
- package/dist/types/components/condition-row/hooks/useRule.d.ts +0 -9
- package/dist/types/components/db-condition-row/hooks/use-left.d.ts +0 -18
- package/dist/types/components/db-condition-row/hooks/use-op.d.ts +0 -18
- package/dist/types/components/prompt-editor-with-inputs/extensions/inputs-tree.d.ts +0 -9
- package/dist/types/components/prompt-editor-with-variables/extensions/variable-tag.d.ts +0 -5
- package/dist/types/components/prompt-editor-with-variables/extensions/variable-tree.d.ts +0 -6
- package/dist/types/components/prompt-editor-with-variables/styles.d.ts +0 -9
- package/src/components/code-editor/init-worker.ts +0 -27
- package/src/components/code-editor/language-features.ts +0 -23
- 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/prompt-editor-with-variables/styles.tsx +0 -44
- /package/dist/cjs/{plugins/json-schema-preset/manager.js → components/condition-context/types.js} +0 -0
- /package/dist/cjs/components/{json-editor-with-variables → coze-editor-extensions}/styles.js +0 -0
- /package/dist/esm/{plugins/json-schema-preset/manager.mjs → components/condition-context/types.mjs} +0 -0
- /package/dist/esm/components/{json-editor-with-variables → coze-editor-extensions}/styles.mjs +0 -0
- /package/dist/types/components/{json-editor-with-variables → coze-editor-extensions}/extensions/variable-tag.d.ts +0 -0
- /package/dist/types/components/{json-editor-with-variables → coze-editor-extensions}/styles.d.ts +0 -0
- /package/src/components/{json-editor-with-variables → coze-editor-extensions}/styles.tsx +0 -0
|
@@ -1,18 +1,47 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
+
import { format } from "date-fns";
|
|
3
4
|
import { DatePicker } from "@douyinfe/semi-ui";
|
|
5
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
4
6
|
const dateTimeRegistry = {
|
|
5
7
|
type: 'date-time',
|
|
6
8
|
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(DatePicker, {
|
|
7
9
|
size: "small",
|
|
8
10
|
type: "dateTime",
|
|
9
11
|
density: "compact",
|
|
12
|
+
defaultValue: Date.now(),
|
|
10
13
|
style: {
|
|
11
14
|
width: '100%',
|
|
12
15
|
...props.style || {}
|
|
13
16
|
},
|
|
14
17
|
disabled: props.readonly,
|
|
15
|
-
...props
|
|
16
|
-
|
|
18
|
+
...props,
|
|
19
|
+
onChange: (date)=>{
|
|
20
|
+
props.onChange?.(format(date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
|
|
21
|
+
},
|
|
22
|
+
value: props.value
|
|
23
|
+
}),
|
|
24
|
+
conditionRule: {
|
|
25
|
+
[ConditionPresetOp.EQ]: {
|
|
26
|
+
type: 'date-time'
|
|
27
|
+
},
|
|
28
|
+
[ConditionPresetOp.NEQ]: {
|
|
29
|
+
type: 'date-time'
|
|
30
|
+
},
|
|
31
|
+
[ConditionPresetOp.GT]: {
|
|
32
|
+
type: 'date-time'
|
|
33
|
+
},
|
|
34
|
+
[ConditionPresetOp.GTE]: {
|
|
35
|
+
type: 'date-time'
|
|
36
|
+
},
|
|
37
|
+
[ConditionPresetOp.LT]: {
|
|
38
|
+
type: 'date-time'
|
|
39
|
+
},
|
|
40
|
+
[ConditionPresetOp.LTE]: {
|
|
41
|
+
type: 'date-time'
|
|
42
|
+
},
|
|
43
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
44
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
45
|
+
}
|
|
17
46
|
};
|
|
18
47
|
export { dateTimeRegistry };
|
|
@@ -2,6 +2,7 @@ import { jsonSchemaTypeManager } from "@flowgram.ai/json-schema";
|
|
|
2
2
|
import { stringRegistry } from "./string.mjs";
|
|
3
3
|
import { objectRegistry } from "./object.mjs";
|
|
4
4
|
import { numberRegistry } from "./number.mjs";
|
|
5
|
+
import { mapRegistry } from "./map.mjs";
|
|
5
6
|
import { integerRegistry } from "./integer.mjs";
|
|
6
7
|
import { dateTimeRegistry } from "./date-time.mjs";
|
|
7
8
|
import { booleanRegistry } from "./boolean.mjs";
|
|
@@ -13,7 +14,11 @@ const jsonSchemaTypePreset = [
|
|
|
13
14
|
integerRegistry,
|
|
14
15
|
booleanRegistry,
|
|
15
16
|
arrayRegistry,
|
|
17
|
+
mapRegistry,
|
|
16
18
|
dateTimeRegistry
|
|
17
19
|
];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const initRegistries = ()=>{
|
|
21
|
+
if (jsonSchemaTypeManager.getTypeByName('string')?.ConstantRenderer) return;
|
|
22
|
+
jsonSchemaTypePreset.forEach((_type)=>jsonSchemaTypeManager.register(_type));
|
|
23
|
+
};
|
|
24
|
+
export { initRegistries, jsonSchemaTypePreset };
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
4
|
import { InputNumber } from "@douyinfe/semi-ui";
|
|
5
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
5
6
|
const integerRegistry = {
|
|
6
7
|
type: 'integer',
|
|
7
8
|
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(InputNumber, {
|
|
@@ -10,6 +11,38 @@ const integerRegistry = {
|
|
|
10
11
|
disabled: props.readonly,
|
|
11
12
|
precision: 0,
|
|
12
13
|
...props
|
|
13
|
-
})
|
|
14
|
+
}),
|
|
15
|
+
conditionRule: {
|
|
16
|
+
[ConditionPresetOp.EQ]: {
|
|
17
|
+
type: 'number'
|
|
18
|
+
},
|
|
19
|
+
[ConditionPresetOp.NEQ]: {
|
|
20
|
+
type: 'number'
|
|
21
|
+
},
|
|
22
|
+
[ConditionPresetOp.GT]: {
|
|
23
|
+
type: 'number'
|
|
24
|
+
},
|
|
25
|
+
[ConditionPresetOp.GTE]: {
|
|
26
|
+
type: 'number'
|
|
27
|
+
},
|
|
28
|
+
[ConditionPresetOp.LT]: {
|
|
29
|
+
type: 'number'
|
|
30
|
+
},
|
|
31
|
+
[ConditionPresetOp.LTE]: {
|
|
32
|
+
type: 'number'
|
|
33
|
+
},
|
|
34
|
+
[ConditionPresetOp.IN]: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
extra: {
|
|
37
|
+
weak: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[ConditionPresetOp.NIN]: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
extra: {
|
|
43
|
+
weak: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
14
47
|
};
|
|
15
48
|
export { integerRegistry };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
5
|
+
import { JsonCodeEditor } from "../../../components/code-editor/index.mjs";
|
|
6
|
+
const mapRegistry = {
|
|
7
|
+
type: 'map',
|
|
8
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(JsonCodeEditor, {
|
|
9
|
+
mini: true,
|
|
10
|
+
value: props.value,
|
|
11
|
+
onChange: (v)=>props.onChange?.(v),
|
|
12
|
+
placeholder: I18n.t('Please Input Map'),
|
|
13
|
+
readonly: props.readonly
|
|
14
|
+
}),
|
|
15
|
+
conditionRule: {
|
|
16
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
17
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export { mapRegistry };
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
4
|
import { InputNumber } from "@douyinfe/semi-ui";
|
|
5
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
5
6
|
const numberRegistry = {
|
|
6
7
|
type: 'number',
|
|
7
8
|
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(InputNumber, {
|
|
@@ -10,6 +11,38 @@ const numberRegistry = {
|
|
|
10
11
|
disabled: props.readonly,
|
|
11
12
|
hideButtons: true,
|
|
12
13
|
...props
|
|
13
|
-
})
|
|
14
|
+
}),
|
|
15
|
+
conditionRule: {
|
|
16
|
+
[ConditionPresetOp.EQ]: {
|
|
17
|
+
type: 'number'
|
|
18
|
+
},
|
|
19
|
+
[ConditionPresetOp.NEQ]: {
|
|
20
|
+
type: 'number'
|
|
21
|
+
},
|
|
22
|
+
[ConditionPresetOp.GT]: {
|
|
23
|
+
type: 'number'
|
|
24
|
+
},
|
|
25
|
+
[ConditionPresetOp.GTE]: {
|
|
26
|
+
type: 'number'
|
|
27
|
+
},
|
|
28
|
+
[ConditionPresetOp.LT]: {
|
|
29
|
+
type: 'number'
|
|
30
|
+
},
|
|
31
|
+
[ConditionPresetOp.LTE]: {
|
|
32
|
+
type: 'number'
|
|
33
|
+
},
|
|
34
|
+
[ConditionPresetOp.IN]: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
extra: {
|
|
37
|
+
weak: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[ConditionPresetOp.NIN]: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
extra: {
|
|
43
|
+
weak: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
14
47
|
};
|
|
15
48
|
export { numberRegistry };
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
|
-
import {
|
|
4
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
5
|
+
import { JsonCodeEditor } from "../../../components/code-editor/index.mjs";
|
|
5
6
|
const objectRegistry = {
|
|
6
7
|
type: 'object',
|
|
7
|
-
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(
|
|
8
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ jsx(JsonCodeEditor, {
|
|
9
|
+
mini: true,
|
|
8
10
|
value: props.value,
|
|
9
11
|
onChange: (v)=>props.onChange?.(v),
|
|
10
|
-
languageId: "json",
|
|
11
12
|
placeholder: I18n.t('Please Input Object'),
|
|
12
13
|
readonly: props.readonly
|
|
13
|
-
})
|
|
14
|
+
}),
|
|
15
|
+
conditionRule: {
|
|
16
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
17
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
18
|
+
}
|
|
14
19
|
};
|
|
15
20
|
export { objectRegistry };
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { I18n } from "@flowgram.ai/editor";
|
|
4
4
|
import { Input, TextArea } from "@douyinfe/semi-ui";
|
|
5
|
+
import { ConditionPresetOp } from "../../../components/condition-context/op.mjs";
|
|
5
6
|
const stringRegistry = {
|
|
6
7
|
type: 'string',
|
|
7
8
|
ConstantRenderer: (props)=>props?.enableMultiLineStr ? /*#__PURE__*/ jsx(TextArea, {
|
|
@@ -15,6 +16,34 @@ const stringRegistry = {
|
|
|
15
16
|
placeholder: I18n.t('Please Input String'),
|
|
16
17
|
disabled: props.readonly,
|
|
17
18
|
...props
|
|
18
|
-
})
|
|
19
|
+
}),
|
|
20
|
+
conditionRule: {
|
|
21
|
+
[ConditionPresetOp.EQ]: {
|
|
22
|
+
type: 'string'
|
|
23
|
+
},
|
|
24
|
+
[ConditionPresetOp.NEQ]: {
|
|
25
|
+
type: 'string'
|
|
26
|
+
},
|
|
27
|
+
[ConditionPresetOp.CONTAINS]: {
|
|
28
|
+
type: 'string'
|
|
29
|
+
},
|
|
30
|
+
[ConditionPresetOp.NOT_CONTAINS]: {
|
|
31
|
+
type: 'string'
|
|
32
|
+
},
|
|
33
|
+
[ConditionPresetOp.IN]: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: {
|
|
36
|
+
type: 'string'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[ConditionPresetOp.NIN]: {
|
|
40
|
+
type: 'array',
|
|
41
|
+
items: {
|
|
42
|
+
type: 'string'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
46
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
47
|
+
}
|
|
19
48
|
};
|
|
20
49
|
export { stringRegistry };
|
|
File without changes
|
|
@@ -29,34 +29,48 @@ import { constantSchema, expressionSchema, refSchema, templateSchema } from "./s
|
|
|
29
29
|
function* traverse(value, options) {
|
|
30
30
|
const { includeTypes = [
|
|
31
31
|
'ref',
|
|
32
|
-
'template'
|
|
33
|
-
|
|
32
|
+
'template',
|
|
33
|
+
'expression',
|
|
34
|
+
'constant'
|
|
35
|
+
], path = '', pathArr = [] } = options || {};
|
|
34
36
|
if (isPlainObject(value)) {
|
|
35
37
|
if (isRef(value) && includeTypes.includes('ref')) return void (yield {
|
|
36
38
|
value,
|
|
37
|
-
path
|
|
39
|
+
path,
|
|
40
|
+
pathArr
|
|
38
41
|
});
|
|
39
42
|
if (isTemplate(value) && includeTypes.includes('template')) return void (yield {
|
|
40
43
|
value,
|
|
41
|
-
path
|
|
44
|
+
path,
|
|
45
|
+
pathArr
|
|
42
46
|
});
|
|
43
47
|
if (isExpression(value) && includeTypes.includes('expression')) return void (yield {
|
|
44
48
|
value,
|
|
45
|
-
path
|
|
49
|
+
path,
|
|
50
|
+
pathArr
|
|
46
51
|
});
|
|
47
52
|
if (isConstant(value) && includeTypes.includes('constant')) return void (yield {
|
|
48
53
|
value,
|
|
49
|
-
path
|
|
54
|
+
path,
|
|
55
|
+
pathArr
|
|
50
56
|
});
|
|
51
57
|
for (const [_key, _value] of Object.entries(value))yield* traverse(_value, {
|
|
52
58
|
...options,
|
|
53
|
-
path: `${path}.${_key}`
|
|
59
|
+
path: path ? `${path}.${_key}` : _key,
|
|
60
|
+
pathArr: [
|
|
61
|
+
...pathArr,
|
|
62
|
+
_key
|
|
63
|
+
]
|
|
54
64
|
});
|
|
55
65
|
return;
|
|
56
66
|
}
|
|
57
67
|
if (isArray(value)) for (const [_idx, _value] of value.entries())yield* traverse(_value, {
|
|
58
68
|
...options,
|
|
59
|
-
path: `${path}[${_idx}]`
|
|
69
|
+
path: path ? `${path}[${_idx}]` : `[${_idx}]`,
|
|
70
|
+
pathArr: [
|
|
71
|
+
...pathArr,
|
|
72
|
+
`[${_idx}]`
|
|
73
|
+
]
|
|
60
74
|
});
|
|
61
75
|
}
|
|
62
76
|
FlowValueUtils.traverse = traverse;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { FlowRendererComponentType, FlowRendererRegistry, usePlaygroundContainer } from "@flowgram.ai/editor";
|
|
3
3
|
function createInjectMaterial(Component, params) {
|
|
4
|
+
const renderKey = params?.renderKey || Component.renderKey || Component.name || '';
|
|
4
5
|
const InjectComponent = (props)=>{
|
|
5
6
|
const container = usePlaygroundContainer();
|
|
6
7
|
if (!container?.isBound(FlowRendererRegistry)) return /*#__PURE__*/ react.createElement(Component, {
|
|
7
8
|
...props
|
|
8
9
|
});
|
|
9
10
|
const rendererRegistry = container.get(FlowRendererRegistry);
|
|
10
|
-
const renderKey = params?.renderKey || Component.renderKey || Component.name || '';
|
|
11
11
|
const renderer = rendererRegistry.tryToGetRendererComponent(renderKey);
|
|
12
12
|
if (renderer?.type !== FlowRendererComponentType.REACT) return /*#__PURE__*/ react.createElement(Component, {
|
|
13
13
|
...props
|
|
@@ -16,6 +16,7 @@ function createInjectMaterial(Component, params) {
|
|
|
16
16
|
...props
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
+
InjectComponent.renderKey = renderKey;
|
|
19
20
|
return InjectComponent;
|
|
20
21
|
}
|
|
21
22
|
export { createInjectMaterial };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/components/index.ts","../src/components/assign-row/index.tsx","../src/components/assign-row/types.ts","../src/components/assign-rows/index.tsx","../src/components/batch-outputs/index.tsx","../src/components/batch-outputs/styles.tsx","../src/components/batch-outputs/types.ts","../src/components/batch-variable-selector/index.tsx","../src/components/blur-input/index.tsx","../src/components/code-editor/editor.tsx","../src/components/code-editor/
|
|
1
|
+
{"root":["../src/index.ts","../src/components/index.ts","../src/components/assign-row/index.tsx","../src/components/assign-row/types.ts","../src/components/assign-rows/index.tsx","../src/components/batch-outputs/index.tsx","../src/components/batch-outputs/styles.tsx","../src/components/batch-outputs/types.ts","../src/components/batch-variable-selector/index.tsx","../src/components/blur-input/index.tsx","../src/components/code-editor/editor-all.tsx","../src/components/code-editor/editor-json.tsx","../src/components/code-editor/editor-python.tsx","../src/components/code-editor/editor-shell.tsx","../src/components/code-editor/editor-sql.tsx","../src/components/code-editor/editor-ts.tsx","../src/components/code-editor/editor.tsx","../src/components/code-editor/factory.tsx","../src/components/code-editor/index.tsx","../src/components/code-editor/utils.ts","../src/components/code-editor/theme/dark.ts","../src/components/code-editor/theme/index.ts","../src/components/code-editor/theme/light.ts","../src/components/code-editor-mini/index.tsx","../src/components/condition-context/context.tsx","../src/components/condition-context/index.tsx","../src/components/condition-context/op.ts","../src/components/condition-context/types.ts","../src/components/condition-context/hooks/use-condition.tsx","../src/components/condition-row/index.tsx","../src/components/condition-row/styles.tsx","../src/components/condition-row/types.ts","../src/components/constant-input/index.tsx","../src/components/constant-input/types.ts","../src/components/coze-editor-extensions/index.tsx","../src/components/coze-editor-extensions/styles.tsx","../src/components/coze-editor-extensions/extensions/inputs-tree.tsx","../src/components/coze-editor-extensions/extensions/variable-tag.tsx","../src/components/coze-editor-extensions/extensions/variable-tree.tsx","../src/components/db-condition-row/index.tsx","../src/components/db-condition-row/styles.tsx","../src/components/db-condition-row/types.ts","../src/components/display-flow-value/index.tsx","../src/components/display-inputs-values/index.tsx","../src/components/display-inputs-values/styles.ts","../src/components/display-outputs/index.tsx","../src/components/display-outputs/styles.ts","../src/components/display-schema-tag/index.tsx","../src/components/display-schema-tag/styles.ts","../src/components/display-schema-tree/index.tsx","../src/components/display-schema-tree/styles.tsx","../src/components/dynamic-value-input/hooks.ts","../src/components/dynamic-value-input/index.tsx","../src/components/dynamic-value-input/styles.tsx","../src/components/inputs-values/index.tsx","../src/components/inputs-values/styles.tsx","../src/components/inputs-values/types.ts","../src/components/inputs-values-tree/index.tsx","../src/components/inputs-values-tree/row.tsx","../src/components/inputs-values-tree/styles.tsx","../src/components/inputs-values-tree/types.ts","../src/components/inputs-values-tree/hooks/use-child-list.tsx","../src/components/json-editor-with-variables/editor.tsx","../src/components/json-editor-with-variables/index.tsx","../src/components/json-schema-editor/default-value.tsx","../src/components/json-schema-editor/hooks.tsx","../src/components/json-schema-editor/index.tsx","../src/components/json-schema-editor/styles.tsx","../src/components/json-schema-editor/types.ts","../src/components/prompt-editor/editor.tsx","../src/components/prompt-editor/index.tsx","../src/components/prompt-editor/styles.tsx","../src/components/prompt-editor/types.tsx","../src/components/prompt-editor/extensions/jinja.tsx","../src/components/prompt-editor/extensions/language-support.tsx","../src/components/prompt-editor/extensions/markdown.tsx","../src/components/prompt-editor-with-inputs/editor.tsx","../src/components/prompt-editor-with-inputs/index.tsx","../src/components/prompt-editor-with-variables/editor.tsx","../src/components/prompt-editor-with-variables/index.tsx","../src/components/sql-editor-with-variables/editor.tsx","../src/components/sql-editor-with-variables/index.tsx","../src/components/type-selector/index.tsx","../src/components/variable-selector/context.tsx","../src/components/variable-selector/index.tsx","../src/components/variable-selector/styles.tsx","../src/components/variable-selector/use-variable-tree.tsx","../src/effects/index.ts","../src/effects/auto-rename-ref/index.ts","../src/effects/listen-ref-schema-change/index.ts","../src/effects/listen-ref-value-change/index.ts","../src/effects/provide-batch-input/index.ts","../src/effects/provide-json-schema-outputs/index.ts","../src/effects/sync-variable-title/index.ts","../src/effects/validate-when-variable-sync/index.ts","../src/form-plugins/index.ts","../src/form-plugins/batch-outputs-plugin/index.ts","../src/form-plugins/infer-assign-plugin/index.ts","../src/form-plugins/infer-inputs-plugin/index.ts","../src/hooks/index.ts","../src/hooks/use-object-list/index.tsx","../src/plugins/index.ts","../src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts","../src/plugins/disable-declaration-plugin/index.tsx","../src/plugins/json-schema-preset/create-type-preset-plugin.tsx","../src/plugins/json-schema-preset/index.tsx","../src/plugins/json-schema-preset/react.tsx","../src/plugins/json-schema-preset/types.ts","../src/plugins/json-schema-preset/type-definition/array.tsx","../src/plugins/json-schema-preset/type-definition/boolean.tsx","../src/plugins/json-schema-preset/type-definition/date-time.tsx","../src/plugins/json-schema-preset/type-definition/index.tsx","../src/plugins/json-schema-preset/type-definition/integer.tsx","../src/plugins/json-schema-preset/type-definition/map.tsx","../src/plugins/json-schema-preset/type-definition/number.tsx","../src/plugins/json-schema-preset/type-definition/object.tsx","../src/plugins/json-schema-preset/type-definition/string.tsx","../src/shared/index.ts","../src/shared/flow-value/index.ts","../src/shared/flow-value/schema.ts","../src/shared/flow-value/types.ts","../src/shared/flow-value/utils.ts","../src/shared/format-legacy-refs/index.ts","../src/shared/inject-material/index.tsx","../src/shared/lazy-suspense/index.tsx","../src/shared/polyfill-create-root/index.tsx","../src/validate/index.ts","../src/validate/validate-flow-value/index.tsx"],"version":"5.9.2"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
7
|
* SPDX-License-Identifier: MIT
|
|
4
8
|
*/
|
|
5
9
|
import React from 'react';
|
|
6
|
-
import {
|
|
10
|
+
import { Input } from '@douyinfe/semi-ui';
|
|
11
|
+
type InputProps = React.ComponentPropsWithoutRef<typeof Input>;
|
|
7
12
|
export declare function BlurInput(props: InputProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated CodeEditor will bundle all languages features, use XXXCodeEditor instead for better bundle experience
|
|
7
|
+
*/
|
|
8
|
+
export declare const CodeEditor: import("react").FC<import("./editor").CodeEditorPropsType>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare const loadJsonLanguage: () => Promise<void>;
|
|
6
|
+
export declare const JsonCodeEditor: import("react").FC<Omit<import("./editor").CodeEditorPropsType, "languageId">>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare const loadPythonLanguage: () => Promise<() => void>;
|
|
6
|
+
export declare const PythonCodeEditor: import("react").FC<Omit<import("./editor").CodeEditorPropsType, "languageId">>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare const loadShellLanguage: () => Promise<() => void>;
|
|
6
|
+
export declare const ShellCodeEditor: import("react").FC<Omit<import("./editor").CodeEditorPropsType, "languageId">>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare const loadSqlLanguage: () => Promise<void>;
|
|
6
|
+
export declare const SQLCodeEditor: import("react").FC<Omit<import("./editor").CodeEditorPropsType, "languageId">>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export declare const loadTypescriptLanguage: () => Promise<void>;
|
|
6
|
+
export declare const TypeScriptCodeEditor: import("react").FC<Omit<import("./editor").CodeEditorPropsType, "languageId">>;
|
|
@@ -5,19 +5,18 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { InferValues } from '@flowgram.ai/coze-editor/react';
|
|
7
7
|
import preset from '@flowgram.ai/coze-editor/preset-code';
|
|
8
|
-
import './theme';
|
|
9
|
-
import './language-features';
|
|
10
8
|
type Preset = typeof preset;
|
|
11
9
|
type Options = Partial<InferValues<Preset[number]>>;
|
|
12
10
|
export interface CodeEditorPropsType extends React.PropsWithChildren<{}> {
|
|
13
11
|
value?: string;
|
|
14
12
|
onChange?: (value: string) => void;
|
|
15
|
-
languageId: 'python' | 'typescript' | 'shell' | 'json';
|
|
13
|
+
languageId: 'python' | 'typescript' | 'shell' | 'json' | 'sql';
|
|
16
14
|
theme?: 'dark' | 'light';
|
|
17
15
|
placeholder?: string;
|
|
18
16
|
activeLinePlaceholder?: string;
|
|
19
17
|
readonly?: boolean;
|
|
20
18
|
options?: Options;
|
|
19
|
+
mini?: boolean;
|
|
21
20
|
}
|
|
22
|
-
export declare function
|
|
21
|
+
export declare function BaseCodeEditor({ value, onChange, languageId, theme, children, placeholder, activeLinePlaceholder, options, readonly, mini, }: CodeEditorPropsType): React.JSX.Element;
|
|
23
22
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { CodeEditorPropsType } from './editor';
|
|
7
|
+
export declare const BaseCodeEditor: React.LazyExoticComponent<typeof import("./editor").BaseCodeEditor>;
|
|
8
|
+
interface FactoryParams<FixLanguageId extends boolean> {
|
|
9
|
+
displayName: string;
|
|
10
|
+
fixLanguageId: FixLanguageId extends true ? CodeEditorPropsType['languageId'] : undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare const CodeEditorFactory: <FixLanguageId extends boolean>(loadLanguage: (languageId: string) => Promise<any>, { displayName, fixLanguageId }: FactoryParams<FixLanguageId>) => FixLanguageId extends true ? React.FC<Omit<CodeEditorPropsType, "languageId">> : React.FC<CodeEditorPropsType>;
|
|
13
|
+
export {};
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export { CodeEditor } from './editor-all';
|
|
6
|
+
export { TypeScriptCodeEditor } from './editor-ts';
|
|
7
|
+
export { ShellCodeEditor } from './editor-shell';
|
|
8
|
+
export { JsonCodeEditor } from './editor-json';
|
|
9
|
+
export { SQLCodeEditor } from './editor-sql';
|
|
10
|
+
export { PythonCodeEditor } from './editor-python';
|
|
11
|
+
export { BaseCodeEditor, type CodeEditorPropsType } from './editor';
|
|
@@ -3,4 +3,33 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
|
+
export declare const colors: {
|
|
7
|
+
background: string;
|
|
8
|
+
foreground: string;
|
|
9
|
+
selection: string;
|
|
10
|
+
cursor: string;
|
|
11
|
+
dropdownBackground: string;
|
|
12
|
+
dropdownBorder: string;
|
|
13
|
+
activeLine: string;
|
|
14
|
+
matchingBracket: string;
|
|
15
|
+
keyword: string;
|
|
16
|
+
storage: string;
|
|
17
|
+
variable: string;
|
|
18
|
+
variableName: string;
|
|
19
|
+
parameter: string;
|
|
20
|
+
function: string;
|
|
21
|
+
string: string;
|
|
22
|
+
constant: string;
|
|
23
|
+
type: string;
|
|
24
|
+
class: string;
|
|
25
|
+
number: string;
|
|
26
|
+
comment: string;
|
|
27
|
+
heading: string;
|
|
28
|
+
invalid: string;
|
|
29
|
+
regexp: string;
|
|
30
|
+
propertyName: string;
|
|
31
|
+
separator: string;
|
|
32
|
+
gutters: string;
|
|
33
|
+
moduleKeyword: string;
|
|
34
|
+
};
|
|
6
35
|
export declare const darkTheme: Extension;
|
|
@@ -3,4 +3,28 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
|
+
export declare const colors: {
|
|
7
|
+
background: string;
|
|
8
|
+
foreground: string;
|
|
9
|
+
selection: string;
|
|
10
|
+
cursor: string;
|
|
11
|
+
dropdownBackground: string;
|
|
12
|
+
dropdownBorder: string;
|
|
13
|
+
activeLine: string;
|
|
14
|
+
matchingBracket: string;
|
|
15
|
+
keyword: string;
|
|
16
|
+
storage: string;
|
|
17
|
+
variable: string;
|
|
18
|
+
parameter: string;
|
|
19
|
+
function: string;
|
|
20
|
+
string: string;
|
|
21
|
+
constant: string;
|
|
22
|
+
type: string;
|
|
23
|
+
class: string;
|
|
24
|
+
number: string;
|
|
25
|
+
comment: string;
|
|
26
|
+
heading: string;
|
|
27
|
+
invalid: string;
|
|
28
|
+
regexp: string;
|
|
29
|
+
};
|
|
6
30
|
export declare const lightTheme: Extension;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
|
-
export declare function getSuffixByLanguageId(languageId: string): "" | ".py" | ".ts" | ".sh" | ".json";
|
|
5
|
+
export declare function getSuffixByLanguageId(languageId: string): "" | ".py" | ".ts" | ".sh" | ".json" | ".sql";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { IConditionRule, ConditionOpConfigs } from './types';
|
|
7
|
+
interface ContextType {
|
|
8
|
+
rules?: Record<string, IConditionRule>;
|
|
9
|
+
ops?: ConditionOpConfigs;
|
|
10
|
+
}
|
|
11
|
+
export declare const ConditionContext: React.Context<ContextType>;
|
|
12
|
+
export declare const ConditionProvider: (props: React.PropsWithChildren<ContextType>) => React.JSX.Element;
|
|
13
|
+
export declare const useConditionContext: () => ContextType;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { IConditionRule, ConditionOpConfigs } from '../types';
|
|
7
|
+
interface HooksParams {
|
|
8
|
+
leftSchema?: IJsonSchema;
|
|
9
|
+
operator?: string;
|
|
10
|
+
/**
|
|
11
|
+
* custom rule config
|
|
12
|
+
*/
|
|
13
|
+
ruleConfig?: {
|
|
14
|
+
ops?: ConditionOpConfigs;
|
|
15
|
+
rules?: Record<string, IConditionRule>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function useCondition({ leftSchema, operator, ruleConfig }: HooksParams): {
|
|
19
|
+
rule: IConditionRule | undefined;
|
|
20
|
+
opConfig: import("..").ConditionOpConfig;
|
|
21
|
+
opOptionList: {
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
abbreviation: string;
|
|
25
|
+
rightDisplay?: string;
|
|
26
|
+
}[];
|
|
27
|
+
targetSchema: IJsonSchema<string> | undefined;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export { type IConditionRule, type IConditionRuleFactory, type ConditionOpConfigs, type ConditionOpConfig, } from './types';
|
|
6
|
+
export { ConditionPresetOp } from './op';
|
|
7
|
+
export { ConditionProvider, useConditionContext } from './context';
|
|
8
|
+
export { useCondition } from './hooks/use-condition';
|