@inploi/plugin-chatbot 3.6.5 → 3.8.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/chatbot.d.ts CHANGED
@@ -12,11 +12,11 @@ export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, }: {
12
12
  hue: number;
13
13
  /** Chroma multiplier. Values between 0 and 1.5 work best. */
14
14
  chroma?: number;
15
+ mode: 'light' | 'dark';
15
16
  };
16
17
  /** @deprecated For internal usage only */
17
18
  _internal_domManager?: {
18
- getOrCreateChatbotElement: () => HTMLDivElement;
19
- addStyle: (css: string, id: string) => void;
19
+ getOrCreateChatbotElement: () => HTMLElement;
20
20
  } | undefined;
21
21
  }) => ({ apiClient, logger, analytics }: {
22
22
  apiClient: import("@inploi/sdk").ApiClient;
@@ -1,5 +1,4 @@
1
1
  export declare const createChatbotDomManager: () => {
2
- getOrCreateChatbotElement: () => HTMLDivElement;
3
- addStyle: (css: string, id: string) => void;
2
+ getOrCreateChatbotElement: () => HTMLElement;
4
3
  };
5
4
  export type ChatbotDomManager = ReturnType<typeof createChatbotDomManager>;
@@ -1,8 +1,8 @@
1
1
  import { Signal } from '@preact/signals';
2
2
  import { JobApplication } from './chatbot.api';
3
3
  import { DistributivePick } from './chatbot.utils';
4
- import { ChatInput } from './ui/chat-input/chat-input';
5
- import { ChatbotInput } from './ui/chat-input/chat-input';
4
+ import { ChatInput } from './components/chat-input/chat-input';
5
+ import { ChatbotInput } from './components/chat-input/chat-input';
6
6
  export declare const getCacheKey: (application: JobApplication) => string;
7
7
  export type ViewState = 'maximised' | 'minimised';
8
8
  export declare const viewState: Signal<ViewState>;
@@ -32,14 +32,14 @@ export declare const application: {
32
32
  current$: Signal<CurrentApplication>;
33
33
  start: (application: JobApplication) => Promise<void>;
34
34
  cancel: () => void;
35
- markAsFinished: () => Promise<void>;
36
- setCurrentNodeId: (currentNodeId: string) => Promise<void>;
35
+ markAsFinished: () => void;
36
+ setCurrentNodeId: (currentNodeId: string) => void;
37
37
  restart: () => void;
38
- addMessage: (message: ChatMessage, groupId?: string) => Promise<void>;
38
+ addMessage: (message: ChatMessage, groupId?: string) => void;
39
39
  /** Removes from the last message backwards, all the messages that have the groupId passed, until it reaches one that doesn't */
40
40
  removeLastGroupMessagesById: (groupId: string) => void;
41
- setSubmission: (fieldKey: string, submission: ApplicationSubmission) => Promise<void>;
42
- setInput: (input: ChatInput | undefined) => Promise<void>;
41
+ setSubmission: (fieldKey: string, submission: ApplicationSubmission | null) => void;
42
+ setInput: (input: ChatInput | undefined) => void;
43
43
  };
44
44
  export type MessageAuthor = 'bot' | 'user';
45
45
  type SystemMessage = {
@@ -62,6 +62,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
62
62
  question: string;
63
63
  trueLabel: string;
64
64
  falseLabel: string;
65
+ optional: boolean;
65
66
  };
66
67
  type: "question-boolean";
67
68
  isHead?: boolean | undefined;
@@ -71,6 +72,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
71
72
  data: {
72
73
  key: string;
73
74
  question: string;
75
+ optional: boolean;
74
76
  format: "text" | "url" | "email" | "phone";
75
77
  placeholder?: string | undefined;
76
78
  };
@@ -82,6 +84,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
82
84
  data: {
83
85
  key: string;
84
86
  question: string;
87
+ optional: boolean;
85
88
  placeholder?: string | undefined;
86
89
  decimalCases?: number | undefined;
87
90
  min?: number | undefined;
@@ -110,6 +113,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
110
113
  data: {
111
114
  key: string;
112
115
  question: string;
116
+ optional: boolean;
113
117
  extensions: string[];
114
118
  multiple?: boolean | undefined;
115
119
  maxSizeKb?: number | undefined;
@@ -130,6 +134,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
130
134
  country: string;
131
135
  };
132
136
  question: string;
137
+ optional: boolean;
133
138
  placeholder?: string | undefined;
134
139
  };
135
140
  type: "question-address";
@@ -155,14 +160,14 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
155
160
  isHead?: boolean | undefined;
156
161
  nextId?: string | undefined;
157
162
  };
158
- export declare const getApplicationSubmissionsPayload: (submissions: KeyToSubmissionMap) => Record<string, string | string[] | import("./ui/chat-input/chat-input.file").FileToUpload[]>;
159
- export declare const isSubmissionOfType: <T extends "boolean" | "text" | "multiple-choice" | "file">(type: T) => (submission?: ApplicationSubmission) => submission is Extract<Pick<import("./ui/chat-input/chat-input.text").TextPayload, "value" | "type">, {
163
+ export declare const getApplicationSubmissionsPayload: (submissions: KeyToSubmissionMap) => Record<string, string | string[] | import("./components/chat-input/chat-input.file").FileToUpload[] | null>;
164
+ export declare const isSubmissionOfType: <T extends "boolean" | "text" | "multiple-choice" | "file">(type: T) => (submission?: ApplicationSubmission) => submission is Extract<Pick<import("./components/chat-input/chat-input.text").TextPayload, "value" | "type">, {
160
165
  type: T;
161
- }> | Extract<Pick<import("./ui/chat-input/chat-input.multiple-choice").MultipleChoicePayload, "value" | "type">, {
166
+ }> | Extract<Pick<import("./components/chat-input/chat-input.multiple-choice").MultipleChoicePayload, "value" | "type">, {
162
167
  type: T;
163
- }> | Extract<Pick<import("./ui/chat-input/chat-input.boolean").BooleanChoicePayload, "value" | "type">, {
168
+ }> | Extract<Pick<import("./components/chat-input/chat-input.boolean").BooleanChoicePayload, "value" | "type">, {
164
169
  type: T;
165
- }> | Extract<Pick<import("./ui/chat-input/chat-input.file").FilePayload, "value" | "type">, {
170
+ }> | Extract<Pick<import("./components/chat-input/chat-input.file").FilePayload, "value" | "type">, {
166
171
  type: T;
167
172
  }>;
168
173
  export declare function gzip(string: string): string | Promise<string>;