@informedai/react 0.2.1 → 0.2.2

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.js CHANGED
@@ -708,7 +708,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
708
708
  const isUser = message.role === "user";
709
709
  const hasQuickActions = message.quickActions && message.quickActions.length > 0;
710
710
  if ((message.type === "quick_actions" || !message.content) && hasQuickActions) {
711
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: message.quickActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
711
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: message.quickActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
712
712
  "button",
713
713
  {
714
714
  onClick: () => onQuickAction(action),
@@ -732,7 +732,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
732
732
  },
733
733
  children: action.label
734
734
  },
735
- action.id
735
+ action.id || action.action || index
736
736
  )) });
737
737
  }
738
738
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -763,7 +763,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
763
763
  children: message.content
764
764
  }
765
765
  ),
766
- hasQuickActions && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", maxWidth: "85%" }, children: message.quickActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
766
+ hasQuickActions && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", maxWidth: "85%" }, children: message.quickActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
767
767
  "button",
768
768
  {
769
769
  onClick: () => onQuickAction(action),
@@ -787,7 +787,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
787
787
  },
788
788
  children: action.label
789
789
  },
790
- action.id
790
+ action.id || action.action || index
791
791
  )) })
792
792
  ]
793
793
  }
package/dist/index.mjs CHANGED
@@ -678,7 +678,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
678
678
  const isUser = message.role === "user";
679
679
  const hasQuickActions = message.quickActions && message.quickActions.length > 0;
680
680
  if ((message.type === "quick_actions" || !message.content) && hasQuickActions) {
681
- return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: message.quickActions.map((action) => /* @__PURE__ */ jsx2(
681
+ return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: message.quickActions.map((action, index) => /* @__PURE__ */ jsx2(
682
682
  "button",
683
683
  {
684
684
  onClick: () => onQuickAction(action),
@@ -702,7 +702,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
702
702
  },
703
703
  children: action.label
704
704
  },
705
- action.id
705
+ action.id || action.action || index
706
706
  )) });
707
707
  }
708
708
  return /* @__PURE__ */ jsxs(
@@ -733,7 +733,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
733
733
  children: message.content
734
734
  }
735
735
  ),
736
- hasQuickActions && /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", maxWidth: "85%" }, children: message.quickActions.map((action) => /* @__PURE__ */ jsx2(
736
+ hasQuickActions && /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", maxWidth: "85%" }, children: message.quickActions.map((action, index) => /* @__PURE__ */ jsx2(
737
737
  "button",
738
738
  {
739
739
  onClick: () => onQuickAction(action),
@@ -757,7 +757,7 @@ function MessageBubble({ message, theme, onQuickAction }) {
757
757
  },
758
758
  children: action.label
759
759
  },
760
- action.id
760
+ action.id || action.action || index
761
761
  )) })
762
762
  ]
763
763
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@informedai/react",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "React SDK for InformedAI Assistant - AI-powered content creation widget",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",