@ensembleapp/client-sdk 0.0.22 → 0.0.23
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.d.ts +2 -1
- package/dist/index.js +34 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -346,7 +346,8 @@ declare global {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
declare const defaultChatWidgets: UIWidgetDefinition[];
|
|
349
|
+
declare const getVendorCardsWidget: (isProd?: boolean) => UIWidgetDefinition[];
|
|
349
350
|
|
|
350
351
|
declare function cn(...inputs: ClassValue[]): string;
|
|
351
352
|
|
|
352
|
-
export { type ApiConfig, type ChatContentItem, type ChatMessage, ChatWidget, type ChatWidgetFeedbackOptions, type ChatWidgetConfig as ChatWidgetProps, type ChatWidgetSpeechToTextOptions, type ChatWidgetStyles, type ChatWidgetVoiceOptions, type EmbeddableChatWidgetConfig, type EnrichedResults, type FeedbackRating, type FeedbackState, type MessageFeedback, type MessageSection, type PopupAnchorConfig, PopupChatWidget, type PopupChatWidgetProps, type SubmitFeedbackParams, type TagGroup, TagGroupDisplay, type TagGroupDisplayProps, type ToolCallContent, ToolCallDisplay, type ToolCallDisplayProps, type UIWidgetDefinition, type UseChatConfig, type UseFeedbackConfig, type WidgetEnrichConfig, cn, createWidget, defaultChatWidgets, registerChatWidgets, useChat, useFeedback };
|
|
353
|
+
export { type ApiConfig, type ChatContentItem, type ChatMessage, ChatWidget, type ChatWidgetFeedbackOptions, type ChatWidgetConfig as ChatWidgetProps, type ChatWidgetSpeechToTextOptions, type ChatWidgetStyles, type ChatWidgetVoiceOptions, type EmbeddableChatWidgetConfig, type EnrichedResults, type FeedbackRating, type FeedbackState, type MessageFeedback, type MessageSection, type PopupAnchorConfig, PopupChatWidget, type PopupChatWidgetProps, type SubmitFeedbackParams, type TagGroup, TagGroupDisplay, type TagGroupDisplayProps, type ToolCallContent, ToolCallDisplay, type ToolCallDisplayProps, type UIWidgetDefinition, type UseChatConfig, type UseFeedbackConfig, type WidgetEnrichConfig, cn, createWidget, defaultChatWidgets, getVendorCardsWidget, registerChatWidgets, useChat, useFeedback };
|
package/dist/index.js
CHANGED
|
@@ -25102,36 +25102,42 @@ var defaultChatWidgets = [
|
|
|
25102
25102
|
children: payload.text || payload.uri
|
|
25103
25103
|
}
|
|
25104
25104
|
)
|
|
25105
|
-
})
|
|
25106
|
-
|
|
25107
|
-
|
|
25108
|
-
|
|
25109
|
-
|
|
25110
|
-
|
|
25111
|
-
|
|
25112
|
-
|
|
25113
|
-
|
|
25114
|
-
|
|
25105
|
+
})
|
|
25106
|
+
];
|
|
25107
|
+
var getVendorCardsWidget = (isProd) => {
|
|
25108
|
+
const vendorDetailsToolId = isProd ? "86dc78e28f933225750d9bcff7c94b18-CPgsswom7FkUYvplmy6H" : "CPgsswom7FkUYvplmy6H";
|
|
25109
|
+
const distanceMatrixToolId = isProd ? "86dc78e28f933225750d9bcff7c94b18-DwsbeKAxOctXSGgghvW8" : "DwsbeKAxOctXSGgghvW8";
|
|
25110
|
+
return [
|
|
25111
|
+
createWidget({
|
|
25112
|
+
widgetType: "vendor-cards",
|
|
25113
|
+
schema: vendorCardsSchema,
|
|
25114
|
+
enrich: {
|
|
25115
|
+
/** fetch vendor details from the list of IDs */
|
|
25116
|
+
vendorDetails: {
|
|
25117
|
+
toolId: vendorDetailsToolId,
|
|
25118
|
+
inputs: {
|
|
25119
|
+
vendorIds: "${vendors|map('vendor_id')|join(',')}"
|
|
25120
|
+
}
|
|
25121
|
+
},
|
|
25122
|
+
/* calculate distance from user to each vendor */
|
|
25123
|
+
distanceMatrix: {
|
|
25124
|
+
toolId: distanceMatrixToolId,
|
|
25125
|
+
inputs: {
|
|
25126
|
+
origin: "${fromCoordinates}",
|
|
25127
|
+
destinations: "${vendors|map('vendorCoordinates')}"
|
|
25128
|
+
}
|
|
25115
25129
|
}
|
|
25116
25130
|
},
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
destinations: "${vendors|map('vendorCoordinates')}"
|
|
25131
|
+
render: (payload, enriched) => /* @__PURE__ */ jsx8(
|
|
25132
|
+
VendorCards,
|
|
25133
|
+
{
|
|
25134
|
+
payload,
|
|
25135
|
+
enriched
|
|
25123
25136
|
}
|
|
25124
|
-
|
|
25125
|
-
}
|
|
25126
|
-
|
|
25127
|
-
|
|
25128
|
-
{
|
|
25129
|
-
payload,
|
|
25130
|
-
enriched
|
|
25131
|
-
}
|
|
25132
|
-
)
|
|
25133
|
-
})
|
|
25134
|
-
];
|
|
25137
|
+
)
|
|
25138
|
+
})
|
|
25139
|
+
];
|
|
25140
|
+
};
|
|
25135
25141
|
export {
|
|
25136
25142
|
ChatWidget,
|
|
25137
25143
|
PopupChatWidget,
|
|
@@ -25140,6 +25146,7 @@ export {
|
|
|
25140
25146
|
cn,
|
|
25141
25147
|
createWidget,
|
|
25142
25148
|
defaultChatWidgets,
|
|
25149
|
+
getVendorCardsWidget,
|
|
25143
25150
|
registerChatWidgets,
|
|
25144
25151
|
useChat,
|
|
25145
25152
|
useFeedback
|