@erpsquad/common 1.10.77 → 1.10.79

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.
Files changed (44) hide show
  1. package/dist/chunks/{android-12-switch-CoMylrig.js → android-12-switch-BgFAxJ9x.js} +289 -229
  2. package/dist/chunks/{android-12-switch-CoMylrig.js.map → android-12-switch-BgFAxJ9x.js.map} +1 -1
  3. package/dist/chunks/{android-12-switch-CJmu5zpr.esm.js → android-12-switch-DoExcS1P.esm.js} +289 -229
  4. package/dist/chunks/{android-12-switch-CJmu5zpr.esm.js.map → android-12-switch-DoExcS1P.esm.js.map} +1 -1
  5. package/dist/chunks/{appbar-DELlMlbx.esm.js → appbar-D1L6GTYk.esm.js} +30 -25
  6. package/dist/chunks/appbar-D1L6GTYk.esm.js.map +1 -0
  7. package/dist/chunks/{appbar-xuAwm7L1.js → appbar-D424Z-Ai.js} +30 -25
  8. package/dist/chunks/appbar-D424Z-Ai.js.map +1 -0
  9. package/dist/chunks/{default-data-Bhdk8Rkn.esm.js → default-data-CdhwU3H3.esm.js} +3 -3
  10. package/dist/chunks/{default-data-Bhdk8Rkn.esm.js.map → default-data-CdhwU3H3.esm.js.map} +1 -1
  11. package/dist/chunks/{default-data-C_eEc8KO.js → default-data-Cgb7xKe1.js} +3 -3
  12. package/dist/chunks/{default-data-C_eEc8KO.js.map → default-data-Cgb7xKe1.js.map} +1 -1
  13. package/dist/chunks/{fullScreen-B0QUzNj3.js → fullScreen-BUbaMxdQ.js} +2 -2
  14. package/dist/chunks/{fullScreen-B0QUzNj3.js.map → fullScreen-BUbaMxdQ.js.map} +1 -1
  15. package/dist/chunks/{fullScreen-C8dcx8pG.esm.js → fullScreen-COa9H9T5.esm.js} +2 -2
  16. package/dist/chunks/{fullScreen-C8dcx8pG.esm.js.map → fullScreen-COa9H9T5.esm.js.map} +1 -1
  17. package/dist/chunks/{sidebar-fZ9vocVX.esm.js → sidebar-D5jsYGs8.esm.js} +2 -2
  18. package/dist/chunks/{sidebar-fZ9vocVX.esm.js.map → sidebar-D5jsYGs8.esm.js.map} +1 -1
  19. package/dist/chunks/{sidebar-BC824FOR.js → sidebar-DvPIFrpF.js} +2 -2
  20. package/dist/chunks/{sidebar-BC824FOR.js.map → sidebar-DvPIFrpF.js.map} +1 -1
  21. package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js → sidebarScreen-B4RSyJAT.esm.js} +3 -3
  22. package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js.map → sidebarScreen-B4RSyJAT.esm.js.map} +1 -1
  23. package/dist/chunks/{sidebarScreen-B08K08t5.js → sidebarScreen-CFDnYrtL.js} +3 -3
  24. package/dist/chunks/{sidebarScreen-B08K08t5.js.map → sidebarScreen-CFDnYrtL.js.map} +1 -1
  25. package/dist/chunks/{uom-field-wrapper-BmRhzpUZ.js → uom-field-wrapper-DGt-0_BI.js} +359 -221
  26. package/dist/chunks/{uom-field-wrapper-BmRhzpUZ.js.map → uom-field-wrapper-DGt-0_BI.js.map} +1 -1
  27. package/dist/chunks/{uom-field-wrapper-GQYKNbtK.esm.js → uom-field-wrapper-_O6BmPp4.esm.js} +360 -222
  28. package/dist/chunks/{uom-field-wrapper-GQYKNbtK.esm.js.map → uom-field-wrapper-_O6BmPp4.esm.js.map} +1 -1
  29. package/dist/components/chat-bot/doc-intro.d.ts +4 -2
  30. package/dist/components/index.esm.js +4 -4
  31. package/dist/components/index.js +4 -4
  32. package/dist/components/material-table/components/inline-edit-fields.d.ts +9 -9
  33. package/dist/index.esm.js +7 -7
  34. package/dist/index.js +7 -7
  35. package/dist/layout/index.esm.js +2 -2
  36. package/dist/layout/index.js +2 -2
  37. package/dist/src/components/chat-bot/doc-intro.d.ts +4 -2
  38. package/dist/src/components/material-table/components/inline-edit-fields.d.ts +9 -9
  39. package/dist/style.css +10 -1
  40. package/dist/views/index.esm.js +5 -5
  41. package/dist/views/index.js +4 -4
  42. package/package.json +1 -1
  43. package/dist/chunks/appbar-DELlMlbx.esm.js.map +0 -1
  44. package/dist/chunks/appbar-xuAwm7L1.js.map +0 -1
