@liveblocks/redux 0.15.11-test.1 → 0.16.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,12 +1,24 @@
1
1
  <p align="center">
2
2
  <a href="https://liveblocks.io">
3
- <img src="https://liveblocks.io/images/blog/introducing-liveblocks.png">
3
+ <img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header.svg" alt="Liveblocks" />
4
4
  </a>
5
5
  </p>
6
6
 
7
- # Liveblocks · [![Twitter Follow](https://shields.io/twitter/follow/liveblocks?label=Follow)](https://twitter.com/liveblocks)
7
+ # `@liveblocks/redux`
8
8
 
9
- **At [Liveblocks](https://liveblocks.io), we’re building tools to help companies create world-class collaborative products that attract, engage and retain users.** This repository is a set of open-source packages for building performant and reliable multiplayer experiences.
9
+ <p>
10
+ <a href="https://npmjs.org/package/@liveblocks/redux">
11
+ <img src="https://img.shields.io/npm/v/@liveblocks/redux?style=flat&label=npm&color=c33" alt="NPM" />
12
+ </a>
13
+ <a href="https://bundlephobia.com/package/@liveblocks/redux">
14
+ <img src="https://img.shields.io/bundlephobia/minzip/@liveblocks/redux?style=flat&label=size&color=09f" alt="Size" />
15
+ </a>
16
+ <a href="https://github.com/liveblocks/liveblocks/blob/main/LICENSE">
17
+ <img src="https://img.shields.io/github/license/liveblocks/liveblocks?style=flat&label=license&color=f80" alt="License" />
18
+ </a>
19
+ </p>
20
+
21
+ A [store enhancer](https://redux.js.org/understanding/thinking-in-redux/glossary#store-enhancer) to integrate [Liveblocks](https://liveblocks.io) into [Redux](https://redux-toolkit.js.org/) stores.
10
22
 
11
23
  ## Installation
12
24
 
@@ -16,7 +28,7 @@ npm install @liveblocks/client @liveblocks/redux
16
28
 
17
29
  ## Documentation
18
30
 
19
- - Start with the [React-Redux guide](https://liveblocks.io/docs/get-started/react-redux).
31
+ - Start with the [React and Redux guide](https://liveblocks.io/docs/get-started/react-redux).
20
32
  - Explore the [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-redux).
21
33
 
22
34
  ## Examples
package/lib/esm/index.js CHANGED
@@ -36,7 +36,7 @@ var __spreadValues = (a, b) => {
36
36
  return a;
37
37
  };
38
38
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
39
- const { patchImmutableObject, patchLiveObjectKey, liveNodeToJson } = internals;
39
+ const { patchImmutableObject, patchLiveObjectKey, lsonToJson } = internals;
40
40
  const ACTION_TYPES = {
41
41
  ENTER: "@@LIVEBLOCKS/ENTER",
42
42
  LEAVE: "@@LIVEBLOCKS/LEAVE",
@@ -155,7 +155,7 @@ const internalEnhancer = (options) => {
155
155
  updates[key] = storageInitialState[key];
156
156
  patchLiveObjectKey(root, key, void 0, storageInitialState[key]);
157
157
  } else {
158
- updates[key] = liveNodeToJson(liveblocksStatePart);
158
+ updates[key] = lsonToJson(liveblocksStatePart);
159
159
  }
160
160
  }
161
161
  });
package/lib/esm/index.mjs CHANGED
@@ -36,7 +36,7 @@ var __spreadValues = (a, b) => {
36
36
  return a;
37
37
  };
38
38
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
39
- const { patchImmutableObject, patchLiveObjectKey, liveNodeToJson } = internals;
39
+ const { patchImmutableObject, patchLiveObjectKey, lsonToJson } = internals;
40
40
  const ACTION_TYPES = {
41
41
  ENTER: "@@LIVEBLOCKS/ENTER",
42
42
  LEAVE: "@@LIVEBLOCKS/LEAVE",
@@ -155,7 +155,7 @@ const internalEnhancer = (options) => {
155
155
  updates[key] = storageInitialState[key];
156
156
  patchLiveObjectKey(root, key, void 0, storageInitialState[key]);
157
157
  } else {
158
- updates[key] = liveNodeToJson(liveblocksStatePart);
158
+ updates[key] = lsonToJson(liveblocksStatePart);
159
159
  }
160
160
  }
161
161
  });
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Client, User } from "@liveblocks/client";
1
+ import { Client, User, Presence } from "@liveblocks/client";
2
2
  import { StoreEnhancer } from "redux";
3
3
  export declare type Mapping<T> = Partial<{
4
4
  [Property in keyof T]: boolean;
5
5
  }>;
6
- export declare type LiveblocksState<TState, TPresence = any> = TState & {
6
+ export declare type LiveblocksState<TState, TPresence extends Presence = Presence> = TState & {
7
7
  /**
8
8
  * Liveblocks extra state attached by the enhancer
9
9
  */
package/lib/index.js CHANGED
@@ -79,7 +79,7 @@ function mappingToFunctionIsNotAllowed(key) {
79
79
 
80
80
  var patchImmutableObject = client.internals.patchImmutableObject,
81
81
  patchLiveObjectKey = client.internals.patchLiveObjectKey,
82
- liveNodeToJson = client.internals.liveNodeToJson;
82
+ lsonToJson = client.internals.lsonToJson;
83
83
  var ACTION_TYPES = {
84
84
  ENTER: "@@LIVEBLOCKS/ENTER",
85
85
  LEAVE: "@@LIVEBLOCKS/LEAVE",
@@ -224,7 +224,7 @@ var internalEnhancer = function internalEnhancer(options) {
224
224
  updates[_key] = storageInitialState[_key];
225
225
  patchLiveObjectKey(root, _key, undefined, storageInitialState[_key]);
226
226
  } else {
227
- updates[_key] = liveNodeToJson(liveblocksStatePart);
227
+ updates[_key] = lsonToJson(liveblocksStatePart);
228
228
  }
229
229
  }
230
230
  });
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@liveblocks/redux",
3
- "version": "0.15.11-test.1",
3
+ "version": "0.16.1",
4
4
  "sideEffects": false,
5
- "description": "",
5
+ "description": "A store enhancer to integrate Liveblocks into Redux stores.",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "files": [
@@ -36,7 +36,7 @@
36
36
  "directory": "packages/liveblocks-redux"
37
37
  },
38
38
  "peerDependencies": {
39
- "@liveblocks/client": "0.15.11-test.1",
39
+ "@liveblocks/client": "0.16.1",
40
40
  "redux": "^4"
41
41
  },
42
42
  "devDependencies": {