@seamly/web-ui 22.2.0 → 22.3.0-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/components.js +269 -138
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +217 -41
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +43 -21
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +12 -4
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +257 -133
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +265 -133
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +274 -134
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/utils.js +325 -171
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/errors/seamly-api-error.ts +0 -1
- package/src/javascripts/api/index.ts +16 -8
- package/src/javascripts/domains/app/actions.ts +8 -3
- package/src/javascripts/domains/interrupt/selectors.ts +3 -2
- package/src/javascripts/domains/interrupt/slice.ts +2 -0
- package/src/javascripts/domains/redux/create-debounced-async-thunk.ts +109 -0
- package/src/javascripts/domains/redux/redux.types.ts +2 -1
- package/src/javascripts/domains/store/actions.ts +38 -0
- package/src/javascripts/domains/visibility/actions.ts +4 -1
- package/src/javascripts/style-guide/states.js +18 -1
- package/src/javascripts/ui/components/conversation/event/{card-component.js → card-component.tsx} +6 -4
- package/src/javascripts/ui/components/conversation/event/event-participant.js +1 -1
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +14 -30
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +8 -3
- package/src/javascripts/ui/hooks/use-session-expired-command.ts +31 -2
- package/src/stylesheets/5-components/_message-count.scss +11 -9
|
@@ -202,6 +202,10 @@
|
|
|
202
202
|
!*** ./src/javascripts/domains/forms/context.ts ***!
|
|
203
203
|
\**************************************************/
|
|
204
204
|
|
|
205
|
+
/*!**************************************************!*\
|
|
206
|
+
!*** ./src/javascripts/domains/store/actions.ts ***!
|
|
207
|
+
\**************************************************/
|
|
208
|
+
|
|
205
209
|
/*!**************************************************!*\
|
|
206
210
|
!*** ./src/javascripts/ui/hooks/seamly-hooks.js ***!
|
|
207
211
|
\**************************************************/
|
|
@@ -1078,6 +1082,10 @@
|
|
|
1078
1082
|
!*** ./node_modules/core-js/internals/copy-constructor-properties.js ***!
|
|
1079
1083
|
\***********************************************************************/
|
|
1080
1084
|
|
|
1085
|
+
/*!***********************************************************************!*\
|
|
1086
|
+
!*** ./src/javascripts/domains/redux/create-debounced-async-thunk.ts ***!
|
|
1087
|
+
\***********************************************************************/
|
|
1088
|
+
|
|
1081
1089
|
/*!***********************************************************************!*\
|
|
1082
1090
|
!*** ./src/javascripts/ui/components/conversation/use-chat-scroll.ts ***!
|
|
1083
1091
|
\***********************************************************************/
|
|
@@ -1242,10 +1250,6 @@
|
|
|
1242
1250
|
!*** ./src/javascripts/domains/translations/components/options-button.tsx ***!
|
|
1243
1251
|
\****************************************************************************/
|
|
1244
1252
|
|
|
1245
|
-
/*!****************************************************************************!*\
|
|
1246
|
-
!*** ./src/javascripts/ui/components/conversation/event/card-component.js ***!
|
|
1247
|
-
\****************************************************************************/
|
|
1248
|
-
|
|
1249
1253
|
/*!****************************************************************************!*\
|
|
1250
1254
|
!*** ./src/javascripts/ui/components/conversation/event/image-lightbox.js ***!
|
|
1251
1255
|
\****************************************************************************/
|
|
@@ -1266,6 +1270,10 @@
|
|
|
1266
1270
|
!*** ./node_modules/raw-loader/dist/cjs.js!./src/icons/icon_options-32.svg ***!
|
|
1267
1271
|
\*****************************************************************************/
|
|
1268
1272
|
|
|
1273
|
+
/*!*****************************************************************************!*\
|
|
1274
|
+
!*** ./src/javascripts/ui/components/conversation/event/card-component.tsx ***!
|
|
1275
|
+
\*****************************************************************************/
|
|
1276
|
+
|
|
1269
1277
|
/*!*****************************************************************************!*\
|
|
1270
1278
|
!*** ./src/javascripts/ui/components/core/seamly-activity-event-context.js ***!
|
|
1271
1279
|
\*****************************************************************************/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.debug.min.js","mappings":";
|
|
1
|
+
{"version":3,"file":"index.debug.min.js","mappings":";430rCAAAA,EAAOC,QAAUC,QAAQ,4CCAzBF,EAAOC,QAAUC,QAAQ,kDCAzBF,EAAOC,QAAUC,QAAQ,uDCAzBF,EAAOC,QAAUC,QAAQ,k+tECCrBC,yBAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,yBAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,yBAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,oBAAoBH,GAAUI,KAAKT,EAAOC,QAASD,EAAQA,EAAOC,QAASG,qBAGpEJ,EAAOC,OACf,CCrBAG,oBAAoBM,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAI,oBAAoBS,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdP,oBAAoBS,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXX,oBAAoBa,EAAEF,EAAYC,KAASZ,oBAAoBa,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDZ,oBAAoBkB,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBvB,oBAAoBa,EAAI,CAACW,EAAKC,IAAUX,OAAOY,UAAUC,eAAetB,KAAKmB,EAAKC,GCClFzB,oBAAoB4B,EAAK/B,IACH,oBAAXgC,QAA0BA,OAAOC,aAC1ChB,OAAOC,eAAelB,EAASgC,OAAOC,YAAa,CAAEC,MAAO,WAE7DjB,OAAOC,eAAelB,EAAS,aAAc,CAAEkC,OAAO,GAAO,QCL9D,IAAIC,EACAhC,oBAAoBkB,EAAEe,gBAAeD,EAAYhC,oBAAoBkB,EAAEgB,SAAW,IACtF,IAAIC,EAAWnC,oBAAoBkB,EAAEiB,SACrC,IAAKH,GAAaG,IACbA,EAASC,gBACZJ,EAAYG,EAASC,cAAcC,MAC/BL,GAAW,CACf,IAAIM,EAAUH,EAASI,qBAAqB,UAC5C,GAAGD,EAAQE,OAEV,IADA,IAAIC,EAAIH,EAAQE,OAAS,EAClBC,GAAK,IAAMT,GAAWA,EAAYM,EAAQG,KAAKJ,GAExD,CAID,IAAKL,EAAW,MAAM,IAAIU,MAAM,yDAChCV,EAAYA,EAAUW,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpF3C,oBAAoB4C,EAAIZ,MCfxB,IAAIa,oBAAsB7C,oBAAoB","sources":["webpack:///external commonjs2 \"preact\"","webpack:///external commonjs2 \"preact/compat\"","webpack:///external commonjs2 \"preact/hooks\"","webpack:///external commonjs2 \"preact/jsx-runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/publicPath","webpack:///webpack/startup"],"sourcesContent":["module.exports = require(\"preact\");","module.exports = require(\"preact/compat\");","module.exports = require(\"preact/hooks\");","module.exports = require(\"preact/jsx-runtime\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// startup\n// Load entry module and return exports\n// This entry module can't be inlined because the eval devtool is used.\nvar __webpack_exports__ = __webpack_require__(\"./src/javascripts/index.ts\");\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","length","i","Error","replace","p","__webpack_exports__"],"sourceRoot":""}
|
package/build/dist/lib/index.js
CHANGED
|
@@ -3927,7 +3927,8 @@ class API {
|
|
|
3927
3927
|
});
|
|
3928
3928
|
}
|
|
3929
3929
|
getConversationUrl() {
|
|
3930
|
-
|
|
3930
|
+
const conversationUrl = this.store.get('conversationUrl');
|
|
3931
|
+
return conversationUrl;
|
|
3931
3932
|
}
|
|
3932
3933
|
hasConversation() {
|
|
3933
3934
|
return !!this.getConversationUrl();
|
|
@@ -4035,7 +4036,7 @@ class API {
|
|
|
4035
4036
|
if (error.status >= 500) {
|
|
4036
4037
|
throw new SeamlyGeneralError(error);
|
|
4037
4038
|
}
|
|
4038
|
-
throw error;
|
|
4039
|
+
throw new ApiError(error);
|
|
4039
4040
|
}
|
|
4040
4041
|
});
|
|
4041
4042
|
}
|
|
@@ -4144,7 +4145,7 @@ class API {
|
|
|
4144
4145
|
if (error.status >= 500) {
|
|
4145
4146
|
throw new SeamlyGeneralError(error);
|
|
4146
4147
|
}
|
|
4147
|
-
throw error;
|
|
4148
|
+
throw new ApiError(error);
|
|
4148
4149
|
}
|
|
4149
4150
|
});
|
|
4150
4151
|
}
|
|
@@ -4204,15 +4205,17 @@ class API {
|
|
|
4204
4205
|
}
|
|
4205
4206
|
}
|
|
4206
4207
|
_API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAuthToken = new WeakMap(), _API_layoutMode = new WeakMap(), _API_config = new WeakMap(), _API_getLocale = new WeakMap(), _API_instances = new WeakSet(), _API_getAccessToken = function _API_getAccessToken() {
|
|
4207
|
-
|
|
4208
|
+
const accessToken = this.store.get('accessToken');
|
|
4209
|
+
return accessToken;
|
|
4208
4210
|
}, _API_setAccessToken = function _API_setAccessToken(accessToken) {
|
|
4209
4211
|
this.store.set('accessToken', accessToken);
|
|
4210
4212
|
}, _API_setConversationUrl = function _API_setConversationUrl(url) {
|
|
4211
4213
|
this.store.set('conversationUrl', url);
|
|
4212
4214
|
}, _API_getChannelTopic = function _API_getChannelTopic() {
|
|
4215
|
+
const channelTopic = this.store.get('channelTopic') || this.store.get('channelName');
|
|
4213
4216
|
// The `channelName` fallback is needed for seamless client upgrades.
|
|
4214
4217
|
// TODO: Remove when all clients have been upgraded past v20.
|
|
4215
|
-
return
|
|
4218
|
+
return channelTopic;
|
|
4216
4219
|
}, _API_setChannelTopic = function _API_setChannelTopic(topic) {
|
|
4217
4220
|
this.store.set('channelTopic', topic);
|
|
4218
4221
|
}, _API_getUrlPrefix = function _API_getUrlPrefix(protocol) {
|
|
@@ -4277,7 +4280,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAu
|
|
|
4277
4280
|
return {
|
|
4278
4281
|
clientName: "@seamly/web-ui",
|
|
4279
4282
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
4280
|
-
clientVersion: "22.
|
|
4283
|
+
clientVersion: "22.3.0-beta.1",
|
|
4281
4284
|
currentUrl: window.location.toString(),
|
|
4282
4285
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
4283
4286
|
timezone: getTimeZone(),
|
|
@@ -8111,6 +8114,62 @@ const setLocale = createAsyncThunk('setLocale', (locale, {
|
|
|
8111
8114
|
return true;
|
|
8112
8115
|
}
|
|
8113
8116
|
});
|
|
8117
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/redux/create-debounced-async-thunk.ts
|
|
8118
|
+
|
|
8119
|
+
/**
|
|
8120
|
+
* A debounced analogue of the `createAsyncThunk` from `@reduxjs/toolkit`
|
|
8121
|
+
* @param typePrefix - a string action type value
|
|
8122
|
+
* @param payloadCreator - a callback function that should return a promise containing the result of some asynchronous logic
|
|
8123
|
+
* @param debounceOptions - the debounce options object
|
|
8124
|
+
*/
|
|
8125
|
+
const createDebouncedAsyncThunk = (typePrefix, payloadCreator, debounceOptions) => {
|
|
8126
|
+
const {
|
|
8127
|
+
wait = 300,
|
|
8128
|
+
maxWait = 0,
|
|
8129
|
+
leading = false
|
|
8130
|
+
} = debounceOptions !== null && debounceOptions !== void 0 ? debounceOptions : {};
|
|
8131
|
+
let debounceTimer = null;
|
|
8132
|
+
let maxWaitTimer = null;
|
|
8133
|
+
let resolve;
|
|
8134
|
+
const cancel = () => {
|
|
8135
|
+
if (resolve) {
|
|
8136
|
+
resolve(false);
|
|
8137
|
+
resolve = undefined;
|
|
8138
|
+
}
|
|
8139
|
+
};
|
|
8140
|
+
const invoke = () => {
|
|
8141
|
+
clearTimeout(maxWaitTimer);
|
|
8142
|
+
maxWaitTimer = undefined;
|
|
8143
|
+
if (resolve) {
|
|
8144
|
+
resolve(true);
|
|
8145
|
+
resolve = undefined;
|
|
8146
|
+
}
|
|
8147
|
+
};
|
|
8148
|
+
const debounceExecutionCondition = () => {
|
|
8149
|
+
const immediate = leading && !debounceTimer;
|
|
8150
|
+
// Start debounced condition resolution
|
|
8151
|
+
clearTimeout(debounceTimer);
|
|
8152
|
+
debounceTimer = setTimeout(() => {
|
|
8153
|
+
invoke();
|
|
8154
|
+
debounceTimer = null;
|
|
8155
|
+
}, wait);
|
|
8156
|
+
if (immediate) {
|
|
8157
|
+
return true;
|
|
8158
|
+
}
|
|
8159
|
+
cancel();
|
|
8160
|
+
// Start max wait condition resolution
|
|
8161
|
+
if (maxWait && !maxWaitTimer) {
|
|
8162
|
+
maxWaitTimer = setTimeout(invoke, maxWait);
|
|
8163
|
+
}
|
|
8164
|
+
return new Promise(res => {
|
|
8165
|
+
resolve = res;
|
|
8166
|
+
});
|
|
8167
|
+
};
|
|
8168
|
+
return createAsyncThunk(typePrefix, payloadCreator, {
|
|
8169
|
+
condition: debounceExecutionCondition
|
|
8170
|
+
});
|
|
8171
|
+
};
|
|
8172
|
+
/* harmony default export */ const create_debounced_async_thunk = (createDebouncedAsyncThunk);
|
|
8114
8173
|
;// CONCATENATED MODULE: ./node_modules/reselect/es/defaultMemoize.js
|
|
8115
8174
|
// Cache implementation based on Erik Rasmussen's `lru-memoize`:
|
|
8116
8175
|
// https://github.com/erikras/lru-memoize
|
|
@@ -8667,8 +8726,9 @@ const setVisibility = createAsyncThunk('setVisibility', (requestedVisibility, {
|
|
|
8667
8726
|
if (previousVisibility === calculatedVisibility) {
|
|
8668
8727
|
return undefined;
|
|
8669
8728
|
}
|
|
8729
|
+
const visibility = api.store.get(StoreKey);
|
|
8670
8730
|
// Store the user-requested visibility in order to reinitialize after refresh
|
|
8671
|
-
api.store.set(StoreKey, Object.assign(Object.assign({},
|
|
8731
|
+
api.store.set(StoreKey, Object.assign(Object.assign({}, visibility || {}), {
|
|
8672
8732
|
[layoutMode]: requestedVisibility
|
|
8673
8733
|
}));
|
|
8674
8734
|
if (requestedVisibility) {
|
|
@@ -8732,6 +8792,7 @@ var app_actions_awaiter = undefined && undefined.__awaiter || function (thisArg,
|
|
|
8732
8792
|
|
|
8733
8793
|
|
|
8734
8794
|
|
|
8795
|
+
|
|
8735
8796
|
const initializeApp = createAsyncThunk('initializeApp', (_, {
|
|
8736
8797
|
extra: {
|
|
8737
8798
|
api,
|
|
@@ -8797,14 +8858,14 @@ const initializeApp = createAsyncThunk('initializeApp', (_, {
|
|
|
8797
8858
|
});
|
|
8798
8859
|
}
|
|
8799
8860
|
}));
|
|
8800
|
-
const resetApp =
|
|
8861
|
+
const resetApp = create_debounced_async_thunk('resetApp', (_, {
|
|
8801
8862
|
dispatch,
|
|
8802
8863
|
extra: {
|
|
8803
8864
|
api
|
|
8804
8865
|
}
|
|
8805
8866
|
}) => app_actions_awaiter(void 0, void 0, void 0, function* () {
|
|
8806
8867
|
yield api.disconnect();
|
|
8807
|
-
|
|
8868
|
+
api.clearStore();
|
|
8808
8869
|
dispatch(resetConfig());
|
|
8809
8870
|
yield dispatch(initializeConfig());
|
|
8810
8871
|
try {
|
|
@@ -8812,11 +8873,14 @@ const resetApp = createAsyncThunk('resetApp', (_, {
|
|
|
8812
8873
|
locale
|
|
8813
8874
|
} = yield dispatch(initializeApp()).unwrap();
|
|
8814
8875
|
yield dispatch(setLocale(locale));
|
|
8815
|
-
} catch (
|
|
8876
|
+
} catch (e) {
|
|
8816
8877
|
// nothing to do
|
|
8817
8878
|
}
|
|
8818
8879
|
dispatch(initializeVisibility());
|
|
8819
|
-
})
|
|
8880
|
+
}), {
|
|
8881
|
+
wait: 2000,
|
|
8882
|
+
leading: true
|
|
8883
|
+
});
|
|
8820
8884
|
;// CONCATENATED MODULE: ./src/javascripts/domains/app/hooks.js
|
|
8821
8885
|
|
|
8822
8886
|
|
|
@@ -8852,12 +8916,75 @@ const {
|
|
|
8852
8916
|
setHasResponded
|
|
8853
8917
|
} = appSlice.actions;
|
|
8854
8918
|
/* harmony default export */ const slice = (appSlice.reducer);
|
|
8919
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/store/actions.ts
|
|
8920
|
+
var store_actions_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
8921
|
+
function adopt(value) {
|
|
8922
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
8923
|
+
resolve(value);
|
|
8924
|
+
});
|
|
8925
|
+
}
|
|
8926
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8927
|
+
function fulfilled(value) {
|
|
8928
|
+
try {
|
|
8929
|
+
step(generator.next(value));
|
|
8930
|
+
} catch (e) {
|
|
8931
|
+
reject(e);
|
|
8932
|
+
}
|
|
8933
|
+
}
|
|
8934
|
+
function rejected(value) {
|
|
8935
|
+
try {
|
|
8936
|
+
step(generator["throw"](value));
|
|
8937
|
+
} catch (e) {
|
|
8938
|
+
reject(e);
|
|
8939
|
+
}
|
|
8940
|
+
}
|
|
8941
|
+
function step(result) {
|
|
8942
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
8943
|
+
}
|
|
8944
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8945
|
+
});
|
|
8946
|
+
};
|
|
8947
|
+
|
|
8948
|
+
const getConversation = createAsyncThunk('getConversation', (_, {
|
|
8949
|
+
extra: {
|
|
8950
|
+
api
|
|
8951
|
+
},
|
|
8952
|
+
rejectWithValue
|
|
8953
|
+
}) => store_actions_awaiter(void 0, void 0, void 0, function* () {
|
|
8954
|
+
try {
|
|
8955
|
+
return api.getConversation();
|
|
8956
|
+
} catch (error) {
|
|
8957
|
+
return rejectWithValue({
|
|
8958
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
8959
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
8960
|
+
langKey: error === null || error === void 0 ? void 0 : error.langKey,
|
|
8961
|
+
action: error === null || error === void 0 ? void 0 : error.action,
|
|
8962
|
+
originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
|
|
8963
|
+
originalError: error === null || error === void 0 ? void 0 : error.originalError
|
|
8964
|
+
});
|
|
8965
|
+
}
|
|
8966
|
+
}), {
|
|
8967
|
+
condition(payload, {
|
|
8968
|
+
getState
|
|
8969
|
+
}) {
|
|
8970
|
+
var _a;
|
|
8971
|
+
const {
|
|
8972
|
+
state: {
|
|
8973
|
+
events
|
|
8974
|
+
}
|
|
8975
|
+
} = getState();
|
|
8976
|
+
const lastEvent = events[events.length - 1];
|
|
8977
|
+
const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
|
|
8978
|
+
return lastEvent && payloadLastEventId !== lastEvent.payload.id;
|
|
8979
|
+
}
|
|
8980
|
+
});
|
|
8855
8981
|
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/slice.ts
|
|
8856
8982
|
|
|
8857
8983
|
|
|
8858
8984
|
|
|
8859
8985
|
|
|
8860
8986
|
|
|
8987
|
+
|
|
8861
8988
|
const slice_initialState = {
|
|
8862
8989
|
error: undefined
|
|
8863
8990
|
};
|
|
@@ -8871,7 +8998,7 @@ const interruptSlice = createSlice({
|
|
|
8871
8998
|
clearInterrupt: () => slice_initialState
|
|
8872
8999
|
},
|
|
8873
9000
|
extraReducers: builder => {
|
|
8874
|
-
builder.addCase(initializeConfig.pending, () => slice_initialState).addMatcher(isAnyOf(initializeApp.rejected, initializeConfig.rejected, setLocale.rejected, setVisibility.rejected, initializeVisibility.rejected), (state, {
|
|
9001
|
+
builder.addCase(initializeConfig.pending, () => slice_initialState).addMatcher(isAnyOf(initializeApp.rejected, initializeConfig.rejected, setLocale.rejected, setVisibility.rejected, initializeVisibility.rejected, getConversation.rejected), (state, {
|
|
8875
9002
|
payload
|
|
8876
9003
|
}) => {
|
|
8877
9004
|
state.error = payload;
|
|
@@ -11277,6 +11404,9 @@ function useInterrupt() {
|
|
|
11277
11404
|
|
|
11278
11405
|
|
|
11279
11406
|
|
|
11407
|
+
|
|
11408
|
+
|
|
11409
|
+
|
|
11280
11410
|
function useSessionExpiredCommand() {
|
|
11281
11411
|
const {
|
|
11282
11412
|
meta: {
|
|
@@ -11284,13 +11414,35 @@ function useSessionExpiredCommand() {
|
|
|
11284
11414
|
action
|
|
11285
11415
|
}
|
|
11286
11416
|
} = useInterrupt();
|
|
11417
|
+
const dispatch = useAppDispatch();
|
|
11287
11418
|
const seamlyCommands = use_seamly_commands();
|
|
11288
11419
|
const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
|
|
11420
|
+
const limit = (0,hooks_.useRef)(0);
|
|
11421
|
+
const limitTimer = (0,hooks_.useRef)(null);
|
|
11289
11422
|
(0,hooks_.useEffect)(() => {
|
|
11290
11423
|
if (isExpiredError && seamlyCommands[action]) {
|
|
11424
|
+
if (limit.current >= 10) {
|
|
11425
|
+
limitTimer.current = setTimeout(() => {
|
|
11426
|
+
limit.current = 0;
|
|
11427
|
+
}, 10000);
|
|
11428
|
+
const error = new SeamlyGeneralError();
|
|
11429
|
+
dispatch(setInterrupt({
|
|
11430
|
+
name: error.name,
|
|
11431
|
+
message: error.message,
|
|
11432
|
+
langKey: error.langKey,
|
|
11433
|
+
originalEvent: error.originalEvent,
|
|
11434
|
+
originalError: error.originalError,
|
|
11435
|
+
action: error.action
|
|
11436
|
+
}));
|
|
11437
|
+
return () => {};
|
|
11438
|
+
}
|
|
11439
|
+
limit.current += 1;
|
|
11291
11440
|
seamlyCommands[action]();
|
|
11292
11441
|
}
|
|
11293
|
-
|
|
11442
|
+
return () => {
|
|
11443
|
+
if (limitTimer.current) clearTimeout(limitTimer.current);
|
|
11444
|
+
};
|
|
11445
|
+
}, [action, seamlyCommands, isExpiredError, dispatch]);
|
|
11294
11446
|
}
|
|
11295
11447
|
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
|
|
11296
11448
|
var use_seamly_chat_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
@@ -12118,7 +12270,7 @@ const EventParticipant = ({
|
|
|
12118
12270
|
})
|
|
12119
12271
|
}));
|
|
12120
12272
|
}
|
|
12121
|
-
if (showName) {
|
|
12273
|
+
if (showName && participantName) {
|
|
12122
12274
|
authorInfo.push((0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
12123
12275
|
className: css_className('message__author-name'),
|
|
12124
12276
|
children: participantName
|
|
@@ -12198,108 +12350,61 @@ function MessageContainer({
|
|
|
12198
12350
|
});
|
|
12199
12351
|
}
|
|
12200
12352
|
/* harmony default export */ const message_container = (MessageContainer);
|
|
12201
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.
|
|
12353
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.tsx
|
|
12202
12354
|
|
|
12203
12355
|
|
|
12204
12356
|
|
|
12205
12357
|
|
|
12206
12358
|
|
|
12207
|
-
|
|
12208
|
-
const
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
})
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
emitEvent
|
|
12223
|
-
} = use_seamly_commands();
|
|
12224
|
-
const descriptionId = useGeneratedId();
|
|
12225
|
-
const isMounted = (0,hooks_.useRef)();
|
|
12226
|
-
const CardActionComponent = action.type === cardTypes.navigate ? 'a' : 'button';
|
|
12227
|
-
const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${actionTypes.clickCard}`, {
|
|
12228
|
-
type: actionTypes.clickCta,
|
|
12229
|
-
originMessage: id,
|
|
12230
|
-
action
|
|
12231
|
-
}), [emitEvent, id, action]);
|
|
12232
|
-
const handleClick = (0,hooks_.useCallback)(() => {
|
|
12233
|
-
emitCardEvent();
|
|
12234
|
-
if (action.type === cardTypes.ask) {
|
|
12235
|
-
sendMessage({
|
|
12236
|
-
body: action.ask
|
|
12237
|
-
});
|
|
12238
|
-
} else if (action.type === cardTypes.topic) {
|
|
12239
|
-
const {
|
|
12240
|
-
topic: name,
|
|
12241
|
-
fallbackMessage
|
|
12242
|
-
} = action;
|
|
12243
|
-
sendAction({
|
|
12244
|
-
type: actionTypes.setTopic,
|
|
12245
|
-
body: {
|
|
12246
|
-
name,
|
|
12247
|
-
fallbackMessage
|
|
12359
|
+
const CardComponent = ({ id, action, buttonText, description, hasFocus, image, title, isCarouselItem, }) => {
|
|
12360
|
+
const cardRef = (0,hooks_.useRef)(null);
|
|
12361
|
+
const { sendMessage, sendAction, emitEvent } = use_seamly_commands();
|
|
12362
|
+
const descriptionId = useGeneratedId();
|
|
12363
|
+
const isMounted = (0,hooks_.useRef)(false);
|
|
12364
|
+
const CardActionComponent = action.type === cardTypes.navigate ? 'a' : 'button';
|
|
12365
|
+
const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${actionTypes.clickCard}`, {
|
|
12366
|
+
type: actionTypes.clickCta,
|
|
12367
|
+
originMessage: id,
|
|
12368
|
+
action,
|
|
12369
|
+
}), [emitEvent, id, action]);
|
|
12370
|
+
const handleClick = (0,hooks_.useCallback)(() => {
|
|
12371
|
+
emitCardEvent();
|
|
12372
|
+
if (action.type === cardTypes.ask) {
|
|
12373
|
+
sendMessage({ body: action.ask });
|
|
12248
12374
|
}
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
target: action.newTab ? '_blank' : '_self',
|
|
12256
|
-
onClick: emitCardEvent
|
|
12257
|
-
} : {
|
|
12258
|
-
onClick: handleClick
|
|
12259
|
-
}, [action, handleClick, emitCardEvent]);
|
|
12260
|
-
(0,hooks_.useEffect)(() => {
|
|
12261
|
-
if (isCarouselItem) {
|
|
12262
|
-
if (hasFocus && isMounted.current) {
|
|
12263
|
-
window.requestAnimationFrame(() => cardRef.current.focus());
|
|
12264
|
-
} else {
|
|
12265
|
-
cardRef.current.blur();
|
|
12266
|
-
}
|
|
12267
|
-
}
|
|
12268
|
-
isMounted.current = true;
|
|
12269
|
-
}, [hasFocus, isCarouselItem]);
|
|
12270
|
-
return (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
12271
|
-
className: css_className('card__wrapper'),
|
|
12272
|
-
id: id,
|
|
12273
|
-
tabIndex: "-1" // set tabIndex of -1 so card can be focussed
|
|
12274
|
-
,
|
|
12275
|
-
ref: cardRef,
|
|
12276
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
12277
|
-
className: css_className('card__image'),
|
|
12278
|
-
src: image,
|
|
12279
|
-
alt: ""
|
|
12280
|
-
}), (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
12281
|
-
className: css_className('card__content'),
|
|
12282
|
-
id: id,
|
|
12283
|
-
children: [title && (0,jsx_runtime_namespaceObject.jsx)("h2", {
|
|
12284
|
-
className: css_className('card__title'),
|
|
12285
|
-
children: title
|
|
12286
|
-
}), description && (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
12287
|
-
className: css_className('card__description'),
|
|
12288
|
-
dangerouslySetInnerHTML: {
|
|
12289
|
-
__html: description
|
|
12375
|
+
else if (action.type === cardTypes.topic) {
|
|
12376
|
+
const { topic: name, fallbackMessage } = action;
|
|
12377
|
+
sendAction({
|
|
12378
|
+
type: actionTypes.setTopic,
|
|
12379
|
+
body: { name, fallbackMessage },
|
|
12380
|
+
});
|
|
12290
12381
|
}
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
|
|
12382
|
+
}, [sendMessage, action, sendAction, emitCardEvent]);
|
|
12383
|
+
const actionProps = (0,hooks_.useMemo)(() => action.type === cardTypes.navigate
|
|
12384
|
+
? {
|
|
12385
|
+
href: action.link,
|
|
12386
|
+
rel: 'noopener noreferrer',
|
|
12387
|
+
target: action.newTab ? '_blank' : '_self',
|
|
12388
|
+
onClick: emitCardEvent,
|
|
12389
|
+
}
|
|
12390
|
+
: {
|
|
12391
|
+
onClick: handleClick,
|
|
12392
|
+
}, [action, handleClick, emitCardEvent]);
|
|
12393
|
+
(0,hooks_.useEffect)(() => {
|
|
12394
|
+
if (isCarouselItem) {
|
|
12395
|
+
if (hasFocus && isMounted.current) {
|
|
12396
|
+
window.requestAnimationFrame(() => cardRef.current.focus());
|
|
12397
|
+
}
|
|
12398
|
+
else {
|
|
12399
|
+
cardRef.current.blur();
|
|
12400
|
+
}
|
|
12401
|
+
}
|
|
12402
|
+
isMounted.current = true;
|
|
12403
|
+
}, [hasFocus, isCarouselItem]);
|
|
12404
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('card__wrapper'), id: id, tabIndex: -1, ref: cardRef, children: [image ? ((0,jsx_runtime_namespaceObject.jsx)("img", { className: css_className('card__image'), src: image, alt: "" })) : null, (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('card__content'), id: id, children: [title && (0,jsx_runtime_namespaceObject.jsx)("h2", { className: css_className('card__title'), children: title }), description && ((0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('card__description'), dangerouslySetInnerHTML: { __html: description } })), (0,jsx_runtime_namespaceObject.jsx)(CardActionComponent, Object.assign({ tabIndex: isCarouselItem && !hasFocus ? -1 : undefined, className: css_className('button', 'button--primary'), "aria-describedby": descriptionId }, actionProps, { children: buttonText }))] })] }));
|
|
12301
12405
|
};
|
|
12302
12406
|
/* harmony default export */ const card_component = (CardComponent);
|
|
12407
|
+
|
|
12303
12408
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-message.js
|
|
12304
12409
|
|
|
12305
12410
|
|
|
@@ -15455,6 +15560,33 @@ const SeamlyActivityMonitor = ({ children }) => {
|
|
|
15455
15560
|
/* harmony default export */ const seamly_activity_monitor = (SeamlyActivityMonitor);
|
|
15456
15561
|
|
|
15457
15562
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-event-subscriber.ts
|
|
15563
|
+
var seamly_event_subscriber_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
15564
|
+
function adopt(value) {
|
|
15565
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
15566
|
+
resolve(value);
|
|
15567
|
+
});
|
|
15568
|
+
}
|
|
15569
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15570
|
+
function fulfilled(value) {
|
|
15571
|
+
try {
|
|
15572
|
+
step(generator.next(value));
|
|
15573
|
+
} catch (e) {
|
|
15574
|
+
reject(e);
|
|
15575
|
+
}
|
|
15576
|
+
}
|
|
15577
|
+
function rejected(value) {
|
|
15578
|
+
try {
|
|
15579
|
+
step(generator["throw"](value));
|
|
15580
|
+
} catch (e) {
|
|
15581
|
+
reject(e);
|
|
15582
|
+
}
|
|
15583
|
+
}
|
|
15584
|
+
function step(result) {
|
|
15585
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15586
|
+
}
|
|
15587
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15588
|
+
});
|
|
15589
|
+
};
|
|
15458
15590
|
var seamly_event_subscriber_rest = undefined && undefined.__rest || function (s, e) {
|
|
15459
15591
|
var t = {};
|
|
15460
15592
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -15475,13 +15607,13 @@ var seamly_event_subscriber_rest = undefined && undefined.__rest || function (s,
|
|
|
15475
15607
|
|
|
15476
15608
|
|
|
15477
15609
|
|
|
15610
|
+
|
|
15478
15611
|
const EMITTABLE_MESSAGE_TYPES = ['text', 'choice_prompt', 'image', 'video'];
|
|
15479
15612
|
const SeamlyEventSubscriber = () => {
|
|
15480
15613
|
const api = useSeamlyApiContext();
|
|
15481
15614
|
const syncChannelRef = (0,hooks_.useRef)();
|
|
15482
15615
|
const messageChannelRef = (0,hooks_.useRef)();
|
|
15483
|
-
const dispatch =
|
|
15484
|
-
const events = useEvents();
|
|
15616
|
+
const dispatch = useAppDispatch();
|
|
15485
15617
|
const eventBus = (0,hooks_.useContext)(SeamlyEventBusContext);
|
|
15486
15618
|
const prevEmittedEventId = (0,hooks_.useRef)(null);
|
|
15487
15619
|
const {
|
|
@@ -15726,31 +15858,19 @@ const SeamlyEventSubscriber = () => {
|
|
|
15726
15858
|
if (syncChannelRef.current) {
|
|
15727
15859
|
(_a = api.conversation.channel) === null || _a === void 0 ? void 0 : _a.off('sync', syncChannelRef.current);
|
|
15728
15860
|
}
|
|
15729
|
-
syncChannelRef.current = api.conversation.channel.on('sync', payload => {
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
|
|
15733
|
-
if (lastEvent && payloadLastEventId === lastEvent.payload.id) {
|
|
15734
|
-
return payload;
|
|
15735
|
-
}
|
|
15736
|
-
return api.getConversation().then(history => {
|
|
15861
|
+
syncChannelRef.current = api.conversation.channel.on('sync', payload => seamly_event_subscriber_awaiter(void 0, void 0, void 0, function* () {
|
|
15862
|
+
try {
|
|
15863
|
+
const history = yield dispatch(getConversation(payload)).unwrap();
|
|
15737
15864
|
if (!history) return;
|
|
15738
15865
|
dispatch(setHistory(history));
|
|
15739
|
-
}
|
|
15740
|
-
|
|
15741
|
-
|
|
15742
|
-
|
|
15743
|
-
langKey: error === null || error === void 0 ? void 0 : error.langKey,
|
|
15744
|
-
action: error === null || error === void 0 ? void 0 : error.action,
|
|
15745
|
-
originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
|
|
15746
|
-
originalError: error === null || error === void 0 ? void 0 : error.originalError
|
|
15747
|
-
}));
|
|
15748
|
-
});
|
|
15749
|
-
});
|
|
15866
|
+
} catch (_e) {
|
|
15867
|
+
// nothing to do, the error is handled in the thunk
|
|
15868
|
+
}
|
|
15869
|
+
}));
|
|
15750
15870
|
return true;
|
|
15751
15871
|
});
|
|
15752
15872
|
}
|
|
15753
|
-
}, [api, api.connectionInfo, api.conversation.channel,
|
|
15873
|
+
}, [api, api.connectionInfo, api.conversation.channel, dispatch]);
|
|
15754
15874
|
return null;
|
|
15755
15875
|
};
|
|
15756
15876
|
/* harmony default export */ const seamly_event_subscriber = (SeamlyEventSubscriber);
|
|
@@ -19333,10 +19453,14 @@ const WindowOpenButton = ({
|
|
|
19333
19453
|
"aria-label": ariaLabel,
|
|
19334
19454
|
"aria-hidden": isOpen,
|
|
19335
19455
|
onClick: handleClick,
|
|
19336
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(
|
|
19337
|
-
|
|
19338
|
-
|
|
19339
|
-
children:
|
|
19456
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, {
|
|
19457
|
+
isActive: !!count,
|
|
19458
|
+
transitionStartState: transitionStartStates.notRendered,
|
|
19459
|
+
children: (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
19460
|
+
className: css_className('message-count'),
|
|
19461
|
+
"aria-hidden": "true",
|
|
19462
|
+
children: count
|
|
19463
|
+
})
|
|
19340
19464
|
}), (0,jsx_runtime_namespaceObject.jsx)(ButtonIcon, {})]
|
|
19341
19465
|
})
|
|
19342
19466
|
});
|