@meetelise/chat 1.11.0 → 1.12.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.
Files changed (57) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/.github/workflows/release.yml +1 -0
  3. package/.vscode/settings.json +6 -1
  4. package/CONTRIBUTING.md +8 -0
  5. package/package.json +9 -10
  6. package/public/demo/index.html +78 -11
  7. package/public/dist/index.js +1713 -1
  8. package/public/dist/index.js.LICENSE.txt +26 -14
  9. package/public/index.html +2 -1
  10. package/src/MEChat.test.ts +5 -5
  11. package/src/MEChat.ts +53 -0
  12. package/src/WebComponent/InHouseLauncher.ts +454 -0
  13. package/src/WebComponent/MEChat.css +5 -0
  14. package/src/WebComponent/MEChat.ts +282 -0
  15. package/src/WebComponent/OfficeHours.ts +73 -0
  16. package/src/WebComponent/Scheduler/date-picker.ts +320 -0
  17. package/src/WebComponent/Scheduler/me-select.ts +244 -0
  18. package/src/WebComponent/Scheduler/time-picker.ts +101 -0
  19. package/src/WebComponent/Scheduler/tour-scheduler.ts +383 -0
  20. package/src/WebComponent/Scheduler/tour-type-option.ts +92 -0
  21. package/src/WebComponent/actions/ActionConfirmButton.ts +94 -0
  22. package/src/WebComponent/actions/CallUsWindow.ts +110 -0
  23. package/src/WebComponent/actions/DetailsWindow.ts +109 -0
  24. package/src/WebComponent/actions/EmailUsWindow.ts +431 -0
  25. package/src/WebComponent/actions/InputStyles.ts +31 -0
  26. package/src/WebComponent/actions/TextUsWindow.ts +226 -0
  27. package/src/WebComponent/actions/formatPhoneNumber.ts +42 -0
  28. package/src/WebComponent/inHouseLauncherStyles.ts +300 -0
  29. package/src/WebComponent/index.ts +2 -0
  30. package/src/WebComponent/utils.ts +82 -0
  31. package/src/fetchBuildingInfo.ts +1 -0
  32. package/src/getAvailabilities.ts +71 -0
  33. package/src/getRegisteredPhoneNumbers.ts +56 -0
  34. package/src/themes.ts +5 -3
  35. package/tsconfig.json +9 -3
  36. package/web-test-runner.config.js +0 -6
  37. package/webpack.config.cjs +8 -25
  38. package/public/dist/index.d.ts +0 -1
  39. package/public/dist/src/ChatButton.d.ts +0 -9
  40. package/public/dist/src/ChatIcon.d.ts +0 -6
  41. package/public/dist/src/InHouseLauncher.d.ts +0 -11
  42. package/public/dist/src/MEChat.d.ts +0 -73
  43. package/public/dist/src/analytics.d.ts +0 -34
  44. package/public/dist/src/assetUrls.d.ts +0 -2
  45. package/public/dist/src/chatID.d.ts +0 -11
  46. package/public/dist/src/createConversation.d.ts +0 -4
  47. package/public/dist/src/fetchBuildingInfo.d.ts +0 -25
  48. package/public/dist/src/themes.d.ts +0 -52
  49. package/public/dist/src/utils.d.ts +0 -2
  50. package/src/ChatButton.module.scss +0 -51
  51. package/src/ChatButton.tsx +0 -38
  52. package/src/ChatIcon.tsx +0 -26
  53. package/src/DemoApp.tsx +0 -113
  54. package/src/InHouseLauncher.module.scss +0 -139
  55. package/src/InHouseLauncher.tsx +0 -69
  56. package/src/MEChat.module.scss +0 -22
  57. package/src/MEChat.tsx +0 -293
package/.eslintrc.cjs CHANGED
@@ -8,6 +8,7 @@ module.exports = {
8
8
  extends: [
9
9
  "eslint:recommended",
10
10
  "plugin:@typescript-eslint/recommended",
11
+ "plugin:lit/recommended",
11
12
  "prettier",
12
13
  ],
13
14
  parser: "@typescript-eslint/parser",
@@ -20,3 +20,4 @@ jobs:
20
20
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
21
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22
22
  LAUNCHDARKLY_CLIENT_ID: "6119b3a2ceeceb24f45c7e66"
23
+ X_SECURITY_HEADER: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"
@@ -4,5 +4,10 @@
4
4
  "[typescript]": {
5
5
  "editor.formatOnSave": true
6
6
  },
7
- "typescript.tsdk": "node_modules/typescript/lib"
7
+ "typescript.tsdk": "node_modules/typescript/lib",
8
+ // Turn Emmet on when writing Lit
9
+ "emmet.includeLanguages": {
10
+ "javascript": "html",
11
+ "typescript": "html"
12
+ }
8
13
  }
