turbodesk-livechat-react-native 0.1.0-alpha.0
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/CHANGELOG.md +30 -0
- package/README.md +91 -0
- package/dist/api/conversation-api.d.ts +16 -0
- package/dist/api/conversation-api.d.ts.map +1 -0
- package/dist/api/conversation-api.js +44 -0
- package/dist/api/conversation-api.js.map +1 -0
- package/dist/api/file-api.d.ts +5 -0
- package/dist/api/file-api.d.ts.map +1 -0
- package/dist/api/file-api.js +15 -0
- package/dist/api/file-api.js.map +1 -0
- package/dist/api/widget-api.d.ts +4 -0
- package/dist/api/widget-api.d.ts.map +1 -0
- package/dist/api/widget-api.js +15 -0
- package/dist/api/widget-api.js.map +1 -0
- package/dist/axios/axios.d.ts +32 -0
- package/dist/axios/axios.d.ts.map +1 -0
- package/dist/axios/axios.js +120 -0
- package/dist/axios/axios.js.map +1 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +42 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/http-client.d.ts +33 -0
- package/dist/core/http-client.d.ts.map +1 -0
- package/dist/core/http-client.js +104 -0
- package/dist/core/http-client.js.map +1 -0
- package/dist/core/identity.d.ts +7 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +62 -0
- package/dist/core/identity.js.map +1 -0
- package/dist/core/visitor-params.d.ts +15 -0
- package/dist/core/visitor-params.d.ts.map +1 -0
- package/dist/core/visitor-params.js +45 -0
- package/dist/core/visitor-params.js.map +1 -0
- package/dist/hooks/use-conversations.d.ts +12 -0
- package/dist/hooks/use-conversations.d.ts.map +1 -0
- package/dist/hooks/use-conversations.js +177 -0
- package/dist/hooks/use-conversations.js.map +1 -0
- package/dist/hooks/use-live-chat.d.ts +30 -0
- package/dist/hooks/use-live-chat.d.ts.map +1 -0
- package/dist/hooks/use-live-chat.js +52 -0
- package/dist/hooks/use-live-chat.js.map +1 -0
- package/dist/hooks/use-messages.d.ts +11 -0
- package/dist/hooks/use-messages.d.ts.map +1 -0
- package/dist/hooks/use-messages.js +185 -0
- package/dist/hooks/use-messages.js.map +1 -0
- package/dist/hooks/use-send-message.d.ts +22 -0
- package/dist/hooks/use-send-message.d.ts.map +1 -0
- package/dist/hooks/use-send-message.js +125 -0
- package/dist/hooks/use-send-message.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/LiveChatPanel.d.ts +5 -0
- package/dist/navigation/LiveChatPanel.d.ts.map +1 -0
- package/dist/navigation/LiveChatPanel.js +81 -0
- package/dist/navigation/LiveChatPanel.js.map +1 -0
- package/dist/navigation/panel-router-context.d.ts +22 -0
- package/dist/navigation/panel-router-context.d.ts.map +1 -0
- package/dist/navigation/panel-router-context.js +42 -0
- package/dist/navigation/panel-router-context.js.map +1 -0
- package/dist/navigation/router-types.d.ts +2 -0
- package/dist/navigation/router-types.d.ts.map +1 -0
- package/dist/navigation/router-types.js +3 -0
- package/dist/navigation/router-types.js.map +1 -0
- package/dist/provider/LiveChatContext.d.ts +4 -0
- package/dist/provider/LiveChatContext.d.ts.map +1 -0
- package/dist/provider/LiveChatContext.js +35 -0
- package/dist/provider/LiveChatContext.js.map +1 -0
- package/dist/provider/LiveChatProvider.d.ts +3 -0
- package/dist/provider/LiveChatProvider.d.ts.map +1 -0
- package/dist/provider/LiveChatProvider.js +308 -0
- package/dist/provider/LiveChatProvider.js.map +1 -0
- package/dist/provider/types.d.ts +42 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +3 -0
- package/dist/provider/types.js.map +1 -0
- package/dist/realtime/ws-client.d.ts +51 -0
- package/dist/realtime/ws-client.d.ts.map +1 -0
- package/dist/realtime/ws-client.js +322 -0
- package/dist/realtime/ws-client.js.map +1 -0
- package/dist/ui/components/AssigneeAvatar.d.ts +12 -0
- package/dist/ui/components/AssigneeAvatar.d.ts.map +1 -0
- package/dist/ui/components/AssigneeAvatar.js +58 -0
- package/dist/ui/components/AssigneeAvatar.js.map +1 -0
- package/dist/ui/components/Avatar.d.ts +10 -0
- package/dist/ui/components/Avatar.d.ts.map +1 -0
- package/dist/ui/components/Avatar.js +76 -0
- package/dist/ui/components/Avatar.js.map +1 -0
- package/dist/ui/components/ConversationHeader.d.ts +10 -0
- package/dist/ui/components/ConversationHeader.d.ts.map +1 -0
- package/dist/ui/components/ConversationHeader.js +90 -0
- package/dist/ui/components/ConversationHeader.js.map +1 -0
- package/dist/ui/components/ConversationListScreen.d.ts +9 -0
- package/dist/ui/components/ConversationListScreen.d.ts.map +1 -0
- package/dist/ui/components/ConversationListScreen.js +350 -0
- package/dist/ui/components/ConversationListScreen.js.map +1 -0
- package/dist/ui/components/ConversationScreen.d.ts +8 -0
- package/dist/ui/components/ConversationScreen.d.ts.map +1 -0
- package/dist/ui/components/ConversationScreen.js +235 -0
- package/dist/ui/components/ConversationScreen.js.map +1 -0
- package/dist/ui/components/HomeScreen.d.ts +6 -0
- package/dist/ui/components/HomeScreen.d.ts.map +1 -0
- package/dist/ui/components/HomeScreen.js +133 -0
- package/dist/ui/components/HomeScreen.js.map +1 -0
- package/dist/ui/components/LivechatMessageRenderer.d.ts +17 -0
- package/dist/ui/components/LivechatMessageRenderer.d.ts.map +1 -0
- package/dist/ui/components/LivechatMessageRenderer.js +122 -0
- package/dist/ui/components/LivechatMessageRenderer.js.map +1 -0
- package/dist/ui/components/LogMessage.d.ts +5 -0
- package/dist/ui/components/LogMessage.d.ts.map +1 -0
- package/dist/ui/components/LogMessage.js +83 -0
- package/dist/ui/components/LogMessage.js.map +1 -0
- package/dist/ui/components/MessageBubble.d.ts +15 -0
- package/dist/ui/components/MessageBubble.d.ts.map +1 -0
- package/dist/ui/components/MessageBubble.js +84 -0
- package/dist/ui/components/MessageBubble.js.map +1 -0
- package/dist/ui/components/MessageComposer.d.ts +31 -0
- package/dist/ui/components/MessageComposer.d.ts.map +1 -0
- package/dist/ui/components/MessageComposer.js +295 -0
- package/dist/ui/components/MessageComposer.js.map +1 -0
- package/dist/ui/components/WsStatusStrip.d.ts +2 -0
- package/dist/ui/components/WsStatusStrip.d.ts.map +1 -0
- package/dist/ui/components/WsStatusStrip.js +103 -0
- package/dist/ui/components/WsStatusStrip.js.map +1 -0
- package/dist/ui/icons.d.ts +22 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/icons.js +71 -0
- package/dist/ui/icons.js.map +1 -0
- package/dist/ui/theme.d.ts +72 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +170 -0
- package/dist/ui/theme.js.map +1 -0
- package/docs/backend-contract.md +392 -0
- package/docs/migration-notes.md +32 -0
- package/package.json +60 -0
- package/src/api/conversation-api.ts +71 -0
- package/src/api/file-api.ts +14 -0
- package/src/api/widget-api.ts +12 -0
- package/src/axios/axios.ts +159 -0
- package/src/core/config.ts +54 -0
- package/src/core/http-client.ts +136 -0
- package/src/core/identity.ts +68 -0
- package/src/core/visitor-params.ts +48 -0
- package/src/hooks/use-conversations.ts +181 -0
- package/src/hooks/use-live-chat.ts +84 -0
- package/src/hooks/use-messages.ts +188 -0
- package/src/hooks/use-send-message.ts +159 -0
- package/src/index.ts +114 -0
- package/src/navigation/LiveChatPanel.tsx +118 -0
- package/src/navigation/panel-router-context.tsx +89 -0
- package/src/navigation/router-types.ts +1 -0
- package/src/provider/LiveChatContext.ts +33 -0
- package/src/provider/LiveChatProvider.tsx +380 -0
- package/src/provider/types.ts +57 -0
- package/src/realtime/ws-client.ts +369 -0
- package/src/types/react-native-svg.d.ts +10 -0
- package/src/ui/components/AssigneeAvatar.tsx +102 -0
- package/src/ui/components/Avatar.tsx +110 -0
- package/src/ui/components/ConversationHeader.tsx +202 -0
- package/src/ui/components/ConversationListScreen.tsx +454 -0
- package/src/ui/components/ConversationScreen.tsx +362 -0
- package/src/ui/components/HomeScreen.tsx +278 -0
- package/src/ui/components/LivechatMessageRenderer.tsx +268 -0
- package/src/ui/components/LogMessage.tsx +88 -0
- package/src/ui/components/MessageBubble.tsx +148 -0
- package/src/ui/components/MessageComposer.tsx +461 -0
- package/src/ui/components/WsStatusStrip.tsx +123 -0
- package/src/ui/icons.tsx +111 -0
- package/src/ui/theme.ts +237 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsStatusStrip = WsStatusStrip;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const LiveChatContext_1 = require("../../provider/LiveChatContext");
|
|
8
|
+
function WsStatusStrip() {
|
|
9
|
+
const { connectionState } = (0, LiveChatContext_1.useLiveChatContext)();
|
|
10
|
+
const { isConnected, isConnecting, isAwaitingRetry } = connectionState;
|
|
11
|
+
const everConnected = (0, react_1.useRef)(false);
|
|
12
|
+
const dismissTimer = (0, react_1.useRef)(null);
|
|
13
|
+
const holdTimer = (0, react_1.useRef)(null);
|
|
14
|
+
const [wsToast, setWsToast] = (0, react_1.useState)(null);
|
|
15
|
+
const [wsStripHold, setWsStripHold] = (0, react_1.useState)(null);
|
|
16
|
+
const heightAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
17
|
+
// Track ever-connected
|
|
18
|
+
(0, react_1.useEffect)(() => {
|
|
19
|
+
if (isConnected)
|
|
20
|
+
everConnected.current = true;
|
|
21
|
+
}, [isConnected]);
|
|
22
|
+
// Drive wsToast
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
if (dismissTimer.current)
|
|
25
|
+
clearTimeout(dismissTimer.current);
|
|
26
|
+
const wsRecoveryUi = !isConnected && (isConnecting || isAwaitingRetry);
|
|
27
|
+
if (wsRecoveryUi) {
|
|
28
|
+
setWsToast(everConnected.current ? "reconnecting" : "connecting");
|
|
29
|
+
}
|
|
30
|
+
else if (isConnected && wsToast !== null) {
|
|
31
|
+
// just recovered
|
|
32
|
+
setWsToast("connected");
|
|
33
|
+
dismissTimer.current = setTimeout(() => setWsToast(null), 1200);
|
|
34
|
+
}
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, [isConnected, isConnecting, isAwaitingRetry]);
|
|
37
|
+
// wsStripHold — keep rendered 300ms after toast clears for collapse animation
|
|
38
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
39
|
+
if (holdTimer.current)
|
|
40
|
+
clearTimeout(holdTimer.current);
|
|
41
|
+
if (wsToast) {
|
|
42
|
+
setWsStripHold(wsToast);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
holdTimer.current = setTimeout(() => setWsStripHold(null), 300);
|
|
46
|
+
}
|
|
47
|
+
return () => {
|
|
48
|
+
if (holdTimer.current)
|
|
49
|
+
clearTimeout(holdTimer.current);
|
|
50
|
+
};
|
|
51
|
+
}, [wsToast]);
|
|
52
|
+
// Height animation
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
|
+
react_native_1.Animated.timing(heightAnim, {
|
|
55
|
+
toValue: wsToast ? 36 : 0,
|
|
56
|
+
duration: 300,
|
|
57
|
+
useNativeDriver: false,
|
|
58
|
+
}).start();
|
|
59
|
+
}, [wsToast, heightAnim]);
|
|
60
|
+
if (!wsStripHold)
|
|
61
|
+
return null;
|
|
62
|
+
const isAmber = wsStripHold === "connecting" || wsStripHold === "reconnecting";
|
|
63
|
+
const bg = "#71717a";
|
|
64
|
+
const label = wsStripHold === "connecting"
|
|
65
|
+
? "Connecting…"
|
|
66
|
+
: wsStripHold === "reconnecting"
|
|
67
|
+
? "Reconnecting…"
|
|
68
|
+
: "Connected";
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.strip, { backgroundColor: bg, height: heightAnim, overflow: "hidden" }], children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.row, children: [isAmber && (0, jsx_runtime_1.jsx)(Spinner, {}), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.text, children: label })] }) }));
|
|
70
|
+
}
|
|
71
|
+
function Spinner() {
|
|
72
|
+
const spin = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
73
|
+
(0, react_1.useEffect)(() => {
|
|
74
|
+
react_native_1.Animated.loop(react_native_1.Animated.timing(spin, { toValue: 1, duration: 800, useNativeDriver: true })).start();
|
|
75
|
+
}, [spin]);
|
|
76
|
+
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.spinner, { transform: [{ rotate }] }] }));
|
|
78
|
+
}
|
|
79
|
+
const styles = react_native_1.StyleSheet.create({
|
|
80
|
+
strip: {
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
},
|
|
84
|
+
row: {
|
|
85
|
+
flexDirection: "row",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
gap: 6,
|
|
88
|
+
},
|
|
89
|
+
text: {
|
|
90
|
+
color: "#ffffff",
|
|
91
|
+
fontSize: 12,
|
|
92
|
+
fontWeight: "600",
|
|
93
|
+
},
|
|
94
|
+
spinner: {
|
|
95
|
+
width: 12,
|
|
96
|
+
height: 12,
|
|
97
|
+
borderRadius: 6,
|
|
98
|
+
borderWidth: 2,
|
|
99
|
+
borderColor: "rgba(255,255,255,0.4)",
|
|
100
|
+
borderTopColor: "#ffffff",
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=WsStatusStrip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WsStatusStrip.js","sourceRoot":"","sources":["../../../src/ui/components/WsStatusStrip.tsx"],"names":[],"mappings":";;AAMA,sCA2EC;;AAjFD,iCAA4E;AAC5E,+C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AE,CAAC,GAAI,CACxE,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,CAAC;KACP;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,uBAAuB;QACpC,cAAc,EAAE,SAAS;KAC1B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type IconProps = {
|
|
2
|
+
size?: number;
|
|
3
|
+
color?: string;
|
|
4
|
+
style?: object;
|
|
5
|
+
};
|
|
6
|
+
export declare const ArrowRightIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const ArrowRightCircleIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ArrowLeftIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ChevronDownIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ChevronLeftIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const CloseIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ChatBubbleIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const MinimizeIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const DotsIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const HistoryChatsIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const SendPlaneIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const PaperclipIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const DownloadIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const PlayIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const FileIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const TurbodeskLogoIcon: ({ size, color, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/ui/icons.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,wBAA8C,SAAS,4CAIrF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wBAA8C,SAAS,4CAK3F,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wBAA8C,SAAS,4CAIpF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wBAA8C,SAAS,4CAItF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wBAA8C,SAAS,4CAItF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,wBAA8C,SAAS,4CAIhF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,wBAA8C,SAAS,4CAIrF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,wBAA8C,SAAS,4CAInF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,wBAA8C,SAAS,4CAM/E,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wBAA8C,SAAS,4CAKvF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wBAA8C,SAAS,4CAIpF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wBAA8C,SAAS,4CAIpF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,wBAA8C,SAAS,4CAMnF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,wBAA8C,SAAS,4CAI/E,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,wBAA8C,SAAS,4CAI/E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,wBAA8C,SAAS,4CAKxF,CAAC"}
|
package/dist/ui/icons.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TurbodeskLogoIcon = exports.FileIcon = exports.PlayIcon = exports.DownloadIcon = exports.PaperclipIcon = exports.SendPlaneIcon = exports.HistoryChatsIcon = exports.DotsIcon = exports.MinimizeIcon = exports.ChatBubbleIcon = exports.CloseIcon = exports.ChevronLeftIcon = exports.ChevronDownIcon = exports.ArrowLeftIcon = exports.ArrowRightCircleIcon = exports.ArrowRightIcon = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
39
|
+
const ArrowRightIcon = ({ size = 16, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M3 8h10M9 4l4 4-4 4", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
40
|
+
exports.ArrowRightIcon = ArrowRightIcon;
|
|
41
|
+
const ArrowRightCircleIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", style: style, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: "10", cy: "10", r: "7.25", stroke: color, strokeWidth: 1.5 }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M8.25 10h4.5M11 7.75L13.25 10 11 12.25", stroke: color, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
42
|
+
exports.ArrowRightCircleIcon = ArrowRightCircleIcon;
|
|
43
|
+
const ArrowLeftIcon = ({ size = 16, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M13 8H3M7 4L3 8l4 4", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
44
|
+
exports.ArrowLeftIcon = ArrowLeftIcon;
|
|
45
|
+
const ChevronDownIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M5 7.5l5 5 5-5", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
46
|
+
exports.ChevronDownIcon = ChevronDownIcon;
|
|
47
|
+
const ChevronLeftIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M12.5 5l-5 5 5 5", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
48
|
+
exports.ChevronLeftIcon = ChevronLeftIcon;
|
|
49
|
+
const CloseIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M15 5L5 15M5 5l10 10", stroke: color, strokeWidth: 2, strokeLinecap: "round" }) }));
|
|
50
|
+
exports.CloseIcon = CloseIcon;
|
|
51
|
+
const ChatBubbleIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: color, style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { fillRule: "evenodd", d: "M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7z", clipRule: "evenodd" }) }));
|
|
52
|
+
exports.ChatBubbleIcon = ChatBubbleIcon;
|
|
53
|
+
const MinimizeIcon = ({ size = 16, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M3 8h10", stroke: color, strokeWidth: 2, strokeLinecap: "round" }) }));
|
|
54
|
+
exports.MinimizeIcon = MinimizeIcon;
|
|
55
|
+
const DotsIcon = ({ size = 20, color = "currentColor", style }) => ((0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 20 20", fill: color, style: style, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: "5", cy: "10", r: "1.5" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: "10", cy: "10", r: "1.5" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: "15", cy: "10", r: "1.5" })] }));
|
|
56
|
+
exports.DotsIcon = DotsIcon;
|
|
57
|
+
const HistoryChatsIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", style: style, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M12 8v4l2.5 1.5M21 12a9 9 0 11-3-6.7", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M21 3v4h-4", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
58
|
+
exports.HistoryChatsIcon = HistoryChatsIcon;
|
|
59
|
+
const SendPlaneIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
60
|
+
exports.SendPlaneIcon = SendPlaneIcon;
|
|
61
|
+
const PaperclipIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
62
|
+
exports.PaperclipIcon = PaperclipIcon;
|
|
63
|
+
const DownloadIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", style: style, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M12 15V3", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "m7 10 5 5 5-5", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
64
|
+
exports.DownloadIcon = DownloadIcon;
|
|
65
|
+
const PlayIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 512 512", fill: color, style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z" }) }));
|
|
66
|
+
exports.PlayIcon = PlayIcon;
|
|
67
|
+
const FileIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsx)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 384 512", fill: color, style: style, children: (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z" }) }));
|
|
68
|
+
exports.FileIcon = FileIcon;
|
|
69
|
+
const TurbodeskLogoIcon = ({ size = 24, color = "currentColor", style }) => ((0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, viewBox: "0 0 152 250", fill: "none", style: style, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M51.5138 0H151.966L74.695 73.4069H0L51.5138 0Z", fill: color }), (0, jsx_runtime_1.jsx)(react_native_svg_1.Path, { d: "M74.7266 73.4069L151.997 0V249.584L74.7266 217.774V73.4069Z", fill: color })] }));
|
|
70
|
+
exports.TurbodeskLogoIcon = TurbodeskLogoIcon;
|
|
71
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/ui/icons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qEAAwD;AAQjD,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,EAAE,KAAK,EAAa,EAAE,EAAE,CAAC,CACzF,uBAAC,0BAAG,IAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,YAC1E,uBAAC,uBAAI,IAAC,CAAC,EAAC,qBAAqB,EAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,GAAG,GACxG,CACP,CAAC;AAJW,QAAA,cAAc,kBAIzB;AAEK,MAAM,oBAAoB,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,EAAE,KAAK,EAAa,EAAE,EAAE,CAAC,CAC/F,wBAAC,0BAAG,IAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,aAC1E,uBAAC,yBAAM,IAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,EAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAI,EACpE,uBAAC,uBAAI,IAAC,CAAC,EAAC,wCAAwC,EAAC,MAAM,EAAE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AAK,EAAE,KAAK,YAC7E,uBAAC,uBAAI,IAAC,CAAC,EAAC,4JAA4J,GAAG,GACnK,CACP,CAAC;AAJW,QAAA,QAAQ,YAInB;AAEK,MAAM,iBAAiB,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,EAAE,KAAK,EAAa,EAAE,EAAE,CAAC,CAC5F,wBAAC,0BAAG,IAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,aAAa,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,aAC5E,uBAAC,uBAAI,IAAC,CAAC,EAAC,gDAAgD,EAAC,IAAI,EAAE,KAAK,GAAI,EACxE,uBAAC,uBAAI,IAAC,CAAC,EAAC,6DAA6D,EAAC,IAAI,EAAE,KAAK,GAAI,IACjF,CACP,CAAC;AALW,QAAA,iBAAiB,qBAK5B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type AppearanceMode = "light" | "dark" | "system";
|
|
2
|
+
export type ThemeColors = {
|
|
3
|
+
brand: string;
|
|
4
|
+
background: string;
|
|
5
|
+
surface: string;
|
|
6
|
+
text: string;
|
|
7
|
+
textMuted: string;
|
|
8
|
+
bubbleIn: string;
|
|
9
|
+
bubbleOut: string;
|
|
10
|
+
bubbleTextIn: string;
|
|
11
|
+
bubbleTextOut: string;
|
|
12
|
+
border: string;
|
|
13
|
+
unreadBadge: string;
|
|
14
|
+
unreadBadgeText: string;
|
|
15
|
+
headerBackground: string;
|
|
16
|
+
headerText: string;
|
|
17
|
+
composerBackground: string;
|
|
18
|
+
composerBorder: string;
|
|
19
|
+
inputText: string;
|
|
20
|
+
sendButtonBackground: string;
|
|
21
|
+
sendButtonIcon: string;
|
|
22
|
+
error: string;
|
|
23
|
+
homeBackground: string;
|
|
24
|
+
homeHeaderText: string;
|
|
25
|
+
presenceActive: string;
|
|
26
|
+
presenceAway: string;
|
|
27
|
+
};
|
|
28
|
+
export type ThemeFontSizes = {
|
|
29
|
+
xs: number;
|
|
30
|
+
sm: number;
|
|
31
|
+
md: number;
|
|
32
|
+
lg: number;
|
|
33
|
+
xl: number;
|
|
34
|
+
};
|
|
35
|
+
export type ThemeSpacing = {
|
|
36
|
+
xs: number;
|
|
37
|
+
sm: number;
|
|
38
|
+
md: number;
|
|
39
|
+
lg: number;
|
|
40
|
+
xl: number;
|
|
41
|
+
};
|
|
42
|
+
export type ThemeBorderRadius = {
|
|
43
|
+
sm: number;
|
|
44
|
+
md: number;
|
|
45
|
+
lg: number;
|
|
46
|
+
bubble: number;
|
|
47
|
+
avatar: number;
|
|
48
|
+
};
|
|
49
|
+
export type ThemeConfig = {
|
|
50
|
+
colors: ThemeColors;
|
|
51
|
+
fontSizes: ThemeFontSizes;
|
|
52
|
+
spacing: ThemeSpacing;
|
|
53
|
+
borderRadius: ThemeBorderRadius;
|
|
54
|
+
appearance: AppearanceMode;
|
|
55
|
+
useBrandThemingForChat: boolean;
|
|
56
|
+
};
|
|
57
|
+
export declare const defaultTheme: ThemeConfig;
|
|
58
|
+
export declare function getBrandColor(settings: any): string;
|
|
59
|
+
export declare function getNotificationIconColor(settings: any): string;
|
|
60
|
+
/** Readable text on top of a hex brand color. */
|
|
61
|
+
export declare function contrastingTextOnBrand(hex: string): string;
|
|
62
|
+
export declare function getWidgetName(config: any): string;
|
|
63
|
+
export declare function getWidgetGreeting(settings: any): string;
|
|
64
|
+
export declare function getWidgetTitle(config: any): string;
|
|
65
|
+
export declare function getWidgetDescription(settings: any): string;
|
|
66
|
+
export declare function getBrandLogoUrl(settings: any): string | undefined;
|
|
67
|
+
export declare const POWERED_BY_TEXT = "Powered by Turbodesk";
|
|
68
|
+
/** Resolve appearance from widget settings + system color scheme. */
|
|
69
|
+
export declare function useEffectiveAppearance(settings: any): "light" | "dark";
|
|
70
|
+
export declare function buildThemeFromBrand(brandColor: string, appearance: AppearanceMode, useBrandThemingForChat: boolean, override?: Partial<ThemeConfig>): ThemeConfig;
|
|
71
|
+
export declare function mergeTheme(base: ThemeConfig, override?: Partial<ThemeConfig>): ThemeConfig;
|
|
72
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ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B,CAAC;AAItD,qEAAqE;AACrE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,GAAG,MAAM,CAOtE;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,cAAc,EAC1B,sBAAsB,EAAE,OAAO,EAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC9B,WAAW,CA0Bb;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC9B,WAAW,CAWb"}
|
package/dist/ui/theme.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POWERED_BY_TEXT = exports.defaultTheme = void 0;
|
|
4
|
+
exports.getBrandColor = getBrandColor;
|
|
5
|
+
exports.getNotificationIconColor = getNotificationIconColor;
|
|
6
|
+
exports.contrastingTextOnBrand = contrastingTextOnBrand;
|
|
7
|
+
exports.getWidgetName = getWidgetName;
|
|
8
|
+
exports.getWidgetGreeting = getWidgetGreeting;
|
|
9
|
+
exports.getWidgetTitle = getWidgetTitle;
|
|
10
|
+
exports.getWidgetDescription = getWidgetDescription;
|
|
11
|
+
exports.getBrandLogoUrl = getBrandLogoUrl;
|
|
12
|
+
exports.useEffectiveAppearance = useEffectiveAppearance;
|
|
13
|
+
exports.buildThemeFromBrand = buildThemeFromBrand;
|
|
14
|
+
exports.mergeTheme = mergeTheme;
|
|
15
|
+
const react_native_1 = require("react-native");
|
|
16
|
+
// ─── Defaults ─────────────────────────────────────────────────────────────────
|
|
17
|
+
const DEFAULT_BRAND = "#6366f1";
|
|
18
|
+
const DEFAULT_NOTIFICATION = "#ef4444";
|
|
19
|
+
const lightColors = {
|
|
20
|
+
brand: DEFAULT_BRAND,
|
|
21
|
+
background: "#f9fafb",
|
|
22
|
+
surface: "#ffffff",
|
|
23
|
+
text: "#18181b",
|
|
24
|
+
textMuted: "#71717a",
|
|
25
|
+
bubbleIn: "#f3f4f6",
|
|
26
|
+
bubbleOut: DEFAULT_BRAND,
|
|
27
|
+
bubbleTextIn: "#18181b",
|
|
28
|
+
bubbleTextOut: "#ffffff",
|
|
29
|
+
border: "rgba(0,0,0,0.08)",
|
|
30
|
+
unreadBadge: DEFAULT_NOTIFICATION,
|
|
31
|
+
unreadBadgeText: "#ffffff",
|
|
32
|
+
headerBackground: "#ffffff",
|
|
33
|
+
headerText: "#18181b",
|
|
34
|
+
composerBackground: "#ffffff",
|
|
35
|
+
composerBorder: "rgba(0,0,0,0.12)",
|
|
36
|
+
inputText: "#18181b",
|
|
37
|
+
sendButtonBackground: DEFAULT_BRAND,
|
|
38
|
+
sendButtonIcon: "#ffffff",
|
|
39
|
+
error: DEFAULT_NOTIFICATION,
|
|
40
|
+
homeBackground: DEFAULT_BRAND,
|
|
41
|
+
homeHeaderText: "#ffffff",
|
|
42
|
+
presenceActive: "#10b981",
|
|
43
|
+
presenceAway: "#f59e0b",
|
|
44
|
+
};
|
|
45
|
+
const darkColors = {
|
|
46
|
+
brand: DEFAULT_BRAND,
|
|
47
|
+
background: "#09090b",
|
|
48
|
+
surface: "#18181b",
|
|
49
|
+
text: "#fafafa",
|
|
50
|
+
textMuted: "#a1a1aa",
|
|
51
|
+
bubbleIn: "#27272a",
|
|
52
|
+
bubbleOut: DEFAULT_BRAND,
|
|
53
|
+
bubbleTextIn: "#fafafa",
|
|
54
|
+
bubbleTextOut: "#ffffff",
|
|
55
|
+
border: "rgba(255,255,255,0.08)",
|
|
56
|
+
unreadBadge: DEFAULT_NOTIFICATION,
|
|
57
|
+
unreadBadgeText: "#ffffff",
|
|
58
|
+
headerBackground: "#18181b",
|
|
59
|
+
headerText: "#fafafa",
|
|
60
|
+
composerBackground: "#18181b",
|
|
61
|
+
composerBorder: "rgba(255,255,255,0.12)",
|
|
62
|
+
inputText: "#fafafa",
|
|
63
|
+
sendButtonBackground: DEFAULT_BRAND,
|
|
64
|
+
sendButtonIcon: "#ffffff",
|
|
65
|
+
error: DEFAULT_NOTIFICATION,
|
|
66
|
+
homeBackground: "#18181b",
|
|
67
|
+
homeHeaderText: "#fafafa",
|
|
68
|
+
presenceActive: "#10b981",
|
|
69
|
+
presenceAway: "#f59e0b",
|
|
70
|
+
};
|
|
71
|
+
exports.defaultTheme = {
|
|
72
|
+
appearance: "light",
|
|
73
|
+
useBrandThemingForChat: false,
|
|
74
|
+
colors: lightColors,
|
|
75
|
+
fontSizes: { xs: 11, sm: 13, md: 15, lg: 17, xl: 20 },
|
|
76
|
+
spacing: { xs: 4, sm: 8, md: 12, lg: 16, xl: 24 },
|
|
77
|
+
borderRadius: { sm: 4, md: 8, lg: 16, bubble: 18, avatar: 999 },
|
|
78
|
+
};
|
|
79
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
80
|
+
function getBrandColor(settings) {
|
|
81
|
+
var _a;
|
|
82
|
+
return ((_a = settings === null || settings === void 0 ? void 0 : settings.brandColor) === null || _a === void 0 ? void 0 : _a.trim()) || DEFAULT_BRAND;
|
|
83
|
+
}
|
|
84
|
+
function getNotificationIconColor(settings) {
|
|
85
|
+
var _a;
|
|
86
|
+
return ((_a = settings === null || settings === void 0 ? void 0 : settings.notificationIconColor) === null || _a === void 0 ? void 0 : _a.trim()) || DEFAULT_NOTIFICATION;
|
|
87
|
+
}
|
|
88
|
+
/** Readable text on top of a hex brand color. */
|
|
89
|
+
function contrastingTextOnBrand(hex) {
|
|
90
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
|
|
91
|
+
if (!m)
|
|
92
|
+
return "#ffffff";
|
|
93
|
+
const n = parseInt(m[1], 16);
|
|
94
|
+
const r = (n >> 16) & 255;
|
|
95
|
+
const g = (n >> 8) & 255;
|
|
96
|
+
const b = n & 255;
|
|
97
|
+
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
98
|
+
return luminance > 0.55 ? "#111827" : "#ffffff";
|
|
99
|
+
}
|
|
100
|
+
function getWidgetName(config) {
|
|
101
|
+
var _a;
|
|
102
|
+
return ((_a = config === null || config === void 0 ? void 0 : config.widgetName) === null || _a === void 0 ? void 0 : _a.trim()) || "Chat with us";
|
|
103
|
+
}
|
|
104
|
+
function getWidgetGreeting(settings) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
const g = ((_b = (_a = settings === null || settings === void 0 ? void 0 : settings.greetings) !== null && _a !== void 0 ? _a : settings === null || settings === void 0 ? void 0 : settings.greeting) !== null && _b !== void 0 ? _b : "").toString().trim();
|
|
107
|
+
return g || "Hi! How can we help you today?";
|
|
108
|
+
}
|
|
109
|
+
function getWidgetTitle(config) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
return ((_b = (_a = config === null || config === void 0 ? void 0 : config.widgetSettings) === null || _a === void 0 ? void 0 : _a.title) === null || _b === void 0 ? void 0 : _b.trim()) || "Chat with us";
|
|
112
|
+
}
|
|
113
|
+
function getWidgetDescription(settings) {
|
|
114
|
+
var _a;
|
|
115
|
+
return ((_a = settings === null || settings === void 0 ? void 0 : settings.description) === null || _a === void 0 ? void 0 : _a.trim()) || "We usually reply within a few minutes.";
|
|
116
|
+
}
|
|
117
|
+
function getBrandLogoUrl(settings) {
|
|
118
|
+
var _a;
|
|
119
|
+
return ((_a = settings === null || settings === void 0 ? void 0 : settings.brandLogoUrl) === null || _a === void 0 ? void 0 : _a.trim()) || undefined;
|
|
120
|
+
}
|
|
121
|
+
exports.POWERED_BY_TEXT = "Powered by Turbodesk";
|
|
122
|
+
// ─── Theme resolution ─────────────────────────────────────────────────────────
|
|
123
|
+
/** Resolve appearance from widget settings + system color scheme. */
|
|
124
|
+
function useEffectiveAppearance(settings) {
|
|
125
|
+
const systemScheme = (0, react_native_1.useColorScheme)();
|
|
126
|
+
const mode = settings === null || settings === void 0 ? void 0 : settings.theme;
|
|
127
|
+
if (mode === "dark" || mode === "custom")
|
|
128
|
+
return "dark";
|
|
129
|
+
if (mode === "light")
|
|
130
|
+
return "light";
|
|
131
|
+
if (mode === "system")
|
|
132
|
+
return systemScheme === "dark" ? "dark" : "light";
|
|
133
|
+
return "light";
|
|
134
|
+
}
|
|
135
|
+
function buildThemeFromBrand(brandColor, appearance, useBrandThemingForChat, override) {
|
|
136
|
+
const isDark = appearance === "dark";
|
|
137
|
+
const base = isDark ? darkColors : lightColors;
|
|
138
|
+
const contrastText = contrastingTextOnBrand(brandColor);
|
|
139
|
+
const colors = {
|
|
140
|
+
...base,
|
|
141
|
+
brand: brandColor,
|
|
142
|
+
bubbleOut: brandColor,
|
|
143
|
+
sendButtonBackground: brandColor,
|
|
144
|
+
homeBackground: isDark ? base.homeBackground : brandColor,
|
|
145
|
+
homeHeaderText: isDark ? base.homeHeaderText : contrastText,
|
|
146
|
+
...(useBrandThemingForChat
|
|
147
|
+
? { bubbleOut: brandColor, bubbleTextOut: contrastText }
|
|
148
|
+
: {}),
|
|
149
|
+
};
|
|
150
|
+
return mergeTheme({
|
|
151
|
+
...exports.defaultTheme,
|
|
152
|
+
appearance,
|
|
153
|
+
useBrandThemingForChat,
|
|
154
|
+
colors,
|
|
155
|
+
}, override);
|
|
156
|
+
}
|
|
157
|
+
function mergeTheme(base, override) {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
if (!override)
|
|
160
|
+
return base;
|
|
161
|
+
return {
|
|
162
|
+
colors: { ...base.colors, ...override.colors },
|
|
163
|
+
fontSizes: { ...base.fontSizes, ...override.fontSizes },
|
|
164
|
+
spacing: { ...base.spacing, ...override.spacing },
|
|
165
|
+
borderRadius: { ...base.borderRadius, ...override.borderRadius },
|
|
166
|
+
appearance: (_a = override.appearance) !== null && _a !== void 0 ? _a : base.appearance,
|
|
167
|
+
useBrandThemingForChat: (_b = override.useBrandThemingForChat) !== null && _b !== void 0 ? _b : base.useBrandThemingForChat,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=theme.js.map
|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