@subiz/widget-v4 4.1.87 → 4.1.89
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/Widget.js +2 -1
- package/compiled_src/lib.js +20 -1
- package/compiled_src/store/store.js +6 -1
- package/compiled_src/util/common.js +1 -0
- package/dist/190ba49045c.app.js +1 -0
- package/dist/{190815938a3.index.html → 190ba49045c.index.html} +1 -1
- package/dist/{190815938a3.library.html → 190ba49045c.library.html} +1 -1
- package/dist/190ba49045c.library.js +1 -0
- package/dist/{190815938a3.preview.html → 190ba49045c.preview.html} +1 -1
- package/dist/190ba49045c.preview.js +1 -0
- package/dist/190ba49045c.screenshoot.js +1 -0
- package/dist/190ba49045c.webview.js +1 -0
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +32 -6
- package/loader.js +4 -1
- package/package.json +6 -6
- package/src/chatbox/Widget.js +4 -3
- package/src/lib.js +21 -1
- package/src/store/store.js +7 -1
- package/src/util/common.js +1 -0
- package/dist/190815938a3.app.js +0 -1
- package/dist/190815938a3.library.js +0 -1
- package/dist/190815938a3.preview.js +0 -1
- package/dist/190815938a3.screenshoot.js +0 -1
- package/dist/190815938a3.webview.js +0 -1
- /package/dist/{190815938a3.127.js → 190ba49045c.127.js} +0 -0
- /package/dist/{190815938a3.132.js → 190ba49045c.132.js} +0 -0
- /package/dist/{190815938a3.185.js → 190ba49045c.185.js} +0 -0
- /package/dist/{190815938a3.27.js → 190ba49045c.27.js} +0 -0
- /package/dist/{190815938a3.278.js → 190ba49045c.278.js} +0 -0
- /package/dist/{190815938a3.459.js → 190ba49045c.459.js} +0 -0
- /package/dist/{190815938a3.490.js → 190ba49045c.490.js} +0 -0
- /package/dist/{190815938a3.74.js → 190ba49045c.74.js} +0 -0
- /package/dist/{190815938a3.997.js → 190ba49045c.997.js} +0 -0
|
@@ -286,7 +286,8 @@ class Widget extends _common.Com {
|
|
|
286
286
|
value: _index.default.stringify(field.value)
|
|
287
287
|
};
|
|
288
288
|
});
|
|
289
|
-
this.props.store.submitForm('chatbox_' + formName, formData, user);
|
|
289
|
+
await this.props.store.submitForm('chatbox_' + formName, formData, user);
|
|
290
|
+
await _index.default.sleep(500);
|
|
290
291
|
if (_creating != this._creating) return;
|
|
291
292
|
if (this.props.cid) {
|
|
292
293
|
this.setState({
|
package/compiled_src/lib.js
CHANGED
|
@@ -72,7 +72,7 @@ class Widget {
|
|
|
72
72
|
param = param || {};
|
|
73
73
|
let accid = param.account_id;
|
|
74
74
|
let ref = param.ref;
|
|
75
|
-
let user = await this.store.init(accid, undefined, ref);
|
|
75
|
+
let user = await this.store.init(accid, undefined, ref, param);
|
|
76
76
|
_index.default.setTimeout(() => window.postMessage({
|
|
77
77
|
type: 'widget_loaded',
|
|
78
78
|
account_id: accid
|
|
@@ -87,6 +87,25 @@ class Widget {
|
|
|
87
87
|
this.domGate.open();
|
|
88
88
|
return user;
|
|
89
89
|
}
|
|
90
|
+
async start(param, $container, mask, cb) {
|
|
91
|
+
param = param || {};
|
|
92
|
+
let id = param.account_id;
|
|
93
|
+
let outmask = await this.store.init(id, mask, param.ref, param);
|
|
94
|
+
_index.default.setTimeout(() => window.postMessage({
|
|
95
|
+
type: 'widget_loaded',
|
|
96
|
+
account_id: id
|
|
97
|
+
}, '*'), 0);
|
|
98
|
+
if (!$container) $container = document.body || document;
|
|
99
|
+
this.pluginMgr = new _plugin.default(this, $container);
|
|
100
|
+
let clean = _index.default.setInterval(() => {
|
|
101
|
+
if ($container && $container.isConnected) return;
|
|
102
|
+
this.pluginMgr.destroy();
|
|
103
|
+
_index.default.clearInterval(clean);
|
|
104
|
+
}, 1000);
|
|
105
|
+
this.domGate.open();
|
|
106
|
+
cb && cb(outmask);
|
|
107
|
+
return outmask;
|
|
108
|
+
}
|
|
90
109
|
async setAccount(id, $container, mask, cb) {
|
|
91
110
|
let outmask = await this.store.init(id, mask);
|
|
92
111
|
_index.default.setTimeout(() => window.postMessage({
|
|
@@ -362,10 +362,15 @@ class Store {
|
|
|
362
362
|
await this.readyGate.entry();
|
|
363
363
|
if (!this.isInsync('account')) this.reconnect();
|
|
364
364
|
}
|
|
365
|
-
async init(accid, mask, userRef) {
|
|
365
|
+
async init(accid, mask, userRef, options) {
|
|
366
366
|
this.readyGate.close();
|
|
367
367
|
accid = (accid || '').trim();
|
|
368
368
|
this.g_sync = {};
|
|
369
|
+
if (!options || !options.use_subdomain_cookie) {
|
|
370
|
+
if (window && window.location && window.location.hostname) {
|
|
371
|
+
cookie.defaults.domain = '.' + window.location.hostname;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
369
374
|
if (!userRef) {
|
|
370
375
|
try {
|
|
371
376
|
userRef = this.cookie.get('__sbref', '');
|