@assistrio/chat-widget 0.1.0
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/README.md +88 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/assistrio-chat.css +2 -0
- package/dist/assistrio-chat.js +37 -0
- package/dist/bootstrap.d.ts +9 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/browser.d.ts +12 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/components/AdminLiveChatAdapter.d.ts +38 -0
- package/dist/components/AdminLiveChatAdapter.d.ts.map +1 -0
- package/dist/components/chat-ui/Chat.d.ts +117 -0
- package/dist/components/chat-ui/Chat.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatBubble.d.ts +36 -0
- package/dist/components/chat-ui/ChatBubble.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatComposer.d.ts +34 -0
- package/dist/components/chat-ui/ChatComposer.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatHeader.d.ts +54 -0
- package/dist/components/chat-ui/ChatHeader.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatLauncherBubble.d.ts +41 -0
- package/dist/components/chat-ui/ChatLauncherBubble.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatMessages.d.ts +45 -0
- package/dist/components/chat-ui/ChatMessages.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatSources.d.ts +12 -0
- package/dist/components/chat-ui/ChatSources.d.ts.map +1 -0
- package/dist/components/chat-ui/ChatWithLauncher.d.ts +22 -0
- package/dist/components/chat-ui/ChatWithLauncher.d.ts.map +1 -0
- package/dist/components/chat-ui/index.d.ts +19 -0
- package/dist/components/chat-ui/index.d.ts.map +1 -0
- package/dist/components/chat-ui/types.d.ts +42 -0
- package/dist/components/chat-ui/types.d.ts.map +1 -0
- package/dist/components/chat-ui/utils.d.ts +4 -0
- package/dist/components/chat-ui/utils.d.ts.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/hooks/usePreferredColorScheme.d.ts +5 -0
- package/dist/hooks/usePreferredColorScheme.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +30 -0
- package/dist/index.mjs.map +7 -0
- package/dist/lib/apiFetch.d.ts +6 -0
- package/dist/lib/apiFetch.d.ts.map +1 -0
- package/dist/lib/preview-display-merge.d.ts +8 -0
- package/dist/lib/preview-display-merge.d.ts.map +1 -0
- package/dist/lib/welcomeMessage.d.ts +9 -0
- package/dist/lib/welcomeMessage.d.ts.map +1 -0
- package/dist/models/botChatUI.d.ts +54 -0
- package/dist/models/botChatUI.d.ts.map +1 -0
- package/dist/normalize.d.ts +3 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/types.d.ts +128 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/widget-root.d.ts +6 -0
- package/dist/widget-root.d.ts.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal same-origin API fetch for {@link AdminLiveChatAdapter} when `apiBaseUrl` is not set.
|
|
3
|
+
* Does not require NEXT_PUBLIC_* or any env var: resolves relative `/api/...` paths against the current page origin.
|
|
4
|
+
*/
|
|
5
|
+
export declare function apiFetch(path: string, init?: RequestInit): Promise<Response>;
|
|
6
|
+
//# sourceMappingURL=apiFetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiFetch.d.ts","sourceRoot":"","sources":["../../src/lib/apiFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAE5E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WidgetInitResponse, WidgetPreviewOverrides } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Applies preview overrides to a baseline init response (from `/preview/init` **without**
|
|
4
|
+
* `previewOverrides` in the body). Mirrors `buildInitResponse` in
|
|
5
|
+
* `ai-platform-backend/.../widget-preview.controller.ts` for display-only updates.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergePreviewInitResponse(base: WidgetInitResponse, overrides: WidgetPreviewOverrides | undefined): WidgetInitResponse;
|
|
8
|
+
//# sourceMappingURL=preview-display-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-display-merge.d.ts","sourceRoot":"","sources":["../../src/lib/preview-display-merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAsC3E;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,sBAAsB,GAAG,SAAS,GAC5C,kBAAkB,CA0CpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve {{Name}}, {{Tagline}}, {{description}} in welcome message template.
|
|
3
|
+
*/
|
|
4
|
+
export declare function resolveWelcomeMessage(template: string, ctx: {
|
|
5
|
+
name?: string;
|
|
6
|
+
tagline?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}): string;
|
|
9
|
+
//# sourceMappingURL=welcomeMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../src/lib/welcomeMessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,MAAM,CAQR"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat UI settings for the widget (extracted from app `models/Bot.ts`).
|
|
3
|
+
* Only types required by BotChatUI and embed normalization.
|
|
4
|
+
*/
|
|
5
|
+
export type ChatBackgroundStyle = "auto" | "light" | "dark";
|
|
6
|
+
export type ChatLauncherPosition = "bottom-right" | "bottom-left";
|
|
7
|
+
export type LiveIndicatorStyle = "label" | "dot-only";
|
|
8
|
+
export type ChatStatusIndicator = "live" | "active" | "none";
|
|
9
|
+
export type ChatTimePosition = "top" | "bottom";
|
|
10
|
+
export interface ChatMenuQuickLink {
|
|
11
|
+
text: string;
|
|
12
|
+
route: string;
|
|
13
|
+
}
|
|
14
|
+
export type ChatLauncherIcon = "default" | "bot-avatar" | "custom";
|
|
15
|
+
export type ChatShadowIntensity = "none" | "low" | "medium" | "high";
|
|
16
|
+
export type ChatOpenAnimation = "slide-up-fade" | "fade" | "expand";
|
|
17
|
+
export interface BotChatUI {
|
|
18
|
+
primaryColor?: string;
|
|
19
|
+
backgroundStyle?: ChatBackgroundStyle;
|
|
20
|
+
bubbleBorderRadius?: number;
|
|
21
|
+
launcherPosition?: ChatLauncherPosition;
|
|
22
|
+
shadowIntensity?: ChatShadowIntensity;
|
|
23
|
+
showChatBorder?: boolean;
|
|
24
|
+
launcherIcon?: ChatLauncherIcon;
|
|
25
|
+
launcherAvatarUrl?: string;
|
|
26
|
+
launcherAvatarRingWidth?: number;
|
|
27
|
+
launcherSize?: number;
|
|
28
|
+
chatOpenAnimation?: ChatOpenAnimation;
|
|
29
|
+
openChatOnLoad?: boolean;
|
|
30
|
+
showBranding?: boolean;
|
|
31
|
+
brandingMessage?: string;
|
|
32
|
+
liveIndicatorStyle?: LiveIndicatorStyle;
|
|
33
|
+
statusIndicator?: ChatStatusIndicator;
|
|
34
|
+
statusDotStyle?: "blinking" | "static";
|
|
35
|
+
showScrollToBottom?: boolean;
|
|
36
|
+
showScrollbar?: boolean;
|
|
37
|
+
composerAsSeparateBox?: boolean;
|
|
38
|
+
composerBorderWidth?: number;
|
|
39
|
+
composerBorderColor?: "default" | "primary";
|
|
40
|
+
showMenuExpand?: boolean;
|
|
41
|
+
menuQuickLinks?: ChatMenuQuickLink[];
|
|
42
|
+
showComposerWithSuggestedQuestions?: boolean;
|
|
43
|
+
showAvatarInHeader?: boolean;
|
|
44
|
+
senderName?: string;
|
|
45
|
+
showSenderName?: boolean;
|
|
46
|
+
showTime?: boolean;
|
|
47
|
+
showCopyButton?: boolean;
|
|
48
|
+
showSources?: boolean;
|
|
49
|
+
timePosition?: ChatTimePosition;
|
|
50
|
+
showEmoji?: boolean;
|
|
51
|
+
allowFileUpload?: boolean;
|
|
52
|
+
showMic?: boolean;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=botChatUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"botChatUI.d.ts","sourceRoot":"","sources":["../../src/models/botChatUI.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,aAAa,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,MAAM,GAAG,QAAQ,C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CAAC;IACtB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EAEf,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAwCjB,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,eAAe,GACtB,wBAAwB,CAsB1B"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { BotChatUI } from "./models/botChatUI";
|
|
2
|
+
export type EmbedPosition = "left" | "right";
|
|
3
|
+
export type WidgetMode = "runtime" | "preview";
|
|
4
|
+
export type LauncherPosition = "bottom-left" | "bottom-right";
|
|
5
|
+
export type WidgetInitStatus = "ok" | "error";
|
|
6
|
+
export type EmbedChatConfig = {
|
|
7
|
+
botId: string;
|
|
8
|
+
apiBaseUrl: string;
|
|
9
|
+
mode?: WidgetMode;
|
|
10
|
+
accessKey?: string;
|
|
11
|
+
secretKey?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional endpoint override for widget init.
|
|
14
|
+
* Useful when the host app proxies widget endpoints (e.g. same-origin preview routes).
|
|
15
|
+
*/
|
|
16
|
+
widgetInitPath?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional endpoint override for chat posting.
|
|
19
|
+
* Useful when the host app proxies widget endpoints (e.g. same-origin preview routes).
|
|
20
|
+
*/
|
|
21
|
+
chatPostPath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Platform visitor identity (platformVisitorId).
|
|
24
|
+
* Used for trial quota enforcement + preview authorization.
|
|
25
|
+
*/
|
|
26
|
+
platformVisitorId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional chat visitor identity (chatVisitorId).
|
|
29
|
+
* Usually omitted by callers; the widget will load/create it from localStorage.
|
|
30
|
+
*/
|
|
31
|
+
chatVisitorId?: string;
|
|
32
|
+
authToken?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Preview mode: authenticate with the same `user_token` HttpOnly cookie as private APIs
|
|
35
|
+
* (`fetch` with `credentials: "include"` to the API origin). Omits keys and `chatVisitorId`
|
|
36
|
+
* from init; do not set `authToken` in the JSON body.
|
|
37
|
+
*/
|
|
38
|
+
sessionPreview?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When false, `chatVisitorId` is not loaded from or saved to `localStorage`.
|
|
41
|
+
* Defaults to false when `authToken` or `sessionPreview` is set, true otherwise.
|
|
42
|
+
*/
|
|
43
|
+
persistChatSession?: boolean;
|
|
44
|
+
position?: EmbedPosition;
|
|
45
|
+
previewOverrides?: WidgetPreviewOverrides;
|
|
46
|
+
disableRemoteConfig?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export interface WidgetInitRequest {
|
|
49
|
+
botId: string;
|
|
50
|
+
mode?: WidgetMode;
|
|
51
|
+
accessKey?: string;
|
|
52
|
+
secretKey?: string;
|
|
53
|
+
chatVisitorId?: string;
|
|
54
|
+
platformVisitorId?: string;
|
|
55
|
+
authToken?: string;
|
|
56
|
+
previewOverrides?: WidgetPreviewOverrides;
|
|
57
|
+
}
|
|
58
|
+
export interface WidgetChatRequest {
|
|
59
|
+
botId: string;
|
|
60
|
+
message: string;
|
|
61
|
+
mode?: WidgetMode;
|
|
62
|
+
accessKey?: string;
|
|
63
|
+
secretKey?: string;
|
|
64
|
+
chatVisitorId: string;
|
|
65
|
+
platformVisitorId?: string;
|
|
66
|
+
authToken?: string;
|
|
67
|
+
previewOverrides?: WidgetPreviewOverrides;
|
|
68
|
+
}
|
|
69
|
+
export interface WidgetInitResponse {
|
|
70
|
+
status?: WidgetInitStatus;
|
|
71
|
+
error?: string;
|
|
72
|
+
errorCode?: string;
|
|
73
|
+
chatVisitorId?: string;
|
|
74
|
+
bot?: {
|
|
75
|
+
id?: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
imageUrl?: string;
|
|
78
|
+
avatarEmoji?: string;
|
|
79
|
+
tagline?: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
welcomeMessage?: string;
|
|
82
|
+
suggestedQuestions?: string[];
|
|
83
|
+
exampleQuestions?: string[];
|
|
84
|
+
};
|
|
85
|
+
settings?: {
|
|
86
|
+
chatUI?: BotChatUI;
|
|
87
|
+
brandingMessage?: string;
|
|
88
|
+
privacyText?: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface NormalizedWidgetSettings {
|
|
92
|
+
botId: string;
|
|
93
|
+
botName: string;
|
|
94
|
+
avatarUrl?: string;
|
|
95
|
+
avatarEmoji?: string;
|
|
96
|
+
tagline?: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
welcomeMessage?: string;
|
|
99
|
+
suggestedQuestions: string[];
|
|
100
|
+
chatUI: BotChatUI;
|
|
101
|
+
launcherPosition: LauncherPosition;
|
|
102
|
+
brandingMessage?: string;
|
|
103
|
+
privacyText?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface WidgetPreviewOverrides {
|
|
106
|
+
botName?: string;
|
|
107
|
+
avatarUrl?: string;
|
|
108
|
+
avatarEmoji?: string;
|
|
109
|
+
tagline?: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
welcomeMessage?: string;
|
|
112
|
+
suggestedQuestions?: string[];
|
|
113
|
+
brandingMessage?: string;
|
|
114
|
+
privacyText?: string;
|
|
115
|
+
launcherPosition?: LauncherPosition;
|
|
116
|
+
chatUI?: Partial<BotChatUI>;
|
|
117
|
+
}
|
|
118
|
+
export interface EmbedRuntimeState {
|
|
119
|
+
config: Required<Pick<EmbedChatConfig, "botId" | "apiBaseUrl">> & Pick<EmbedChatConfig, "accessKey" | "position">;
|
|
120
|
+
initResponse: WidgetInitResponse;
|
|
121
|
+
settings: NormalizedWidgetSettings;
|
|
122
|
+
}
|
|
123
|
+
export type AssistrioChatGlobal = {
|
|
124
|
+
mount: (config?: Partial<EmbedChatConfig>) => void;
|
|
125
|
+
unmount: () => void;
|
|
126
|
+
isMounted: () => boolean;
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAC7C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,m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E,WAAW,GAAG,UAAU,CAAC,CAAC;IAChD,YAAY,EAAE,kBAAkB,CAAC;IACjC,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EmbedChatConfig } from "./types";
|
|
2
|
+
export interface EmbedWidgetRootProps {
|
|
3
|
+
rawConfig: Partial<EmbedChatConfig>;
|
|
4
|
+
}
|
|
5
|
+
export declare function EmbedWidgetRoot({ rawConfig }: EmbedWidgetRootProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
//# sourceMappingURL=widget-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-root.d.ts","sourceRoot":"","sources":["../src/widget-root.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAgD,MAAM,SAAS,CAAC;AAoB7F,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACrC;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB,kDAuIlE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@assistrio/chat-widget",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Assistrio embeddable chat widget: CDN bundle (assistrio-chat.js) and npm ESM entry for React apps.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.mjs",
|
|
10
|
+
"module": "./dist/index.mjs",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"default": "./dist/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./assistrio-chat.js": "./dist/assistrio-chat.js",
|
|
19
|
+
"./assistrio-chat.css": "./dist/assistrio-chat.css"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"./dist/assistrio-chat.js",
|
|
23
|
+
"**/*.css"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "npm run build:js && npm run build:css && npm run build:lib && npm run build:types && npm run copy:public",
|
|
31
|
+
"build:js": "node scripts/build-js.mjs",
|
|
32
|
+
"build:lib": "node scripts/build-lib.mjs",
|
|
33
|
+
"build:types": "tsc -p tsconfig.dts.json",
|
|
34
|
+
"build:css": "npx @tailwindcss/cli -i ./src/styles/embed.css -o ./dist/assistrio-chat.css --minify",
|
|
35
|
+
"copy:public": "node -e \"const fs=require('fs'); fs.mkdirSync('public',{recursive:true}); fs.copyFileSync('dist/assistrio-chat.js','public/assistrio-chat.js'); fs.copyFileSync('dist/assistrio-chat.css','public/assistrio-chat.css'); console.log('Copied dist files to public/');\"",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"prepublishOnly": "npm run build",
|
|
38
|
+
"test:local": "npx --yes serve . -l 3456"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
42
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"lucide-react": "^0.577.0",
|
|
46
|
+
"react-markdown": "^10.1.0",
|
|
47
|
+
"remark-gfm": "^4.0.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@tailwindcss/cli": "^4.2.2",
|
|
51
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
52
|
+
"@types/react": "^19",
|
|
53
|
+
"@types/react-dom": "^19",
|
|
54
|
+
"esbuild": "^0.27.4",
|
|
55
|
+
"react": "^19.2.3",
|
|
56
|
+
"react-dom": "^19.2.3",
|
|
57
|
+
"tailwindcss": "^4",
|
|
58
|
+
"typescript": "^5"
|
|
59
|
+
}
|
|
60
|
+
}
|