@marketrix.ai/widget 3.8.461 → 3.8.463
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/src/components/base/Button.d.ts +1 -2
- package/dist/src/components/base/Spinner.d.ts +1 -4
- package/dist/src/context/sseReducer.d.ts +6 -0
- package/dist/src/design-system/semantic-tokens.d.ts +1 -0
- package/dist/src/sdk/contract.d.ts +0 -4
- package/dist/src/sdk/contracts/entities.d.ts +38 -0
- package/dist/src/sdk/contracts/widget.d.ts +24 -58
- package/dist/src/sdk/index.d.ts +0 -4
- package/dist/widget.mjs +16 -18
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -6,12 +6,11 @@ type ButtonShape = 'default' | 'theme' | 'pill';
|
|
|
6
6
|
export interface ButtonProps extends ComponentPropsWithRef<'button'> {
|
|
7
7
|
active?: boolean;
|
|
8
8
|
elevation?: ShadowToken;
|
|
9
|
-
loading?: boolean;
|
|
10
9
|
size?: ButtonSize;
|
|
11
10
|
shape?: ButtonShape;
|
|
12
11
|
stacked?: boolean;
|
|
13
12
|
variant?: ButtonVariant;
|
|
14
13
|
full?: boolean;
|
|
15
14
|
}
|
|
16
|
-
export declare function Button({ active, className, disabled, elevation, full,
|
|
15
|
+
export declare function Button({ active, className, disabled, elevation, full, shape, size, stacked, type, variant, style, ref, ...props }: ButtonProps): import("react").JSX.Element;
|
|
17
16
|
export {};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties, Ref } from 'react';
|
|
2
2
|
type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface SpinnerProps {
|
|
4
|
-
label?: string;
|
|
5
4
|
size?: SpinnerSize;
|
|
6
|
-
/** @internal blocks/ only */
|
|
7
|
-
className?: string;
|
|
8
5
|
style?: CSSProperties;
|
|
9
6
|
ref?: Ref<HTMLDivElement>;
|
|
10
7
|
}
|
|
11
|
-
export declare function Spinner({
|
|
8
|
+
export declare function Spinner({ size, style, ref }: SpinnerProps): import("react").JSX.Element;
|
|
12
9
|
export {};
|
|
@@ -26,6 +26,12 @@ type ProgressStatus = 'in_progress' | 'completed' | 'failed';
|
|
|
26
26
|
export declare function reduceToolProgress(state: SseState, browserToolName: string, explanation: string, status: ProgressStatus, currentMode: InstructionType, error?: string): SseState;
|
|
27
27
|
export declare function reduceToolDone(state: SseState, currentMode: InstructionType): SseState;
|
|
28
28
|
export declare function reduceStop(state: SseState, currentMode: InstructionType): SseState;
|
|
29
|
+
declare const TASK_STATUS: {
|
|
30
|
+
readonly completed: "done";
|
|
31
|
+
readonly failed: "failed";
|
|
32
|
+
readonly stopped: "stopped";
|
|
33
|
+
};
|
|
34
|
+
export declare const isTerminalTaskStatus: (status: string) => status is keyof typeof TASK_STATUS;
|
|
29
35
|
/** Settles a pending message into a plain error bubble — the one shape for both a failed POST and a chat/error. */
|
|
30
36
|
export declare function reduceError(state: SseState, messageId: string, text: string): SseState;
|
|
31
37
|
export declare function reduceSse(state: SseState, event: WidgetEvent, currentMode: InstructionType): ReduceResult;
|
|
@@ -20,6 +20,7 @@ type SemanticTokens = {
|
|
|
20
20
|
durationFade: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export declare const WIDGET_RADIUS_PX = 12;
|
|
23
24
|
export declare function createSemanticTokens(settings?: Partial<WidgetSettingsData>): SemanticTokens;
|
|
24
25
|
export declare function semanticTokensToCssCustomProperties(tokens: SemanticTokens): Record<string, string>;
|
|
25
26
|
export {};
|
|
@@ -389,8 +389,6 @@ export declare const widgetContract: {
|
|
|
389
389
|
type: "task/status";
|
|
390
390
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
391
391
|
message?: string | undefined;
|
|
392
|
-
task_id?: string | undefined;
|
|
393
|
-
timestamp?: number | undefined;
|
|
394
392
|
} | {
|
|
395
393
|
type: "tool/call";
|
|
396
394
|
tool_call_id: string;
|
|
@@ -420,8 +418,6 @@ export declare const widgetContract: {
|
|
|
420
418
|
type: "task/status";
|
|
421
419
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
422
420
|
message?: string | undefined;
|
|
423
|
-
task_id?: string | undefined;
|
|
424
|
-
timestamp?: number | undefined;
|
|
425
421
|
} | {
|
|
426
422
|
type: "tool/call";
|
|
427
423
|
tool_call_id: string;
|
|
@@ -163,6 +163,44 @@ export declare const WidgetSettingsDataSchema: z.ZodObject<{
|
|
|
163
163
|
}, z.core.$strip>>;
|
|
164
164
|
}, z.core.$strip>;
|
|
165
165
|
export type WidgetSettingsData = z.infer<typeof WidgetSettingsDataSchema>;
|
|
166
|
+
export declare const WIDGET_RENDER_CONSTANTS: readonly ["widget_border_radius", "widget_font_size", "widget_animation_duration", "widget_fade_duration"];
|
|
167
|
+
export declare const WidgetSettingsWriteSchema: z.ZodObject<{
|
|
168
|
+
widget_enabled: z.ZodBoolean;
|
|
169
|
+
widget_appearance: z.ZodEnum<{
|
|
170
|
+
default: "default";
|
|
171
|
+
hidden: "hidden";
|
|
172
|
+
}>;
|
|
173
|
+
widget_position: z.ZodEnum<{
|
|
174
|
+
bottom_left: "bottom_left";
|
|
175
|
+
bottom_right: "bottom_right";
|
|
176
|
+
top_left: "top_left";
|
|
177
|
+
top_right: "top_right";
|
|
178
|
+
}>;
|
|
179
|
+
widget_header: z.ZodString;
|
|
180
|
+
widget_body: z.ZodString;
|
|
181
|
+
widget_greeting: z.ZodString;
|
|
182
|
+
widget_greeting_toast: z.ZodBoolean;
|
|
183
|
+
widget_recording: z.ZodBoolean;
|
|
184
|
+
widget_feature_tell: z.ZodBoolean;
|
|
185
|
+
widget_feature_show: z.ZodBoolean;
|
|
186
|
+
widget_feature_do: z.ZodBoolean;
|
|
187
|
+
widget_background_color: z.ZodString;
|
|
188
|
+
widget_text_color: z.ZodString;
|
|
189
|
+
widget_border_color: z.ZodString;
|
|
190
|
+
widget_accent_color: z.ZodString;
|
|
191
|
+
widget_secondary_color: z.ZodString;
|
|
192
|
+
widget_width: z.ZodString;
|
|
193
|
+
widget_height: z.ZodString;
|
|
194
|
+
widget_chips: z.ZodArray<z.ZodObject<{
|
|
195
|
+
chip_mode: z.ZodEnum<{
|
|
196
|
+
tell: "tell";
|
|
197
|
+
show: "show";
|
|
198
|
+
do: "do";
|
|
199
|
+
}>;
|
|
200
|
+
chip_text: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type WidgetSettingsWriteData = z.infer<typeof WidgetSettingsWriteSchema>;
|
|
166
204
|
export declare const WidgetEntitySchema: z.ZodObject<{
|
|
167
205
|
id: z.ZodOptional<z.ZodNumber>;
|
|
168
206
|
created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -113,12 +113,8 @@ export declare const WidgetCreateSchema: z.ZodObject<{
|
|
|
113
113
|
widget_border_color: z.ZodString;
|
|
114
114
|
widget_accent_color: z.ZodString;
|
|
115
115
|
widget_secondary_color: z.ZodString;
|
|
116
|
-
widget_border_radius: z.ZodString;
|
|
117
|
-
widget_font_size: z.ZodString;
|
|
118
116
|
widget_width: z.ZodString;
|
|
119
117
|
widget_height: z.ZodString;
|
|
120
|
-
widget_animation_duration: z.ZodString;
|
|
121
|
-
widget_fade_duration: z.ZodString;
|
|
122
118
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
123
119
|
chip_mode: z.ZodEnum<{
|
|
124
120
|
tell: "tell";
|
|
@@ -138,6 +134,14 @@ export declare const WidgetUpdateSchema: z.ZodObject<{
|
|
|
138
134
|
type: z.ZodOptional<z.ZodEnum<{
|
|
139
135
|
widget: "widget";
|
|
140
136
|
}>>;
|
|
137
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
created: "created";
|
|
139
|
+
active: "active";
|
|
140
|
+
suspended: "suspended";
|
|
141
|
+
}>>;
|
|
142
|
+
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
143
|
+
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
144
|
+
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
141
145
|
settings: z.ZodOptional<z.ZodObject<{
|
|
142
146
|
widget_enabled: z.ZodBoolean;
|
|
143
147
|
widget_appearance: z.ZodEnum<{
|
|
@@ -163,12 +167,8 @@ export declare const WidgetUpdateSchema: z.ZodObject<{
|
|
|
163
167
|
widget_border_color: z.ZodString;
|
|
164
168
|
widget_accent_color: z.ZodString;
|
|
165
169
|
widget_secondary_color: z.ZodString;
|
|
166
|
-
widget_border_radius: z.ZodString;
|
|
167
|
-
widget_font_size: z.ZodString;
|
|
168
170
|
widget_width: z.ZodString;
|
|
169
171
|
widget_height: z.ZodString;
|
|
170
|
-
widget_animation_duration: z.ZodString;
|
|
171
|
-
widget_fade_duration: z.ZodString;
|
|
172
172
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
173
173
|
chip_mode: z.ZodEnum<{
|
|
174
174
|
tell: "tell";
|
|
@@ -178,14 +178,6 @@ export declare const WidgetUpdateSchema: z.ZodObject<{
|
|
|
178
178
|
chip_text: z.ZodString;
|
|
179
179
|
}, z.core.$strip>>;
|
|
180
180
|
}, z.core.$strip>>;
|
|
181
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
182
|
-
created: "created";
|
|
183
|
-
active: "active";
|
|
184
|
-
suspended: "suspended";
|
|
185
|
-
}>>;
|
|
186
|
-
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
187
|
-
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
188
|
-
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
189
181
|
}, z.core.$strip>;
|
|
190
182
|
export type WidgetUpdateData = z.infer<typeof WidgetUpdateSchema>;
|
|
191
183
|
/** Server → Widget events. */
|
|
@@ -217,8 +209,6 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
217
209
|
has_question: "has_question";
|
|
218
210
|
}>;
|
|
219
211
|
message: z.ZodOptional<z.ZodString>;
|
|
220
|
-
task_id: z.ZodOptional<z.ZodString>;
|
|
221
|
-
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
222
212
|
}, z.core.$strip>, z.ZodObject<{
|
|
223
213
|
type: z.ZodLiteral<"tool/call">;
|
|
224
214
|
tool_call_id: z.ZodString;
|
|
@@ -312,12 +302,8 @@ export declare const widgetCreate: import("@orpc/contract").ContractProcedureBui
|
|
|
312
302
|
widget_border_color: z.ZodString;
|
|
313
303
|
widget_accent_color: z.ZodString;
|
|
314
304
|
widget_secondary_color: z.ZodString;
|
|
315
|
-
widget_border_radius: z.ZodString;
|
|
316
|
-
widget_font_size: z.ZodString;
|
|
317
305
|
widget_width: z.ZodString;
|
|
318
306
|
widget_height: z.ZodString;
|
|
319
|
-
widget_animation_duration: z.ZodString;
|
|
320
|
-
widget_fade_duration: z.ZodString;
|
|
321
307
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
322
308
|
chip_mode: z.ZodEnum<{
|
|
323
309
|
tell: "tell";
|
|
@@ -507,6 +493,14 @@ export declare const widgetUpdate: import("@orpc/contract").ContractProcedureBui
|
|
|
507
493
|
type: z.ZodOptional<z.ZodEnum<{
|
|
508
494
|
widget: "widget";
|
|
509
495
|
}>>;
|
|
496
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
497
|
+
created: "created";
|
|
498
|
+
active: "active";
|
|
499
|
+
suspended: "suspended";
|
|
500
|
+
}>>;
|
|
501
|
+
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
502
|
+
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
503
|
+
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
510
504
|
settings: z.ZodOptional<z.ZodObject<{
|
|
511
505
|
widget_enabled: z.ZodBoolean;
|
|
512
506
|
widget_appearance: z.ZodEnum<{
|
|
@@ -532,12 +526,8 @@ export declare const widgetUpdate: import("@orpc/contract").ContractProcedureBui
|
|
|
532
526
|
widget_border_color: z.ZodString;
|
|
533
527
|
widget_accent_color: z.ZodString;
|
|
534
528
|
widget_secondary_color: z.ZodString;
|
|
535
|
-
widget_border_radius: z.ZodString;
|
|
536
|
-
widget_font_size: z.ZodString;
|
|
537
529
|
widget_width: z.ZodString;
|
|
538
530
|
widget_height: z.ZodString;
|
|
539
|
-
widget_animation_duration: z.ZodString;
|
|
540
|
-
widget_fade_duration: z.ZodString;
|
|
541
531
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
542
532
|
chip_mode: z.ZodEnum<{
|
|
543
533
|
tell: "tell";
|
|
@@ -547,14 +537,6 @@ export declare const widgetUpdate: import("@orpc/contract").ContractProcedureBui
|
|
|
547
537
|
chip_text: z.ZodString;
|
|
548
538
|
}, z.core.$strip>>;
|
|
549
539
|
}, z.core.$strip>>;
|
|
550
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
551
|
-
created: "created";
|
|
552
|
-
active: "active";
|
|
553
|
-
suspended: "suspended";
|
|
554
|
-
}>>;
|
|
555
|
-
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
556
|
-
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
557
|
-
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
558
540
|
widget_id: z.ZodCoercedNumber<unknown>;
|
|
559
541
|
}, z.core.$strip>, z.ZodObject<{
|
|
560
542
|
id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -645,8 +627,6 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
645
627
|
type: "task/status";
|
|
646
628
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
647
629
|
message?: string | undefined;
|
|
648
|
-
task_id?: string | undefined;
|
|
649
|
-
timestamp?: number | undefined;
|
|
650
630
|
} | {
|
|
651
631
|
type: "tool/call";
|
|
652
632
|
tool_call_id: string;
|
|
@@ -676,8 +656,6 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
676
656
|
type: "task/status";
|
|
677
657
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
678
658
|
message?: string | undefined;
|
|
679
|
-
task_id?: string | undefined;
|
|
680
|
-
timestamp?: number | undefined;
|
|
681
659
|
} | {
|
|
682
660
|
type: "tool/call";
|
|
683
661
|
tool_call_id: string;
|
|
@@ -772,12 +750,8 @@ export declare const widgetRoutes: {
|
|
|
772
750
|
widget_border_color: z.ZodString;
|
|
773
751
|
widget_accent_color: z.ZodString;
|
|
774
752
|
widget_secondary_color: z.ZodString;
|
|
775
|
-
widget_border_radius: z.ZodString;
|
|
776
|
-
widget_font_size: z.ZodString;
|
|
777
753
|
widget_width: z.ZodString;
|
|
778
754
|
widget_height: z.ZodString;
|
|
779
|
-
widget_animation_duration: z.ZodString;
|
|
780
|
-
widget_fade_duration: z.ZodString;
|
|
781
755
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
782
756
|
chip_mode: z.ZodEnum<{
|
|
783
757
|
tell: "tell";
|
|
@@ -967,6 +941,14 @@ export declare const widgetRoutes: {
|
|
|
967
941
|
type: z.ZodOptional<z.ZodEnum<{
|
|
968
942
|
widget: "widget";
|
|
969
943
|
}>>;
|
|
944
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
945
|
+
created: "created";
|
|
946
|
+
active: "active";
|
|
947
|
+
suspended: "suspended";
|
|
948
|
+
}>>;
|
|
949
|
+
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
950
|
+
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
951
|
+
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
970
952
|
settings: z.ZodOptional<z.ZodObject<{
|
|
971
953
|
widget_enabled: z.ZodBoolean;
|
|
972
954
|
widget_appearance: z.ZodEnum<{
|
|
@@ -992,12 +974,8 @@ export declare const widgetRoutes: {
|
|
|
992
974
|
widget_border_color: z.ZodString;
|
|
993
975
|
widget_accent_color: z.ZodString;
|
|
994
976
|
widget_secondary_color: z.ZodString;
|
|
995
|
-
widget_border_radius: z.ZodString;
|
|
996
|
-
widget_font_size: z.ZodString;
|
|
997
977
|
widget_width: z.ZodString;
|
|
998
978
|
widget_height: z.ZodString;
|
|
999
|
-
widget_animation_duration: z.ZodString;
|
|
1000
|
-
widget_fade_duration: z.ZodString;
|
|
1001
979
|
widget_chips: z.ZodArray<z.ZodObject<{
|
|
1002
980
|
chip_mode: z.ZodEnum<{
|
|
1003
981
|
tell: "tell";
|
|
@@ -1007,14 +985,6 @@ export declare const widgetRoutes: {
|
|
|
1007
985
|
chip_text: z.ZodString;
|
|
1008
986
|
}, z.core.$strip>>;
|
|
1009
987
|
}, z.core.$strip>>;
|
|
1010
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
1011
|
-
created: "created";
|
|
1012
|
-
active: "active";
|
|
1013
|
-
suspended: "suspended";
|
|
1014
|
-
}>>;
|
|
1015
|
-
marketrix_id: z.ZodOptional<z.ZodString>;
|
|
1016
|
-
marketrix_key: z.ZodOptional<z.ZodString>;
|
|
1017
|
-
snippet: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1018
988
|
widget_id: z.ZodCoercedNumber<unknown>;
|
|
1019
989
|
}, z.core.$strip>, z.ZodObject<{
|
|
1020
990
|
id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1105,8 +1075,6 @@ export declare const widgetRoutes: {
|
|
|
1105
1075
|
type: "task/status";
|
|
1106
1076
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
1107
1077
|
message?: string | undefined;
|
|
1108
|
-
task_id?: string | undefined;
|
|
1109
|
-
timestamp?: number | undefined;
|
|
1110
1078
|
} | {
|
|
1111
1079
|
type: "tool/call";
|
|
1112
1080
|
tool_call_id: string;
|
|
@@ -1136,8 +1104,6 @@ export declare const widgetRoutes: {
|
|
|
1136
1104
|
type: "task/status";
|
|
1137
1105
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
1138
1106
|
message?: string | undefined;
|
|
1139
|
-
task_id?: string | undefined;
|
|
1140
|
-
timestamp?: number | undefined;
|
|
1141
1107
|
} | {
|
|
1142
1108
|
type: "tool/call";
|
|
1143
1109
|
tool_call_id: string;
|
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -391,8 +391,6 @@ export declare const sdk: {
|
|
|
391
391
|
type: "task/status";
|
|
392
392
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
393
393
|
message?: string | undefined;
|
|
394
|
-
task_id?: string | undefined;
|
|
395
|
-
timestamp?: number | undefined;
|
|
396
394
|
} | {
|
|
397
395
|
type: "tool/call";
|
|
398
396
|
tool_call_id: string;
|
|
@@ -422,8 +420,6 @@ export declare const sdk: {
|
|
|
422
420
|
type: "task/status";
|
|
423
421
|
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
424
422
|
message?: string | undefined;
|
|
425
|
-
task_id?: string | undefined;
|
|
426
|
-
timestamp?: number | undefined;
|
|
427
423
|
} | {
|
|
428
424
|
type: "tool/call";
|
|
429
425
|
tool_call_id: string;
|