@datalayer/lexical-loro 0.0.2 → 0.0.7

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * NodeState configuration for storing stable UUIDs in Lexical nodes.
3
+ * This replaces the unstable NodeKey system for cursor positioning.
4
+ *
5
+ * Based on Lexical NodeState documentation:
6
+ * https://lexical.dev/docs/concepts/node-state
7
+ */
8
+ export declare const stableNodeIdState: import("lexical").StateConfig<"stable-node-id", string | undefined>;
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the MIT License.
4
+ */
5
+ import { createState } from 'lexical';
6
+ /**
7
+ * NodeState configuration for storing stable UUIDs in Lexical nodes.
8
+ * This replaces the unstable NodeKey system for cursor positioning.
9
+ *
10
+ * Based on Lexical NodeState documentation:
11
+ * https://lexical.dev/docs/concepts/node-state
12
+ */
13
+ export const stableNodeIdState = createState('stable-node-id', {
14
+ parse: (v) => typeof v === 'string' ? v : undefined,
15
+ });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@datalayer/lexical-loro",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
- "description": "Collaborative editing plugin for Lexical based on Loro CRDT",
6
+ "description": "Collaborative editing solution for Lexical based on Loro CRDT",
7
7
  "main": "lib/index.js",
8
8
  "types": "lib/index.d.ts",
9
9
  "files": [
@@ -16,7 +16,8 @@
16
16
  "collaborative",
17
17
  "editor",
18
18
  "plugin",
19
- "react"
19
+ "react",
20
+ "rich-editor"
20
21
  ],
21
22
  "repository": {
22
23
  "type": "git",
@@ -34,35 +35,35 @@
34
35
  "dev:all:js": "npm run example:js",
35
36
  "dev:all:py": "npm run example:py",
36
37
  "dev:vite": "npm run example:vite",
37
- "example": "concurrently \"npm run server\" \"npm run server:py\" \"npm run example:vite\"",
38
- "example:js": "concurrently \"npm run server\" \"npm run example:vite\"",
39
- "example:py": "concurrently \"npm run server:py\" \"npm run example:vite\"",
38
+ "example": "concurrently \"npm run server\" \"npm run server:py\" \"npm run server:mcp\" \"npm run example:vite\"",
39
+ "example:js": "concurrently \"npm run server\" \"npm run example:vite\"",
40
+ "example:py": "concurrently \"npm run server:py:dev\" \"npm run example:vite\"",
40
41
  "example:vite": "vite",
41
42
  "lint": "eslint .",
42
43
  "preview": "vite preview",
43
- "server": "tsx servers/server.ts",
44
+ "server": "tsx dev/node-server.ts",
44
45
  "server:py": "lexical-loro-server",
45
46
  "server:py:dev": "python3 -m lexical_loro.cli",
47
+ "server:mcp": "python3 -m lexical_loro.mcp start --transport streamable-http --port 3001 --host 0.0.0.0",
46
48
  "test": "vitest",
47
49
  "test:js": "vitest run",
48
50
  "test:py": "python3 -m pytest lexical_loro/tests/ -v",
49
51
  "test:py:coverage": "python3 -m pytest lexical_loro/tests/ --cov=. --cov-report=html --cov-report=term",
50
- "test:py:watch": "python3 -m pytest lexical_loro/tests/ -v --tb=short -f"
52
+ "test:py:watch": "python3 -m pytest lexical_loro/tests/ -v --tb=short -f",
53
+ "watch:lib": "tsc -b -w"
51
54
  },
52
55
  "dependencies": {
53
56
  "loro-crdt": "^1.5.10",
54
- "react": "^18 || ^19.1.0",
55
- "react-dom": "^18 || ^19.1.0",
57
+ "react": "^18.3.1",
58
+ "react-dom": "^18.3.1",
56
59
  "lexical": "^0.33.1",
57
60
  "@lexical/react": "^0.33.1",
58
61
  "@lexical/selection": "^0.33.1"
59
62
  },
60
- "peerDependencies": {
61
- },
62
63
  "devDependencies": {
63
64
  "@eslint/js": "^9.30.1",
64
- "@types/react": "^19.1.8",
65
- "@types/react-dom": "^19.1.6",
65
+ "@types/react": "18.3.20",
66
+ "@types/react-dom": "18.3.6",
66
67
  "@types/ws": "^8.18.1",
67
68
  "@vitejs/plugin-react": "^4.6.0",
68
69
  "concurrently": "^9.2.0",
@@ -74,6 +75,7 @@
74
75
  "@lexical/history": "^0.33.1",
75
76
  "@lexical/html": "^0.33.1",
76
77
  "@lexical/list": "^0.33.1",
78
+ "@lexical/mark": "^0.33.1",
77
79
  "@lexical/plain-text": "^0.33.1",
78
80
  "@lexical/rich-text": "^0.33.1",
79
81
  "@lexical/table": "^0.33.1",