open-chat-studio-widget 0.1.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/README.md +62 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/index-3826e5a2.js +1310 -0
- package/dist/cjs/index-3826e5a2.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +49 -0
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -0
- package/dist/cjs/open-chat-studio-widget.cjs.js +27 -0
- package/dist/cjs/open-chat-studio-widget.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/ocs-chat/ocs-chat.css +1222 -0
- package/dist/collection/components/ocs-chat/ocs-chat.js +117 -0
- package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/open-chat-studio-widget.d.ts +11 -0
- package/dist/components/open-chat-studio-widget.js +69 -0
- package/dist/components/open-chat-studio-widget.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/index-9a12ccff.js +1283 -0
- package/dist/esm/index-9a12ccff.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/open-chat-studio-widget.entry.js +45 -0
- package/dist/esm/open-chat-studio-widget.entry.js.map +1 -0
- package/dist/esm/open-chat-studio-widget.js +22 -0
- package/dist/esm/open-chat-studio-widget.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/open-chat-studio-widget/index.esm.js +2 -0
- package/dist/open-chat-studio-widget/index.esm.js.map +1 -0
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +2 -0
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js.map +1 -0
- package/dist/open-chat-studio-widget/p-b1996f7e.entry.js +2 -0
- package/dist/open-chat-studio-widget/p-b1996f7e.entry.js.map +1 -0
- package/dist/open-chat-studio-widget/p-d346075a.js +3 -0
- package/dist/open-chat-studio-widget/p-d346075a.js.map +1 -0
- package/dist/open-chat-studio-widget/p-e1255160.js +2 -0
- package/dist/open-chat-studio-widget/p-e1255160.js.map +1 -0
- package/dist/types/components/ocs-chat/ocs-chat.d.ts +10 -0
- package/dist/types/components.d.ts +43 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1680 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Open Chat Studio Chat Component
|
|
2
|
+
|
|
3
|
+
A Web Component built with [Stencil](https://stenciljs.com/) that allows you to add a chat dialog to a web page
|
|
4
|
+
that is connected to a public Open Chat Studio (OCS) bot.
|
|
5
|
+
|
|
6
|
+
## Getting Started
|
|
7
|
+
|
|
8
|
+
To try this component out, run:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install
|
|
12
|
+
npm start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Now load the localhost URL shown in the console in your browser.
|
|
16
|
+
|
|
17
|
+
Note that this requires you to have OCS running locally on port 8000.
|
|
18
|
+
You will also need to set the `boturl` property on the `open-chat-studio-widget` element to the URL of a bot you have
|
|
19
|
+
running locally.
|
|
20
|
+
|
|
21
|
+
To build the component for production, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run build
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To run the unit tests for the components, run:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Making Changes
|
|
34
|
+
|
|
35
|
+
To make changes to the component, you can edit the files in the `src/components/open-chat-studio-widget` directory. You can
|
|
36
|
+
also edit the `src/index.html` file to change the page that is loaded when you run `npm start`.
|
|
37
|
+
|
|
38
|
+
### Styling
|
|
39
|
+
|
|
40
|
+
The component uses [Tailwind CSS](https://tailwindcss.com/) with [DaisyUI](https://daisyui.com/) for styling.
|
|
41
|
+
|
|
42
|
+
## Using this component
|
|
43
|
+
|
|
44
|
+
There are three strategies we recommend for using web components built with Stencil.
|
|
45
|
+
|
|
46
|
+
The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
|
47
|
+
|
|
48
|
+
Once you've set up your local npm account, can do this by running
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
npm publish
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Script tag
|
|
55
|
+
|
|
56
|
+
- Put a script tag similar to this `<script type='module' src='https://unpkg.com/open-chat-studio-widget@0.0.1/dist/open-chat-studio-widget.esm.js'></script>` in the head of your index.html
|
|
57
|
+
- Then you can use the element anywhere in your template, JSX, html etc
|
|
58
|
+
|
|
59
|
+
### Node Modules
|
|
60
|
+
- Run `npm install open-chat-studio-widget --save`
|
|
61
|
+
- Put a script tag similar to this `<script type='module' src='node_modules/open-chat-studio-widget/dist/open-chat-studio-widget.esm.js'></script>` in the head of your index.html
|
|
62
|
+
- Then you can use the element anywhere in your template, JSX, html etc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"app-globals-3a1e7e63.js","mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;","names":[],"sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\n"],"version":3}
|