@subiz/widget-v4 4.0.67 → 4.0.68
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/lib.js +18 -4
- package/compiled_src/store/store.js +1 -0
- package/dist/{17ff367201e.132.js → 1801c652a77.132.js} +0 -0
- package/dist/{17ff367201e.178.js → 1801c652a77.178.js} +0 -0
- package/dist/{17ff367201e.213.js → 1801c652a77.213.js} +0 -0
- package/dist/{17ff367201e.335.js → 1801c652a77.335.js} +0 -0
- package/dist/{17ff367201e.362.js → 1801c652a77.362.js} +0 -0
- package/dist/{17ff367201e.441.js → 1801c652a77.441.js} +0 -0
- package/dist/{17ff367201e.605.js → 1801c652a77.605.js} +0 -0
- package/dist/{17ff367201e.678.js → 1801c652a77.678.js} +0 -0
- package/dist/{17ff367201e.782.js → 1801c652a77.782.js} +0 -0
- package/dist/{17ff367201e.app.js → 1801c652a77.app.js} +1 -1
- package/dist/{17ff367201e.index.html → 1801c652a77.index.html} +1 -1
- package/dist/{17ff367201e.library.html → 1801c652a77.library.html} +1 -1
- package/dist/{17ff367201e.library.js → 1801c652a77.library.js} +1 -1
- package/dist/{17ff367201e.preview.html → 1801c652a77.preview.html} +1 -1
- package/dist/{17ff367201e.preview.js → 1801c652a77.preview.js} +1 -1
- package/dist/{17ff367201e.screenshoot.js → 1801c652a77.screenshoot.js} +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +19 -4
- package/package.json +1 -1
- package/src/lib.js +13 -4
- package/src/store/store.js +1 -0
package/package.json
CHANGED
package/src/lib.js
CHANGED
|
@@ -85,7 +85,15 @@ class Widget {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
async sendMessage(convoid, message) {
|
|
88
|
-
|
|
88
|
+
if (!convoid) {
|
|
89
|
+
const {convo, error} = await this.store.startConvo({
|
|
90
|
+
message: message.text,
|
|
91
|
+
initial_by: this.store.matchUser().id,
|
|
92
|
+
})
|
|
93
|
+
if (error) return {error}
|
|
94
|
+
convoid = convo.id
|
|
95
|
+
}
|
|
96
|
+
return this.store.sendConvoEvent(convoid, 'message_sent', {message})
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
startConvo(req) {
|
|
@@ -102,9 +110,10 @@ class Widget {
|
|
|
102
110
|
this.pluginMgr.hideCurrentGreeting()
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
// view could be: chat, list, offline_form
|
|
114
|
+
async showWidget(view, cid) {
|
|
106
115
|
await this.domGate.entry()
|
|
107
|
-
this.pluginMgr.showCurrentChatbox({view, cid:
|
|
116
|
+
this.pluginMgr.showCurrentChatbox({view, cid: cid})
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
async hideWidget() {
|
|
@@ -112,7 +121,7 @@ class Widget {
|
|
|
112
121
|
this.pluginMgr.hideCurrentChatbox()
|
|
113
122
|
}
|
|
114
123
|
|
|
115
|
-
version = () => '4.
|
|
124
|
+
version = () => '4.5'
|
|
116
125
|
|
|
117
126
|
setSetting = (setting) => this.store.setSetting({account_setting: setting})
|
|
118
127
|
getSetting = (_) => ({account_setting: sb.cloneDeep(this.store.matchAccountSetting())})
|