@liveblocks/react 3.14.0-types2 → 3.14.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/README.md +7 -17
- package/dist/_private.cjs +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-5C2OIBKL.js → chunk-EB7KWKMS.js} +6 -6
- package/dist/chunk-EB7KWKMS.js.map +1 -0
- package/dist/{chunk-YAEE7IRC.js → chunk-FDVJKZZ5.js} +2 -2
- package/dist/{chunk-RE7FR44F.cjs → chunk-J5D7MJT7.cjs} +6 -6
- package/dist/chunk-J5D7MJT7.cjs.map +1 -0
- package/dist/{chunk-2NBTMBTZ.cjs → chunk-MH5YSKF5.cjs} +2 -2
- package/dist/{chunk-2NBTMBTZ.cjs.map → chunk-MH5YSKF5.cjs.map} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{room-CEMGQ1Mj.d.cts → room-DamZM98T.d.cts} +3 -3
- package/dist/{room-CEMGQ1Mj.d.ts → room-DamZM98T.d.ts} +3 -3
- package/dist/suspense.cjs +4 -4
- package/dist/suspense.d.cts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +2 -2
- package/package.json +5 -3
- package/dist/chunk-5C2OIBKL.js.map +0 -1
- package/dist/chunk-RE7FR44F.cjs.map +0 -1
- /package/dist/{chunk-YAEE7IRC.js.map → chunk-FDVJKZZ5.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
<p
|
|
2
|
-
<a href="https://liveblocks.io#gh-light-mode-only">
|
|
3
|
-
|
|
4
|
-
</a>
|
|
5
|
-
<a href="https://liveblocks.io#gh-dark-mode-only">
|
|
6
|
-
<img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-dark.svg" alt="Liveblocks" />
|
|
7
|
-
</a>
|
|
1
|
+
<p>
|
|
2
|
+
<a href="https://liveblocks.io#gh-light-mode-only"><img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-light.svg" alt="Liveblocks" /></a>
|
|
3
|
+
<a href="https://liveblocks.io#gh-dark-mode-only"><img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-dark.svg" alt="Liveblocks" /></a>
|
|
8
4
|
</p>
|
|
9
5
|
|
|
10
6
|
# `@liveblocks/react`
|
|
11
7
|
|
|
12
8
|
<p>
|
|
13
|
-
<a href="https://npmjs.org/package/@liveblocks/react">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<a href="https://bundlephobia.com/package/@liveblocks/react">
|
|
17
|
-
<img src="https://img.shields.io/bundlephobia/minzip/@liveblocks/react?style=flat&label=size&color=09f" alt="Size" />
|
|
18
|
-
</a>
|
|
19
|
-
<a href="https://github.com/liveblocks/liveblocks/blob/main/LICENSE">
|
|
20
|
-
<img src="https://img.shields.io/github/license/liveblocks/liveblocks?style=flat&label=license&color=f80" alt="License" />
|
|
21
|
-
</a>
|
|
9
|
+
<a href="https://npmjs.org/package/@liveblocks/react"><img src="https://img.shields.io/npm/v/@liveblocks/react?style=flat&label=npm&color=c33" alt="NPM" /></a>
|
|
10
|
+
<a href="https://bundlephobia.com/package/@liveblocks/react"><img src="https://img.shields.io/bundlephobia/minzip/@liveblocks/react?style=flat&label=size&color=09f" alt="Size" /></a>
|
|
11
|
+
<a href="https://github.com/liveblocks/liveblocks/blob/main/licenses/LICENSE-APACHE-2.0"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
|
|
22
12
|
</p>
|
|
23
13
|
|
|
24
14
|
`@liveblocks/react` provides [React](https://reactjs.org/) hooks and providers
|
|
@@ -63,4 +53,4 @@ learn more about
|
|
|
63
53
|
Licensed under the Apache License 2.0, Copyright © 2021-present
|
|
64
54
|
[Liveblocks](https://liveblocks.io).
|
|
65
55
|
|
|
66
|
-
See [LICENSE](../../LICENSE) for more information.
|
|
56
|
+
See [LICENSE](../../licenses/LICENSE-APACHE-2.0) for more information.
|
package/dist/_private.cjs
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkJ5D7MJT7cjs = require('./chunk-J5D7MJT7.cjs');
|
|
29
29
|
|
|
30
30
|
// src/lib/use-layout-effect.ts
|
|
31
31
|
var _react = require('react');
|
|
@@ -50,7 +50,7 @@ function selectorFor_useGroup(state) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function useGroup(groupId) {
|
|
53
|
-
const client =
|
|
53
|
+
const client = _chunkJ5D7MJT7cjs.useClient.call(void 0, );
|
|
54
54
|
const store = client[_core.kInternal].httpClient.groupsStore;
|
|
55
55
|
const getGroupState = _react.useCallback.call(void 0,
|
|
56
56
|
() => store.getItemState(groupId),
|
|
@@ -59,7 +59,7 @@ function useGroup(groupId) {
|
|
|
59
59
|
_react.useEffect.call(void 0, () => {
|
|
60
60
|
void store.enqueue(groupId);
|
|
61
61
|
}, [store, groupId]);
|
|
62
|
-
return
|
|
62
|
+
return _chunkJ5D7MJT7cjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
63
63
|
store.subscribe,
|
|
64
64
|
getGroupState,
|
|
65
65
|
getGroupState,
|
|
@@ -80,8 +80,8 @@ function normalizeMentionSuggestions(suggestions) {
|
|
|
80
80
|
function useMentionSuggestions(roomId, search) {
|
|
81
81
|
const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
|
|
82
82
|
const lastInvokedAt = _react.useRef.call(void 0, );
|
|
83
|
-
const resolveMentionSuggestions =
|
|
84
|
-
const mentionSuggestionsCache =
|
|
83
|
+
const resolveMentionSuggestions = _chunkJ5D7MJT7cjs.useResolveMentionSuggestions.call(void 0, );
|
|
84
|
+
const mentionSuggestionsCache = _chunkJ5D7MJT7cjs.useMentionSuggestionsCache.call(void 0, );
|
|
85
85
|
_react.useEffect.call(void 0, () => {
|
|
86
86
|
if (search === void 0 || !resolveMentionSuggestions) {
|
|
87
87
|
return;
|
|
@@ -136,7 +136,7 @@ function useMentionSuggestions(roomId, search) {
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
function useSyncSource() {
|
|
139
|
-
const client =
|
|
139
|
+
const client = _chunkJ5D7MJT7cjs.useClient.call(void 0, );
|
|
140
140
|
const createSyncSource = client[_core.kInternal].createSyncSource;
|
|
141
141
|
const [syncSource, setSyncSource] = _react.useState.call(void 0, );
|
|
142
142
|
_react.useEffect.call(void 0, () => {
|
|
@@ -176,5 +176,5 @@ function useSyncSource() {
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
exports.getUmbrellaStoreForClient =
|
|
179
|
+
exports.getUmbrellaStoreForClient = _chunkJ5D7MJT7cjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkJ5D7MJT7cjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkJ5D7MJT7cjs.useClientOrNull; exports.useCreateRoomComment = _chunkJ5D7MJT7cjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkJ5D7MJT7cjs.useCreateRoomThread; exports.useCreateTextMention = _chunkJ5D7MJT7cjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkJ5D7MJT7cjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkJ5D7MJT7cjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkJ5D7MJT7cjs.useDeleteTextMention; exports.useEditRoomComment = _chunkJ5D7MJT7cjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkJ5D7MJT7cjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useLatest = _chunkJ5D7MJT7cjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkJ5D7MJT7cjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkJ5D7MJT7cjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkJ5D7MJT7cjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkJ5D7MJT7cjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkJ5D7MJT7cjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkJ5D7MJT7cjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkJ5D7MJT7cjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkJ5D7MJT7cjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkJ5D7MJT7cjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkJ5D7MJT7cjs.useRoomThreadSubscription; exports.useSignal = _chunkJ5D7MJT7cjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkJ5D7MJT7cjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkJ5D7MJT7cjs.useYjsProvider;
|
|
180
180
|
//# sourceMappingURL=_private.cjs.map
|
package/dist/_private.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DamZM98T.cjs';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-DamZM98T.cjs';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DamZM98T.js';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-DamZM98T.js';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
useSignal,
|
|
26
26
|
useSyncExternalStoreWithSelector,
|
|
27
27
|
useYjsProvider
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EB7KWKMS.js";
|
|
29
29
|
|
|
30
30
|
// src/lib/use-layout-effect.ts
|
|
31
31
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -559,6 +559,7 @@ var PaginatedResource = class {
|
|
|
559
559
|
this.#patch({ isFetchingMore: true });
|
|
560
560
|
try {
|
|
561
561
|
const nextCursor = await this.#fetchPage(state.data.cursor);
|
|
562
|
+
this.#pendingFetchMore = null;
|
|
562
563
|
this.#patch({
|
|
563
564
|
cursor: nextCursor,
|
|
564
565
|
hasFetchedAll: nextCursor === null,
|
|
@@ -566,6 +567,7 @@ var PaginatedResource = class {
|
|
|
566
567
|
isFetchingMore: false
|
|
567
568
|
});
|
|
568
569
|
} catch (err) {
|
|
570
|
+
this.#pendingFetchMore = null;
|
|
569
571
|
this.#patch({
|
|
570
572
|
isFetchingMore: false,
|
|
571
573
|
fetchMoreError: err
|
|
@@ -576,9 +578,7 @@ var PaginatedResource = class {
|
|
|
576
578
|
const state = this.#signal.get();
|
|
577
579
|
if (!state.data?.cursor) return noop;
|
|
578
580
|
if (!this.#pendingFetchMore) {
|
|
579
|
-
this.#pendingFetchMore = this.#fetchMore()
|
|
580
|
-
this.#pendingFetchMore = null;
|
|
581
|
-
});
|
|
581
|
+
this.#pendingFetchMore = this.#fetchMore();
|
|
582
582
|
}
|
|
583
583
|
return this.#pendingFetchMore;
|
|
584
584
|
}
|
|
@@ -887,12 +887,13 @@ function createStore_forNotificationSettings(updates) {
|
|
|
887
887
|
update
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
+
var NON_BLOCKING_OPTIMISTIC_UPDATES = /* @__PURE__ */ new Set(["mark-inbox-notification-as-read"]);
|
|
890
891
|
function createStore_forOptimistic(client) {
|
|
891
892
|
const signal = new Signal([]);
|
|
892
893
|
const syncSource = client[kInternal2].createSyncSource();
|
|
893
894
|
signal.subscribe(
|
|
894
895
|
() => syncSource.setSyncStatus(
|
|
895
|
-
signal.get().
|
|
896
|
+
signal.get().some((update) => !NON_BLOCKING_OPTIMISTIC_UPDATES.has(update.type)) ? "synchronizing" : "synchronized"
|
|
896
897
|
)
|
|
897
898
|
);
|
|
898
899
|
function add(optimisticUpdate) {
|
|
@@ -3147,7 +3148,6 @@ function LiveblocksProvider(props) {
|
|
|
3147
3148
|
lostConnectionTimeout: useInitial(o.lostConnectionTimeout),
|
|
3148
3149
|
backgroundKeepAliveTimeout: useInitial(o.backgroundKeepAliveTimeout),
|
|
3149
3150
|
polyfills: useInitial(o.polyfills),
|
|
3150
|
-
largeMessageStrategy: useInitial(o.largeMessageStrategy),
|
|
3151
3151
|
unstable_streamData: useInitial(o.unstable_streamData),
|
|
3152
3152
|
preventUnsavedChanges: useInitial(o.preventUnsavedChanges),
|
|
3153
3153
|
badgeLocation: useInitial(o.badgeLocation),
|
|
@@ -5242,4 +5242,4 @@ export {
|
|
|
5242
5242
|
_useStorageRoot,
|
|
5243
5243
|
_useUpdateMyPresence
|
|
5244
5244
|
};
|
|
5245
|
-
//# sourceMappingURL=chunk-
|
|
5245
|
+
//# sourceMappingURL=chunk-EB7KWKMS.js.map
|