@seamly/web-ui 21.0.2 → 21.0.3-beta.2
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/components.js +132 -134
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/index.debug.js +4 -4
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +58 -19
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +75 -34
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +58 -17
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/utils.js +58 -17
- 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
- package/src/javascripts/ui/components/view/deprecated-view.js +0 -2
package/build/dist/lib/index.js
CHANGED
|
@@ -6761,21 +6761,37 @@ class ConversationConnector {
|
|
|
6761
6761
|
this.channel.on('system', msg => {
|
|
6762
6762
|
switch (msg.type) {
|
|
6763
6763
|
case 'attach_channel_succeeded':
|
|
6764
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6764
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6765
|
+
connected: true,
|
|
6766
|
+
ready: true,
|
|
6767
|
+
currentState: 'attach_channel_succeeded'
|
|
6768
|
+
});
|
|
6765
6769
|
break;
|
|
6766
6770
|
}
|
|
6767
6771
|
});
|
|
6768
6772
|
this.socket.onClose(() => {
|
|
6769
6773
|
log('[SOCKET]CLOSE');
|
|
6770
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6774
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6775
|
+
connected: false,
|
|
6776
|
+
ready: false,
|
|
6777
|
+
currentState: 'socket_closed'
|
|
6778
|
+
});
|
|
6771
6779
|
});
|
|
6772
6780
|
this.channel.onClose(() => {
|
|
6773
6781
|
log('[CHANNEL]CLOSE');
|
|
6774
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6782
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6783
|
+
connected: false,
|
|
6784
|
+
ready: false,
|
|
6785
|
+
currentState: 'channel_closed'
|
|
6786
|
+
});
|
|
6775
6787
|
});
|
|
6776
6788
|
this.channel.onError(msg => {
|
|
6777
6789
|
log('[CHANNEL][ERROR]', msg);
|
|
6778
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6790
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6791
|
+
connected: false,
|
|
6792
|
+
ready: false,
|
|
6793
|
+
currentState: 'channel_erred'
|
|
6794
|
+
});
|
|
6779
6795
|
});
|
|
6780
6796
|
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_listenTo).call(this, 'ack', 'ui', 'error', 'participant', 'message', 'service_data', 'system', 'info', 'sync');
|
|
6781
6797
|
});
|
|
@@ -6783,10 +6799,18 @@ class ConversationConnector {
|
|
|
6783
6799
|
start() {
|
|
6784
6800
|
this.channel.join().receive('ok', () => {
|
|
6785
6801
|
log('[CHANNEL][JOIN] OK');
|
|
6786
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6802
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6803
|
+
connected: true,
|
|
6804
|
+
ready: false,
|
|
6805
|
+
currentState: 'join_channel_succeeded'
|
|
6806
|
+
});
|
|
6787
6807
|
}).receive('error', err => {
|
|
6788
6808
|
log('[CHANNEL][JOIN] ERROR', err);
|
|
6789
|
-
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this,
|
|
6809
|
+
__classPrivateFieldGet(this, _ConversationConnector_instances, "m", _ConversationConnector_emitConnectionState).call(this, {
|
|
6810
|
+
connected: false,
|
|
6811
|
+
ready: false,
|
|
6812
|
+
currentState: 'join_channel_erred'
|
|
6813
|
+
});
|
|
6790
6814
|
// @ts-ignore
|
|
6791
6815
|
this.channel.socket.disconnect();
|
|
6792
6816
|
}).receive('timeout', () => {
|
|
@@ -6800,7 +6824,6 @@ class ConversationConnector {
|
|
|
6800
6824
|
(_b = this.socket) === null || _b === void 0 ? void 0 : _b.remove(this.channel);
|
|
6801
6825
|
(_c = this.socket) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
6802
6826
|
}
|
|
6803
|
-
// eslint-disable-next-line no-unused-vars
|
|
6804
6827
|
onConnection(cb) {
|
|
6805
6828
|
__classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").push(cb);
|
|
6806
6829
|
}
|
|
@@ -6815,7 +6838,15 @@ _ConversationConnector_connectionListeners = new WeakMap(), _ConversationConnect
|
|
|
6815
6838
|
});
|
|
6816
6839
|
});
|
|
6817
6840
|
}, _ConversationConnector_emitConnectionState = function _ConversationConnector_emitConnectionState(payload) {
|
|
6818
|
-
|
|
6841
|
+
// Loop in reverse order to enable splicing the array while iterating
|
|
6842
|
+
for (let i = __classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").length - 1; i >= 0; i--) {
|
|
6843
|
+
const callback = __classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f")[i];
|
|
6844
|
+
const complete = callback(payload);
|
|
6845
|
+
// If we only want to execute the callback once, remove it from the listener
|
|
6846
|
+
if (complete) {
|
|
6847
|
+
__classPrivateFieldGet(this, _ConversationConnector_connectionListeners, "f").splice(i, 1);
|
|
6848
|
+
}
|
|
6849
|
+
}
|
|
6819
6850
|
};
|
|
6820
6851
|
;// CONCATENATED MODULE: ./src/javascripts/api/index.ts
|
|
6821
6852
|
var api_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
@@ -7069,9 +7100,12 @@ class API {
|
|
|
7069
7100
|
conversationInitialState = yield api_classPrivateFieldGet(this, _API_instances, "m", _API_createConversation).call(this);
|
|
7070
7101
|
}
|
|
7071
7102
|
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));
|
|
7072
|
-
this.conversation.onConnection(
|
|
7073
|
-
|
|
7074
|
-
|
|
7103
|
+
this.conversation.onConnection(({
|
|
7104
|
+
connected,
|
|
7105
|
+
ready
|
|
7106
|
+
}) => {
|
|
7107
|
+
this.connected = connected;
|
|
7108
|
+
api_classPrivateFieldSet(this, _API_ready, ready, "f");
|
|
7075
7109
|
});
|
|
7076
7110
|
// Send environment
|
|
7077
7111
|
if (api_classPrivateFieldGet(this, _API_config, "f").sendEnvironment) {
|
|
@@ -7154,12 +7188,17 @@ class API {
|
|
|
7154
7188
|
var _a;
|
|
7155
7189
|
if (!this.connected || waitForReady && !api_classPrivateFieldGet(this, _API_ready, "f")) {
|
|
7156
7190
|
// Wait for connection to be made
|
|
7157
|
-
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7191
|
+
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(({
|
|
7192
|
+
connected,
|
|
7193
|
+
ready
|
|
7194
|
+
}) => {
|
|
7195
|
+
this.connected = connected;
|
|
7196
|
+
api_classPrivateFieldSet(this, _API_ready, ready, "f");
|
|
7197
|
+
if (waitForReady ? ready : connected) {
|
|
7161
7198
|
this.send(command, payload, waitForReady);
|
|
7199
|
+
return true;
|
|
7162
7200
|
}
|
|
7201
|
+
return false;
|
|
7163
7202
|
});
|
|
7164
7203
|
return;
|
|
7165
7204
|
}
|
|
@@ -17879,8 +17918,10 @@ const SeamlyEventSubscriber = () => {
|
|
|
17879
17918
|
return () => {};
|
|
17880
17919
|
}, [api, api.connectionInfo, api.conversation]);
|
|
17881
17920
|
(0,hooks_.useEffect)(() => {
|
|
17882
|
-
api.conversation.onConnection(
|
|
17883
|
-
|
|
17921
|
+
api.conversation.onConnection(({
|
|
17922
|
+
currentState
|
|
17923
|
+
}) => {
|
|
17924
|
+
if (currentState === 'join_channel_erred') {
|
|
17884
17925
|
const seamlyGeneralError = new SeamlyGeneralError();
|
|
17885
17926
|
dispatch(setInterrupt({
|
|
17886
17927
|
name: seamlyGeneralError.name,
|
|
@@ -22638,7 +22679,6 @@ const DeprecatedAppFrame = ({
|
|
|
22638
22679
|
|
|
22639
22680
|
|
|
22640
22681
|
|
|
22641
|
-
|
|
22642
22682
|
const ShowInlineView = ({
|
|
22643
22683
|
children
|
|
22644
22684
|
}) => {
|
|
@@ -22652,7 +22692,6 @@ const ShowInlineView = ({
|
|
|
22652
22692
|
});
|
|
22653
22693
|
};
|
|
22654
22694
|
const DeprecatedView = () => {
|
|
22655
|
-
use_seamly_chat();
|
|
22656
22695
|
const {
|
|
22657
22696
|
isVisible,
|
|
22658
22697
|
openChat,
|