@uipath/apollo-react 7.38.0 → 7.39.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/styles/tailwind.canvas.css +1 -1
- package/dist/chat/headless/hooks/use-composer-footer.cjs +69 -0
- package/dist/chat/headless/hooks/use-composer-footer.d.ts +7 -0
- package/dist/chat/headless/hooks/use-composer-footer.d.ts.map +1 -0
- package/dist/chat/headless/hooks/use-composer-footer.js +25 -0
- package/dist/chat/headless/utils/info-links.cjs +52 -0
- package/dist/chat/headless/utils/info-links.d.ts +7 -0
- package/dist/chat/headless/utils/info-links.d.ts.map +1 -0
- package/dist/chat/headless/utils/info-links.js +18 -0
- package/dist/chat/service/ChatModel.cjs +1 -0
- package/dist/chat/service/ChatModel.d.ts +6 -0
- package/dist/chat/service/ChatModel.d.ts.map +1 -1
- package/dist/chat/service/ChatModel.js +1 -0
- package/dist/chat/service/ChatService.cjs +7 -0
- package/dist/chat/service/ChatService.d.ts +2 -1
- package/dist/chat/service/ChatService.d.ts.map +1 -1
- package/dist/chat/service/ChatService.js +7 -0
- package/dist/chat/stories/chat-playground.d.ts +2 -1
- package/dist/chat/stories/chat-playground.d.ts.map +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/chat/wind/composer/chat-composer.cjs +3 -5
- package/dist/chat/wind/composer/chat-composer.d.ts.map +1 -1
- package/dist/chat/wind/composer/chat-composer.js +4 -6
- package/dist/chat/wind/composer/composer-footer.cjs +73 -0
- package/dist/chat/wind/composer/composer-footer.d.ts +2 -0
- package/dist/chat/wind/composer/composer-footer.d.ts.map +1 -0
- package/dist/chat/wind/composer/composer-footer.js +39 -0
- package/dist/chat/wind/renderers/chat-code-block.cjs +3 -4
- package/dist/chat/wind/renderers/chat-code-block.d.ts.map +1 -1
- package/dist/chat/wind/renderers/chat-code-block.js +3 -4
- package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input-footer.cjs +57 -8
- package/dist/material/components/ap-chat/components/input/chat-input-footer.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input-footer.js +57 -9
- package/dist/material/components/ap-link/ApLink.cjs +9 -4
- package/dist/material/components/ap-link/ApLink.d.ts.map +1 -1
- package/dist/material/components/ap-link/ApLink.js +9 -4
- package/package.json +3 -3
|
@@ -51,6 +51,7 @@ const loading_provider_cjs_namespaceObject = require("../../headless/providers/l
|
|
|
51
51
|
const index_cjs_namespaceObject = require("../../service/index.cjs");
|
|
52
52
|
const message_attachments_cjs_namespaceObject = require("../messages/message-attachments.cjs");
|
|
53
53
|
const markdown_renderer_cjs_namespaceObject = require("../renderers/markdown-renderer.cjs");
|
|
54
|
+
const external_composer_footer_cjs_namespaceObject = require("./composer-footer.cjs");
|
|
54
55
|
const external_composer_strings_cjs_namespaceObject = require("./composer-strings.cjs");
|
|
55
56
|
const promptText = (prompt)=>'string' == typeof prompt ? prompt : prompt?.content ?? '';
|
|
56
57
|
function ComposerErrorText({ message }) {
|
|
@@ -65,7 +66,7 @@ function ComposerErrorText({ message }) {
|
|
|
65
66
|
function WindChatComposer() {
|
|
66
67
|
const chatService = (0, chat_service_provider_cjs_namespaceObject.useChatService)();
|
|
67
68
|
const { disabledFeatures, spacing, allowedAttachments } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
68
|
-
const { inputPlaceholder
|
|
69
|
+
const { inputPlaceholder } = (0, use_chat_labels_cjs_namespaceObject.useChatLabels)();
|
|
69
70
|
const { skeletonLoader } = (0, loading_provider_cjs_namespaceObject.useLoading)();
|
|
70
71
|
const { error, clearError } = (0, error_provider_cjs_namespaceObject.useError)();
|
|
71
72
|
const { attachments, attachmentsLoading, removeAttachment, clearAttachments } = (0, attachments_provider_cjs_namespaceObject.useAttachments)();
|
|
@@ -197,10 +198,7 @@ function WindChatComposer() {
|
|
|
197
198
|
})
|
|
198
199
|
]
|
|
199
200
|
}),
|
|
200
|
-
!disabledFeatures.footer && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
201
|
-
className: "text-[10px]",
|
|
202
|
-
children: footerDisclaimer
|
|
203
|
-
})
|
|
201
|
+
!disabledFeatures.footer && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_composer_footer_cjs_namespaceObject.WindComposerFooter, {})
|
|
204
202
|
]
|
|
205
203
|
});
|
|
206
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-composer.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-composer.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,gBAAgB,4CA+I/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChatComposer, ChatComposerAttachButton, ChatComposerAttachments, ChatComposerError,
|
|
2
|
+
import { ChatComposer, ChatComposerAttachButton, ChatComposerAttachments, ChatComposerError, ChatComposerInputGroup, ChatComposerSubmit, ChatComposerTextarea, ChatComposerToolbar, Markdown, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "@uipath/apollo-wind";
|
|
3
3
|
import react from "react";
|
|
4
4
|
import { getAcceptedFileTypes, useAttachmentIntake } from "../../headless/hooks/use-attachment-intake.js";
|
|
5
5
|
import { useAttachmentLimits } from "../../headless/hooks/use-attachment-limits.js";
|
|
@@ -13,6 +13,7 @@ import { useLoading } from "../../headless/providers/loading-provider.js";
|
|
|
13
13
|
import { AutopilotChatEvent, AutopilotChatInternalEvent } from "../../service/index.js";
|
|
14
14
|
import { AttachmentTypeIcon } from "../messages/message-attachments.js";
|
|
15
15
|
import { useMarkdownStrings } from "../renderers/markdown-renderer.js";
|
|
16
|
+
import { WindComposerFooter } from "./composer-footer.js";
|
|
16
17
|
import { useComposerStrings } from "./composer-strings.js";
|
|
17
18
|
const promptText = (prompt)=>'string' == typeof prompt ? prompt : prompt?.content ?? '';
|
|
18
19
|
function ComposerErrorText({ message }) {
|
|
@@ -27,7 +28,7 @@ function ComposerErrorText({ message }) {
|
|
|
27
28
|
function WindChatComposer() {
|
|
28
29
|
const chatService = useChatService();
|
|
29
30
|
const { disabledFeatures, spacing, allowedAttachments } = useChatState();
|
|
30
|
-
const { inputPlaceholder
|
|
31
|
+
const { inputPlaceholder } = useChatLabels();
|
|
31
32
|
const { skeletonLoader } = useLoading();
|
|
32
33
|
const { error, clearError } = useError();
|
|
33
34
|
const { attachments, attachmentsLoading, removeAttachment, clearAttachments } = useAttachments();
|
|
@@ -159,10 +160,7 @@ function WindChatComposer() {
|
|
|
159
160
|
})
|
|
160
161
|
]
|
|
161
162
|
}),
|
|
162
|
-
!disabledFeatures.footer && /*#__PURE__*/ jsx(
|
|
163
|
-
className: "text-[10px]",
|
|
164
|
-
children: footerDisclaimer
|
|
165
|
-
})
|
|
163
|
+
!disabledFeatures.footer && /*#__PURE__*/ jsx(WindComposerFooter, {})
|
|
166
164
|
]
|
|
167
165
|
});
|
|
168
166
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
WindComposerFooter: ()=>WindComposerFooter
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const use_composer_footer_cjs_namespaceObject = require("../../headless/hooks/use-composer-footer.cjs");
|
|
32
|
+
function WindComposerFooter() {
|
|
33
|
+
const { disclaimer, links } = (0, use_composer_footer_cjs_namespaceObject.useComposerFooter)();
|
|
34
|
+
if (0 === links.length) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ChatComposerFooter, {
|
|
35
|
+
className: "text-[10px]",
|
|
36
|
+
children: disclaimer
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
39
|
+
"data-slot": "chat-composer-footer-row",
|
|
40
|
+
className: "flex flex-wrap items-baseline justify-between gap-2 px-1 text-[10px] text-muted-foreground",
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
43
|
+
"data-slot": "chat-composer-info-links",
|
|
44
|
+
className: "flex flex-wrap gap-x-3",
|
|
45
|
+
children: links.map(({ label, href }, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
46
|
+
children: href ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
47
|
+
asChild: true,
|
|
48
|
+
variant: "link",
|
|
49
|
+
size: "4xs",
|
|
50
|
+
className: "h-auto px-0 text-[10px]",
|
|
51
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
52
|
+
href: href,
|
|
53
|
+
target: "_blank",
|
|
54
|
+
rel: "noopener noreferrer",
|
|
55
|
+
children: label
|
|
56
|
+
})
|
|
57
|
+
}) : label
|
|
58
|
+
}, index))
|
|
59
|
+
}),
|
|
60
|
+
disclaimer && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ChatComposerFooter, {
|
|
61
|
+
className: "px-0 text-end text-[10px]",
|
|
62
|
+
children: disclaimer
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.WindComposerFooter = __webpack_exports__.WindComposerFooter;
|
|
68
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
69
|
+
"WindComposerFooter"
|
|
70
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
71
|
+
Object.defineProperty(exports, '__esModule', {
|
|
72
|
+
value: true
|
|
73
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer-footer.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/composer-footer.tsx"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB,4CAmCjC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, ChatComposerFooter } from "@uipath/apollo-wind";
|
|
3
|
+
import { useComposerFooter } from "../../headless/hooks/use-composer-footer.js";
|
|
4
|
+
function WindComposerFooter() {
|
|
5
|
+
const { disclaimer, links } = useComposerFooter();
|
|
6
|
+
if (0 === links.length) return /*#__PURE__*/ jsx(ChatComposerFooter, {
|
|
7
|
+
className: "text-[10px]",
|
|
8
|
+
children: disclaimer
|
|
9
|
+
});
|
|
10
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
11
|
+
"data-slot": "chat-composer-footer-row",
|
|
12
|
+
className: "flex flex-wrap items-baseline justify-between gap-2 px-1 text-[10px] text-muted-foreground",
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ jsx("ul", {
|
|
15
|
+
"data-slot": "chat-composer-info-links",
|
|
16
|
+
className: "flex flex-wrap gap-x-3",
|
|
17
|
+
children: links.map(({ label, href }, index)=>/*#__PURE__*/ jsx("li", {
|
|
18
|
+
children: href ? /*#__PURE__*/ jsx(Button, {
|
|
19
|
+
asChild: true,
|
|
20
|
+
variant: "link",
|
|
21
|
+
size: "4xs",
|
|
22
|
+
className: "h-auto px-0 text-[10px]",
|
|
23
|
+
children: /*#__PURE__*/ jsx("a", {
|
|
24
|
+
href: href,
|
|
25
|
+
target: "_blank",
|
|
26
|
+
rel: "noopener noreferrer",
|
|
27
|
+
children: label
|
|
28
|
+
})
|
|
29
|
+
}) : label
|
|
30
|
+
}, index))
|
|
31
|
+
}),
|
|
32
|
+
disclaimer && /*#__PURE__*/ jsx(ChatComposerFooter, {
|
|
33
|
+
className: "px-0 text-end text-[10px]",
|
|
34
|
+
children: disclaimer
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { WindComposerFooter };
|
|
@@ -59,9 +59,8 @@ function ChatCodeBlock({ block, codeBlockProps, htmlPreview, streaming }) {
|
|
|
59
59
|
const { _ } = (0, react_namespaceObject.useLingui)();
|
|
60
60
|
const dialogContainer = (0, dialog_container_cjs_namespaceObject.useDialogContainer)();
|
|
61
61
|
const previewable = htmlPreview && block.language?.trim().toLowerCase() === 'html';
|
|
62
|
-
const [
|
|
63
|
-
|
|
64
|
-
const showPreview = previewable && !streaming && previewedCode === block.code;
|
|
62
|
+
const [showSource, setShowSource] = external_react_default().useState(false);
|
|
63
|
+
const showPreview = previewable && !streaming && !showSource;
|
|
65
64
|
const [expanded, setExpanded] = external_react_default().useState(false);
|
|
66
65
|
const codeLabel = _({
|
|
67
66
|
id: 'autopilot-chat.message.code-block-code'
|
|
@@ -88,7 +87,7 @@ function ChatCodeBlock({ block, codeBlockProps, htmlPreview, streaming }) {
|
|
|
88
87
|
"aria-label": toggleLabel,
|
|
89
88
|
title: toggleLabel,
|
|
90
89
|
disabled: streaming,
|
|
91
|
-
onClick: ()=>
|
|
90
|
+
onClick: ()=>setShowSource(showPreview),
|
|
92
91
|
children: showPreview ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Code, {
|
|
93
92
|
"aria-hidden": true
|
|
94
93
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Eye, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-code-block.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/renderers/chat-code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EAMnB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAY7B,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAC;IAEzB,cAAc,EAAE,cAAc,CAAC;IAE/B,WAAW,EAAE,OAAO,CAAC;IAErB,SAAS,EAAE,OAAO,CAAC;CACpB;AA4BD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,cAAc,EACd,WAAW,EACX,SAAS,GACV,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"chat-code-block.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/renderers/chat-code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EAMnB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAY7B,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAC;IAEzB,cAAc,EAAE,cAAc,CAAC;IAE/B,WAAW,EAAE,OAAO,CAAC;IAErB,SAAS,EAAE,OAAO,CAAC;CACpB;AA4BD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,cAAc,EACd,WAAW,EACX,SAAS,GACV,EAAE,kBAAkB,2CAyFpB"}
|
|
@@ -21,9 +21,8 @@ function ChatCodeBlock({ block, codeBlockProps, htmlPreview, streaming }) {
|
|
|
21
21
|
const { _ } = useLingui();
|
|
22
22
|
const dialogContainer = useDialogContainer();
|
|
23
23
|
const previewable = htmlPreview && block.language?.trim().toLowerCase() === 'html';
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
const showPreview = previewable && !streaming && previewedCode === block.code;
|
|
24
|
+
const [showSource, setShowSource] = react.useState(false);
|
|
25
|
+
const showPreview = previewable && !streaming && !showSource;
|
|
27
26
|
const [expanded, setExpanded] = react.useState(false);
|
|
28
27
|
const codeLabel = _({
|
|
29
28
|
id: 'autopilot-chat.message.code-block-code'
|
|
@@ -50,7 +49,7 @@ function ChatCodeBlock({ block, codeBlockProps, htmlPreview, streaming }) {
|
|
|
50
49
|
"aria-label": toggleLabel,
|
|
51
50
|
title: toggleLabel,
|
|
52
51
|
disabled: streaming,
|
|
53
|
-
onClick: ()=>
|
|
52
|
+
onClick: ()=>setShowSource(showPreview),
|
|
54
53
|
children: showPreview ? /*#__PURE__*/ jsx(Code, {
|
|
55
54
|
"aria-hidden": true
|
|
56
55
|
}) : /*#__PURE__*/ jsx(Eye, {
|