@accurix/centrinfo-widget 1.1.0 → 4.0.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/dist/cdn/centrinfo-widget.js +303 -61
- package/dist/cdn/manifest.json +6 -6
- package/dist/{config-CHvO9tW1.mjs → config-CkU4urQY.mjs} +7 -7
- package/dist/{config-BfVMFkZ4.cjs → config-DsNMbdKp.cjs} +7 -7
- package/dist/index.cjs +284 -42
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +284 -42
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.cts +36 -7
- package/dist/runtime.d.mts +36 -7
- package/dist/runtime.mjs +1 -1
- package/dist/{types-BwixZ4yh.d.mts → types-1ZJJY7Da.d.mts} +280 -8
- package/dist/{types-CiW6Ilds.d.cts → types-B0r4SXaT.d.cts} +280 -8
- package/package.json +4 -4
package/dist/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./config-
|
|
1
|
+
const e=require(`./config-DsNMbdKp.cjs`),t=t=>t.demo?new e.S:t.preview?new e.x(new e.C(t.apiBaseUrl,t.token,t.gifApiKey,t.analyticsContextToken,{agentName:t.agentName,agentAvatarUrl:t.agentAvatarUrl},t.identityToken,t.getIdentityToken,t.chatSurface),t.strings):new e.C(t.apiBaseUrl,t.token,t.gifApiKey,t.analyticsContextToken,{agentName:t.agentName,agentAvatarUrl:t.agentAvatarUrl},t.identityToken,t.getIdentityToken,t.chatSurface);exports.ResultTable=e.m,exports.WidgetAnalyticsChart=e._,exports.buildWidgetAnalyticsChartModel=e.v,exports.createChatTransport=t,exports.createPreferredAudioRecorder=e.u,exports.createVoiceAudioConstraints=e.d,exports.formatResultCell=e.h,exports.renderRich=e.a,exports.resolveConfig=e.t,exports.serializeResultCsv=e.g,exports.stopRecorderWithFlush=e.f,exports.useChat=e.n;
|
package/dist/runtime.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as PublicChatActionField, a as Source, c as WidgetConfig, d as WidgetUser, f as ActionResult, g as PublicChatAction, h as GifResult, i as FeaturedLink, m as DemoSlotsResult, n as ChatArtifact, o as Visitor, p as AnalyticsVisualization, r as ChatMessage, s as WidgetActionTranslation, t as BootstrapInfo, u as WidgetThemeTokens, v as Transport, y as WidgetStrings } from "./types-B0r4SXaT.cjs";
|
|
2
2
|
import * as preact0 from "preact";
|
|
3
3
|
import { JSX } from "preact";
|
|
4
4
|
|
|
5
5
|
//#region src/config.d.ts
|
|
6
|
-
interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'user' | 'analyticsContextToken' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onAction' | 'onHandoff'>> {
|
|
6
|
+
interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'locale' | 'translations' | 'user' | 'analyticsContextToken' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onAction' | 'onHandoff'>> {
|
|
7
7
|
accentColor?: string;
|
|
8
8
|
agentName?: string;
|
|
9
9
|
agentAvatarUrl?: string;
|
|
@@ -12,6 +12,8 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
|
|
|
12
12
|
gifApiKey?: string;
|
|
13
13
|
/** Resolved string table (English defaults + host `labels` overrides). */
|
|
14
14
|
strings: WidgetStrings;
|
|
15
|
+
locale: string;
|
|
16
|
+
actionTranslations: Record<string, WidgetActionTranslation>;
|
|
15
17
|
/** Host-app SSO passthrough (see WidgetConfig.user). Optional. */
|
|
16
18
|
user?: WidgetConfig['user'];
|
|
17
19
|
/** Short-lived signed context for governed customer analytics. */
|
|
@@ -32,6 +34,9 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
|
|
|
32
34
|
}
|
|
33
35
|
declare const resolveConfig: (cfg: WidgetConfig) => ResolvedConfig;
|
|
34
36
|
//#endregion
|
|
37
|
+
//#region ../centrinfo-results/src/analytics-chart-catalog.d.ts
|
|
38
|
+
type AnalyticsChartCatalogType = 'kpi' | 'table' | 'line' | 'bar' | 'pie' | 'scatter' | 'effectScatter' | 'map' | 'candlestick' | 'boxplot' | 'graph' | 'lines' | 'tree' | 'treemap' | 'sunburst' | 'parallel' | 'sankey' | 'funnel' | 'heatmap' | 'radar' | 'gauge' | 'pictorialBar' | 'themeRiver' | 'matrix' | 'chord' | 'custom' | 'dataset' | 'dataZoom' | 'graphic' | 'richText' | 'globe' | 'bar3D' | 'scatter3D' | 'surface' | 'map3D' | 'lines3D' | 'line3D' | 'scatterGL' | 'linesGL' | 'flowGL' | 'graphGL' | 'polygons3D';
|
|
39
|
+
//#endregion
|
|
35
40
|
//#region ../centrinfo-results/src/types.d.ts
|
|
36
41
|
interface AnalyticsVisualizationColumn {
|
|
37
42
|
key: string;
|
|
@@ -48,9 +53,12 @@ interface AnalyticsVisualizationColumn {
|
|
|
48
53
|
groupable?: boolean;
|
|
49
54
|
}
|
|
50
55
|
interface AnalyticsVisualizationRecommendation {
|
|
51
|
-
type:
|
|
56
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
52
57
|
mode: string;
|
|
53
58
|
categoryField?: string;
|
|
59
|
+
latitudeField?: string;
|
|
60
|
+
longitudeField?: string;
|
|
61
|
+
geometryField?: string;
|
|
54
62
|
valueFields?: string[];
|
|
55
63
|
seriesField?: string;
|
|
56
64
|
reason?: string;
|
|
@@ -59,10 +67,13 @@ interface AnalyticsVisualizationRecommendation {
|
|
|
59
67
|
interface AnalyticsVisualization$1 {
|
|
60
68
|
version?: number;
|
|
61
69
|
presentation?: 'kpi' | 'chart' | 'table';
|
|
62
|
-
type:
|
|
70
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
63
71
|
title?: string;
|
|
64
72
|
label?: string;
|
|
65
73
|
value?: string;
|
|
74
|
+
latitudeField?: string;
|
|
75
|
+
longitudeField?: string;
|
|
76
|
+
geometryField?: string;
|
|
66
77
|
valueFields?: string[];
|
|
67
78
|
series?: string;
|
|
68
79
|
seriesField?: string;
|
|
@@ -145,6 +156,23 @@ declare const ResultTable: ({
|
|
|
145
156
|
//#region src/rich.d.ts
|
|
146
157
|
declare const renderRich: (text: string) => JSX.Element[];
|
|
147
158
|
//#endregion
|
|
159
|
+
//#region src/audio.d.ts
|
|
160
|
+
interface VoiceAudioCapabilities {
|
|
161
|
+
echoCancellation?: boolean;
|
|
162
|
+
noiseSuppression?: boolean;
|
|
163
|
+
autoGainControl?: boolean;
|
|
164
|
+
channelCount?: boolean;
|
|
165
|
+
voiceIsolation?: boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Build a best-effort microphone profile for conversational speech. Every
|
|
169
|
+
* enhancement is capability-driven and optional, so unsupported processing
|
|
170
|
+
* cannot make microphone permission fail.
|
|
171
|
+
*/
|
|
172
|
+
declare const createVoiceAudioConstraints: (deviceId?: string, supported?: VoiceAudioCapabilities) => MediaTrackConstraints;
|
|
173
|
+
declare const createPreferredAudioRecorder: (stream: MediaStream) => MediaRecorder;
|
|
174
|
+
declare const stopRecorderWithFlush: (recorder: MediaRecorder | null | undefined) => void;
|
|
175
|
+
//#endregion
|
|
148
176
|
//#region src/useChat.d.ts
|
|
149
177
|
/** One past conversation, for the in-widget history list. */
|
|
150
178
|
interface HistoryEntry {
|
|
@@ -205,8 +233,9 @@ interface ChatApi {
|
|
|
205
233
|
/** Conversation-level CSAT at end-of-chat. Best-effort. */
|
|
206
234
|
submitCsat: (rating: 'up' | 'down', comment?: string) => void;
|
|
207
235
|
/** Submit an inline action form; persists identity so Case-1 auto-handoff can fire later. */
|
|
208
|
-
submitForm: (type:
|
|
209
|
-
|
|
236
|
+
submitForm: (type: string, payload: Record<string, unknown>, identity?: Visitor, /** Backend-declared endpoint; authoritative when present. */
|
|
237
|
+
endpointOverride?: string) => Promise<ActionResult>;
|
|
238
|
+
transcribe: (audio: Blob | string, mimeType: string, languageHint?: string, durationSeconds?: number) => Promise<string>;
|
|
210
239
|
/** Extract text from an attached image/PDF (folded into the next message). */
|
|
211
240
|
extract: (fileBase64: string, mimeType: string, filename?: string) => Promise<string>;
|
|
212
241
|
searchGifs: (query: string) => Promise<GifResult[]>;
|
|
@@ -246,4 +275,4 @@ declare const useChat: (transport: Transport, config: ResolvedConfig, active?: b
|
|
|
246
275
|
//#region src/runtime.d.ts
|
|
247
276
|
declare const createChatTransport: (config: ResolvedConfig) => Transport;
|
|
248
277
|
//#endregion
|
|
249
|
-
export { type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatMessage, type HistoryEntry, type ResolvedConfig, ResultTable, type Source, type Transport, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, buildWidgetAnalyticsChartModel, createChatTransport, formatResultCell, renderRich, resolveConfig, serializeResultCsv, useChat };
|
|
278
|
+
export { type ActionResult, type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatArtifact, type ChatMessage, type DemoSlotsResult, type HistoryEntry, type PublicChatAction, type PublicChatActionField, type ResolvedConfig, ResultTable, type Source, type Transport, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, buildWidgetAnalyticsChartModel, createChatTransport, createPreferredAudioRecorder, createVoiceAudioConstraints, formatResultCell, renderRich, resolveConfig, serializeResultCsv, stopRecorderWithFlush, useChat };
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as PublicChatActionField, a as Source, c as WidgetConfig, d as WidgetUser, f as ActionResult, g as PublicChatAction, h as GifResult, i as FeaturedLink, m as DemoSlotsResult, n as ChatArtifact, o as Visitor, p as AnalyticsVisualization, r as ChatMessage, s as WidgetActionTranslation, t as BootstrapInfo, u as WidgetThemeTokens, v as Transport, y as WidgetStrings } from "./types-1ZJJY7Da.mjs";
|
|
2
2
|
import * as preact0 from "preact";
|
|
3
3
|
import { JSX } from "preact";
|
|
4
4
|
|
|
5
5
|
//#region src/config.d.ts
|
|
6
|
-
interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'user' | 'analyticsContextToken' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onAction' | 'onHandoff'>> {
|
|
6
|
+
interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'locale' | 'translations' | 'user' | 'analyticsContextToken' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onAction' | 'onHandoff'>> {
|
|
7
7
|
accentColor?: string;
|
|
8
8
|
agentName?: string;
|
|
9
9
|
agentAvatarUrl?: string;
|
|
@@ -12,6 +12,8 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
|
|
|
12
12
|
gifApiKey?: string;
|
|
13
13
|
/** Resolved string table (English defaults + host `labels` overrides). */
|
|
14
14
|
strings: WidgetStrings;
|
|
15
|
+
locale: string;
|
|
16
|
+
actionTranslations: Record<string, WidgetActionTranslation>;
|
|
15
17
|
/** Host-app SSO passthrough (see WidgetConfig.user). Optional. */
|
|
16
18
|
user?: WidgetConfig['user'];
|
|
17
19
|
/** Short-lived signed context for governed customer analytics. */
|
|
@@ -32,6 +34,9 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
|
|
|
32
34
|
}
|
|
33
35
|
declare const resolveConfig: (cfg: WidgetConfig) => ResolvedConfig;
|
|
34
36
|
//#endregion
|
|
37
|
+
//#region ../centrinfo-results/src/analytics-chart-catalog.d.ts
|
|
38
|
+
type AnalyticsChartCatalogType = 'kpi' | 'table' | 'line' | 'bar' | 'pie' | 'scatter' | 'effectScatter' | 'map' | 'candlestick' | 'boxplot' | 'graph' | 'lines' | 'tree' | 'treemap' | 'sunburst' | 'parallel' | 'sankey' | 'funnel' | 'heatmap' | 'radar' | 'gauge' | 'pictorialBar' | 'themeRiver' | 'matrix' | 'chord' | 'custom' | 'dataset' | 'dataZoom' | 'graphic' | 'richText' | 'globe' | 'bar3D' | 'scatter3D' | 'surface' | 'map3D' | 'lines3D' | 'line3D' | 'scatterGL' | 'linesGL' | 'flowGL' | 'graphGL' | 'polygons3D';
|
|
39
|
+
//#endregion
|
|
35
40
|
//#region ../centrinfo-results/src/types.d.ts
|
|
36
41
|
interface AnalyticsVisualizationColumn {
|
|
37
42
|
key: string;
|
|
@@ -48,9 +53,12 @@ interface AnalyticsVisualizationColumn {
|
|
|
48
53
|
groupable?: boolean;
|
|
49
54
|
}
|
|
50
55
|
interface AnalyticsVisualizationRecommendation {
|
|
51
|
-
type:
|
|
56
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
52
57
|
mode: string;
|
|
53
58
|
categoryField?: string;
|
|
59
|
+
latitudeField?: string;
|
|
60
|
+
longitudeField?: string;
|
|
61
|
+
geometryField?: string;
|
|
54
62
|
valueFields?: string[];
|
|
55
63
|
seriesField?: string;
|
|
56
64
|
reason?: string;
|
|
@@ -59,10 +67,13 @@ interface AnalyticsVisualizationRecommendation {
|
|
|
59
67
|
interface AnalyticsVisualization$1 {
|
|
60
68
|
version?: number;
|
|
61
69
|
presentation?: 'kpi' | 'chart' | 'table';
|
|
62
|
-
type:
|
|
70
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
63
71
|
title?: string;
|
|
64
72
|
label?: string;
|
|
65
73
|
value?: string;
|
|
74
|
+
latitudeField?: string;
|
|
75
|
+
longitudeField?: string;
|
|
76
|
+
geometryField?: string;
|
|
66
77
|
valueFields?: string[];
|
|
67
78
|
series?: string;
|
|
68
79
|
seriesField?: string;
|
|
@@ -145,6 +156,23 @@ declare const ResultTable: ({
|
|
|
145
156
|
//#region src/rich.d.ts
|
|
146
157
|
declare const renderRich: (text: string) => JSX.Element[];
|
|
147
158
|
//#endregion
|
|
159
|
+
//#region src/audio.d.ts
|
|
160
|
+
interface VoiceAudioCapabilities {
|
|
161
|
+
echoCancellation?: boolean;
|
|
162
|
+
noiseSuppression?: boolean;
|
|
163
|
+
autoGainControl?: boolean;
|
|
164
|
+
channelCount?: boolean;
|
|
165
|
+
voiceIsolation?: boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Build a best-effort microphone profile for conversational speech. Every
|
|
169
|
+
* enhancement is capability-driven and optional, so unsupported processing
|
|
170
|
+
* cannot make microphone permission fail.
|
|
171
|
+
*/
|
|
172
|
+
declare const createVoiceAudioConstraints: (deviceId?: string, supported?: VoiceAudioCapabilities) => MediaTrackConstraints;
|
|
173
|
+
declare const createPreferredAudioRecorder: (stream: MediaStream) => MediaRecorder;
|
|
174
|
+
declare const stopRecorderWithFlush: (recorder: MediaRecorder | null | undefined) => void;
|
|
175
|
+
//#endregion
|
|
148
176
|
//#region src/useChat.d.ts
|
|
149
177
|
/** One past conversation, for the in-widget history list. */
|
|
150
178
|
interface HistoryEntry {
|
|
@@ -205,8 +233,9 @@ interface ChatApi {
|
|
|
205
233
|
/** Conversation-level CSAT at end-of-chat. Best-effort. */
|
|
206
234
|
submitCsat: (rating: 'up' | 'down', comment?: string) => void;
|
|
207
235
|
/** Submit an inline action form; persists identity so Case-1 auto-handoff can fire later. */
|
|
208
|
-
submitForm: (type:
|
|
209
|
-
|
|
236
|
+
submitForm: (type: string, payload: Record<string, unknown>, identity?: Visitor, /** Backend-declared endpoint; authoritative when present. */
|
|
237
|
+
endpointOverride?: string) => Promise<ActionResult>;
|
|
238
|
+
transcribe: (audio: Blob | string, mimeType: string, languageHint?: string, durationSeconds?: number) => Promise<string>;
|
|
210
239
|
/** Extract text from an attached image/PDF (folded into the next message). */
|
|
211
240
|
extract: (fileBase64: string, mimeType: string, filename?: string) => Promise<string>;
|
|
212
241
|
searchGifs: (query: string) => Promise<GifResult[]>;
|
|
@@ -246,4 +275,4 @@ declare const useChat: (transport: Transport, config: ResolvedConfig, active?: b
|
|
|
246
275
|
//#region src/runtime.d.ts
|
|
247
276
|
declare const createChatTransport: (config: ResolvedConfig) => Transport;
|
|
248
277
|
//#endregion
|
|
249
|
-
export { type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatMessage, type HistoryEntry, type ResolvedConfig, ResultTable, type Source, type Transport, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, buildWidgetAnalyticsChartModel, createChatTransport, formatResultCell, renderRich, resolveConfig, serializeResultCsv, useChat };
|
|
278
|
+
export { type ActionResult, type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatArtifact, type ChatMessage, type DemoSlotsResult, type HistoryEntry, type PublicChatAction, type PublicChatActionField, type ResolvedConfig, ResultTable, type Source, type Transport, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, buildWidgetAnalyticsChartModel, createChatTransport, createPreferredAudioRecorder, createVoiceAudioConstraints, formatResultCell, renderRich, resolveConfig, serializeResultCsv, stopRecorderWithFlush, useChat };
|
package/dist/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,S as t,_ as n,a as r,d as i,f as a,g as o,h as s,m as c,n as l,t as u,u as d,v as f,x as p}from"./config-CkU4urQY.mjs";const m=n=>n.demo?new t:n.preview?new p(new e(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface),n.strings):new e(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface);export{c as ResultTable,n as WidgetAnalyticsChart,f as buildWidgetAnalyticsChartModel,m as createChatTransport,d as createPreferredAudioRecorder,i as createVoiceAudioConstraints,s as formatResultCell,r as renderRich,u as resolveConfig,o as serializeResultCsv,a as stopRecorderWithFlush,l as useChat};
|