@informedai/react 0.2.3 → 0.2.5
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 +65 -42
- package/dist/index.mjs +66 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -746,33 +746,43 @@ function MessageBubble({ message, theme, onQuickAction }) {
|
|
|
746
746
|
const isUser = message.role === "user";
|
|
747
747
|
const hasQuickActions = message.quickActions && message.quickActions.length > 0;
|
|
748
748
|
if ((message.type === "quick_actions" || !message.content) && hasQuickActions) {
|
|
749
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: {
|
|
750
750
|
display: "flex",
|
|
751
|
-
|
|
752
|
-
|
|
751
|
+
flexDirection: "column",
|
|
752
|
+
alignItems: "center",
|
|
753
753
|
gap: "8px",
|
|
754
|
-
padding: "
|
|
755
|
-
}, children:
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
action.id || action.action || index
|
|
763
|
-
)) });
|
|
764
|
-
}
|
|
765
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
766
|
-
"div",
|
|
767
|
-
{
|
|
768
|
-
style: {
|
|
754
|
+
padding: "12px 0"
|
|
755
|
+
}, children: [
|
|
756
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: {
|
|
757
|
+
fontSize: "11px",
|
|
758
|
+
color: "#a3a3a3",
|
|
759
|
+
fontWeight: 500
|
|
760
|
+
}, children: "Quick actions:" }),
|
|
761
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: {
|
|
769
762
|
display: "flex",
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
gap: "
|
|
773
|
-
},
|
|
774
|
-
|
|
775
|
-
|
|
763
|
+
flexWrap: "wrap",
|
|
764
|
+
justifyContent: "center",
|
|
765
|
+
gap: "8px"
|
|
766
|
+
}, children: message.quickActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
767
|
+
QuickActionButton,
|
|
768
|
+
{
|
|
769
|
+
action,
|
|
770
|
+
theme,
|
|
771
|
+
onClick: () => onQuickAction(action)
|
|
772
|
+
},
|
|
773
|
+
action.id || action.action || index
|
|
774
|
+
)) })
|
|
775
|
+
] });
|
|
776
|
+
}
|
|
777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
style: {
|
|
782
|
+
display: "flex",
|
|
783
|
+
justifyContent: isUser ? "flex-end" : "flex-start"
|
|
784
|
+
},
|
|
785
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
776
786
|
"div",
|
|
777
787
|
{
|
|
778
788
|
style: {
|
|
@@ -789,24 +799,37 @@ function MessageBubble({ message, theme, onQuickAction }) {
|
|
|
789
799
|
},
|
|
790
800
|
children: message.content
|
|
791
801
|
}
|
|
792
|
-
)
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
802
|
+
)
|
|
803
|
+
}
|
|
804
|
+
),
|
|
805
|
+
hasQuickActions && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: {
|
|
806
|
+
display: "flex",
|
|
807
|
+
flexDirection: "column",
|
|
808
|
+
alignItems: "center",
|
|
809
|
+
gap: "8px",
|
|
810
|
+
padding: "12px 0"
|
|
811
|
+
}, children: [
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: {
|
|
813
|
+
fontSize: "11px",
|
|
814
|
+
color: "#a3a3a3",
|
|
815
|
+
fontWeight: 500
|
|
816
|
+
}, children: "Quick actions:" }),
|
|
817
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: {
|
|
818
|
+
display: "flex",
|
|
819
|
+
flexWrap: "wrap",
|
|
820
|
+
justifyContent: "center",
|
|
821
|
+
gap: "8px"
|
|
822
|
+
}, children: message.quickActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
823
|
+
QuickActionButton,
|
|
824
|
+
{
|
|
825
|
+
action,
|
|
826
|
+
theme,
|
|
827
|
+
onClick: () => onQuickAction(action)
|
|
828
|
+
},
|
|
829
|
+
action.id || action.action || index
|
|
830
|
+
)) })
|
|
831
|
+
] })
|
|
832
|
+
] });
|
|
810
833
|
}
|
|
811
834
|
function SparklesIcon({ color = "currentColor" }) {
|
|
812
835
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", children: [
|
package/dist/index.mjs
CHANGED
|
@@ -318,7 +318,7 @@ function InformedAIProvider({ config, children }) {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
// src/components/InformedAssistant.tsx
|
|
321
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
321
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
322
322
|
var defaultTheme = {
|
|
323
323
|
primaryColor: "#f59e0b",
|
|
324
324
|
// Amber
|
|
@@ -716,33 +716,43 @@ function MessageBubble({ message, theme, onQuickAction }) {
|
|
|
716
716
|
const isUser = message.role === "user";
|
|
717
717
|
const hasQuickActions = message.quickActions && message.quickActions.length > 0;
|
|
718
718
|
if ((message.type === "quick_actions" || !message.content) && hasQuickActions) {
|
|
719
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ jsxs("div", { style: {
|
|
720
720
|
display: "flex",
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
flexDirection: "column",
|
|
722
|
+
alignItems: "center",
|
|
723
723
|
gap: "8px",
|
|
724
|
-
padding: "
|
|
725
|
-
}, children:
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
action.id || action.action || index
|
|
733
|
-
)) });
|
|
734
|
-
}
|
|
735
|
-
return /* @__PURE__ */ jsxs(
|
|
736
|
-
"div",
|
|
737
|
-
{
|
|
738
|
-
style: {
|
|
724
|
+
padding: "12px 0"
|
|
725
|
+
}, children: [
|
|
726
|
+
/* @__PURE__ */ jsx2("span", { style: {
|
|
727
|
+
fontSize: "11px",
|
|
728
|
+
color: "#a3a3a3",
|
|
729
|
+
fontWeight: 500
|
|
730
|
+
}, children: "Quick actions:" }),
|
|
731
|
+
/* @__PURE__ */ jsx2("div", { style: {
|
|
739
732
|
display: "flex",
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
gap: "
|
|
743
|
-
},
|
|
744
|
-
|
|
745
|
-
|
|
733
|
+
flexWrap: "wrap",
|
|
734
|
+
justifyContent: "center",
|
|
735
|
+
gap: "8px"
|
|
736
|
+
}, children: message.quickActions.map((action, index) => /* @__PURE__ */ jsx2(
|
|
737
|
+
QuickActionButton,
|
|
738
|
+
{
|
|
739
|
+
action,
|
|
740
|
+
theme,
|
|
741
|
+
onClick: () => onQuickAction(action)
|
|
742
|
+
},
|
|
743
|
+
action.id || action.action || index
|
|
744
|
+
)) })
|
|
745
|
+
] });
|
|
746
|
+
}
|
|
747
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
748
|
+
/* @__PURE__ */ jsx2(
|
|
749
|
+
"div",
|
|
750
|
+
{
|
|
751
|
+
style: {
|
|
752
|
+
display: "flex",
|
|
753
|
+
justifyContent: isUser ? "flex-end" : "flex-start"
|
|
754
|
+
},
|
|
755
|
+
children: /* @__PURE__ */ jsx2(
|
|
746
756
|
"div",
|
|
747
757
|
{
|
|
748
758
|
style: {
|
|
@@ -759,24 +769,37 @@ function MessageBubble({ message, theme, onQuickAction }) {
|
|
|
759
769
|
},
|
|
760
770
|
children: message.content
|
|
761
771
|
}
|
|
762
|
-
)
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
772
|
+
)
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
hasQuickActions && /* @__PURE__ */ jsxs("div", { style: {
|
|
776
|
+
display: "flex",
|
|
777
|
+
flexDirection: "column",
|
|
778
|
+
alignItems: "center",
|
|
779
|
+
gap: "8px",
|
|
780
|
+
padding: "12px 0"
|
|
781
|
+
}, children: [
|
|
782
|
+
/* @__PURE__ */ jsx2("span", { style: {
|
|
783
|
+
fontSize: "11px",
|
|
784
|
+
color: "#a3a3a3",
|
|
785
|
+
fontWeight: 500
|
|
786
|
+
}, children: "Quick actions:" }),
|
|
787
|
+
/* @__PURE__ */ jsx2("div", { style: {
|
|
788
|
+
display: "flex",
|
|
789
|
+
flexWrap: "wrap",
|
|
790
|
+
justifyContent: "center",
|
|
791
|
+
gap: "8px"
|
|
792
|
+
}, children: message.quickActions.map((action, index) => /* @__PURE__ */ jsx2(
|
|
793
|
+
QuickActionButton,
|
|
794
|
+
{
|
|
795
|
+
action,
|
|
796
|
+
theme,
|
|
797
|
+
onClick: () => onQuickAction(action)
|
|
798
|
+
},
|
|
799
|
+
action.id || action.action || index
|
|
800
|
+
)) })
|
|
801
|
+
] })
|
|
802
|
+
] });
|
|
780
803
|
}
|
|
781
804
|
function SparklesIcon({ color = "currentColor" }) {
|
|
782
805
|
return /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", children: [
|