@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 CHANGED
@@ -1,24 +1,14 @@
1
- <p align="center">
2
- <a href="https://liveblocks.io#gh-light-mode-only">
3
- <img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header-light.svg" alt="Liveblocks" />
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
- <img src="https://img.shields.io/npm/v/@liveblocks/react?style=flat&label=npm&color=c33" alt="NPM" />
15
- </a>
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 _chunkRE7FR44Fcjs = require('./chunk-RE7FR44F.cjs');
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 = _chunkRE7FR44Fcjs.useClient.call(void 0, );
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 _chunkRE7FR44Fcjs.useSyncExternalStoreWithSelector.call(void 0,
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 = _chunkRE7FR44Fcjs.useResolveMentionSuggestions.call(void 0, );
84
- const mentionSuggestionsCache = _chunkRE7FR44Fcjs.useMentionSuggestionsCache.call(void 0, );
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 = _chunkRE7FR44Fcjs.useClient.call(void 0, );
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 = _chunkRE7FR44Fcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkRE7FR44Fcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkRE7FR44Fcjs.useClientOrNull; exports.useCreateRoomComment = _chunkRE7FR44Fcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkRE7FR44Fcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkRE7FR44Fcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkRE7FR44Fcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkRE7FR44Fcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkRE7FR44Fcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkRE7FR44Fcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkRE7FR44Fcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useLatest = _chunkRE7FR44Fcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkRE7FR44Fcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkRE7FR44Fcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkRE7FR44Fcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkRE7FR44Fcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkRE7FR44Fcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkRE7FR44Fcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkRE7FR44Fcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkRE7FR44Fcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkRE7FR44Fcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkRE7FR44Fcjs.useRoomThreadSubscription; exports.useSignal = _chunkRE7FR44Fcjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkRE7FR44Fcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkRE7FR44Fcjs.useYjsProvider;
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
@@ -1,5 +1,5 @@
1
- import { G as GroupAsyncResult } from './room-CEMGQ1Mj.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-CEMGQ1Mj.cjs';
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';
@@ -1,5 +1,5 @@
1
- import { G as GroupAsyncResult } from './room-CEMGQ1Mj.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-CEMGQ1Mj.js';
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-5C2OIBKL.js";
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().finally(() => {
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().length > 0 ? "synchronizing" : "synchronized"
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-5C2OIBKL.js.map
5245
+ //# sourceMappingURL=chunk-EB7KWKMS.js.map