@subiz/widget-v4 4.1.103 → 4.1.104
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/compiled_src/chatbox/ChatButton.js +5 -0
- package/compiled_src/chatbox/Widget.js +9 -9
- package/compiled_src/chatbox/main.js +1 -0
- package/compiled_src/lib.js +3 -0
- package/compiled_src/store/api.js +1 -0
- package/compiled_src/store/store.js +3 -0
- package/dist/127.js +273 -0
- package/dist/132.js +2569 -6434
- package/dist/185.js +1885 -0
- package/dist/191ee43a45a.127.js +1 -0
- package/dist/191ee43a45a.132.js +1 -0
- package/dist/191ee43a45a.185.js +1 -0
- package/dist/191ee43a45a.27.js +1 -0
- package/dist/191ee43a45a.278.js +1 -0
- package/dist/191ee43a45a.459.js +1 -0
- package/dist/191ee43a45a.490.js +1 -0
- package/dist/191ee43a45a.74.js +1 -0
- package/dist/191ee43a45a.997.js +1 -0
- package/dist/191ee43a45a.app.js +1 -0
- package/dist/{18a02a9c54e.index.html → 191ee43a45a.index.html} +28 -4
- package/dist/{18a02a9c54e.library.html → 191ee43a45a.library.html} +28 -4
- package/dist/191ee43a45a.library.js +1 -0
- package/dist/{18a02a9c54e.preview.html → 191ee43a45a.preview.html} +1 -1
- package/dist/191ee43a45a.preview.js +1 -0
- package/dist/191ee43a45a.webview.js +1 -0
- package/dist/{782.js → 27.js} +7 -7
- package/dist/278.js +406 -0
- package/dist/{362.js → 459.js} +7 -7
- package/dist/{605.js → 490.js} +82 -82
- package/dist/{335.js → 74.js} +35 -35
- package/dist/{678.js → 997.js} +6 -6
- package/dist/HASH +1 -1
- package/dist/assets/img/{subiz-mono.877e9f5.svg → subiz-mono.8fbc067.svg} +1 -1
- package/dist/malicious-app.js +6 -4
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +6730 -2489
- package/package.json +3 -3
- package/src/chatbox/ChatButton.js +4 -0
- package/src/chatbox/Widget.js +9 -10
- package/src/chatbox/main.js +2 -0
- package/src/lib.js +4 -0
- package/src/store/api.js +1 -0
- package/src/store/store.js +4 -0
- package/dist/178.js +0 -406
- package/dist/18a02a9c54e.132.js +0 -1
- package/dist/18a02a9c54e.178.js +0 -1
- package/dist/18a02a9c54e.213.js +0 -1
- package/dist/18a02a9c54e.335.js +0 -1
- package/dist/18a02a9c54e.362.js +0 -1
- package/dist/18a02a9c54e.441.js +0 -1
- package/dist/18a02a9c54e.605.js +0 -1
- package/dist/18a02a9c54e.678.js +0 -1
- package/dist/18a02a9c54e.782.js +0 -1
- package/dist/18a02a9c54e.app.js +0 -1
- package/dist/18a02a9c54e.library.js +0 -1
- package/dist/18a02a9c54e.preview.js +0 -1
- package/dist/18a02a9c54e.screenshoot.js +0 -1
- package/dist/18a02a9c54e.webview.js +0 -1
- package/dist/213.js +0 -2780
- package/dist/441.js +0 -2855
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subiz/widget-v4",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.104",
|
|
4
4
|
"main": "./compiled_src/lib.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npx webpack serve --config webpack.dev.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
28
28
|
"@babel/plugin-transform-react-jsx": "^7.25.2",
|
|
29
29
|
"@babel/preset-env": "^7.25.4",
|
|
30
|
-
"babel-loader": "^9.1
|
|
30
|
+
"babel-loader": "^9.2.1",
|
|
31
31
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
32
32
|
"html-webpack-plugin": "^5.6.0",
|
|
33
|
-
"puppeteer": "^23.3.
|
|
33
|
+
"puppeteer": "^23.3.1",
|
|
34
34
|
"webpack": "^5.94.0",
|
|
35
35
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
36
36
|
"webpack-cli": "^5.1.4",
|
|
@@ -100,6 +100,10 @@ export default class ChatButton extends Com {
|
|
|
100
100
|
this.setState({previewEvent: {}})
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
ClosePreview() {
|
|
104
|
+
this.setState({displayPreview: false})
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
// this method could be call from the parent
|
|
104
108
|
ShowGreeting() {
|
|
105
109
|
// workaround for bao chau elect dont want show greeting in mobile
|
package/src/chatbox/Widget.js
CHANGED
|
@@ -279,6 +279,15 @@ export default class Widget extends Com {
|
|
|
279
279
|
formMounted = (form) => {
|
|
280
280
|
// waiting for element to be created
|
|
281
281
|
let formData = this.fillForm(form)
|
|
282
|
+
if (form.question_required || this.state.quickReplyMessage.text) {
|
|
283
|
+
formData['question'] = {
|
|
284
|
+
key: 'question',
|
|
285
|
+
is_required: true,
|
|
286
|
+
label: this.props.t.i18n(sb.get(form, `i18n_question_label`, {})) || form.question_label,
|
|
287
|
+
type: 'text',
|
|
288
|
+
value: this.state.quickReplyMessage.text,
|
|
289
|
+
}
|
|
290
|
+
}
|
|
282
291
|
|
|
283
292
|
this.setState({formData})
|
|
284
293
|
// dont steal focus on mobile or trying to override form
|
|
@@ -1155,16 +1164,6 @@ export default class Widget extends Com {
|
|
|
1155
1164
|
list: sb.map(form.groups, (group) => ({value: group.id, label: group.name})),
|
|
1156
1165
|
}
|
|
1157
1166
|
}
|
|
1158
|
-
|
|
1159
|
-
if (form.question_required) {
|
|
1160
|
-
data['question'] = {
|
|
1161
|
-
key: 'question',
|
|
1162
|
-
is_required: true,
|
|
1163
|
-
label: this.props.t.i18n(sb.get(form, `i18n_question_label`, {})) || form.question_label,
|
|
1164
|
-
type: 'text',
|
|
1165
|
-
value: this.state.quickReplyMessage.text,
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
1167
|
return data
|
|
1169
1168
|
}
|
|
1170
1169
|
}
|
package/src/chatbox/main.js
CHANGED
|
@@ -188,6 +188,8 @@ export default class Main extends Com {
|
|
|
188
188
|
|
|
189
189
|
onWidgetClose() {
|
|
190
190
|
this.refButton.current && this.refButton.current.ClearPreview()
|
|
191
|
+
// need call closePreview if not this will display default agent avatar and account name
|
|
192
|
+
this.refButton.current && this.refButton.current.ClosePreview()
|
|
191
193
|
this.props.store.setHasManuallyClosed()
|
|
192
194
|
this.hideWidget()
|
|
193
195
|
|
package/src/lib.js
CHANGED
package/src/store/api.js
CHANGED
|
@@ -314,4 +314,5 @@ export default class {
|
|
|
314
314
|
list_wards = (p) => this.apireq.setQuery(p).get(`/accounts/${this.accid}/wards`)
|
|
315
315
|
|
|
316
316
|
suggest_address = (keyword) => this.apireq.setQuery({keyword: keyword}).get(`/accounts/${this.accid}/addresses`)
|
|
317
|
+
create_ticket = (ticket) => this.apireq.post(`/accounts/${this.accid}/tickets`, ticket)
|
|
317
318
|
}
|
package/src/store/store.js
CHANGED
|
@@ -168,6 +168,10 @@ export default class Store {
|
|
|
168
168
|
return this.api.createShippingAddress(addr)
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
createTicket(ticket) {
|
|
172
|
+
return this.api.create_ticket(ticket)
|
|
173
|
+
}
|
|
174
|
+
|
|
171
175
|
async overrideAcc(acc) {
|
|
172
176
|
this.forceAcc = sb.cloneDeep(acc)
|
|
173
177
|
await this.readyGate.entry()
|