@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
package/dist/cjs/index.js
CHANGED
|
@@ -1302,6 +1302,7 @@ SiteChatComponentNew.displayName = "SiteChatComponentNew";
|
|
|
1302
1302
|
|
|
1303
1303
|
// src/components/SiteChatComponentNewErc/SiteChatComponentNewErc.tsx
|
|
1304
1304
|
var import_react10 = __toESM(require("react"));
|
|
1305
|
+
var import_classnames7 = __toESM(require("classnames"));
|
|
1305
1306
|
|
|
1306
1307
|
// src/components/SiteChatComponentNewErc/useSiteChatComponentNewErc.ts
|
|
1307
1308
|
var import_react6 = require("react");
|
|
@@ -1386,6 +1387,9 @@ function formatTime2(timestamp) {
|
|
|
1386
1387
|
});
|
|
1387
1388
|
}
|
|
1388
1389
|
|
|
1390
|
+
// src/components/SiteChatComponentNewErc/Header/Header.tsx
|
|
1391
|
+
var import_classnames = __toESM(require("classnames"));
|
|
1392
|
+
|
|
1389
1393
|
// src/components/SiteChatComponentNewErc/Header/Header.css
|
|
1390
1394
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-759620f0")) {
|
|
1391
1395
|
const s = document.createElement("style");
|
|
@@ -1397,25 +1401,25 @@ if (typeof document !== "undefined" && !document.getElementById("jrapps-style-75
|
|
|
1397
1401
|
// src/components/SiteChatComponentNewErc/Header/Header.tsx
|
|
1398
1402
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1399
1403
|
var Header2 = ({ image, title, subtitle, onClose, ercClasses }) => {
|
|
1400
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { className:
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { className: (0, import_classnames.default)("cw-header", ercClasses == null ? void 0 : ercClasses.headerClassName), role: "banner", children: [
|
|
1401
1405
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "cw-header__identity", children: [
|
|
1402
1406
|
image && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1403
1407
|
"img",
|
|
1404
1408
|
{
|
|
1405
1409
|
src: image,
|
|
1406
1410
|
alt: `${title} avatar`,
|
|
1407
|
-
className:
|
|
1411
|
+
className: (0, import_classnames.default)("cw-header__avatar", ercClasses == null ? void 0 : ercClasses.imageClassName)
|
|
1408
1412
|
}
|
|
1409
1413
|
),
|
|
1410
1414
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "cw-header__text", children: [
|
|
1411
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className:
|
|
1412
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className:
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_classnames.default)("cw-header__title", ercClasses == null ? void 0 : ercClasses.titleClassName), children: title }),
|
|
1416
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_classnames.default)("cw-header__subtitle", ercClasses == null ? void 0 : ercClasses.subtitleClassName), children: subtitle })
|
|
1413
1417
|
] })
|
|
1414
1418
|
] }),
|
|
1415
1419
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1416
1420
|
"button",
|
|
1417
1421
|
{
|
|
1418
|
-
className:
|
|
1422
|
+
className: (0, import_classnames.default)("cw-header__close", ercClasses == null ? void 0 : ercClasses.closeButtonClassName),
|
|
1419
1423
|
onClick: onClose,
|
|
1420
1424
|
"aria-label": "Close chat",
|
|
1421
1425
|
type: "button",
|
|
@@ -1446,6 +1450,7 @@ var Header_default2 = Header2;
|
|
|
1446
1450
|
|
|
1447
1451
|
// src/components/SiteChatComponentNewErc/Footer/Footer.tsx
|
|
1448
1452
|
var import_react7 = require("react");
|
|
1453
|
+
var import_classnames2 = __toESM(require("classnames"));
|
|
1449
1454
|
|
|
1450
1455
|
// src/components/SiteChatComponentNewErc/Footer/Footer.css
|
|
1451
1456
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-c86a5c82")) {
|
|
@@ -1515,7 +1520,7 @@ var Footer2 = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
1515
1520
|
const handleRemoveStagedFile = (0, import_react7.useCallback)((index) => {
|
|
1516
1521
|
setStagedFiles((prev) => prev.filter((_, i) => i !== index));
|
|
1517
1522
|
}, []);
|
|
1518
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { className:
|
|
1523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { className: (0, import_classnames2.default)("cw-footer", ercClasses == null ? void 0 : ercClasses.footerClassName), role: "contentinfo", children: [
|
|
1519
1524
|
stagedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "cw-footer__file-list", "aria-label": "Files to send", children: stagedFiles.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { className: "cw-footer__file-chip", children: [
|
|
1520
1525
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "cw-footer__file-chip-name", title: file.name, children: file.name }),
|
|
1521
1526
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1533,7 +1538,7 @@ var Footer2 = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
1533
1538
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1534
1539
|
"button",
|
|
1535
1540
|
{
|
|
1536
|
-
className:
|
|
1541
|
+
className: (0, import_classnames2.default)("cw-footer__attach-btn", ercClasses == null ? void 0 : ercClasses.attachmentButtonClassName),
|
|
1537
1542
|
onClick: handleAttachmentClick,
|
|
1538
1543
|
"aria-label": "Attach file",
|
|
1539
1544
|
type: "button",
|
|
@@ -1560,7 +1565,7 @@ var Footer2 = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
1560
1565
|
"textarea",
|
|
1561
1566
|
{
|
|
1562
1567
|
ref: textareaRef,
|
|
1563
|
-
className:
|
|
1568
|
+
className: (0, import_classnames2.default)("cw-footer__input", ercClasses == null ? void 0 : ercClasses.inputClassName),
|
|
1564
1569
|
value: text,
|
|
1565
1570
|
onChange: handleChange,
|
|
1566
1571
|
onKeyDown: handleKeyDown,
|
|
@@ -1573,11 +1578,11 @@ var Footer2 = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
1573
1578
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1574
1579
|
"button",
|
|
1575
1580
|
{
|
|
1576
|
-
className:
|
|
1581
|
+
className: (0, import_classnames2.default)(
|
|
1577
1582
|
"cw-footer__send-btn",
|
|
1578
|
-
isEmpty || disabled
|
|
1583
|
+
(isEmpty || disabled) && "cw-footer__send-btn--disabled",
|
|
1579
1584
|
ercClasses == null ? void 0 : ercClasses.sendButtonClassName
|
|
1580
|
-
|
|
1585
|
+
),
|
|
1581
1586
|
onClick: handleSend,
|
|
1582
1587
|
"aria-label": "Send message",
|
|
1583
1588
|
type: "button",
|
|
@@ -1613,6 +1618,9 @@ var Footer2 = ({ onSend, onAttachment, disabled, ercClasses }) => {
|
|
|
1613
1618
|
};
|
|
1614
1619
|
var Footer_default2 = Footer2;
|
|
1615
1620
|
|
|
1621
|
+
// src/components/SiteChatComponentNewErc/Messages/MessageList.tsx
|
|
1622
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
1623
|
+
|
|
1616
1624
|
// src/components/SiteChatComponentNewErc/hooks/useAutoScroll.ts
|
|
1617
1625
|
var import_react8 = require("react");
|
|
1618
1626
|
function useAutoScroll2(dependency) {
|
|
@@ -1710,6 +1718,9 @@ function useOfflineForm2(schema) {
|
|
|
1710
1718
|
return { values, errors, setValue, handleSubmit, reset };
|
|
1711
1719
|
}
|
|
1712
1720
|
|
|
1721
|
+
// src/components/SiteChatComponentNewErc/Messages/UserMessage.tsx
|
|
1722
|
+
var import_classnames3 = __toESM(require("classnames"));
|
|
1723
|
+
|
|
1713
1724
|
// src/components/SiteChatComponentNewErc/Messages/UserMessage.css
|
|
1714
1725
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-488069e4")) {
|
|
1715
1726
|
const s = document.createElement("style");
|
|
@@ -1721,13 +1732,16 @@ if (typeof document !== "undefined" && !document.getElementById("jrapps-style-48
|
|
|
1721
1732
|
// src/components/SiteChatComponentNewErc/Messages/UserMessage.tsx
|
|
1722
1733
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1723
1734
|
var UserMessage2 = ({ message, ercClassName }) => {
|
|
1724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className:
|
|
1735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_classnames3.default)("cw-user-message", ercClassName), role: "listitem", "aria-label": "Your message", children: [
|
|
1725
1736
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "cw-user-message__bubble", children: message.message }),
|
|
1726
1737
|
message.timestamp !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "cw-user-message__time", children: formatTime2(message.timestamp) })
|
|
1727
1738
|
] });
|
|
1728
1739
|
};
|
|
1729
1740
|
var UserMessage_default2 = UserMessage2;
|
|
1730
1741
|
|
|
1742
|
+
// src/components/SiteChatComponentNewErc/Messages/AgentMessage.tsx
|
|
1743
|
+
var import_classnames4 = __toESM(require("classnames"));
|
|
1744
|
+
|
|
1731
1745
|
// src/components/SiteChatComponentNewErc/Shared/Avatar.css
|
|
1732
1746
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-ad01373e")) {
|
|
1733
1747
|
const s = document.createElement("style");
|
|
@@ -1818,7 +1832,7 @@ var AgentMessage2 = ({ message, ercClassName }) => {
|
|
|
1818
1832
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1819
1833
|
"div",
|
|
1820
1834
|
{
|
|
1821
|
-
className:
|
|
1835
|
+
className: (0, import_classnames4.default)("cw-agent-message", ercClassName),
|
|
1822
1836
|
role: "listitem",
|
|
1823
1837
|
"aria-label": `Message from ${(_a = message.senderName) != null ? _a : "Agent"}`,
|
|
1824
1838
|
children: [
|
|
@@ -1834,6 +1848,9 @@ var AgentMessage2 = ({ message, ercClassName }) => {
|
|
|
1834
1848
|
};
|
|
1835
1849
|
var AgentMessage_default2 = AgentMessage2;
|
|
1836
1850
|
|
|
1851
|
+
// src/components/SiteChatComponentNewErc/Messages/SystemMessage.tsx
|
|
1852
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
1853
|
+
|
|
1837
1854
|
// src/components/SiteChatComponentNewErc/Messages/SystemMessage.css
|
|
1838
1855
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-631d733c")) {
|
|
1839
1856
|
const s = document.createElement("style");
|
|
@@ -1850,7 +1867,7 @@ var SystemMessage2 = ({ message, ercClassName }) => {
|
|
|
1850
1867
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1851
1868
|
"div",
|
|
1852
1869
|
{
|
|
1853
|
-
className:
|
|
1870
|
+
className: (0, import_classnames5.default)("cw-system-message", ercClassName),
|
|
1854
1871
|
role: "listitem",
|
|
1855
1872
|
"aria-label": `System notification: ${label}`,
|
|
1856
1873
|
children: [
|
|
@@ -1877,9 +1894,6 @@ var AttachmentMessage2 = ({ message }) => {
|
|
|
1877
1894
|
var _a;
|
|
1878
1895
|
const attachment = (_a = message.item) != null ? _a : message.attachment;
|
|
1879
1896
|
if (!attachment) return null;
|
|
1880
|
-
const handleOpen = () => {
|
|
1881
|
-
window.open(attachment.url, "_blank", "noopener,noreferrer");
|
|
1882
|
-
};
|
|
1883
1897
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1884
1898
|
"div",
|
|
1885
1899
|
{
|
|
@@ -1911,12 +1925,13 @@ var AttachmentMessage2 = ({ message }) => {
|
|
|
1911
1925
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "cw-attachment-message__label", children: "Attachment" })
|
|
1912
1926
|
] }),
|
|
1913
1927
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1914
|
-
"
|
|
1928
|
+
"a",
|
|
1915
1929
|
{
|
|
1916
1930
|
className: "cw-attachment-message__open-btn",
|
|
1917
|
-
|
|
1931
|
+
href: attachment.url,
|
|
1932
|
+
target: "_blank",
|
|
1933
|
+
rel: "noopener noreferrer",
|
|
1918
1934
|
"aria-label": `Open attachment ${attachment.name}`,
|
|
1919
|
-
type: "button",
|
|
1920
1935
|
children: "Open"
|
|
1921
1936
|
}
|
|
1922
1937
|
)
|
|
@@ -1969,7 +1984,7 @@ var MessageList2 = ({ messages, ercClasses }) => {
|
|
|
1969
1984
|
"div",
|
|
1970
1985
|
{
|
|
1971
1986
|
ref: scrollRef,
|
|
1972
|
-
className:
|
|
1987
|
+
className: (0, import_classnames6.default)("cw-message-list", ercClasses == null ? void 0 : ercClasses.messageListClassName),
|
|
1973
1988
|
role: "list",
|
|
1974
1989
|
"aria-label": "Chat messages",
|
|
1975
1990
|
"aria-live": "polite",
|
|
@@ -2468,31 +2483,35 @@ var ChatEndedState_default2 = ChatEndedState2;
|
|
|
2468
2483
|
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-6b6fcb3b")) {
|
|
2469
2484
|
const s = document.createElement("style");
|
|
2470
2485
|
s.id = "jrapps-style-6b6fcb3b";
|
|
2471
|
-
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.
|
|
2486
|
+
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";
|
|
2472
2487
|
document.head.appendChild(s);
|
|
2473
2488
|
}
|
|
2474
2489
|
|
|
2475
2490
|
// src/components/SiteChatComponentNewErc/SiteChatComponentNewErc.tsx
|
|
2476
2491
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2477
|
-
var SiteChatComponentNewErc = import_react10.default.forwardRef(({
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2492
|
+
var SiteChatComponentNewErc = import_react10.default.forwardRef((props, ref) => {
|
|
2493
|
+
const {
|
|
2494
|
+
title,
|
|
2495
|
+
subtitle,
|
|
2496
|
+
image,
|
|
2497
|
+
theme,
|
|
2498
|
+
messages,
|
|
2499
|
+
offlineForm,
|
|
2500
|
+
defaultOpen = false,
|
|
2501
|
+
loading = false,
|
|
2502
|
+
chatEnded = false,
|
|
2503
|
+
width,
|
|
2504
|
+
height,
|
|
2505
|
+
onSend,
|
|
2506
|
+
onAttachment,
|
|
2507
|
+
onOfflineSubmit,
|
|
2508
|
+
onClose,
|
|
2509
|
+
isEditorReactComponent = false,
|
|
2510
|
+
className,
|
|
2511
|
+
id,
|
|
2512
|
+
direction = "ltr",
|
|
2513
|
+
editorReactComponentThemeProps
|
|
2514
|
+
} = props;
|
|
2496
2515
|
const { open, openWidget, closeWidget } = useSiteChatComponentNewErc(defaultOpen);
|
|
2497
2516
|
const themeVars = buildThemeVars2(theme, width, height);
|
|
2498
2517
|
const handleClose = () => {
|
|
@@ -2524,30 +2543,40 @@ var SiteChatComponentNewErc = import_react10.default.forwardRef(({
|
|
|
2524
2543
|
};
|
|
2525
2544
|
if (isEditorReactComponent) {
|
|
2526
2545
|
const ercTheme = editorReactComponentThemeProps;
|
|
2527
|
-
const ercStyle =
|
|
2528
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2546
|
+
const ercStyle = buildThemeVars2(theme);
|
|
2547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2548
|
+
"div",
|
|
2549
|
+
{
|
|
2550
|
+
ref,
|
|
2551
|
+
id,
|
|
2552
|
+
dir: direction,
|
|
2553
|
+
className: (0, import_classnames7.default)("site-chat-erc", className),
|
|
2554
|
+
style: ercStyle,
|
|
2555
|
+
children: [
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2557
|
+
Header_default2,
|
|
2558
|
+
{
|
|
2559
|
+
image,
|
|
2560
|
+
title,
|
|
2561
|
+
subtitle,
|
|
2562
|
+
onClose: onClose != null ? onClose : (() => {
|
|
2563
|
+
}),
|
|
2564
|
+
ercClasses: ercTheme == null ? void 0 : ercTheme.header
|
|
2565
|
+
}
|
|
2566
|
+
),
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2568
|
+
"div",
|
|
2569
|
+
{
|
|
2570
|
+
className: (0, import_classnames7.default)(
|
|
2571
|
+
"cw-widget__body",
|
|
2572
|
+
ercTheme == null ? void 0 : ercTheme.conversation.conversationClassName
|
|
2573
|
+
),
|
|
2574
|
+
children: renderBody(ercTheme == null ? void 0 : ercTheme.conversation, ercTheme == null ? void 0 : ercTheme.footer)
|
|
2575
|
+
}
|
|
2576
|
+
)
|
|
2577
|
+
]
|
|
2578
|
+
}
|
|
2579
|
+
);
|
|
2551
2580
|
}
|
|
2552
2581
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref, className: "cw-root", style: themeVars, children: [
|
|
2553
2582
|
open && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|