@@ -1085,24 +1085,28 @@ const DocStatus = ({ document: document2, onReady, onError, getStatus }) => {
1085
1085
  ] })
1086
1086
  ] });
1087
1087
  };
1088
- const DocIntro = ({ document: document2, onSuggestion }) => {
1089
- var _a;
1090
- if (!document2.summary && !((_a = document2.suggested_questions) == null ? void 0 : _a.length)) return null;
1088
+ const DocIntro = ({ document: document2, documents, suggestedQuestions, onSuggestion }) => {
1089
+ const docsToRender = documents && documents.length > 0 ? documents : document2 ? [document2] : [];
1090
+ const questionsToRender = suggestedQuestions && suggestedQuestions.length > 0 ? suggestedQuestions : document2 == null ? void 0 : document2.suggested_questions;
1091
+ if (docsToRender.length === 0) return null;
1092
+ if (!docsToRender.some((d) => d.summary) && !(questionsToRender == null ? void 0 : questionsToRender.length)) return null;
1091
1093
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-card", children: [
1092
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-head", children: [
1093
- /* @__PURE__ */ jsxRuntimeExports.jsx(PictureAsPdfRounded, { sx: { fontSize: 16, color: "#C62828" } }),
1094
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-head-info", children: [
1095
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "chatBot--doc-intro-filename", children: document2.filename }),
1096
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "chatBot--doc-intro-meta", children: document2.category && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1097
- document2.category,
1098
- document2.sub_category ? ` · ${document2.sub_category}` : ""
1099
- ] }) })
1100
- ] })
1101
- ] }),
1102
- document2.summary && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "chatBot--doc-intro-summary", children: document2.summary }),
1103
- document2.suggested_questions && document2.suggested_questions.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-questions", children: [
1094
+ docsToRender.map((doc, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { borderBottom: idx < docsToRender.length - 1 && docsToRender.length > 1 ? "1px solid #F2F3F4" : "none" }, children: [
1095
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-head", children: [
1096
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PictureAsPdfRounded, { sx: { fontSize: 16, color: "#C62828" } }),
1097
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-head-info", children: [
1098
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "chatBot--doc-intro-filename", children: doc.filename }),
1099
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "chatBot--doc-intro-meta", children: doc.category && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1100
+ doc.category,
1101
+ doc.sub_category ? ` · ${doc.sub_category}` : ""
1102
+ ] }) })
1103
+ ] })
1104
+ ] }),
1105
+ doc.summary && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "chatBot--doc-intro-summary", children: doc.summary })
1106
+ ] }, doc.doc_id || idx)),
1107
+ questionsToRender && questionsToRender.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chatBot--doc-intro-questions", children: [
1104
1108
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "chatBot--doc-intro-q-label", children: "Suggested questions" }),
1105
- document2.suggested_questions.map((q, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "chatBot--doc-intro-q-btn", onClick: () => onSuggestion(q), children: q }, i))
1109
+ questionsToRender.map((q, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "chatBot--doc-intro-q-btn", onClick: () => onSuggestion(q), children: q }, i))
1106
1110
  ] })
1107
1111
  ] });
1108
1112
  };
