@liveblocks/yjs
Advanced tools
Comparing version 1.2.2-test4 to 1.2.2-test5
@@ -80,3 +80,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/index.ts | ||
var PKG_NAME = "@liveblocks/yjs"; | ||
var PKG_VERSION = "1.2.2-test4"; | ||
var PKG_VERSION = "1.2.2-test5"; | ||
var PKG_FORMAT = "cjs"; | ||
@@ -198,9 +198,14 @@ | ||
this.unsubscribers.push( | ||
this.room.events.ydoc.subscribe(({ update, isSync }) => { | ||
Y.applyUpdate( | ||
this.doc, | ||
_jsbase64.Base64.toUint8Array(update), | ||
"backend" | ||
); | ||
if (isSync) { | ||
this.room.events.ydoc.subscribe(({ update, stateVector }) => { | ||
Y.applyUpdate(this.doc, _jsbase64.Base64.toUint8Array(update), "backend"); | ||
if (stateVector) { | ||
try { | ||
const localUpdate = Y.encodeStateAsUpdate( | ||
this.doc, | ||
_jsbase64.Base64.toUint8Array(stateVector) | ||
); | ||
this.room.updateYDoc(_jsbase64.Base64.fromUint8Array(localUpdate)); | ||
} catch (e) { | ||
console.warn(e); | ||
} | ||
this.synced = true; | ||
@@ -207,0 +212,0 @@ } |
{ | ||
"name": "@liveblocks/yjs", | ||
"version": "1.2.2-test4", | ||
"version": "1.2.2-test5", | ||
"description": "An integration with . Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", | ||
@@ -35,4 +35,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@liveblocks/client": "1.2.2-test4", | ||
"@liveblocks/core": "1.2.2-test4", | ||
"@liveblocks/client": "1.2.2-test5", | ||
"@liveblocks/core": "1.2.2-test5", | ||
"js-base64": "^3.7.5" | ||
@@ -39,0 +39,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63859
509
+ Added@liveblocks/client@1.2.2-test5(transitive)
+ Added@liveblocks/core@1.2.2-test5(transitive)
- Removed@liveblocks/client@1.2.2-test4(transitive)
- Removed@liveblocks/core@1.2.2-test4(transitive)
Updated@liveblocks/core@1.2.2-test5