@moveo-ai/web-client 0.15.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/README.md ADDED
@@ -0,0 +1,17 @@
1
+ ## Web Widget
2
+
3
+ <blockquote>Moveo web client integration</blockquote>
4
+
5
+ ![](https://user-images.githubusercontent.com/52110045/147710079-c7da74c3-de6a-47e4-9ef8-83cadd4b1f5f.png)
6
+
7
+ ## ⭐️ Features
8
+
9
+ ![](https://user-images.githubusercontent.com/52110045/147710060-7ed0eed1-df5e-4f51-ba14-f3fa040a7a7f.png)
10
+
11
+ ## 📦 Getting Started
12
+
13
+ 1. Create an account in console.moveo.ai
14
+ 1. Create a desk
15
+ 1. Create a web integration
16
+ 1. Copy the snippet to your website html
17
+ 1. Enjoy 🚀
@@ -0,0 +1,38 @@
1
+ <!doctype html><html><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><title>Development</title><style>/* The way to override styles */
2
+
3
+ /**
4
+ .moveo_web_client1 > div:first-child div {
5
+ --background-color:red;
6
+ }
7
+ .moveo_web_client1 .mo_bubble{
8
+ transform: translateX(-100px);
9
+ }
10
+ .moveo_web_client2 .mo_bubble{
11
+ transform: rotate(45deg);
12
+ }
13
+ */
14
+
15
+ body {
16
+ background-color: #f5f6f8;
17
+ }</style></head><body><script src="web-client.min.js"></script><script src="https://cdn.jsdelivr.net/npm/js-base64@2.5.2/base64.min.js"></script><script>const queryString = window.location.search;
18
+ const urlParams = new URLSearchParams(queryString);
19
+ const encodedConfig = urlParams.get('c');
20
+ let config = {};
21
+
22
+ if (encodedConfig) {
23
+ config = JSON.parse(Base64.decode(encodedConfig));
24
+ } else if (urlParams.get('integrationId')) {
25
+ const search = queryString.substring(1);
26
+ config = JSON.parse(
27
+ '{"' + search.replace(/&/g, '","').replace(/=/g, '":"') + '"}',
28
+ (key, value) => (key === '' ? value : decodeURIComponent(value))
29
+ );
30
+ }
31
+
32
+ console.log({ config });
33
+ MoveoAI.init({ ...config, namespace: 'inline_1' })
34
+ .then((agent) => {
35
+ console.log('agent', agent);
36
+ console.log('Desk connected');
37
+ })
38
+ .catch((err) => console.error(err));</script></body></html>