@usereq/widget 0.2.4 → 0.2.6
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/widget.js +415 -415
- package/package.json +2 -2
- package/src/custom-element/agent-widget-element.tsx +5 -0
- package/src/renderer/widget-runtime.tsx +4 -0
- package/src/types.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereq/widget",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@streamdown/mermaid": "^1.0.2",
|
|
79
|
-
"@usereq/ui": "^0.2.
|
|
79
|
+
"@usereq/ui": "^0.2.5",
|
|
80
80
|
"lucide-react": "^0.553.0",
|
|
81
81
|
"motion": "^12.23.24",
|
|
82
82
|
"react": "^19.2.0",
|
|
@@ -190,6 +190,10 @@ export class AgentWidgetElement extends HTMLElement {
|
|
|
190
190
|
return this.sessionConfig?.widgetConfig.spotlightMessages ?? [];
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
private getCtaLink(): string | null {
|
|
194
|
+
return this.sessionConfig?.widgetConfig.ctaLink ?? null;
|
|
195
|
+
}
|
|
196
|
+
|
|
193
197
|
private clearAgentState() {
|
|
194
198
|
this.sendVersion += 1;
|
|
195
199
|
this.confirmationVersion += 1;
|
|
@@ -261,6 +265,7 @@ export class AgentWidgetElement extends HTMLElement {
|
|
|
261
265
|
widgetTitle: this.getWidgetTitle(),
|
|
262
266
|
welcomeMessage: this.getWelcomeMessage(),
|
|
263
267
|
spotlights: this.getSpotlights(),
|
|
268
|
+
ctaLink: this.getCtaLink(),
|
|
264
269
|
open: this.open,
|
|
265
270
|
status: this.status,
|
|
266
271
|
messages: this.messages,
|
|
@@ -48,6 +48,7 @@ export type WidgetRuntimeProps = {
|
|
|
48
48
|
widgetTitle: string;
|
|
49
49
|
welcomeMessage: string | null;
|
|
50
50
|
spotlights: string[];
|
|
51
|
+
ctaLink?: string | null;
|
|
51
52
|
open: boolean;
|
|
52
53
|
status: WidgetRuntimeStatus;
|
|
53
54
|
messages: WidgetMessage[];
|
|
@@ -85,6 +86,7 @@ export function WidgetRuntime({
|
|
|
85
86
|
widgetTitle,
|
|
86
87
|
welcomeMessage,
|
|
87
88
|
spotlights,
|
|
89
|
+
ctaLink,
|
|
88
90
|
open,
|
|
89
91
|
status,
|
|
90
92
|
messages,
|
|
@@ -127,12 +129,14 @@ export function WidgetRuntime({
|
|
|
127
129
|
appearance: toChatAppearance(appearance),
|
|
128
130
|
welcomeMessage,
|
|
129
131
|
spotlights,
|
|
132
|
+
ctaLink,
|
|
130
133
|
actionLabel: appearance.actionText || undefined,
|
|
131
134
|
showStopConversation: Boolean(onStopConversation),
|
|
132
135
|
}),
|
|
133
136
|
[
|
|
134
137
|
agentAvatarUrl,
|
|
135
138
|
appearance,
|
|
139
|
+
ctaLink,
|
|
136
140
|
onStopConversation,
|
|
137
141
|
placement,
|
|
138
142
|
preset,
|
package/src/types.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type WidgetSessionConfig = {
|
|
|
35
35
|
agentAvatarUrl: string | null;
|
|
36
36
|
welcomeMessage: string | null;
|
|
37
37
|
spotlightMessages: string[];
|
|
38
|
+
ctaLink: string | null;
|
|
38
39
|
widgetAppearance: WidgetAppearance;
|
|
39
40
|
widgetBehavior: WidgetBehavior;
|
|
40
41
|
widgetVariant: WidgetVariant;
|