@liveblocks/yjs
Advanced tools
Comparing version 1.2.0-internal4 to 1.2.0-internal5
@@ -1,19 +0,2 @@ | ||
"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; } }var __defProp = Object.defineProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
// src/index.ts | ||
"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 _jsbase64 = require('js-base64'); | ||
@@ -142,14 +125,12 @@ | ||
setLocalState(state) { | ||
var _a; | ||
const presence = (_a = this.room.getSelf()) == null ? void 0 : _a.presence[Y_PRESENCE_KEY]; | ||
const presence = _optionalChain([this, 'access', _ => _.room, 'access', _2 => _2.getSelf, 'call', _3 => _3(), 'optionalAccess', _4 => _4.presence, 'access', _5 => _5[Y_PRESENCE_KEY]]); | ||
this.room.updatePresence({ | ||
__yjs: __spreadValues(__spreadValues({}, presence || {}), state || {}) | ||
__yjs: { ...presence || {}, ...state || {} } | ||
}); | ||
} | ||
setLocalStateField(field, value) { | ||
var _a; | ||
const presence = (_a = this.room.getSelf()) == null ? void 0 : _a.presence[Y_PRESENCE_KEY]; | ||
const presence = _optionalChain([this, 'access', _6 => _6.room, 'access', _7 => _7.getSelf, 'call', _8 => _8(), 'optionalAccess', _9 => _9.presence, 'access', _10 => _10[Y_PRESENCE_KEY]]); | ||
const update = { [field]: value }; | ||
this.room.updatePresence({ | ||
__yjs: __spreadValues(__spreadValues({}, presence || {}), update) | ||
__yjs: { ...presence || {}, ...update } | ||
}); | ||
@@ -174,3 +155,2 @@ } | ||
constructor(room, doc) { | ||
var _a; | ||
super(); | ||
@@ -180,5 +160,4 @@ this.unsubscribers = []; | ||
this.syncDoc = () => { | ||
var _a; | ||
this.synced = false; | ||
this.doc.clientID = ((_a = this.room.getSelf()) == null ? void 0 : _a.connectionId) || this.doc.clientID; | ||
this.doc.clientID = _optionalChain([this, 'access', _11 => _11.room, 'access', _12 => _12.getSelf, 'call', _13 => _13(), 'optionalAccess', _14 => _14.connectionId]) || this.doc.clientID; | ||
this.awareness.clientID = this.doc.clientID; | ||
@@ -196,3 +175,3 @@ const encodedVector = _jsbase64.Base64.fromUint8Array(Y.encodeStateVector(this.doc)); | ||
this.room = room; | ||
const connectionId = (_a = this.room.getSelf()) == null ? void 0 : _a.connectionId; | ||
const connectionId = _optionalChain([this, 'access', _15 => _15.room, 'access', _16 => _16.getSelf, 'call', _17 => _17(), 'optionalAccess', _18 => _18.connectionId]); | ||
if (connectionId) { | ||
@@ -244,1 +223,2 @@ this.doc.clientID = connectionId; | ||
exports.Awareness = Awareness; exports.default = LiveblocksProvider; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@liveblocks/yjs", | ||
"version": "1.2.0-internal4", | ||
"version": "1.2.0-internal5", | ||
"description": "An integration with . Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", | ||
@@ -8,2 +8,15 @@ "license": "Apache-2.0", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.mjs", | ||
"default": "./dist/index.js" | ||
} | ||
} | ||
}, | ||
"files": [ | ||
@@ -20,20 +33,7 @@ "dist/**", | ||
"test": "jest --silent --verbose --color=always", | ||
"test:types": "tsd", | ||
"test:watch": "jest --silent --verbose --color=always --watch" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
"@liveblocks/client": "1.2.0-internal4", | ||
"@liveblocks/core": "1.2.0-internal4", | ||
"@liveblocks/client": "1.2.0-internal5", | ||
"@liveblocks/core": "1.2.0-internal5", | ||
"js-base64": "^3.7.5" | ||
@@ -40,0 +40,0 @@ }, |
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
59325
8
469
+ Added@liveblocks/client@1.2.0-internal5(transitive)
+ Added@liveblocks/core@1.2.0-internal5(transitive)
- Removed@liveblocks/client@1.2.0-internal4(transitive)
- Removed@liveblocks/core@1.2.0-internal4(transitive)