@soyio/soyio-widget 0.0.1 → 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 +31 -1
- package/dist/constants.d.ts +1 -1
- package/dist/events.d.ts +3 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +2185 -20
- package/dist/index.umd.cjs +17 -1
- package/dist/listeners.d.ts +3 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
1
|
# soy-io-widget
|
|
2
|
-
This is the library for include a soyio widget
|
|
2
|
+
This is the library for include a soyio widget.
|
|
3
|
+
|
|
4
|
+
This library contemplate that a div element with ID: `soyio-widget-iframe-container` should be created before instantiate the widget.
|
|
5
|
+
|
|
6
|
+
## How to work
|
|
7
|
+
|
|
8
|
+
For frontend frameworks, this should be imported as follows.
|
|
9
|
+
|
|
10
|
+
``` html
|
|
11
|
+
<script>
|
|
12
|
+
// insert setup of your framework here!!
|
|
13
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
14
|
+
new Widget({ userEmail: 'example@email.com', companyName: 'Company name'})
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
<body>
|
|
18
|
+
<div id="soyio-widget-iframe-container"></div>
|
|
19
|
+
</body>
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The widget class receive the following object when is initialized:
|
|
24
|
+
|
|
25
|
+
```JS
|
|
26
|
+
{
|
|
27
|
+
userEmail?: string
|
|
28
|
+
companyName?: string
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
And if there is an email this is sended to the iframe.
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const IFRAME_ID = "soyio-widget-iframe";
|
|
2
|
-
export declare const DEVELOPMENT_WIDGET_URL = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com";
|
|
2
|
+
export declare const DEVELOPMENT_WIDGET_URL = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";
|
package/dist/events.d.ts
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
1
|
+
interface WidgetProps {
|
|
2
|
+
userEmail?: string;
|
|
3
|
+
}
|
|
4
|
+
declare class Widget {
|
|
5
|
+
private iframe;
|
|
6
|
+
userEmail?: string;
|
|
7
|
+
constructor({ userEmail }: WidgetProps);
|
|
8
|
+
initialize(): void;
|
|
9
|
+
}
|
|
10
|
+
export default Widget;
|