@flowgram.ai/form-materials 0.4.13 → 0.4.14
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/dist/cjs/components/code-editor/editor.js +54 -77
- package/dist/cjs/components/code-editor/index.js +10 -2
- package/dist/cjs/components/code-editor/language-features.js +119 -16
- 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/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/coze-editor-extensions/extensions/variable-tag.js +4 -3
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +3 -0
- package/dist/cjs/components/db-condition-row/index.js +59 -34
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +30 -3
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +1 -0
- package/dist/cjs/plugins/json-schema-preset/react.js +1 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +30 -1
- 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/{components/code-editor/init-worker.js → plugins/json-schema-preset/type-definition/map.js} +21 -23
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +34 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +6 -1
- 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/esm/components/code-editor/editor.mjs +4 -9
- package/dist/esm/components/code-editor/index.mjs +5 -2
- package/dist/esm/components/code-editor/language-features.mjs +49 -13
- 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/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/variable-tag.mjs +4 -3
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +3 -0
- package/dist/esm/components/db-condition-row/index.mjs +59 -34
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +31 -4
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +2 -1
- package/dist/esm/plugins/json-schema-preset/react.mjs +2 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +30 -1
- 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 +6 -1
- 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/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/code-editor/editor.d.ts +0 -2
- package/dist/types/components/code-editor/language-features.d.ts +4 -1
- 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/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/db-condition-row/index.d.ts +4 -3
- package/dist/types/components/db-condition-row/types.d.ts +0 -8
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +4 -0
- 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 +1 -1
- package/dist/types/plugins/json-schema-preset/react.d.ts +1 -1
- 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/package.json +7 -6
- package/src/components/code-editor/editor.tsx +7 -10
- package/src/components/code-editor/index.tsx +3 -1
- package/src/components/code-editor/language-features.ts +52 -14
- package/src/components/code-editor/theme/dark.ts +62 -77
- package/src/components/code-editor/theme/light.ts +60 -91
- 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/coze-editor-extensions/extensions/variable-tag.tsx +6 -3
- package/src/components/coze-editor-extensions/extensions/variable-tree.tsx +3 -0
- package/src/components/db-condition-row/index.tsx +76 -24
- package/src/components/db-condition-row/types.ts +0 -13
- package/src/form-plugins/infer-inputs-plugin/index.ts +62 -14
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/plugins/json-schema-preset/index.tsx +1 -1
- package/src/plugins/json-schema-preset/react.tsx +5 -2
- package/src/plugins/json-schema-preset/type-definition/array.tsx +10 -1
- 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 +6 -1
- 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/dist/cjs/components/condition-row/constants.js +0 -165
- package/dist/cjs/components/condition-row/hooks/useOp.js +0 -78
- package/dist/cjs/components/condition-row/hooks/useRule.js +0 -68
- 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/esm/components/code-editor/init-worker.mjs +0 -19
- 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/types/components/code-editor/init-worker.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/src/components/code-editor/init-worker.ts +0 -27
- 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/dist/cjs/{plugins/json-schema-preset/manager.js → components/condition-context/types.js} +0 -0
- /package/dist/esm/{plugins/json-schema-preset/manager.mjs → components/condition-context/types.mjs} +0 -0
|
@@ -9,7 +9,9 @@ import React from 'react';
|
|
|
9
9
|
import { I18n } from '@flowgram.ai/editor';
|
|
10
10
|
import { InputNumber } from '@douyinfe/semi-ui';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { ConditionPresetOp } from '@/components/condition-context/op';
|
|
13
|
+
|
|
14
|
+
import { type JsonSchemaTypeRegistry } from '../types';
|
|
13
15
|
|
|
14
16
|
export const numberRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
15
17
|
type: 'number',
|
|
@@ -22,4 +24,20 @@ export const numberRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
|
22
24
|
{...props}
|
|
23
25
|
/>
|
|
24
26
|
),
|
|
27
|
+
conditionRule: {
|
|
28
|
+
[ConditionPresetOp.EQ]: { type: 'number' },
|
|
29
|
+
[ConditionPresetOp.NEQ]: { type: 'number' },
|
|
30
|
+
[ConditionPresetOp.GT]: { type: 'number' },
|
|
31
|
+
[ConditionPresetOp.GTE]: { type: 'number' },
|
|
32
|
+
[ConditionPresetOp.LT]: { type: 'number' },
|
|
33
|
+
[ConditionPresetOp.LTE]: { type: 'number' },
|
|
34
|
+
[ConditionPresetOp.IN]: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
extra: { weak: true },
|
|
37
|
+
},
|
|
38
|
+
[ConditionPresetOp.NIN]: {
|
|
39
|
+
type: 'array',
|
|
40
|
+
extra: { weak: true },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
25
43
|
};
|
|
@@ -8,9 +8,10 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { I18n } from '@flowgram.ai/editor';
|
|
10
10
|
|
|
11
|
+
import { ConditionPresetOp } from '@/components/condition-context/op';
|
|
11
12
|
import { CodeEditorMini } from '@/components/code-editor-mini';
|
|
12
13
|
|
|
13
|
-
import { type JsonSchemaTypeRegistry } from '../
|
|
14
|
+
import { type JsonSchemaTypeRegistry } from '../types';
|
|
14
15
|
|
|
15
16
|
export const objectRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
16
17
|
type: 'object',
|
|
@@ -23,4 +24,8 @@ export const objectRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
|
23
24
|
readonly={props.readonly}
|
|
24
25
|
/>
|
|
25
26
|
),
|
|
27
|
+
conditionRule: {
|
|
28
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
29
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null,
|
|
30
|
+
},
|
|
26
31
|
};
|
|
@@ -9,7 +9,9 @@ import React from 'react';
|
|
|
9
9
|
import { I18n } from '@flowgram.ai/editor';
|
|
10
10
|
import { Input, TextArea } from '@douyinfe/semi-ui';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { ConditionPresetOp } from '@/components/condition-context/op';
|
|
13
|
+
|
|
14
|
+
import { type JsonSchemaTypeRegistry } from '../types';
|
|
13
15
|
|
|
14
16
|
export const stringRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
15
17
|
type: 'string',
|
|
@@ -30,4 +32,20 @@ export const stringRegistry: Partial<JsonSchemaTypeRegistry> = {
|
|
|
30
32
|
{...props}
|
|
31
33
|
/>
|
|
32
34
|
),
|
|
35
|
+
conditionRule: {
|
|
36
|
+
[ConditionPresetOp.EQ]: { type: 'string' },
|
|
37
|
+
[ConditionPresetOp.NEQ]: { type: 'string' },
|
|
38
|
+
[ConditionPresetOp.CONTAINS]: { type: 'string' },
|
|
39
|
+
[ConditionPresetOp.NOT_CONTAINS]: { type: 'string' },
|
|
40
|
+
[ConditionPresetOp.IN]: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
items: { type: 'string' },
|
|
43
|
+
},
|
|
44
|
+
[ConditionPresetOp.NIN]: {
|
|
45
|
+
type: 'array',
|
|
46
|
+
items: { type: 'string' },
|
|
47
|
+
},
|
|
48
|
+
[ConditionPresetOp.IS_EMPTY]: null,
|
|
49
|
+
[ConditionPresetOp.IS_NOT_EMPTY]: null,
|
|
50
|
+
},
|
|
33
51
|
};
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { JsonSchemaTypeRegistry as OriginJsonSchemaTypeRegistry } from '@flowgram.ai/json-schema';
|
|
7
7
|
|
|
8
|
+
import { IConditionRule, IConditionRuleFactory } from '@/components/condition-context/types';
|
|
9
|
+
|
|
8
10
|
export interface ConstantRendererProps<Value = any> {
|
|
9
11
|
value?: Value;
|
|
10
12
|
onChange?: (value: Value) => void;
|
|
@@ -16,4 +18,9 @@ export interface JsonSchemaTypeRegistry<Value = any> extends OriginJsonSchemaTyp
|
|
|
16
18
|
* Render Constant Input
|
|
17
19
|
*/
|
|
18
20
|
ConstantRenderer: React.FC<ConstantRendererProps<Value>>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Condition Rules
|
|
24
|
+
*/
|
|
25
|
+
conditionRule?: IConditionRule | IConditionRuleFactory;
|
|
19
26
|
}
|
|
@@ -70,42 +70,55 @@ export namespace FlowValueUtils {
|
|
|
70
70
|
export function* traverse(
|
|
71
71
|
value: any,
|
|
72
72
|
options: {
|
|
73
|
-
includeTypes
|
|
73
|
+
includeTypes: FlowValueType[];
|
|
74
74
|
path?: string;
|
|
75
|
+
pathArr?: string[];
|
|
75
76
|
}
|
|
76
|
-
): Generator<{ value: IFlowValue; path: string }> {
|
|
77
|
-
const {
|
|
77
|
+
): Generator<{ value: IFlowValue; path: string; pathArr: string[] }> {
|
|
78
|
+
const {
|
|
79
|
+
includeTypes = ['ref', 'template', 'expression', 'constant'],
|
|
80
|
+
path = '',
|
|
81
|
+
pathArr = [],
|
|
82
|
+
} = options || {};
|
|
78
83
|
|
|
79
84
|
if (isPlainObject(value)) {
|
|
80
85
|
if (isRef(value) && includeTypes.includes('ref')) {
|
|
81
|
-
yield { value, path };
|
|
86
|
+
yield { value, path, pathArr };
|
|
82
87
|
return;
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
if (isTemplate(value) && includeTypes.includes('template')) {
|
|
86
|
-
yield { value, path };
|
|
91
|
+
yield { value, path, pathArr };
|
|
87
92
|
return;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
if (isExpression(value) && includeTypes.includes('expression')) {
|
|
91
|
-
yield { value, path };
|
|
96
|
+
yield { value, path, pathArr };
|
|
92
97
|
return;
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
if (isConstant(value) && includeTypes.includes('constant')) {
|
|
96
|
-
yield { value, path };
|
|
101
|
+
yield { value, path, pathArr };
|
|
97
102
|
return;
|
|
98
103
|
}
|
|
99
104
|
|
|
100
105
|
for (const [_key, _value] of Object.entries(value)) {
|
|
101
|
-
yield* traverse(_value, {
|
|
106
|
+
yield* traverse(_value, {
|
|
107
|
+
...options,
|
|
108
|
+
path: path ? `${path}.${_key}` : _key,
|
|
109
|
+
pathArr: [...pathArr, _key],
|
|
110
|
+
});
|
|
102
111
|
}
|
|
103
112
|
return;
|
|
104
113
|
}
|
|
105
114
|
|
|
106
115
|
if (isArray(value)) {
|
|
107
116
|
for (const [_idx, _value] of value.entries()) {
|
|
108
|
-
yield* traverse(_value, {
|
|
117
|
+
yield* traverse(_value, {
|
|
118
|
+
...options,
|
|
119
|
+
path: path ? `${path}[${_idx}]` : `[${_idx}]`,
|
|
120
|
+
pathArr: [...pathArr, `[${_idx}]`],
|
|
121
|
+
});
|
|
109
122
|
}
|
|
110
123
|
return;
|
|
111
124
|
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
defaultOpConfigs: ()=>defaultOpConfigs,
|
|
28
|
-
defaultRules: ()=>defaultRules
|
|
29
|
-
});
|
|
30
|
-
const external_types_js_namespaceObject = require("./types.js");
|
|
31
|
-
const defaultRules = {
|
|
32
|
-
string: {
|
|
33
|
-
[external_types_js_namespaceObject.Op.EQ]: 'string',
|
|
34
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'string',
|
|
35
|
-
[external_types_js_namespaceObject.Op.CONTAINS]: 'string',
|
|
36
|
-
[external_types_js_namespaceObject.Op.NOT_CONTAINS]: 'string',
|
|
37
|
-
[external_types_js_namespaceObject.Op.IN]: 'array',
|
|
38
|
-
[external_types_js_namespaceObject.Op.NIN]: 'array',
|
|
39
|
-
[external_types_js_namespaceObject.Op.IS_EMPTY]: null,
|
|
40
|
-
[external_types_js_namespaceObject.Op.IS_NOT_EMPTY]: null
|
|
41
|
-
},
|
|
42
|
-
number: {
|
|
43
|
-
[external_types_js_namespaceObject.Op.EQ]: 'number',
|
|
44
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'number',
|
|
45
|
-
[external_types_js_namespaceObject.Op.GT]: 'number',
|
|
46
|
-
[external_types_js_namespaceObject.Op.GTE]: 'number',
|
|
47
|
-
[external_types_js_namespaceObject.Op.LT]: 'number',
|
|
48
|
-
[external_types_js_namespaceObject.Op.LTE]: 'number',
|
|
49
|
-
[external_types_js_namespaceObject.Op.IN]: 'array',
|
|
50
|
-
[external_types_js_namespaceObject.Op.NIN]: 'array'
|
|
51
|
-
},
|
|
52
|
-
integer: {
|
|
53
|
-
[external_types_js_namespaceObject.Op.EQ]: 'number',
|
|
54
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'number',
|
|
55
|
-
[external_types_js_namespaceObject.Op.GT]: 'number',
|
|
56
|
-
[external_types_js_namespaceObject.Op.GTE]: 'number',
|
|
57
|
-
[external_types_js_namespaceObject.Op.LT]: 'number',
|
|
58
|
-
[external_types_js_namespaceObject.Op.LTE]: 'number',
|
|
59
|
-
[external_types_js_namespaceObject.Op.IN]: 'array',
|
|
60
|
-
[external_types_js_namespaceObject.Op.NIN]: 'array'
|
|
61
|
-
},
|
|
62
|
-
boolean: {
|
|
63
|
-
[external_types_js_namespaceObject.Op.EQ]: 'boolean',
|
|
64
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'boolean',
|
|
65
|
-
[external_types_js_namespaceObject.Op.IS_TRUE]: null,
|
|
66
|
-
[external_types_js_namespaceObject.Op.IS_FALSE]: null,
|
|
67
|
-
[external_types_js_namespaceObject.Op.IN]: 'array',
|
|
68
|
-
[external_types_js_namespaceObject.Op.NIN]: 'array'
|
|
69
|
-
},
|
|
70
|
-
object: {
|
|
71
|
-
[external_types_js_namespaceObject.Op.IS_EMPTY]: null,
|
|
72
|
-
[external_types_js_namespaceObject.Op.IS_NOT_EMPTY]: null
|
|
73
|
-
},
|
|
74
|
-
array: {
|
|
75
|
-
[external_types_js_namespaceObject.Op.IS_EMPTY]: null,
|
|
76
|
-
[external_types_js_namespaceObject.Op.IS_NOT_EMPTY]: null,
|
|
77
|
-
[external_types_js_namespaceObject.Op.CONTAINS]: 'array',
|
|
78
|
-
[external_types_js_namespaceObject.Op.NOT_CONTAINS]: 'array',
|
|
79
|
-
[external_types_js_namespaceObject.Op.EQ]: 'array',
|
|
80
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'array'
|
|
81
|
-
},
|
|
82
|
-
map: {
|
|
83
|
-
[external_types_js_namespaceObject.Op.IS_EMPTY]: null,
|
|
84
|
-
[external_types_js_namespaceObject.Op.IS_NOT_EMPTY]: null
|
|
85
|
-
},
|
|
86
|
-
['date-time']: {
|
|
87
|
-
[external_types_js_namespaceObject.Op.EQ]: 'date-time',
|
|
88
|
-
[external_types_js_namespaceObject.Op.NEQ]: 'date-time',
|
|
89
|
-
[external_types_js_namespaceObject.Op.GT]: 'date-time',
|
|
90
|
-
[external_types_js_namespaceObject.Op.GTE]: 'date-time',
|
|
91
|
-
[external_types_js_namespaceObject.Op.LT]: 'date-time',
|
|
92
|
-
[external_types_js_namespaceObject.Op.LTE]: 'date-time'
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const defaultOpConfigs = {
|
|
96
|
-
[external_types_js_namespaceObject.Op.EQ]: {
|
|
97
|
-
label: 'Equal',
|
|
98
|
-
abbreviation: '='
|
|
99
|
-
},
|
|
100
|
-
[external_types_js_namespaceObject.Op.NEQ]: {
|
|
101
|
-
label: 'Not Equal',
|
|
102
|
-
abbreviation: "\u2260"
|
|
103
|
-
},
|
|
104
|
-
[external_types_js_namespaceObject.Op.GT]: {
|
|
105
|
-
label: 'Greater Than',
|
|
106
|
-
abbreviation: '>'
|
|
107
|
-
},
|
|
108
|
-
[external_types_js_namespaceObject.Op.GTE]: {
|
|
109
|
-
label: 'Greater Than or Equal',
|
|
110
|
-
abbreviation: '>='
|
|
111
|
-
},
|
|
112
|
-
[external_types_js_namespaceObject.Op.LT]: {
|
|
113
|
-
label: 'Less Than',
|
|
114
|
-
abbreviation: '<'
|
|
115
|
-
},
|
|
116
|
-
[external_types_js_namespaceObject.Op.LTE]: {
|
|
117
|
-
label: 'Less Than or Equal',
|
|
118
|
-
abbreviation: '<='
|
|
119
|
-
},
|
|
120
|
-
[external_types_js_namespaceObject.Op.IN]: {
|
|
121
|
-
label: 'In',
|
|
122
|
-
abbreviation: "\u2208"
|
|
123
|
-
},
|
|
124
|
-
[external_types_js_namespaceObject.Op.NIN]: {
|
|
125
|
-
label: 'Not In',
|
|
126
|
-
abbreviation: "\u2209"
|
|
127
|
-
},
|
|
128
|
-
[external_types_js_namespaceObject.Op.CONTAINS]: {
|
|
129
|
-
label: 'Contains',
|
|
130
|
-
abbreviation: "\u2287"
|
|
131
|
-
},
|
|
132
|
-
[external_types_js_namespaceObject.Op.NOT_CONTAINS]: {
|
|
133
|
-
label: 'Not Contains',
|
|
134
|
-
abbreviation: "\u2289"
|
|
135
|
-
},
|
|
136
|
-
[external_types_js_namespaceObject.Op.IS_EMPTY]: {
|
|
137
|
-
label: 'Is Empty',
|
|
138
|
-
abbreviation: '=',
|
|
139
|
-
rightDisplay: 'Empty'
|
|
140
|
-
},
|
|
141
|
-
[external_types_js_namespaceObject.Op.IS_NOT_EMPTY]: {
|
|
142
|
-
label: 'Is Not Empty',
|
|
143
|
-
abbreviation: "\u2260",
|
|
144
|
-
rightDisplay: 'Empty'
|
|
145
|
-
},
|
|
146
|
-
[external_types_js_namespaceObject.Op.IS_TRUE]: {
|
|
147
|
-
label: 'Is True',
|
|
148
|
-
abbreviation: '=',
|
|
149
|
-
rightDisplay: 'True'
|
|
150
|
-
},
|
|
151
|
-
[external_types_js_namespaceObject.Op.IS_FALSE]: {
|
|
152
|
-
label: 'Is False',
|
|
153
|
-
abbreviation: '=',
|
|
154
|
-
rightDisplay: 'False'
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
exports.defaultOpConfigs = __webpack_exports__.defaultOpConfigs;
|
|
158
|
-
exports.defaultRules = __webpack_exports__.defaultRules;
|
|
159
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
160
|
-
"defaultOpConfigs",
|
|
161
|
-
"defaultRules"
|
|
162
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
163
|
-
Object.defineProperty(exports, '__esModule', {
|
|
164
|
-
value: true
|
|
165
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useOp: ()=>useOp
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const external_react_namespaceObject = require("react");
|
|
31
|
-
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
|
-
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
-
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
34
|
-
const external_constants_js_namespaceObject = require("../constants.js");
|
|
35
|
-
function useOp({ rule, op, onChange, readonly, userOps }) {
|
|
36
|
-
const options = (0, external_react_namespaceObject.useMemo)(()=>Object.keys(rule || {}).map((_op)=>({
|
|
37
|
-
...external_constants_js_namespaceObject.defaultOpConfigs[_op] || {},
|
|
38
|
-
...userOps?.[_op] || {},
|
|
39
|
-
value: _op,
|
|
40
|
-
label: editor_namespaceObject.I18n.t(userOps?.[_op]?.label || external_constants_js_namespaceObject.defaultOpConfigs[_op]?.label)
|
|
41
|
-
})), [
|
|
42
|
-
rule,
|
|
43
|
-
userOps
|
|
44
|
-
]);
|
|
45
|
-
const opConfig = (0, external_react_namespaceObject.useMemo)(()=>external_constants_js_namespaceObject.defaultOpConfigs[op], [
|
|
46
|
-
op
|
|
47
|
-
]);
|
|
48
|
-
const renderOpSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
49
|
-
style: {
|
|
50
|
-
height: 22
|
|
51
|
-
},
|
|
52
|
-
disabled: readonly,
|
|
53
|
-
size: "small",
|
|
54
|
-
value: op,
|
|
55
|
-
optionList: options,
|
|
56
|
-
onChange: (v)=>{
|
|
57
|
-
onChange(v);
|
|
58
|
-
},
|
|
59
|
-
triggerRender: ({ value })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Button, {
|
|
60
|
-
size: "small",
|
|
61
|
-
disabled: !rule,
|
|
62
|
-
children: opConfig?.abbreviation || /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconChevronDownStroked, {
|
|
63
|
-
size: "small"
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
});
|
|
67
|
-
return {
|
|
68
|
-
renderOpSelect,
|
|
69
|
-
opConfig
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
exports.useOp = __webpack_exports__.useOp;
|
|
73
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
74
|
-
"useOp"
|
|
75
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
76
|
-
Object.defineProperty(exports, '__esModule', {
|
|
77
|
-
value: true
|
|
78
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useRule: ()=>useRule
|
|
28
|
-
});
|
|
29
|
-
const external_react_namespaceObject = require("react");
|
|
30
|
-
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
31
|
-
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
|
-
const external_constants_js_namespaceObject = require("../constants.js");
|
|
33
|
-
function useRule(left, userRules) {
|
|
34
|
-
const available = (0, editor_namespaceObject.useScopeAvailable)();
|
|
35
|
-
const rules = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
36
|
-
...external_constants_js_namespaceObject.defaultRules,
|
|
37
|
-
...userRules || {}
|
|
38
|
-
}), [
|
|
39
|
-
userRules
|
|
40
|
-
]);
|
|
41
|
-
const variable = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
42
|
-
if (!left) return;
|
|
43
|
-
return available.getByKeyPath(left.content);
|
|
44
|
-
}, [
|
|
45
|
-
available,
|
|
46
|
-
left
|
|
47
|
-
]);
|
|
48
|
-
const rule = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
49
|
-
if (!variable) return;
|
|
50
|
-
const schema = json_schema_namespaceObject.JsonSchemaUtils.astToSchema(variable.type, {
|
|
51
|
-
drilldown: false
|
|
52
|
-
});
|
|
53
|
-
return rules[schema?.type];
|
|
54
|
-
}, [
|
|
55
|
-
variable?.type,
|
|
56
|
-
rules
|
|
57
|
-
]);
|
|
58
|
-
return {
|
|
59
|
-
rule
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
exports.useRule = __webpack_exports__.useRule;
|
|
63
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
64
|
-
"useRule"
|
|
65
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
66
|
-
Object.defineProperty(exports, '__esModule', {
|
|
67
|
-
value: true
|
|
68
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useLeft: ()=>useLeft
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const external_react_namespaceObject = require("react");
|
|
31
|
-
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
32
|
-
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
-
const external_index_js_namespaceObject = require("../../index.js");
|
|
34
|
-
const external_styles_js_namespaceObject = require("../styles.js");
|
|
35
|
-
const defaultRules = external_index_js_namespaceObject.ConditionRow.defaultRules;
|
|
36
|
-
function useLeft({ left, options, userRules, readonly, onChange }) {
|
|
37
|
-
const rules = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
38
|
-
...defaultRules,
|
|
39
|
-
...userRules || {}
|
|
40
|
-
}), [
|
|
41
|
-
userRules
|
|
42
|
-
]);
|
|
43
|
-
const typeManager = (0, json_schema_namespaceObject.useTypeManager)();
|
|
44
|
-
const rule = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
45
|
-
if (!left) return;
|
|
46
|
-
const option = options?.find((item)=>item.value === left);
|
|
47
|
-
if (!option?.schema?.type) return;
|
|
48
|
-
return rules[option.schema.type];
|
|
49
|
-
}, [
|
|
50
|
-
left,
|
|
51
|
-
options,
|
|
52
|
-
rules
|
|
53
|
-
]);
|
|
54
|
-
const renderDBOptionSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UISelect, {
|
|
55
|
-
disabled: readonly,
|
|
56
|
-
size: "small",
|
|
57
|
-
style: {
|
|
58
|
-
width: '100%'
|
|
59
|
-
},
|
|
60
|
-
value: left,
|
|
61
|
-
onChange: (v)=>onChange(v),
|
|
62
|
-
optionList: options?.map((item)=>({
|
|
63
|
-
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_styles_js_namespaceObject.UIOptionLabel, {
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Icon, {
|
|
66
|
-
size: "small",
|
|
67
|
-
svg: typeManager.getDisplayIcon(item.schema)
|
|
68
|
-
}),
|
|
69
|
-
item.label
|
|
70
|
-
]
|
|
71
|
-
}),
|
|
72
|
-
value: item.value
|
|
73
|
-
})) || []
|
|
74
|
-
});
|
|
75
|
-
return {
|
|
76
|
-
rule,
|
|
77
|
-
renderDBOptionSelect
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
exports.useLeft = __webpack_exports__.useLeft;
|
|
81
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
82
|
-
"useLeft"
|
|
83
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
84
|
-
Object.defineProperty(exports, '__esModule', {
|
|
85
|
-
value: true
|
|
86
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useOp: ()=>useOp
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const external_react_namespaceObject = require("react");
|
|
31
|
-
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
|
-
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
-
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
34
|
-
const external_index_js_namespaceObject = require("../../index.js");
|
|
35
|
-
const defaultOpConfigs = external_index_js_namespaceObject.ConditionRow.defaultOpConfigs;
|
|
36
|
-
function useOp({ rule, op, onChange, readonly, userOps }) {
|
|
37
|
-
const options = (0, external_react_namespaceObject.useMemo)(()=>Object.keys(rule || {}).map((_op)=>({
|
|
38
|
-
...defaultOpConfigs[_op] || {},
|
|
39
|
-
...userOps?.[_op] || {},
|
|
40
|
-
value: _op,
|
|
41
|
-
label: editor_namespaceObject.I18n.t(userOps?.[_op]?.label || defaultOpConfigs[_op]?.label)
|
|
42
|
-
})), [
|
|
43
|
-
rule,
|
|
44
|
-
userOps
|
|
45
|
-
]);
|
|
46
|
-
const opConfig = (0, external_react_namespaceObject.useMemo)(()=>defaultOpConfigs[op], [
|
|
47
|
-
op
|
|
48
|
-
]);
|
|
49
|
-
const renderOpSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
50
|
-
style: {
|
|
51
|
-
height: 22
|
|
52
|
-
},
|
|
53
|
-
disabled: readonly,
|
|
54
|
-
size: "small",
|
|
55
|
-
value: op,
|
|
56
|
-
optionList: options,
|
|
57
|
-
onChange: (v)=>{
|
|
58
|
-
onChange(v);
|
|
59
|
-
},
|
|
60
|
-
triggerRender: ({ value })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Button, {
|
|
61
|
-
size: "small",
|
|
62
|
-
disabled: !rule,
|
|
63
|
-
children: opConfig?.abbreviation || /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconChevronDownStroked, {
|
|
64
|
-
size: "small"
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
return {
|
|
69
|
-
renderOpSelect,
|
|
70
|
-
opConfig
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
exports.useOp = __webpack_exports__.useOp;
|
|
74
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
75
|
-
"useOp"
|
|
76
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
77
|
-
Object.defineProperty(exports, '__esModule', {
|
|
78
|
-
value: true
|
|
79
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { typescript } from "@flowgram.ai/coze-editor/language-typescript";
|
|
2
|
-
let tsWorkerInit = false;
|
|
3
|
-
const initTsWorker = ()=>{
|
|
4
|
-
if (tsWorkerInit) return;
|
|
5
|
-
tsWorkerInit = true;
|
|
6
|
-
const tsWorker = new Worker(new URL("@flowgram.ai/coze-editor/language-typescript/worker", import.meta.url), {
|
|
7
|
-
type: 'module'
|
|
8
|
-
});
|
|
9
|
-
typescript.languageService.initialize(tsWorker, {
|
|
10
|
-
compilerOptions: {
|
|
11
|
-
lib: [
|
|
12
|
-
'es2015',
|
|
13
|
-
'dom'
|
|
14
|
-
],
|
|
15
|
-
noImplicitAny: false
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export { initTsWorker };
|