@inploi/plugin-chatbot 3.16.0 → 3.16.1
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 +9 -9
- package/dist/{chatbot-body-1f7580cd.js → chatbot-body-59fab6f6.js} +24 -8
- package/dist/{chatbot-body-5774cb2a.cjs → chatbot-body-9bce9c3f.cjs} +25 -9
- package/dist/chatbot.utils.d.ts +1 -0
- package/dist/{index-a8a873bc.cjs → index-154bf9a3.cjs} +3 -1
- package/dist/{index-063bd7e8.js → index-dfe3ef24.js} +26 -24
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getHeadOrThrow,
|
|
1
|
+
import { i as isString$1, g as getHeadOrThrow, a as invariant, A as AbortedError, N, b as getFlowSubmissionsPayload, _, k as kbToReadableSize, h, c as _$1, p, F, o as o$1, d as clsx, y, s as store, e as a$2, f as debounce$1, j as k, l as parse, m as picklist, n as isSubmissionOfType, C as Cn, q as parseAsync, V as ValiError, r as object, t as transform, u as maxLength, v as minLength, w as record, x as boolean, z as string, B as email, D as url, E as regex, G as cva, H as ERROR_MESSAGES } from "./index-dfe3ef24.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -459,7 +459,6 @@ function get$1(object2, path, defaultValue) {
|
|
|
459
459
|
}
|
|
460
460
|
var get_1 = get$1;
|
|
461
461
|
const get$2 = /* @__PURE__ */ getDefaultExportFromCjs(get_1);
|
|
462
|
-
const isString$1 = (value) => typeof value === "string";
|
|
463
462
|
const isIfBlockConditionMet = (ifBlock, submissions) => {
|
|
464
463
|
const [firstSegment, ...rest] = ifBlock.data.compareKey.split(".");
|
|
465
464
|
if (!firstSegment)
|
|
@@ -1141,8 +1140,8 @@ async function interpretEndFlowNode({
|
|
|
1141
1140
|
const interpolateString = (str, context) => {
|
|
1142
1141
|
const regex2 = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;
|
|
1143
1142
|
return str.replace(regex2, (_2, key, defaultValue = "") => {
|
|
1144
|
-
|
|
1145
|
-
const submission = context == null ? void 0 : context[
|
|
1143
|
+
const [firstSegment, ...rest] = key.trim().split(".");
|
|
1144
|
+
const submission = context == null ? void 0 : context[firstSegment];
|
|
1146
1145
|
if (!submission)
|
|
1147
1146
|
return defaultValue;
|
|
1148
1147
|
switch (submission.type) {
|
|
@@ -1159,11 +1158,28 @@ const interpolateString = (str, context) => {
|
|
|
1159
1158
|
if (!submission.value)
|
|
1160
1159
|
return defaultValue;
|
|
1161
1160
|
return submission.value.toString();
|
|
1162
|
-
case "integration":
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1161
|
+
case "integration": {
|
|
1162
|
+
if (typeof submission.value !== "object")
|
|
1163
|
+
break;
|
|
1164
|
+
if (Array.isArray(submission.value))
|
|
1165
|
+
break;
|
|
1166
|
+
const value = get$2(submission.value, rest.join("."));
|
|
1167
|
+
switch (typeof value) {
|
|
1168
|
+
case "boolean":
|
|
1169
|
+
return value === true ? "true" : "false";
|
|
1170
|
+
case "string":
|
|
1171
|
+
return value;
|
|
1172
|
+
case "number":
|
|
1173
|
+
return value.toString();
|
|
1174
|
+
case "object":
|
|
1175
|
+
if (Array.isArray(value) && value.every(isString$1)) {
|
|
1176
|
+
return value.join(", ");
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
break;
|
|
1180
|
+
}
|
|
1166
1181
|
}
|
|
1182
|
+
return defaultValue;
|
|
1167
1183
|
});
|
|
1168
1184
|
};
|
|
1169
1185
|
function debounce(func, wait, immediate) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-154bf9a3.cjs");
|
|
4
4
|
require("@inploi/sdk");
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
6
|
function getDefaultExportFromCjs(x) {
|
|
@@ -461,7 +461,6 @@ function get$1(object, path, defaultValue) {
|
|
|
461
461
|
}
|
|
462
462
|
var get_1 = get$1;
|
|
463
463
|
const get$2 = /* @__PURE__ */ getDefaultExportFromCjs(get_1);
|
|
464
|
-
const isString$1 = (value) => typeof value === "string";
|
|
465
464
|
const isIfBlockConditionMet = (ifBlock, submissions) => {
|
|
466
465
|
const [firstSegment, ...rest] = ifBlock.data.compareKey.split(".");
|
|
467
466
|
if (!firstSegment)
|
|
@@ -524,7 +523,7 @@ const isIfBlockConditionMet = (ifBlock, submissions) => {
|
|
|
524
523
|
}
|
|
525
524
|
});
|
|
526
525
|
case "object":
|
|
527
|
-
if (Array.isArray(value) && value.every(isString
|
|
526
|
+
if (Array.isArray(value) && value.every(index.isString)) {
|
|
528
527
|
return isIfBlockConditionMet(newIfBlock, {
|
|
529
528
|
["_temp"]: {
|
|
530
529
|
value,
|
|
@@ -1143,8 +1142,8 @@ async function interpretEndFlowNode({
|
|
|
1143
1142
|
const interpolateString = (str, context) => {
|
|
1144
1143
|
const regex = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;
|
|
1145
1144
|
return str.replace(regex, (_, key, defaultValue = "") => {
|
|
1146
|
-
|
|
1147
|
-
const submission = context == null ? void 0 : context[
|
|
1145
|
+
const [firstSegment, ...rest] = key.trim().split(".");
|
|
1146
|
+
const submission = context == null ? void 0 : context[firstSegment];
|
|
1148
1147
|
if (!submission)
|
|
1149
1148
|
return defaultValue;
|
|
1150
1149
|
switch (submission.type) {
|
|
@@ -1161,11 +1160,28 @@ const interpolateString = (str, context) => {
|
|
|
1161
1160
|
if (!submission.value)
|
|
1162
1161
|
return defaultValue;
|
|
1163
1162
|
return submission.value.toString();
|
|
1164
|
-
case "integration":
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1163
|
+
case "integration": {
|
|
1164
|
+
if (typeof submission.value !== "object")
|
|
1165
|
+
break;
|
|
1166
|
+
if (Array.isArray(submission.value))
|
|
1167
|
+
break;
|
|
1168
|
+
const value = get$2(submission.value, rest.join("."));
|
|
1169
|
+
switch (typeof value) {
|
|
1170
|
+
case "boolean":
|
|
1171
|
+
return value === true ? "true" : "false";
|
|
1172
|
+
case "string":
|
|
1173
|
+
return value;
|
|
1174
|
+
case "number":
|
|
1175
|
+
return value.toString();
|
|
1176
|
+
case "object":
|
|
1177
|
+
if (Array.isArray(value) && value.every(index.isString)) {
|
|
1178
|
+
return value.join(", ");
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
break;
|
|
1182
|
+
}
|
|
1168
1183
|
}
|
|
1184
|
+
return defaultValue;
|
|
1169
1185
|
});
|
|
1170
1186
|
};
|
|
1171
1187
|
function debounce(func, wait, immediate) {
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -4280,6 +4280,7 @@ function debounce(func, timeout = 300) {
|
|
|
4280
4280
|
}, timeout);
|
|
4281
4281
|
};
|
|
4282
4282
|
}
|
|
4283
|
+
const isString = (value) => typeof value === "string";
|
|
4283
4284
|
const db = typeof window === "undefined" ? void 0 : openDB("inploi-chatbot", 2, {
|
|
4284
4285
|
upgrade(db2) {
|
|
4285
4286
|
try {
|
|
@@ -4733,7 +4734,7 @@ const StatusBar = ({
|
|
|
4733
4734
|
})
|
|
4734
4735
|
});
|
|
4735
4736
|
};
|
|
4736
|
-
const ChatbotBody = M(() => Promise.resolve().then(() => require("./chatbot-body-
|
|
4737
|
+
const ChatbotBody = M(() => Promise.resolve().then(() => require("./chatbot-body-9bce9c3f.cjs")).then((module2) => module2.ChatbotBody));
|
|
4737
4738
|
const chatbotContentClass = cva("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none", {
|
|
4738
4739
|
variants: {
|
|
4739
4740
|
view: {
|
|
@@ -5205,6 +5206,7 @@ exports.getFlowSubmissionsPayload = getFlowSubmissionsPayload;
|
|
|
5205
5206
|
exports.getHeadOrThrow = getHeadOrThrow;
|
|
5206
5207
|
exports.h = h$1;
|
|
5207
5208
|
exports.invariant = invariant;
|
|
5209
|
+
exports.isString = isString;
|
|
5208
5210
|
exports.isSubmissionOfType = isSubmissionOfType;
|
|
5209
5211
|
exports.k = k$3;
|
|
5210
5212
|
exports.kbToReadableSize = kbToReadableSize;
|
|
@@ -4279,6 +4279,7 @@ function debounce(func, timeout = 300) {
|
|
|
4279
4279
|
}, timeout);
|
|
4280
4280
|
};
|
|
4281
4281
|
}
|
|
4282
|
+
const isString = (value) => typeof value === "string";
|
|
4282
4283
|
const db = typeof window === "undefined" ? void 0 : openDB("inploi-chatbot", 2, {
|
|
4283
4284
|
upgrade(db2) {
|
|
4284
4285
|
try {
|
|
@@ -4732,7 +4733,7 @@ const StatusBar = ({
|
|
|
4732
4733
|
})
|
|
4733
4734
|
});
|
|
4734
4735
|
};
|
|
4735
|
-
const ChatbotBody = M(() => import("./chatbot-body-
|
|
4736
|
+
const ChatbotBody = M(() => import("./chatbot-body-59fab6f6.js").then((module) => module.ChatbotBody));
|
|
4736
4737
|
const chatbotContentClass = cva("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none", {
|
|
4737
4738
|
variants: {
|
|
4738
4739
|
view: {
|
|
@@ -5187,40 +5188,41 @@ const chatbotPlugin = ({
|
|
|
5187
5188
|
});
|
|
5188
5189
|
export {
|
|
5189
5190
|
AbortedError as A,
|
|
5190
|
-
|
|
5191
|
+
email as B,
|
|
5191
5192
|
Cn as C,
|
|
5192
|
-
|
|
5193
|
-
|
|
5193
|
+
url as D,
|
|
5194
|
+
regex as E,
|
|
5194
5195
|
F$1 as F,
|
|
5195
|
-
|
|
5196
|
-
|
|
5196
|
+
cva as G,
|
|
5197
|
+
ERROR_MESSAGES as H,
|
|
5198
|
+
chatbotPlugin as I,
|
|
5197
5199
|
N,
|
|
5198
5200
|
ValiError as V,
|
|
5199
5201
|
_$3 as _,
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5202
|
+
invariant as a,
|
|
5203
|
+
getFlowSubmissionsPayload as b,
|
|
5204
|
+
_$4 as c,
|
|
5205
|
+
clsx as d,
|
|
5206
|
+
a as e,
|
|
5207
|
+
debounce as f,
|
|
5206
5208
|
getHeadOrThrow as g,
|
|
5207
5209
|
h$1 as h,
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
+
isString as i,
|
|
5211
|
+
k$3 as j,
|
|
5210
5212
|
kbToReadableSize as k,
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5213
|
+
parse$1 as l,
|
|
5214
|
+
picklist as m,
|
|
5215
|
+
isSubmissionOfType as n,
|
|
5214
5216
|
o,
|
|
5215
5217
|
p$3 as p,
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
+
parseAsync as q,
|
|
5219
|
+
object as r,
|
|
5218
5220
|
store as s,
|
|
5219
5221
|
transform as t,
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5222
|
+
maxLength as u,
|
|
5223
|
+
minLength as v,
|
|
5224
|
+
record as w,
|
|
5225
|
+
boolean as x,
|
|
5224
5226
|
y$2 as y,
|
|
5225
|
-
|
|
5227
|
+
string as z
|
|
5226
5228
|
};
|
package/dist/plugin-chatbot.cjs
CHANGED
package/dist/plugin-chatbot.js
CHANGED