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 2.0.0-alpha4 to 2.0.0-alpha5

30

dist/index.d.ts

@@ -19,4 +19,34 @@ import { Liveblocks } from '@liveblocks/node';

};
/**
*
* `withLexicalDocument` is the main entry point to access and modify Lexical documents on your backend.
* This function internally instantiates a Lexical headless editor and allows you to modify and export its values asynchronously
* with a simplified interface.
*
* @param options Specify the roomId, client, and nodes.
* @param callback The call back function is optionally async and receives the document API as its only argument.
*
* @example
*
* import { Liveblocks } from "@liveblocks/node";
* import { withLexicalDocument } from "@liveblocks/node-lexical";
*
* const client = new Liveblocks({secret: "sk_your_secret_key"});
* const text = await withLexicalDocument(
* { client, roomId: "your-room" },
* async (doc) => {
* await doc.update(() => {
* const root = $getRoot();
* const paragraphNode = $createParagraphNode();
* const textNode = $createTextNode("Hello from node");
* paragraphNode.append(textNode);
* root.append(paragraphNode);
* });
* return doc.getTextContent();
* }
* );
*
*/
declare function withLexicalDocument<T>({ roomId, nodes, client }: LiveblocksLexicalOptions, callback: (api: LiveblocksDocumentApi) => Promise<T> | T): Promise<T>;
export { type LiveblocksDocumentApi, type LiveblocksLexicalOptions, withLexicalDocument };

23

dist/index.js

@@ -169,3 +169,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/index.ts

var PKG_NAME = "@liveblocks/node-lexical";
var PKG_VERSION = "2.0.0-alpha4";
var PKG_VERSION = "2.0.0-alpha5";
var PKG_FORMAT = "cjs";

@@ -194,2 +194,5 @@

const val = await callback({
/**
* Fetches and resyncs the latest document with Liveblocks
*/
refresh: async () => {

@@ -203,2 +206,5 @@ const latest = new Uint8Array(

},
/**
* Provide a callback to modify documetns with Lexical's standard api. All calls are discrete.
*/
update: async (modifyFn) => {

@@ -217,2 +223,5 @@ editor.update(() => {

},
/**
* Helper function to easily provide the text content from the root, i.e. `$getRoot().getTextContent()`
*/
getTextContent: () => {

@@ -225,5 +234,11 @@ let content = "";

},
/**
* Helper function to return editorState in JSON form
*/
toJSON: () => {
return editor.getEditorState().toJSON();
},
/**
* Helper function to return editor state as Markdown
*/
toMarkdown: () => {

@@ -236,5 +251,11 @@ let markdown = "";

},
/**
* Helper function to return the editor's current state
*/
getEditorState: () => {
return editor.getEditorState();
},
/**
* Helper function to return the current headless editor instance
*/
getLexicalEditor: () => {

@@ -241,0 +262,0 @@ return editor;

6

package.json
{
"name": "@liveblocks/node-lexical",
"version": "2.0.0-alpha4",
"version": "2.0.0-alpha5",
"description": "A server-side utility that lets you modify lexical documents hosted in Liveblocks.",

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

"dependencies": {
"@liveblocks/core": "2.0.0-alpha4",
"@liveblocks/node": "2.0.0-alpha4",
"@liveblocks/core": "2.0.0-alpha5",
"@liveblocks/node": "2.0.0-alpha5",
"yjs": "^13.6.15"

@@ -41,0 +41,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

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