@liveblocks/client 0.17.0-beta2 → 0.17.1-beta1

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
@@ -18,7 +18,8 @@
18
18
  </a>
19
19
  </p>
20
20
 
21
- A client that lets you interact with [Liveblocks](https://liveblocks.io) servers.
21
+ A client that lets you interact with [Liveblocks](https://liveblocks.io)
22
+ servers.
22
23
 
23
24
  ## Installation
24
25
 
@@ -28,25 +29,33 @@ npm install @liveblocks/client
28
29
 
29
30
  ## Documentation
30
31
 
31
- - [Read the documentation](https://liveblocks.io/docs) to start using Liveblocks.
32
- - Explore the [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-client).
32
+ - [Read the documentation](https://liveblocks.io/docs) to start using
33
+ Liveblocks.
34
+ - Explore the
35
+ [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-client).
33
36
 
34
37
  ## Examples
35
38
 
36
- - Browse our gallery of collaborative UI patterns. [View examples gallery](https://liveblocks.io/examples)
37
- - Explore and clone any of our open-source examples. [View code examples](https://github.com/liveblocks/liveblocks/tree/main/examples)
39
+ - Browse our gallery of collaborative UI patterns.
40
+ [View examples gallery](https://liveblocks.io/examples)
41
+ - Explore and clone any of our open-source examples.
42
+ [View code examples](https://github.com/liveblocks/liveblocks/tree/main/examples)
38
43
 
39
44
  ## Releases
40
45
 
41
- For changelog, visit [https://github.com/liveblocks/liveblocks/releases](https://github.com/liveblocks/liveblocks/releases).
46
+ For changelog, visit
47
+ [https://github.com/liveblocks/liveblocks/releases](https://github.com/liveblocks/liveblocks/releases).
42
48
 
43
49
  ## Community
44
50
 
45
- - [Discord](https://discord.gg/X4YWJuH9VY) - To get involved with the Liveblocks community, ask questions and share tips.
46
- - [Twitter](https://twitter.com/liveblocks) - To receive updates, announcements, blog posts, and general Liveblocks tips.
51
+ - [Discord](https://discord.gg/X4YWJuH9VY) - To get involved with the Liveblocks
52
+ community, ask questions and share tips.
53
+ - [Twitter](https://twitter.com/liveblocks) - To receive updates, announcements,
54
+ blog posts, and general Liveblocks tips.
47
55
 
48
56
  ## License
49
57
 
50
- Licensed under the Apache License 2.0, Copyright © 2021-present [Liveblocks](https://liveblocks.io).
58
+ Licensed under the Apache License 2.0, Copyright © 2021-present
59
+ [Liveblocks](https://liveblocks.io).
51
60
 
52
61
  See [LICENSE](../../LICENSE) for more information.
package/index.js CHANGED
@@ -413,7 +413,9 @@ function makeStateMachine(state, context, mockedEffects) {
413
413
  );
414
414
  var ws = WebSocketPolyfill || WebSocket;
415
415
  return function (token) {
416
- return new ws(liveblocksServer + "/?token=" + token);
416
+ return new ws(
417
+ liveblocksServer + "/?token=" + token + "&version=0.17.1-beta1"
418
+ );
417
419
  };
418
420
  })(
419
421
  context.liveblocksServer,
package/index.mjs CHANGED
@@ -336,7 +336,8 @@ function makeStateMachine(state, context, mockedEffects) {
336
336
  "To use Liveblocks client in a non-dom environment, you need to provide a WebSocket polyfill."
337
337
  );
338
338
  const ws = WebSocketPolyfill || WebSocket;
339
- return (token) => new ws(`${liveblocksServer}/?token=${token}`);
339
+ return (token) =>
340
+ new ws(`${liveblocksServer}/?token=${token}&version=0.17.1-beta1`);
340
341
  })(
341
342
  context.liveblocksServer,
342
343
  null !==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/client",
3
- "version": "0.17.0-beta2",
3
+ "version": "0.17.1-beta1",
4
4
  "description": "A client that lets you interact with Liveblocks servers.",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
package/shared.d.ts CHANGED
@@ -426,9 +426,9 @@ declare type Client = {
426
426
  */
427
427
  getRoom<
428
428
  TPresence extends JsonObject,
429
- TStorage extends LsonObject,
430
- TUserMeta extends BaseUserMeta,
431
- TRoomEvent extends Json
429
+ TStorage extends LsonObject = LsonObject,
430
+ TUserMeta extends BaseUserMeta = BaseUserMeta,
431
+ TRoomEvent extends Json = never
432
432
  >(
433
433
  roomId: string
434
434
  ): Room<TPresence, TStorage, TUserMeta, TRoomEvent> | null;
@@ -439,9 +439,9 @@ declare type Client = {
439
439
  */
440
440
  enter<
441
441
  TPresence extends JsonObject,
442
- TStorage extends LsonObject,
443
- TUserMeta extends BaseUserMeta,
444
- TRoomEvent extends Json
442
+ TStorage extends LsonObject = LsonObject,
443
+ TUserMeta extends BaseUserMeta = BaseUserMeta,
444
+ TRoomEvent extends Json = never
445
445
  >(
446
446
  roomId: string,
447
447
  options?: RoomInitializers<TPresence, TStorage>
package/shared.js CHANGED
@@ -945,14 +945,14 @@ var LiveList = (function (_AbstractCrdt) {
945
945
  var parentKey = nn(child._parentKey),
946
946
  reverse = child._serialize(nn(this._id), parentKey, this._doc),
947
947
  indexToDelete = this._items.indexOf(child);
948
- return (
949
- this._items.splice(indexToDelete, 1),
950
- child._detach(),
951
- {
952
- modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
953
- reverse: reverse,
954
- }
955
- );
948
+ return -1 === indexToDelete
949
+ ? { modified: !1 }
950
+ : (this._items.splice(indexToDelete, 1),
951
+ child._detach(),
952
+ {
953
+ modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
954
+ reverse: reverse,
955
+ });
956
956
  }
957
957
  return { modified: !1 };
958
958
  }),
package/shared.mjs CHANGED
@@ -693,14 +693,14 @@ class LiveList extends AbstractCrdt {
693
693
  const parentKey = nn(child._parentKey),
694
694
  reverse = child._serialize(nn(this._id), parentKey, this._doc),
695
695
  indexToDelete = this._items.indexOf(child);
696
- return (
697
- this._items.splice(indexToDelete, 1),
698
- child._detach(),
699
- {
700
- modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
701
- reverse: reverse,
702
- }
703
- );
696
+ return -1 === indexToDelete
697
+ ? { modified: !1 }
698
+ : (this._items.splice(indexToDelete, 1),
699
+ child._detach(),
700
+ {
701
+ modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
702
+ reverse: reverse,
703
+ });
704
704
  }
705
705
  return { modified: !1 };
706
706
  }