@flowgram.ai/form-materials 0.1.0-alpha.18 → 0.1.0-alpha.20
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/assign-rows/index.js +8 -2
- package/dist/cjs/components/batch-outputs/index.js +5 -3
- package/dist/cjs/components/batch-outputs/styles.css +13 -0
- package/dist/cjs/components/blur-input/index.js +5 -1
- package/dist/cjs/components/code-editor/editor.js +16 -12
- package/dist/cjs/components/code-editor/styles.css +4 -0
- package/dist/cjs/components/code-editor/theme/dark.js +1 -1
- package/dist/cjs/components/code-editor/theme/light.js +1 -1
- package/dist/cjs/components/code-editor-mini/index.js +2 -16
- package/dist/cjs/components/condition-context/hooks/use-condition.js +21 -1
- package/dist/cjs/components/condition-row/index.js +26 -12
- package/dist/cjs/components/condition-row/styles.css +19 -0
- package/dist/cjs/components/coze-editor-extensions/extensions/inputs-tree.js +2 -2
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +44 -15
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +7 -3
- package/dist/{esm/components/coze-editor-extensions/styles.mjs → cjs/components/coze-editor-extensions/styles.css} +19 -18
- package/dist/cjs/components/db-condition-row/index.js +29 -14
- package/dist/cjs/components/db-condition-row/styles.css +30 -0
- package/dist/cjs/components/display-inputs-values/index.js +3 -2
- package/dist/cjs/components/display-inputs-values/styles.css +6 -0
- package/dist/cjs/components/display-outputs/index.js +8 -6
- package/dist/cjs/components/display-outputs/styles.css +6 -0
- package/dist/cjs/components/display-schema-tag/index.js +7 -4
- package/dist/cjs/components/display-schema-tag/styles.css +21 -0
- package/dist/cjs/components/display-schema-tree/index.js +12 -7
- package/dist/cjs/components/display-schema-tree/styles.css +64 -0
- package/dist/cjs/components/dynamic-value-input/index.js +9 -5
- package/dist/{esm/components/dynamic-value-input/styles.mjs → cjs/components/dynamic-value-input/styles.css} +24 -30
- package/dist/cjs/components/index.js +5 -1
- package/dist/cjs/components/inputs-values/index.js +5 -3
- package/dist/cjs/components/inputs-values/styles.css +13 -0
- package/dist/cjs/components/inputs-values-tree/icon.js +70 -0
- package/dist/cjs/components/inputs-values-tree/index.js +4 -3
- package/dist/cjs/components/inputs-values-tree/row.js +19 -15
- package/dist/cjs/components/inputs-values-tree/styles.css +85 -0
- package/dist/cjs/components/{display-inputs-values/styles.js → json-schema-creator/index.js} +4 -19
- package/dist/cjs/components/json-schema-creator/json-input-modal.js +96 -0
- package/dist/cjs/components/{prompt-editor-with-variables/editor.js → json-schema-creator/json-schema-creator.js} +23 -11
- package/dist/cjs/components/{batch-outputs/styles.js → json-schema-creator/utils/json-to-schema.js} +35 -28
- package/dist/cjs/components/json-schema-editor/default-value.js +2 -2
- package/dist/cjs/components/json-schema-editor/hooks.js +55 -48
- package/dist/cjs/components/json-schema-editor/icon.js +70 -0
- package/dist/cjs/components/json-schema-editor/index.js +37 -25
- package/dist/cjs/components/json-schema-editor/styles.css +113 -0
- package/dist/cjs/components/prompt-editor/editor.js +16 -6
- package/dist/cjs/components/prompt-editor/styles.css +10 -0
- package/dist/cjs/components/prompt-editor-with-inputs/index.js +16 -26
- package/dist/cjs/components/prompt-editor-with-variables/index.js +17 -26
- package/dist/cjs/components/variable-selector/context.js +7 -3
- package/dist/cjs/components/variable-selector/index.js +16 -10
- package/dist/{esm/components/variable-selector/styles.mjs → cjs/components/variable-selector/styles.css} +37 -29
- package/dist/cjs/components/variable-selector/use-variable-tree.js +3 -1
- package/dist/cjs/effects/validate-when-variable-sync/index.js +3 -3
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/shared/inject-material/index.js +1 -1
- package/dist/esm/components/assign-rows/index.mjs +9 -3
- package/dist/esm/components/batch-outputs/index.mjs +5 -3
- package/dist/esm/components/batch-outputs/styles.css +13 -0
- package/dist/esm/components/blur-input/index.mjs +5 -1
- package/dist/esm/components/code-editor/editor.mjs +16 -11
- package/dist/esm/components/code-editor/styles.css +4 -0
- package/dist/esm/components/code-editor/theme/dark.mjs +1 -1
- package/dist/esm/components/code-editor/theme/light.mjs +1 -1
- package/dist/esm/components/code-editor-mini/index.mjs +2 -6
- package/dist/esm/components/condition-context/hooks/use-condition.mjs +22 -2
- package/dist/esm/components/condition-row/index.mjs +26 -12
- package/dist/esm/components/condition-row/styles.css +19 -0
- package/dist/esm/components/coze-editor-extensions/extensions/inputs-tree.mjs +3 -3
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +45 -16
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +8 -4
- package/dist/esm/components/coze-editor-extensions/styles.css +37 -0
- package/dist/esm/components/db-condition-row/index.mjs +29 -14
- package/dist/esm/components/db-condition-row/styles.css +30 -0
- package/dist/esm/components/display-inputs-values/index.mjs +3 -2
- package/dist/esm/components/display-inputs-values/styles.css +6 -0
- package/dist/esm/components/display-outputs/index.mjs +9 -7
- package/dist/esm/components/display-outputs/styles.css +6 -0
- package/dist/esm/components/display-schema-tag/index.mjs +8 -5
- package/dist/esm/components/display-schema-tag/styles.css +21 -0
- package/dist/esm/components/display-schema-tree/index.mjs +12 -7
- package/dist/esm/components/display-schema-tree/styles.css +64 -0
- package/dist/esm/components/dynamic-value-input/index.mjs +9 -5
- package/dist/esm/components/dynamic-value-input/styles.css +48 -0
- package/dist/esm/components/index.mjs +2 -1
- package/dist/esm/components/inputs-values/index.mjs +5 -3
- package/dist/esm/components/inputs-values/styles.css +13 -0
- package/dist/esm/components/inputs-values-tree/icon.mjs +26 -0
- package/dist/esm/components/inputs-values-tree/index.mjs +4 -3
- package/dist/esm/components/inputs-values-tree/row.mjs +18 -14
- package/dist/esm/components/inputs-values-tree/styles.css +85 -0
- package/dist/esm/components/json-schema-creator/index.mjs +2 -0
- package/dist/esm/components/json-schema-creator/json-input-modal.mjs +62 -0
- package/dist/esm/components/json-schema-creator/json-schema-creator.mjs +26 -0
- package/dist/esm/components/json-schema-creator/utils/json-to-schema.mjs +33 -0
- package/dist/esm/components/json-schema-editor/default-value.mjs +2 -2
- package/dist/esm/components/json-schema-editor/hooks.mjs +55 -48
- package/dist/esm/components/json-schema-editor/icon.mjs +26 -0
- package/dist/esm/components/json-schema-editor/index.mjs +36 -24
- package/dist/esm/components/json-schema-editor/styles.css +113 -0
- package/dist/esm/components/prompt-editor/editor.mjs +16 -6
- package/dist/esm/components/prompt-editor/styles.css +10 -0
- package/dist/esm/components/prompt-editor-with-inputs/index.mjs +12 -4
- package/dist/esm/components/prompt-editor-with-variables/index.mjs +13 -4
- package/dist/esm/components/variable-selector/context.mjs +7 -3
- package/dist/esm/components/variable-selector/index.mjs +17 -11
- package/{src/components/variable-selector/styles.tsx → dist/esm/components/variable-selector/styles.css} +35 -38
- package/dist/esm/components/variable-selector/use-variable-tree.mjs +3 -1
- package/dist/esm/effects/validate-when-variable-sync/index.mjs +3 -3
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/shared/inject-material/index.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/assign-rows/index.d.ts +2 -0
- package/dist/types/components/batch-outputs/index.d.ts +1 -0
- package/dist/types/components/blur-input/index.d.ts +1 -1
- package/dist/types/components/code-editor/editor.d.ts +1 -0
- package/dist/types/components/condition-context/hooks/use-condition.d.ts +16 -1
- package/dist/types/components/condition-row/index.d.ts +5 -1
- package/dist/types/components/coze-editor-extensions/extensions/inputs-tree.d.ts +3 -3
- package/dist/types/components/coze-editor-extensions/extensions/variable-tag.d.ts +1 -0
- package/dist/types/components/coze-editor-extensions/index.d.ts +1 -1
- package/dist/types/components/db-condition-row/index.d.ts +4 -0
- package/dist/types/components/db-condition-row/types.d.ts +0 -1
- package/dist/types/components/display-inputs-values/index.d.ts +3 -1
- package/dist/types/components/display-outputs/index.d.ts +3 -1
- package/dist/types/components/display-schema-tag/index.d.ts +1 -0
- package/dist/types/components/display-schema-tree/index.d.ts +1 -0
- package/dist/types/components/dynamic-value-input/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/inputs-values/index.d.ts +1 -0
- package/dist/types/components/inputs-values-tree/icon.d.ts +6 -0
- package/dist/types/components/inputs-values-tree/index.d.ts +1 -0
- package/dist/types/components/inputs-values-tree/row.d.ts +1 -0
- package/dist/types/components/inputs-values-tree/types.d.ts +3 -2
- package/dist/types/components/json-schema-creator/index.d.ts +6 -0
- package/dist/types/components/json-schema-creator/json-input-modal.d.ts +13 -0
- package/dist/types/components/json-schema-creator/json-schema-creator.d.ts +11 -0
- package/dist/types/components/json-schema-creator/utils/json-to-schema.d.ts +6 -0
- package/dist/types/components/json-schema-editor/icon.d.ts +6 -0
- package/dist/types/components/json-schema-editor/index.d.ts +1 -0
- package/dist/types/components/prompt-editor/editor.d.ts +1 -0
- package/dist/types/components/prompt-editor-with-inputs/index.d.ts +7 -2
- package/dist/types/components/prompt-editor-with-variables/index.d.ts +5 -2
- package/dist/types/components/variable-selector/context.d.ts +16 -3
- package/dist/types/components/variable-selector/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +7 -3
- package/dist/types/shared/flow-value/index.d.ts +1 -1
- package/dist/types/shared/flow-value/types.d.ts +3 -0
- package/dist/types/shared/index.d.ts +1 -1
- package/package.json +7 -10
- package/src/components/assign-rows/index.tsx +7 -6
- package/src/components/batch-outputs/index.tsx +5 -5
- package/src/components/batch-outputs/{styles.tsx → styles.css} +4 -6
- package/src/components/blur-input/index.tsx +6 -2
- package/src/components/code-editor/editor.tsx +19 -14
- package/src/components/code-editor/styles.css +11 -0
- package/src/components/code-editor/theme/dark.ts +1 -1
- package/src/components/code-editor/theme/light.ts +1 -1
- package/src/components/code-editor-mini/index.tsx +2 -9
- package/src/components/condition-context/hooks/use-condition.tsx +55 -7
- package/src/components/condition-row/index.tsx +27 -22
- package/src/components/condition-row/{styles.tsx → styles.css} +11 -11
- package/src/components/coze-editor-extensions/extensions/inputs-tree.tsx +7 -6
- package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +35 -22
- package/src/components/coze-editor-extensions/extensions/variable-tree.tsx +14 -4
- package/src/components/coze-editor-extensions/{styles.tsx → styles.css} +8 -11
- package/src/components/db-condition-row/index.tsx +29 -26
- package/src/components/db-condition-row/{styles.tsx → styles.css} +14 -16
- package/src/components/db-condition-row/types.ts +0 -1
- package/src/components/display-inputs-values/index.tsx +5 -4
- package/src/components/display-inputs-values/{styles.ts → styles.css} +2 -4
- package/src/components/display-outputs/index.tsx +9 -8
- package/src/components/display-outputs/{styles.ts → styles.css} +2 -4
- package/src/components/display-schema-tag/index.tsx +7 -7
- package/src/components/display-schema-tag/{styles.ts → styles.css} +7 -10
- package/src/components/display-schema-tree/index.tsx +10 -10
- package/src/components/display-schema-tree/{styles.tsx → styles.css} +18 -24
- package/src/components/dynamic-value-input/index.tsx +6 -6
- package/src/components/dynamic-value-input/{styles.tsx → styles.css} +9 -12
- package/src/components/index.ts +1 -0
- package/src/components/inputs-values/index.tsx +5 -5
- package/src/components/inputs-values/{styles.tsx → styles.css} +4 -6
- package/src/components/inputs-values-tree/icon.tsx +28 -0
- package/src/components/inputs-values-tree/index.tsx +8 -6
- package/src/components/inputs-values-tree/row.tsx +25 -27
- package/src/components/inputs-values-tree/styles.css +94 -0
- package/src/components/inputs-values-tree/types.ts +3 -2
- package/src/components/json-schema-creator/index.tsx +7 -0
- package/src/components/json-schema-creator/json-input-modal.tsx +61 -0
- package/src/components/json-schema-creator/json-schema-creator.tsx +37 -0
- package/src/components/json-schema-creator/utils/json-to-schema.ts +50 -0
- package/src/components/json-schema-editor/default-value.tsx +2 -4
- package/src/components/json-schema-editor/hooks.tsx +60 -53
- package/src/components/json-schema-editor/icon.tsx +28 -0
- package/src/components/json-schema-editor/index.tsx +45 -50
- package/src/components/json-schema-editor/styles.css +135 -0
- package/src/components/prompt-editor/editor.tsx +18 -7
- package/src/components/prompt-editor/styles.css +14 -0
- package/src/components/prompt-editor-with-inputs/index.tsx +18 -5
- package/src/components/prompt-editor-with-variables/index.tsx +13 -5
- package/src/components/variable-selector/context.tsx +22 -2
- package/src/components/variable-selector/index.tsx +24 -14
- package/src/components/variable-selector/styles.css +70 -0
- package/src/components/variable-selector/use-variable-tree.tsx +9 -1
- package/src/effects/validate-when-variable-sync/index.ts +7 -3
- package/src/index.ts +3 -0
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +17 -12
- package/src/shared/flow-value/index.ts +1 -0
- package/src/shared/flow-value/types.ts +4 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/inject-material/index.tsx +1 -1
- package/dist/cjs/components/condition-row/styles.js +0 -77
- package/dist/cjs/components/coze-editor-extensions/styles.js +0 -89
- package/dist/cjs/components/db-condition-row/styles.js +0 -94
- package/dist/cjs/components/display-outputs/styles.js +0 -51
- package/dist/cjs/components/display-schema-tag/styles.js +0 -71
- package/dist/cjs/components/display-schema-tree/styles.js +0 -135
- package/dist/cjs/components/dynamic-value-input/styles.js +0 -107
- package/dist/cjs/components/inputs-values/styles.js +0 -60
- package/dist/cjs/components/inputs-values-tree/styles.js +0 -177
- package/dist/cjs/components/json-schema-editor/styles.js +0 -231
- package/dist/cjs/components/prompt-editor/styles.js +0 -55
- package/dist/cjs/components/prompt-editor-with-inputs/editor.js +0 -47
- package/dist/cjs/components/variable-selector/styles.js +0 -114
- package/dist/esm/components/batch-outputs/styles.mjs +0 -13
- package/dist/esm/components/condition-row/styles.mjs +0 -21
- package/dist/esm/components/db-condition-row/styles.mjs +0 -32
- package/dist/esm/components/display-inputs-values/styles.mjs +0 -7
- package/dist/esm/components/display-outputs/styles.mjs +0 -7
- package/dist/esm/components/display-schema-tag/styles.mjs +0 -21
- package/dist/esm/components/display-schema-tree/styles.mjs +0 -79
- package/dist/esm/components/inputs-values/styles.mjs +0 -13
- package/dist/esm/components/inputs-values-tree/styles.mjs +0 -105
- package/dist/esm/components/json-schema-editor/styles.mjs +0 -138
- package/dist/esm/components/prompt-editor/styles.mjs +0 -11
- package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +0 -13
- package/dist/esm/components/prompt-editor-with-variables/editor.mjs +0 -14
- package/dist/types/components/batch-outputs/styles.d.ts +0 -6
- package/dist/types/components/condition-row/styles.d.ts +0 -9
- package/dist/types/components/coze-editor-extensions/styles.d.ts +0 -9
- package/dist/types/components/db-condition-row/styles.d.ts +0 -12
- package/dist/types/components/display-inputs-values/styles.d.ts +0 -5
- package/dist/types/components/display-outputs/styles.d.ts +0 -5
- package/dist/types/components/display-schema-tag/styles.d.ts +0 -8
- package/dist/types/components/display-schema-tree/styles.d.ts +0 -11
- package/dist/types/components/dynamic-value-input/styles.d.ts +0 -8
- package/dist/types/components/inputs-values/styles.d.ts +0 -6
- package/dist/types/components/inputs-values-tree/styles.d.ts +0 -23
- package/dist/types/components/json-schema-editor/styles.d.ts +0 -30
- package/dist/types/components/prompt-editor/styles.d.ts +0 -7
- package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +0 -10
- package/dist/types/components/prompt-editor-with-variables/editor.d.ts +0 -9
- package/dist/types/components/variable-selector/styles.d.ts +0 -14
- package/src/components/inputs-values-tree/styles.tsx +0 -128
- package/src/components/json-schema-editor/styles.tsx +0 -168
- package/src/components/prompt-editor/styles.tsx +0 -18
- package/src/components/prompt-editor-with-inputs/editor.tsx +0 -24
- package/src/components/prompt-editor-with-variables/editor.tsx +0 -20
- package/src/shared/inject-material/README.md +0 -170
- package/src/shared/inject-material/README.zh.md +0 -174
|
@@ -14,11 +14,12 @@ import {
|
|
|
14
14
|
import preset, { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
|
|
15
15
|
|
|
16
16
|
import { PropsType } from './types';
|
|
17
|
-
import { UIContainer } from './styles';
|
|
18
17
|
import MarkdownHighlight from './extensions/markdown';
|
|
19
18
|
import LanguageSupport from './extensions/language-support';
|
|
20
19
|
import JinjaHighlight from './extensions/jinja';
|
|
21
20
|
|
|
21
|
+
import './styles.css';
|
|
22
|
+
|
|
22
23
|
type Preset = typeof preset;
|
|
23
24
|
type Options = Partial<InferValues<Preset[number]>>;
|
|
24
25
|
|
|
@@ -42,22 +43,32 @@ export function PromptEditor(props: PromptEditorPropsType) {
|
|
|
42
43
|
|
|
43
44
|
const editorRef = useRef<EditorAPI | null>(null);
|
|
44
45
|
|
|
46
|
+
const editorValue = String(value?.content || '');
|
|
47
|
+
|
|
45
48
|
useEffect(() => {
|
|
46
49
|
// listen to value change
|
|
47
|
-
if (editorRef.current?.getValue() !==
|
|
48
|
-
|
|
50
|
+
if (editorRef.current?.getValue() !== editorValue) {
|
|
51
|
+
// apply updates on readonly mode
|
|
52
|
+
const editorView = editorRef.current?.$view;
|
|
53
|
+
editorView?.dispatch({
|
|
54
|
+
changes: {
|
|
55
|
+
from: 0,
|
|
56
|
+
to: editorView?.state.doc.length,
|
|
57
|
+
insert: editorValue,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
49
60
|
}
|
|
50
|
-
}, [
|
|
61
|
+
}, [editorValue]);
|
|
51
62
|
|
|
52
63
|
return (
|
|
53
|
-
<
|
|
64
|
+
<div className={`gedit-m-prompt-editor-container ${hasError ? 'has-error' : ''}`} style={style}>
|
|
54
65
|
<EditorProvider>
|
|
55
66
|
<Renderer
|
|
56
67
|
didMount={(editor: EditorAPI) => {
|
|
57
68
|
editorRef.current = editor;
|
|
58
69
|
}}
|
|
59
70
|
plugins={preset}
|
|
60
|
-
defaultValue={
|
|
71
|
+
defaultValue={editorValue}
|
|
61
72
|
options={{
|
|
62
73
|
readOnly: readonly,
|
|
63
74
|
editable: !readonly,
|
|
@@ -76,6 +87,6 @@ export function PromptEditor(props: PromptEditorPropsType) {
|
|
|
76
87
|
<JinjaHighlight />
|
|
77
88
|
{children}
|
|
78
89
|
</EditorProvider>
|
|
79
|
-
</
|
|
90
|
+
</div>
|
|
80
91
|
);
|
|
81
92
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.gedit-m-prompt-editor-container {
|
|
7
|
+
background-color: var(--semi-color-fill-0);
|
|
8
|
+
padding-left: 10px;
|
|
9
|
+
padding-right: 6px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.gedit-m-prompt-editor-container.has-error {
|
|
13
|
+
border: 1px solid var(--semi-color-danger-6);
|
|
14
|
+
}
|
|
@@ -3,10 +3,23 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import type { IInputsValues } from '@/shared/flow-value';
|
|
9
|
+
import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
|
|
10
|
+
import { EditorInputsTree } from '@/components/coze-editor-extensions';
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export interface PromptEditorWithInputsProps extends PromptEditorPropsType {
|
|
13
|
+
inputsValues: IInputsValues;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function PromptEditorWithInputs({
|
|
17
|
+
inputsValues,
|
|
18
|
+
...restProps
|
|
19
|
+
}: PromptEditorWithInputsProps) {
|
|
20
|
+
return (
|
|
21
|
+
<PromptEditor {...restProps}>
|
|
22
|
+
<EditorInputsTree inputsValues={inputsValues} />
|
|
23
|
+
</PromptEditor>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
);
|
|
8
|
+
import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
|
|
9
|
+
import { EditorVariableTree, EditorVariableTagInject } from '@/components/coze-editor-extensions';
|
|
11
10
|
|
|
12
|
-
export
|
|
11
|
+
export interface PromptEditorWithVariablesProps extends PromptEditorPropsType {}
|
|
12
|
+
|
|
13
|
+
export function PromptEditorWithVariables(props: PromptEditorWithVariablesProps) {
|
|
14
|
+
return (
|
|
15
|
+
<PromptEditor {...props}>
|
|
16
|
+
<EditorVariableTree />
|
|
17
|
+
<EditorVariableTagInject />
|
|
18
|
+
</PromptEditor>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -5,10 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { createContext, useContext, useMemo } from 'react';
|
|
7
7
|
|
|
8
|
+
import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
8
9
|
import { BaseVariableField } from '@flowgram.ai/editor';
|
|
9
10
|
|
|
11
|
+
type VariableField = BaseVariableField<{
|
|
12
|
+
icon?: string | JSX.Element;
|
|
13
|
+
title?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
10
17
|
export const VariableSelectorContext = createContext<{
|
|
11
|
-
|
|
18
|
+
includeSchema?: IJsonSchema | IJsonSchema[];
|
|
19
|
+
excludeSchema?: IJsonSchema | IJsonSchema[];
|
|
20
|
+
skipVariable?: (variable: VariableField) => boolean;
|
|
12
21
|
}>({});
|
|
13
22
|
|
|
14
23
|
export const useVariableSelectorContext = () => useContext(VariableSelectorContext);
|
|
@@ -16,11 +25,22 @@ export const useVariableSelectorContext = () => useContext(VariableSelectorConte
|
|
|
16
25
|
export const VariableSelectorProvider = ({
|
|
17
26
|
children,
|
|
18
27
|
skipVariable,
|
|
28
|
+
includeSchema,
|
|
29
|
+
excludeSchema,
|
|
19
30
|
}: {
|
|
20
31
|
skipVariable?: (variable?: BaseVariableField) => boolean;
|
|
32
|
+
includeSchema?: IJsonSchema | IJsonSchema[];
|
|
33
|
+
excludeSchema?: IJsonSchema | IJsonSchema[];
|
|
21
34
|
children: React.ReactNode;
|
|
22
35
|
}) => {
|
|
23
|
-
const context = useMemo(
|
|
36
|
+
const context = useMemo(
|
|
37
|
+
() => ({
|
|
38
|
+
skipVariable,
|
|
39
|
+
includeSchema,
|
|
40
|
+
excludeSchema,
|
|
41
|
+
}),
|
|
42
|
+
[skipVariable, includeSchema, excludeSchema]
|
|
43
|
+
);
|
|
24
44
|
|
|
25
45
|
return (
|
|
26
46
|
<VariableSelectorContext.Provider value={context}>{children}</VariableSelectorContext.Provider>
|
|
@@ -9,15 +9,16 @@ import { IJsonSchema } from '@flowgram.ai/json-schema';
|
|
|
9
9
|
import { I18n } from '@flowgram.ai/editor';
|
|
10
10
|
import { type TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
11
11
|
import { type TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
12
|
-
import { Popover } from '@douyinfe/semi-ui';
|
|
12
|
+
import { Popover, Tag, TreeSelect } from '@douyinfe/semi-ui';
|
|
13
13
|
import { IconChevronDownStroked, IconIssueStroked } from '@douyinfe/semi-icons';
|
|
14
14
|
|
|
15
15
|
import { createInjectMaterial } from '@/shared';
|
|
16
16
|
|
|
17
17
|
import { useVariableTree } from './use-variable-tree';
|
|
18
|
-
import { UIPopoverContent, UIRootTitle, UITag, UITreeSelect, UIVarName } from './styles';
|
|
19
18
|
import { useVariableSelectorContext } from './context';
|
|
20
19
|
|
|
20
|
+
import './styles.css';
|
|
21
|
+
|
|
21
22
|
export interface VariableSelectorProps {
|
|
22
23
|
value?: string[];
|
|
23
24
|
config?: {
|
|
@@ -75,62 +76,71 @@ export const VariableSelector = ({
|
|
|
75
76
|
|
|
76
77
|
return (
|
|
77
78
|
<>
|
|
78
|
-
<
|
|
79
|
+
<TreeSelect
|
|
80
|
+
className={`gedit-m-variable-selector-tree-select ${hasError ? 'error' : ''}`}
|
|
79
81
|
dropdownMatchSelectWidth={false}
|
|
80
82
|
disabled={readonly}
|
|
81
83
|
treeData={treeData}
|
|
82
84
|
size="small"
|
|
83
85
|
value={treeValue}
|
|
84
86
|
clearIcon={null}
|
|
85
|
-
$error={hasError}
|
|
86
87
|
style={style}
|
|
87
88
|
validateStatus={hasError ? 'error' : undefined}
|
|
89
|
+
dropdownClassName="gedit-m-variable-selector-dropdown"
|
|
88
90
|
onChange={(_, _config) => {
|
|
89
91
|
onChange((_config as TreeNodeData).keyPath as string[]);
|
|
90
92
|
}}
|
|
91
93
|
renderSelectedItem={(_option: TreeNodeData) => {
|
|
92
94
|
if (!_option?.keyPath) {
|
|
93
95
|
return (
|
|
94
|
-
<
|
|
96
|
+
<Tag
|
|
97
|
+
className="gedit-m-variable-selector-tag"
|
|
95
98
|
prefixIcon={<IconIssueStroked />}
|
|
96
99
|
color="amber"
|
|
97
100
|
closable={!readonly}
|
|
98
101
|
onClose={() => onChange(undefined)}
|
|
99
102
|
>
|
|
100
103
|
{config?.notFoundContent ?? 'Undefined'}
|
|
101
|
-
</
|
|
104
|
+
</Tag>
|
|
102
105
|
);
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
const rootIcon = renderIcon(_option.rootMeta?.icon || _option?.icon);
|
|
106
109
|
|
|
107
110
|
const rootTitle = (
|
|
108
|
-
<
|
|
111
|
+
<div className="gedit-m-variable-selector-root-title">
|
|
109
112
|
{_option.rootMeta?.title
|
|
110
113
|
? `${_option.rootMeta?.title} ${_option.isRoot ? '' : '-'} `
|
|
111
114
|
: null}
|
|
112
|
-
</
|
|
115
|
+
</div>
|
|
113
116
|
);
|
|
114
117
|
|
|
115
118
|
return (
|
|
116
119
|
<div>
|
|
117
120
|
<Popover
|
|
118
121
|
content={
|
|
119
|
-
<
|
|
122
|
+
<div className="gedit-m-variable-selector-tag-pop">
|
|
120
123
|
{rootIcon}
|
|
121
124
|
{rootTitle}
|
|
122
|
-
<
|
|
123
|
-
|
|
125
|
+
<div className="gedit-m-variable-selector-var-name">
|
|
126
|
+
{_option.keyPath.slice(1).join('.')}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
124
129
|
}
|
|
125
130
|
>
|
|
126
|
-
<
|
|
131
|
+
<Tag
|
|
132
|
+
className="gedit-m-variable-selector-tag"
|
|
127
133
|
prefixIcon={rootIcon}
|
|
128
134
|
closable={!readonly}
|
|
129
135
|
onClose={() => onChange(undefined)}
|
|
130
136
|
>
|
|
131
137
|
{rootTitle}
|
|
132
|
-
{!_option.isRoot &&
|
|
133
|
-
|
|
138
|
+
{!_option.isRoot && (
|
|
139
|
+
<div className="gedit-m-variable-selector-var-name in-selector">
|
|
140
|
+
{_option.label}
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
</Tag>
|
|
134
144
|
</Popover>
|
|
135
145
|
</div>
|
|
136
146
|
);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.gedit-m-variable-selector-root-title {
|
|
7
|
+
margin-right: 4px;
|
|
8
|
+
min-width: 20px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
text-overflow: ellipsis;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
color: var(--semi-color-text-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.gedit-m-variable-selector-var-name {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
text-overflow: ellipsis;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
|
|
20
|
+
&.in-selector {
|
|
21
|
+
min-width: 50%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.gedit-m-variable-selector-tag {
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: flex-start;
|
|
30
|
+
margin: 0;
|
|
31
|
+
height: 22px;
|
|
32
|
+
|
|
33
|
+
.semi-tag-content-center {
|
|
34
|
+
justify-content: flex-start;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.gedit-m-variable-selector-tree-select {
|
|
39
|
+
outline: none;
|
|
40
|
+
|
|
41
|
+
&.error {
|
|
42
|
+
outline: 1px solid red;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.semi-tree-select-selection {
|
|
46
|
+
padding: 0px;
|
|
47
|
+
height: 22px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.semi-tree-select-selection-content {
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.semi-tree-select-selection-placeholder {
|
|
55
|
+
padding-left: 10px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.gedit-m-variable-selector-tag-pop {
|
|
60
|
+
padding: 10px;
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.gedit-m-variable-selector-dropdown {
|
|
68
|
+
max-height: 300px;
|
|
69
|
+
overflow: auto;
|
|
70
|
+
}
|
|
@@ -15,6 +15,8 @@ import { ASTMatch, BaseVariableField, useAvailableVariables } from '@flowgram.ai
|
|
|
15
15
|
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
16
16
|
import { Icon } from '@douyinfe/semi-ui';
|
|
17
17
|
|
|
18
|
+
import { useVariableSelectorContext } from './context';
|
|
19
|
+
|
|
18
20
|
type VariableField = BaseVariableField<{
|
|
19
21
|
icon?: string | JSX.Element;
|
|
20
22
|
title?: string;
|
|
@@ -26,7 +28,13 @@ export function useVariableTree(params: {
|
|
|
26
28
|
excludeSchema?: IJsonSchema | IJsonSchema[];
|
|
27
29
|
skipVariable?: (variable: VariableField) => boolean;
|
|
28
30
|
}): TreeNodeData[] {
|
|
29
|
-
const
|
|
31
|
+
const context = useVariableSelectorContext();
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
includeSchema = context.includeSchema,
|
|
35
|
+
excludeSchema = context.excludeSchema,
|
|
36
|
+
skipVariable = context.skipVariable,
|
|
37
|
+
} = params;
|
|
30
38
|
|
|
31
39
|
const typeManager = useTypeManager() as JsonSchemaTypeManager;
|
|
32
40
|
const variables = useAvailableVariables();
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { isEmpty } from 'lodash-es';
|
|
7
6
|
import {
|
|
8
7
|
DataEvent,
|
|
9
8
|
Effect,
|
|
@@ -19,12 +18,17 @@ export const validateWhenVariableSync = ({
|
|
|
19
18
|
} = {}): EffectOptions[] => [
|
|
20
19
|
{
|
|
21
20
|
event: DataEvent.onValueInit,
|
|
22
|
-
effect: (({ context, form }) => {
|
|
21
|
+
effect: (({ context, form, name }) => {
|
|
23
22
|
const nodeScope =
|
|
24
23
|
scope === 'private' ? getNodePrivateScope(context.node) : getNodeScope(context.node);
|
|
25
24
|
|
|
26
25
|
const disposable = nodeScope.available.onListOrAnyVarChange(() => {
|
|
27
|
-
|
|
26
|
+
const errorKeys = Object.entries(form.state.errors || {})
|
|
27
|
+
.filter(([_, errors]) => errors?.length > 0)
|
|
28
|
+
.filter(([key]) => key.startsWith(name) || name.startsWith(key))
|
|
29
|
+
.map(([key]) => key);
|
|
30
|
+
|
|
31
|
+
if (errorKeys.length > 0) {
|
|
28
32
|
form.validate();
|
|
29
33
|
}
|
|
30
34
|
});
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export {
|
|
|
34
34
|
InputsValuesTree,
|
|
35
35
|
JsonCodeEditor,
|
|
36
36
|
JsonEditorWithVariables,
|
|
37
|
+
JsonSchemaCreator,
|
|
37
38
|
JsonSchemaEditor,
|
|
38
39
|
PromptEditor,
|
|
39
40
|
PromptEditorWithInputs,
|
|
@@ -59,6 +60,7 @@ export {
|
|
|
59
60
|
type IConditionRule,
|
|
60
61
|
type IConditionRuleFactory,
|
|
61
62
|
type JsonEditorWithVariablesProps,
|
|
63
|
+
type JsonSchemaCreatorProps,
|
|
62
64
|
type PromptEditorPropsType,
|
|
63
65
|
type PromptEditorWithInputsProps,
|
|
64
66
|
type PromptEditorWithVariablesProps,
|
|
@@ -115,6 +117,7 @@ export {
|
|
|
115
117
|
type IFlowTemplateValue,
|
|
116
118
|
type IFlowValue,
|
|
117
119
|
type IFlowValueExtra,
|
|
120
|
+
type IInputsValues,
|
|
118
121
|
type IPolyfillRoot,
|
|
119
122
|
unstableSetCreateRoot,
|
|
120
123
|
withSuspense,
|
|
@@ -8,23 +8,28 @@ import {
|
|
|
8
8
|
jsonSchemaContainerModule,
|
|
9
9
|
JsonSchemaTypeManager,
|
|
10
10
|
} from '@flowgram.ai/json-schema';
|
|
11
|
-
import { definePluginCreator } from '@flowgram.ai/editor';
|
|
11
|
+
import { definePluginCreator, type PluginCreator } from '@flowgram.ai/editor';
|
|
12
12
|
|
|
13
13
|
import { JsonSchemaTypeRegistry } from './types';
|
|
14
14
|
import { initRegistries, jsonSchemaTypePreset } from './type-definition';
|
|
15
15
|
|
|
16
16
|
initRegistries();
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type TypePresetRegistry = Partial<JsonSchemaTypeRegistry> & Pick<JsonSchemaTypeRegistry, 'type'>;
|
|
19
|
+
|
|
20
|
+
interface TypePresetPluginOptions {
|
|
21
|
+
types?: TypePresetRegistry[];
|
|
20
22
|
unregisterTypes?: string[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const createTypePresetPlugin: PluginCreator<TypePresetPluginOptions> =
|
|
26
|
+
definePluginCreator<TypePresetPluginOptions>({
|
|
27
|
+
onInit(ctx, opts) {
|
|
28
|
+
const typeManager = ctx.get(BaseTypeManager) as JsonSchemaTypeManager;
|
|
29
|
+
jsonSchemaTypePreset.forEach((_type) => typeManager.register(_type));
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
+
opts.types?.forEach((_type) => typeManager.register(_type));
|
|
32
|
+
opts.unregisterTypes?.forEach((_type) => typeManager.unregister(_type));
|
|
33
|
+
},
|
|
34
|
+
containerModules: [jsonSchemaContainerModule],
|
|
35
|
+
});
|
package/src/shared/index.ts
CHANGED
|
@@ -62,7 +62,7 @@ export function createInjectMaterial<Props>(
|
|
|
62
62
|
const container = usePlaygroundContainer();
|
|
63
63
|
|
|
64
64
|
// Check if renderer registry is bound in container
|
|
65
|
-
if (!container?.isBound(FlowRendererRegistry)) {
|
|
65
|
+
if (!container?.isBound?.(FlowRendererRegistry)) {
|
|
66
66
|
// If no registry, use default component directly
|
|
67
67
|
return React.createElement(Component as (props?: any) => any, { ...props });
|
|
68
68
|
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
UIOperator: ()=>UIOperator,
|
|
37
|
-
UIContainer: ()=>UIContainer,
|
|
38
|
-
UIRight: ()=>UIRight,
|
|
39
|
-
UIValues: ()=>UIValues,
|
|
40
|
-
UILeft: ()=>UILeft
|
|
41
|
-
});
|
|
42
|
-
const external_styled_components_namespaceObject = require("styled-components");
|
|
43
|
-
var external_styled_components_default = /*#__PURE__*/ __webpack_require__.n(external_styled_components_namespaceObject);
|
|
44
|
-
const UIContainer = external_styled_components_default().div`
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
gap: 4px;
|
|
48
|
-
`;
|
|
49
|
-
const UIOperator = external_styled_components_default().div``;
|
|
50
|
-
const UILeft = external_styled_components_default().div`
|
|
51
|
-
width: 100%;
|
|
52
|
-
`;
|
|
53
|
-
const UIRight = external_styled_components_default().div`
|
|
54
|
-
width: 100%;
|
|
55
|
-
`;
|
|
56
|
-
const UIValues = external_styled_components_default().div`
|
|
57
|
-
flex-grow: 1;
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
align-items: center;
|
|
61
|
-
gap: 4px;
|
|
62
|
-
`;
|
|
63
|
-
exports.UIContainer = __webpack_exports__.UIContainer;
|
|
64
|
-
exports.UILeft = __webpack_exports__.UILeft;
|
|
65
|
-
exports.UIOperator = __webpack_exports__.UIOperator;
|
|
66
|
-
exports.UIRight = __webpack_exports__.UIRight;
|
|
67
|
-
exports.UIValues = __webpack_exports__.UIValues;
|
|
68
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
69
|
-
"UIContainer",
|
|
70
|
-
"UILeft",
|
|
71
|
-
"UIOperator",
|
|
72
|
-
"UIRight",
|
|
73
|
-
"UIValues"
|
|
74
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
75
|
-
Object.defineProperty(exports, '__esModule', {
|
|
76
|
-
value: true
|
|
77
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
UIRootTitle: ()=>UIRootTitle,
|
|
37
|
-
UIPopoverContent: ()=>UIPopoverContent,
|
|
38
|
-
UIVarName: ()=>UIVarName,
|
|
39
|
-
UITag: ()=>UITag
|
|
40
|
-
});
|
|
41
|
-
const external_styled_components_namespaceObject = require("styled-components");
|
|
42
|
-
var external_styled_components_default = /*#__PURE__*/ __webpack_require__.n(external_styled_components_namespaceObject);
|
|
43
|
-
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
44
|
-
const UIRootTitle = external_styled_components_default().div`
|
|
45
|
-
margin-right: 4px;
|
|
46
|
-
min-width: 20px;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
text-overflow: ellipsis;
|
|
49
|
-
white-space: nowrap;
|
|
50
|
-
color: var(--semi-color-text-2);
|
|
51
|
-
`;
|
|
52
|
-
const UIVarName = external_styled_components_default().div`
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
`;
|
|
57
|
-
const UITag = external_styled_components_default()(semi_ui_namespaceObject.Tag)`
|
|
58
|
-
display: inline-flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: flex-start;
|
|
61
|
-
max-width: 300px;
|
|
62
|
-
|
|
63
|
-
& .semi-tag-content-center {
|
|
64
|
-
justify-content: flex-start;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&.semi-tag {
|
|
68
|
-
margin: 0 5px;
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
const UIPopoverContent = external_styled_components_default().div`
|
|
72
|
-
padding: 10px;
|
|
73
|
-
display: inline-flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
`;
|
|
77
|
-
exports.UIPopoverContent = __webpack_exports__.UIPopoverContent;
|
|
78
|
-
exports.UIRootTitle = __webpack_exports__.UIRootTitle;
|
|
79
|
-
exports.UITag = __webpack_exports__.UITag;
|
|
80
|
-
exports.UIVarName = __webpack_exports__.UIVarName;
|
|
81
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
82
|
-
"UIPopoverContent",
|
|
83
|
-
"UIRootTitle",
|
|
84
|
-
"UITag",
|
|
85
|
-
"UIVarName"
|
|
86
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
87
|
-
Object.defineProperty(exports, '__esModule', {
|
|
88
|
-
value: true
|
|
89
|
-
});
|