@@ -1134,6 +1138,7 @@ const ChatBot = () => {
1134
1138
  const [docError, setDocError] = useState(null);
1135
1139
  const [activeDocuments, setActiveDocuments] = useState([]);
1136
1140
  const [suggestedQuestions, setSuggestedQuestions] = useState([]);
1141
+ const fetchedMultiDocIntroIds = useRef("");
1137
1142
  const firstName = (user == null ? void 0 : user.first_name) || "";
1138
1143
  const filteredMessages = useMemo(
1139
1144
  () => messages.filter((m) => !m.mode || m.mode === mode),
@@ -1169,7 +1174,7 @@ const ChatBot = () => {
1169
1174
  if (!userScrolledUp.current && bodyRef.current) {
1170
1175
  bodyRef.current.scrollTop = bodyRef.current.scrollHeight;
1171
1176
  }
1172
- }, [messages, isTyping, currentFieldUpdates, resolvedLabels]);
1177
+ }, [messages, isTyping, currentFieldUpdates, resolvedLabels, activeDocument, activeDocuments, suggestedQuestions]);
1173
1178
  const selectCommand = (id) => {
1174
1179
  setMode(id);
1175
1180
  setShowSlashMenu(false);
@@ -1318,8 +1323,9 @@ const ChatBot = () => {
1318
1323
  const checkAndSendMultiDocIntro = useCallback((docs) => {
1319
1324
  if (docs.length === 0) return;
1320
1325
  if (docs.some((d) => d.status !== "ready")) return;
1321
- if (docIntroSent) return;
1322
- setDocIntroSent(true);
1326
+ const currentIds = docs.map((d) => d.doc_id).sort().join(",");
1327
+ if (fetchedMultiDocIntroIds.current === currentIds) return;
1328
+ fetchedMultiDocIntroIds.current = currentIds;
1323
1329
  streamV1CopilotChat(
1324
1330
  { ...getToken(), query: "", doc_ids: docs.map((d) => d.doc_id), doc_intro: true },
1325
1331
  () => {
@@ -1434,6 +1440,7 @@ const ChatBot = () => {
1434
1440
  setDocIntroSent(false);
1435
1441
  setDocError(null);
1436
1442
  setSuggestedQuestions([]);
1443
+ fetchedMultiDocIntroIds.current = "";
1437
1444
  } catch {
1438
1445
  setDocError("Failed to delete document(s). Please try again.");
1439
1446
  }
@@ -1794,6 +1801,7 @@ const ChatBot = () => {
1794
1801
  setActiveDocuments([]);
1795
1802
  setSuggestedQuestions([]);
1796
1803
  setMessages([]);
1804
+ fetchedMultiDocIntroIds.current = "";
1797
1805
  }
1798
1806
  }
1799
1807
  ),
@@ -1818,11 +1826,8 @@ const ChatBot = () => {
1818
1826
  activeDocuments.length > 0 && mode === "doc_qa" && activeDocuments.every((d) => d.status === "ready") && !docIntroSent && filteredMessages.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
1819
1827
  DocIntro,
1820
1828
  {
1821
- document: {
1822
- ...activeDocuments[0],
1823
- summary: activeDocuments.length === 1 ? activeDocuments[0].summary : "Multiple documents are ready for Q&A.",
1824
- suggested_questions: suggestedQuestions.length > 0 ? suggestedQuestions : activeDocuments[0].suggested_questions
1825
- },
1829
+ documents: activeDocuments,
1830
+ suggestedQuestions: suggestedQuestions.length > 0 ? suggestedQuestions : activeDocuments[0].suggested_questions,
1826
1831
  onSuggestion: (q) => {
1827
1832
  setDocIntroSent(true);
1828
1833
  setInputValue(q);
@@ -10131,4 +10136,4 @@ export {
10131
10136
  List as y,
10132
10137
  Typography as z
10133
10138
  };
10134
- //# sourceMappingURL=appbar-DELlMlbx.esm.js.map
10139
+ //# sourceMappingURL=appbar-D1L6GTYk.esm.js.map