@release0/js 1.1.3 → 1.1.5
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 +13 -13
- package/dist/index.d.ts +5 -4
- package/dist/web.js +79 -2097
- package/package.json +17 -12
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @release0/js
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
<script type="module">
|
|
19
|
-
import Agent from 'https://cdn.jsdelivr.net/npm/@release0/js@1.1.
|
|
19
|
+
import Agent from 'https://cdn.jsdelivr.net/npm/@release0/js@1.1.5/dist/web.js'
|
|
20
20
|
|
|
21
21
|
Agent.initStandard({
|
|
22
22
|
agent: 'my-agent-id',
|
|
@@ -34,7 +34,7 @@ There, you can change the container dimensions. Here is a code example:
|
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<script type="module">
|
|
37
|
-
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.
|
|
37
|
+
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.5/dist/web.js";
|
|
38
38
|
|
|
39
39
|
Agent.initStandard({
|
|
40
40
|
agent: "my-agent-id",
|
|
@@ -54,17 +54,17 @@ Here is an example:
|
|
|
54
54
|
|
|
55
55
|
```html
|
|
56
56
|
<script type="module">
|
|
57
|
-
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.
|
|
57
|
+
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.5/dist/web.js";
|
|
58
58
|
|
|
59
59
|
Agent.initPopup({
|
|
60
|
-
agent: "
|
|
60
|
+
agent: "ag_herexisxyourxagentxid",
|
|
61
61
|
apiHost: "https://release0.com",
|
|
62
|
-
autoShowDelay:
|
|
62
|
+
autoShowDelay: 2000,
|
|
63
63
|
});
|
|
64
64
|
</script>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
This code will automatically trigger the popup window after
|
|
67
|
+
This code will automatically trigger the popup window after 2 seconds.
|
|
68
68
|
|
|
69
69
|
### Open or Close a popup
|
|
70
70
|
|
|
@@ -96,10 +96,10 @@ Here is an example:
|
|
|
96
96
|
|
|
97
97
|
```html
|
|
98
98
|
<script type="module">
|
|
99
|
-
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.
|
|
99
|
+
import Agent from "https://cdn.jsdelivr.net/npm/@release0/js@1.1.5/dist/web.js";
|
|
100
100
|
|
|
101
101
|
Agent.initBubble({
|
|
102
|
-
agent: "
|
|
102
|
+
agent: "ag_herexisxyourxagentxid",
|
|
103
103
|
previewMessage: {
|
|
104
104
|
message: "I have a question for you!",
|
|
105
105
|
autoShowDelay: 5000,
|
|
@@ -156,14 +156,14 @@ You can prefill the agent variable values in your embed code by adding the `pref
|
|
|
156
156
|
|
|
157
157
|
```js
|
|
158
158
|
Agent.initStandard({
|
|
159
|
-
agent: "
|
|
159
|
+
agent: "ag_herexisxyourxagentxid",
|
|
160
160
|
prefilledVariables: {
|
|
161
|
-
"
|
|
162
|
-
"User name": "
|
|
161
|
+
"Account URL": "https://my-site.com/account",
|
|
162
|
+
"User name": "My username",
|
|
163
163
|
},
|
|
164
164
|
});
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
It will prefill the `
|
|
167
|
+
It will prefill the `Account URL` variable with "https://my-site.com/account" and the `User name` variable with "My username".
|
|
168
168
|
|
|
169
|
-
Note that if your site URL contains query params (i.e. https://
|
|
169
|
+
Note that if your site URL contains query params (i.e. https://my-site.com?User%20name=My%20username), the variables will automatically be injected to the agent. So you don't need to manually transfer query params to the agent embed configuration.
|
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,10 @@ type OutgoingLog = {
|
|
|
81
81
|
details?: unknown;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
type Answer = {
|
|
85
|
+
message: string;
|
|
86
|
+
blockId: string;
|
|
87
|
+
};
|
|
84
88
|
type AgentProps = {
|
|
85
89
|
id?: string;
|
|
86
90
|
agent: string | any;
|
|
@@ -93,10 +97,7 @@ type AgentProps = {
|
|
|
93
97
|
startFrom?: StartFrom;
|
|
94
98
|
sessionId?: string;
|
|
95
99
|
onNewInputBlock?: (inputBlock: InputBlock) => void;
|
|
96
|
-
onAnswer?: (answer:
|
|
97
|
-
message: string;
|
|
98
|
-
blockId: string;
|
|
99
|
-
}) => void;
|
|
100
|
+
onAnswer?: (answer: Answer) => void;
|
|
100
101
|
onInit?: () => void;
|
|
101
102
|
onEnd?: () => void;
|
|
102
103
|
onNewLogs?: (logs: OutgoingLog[]) => void;
|