@meetelise/chat 1.4.1 → 1.5.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/src/themes.ts ADDED
@@ -0,0 +1,88 @@
1
+ export const white = "#FFFFFF";
2
+ export const darkGray = "#202020";
3
+ export const lightGray = "#83818E";
4
+
5
+ export const defaultThemeId = "Light" as keyof typeof themesById;
6
+
7
+ export const lightMessage = {
8
+ user: { textColor: white, backgroundColor: lightGray },
9
+ agent: { textColor: darkGray, backgroundColor: white },
10
+ };
11
+ export const darkMessage = {
12
+ user: { textColor: white, backgroundColor: lightGray },
13
+ agent: { textColor: white, backgroundColor: darkGray },
14
+ };
15
+ export const themesById = {
16
+ Light: {
17
+ chatHeader: {
18
+ backgroundColor: white,
19
+ textColor: darkGray,
20
+ },
21
+ chatPaneBackgroundColor: "rgba(255, 255, 255, 0.9)",
22
+ message: darkMessage,
23
+ },
24
+ Dark: {
25
+ chatHeader: {
26
+ backgroundColor: darkGray,
27
+ textColor: white,
28
+ },
29
+ chatPaneBackgroundColor: "rgba(32, 32, 32, 0.9)",
30
+ message: lightMessage,
31
+ },
32
+ Purple: {
33
+ chatHeader: {
34
+ backgroundColor: "#550098",
35
+ textColor: white,
36
+ },
37
+ chatPaneBackgroundColor: "rgba(85, 0, 152, 0.6)",
38
+ message: lightMessage,
39
+ },
40
+ Blue: {
41
+ chatHeader: {
42
+ backgroundColor: "#0814E5",
43
+ textColor: white,
44
+ },
45
+ chatPaneBackgroundColor: "rgba(4, 17, 245, 0.6)",
46
+ message: lightMessage,
47
+ },
48
+ Teal: {
49
+ chatHeader: {
50
+ backgroundColor: "#6EE7ED",
51
+ textColor: darkGray,
52
+ },
53
+ chatPaneBackgroundColor: "rgba(115, 247, 253, 0.8)",
54
+ message: darkMessage,
55
+ },
56
+ Green: {
57
+ chatHeader: {
58
+ backgroundColor: "#147B0E",
59
+ textColor: white,
60
+ },
61
+ chatPaneBackgroundColor: "rgba(13, 141, 5, 0.6)",
62
+ message: lightMessage,
63
+ },
64
+ Yellow: {
65
+ chatHeader: {
66
+ backgroundColor: "#F1E54F",
67
+ textColor: darkGray,
68
+ },
69
+ chatPaneBackgroundColor: "rgba(251, 239, 80, 0.9)",
70
+ message: darkMessage,
71
+ },
72
+ Orange: {
73
+ chatHeader: {
74
+ backgroundColor: "#C06C31",
75
+ textColor: white,
76
+ },
77
+ chatPaneBackgroundColor: "rgba(238, 126, 49, 0.7)",
78
+ message: lightMessage,
79
+ },
80
+ Pink: {
81
+ chatHeader: {
82
+ backgroundColor: "#A24599",
83
+ textColor: white,
84
+ },
85
+ chatPaneBackgroundColor: "rgba(167, 70, 157, 0.8)",
86
+ message: lightMessage,
87
+ },
88
+ };
package/src/utils.ts CHANGED
@@ -22,3 +22,6 @@ export function useInterval(callback: () => void, delay: number | null): void {
22
22
  return () => clearInterval(id);
23
23
  }, [delay]);
24
24
  }
25
+
26
+ export const isMobile = (): boolean =>
27
+ window.matchMedia("(max-width: 767px)").matches;
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- interface ChatBubbleProps {
3
- messages: {
4
- title: string;
5
- text: string;
6
- }[];
7
- triggerBounce: () => void;
8
- bounceIntervalInSeconds: number;
9
- onClick: () => void;
10
- }
11
- declare const ChatBubble: React.FunctionComponent<ChatBubbleProps>;
12
- export default ChatBubble;
@@ -1,21 +0,0 @@
1
- import { esbuildPlugin } from "@web/dev-server-esbuild";
2
- import { fromRollup } from "@web/dev-server-rollup";
3
- import rollupReplace from "@rollup/plugin-replace";
4
-
5
- const replace = fromRollup(rollupReplace);
6
-
7
- export default {
8
- open: true,
9
- nodeResolve: {
10
- browser: true,
11
- },
12
- appIndex: "demo/index.html",
13
- plugins: [
14
- esbuildPlugin({ ts: true, tsx: true, target: "auto" }),
15
- replace({
16
- // setting "include" is important for performance
17
- include: ["node_modules/react/index.js"],
18
- "process.env.NODE_ENV": '"development"',
19
- }),
20
- ],
21
- };