@marketrix.ai/widget 3.8.443 → 3.8.445
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/Avatar.d.ts +3 -2
- package/dist/src/components/base/Button.d.ts +3 -2
- package/dist/src/components/base/Icon.d.ts +3 -2
- package/dist/src/components/base/IconButton.d.ts +3 -2
- package/dist/src/components/base/Spinner.d.ts +3 -2
- package/dist/src/components/base/Stack.d.ts +3 -3
- package/dist/src/components/base/Text.d.ts +3 -2
- package/dist/src/components/blocks/ChatInput.d.ts +2 -1
- package/dist/src/sdk/contract.d.ts +1 -1
- package/dist/src/sdk/contracts/common.d.ts +3 -3
- package/dist/src/sdk/contracts/entities.d.ts +1 -1
- package/dist/src/sdk/contracts/widget.d.ts +2 -2
- package/dist/src/sdk/index.d.ts +1 -1
- package/dist/src/services/ConfigManager.d.ts +0 -2
- package/dist/src/services/StorageService.d.ts +0 -5
- package/dist/src/utils/bootstrap.d.ts +1 -1
- package/dist/widget.mjs +61 -61
- package/dist/widget.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
1
2
|
import { type RadiusToken } from '../../design-system/component-tokens';
|
|
2
3
|
import type { ShadowToken } from '../../design-system/shadows';
|
|
3
4
|
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
4
|
-
export interface AvatarProps extends Omit<
|
|
5
|
+
export interface AvatarProps extends Omit<ComponentPropsWithRef<'img'>, 'size'> {
|
|
5
6
|
src: string;
|
|
6
7
|
alt: string;
|
|
7
8
|
elevation?: ShadowToken;
|
|
@@ -9,5 +10,5 @@ export interface AvatarProps extends Omit<React.ImgHTMLAttributes<HTMLImageEleme
|
|
|
9
10
|
size?: AvatarSize | number;
|
|
10
11
|
rounded?: boolean | 'full' | 'theme' | RadiusToken;
|
|
11
12
|
}
|
|
12
|
-
export declare
|
|
13
|
+
export declare function Avatar(props: AvatarProps): import("react").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
1
2
|
import type { ShadowToken } from '../../design-system/shadows';
|
|
2
3
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'bare' | 'chip' | 'tab' | 'inline' | 'toolbar';
|
|
3
4
|
type ButtonSize = 'sm' | 'md';
|
|
4
5
|
type ButtonShape = 'default' | 'theme' | 'pill';
|
|
5
|
-
export interface ButtonProps extends
|
|
6
|
+
export interface ButtonProps extends ComponentPropsWithRef<'button'> {
|
|
6
7
|
active?: boolean;
|
|
7
8
|
elevation?: ShadowToken;
|
|
8
9
|
loading?: boolean;
|
|
@@ -12,5 +13,5 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
12
13
|
variant?: ButtonVariant;
|
|
13
14
|
full?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare
|
|
16
|
+
export declare function Button({ active, className, disabled, elevation, full, loading, shape, size, stacked, type, variant, style, ref, ...props }: ButtonProps): import("react").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
1
2
|
import { type IconName } from './icons';
|
|
2
|
-
export interface IconProps extends
|
|
3
|
+
export interface IconProps extends ComponentPropsWithRef<'svg'> {
|
|
3
4
|
name: IconName;
|
|
4
5
|
size?: number;
|
|
5
6
|
/** @internal blocks/ only */
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare
|
|
9
|
+
export declare function Icon({ name, size, className, ref, ...props }: IconProps): import("react").JSX.Element | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
1
2
|
import { type TextTone } from '../../design-system/component-tokens';
|
|
2
3
|
import type { ShadowToken } from '../../design-system/shadows';
|
|
3
4
|
type IconButtonVariant = 'primary' | 'secondary' | 'ghost' | 'toolbar';
|
|
4
5
|
type IconButtonSize = 'xs' | 'sm';
|
|
5
6
|
type IconButtonShape = 'circle' | 'theme';
|
|
6
|
-
export interface IconButtonProps extends
|
|
7
|
+
export interface IconButtonProps extends ComponentPropsWithRef<'button'> {
|
|
7
8
|
elevation?: ShadowToken;
|
|
8
9
|
variant?: IconButtonVariant;
|
|
9
10
|
size?: IconButtonSize;
|
|
@@ -13,5 +14,5 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
13
14
|
/** @internal blocks/ only */
|
|
14
15
|
className?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare
|
|
17
|
+
export declare function IconButton({ variant, size, shape, tone, label, disabled, elevation, className: userClassName, children, style, ref, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CSSProperties, Ref } from 'react';
|
|
2
2
|
type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface SpinnerProps {
|
|
4
4
|
label?: string;
|
|
@@ -6,6 +6,7 @@ export interface SpinnerProps {
|
|
|
6
6
|
/** @internal blocks/ only */
|
|
7
7
|
className?: string;
|
|
8
8
|
style?: CSSProperties;
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
10
|
}
|
|
10
|
-
export declare
|
|
11
|
+
export declare function Spinner({ label, size, className, style, ref }: SpinnerProps): import("react").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import { type RadiusToken } from '../../design-system/component-tokens';
|
|
3
3
|
import type { ShadowToken } from '../../design-system/shadows';
|
|
4
4
|
import { type LayoutProps } from './layoutProps';
|
|
5
5
|
import { type SurfaceBackground, type SurfacePadding } from './Surface';
|
|
6
|
-
export interface StackProps extends LayoutProps, Omit<
|
|
6
|
+
export interface StackProps extends LayoutProps, Omit<ComponentPropsWithRef<'div'>, 'className'> {
|
|
7
7
|
background?: SurfaceBackground;
|
|
8
8
|
elevation?: ShadowToken;
|
|
9
9
|
paddingPreset?: SurfacePadding;
|
|
@@ -12,4 +12,4 @@ export interface StackProps extends LayoutProps, Omit<React.HTMLAttributes<HTMLD
|
|
|
12
12
|
className?: string;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
|
-
export declare
|
|
15
|
+
export declare function Stack(props: StackProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ElementType, Ref } from 'react';
|
|
2
2
|
import { type TextLeading, type TextTone } from '../../design-system/component-tokens';
|
|
3
3
|
type TextVariant = 'default' | 'muted' | 'faint';
|
|
4
4
|
type TextSize = 'xxs' | 'xs' | 'sm' | 'base' | 'lg';
|
|
@@ -20,6 +20,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
20
20
|
align?: TextAlign;
|
|
21
21
|
/** @internal blocks/ only */
|
|
22
22
|
className?: string;
|
|
23
|
+
ref?: Ref<HTMLElement>;
|
|
23
24
|
}
|
|
24
|
-
export declare
|
|
25
|
+
export declare function Text({ as: Component, block, clamp, code, inheritColor, italic, leading, tone, variant, size, weight, truncate, align, className, ref, style, ...props }: TextProps): import("react").JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -16,5 +16,6 @@ export interface ChatInputProps {
|
|
|
16
16
|
taskRunning?: boolean;
|
|
17
17
|
onStop?: () => void;
|
|
18
18
|
placeholder?: string;
|
|
19
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
19
20
|
}
|
|
20
|
-
export declare
|
|
21
|
+
export declare function ChatInput({ value, onChange, onSubmit, modes, activeMode, onModeChange, disabled, taskRunning, onStop, placeholder, ref, }: ChatInputProps): React.JSX.Element;
|
|
@@ -358,7 +358,7 @@ export declare const widgetContract: {
|
|
|
358
358
|
limit: import("zod").ZodNumber;
|
|
359
359
|
offset: import("zod").ZodNumber;
|
|
360
360
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
361
|
-
|
|
361
|
+
widgetMessagePost: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
362
362
|
chat_id: import("zod").ZodString;
|
|
363
363
|
tab_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
364
364
|
command: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
@@ -32,13 +32,13 @@ export declare const PaginationSchema: z.ZodObject<{
|
|
|
32
32
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
34
|
export declare const booleanQueryParam: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean | undefined, string | boolean>>>;
|
|
35
|
-
export declare const paginatedListOf: <T extends z.
|
|
35
|
+
export declare const paginatedListOf: <T extends z.ZodType>(schema: T) => z.ZodObject<{
|
|
36
36
|
items: z.ZodArray<T>;
|
|
37
37
|
total: z.ZodNumber;
|
|
38
38
|
limit: z.ZodNumber;
|
|
39
39
|
offset: z.ZodNumber;
|
|
40
40
|
}, z.core.$strip>;
|
|
41
|
-
export declare const listOf: <T extends z.
|
|
41
|
+
export declare const listOf: <T extends z.ZodType>(schema: T) => z.ZodObject<{
|
|
42
42
|
items: z.ZodArray<T>;
|
|
43
43
|
count: z.ZodNumber;
|
|
44
44
|
}, z.core.$strip>;
|
|
@@ -54,7 +54,7 @@ export declare const ToolCallRecordSchema: z.ZodObject<{
|
|
|
54
54
|
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
55
|
result: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
56
|
}, z.core.$strip>;
|
|
57
|
-
export declare const SlackWebhookUrlSchema: z.
|
|
57
|
+
export declare const SlackWebhookUrlSchema: z.ZodURL;
|
|
58
58
|
export declare const GraphEdgeSchema: z.ZodObject<{
|
|
59
59
|
start: z.ZodString;
|
|
60
60
|
end: z.ZodString;
|
|
@@ -64,7 +64,7 @@ export declare const UserEntitySchema: z.ZodObject<{
|
|
|
64
64
|
active: "active";
|
|
65
65
|
suspended: "suspended";
|
|
66
66
|
}>;
|
|
67
|
-
email: z.
|
|
67
|
+
email: z.ZodEmail;
|
|
68
68
|
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
69
|
first_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
70
|
last_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -778,7 +778,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
778
778
|
mode?: "show" | "do" | undefined;
|
|
779
779
|
explanation?: string | undefined;
|
|
780
780
|
}, unknown, void>>, Record<never, never>, Record<never, never>>;
|
|
781
|
-
export declare const
|
|
781
|
+
export declare const widgetMessagePost: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
782
782
|
chat_id: z.ZodString;
|
|
783
783
|
tab_id: z.ZodOptional<z.ZodString>;
|
|
784
784
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1298,7 +1298,7 @@ export declare const widgetRoutes: {
|
|
|
1298
1298
|
mode?: "show" | "do" | undefined;
|
|
1299
1299
|
explanation?: string | undefined;
|
|
1300
1300
|
}, unknown, void>>, Record<never, never>, Record<never, never>>;
|
|
1301
|
-
|
|
1301
|
+
widgetMessagePost: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1302
1302
|
chat_id: z.ZodString;
|
|
1303
1303
|
tab_id: z.ZodOptional<z.ZodString>;
|
|
1304
1304
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -360,7 +360,7 @@ export declare const sdk: {
|
|
|
360
360
|
limit: import("zod").ZodNumber;
|
|
361
361
|
offset: import("zod").ZodNumber;
|
|
362
362
|
}, import("zod/v4/core").$strip>, Record<never, never>>;
|
|
363
|
-
|
|
363
|
+
widgetMessagePost: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("zod").ZodObject<{
|
|
364
364
|
chat_id: import("zod").ZodString;
|
|
365
365
|
tab_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
366
366
|
command: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
@@ -7,9 +7,7 @@ export declare class ConfigManager {
|
|
|
7
7
|
static getInstance(): ConfigManager;
|
|
8
8
|
loadConfig(): MarketrixConfig;
|
|
9
9
|
saveConfig(config: MarketrixConfig): void;
|
|
10
|
-
updateConfig(updates: Partial<MarketrixConfig>): void;
|
|
11
10
|
getConfig(): MarketrixConfig | null;
|
|
12
|
-
shouldShowWidget(): boolean;
|
|
13
11
|
}
|
|
14
12
|
export declare const configManager: ConfigManager;
|
|
15
13
|
export declare function createConfigFromSettings(widgetSettings: WidgetSettingsData, baseConfig?: Partial<MarketrixConfig>): MarketrixConfig;
|
|
@@ -27,13 +27,8 @@ declare class StorageService {
|
|
|
27
27
|
/** window.name takes priority over localStorage — it persists across page navigations. */
|
|
28
28
|
getChatId(): string | null;
|
|
29
29
|
setChatId(chatId: string | null): void;
|
|
30
|
-
getMessages(): StoredMessage[];
|
|
31
|
-
setMessages(messages: StoredMessage[]): void;
|
|
32
|
-
getChatState(): Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>;
|
|
33
|
-
setChatState(state: Partial<Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>>): void;
|
|
34
30
|
getConfig(): MarketrixConfig | null;
|
|
35
31
|
setConfig(config: MarketrixConfig | null): void;
|
|
36
|
-
clear(): void;
|
|
37
32
|
hasValidContext(): boolean;
|
|
38
33
|
}
|
|
39
34
|
export declare const storageService: StorageService;
|
|
@@ -17,5 +17,5 @@ export declare const setProgrammaticInitInProgress: (inProgress: boolean) => voi
|
|
|
17
17
|
export declare const isProgrammaticInitInProgress: () => boolean;
|
|
18
18
|
export declare const showWidgetSettingsLoader: (message?: string) => void;
|
|
19
19
|
export declare const hideWidgetSettingsLoader: () => void;
|
|
20
|
-
export declare const autoInitializeWidget: (
|
|
20
|
+
export declare const autoInitializeWidget: () => void;
|
|
21
21
|
export declare const registerAutoInit: (initWidget: (config: MarketrixConfig) => Promise<void>) => void;
|