impact-chatbot 3.1.3 → 3.1.6
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/components/core-chart/CoreChart.d.ts +1 -1
- package/dist/components/message-template/components/message-actions/AssistantMessageActions.d.ts +16 -0
- package/dist/components/message-template/components/message-content/iris-message/IrisMessageContext.d.ts +15 -0
- package/dist/components/message-template/components/message-content/iris-message/ResponseCard.d.ts +11 -0
- package/dist/components/message-template/components/message-content/steps-accordion/ProcessStepsAccordion.d.ts +23 -0
- package/dist/components/message-template/components/message-content/steps-accordion/StepTimelineItem.d.ts +26 -0
- package/dist/components/message-template/components/message-content/steps-accordion/styles.d.ts +6 -0
- package/dist/components/message-template/components/message-content/steps-accordion/utils.d.ts +27 -0
- package/dist/components/message-template/components/message-content/tabular-content/index.d.ts +3 -1
- package/dist/hooks/useSuggestedPrompts.d.ts +21 -0
- package/dist/index.cjs.css +13 -9
- package/dist/index.cjs.js +1470 -1238
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.css +13 -9
- package/dist/index.esm.js +1467 -1235
- package/dist/index.esm.js.map +1 -1
- package/dist/services/conversation-service.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/message-template/components/message-actions/LikeDislikeActions.d.ts +0 -7
|
@@ -10,7 +10,7 @@ import 'highcharts/esm/modules/pareto.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* CoreChart Component
|
|
12
12
|
* A simple wrapper around the Highcharts React component.
|
|
13
|
-
*
|
|
13
|
+
* Passes the provided options to Highcharts, minus string-typed callbacks.
|
|
14
14
|
*
|
|
15
15
|
* @param {Object} props - Component props
|
|
16
16
|
* @param {Object} props.options - Highcharts options configuration
|
package/dist/components/message-template/components/message-actions/AssistantMessageActions.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Window event handled in `src/index.tsx`: re-sends the prompt that produced a bot message. */
|
|
2
|
+
export declare const REGENERATE_EVENT = "iris:regenerate";
|
|
3
|
+
/** The textual part of a bot message (what copy and speak operate on). */
|
|
4
|
+
export declare const getMessagePlainText: (botData: any) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Action row for a completed bot message, in the Iris design order: copy,
|
|
7
|
+
* like, dislike, regenerate, read aloud. (The library's own action row is
|
|
8
|
+
* switched off for our messages because its copy can't read our JSX content.)
|
|
9
|
+
*/
|
|
10
|
+
declare const AssistantMessageActions: ({ botData, likeDislikeKey, handleLikeDislike, }: {
|
|
11
|
+
botData: any;
|
|
12
|
+
state?: any;
|
|
13
|
+
likeDislikeKey?: string;
|
|
14
|
+
handleLikeDislike?: (key: string, isLike: boolean, answer: any, chatIndex: number) => void;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default AssistantMessageActions;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Per-message details that the library's Iris thread no longer renders for us
|
|
4
|
+
* (it only draws avatar + a plain bubble). BotMessage provides them and the
|
|
5
|
+
* pieces that now draw the message chrome (steps header, response card) read
|
|
6
|
+
* them.
|
|
7
|
+
*/
|
|
8
|
+
export interface IrisMessageChrome {
|
|
9
|
+
/** "Completed in 0m:05s" / live "Working for ..." caption (string or element). */
|
|
10
|
+
thinkingCaption?: ReactNode;
|
|
11
|
+
/** Message time, e.g. "7:53 PM". */
|
|
12
|
+
timeLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const IrisMessageContext: import("react").Context<IrisMessageChrome>;
|
|
15
|
+
export declare const useIrisMessageChrome: () => IrisMessageChrome;
|
package/dist/components/message-template/components/message-content/iris-message/ResponseCard.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The gray response card from the Iris design: wraps a bot response and shows
|
|
4
|
+
* the message time at its bottom right.
|
|
5
|
+
*/
|
|
6
|
+
declare const ResponseCard: ({ children, shrink, }: {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Size the card to its text when the reply is short. */
|
|
9
|
+
shrink?: boolean;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default ResponseCard;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface ProcessStepsAccordionProps {
|
|
2
|
+
/** Timeline content */
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/** Whether the timeline is currently open */
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
onToggle: () => void;
|
|
7
|
+
/** Live phase: shows "Thinking (n/m)..." with shimmer, no toggle */
|
|
8
|
+
isThinking: boolean;
|
|
9
|
+
/** Whether the user may collapse / expand the timeline */
|
|
10
|
+
canToggle: boolean;
|
|
11
|
+
done: number;
|
|
12
|
+
total: number;
|
|
13
|
+
/** Play the slide-in / item fade-in animations on mount (default true) */
|
|
14
|
+
animateEntrance?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* "Thinking (n/m)..." while the agent works, "Process Steps (n/m)" once it is
|
|
18
|
+
* done. Wraps the step timeline in an animated collapsible body. The sparkle
|
|
19
|
+
* avatar is drawn by the library's Iris thread, so the header has no icon; the
|
|
20
|
+
* message's "Completed in ..." caption sits at the right of the header row.
|
|
21
|
+
*/
|
|
22
|
+
declare const ProcessStepsAccordion: ({ children, expanded, onToggle, isThinking, canToggle, done, total, animateEntrance, }: ProcessStepsAccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default ProcessStepsAccordion;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface StepTimelineItemProps {
|
|
2
|
+
title: string;
|
|
3
|
+
status: "completed" | "in-progress" | "error" | "not-started" | string;
|
|
4
|
+
isLast: boolean;
|
|
5
|
+
/** Whether the step has any collapsible content (sub-steps, form, ...) */
|
|
6
|
+
hasBody: boolean;
|
|
7
|
+
/** Keeps the body open (e.g. a step form is waiting for / showing input) */
|
|
8
|
+
forceExpanded?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Keep the body open after this step completes, until a later step arrives
|
|
11
|
+
* and the parent clears the flag. Completion alone must not fold it.
|
|
12
|
+
*/
|
|
13
|
+
holdOpen?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One row of the timeline: status dot + connector line, a title with a
|
|
18
|
+
* rotating chevron, and an animated collapsible body.
|
|
19
|
+
*
|
|
20
|
+
* Body behaviour: open while the step is running, and stay open after it
|
|
21
|
+
* completes until a later step arrives (`holdOpen` cleared). Then it folds
|
|
22
|
+
* away. It re-opens if it becomes active again. A manual toggle by the user
|
|
23
|
+
* wins until the next status or holdOpen change.
|
|
24
|
+
*/
|
|
25
|
+
declare const StepTimelineItem: ({ title, status, isLast, hasBody, forceExpanded, holdOpen, children, }: StepTimelineItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default StepTimelineItem;
|
package/dist/components/message-template/components/message-content/steps-accordion/styles.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared styles for the "Process Steps" accordion (header + timeline items).
|
|
3
|
+
* Used by both the live stream (StepsResponseTab) and history/restream
|
|
4
|
+
* (TabularContent) so the two views stay visually identical.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useStepsAccordionStyles: any;
|
package/dist/components/message-template/components/message-content/steps-accordion/utils.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines the overall status of a question based on its steps.
|
|
3
|
+
* - "completed": all steps are completed
|
|
4
|
+
* - "in-progress": at least one step is not-completed (loading)
|
|
5
|
+
* - "error": at least one step has error
|
|
6
|
+
* - "not-started": no steps or all pending
|
|
7
|
+
*/
|
|
8
|
+
export declare const getQuestionStatus: (questionSteps: any, emptyIsCompleted?: boolean) => "error" | "completed" | "in-progress" | "not-started";
|
|
9
|
+
/**
|
|
10
|
+
* Progress shown in the accordion header: completed questions out of total.
|
|
11
|
+
* Before any question is known the whole request counts as a single step.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getProgress: (questions?: any[], questionsStepsMap?: {}) => {
|
|
14
|
+
done: number;
|
|
15
|
+
total: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* True once a question has a real step (not the "Processing Request"
|
|
19
|
+
* placeholder) or a step form. Used to tell "this step arrived" from the
|
|
20
|
+
* placeholder rows that exist before any step is fetched.
|
|
21
|
+
*/
|
|
22
|
+
export declare const questionHasArrivedStep: (steps: any, formEntry: any) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The question whose body should stay open: the latest one that has actually
|
|
25
|
+
* received a step. Earlier questions fold only after this index moves on.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getActiveQuestionIndex: (questions?: any[], questionsStepsMap?: {}, stepFormDataMap?: {}) => number;
|
package/dist/components/message-template/components/message-content/tabular-content/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const TabularContent: ({ steps: initialSteps, currentTabValue, children, questions: initialQuestions, questionsStepsMap: initialQuestionsStepsMap, stepFormDataMap: initialStepFormDataMap, isFormDisabled, sessionId: propSessionId, chatSessionId, botProps, currentMode, agentId }: {
|
|
1
|
+
declare const TabularContent: ({ steps: initialSteps, currentTabValue, children, questions: initialQuestions, questionsStepsMap: initialQuestionsStepsMap, stepFormDataMap: initialStepFormDataMap, isFormDisabled, sessionId: propSessionId, chatSessionId, botProps, currentMode, agentId, savedRestream, onRestreamComplete }: {
|
|
2
2
|
steps: any;
|
|
3
3
|
currentTabValue: any;
|
|
4
4
|
children: any;
|
|
@@ -11,6 +11,8 @@ declare const TabularContent: ({ steps: initialSteps, currentTabValue, children,
|
|
|
11
11
|
botProps?: any;
|
|
12
12
|
currentMode?: string;
|
|
13
13
|
agentId?: string;
|
|
14
|
+
savedRestream?: any;
|
|
15
|
+
onRestreamComplete?: any;
|
|
14
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
/** Reset the active instance tracker (call when a new conversation starts from the input field) */
|
|
16
18
|
export declare const resetActiveTabularInstance: () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface AgentSuggestedPrompt {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
agentId: string | number | undefined;
|
|
5
|
+
}
|
|
6
|
+
interface UseSuggestedPromptsArgs {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
legacyAgentScreen?: boolean;
|
|
9
|
+
displayQuestions?: boolean;
|
|
10
|
+
questions?: any[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the greeting screen's suggested prompts from the same sources the
|
|
14
|
+
* old ChatPlaceholder cards used:
|
|
15
|
+
* - `questions` prop when `displayQuestions` is on
|
|
16
|
+
* - agents fetched from the backend when `legacyAgentScreen` is on
|
|
17
|
+
* When neither is enabled the old cards were static and non-clickable, so no
|
|
18
|
+
* prompts are produced.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useSuggestedPrompts: ({ baseUrl, legacyAgentScreen, displayQuestions, questions, }: UseSuggestedPromptsArgs) => AgentSuggestedPrompt[];
|
|
21
|
+
export {};
|
package/dist/index.cjs.css
CHANGED
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
padding: 12px;
|
|
367
367
|
background: #fff;
|
|
368
368
|
border: 1px solid #d9dde7;
|
|
369
|
-
box-shadow:
|
|
369
|
+
box-shadow: 0 0 12px rgba(0, 0, 0, 0.0588235294);
|
|
370
370
|
}
|
|
371
371
|
.chat-input-container:hover {
|
|
372
372
|
border: 1px solid #b3bdf8;
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
|
|
378
378
|
.chat-input-wrapper {
|
|
379
379
|
display: flex;
|
|
380
|
-
align-items:
|
|
380
|
+
align-items: center;
|
|
381
381
|
width: 100%;
|
|
382
382
|
max-height: 182px;
|
|
383
383
|
transition: all 0.2s ease-in-out;
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
.chat-input-wrapper.has-filter-selected .chat-input-editor {
|
|
401
401
|
grid-column: 1/-1;
|
|
402
402
|
grid-row: 1;
|
|
403
|
-
min-height:
|
|
403
|
+
min-height: 32px;
|
|
404
404
|
width: 100%;
|
|
405
405
|
flex: none;
|
|
406
406
|
}
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
|
|
417
417
|
.chat-input-wrapper.empty {
|
|
418
418
|
flex-direction: row;
|
|
419
|
-
align-items:
|
|
419
|
+
align-items: center;
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
.chat-input-wrapper.single-line-textarea {
|
|
@@ -424,9 +424,12 @@
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
.chat-input-editor {
|
|
427
|
+
position: relative;
|
|
427
428
|
flex: 1;
|
|
428
|
-
min-height:
|
|
429
|
+
min-height: 32px;
|
|
429
430
|
max-height: 142px;
|
|
431
|
+
box-sizing: border-box;
|
|
432
|
+
padding: 5px 0;
|
|
430
433
|
overflow-y: auto;
|
|
431
434
|
overflow-x: hidden;
|
|
432
435
|
font-size: 14px;
|
|
@@ -445,6 +448,9 @@
|
|
|
445
448
|
color: #b4bac7;
|
|
446
449
|
pointer-events: none;
|
|
447
450
|
position: absolute;
|
|
451
|
+
left: 0;
|
|
452
|
+
top: 50%;
|
|
453
|
+
transform: translateY(-50%);
|
|
448
454
|
}
|
|
449
455
|
.chat-input-editor:focus {
|
|
450
456
|
outline: none;
|
|
@@ -452,7 +458,7 @@
|
|
|
452
458
|
|
|
453
459
|
.chat-actions {
|
|
454
460
|
display: flex;
|
|
455
|
-
align-items:
|
|
461
|
+
align-items: center;
|
|
456
462
|
gap: 12px;
|
|
457
463
|
justify-content: flex-end;
|
|
458
464
|
height: 32px;
|
|
@@ -464,6 +470,7 @@
|
|
|
464
470
|
height: 32px;
|
|
465
471
|
}
|
|
466
472
|
|
|
473
|
+
.send-icon-button .ia-btn-icon,
|
|
467
474
|
.stop-icon-button .ia-btn-icon {
|
|
468
475
|
width: auto;
|
|
469
476
|
height: auto;
|
|
@@ -472,9 +479,6 @@
|
|
|
472
479
|
align-items: center;
|
|
473
480
|
justify-content: center;
|
|
474
481
|
}
|
|
475
|
-
.stop-icon-button.ia-styles.ia-btn.ia-btn-contained {
|
|
476
|
-
background: #E15554;
|
|
477
|
-
}
|
|
478
482
|
|
|
479
483
|
.mention-select-wrapper {
|
|
480
484
|
position: absolute;
|