@uipath/apollo-react 7.6.1 → 7.8.0
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/canvas/components/Guardrails/components/guardrail-action-section.cjs +2 -2
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts +2 -1
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.js +2 -2
- package/dist/canvas/components/Guardrails/guardrail-builder.cjs +2 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts +2 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.js +2 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/locales/en.cjs +1 -1
- package/dist/chat/locales/en.d.ts.map +1 -1
- package/dist/chat/locales/en.js +1 -1
- package/dist/chat/stories/chat-story-fixtures.d.ts +1 -1
- package/dist/chat/stories/chat-story-fixtures.d.ts.map +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/chat/wind/composer/chat-composer.cjs +1 -3
- package/dist/chat/wind/composer/chat-composer.d.ts.map +1 -1
- package/dist/chat/wind/composer/chat-composer.js +2 -4
- package/dist/chat/wind/composer/chat-dropzone.cjs +29 -25
- package/dist/chat/wind/composer/chat-dropzone.d.ts +1 -1
- package/dist/chat/wind/composer/chat-dropzone.d.ts.map +1 -1
- package/dist/chat/wind/composer/chat-dropzone.js +20 -26
- package/dist/chat/wind/history/chat-history.d.ts.map +1 -1
- package/dist/chat/wind/history/history-panel.cjs +18 -7
- package/dist/chat/wind/history/history-panel.d.ts.map +1 -1
- package/dist/chat/wind/history/history-panel.js +19 -8
- package/dist/chat/wind/layout/full-screen-layout.cjs +0 -6
- package/dist/chat/wind/layout/full-screen-layout.d.ts.map +1 -1
- package/dist/chat/wind/layout/full-screen-layout.js +0 -6
- package/dist/chat/wind/layout/regions.cjs +1 -1
- package/dist/chat/wind/layout/regions.js +1 -1
- package/dist/chat/wind/messages/message-attachments.cjs +3 -20
- package/dist/chat/wind/messages/message-attachments.d.ts +0 -4
- package/dist/chat/wind/messages/message-attachments.d.ts.map +1 -1
- package/dist/chat/wind/messages/message-attachments.js +2 -10
- package/dist/chat/wind/messages/message-list.cjs +4 -0
- package/dist/chat/wind/messages/message-list.d.ts.map +1 -1
- package/dist/chat/wind/messages/message-list.js +4 -0
- package/dist/chat/wind/renderers/chat-code-block.cjs +169 -0
- package/dist/chat/wind/renderers/chat-code-block.d.ts +10 -0
- package/dist/chat/wind/renderers/chat-code-block.d.ts.map +1 -0
- package/dist/chat/wind/renderers/chat-code-block.js +125 -0
- package/dist/chat/wind/renderers/markdown-renderer.cjs +4 -3
- package/dist/chat/wind/renderers/markdown-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/markdown-renderer.js +4 -3
- package/dist/chat/wind/renderers/tool-call-renderer.cjs +13 -17
- package/dist/chat/wind/renderers/tool-call-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/tool-call-renderer.js +13 -17
- package/dist/chat/wind/renderers/tree-renderer.cjs +14 -9
- package/dist/chat/wind/renderers/tree-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/tree-renderer.js +13 -8
- package/package.json +3 -3
- package/dist/chat/wind/renderers/code-block-actions.cjs +0 -176
- package/dist/chat/wind/renderers/code-block-actions.d.ts +0 -9
- package/dist/chat/wind/renderers/code-block-actions.d.ts.map +0 -1
- package/dist/chat/wind/renderers/code-block-actions.js +0 -132
- package/dist/chat/wind/renderers/disclosure-tree.cjs +0 -136
- package/dist/chat/wind/renderers/disclosure-tree.d.ts +0 -22
- package/dist/chat/wind/renderers/disclosure-tree.d.ts.map +0 -1
- package/dist/chat/wind/renderers/disclosure-tree.js +0 -92
|
@@ -1,176 +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 ("u" > 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
|
-
CodeBlockActions: ()=>CodeBlockActions
|
|
37
|
-
});
|
|
38
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
-
const react_namespaceObject = require("@lingui/react");
|
|
40
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
41
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
42
|
-
const external_react_namespaceObject = require("react");
|
|
43
|
-
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
44
|
-
const html_preview_cjs_namespaceObject = require("../../headless/markdown/html-preview.cjs");
|
|
45
|
-
const dialog_container_cjs_namespaceObject = require("../common/dialog-container.cjs");
|
|
46
|
-
const PREVIEW_CSP = "default-src 'none'; img-src data: https:; font-src data: https:; style-src 'unsafe-inline'; script-src 'unsafe-inline'";
|
|
47
|
-
function CodeBlockActions({ block, htmlPreview, streaming }) {
|
|
48
|
-
const { _ } = (0, react_namespaceObject.useLingui)();
|
|
49
|
-
const [view, setView] = external_react_default().useState(null);
|
|
50
|
-
const dialogContainer = (0, dialog_container_cjs_namespaceObject.useDialogContainer)();
|
|
51
|
-
const opener = external_react_default().useRef(null);
|
|
52
|
-
const openAs = (next)=>(event)=>{
|
|
53
|
-
opener.current = event.currentTarget;
|
|
54
|
-
setView(next);
|
|
55
|
-
};
|
|
56
|
-
const previewable = htmlPreview && block.language?.trim().toLowerCase() === 'html';
|
|
57
|
-
const showPreview = 'preview' === view && previewable && !streaming;
|
|
58
|
-
const codeLabel = _({
|
|
59
|
-
id: 'autopilot-chat.message.code-block-code'
|
|
60
|
-
});
|
|
61
|
-
const previewLabel = _({
|
|
62
|
-
id: 'autopilot-chat.message.code-block-preview'
|
|
63
|
-
});
|
|
64
|
-
const previewTitle = _({
|
|
65
|
-
id: 'autopilot-chat.message.html-preview'
|
|
66
|
-
});
|
|
67
|
-
const expandLabel = _({
|
|
68
|
-
id: 'autopilot-chat.message.expand'
|
|
69
|
-
});
|
|
70
|
-
const closeLabel = _({
|
|
71
|
-
id: 'autopilot-chat.message.dialog-close'
|
|
72
|
-
});
|
|
73
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
74
|
-
children: [
|
|
75
|
-
previewable && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
76
|
-
variant: "ghost",
|
|
77
|
-
size: "2xs",
|
|
78
|
-
icon: true,
|
|
79
|
-
"aria-label": previewLabel,
|
|
80
|
-
title: previewLabel,
|
|
81
|
-
disabled: streaming,
|
|
82
|
-
onClick: openAs('preview'),
|
|
83
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Eye, {
|
|
84
|
-
"aria-hidden": true
|
|
85
|
-
})
|
|
86
|
-
}),
|
|
87
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
88
|
-
variant: "ghost",
|
|
89
|
-
size: "2xs",
|
|
90
|
-
icon: true,
|
|
91
|
-
"aria-label": expandLabel,
|
|
92
|
-
title: expandLabel,
|
|
93
|
-
onClick: openAs('code'),
|
|
94
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Maximize2, {
|
|
95
|
-
"aria-hidden": true
|
|
96
|
-
})
|
|
97
|
-
}),
|
|
98
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Dialog, {
|
|
99
|
-
open: null !== view,
|
|
100
|
-
onOpenChange: (open)=>!open && setView(null),
|
|
101
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DialogContent, {
|
|
102
|
-
container: dialogContainer,
|
|
103
|
-
onCloseAutoFocus: (event)=>{
|
|
104
|
-
event.preventDefault();
|
|
105
|
-
opener.current?.focus();
|
|
106
|
-
},
|
|
107
|
-
showCloseButton: false,
|
|
108
|
-
"aria-describedby": void 0,
|
|
109
|
-
className: "flex h-[90vh] max-h-[900px] w-[95vw] max-w-[1400px] flex-col gap-3 p-4 sm:max-w-[1400px]",
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
112
|
-
className: "flex items-center gap-2",
|
|
113
|
-
children: [
|
|
114
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DialogTitle, {
|
|
115
|
-
className: "min-w-0 flex-1 truncate text-sm",
|
|
116
|
-
children: showPreview ? previewTitle : block.language?.trim() || codeLabel
|
|
117
|
-
}),
|
|
118
|
-
previewable && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
119
|
-
variant: "ghost",
|
|
120
|
-
size: "2xs",
|
|
121
|
-
icon: true,
|
|
122
|
-
"aria-label": showPreview ? codeLabel : previewLabel,
|
|
123
|
-
title: showPreview ? codeLabel : previewLabel,
|
|
124
|
-
disabled: streaming,
|
|
125
|
-
onClick: ()=>setView(showPreview ? 'code' : 'preview'),
|
|
126
|
-
children: showPreview ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Code, {
|
|
127
|
-
"aria-hidden": true
|
|
128
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Eye, {
|
|
129
|
-
"aria-hidden": true
|
|
130
|
-
})
|
|
131
|
-
}),
|
|
132
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DialogClose, {
|
|
133
|
-
asChild: true,
|
|
134
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
135
|
-
variant: "ghost",
|
|
136
|
-
size: "2xs",
|
|
137
|
-
icon: true,
|
|
138
|
-
"aria-label": closeLabel,
|
|
139
|
-
title: closeLabel,
|
|
140
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
141
|
-
"aria-hidden": true
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
})
|
|
145
|
-
]
|
|
146
|
-
}),
|
|
147
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
148
|
-
className: "min-h-0 flex-1 overflow-auto",
|
|
149
|
-
children: showPreview ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("iframe", {
|
|
150
|
-
"data-slot": "wind-chat-html-preview",
|
|
151
|
-
sandbox: "allow-scripts",
|
|
152
|
-
srcDoc: (0, html_preview_cjs_namespaceObject.buildHtmlPreviewDocument)(block.code, {
|
|
153
|
-
contentSecurityPolicy: PREVIEW_CSP
|
|
154
|
-
}),
|
|
155
|
-
title: previewTitle,
|
|
156
|
-
className: "size-full rounded-lg border border-border-subtle bg-white"
|
|
157
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.CodeBlock, {
|
|
158
|
-
code: block.code,
|
|
159
|
-
language: block.language,
|
|
160
|
-
wrap: true,
|
|
161
|
-
hideHeader: true
|
|
162
|
-
})
|
|
163
|
-
})
|
|
164
|
-
]
|
|
165
|
-
})
|
|
166
|
-
})
|
|
167
|
-
]
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
exports.CodeBlockActions = __webpack_exports__.CodeBlockActions;
|
|
171
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
172
|
-
"CodeBlockActions"
|
|
173
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
174
|
-
Object.defineProperty(exports, '__esModule', {
|
|
175
|
-
value: true
|
|
176
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type MarkdownCodeBlock } from '@uipath/apollo-wind';
|
|
2
|
-
interface CodeBlockActionsProps {
|
|
3
|
-
block: MarkdownCodeBlock;
|
|
4
|
-
htmlPreview: boolean;
|
|
5
|
-
streaming: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function CodeBlockActions({ block, htmlPreview, streaming }: CodeBlockActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=code-block-actions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-block-actions.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/renderers/code-block-actions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAc7B,UAAU,qBAAqB;IAC7B,KAAK,EAAE,iBAAiB,CAAC;IAEzB,WAAW,EAAE,OAAO,CAAC;IAErB,SAAS,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,qBAAqB,2CAsGxF"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLingui } from "@lingui/react";
|
|
3
|
-
import { Button, CodeBlock, Dialog, DialogClose, DialogContent, DialogTitle } from "@uipath/apollo-wind";
|
|
4
|
-
import { Code, Eye, Maximize2, X } from "lucide-react";
|
|
5
|
-
import react from "react";
|
|
6
|
-
import { buildHtmlPreviewDocument } from "../../headless/markdown/html-preview.js";
|
|
7
|
-
import { useDialogContainer } from "../common/dialog-container.js";
|
|
8
|
-
const PREVIEW_CSP = "default-src 'none'; img-src data: https:; font-src data: https:; style-src 'unsafe-inline'; script-src 'unsafe-inline'";
|
|
9
|
-
function CodeBlockActions({ block, htmlPreview, streaming }) {
|
|
10
|
-
const { _ } = useLingui();
|
|
11
|
-
const [view, setView] = react.useState(null);
|
|
12
|
-
const dialogContainer = useDialogContainer();
|
|
13
|
-
const opener = react.useRef(null);
|
|
14
|
-
const openAs = (next)=>(event)=>{
|
|
15
|
-
opener.current = event.currentTarget;
|
|
16
|
-
setView(next);
|
|
17
|
-
};
|
|
18
|
-
const previewable = htmlPreview && block.language?.trim().toLowerCase() === 'html';
|
|
19
|
-
const showPreview = 'preview' === view && previewable && !streaming;
|
|
20
|
-
const codeLabel = _({
|
|
21
|
-
id: 'autopilot-chat.message.code-block-code'
|
|
22
|
-
});
|
|
23
|
-
const previewLabel = _({
|
|
24
|
-
id: 'autopilot-chat.message.code-block-preview'
|
|
25
|
-
});
|
|
26
|
-
const previewTitle = _({
|
|
27
|
-
id: 'autopilot-chat.message.html-preview'
|
|
28
|
-
});
|
|
29
|
-
const expandLabel = _({
|
|
30
|
-
id: 'autopilot-chat.message.expand'
|
|
31
|
-
});
|
|
32
|
-
const closeLabel = _({
|
|
33
|
-
id: 'autopilot-chat.message.dialog-close'
|
|
34
|
-
});
|
|
35
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
36
|
-
children: [
|
|
37
|
-
previewable && /*#__PURE__*/ jsx(Button, {
|
|
38
|
-
variant: "ghost",
|
|
39
|
-
size: "2xs",
|
|
40
|
-
icon: true,
|
|
41
|
-
"aria-label": previewLabel,
|
|
42
|
-
title: previewLabel,
|
|
43
|
-
disabled: streaming,
|
|
44
|
-
onClick: openAs('preview'),
|
|
45
|
-
children: /*#__PURE__*/ jsx(Eye, {
|
|
46
|
-
"aria-hidden": true
|
|
47
|
-
})
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ jsx(Button, {
|
|
50
|
-
variant: "ghost",
|
|
51
|
-
size: "2xs",
|
|
52
|
-
icon: true,
|
|
53
|
-
"aria-label": expandLabel,
|
|
54
|
-
title: expandLabel,
|
|
55
|
-
onClick: openAs('code'),
|
|
56
|
-
children: /*#__PURE__*/ jsx(Maximize2, {
|
|
57
|
-
"aria-hidden": true
|
|
58
|
-
})
|
|
59
|
-
}),
|
|
60
|
-
/*#__PURE__*/ jsx(Dialog, {
|
|
61
|
-
open: null !== view,
|
|
62
|
-
onOpenChange: (open)=>!open && setView(null),
|
|
63
|
-
children: /*#__PURE__*/ jsxs(DialogContent, {
|
|
64
|
-
container: dialogContainer,
|
|
65
|
-
onCloseAutoFocus: (event)=>{
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
opener.current?.focus();
|
|
68
|
-
},
|
|
69
|
-
showCloseButton: false,
|
|
70
|
-
"aria-describedby": void 0,
|
|
71
|
-
className: "flex h-[90vh] max-h-[900px] w-[95vw] max-w-[1400px] flex-col gap-3 p-4 sm:max-w-[1400px]",
|
|
72
|
-
children: [
|
|
73
|
-
/*#__PURE__*/ jsxs("div", {
|
|
74
|
-
className: "flex items-center gap-2",
|
|
75
|
-
children: [
|
|
76
|
-
/*#__PURE__*/ jsx(DialogTitle, {
|
|
77
|
-
className: "min-w-0 flex-1 truncate text-sm",
|
|
78
|
-
children: showPreview ? previewTitle : block.language?.trim() || codeLabel
|
|
79
|
-
}),
|
|
80
|
-
previewable && /*#__PURE__*/ jsx(Button, {
|
|
81
|
-
variant: "ghost",
|
|
82
|
-
size: "2xs",
|
|
83
|
-
icon: true,
|
|
84
|
-
"aria-label": showPreview ? codeLabel : previewLabel,
|
|
85
|
-
title: showPreview ? codeLabel : previewLabel,
|
|
86
|
-
disabled: streaming,
|
|
87
|
-
onClick: ()=>setView(showPreview ? 'code' : 'preview'),
|
|
88
|
-
children: showPreview ? /*#__PURE__*/ jsx(Code, {
|
|
89
|
-
"aria-hidden": true
|
|
90
|
-
}) : /*#__PURE__*/ jsx(Eye, {
|
|
91
|
-
"aria-hidden": true
|
|
92
|
-
})
|
|
93
|
-
}),
|
|
94
|
-
/*#__PURE__*/ jsx(DialogClose, {
|
|
95
|
-
asChild: true,
|
|
96
|
-
children: /*#__PURE__*/ jsx(Button, {
|
|
97
|
-
variant: "ghost",
|
|
98
|
-
size: "2xs",
|
|
99
|
-
icon: true,
|
|
100
|
-
"aria-label": closeLabel,
|
|
101
|
-
title: closeLabel,
|
|
102
|
-
children: /*#__PURE__*/ jsx(X, {
|
|
103
|
-
"aria-hidden": true
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
}),
|
|
109
|
-
/*#__PURE__*/ jsx("div", {
|
|
110
|
-
className: "min-h-0 flex-1 overflow-auto",
|
|
111
|
-
children: showPreview ? /*#__PURE__*/ jsx("iframe", {
|
|
112
|
-
"data-slot": "wind-chat-html-preview",
|
|
113
|
-
sandbox: "allow-scripts",
|
|
114
|
-
srcDoc: buildHtmlPreviewDocument(block.code, {
|
|
115
|
-
contentSecurityPolicy: PREVIEW_CSP
|
|
116
|
-
}),
|
|
117
|
-
title: previewTitle,
|
|
118
|
-
className: "size-full rounded-lg border border-border-subtle bg-white"
|
|
119
|
-
}) : /*#__PURE__*/ jsx(CodeBlock, {
|
|
120
|
-
code: block.code,
|
|
121
|
-
language: block.language,
|
|
122
|
-
wrap: true,
|
|
123
|
-
hideHeader: true
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
export { CodeBlockActions };
|
|
@@ -1,136 +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 ("u" > 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
|
-
DisclosureTree: ()=>DisclosureTree
|
|
37
|
-
});
|
|
38
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
40
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
41
|
-
const external_react_namespaceObject = require("react");
|
|
42
|
-
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
43
|
-
const ROW_CLASSES = 'flex w-full min-w-0 items-center gap-2 rounded p-1 text-left transition-colors motion-reduce:transition-none';
|
|
44
|
-
const FOCUS_CLASSES = 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring';
|
|
45
|
-
const TOGGLE_CLASSES = (0, apollo_wind_namespaceObject.cn)('cursor-pointer hover:text-foreground', FOCUS_CLASSES);
|
|
46
|
-
function DisclosureTree({ items, openState, className }) {
|
|
47
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
48
|
-
"data-slot": "wind-chat-disclosure-tree",
|
|
49
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex min-w-0 flex-col', className),
|
|
50
|
-
children: items.map((item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DisclosureTreeRow, {
|
|
51
|
-
item: item,
|
|
52
|
-
openState: openState
|
|
53
|
-
}, item.id))
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function DisclosureTreeRow({ item, openState }) {
|
|
57
|
-
const [localOpen, setLocalOpen] = external_react_default().useState(item.defaultOpen ?? false);
|
|
58
|
-
const open = openState ? openState.isOpen(item.id) : localOpen;
|
|
59
|
-
const setOpen = (next)=>openState ? openState.setOpen(item.id, next) : setLocalOpen(next);
|
|
60
|
-
const hasChildren = 'function' == typeof item.children ? !!item.expandable : !!item.children?.length;
|
|
61
|
-
const children = hasChildren && open ? resolveChildren(item.children) : void 0;
|
|
62
|
-
const content = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
63
|
-
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
64
|
-
children: [
|
|
65
|
-
item.icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
66
|
-
className: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
67
|
-
children: item.icon
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
70
|
-
className: "min-w-0 truncate",
|
|
71
|
-
style: item.labelStyle,
|
|
72
|
-
children: item.label
|
|
73
|
-
}),
|
|
74
|
-
item.trailing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
75
|
-
className: "ml-auto shrink-0 pl-2 text-muted-foreground",
|
|
76
|
-
children: item.trailing
|
|
77
|
-
})
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
const chevron = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRight, {
|
|
81
|
-
"aria-hidden": "true",
|
|
82
|
-
className: (0, apollo_wind_namespaceObject.cn)('size-4 shrink-0 transition-transform motion-reduce:transition-none', open && 'rotate-90', !hasChildren && 'invisible')
|
|
83
|
-
});
|
|
84
|
-
const row = hasChildren ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
85
|
-
type: "button",
|
|
86
|
-
"aria-expanded": open,
|
|
87
|
-
onClick: ()=>setOpen(!open),
|
|
88
|
-
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASSES, TOGGLE_CLASSES),
|
|
89
|
-
children: [
|
|
90
|
-
chevron,
|
|
91
|
-
content
|
|
92
|
-
]
|
|
93
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
94
|
-
tabIndex: item.description ? 0 : void 0,
|
|
95
|
-
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASSES, item.description && FOCUS_CLASSES),
|
|
96
|
-
children: [
|
|
97
|
-
chevron,
|
|
98
|
-
content
|
|
99
|
-
]
|
|
100
|
-
});
|
|
101
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("li", {
|
|
102
|
-
"data-slot": "wind-chat-disclosure-tree-item",
|
|
103
|
-
className: "min-w-0",
|
|
104
|
-
children: [
|
|
105
|
-
item.description ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Tooltip, {
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipTrigger, {
|
|
108
|
-
asChild: true,
|
|
109
|
-
children: row
|
|
110
|
-
}),
|
|
111
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipPortal, {
|
|
112
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.TooltipContent, {
|
|
113
|
-
align: "start",
|
|
114
|
-
children: item.description
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
]
|
|
118
|
-
}) : row,
|
|
119
|
-
children && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DisclosureTree, {
|
|
120
|
-
items: children,
|
|
121
|
-
openState: openState,
|
|
122
|
-
className: "ml-7"
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
function resolveChildren(children) {
|
|
128
|
-
return 'function' == typeof children ? children() : children ?? [];
|
|
129
|
-
}
|
|
130
|
-
exports.DisclosureTree = __webpack_exports__.DisclosureTree;
|
|
131
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
132
|
-
"DisclosureTree"
|
|
133
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
134
|
-
Object.defineProperty(exports, '__esModule', {
|
|
135
|
-
value: true
|
|
136
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface DisclosureTreeItem {
|
|
3
|
-
id: string;
|
|
4
|
-
label: React.ReactNode;
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
description?: string;
|
|
7
|
-
trailing?: React.ReactNode;
|
|
8
|
-
labelStyle?: React.CSSProperties;
|
|
9
|
-
defaultOpen?: boolean;
|
|
10
|
-
children?: readonly DisclosureTreeItem[] | (() => readonly DisclosureTreeItem[]);
|
|
11
|
-
expandable?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface DisclosureTreeOpenState {
|
|
14
|
-
isOpen: (id: string) => boolean;
|
|
15
|
-
setOpen: (id: string, open: boolean) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare function DisclosureTree({ items, openState, className, }: {
|
|
18
|
-
items: readonly DisclosureTreeItem[];
|
|
19
|
-
openState?: DisclosureTreeOpenState;
|
|
20
|
-
className?: string;
|
|
21
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=disclosure-tree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure-tree.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/renderers/disclosure-tree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,QAAQ,CAAC,EAAE,SAAS,kBAAkB,EAAE,GAAG,CAAC,MAAM,SAAS,kBAAkB,EAAE,CAAC,CAAC;IAEjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAChC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAeD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,SAAS,EACT,SAAS,GACV,EAAE;IACD,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAQA"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { ChevronRight } from "lucide-react";
|
|
4
|
-
import react from "react";
|
|
5
|
-
const ROW_CLASSES = 'flex w-full min-w-0 items-center gap-2 rounded p-1 text-left transition-colors motion-reduce:transition-none';
|
|
6
|
-
const FOCUS_CLASSES = 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring';
|
|
7
|
-
const TOGGLE_CLASSES = cn('cursor-pointer hover:text-foreground', FOCUS_CLASSES);
|
|
8
|
-
function DisclosureTree({ items, openState, className }) {
|
|
9
|
-
return /*#__PURE__*/ jsx("ul", {
|
|
10
|
-
"data-slot": "wind-chat-disclosure-tree",
|
|
11
|
-
className: cn('flex min-w-0 flex-col', className),
|
|
12
|
-
children: items.map((item)=>/*#__PURE__*/ jsx(DisclosureTreeRow, {
|
|
13
|
-
item: item,
|
|
14
|
-
openState: openState
|
|
15
|
-
}, item.id))
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function DisclosureTreeRow({ item, openState }) {
|
|
19
|
-
const [localOpen, setLocalOpen] = react.useState(item.defaultOpen ?? false);
|
|
20
|
-
const open = openState ? openState.isOpen(item.id) : localOpen;
|
|
21
|
-
const setOpen = (next)=>openState ? openState.setOpen(item.id, next) : setLocalOpen(next);
|
|
22
|
-
const hasChildren = 'function' == typeof item.children ? !!item.expandable : !!item.children?.length;
|
|
23
|
-
const children = hasChildren && open ? resolveChildren(item.children) : void 0;
|
|
24
|
-
const content = /*#__PURE__*/ jsxs("span", {
|
|
25
|
-
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
26
|
-
children: [
|
|
27
|
-
item.icon && /*#__PURE__*/ jsx("span", {
|
|
28
|
-
className: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
29
|
-
children: item.icon
|
|
30
|
-
}),
|
|
31
|
-
/*#__PURE__*/ jsx("span", {
|
|
32
|
-
className: "min-w-0 truncate",
|
|
33
|
-
style: item.labelStyle,
|
|
34
|
-
children: item.label
|
|
35
|
-
}),
|
|
36
|
-
item.trailing && /*#__PURE__*/ jsx("span", {
|
|
37
|
-
className: "ml-auto shrink-0 pl-2 text-muted-foreground",
|
|
38
|
-
children: item.trailing
|
|
39
|
-
})
|
|
40
|
-
]
|
|
41
|
-
});
|
|
42
|
-
const chevron = /*#__PURE__*/ jsx(ChevronRight, {
|
|
43
|
-
"aria-hidden": "true",
|
|
44
|
-
className: cn('size-4 shrink-0 transition-transform motion-reduce:transition-none', open && 'rotate-90', !hasChildren && 'invisible')
|
|
45
|
-
});
|
|
46
|
-
const row = hasChildren ? /*#__PURE__*/ jsxs("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
"aria-expanded": open,
|
|
49
|
-
onClick: ()=>setOpen(!open),
|
|
50
|
-
className: cn(ROW_CLASSES, TOGGLE_CLASSES),
|
|
51
|
-
children: [
|
|
52
|
-
chevron,
|
|
53
|
-
content
|
|
54
|
-
]
|
|
55
|
-
}) : /*#__PURE__*/ jsxs("div", {
|
|
56
|
-
tabIndex: item.description ? 0 : void 0,
|
|
57
|
-
className: cn(ROW_CLASSES, item.description && FOCUS_CLASSES),
|
|
58
|
-
children: [
|
|
59
|
-
chevron,
|
|
60
|
-
content
|
|
61
|
-
]
|
|
62
|
-
});
|
|
63
|
-
return /*#__PURE__*/ jsxs("li", {
|
|
64
|
-
"data-slot": "wind-chat-disclosure-tree-item",
|
|
65
|
-
className: "min-w-0",
|
|
66
|
-
children: [
|
|
67
|
-
item.description ? /*#__PURE__*/ jsxs(Tooltip, {
|
|
68
|
-
children: [
|
|
69
|
-
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
70
|
-
asChild: true,
|
|
71
|
-
children: row
|
|
72
|
-
}),
|
|
73
|
-
/*#__PURE__*/ jsx(TooltipPortal, {
|
|
74
|
-
children: /*#__PURE__*/ jsx(TooltipContent, {
|
|
75
|
-
align: "start",
|
|
76
|
-
children: item.description
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
}) : row,
|
|
81
|
-
children && /*#__PURE__*/ jsx(DisclosureTree, {
|
|
82
|
-
items: children,
|
|
83
|
-
openState: openState,
|
|
84
|
-
className: "ml-7"
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function resolveChildren(children) {
|
|
90
|
-
return 'function' == typeof children ? children() : children ?? [];
|
|
91
|
-
}
|
|
92
|
-
export { DisclosureTree };
|