From 63e8a2abef87488ff56d2f260183e53850edee09 Mon Sep 17 00:00:00 2001 From: "David P. Novakovic" Date: Thu, 12 Dec 2024 10:15:01 +1000 Subject: [PATCH] doc: fix registry component location and issue in plugin config docs --- apps/www/content/docs/collaboration.mdx | 6 ++-- apps/www/public/r/index.json | 46 ++++++++++++------------- apps/www/src/__registry__/index.tsx | 32 ++++++++--------- apps/www/src/registry/registry-ui.ts | 30 ++++++++-------- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/apps/www/content/docs/collaboration.mdx b/apps/www/content/docs/collaboration.mdx index c6a959e7d2..51e1a2cf0c 100644 --- a/apps/www/content/docs/collaboration.mdx +++ b/apps/www/content/docs/collaboration.mdx @@ -36,10 +36,10 @@ const editor = createPlateEditor({ plugins: [ // ...otherPlugins, YjsPlugin.configure({ + render: { + afterEditable: RemoteCursorOverlay, + }, options: { - render: { - afterEditable: RemoteCursorOverlay, - }, cursorOptions: { autoSend: true, data: { name: 'A plate user', color: '#5AC990' }, diff --git a/apps/www/public/r/index.json b/apps/www/public/r/index.json index 91522e2b79..0333022b80 100644 --- a/apps/www/public/r/index.json +++ b/apps/www/public/r/index.json @@ -1476,29 +1476,6 @@ "registryDependencies": [], "type": "registry:ui" }, - { - "dependencies": [ - "@slate-yjs/react" - ], - "doc": { - "description": "A cursor overlay to display multiplayer cursors in the yjs plugin.", - "docs": [ - { - "route": "/docs/collaboration" - } - ], - "examples": [] - }, - "files": [ - { - "path": "plate-ui/remote-cursor-overlay.tsx", - "type": "registry:ui" - } - ], - "name": "remote-cursor-overlay", - "registryDependencies": [], - "type": "registry:ui" - }, { "dependencies": [ "@udecode/plate-ai", @@ -3032,5 +3009,28 @@ "transforms" ], "type": "registry:ui" + }, + { + "dependencies": [ + "@slate-yjs/react" + ], + "doc": { + "description": "A cursor overlay to display multiplayer cursors in the yjs plugin.", + "docs": [ + { + "route": "/docs/collaboration" + } + ], + "examples": [] + }, + "files": [ + { + "path": "plate-ui/remote-cursor-overlay.tsx", + "type": "registry:ui" + } + ], + "name": "remote-cursor-overlay", + "registryDependencies": [], + "type": "registry:ui" } ] \ No newline at end of file diff --git a/apps/www/src/__registry__/index.tsx b/apps/www/src/__registry__/index.tsx index 363f673908..261e37f5f1 100644 --- a/apps/www/src/__registry__/index.tsx +++ b/apps/www/src/__registry__/index.tsx @@ -877,22 +877,6 @@ export const Index: Record = { subcategory: "", chunks: [] }, - "remote-cursor-overlay": { - name: "remote-cursor-overlay", - description: "", - type: "registry:ui", - registryDependencies: [], - files: [{ - path: "src/registry/default/plate-ui/remote-cursor-overlay.tsx", - type: "registry:ui", - target: "" - }], - component: React.lazy(() => import("@/registry/default/plate-ui/remote-cursor-overlay.tsx")), - source: "", - category: "", - subcategory: "", - chunks: [] - }, "ai-menu": { name: "ai-menu", description: "", @@ -1737,6 +1721,22 @@ export const Index: Record = { subcategory: "", chunks: [] }, + "remote-cursor-overlay": { + name: "remote-cursor-overlay", + description: "", + type: "registry:ui", + registryDependencies: [], + files: [{ + path: "src/registry/default/plate-ui/remote-cursor-overlay.tsx", + type: "registry:ui", + target: "" + }], + component: React.lazy(() => import("@/registry/default/plate-ui/remote-cursor-overlay.tsx")), + source: "", + category: "", + subcategory: "", + chunks: [] + }, "editor-plugins": { name: "editor-plugins", description: "", diff --git a/apps/www/src/registry/registry-ui.ts b/apps/www/src/registry/registry-ui.ts index 20158398fc..a82276425b 100644 --- a/apps/www/src/registry/registry-ui.ts +++ b/apps/www/src/registry/registry-ui.ts @@ -874,6 +874,21 @@ import { withDraggables } from './withDraggables';`, registryDependencies: ['dropdown-menu', 'toolbar', 'transforms'], type: 'registry:ui', }, + { + dependencies: ['@slate-yjs/react'], + doc: { + description: + 'A cursor overlay to display multiplayer cursors in the yjs plugin.', + docs: [{ route: '/docs/collaboration' }], + examples: [], + }, + files: [ + { path: 'plate-ui/remote-cursor-overlay.tsx', type: 'registry:ui' }, + ], + name: 'remote-cursor-overlay', + registryDependencies: [], + type: 'registry:ui', + }, ]; export const uiNodes: Registry = [ @@ -1723,21 +1738,6 @@ export const uiPrimitives: Registry = [ registryDependencies: [], type: 'registry:ui', }, - { - dependencies: ['@slate-yjs/react'], - doc: { - description: - 'A cursor overlay to display multiplayer cursors in the yjs plugin.', - docs: [{ route: '/docs/collaboration' }], - examples: [], - }, - files: [ - { path: 'plate-ui/remote-cursor-overlay.tsx', type: 'registry:ui' }, - ], - name: 'remote-cursor-overlay', - registryDependencies: [], - type: 'registry:ui', - }, ]; export const ui: Registry = [...uiNodes, ...uiPrimitives, ...uiComponents];