Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liveblocks/node-lexical

Package Overview
Dependencies
Maintainers
5
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liveblocks/node-lexical - npm Package Compare versions

Comparing version 1.12.0-lexical4 to 1.12.0-lexical6

8

dist/index.d.ts
import { Liveblocks } from '@liveblocks/node';
import { Klass, LexicalNode, LexicalNodeReplacement, EditorState, RootNode } from 'lexical';
import { Klass, LexicalNode, LexicalNodeReplacement, LexicalEditor, EditorState } from 'lexical';
export { $createParagraphNode, $createTextNode, $getRoot } from 'lexical';
declare function getEditor(client: Liveblocks, roomId: string, nodes: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>): Promise<LexicalEditor>;
declare function getTextContent(client: Liveblocks, roomId: string, nodes: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>): Promise<string>;
declare function getEditorState(client: Liveblocks, roomId: string, nodes: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>): Promise<EditorState>;
declare function modifyDocument(client: Liveblocks, roomId: string, nodes: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>, modifyFn: (root: RootNode) => void): Promise<void>;
declare function modifyDocument(client: Liveblocks, roomId: string, nodes: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>, modifyFn: (editor: LexicalEditor) => void): Promise<void>;
export { getEditorState, modifyDocument };
export { getEditor, getEditorState, getTextContent, modifyDocument };

@@ -184,3 +184,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts

var PKG_NAME = "@liveblocks/node-lexical";
var PKG_VERSION = "1.12.0-lexical4";
var PKG_VERSION = "1.12.0-lexical6";
var PKG_FORMAT = "cjs";

@@ -192,2 +192,32 @@

var LIVEBLOCKS_NODES = [ThreadMarkNode, MentionNode];
async function getEditor(client, roomId, nodes) {
const doc = await client.getYjsDocumentAsBinaryUpdate(roomId);
const update = new Uint8Array(doc);
return withHeadlessCollaborationEditor(
[...LIVEBLOCKS_NODES, ...nodes],
(editor, binding) => {
_yjs.applyUpdate.call(void 0, binding.doc, update);
editor.update(() => {
}, { discrete: true });
return editor;
}
);
}
async function getTextContent(client, roomId, nodes) {
const doc = await client.getYjsDocumentAsBinaryUpdate(roomId);
const update = new Uint8Array(doc);
return withHeadlessCollaborationEditor(
[...LIVEBLOCKS_NODES, ...nodes],
(editor, binding) => {
_yjs.applyUpdate.call(void 0, binding.doc, update);
editor.update(() => {
}, { discrete: true });
let content = "";
editor.getEditorState().read(() => {
content = _lexical.$getRoot.call(void 0, ).getTextContent();
});
return content;
}
);
}
async function getEditorState(client, roomId, nodes) {

@@ -218,4 +248,3 @@ const doc = await client.getYjsDocumentAsBinaryUpdate(roomId);

() => {
const root = _lexical.$getRoot.call(void 0, );
modifyFn(root);
modifyFn(editor);
},

@@ -235,3 +264,5 @@ { discrete: true }

exports.$createParagraphNode = _lexical.$createParagraphNode; exports.$createTextNode = _lexical.$createTextNode; exports.$getRoot = _lexical.$getRoot; exports.getEditorState = getEditorState; exports.modifyDocument = modifyDocument;
exports.$createParagraphNode = _lexical.$createParagraphNode; exports.$createTextNode = _lexical.$createTextNode; exports.$getRoot = _lexical.$getRoot; exports.getEditor = getEditor; exports.getEditorState = getEditorState; exports.getTextContent = getTextContent; exports.modifyDocument = modifyDocument;
//# sourceMappingURL=index.js.map
{
"name": "@liveblocks/node-lexical",
"version": "1.12.0-lexical4",
"version": "1.12.0-lexical6",
"description": "A server-side utility that lets you modify lexical documents hosted in Liveblocks.",

@@ -36,4 +36,4 @@ "license": "Apache-2.0",

"dependencies": {
"@liveblocks/core": "1.12.0-lexical4",
"@liveblocks/node": "1.12.0-lexical4",
"@liveblocks/core": "1.12.0-lexical6",
"@liveblocks/node": "1.12.0-lexical6",
"yjs": "^13.6.15"

@@ -43,2 +43,3 @@ },

"@lexical/headless": "0.14.5",
"@lexical/selection": "0.14.3",
"@lexical/yjs": "0.14.5",

@@ -45,0 +46,0 @@ "lexical": "0.14.5"

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc