@jrapps/my_tickets_chat_ui 0.3.2 → 0.3.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/dist/cjs/components/SiteChatComponentNewErc/index.js +94 -65
- package/dist/cjs/components/SiteChatComponentNewErc/index.js.map +4 -4
- package/dist/cjs/index.js +94 -65
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/chunks/{chunk-364KVRPG.mjs → chunk-JGAOPBRJ.mjs} +95 -66
- package/dist/esm/chunks/chunk-JGAOPBRJ.mjs.map +7 -0
- package/dist/esm/components/SiteChatComponentNewErc/index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Footer/Footer.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Header/Header.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Messages/AgentMessage.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Messages/AttachmentMessage.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Messages/MessageList.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Messages/SystemMessage.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/Messages/UserMessage.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.d.ts.map +1 -1
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.types.d.ts +10 -1
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.types.d.ts.map +1 -1
- package/package.json +8 -4
- package/dist/esm/chunks/chunk-364KVRPG.mjs.map +0 -7
|
@@ -37,6 +37,7 @@ module.exports = __toCommonJS(SiteChatComponentNewErc_exports);
|
|
|
37
37
|
|
|
38
38
|
// src/components/SiteChatComponentNewErc/SiteChatComponentNewErc.tsx
|
|
39
39
|
var import_react5 = __toESM(require("react"));
|
|
40
|
+
var import_classnames7 = __toESM(require("classnames"));
|
|
40
41
|
|
|
41
42
|
// src/components/SiteChatComponentNewErc/useSiteChatComponentNewErc.ts
|
|
42
43
|
var import_react = require("react");
|
|
@@ -121,6 +122,9 @@ function formatTime(timestamp) {
|
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
// src/components/SiteChatComponentNewErc/Header/Header.tsx
|
|
126
|
+
var import_classnames = __toESM(require("classnames"));
|
|
127
|
+
|
|
124
128
|
// src/components/SiteChatComponentNewErc/Header/Header.css
|
|
125
129
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-759620f0")) {
|
|
126
130
|
const s = document.createElement("style");
|
|
@@ -132,25 +136,25 @@ if (typeof document !== "undefined" && !document.getElementById("jrapps-style-75
|
|
|
132
136
|
// src/components/SiteChatComponentNewErc/Header/Header.tsx
|
|
133
137
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
134
138
|
var Header = ({ image, title, subtitle, onClose, ercClasses }) => {
|
|
135
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className:
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: (0, import_classnames.default)("cw-header", ercClasses == null ? void 0 : ercClasses.headerClassName), role: "banner", children: [
|
|
136
140
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "cw-header__identity", children: [
|
|
137
141
|
image && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
142
|
"img",
|
|
139
143
|
{
|
|
140
144
|
src: image,
|
|
141
145
|
alt: `${title} avatar`,
|
|
142
|
-
className:
|
|
146
|
+
className: (0, import_classnames.default)("cw-header__avatar", ercClasses == null ? void 0 : ercClasses.imageClassName)
|
|
143
147
|
}
|
|
144
148
|
),
|
|
145
149
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "cw-header__text", children: [
|
|
146
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className:
|
|
147
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className:
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_classnames.default)("cw-header__title", ercClasses == null ? void 0 : ercClasses.titleClassName), children: title }),
|
|
151
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_classnames.default)("cw-header__subtitle", ercClasses == null ? void 0 : ercClasses.subtitleClassName), children: subtitle })
|
|
148
152
|
] })
|
|
149
153
|
] }),
|
|
150
154
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
151
155
|
"button",
|
|
152
156
|
{
|
|
153
|
-
className:
|
|
157
|
+
className: (0, import_classnames.default)("cw-header__close", ercClasses == null ? void 0 : ercClasses.closeButtonClassName),
|
|
154
158
|
onClick: onClose,
|
|
155
159
|
"aria-label": "Close chat",
|
|
156
160
|
type: "button",
|
|
@@ -181,6 +185,7 @@ var Header_default = Header;
|
|
|
181
185
|
|
|
182
186
|
// src/components/SiteChatComponentNewErc/Footer/Footer.tsx
|
|
183
187
|
var import_react2 = require("react");
|
|
188
|
+
var import_classnames2 = __toESM(require("classnames"));
|
|
184
189
|
|
|
185
190
|
// src/components/SiteChatComponentNewErc/Footer/Footer.css
|
|
186
191
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-c86a5c82")) {
|
|
@@ -250,7 +255,7 @@ var Footer = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
250
255
|
const handleRemoveStagedFile = (0, import_react2.useCallback)((index) => {
|
|
251
256
|
setStagedFiles((prev) => prev.filter((_, i) => i !== index));
|
|
252
257
|
}, []);
|
|
253
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { className:
|
|
258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { className: (0, import_classnames2.default)("cw-footer", ercClasses == null ? void 0 : ercClasses.footerClassName), role: "contentinfo", children: [
|
|
254
259
|
stagedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "cw-footer__file-list", "aria-label": "Files to send", children: stagedFiles.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: "cw-footer__file-chip", children: [
|
|
255
260
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "cw-footer__file-chip-name", title: file.name, children: file.name }),
|
|
256
261
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -268,7 +273,7 @@ var Footer = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
268
273
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
269
274
|
"button",
|
|
270
275
|
{
|
|
271
|
-
className:
|
|
276
|
+
className: (0, import_classnames2.default)("cw-footer__attach-btn", ercClasses == null ? void 0 : ercClasses.attachmentButtonClassName),
|
|
272
277
|
onClick: handleAttachmentClick,
|
|
273
278
|
"aria-label": "Attach file",
|
|
274
279
|
type: "button",
|
|
@@ -295,7 +300,7 @@ var Footer = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
295
300
|
"textarea",
|
|
296
301
|
{
|
|
297
302
|
ref: textareaRef,
|
|
298
|
-
className:
|
|
303
|
+
className: (0, import_classnames2.default)("cw-footer__input", ercClasses == null ? void 0 : ercClasses.inputClassName),
|
|
299
304
|
value: text,
|
|
300
305
|
onChange: handleChange,
|
|
301
306
|
onKeyDown: handleKeyDown,
|
|
@@ -308,11 +313,11 @@ var Footer = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
308
313
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
309
314
|
"button",
|
|
310
315
|
{
|
|
311
|
-
className:
|
|
316
|
+
className: (0, import_classnames2.default)(
|
|
312
317
|
"cw-footer__send-btn",
|
|
313
|
-
isEmpty || disabled
|
|
318
|
+
(isEmpty || disabled) && "cw-footer__send-btn--disabled",
|
|
314
319
|
ercClasses == null ? void 0 : ercClasses.sendButtonClassName
|
|
315
|
-
|
|
320
|
+
),
|
|
316
321
|
onClick: handleSend,
|
|
317
322
|
"aria-label": "Send message",
|
|
318
323
|
type: "button",
|
|
@@ -348,6 +353,9 @@ var Footer = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
348
353
|
};
|
|
349
354
|
var Footer_default = Footer;
|
|
350
355
|
|
|
356
|
+
// src/components/SiteChatComponentNewErc/Messages/MessageList.tsx
|
|
357
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
358
|
+
|
|
351
359
|
// src/components/SiteChatComponentNewErc/hooks/useAutoScroll.ts
|
|
352
360
|
var import_react3 = require("react");
|
|
353
361
|
function useAutoScroll(dependency) {
|
|
@@ -445,6 +453,9 @@ function useOfflineForm(schema) {
|
|
|
445
453
|
return { values, errors, setValue, handleSubmit, reset };
|
|
446
454
|
}
|
|
447
455
|
|
|
456
|
+
// src/components/SiteChatComponentNewErc/Messages/UserMessage.tsx
|
|
457
|
+
var import_classnames3 = __toESM(require("classnames"));
|
|
458
|
+
|
|
448
459
|
// src/components/SiteChatComponentNewErc/Messages/UserMessage.css
|
|
449
460
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-488069e4")) {
|
|
450
461
|
const s = document.createElement("style");
|
|
@@ -456,13 +467,16 @@ if (typeof document !== "undefined" && !document.getElementById("jrapps-style-48
|
|
|
456
467
|
// src/components/SiteChatComponentNewErc/Messages/UserMessage.tsx
|
|
457
468
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
458
469
|
var UserMessage = ({ message, ercClassName }) => {
|
|
459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_classnames3.default)("cw-user-message", ercClassName), role: "listitem", "aria-label": "Your message", children: [
|
|
460
471
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cw-user-message__bubble", children: message.message }),
|
|
461
472
|
message.timestamp !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cw-user-message__time", children: formatTime(message.timestamp) })
|
|
462
473
|
] });
|
|
463
474
|
};
|
|
464
475
|
var UserMessage_default = UserMessage;
|
|
465
476
|
|
|
477
|
+
// src/components/SiteChatComponentNewErc/Messages/AgentMessage.tsx
|
|
478
|
+
var import_classnames4 = __toESM(require("classnames"));
|
|
479
|
+
|
|
466
480
|
// src/components/SiteChatComponentNewErc/Shared/Avatar.css
|
|
467
481
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-ad01373e")) {
|
|
468
482
|
const s = document.createElement("style");
|
|
@@ -553,7 +567,7 @@ var AgentMessage = ({ message, ercClassName }) => {
|
|
|
553
567
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
554
568
|
"div",
|
|
555
569
|
{
|
|
556
|
-
className:
|
|
570
|
+
className: (0, import_classnames4.default)("cw-agent-message", ercClassName),
|
|
557
571
|
role: "listitem",
|
|
558
572
|
"aria-label": `Message from ${(_a = message.senderName) != null ? _a : "Agent"}`,
|
|
559
573
|
children: [
|
|
@@ -569,6 +583,9 @@ var AgentMessage = ({ message, ercClassName }) => {
|
|
|
569
583
|
};
|
|
570
584
|
var AgentMessage_default = AgentMessage;
|
|
571
585
|
|
|
586
|
+
// src/components/SiteChatComponentNewErc/Messages/SystemMessage.tsx
|
|
587
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
588
|
+
|
|
572
589
|
// src/components/SiteChatComponentNewErc/Messages/SystemMessage.css
|
|
573
590
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-631d733c")) {
|
|
574
591
|
const s = document.createElement("style");
|
|
@@ -585,7 +602,7 @@ var SystemMessage = ({ message, ercClassName }) => {
|
|
|
585
602
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
586
603
|
"div",
|
|
587
604
|
{
|
|
588
|
-
className:
|
|
605
|
+
className: (0, import_classnames5.default)("cw-system-message", ercClassName),
|
|
589
606
|
role: "listitem",
|
|
590
607
|
"aria-label": `System notification: ${label}`,
|
|
591
608
|
children: [
|
|
@@ -612,9 +629,6 @@ var AttachmentMessage = ({ message }) => {
|
|
|
612
629
|
var _a;
|
|
613
630
|
const attachment = (_a = message.item) != null ? _a : message.attachment;
|
|
614
631
|
if (!attachment) return null;
|
|
615
|
-
const handleOpen = () => {
|
|
616
|
-
window.open(attachment.url, "_blank", "noopener,noreferrer");
|
|
617
|
-
};
|
|
618
632
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
619
633
|
"div",
|
|
620
634
|
{
|
|
@@ -646,12 +660,13 @@ var AttachmentMessage = ({ message }) => {
|
|
|
646
660
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cw-attachment-message__label", children: "Attachment" })
|
|
647
661
|
] }),
|
|
648
662
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
649
|
-
"
|
|
663
|
+
"a",
|
|
650
664
|
{
|
|
651
665
|
className: "cw-attachment-message__open-btn",
|
|
652
|
-
|
|
666
|
+
href: attachment.url,
|
|
667
|
+
target: "_blank",
|
|
668
|
+
rel: "noopener noreferrer",
|
|
653
669
|
"aria-label": `Open attachment ${attachment.name}`,
|
|
654
|
-
type: "button",
|
|
655
670
|
children: "Open"
|
|
656
671
|
}
|
|
657
672
|
)
|
|
@@ -704,7 +719,7 @@ var MessageList = ({ messages, ercClasses }) => {
|
|
|
704
719
|
"div",
|
|
705
720
|
{
|
|
706
721
|
ref: scrollRef,
|
|
707
|
-
className:
|
|
722
|
+
className: (0, import_classnames6.default)("cw-message-list", ercClasses == null ? void 0 : ercClasses.messageListClassName),
|
|
708
723
|
role: "list",
|
|
709
724
|
"aria-label": "Chat messages",
|
|
710
725
|
"aria-live": "polite",
|
|
@@ -1203,31 +1218,35 @@ var ChatEndedState_default = ChatEndedState;
|
|
|
1203
1218
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-6b6fcb3b")) {
|
|
1204
1219
|
const s = document.createElement("style");
|
|
1205
1220
|
s.id = "jrapps-style-6b6fcb3b";
|
|
1206
|
-
s.textContent = "/* \u2500\u2500\u2500 Root container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Fixed to bottom-right by default so it works out-of-the-box.\n * Override with your own positioning class if embedding differently.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.cw-root {\n position: fixed;\n bottom: max(24px, env(safe-area-inset-bottom));\n right: max(24px, env(safe-area-inset-right));\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 12px;\n z-index: 9999;\n /* Scope CSS vars and stacking context */\n isolation: isolate;\n font-family: var(--cw-font-family);\n font-size: var(--cw-font-size);\n}\n\n/* \u2500\u2500\u2500 Editor React Component root \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Fills the container provided by the Wix editor. No fixed positioning,\n * no launcher button. Width & height are managed by the editor itself.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.
|
|
1221
|
+
s.textContent = "/* \u2500\u2500\u2500 Root container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Fixed to bottom-right by default so it works out-of-the-box.\n * Override with your own positioning class if embedding differently.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.cw-root {\n position: fixed;\n bottom: max(24px, env(safe-area-inset-bottom));\n right: max(24px, env(safe-area-inset-right));\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 12px;\n z-index: 9999;\n /* Scope CSS vars and stacking context */\n isolation: isolate;\n font-family: var(--cw-font-family);\n font-size: var(--cw-font-size);\n}\n\n/* \u2500\u2500\u2500 Editor React Component root \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Fills the container provided by the Wix editor. No fixed positioning,\n * no launcher button. Width & height are managed by the editor itself.\n * The global class `site-chat-erc` is the root part name scanned by\n * zeroConfig so the editor can style it.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.site-chat-erc {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: var(--cw-background, #ffffff);\n font-family: var(--cw-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif);\n font-size: var(--cw-font-size, 14px);\n overflow: hidden;\n}\n\n/* Widget body fills remaining space between header and footer */\n.site-chat-erc .cw-widget__body {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n/* \u2500\u2500\u2500 Widget Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.cw-widget {\n display: flex;\n flex-direction: column;\n width: var(--cw-width);\n height: var(--cw-height);\n /* Clamp so it never overflows the viewport on small screens */\n max-width: calc(100vw - 48px);\n max-height: calc(100dvh - 96px);\n background-color: var(--cw-background);\n border-radius: var(--cw-border-radius);\n box-shadow: var(--cw-shadow);\n overflow: hidden;\n /* Entry animation */\n animation: cw-panel-in 0.22s ease;\n transform-origin: bottom right;\n}\n\n@keyframes cw-panel-in {\n from {\n opacity: 0;\n transform: scale(0.92) translateY(10px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n}\n\n.cw-widget__body {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n}\n\n/* \u2500\u2500\u2500 Launcher Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.cw-launcher {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n border: none;\n background-color: var(--cw-primary);\n color: #ffffff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);\n flex-shrink: 0;\n transition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n\n.cw-launcher:hover {\n transform: scale(1.07);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);\n}\n\n.cw-launcher:focus-visible {\n outline: 3px solid var(--cw-primary);\n outline-offset: 3px;\n}\n\n.cw-launcher:active {\n transform: scale(0.96);\n}\n\n/* \u2500\u2500\u2500 Tablet (481px \u2013 768px): panel floats, slightly narrower margin \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n@media (min-width: 481px) and (max-width: 768px) {\n .cw-root {\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n }\n\n .cw-widget {\n max-width: calc(100vw - 32px);\n max-height: calc(100dvh - 80px);\n }\n}\n\n/* \u2500\u2500\u2500 Mobile (\u2264 480px): full-screen panel, launcher stays fixed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n@media (max-width: 480px) {\n .cw-root {\n bottom: 0;\n right: 0;\n gap: 0;\n }\n\n .cw-root > .cw-launcher {\n position: fixed;\n bottom: max(20px, env(safe-area-inset-bottom));\n right: max(20px, env(safe-area-inset-right));\n }\n\n .cw-widget {\n width: 100vw;\n max-width: 100vw;\n height: 100dvh;\n max-height: 100dvh;\n border-radius: 0;\n transform-origin: bottom center;\n }\n}\n";
|
|
1207
1222
|
document.head.appendChild(s);
|
|
1208
1223
|
}
|
|
1209
1224
|
|
|
1210
1225
|
// src/components/SiteChatComponentNewErc/SiteChatComponentNewErc.tsx
|
|
1211
1226
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1212
|
-
var SiteChatComponentNewErc = import_react5.default.forwardRef(({
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1227
|
+
var SiteChatComponentNewErc = import_react5.default.forwardRef((props, ref) => {
|
|
1228
|
+
const {
|
|
1229
|
+
title,
|
|
1230
|
+
subtitle,
|
|
1231
|
+
image,
|
|
1232
|
+
theme,
|
|
1233
|
+
messages,
|
|
1234
|
+
offlineForm,
|
|
1235
|
+
defaultOpen = false,
|
|
1236
|
+
loading = false,
|
|
1237
|
+
chatEnded = false,
|
|
1238
|
+
width,
|
|
1239
|
+
height,
|
|
1240
|
+
onSend,
|
|
1241
|
+
onAttachment,
|
|
1242
|
+
onOfflineSubmit,
|
|
1243
|
+
onClose,
|
|
1244
|
+
isEditorReactComponent = false,
|
|
1245
|
+
className,
|
|
1246
|
+
id,
|
|
1247
|
+
direction = "ltr",
|
|
1248
|
+
editorReactComponentThemeProps
|
|
1249
|
+
} = props;
|
|
1231
1250
|
const { open, openWidget, closeWidget } = useSiteChatComponentNewErc(defaultOpen);
|
|
1232
1251
|
const themeVars = buildThemeVars(theme, width, height);
|
|
1233
1252
|
const handleClose = () => {
|
|
@@ -1259,30 +1278,40 @@ var SiteChatComponentNewErc = import_react5.default.forwardRef(({
|
|
|
1259
1278
|
};
|
|
1260
1279
|
if (isEditorReactComponent) {
|
|
1261
1280
|
const ercTheme = editorReactComponentThemeProps;
|
|
1262
|
-
const ercStyle =
|
|
1263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1281
|
+
const ercStyle = buildThemeVars(theme);
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1283
|
+
"div",
|
|
1284
|
+
{
|
|
1285
|
+
ref,
|
|
1286
|
+
id,
|
|
1287
|
+
dir: direction,
|
|
1288
|
+
className: (0, import_classnames7.default)("site-chat-erc", className),
|
|
1289
|
+
style: ercStyle,
|
|
1290
|
+
children: [
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1292
|
+
Header_default,
|
|
1293
|
+
{
|
|
1294
|
+
image,
|
|
1295
|
+
title,
|
|
1296
|
+
subtitle,
|
|
1297
|
+
onClose: onClose != null ? onClose : (() => {
|
|
1298
|
+
}),
|
|
1299
|
+
ercClasses: ercTheme == null ? void 0 : ercTheme.header
|
|
1300
|
+
}
|
|
1301
|
+
),
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
className: (0, import_classnames7.default)(
|
|
1306
|
+
"cw-widget__body",
|
|
1307
|
+
ercTheme == null ? void 0 : ercTheme.conversation.conversationClassName
|
|
1308
|
+
),
|
|
1309
|
+
children: renderBody(ercTheme == null ? void 0 : ercTheme.conversation, ercTheme == null ? void 0 : ercTheme.footer)
|
|
1310
|
+
}
|
|
1311
|
+
)
|
|
1312
|
+
]
|
|
1313
|
+
}
|
|
1314
|
+
);
|
|
1286
1315
|
}
|
|
1287
1316
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref, className: "cw-root", style: themeVars, children: [
|
|
1288
1317
|
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|