sceyt-chat-react-uikit 1.6.9-beta.14 → 1.6.9-beta.16
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/index.js +507 -230
- package/index.modern.js +507 -230
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -580,6 +580,10 @@ function getPlugin(pluginKey) {
|
|
|
580
580
|
}
|
|
581
581
|
return plugin;
|
|
582
582
|
}
|
|
583
|
+
function loadPlugin(pluginKey, implementation) {
|
|
584
|
+
if (!plugins[pluginKey])
|
|
585
|
+
plugins[pluginKey] = implementation;
|
|
586
|
+
}
|
|
583
587
|
|
|
584
588
|
// src/core/scope.ts
|
|
585
589
|
var currentScope;
|
|
@@ -1096,6 +1100,256 @@ function currentImpl(value) {
|
|
|
1096
1100
|
return copy;
|
|
1097
1101
|
}
|
|
1098
1102
|
|
|
1103
|
+
// src/plugins/mapset.ts
|
|
1104
|
+
function enableMapSet() {
|
|
1105
|
+
class DraftMap extends Map {
|
|
1106
|
+
constructor(target, parent) {
|
|
1107
|
+
super();
|
|
1108
|
+
this[DRAFT_STATE] = {
|
|
1109
|
+
type_: 2 /* Map */,
|
|
1110
|
+
parent_: parent,
|
|
1111
|
+
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
1112
|
+
modified_: false,
|
|
1113
|
+
finalized_: false,
|
|
1114
|
+
copy_: void 0,
|
|
1115
|
+
assigned_: void 0,
|
|
1116
|
+
base_: target,
|
|
1117
|
+
draft_: this,
|
|
1118
|
+
isManual_: false,
|
|
1119
|
+
revoked_: false
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
get size() {
|
|
1123
|
+
return latest(this[DRAFT_STATE]).size;
|
|
1124
|
+
}
|
|
1125
|
+
has(key) {
|
|
1126
|
+
return latest(this[DRAFT_STATE]).has(key);
|
|
1127
|
+
}
|
|
1128
|
+
set(key, value) {
|
|
1129
|
+
const state = this[DRAFT_STATE];
|
|
1130
|
+
assertUnrevoked(state);
|
|
1131
|
+
if (!latest(state).has(key) || latest(state).get(key) !== value) {
|
|
1132
|
+
prepareMapCopy(state);
|
|
1133
|
+
markChanged(state);
|
|
1134
|
+
state.assigned_.set(key, true);
|
|
1135
|
+
state.copy_.set(key, value);
|
|
1136
|
+
state.assigned_.set(key, true);
|
|
1137
|
+
}
|
|
1138
|
+
return this;
|
|
1139
|
+
}
|
|
1140
|
+
delete(key) {
|
|
1141
|
+
if (!this.has(key)) {
|
|
1142
|
+
return false;
|
|
1143
|
+
}
|
|
1144
|
+
const state = this[DRAFT_STATE];
|
|
1145
|
+
assertUnrevoked(state);
|
|
1146
|
+
prepareMapCopy(state);
|
|
1147
|
+
markChanged(state);
|
|
1148
|
+
if (state.base_.has(key)) {
|
|
1149
|
+
state.assigned_.set(key, false);
|
|
1150
|
+
} else {
|
|
1151
|
+
state.assigned_.delete(key);
|
|
1152
|
+
}
|
|
1153
|
+
state.copy_.delete(key);
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
clear() {
|
|
1157
|
+
const state = this[DRAFT_STATE];
|
|
1158
|
+
assertUnrevoked(state);
|
|
1159
|
+
if (latest(state).size) {
|
|
1160
|
+
prepareMapCopy(state);
|
|
1161
|
+
markChanged(state);
|
|
1162
|
+
state.assigned_ = /* @__PURE__ */ new Map();
|
|
1163
|
+
each(state.base_, (key) => {
|
|
1164
|
+
state.assigned_.set(key, false);
|
|
1165
|
+
});
|
|
1166
|
+
state.copy_.clear();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
forEach(cb, thisArg) {
|
|
1170
|
+
const state = this[DRAFT_STATE];
|
|
1171
|
+
latest(state).forEach((_value, key, _map) => {
|
|
1172
|
+
cb.call(thisArg, this.get(key), key, this);
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
get(key) {
|
|
1176
|
+
const state = this[DRAFT_STATE];
|
|
1177
|
+
assertUnrevoked(state);
|
|
1178
|
+
const value = latest(state).get(key);
|
|
1179
|
+
if (state.finalized_ || !isDraftable(value)) {
|
|
1180
|
+
return value;
|
|
1181
|
+
}
|
|
1182
|
+
if (value !== state.base_.get(key)) {
|
|
1183
|
+
return value;
|
|
1184
|
+
}
|
|
1185
|
+
const draft = createProxy(value, state);
|
|
1186
|
+
prepareMapCopy(state);
|
|
1187
|
+
state.copy_.set(key, draft);
|
|
1188
|
+
return draft;
|
|
1189
|
+
}
|
|
1190
|
+
keys() {
|
|
1191
|
+
return latest(this[DRAFT_STATE]).keys();
|
|
1192
|
+
}
|
|
1193
|
+
values() {
|
|
1194
|
+
const iterator = this.keys();
|
|
1195
|
+
return {
|
|
1196
|
+
[Symbol.iterator]: () => this.values(),
|
|
1197
|
+
next: () => {
|
|
1198
|
+
const r = iterator.next();
|
|
1199
|
+
if (r.done)
|
|
1200
|
+
return r;
|
|
1201
|
+
const value = this.get(r.value);
|
|
1202
|
+
return {
|
|
1203
|
+
done: false,
|
|
1204
|
+
value
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
entries() {
|
|
1210
|
+
const iterator = this.keys();
|
|
1211
|
+
return {
|
|
1212
|
+
[Symbol.iterator]: () => this.entries(),
|
|
1213
|
+
next: () => {
|
|
1214
|
+
const r = iterator.next();
|
|
1215
|
+
if (r.done)
|
|
1216
|
+
return r;
|
|
1217
|
+
const value = this.get(r.value);
|
|
1218
|
+
return {
|
|
1219
|
+
done: false,
|
|
1220
|
+
value: [r.value, value]
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
[(Symbol.iterator)]() {
|
|
1226
|
+
return this.entries();
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
function proxyMap_(target, parent) {
|
|
1230
|
+
return new DraftMap(target, parent);
|
|
1231
|
+
}
|
|
1232
|
+
function prepareMapCopy(state) {
|
|
1233
|
+
if (!state.copy_) {
|
|
1234
|
+
state.assigned_ = /* @__PURE__ */ new Map();
|
|
1235
|
+
state.copy_ = new Map(state.base_);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
class DraftSet extends Set {
|
|
1239
|
+
constructor(target, parent) {
|
|
1240
|
+
super();
|
|
1241
|
+
this[DRAFT_STATE] = {
|
|
1242
|
+
type_: 3 /* Set */,
|
|
1243
|
+
parent_: parent,
|
|
1244
|
+
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
1245
|
+
modified_: false,
|
|
1246
|
+
finalized_: false,
|
|
1247
|
+
copy_: void 0,
|
|
1248
|
+
base_: target,
|
|
1249
|
+
draft_: this,
|
|
1250
|
+
drafts_: /* @__PURE__ */ new Map(),
|
|
1251
|
+
revoked_: false,
|
|
1252
|
+
isManual_: false
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
get size() {
|
|
1256
|
+
return latest(this[DRAFT_STATE]).size;
|
|
1257
|
+
}
|
|
1258
|
+
has(value) {
|
|
1259
|
+
const state = this[DRAFT_STATE];
|
|
1260
|
+
assertUnrevoked(state);
|
|
1261
|
+
if (!state.copy_) {
|
|
1262
|
+
return state.base_.has(value);
|
|
1263
|
+
}
|
|
1264
|
+
if (state.copy_.has(value))
|
|
1265
|
+
return true;
|
|
1266
|
+
if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))
|
|
1267
|
+
return true;
|
|
1268
|
+
return false;
|
|
1269
|
+
}
|
|
1270
|
+
add(value) {
|
|
1271
|
+
const state = this[DRAFT_STATE];
|
|
1272
|
+
assertUnrevoked(state);
|
|
1273
|
+
if (!this.has(value)) {
|
|
1274
|
+
prepareSetCopy(state);
|
|
1275
|
+
markChanged(state);
|
|
1276
|
+
state.copy_.add(value);
|
|
1277
|
+
}
|
|
1278
|
+
return this;
|
|
1279
|
+
}
|
|
1280
|
+
delete(value) {
|
|
1281
|
+
if (!this.has(value)) {
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
const state = this[DRAFT_STATE];
|
|
1285
|
+
assertUnrevoked(state);
|
|
1286
|
+
prepareSetCopy(state);
|
|
1287
|
+
markChanged(state);
|
|
1288
|
+
return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (
|
|
1289
|
+
/* istanbul ignore next */
|
|
1290
|
+
false
|
|
1291
|
+
));
|
|
1292
|
+
}
|
|
1293
|
+
clear() {
|
|
1294
|
+
const state = this[DRAFT_STATE];
|
|
1295
|
+
assertUnrevoked(state);
|
|
1296
|
+
if (latest(state).size) {
|
|
1297
|
+
prepareSetCopy(state);
|
|
1298
|
+
markChanged(state);
|
|
1299
|
+
state.copy_.clear();
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
values() {
|
|
1303
|
+
const state = this[DRAFT_STATE];
|
|
1304
|
+
assertUnrevoked(state);
|
|
1305
|
+
prepareSetCopy(state);
|
|
1306
|
+
return state.copy_.values();
|
|
1307
|
+
}
|
|
1308
|
+
entries() {
|
|
1309
|
+
const state = this[DRAFT_STATE];
|
|
1310
|
+
assertUnrevoked(state);
|
|
1311
|
+
prepareSetCopy(state);
|
|
1312
|
+
return state.copy_.entries();
|
|
1313
|
+
}
|
|
1314
|
+
keys() {
|
|
1315
|
+
return this.values();
|
|
1316
|
+
}
|
|
1317
|
+
[(Symbol.iterator)]() {
|
|
1318
|
+
return this.values();
|
|
1319
|
+
}
|
|
1320
|
+
forEach(cb, thisArg) {
|
|
1321
|
+
const iterator = this.values();
|
|
1322
|
+
let result = iterator.next();
|
|
1323
|
+
while (!result.done) {
|
|
1324
|
+
cb.call(thisArg, result.value, result.value, this);
|
|
1325
|
+
result = iterator.next();
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
function proxySet_(target, parent) {
|
|
1330
|
+
return new DraftSet(target, parent);
|
|
1331
|
+
}
|
|
1332
|
+
function prepareSetCopy(state) {
|
|
1333
|
+
if (!state.copy_) {
|
|
1334
|
+
state.copy_ = /* @__PURE__ */ new Set();
|
|
1335
|
+
state.base_.forEach((value) => {
|
|
1336
|
+
if (isDraftable(value)) {
|
|
1337
|
+
const draft = createProxy(value, state);
|
|
1338
|
+
state.drafts_.set(value, draft);
|
|
1339
|
+
state.copy_.add(draft);
|
|
1340
|
+
} else {
|
|
1341
|
+
state.copy_.add(value);
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
function assertUnrevoked(state) {
|
|
1347
|
+
if (state.revoked_)
|
|
1348
|
+
die(3, JSON.stringify(latest(state)));
|
|
1349
|
+
}
|
|
1350
|
+
loadPlugin("MapSet", { proxyMap_, proxySet_ });
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1099
1353
|
// src/immer.ts
|
|
1100
1354
|
var immer = new Immer2();
|
|
1101
1355
|
var produce = immer.produce;
|
|
@@ -2579,181 +2833,205 @@ function _catch(body, recover) {
|
|
|
2579
2833
|
return result;
|
|
2580
2834
|
}
|
|
2581
2835
|
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2836
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
|
2837
|
+
function _finallyRethrows(body, finalizer) {
|
|
2838
|
+
try {
|
|
2839
|
+
var result = body();
|
|
2840
|
+
} catch (e) {
|
|
2841
|
+
return finalizer(true, e);
|
|
2842
|
+
}
|
|
2843
|
+
if (result && result.then) {
|
|
2844
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
2845
|
+
}
|
|
2846
|
+
return finalizer(false, result);
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
var openDatabase = function openDatabase(dbName) {
|
|
2850
|
+
return new Promise(function (resolve, reject) {
|
|
2851
|
+
var request = indexedDB.open(dbName);
|
|
2852
|
+
request.onsuccess = function () {
|
|
2853
|
+
return resolve(request.result);
|
|
2592
2854
|
};
|
|
2593
|
-
|
|
2594
|
-
|
|
2855
|
+
request.onerror = function () {
|
|
2856
|
+
return reject(request.error);
|
|
2595
2857
|
};
|
|
2596
|
-
|
|
2597
|
-
|
|
2858
|
+
});
|
|
2859
|
+
};
|
|
2860
|
+
var runUpgrade = function runUpgrade(dbName, onUpgrade) {
|
|
2861
|
+
try {
|
|
2862
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2863
|
+
var nextVersion = db.version + 1;
|
|
2864
|
+
db.close();
|
|
2865
|
+
return new Promise(function (resolve, reject) {
|
|
2866
|
+
var request = indexedDB.open(dbName, nextVersion);
|
|
2867
|
+
request.onupgradeneeded = function () {
|
|
2868
|
+
var upgradeDb = request.result;
|
|
2869
|
+
onUpgrade(upgradeDb);
|
|
2870
|
+
};
|
|
2871
|
+
request.onsuccess = function () {
|
|
2872
|
+
return resolve(request.result);
|
|
2873
|
+
};
|
|
2874
|
+
request.onerror = function () {
|
|
2875
|
+
return reject(request.error);
|
|
2876
|
+
};
|
|
2877
|
+
request.onblocked = function () {
|
|
2878
|
+
log.warn('IndexedDB upgrade blocked; close other tabs to proceed');
|
|
2879
|
+
};
|
|
2880
|
+
});
|
|
2881
|
+
});
|
|
2882
|
+
} catch (e) {
|
|
2883
|
+
return Promise.reject(e);
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2886
|
+
var ensureStore = function ensureStore(dbName, storeName, keyPath) {
|
|
2887
|
+
try {
|
|
2888
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2598
2889
|
if (db.objectStoreNames.contains(storeName)) {
|
|
2599
|
-
|
|
2600
|
-
} else {
|
|
2601
|
-
db.close();
|
|
2602
|
-
currentVersion++;
|
|
2603
|
-
_setDataToDB(dbName, storeName, data, keyPath);
|
|
2890
|
+
return db;
|
|
2604
2891
|
}
|
|
2605
|
-
db.
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2892
|
+
db.close();
|
|
2893
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
2894
|
+
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
2895
|
+
upgradeDb.createObjectStore(storeName, {
|
|
2896
|
+
keyPath: keyPath
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2899
|
+
}));
|
|
2900
|
+
});
|
|
2901
|
+
} catch (e) {
|
|
2902
|
+
return Promise.reject(e);
|
|
2610
2903
|
}
|
|
2611
2904
|
};
|
|
2612
|
-
var
|
|
2905
|
+
var awaitTransaction = function awaitTransaction(tx) {
|
|
2613
2906
|
return new Promise(function (resolve, reject) {
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
var db = event.target.result;
|
|
2617
|
-
var transaction = event.target.transaction;
|
|
2618
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2619
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2620
|
-
var request = objectStore.get(keyPath);
|
|
2621
|
-
request.onsuccess = function (event) {
|
|
2622
|
-
var result = event.target.result;
|
|
2623
|
-
resolve(result || '');
|
|
2624
|
-
};
|
|
2625
|
-
request.onerror = function (event) {
|
|
2626
|
-
log.error('Error retrieving data during upgrade: ', event.target.error);
|
|
2627
|
-
resolve('');
|
|
2628
|
-
};
|
|
2629
|
-
} else {
|
|
2630
|
-
db.createObjectStore(storeName, {
|
|
2631
|
-
keyPath: keyPatName
|
|
2632
|
-
});
|
|
2633
|
-
resolve('');
|
|
2634
|
-
}
|
|
2907
|
+
tx.oncomplete = function () {
|
|
2908
|
+
return resolve();
|
|
2635
2909
|
};
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
currentVersion++;
|
|
2639
|
-
resolve(_getDataFromDB(dbName, storeName, keyPath));
|
|
2640
|
-
} else {
|
|
2641
|
-
reject(event);
|
|
2642
|
-
}
|
|
2910
|
+
tx.onerror = function () {
|
|
2911
|
+
return reject(tx.error);
|
|
2643
2912
|
};
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2647
|
-
var transaction = db.transaction(storeName, 'readonly');
|
|
2648
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2649
|
-
var request = objectStore.get(keyPath);
|
|
2650
|
-
request.onsuccess = function (event) {
|
|
2651
|
-
var result = event.target.result;
|
|
2652
|
-
if (result) {
|
|
2653
|
-
db.close();
|
|
2654
|
-
resolve(result);
|
|
2655
|
-
} else {
|
|
2656
|
-
log.info('No data found for the specified keyPathValue.');
|
|
2657
|
-
db.close();
|
|
2658
|
-
resolve('');
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
|
-
request.onerror = function (event) {
|
|
2662
|
-
db.close();
|
|
2663
|
-
log.error('Error retrieving data: ', event.target.error);
|
|
2664
|
-
};
|
|
2665
|
-
} else {
|
|
2666
|
-
db.close();
|
|
2667
|
-
resolve('');
|
|
2668
|
-
}
|
|
2913
|
+
tx.onabort = function () {
|
|
2914
|
+
return reject(tx.error);
|
|
2669
2915
|
};
|
|
2670
2916
|
});
|
|
2671
2917
|
};
|
|
2672
|
-
var
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
if (
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2918
|
+
var putWithPossibleOutOfLineKey = function putWithPossibleOutOfLineKey(store, value, keyField) {
|
|
2919
|
+
try {
|
|
2920
|
+
if (store.keyPath !== null) {
|
|
2921
|
+
store.put(value);
|
|
2922
|
+
return;
|
|
2923
|
+
}
|
|
2924
|
+
} catch (e) {}
|
|
2925
|
+
var explicitKey = value === null || value === void 0 ? void 0 : value[keyField];
|
|
2926
|
+
if (explicitKey === undefined || explicitKey === null) {
|
|
2927
|
+
throw new Error("IndexedDB put requires explicit key but value has no '" + keyField + "' field");
|
|
2928
|
+
}
|
|
2929
|
+
store.put(value, explicitKey);
|
|
2930
|
+
};
|
|
2931
|
+
var setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
|
|
2932
|
+
try {
|
|
2933
|
+
if (!('indexedDB' in window)) {
|
|
2934
|
+
log.info("This browser doesn't support IndexedDB");
|
|
2935
|
+
return Promise.resolve();
|
|
2936
|
+
}
|
|
2937
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPath)).then(function (db) {
|
|
2938
|
+
var _temp = _finallyRethrows(function () {
|
|
2939
|
+
var tx = db.transaction(storeName, 'readwrite');
|
|
2940
|
+
var store = tx.objectStore(storeName);
|
|
2941
|
+
data.forEach(function (value) {
|
|
2942
|
+
putWithPossibleOutOfLineKey(store, value, keyPath);
|
|
2943
|
+
});
|
|
2944
|
+
return Promise.resolve(awaitTransaction(tx)).then(function () {});
|
|
2945
|
+
}, function (_wasThrown, _result) {
|
|
2946
|
+
db.close();
|
|
2947
|
+
if (_wasThrown) throw _result;
|
|
2948
|
+
return _result;
|
|
2697
2949
|
});
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2950
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
2951
|
+
});
|
|
2952
|
+
} catch (e) {
|
|
2953
|
+
return Promise.reject(e);
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
var getDataFromDB = function getDataFromDB(dbName, storeName, keyPathValue, keyPathName) {
|
|
2957
|
+
try {
|
|
2958
|
+
return Promise.resolve(_catch(function () {
|
|
2959
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2960
|
+
var _exit = false;
|
|
2961
|
+
function _temp5(_result2) {
|
|
2962
|
+
if (_exit) return _result2;
|
|
2963
|
+
var tx = db.transaction(storeName, 'readonly');
|
|
2964
|
+
var objectStore = tx.objectStore(storeName);
|
|
2965
|
+
return Promise.resolve(new Promise(function (resolve, reject) {
|
|
2966
|
+
var request = objectStore.get(keyPathValue);
|
|
2967
|
+
request.onsuccess = function () {
|
|
2968
|
+
return resolve(request.result);
|
|
2969
|
+
};
|
|
2970
|
+
request.onerror = function () {
|
|
2971
|
+
return reject(request.error);
|
|
2972
|
+
};
|
|
2973
|
+
})).then(function (result) {
|
|
2974
|
+
db.close();
|
|
2975
|
+
return result || '';
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
var _temp4 = function () {
|
|
2979
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
2980
|
+
var _temp3 = function _temp3() {
|
|
2981
|
+
_exit = true;
|
|
2982
|
+
return '';
|
|
2983
|
+
};
|
|
2984
|
+
db.close();
|
|
2985
|
+
var _temp2 = function () {
|
|
2986
|
+
if (keyPathName) {
|
|
2987
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPathName)).then(function (upgraded) {
|
|
2988
|
+
upgraded.close();
|
|
2989
|
+
});
|
|
2990
|
+
}
|
|
2991
|
+
}();
|
|
2992
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
2993
|
+
}
|
|
2994
|
+
}();
|
|
2995
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
2709
2996
|
});
|
|
2710
|
-
}
|
|
2997
|
+
}, function (error) {
|
|
2998
|
+
log.error('Error retrieving data: ', error);
|
|
2999
|
+
return '';
|
|
3000
|
+
}));
|
|
3001
|
+
} catch (e) {
|
|
3002
|
+
return Promise.reject(e);
|
|
2711
3003
|
}
|
|
2712
3004
|
};
|
|
2713
3005
|
var getAllStoreNames = function getAllStoreNames(dbName) {
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
openRequest.onupgradeneeded = function (event) {
|
|
2717
|
-
var db = event.target.result;
|
|
2718
|
-
resolve(Array.from(db.objectStoreNames));
|
|
2719
|
-
};
|
|
2720
|
-
openRequest.onerror = function () {
|
|
2721
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
2722
|
-
reject(openRequest.error);
|
|
2723
|
-
};
|
|
2724
|
-
openRequest.onsuccess = function (event) {
|
|
2725
|
-
var db = event.target.result;
|
|
3006
|
+
try {
|
|
3007
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2726
3008
|
try {
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
resolve(storeNames);
|
|
2730
|
-
} catch (error) {
|
|
3009
|
+
return Array.from(db.objectStoreNames);
|
|
3010
|
+
} finally {
|
|
2731
3011
|
db.close();
|
|
2732
|
-
reject(error);
|
|
2733
3012
|
}
|
|
2734
|
-
};
|
|
2735
|
-
})
|
|
3013
|
+
});
|
|
3014
|
+
} catch (e) {
|
|
3015
|
+
return Promise.reject(e);
|
|
3016
|
+
}
|
|
2736
3017
|
};
|
|
2737
3018
|
var deleteStore = function deleteStore(dbName, storeName) {
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
var db = event.target.result;
|
|
2742
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2743
|
-
db.deleteObjectStore(storeName);
|
|
2744
|
-
currentVersion++;
|
|
2745
|
-
}
|
|
2746
|
-
};
|
|
2747
|
-
openRequest.onerror = function () {
|
|
2748
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
2749
|
-
reject(openRequest.error);
|
|
2750
|
-
};
|
|
2751
|
-
openRequest.onsuccess = function (event) {
|
|
2752
|
-
var db = event.target.result;
|
|
3019
|
+
try {
|
|
3020
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3021
|
+
var shouldDelete = db.objectStoreNames.contains(storeName);
|
|
2753
3022
|
db.close();
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
3023
|
+
if (!shouldDelete) return;
|
|
3024
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
3025
|
+
if (upgradeDb.objectStoreNames.contains(storeName)) {
|
|
3026
|
+
upgradeDb.deleteObjectStore(storeName);
|
|
3027
|
+
}
|
|
3028
|
+
})).then(function (upgraded) {
|
|
3029
|
+
upgraded.close();
|
|
3030
|
+
});
|
|
3031
|
+
});
|
|
3032
|
+
} catch (e) {
|
|
3033
|
+
return Promise.reject(e);
|
|
3034
|
+
}
|
|
2757
3035
|
};
|
|
2758
3036
|
|
|
2759
3037
|
var METADATA_DB_NAME = 'sceyt-metadata-db';
|
|
@@ -2776,7 +3054,7 @@ var storeMetadata = function storeMetadata(url, metadata) {
|
|
|
2776
3054
|
expiresAt: Date.now() + CACHE_DURATION
|
|
2777
3055
|
});
|
|
2778
3056
|
var _temp = _catch(function () {
|
|
2779
|
-
return Promise.resolve(
|
|
3057
|
+
return Promise.resolve(setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
|
|
2780
3058
|
}, function (error) {
|
|
2781
3059
|
console.error('Failed to store metadata in IndexedDB:', error);
|
|
2782
3060
|
});
|
|
@@ -2824,7 +3102,7 @@ var cleanupOldMonthsMetadata = function cleanupOldMonthsMetadata() {
|
|
|
2824
3102
|
var getMetadata = function getMetadata(url) {
|
|
2825
3103
|
return Promise.resolve(_catch(function () {
|
|
2826
3104
|
var currentMonth = getCurrentMonthKey();
|
|
2827
|
-
return Promise.resolve(
|
|
3105
|
+
return Promise.resolve(getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
|
|
2828
3106
|
if (!result || typeof result === 'string') {
|
|
2829
3107
|
return null;
|
|
2830
3108
|
}
|
|
@@ -10662,11 +10940,11 @@ var defaultTheme = {
|
|
|
10662
10940
|
light: '#D9D9DF',
|
|
10663
10941
|
dark: '#303032'
|
|
10664
10942
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND] = {
|
|
10665
|
-
light: '
|
|
10666
|
-
dark: '
|
|
10943
|
+
light: '#111539',
|
|
10944
|
+
dark: '#111539'
|
|
10667
10945
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND_2] = {
|
|
10668
|
-
light: '
|
|
10669
|
-
dark: '
|
|
10946
|
+
light: '#111539',
|
|
10947
|
+
dark: '#111539'
|
|
10670
10948
|
}, _colors[THEME_COLORS.WARNING] = {
|
|
10671
10949
|
light: '#FA4C56',
|
|
10672
10950
|
dark: '#FA4C56'
|
|
@@ -10992,11 +11270,12 @@ var sendTypingAC = function sendTypingAC(state) {
|
|
|
10992
11270
|
}
|
|
10993
11271
|
};
|
|
10994
11272
|
};
|
|
10995
|
-
var sendRecordingAC = function sendRecordingAC(state) {
|
|
11273
|
+
var sendRecordingAC = function sendRecordingAC(state, channelId) {
|
|
10996
11274
|
return {
|
|
10997
11275
|
type: SEND_RECORDING,
|
|
10998
11276
|
payload: {
|
|
10999
|
-
state: state
|
|
11277
|
+
state: state,
|
|
11278
|
+
channelId: channelId
|
|
11000
11279
|
}
|
|
11001
11280
|
};
|
|
11002
11281
|
};
|
|
@@ -12622,7 +12901,7 @@ var UploadPercent = styled.span(_templateObject38 || (_templateObject38 = _tagge
|
|
|
12622
12901
|
}, function (props) {
|
|
12623
12902
|
return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
|
|
12624
12903
|
}, function (props) {
|
|
12625
|
-
return props.backgroundColor + "
|
|
12904
|
+
return props.backgroundColor + "66";
|
|
12626
12905
|
}, function (props) {
|
|
12627
12906
|
return props.borderRadius ? props.borderRadius : props.fileAttachment ? '8px' : props.isRepliedMessage ? '4px' : ' 50%';
|
|
12628
12907
|
}, function (props) {
|
|
@@ -15943,47 +16222,43 @@ function sendTyping(action) {
|
|
|
15943
16222
|
}, _marked22, null, [[3, 7]]);
|
|
15944
16223
|
}
|
|
15945
16224
|
function sendRecording(action) {
|
|
15946
|
-
var state,
|
|
16225
|
+
var _action$payload, state, channelId, channel, _t24;
|
|
15947
16226
|
return _regenerator().w(function (_context23) {
|
|
15948
16227
|
while (1) switch (_context23.p = _context23.n) {
|
|
15949
16228
|
case 0:
|
|
15950
|
-
|
|
16229
|
+
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
15951
16230
|
_context23.n = 1;
|
|
15952
|
-
return call(
|
|
16231
|
+
return call(getChannelFromMap, channelId);
|
|
15953
16232
|
case 1:
|
|
15954
|
-
activeChannelId = _context23.v;
|
|
15955
|
-
_context23.n = 2;
|
|
15956
|
-
return call(getChannelFromMap, activeChannelId);
|
|
15957
|
-
case 2:
|
|
15958
16233
|
channel = _context23.v;
|
|
15959
|
-
_context23.p =
|
|
16234
|
+
_context23.p = 2;
|
|
15960
16235
|
if (!channel) {
|
|
15961
|
-
_context23.n =
|
|
16236
|
+
_context23.n = 5;
|
|
15962
16237
|
break;
|
|
15963
16238
|
}
|
|
15964
16239
|
if (!state) {
|
|
15965
|
-
_context23.n =
|
|
16240
|
+
_context23.n = 4;
|
|
15966
16241
|
break;
|
|
15967
16242
|
}
|
|
15968
|
-
_context23.n =
|
|
16243
|
+
_context23.n = 3;
|
|
15969
16244
|
return call(channel.startRecording);
|
|
15970
|
-
case
|
|
15971
|
-
_context23.n =
|
|
16245
|
+
case 3:
|
|
16246
|
+
_context23.n = 5;
|
|
15972
16247
|
break;
|
|
15973
|
-
case
|
|
15974
|
-
_context23.n =
|
|
16248
|
+
case 4:
|
|
16249
|
+
_context23.n = 5;
|
|
15975
16250
|
return call(channel.stopRecording);
|
|
15976
|
-
case
|
|
15977
|
-
_context23.n =
|
|
16251
|
+
case 5:
|
|
16252
|
+
_context23.n = 7;
|
|
15978
16253
|
break;
|
|
15979
|
-
case
|
|
15980
|
-
_context23.p =
|
|
16254
|
+
case 6:
|
|
16255
|
+
_context23.p = 6;
|
|
15981
16256
|
_t24 = _context23.v;
|
|
15982
16257
|
log.error('ERROR in send recording', _t24);
|
|
15983
|
-
case
|
|
16258
|
+
case 7:
|
|
15984
16259
|
return _context23.a(2);
|
|
15985
16260
|
}
|
|
15986
|
-
}, _marked23, null, [[
|
|
16261
|
+
}, _marked23, null, [[2, 6]]);
|
|
15987
16262
|
}
|
|
15988
16263
|
function clearHistory(action) {
|
|
15989
16264
|
var payload, channelId, channel, activeChannelId, groupName, _t25;
|
|
@@ -16964,7 +17239,7 @@ function sendMessage(action) {
|
|
|
16964
17239
|
} else {
|
|
16965
17240
|
var pendingAttachment = getPendingAttachment(attachment.tid);
|
|
16966
17241
|
if (!attachment.cachedUrl) {
|
|
16967
|
-
|
|
17242
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, updatedAttachment, {
|
|
16968
17243
|
checksum: pendingAttachment.checksum
|
|
16969
17244
|
})], 'checksum');
|
|
16970
17245
|
}
|
|
@@ -17122,7 +17397,7 @@ function sendMessage(action) {
|
|
|
17122
17397
|
});
|
|
17123
17398
|
pendingAttachment = getPendingAttachment(messageAttachment[k].tid);
|
|
17124
17399
|
if (!messageAttachment[k].cachedUrl) {
|
|
17125
|
-
|
|
17400
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, messageResponse.attachments[k], {
|
|
17126
17401
|
checksum: pendingAttachment.checksum || (pendingAttachment === null || pendingAttachment === void 0 ? void 0 : pendingAttachment.file)
|
|
17127
17402
|
})], 'checksum');
|
|
17128
17403
|
}
|
|
@@ -19668,6 +19943,7 @@ function rootSaga() {
|
|
|
19668
19943
|
}, _marked$6);
|
|
19669
19944
|
}
|
|
19670
19945
|
|
|
19946
|
+
enableMapSet();
|
|
19671
19947
|
var sagaMiddleware = createSagaMiddleware();
|
|
19672
19948
|
var store = configureStore({
|
|
19673
19949
|
reducer: {
|
|
@@ -20738,15 +21014,15 @@ var Channel = function Channel(_ref3) {
|
|
|
20738
21014
|
items: filteredItems,
|
|
20739
21015
|
isTyping: !!filteredItems.find(function (item) {
|
|
20740
21016
|
return item.typingState;
|
|
21017
|
+
}),
|
|
21018
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
21019
|
+
return item.recordingState;
|
|
20741
21020
|
})
|
|
20742
21021
|
};
|
|
20743
21022
|
}, [typingOrRecordingIndicator]);
|
|
20744
|
-
var isTypingOrRecording = useMemo(function () {
|
|
20745
|
-
return typingOrRecording.items.length > 0;
|
|
20746
|
-
}, [typingOrRecording]);
|
|
20747
21023
|
var MessageText = useMemo(function () {
|
|
20748
21024
|
return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
|
|
20749
|
-
isTypingOrRecording:
|
|
21025
|
+
isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
|
|
20750
21026
|
user: user,
|
|
20751
21027
|
contactsMap: contactsMap,
|
|
20752
21028
|
getFromContacts: getFromContacts,
|
|
@@ -20760,7 +21036,7 @@ var Channel = function Channel(_ref3) {
|
|
|
20760
21036
|
lastMessage: lastMessage,
|
|
20761
21037
|
isDirectChannel: isDirectChannel
|
|
20762
21038
|
});
|
|
20763
|
-
}, [
|
|
21039
|
+
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel]);
|
|
20764
21040
|
return /*#__PURE__*/React__default.createElement(Container$2, {
|
|
20765
21041
|
theme: theme,
|
|
20766
21042
|
selectedChannel: channel.id === activeChannel.id,
|
|
@@ -20803,9 +21079,9 @@ var Channel = function Channel(_ref3) {
|
|
|
20803
21079
|
unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
|
|
20804
21080
|
fontSize: channelLastMessageFontSize,
|
|
20805
21081
|
height: channelLastMessageHeight
|
|
20806
|
-
},
|
|
21082
|
+
}, typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping || typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording ? !isDirectChannel ? (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
|
|
20807
21083
|
typing: typingOrRecording.isTyping,
|
|
20808
|
-
recording:
|
|
21084
|
+
recording: typingOrRecording.isRecording,
|
|
20809
21085
|
color: textPrimary
|
|
20810
21086
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20811
21087
|
ref: messageAuthorRef
|
|
@@ -20823,11 +21099,11 @@ var Channel = function Channel(_ref3) {
|
|
|
20823
21099
|
color: textPrimary
|
|
20824
21100
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20825
21101
|
ref: messageAuthorRef
|
|
20826
|
-
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !
|
|
21102
|
+
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (draftMessageText || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id)) : ((typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording)) && draftMessageText || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== 'system') && (/*#__PURE__*/React__default.createElement(Points, {
|
|
20827
21103
|
color: draftMessageText && warningColor || textPrimary
|
|
20828
21104
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
20829
21105
|
color: textSecondary,
|
|
20830
|
-
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && !
|
|
21106
|
+
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && (!(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) || !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording)),
|
|
20831
21107
|
noBody: lastMessage && !lastMessage.body,
|
|
20832
21108
|
deletedMessage: lastMessage && lastMessage.state === MESSAGE_STATUS.DELETE
|
|
20833
21109
|
}, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
|
|
@@ -21343,7 +21619,7 @@ var Container$4 = styled.div(_templateObject$8 || (_templateObject$8 = _taggedTe
|
|
|
21343
21619
|
}, function (props) {
|
|
21344
21620
|
return props.height ? props.height + "px" : '0px';
|
|
21345
21621
|
}, function (props) {
|
|
21346
|
-
return props.background + "
|
|
21622
|
+
return props.background + "66";
|
|
21347
21623
|
});
|
|
21348
21624
|
|
|
21349
21625
|
var _templateObject$9, _templateObject2$8, _templateObject3$5, _templateObject4$5, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject0$2, _templateObject1$2;
|
|
@@ -23787,7 +24063,7 @@ var Container$a = styled.div(_templateObject$j || (_templateObject$j = _taggedTe
|
|
|
23787
24063
|
}, function (props) {
|
|
23788
24064
|
return props.dateDividerTextColor;
|
|
23789
24065
|
}, function (props) {
|
|
23790
|
-
return props.dateDividerBackgroundColor + "
|
|
24066
|
+
return props.dateDividerBackgroundColor + "66";
|
|
23791
24067
|
}, function (props) {
|
|
23792
24068
|
return props.dateDividerBorderRadius || '14px';
|
|
23793
24069
|
}, function (props) {
|
|
@@ -25317,7 +25593,7 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
25317
25593
|
text: '',
|
|
25318
25594
|
styles: {
|
|
25319
25595
|
background: {
|
|
25320
|
-
fill: overlayBackground2 + "
|
|
25596
|
+
fill: overlayBackground2 + "66"
|
|
25321
25597
|
},
|
|
25322
25598
|
path: {
|
|
25323
25599
|
stroke: textOnPrimary,
|
|
@@ -25572,7 +25848,7 @@ var Container$c = styled.div(_templateObject$p || (_templateObject$p = _taggedTe
|
|
|
25572
25848
|
}, function (props) {
|
|
25573
25849
|
return props.textColor;
|
|
25574
25850
|
}, function (props) {
|
|
25575
|
-
return props.backgroundColor + "
|
|
25851
|
+
return props.backgroundColor + "66";
|
|
25576
25852
|
}, function (props) {
|
|
25577
25853
|
return props.border;
|
|
25578
25854
|
}, function (props) {
|
|
@@ -26620,7 +26896,7 @@ var VideoTime = styled.div(_templateObject2$o || (_templateObject2$o = _taggedTe
|
|
|
26620
26896
|
}, function (props) {
|
|
26621
26897
|
return props.isRepliedMessage ? '0 3px' : '4px 6px';
|
|
26622
26898
|
}, function (props) {
|
|
26623
|
-
return props.messageTimeBackgroundColor + "
|
|
26899
|
+
return props.messageTimeBackgroundColor + "66";
|
|
26624
26900
|
}, function (props) {
|
|
26625
26901
|
return props.color;
|
|
26626
26902
|
}, function (props) {
|
|
@@ -29234,7 +29510,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29234
29510
|
text: '',
|
|
29235
29511
|
styles: {
|
|
29236
29512
|
background: {
|
|
29237
|
-
fill: overlayBackground2 + "
|
|
29513
|
+
fill: overlayBackground2 + "66"
|
|
29238
29514
|
},
|
|
29239
29515
|
path: {
|
|
29240
29516
|
stroke: textOnPrimary,
|
|
@@ -29284,7 +29560,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29284
29560
|
text: '',
|
|
29285
29561
|
styles: {
|
|
29286
29562
|
background: {
|
|
29287
|
-
fill: overlayBackground2 + "
|
|
29563
|
+
fill: overlayBackground2 + "66"
|
|
29288
29564
|
},
|
|
29289
29565
|
path: {
|
|
29290
29566
|
stroke: textOnPrimary,
|
|
@@ -29391,7 +29667,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29391
29667
|
text: '',
|
|
29392
29668
|
styles: {
|
|
29393
29669
|
background: {
|
|
29394
|
-
fill: overlayBackground2 + "
|
|
29670
|
+
fill: overlayBackground2 + "66"
|
|
29395
29671
|
},
|
|
29396
29672
|
path: {
|
|
29397
29673
|
stroke: textOnPrimary,
|
|
@@ -30563,7 +30839,7 @@ var MessageStatusAndTime = function MessageStatusAndTime(_ref) {
|
|
|
30563
30839
|
}))));
|
|
30564
30840
|
};
|
|
30565
30841
|
var MessageStatusAndTime$1 = /*#__PURE__*/React__default.memo(MessageStatusAndTime, function (prevProps, nextProps) {
|
|
30566
|
-
return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment;
|
|
30842
|
+
return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment && prevProps.withAttachment === nextProps.withAttachment;
|
|
30567
30843
|
});
|
|
30568
30844
|
var MessageStatus = styled.span(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
|
|
30569
30845
|
return props.height || '14px';
|
|
@@ -30582,7 +30858,7 @@ var MessageStatusAndTimeContainer = styled.span(_templateObject3$o || (_template
|
|
|
30582
30858
|
}, function (props) {
|
|
30583
30859
|
return props.withAttachment && '4px 6px';
|
|
30584
30860
|
}, function (props) {
|
|
30585
|
-
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "
|
|
30861
|
+
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "66";
|
|
30586
30862
|
}, function (props) {
|
|
30587
30863
|
return props.lineHeight || '14px';
|
|
30588
30864
|
}, function (props) {
|
|
@@ -30638,7 +30914,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30638
30914
|
var queryBuilder = new client.MessageLinkOGQueryBuilder(url);
|
|
30639
30915
|
return Promise.resolve(queryBuilder.build()).then(function (query) {
|
|
30640
30916
|
return Promise.resolve(query.loadOGData()).then(function (metadata) {
|
|
30641
|
-
return Promise.resolve(storeMetadata(url.replace('https://', ''), metadata)).then(function () {
|
|
30917
|
+
return Promise.resolve(storeMetadata(url.replace('https://', '').replace('http://', ''), metadata)).then(function () {
|
|
30642
30918
|
setMetadata(metadata);
|
|
30643
30919
|
});
|
|
30644
30920
|
});
|
|
@@ -30660,7 +30936,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30660
30936
|
if (attachment !== null && attachment !== void 0 && attachment.id && !metadata) {
|
|
30661
30937
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
30662
30938
|
if (url) {
|
|
30663
|
-
getMetadata(url.replace('https://', '')).then(function (cachedMetadata) {
|
|
30939
|
+
getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
|
|
30664
30940
|
try {
|
|
30665
30941
|
if (cachedMetadata) {
|
|
30666
30942
|
setMetadata(cachedMetadata);
|
|
@@ -33061,7 +33337,7 @@ var MessageTopDate = styled.div(_templateObject4$o || (_templateObject4$o = _tag
|
|
|
33061
33337
|
}, function (props) {
|
|
33062
33338
|
return props.dateDividerTextColor;
|
|
33063
33339
|
}, function (props) {
|
|
33064
|
-
return props.dateDividerBackgroundColor + "
|
|
33340
|
+
return props.dateDividerBackgroundColor + "66";
|
|
33065
33341
|
}, function (props) {
|
|
33066
33342
|
return props.dateDividerBorder;
|
|
33067
33343
|
}, function (props) {
|
|
@@ -35105,19 +35381,19 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35105
35381
|
}, [currentRecordedFile]);
|
|
35106
35382
|
var dispatch = useDispatch();
|
|
35107
35383
|
var handleStartRecording = function handleStartRecording() {
|
|
35108
|
-
dispatch(sendRecordingAC(true));
|
|
35384
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35109
35385
|
if (sendingInterval) {
|
|
35110
35386
|
clearInterval(sendingInterval);
|
|
35111
35387
|
setSendingInterval(null);
|
|
35112
35388
|
return;
|
|
35113
35389
|
}
|
|
35114
35390
|
var interval = setInterval(function () {
|
|
35115
|
-
dispatch(sendRecordingAC(true));
|
|
35391
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35116
35392
|
}, 1000);
|
|
35117
35393
|
setSendingInterval(interval);
|
|
35118
35394
|
};
|
|
35119
35395
|
var handleStopRecording = function handleStopRecording() {
|
|
35120
|
-
dispatch(sendRecordingAC(false));
|
|
35396
|
+
dispatch(sendRecordingAC(false, currentChannelId));
|
|
35121
35397
|
if (sendingInterval) {
|
|
35122
35398
|
clearInterval(sendingInterval);
|
|
35123
35399
|
setSendingInterval(null);
|
|
@@ -35271,10 +35547,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35271
35547
|
return Promise.resolve(_catch(function () {
|
|
35272
35548
|
var _wavesurfer$current3;
|
|
35273
35549
|
function _temp3(_result3) {
|
|
35550
|
+
var _wavesurfer$current$i, _wavesurfer$current$i2;
|
|
35274
35551
|
if (_exit) return _result3;
|
|
35275
|
-
|
|
35276
|
-
return;
|
|
35277
|
-
}
|
|
35552
|
+
setCurrentTime(((_wavesurfer$current$i = wavesurfer.current[id]) === null || _wavesurfer$current$i === void 0 ? void 0 : (_wavesurfer$current$i2 = _wavesurfer$current$i.decodedData) === null || _wavesurfer$current$i2 === void 0 ? void 0 : _wavesurfer$current$i2.duration) || 0);
|
|
35278
35553
|
wavesurfer.current[id].on('ready', function () {
|
|
35279
35554
|
setRecordingIsReadyToPlay(true);
|
|
35280
35555
|
var audioDuration = wavesurfer.current[id].getDuration();
|
|
@@ -35386,7 +35661,6 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35386
35661
|
recorder.stop().getMp3().then(function (_ref4) {
|
|
35387
35662
|
var buffer = _ref4[0],
|
|
35388
35663
|
blob = _ref4[1];
|
|
35389
|
-
setCurrentTime(0);
|
|
35390
35664
|
var file = new File(buffer, 'record.mp3', {
|
|
35391
35665
|
type: blob.type,
|
|
35392
35666
|
lastModified: Date.now()
|
|
@@ -35452,15 +35726,12 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35452
35726
|
if ((_wavesurfer$current5 = wavesurfer.current) !== null && _wavesurfer$current5 !== void 0 && _wavesurfer$current5[cId || currentChannelId]) {
|
|
35453
35727
|
if (!wavesurfer.current[cId || currentChannelId].isPlaying()) {
|
|
35454
35728
|
setPlayAudio(true);
|
|
35455
|
-
handleStartRecording();
|
|
35456
35729
|
intervalRef.current[cId || currentChannelId] = setInterval(function () {
|
|
35457
35730
|
var currentTime = wavesurfer.current[cId || currentChannelId].getCurrentTime();
|
|
35458
35731
|
if (currentTime >= 0) {
|
|
35459
35732
|
setCurrentTime(currentTime);
|
|
35460
35733
|
}
|
|
35461
35734
|
}, 10);
|
|
35462
|
-
} else {
|
|
35463
|
-
handleStopRecording();
|
|
35464
35735
|
}
|
|
35465
35736
|
wavesurfer.current[cId || currentChannelId].playPause();
|
|
35466
35737
|
}
|
|
@@ -35576,6 +35847,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35576
35847
|
setRecordedFile(audioRecording || null);
|
|
35577
35848
|
setRecordingIsReadyToPlay(!!audioRecording);
|
|
35578
35849
|
}
|
|
35850
|
+
handleStopRecording();
|
|
35579
35851
|
setCurrentChannelId(channelId);
|
|
35580
35852
|
}, [channelId]);
|
|
35581
35853
|
return /*#__PURE__*/React__default.createElement(Container$j, {
|
|
@@ -36599,7 +36871,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36599
36871
|
}
|
|
36600
36872
|
var dataFromDb;
|
|
36601
36873
|
var _temp11 = _catch(function () {
|
|
36602
|
-
return Promise.resolve(
|
|
36874
|
+
return Promise.resolve(getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
|
|
36603
36875
|
dataFromDb = _getDataFromDB;
|
|
36604
36876
|
});
|
|
36605
36877
|
}, function (e) {
|
|
@@ -36939,16 +37211,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36939
37211
|
}
|
|
36940
37212
|
};
|
|
36941
37213
|
}, []);
|
|
36942
|
-
var
|
|
36943
|
-
|
|
37214
|
+
var typingOrRecording = useMemo(function () {
|
|
37215
|
+
var dataValues = typingOrRecordingIndicator ? Object.values(typingOrRecordingIndicator) : [];
|
|
37216
|
+
var filteredItems = dataValues.filter(function (item) {
|
|
36944
37217
|
return item.typingState || item.recordingState;
|
|
36945
|
-
}) : [];
|
|
36946
|
-
}, [typingOrRecordingIndicator]);
|
|
36947
|
-
var isTyping = useMemo(function () {
|
|
36948
|
-
return !!filteredTypingOrRecordingIndicator.find(function (item) {
|
|
36949
|
-
return item.typingState;
|
|
36950
37218
|
});
|
|
36951
|
-
|
|
37219
|
+
return {
|
|
37220
|
+
items: filteredItems,
|
|
37221
|
+
isTyping: !!filteredItems.find(function (item) {
|
|
37222
|
+
return item.typingState;
|
|
37223
|
+
}),
|
|
37224
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
37225
|
+
return item.recordingState;
|
|
37226
|
+
})
|
|
37227
|
+
};
|
|
37228
|
+
}, [typingOrRecordingIndicator]);
|
|
36952
37229
|
var formatTypingIndicatorText = function formatTypingIndicatorText(users, maxShownUsers) {
|
|
36953
37230
|
if (maxShownUsers === void 0) {
|
|
36954
37231
|
maxShownUsers = 3;
|
|
@@ -36957,7 +37234,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36957
37234
|
if (users.length === 1) {
|
|
36958
37235
|
var _user = users[0];
|
|
36959
37236
|
var userName = makeUsername(getFromContacts && _user.from && contactsMap[_user.from.id], _user.from, getFromContacts);
|
|
36960
|
-
return "" + userName + (isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
|
|
37237
|
+
return "" + userName + (typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
|
|
36961
37238
|
}
|
|
36962
37239
|
if (users.length <= maxShownUsers) {
|
|
36963
37240
|
var userNames = users.map(function (user) {
|
|
@@ -37027,8 +37304,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37027
37304
|
}, "Join")) : (activeChannel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || activeChannel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? !(activeChannel.userRole === 'admin' || activeChannel.userRole === 'owner') : activeChannel.type !== DEFAULT_CHANNEL_TYPE.DIRECT && !checkActionPermission('sendMessage')) ? (/*#__PURE__*/React__default.createElement(ReadOnlyCont, {
|
|
37028
37305
|
color: textPrimary,
|
|
37029
37306
|
iconColor: accentColor
|
|
37030
|
-
}, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null,
|
|
37031
|
-
from:
|
|
37307
|
+
}, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null, (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.length) > 0 && (CustomTypingIndicator ? (/*#__PURE__*/React__default.createElement(CustomTypingIndicator, {
|
|
37308
|
+
from: typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.map(function (item) {
|
|
37032
37309
|
return {
|
|
37033
37310
|
id: item.from.id,
|
|
37034
37311
|
name: item.from.name,
|
|
@@ -37038,7 +37315,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37038
37315
|
})
|
|
37039
37316
|
})) : (/*#__PURE__*/React__default.createElement(TypingIndicatorCont, null, /*#__PURE__*/React__default.createElement(TypingFrom, {
|
|
37040
37317
|
color: textSecondary
|
|
37041
|
-
}, formatTypingIndicatorText(
|
|
37318
|
+
}, formatTypingIndicatorText(typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items, 3)), typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? (/*#__PURE__*/React__default.createElement(TypingAnimation, {
|
|
37042
37319
|
borderColor: iconInactive
|
|
37043
37320
|
}, /*#__PURE__*/React__default.createElement(DotOne, null), /*#__PURE__*/React__default.createElement(DotTwo, null), /*#__PURE__*/React__default.createElement(DotThree, null))) : (/*#__PURE__*/React__default.createElement(RecordingAnimation, {
|
|
37044
37321
|
borderColor: iconInactive
|
|
@@ -38808,7 +39085,7 @@ var Files = function Files(_ref) {
|
|
|
38808
39085
|
text: '',
|
|
38809
39086
|
styles: {
|
|
38810
39087
|
background: {
|
|
38811
|
-
fill: overlayBackground2 + "
|
|
39088
|
+
fill: overlayBackground2 + "66"
|
|
38812
39089
|
},
|
|
38813
39090
|
path: {
|
|
38814
39091
|
stroke: accentColor,
|