@askly/widget 2.11.0 → 3.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/MIGRATION-3.0.md +58 -0
- package/README.md +131 -3
- package/dist/app/HelpTab-BrWJK4wa.js +1 -0
- package/dist/app/VoiceRecorder-rdqySW9p.js +1 -0
- package/dist/app/ar-V_LzQrur.js +1 -0
- package/dist/app/askly-app.js +1 -0
- package/dist/app/de-BN3nFgQz.js +1 -0
- package/dist/app/es-BvfGFMIb.js +1 -0
- package/dist/app/fr-DNlpcnFv.js +1 -0
- package/dist/app/hi-C81tFu4P.js +1 -0
- package/dist/app/pt-nxDVHThV.js +1 -0
- package/dist/app/shared-Cp0FX5Ux.js +1 -0
- package/dist/app/speech-8iAgRQFA.js +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/loader.js +1 -0
- package/dist/types/app.d.ts +3 -0
- package/dist/types/core/api.d.ts +34 -0
- package/dist/types/core/config.d.ts +52 -0
- package/dist/{core → types/core}/events.d.ts +10 -0
- package/dist/types/core/format.d.ts +2 -0
- package/dist/types/core/html.d.ts +2 -0
- package/dist/{core → types/core}/speech.d.ts +2 -7
- package/dist/{core → types/core}/types.d.ts +8 -0
- package/dist/types/core/voice.d.ts +6 -0
- package/dist/types/i18n/en.d.ts +144 -0
- package/dist/types/i18n/index.d.ts +32 -0
- package/dist/types/i18n/locales/ar.d.ts +3 -0
- package/dist/types/i18n/locales/de.d.ts +3 -0
- package/dist/types/i18n/locales/es.d.ts +3 -0
- package/dist/types/i18n/locales/fr.d.ts +3 -0
- package/dist/types/i18n/locales/hi.d.ts +3 -0
- package/dist/types/i18n/locales/pt.d.ts +3 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/loader/attrs.d.ts +4 -0
- package/dist/types/loader/core.d.ts +26 -0
- package/dist/types/ui/ChatTerms.d.ts +5 -0
- package/dist/{ui → types/ui}/GreetingBubble.d.ts +4 -0
- package/dist/{ui → types/ui}/Launcher.d.ts +5 -0
- package/dist/{ui → types/ui}/MessageList.d.ts +5 -0
- package/dist/types/widget-entry.d.ts +1 -0
- package/dist/types/widget.d.ts +3 -0
- package/dist/widget.js +1 -10
- package/package.json +33 -21
- package/dist/core/format.d.ts +0 -2
- package/dist/index.d.ts +0 -124
- package/dist/ui/ChatTerms.d.ts +0 -3
- package/dist/widget.d.ts +0 -4
- /package/dist/{core → types/core}/greeting.d.ts +0 -0
- /package/dist/{core → types/core}/session.d.ts +0 -0
- /package/dist/{core → types/core}/storage.d.ts +0 -0
- /package/dist/{icons.d.ts → types/icons.d.ts} +0 -0
- /package/dist/{identity.d.ts → types/identity.d.ts} +0 -0
- /package/dist/{markdown.d.ts → types/markdown.d.ts} +0 -0
- /package/dist/{pathRules.d.ts → types/pathRules.d.ts} +0 -0
- /package/dist/{realtime.d.ts → types/realtime.d.ts} +0 -0
- /package/dist/{ui → types/ui}/Composer.d.ts +0 -0
- /package/dist/{ui → types/ui}/ConversationList.d.ts +0 -0
- /package/dist/{ui → types/ui}/ExploreTab.d.ts +0 -0
- /package/dist/{ui → types/ui}/HelpTab.d.ts +0 -0
- /package/dist/{ui → types/ui}/NavTabs.d.ts +0 -0
- /package/dist/{ui → types/ui}/PanelHeader.d.ts +0 -0
- /package/dist/{ui → types/ui}/VoiceRecorder.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askly/widget",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Embeddable AI support chat widget for React
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Embeddable AI support chat widget for React \u2014 drop-in customer support chatbot with voice, RAG (docs-grounded) answers, and human handoff. One line to install.",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"unpkg": "dist/widget.js",
|
|
8
8
|
"jsdelivr": "dist/widget.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
9
|
+
"types": "dist/types/index.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "rollup -c",
|
|
11
|
+
"build": "rm -rf dist && rollup -c rollup.config.mjs && npm run build:react",
|
|
12
12
|
"test": "tsc src/markdown.ts --outDir test/.build --module commonjs --target es2019 --strict --skipLibCheck && node --test test/markdown.test.cjs",
|
|
13
13
|
"typecheck": "tsc --noEmit -p .",
|
|
14
14
|
"test:e2e": "playwright test",
|
|
15
15
|
"size": "node scripts/check-size.cjs",
|
|
16
|
-
"prepublishOnly": "npm run build"
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"build:react": "tsc -p packages/react/tsconfig.json"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
20
|
"dist",
|
|
20
21
|
"README.md",
|
|
22
|
+
"MIGRATION-3.0.md",
|
|
21
23
|
"LICENSE"
|
|
22
24
|
],
|
|
23
25
|
"keywords": [
|
|
@@ -51,29 +53,39 @@
|
|
|
51
53
|
"url": "https://github.com/StrontiumTechnologies/Askly-SDK/issues"
|
|
52
54
|
},
|
|
53
55
|
"homepage": "https://github.com/StrontiumTechnologies/Askly-SDK#readme",
|
|
54
|
-
"peerDependencies": {
|
|
55
|
-
"react": ">=18.0.0",
|
|
56
|
-
"react-dom": ">=18.0.0"
|
|
57
|
-
},
|
|
58
56
|
"devDependencies": {
|
|
57
|
+
"@axe-core/playwright": "^4.13.0",
|
|
59
58
|
"@playwright/test": "^1.63.0",
|
|
60
|
-
"@rollup/plugin-
|
|
61
|
-
"@rollup/plugin-
|
|
62
|
-
"@rollup/plugin-
|
|
63
|
-
"@rollup/plugin-
|
|
59
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
60
|
+
"@rollup/plugin-commonjs": "^28.0.9",
|
|
61
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
62
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
63
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
64
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
64
65
|
"@types/react": "^18.0.0",
|
|
65
66
|
"@types/react-dom": "^18.0.0",
|
|
66
67
|
"cors": "^2.8.5",
|
|
67
68
|
"express": "^5.1.0",
|
|
68
69
|
"postcss": "^8.4.5",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"rollup": "^2.60.0",
|
|
70
|
+
"preact": "^10.29.8",
|
|
71
|
+
"rollup": "^4.64.0",
|
|
72
72
|
"rollup-plugin-postcss": "^4.0.2",
|
|
73
|
-
"
|
|
74
|
-
|
|
73
|
+
"typescript": "^5.9.3"
|
|
74
|
+
},
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"types": "./dist/types/index.d.ts",
|
|
78
|
+
"import": "./dist/index.esm.js",
|
|
79
|
+
"default": "./dist/index.umd.js"
|
|
80
|
+
},
|
|
81
|
+
"./dist/*": "./dist/*",
|
|
82
|
+
"./package.json": "./package.json"
|
|
75
83
|
},
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
|
|
84
|
+
"sideEffects": [
|
|
85
|
+
"dist/widget.js",
|
|
86
|
+
"dist/loader.js",
|
|
87
|
+
"dist/index.esm.js",
|
|
88
|
+
"dist/index.umd.js",
|
|
89
|
+
"dist/app/*"
|
|
90
|
+
]
|
|
79
91
|
}
|
package/dist/core/format.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { type AsklyEventMap, type AsklyEventName, type AsklyEventHandler, type AsklySpace } from "./core/events";
|
|
2
|
-
import { type AsklyIdentity } from "./identity";
|
|
3
|
-
export interface AsklyConfig {
|
|
4
|
-
appId?: string;
|
|
5
|
-
widgetId?: string;
|
|
6
|
-
orgId?: string;
|
|
7
|
-
orgServerRoute?: string;
|
|
8
|
-
organizationName?: string;
|
|
9
|
-
position?: "left" | "right";
|
|
10
|
-
themeColor?: string;
|
|
11
|
-
theme?: "light" | "dark" | "auto";
|
|
12
|
-
voiceInput?: false | "review" | "auto-send";
|
|
13
|
-
/** @deprecated use `voiceInput`. */
|
|
14
|
-
enableVoiceChat?: boolean;
|
|
15
|
-
/** @deprecated removed in 2.11.0; ignored. */
|
|
16
|
-
readAloud?: boolean;
|
|
17
|
-
welcomeMessage?: string;
|
|
18
|
-
placeholderText?: string;
|
|
19
|
-
organizationLogo?: string;
|
|
20
|
-
buttonIcon?: string;
|
|
21
|
-
buttonShape?: "round" | "square";
|
|
22
|
-
autoOpen?: boolean;
|
|
23
|
-
greeting?: boolean | {
|
|
24
|
-
message?: string;
|
|
25
|
-
delayMs?: number;
|
|
26
|
-
};
|
|
27
|
-
showTimestamp?: boolean;
|
|
28
|
-
soundEnabled?: boolean;
|
|
29
|
-
soundVolume?: number;
|
|
30
|
-
poweredBy?: string;
|
|
31
|
-
userId?: string;
|
|
32
|
-
timestamp?: number;
|
|
33
|
-
signature?: string;
|
|
34
|
-
turnstileSiteKey?: string;
|
|
35
|
-
excludePaths?: string[];
|
|
36
|
-
includePaths?: string[];
|
|
37
|
-
configOverride?: Record<string, any>;
|
|
38
|
-
debug?: boolean;
|
|
39
|
-
onMessageSent?: (message: string) => void;
|
|
40
|
-
onMessageReceived?: (reply: string) => void;
|
|
41
|
-
onChatOpened?: () => void;
|
|
42
|
-
onChatClosed?: () => void;
|
|
43
|
-
onEscalation?: (data: any) => void;
|
|
44
|
-
}
|
|
45
|
-
declare const Askly: {
|
|
46
|
-
init: (config?: AsklyConfig) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Tell Askly who the current visitor is.
|
|
49
|
-
*
|
|
50
|
-
* Call this after your user logs in. Everything they did anonymously beforehand — on this
|
|
51
|
-
* browser — is merged into their profile, so an agent sees one person with one history
|
|
52
|
-
* instead of a stranger every session.
|
|
53
|
-
*
|
|
54
|
-
* Askly.identify({
|
|
55
|
-
* userId: "usr_8812",
|
|
56
|
-
* email: "priya@example.com",
|
|
57
|
-
* name: "Priya Raman",
|
|
58
|
-
* hash: "<HMAC-SHA256 of userId+timestamp, computed on YOUR server>",
|
|
59
|
-
* timestamp: 1735689600,
|
|
60
|
-
* });
|
|
61
|
-
*
|
|
62
|
-
* The `hash` is what makes the claim trustworthy. Compute it server-side with your
|
|
63
|
-
* organization's widget secret key — never ship that secret to the browser. Without a
|
|
64
|
-
* hash the traits are used locally but the server will not link the accounts, because
|
|
65
|
-
* anything the browser asserts unsigned could be forged to claim another person's history.
|
|
66
|
-
*/
|
|
67
|
-
identify: (identity: AsklyIdentity) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Forget the current visitor: clears their browser token and local chat history.
|
|
70
|
-
* Call on logout, especially on shared computers — otherwise the next person inherits
|
|
71
|
-
* the previous one's conversations.
|
|
72
|
-
*/
|
|
73
|
-
reset: () => void;
|
|
74
|
-
/** Remove the widget from the page. Also resets identity, as on logout. */
|
|
75
|
-
shutdown: () => void;
|
|
76
|
-
/** Open the chat panel — for host-page CTAs like a "Contact us" button. */
|
|
77
|
-
open: () => void;
|
|
78
|
-
/** Close the chat panel. */
|
|
79
|
-
close: () => void;
|
|
80
|
-
/** Toggle the chat panel. */
|
|
81
|
-
toggle: () => void;
|
|
82
|
-
/** Aliases of open() / close(). */
|
|
83
|
-
show: () => void;
|
|
84
|
-
hide: () => void;
|
|
85
|
-
/** Whether the chat panel is open right now. */
|
|
86
|
-
isOpen: () => boolean;
|
|
87
|
-
/** Agent replies the visitor has not seen yet (the number on the launcher badge). */
|
|
88
|
-
getUnreadCount: () => number;
|
|
89
|
-
/** This browser's anonymous visitor id, or "" before the widget has mounted. */
|
|
90
|
-
getVisitorId: () => string;
|
|
91
|
-
/**
|
|
92
|
-
* Listen for a widget event. Returns a function that removes the listener.
|
|
93
|
-
*
|
|
94
|
-
* Askly.on("message:received", ({ text, from }) => analytics.track("support_reply", { from }));
|
|
95
|
-
* Askly.on("unread", ({ count }) => setBadge(count));
|
|
96
|
-
*/
|
|
97
|
-
on: <K extends keyof AsklyEventMap>(name: K, handler: AsklyEventHandler<K>) => (() => void);
|
|
98
|
-
off: <K_1 extends keyof AsklyEventMap>(name: K_1, handler: AsklyEventHandler<K_1>) => void;
|
|
99
|
-
once: <K_2 extends keyof AsklyEventMap>(name: K_2, handler: AsklyEventHandler<K_2>) => (() => void);
|
|
100
|
-
/** Resolves when the widget has mounted and applied its configuration. */
|
|
101
|
-
ready: () => Promise<void>;
|
|
102
|
-
/** Open the widget on a section: "home", "messages" or "help". */
|
|
103
|
-
showSpace: (space: AsklySpace) => void;
|
|
104
|
-
/** Open the chat with the composer ready, optionally pre-filled. Nothing is sent. */
|
|
105
|
-
showNewMessage: (text?: string) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Open the chat and send a message as the visitor. It goes through the same checks as a
|
|
108
|
-
* typed message; if one is pending (email required, security check) it waits in the composer.
|
|
109
|
-
*/
|
|
110
|
-
sendMessage: (text: string) => void;
|
|
111
|
-
/** Open a help article by id, as listed in the Help tab. */
|
|
112
|
-
showArticle: (articleId: string) => void;
|
|
113
|
-
/** Open the chat and start recording a voice message. The browser may ask for the microphone. */
|
|
114
|
-
startVoiceInput: () => void;
|
|
115
|
-
/** Finish the recording in progress and transcribe it. */
|
|
116
|
-
stopVoiceInput: () => void;
|
|
117
|
-
/**
|
|
118
|
-
* Change display settings on the mounted widget without re-initialising: the fields the
|
|
119
|
-
* portal controls, e.g. `{ themeColor, theme, organizationName, welcomeMessage, buttonShape }`.
|
|
120
|
-
*/
|
|
121
|
-
update: (config: Record<string, any>) => void;
|
|
122
|
-
};
|
|
123
|
-
export default Askly;
|
|
124
|
-
export type { AsklyIdentity, AsklyEventMap, AsklyEventName, AsklyEventHandler, AsklySpace };
|
package/dist/ui/ChatTerms.d.ts
DELETED
package/dist/widget.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ChatWidgetProps } from "./core/types";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
export declare const ChatWidget: ({ orgId, organizationName: initialOrganizationName, themeColor: initialThemeColor, theme: initialTheme, position, orgServerRoute, enableVoiceChat: initialEnableVoiceChat, voiceInput: initialVoiceInput, welcomeMessage: initialWelcomeMessage, placeholderText, organizationLogo: initialOrganizationLogo, buttonIcon, buttonShape: initialButtonShape, autoOpen, greeting, showTimestamp, soundEnabled, soundVolume, poweredBy, userId, timestamp, signature, turnstileSiteKey, excludePaths, includePaths, configOverride, resetGeneration: initResetGeneration, onMessageSent, onMessageReceived, onChatOpened, onChatClosed, onEscalation, }: ChatWidgetProps) => React.JSX.Element | null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|