@rpcbase/client 0.460.0 → 0.462.0
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/dist/index.js +116 -88
- package/dist/index.js.map +1 -1
- package/dist/notificationsRealtime.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -373,7 +373,7 @@ const Toaster = () => {
|
|
|
373
373
|
} else {
|
|
374
374
|
t0 = $[0];
|
|
375
375
|
}
|
|
376
|
-
useEffect(_temp8, t0);
|
|
376
|
+
useEffect(_temp8$1, t0);
|
|
377
377
|
const requested = useSyncExternalStore(subscribeToasterRequested, getToasterRequested, getToasterRequested);
|
|
378
378
|
if (!requested) {
|
|
379
379
|
return null;
|
|
@@ -419,7 +419,7 @@ function _temp5$1() {
|
|
|
419
419
|
function _temp6$1() {
|
|
420
420
|
return startToaster();
|
|
421
421
|
}
|
|
422
|
-
function _temp7() {
|
|
422
|
+
function _temp7$1() {
|
|
423
423
|
if (typeof window.requestIdleCallback === "function") {
|
|
424
424
|
window.requestIdleCallback(_temp5$1, {
|
|
425
425
|
timeout: 2e3
|
|
@@ -428,11 +428,11 @@ function _temp7() {
|
|
|
428
428
|
}
|
|
429
429
|
window.setTimeout(_temp6$1, 150);
|
|
430
430
|
}
|
|
431
|
-
function _temp8() {
|
|
431
|
+
function _temp8$1() {
|
|
432
432
|
if (typeof window === "undefined") {
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
const startDeferred = _temp7;
|
|
435
|
+
const startDeferred = _temp7$1;
|
|
436
436
|
if (isPageLoaded()) {
|
|
437
437
|
startDeferred();
|
|
438
438
|
return;
|
|
@@ -2978,7 +2978,7 @@ const queuePendingInAppToasts = (pendingInAppToastItems, items, userId, appName,
|
|
|
2978
2978
|
flushPendingInAppToasts(pendingInAppToastItems, userId, appName, renderNotificationToast);
|
|
2979
2979
|
};
|
|
2980
2980
|
function NotificationsRealtimeProvider(t0) {
|
|
2981
|
-
const $ = c(
|
|
2981
|
+
const $ = c(78);
|
|
2982
2982
|
const {
|
|
2983
2983
|
userId,
|
|
2984
2984
|
appName,
|
|
@@ -2989,6 +2989,7 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
2989
2989
|
} = t0;
|
|
2990
2990
|
const limit = t1 === void 0 ? 200 : t1;
|
|
2991
2991
|
const toastOnNew = t2 === void 0 ? true : t2;
|
|
2992
|
+
const location = useLocation();
|
|
2992
2993
|
let t3;
|
|
2993
2994
|
if ($[0] !== userId) {
|
|
2994
2995
|
t3 = typeof userId === "string" ? userId.trim() : "";
|
|
@@ -3234,31 +3235,51 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3234
3235
|
}
|
|
3235
3236
|
const pendingInAppToastItems = useRef(t19);
|
|
3236
3237
|
let t20;
|
|
3237
|
-
|
|
3238
|
+
let t21;
|
|
3239
|
+
if ($[39] !== canUseRts || $[40] !== location.pathname || $[41] !== location.search) {
|
|
3238
3240
|
t20 = () => {
|
|
3241
|
+
if (!canUseRts) {
|
|
3242
|
+
return;
|
|
3243
|
+
}
|
|
3244
|
+
markNotificationsReadByUrl(`${location.pathname}${location.search}`).then(_temp7).catch(_temp8);
|
|
3245
|
+
};
|
|
3246
|
+
t21 = [canUseRts, location.pathname, location.search];
|
|
3247
|
+
$[39] = canUseRts;
|
|
3248
|
+
$[40] = location.pathname;
|
|
3249
|
+
$[41] = location.search;
|
|
3250
|
+
$[42] = t20;
|
|
3251
|
+
$[43] = t21;
|
|
3252
|
+
} else {
|
|
3253
|
+
t20 = $[42];
|
|
3254
|
+
t21 = $[43];
|
|
3255
|
+
}
|
|
3256
|
+
useEffect(t20, t21);
|
|
3257
|
+
let t22;
|
|
3258
|
+
if ($[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3259
|
+
t22 = () => {
|
|
3239
3260
|
hasSeededToastIds.current = false;
|
|
3240
3261
|
lastToastDeliveryIds.current = /* @__PURE__ */ new Set();
|
|
3241
3262
|
toastStartMs.current = Date.now();
|
|
3242
3263
|
pendingInAppToastItems.current = /* @__PURE__ */ new Map();
|
|
3243
3264
|
};
|
|
3244
|
-
$[
|
|
3265
|
+
$[44] = t22;
|
|
3245
3266
|
} else {
|
|
3246
|
-
|
|
3267
|
+
t22 = $[44];
|
|
3247
3268
|
}
|
|
3248
|
-
let
|
|
3249
|
-
if ($[
|
|
3250
|
-
|
|
3251
|
-
$[
|
|
3252
|
-
$[
|
|
3253
|
-
$[
|
|
3269
|
+
let t23;
|
|
3270
|
+
if ($[45] !== normalizedAppName || $[46] !== trimmedUserId) {
|
|
3271
|
+
t23 = [normalizedAppName, trimmedUserId];
|
|
3272
|
+
$[45] = normalizedAppName;
|
|
3273
|
+
$[46] = trimmedUserId;
|
|
3274
|
+
$[47] = t23;
|
|
3254
3275
|
} else {
|
|
3255
|
-
|
|
3276
|
+
t23 = $[47];
|
|
3256
3277
|
}
|
|
3257
|
-
useEffect(
|
|
3258
|
-
let
|
|
3259
|
-
let
|
|
3260
|
-
if ($[
|
|
3261
|
-
|
|
3278
|
+
useEffect(t22, t23);
|
|
3279
|
+
let t24;
|
|
3280
|
+
let t25;
|
|
3281
|
+
if ($[48] !== canUseRts || $[49] !== normalizedAppName || $[50] !== trimmedUserId) {
|
|
3282
|
+
t24 = () => {
|
|
3262
3283
|
if (!canUseRts) {
|
|
3263
3284
|
return;
|
|
3264
3285
|
}
|
|
@@ -3284,21 +3305,21 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3284
3305
|
removeState();
|
|
3285
3306
|
};
|
|
3286
3307
|
};
|
|
3287
|
-
|
|
3288
|
-
$[
|
|
3289
|
-
$[
|
|
3290
|
-
$[
|
|
3291
|
-
$[
|
|
3292
|
-
$[
|
|
3308
|
+
t25 = [canUseRts, normalizedAppName, trimmedUserId];
|
|
3309
|
+
$[48] = canUseRts;
|
|
3310
|
+
$[49] = normalizedAppName;
|
|
3311
|
+
$[50] = trimmedUserId;
|
|
3312
|
+
$[51] = t24;
|
|
3313
|
+
$[52] = t25;
|
|
3293
3314
|
} else {
|
|
3294
|
-
|
|
3295
|
-
|
|
3315
|
+
t24 = $[51];
|
|
3316
|
+
t25 = $[52];
|
|
3296
3317
|
}
|
|
3297
|
-
useEffect(
|
|
3298
|
-
let
|
|
3299
|
-
let
|
|
3300
|
-
if ($[
|
|
3301
|
-
|
|
3318
|
+
useEffect(t24, t25);
|
|
3319
|
+
let t26;
|
|
3320
|
+
let t27;
|
|
3321
|
+
if ($[53] !== canUseRts || $[54] !== normalizedAppName || $[55] !== renderNotificationToast || $[56] !== trimmedUserId) {
|
|
3322
|
+
t26 = () => {
|
|
3302
3323
|
if (!canUseRts) {
|
|
3303
3324
|
return;
|
|
3304
3325
|
}
|
|
@@ -3315,22 +3336,22 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3315
3336
|
document.removeEventListener("visibilitychange", handlePendingInAppToastFlush);
|
|
3316
3337
|
};
|
|
3317
3338
|
};
|
|
3318
|
-
|
|
3319
|
-
$[
|
|
3320
|
-
$[
|
|
3321
|
-
$[
|
|
3322
|
-
$[
|
|
3323
|
-
$[
|
|
3324
|
-
$[
|
|
3339
|
+
t27 = [canUseRts, normalizedAppName, renderNotificationToast, trimmedUserId];
|
|
3340
|
+
$[53] = canUseRts;
|
|
3341
|
+
$[54] = normalizedAppName;
|
|
3342
|
+
$[55] = renderNotificationToast;
|
|
3343
|
+
$[56] = trimmedUserId;
|
|
3344
|
+
$[57] = t26;
|
|
3345
|
+
$[58] = t27;
|
|
3325
3346
|
} else {
|
|
3326
|
-
|
|
3327
|
-
|
|
3347
|
+
t26 = $[57];
|
|
3348
|
+
t27 = $[58];
|
|
3328
3349
|
}
|
|
3329
|
-
useEffect(
|
|
3330
|
-
let
|
|
3331
|
-
let
|
|
3332
|
-
if ($[
|
|
3333
|
-
|
|
3350
|
+
useEffect(t26, t27);
|
|
3351
|
+
let t28;
|
|
3352
|
+
let t29;
|
|
3353
|
+
if ($[59] !== canUseRts || $[60] !== normalizedAppName || $[61] !== notificationDeliveries || $[62] !== notificationDeliveriesQuery.loading || $[63] !== renderNotificationToast || $[64] !== toastOnNew || $[65] !== trimmedUserId) {
|
|
3354
|
+
t28 = () => {
|
|
3334
3355
|
if (!toastOnNew) {
|
|
3335
3356
|
return;
|
|
3336
3357
|
}
|
|
@@ -3378,61 +3399,68 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3378
3399
|
queuePendingInAppToasts(pendingInAppToastItems, pending_0, trimmedUserId, normalizedAppName, renderNotificationToast);
|
|
3379
3400
|
});
|
|
3380
3401
|
};
|
|
3381
|
-
|
|
3382
|
-
$[
|
|
3383
|
-
$[
|
|
3384
|
-
$[
|
|
3385
|
-
$[
|
|
3386
|
-
$[
|
|
3387
|
-
$[
|
|
3388
|
-
$[
|
|
3389
|
-
$[
|
|
3390
|
-
$[
|
|
3391
|
-
} else {
|
|
3392
|
-
|
|
3393
|
-
|
|
3402
|
+
t29 = [canUseRts, normalizedAppName, notificationDeliveries, notificationDeliveriesQuery.loading, renderNotificationToast, toastOnNew, trimmedUserId];
|
|
3403
|
+
$[59] = canUseRts;
|
|
3404
|
+
$[60] = normalizedAppName;
|
|
3405
|
+
$[61] = notificationDeliveries;
|
|
3406
|
+
$[62] = notificationDeliveriesQuery.loading;
|
|
3407
|
+
$[63] = renderNotificationToast;
|
|
3408
|
+
$[64] = toastOnNew;
|
|
3409
|
+
$[65] = trimmedUserId;
|
|
3410
|
+
$[66] = t28;
|
|
3411
|
+
$[67] = t29;
|
|
3412
|
+
} else {
|
|
3413
|
+
t28 = $[66];
|
|
3414
|
+
t29 = $[67];
|
|
3394
3415
|
}
|
|
3395
|
-
useEffect(
|
|
3396
|
-
let
|
|
3397
|
-
if ($[
|
|
3398
|
-
|
|
3416
|
+
useEffect(t28, t29);
|
|
3417
|
+
let t30;
|
|
3418
|
+
if ($[68] !== notifications || $[69] !== notificationsQuery.error || $[70] !== notificationsQuery.loading || $[71] !== unreadCount || $[72] !== unseenCount) {
|
|
3419
|
+
t30 = {
|
|
3399
3420
|
notifications,
|
|
3400
3421
|
unreadCount,
|
|
3401
3422
|
unseenCount,
|
|
3402
3423
|
loading: notificationsQuery.loading,
|
|
3403
3424
|
error: notificationsQuery.error
|
|
3404
3425
|
};
|
|
3405
|
-
$[
|
|
3406
|
-
$[
|
|
3407
|
-
$[
|
|
3408
|
-
$[
|
|
3409
|
-
$[
|
|
3410
|
-
$[
|
|
3426
|
+
$[68] = notifications;
|
|
3427
|
+
$[69] = notificationsQuery.error;
|
|
3428
|
+
$[70] = notificationsQuery.loading;
|
|
3429
|
+
$[71] = unreadCount;
|
|
3430
|
+
$[72] = unseenCount;
|
|
3431
|
+
$[73] = t30;
|
|
3411
3432
|
} else {
|
|
3412
|
-
|
|
3413
|
-
}
|
|
3414
|
-
const value =
|
|
3415
|
-
const
|
|
3416
|
-
let
|
|
3417
|
-
if ($[
|
|
3418
|
-
|
|
3419
|
-
$[
|
|
3433
|
+
t30 = $[73];
|
|
3434
|
+
}
|
|
3435
|
+
const value = t30;
|
|
3436
|
+
const t31 = canUseRts ? value : null;
|
|
3437
|
+
let t32;
|
|
3438
|
+
if ($[74] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3439
|
+
t32 = /* @__PURE__ */ jsx("style", { children: notificationToastStyles });
|
|
3440
|
+
$[74] = t32;
|
|
3420
3441
|
} else {
|
|
3421
|
-
|
|
3442
|
+
t32 = $[74];
|
|
3422
3443
|
}
|
|
3423
|
-
let
|
|
3424
|
-
if ($[
|
|
3425
|
-
|
|
3426
|
-
|
|
3444
|
+
let t33;
|
|
3445
|
+
if ($[75] !== children || $[76] !== t31) {
|
|
3446
|
+
t33 = /* @__PURE__ */ jsxs(NotificationsRealtimeContext.Provider, { value: t31, children: [
|
|
3447
|
+
t32,
|
|
3427
3448
|
children
|
|
3428
3449
|
] });
|
|
3429
|
-
$[
|
|
3430
|
-
$[
|
|
3431
|
-
$[
|
|
3450
|
+
$[75] = children;
|
|
3451
|
+
$[76] = t31;
|
|
3452
|
+
$[77] = t33;
|
|
3432
3453
|
} else {
|
|
3433
|
-
|
|
3454
|
+
t33 = $[77];
|
|
3455
|
+
}
|
|
3456
|
+
return t33;
|
|
3457
|
+
}
|
|
3458
|
+
function _temp8() {
|
|
3459
|
+
}
|
|
3460
|
+
function _temp7(result) {
|
|
3461
|
+
if (result.modifiedCount > 0) {
|
|
3462
|
+
window.dispatchEvent(new Event("rb-notifications-refresh"));
|
|
3434
3463
|
}
|
|
3435
|
-
return t31;
|
|
3436
3464
|
}
|
|
3437
3465
|
function _temp6(acc_0, n_2) {
|
|
3438
3466
|
return acc_0 + (n_2.seenAt ? 0 : 1);
|