@prodact.ai/sdk 0.0.9 → 0.0.10

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/react.js CHANGED
@@ -2031,11 +2031,13 @@ Check the Network tab in DevTools for more details.`
2031
2031
  role: "assistant",
2032
2032
  content: result.message?.content || result.response || "",
2033
2033
  visualFlows: result.flows || [],
2034
- images: result.images || []
2034
+ images: result.images || [],
2035
+ userFlows: result.userFlows || []
2035
2036
  };
2036
2037
  await this.log("info", "Chat response received", {
2037
2038
  hasFlows: (result.flows || []).length > 0,
2038
- hasImages: (result.images || []).length > 0
2039
+ hasImages: (result.images || []).length > 0,
2040
+ hasUserFlows: (result.userFlows || []).length > 0
2039
2041
  });
2040
2042
  this.emit("message", chatMessage);
2041
2043
  return chatMessage;
@@ -3548,6 +3550,80 @@ function ProduckChat({
3548
3550
  ]
3549
3551
  },
3550
3552
  imgIdx
3553
+ )) }),
3554
+ msg.userFlows && msg.userFlows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { marginTop: "12px" }, children: msg.userFlows.filter((uf) => uf.hasReplay).slice(0, 2).map((userFlow, ufIdx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
3555
+ "div",
3556
+ {
3557
+ style: {
3558
+ marginTop: ufIdx > 0 ? "8px" : 0,
3559
+ padding: "12px",
3560
+ borderRadius: "8px",
3561
+ border: `1px solid ${isDark ? "#374151" : "#e5e7eb"}`,
3562
+ backgroundColor: isDark ? "#1f2937" : "#f9fafb"
3563
+ },
3564
+ children: [
3565
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: {
3566
+ display: "flex",
3567
+ alignItems: "center",
3568
+ justifyContent: "space-between",
3569
+ marginBottom: "8px"
3570
+ }, children: [
3571
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
3572
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { fontSize: "16px" }, children: "\u{1F3AC}" }),
3573
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: {
3574
+ fontWeight: 600,
3575
+ fontSize: "13px",
3576
+ color: isDark ? "#f3f4f6" : "#111827"
3577
+ }, children: userFlow.title })
3578
+ ] }),
3579
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: {
3580
+ fontSize: "11px",
3581
+ padding: "2px 6px",
3582
+ backgroundColor: primaryColor + "20",
3583
+ color: primaryColor,
3584
+ borderRadius: "4px"
3585
+ }, children: [
3586
+ userFlow.eventCount,
3587
+ " steps"
3588
+ ] })
3589
+ ] }),
3590
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: {
3591
+ fontSize: "12px",
3592
+ color: isDark ? "#9ca3af" : "#6b7280",
3593
+ marginBottom: "10px",
3594
+ lineHeight: 1.4
3595
+ }, children: userFlow.description }),
3596
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
3597
+ "button",
3598
+ {
3599
+ onClick: () => {
3600
+ const replayUrl = `${window.location.origin}/recordings/${userFlow.recordingId}`;
3601
+ window.open(replayUrl, "_blank", "width=1200,height=800");
3602
+ },
3603
+ style: {
3604
+ display: "flex",
3605
+ alignItems: "center",
3606
+ gap: "6px",
3607
+ padding: "8px 12px",
3608
+ backgroundColor: primaryColor,
3609
+ color: "#fff",
3610
+ border: "none",
3611
+ borderRadius: "6px",
3612
+ fontSize: "12px",
3613
+ fontWeight: 500,
3614
+ cursor: "pointer",
3615
+ width: "100%",
3616
+ justifyContent: "center"
3617
+ },
3618
+ children: [
3619
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u25B6\uFE0F" }),
3620
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Watch Session Replay" })
3621
+ ]
3622
+ }
3623
+ )
3624
+ ]
3625
+ },
3626
+ userFlow.id || ufIdx
3551
3627
  )) })
3552
3628
  ]
3553
3629
  }