@jrapps/my_tickets_chat_ui 0.2.3 → 0.3.2
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 +1334 -0
- package/dist/cjs/components/SiteChatComponentNewErc/index.js.map +7 -0
- package/dist/cjs/index.js +1505 -1169
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/chunks/chunk-364KVRPG.mjs +1302 -0
- package/dist/esm/chunks/chunk-364KVRPG.mjs.map +7 -0
- package/dist/esm/chunks/{chunk-QGWQSJDB.js → chunk-54X5DYPJ.mjs} +1 -1
- package/dist/esm/components/SiteChatComponentNew/{index.js → index.mjs} +2 -2
- package/dist/esm/components/SiteChatComponentNewErc/index.mjs +9 -0
- package/dist/esm/index.mjs +15 -0
- package/dist/types/components/SiteChatComponentNewErc/Footer/Footer.d.ts +6 -0
- package/dist/types/components/SiteChatComponentNewErc/Footer/Footer.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Footer/index.d.ts +2 -0
- package/dist/types/components/SiteChatComponentNewErc/Footer/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Header/Header.d.ts +6 -0
- package/dist/types/components/SiteChatComponentNewErc/Header/Header.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Header/index.d.ts +2 -0
- package/dist/types/components/SiteChatComponentNewErc/Header/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/AgentMessage.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/AgentMessage.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/AttachmentMessage.d.ts +9 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/AttachmentMessage.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/MessageList.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/MessageList.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/MessageRenderer.d.ts +9 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/MessageRenderer.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/SystemMessage.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/SystemMessage.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/TypingIndicator.d.ts +5 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/TypingIndicator.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/UserMessage.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/UserMessage.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/index.d.ts +8 -0
- package/dist/types/components/SiteChatComponentNewErc/Messages/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/OfflineForm/OfflineForm.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/OfflineForm/OfflineForm.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/OfflineForm/index.d.ts +2 -0
- package/dist/types/components/SiteChatComponentNewErc/OfflineForm/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/Avatar.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/Avatar.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/Button.d.ts +14 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/Button.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/index.d.ts +3 -0
- package/dist/types/components/SiteChatComponentNewErc/Shared/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.d.ts +5 -0
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.types.d.ts +146 -0
- package/dist/types/components/SiteChatComponentNewErc/SiteChatComponentNewErc.types.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/States/ChatEndedState.d.ts +5 -0
- package/dist/types/components/SiteChatComponentNewErc/States/ChatEndedState.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/States/LoadingState.d.ts +5 -0
- package/dist/types/components/SiteChatComponentNewErc/States/LoadingState.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/States/OfflineState.d.ts +10 -0
- package/dist/types/components/SiteChatComponentNewErc/States/OfflineState.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/States/StartChatState.d.ts +11 -0
- package/dist/types/components/SiteChatComponentNewErc/States/StartChatState.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/States/index.d.ts +5 -0
- package/dist/types/components/SiteChatComponentNewErc/States/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/index.d.ts +3 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/useAutoScroll.d.ts +15 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/useAutoScroll.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/useOfflineForm.d.ts +12 -0
- package/dist/types/components/SiteChatComponentNewErc/hooks/useOfflineForm.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/index.d.ts +4 -0
- package/dist/types/components/SiteChatComponentNewErc/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/useSiteChatComponentNewErc.d.ts +3 -0
- package/dist/types/components/SiteChatComponentNewErc/useSiteChatComponentNewErc.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/classNames.d.ts +28 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/classNames.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/format.d.ts +9 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/format.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/index.d.ts +4 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/index.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/systemMessages.d.ts +4 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/systemMessages.d.ts.map +1 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/theme.d.ts +8 -0
- package/dist/types/components/SiteChatComponentNewErc/utils/theme.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +4 -7
- package/dist/cjs/components/SiteChatComponent/index.js +0 -998
- package/dist/cjs/components/SiteChatComponent/index.js.map +0 -7
- package/dist/esm/chunks/chunk-QPJPV2T3.js +0 -971
- package/dist/esm/chunks/chunk-QPJPV2T3.js.map +0 -7
- package/dist/esm/components/SiteChatComponent/index.js +0 -7
- package/dist/esm/index.js +0 -13
- package/dist/types/components/SiteChatComponent/FabButton/FabButton.d.ts +0 -4
- package/dist/types/components/SiteChatComponent/FabButton/FabButton.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/FabButton/FabButton.types.d.ts +0 -8
- package/dist/types/components/SiteChatComponent/FabButton/FabButton.types.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/Footer.d.ts +0 -4
- package/dist/types/components/SiteChatComponent/Footer/Footer.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/Footer.types.d.ts +0 -45
- package/dist/types/components/SiteChatComponent/Footer/Footer.types.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/attachment-list/attachment-list.d.ts +0 -5
- package/dist/types/components/SiteChatComponent/Footer/attachment-list/attachment-list.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/message-input/message-input.d.ts +0 -18
- package/dist/types/components/SiteChatComponent/Footer/message-input/message-input.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/message-input/open-file-picker.d.ts +0 -10
- package/dist/types/components/SiteChatComponent/Footer/message-input/open-file-picker.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Footer/send-button/send-button.d.ts +0 -10
- package/dist/types/components/SiteChatComponent/Footer/send-button/send-button.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Header/Header.d.ts +0 -4
- package/dist/types/components/SiteChatComponent/Header/Header.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/Header/Header.types.d.ts +0 -8
- package/dist/types/components/SiteChatComponent/Header/Header.types.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/MessageContainer/MessageContainer.d.ts +0 -4
- package/dist/types/components/SiteChatComponent/MessageContainer/MessageContainer.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/MessageContainer/MessageContainer.types.d.ts +0 -7
- package/dist/types/components/SiteChatComponent/MessageContainer/MessageContainer.types.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/MessageContainer/messages/attachment.d.ts +0 -5
- package/dist/types/components/SiteChatComponent/MessageContainer/messages/attachment.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/MessageContainer/messages/messages-wrapper.d.ts +0 -5
- package/dist/types/components/SiteChatComponent/MessageContainer/messages/messages-wrapper.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/SiteChatComponent.d.ts +0 -11
- package/dist/types/components/SiteChatComponent/SiteChatComponent.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/SiteChatComponent.types.d.ts +0 -10
- package/dist/types/components/SiteChatComponent/SiteChatComponent.types.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/index.d.ts +0 -6
- package/dist/types/components/SiteChatComponent/index.d.ts.map +0 -1
- package/dist/types/components/SiteChatComponent/useSiteChatComponent.d.ts +0 -8
- package/dist/types/components/SiteChatComponent/useSiteChatComponent.d.ts.map +0 -1
- package/dist/types/test/test.d.ts +0 -8
- package/dist/types/test/test.d.ts.map +0 -1
- /package/dist/esm/chunks/{chunk-QGWQSJDB.js.map → chunk-54X5DYPJ.mjs.map} +0 -0
- /package/dist/esm/components/{SiteChatComponent/index.js.map → SiteChatComponentNew/index.mjs.map} +0 -0
- /package/dist/esm/components/{SiteChatComponentNew/index.js.map → SiteChatComponentNewErc/index.mjs.map} +0 -0
- /package/dist/esm/{index.js.map → index.mjs.map} +0 -0
|
@@ -1,998 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/components/SiteChatComponent/index.ts
|
|
31
|
-
var SiteChatComponent_exports = {};
|
|
32
|
-
__export(SiteChatComponent_exports, {
|
|
33
|
-
SiteChatComponent: () => SiteChatComponent
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(SiteChatComponent_exports);
|
|
36
|
-
|
|
37
|
-
// src/components/SiteChatComponent/SiteChatComponent.tsx
|
|
38
|
-
var import_react7 = __toESM(require("react"));
|
|
39
|
-
var import_design_system9 = require("@wix/design-system");
|
|
40
|
-
var import_styles_global = require("@wix/design-system/styles.global.css");
|
|
41
|
-
|
|
42
|
-
// src/components/SiteChatComponent/useSiteChatComponent.ts
|
|
43
|
-
function useSiteChatComponent() {
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// src/components/SiteChatComponent/FabButton/FabButton.tsx
|
|
48
|
-
var import_react = __toESM(require("react"));
|
|
49
|
-
var import_design_system = require("@wix/design-system");
|
|
50
|
-
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
|
|
51
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
-
var FabButton = import_react.default.forwardRef(
|
|
53
|
-
({
|
|
54
|
-
className,
|
|
55
|
-
children,
|
|
56
|
-
onClick,
|
|
57
|
-
type = "textIcon",
|
|
58
|
-
icon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wix_ui_icons_common.WixChat, {}),
|
|
59
|
-
text,
|
|
60
|
-
...rest
|
|
61
|
-
}, ref) => {
|
|
62
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
-
"button",
|
|
64
|
-
{
|
|
65
|
-
className: "site-chat-component-fab",
|
|
66
|
-
onClick,
|
|
67
|
-
children: [
|
|
68
|
-
type === "textIcon" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "site-chat-component-fab-fab-button-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Box, { height: "100%", children: icon }) }) : null,
|
|
69
|
-
type === "textIcon" || type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "site-chat-component-fab-fab-button-text", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "site-chat-component-fab-fab-button-label", children: text }) }) : null,
|
|
70
|
-
type === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "site-chat-component-fab-fab-button-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Box, { height: "100%", width: "max-content", children: icon }) }) : null
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
) });
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
FabButton.displayName = "SiteChatComponent.FabButton";
|
|
77
|
-
|
|
78
|
-
// src/components/SiteChatComponent/Footer/Footer.tsx
|
|
79
|
-
var import_react3 = __toESM(require("react"));
|
|
80
|
-
var import_design_system4 = require("@wix/design-system");
|
|
81
|
-
|
|
82
|
-
// src/components/SiteChatComponent/Footer/send-button/send-button.tsx
|
|
83
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
84
|
-
var SendButton = ({
|
|
85
|
-
text = "Send",
|
|
86
|
-
className = "",
|
|
87
|
-
onClick,
|
|
88
|
-
disabled = false
|
|
89
|
-
}) => {
|
|
90
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
91
|
-
"button",
|
|
92
|
-
{
|
|
93
|
-
className: `site-chat-component-footer-my-tickets-chat-widget-send-button ${className}`,
|
|
94
|
-
onClick,
|
|
95
|
-
disabled,
|
|
96
|
-
children: text
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
var send_button_default = SendButton;
|
|
101
|
-
|
|
102
|
-
// src/components/SiteChatComponent/Footer/attachment-list/attachment-list.tsx
|
|
103
|
-
var import_react2 = require("react");
|
|
104
|
-
var import_design_system2 = require("@wix/design-system");
|
|
105
|
-
var import_wix_ui_icons_common2 = require("@wix/wix-ui-icons-common");
|
|
106
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
107
|
-
var AttachmentList = ({ items, onRemove, onClick, onFilesSent }) => {
|
|
108
|
-
const [localItems, setLocalItems] = (0, import_react2.useState)(items);
|
|
109
|
-
(0, import_react2.useEffect)(() => {
|
|
110
|
-
setLocalItems(items);
|
|
111
|
-
}, [items]);
|
|
112
|
-
const handleOnRemove = (id) => {
|
|
113
|
-
if (onRemove) {
|
|
114
|
-
onRemove(id);
|
|
115
|
-
}
|
|
116
|
-
setLocalItems((prev) => prev.filter((item) => item.id !== id));
|
|
117
|
-
};
|
|
118
|
-
const handleSendFiles = () => {
|
|
119
|
-
if (onFilesSent && localItems.length > 0) {
|
|
120
|
-
onFilesSent(localItems);
|
|
121
|
-
setLocalItems([]);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.Box, { direction: "horizontal", gap: 2, maxWidth: "100%", minWidth: "100%", overflowY: "hidden", boxSizing: "border-box", scrollbarWidth: "thin", overflowX: "auto", children: localItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "site-chat-component-footer-file-item-container", onClick: () => onClick && onClick(item.id, item.url), children: [
|
|
125
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_wix_ui_icons_common2.Page, { size: "15px" }),
|
|
126
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "site-chat-component-footer-file-name", children: item.name }),
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.IconButton, { size: "tiny", onClick: () => handleOnRemove(item.id), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_wix_ui_icons_common2.DismissSmall, {}) })
|
|
128
|
-
] }, item.id)) });
|
|
129
|
-
};
|
|
130
|
-
var attachment_list_default = AttachmentList;
|
|
131
|
-
|
|
132
|
-
// src/components/SiteChatComponent/Footer/message-input/message-input.tsx
|
|
133
|
-
var import_design_system3 = require("@wix/design-system");
|
|
134
|
-
var import_wix_ui_icons_common3 = require("@wix/wix-ui-icons-common");
|
|
135
|
-
|
|
136
|
-
// src/components/SiteChatComponent/Footer/message-input/open-file-picker.ts
|
|
137
|
-
var import_essentials = require("@wix/essentials");
|
|
138
|
-
var import_meta = {};
|
|
139
|
-
var uploadFile = async (file) => {
|
|
140
|
-
var _a;
|
|
141
|
-
try {
|
|
142
|
-
const baseApiUrl = new URL(import_meta.url).origin;
|
|
143
|
-
const response = await import_essentials.httpClient.fetchWithAuth(`${baseApiUrl}/api/widget/chat/upload-attachment`, {
|
|
144
|
-
method: "POST",
|
|
145
|
-
headers: {
|
|
146
|
-
"Content-Type": file.type || "application/octet-stream",
|
|
147
|
-
"x-file-name": encodeURIComponent(file.name),
|
|
148
|
-
"x-file-type": file.type || "application/octet-stream"
|
|
149
|
-
},
|
|
150
|
-
body: file
|
|
151
|
-
});
|
|
152
|
-
const data = await response.json();
|
|
153
|
-
if (!response.ok) {
|
|
154
|
-
throw new Error(data.error || "Failed to upload file");
|
|
155
|
-
}
|
|
156
|
-
if (!((_a = data.file) == null ? void 0 : _a.id) || !data.file.displayName || !data.file.url) {
|
|
157
|
-
throw new Error("Invalid response format from upload endpoint");
|
|
158
|
-
}
|
|
159
|
-
return data.file;
|
|
160
|
-
} catch (error) {
|
|
161
|
-
console.error("Error uploading file:", error);
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
var openFilePicker = async (options) => {
|
|
166
|
-
const win = window;
|
|
167
|
-
if (!win.showOpenFilePicker) {
|
|
168
|
-
console.error("File Picker API is not supported in this browser.");
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
try {
|
|
172
|
-
const fileHandles = await win.showOpenFilePicker(options);
|
|
173
|
-
const fileHandle = fileHandles[0];
|
|
174
|
-
const file = await fileHandle.getFile();
|
|
175
|
-
const uploadedFile = await uploadFile(file);
|
|
176
|
-
if (!uploadedFile) {
|
|
177
|
-
console.error("Failed to upload file.");
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
id: uploadedFile.id,
|
|
182
|
-
name: uploadedFile.displayName,
|
|
183
|
-
url: uploadedFile.url
|
|
184
|
-
};
|
|
185
|
-
} catch (error) {
|
|
186
|
-
console.error("Error opening file picker:", error);
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
// src/components/SiteChatComponent/Footer/message-input/message-input.tsx
|
|
192
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
193
|
-
var MessageInput = ({
|
|
194
|
-
placeholder = "Type a message...",
|
|
195
|
-
disabled = false,
|
|
196
|
-
className = "",
|
|
197
|
-
suffix,
|
|
198
|
-
value = "",
|
|
199
|
-
onChange,
|
|
200
|
-
onKeyDown,
|
|
201
|
-
onAttachmentAdded
|
|
202
|
-
}) => {
|
|
203
|
-
const handleAttachmentOnClick = async () => {
|
|
204
|
-
try {
|
|
205
|
-
await openFilePicker({ multiple: false }).then((file) => {
|
|
206
|
-
if (file && onAttachmentAdded) {
|
|
207
|
-
onAttachmentAdded(file);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
} catch (error) {
|
|
211
|
-
console.error("Error opening file picker:", error);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `site-chat-component-footer-input-wrapper ${className}`, children: [
|
|
215
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
216
|
-
"input",
|
|
217
|
-
{
|
|
218
|
-
name: "messageInput",
|
|
219
|
-
className: "site-chat-component-footer-chat-input",
|
|
220
|
-
placeholder,
|
|
221
|
-
disabled,
|
|
222
|
-
value,
|
|
223
|
-
onChange,
|
|
224
|
-
onKeyDown
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("sub", { className: "site-chat-component-footer-suffix", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.IconButton, { onClick: handleAttachmentOnClick, className: "attachment-icon-button", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_wix_ui_icons_common3.AttachmentSmall, {}) }) })
|
|
228
|
-
] });
|
|
229
|
-
};
|
|
230
|
-
var message_input_default = MessageInput;
|
|
231
|
-
|
|
232
|
-
// src/components/SiteChatComponent/Footer/Footer.tsx
|
|
233
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
234
|
-
var Footer = import_react3.default.forwardRef(
|
|
235
|
-
({
|
|
236
|
-
className,
|
|
237
|
-
children,
|
|
238
|
-
sendButtonConfig,
|
|
239
|
-
attachmentListConfig,
|
|
240
|
-
messageInputConfig,
|
|
241
|
-
onAttachmentAdded,
|
|
242
|
-
...rest
|
|
243
|
-
}, ref) => {
|
|
244
|
-
const handleSendMessage = (text, messageType, attachment) => {
|
|
245
|
-
if (sendButtonConfig == null ? void 0 : sendButtonConfig.onClick) {
|
|
246
|
-
sendButtonConfig.onClick(text, messageType, attachment);
|
|
247
|
-
} else {
|
|
248
|
-
console.warn("handleSendMessage function is not provided in sendButtonConfig");
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system4.Box, { ref, className: "site-chat-component-footer-message-input-container", direction: "vertical", gap: 1, verticalAlign: "middle", children: [
|
|
252
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.Box, { width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(attachment_list_default, { items: (attachmentListConfig == null ? void 0 : attachmentListConfig.items) || [], onRemove: attachmentListConfig == null ? void 0 : attachmentListConfig.onRemove, onClick: attachmentListConfig == null ? void 0 : attachmentListConfig.onClick, onFilesSent: attachmentListConfig == null ? void 0 : attachmentListConfig.onFilesSent }) }),
|
|
253
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system4.Box, { alignContent: "bottom", width: "100%", direction: "horizontal", gap: 2, verticalAlign: "middle", children: [
|
|
254
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
255
|
-
message_input_default,
|
|
256
|
-
{
|
|
257
|
-
placeholder: (messageInputConfig == null ? void 0 : messageInputConfig.placeholder) || "Type your message here...",
|
|
258
|
-
className: (messageInputConfig == null ? void 0 : messageInputConfig.className) || "message-input",
|
|
259
|
-
value: (messageInputConfig == null ? void 0 : messageInputConfig.value) || "",
|
|
260
|
-
onChange: messageInputConfig == null ? void 0 : messageInputConfig.onChange,
|
|
261
|
-
onKeyDown: messageInputConfig == null ? void 0 : messageInputConfig.onKeyDown,
|
|
262
|
-
disabled: messageInputConfig == null ? void 0 : messageInputConfig.disabled,
|
|
263
|
-
onAttachmentAdded
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
267
|
-
send_button_default,
|
|
268
|
-
{
|
|
269
|
-
onClick: () => handleSendMessage((messageInputConfig == null ? void 0 : messageInputConfig.value) || "", (attachmentListConfig == null ? void 0 : attachmentListConfig.items) ? "ATTACHMENT" : "TEXT"),
|
|
270
|
-
disabled: sendButtonConfig == null ? void 0 : sendButtonConfig.disabled,
|
|
271
|
-
text: (sendButtonConfig == null ? void 0 : sendButtonConfig.buttonText) || "Send"
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
] })
|
|
275
|
-
] });
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
Footer.displayName = "SiteChatComponent.Footer";
|
|
279
|
-
|
|
280
|
-
// src/components/SiteChatComponent/Header/Header.tsx
|
|
281
|
-
var import_react4 = __toESM(require("react"));
|
|
282
|
-
var import_design_system5 = require("@wix/design-system");
|
|
283
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
284
|
-
var Header = import_react4.default.forwardRef(
|
|
285
|
-
({
|
|
286
|
-
className,
|
|
287
|
-
children,
|
|
288
|
-
title,
|
|
289
|
-
subtitle,
|
|
290
|
-
image,
|
|
291
|
-
onClose,
|
|
292
|
-
...rest
|
|
293
|
-
}, ref) => {
|
|
294
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system5.Box, { ref, className: "site-chat-component-header-container", verticalAlign: "middle", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system5.Box, { width: "100%", direction: "horizontal", align: "center", gap: "10px", children: [
|
|
295
|
-
image && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system5.Box, { className: "site-chat-component-header-image", width: "60px", height: "50px", borderRadius: "999px", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { style: { borderRadius: "999px" }, width: "100%", height: "100%", src: String(image), alt: "Business Logo" }) }),
|
|
296
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system5.Box, { direction: "vertical", className: "site-chat-component-header-text-section", children: [
|
|
297
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system5.Box, { className: "site-chat-component-header-top-section", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system5.Box, { className: "site-chat-component-header-top", verticalAlign: "middle", WebkitJustifyContent: "space-between", width: "100%", children: [
|
|
298
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { className: "site-chat-component-header-title", children: title }),
|
|
299
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
300
|
-
"button",
|
|
301
|
-
{
|
|
302
|
-
onClick: onClose,
|
|
303
|
-
"aria-label": "Close",
|
|
304
|
-
className: "site-chat-component-header-close-button",
|
|
305
|
-
children: "\u2715"
|
|
306
|
-
}
|
|
307
|
-
)
|
|
308
|
-
] }) }),
|
|
309
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system5.Box, { className: "site-chat-component-header-bottom-section", children: subtitle && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "site-chat-component-header-subtitle", children: subtitle }) })
|
|
310
|
-
] })
|
|
311
|
-
] }) });
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
Header.displayName = "SiteChatComponent.Header";
|
|
315
|
-
|
|
316
|
-
// src/components/SiteChatComponent/MessageContainer/MessageContainer.tsx
|
|
317
|
-
var import_react6 = __toESM(require("react"));
|
|
318
|
-
var import_design_system8 = require("@wix/design-system");
|
|
319
|
-
|
|
320
|
-
// src/components/SiteChatComponent/MessageContainer/messages/messages-wrapper.tsx
|
|
321
|
-
var import_react5 = require("react");
|
|
322
|
-
var import_design_system7 = require("@wix/design-system");
|
|
323
|
-
|
|
324
|
-
// src/components/SiteChatComponent/MessageContainer/messages/attachment.tsx
|
|
325
|
-
var import_design_system6 = require("@wix/design-system");
|
|
326
|
-
var import_wix_ui_icons_common4 = require("@wix/wix-ui-icons-common");
|
|
327
|
-
var import_on_stage = require("@wix/wix-ui-icons-common/on-stage");
|
|
328
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
329
|
-
var Attachment = ({ item }) => {
|
|
330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system6.Box, { direction: "horizontal", maxWidth: "100%", boxSizing: "border-box", className: "site-chat-component-message-container-in-chat-file-item-wrapper-box", children: item && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "site-chat-component-message-container-in-chat-file-item-container", children: [
|
|
331
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_wix_ui_icons_common4.Page, { className: "site-chat-component-message-container-in-chat-file-icon", width: "20px", height: "20px" }),
|
|
332
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "site-chat-component-message-container-in-chat-file-names-container", children: [
|
|
333
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "site-chat-component-message-container-in-chat-file-name", children: item.name }),
|
|
334
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "site-chat-component-message-container-in-chat-file-sub-name", children: "Attachment" })
|
|
335
|
-
] }),
|
|
336
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system6.TextButton, { size: "tiny", onClick: () => window.open(item.url, "_blank"), suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_on_stage.ArrowTopRight, { size: "tiny" }), children: "Open" })
|
|
337
|
-
] }, item.id) });
|
|
338
|
-
};
|
|
339
|
-
var attachment_default = Attachment;
|
|
340
|
-
|
|
341
|
-
// src/components/SiteChatComponent/MessageContainer/messages/messages-wrapper.tsx
|
|
342
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
343
|
-
var AGENT_MESSAGE_GAP = "10px";
|
|
344
|
-
var AGENT_MESSAGE_WIDTH = "75%";
|
|
345
|
-
var AGENT_MESSAGE_INNER_GAP = "4px";
|
|
346
|
-
var ONE_MINUTE_MS = 6e4;
|
|
347
|
-
var ONE_DAY_MS = 864e5;
|
|
348
|
-
var DAYS_IN_WEEK = 7;
|
|
349
|
-
var formatTimestamp = (timestamp) => {
|
|
350
|
-
if (!timestamp) return "";
|
|
351
|
-
const date = new Date(timestamp);
|
|
352
|
-
const now = /* @__PURE__ */ new Date();
|
|
353
|
-
if (now.getTime() - date.getTime() < ONE_MINUTE_MS) return "Just now";
|
|
354
|
-
const time = date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
355
|
-
const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
356
|
-
const startOfDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
357
|
-
const diffDays = Math.floor((startOfToday.getTime() - startOfDay.getTime()) / ONE_DAY_MS);
|
|
358
|
-
if (diffDays === 0) return `Today at ${time}`;
|
|
359
|
-
if (diffDays === 1) return `Yesterday at ${time}`;
|
|
360
|
-
if (diffDays < DAYS_IN_WEEK && date.getDay() < now.getDay())
|
|
361
|
-
return `${date.toLocaleDateString([], { weekday: "short" })} at ${time}`;
|
|
362
|
-
return `${date.toLocaleDateString([], { month: "short", day: "numeric", year: "numeric" })} at ${time}`;
|
|
363
|
-
};
|
|
364
|
-
var MessagesWrapper = ({ messages = [] }) => {
|
|
365
|
-
const wrapperRef = (0, import_react5.useRef)(null);
|
|
366
|
-
(0, import_react5.useEffect)(() => {
|
|
367
|
-
if (wrapperRef.current) {
|
|
368
|
-
wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight;
|
|
369
|
-
}
|
|
370
|
-
}, [messages]);
|
|
371
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-messages-wrapper", ref: wrapperRef, children: messages.map(({ _id, message, attachment, timestamp, senderType, senderName }, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `message-item ${senderType}`, children: senderType === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AgentMessageWrapper, { message, attachment: attachment ? Array.isArray(attachment) ? attachment[0] : attachment : void 0, timestamp, agentName: senderName }) : senderType === "user" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UserMessageWrapper, { message, attachment: attachment ? Array.isArray(attachment) ? attachment[0] : attachment : void 0, timestamp }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SystemMessageWrapper, { message, timestamp }) }, _id || index)) });
|
|
372
|
-
};
|
|
373
|
-
var GetSystemMessage = ({ type }) => {
|
|
374
|
-
switch (type) {
|
|
375
|
-
case "AGENT_JOINED":
|
|
376
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "An agent has joined the chat." });
|
|
377
|
-
case "AGENT_LEFT":
|
|
378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "An agent has left the chat." });
|
|
379
|
-
case "USER_JOINED":
|
|
380
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "A user has joined the chat." });
|
|
381
|
-
case "USER_LEFT":
|
|
382
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "A user has left the chat." });
|
|
383
|
-
case "CHAT_ENDED":
|
|
384
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "The chat has ended." });
|
|
385
|
-
case "CHAT_REOPENED":
|
|
386
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "The chat has been reopened." });
|
|
387
|
-
case "CHAT_TRANSFERRED":
|
|
388
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "The chat has been transferred to another agent." });
|
|
389
|
-
case "WAITING_FOR_AGENT":
|
|
390
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "Waiting for an agent to join the chat..." });
|
|
391
|
-
default:
|
|
392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-message", children: "System message" });
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
var SystemMessageWrapper = ({ message, timestamp }) => {
|
|
396
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-system-message-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "site-chat-component-message-container-system-message", children: [
|
|
397
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", { className: "dashed" }),
|
|
398
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GetSystemMessage, { type: message }),
|
|
399
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", { className: "dashed" })
|
|
400
|
-
] }) });
|
|
401
|
-
};
|
|
402
|
-
var AgentMessageWrapper = ({ message, attachment, timestamp, agentName }) => {
|
|
403
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: AGENT_MESSAGE_GAP }, children: [
|
|
404
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system7.Avatar, { size: "size24", className: "site-chat-component-message-container-agent-message-avatar", name: agentName }),
|
|
405
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { width: AGENT_MESSAGE_WIDTH, gap: AGENT_MESSAGE_INNER_GAP, display: "flex", flexDirection: "column" }, children: [
|
|
406
|
-
agentName && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "site-chat-component-message-container-agent-name-time-container", children: [
|
|
407
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-agent-name", children: agentName }),
|
|
408
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-agent-message-timestamp", children: formatTimestamp(timestamp) })
|
|
409
|
-
] }),
|
|
410
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `site-chat-component-message-container-agent-message-wrapper${attachment ? "-attachment" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "site-chat-component-message-container-agent-message", children: [
|
|
411
|
-
message && message,
|
|
412
|
-
attachment && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(attachment_default, { item: attachment })
|
|
413
|
-
] }) })
|
|
414
|
-
] })
|
|
415
|
-
] });
|
|
416
|
-
};
|
|
417
|
-
var UserMessageWrapper = ({ message, attachment, timestamp }) => {
|
|
418
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "4px" }, children: [
|
|
419
|
-
!attachment && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "site-chat-component-message-container-user-name", children: "Me" }),
|
|
420
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `site-chat-component-message-container-user-message-wrapper${attachment ? "-attachment" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "site-chat-component-message-container-user-message", children: [
|
|
421
|
-
message && message,
|
|
422
|
-
attachment && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(attachment_default, { item: attachment })
|
|
423
|
-
] }) })
|
|
424
|
-
] });
|
|
425
|
-
};
|
|
426
|
-
var messages_wrapper_default = MessagesWrapper;
|
|
427
|
-
|
|
428
|
-
// src/components/SiteChatComponent/MessageContainer/MessageContainer.tsx
|
|
429
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
430
|
-
var MessageContainer = import_react6.default.forwardRef(
|
|
431
|
-
({
|
|
432
|
-
className,
|
|
433
|
-
children,
|
|
434
|
-
messages,
|
|
435
|
-
loading,
|
|
436
|
-
...rest
|
|
437
|
-
}, ref) => {
|
|
438
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_design_system8.Box, { ref, className: "site-chat-component-message-container", children: [
|
|
439
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system8.Box, { className: "site-chat-component-message-container-loading-state", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Loading messages..." }) }),
|
|
440
|
-
messages.length === 0 && !loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system8.Box, { className: "site-chat-component-message-container-empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "No messages yet. Start a conversation" }) }),
|
|
441
|
-
messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(messages_wrapper_default, { messages })
|
|
442
|
-
] });
|
|
443
|
-
}
|
|
444
|
-
);
|
|
445
|
-
MessageContainer.displayName = "SiteChatComponent.MessageContainer";
|
|
446
|
-
|
|
447
|
-
// src/components/SiteChatComponent/SiteChatComponent.css
|
|
448
|
-
if (typeof document !== "undefined" && !document.getElementById("jrapps-style-3c48ccde")) {
|
|
449
|
-
const s = document.createElement("style");
|
|
450
|
-
s.id = "jrapps-style-3c48ccde";
|
|
451
|
-
s.textContent = `.site-chat-component {
|
|
452
|
-
/* SiteChatComponent base styles */
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/* ---------- Header styles ---------- */
|
|
456
|
-
|
|
457
|
-
.site-chat-component-header-container {
|
|
458
|
-
background: var(--my-tickets-chat-widget-panel-header-background-color);
|
|
459
|
-
padding: 10px;
|
|
460
|
-
border-top-right-radius: inherit;
|
|
461
|
-
border-top-left-radius: inherit;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.site-chat-component-header-container .site-chat-component-header-text-section {
|
|
465
|
-
width: 100%;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
.site-chat-component-header-title {
|
|
469
|
-
font-style: var(--my-tickets-chat-widget-panel-header-title-font-style);
|
|
470
|
-
margin-bottom: 0 !important;
|
|
471
|
-
color: var(--my-tickets-chat-widget-panel-header-title-color);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.site-chat-component-header-subtitle {
|
|
475
|
-
font-style: var(--my-tickets-chat-widget-panel-header-subtitle-font-style);
|
|
476
|
-
font-weight: normal !important;
|
|
477
|
-
margin-top: 0 !important;
|
|
478
|
-
color: var(--my-tickets-chat-widget-panel-header-subtitle-color);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.site-chat-component-header-close-button {
|
|
482
|
-
cursor: pointer !important;
|
|
483
|
-
background: none;
|
|
484
|
-
border: none;
|
|
485
|
-
padding: 4px;
|
|
486
|
-
color: var(--my-tickets-chat-widget-panel-header-button-color);
|
|
487
|
-
font-size: 1.25rem;
|
|
488
|
-
line-height: 1;
|
|
489
|
-
border-radius: 4px;
|
|
490
|
-
transition: opacity 0.15s;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.site-chat-component-header-close-button:hover {
|
|
494
|
-
opacity: 0.8;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
/* ---------- Footer styles ---------- */
|
|
498
|
-
|
|
499
|
-
.site-chat-component-footer-message-input-container {
|
|
500
|
-
padding: var(--cw-space-md, 16px);
|
|
501
|
-
background: var(--my-tickets-chat-widget-panel-footer-background-color);
|
|
502
|
-
font-family: var(--cw-font, sans-serif);
|
|
503
|
-
border-radius: 0 0 var(--cw-radius-panel, 16px) var(--cw-radius-panel, 16px);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.site-chat-component-footer-attachment-icon-button {
|
|
507
|
-
width: 20px;
|
|
508
|
-
height: 20px;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.site-chat-component-footer-my-tickets-chat-widget-send-button {
|
|
512
|
-
background: var(--my-tickets-chat-widget-panel-footer-button-color);
|
|
513
|
-
border: 1px solid var(--my-tickets-chat-widget-panel-footer-button-border-color);
|
|
514
|
-
color: var(--my-tickets-chat-widget-panel-footer-button-text-color);
|
|
515
|
-
padding: 6px;
|
|
516
|
-
border-radius: 4px;
|
|
517
|
-
width: 80px;
|
|
518
|
-
cursor: pointer;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
.site-chat-component-footer-my-tickets-chat-widget-send-button:disabled {
|
|
522
|
-
opacity: 0.5;
|
|
523
|
-
cursor: default;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
.site-chat-component-footer-file-item-container {
|
|
527
|
-
display: flex;
|
|
528
|
-
align-items: center;
|
|
529
|
-
gap: 8px;
|
|
530
|
-
padding: 2px 4px;
|
|
531
|
-
border-radius: var(--wds-input-area-border-radius-default-medium, 6px);
|
|
532
|
-
background-color: var(--wds-color-surface, var(--wsr-color-surface, #FFFFFF));
|
|
533
|
-
border: 1px solid var(--wds-input-border-color, var(--wsr-color-B40, #D6E6FE));
|
|
534
|
-
box-sizing: border-box;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.site-chat-component-footer-file-name {
|
|
538
|
-
font-family: var(--wds-font-family-default, var(--wsr-font-family, Madefor, "Helvetica Neue", Helvetica, Arial, "\\30E1\\30A4\\30EA\\30AA", "meiryo", "\\30D2\\30E9\\30AE\\30CE\\89D2\\30B4 pro w3", "hiragino kaku gothic pro", sans-serif));
|
|
539
|
-
font-size: var(--wds-font-size-body-small, var(--wsr-text-font-size-small, 14px));
|
|
540
|
-
font-weight: var(--wds-font-weight-regular, var(--wsr-font-weight-regular, 400));
|
|
541
|
-
line-height: var(--wds-font-line-height-body-small, var(--wsr-text-line-height-small, 20px));
|
|
542
|
-
letter-spacing: var(--wds-font-letter-spacing-0, unset);
|
|
543
|
-
white-space: nowrap;
|
|
544
|
-
overflow: hidden;
|
|
545
|
-
text-overflow: ellipsis;
|
|
546
|
-
max-width: 115px;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.site-chat-component-footer-input-wrapper {
|
|
550
|
-
padding: 5px;
|
|
551
|
-
box-sizing: border-box;
|
|
552
|
-
width: inherit;
|
|
553
|
-
display: flex;
|
|
554
|
-
justify-content: center;
|
|
555
|
-
flex-direction: row;
|
|
556
|
-
gap: 10px;
|
|
557
|
-
border-radius: 4px;
|
|
558
|
-
background: var(--my-tickets-chat-widget-panel-footer-input-background-color);
|
|
559
|
-
border: 2px solid var(--my-tickets-chat-widget-panel-footer-input-border-color);
|
|
560
|
-
color: var(--my-tickets-chat-widget-panel-footer-input-text-color);
|
|
561
|
-
font-size: var(--my-tickets-chat-widget-panel-footer-input-text-size);
|
|
562
|
-
font-family: 'Arial', sans-serif;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.site-chat-component-footer-suffix {
|
|
566
|
-
background: inherit;
|
|
567
|
-
width: max-content;
|
|
568
|
-
min-height: 100%;
|
|
569
|
-
max-height: 100%;
|
|
570
|
-
align-items: center;
|
|
571
|
-
justify-content: center;
|
|
572
|
-
display: flex;
|
|
573
|
-
font-size: inherit;
|
|
574
|
-
padding: 0px;
|
|
575
|
-
margin: 0px;
|
|
576
|
-
font-family: inherit;
|
|
577
|
-
color: inherit;
|
|
578
|
-
box-sizing: border-box;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.site-chat-component-footer-chat-input {
|
|
582
|
-
background: inherit;
|
|
583
|
-
border: none;
|
|
584
|
-
font-size: inherit;
|
|
585
|
-
font-family: inherit;
|
|
586
|
-
color: inherit;
|
|
587
|
-
width: inherit;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.site-chat-component-footer-chat-input::placeholder {
|
|
591
|
-
background: inherit;
|
|
592
|
-
border: none;
|
|
593
|
-
font-size: inherit;
|
|
594
|
-
font-family: inherit;
|
|
595
|
-
color: inherit;
|
|
596
|
-
opacity: 0.5;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.site-chat-component-footer-chat-input:focus {
|
|
600
|
-
outline: none;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
/* ---------- Messages styles ---------- */
|
|
604
|
-
/* Message Container */
|
|
605
|
-
.site-chat-component-message-container {
|
|
606
|
-
display: flex !important;
|
|
607
|
-
flex-direction: column !important;
|
|
608
|
-
padding: var(--cw-space-md, 16px) !important;
|
|
609
|
-
background: var(--my-tickets-chat-widget-panel-messages-background-color) !important;
|
|
610
|
-
flex: 1 !important;
|
|
611
|
-
min-height: 0;
|
|
612
|
-
overflow-y: auto !important;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
.site-chat-component-message-container-messages-wrapper {
|
|
616
|
-
display: flex;
|
|
617
|
-
flex-direction: column;
|
|
618
|
-
gap: var(--cw-space-sm, 8px);
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
.site-chat-component-message-container-agent-message-wrapper,
|
|
622
|
-
.site-chat-component-message-container-user-message-wrapper {
|
|
623
|
-
display: flex;
|
|
624
|
-
padding: 10px 14px;
|
|
625
|
-
border-radius: var(--cw-radius-bubble, 12px);
|
|
626
|
-
width: max-content;
|
|
627
|
-
max-width: 80%;
|
|
628
|
-
font-family: var(--cw-font, sans-serif);
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.site-chat-component-message-container-agent-name {
|
|
632
|
-
color: var(--my-tickets-chat-widget-panel-messages-agent-name-text-color);
|
|
633
|
-
font-size: var(--my-tickets-chat-widget-panel-messages-agent-name-text-size);
|
|
634
|
-
font-weight: 500;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
.site-chat-component-message-container-user-name {
|
|
638
|
-
color: var(--my-tickets-chat-widget-panel-messages-user-name-text-color);
|
|
639
|
-
font-size: var(--my-tickets-chat-widget-panel-messages-user-name-text-size);
|
|
640
|
-
font-weight: 500;
|
|
641
|
-
display: var(--my-tickets-chat-widget-panel-messages-user-name-text-visible);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
.site-chat-component-message-container-agent-message-avatar {
|
|
645
|
-
margin-top: 20px;
|
|
646
|
-
display: var(--my-tickets-chat-widget-panel-messages-agent-icon-visible);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.site-chat-component-message-container-user-message,
|
|
650
|
-
.site-chat-component-message-container-agent-message {
|
|
651
|
-
line-height: 1.5;
|
|
652
|
-
word-wrap: break-word;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
.site-chat-component-message-container-agent-message {
|
|
656
|
-
font-size: var(--my-tickets-chat-widget-panel-messages-agent-text-size);
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
.site-chat-component-message-container-user-message {
|
|
660
|
-
font-size: var(--my-tickets-chat-widget-panel-messages-user-text-size);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
.site-chat-component-message-container-agent-message-wrapper {
|
|
664
|
-
justify-content: flex-start;
|
|
665
|
-
align-self: flex-start;
|
|
666
|
-
background-color: var(--my-tickets-chat-widget-panel-messages-agent-bubble-color);
|
|
667
|
-
color: var(--my-tickets-chat-widget-panel-messages-agent-text-color);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.site-chat-component-message-container-user-message-wrapper {
|
|
671
|
-
justify-content: flex-end;
|
|
672
|
-
align-self: flex-end;
|
|
673
|
-
margin-left: auto;
|
|
674
|
-
background-color: var(--my-tickets-chat-widget-panel-messages-user-bubble-color);
|
|
675
|
-
color: var(--my-tickets-chat-widget-panel-messages-user-text-color);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.site-chat-component-message-container-agent-name-time-container {
|
|
679
|
-
gap: 8px;
|
|
680
|
-
display: flex;
|
|
681
|
-
align-items: center;
|
|
682
|
-
font-family: 'Madefor';
|
|
683
|
-
font-size: 13px;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/* System Messages */
|
|
687
|
-
|
|
688
|
-
.site-chat-component-message-container-system-message {
|
|
689
|
-
display: flex;
|
|
690
|
-
justify-content: center;
|
|
691
|
-
align-items: center;
|
|
692
|
-
width: 100%;
|
|
693
|
-
gap: var(--cw-space-sm, 8px);
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
.site-chat-component-message-container-system-message .dashed {
|
|
697
|
-
flex: 1;
|
|
698
|
-
border: none;
|
|
699
|
-
border-top: 1px dashed var(--my-tickets-chat-widget-panel-messages-system-color);
|
|
700
|
-
margin: 0;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
.site-chat-component-message-container-system-message-message {
|
|
704
|
-
color: var(--my-tickets-chat-widget-panel-messages-system-color);
|
|
705
|
-
font-family: var(--cw-font, sans-serif);
|
|
706
|
-
font-size: var(--my-tickets-chat-widget-panel-messages-system-size);
|
|
707
|
-
font-weight: 500;
|
|
708
|
-
white-space: nowrap;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
/* Empty and Loading States */
|
|
712
|
-
|
|
713
|
-
.site-chat-component-message-container-empty-state {
|
|
714
|
-
display: flex;
|
|
715
|
-
flex: 1;
|
|
716
|
-
align-items: center;
|
|
717
|
-
justify-content: center;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
.site-chat-component-message-container-empty-state p {
|
|
721
|
-
font-family: var(--cw-font, sans-serif);
|
|
722
|
-
font-size: 14px;
|
|
723
|
-
color: var(--my-tickets-chat-widget-panel-messages-system-color);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
.site-chat-component-message-container-loading-state {
|
|
727
|
-
display: flex;
|
|
728
|
-
flex: 1;
|
|
729
|
-
align-items: center;
|
|
730
|
-
justify-content: center;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
.site-chat-component-message-container-loading-state p {
|
|
734
|
-
font-family: var(--cw-font, sans-serif);
|
|
735
|
-
font-size: 14px;
|
|
736
|
-
color: var(--my-tickets-chat-widget-panel-messages-system-color);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
.site-chat-component-message-container-in-chat-file-item-container {
|
|
740
|
-
display: flex;
|
|
741
|
-
align-items: center;
|
|
742
|
-
gap: 8px;
|
|
743
|
-
padding: 4px 8px;
|
|
744
|
-
border-radius: var(--wds-input-area-border-radius-default-medium, 6px);
|
|
745
|
-
background-color: var(--wds-color-surface, var(--wsr-color-surface, #FFFFFF));
|
|
746
|
-
border: 1px solid var(--wds-input-border-color, var(--wsr-color-B40, #D6E6FE));
|
|
747
|
-
box-sizing: border-box;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
.site-chat-component-message-container-in-chat-file-name {
|
|
751
|
-
font-family: var(--wds-font-family-default, var(--wsr-font-family, Madefor, "Helvetica Neue", Helvetica, Arial, "\\30E1\\30A4\\30EA\\30AA", "meiryo", "\\30D2\\30E9\\30AE\\30CE\\89D2\\30B4 pro w3", "hiragino kaku gothic pro", sans-serif));
|
|
752
|
-
font-size: var(--wds-font-size-body-tiny, var(--wsr-text-font-size-tiny, 10px));
|
|
753
|
-
font-weight: var(--wds-font-weight-regular, var(--wsr-font-weight-regular, 400));
|
|
754
|
-
line-height: var(--wds-font-line-height-body-tiny, var(--wsr-text-line-height-tiny, 12px));
|
|
755
|
-
letter-spacing: var(--wds-font-letter-spacing-0, unset);
|
|
756
|
-
white-space: nowrap;
|
|
757
|
-
overflow: hidden;
|
|
758
|
-
text-overflow: ellipsis;
|
|
759
|
-
max-width: 150px;
|
|
760
|
-
color: black;
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
.site-chat-component-message-container-in-chat-file-sub-name {
|
|
764
|
-
font-family: var(--wds-font-family-default, var(--wsr-font-family, Madefor, "Helvetica Neue", Helvetica, Arial, "\\30E1\\30A4\\30EA\\30AA", "meiryo", "\\30D2\\30E9\\30AE\\30CE\\89D2\\30B4 pro w3", "hiragino kaku gothic pro", sans-serif));
|
|
765
|
-
font-size: var(--wds-font-size-body-tiny, var(--wsr-text-font-size-tiny, 10px));
|
|
766
|
-
font-weight: var(--wds-font-weight-regular, var(--wsr-font-weight-regular, 400));
|
|
767
|
-
line-height: var(--wds-font-line-height-body-tiny, var(--wsr-text-line-height-tiny, 12px));
|
|
768
|
-
letter-spacing: var(--wds-font-letter-spacing-0, unset);
|
|
769
|
-
color: var(--wds-color-text-secondary, var(--wsr-color-text-secondary, #6B6B6B));
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.site-chat-component-message-container-in-chat-file-icon {
|
|
773
|
-
fill: black !important;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.site-chat-component-message-container-in-chat-file-names-container {
|
|
777
|
-
display: flex;
|
|
778
|
-
flex-direction: column;
|
|
779
|
-
gap: 0px;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
.site-chat-component-message-container-user-message-wrapper-attachment .site-chat-component-message-container-in-chat-file-item-wrapper-box {
|
|
783
|
-
align-items: flex-end;
|
|
784
|
-
display: flex;
|
|
785
|
-
flex-direction: column;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
.site-chat-component-message-container-agent-message-wrapper-attachment .site-chat-component-message-container-in-chat-file-item-wrapper-box {
|
|
789
|
-
align-items: flex-start;
|
|
790
|
-
display: flex;
|
|
791
|
-
flex-direction: column;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
/* FAB */
|
|
795
|
-
.site-chat-component-fab {
|
|
796
|
-
position: fixed;
|
|
797
|
-
bottom: 24px;
|
|
798
|
-
right: 24px;
|
|
799
|
-
gap: 4.5px;
|
|
800
|
-
cursor: pointer;
|
|
801
|
-
z-index: 100;
|
|
802
|
-
user-select: none;
|
|
803
|
-
border-radius: 99px;
|
|
804
|
-
padding: 9px 25px;
|
|
805
|
-
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
|
|
806
|
-
display: flex;
|
|
807
|
-
justify-content: center;
|
|
808
|
-
align-items: center;
|
|
809
|
-
flex-direction: row;
|
|
810
|
-
|
|
811
|
-
font-size: var(--my-tickets-chat-widget-button-text-size) !important;
|
|
812
|
-
background-color: var(--my-tickets-chat-widget-button-color);
|
|
813
|
-
border: 1px solid var(--my-tickets-chat-widget-button-border-color);
|
|
814
|
-
color: var(--my-tickets-chat-widget-button-text-color);
|
|
815
|
-
font: var(--my-tickets-chat-widget-button-text-font);
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
.site-chat-component-fab-fab-button-label {
|
|
819
|
-
margin: 0;
|
|
820
|
-
padding: 0;
|
|
821
|
-
line-height: 1;
|
|
822
|
-
display: inline-flex;
|
|
823
|
-
align-items: center;
|
|
824
|
-
margin-top: 2px;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
.site-chat-component-fab-fab-button-icon,
|
|
828
|
-
.site-chat-component-fab-fab-button-text {
|
|
829
|
-
display: inline-flex;
|
|
830
|
-
align-items: center;
|
|
831
|
-
height: 100%;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
.site-chat-component-fab-fab-button-icon svg {
|
|
835
|
-
width: var(--my-tickets-chat-widget-button-icon-size);
|
|
836
|
-
height: var(--my-tickets-chat-widget-button-icon-size);
|
|
837
|
-
font-weight: inherit;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
/* \u2500\u2500 Design Tokens \u2500\u2500 */
|
|
841
|
-
:host {
|
|
842
|
-
--cw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
843
|
-
|
|
844
|
-
/* Primary palette */
|
|
845
|
-
--cw-primary: #3B82F6;
|
|
846
|
-
--cw-primary-hover: #2563EB;
|
|
847
|
-
--cw-primary-light: #EFF6FF;
|
|
848
|
-
--cw-primary-shadow: rgba(59, 130, 246, 0.35);
|
|
849
|
-
--cw-primary-shadow-hover: rgba(59, 130, 246, 0.5);
|
|
850
|
-
|
|
851
|
-
/* Neutrals */
|
|
852
|
-
--cw-bg: #F8FAFC;
|
|
853
|
-
--cw-surface: #FFFFFF;
|
|
854
|
-
--cw-border: #E2E8F0;
|
|
855
|
-
|
|
856
|
-
/* Text */
|
|
857
|
-
--cw-text: #1E293B;
|
|
858
|
-
--cw-text-muted: #64748B;
|
|
859
|
-
--cw-text-inverse: #FFFFFF;
|
|
860
|
-
|
|
861
|
-
/* Message bubbles */
|
|
862
|
-
--cw-bubble-user: var(--cw-primary);
|
|
863
|
-
--cw-bubble-user-text: var(--cw-text-inverse);
|
|
864
|
-
--cw-bubble-agent: #F1F5F9;
|
|
865
|
-
--cw-bubble-agent-text: var(--cw-text);
|
|
866
|
-
|
|
867
|
-
/* Radii */
|
|
868
|
-
--cw-radius-panel: 16px;
|
|
869
|
-
--cw-radius-bubble: 12px;
|
|
870
|
-
--cw-radius-pill: 50px;
|
|
871
|
-
|
|
872
|
-
/* Spacing */
|
|
873
|
-
--cw-space-xs: 4px;
|
|
874
|
-
--cw-space-sm: 8px;
|
|
875
|
-
--cw-space-md: 16px;
|
|
876
|
-
--cw-space-lg: 24px;
|
|
877
|
-
|
|
878
|
-
/* Shadows */
|
|
879
|
-
--cw-shadow-panel: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.05);
|
|
880
|
-
--cw-shadow-fab: 0 8px 24px var(--cw-primary-shadow);
|
|
881
|
-
--cw-shadow-fab-hover: 0 12px 32px var(--cw-primary-shadow-hover);
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
/* \u2500\u2500 Hide toggle \u2500\u2500 */
|
|
885
|
-
#site-chat-component-chat-toggle {
|
|
886
|
-
display: none;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
/* \u2500\u2500 Panel \u2500\u2500 */
|
|
890
|
-
.site-chat-component-panel {
|
|
891
|
-
position: fixed !important;
|
|
892
|
-
bottom: 60px;
|
|
893
|
-
right: 30px;
|
|
894
|
-
width: min(340px, 100vw);
|
|
895
|
-
max-height: 50vh;
|
|
896
|
-
max-height: 50dvh;
|
|
897
|
-
background: var(--cw-surface);
|
|
898
|
-
border-radius: var(--cw-radius-panel, 16px) !important;
|
|
899
|
-
box-shadow: var(--cw-shadow-panel);
|
|
900
|
-
transform: scale(0.85) translateY(16px);
|
|
901
|
-
transform-origin: bottom right;
|
|
902
|
-
opacity: 0;
|
|
903
|
-
pointer-events: none;
|
|
904
|
-
transition: transform 0.3s cubic-bezier(.175, .885, .32, 1.275), opacity 0.25s ease;
|
|
905
|
-
z-index: 99;
|
|
906
|
-
display: flex !important;
|
|
907
|
-
flex-direction: column !important;
|
|
908
|
-
min-height: 450px;
|
|
909
|
-
font-family: var(--cw-font);
|
|
910
|
-
overflow: hidden;
|
|
911
|
-
border: 0px solid var(--wst-color-line);
|
|
912
|
-
box-shadow: 0 2px 6px var(--wst-color-line), 0 0 0 1px var(--wst-color-line);
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
.site-chat-component-panel.open {
|
|
916
|
-
transform: scale(1) translateY(0);
|
|
917
|
-
opacity: 1;
|
|
918
|
-
pointer-events: all;
|
|
919
|
-
z-index: 101;
|
|
920
|
-
bottom: 10px;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
/* \u2500\u2500 Mobile: fill screen \u2500\u2500 */
|
|
924
|
-
@media (max-width: 480px) {
|
|
925
|
-
.site-chat-component-panel {
|
|
926
|
-
width: 100vw;
|
|
927
|
-
height: 100vh;
|
|
928
|
-
height: 100dvh;
|
|
929
|
-
min-height: 0;
|
|
930
|
-
max-height: none;
|
|
931
|
-
bottom: 0;
|
|
932
|
-
right: 0;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.site-chat-component-panel.open {
|
|
936
|
-
top: 0;
|
|
937
|
-
left: 0;
|
|
938
|
-
right: 0;
|
|
939
|
-
bottom: 0;
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
/* \u2500\u2500 Small tablets \u2500\u2500 */
|
|
944
|
-
@media (min-width: 481px) and (max-width: 768px) {
|
|
945
|
-
.site-chat-component-panel {
|
|
946
|
-
width: min(380px, calc(100vw - 24px));
|
|
947
|
-
max-height: 70vh;
|
|
948
|
-
max-height: 70dvh;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
/* \u2500\u2500 Large screens \u2500\u2500 */
|
|
953
|
-
@media (min-width: 1200px) {
|
|
954
|
-
.site-chat-component-panel {
|
|
955
|
-
width: 350px;
|
|
956
|
-
max-height: 70vh;
|
|
957
|
-
max-height: 70dvh;
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
`;
|
|
961
|
-
document.head.appendChild(s);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
// src/components/SiteChatComponent/SiteChatComponent.tsx
|
|
965
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
966
|
-
var SiteChatComponentRoot = import_react7.default.forwardRef(
|
|
967
|
-
({
|
|
968
|
-
children,
|
|
969
|
-
viewMode,
|
|
970
|
-
editorShowChatPanel,
|
|
971
|
-
handleToggle,
|
|
972
|
-
buttonTextValue,
|
|
973
|
-
isOpen
|
|
974
|
-
}, _ref) => {
|
|
975
|
-
useSiteChatComponent();
|
|
976
|
-
if (viewMode === "Editor") {
|
|
977
|
-
if (typeof editorShowChatPanel === "undefined") {
|
|
978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system9.Box, { align: "center", verticalAlign: "middle", height: "100%", width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system9.Text, { children: "Editor view mode detected but editorShowChatPanel prop is not provided" }) });
|
|
979
|
-
}
|
|
980
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_design_system9.Box, { children: [
|
|
981
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FabButton, { onClick: handleToggle, text: buttonTextValue }),
|
|
982
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system9.Box, { className: `site-chat-component-panel ${editorShowChatPanel ? "open" : ""}`, children })
|
|
983
|
-
] });
|
|
984
|
-
}
|
|
985
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_design_system9.Box, { children: [
|
|
986
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FabButton, { onClick: handleToggle, text: buttonTextValue }),
|
|
987
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system9.Box, { className: `site-chat-component-panel ${isOpen ? "open" : ""}`, children })
|
|
988
|
-
] });
|
|
989
|
-
}
|
|
990
|
-
);
|
|
991
|
-
SiteChatComponentRoot.displayName = "SiteChatComponent";
|
|
992
|
-
var SiteChatComponent = Object.assign(SiteChatComponentRoot, {
|
|
993
|
-
Header,
|
|
994
|
-
MessageContainer,
|
|
995
|
-
Footer,
|
|
996
|
-
FabButton
|
|
997
|
-
});
|
|
998
|
-
//# sourceMappingURL=index.js.map
|