@sensiblestats/widget-react 0.23.0 → 0.23.1
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/CHANGELOG.md +8 -0
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -322,8 +322,9 @@ function toCardVM(card) {
|
|
|
322
322
|
function toActionVM(action) {
|
|
323
323
|
const label = str(action.actionLabel) ?? str(action.label) ?? str(action.text) ?? str(action.title) ?? "Continue";
|
|
324
324
|
const actionId = str(action.actionId) ?? str(action.id);
|
|
325
|
+
const actionRef = str(action.actionRef);
|
|
325
326
|
const message = str(action.actionValue) ?? str(action.message) ?? str(action.query) ?? label;
|
|
326
|
-
return { label, actionId, message };
|
|
327
|
+
return { label, actionId, actionRef, message };
|
|
327
328
|
}
|
|
328
329
|
function toChipVM(intent) {
|
|
329
330
|
const text = str(intent.text) ?? str(intent.label) ?? str(intent.title);
|
|
@@ -1562,7 +1563,7 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip }) {
|
|
|
1562
1563
|
return /* @__PURE__ */ jsx26("div", { className: "ss-w-msg ss-w-user", children: /* @__PURE__ */ jsx26("div", { className: "ss-w-bubble", children: message.text }) });
|
|
1563
1564
|
}
|
|
1564
1565
|
const onFanDashboardTap = (card) => {
|
|
1565
|
-
onAct({ message: card.
|
|
1566
|
+
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
1566
1567
|
};
|
|
1567
1568
|
return /* @__PURE__ */ jsxs22("div", { className: "ss-w-msg ss-w-bot", children: [
|
|
1568
1569
|
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx26(Markdown, { text: message.text }) : null,
|
|
@@ -1616,7 +1617,7 @@ function MessageList({ controller, ui, slip, onDashboardTap }) {
|
|
|
1616
1617
|
{
|
|
1617
1618
|
message: m,
|
|
1618
1619
|
disabled: state.isStreaming,
|
|
1619
|
-
onAct: (a) => send(a.message, { actionId: a.actionId, displayText: a.label }),
|
|
1620
|
+
onAct: (a) => send(a.message, { actionId: a.actionId, actionRef: a.actionRef, displayText: a.label }),
|
|
1620
1621
|
onTap: (tile, index) => {
|
|
1621
1622
|
send(tile.actionValue, { displayText: tile.title });
|
|
1622
1623
|
if (m.role === "assistant" && m.greetingDashboard) onDashboardTap?.(tile, index, m.greetingDashboard.layout);
|