@2uinc/frontend-component-xpert-chatbot 1.2.0-beta.3 → 1.2.0-beta.4

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 (3) hide show
  1. package/README.md +42 -6
  2. package/dist/lib/index.min.js +2028 -1972
  3. package/package.json +10 -2
package/README.md CHANGED
@@ -36,17 +36,21 @@ See `package.json` for more info.
36
36
 
37
37
  ## To view component library demo and develop (entry point `src/demo.jsx`):
38
38
 
39
- 1. Install dependencies:
39
+ 1. Switch the the correct version of node (install nvm if necessary):
40
+ ```
41
+ nvm use
42
+ ```
43
+ 2. Install dependencies:
40
44
  ```
41
45
  npm i
42
46
  ```
43
- 2. Start app:
47
+ 3. Start app:
44
48
  ```
45
49
  npm start
46
50
  ```
47
- 3. Go to `http://localhost:5173/`
48
- 4. Verify all chatbot ux and functionality work as expected since changes can affect them all
49
- 5. Write automated tests to avoid too much manual verification and to make sure existing functionality isn't broken.
51
+ 4. Go to `http://localhost:5173/`
52
+ 5. Verify all chatbot ux and functionality work as expected since changes can affect them all
53
+ 6. Write automated tests to avoid too much manual verification and to make sure existing functionality isn't broken.
50
54
 
51
55
  `
52
56
  <add picture here>
@@ -104,6 +108,10 @@ Also add to page head element:
104
108
 
105
109
  For clients that don't have React, there's the option to pull the resources from CDN.
106
110
 
111
+ ### CDN
112
+
113
+ A CDN deployment occurs after the NPM deployment for clients that don't have React. See `publishCmd` in package.json.
114
+
107
115
  ```
108
116
  <head>
109
117
  <link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />
@@ -122,9 +130,37 @@ For clients that don't have React, there's the option to pull the resources from
122
130
  </body>
123
131
  ```
124
132
 
133
+ For environments that don't support script type "importmap" (ie Google Tag Manager), manual creation of the script tag will be required:
134
+
135
+ ```
136
+ <script>
137
+ var scriptElement = document.createElement('script');
138
+ scriptElement.type = "importmap";
139
+ var importMap = {
140
+ "imports": {
141
+ "react": "https://cdn.jsdelivr.net/npm/react@17.0.2/+esm",
142
+ "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@17.0.2/+esm"
143
+ }
144
+ };
145
+ var importMapString = JSON.stringify(importMap);
146
+ var importMapElement = document.createTextNode(importMapString);
147
+ scriptElement.appendChild(importMapElement);
148
+ document.head.appendChild(scriptElement);
149
+ </script>
150
+
151
+ <link rel="stylesheet" href="https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.css" />
152
+
153
+ <script>
154
+ var scriptElement = document.createElement('script');
155
+ scriptElement.setAttribute('type', "module");
156
+ scriptElement.setAttribute('src', "https://chatbot-frontend.prod.ai.2u.com/@latest/index.min.js");
157
+ document.body.appendChild(scriptElement);
158
+ </script>
159
+ ```
160
+
125
161
  ## Beta releases
126
162
 
127
- To create a beta release, make a PR to the `beta` branch. Once the PR is merged, a new beta release will be created and published to npmjs.org with the name:
163
+ To create a beta release for testing, make a PR to the `beta` branch. Once the PR is merged, a new beta release will be created and published to npmjs.org with the name:
128
164
 
129
165
  ```
130
166
  @2uinc/frontend-component-xpert-chatbot@v{tag-name}