@axiom-lattice/react-sdk 2.1.107 → 2.1.108

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/index.mjs CHANGED
@@ -2365,7 +2365,7 @@ function AgentThreadProvider({
2365
2365
  stopStreamingRef.current();
2366
2366
  stopStreamingRef.current = null;
2367
2367
  }
2368
- setState((prev) => ({ ...prev, isLoading: true, error: null }));
2368
+ setState((prev) => ({ ...prev, messages: [], isLoading: true, error: null }));
2369
2369
  try {
2370
2370
  const agentState = await client.getAgentState(threadId);
2371
2371
  const currentCreatedAt = agentState?.createdAt;
@@ -14825,6 +14825,9 @@ var ClarifyFeedback = ({
14825
14825
  if (currentQuestion.type === "file_upload") {
14826
14826
  return !!(answer?.filePath && answer.filePath.trim() !== "");
14827
14827
  }
14828
+ if (currentQuestion.type === "input") {
14829
+ return !!(answer?.otherText && answer.otherText.trim() !== "");
14830
+ }
14828
14831
  const hasSelection = answer?.selectedOptions?.length > 0;
14829
14832
  const hasOtherText = answer?.otherText?.trim() !== "";
14830
14833
  return hasSelection || hasOtherText;
@@ -14987,16 +14990,58 @@ var ClarifyFeedback = ({
14987
14990
  ]
14988
14991
  }
14989
14992
  )
14990
- ] }) : /* @__PURE__ */ jsx43(
14991
- Checkbox6.Group,
14993
+ ] }) : currentQuestion.type === "input" ? /* @__PURE__ */ jsx43(
14994
+ Input15,
14992
14995
  {
14993
- value: currentAnswer.selectedOptions,
14994
- onChange: (values) => handleOptionChange(values),
14996
+ placeholder: "Enter your answer...",
14997
+ value: currentAnswer.otherText,
14998
+ onChange: (e) => handleOtherTextChange(e.target.value),
14995
14999
  disabled: !interactive || submitted,
14996
- style: { display: "flex", flexDirection: "column", gap: 4 },
14997
- children: currentQuestion.options.map((option) => /* @__PURE__ */ jsx43(Checkbox6, { value: option, style: { fontSize: 14 }, children: option }, option))
15000
+ style: { fontSize: 14 }
14998
15001
  }
14999
- ) }),
15002
+ ) : /* @__PURE__ */ jsxs32(Fragment13, { children: [
15003
+ /* @__PURE__ */ jsx43(
15004
+ Checkbox6.Group,
15005
+ {
15006
+ value: currentAnswer.selectedOptions,
15007
+ onChange: (values) => handleOptionChange(values),
15008
+ disabled: !interactive || submitted,
15009
+ style: { display: "flex", flexDirection: "column", gap: 4 },
15010
+ children: currentQuestion.options.map((option) => /* @__PURE__ */ jsx43(Checkbox6, { value: option, style: { fontSize: 14 }, children: option }, option))
15011
+ }
15012
+ ),
15013
+ currentQuestion.allowOther && /* @__PURE__ */ jsxs32("div", { style: { marginTop: 8 }, children: [
15014
+ /* @__PURE__ */ jsx43(
15015
+ Checkbox6,
15016
+ {
15017
+ checked: currentAnswer.selectedOptions.includes("__other__"),
15018
+ onChange: (e) => {
15019
+ const current = currentAnswer.selectedOptions || [];
15020
+ if (e.target.checked) {
15021
+ handleOptionChange([...current, "__other__"]);
15022
+ } else {
15023
+ handleOptionChange(current.filter((o) => o !== "__other__"));
15024
+ handleOtherTextChange("");
15025
+ }
15026
+ },
15027
+ disabled: !interactive || submitted,
15028
+ style: { fontSize: 14 },
15029
+ children: "Other (please specify)"
15030
+ }
15031
+ ),
15032
+ currentAnswer.selectedOptions.includes("__other__") && /* @__PURE__ */ jsx43(
15033
+ Input15,
15034
+ {
15035
+ size: "small",
15036
+ placeholder: "Enter your answer...",
15037
+ value: currentAnswer.otherText,
15038
+ onChange: (e) => handleOtherTextChange(e.target.value),
15039
+ disabled: !interactive || submitted,
15040
+ style: { fontSize: 14, marginTop: 8, marginLeft: 24, width: "calc(100% - 24px)" }
15041
+ }
15042
+ )
15043
+ ] })
15044
+ ] }) }),
15000
15045
  /* @__PURE__ */ jsxs32(
15001
15046
  Space15,
15002
15047
  {
@@ -15363,7 +15408,7 @@ var ToolCard = ({
15363
15408
  size: "small",
15364
15409
  className: styles.card,
15365
15410
  bordered: false,
15366
- bodyStyle: { padding: "16px" },
15411
+ styles: { body: { padding: "16px" } },
15367
15412
  children: [
15368
15413
  /* @__PURE__ */ jsxs34("div", { className: styles.header, children: [
15369
15414
  /* @__PURE__ */ jsxs34(Space17, { align: "center", children: [
@@ -32926,7 +32971,7 @@ var PersonalAssistantChannelModal = ({
32926
32971
  bindingsLoadIdRef.current = requestId;
32927
32972
  setBindingsLoading(true);
32928
32973
  try {
32929
- const res = await get(`/api/channel-bindings?channelInstallationId=${installationId}`);
32974
+ const res = await get(`/api/channel-bindings?channelInstallationId=${installationId}&agentId=${assistantId}`);
32930
32975
  if (bindingsLoadIdRef.current !== requestId) return;
32931
32976
  if (res.success) {
32932
32977
  setBindings(res.data?.records ?? []);
@@ -34726,11 +34771,8 @@ var WorkspaceResourceManager = ({
34726
34771
  }
34727
34772
  }, [fetchedCustomMenuItems]);
34728
34773
  const menuItems = useMemo35(() => {
34729
- const workspaceMenu = config.workspaceMenuItems?.length ? config.workspaceMenuItems : void 0;
34730
- if (workspaceMenu) {
34731
- return [...workspaceMenu].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
34732
- }
34733
- const merged = fetchedCustomMenuItems.length > 0 ? mergeMenuItems(DEFAULT_WORKSPACE_MENU_ITEMS, fetchedCustomMenuItems) : [...DEFAULT_WORKSPACE_MENU_ITEMS];
34774
+ const base = config.workspaceMenuItems?.length ? config.workspaceMenuItems : DEFAULT_WORKSPACE_MENU_ITEMS;
34775
+ const merged = fetchedCustomMenuItems.length > 0 ? mergeMenuItems([...base], fetchedCustomMenuItems) : [...base];
34734
34776
  return merged;
34735
34777
  }, [config.workspaceMenuItems, fetchedCustomMenuItems]);
34736
34778
  const getContextMenuItems = useCallback44(