package/CONTRIBUTING.md CHANGED
@@ -15,6 +15,14 @@ Run `npm start` to run the dev server, Ctrl+C to stop it.
15
15
 
16
16
  To test the build on a static test page, run `npx serve public`, optionally supplying a port number with the `-p` flag.
17
17
 
18
+ We use:
19
+
20
+ - Lit, a framework for developing web components: https://lit.dev/
21
+ - TypeScript: https://www.typescriptlang.org/
22
+ - Webpack: https://webpack.js.org/
23
+ - ESLint: https://eslint.org/
24
+ - Prettier: https://prettier.io/
25
+
18
26
  ## Unit tests
19
27
 
20
28
  Run `npm test` to run unit tests via [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) in a headless browser.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.11.0",
3
+ "version": "1.12.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "public/dist/index.js",
7
7
  "module": "public/dist/index.js",
8
8
  "types": "public/dist/index.d.ts",
9
9
  "scripts": {
10
- "start": "webpack serve --mode=development --env isDemoApp --open",
10
+ "start": "webpack serve --mode=development --open",
11
11
  "test": "npm run build; web-test-runner",
12
12
  "test:watch": "web-test-runner --watch",
13
13
  "build": "webpack --mode=production",
@@ -28,28 +28,23 @@
28
28
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
29
29
  "devDependencies": {
30
30
  "@esm-bundle/chai": "^4.3.4-fix.0",
31
- "@rollup/plugin-replace": "^3.0.1",
32
31
  "@types/lodash": "^4.14.178",
33
32
  "@types/react": "^17.0.38",
34
- "@types/react-dom": "^17.0.11",
35
- "@types/sass": "^1.43.1",
36
33
  "@types/uuid": "^8.3.1",
37
34
  "@typescript-eslint/eslint-plugin": "^4.31.2",
38
35
  "@typescript-eslint/parser": "^4.31.2",
36
+ "@web/dev-server": "^0.1.30",
39
37
  "@web/dev-server-esbuild": "^0.2.16",
40
38
  "@web/test-runner": "^0.13.17",
41
39
  "css-loader": "^6.5.1",
42
- "css-modules-typescript-loader": "^4.0.1",
43
- "cz-conventional-changelog": "^3.3.0",
44
40
  "dotenv-webpack": "^7.0.3",
45
41
  "eslint": "^7.32.0",
46
42
  "eslint-config-prettier": "^8.3.0",
43
+ "eslint-plugin-lit": "^1.6.1",
47
44
  "html-webpack-plugin": "^5.5.0",
48
45
  "husky": "^7.0.2",
49
46
  "lint-staged": "^11.1.2",
50
47
  "prettier": "^2.4.1",
51
- "sass": "^1.45.2",
52
- "sass-loader": "^12.4.0",
53
48
  "semantic-release": "^18.0.0",
54
49
  "sinon": "^11.1.2",
55
50
  "style-loader": "^3.3.1",
@@ -61,10 +56,14 @@
61
56
  "webpack-dev-server": "^4.7.2"
62
57
  },
63
58
  "dependencies": {
59
+ "@meetelise/rest-sdk": "^0.0.129",
60
+ "axios": "^0.27.2",
64
61
  "classnames": "^2.3.1",
62
+ "date-fns": "^2.28.0",
63
+ "dotenv": "^16.0.1",
64
+ "lit": "^2.2.4",
65
65
  "lodash": "^4.17.21",
66
66
  "react": "^17.0.2",
67
- "react-dom": "^17.0.2",
68
67
  "talkjs": "^0.14.5",
69
68
  "uuid": "^8.3.2"
70
69
  },
@@ -13,9 +13,6 @@
13
13
  /* Complex background image so we can evaluate transparency and blur effects */
14
14
  background: url("https://assets.dnainfo.com/photo/2016/9/1473799613-272887/original.jpg");
15
15
  background-size: cover;
16
- margin: 0;
17
- min-height: 100vh;
18
- width: 100%;
19
16
  font-family: sans-serif;
20
17
  display: flex;
21
18
  flex-direction: column;
@@ -28,6 +25,10 @@
28
25
  max-width: 600px;
29
26
  background-color: #fff;
30
27
  }
