@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.
- package/README.md +11 -12
- 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
|
|
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
|
-
```
|
|
10
|
+
``` html
|
|
11
11
|
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
<
|
|
20
|
-
<
|
|
21
|
-
</
|
|
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
|
|