@inploi/plugin-chatbot 3.28.3 → 3.28.4
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/cdn/index.js +7 -7
- package/dist/{chatbot-body-b09f390e.cjs → chatbot-body-30a036fc.cjs} +45 -24
- package/dist/{chatbot-body-dd8b2ce7.js → chatbot-body-51e9bd34.js} +45 -24
- package/dist/chatbot.api.d.ts +220 -22
- package/dist/chatbot.utils.d.ts +20 -2
- package/dist/components/chat-bubble.d.ts +10 -0
- package/dist/components/chat-error.d.ts +3 -0
- package/dist/components/chat-input/chat-input.address.d.ts +16 -0
- package/dist/components/chat-input/chat-input.boolean.d.ts +21 -0
- package/dist/components/chat-input/chat-input.constants.d.ts +249 -0
- package/dist/components/chat-input/chat-input.d.ts +18 -0
- package/dist/components/chat-input/chat-input.file.d.ts +18 -0
- package/dist/components/chat-input/chat-input.multiple-choice.d.ts +16 -0
- package/dist/components/chat-input/chat-input.number.d.ts +16 -0
- package/dist/components/chat-input/chat-input.phone-number.d.ts +15 -0
- package/dist/components/chat-input/chat-input.phone-number.utils.d.ts +4 -0
- package/dist/components/chat-input/chat-input.submit.d.ts +10 -0
- package/dist/components/chat-input/chat-input.text.d.ts +17 -0
- package/dist/components/chat-loading.d.ts +1 -0
- package/dist/components/chatbot-body.d.ts +8 -0
- package/dist/components/chatbot.d.ts +8 -0
- package/dist/components/conversation.d.ts +4 -0
- package/dist/components/input-error.d.ts +5 -0
- package/dist/components/loading-indicator.d.ts +2 -0
- package/dist/components/message.link.d.ts +4 -0
- package/dist/components/palette-debugger.d.ts +1 -0
- package/dist/components/send-button.d.ts +2 -0
- package/dist/components/skip-button.d.ts +2 -0
- package/dist/components/status-bar.d.ts +4 -0
- package/dist/components/transition.d.ts +1 -0
- package/dist/components/typing-indicator.d.ts +2 -0
- package/dist/components/useChatService.d.ts +14 -0
- package/dist/components/useFocus.d.ts +1 -0
- package/dist/{index-70d48f50.cjs → index-251fe248.cjs} +1 -1
- package/dist/{index-430056cf.js → index-5e2a3998.js} +1 -1
- package/dist/mocks/browser.d.ts +1 -0
- package/dist/mocks/flows.mocks.d.ts +71 -0
- package/dist/mocks/handlers.d.ts +14 -0
- package/dist/mocks/mocks.utils.d.ts +2 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/dist/style/theme.d.ts +2 -0
- package/dist/style/theme.utils.d.ts +5 -0
- package/dist/style/tokens.d.ts +88 -0
- package/package.json +2 -2
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-251fe248.cjs");
|
|
4
4
|
require("@inploi/sdk");
|
|
5
|
-
const
|
|
5
|
+
const isConditionMet = ({
|
|
6
|
+
condition,
|
|
6
7
|
context,
|
|
7
|
-
submissions
|
|
8
|
+
submissions,
|
|
9
|
+
ifBlock
|
|
8
10
|
}) => {
|
|
9
|
-
const [firstSegment, ...path] =
|
|
11
|
+
const [firstSegment, ...path] = condition.compareKey.split(".");
|
|
10
12
|
if (!firstSegment)
|
|
11
13
|
return false;
|
|
12
14
|
const answer = getSubmissionValueToCheck({
|
|
@@ -20,19 +22,19 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
20
22
|
switch (answer.type) {
|
|
21
23
|
case "address": {
|
|
22
24
|
const value = index.get(answer.value, path.join("."));
|
|
23
|
-
switch (
|
|
25
|
+
switch (condition.compare) {
|
|
24
26
|
case "equals":
|
|
25
|
-
return value ===
|
|
27
|
+
return value === condition.compareValue;
|
|
26
28
|
case "contains":
|
|
27
29
|
if (!value)
|
|
28
30
|
return false;
|
|
29
|
-
return value.includes(
|
|
31
|
+
return value.includes(condition.compareValue);
|
|
30
32
|
case "notEquals":
|
|
31
|
-
return value !==
|
|
33
|
+
return value !== condition.compareValue;
|
|
32
34
|
case "notContains":
|
|
33
35
|
if (!value)
|
|
34
36
|
return true;
|
|
35
|
-
return !value.includes(
|
|
37
|
+
return !value.includes(condition.compareValue);
|
|
36
38
|
}
|
|
37
39
|
break;
|
|
38
40
|
}
|
|
@@ -97,8 +99,8 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
97
99
|
break;
|
|
98
100
|
}
|
|
99
101
|
case "boolean": {
|
|
100
|
-
const compareBoolean =
|
|
101
|
-
switch (
|
|
102
|
+
const compareBoolean = condition.compareValue === "true";
|
|
103
|
+
switch (condition.compare) {
|
|
102
104
|
case "equals":
|
|
103
105
|
return answer.value === compareBoolean;
|
|
104
106
|
case "notEquals":
|
|
@@ -107,25 +109,25 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
107
109
|
break;
|
|
108
110
|
}
|
|
109
111
|
case "string":
|
|
110
|
-
switch (
|
|
112
|
+
switch (condition.compare) {
|
|
111
113
|
case "equals":
|
|
112
|
-
return answer.value ===
|
|
114
|
+
return answer.value === condition.compareValue;
|
|
113
115
|
case "contains":
|
|
114
116
|
if (!answer.value)
|
|
115
117
|
return false;
|
|
116
|
-
return answer.value.includes(
|
|
118
|
+
return answer.value.includes(condition.compareValue);
|
|
117
119
|
case "notEquals":
|
|
118
|
-
return answer.value !==
|
|
120
|
+
return answer.value !== condition.compareValue;
|
|
119
121
|
case "notContains":
|
|
120
122
|
if (!answer.value)
|
|
121
123
|
return true;
|
|
122
|
-
return !answer.value.includes(
|
|
124
|
+
return !answer.value.includes(condition.compareValue);
|
|
123
125
|
}
|
|
124
126
|
break;
|
|
125
127
|
case "number": {
|
|
126
128
|
try {
|
|
127
|
-
const compareNumber = Number(
|
|
128
|
-
switch (
|
|
129
|
+
const compareNumber = Number(condition.compareValue);
|
|
130
|
+
switch (condition.compare) {
|
|
129
131
|
case "equals":
|
|
130
132
|
return answer.value === compareNumber;
|
|
131
133
|
case "notEquals":
|
|
@@ -146,19 +148,38 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
146
148
|
break;
|
|
147
149
|
}
|
|
148
150
|
case "enum":
|
|
149
|
-
switch (
|
|
151
|
+
switch (condition.compare) {
|
|
150
152
|
case "equals":
|
|
151
|
-
return answer.value.length === 1 && answer.value[0] ===
|
|
153
|
+
return answer.value.length === 1 && answer.value[0] === condition.compareValue;
|
|
152
154
|
case "notEquals":
|
|
153
|
-
return answer.value.length === 1 && answer.value[0] !==
|
|
155
|
+
return answer.value.length === 1 && answer.value[0] !== condition.compareValue;
|
|
154
156
|
case "contains":
|
|
155
|
-
return answer.value.includes(
|
|
157
|
+
return answer.value.includes(condition.compareValue);
|
|
156
158
|
case "notContains":
|
|
157
|
-
return !answer.value.includes(
|
|
159
|
+
return !answer.value.includes(condition.compareValue);
|
|
158
160
|
}
|
|
159
161
|
break;
|
|
160
162
|
}
|
|
161
|
-
|
|
163
|
+
};
|
|
164
|
+
const isIfBlockConditionMet = (ifBlock, {
|
|
165
|
+
context,
|
|
166
|
+
submissions
|
|
167
|
+
}) => {
|
|
168
|
+
const conditions = "combinator" in ifBlock.data ? ifBlock.data.conditions : [ifBlock.data];
|
|
169
|
+
const combinator = "combinator" in ifBlock.data ? ifBlock.data.combinator : "and";
|
|
170
|
+
for (const condition of conditions) {
|
|
171
|
+
const isMet = isConditionMet({
|
|
172
|
+
condition,
|
|
173
|
+
context,
|
|
174
|
+
submissions,
|
|
175
|
+
ifBlock
|
|
176
|
+
});
|
|
177
|
+
if (combinator === "or" && isMet)
|
|
178
|
+
return true;
|
|
179
|
+
if (combinator === "and" && !isMet)
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
return true;
|
|
162
183
|
};
|
|
163
184
|
const HANDLEBARS_REGEXP = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;
|
|
164
185
|
const interpolateWithData = (str, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { g as get$1, i as isString$2, k as kbToReadableSize, a as getHeadOrThrow, b as invariant, A as AbortedError, c as getFlowSubmissionsPayload, N, _, d as getDefaultExportFromCjs, h, e as _$1, p, F, o as o$1, f as clsx, y, s as store, j as a$2, l as k, m as k$1, n as getFormSubmitter, q as parse, r as picklist, t as isSubmissionOfType, C as Cn, u as parseAsync, V as ValiError, v as object, w as transform, x as cva, z as maxLength, B as minLength, D as record, E as boolean, G as number, H as minValue, I as maxValue, J as custom, K as string, L as regex, M as email, O as url, P as LoadingIndicator, Q as ERROR_MESSAGES } from "./index-
|
|
1
|
+
import { g as get$1, i as isString$2, k as kbToReadableSize, a as getHeadOrThrow, b as invariant, A as AbortedError, c as getFlowSubmissionsPayload, N, _, d as getDefaultExportFromCjs, h, e as _$1, p, F, o as o$1, f as clsx, y, s as store, j as a$2, l as k, m as k$1, n as getFormSubmitter, q as parse, r as picklist, t as isSubmissionOfType, C as Cn, u as parseAsync, V as ValiError, v as object, w as transform, x as cva, z as maxLength, B as minLength, D as record, E as boolean, G as number, H as minValue, I as maxValue, J as custom, K as string, L as regex, M as email, O as url, P as LoadingIndicator, Q as ERROR_MESSAGES } from "./index-5e2a3998.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
|
-
const
|
|
3
|
+
const isConditionMet = ({
|
|
4
|
+
condition,
|
|
4
5
|
context,
|
|
5
|
-
submissions
|
|
6
|
+
submissions,
|
|
7
|
+
ifBlock
|
|
6
8
|
}) => {
|
|
7
|
-
const [firstSegment, ...path] =
|
|
9
|
+
const [firstSegment, ...path] = condition.compareKey.split(".");
|
|
8
10
|
if (!firstSegment)
|
|
9
11
|
return false;
|
|
10
12
|
const answer = getSubmissionValueToCheck({
|
|
@@ -18,19 +20,19 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
18
20
|
switch (answer.type) {
|
|
19
21
|
case "address": {
|
|
20
22
|
const value = get$1(answer.value, path.join("."));
|
|
21
|
-
switch (
|
|
23
|
+
switch (condition.compare) {
|
|
22
24
|
case "equals":
|
|
23
|
-
return value ===
|
|
25
|
+
return value === condition.compareValue;
|
|
24
26
|
case "contains":
|
|
25
27
|
if (!value)
|
|
26
28
|
return false;
|
|
27
|
-
return value.includes(
|
|
29
|
+
return value.includes(condition.compareValue);
|
|
28
30
|
case "notEquals":
|
|
29
|
-
return value !==
|
|
31
|
+
return value !== condition.compareValue;
|
|
30
32
|
case "notContains":
|
|
31
33
|
if (!value)
|
|
32
34
|
return true;
|
|
33
|
-
return !value.includes(
|
|
35
|
+
return !value.includes(condition.compareValue);
|
|
34
36
|
}
|
|
35
37
|
break;
|
|
36
38
|
}
|
|
@@ -95,8 +97,8 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
95
97
|
break;
|
|
96
98
|
}
|
|
97
99
|
case "boolean": {
|
|
98
|
-
const compareBoolean =
|
|
99
|
-
switch (
|
|
100
|
+
const compareBoolean = condition.compareValue === "true";
|
|
101
|
+
switch (condition.compare) {
|
|
100
102
|
case "equals":
|
|
101
103
|
return answer.value === compareBoolean;
|
|
102
104
|
case "notEquals":
|
|
@@ -105,25 +107,25 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
105
107
|
break;
|
|
106
108
|
}
|
|
107
109
|
case "string":
|
|
108
|
-
switch (
|
|
110
|
+
switch (condition.compare) {
|
|
109
111
|
case "equals":
|
|
110
|
-
return answer.value ===
|
|
112
|
+
return answer.value === condition.compareValue;
|
|
111
113
|
case "contains":
|
|
112
114
|
if (!answer.value)
|
|
113
115
|
return false;
|
|
114
|
-
return answer.value.includes(
|
|
116
|
+
return answer.value.includes(condition.compareValue);
|
|
115
117
|
case "notEquals":
|
|
116
|
-
return answer.value !==
|
|
118
|
+
return answer.value !== condition.compareValue;
|
|
117
119
|
case "notContains":
|
|
118
120
|
if (!answer.value)
|
|
119
121
|
return true;
|
|
120
|
-
return !answer.value.includes(
|
|
122
|
+
return !answer.value.includes(condition.compareValue);
|
|
121
123
|
}
|
|
122
124
|
break;
|
|
123
125
|
case "number": {
|
|
124
126
|
try {
|
|
125
|
-
const compareNumber = Number(
|
|
126
|
-
switch (
|
|
127
|
+
const compareNumber = Number(condition.compareValue);
|
|
128
|
+
switch (condition.compare) {
|
|
127
129
|
case "equals":
|
|
128
130
|
return answer.value === compareNumber;
|
|
129
131
|
case "notEquals":
|
|
@@ -144,19 +146,38 @@ const isIfBlockConditionMet = (ifBlock, {
|
|
|
144
146
|
break;
|
|
145
147
|
}
|
|
146
148
|
case "enum":
|
|
147
|
-
switch (
|
|
149
|
+
switch (condition.compare) {
|
|
148
150
|
case "equals":
|
|
149
|
-
return answer.value.length === 1 && answer.value[0] ===
|
|
151
|
+
return answer.value.length === 1 && answer.value[0] === condition.compareValue;
|
|
150
152
|
case "notEquals":
|
|
151
|
-
return answer.value.length === 1 && answer.value[0] !==
|
|
153
|
+
return answer.value.length === 1 && answer.value[0] !== condition.compareValue;
|
|
152
154
|
case "contains":
|
|
153
|
-
return answer.value.includes(
|
|
155
|
+
return answer.value.includes(condition.compareValue);
|
|
154
156
|
case "notContains":
|
|
155
|
-
return !answer.value.includes(
|
|
157
|
+
return !answer.value.includes(condition.compareValue);
|
|
156
158
|
}
|
|
157
159
|
break;
|
|
158
160
|
}
|
|
159
|
-
|
|
161
|
+
};
|
|
162
|
+
const isIfBlockConditionMet = (ifBlock, {
|
|
163
|
+
context,
|
|
164
|
+
submissions
|
|
165
|
+
}) => {
|
|
166
|
+
const conditions = "combinator" in ifBlock.data ? ifBlock.data.conditions : [ifBlock.data];
|
|
167
|
+
const combinator = "combinator" in ifBlock.data ? ifBlock.data.combinator : "and";
|
|
168
|
+
for (const condition of conditions) {
|
|
169
|
+
const isMet = isConditionMet({
|
|
170
|
+
condition,
|
|
171
|
+
context,
|
|
172
|
+
submissions,
|
|
173
|
+
ifBlock
|
|
174
|
+
});
|
|
175
|
+
if (combinator === "or" && isMet)
|
|
176
|
+
return true;
|
|
177
|
+
if (combinator === "and" && !isMet)
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
160
181
|
};
|
|
161
182
|
const HANDLEBARS_REGEXP = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;
|
|
162
183
|
const interpolateWithData = (str, {
|
package/dist/chatbot.api.d.ts
CHANGED
|
@@ -155,11 +155,29 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
155
155
|
isHead?: boolean | undefined;
|
|
156
156
|
nextId?: string | undefined;
|
|
157
157
|
} | {
|
|
158
|
-
data: {
|
|
158
|
+
data: ({
|
|
159
159
|
compareKey: string;
|
|
160
160
|
compareValue: string;
|
|
161
161
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
162
|
-
}
|
|
162
|
+
} | {
|
|
163
|
+
combinator: "and" | "or";
|
|
164
|
+
conditions: {
|
|
165
|
+
compareKey: string;
|
|
166
|
+
compareValue: string;
|
|
167
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
168
|
+
}[];
|
|
169
|
+
}) & ({
|
|
170
|
+
compareKey: string;
|
|
171
|
+
compareValue: string;
|
|
172
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
173
|
+
} | {
|
|
174
|
+
combinator: "and" | "or";
|
|
175
|
+
conditions: {
|
|
176
|
+
compareKey: string;
|
|
177
|
+
compareValue: string;
|
|
178
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
179
|
+
}[];
|
|
180
|
+
} | undefined);
|
|
163
181
|
type: "if-block";
|
|
164
182
|
id: string;
|
|
165
183
|
isHead?: boolean | undefined;
|
|
@@ -334,11 +352,29 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
334
352
|
isHead?: boolean | undefined;
|
|
335
353
|
nextId?: string | undefined;
|
|
336
354
|
} | {
|
|
337
|
-
data: {
|
|
355
|
+
data: ({
|
|
338
356
|
compareKey: string;
|
|
339
357
|
compareValue: string;
|
|
340
358
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
341
|
-
}
|
|
359
|
+
} | {
|
|
360
|
+
combinator: "and" | "or";
|
|
361
|
+
conditions: {
|
|
362
|
+
compareKey: string;
|
|
363
|
+
compareValue: string;
|
|
364
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
365
|
+
}[];
|
|
366
|
+
}) & ({
|
|
367
|
+
compareKey: string;
|
|
368
|
+
compareValue: string;
|
|
369
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
370
|
+
} | {
|
|
371
|
+
combinator: "and" | "or";
|
|
372
|
+
conditions: {
|
|
373
|
+
compareKey: string;
|
|
374
|
+
compareValue: string;
|
|
375
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
376
|
+
}[];
|
|
377
|
+
} | undefined);
|
|
342
378
|
type: "if-block";
|
|
343
379
|
id: string;
|
|
344
380
|
isHead?: boolean | undefined;
|
|
@@ -540,11 +576,29 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
540
576
|
isHead?: boolean | undefined;
|
|
541
577
|
nextId?: string | undefined;
|
|
542
578
|
} | {
|
|
543
|
-
data: {
|
|
579
|
+
data: ({
|
|
544
580
|
compareKey: string;
|
|
545
581
|
compareValue: string;
|
|
546
582
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
547
|
-
}
|
|
583
|
+
} | {
|
|
584
|
+
combinator: "and" | "or";
|
|
585
|
+
conditions: {
|
|
586
|
+
compareKey: string;
|
|
587
|
+
compareValue: string;
|
|
588
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
589
|
+
}[];
|
|
590
|
+
}) & ({
|
|
591
|
+
compareKey: string;
|
|
592
|
+
compareValue: string;
|
|
593
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
594
|
+
} | {
|
|
595
|
+
combinator: "and" | "or";
|
|
596
|
+
conditions: {
|
|
597
|
+
compareKey: string;
|
|
598
|
+
compareValue: string;
|
|
599
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
600
|
+
}[];
|
|
601
|
+
} | undefined);
|
|
548
602
|
type: "if-block";
|
|
549
603
|
id: string;
|
|
550
604
|
isHead?: boolean | undefined;
|
|
@@ -733,11 +787,29 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
733
787
|
isHead?: boolean | undefined;
|
|
734
788
|
nextId?: string | undefined;
|
|
735
789
|
} | {
|
|
736
|
-
data: {
|
|
790
|
+
data: ({
|
|
737
791
|
compareKey: string;
|
|
738
792
|
compareValue: string;
|
|
739
793
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
740
|
-
}
|
|
794
|
+
} | {
|
|
795
|
+
combinator: "and" | "or";
|
|
796
|
+
conditions: {
|
|
797
|
+
compareKey: string;
|
|
798
|
+
compareValue: string;
|
|
799
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
800
|
+
}[];
|
|
801
|
+
}) & ({
|
|
802
|
+
compareKey: string;
|
|
803
|
+
compareValue: string;
|
|
804
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
805
|
+
} | {
|
|
806
|
+
combinator: "and" | "or";
|
|
807
|
+
conditions: {
|
|
808
|
+
compareKey: string;
|
|
809
|
+
compareValue: string;
|
|
810
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
811
|
+
}[];
|
|
812
|
+
} | undefined);
|
|
741
813
|
type: "if-block";
|
|
742
814
|
id: string;
|
|
743
815
|
isHead?: boolean | undefined;
|
|
@@ -912,11 +984,29 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
912
984
|
isHead?: boolean | undefined;
|
|
913
985
|
nextId?: string | undefined;
|
|
914
986
|
} | {
|
|
915
|
-
data: {
|
|
987
|
+
data: ({
|
|
916
988
|
compareKey: string;
|
|
917
989
|
compareValue: string;
|
|
918
990
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
919
|
-
}
|
|
991
|
+
} | {
|
|
992
|
+
combinator: "and" | "or";
|
|
993
|
+
conditions: {
|
|
994
|
+
compareKey: string;
|
|
995
|
+
compareValue: string;
|
|
996
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
997
|
+
}[];
|
|
998
|
+
}) & ({
|
|
999
|
+
compareKey: string;
|
|
1000
|
+
compareValue: string;
|
|
1001
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1002
|
+
} | {
|
|
1003
|
+
combinator: "and" | "or";
|
|
1004
|
+
conditions: {
|
|
1005
|
+
compareKey: string;
|
|
1006
|
+
compareValue: string;
|
|
1007
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1008
|
+
}[];
|
|
1009
|
+
} | undefined);
|
|
920
1010
|
type: "if-block";
|
|
921
1011
|
id: string;
|
|
922
1012
|
isHead?: boolean | undefined;
|
|
@@ -1118,11 +1208,29 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1118
1208
|
isHead?: boolean | undefined;
|
|
1119
1209
|
nextId?: string | undefined;
|
|
1120
1210
|
} | {
|
|
1121
|
-
data: {
|
|
1211
|
+
data: ({
|
|
1122
1212
|
compareKey: string;
|
|
1123
1213
|
compareValue: string;
|
|
1124
1214
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1125
|
-
}
|
|
1215
|
+
} | {
|
|
1216
|
+
combinator: "and" | "or";
|
|
1217
|
+
conditions: {
|
|
1218
|
+
compareKey: string;
|
|
1219
|
+
compareValue: string;
|
|
1220
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1221
|
+
}[];
|
|
1222
|
+
}) & ({
|
|
1223
|
+
compareKey: string;
|
|
1224
|
+
compareValue: string;
|
|
1225
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1226
|
+
} | {
|
|
1227
|
+
combinator: "and" | "or";
|
|
1228
|
+
conditions: {
|
|
1229
|
+
compareKey: string;
|
|
1230
|
+
compareValue: string;
|
|
1231
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1232
|
+
}[];
|
|
1233
|
+
} | undefined);
|
|
1126
1234
|
type: "if-block";
|
|
1127
1235
|
id: string;
|
|
1128
1236
|
isHead?: boolean | undefined;
|
|
@@ -1310,11 +1418,29 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1310
1418
|
isHead?: boolean | undefined;
|
|
1311
1419
|
nextId?: string | undefined;
|
|
1312
1420
|
} | {
|
|
1313
|
-
data: {
|
|
1421
|
+
data: ({
|
|
1314
1422
|
compareKey: string;
|
|
1315
1423
|
compareValue: string;
|
|
1316
1424
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1317
|
-
}
|
|
1425
|
+
} | {
|
|
1426
|
+
combinator: "and" | "or";
|
|
1427
|
+
conditions: {
|
|
1428
|
+
compareKey: string;
|
|
1429
|
+
compareValue: string;
|
|
1430
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1431
|
+
}[];
|
|
1432
|
+
}) & ({
|
|
1433
|
+
compareKey: string;
|
|
1434
|
+
compareValue: string;
|
|
1435
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1436
|
+
} | {
|
|
1437
|
+
combinator: "and" | "or";
|
|
1438
|
+
conditions: {
|
|
1439
|
+
compareKey: string;
|
|
1440
|
+
compareValue: string;
|
|
1441
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1442
|
+
}[];
|
|
1443
|
+
} | undefined);
|
|
1318
1444
|
type: "if-block";
|
|
1319
1445
|
id: string;
|
|
1320
1446
|
isHead?: boolean | undefined;
|
|
@@ -1508,11 +1634,29 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1508
1634
|
isHead?: boolean | undefined;
|
|
1509
1635
|
nextId?: string | undefined;
|
|
1510
1636
|
} | {
|
|
1511
|
-
data: {
|
|
1637
|
+
data: ({
|
|
1512
1638
|
compareKey: string;
|
|
1513
1639
|
compareValue: string;
|
|
1514
1640
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1515
|
-
}
|
|
1641
|
+
} | {
|
|
1642
|
+
combinator: "and" | "or";
|
|
1643
|
+
conditions: {
|
|
1644
|
+
compareKey: string;
|
|
1645
|
+
compareValue: string;
|
|
1646
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1647
|
+
}[];
|
|
1648
|
+
}) & ({
|
|
1649
|
+
compareKey: string;
|
|
1650
|
+
compareValue: string;
|
|
1651
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1652
|
+
} | {
|
|
1653
|
+
combinator: "and" | "or";
|
|
1654
|
+
conditions: {
|
|
1655
|
+
compareKey: string;
|
|
1656
|
+
compareValue: string;
|
|
1657
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1658
|
+
}[];
|
|
1659
|
+
} | undefined);
|
|
1516
1660
|
type: "if-block";
|
|
1517
1661
|
id: string;
|
|
1518
1662
|
isHead?: boolean | undefined;
|
|
@@ -1687,11 +1831,29 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1687
1831
|
isHead?: boolean | undefined;
|
|
1688
1832
|
nextId?: string | undefined;
|
|
1689
1833
|
} | {
|
|
1690
|
-
data: {
|
|
1834
|
+
data: ({
|
|
1691
1835
|
compareKey: string;
|
|
1692
1836
|
compareValue: string;
|
|
1693
1837
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1694
|
-
}
|
|
1838
|
+
} | {
|
|
1839
|
+
combinator: "and" | "or";
|
|
1840
|
+
conditions: {
|
|
1841
|
+
compareKey: string;
|
|
1842
|
+
compareValue: string;
|
|
1843
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1844
|
+
}[];
|
|
1845
|
+
}) & ({
|
|
1846
|
+
compareKey: string;
|
|
1847
|
+
compareValue: string;
|
|
1848
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1849
|
+
} | {
|
|
1850
|
+
combinator: "and" | "or";
|
|
1851
|
+
conditions: {
|
|
1852
|
+
compareKey: string;
|
|
1853
|
+
compareValue: string;
|
|
1854
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1855
|
+
}[];
|
|
1856
|
+
} | undefined);
|
|
1695
1857
|
type: "if-block";
|
|
1696
1858
|
id: string;
|
|
1697
1859
|
isHead?: boolean | undefined;
|
|
@@ -1893,11 +2055,29 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1893
2055
|
isHead?: boolean | undefined;
|
|
1894
2056
|
nextId?: string | undefined;
|
|
1895
2057
|
} | {
|
|
1896
|
-
data: {
|
|
2058
|
+
data: ({
|
|
1897
2059
|
compareKey: string;
|
|
1898
2060
|
compareValue: string;
|
|
1899
2061
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
1900
|
-
}
|
|
2062
|
+
} | {
|
|
2063
|
+
combinator: "and" | "or";
|
|
2064
|
+
conditions: {
|
|
2065
|
+
compareKey: string;
|
|
2066
|
+
compareValue: string;
|
|
2067
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2068
|
+
}[];
|
|
2069
|
+
}) & ({
|
|
2070
|
+
compareKey: string;
|
|
2071
|
+
compareValue: string;
|
|
2072
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2073
|
+
} | {
|
|
2074
|
+
combinator: "and" | "or";
|
|
2075
|
+
conditions: {
|
|
2076
|
+
compareKey: string;
|
|
2077
|
+
compareValue: string;
|
|
2078
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2079
|
+
}[];
|
|
2080
|
+
} | undefined);
|
|
1901
2081
|
type: "if-block";
|
|
1902
2082
|
id: string;
|
|
1903
2083
|
isHead?: boolean | undefined;
|
|
@@ -2092,11 +2272,29 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2092
2272
|
isHead?: boolean | undefined;
|
|
2093
2273
|
nextId?: string | undefined;
|
|
2094
2274
|
} | {
|
|
2095
|
-
data: {
|
|
2275
|
+
data: ({
|
|
2096
2276
|
compareKey: string;
|
|
2097
2277
|
compareValue: string;
|
|
2098
2278
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2099
|
-
}
|
|
2279
|
+
} | {
|
|
2280
|
+
combinator: "and" | "or";
|
|
2281
|
+
conditions: {
|
|
2282
|
+
compareKey: string;
|
|
2283
|
+
compareValue: string;
|
|
2284
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2285
|
+
}[];
|
|
2286
|
+
}) & ({
|
|
2287
|
+
compareKey: string;
|
|
2288
|
+
compareValue: string;
|
|
2289
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2290
|
+
} | {
|
|
2291
|
+
combinator: "and" | "or";
|
|
2292
|
+
conditions: {
|
|
2293
|
+
compareKey: string;
|
|
2294
|
+
compareValue: string;
|
|
2295
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
2296
|
+
}[];
|
|
2297
|
+
} | undefined);
|
|
2100
2298
|
type: "if-block";
|
|
2101
2299
|
id: string;
|
|
2102
2300
|
isHead?: boolean | undefined;
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -146,11 +146,29 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
146
146
|
isHead?: boolean | undefined;
|
|
147
147
|
nextId?: string | undefined;
|
|
148
148
|
} | {
|
|
149
|
-
data: {
|
|
149
|
+
data: ({
|
|
150
150
|
compareKey: string;
|
|
151
151
|
compareValue: string;
|
|
152
152
|
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
153
|
-
}
|
|
153
|
+
} | {
|
|
154
|
+
combinator: "and" | "or";
|
|
155
|
+
conditions: {
|
|
156
|
+
compareKey: string;
|
|
157
|
+
compareValue: string;
|
|
158
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
159
|
+
}[];
|
|
160
|
+
}) & ({
|
|
161
|
+
compareKey: string;
|
|
162
|
+
compareValue: string;
|
|
163
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
164
|
+
} | {
|
|
165
|
+
combinator: "and" | "or";
|
|
166
|
+
conditions: {
|
|
167
|
+
compareKey: string;
|
|
168
|
+
compareValue: string;
|
|
169
|
+
compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
|
|
170
|
+
}[];
|
|
171
|
+
} | undefined);
|
|
154
172
|
type: "if-block";
|
|
155
173
|
id: string;
|
|
156
174
|
isHead?: boolean | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { ComponentProps } from '../../node_modules/preact/compat';
|
|
3
|
+
declare const chatBubbleVariants: (props?: ({
|
|
4
|
+
side?: "left" | "right" | null | undefined;
|
|
5
|
+
animate?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type ChatBubbleVariants = VariantProps<typeof chatBubbleVariants>;
|
|
8
|
+
type ChatBubbleProps = ComponentProps<'p'> & ChatBubbleVariants;
|
|
9
|
+
export declare const ChatBubble: ({ children, className, animate, side, ...props }: ChatBubbleProps) => import("preact/compat").JSX.Element;
|
|
10
|
+
export {};
|