@uipath/apollo-wind 2.71.0 → 2.72.1
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/README.md +25 -0
- package/dist/components/ui/index.cjs +502 -308
- package/dist/components/ui/index.d.ts +4 -2
- package/dist/components/ui/index.js +5 -3
- package/dist/components/ui/prompt-editor/components/MarkdownPreview.cjs +4 -2
- package/dist/components/ui/prompt-editor/components/MarkdownPreview.js +4 -2
- package/dist/components/ui/prompt-editor/components/TokenPill.cjs +13 -68
- package/dist/components/ui/prompt-editor/components/TokenPill.js +14 -69
- package/dist/components/ui/prompt-editor/types.cjs +2 -14
- package/dist/components/ui/prompt-editor/types.d.ts +14 -1
- package/dist/components/ui/prompt-editor/types.js +2 -14
- package/dist/components/ui/reference-chip-colors.cjs +49 -0
- package/dist/components/ui/reference-chip-colors.d.ts +15 -0
- package/dist/components/ui/reference-chip-colors.js +15 -0
- package/dist/components/ui/reference-chip.cjs +104 -0
- package/dist/components/ui/reference-chip.d.ts +17 -0
- package/dist/components/ui/reference-chip.js +70 -0
- package/dist/components/ui/variable-value-control.cjs +5 -3
- package/dist/components/ui/variable-value-control.js +5 -3
- package/dist/index.cjs +10 -2
- package/dist/index.d.ts +7 -5
- package/dist/index.js +5 -3
- package/dist/styles.css +30 -2
- package/package.json +2 -2
|
@@ -54,6 +54,7 @@ export * from './message-scroller';
|
|
|
54
54
|
export * from './model-picker';
|
|
55
55
|
export * from './multi-select';
|
|
56
56
|
export * from './pagination';
|
|
57
|
+
export * from './panel-tabs';
|
|
57
58
|
export * from './popover';
|
|
58
59
|
export * from './portal-container';
|
|
59
60
|
export * from './progress';
|
|
@@ -62,13 +63,15 @@ export * from './prompt-suggestions';
|
|
|
62
63
|
export * from './prompt-value-control';
|
|
63
64
|
export * from './quick-form-field';
|
|
64
65
|
export * from './radio-group';
|
|
66
|
+
export { ReferenceChip, type ReferenceChipProps } from './reference-chip';
|
|
67
|
+
export { getReferenceChipColors } from './reference-chip-colors';
|
|
65
68
|
export * from './resizable';
|
|
66
69
|
export * from './scroll-area';
|
|
67
70
|
export * from './search';
|
|
68
71
|
export * from './select';
|
|
69
72
|
export * from './separator';
|
|
70
|
-
export * from './sidebar';
|
|
71
73
|
export * from './sheet';
|
|
74
|
+
export * from './sidebar';
|
|
72
75
|
export * from './skeleton';
|
|
73
76
|
export * from './slider';
|
|
74
77
|
export * from './sonner';
|
|
@@ -78,7 +81,6 @@ export * from './stats-card';
|
|
|
78
81
|
export * from './stepper';
|
|
79
82
|
export * from './switch';
|
|
80
83
|
export * from './table';
|
|
81
|
-
export * from './panel-tabs';
|
|
82
84
|
export * from './tabs';
|
|
83
85
|
export * from './textarea';
|
|
84
86
|
export * from './thinking-indicator';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReferenceChip } from "./reference-chip.js";
|
|
2
|
+
import { getReferenceChipColors } from "./reference-chip-colors.js";
|
|
1
3
|
import tree_view, { TreeView } from "./tree-view.js";
|
|
2
4
|
export * from "./accordion.js";
|
|
3
5
|
export * from "./alert.js";
|
|
@@ -55,6 +57,7 @@ export * from "./message-scroller/index.js";
|
|
|
55
57
|
export * from "./model-picker/index.js";
|
|
56
58
|
export * from "./multi-select.js";
|
|
57
59
|
export * from "./pagination.js";
|
|
60
|
+
export * from "./panel-tabs.js";
|
|
58
61
|
export * from "./popover.js";
|
|
59
62
|
export * from "./portal-container.js";
|
|
60
63
|
export * from "./progress.js";
|
|
@@ -68,8 +71,8 @@ export * from "./scroll-area.js";
|
|
|
68
71
|
export * from "./search.js";
|
|
69
72
|
export * from "./select.js";
|
|
70
73
|
export * from "./separator.js";
|
|
71
|
-
export * from "./sidebar/index.js";
|
|
72
74
|
export * from "./sheet.js";
|
|
75
|
+
export * from "./sidebar/index.js";
|
|
73
76
|
export * from "./skeleton.js";
|
|
74
77
|
export * from "./slider.js";
|
|
75
78
|
export * from "./sonner.js";
|
|
@@ -79,7 +82,6 @@ export * from "./stats-card.js";
|
|
|
79
82
|
export * from "./stepper.js";
|
|
80
83
|
export * from "./switch.js";
|
|
81
84
|
export * from "./table.js";
|
|
82
|
-
export * from "./panel-tabs.js";
|
|
83
85
|
export * from "./tabs.js";
|
|
84
86
|
export * from "./textarea.js";
|
|
85
87
|
export * from "./thinking-indicator.js";
|
|
@@ -89,4 +91,4 @@ export * from "./tool-call.js";
|
|
|
89
91
|
export * from "./tooltip.js";
|
|
90
92
|
export * from "./variable-picker/index.js";
|
|
91
93
|
export * from "./variable-value-control.js";
|
|
92
|
-
export { tree_view as FileTreeView, TreeView };
|
|
94
|
+
export { tree_view as FileTreeView, ReferenceChip, TreeView, getReferenceChipColors };
|
|
@@ -40,6 +40,7 @@ const external_dompurify_namespaceObject = require("dompurify");
|
|
|
40
40
|
var external_dompurify_default = /*#__PURE__*/ __webpack_require__.n(external_dompurify_namespaceObject);
|
|
41
41
|
const external_marked_namespaceObject = require("marked");
|
|
42
42
|
const external_react_namespaceObject = require("react");
|
|
43
|
+
const external_reference_chip_colors_cjs_namespaceObject = require("../../reference-chip-colors.cjs");
|
|
43
44
|
const external_prompt_editor_config_cjs_namespaceObject = require("../prompt-editor-config.cjs");
|
|
44
45
|
const external_token_icon_markup_cjs_namespaceObject = require("./token-icon-markup.cjs");
|
|
45
46
|
const marked = new external_marked_namespaceObject.Marked({
|
|
@@ -47,6 +48,7 @@ const marked = new external_marked_namespaceObject.Marked({
|
|
|
47
48
|
gfm: true,
|
|
48
49
|
breaks: true
|
|
49
50
|
});
|
|
51
|
+
const referenceColors = (0, external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors)().valid;
|
|
50
52
|
const MARKDOWN_PREVIEW_STYLES = `
|
|
51
53
|
.prompt-editor-preview { color: var(--color-foreground); }
|
|
52
54
|
.prompt-editor-preview-empty { color: var(--color-muted-foreground); }
|
|
@@ -73,8 +75,8 @@ const MARKDOWN_PREVIEW_STYLES = `
|
|
|
73
75
|
.prompt-editor-preview th { font-weight: 600; background-color: var(--color-muted); }
|
|
74
76
|
.prompt-editor-preview strong { font-weight: 700; }
|
|
75
77
|
.prompt-editor-preview em { font-style: italic; }
|
|
76
|
-
.prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background:
|
|
77
|
-
.prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color:
|
|
78
|
+
.prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: ${referenceColors.background}; color: ${referenceColors.text}; }
|
|
79
|
+
.prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: ${referenceColors.icon}; width: 14px; height: 14px; }
|
|
78
80
|
`;
|
|
79
81
|
const PURIFY_CONFIG = {
|
|
80
82
|
ALLOWED_TAGS: [
|
|
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import dompurify from "dompurify";
|
|
3
3
|
import { Marked } from "marked";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
+
import { getReferenceChipColors } from "../../reference-chip-colors.js";
|
|
5
6
|
import { usePromptEditorConfig } from "../prompt-editor-config.js";
|
|
6
7
|
import { buildTokenIconSvgMarkup } from "./token-icon-markup.js";
|
|
7
8
|
const marked = new Marked({
|
|
@@ -9,6 +10,7 @@ const marked = new Marked({
|
|
|
9
10
|
gfm: true,
|
|
10
11
|
breaks: true
|
|
11
12
|
});
|
|
13
|
+
const referenceColors = getReferenceChipColors().valid;
|
|
12
14
|
const MARKDOWN_PREVIEW_STYLES = `
|
|
13
15
|
.prompt-editor-preview { color: var(--color-foreground); }
|
|
14
16
|
.prompt-editor-preview-empty { color: var(--color-muted-foreground); }
|
|
@@ -35,8 +37,8 @@ const MARKDOWN_PREVIEW_STYLES = `
|
|
|
35
37
|
.prompt-editor-preview th { font-weight: 600; background-color: var(--color-muted); }
|
|
36
38
|
.prompt-editor-preview strong { font-weight: 700; }
|
|
37
39
|
.prompt-editor-preview em { font-style: italic; }
|
|
38
|
-
.prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background:
|
|
39
|
-
.prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color:
|
|
40
|
+
.prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: ${referenceColors.background}; color: ${referenceColors.text}; }
|
|
41
|
+
.prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: ${referenceColors.icon}; width: 14px; height: 14px; }
|
|
40
42
|
`;
|
|
41
43
|
const PURIFY_CONFIG = {
|
|
42
44
|
ALLOWED_TAGS: [
|
|
@@ -29,8 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_reference_chip_cjs_namespaceObject = require("../../reference-chip.cjs");
|
|
32
33
|
const external_prompt_editor_config_cjs_namespaceObject = require("../prompt-editor-config.cjs");
|
|
33
|
-
const external_types_cjs_namespaceObject = require("../types.cjs");
|
|
34
34
|
const TOKEN_TYPE_ICON = {
|
|
35
35
|
input: external_lucide_react_namespaceObject.Variable,
|
|
36
36
|
output: external_lucide_react_namespaceObject.SquareFunction,
|
|
@@ -40,75 +40,20 @@ const TOKEN_TYPE_ICON = {
|
|
|
40
40
|
};
|
|
41
41
|
const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInvalid, isSelected, onMouseDown })=>{
|
|
42
42
|
const { strings } = (0, external_prompt_editor_config_cjs_namespaceObject.usePromptEditorConfig)();
|
|
43
|
-
const PROMPT_EDITOR_TOKEN_COLORS = (0, external_types_cjs_namespaceObject.getPromptEditorTokenColors)();
|
|
44
|
-
const colors = isInvalid && !diffType ? PROMPT_EDITOR_TOKEN_COLORS.invalid : PROMPT_EDITOR_TOKEN_COLORS.valid;
|
|
45
43
|
const Icon = TOKEN_TYPE_ICON[tokenType];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
const bgColor = diffType ? 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)' : colors.background;
|
|
56
|
-
const outerClassName = [
|
|
57
|
-
'relative inline-flex items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1',
|
|
58
|
-
readonly ? 'cursor-default' : 'cursor-pointer',
|
|
59
|
-
'removed' === diffType ? 'line-through opacity-60' : '',
|
|
60
|
-
isSelected ? 'z-10' : ''
|
|
61
|
-
].filter(Boolean).join(' ');
|
|
62
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_reference_chip_cjs_namespaceObject.ReferenceChip, {
|
|
45
|
+
label: value,
|
|
46
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {}),
|
|
47
|
+
onRemove: onRemove,
|
|
48
|
+
removeLabel: strings.removeToken,
|
|
49
|
+
readOnly: readonly,
|
|
50
|
+
invalid: isInvalid && !diffType,
|
|
51
|
+
selected: isSelected,
|
|
63
52
|
onMouseDown: onMouseDown,
|
|
64
|
-
className:
|
|
65
|
-
style: {
|
|
66
|
-
backgroundColor:
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
children: [
|
|
70
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
71
|
-
className: "inline-flex shrink-0",
|
|
72
|
-
style: {
|
|
73
|
-
color: colors.icon
|
|
74
|
-
},
|
|
75
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
|
|
76
|
-
className: "h-3.5 w-3.5"
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
80
|
-
className: "font-normal whitespace-nowrap",
|
|
81
|
-
style: {
|
|
82
|
-
color: colors.text,
|
|
83
|
-
fontFamily: "'Noto Sans', sans-serif"
|
|
84
|
-
},
|
|
85
|
-
children: value
|
|
86
|
-
}),
|
|
87
|
-
!readonly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
88
|
-
type: "button",
|
|
89
|
-
"aria-label": strings.removeToken,
|
|
90
|
-
className: "inline-flex items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4",
|
|
91
|
-
style: {
|
|
92
|
-
color: colors.text
|
|
93
|
-
},
|
|
94
|
-
onMouseDown: handleRemoveMouseDown,
|
|
95
|
-
onClick: handleRemoveClick,
|
|
96
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
97
|
-
width: "12",
|
|
98
|
-
height: "12",
|
|
99
|
-
viewBox: "0 0 24 24",
|
|
100
|
-
fill: "none",
|
|
101
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
102
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
103
|
-
d: "M18 6L6 18M6 6L18 18",
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
strokeWidth: "2",
|
|
106
|
-
strokeLinecap: "round",
|
|
107
|
-
strokeLinejoin: "round"
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
]
|
|
53
|
+
className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
|
|
54
|
+
style: diffType ? {
|
|
55
|
+
backgroundColor: 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)'
|
|
56
|
+
} : void 0
|
|
112
57
|
});
|
|
113
58
|
};
|
|
114
59
|
const TokenPill = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(TokenPillBase);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Database, Paperclip, SquareFunction, Variable } from "lucide-react";
|
|
3
3
|
import { memo } from "react";
|
|
4
|
+
import { ReferenceChip } from "../../reference-chip.js";
|
|
4
5
|
import { usePromptEditorConfig } from "../prompt-editor-config.js";
|
|
5
|
-
import { getPromptEditorTokenColors } from "../types.js";
|
|
6
6
|
const TOKEN_TYPE_ICON = {
|
|
7
7
|
input: Variable,
|
|
8
8
|
output: SquareFunction,
|
|
@@ -12,75 +12,20 @@ const TOKEN_TYPE_ICON = {
|
|
|
12
12
|
};
|
|
13
13
|
const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInvalid, isSelected, onMouseDown })=>{
|
|
14
14
|
const { strings } = usePromptEditorConfig();
|
|
15
|
-
const PROMPT_EDITOR_TOKEN_COLORS = getPromptEditorTokenColors();
|
|
16
|
-
const colors = isInvalid && !diffType ? PROMPT_EDITOR_TOKEN_COLORS.invalid : PROMPT_EDITOR_TOKEN_COLORS.valid;
|
|
17
15
|
const Icon = TOKEN_TYPE_ICON[tokenType];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
const bgColor = diffType ? 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)' : colors.background;
|
|
28
|
-
const outerClassName = [
|
|
29
|
-
'relative inline-flex items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1',
|
|
30
|
-
readonly ? 'cursor-default' : 'cursor-pointer',
|
|
31
|
-
'removed' === diffType ? 'line-through opacity-60' : '',
|
|
32
|
-
isSelected ? 'z-10' : ''
|
|
33
|
-
].filter(Boolean).join(' ');
|
|
34
|
-
return /*#__PURE__*/ jsxs("span", {
|
|
16
|
+
return /*#__PURE__*/ jsx(ReferenceChip, {
|
|
17
|
+
label: value,
|
|
18
|
+
icon: /*#__PURE__*/ jsx(Icon, {}),
|
|
19
|
+
onRemove: onRemove,
|
|
20
|
+
removeLabel: strings.removeToken,
|
|
21
|
+
readOnly: readonly,
|
|
22
|
+
invalid: isInvalid && !diffType,
|
|
23
|
+
selected: isSelected,
|
|
35
24
|
onMouseDown: onMouseDown,
|
|
36
|
-
className:
|
|
37
|
-
style: {
|
|
38
|
-
backgroundColor:
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ jsx("span", {
|
|
43
|
-
className: "inline-flex shrink-0",
|
|
44
|
-
style: {
|
|
45
|
-
color: colors.icon
|
|
46
|
-
},
|
|
47
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
48
|
-
className: "h-3.5 w-3.5"
|
|
49
|
-
})
|
|
50
|
-
}),
|
|
51
|
-
/*#__PURE__*/ jsx("span", {
|
|
52
|
-
className: "font-normal whitespace-nowrap",
|
|
53
|
-
style: {
|
|
54
|
-
color: colors.text,
|
|
55
|
-
fontFamily: "'Noto Sans', sans-serif"
|
|
56
|
-
},
|
|
57
|
-
children: value
|
|
58
|
-
}),
|
|
59
|
-
!readonly && /*#__PURE__*/ jsx("button", {
|
|
60
|
-
type: "button",
|
|
61
|
-
"aria-label": strings.removeToken,
|
|
62
|
-
className: "inline-flex items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4",
|
|
63
|
-
style: {
|
|
64
|
-
color: colors.text
|
|
65
|
-
},
|
|
66
|
-
onMouseDown: handleRemoveMouseDown,
|
|
67
|
-
onClick: handleRemoveClick,
|
|
68
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
69
|
-
width: "12",
|
|
70
|
-
height: "12",
|
|
71
|
-
viewBox: "0 0 24 24",
|
|
72
|
-
fill: "none",
|
|
73
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
75
|
-
d: "M18 6L6 18M6 6L18 18",
|
|
76
|
-
stroke: "currentColor",
|
|
77
|
-
strokeWidth: "2",
|
|
78
|
-
strokeLinecap: "round",
|
|
79
|
-
strokeLinejoin: "round"
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
]
|
|
25
|
+
className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
|
|
26
|
+
style: diffType ? {
|
|
27
|
+
backgroundColor: 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)'
|
|
28
|
+
} : void 0
|
|
84
29
|
});
|
|
85
30
|
};
|
|
86
31
|
const TokenPill = /*#__PURE__*/ memo(TokenPillBase);
|
|
@@ -29,20 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
isPromptEditorNonTextToken: ()=>isPromptEditorNonTextToken,
|
|
30
30
|
isPromptEditorTextToken: ()=>isPromptEditorTextToken
|
|
31
31
|
});
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
background: 'var(--color-info-background)',
|
|
35
|
-
border: 'var(--color-info-icon)',
|
|
36
|
-
text: 'var(--color-info-text)',
|
|
37
|
-
icon: 'var(--color-info-icon)'
|
|
38
|
-
},
|
|
39
|
-
invalid: {
|
|
40
|
-
background: 'var(--color-error-background)',
|
|
41
|
-
border: 'var(--color-error-icon)',
|
|
42
|
-
text: 'var(--color-error-text)',
|
|
43
|
-
icon: 'var(--color-error-icon)'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
32
|
+
const external_reference_chip_colors_cjs_namespaceObject = require("../reference-chip-colors.cjs");
|
|
33
|
+
const getPromptEditorTokenColors = external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors;
|
|
46
34
|
const getPromptEditorTokenTypeLabel = (type, labels)=>{
|
|
47
35
|
switch(type){
|
|
48
36
|
case 'input':
|
|
@@ -63,7 +63,20 @@ export interface PromptEditorTokenColorConfig {
|
|
|
63
63
|
* Two-state palette: invalid = red, valid = blue. Backed by apollo-wind's semantic design tokens,
|
|
64
64
|
* which already resolve per light/dark theme via CSS — no JS theme detection needed.
|
|
65
65
|
*/
|
|
66
|
-
export declare const getPromptEditorTokenColors: () =>
|
|
66
|
+
export declare const getPromptEditorTokenColors: () => {
|
|
67
|
+
valid: {
|
|
68
|
+
background: string;
|
|
69
|
+
border: string;
|
|
70
|
+
text: string;
|
|
71
|
+
icon: string;
|
|
72
|
+
};
|
|
73
|
+
invalid: {
|
|
74
|
+
background: string;
|
|
75
|
+
border: string;
|
|
76
|
+
text: string;
|
|
77
|
+
icon: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
67
80
|
/** The token-type label subset of `PromptEditorStrings` (structural, to avoid a config↔types cycle). */
|
|
68
81
|
export interface PromptEditorTokenTypeLabels {
|
|
69
82
|
tokenTypeInput: string;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
background: 'var(--color-info-background)',
|
|
4
|
-
border: 'var(--color-info-icon)',
|
|
5
|
-
text: 'var(--color-info-text)',
|
|
6
|
-
icon: 'var(--color-info-icon)'
|
|
7
|
-
},
|
|
8
|
-
invalid: {
|
|
9
|
-
background: 'var(--color-error-background)',
|
|
10
|
-
border: 'var(--color-error-icon)',
|
|
11
|
-
text: 'var(--color-error-text)',
|
|
12
|
-
icon: 'var(--color-error-icon)'
|
|
13
|
-
}
|
|
14
|
-
});
|
|
1
|
+
import { getReferenceChipColors } from "../reference-chip-colors.js";
|
|
2
|
+
const getPromptEditorTokenColors = getReferenceChipColors;
|
|
15
3
|
const getPromptEditorTokenTypeLabel = (type, labels)=>{
|
|
16
4
|
switch(type){
|
|
17
5
|
case 'input':
|
|
@@ -0,0 +1,49 @@
|
|
|
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 ("u" > 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
|
+
getReferenceChipColors: ()=>getReferenceChipColors
|
|
28
|
+
});
|
|
29
|
+
const getReferenceChipColors = ()=>({
|
|
30
|
+
valid: {
|
|
31
|
+
background: 'var(--color-info-background)',
|
|
32
|
+
border: 'var(--color-info-icon)',
|
|
33
|
+
text: 'var(--color-info-text)',
|
|
34
|
+
icon: 'var(--color-info-icon)'
|
|
35
|
+
},
|
|
36
|
+
invalid: {
|
|
37
|
+
background: 'var(--color-error-background)',
|
|
38
|
+
border: 'var(--color-error-icon)',
|
|
39
|
+
text: 'var(--color-error-text)',
|
|
40
|
+
icon: 'var(--color-error-icon)'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.getReferenceChipColors = __webpack_exports__.getReferenceChipColors;
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
|
+
"getReferenceChipColors"
|
|
46
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
47
|
+
Object.defineProperty(exports, '__esModule', {
|
|
48
|
+
value: true
|
|
49
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Paired reference colors. Keep labels, icons and backgrounds on the same semantic palette. */
|
|
2
|
+
export declare const getReferenceChipColors: () => {
|
|
3
|
+
valid: {
|
|
4
|
+
background: string;
|
|
5
|
+
border: string;
|
|
6
|
+
text: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
};
|
|
9
|
+
invalid: {
|
|
10
|
+
background: string;
|
|
11
|
+
border: string;
|
|
12
|
+
text: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const getReferenceChipColors = ()=>({
|
|
2
|
+
valid: {
|
|
3
|
+
background: 'var(--color-info-background)',
|
|
4
|
+
border: 'var(--color-info-icon)',
|
|
5
|
+
text: 'var(--color-info-text)',
|
|
6
|
+
icon: 'var(--color-info-icon)'
|
|
7
|
+
},
|
|
8
|
+
invalid: {
|
|
9
|
+
background: 'var(--color-error-background)',
|
|
10
|
+
border: 'var(--color-error-icon)',
|
|
11
|
+
text: 'var(--color-error-text)',
|
|
12
|
+
icon: 'var(--color-error-icon)'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { getReferenceChipColors };
|
|
@@ -0,0 +1,104 @@
|
|
|
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 ("u" > 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
|
+
ReferenceChip: ()=>ReferenceChip
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
32
|
+
const external_reference_chip_colors_cjs_namespaceObject = require("./reference-chip-colors.cjs");
|
|
33
|
+
const ReferenceChip = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ label, icon, onRemove, removeLabel, readOnly = false, disabled = false, invalid = false, selected = false, className, style, ...props }, ref)=>{
|
|
34
|
+
const colors = (0, external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors)()[invalid ? 'invalid' : 'valid'];
|
|
35
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
36
|
+
...props,
|
|
37
|
+
ref: ref,
|
|
38
|
+
"data-slot": "reference-chip",
|
|
39
|
+
"data-invalid": invalid || void 0,
|
|
40
|
+
"data-selected": selected || void 0,
|
|
41
|
+
"aria-disabled": disabled || void 0,
|
|
42
|
+
className: (0, index_cjs_namespaceObject.cn)('relative inline-flex max-w-full min-w-0 items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1', selected && 'z-10', disabled && 'opacity-50', className),
|
|
43
|
+
style: {
|
|
44
|
+
backgroundColor: colors.background,
|
|
45
|
+
color: colors.text,
|
|
46
|
+
outline: selected ? `2px solid ${colors.border}` : void 0,
|
|
47
|
+
...style
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
className: "inline-flex shrink-0 [&_svg]:size-3.5 [&_img]:size-3.5",
|
|
53
|
+
style: {
|
|
54
|
+
color: colors.icon
|
|
55
|
+
},
|
|
56
|
+
children: icon
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
59
|
+
className: "min-w-0 truncate font-normal",
|
|
60
|
+
style: {
|
|
61
|
+
fontFamily: "'Noto Sans', sans-serif"
|
|
62
|
+
},
|
|
63
|
+
children: label
|
|
64
|
+
}),
|
|
65
|
+
onRemove && !readOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
"aria-label": removeLabel ?? `Remove ${label}`,
|
|
69
|
+
className: "inline-flex shrink-0 items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4 text-inherit focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current disabled:cursor-default",
|
|
70
|
+
onMouseDown: (event)=>{
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
},
|
|
74
|
+
onClick: (event)=>{
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
onRemove();
|
|
78
|
+
},
|
|
79
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
width: "12",
|
|
82
|
+
height: "12",
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
fill: "none",
|
|
85
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
86
|
+
d: "M18 6L6 18M6 6L18 18",
|
|
87
|
+
stroke: "currentColor",
|
|
88
|
+
strokeWidth: "2",
|
|
89
|
+
strokeLinecap: "round",
|
|
90
|
+
strokeLinejoin: "round"
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
ReferenceChip.displayName = 'ReferenceChip';
|
|
98
|
+
exports.ReferenceChip = __webpack_exports__.ReferenceChip;
|
|
99
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
100
|
+
"ReferenceChip"
|
|
101
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
102
|
+
Object.defineProperty(exports, '__esModule', {
|
|
103
|
+
value: true
|
|
104
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface ReferenceChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
3
|
+
/** Display name of the referenced variable, resource or connection. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Decorative icon. Branded icons may preserve their original colors. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
onRemove?: () => void;
|
|
8
|
+
/** Localized accessible name for the remove button. */
|
|
9
|
+
removeLabel?: string;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
/** Visual selection only. The containing editor or picker owns selection semantics. */
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Shared visual primitive. Picker behavior and editor selection remain with the host. */
|
|
17
|
+
export declare const ReferenceChip: import("react").ForwardRefExoticComponent<ReferenceChipProps & import("react").RefAttributes<HTMLSpanElement>>;
|