28
+ form#theme {
29
+ display: flex;
30
+ flex-direction: column;
31
+ }
31
32
  button {
32
33
  padding: 0.5rem 1rem;
33
34
  border-radius: 0.25rem;
@@ -45,21 +46,87 @@
45
46
  button:active {
46
47
  background-color: #bbb;
47
48
  }
48
- .meetelise-chat.launcher {
49
- bottom: 10vh;
50
- right: 10vh;
49
+ #bottomBanner {
50
+ position: fixed;
51
+ bottom: 0;
52
+ left: 0;
53
+ width: 100%;
54
+ height: 20vh;
55
+ background-color: lightpink;
56
+ text-align: center;
57
+ }
58
+ #bannerText {
59
+ margin-top: 5em;
60
+ }
61
+ #bannerCloseButton {
62
+ position: absolute;
63
+ top: 1rem;
64
+ left: 1rem;
65
+ cursor: pointer;
51
66
  }
52
- .meetelise-chat.pane {
53
- bottom: calc(10vh + 60px);
54
- right: calc(10vh - 25px);
67
+ #bannerCloseButton:hover::after {
68
+ content: "";
69
+ position: absolute;
70
+ top: 50%;
71
+ left: 50%;
72
+ transform: translate(-50%, -50%);
73
+ background-color: lightgray;
74
+ height: 100%;
75
+ aspect-ratio: 1 / 1;
76
+ border-radius: 50%;
77
+ z-index: -1;
78
+ user-select: none;
55
79
  }
56
80
  /* Test CSS isolation: this padding will make the launcher look terrible unless it has taken defensive measures against host page styles */
57
- div {
81
+ /* (the exclusions are for the banner and the Guru extension's stuff. padding them causes scrollbars) */
82
+ div:not(#bottomBanner, .ghq-ext-app) {
58
83
  padding: 10px;
59
84
  }
60
85
  </style>
61
86
  </head>
62
87
  <body>
63
- <main id="root"></main>
88
+ <!-- Webpack dev server will serve the bundle, index.js, at the path '/' -->
89
+ <script type="module" async>
90
+ import MEChat from "/index.js";
91
+ MEChat.start({
92
+ organization: "test-company",
93
+ building: "e2e-test-yardi-building",
94
+ });
95
+ </script>
96
+ <main>
97
+ <h1>Example Page</h1>
98
+ <p>This is an example page for serving the chat widget locally.</p>
99
+ <button id="reset" type="button">Restart conversation</button>
100
+ <form id="theme">
101
+ <label htmlFor="chatTitle">Title</label>
102
+ <input type="text" id="chatTitle" name="chatTitle" />
103
+ <label htmlFor="chatSubtitle">Subtitle</label>
104
+ <input type="text" id="chatSubtitle" name="chatSubtitle" />
105
+ <label htmlFor="bannerColor">Banner Color</label>
106
+ <input type="text" id="bannerColor" name="bannerColor" />
107
+ <label htmlFor="bannerTextColor">Banner Text Color</label>
108
+ <input type="text" id="bannerTextColor" name="bannerTextColor" />
109
+ <label htmlFor="launchButtonColor">Launch Button Color</label>
110
+ <input type="text" id="launchButtonColor" name="launchButtonColor" />
111
+ <label htmlFor="launchButtonIconColor">Launch Button Icon Color</label>
112
+ <input
113
+ type="text"
114
+ id="launchButtonIconColor"
115
+ name="launchButtonIconColor"
116
+ />
117
+ </form>
118
+ <div id="bottomBanner">
119
+ <p id="bannerText">
120
+ Hi, I'm a banner that appears at the bottom of the screen! I eat chat
121
+ widgets for breakfast and I'll eat yours if you aren't careful!
122
+ </p>
123
+ <div
124
+ id="bannerCloseButton"
125
+ onclick="document.querySelector('#bottomBanner')?.remove()"
126
+ >
127
+
128
+ </div>
129
+ </div>
130
+ </main>
64
131
  </body>
65
132
  </html>