@soyio/soyio-widget 0.0.2 → 0.0.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 (2) hide show
  1. package/README.md +11 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,32 +1,31 @@
1
1
  # soy-io-widget
2
2
  This is the library for include a soyio widget.
3
3
 
4
- This library contemplate that an iframe with the ID: soyio-widget-iframe should be created before instantiate the widget.
4
+ This library contemplate that a div element with ID: `soyio-widget-iframe-container` should be created before instantiate the widget.
5
5
 
6
6
  ## How to work
7
7
 
8
8
  For frontend frameworks, this should be imported as follows.
9
9
 
10
- ``` VUE
10
+ ``` html
11
11
  <script>
12
- import Widget from '@soyio/soyio-widget'
13
-
14
- // Vue syntax
15
- onMounted(() => {
16
- const widget = new Widget()
17
- })
12
+ // insert setup of your framework here!!
13
+ document.addEventListener('DOMContentLoaded', function() {
14
+ new Widget({ userEmail: 'example@email.com', companyName: 'Company name'})
15
+ });
18
16
  </script>
19
- <template>
20
- <iframe id="soyio-widget-iframe"></iframe>
21
- </template>
17
+ <body>
18
+ <div id="soyio-widget-iframe-container"></div>
19
+ </body>
22
20
 
23
21
  ```
24
22
 
25
- The widget class receive the following object:
23
+ The widget class receive the following object when is initialized:
26
24
 
27
25
  ```JS
28
26
  {
29
27
  userEmail?: string
28
+ companyName?: string
30
29
  }
31
30
  ```
32
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",