@red-hat-developer-hub/backstage-plugin-lightspeed 2.8.4 → 2.9.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/CHANGELOG.md +17 -0
- package/dist/alpha/LightspeedFAB.esm.js +22 -31
- package/dist/alpha/LightspeedFAB.esm.js.map +1 -1
- package/dist/alpha.d.ts +1 -0
- package/dist/components/LightSpeedChat.esm.js +7 -3
- package/dist/components/LightSpeedChat.esm.js.map +1 -1
- package/dist/components/LightspeedDrawerProvider.esm.js +3 -6
- package/dist/components/LightspeedDrawerProvider.esm.js.map +1 -1
- package/dist/components/LightspeedFAB.esm.js +22 -31
- package/dist/components/LightspeedFAB.esm.js.map +1 -1
- package/dist/components/notebooks/AddDocumentModal.esm.js +3 -1
- package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -1
- package/dist/components/notebooks/DocumentSidebar.esm.js +3 -2
- package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -1
- package/dist/components/notebooks/NotebookView.esm.js +12 -2
- package/dist/components/notebooks/NotebookView.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/translations/ref.esm.js +1 -0
- package/dist/translations/ref.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/images/bot-avatar.svg +0 -15
- package/dist/images/logo-black.svg +0 -22
- package/dist/images/logo-white.svg +0 -16
- package/dist/images/logo.svg +0 -1
- package/dist/images/permission-required.svg +0 -48
- package/dist/images/rounded-logo.svg +0 -22
- package/dist/images/user-avatar.svg +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
## @red-hat-developer-hub/backstage-plugin-lightspeed
|
|
2
2
|
|
|
3
|
+
## 2.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 824efa9: documents cannot be uploaded when a document processing is in progress
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @red-hat-developer-hub/backstage-plugin-lightspeed-common@2.9.0
|
|
12
|
+
|
|
13
|
+
## 2.8.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 52ac724: fix(lightspeed): prevent JSS class name prefix from leaking into host application styles
|
|
18
|
+
- @red-hat-developer-hub/backstage-plugin-lightspeed-common@2.8.5
|
|
19
|
+
|
|
3
20
|
## 2.8.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,48 +1,35 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { StylesProvider as StylesProvider$1 } from '@material-ui/core/styles';
|
|
3
2
|
import CloseIcon from '@mui/icons-material/Close';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
4
|
import Fab from '@mui/material/Fab';
|
|
5
5
|
import Tooltip from '@mui/material/Tooltip';
|
|
6
|
-
import { makeStyles, StylesProvider } from '@mui/styles';
|
|
7
6
|
import { ChatbotDisplayMode } from '@patternfly/chatbot';
|
|
8
7
|
import { LightspeedFABIcon } from '../components/LightspeedIcon.esm.js';
|
|
9
8
|
import { DOCKED_CONTENT_OFFSET } from '../const.esm.js';
|
|
10
9
|
import { useLightspeedDrawerContext } from '../hooks/useLightspeedDrawerContext.esm.js';
|
|
11
10
|
import { useTranslation } from '../hooks/useTranslation.esm.js';
|
|
12
|
-
import { generateClassName, generateClassNameV4 } from '../utils/generateClassName.esm.js';
|
|
13
11
|
|
|
14
|
-
const
|
|
15
|
-
fab: {
|
|
16
|
-
opacity: "1 !important",
|
|
17
|
-
backgroundColor: `${theme?.palette?.primary?.main ?? "#1976d2"} !important`,
|
|
18
|
-
color: `${theme?.palette?.primary?.contrastText ?? "#fff"} !important`,
|
|
19
|
-
boxShadow: `${theme?.shadows?.[6] ?? "0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)"} !important`
|
|
20
|
-
},
|
|
21
|
-
"fab-button": {
|
|
22
|
-
bottom: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
|
|
23
|
-
right: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
|
|
24
|
-
alignItems: "end",
|
|
25
|
-
zIndex: 200,
|
|
26
|
-
display: "flex",
|
|
27
|
-
position: "fixed",
|
|
28
|
-
// When ApplicationDrawer is docked, match main content inset
|
|
29
|
-
"body.docked-drawer-open &": {
|
|
30
|
-
transition: "margin-right 0.3s ease",
|
|
31
|
-
marginRight: DOCKED_CONTENT_OFFSET
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
const LightspeedFABInner = () => {
|
|
12
|
+
const LightspeedFAB = () => {
|
|
36
13
|
const { t } = useTranslation();
|
|
37
14
|
const { isChatbotActive, toggleChatbot, displayMode } = useLightspeedDrawerContext();
|
|
38
|
-
const fabButton = useStyles();
|
|
39
15
|
if (displayMode === ChatbotDisplayMode.embedded) {
|
|
40
16
|
return null;
|
|
41
17
|
}
|
|
42
18
|
return /* @__PURE__ */ jsx(
|
|
43
|
-
|
|
19
|
+
Box,
|
|
44
20
|
{
|
|
45
|
-
|
|
21
|
+
sx: (theme) => ({
|
|
22
|
+
bottom: `calc(${theme.spacing(2)} + 1.5em)`,
|
|
23
|
+
right: `calc(${theme.spacing(2)} + 1.5em)`,
|
|
24
|
+
alignItems: "end",
|
|
25
|
+
zIndex: 200,
|
|
26
|
+
display: "flex",
|
|
27
|
+
position: "fixed",
|
|
28
|
+
"body.docked-drawer-open &": {
|
|
29
|
+
transition: "margin-right 0.3s ease",
|
|
30
|
+
marginRight: DOCKED_CONTENT_OFFSET
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
46
33
|
id: "lightspeed-fab",
|
|
47
34
|
"data-testid": "lightspeed-fab",
|
|
48
35
|
children: /* @__PURE__ */ jsx(
|
|
@@ -58,8 +45,13 @@ const LightspeedFABInner = () => {
|
|
|
58
45
|
size: "small",
|
|
59
46
|
onClick: toggleChatbot,
|
|
60
47
|
"aria-label": isChatbotActive ? t("tooltip.fab.close") : t("tooltip.fab.open"),
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
sx: (theme) => ({
|
|
49
|
+
borderRadius: "100% !important",
|
|
50
|
+
opacity: "1 !important",
|
|
51
|
+
backgroundColor: `${theme.palette?.primary?.main ?? "#1976d2"} !important`,
|
|
52
|
+
color: `${theme.palette?.primary?.contrastText ?? "#fff"} !important`,
|
|
53
|
+
boxShadow: `${theme.shadows?.[6] ?? "0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)"} !important`
|
|
54
|
+
}),
|
|
63
55
|
children: isChatbotActive ? /* @__PURE__ */ jsx(CloseIcon, { fontSize: "small" }) : /* @__PURE__ */ jsx(LightspeedFABIcon, {})
|
|
64
56
|
}
|
|
65
57
|
)
|
|
@@ -68,7 +60,6 @@ const LightspeedFABInner = () => {
|
|
|
68
60
|
}
|
|
69
61
|
);
|
|
70
62
|
};
|
|
71
|
-
const LightspeedFAB = () => /* @__PURE__ */ jsx(StylesProvider, { generateClassName, children: /* @__PURE__ */ jsx(StylesProvider$1, { generateClassName: generateClassNameV4, children: /* @__PURE__ */ jsx(LightspeedFABInner, {}) }) });
|
|
72
63
|
|
|
73
64
|
export { LightspeedFAB };
|
|
74
65
|
//# sourceMappingURL=LightspeedFAB.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightspeedFAB.esm.js","sources":["../../src/alpha/LightspeedFAB.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"LightspeedFAB.esm.js","sources":["../../src/alpha/LightspeedFAB.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Close from '@mui/icons-material/Close';\nimport Box from '@mui/material/Box';\nimport Fab from '@mui/material/Fab';\nimport Tooltip from '@mui/material/Tooltip';\nimport { ChatbotDisplayMode } from '@patternfly/chatbot';\n\nimport { LightspeedFABIcon } from '../components/LightspeedIcon';\nimport { DOCKED_CONTENT_OFFSET } from '../const';\nimport { useLightspeedDrawerContext } from '../hooks/useLightspeedDrawerContext';\nimport { useTranslation } from '../hooks/useTranslation';\n\n/**\n * @alpha\n * Lightspeed Floating action button to open/close the lightspeed chatbot\n */\nexport const LightspeedFAB = () => {\n const { t } = useTranslation();\n const { isChatbotActive, toggleChatbot, displayMode } =\n useLightspeedDrawerContext();\n\n if (displayMode === ChatbotDisplayMode.embedded) {\n return null;\n }\n\n return (\n <Box\n sx={theme => ({\n bottom: `calc(${theme.spacing(2)} + 1.5em)`,\n right: `calc(${theme.spacing(2)} + 1.5em)`,\n alignItems: 'end',\n zIndex: 200,\n display: 'flex',\n position: 'fixed',\n 'body.docked-drawer-open &': {\n transition: 'margin-right 0.3s ease',\n marginRight: DOCKED_CONTENT_OFFSET,\n },\n })}\n id=\"lightspeed-fab\"\n data-testid=\"lightspeed-fab\"\n >\n <Tooltip\n title={isChatbotActive ? t('tooltip.fab.close') : t('tooltip.fab.open')}\n placement=\"left\"\n >\n <Fab\n color=\"primary\"\n variant=\"circular\"\n size=\"small\"\n onClick={toggleChatbot}\n aria-label={\n isChatbotActive ? t('tooltip.fab.close') : t('tooltip.fab.open')\n }\n sx={theme => ({\n borderRadius: '100% !important',\n opacity: '1 !important',\n backgroundColor: `${theme.palette?.primary?.main ?? '#1976d2'} !important`,\n color: `${theme.palette?.primary?.contrastText ?? '#fff'} !important`,\n boxShadow: `${\n theme.shadows?.[6] ??\n '0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)'\n } !important`,\n })}\n >\n {isChatbotActive ? <Close fontSize=\"small\" /> : <LightspeedFABIcon />}\n </Fab>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["Close"],"mappings":";;;;;;;;;;;AA+BO,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,EAAe;AAC7B,EAAA,MAAM,EAAE,eAAA,EAAiB,aAAA,EAAe,WAAA,KACtC,0BAAA,EAA2B;AAE7B,EAAA,IAAI,WAAA,KAAgB,mBAAmB,QAAA,EAAU;AAC/C,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,IAAI,CAAA,KAAA,MAAU;AAAA,QACZ,MAAA,EAAQ,CAAA,KAAA,EAAQ,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,SAAA,CAAA;AAAA,QAChC,KAAA,EAAO,CAAA,KAAA,EAAQ,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,SAAA,CAAA;AAAA,QAC/B,UAAA,EAAY,KAAA;AAAA,QACZ,MAAA,EAAQ,GAAA;AAAA,QACR,OAAA,EAAS,MAAA;AAAA,QACT,QAAA,EAAU,OAAA;AAAA,QACV,2BAAA,EAA6B;AAAA,UAC3B,UAAA,EAA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resize": string;
|
|
78
78
|
readonly "notebook.view.documents.uploading": string;
|
|
79
79
|
readonly "notebook.view.documents.maxReached": string;
|
|
80
|
+
readonly "notebook.view.documents.uploadsInProgress": string;
|
|
80
81
|
readonly "notebook.upload.failed": string;
|
|
81
82
|
readonly "notebook.upload.modal.title": string;
|
|
82
83
|
readonly "notebook.upload.modal.dragDropTitle": string;
|
|
@@ -571,9 +571,7 @@ const LightspeedChat = ({
|
|
|
571
571
|
[]
|
|
572
572
|
);
|
|
573
573
|
const createNotebookMutation = useCreateNotebook();
|
|
574
|
-
const { data: notebookDocuments = [] } = useNotebookDocuments(
|
|
575
|
-
activeNotebook?.session_id
|
|
576
|
-
);
|
|
574
|
+
const { data: notebookDocuments = [], isFetching: isDocumentsFetching } = useNotebookDocuments(activeNotebook?.session_id);
|
|
577
575
|
const [conversationId, setConversationId] = useState("");
|
|
578
576
|
const [requestId, setRequestId] = useState("");
|
|
579
577
|
const [newChatCreated, setNewChatCreated] = useState(false);
|
|
@@ -1612,10 +1610,15 @@ const LightspeedChat = ({
|
|
|
1612
1610
|
minHeight: theme.spacing(6),
|
|
1613
1611
|
paddingLeft: theme.spacing(2),
|
|
1614
1612
|
paddingRight: theme.spacing(2),
|
|
1613
|
+
"& .MuiTabs-flexContainer": {
|
|
1614
|
+
gap: theme.spacing(2)
|
|
1615
|
+
},
|
|
1615
1616
|
'& [role="tab"]': {
|
|
1616
1617
|
fontWeight: 700,
|
|
1617
1618
|
textTransform: "none",
|
|
1618
1619
|
opacity: 1,
|
|
1620
|
+
padding: `${theme.spacing(1)} ${theme.spacing(2)}`,
|
|
1621
|
+
borderRadius: theme.spacing(0.5),
|
|
1619
1622
|
'&:not([aria-selected="true"])': {
|
|
1620
1623
|
color: `${theme.palette.text.primary} !important`
|
|
1621
1624
|
},
|
|
@@ -1770,6 +1773,7 @@ const LightspeedChat = ({
|
|
|
1770
1773
|
sessionId: activeNotebook.session_id,
|
|
1771
1774
|
notebookName: activeNotebook.name,
|
|
1772
1775
|
documents: notebookDocuments,
|
|
1776
|
+
isDocumentsFetching,
|
|
1773
1777
|
metadata: activeNotebook.metadata,
|
|
1774
1778
|
topicSummary: conversations.find(
|
|
1775
1779
|
(c) => c.conversation_id === activeNotebook.metadata?.conversation_id
|