@liveblocks/react 2.17.0-usrnotsettings2 → 2.17.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/_private.d.mts +1 -1
- package/dist/_private.d.ts +1 -1
- package/dist/_private.js +5 -5
- package/dist/_private.mjs +1 -1
- package/dist/{chunk-X2FQ2FNK.mjs → chunk-4KNGHD4I.mjs} +11 -193
- package/dist/chunk-4KNGHD4I.mjs.map +1 -0
- package/dist/{chunk-CTSQGLA4.js → chunk-J5ZDLMBE.js} +29 -211
- package/dist/chunk-J5ZDLMBE.js.map +1 -0
- package/dist/{chunk-QJATV7TB.js → chunk-K7QFAI6G.js} +2 -2
- package/dist/chunk-K7QFAI6G.js.map +1 -0
- package/dist/{chunk-D5P6PENM.mjs → chunk-XHQ4VJ7B.mjs} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{room-DlI0Yrzf.d.mts → room-DVbQkoj3.d.mts} +4 -75
- package/dist/{room-DlI0Yrzf.d.ts → room-DVbQkoj3.d.ts} +4 -75
- package/dist/suspense.d.mts +2 -2
- package/dist/suspense.d.ts +2 -2
- package/dist/suspense.js +4 -9
- package/dist/suspense.js.map +1 -1
- package/dist/suspense.mjs +3 -8
- package/dist/suspense.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-CTSQGLA4.js.map +0 -1
- package/dist/chunk-QJATV7TB.js.map +0 -1
- package/dist/chunk-X2FQ2FNK.mjs.map +0 -1
- /package/dist/{chunk-D5P6PENM.mjs.map → chunk-XHQ4VJ7B.mjs.map} +0 -0
package/dist/_private.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-
|
|
1
|
+
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-DVbQkoj3.mjs';
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
3
3
|
import { ISignal, SyncSource } from '@liveblocks/core';
|
|
4
4
|
import '@liveblocks/client';
|
package/dist/_private.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-
|
|
1
|
+
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-DVbQkoj3.js';
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
3
3
|
import { ISignal, SyncSource } from '@liveblocks/core';
|
|
4
4
|
import '@liveblocks/client';
|
package/dist/_private.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkJ5ZDLMBEjs = require('./chunk-J5ZDLMBE.js');
|
|
28
28
|
|
|
29
29
|
// src/lib/use-layout-effect.ts
|
|
30
30
|
var _react = require('react');
|
|
@@ -37,8 +37,8 @@ var MENTION_SUGGESTIONS_DEBOUNCE = 500;
|
|
|
37
37
|
function useMentionSuggestions(roomId, search) {
|
|
38
38
|
const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
|
|
39
39
|
const lastInvokedAt = _react.useRef.call(void 0, );
|
|
40
|
-
const resolveMentionSuggestions =
|
|
41
|
-
const mentionSuggestionsCache =
|
|
40
|
+
const resolveMentionSuggestions = _chunkJ5ZDLMBEjs.useResolveMentionSuggestions.call(void 0, );
|
|
41
|
+
const mentionSuggestionsCache = _chunkJ5ZDLMBEjs.useMentionSuggestionsCache.call(void 0, );
|
|
42
42
|
_react.useEffect.call(void 0, () => {
|
|
43
43
|
if (search === void 0 || !resolveMentionSuggestions) {
|
|
44
44
|
return;
|
|
@@ -87,7 +87,7 @@ function useMentionSuggestions(roomId, search) {
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
function useSyncSource() {
|
|
90
|
-
const client =
|
|
90
|
+
const client = _chunkJ5ZDLMBEjs.useClient.call(void 0, );
|
|
91
91
|
const createSyncSource = client[_core.kInternal].createSyncSource;
|
|
92
92
|
const [syncSource, setSyncSource] = _react.useState.call(void 0, );
|
|
93
93
|
_react.useEffect.call(void 0, () => {
|
|
@@ -125,5 +125,5 @@ function useSyncSource() {
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
exports.getUmbrellaStoreForClient =
|
|
128
|
+
exports.getUmbrellaStoreForClient = _chunkJ5ZDLMBEjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkJ5ZDLMBEjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkJ5ZDLMBEjs.useClientOrNull; exports.useCreateRoomComment = _chunkJ5ZDLMBEjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkJ5ZDLMBEjs.useCreateRoomThread; exports.useCreateTextMention = _chunkJ5ZDLMBEjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkJ5ZDLMBEjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkJ5ZDLMBEjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkJ5ZDLMBEjs.useDeleteTextMention; exports.useEditRoomComment = _chunkJ5ZDLMBEjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkJ5ZDLMBEjs.useEditRoomThreadMetadata; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkJ5ZDLMBEjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkJ5ZDLMBEjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkJ5ZDLMBEjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkJ5ZDLMBEjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkJ5ZDLMBEjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkJ5ZDLMBEjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkJ5ZDLMBEjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkJ5ZDLMBEjs.useRoomAttachmentUrl; exports.useRoomOrNull = _chunkJ5ZDLMBEjs.useRoomOrNull; exports.useRoomPermissions = _chunkJ5ZDLMBEjs.useRoomPermissions; exports.useSignal = _chunkJ5ZDLMBEjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkJ5ZDLMBEjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkJ5ZDLMBEjs.useYjsProvider;
|
|
129
129
|
//# sourceMappingURL=_private.js.map
|
package/dist/_private.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
useSignal,
|
|
25
25
|
useSyncExternalStoreWithSelector,
|
|
26
26
|
useYjsProvider
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4KNGHD4I.mjs";
|
|
28
28
|
|
|
29
29
|
// src/lib/use-layout-effect.ts
|
|
30
30
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -130,9 +130,7 @@ var config = {
|
|
|
130
130
|
HISTORY_VERSIONS_POLL_INTERVAL: 1 * MINUTES,
|
|
131
131
|
HISTORY_VERSIONS_MAX_STALE_TIME: 5 * SECONDS,
|
|
132
132
|
NOTIFICATION_SETTINGS_POLL_INTERVAL: 1 * MINUTES,
|
|
133
|
-
NOTIFICATION_SETTINGS_MAX_STALE_TIME: 5 * SECONDS
|
|
134
|
-
USER_NOTIFICATION_SETTINGS_INTERVAL: 5 * MINUTES,
|
|
135
|
-
USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME: 1 * MINUTES
|
|
133
|
+
NOTIFICATION_SETTINGS_MAX_STALE_TIME: 5 * SECONDS
|
|
136
134
|
};
|
|
137
135
|
|
|
138
136
|
// src/lib/AsyncResult.ts
|
|
@@ -235,8 +233,6 @@ import {
|
|
|
235
233
|
console as console2,
|
|
236
234
|
DefaultMap,
|
|
237
235
|
DerivedSignal,
|
|
238
|
-
entries,
|
|
239
|
-
keys,
|
|
240
236
|
kInternal,
|
|
241
237
|
MutableSignal as MutableSignal2,
|
|
242
238
|
nanoid,
|
|
@@ -727,26 +723,6 @@ function createStore_forPermissionHints() {
|
|
|
727
723
|
update
|
|
728
724
|
};
|
|
729
725
|
}
|
|
730
|
-
function createStore_forUserNotificationSettings(updates) {
|
|
731
|
-
const signal = new Signal({});
|
|
732
|
-
function update(settings) {
|
|
733
|
-
signal.set((prevSettings) => {
|
|
734
|
-
return {
|
|
735
|
-
...prevSettings,
|
|
736
|
-
...settings
|
|
737
|
-
};
|
|
738
|
-
});
|
|
739
|
-
}
|
|
740
|
-
return {
|
|
741
|
-
signal: DerivedSignal.from(
|
|
742
|
-
signal,
|
|
743
|
-
updates,
|
|
744
|
-
(base, updates2) => applyOptimisticUpdates_forUserNotificationSettings(base, updates2)
|
|
745
|
-
),
|
|
746
|
-
// Mutations
|
|
747
|
-
update
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
726
|
function createStore_forOptimistic(client) {
|
|
751
727
|
const signal = new Signal([]);
|
|
752
728
|
const syncSource = client[kInternal].createSyncSource();
|
|
@@ -780,17 +756,15 @@ var UmbrellaStore = class {
|
|
|
780
756
|
//
|
|
781
757
|
// Mutate inputs... ...observe clean/consistent output!
|
|
782
758
|
//
|
|
783
|
-
// .-> Base ThreadDB ---------+ +----> Clean threads by ID
|
|
759
|
+
// .-> Base ThreadDB ---------+ +----> Clean threads by ID (Part 1)
|
|
784
760
|
// / | |
|
|
785
|
-
// mutate ----> Base Notifications --+ | | +--> Clean notifications
|
|
761
|
+
// mutate ----> Base Notifications --+ | | +--> Clean notifications (Part 1)
|
|
786
762
|
// \ | | | | & notifications by ID
|
|
787
763
|
// | \ | | Apply | |
|
|
788
|
-
// | `-> OptimisticUpdates --+--+--> Optimistic --+-+-->
|
|
789
|
-
// \ | Updates
|
|
790
|
-
// `------- etc etc ---------+
|
|
791
|
-
// ^
|
|
792
|
-
// | +-----> User Notification Settings (Part 4)
|
|
793
|
-
// |
|
|
764
|
+
// | `-> OptimisticUpdates --+--+--> Optimistic --+-+--> Notification Settings (Part 2)
|
|
765
|
+
// \ | Updates |
|
|
766
|
+
// `------- etc etc ---------+ +--> History Versions (Part 3)
|
|
767
|
+
// ^
|
|
794
768
|
// |
|
|
795
769
|
// | ^ ^
|
|
796
770
|
// Signal | |
|
|
@@ -811,7 +785,6 @@ var UmbrellaStore = class {
|
|
|
811
785
|
// prettier-ignore
|
|
812
786
|
historyVersions;
|
|
813
787
|
permissionHints;
|
|
814
|
-
userNotificationSettings;
|
|
815
788
|
optimisticUpdates;
|
|
816
789
|
//
|
|
817
790
|
// Output signals.
|
|
@@ -832,8 +805,6 @@ var UmbrellaStore = class {
|
|
|
832
805
|
#userThreadsLastRequestedAt = null;
|
|
833
806
|
// Room versions
|
|
834
807
|
#roomVersionsLastRequestedAtByRoom = /* @__PURE__ */ new Map();
|
|
835
|
-
// User Notification Settings
|
|
836
|
-
#userNotificationSettings;
|
|
837
808
|
constructor(client) {
|
|
838
809
|
this.#client = client[kInternal].as();
|
|
839
810
|
this.optimisticUpdates = createStore_forOptimistic(this.#client);
|
|
@@ -849,16 +820,6 @@ var UmbrellaStore = class {
|
|
|
849
820
|
return nextCursor;
|
|
850
821
|
}
|
|
851
822
|
);
|
|
852
|
-
const userNotificationSettingsFetcher = async () => {
|
|
853
|
-
const result = await this.#client.getNotificationSettings();
|
|
854
|
-
this.userNotificationSettings.update(result);
|
|
855
|
-
};
|
|
856
|
-
this.userNotificationSettings = createStore_forUserNotificationSettings(
|
|
857
|
-
this.optimisticUpdates.signal
|
|
858
|
-
);
|
|
859
|
-
this.#userNotificationSettings = new SinglePageResource(
|
|
860
|
-
userNotificationSettingsFetcher
|
|
861
|
-
);
|
|
862
823
|
this.threads = new ThreadDB();
|
|
863
824
|
this.notifications = createStore_forNotifications();
|
|
864
825
|
this.roomNotificationSettings = createStore_forRoomNotificationSettings(
|
|
@@ -1036,19 +997,6 @@ var UmbrellaStore = class {
|
|
|
1036
997
|
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1037
998
|
}
|
|
1038
999
|
);
|
|
1039
|
-
const userNotificationSettings = {
|
|
1040
|
-
signal: DerivedSignal.from(() => {
|
|
1041
|
-
const result = this.#userNotificationSettings.get();
|
|
1042
|
-
if (result.isLoading || result.error) {
|
|
1043
|
-
return result;
|
|
1044
|
-
}
|
|
1045
|
-
return ASYNC_OK(
|
|
1046
|
-
"settings",
|
|
1047
|
-
nn(this.userNotificationSettings.signal.get())
|
|
1048
|
-
);
|
|
1049
|
-
}, shallow3),
|
|
1050
|
-
waitUntilLoaded: this.#userNotificationSettings.waitUntilLoaded
|
|
1051
|
-
};
|
|
1052
1000
|
this.outputs = {
|
|
1053
1001
|
threadifications,
|
|
1054
1002
|
threads,
|
|
@@ -1057,8 +1005,7 @@ var UmbrellaStore = class {
|
|
|
1057
1005
|
notifications,
|
|
1058
1006
|
loadingNotifications,
|
|
1059
1007
|
settingsByRoomId,
|
|
1060
|
-
versionsByRoomId
|
|
1061
|
-
userNotificationSettings
|
|
1008
|
+
versionsByRoomId
|
|
1062
1009
|
};
|
|
1063
1010
|
autobind(this);
|
|
1064
1011
|
}
|
|
@@ -1303,25 +1250,6 @@ var UmbrellaStore = class {
|
|
|
1303
1250
|
const result = await room.getNotificationSettings({ signal });
|
|
1304
1251
|
this.roomNotificationSettings.update(roomId, result);
|
|
1305
1252
|
}
|
|
1306
|
-
/**
|
|
1307
|
-
* Refresh User Notification Settings from poller
|
|
1308
|
-
*/
|
|
1309
|
-
async refreshUserNotificationSettings(signal) {
|
|
1310
|
-
const result = await this.#client.getNotificationSettings({
|
|
1311
|
-
signal
|
|
1312
|
-
});
|
|
1313
|
-
this.userNotificationSettings.update(result);
|
|
1314
|
-
}
|
|
1315
|
-
/**
|
|
1316
|
-
* Updates user notification settings with a new value, replacing the
|
|
1317
|
-
* corresponding optimistic update.
|
|
1318
|
-
*/
|
|
1319
|
-
updateUserNotificationSettings_confirmOptimisticUpdate(settings, optimisticUpdateId) {
|
|
1320
|
-
batch2(() => {
|
|
1321
|
-
this.optimisticUpdates.remove(optimisticUpdateId);
|
|
1322
|
-
this.userNotificationSettings.update(settings);
|
|
1323
|
-
});
|
|
1324
|
-
}
|
|
1325
1253
|
};
|
|
1326
1254
|
function applyOptimisticUpdates_forThreadifications(baseThreadsDB, notificationsLUT, optimisticUpdates) {
|
|
1327
1255
|
const threadsDB = baseThreadsDB.clone();
|
|
@@ -1496,33 +1424,6 @@ function applyOptimisticUpdates_forSettings(settingsLUT, optimisticUpdates) {
|
|
|
1496
1424
|
}
|
|
1497
1425
|
return settingsByRoomId;
|
|
1498
1426
|
}
|
|
1499
|
-
function applyOptimisticUpdates_forUserNotificationSettings(baseSettings, optimisticUpdates) {
|
|
1500
|
-
const outcomingSettings = { ...baseSettings };
|
|
1501
|
-
for (const optimisticUpdate of optimisticUpdates) {
|
|
1502
|
-
switch (optimisticUpdate.type) {
|
|
1503
|
-
case "update-user-notification-settings": {
|
|
1504
|
-
const incomingSettings = optimisticUpdate.settings;
|
|
1505
|
-
for (const channelKey of keys(incomingSettings)) {
|
|
1506
|
-
const key = channelKey;
|
|
1507
|
-
const channelUpdates = incomingSettings[key];
|
|
1508
|
-
if (channelUpdates) {
|
|
1509
|
-
const realChannelUpdates = Object.fromEntries(
|
|
1510
|
-
entries(channelUpdates).filter(
|
|
1511
|
-
([_, value]) => value !== void 0
|
|
1512
|
-
)
|
|
1513
|
-
);
|
|
1514
|
-
outcomingSettings[key] = {
|
|
1515
|
-
...outcomingSettings[key],
|
|
1516
|
-
...realChannelUpdates
|
|
1517
|
-
};
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
break;
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
return outcomingSettings;
|
|
1525
|
-
}
|
|
1526
1427
|
function compareInboxNotifications(inboxNotificationA, inboxNotificationB) {
|
|
1527
1428
|
if (inboxNotificationA.notifiedAt > inboxNotificationB.notifiedAt) {
|
|
1528
1429
|
return 1;
|
|
@@ -1816,25 +1717,10 @@ function makeLiveblocksExtrasForClient(client) {
|
|
|
1816
1717
|
config.USER_THREADS_POLL_INTERVAL,
|
|
1817
1718
|
{ maxStaleTimeMs: config.USER_THREADS_MAX_STALE_TIME }
|
|
1818
1719
|
);
|
|
1819
|
-
const userNotificationSettingsPoller = makePoller(
|
|
1820
|
-
async (signal) => {
|
|
1821
|
-
try {
|
|
1822
|
-
return await store.refreshUserNotificationSettings(signal);
|
|
1823
|
-
} catch (err) {
|
|
1824
|
-
console.warn(
|
|
1825
|
-
`Polling new user notification settings failed: ${String(err)}`
|
|
1826
|
-
);
|
|
1827
|
-
throw err;
|
|
1828
|
-
}
|
|
1829
|
-
},
|
|
1830
|
-
config.USER_NOTIFICATION_SETTINGS_INTERVAL,
|
|
1831
|
-
{ maxStaleTimeMs: config.USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME }
|
|
1832
|
-
);
|
|
1833
1720
|
return {
|
|
1834
1721
|
store,
|
|
1835
1722
|
notificationsPoller,
|
|
1836
|
-
userThreadsPoller
|
|
1837
|
-
userNotificationSettingsPoller
|
|
1723
|
+
userThreadsPoller
|
|
1838
1724
|
};
|
|
1839
1725
|
}
|
|
1840
1726
|
function makeLiveblocksContextBundle(client) {
|
|
@@ -1843,7 +1729,6 @@ function makeLiveblocksContextBundle(client) {
|
|
|
1843
1729
|
const useMarkAllInboxNotificationsAsRead2 = () => useMarkAllInboxNotificationsAsRead_withClient(client);
|
|
1844
1730
|
const useDeleteInboxNotification2 = () => useDeleteInboxNotification_withClient(client);
|
|
1845
1731
|
const useDeleteAllInboxNotifications2 = () => useDeleteAllInboxNotifications_withClient(client);
|
|
1846
|
-
const useUpdateNotificationSettings2 = () => useUpdateNotificationSettings_withClient(client);
|
|
1847
1732
|
function LiveblocksProvider2(props) {
|
|
1848
1733
|
useEnsureNoLiveblocksProvider();
|
|
1849
1734
|
return /* @__PURE__ */ jsx(ClientContext.Provider, { value: client, children: props.children });
|
|
@@ -1857,8 +1742,6 @@ function makeLiveblocksContextBundle(client) {
|
|
|
1857
1742
|
useMarkAllInboxNotificationsAsRead: useMarkAllInboxNotificationsAsRead2,
|
|
1858
1743
|
useDeleteInboxNotification: useDeleteInboxNotification2,
|
|
1859
1744
|
useDeleteAllInboxNotifications: useDeleteAllInboxNotifications2,
|
|
1860
|
-
useNotificationSettings: () => useNotificationSettings_withClient(client),
|
|
1861
|
-
useUpdateNotificationSettings: useUpdateNotificationSettings2,
|
|
1862
1745
|
useInboxNotificationThread: useInboxNotificationThread2,
|
|
1863
1746
|
useUserThreads_experimental,
|
|
1864
1747
|
...shared.classic,
|
|
@@ -1871,8 +1754,6 @@ function makeLiveblocksContextBundle(client) {
|
|
|
1871
1754
|
useDeleteInboxNotification: useDeleteInboxNotification2,
|
|
1872
1755
|
useDeleteAllInboxNotifications: useDeleteAllInboxNotifications2,
|
|
1873
1756
|
useInboxNotificationThread: useInboxNotificationThread2,
|
|
1874
|
-
useNotificationSettings: () => useNotificationSettingsSuspense_withClient(client),
|
|
1875
|
-
useUpdateNotificationSettings: useUpdateNotificationSettings2,
|
|
1876
1757
|
useUserThreads_experimental: useUserThreadsSuspense_experimental,
|
|
1877
1758
|
...shared.suspense
|
|
1878
1759
|
}
|
|
@@ -2057,58 +1938,6 @@ function useInboxNotificationThread_withClient(client, inboxNotificationId) {
|
|
|
2057
1938
|
)
|
|
2058
1939
|
);
|
|
2059
1940
|
}
|
|
2060
|
-
function useUpdateNotificationSettings_withClient(client) {
|
|
2061
|
-
return useCallback2(
|
|
2062
|
-
(settings) => {
|
|
2063
|
-
const { store } = getLiveblocksExtrasForClient(client);
|
|
2064
|
-
const optimisticUpdateId = store.optimisticUpdates.add({
|
|
2065
|
-
type: "update-user-notification-settings",
|
|
2066
|
-
settings
|
|
2067
|
-
});
|
|
2068
|
-
client.updateNotificationSettings(settings).then(
|
|
2069
|
-
(settings2) => {
|
|
2070
|
-
store.updateUserNotificationSettings_confirmOptimisticUpdate(
|
|
2071
|
-
settings2,
|
|
2072
|
-
optimisticUpdateId
|
|
2073
|
-
);
|
|
2074
|
-
},
|
|
2075
|
-
() => {
|
|
2076
|
-
store.optimisticUpdates.remove(optimisticUpdateId);
|
|
2077
|
-
}
|
|
2078
|
-
);
|
|
2079
|
-
},
|
|
2080
|
-
[client]
|
|
2081
|
-
);
|
|
2082
|
-
}
|
|
2083
|
-
function useNotificationSettings_withClient(client) {
|
|
2084
|
-
const updateNotificationSettings = useUpdateNotificationSettings_withClient(client);
|
|
2085
|
-
const { store, userNotificationSettingsPoller: poller } = getLiveblocksExtrasForClient(client);
|
|
2086
|
-
useEffect3(() => {
|
|
2087
|
-
void store.outputs.userNotificationSettings.waitUntilLoaded();
|
|
2088
|
-
});
|
|
2089
|
-
useEffect3(() => {
|
|
2090
|
-
poller.inc();
|
|
2091
|
-
poller.pollNowIfStale();
|
|
2092
|
-
return () => {
|
|
2093
|
-
poller.dec();
|
|
2094
|
-
};
|
|
2095
|
-
}, [poller]);
|
|
2096
|
-
const settings = useSignal(store.outputs.userNotificationSettings.signal);
|
|
2097
|
-
return useMemo2(() => {
|
|
2098
|
-
return [settings, updateNotificationSettings];
|
|
2099
|
-
}, [settings, updateNotificationSettings]);
|
|
2100
|
-
}
|
|
2101
|
-
function useNotificationSettingsSuspense_withClient(client) {
|
|
2102
|
-
ensureNotServerSide();
|
|
2103
|
-
const store = getLiveblocksExtrasForClient(client).store;
|
|
2104
|
-
use(store.outputs.userNotificationSettings.waitUntilLoaded());
|
|
2105
|
-
const [settings, updateNotificationSettings] = useNotificationSettings_withClient(client);
|
|
2106
|
-
assert(!settings.error, "Did not expect error");
|
|
2107
|
-
assert(!settings.isLoading, "Did not expect loading");
|
|
2108
|
-
return useMemo2(() => {
|
|
2109
|
-
return [settings, updateNotificationSettings];
|
|
2110
|
-
}, [settings, updateNotificationSettings]);
|
|
2111
|
-
}
|
|
2112
1941
|
function useUser_withClient(client, userId) {
|
|
2113
1942
|
const usersStore = client[kInternal2].usersStore;
|
|
2114
1943
|
const getUserState = useCallback2(
|
|
@@ -2282,6 +2111,7 @@ function LiveblocksProvider(props) {
|
|
|
2282
2111
|
lostConnectionTimeout: useInitial(o.lostConnectionTimeout),
|
|
2283
2112
|
backgroundKeepAliveTimeout: useInitial(o.backgroundKeepAliveTimeout),
|
|
2284
2113
|
polyfills: useInitial(o.polyfills),
|
|
2114
|
+
largeMessageStrategy: useInitial(o.largeMessageStrategy),
|
|
2285
2115
|
unstable_fallbackToHTTP: useInitial(o.unstable_fallbackToHTTP),
|
|
2286
2116
|
unstable_streamData: useInitial(o.unstable_streamData),
|
|
2287
2117
|
preventUnsavedChanges: useInitial(o.preventUnsavedChanges),
|
|
@@ -2373,15 +2203,6 @@ function useUnreadInboxNotificationsCount() {
|
|
|
2373
2203
|
function useUnreadInboxNotificationsCountSuspense() {
|
|
2374
2204
|
return useUnreadInboxNotificationsCountSuspense_withClient(useClient());
|
|
2375
2205
|
}
|
|
2376
|
-
function useNotificationSettings() {
|
|
2377
|
-
return useNotificationSettings_withClient(useClient());
|
|
2378
|
-
}
|
|
2379
|
-
function useNotificationSettingsSuspense() {
|
|
2380
|
-
return useNotificationSettingsSuspense_withClient(useClient());
|
|
2381
|
-
}
|
|
2382
|
-
function useUpdateNotificationSettings() {
|
|
2383
|
-
return useUpdateNotificationSettings_withClient(useClient());
|
|
2384
|
-
}
|
|
2385
2206
|
function useUser(userId) {
|
|
2386
2207
|
const client = useClient();
|
|
2387
2208
|
return useUser_withClient(client, userId);
|
|
@@ -4029,9 +3850,6 @@ export {
|
|
|
4029
3850
|
useDeleteInboxNotification,
|
|
4030
3851
|
useUnreadInboxNotificationsCount,
|
|
4031
3852
|
useUnreadInboxNotificationsCountSuspense,
|
|
4032
|
-
useNotificationSettings,
|
|
4033
|
-
useNotificationSettingsSuspense,
|
|
4034
|
-
useUpdateNotificationSettings,
|
|
4035
3853
|
useRoomInfo,
|
|
4036
3854
|
useRoomInfoSuspense,
|
|
4037
3855
|
_useInboxNotificationThread,
|
|
@@ -4116,4 +3934,4 @@ export {
|
|
|
4116
3934
|
_useStorageRoot,
|
|
4117
3935
|
_useUpdateMyPresence
|
|
4118
3936
|
};
|
|
4119
|
-
//# sourceMappingURL=chunk-
|
|
3937
|
+
//# sourceMappingURL=chunk-4KNGHD4I.mjs.map
|