@seamly/web-ui 21.0.2-beta.7 → 21.0.3-beta.1
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/build/dist/lib/index.debug.js +3 -3
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +59 -18
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +76 -33
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +59 -18
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/utils.js +59 -18
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/conversation-connector.ts +49 -12
- package/src/javascripts/api/index.ts +12 -10
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +2 -2
|
@@ -6717,21 +6717,37 @@ class ConversationConnector {
|
|
|
6717
6717
|
this.channel.on('system', msg => {
|
|
6718
6718
|
switch (msg.type) {
|
|
6719
6719
|
case 'attach_channel_succeeded':
|
|
6720
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6720
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6721
|
+
connected: true,
|
|
6722
|
+
ready: true,
|
|
6723
|
+
currentState: 'attach_channel_succeeded'
|
|
6724
|
+
});
|
|
6721
6725
|
break;
|
|
6722
6726
|
}
|
|
6723
6727
|
});
|
|
6724
6728
|
this.socket.onClose(() => {
|
|
6725
6729
|
log('[SOCKET]CLOSE');
|
|
6726
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6730
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6731
|
+
connected: false,
|
|
6732
|
+
ready: false,
|
|
6733
|
+
currentState: 'socket_closed'
|
|
6734
|
+
});
|
|
6727
6735
|
});
|
|
6728
6736
|
this.channel.onClose(() => {
|
|
6729
6737
|
log('[CHANNEL]CLOSE');
|
|
6730
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6738
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6739
|
+
connected: false,
|
|
6740
|
+
ready: false,
|
|
6741
|
+
currentState: 'channel_closed'
|
|
6742
|
+
});
|
|
6731
6743
|
});
|
|
6732
6744
|
this.channel.onError(msg => {
|
|
6733
6745
|
log('[CHANNEL][ERROR]', msg);
|
|
6734
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6746
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6747
|
+
connected: false,
|
|
6748
|
+
ready: false,
|
|
6749
|
+
currentState: 'channel_erred'
|
|
6750
|
+
});
|
|
6735
6751
|
});
|
|
6736
6752
|
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_listenTo).call(this, 'ack', 'ui', 'error', 'participant', 'message', 'service_data', 'system', 'info', 'sync');
|
|
6737
6753
|
});
|
|
@@ -6739,10 +6755,18 @@ class ConversationConnector {
|
|
|
6739
6755
|
start() {
|
|
6740
6756
|
this.channel.join().receive('ok', () => {
|
|
6741
6757
|
log('[CHANNEL][JOIN] OK');
|
|
6742
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6758
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6759
|
+
connected: true,
|
|
6760
|
+
ready: false,
|
|
6761
|
+
currentState: 'join_channel_succeeded'
|
|
6762
|
+
});
|
|
6743
6763
|
}).receive('error', err => {
|
|
6744
6764
|
log('[CHANNEL][JOIN] ERROR', err);
|
|
6745
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6765
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6766
|
+
connected: false,
|
|
6767
|
+
ready: false,
|
|
6768
|
+
currentState: 'join_channel_erred'
|
|
6769
|
+
});
|
|
6746
6770
|
// @ts-ignore
|
|
6747
6771
|
this.channel.socket.disconnect();
|
|
6748
6772
|
}).receive('timeout', () => {
|
|
@@ -6756,7 +6780,6 @@ class ConversationConnector {
|
|
|
6756
6780
|
(_b = this.socket) === null || _b === void 0 ? void 0 : _b.remove(this.channel);
|
|
6757
6781
|
(_c = this.socket) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
6758
6782
|
}
|
|
6759
|
-
// eslint-disable-next-line no-unused-vars
|
|
6760
6783
|
onConnection(cb) {
|
|
6761
6784
|
__classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").push(cb);
|
|
6762
6785
|
}
|
|
@@ -6771,7 +6794,15 @@ _ConversationConnector_connectionListeners = new WeakMap(), _ConversationConnect
|
|
|
6771
6794
|
});
|
|
6772
6795
|
});
|
|
6773
6796
|
}, _ConversationConnector_emitConnectionState = function _ConversationConnector_emitConnectionState(payload) {
|
|
6774
|
-
|
|
6797
|
+
// Loop in reverse order to enable splicing the array while iterating
|
|
6798
|
+
for (let i = __classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").length - 1; i >= 0; i--) {
|
|
6799
|
+
const cb = __classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f")[i];
|
|
6800
|
+
const complete = cb(payload);
|
|
6801
|
+
// If we only want to execute the callback once, remove it from the listener
|
|
6802
|
+
if (complete) {
|
|
6803
|
+
__classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").splice(i, 1);
|
|
6804
|
+
}
|
|
6805
|
+
}
|
|
6775
6806
|
};
|
|
6776
6807
|
;// CONCATENATED MODULE: ./src/javascripts/api/index.ts
|
|
6777
6808
|
var api_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
@@ -7025,9 +7056,12 @@ class API {
|
|
|
7025
7056
|
conversationInitialState = yield api_classPrivateFieldGet(this, _API_instances, "m", _API_createConversation).call(this);
|
|
7026
7057
|
}
|
|
7027
7058
|
this.conversation.connect(`${api_classPrivateFieldGet(this, _API_instances, "m", _API_getUrlPrefix).call(this, 'ws')}${this.URLS.socket}`, api_classPrivateFieldGet(this, _API_config, "f").context.channelName, api_classPrivateFieldGet(this, _API_instances, "m", _API_getChannelTopic).call(this), api_classPrivateFieldGet(this, _API_instances, "m", _API_getAccessToken).call(this));
|
|
7028
|
-
this.conversation.onConnection(
|
|
7029
|
-
|
|
7030
|
-
|
|
7059
|
+
this.conversation.onConnection(({
|
|
7060
|
+
connected,
|
|
7061
|
+
ready
|
|
7062
|
+
}) => {
|
|
7063
|
+
this.connected = connected;
|
|
7064
|
+
api_classPrivateFieldSet(this, _API_ready, ready, "f");
|
|
7031
7065
|
});
|
|
7032
7066
|
// Send environment
|
|
7033
7067
|
if (api_classPrivateFieldGet(this, _API_config, "f").sendEnvironment) {
|
|
@@ -7110,12 +7144,17 @@ class API {
|
|
|
7110
7144
|
var _a;
|
|
7111
7145
|
if (!this.connected || waitForReady && !api_classPrivateFieldGet(this, _API_ready, "f")) {
|
|
7112
7146
|
// Wait for connection to be made
|
|
7113
|
-
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7147
|
+
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(({
|
|
7148
|
+
connected,
|
|
7149
|
+
ready
|
|
7150
|
+
}) => {
|
|
7151
|
+
this.connected = connected;
|
|
7152
|
+
api_classPrivateFieldSet(this, _API_ready, ready, "f");
|
|
7153
|
+
if (waitForReady ? ready : connected) {
|
|
7117
7154
|
this.send(command, payload, waitForReady);
|
|
7155
|
+
return true;
|
|
7118
7156
|
}
|
|
7157
|
+
return false;
|
|
7119
7158
|
});
|
|
7120
7159
|
return;
|
|
7121
7160
|
}
|
|
@@ -7211,7 +7250,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_layoutMode = n
|
|
|
7211
7250
|
return {
|
|
7212
7251
|
clientName: "@seamly/web-ui",
|
|
7213
7252
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
7214
|
-
clientVersion: "21.0.2
|
|
7253
|
+
clientVersion: "21.0.2",
|
|
7215
7254
|
currentUrl: window.location.toString(),
|
|
7216
7255
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
7217
7256
|
timezone: getTimeZone(),
|
|
@@ -17835,8 +17874,10 @@ const SeamlyEventSubscriber = () => {
|
|
|
17835
17874
|
return () => {};
|
|
17836
17875
|
}, [api, api.connectionInfo, api.conversation]);
|
|
17837
17876
|
(0,hooks_.useEffect)(() => {
|
|
17838
|
-
api.conversation.onConnection(
|
|
17839
|
-
|
|
17877
|
+
api.conversation.onConnection(({
|
|
17878
|
+
currentState
|
|
17879
|
+
}) => {
|
|
17880
|
+
if (currentState === 'join_channel_erred') {
|
|
17840
17881
|
const seamlyGeneralError = new SeamlyGeneralError();
|
|
17841
17882
|
dispatch(setInterrupt({
|
|
17842
17883
|
name: seamlyGeneralError.name,
|