@liveblocks/yjs 1.1.0-yjs1 → 1.1.0-yjs2

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/index.js CHANGED
@@ -158,10 +158,6 @@ var Awareness = class extends Observable {
158
158
  return presence["__yjs"];
159
159
  }
160
160
  setLocalState(state) {
161
- const self = this.room.getSelf();
162
- if (!self) {
163
- return;
164
- }
165
161
  this.room.updatePresence({ __yjs: __spreadValues({}, state || {}) });
166
162
  }
167
163
  setLocalStateField(field, value) {
@@ -173,10 +169,14 @@ var Awareness = class extends Observable {
173
169
  const others = this.room.getOthers();
174
170
  const states = others.reduce((acc, currentValue) => {
175
171
  if (currentValue.connectionId) {
176
- acc.set(currentValue.connectionId, currentValue.presence["__yjs"]);
172
+ acc.set(
173
+ currentValue.connectionId,
174
+ currentValue.presence["__yjs"] || {}
175
+ );
177
176
  }
178
177
  return acc;
179
178
  }, /* @__PURE__ */ new Map());
179
+ console.log(states);
180
180
  return states;
181
181
  }
182
182
  };
package/dist/index.mjs CHANGED
@@ -158,10 +158,6 @@ var Awareness = class extends Observable {
158
158
  return presence["__yjs"];
159
159
  }
160
160
  setLocalState(state) {
161
- const self = this.room.getSelf();
162
- if (!self) {
163
- return;
164
- }
165
161
  this.room.updatePresence({ __yjs: __spreadValues({}, state || {}) });
166
162
  }
167
163
  setLocalStateField(field, value) {
@@ -173,10 +169,14 @@ var Awareness = class extends Observable {
173
169
  const others = this.room.getOthers();
174
170
  const states = others.reduce((acc, currentValue) => {
175
171
  if (currentValue.connectionId) {
176
- acc.set(currentValue.connectionId, currentValue.presence["__yjs"]);
172
+ acc.set(
173
+ currentValue.connectionId,
174
+ currentValue.presence["__yjs"] || {}
175
+ );
177
176
  }
178
177
  return acc;
179
178
  }, /* @__PURE__ */ new Map());
179
+ console.log(states);
180
180
  return states;
181
181
  }
182
182
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/yjs",
3
- "version": "1.1.0-yjs1",
3
+ "version": "1.1.0-yjs2",
4
4
  "description": "An integration with . Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -26,8 +26,8 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@liveblocks/client": "1.1.0-yjs1",
30
- "@liveblocks/core": "1.1.0-yjs1",
29
+ "@liveblocks/client": "1.1.0-yjs2",
30
+ "@liveblocks/core": "1.1.0-yjs2",
31
31
  "js-base64": "^3.7.5"
32
32
  },
33
33
  "peerDependencies": {