Skip to content

画布上的评论层

评论需要 锚点权限通知,常叠在 CRDT 文档状态之上。本示例用 Liveblocks 展示叠加 UI;鉴权需按租户模型扩展。

审计场景可将评论与几何一并导出。

交互示例

Use liveblocks Yjs implementing comments overlay.

ts
import { createClient } from '@liveblocks/client';
import { getYjsProviderForRoom } from '@liveblocks/yjs';

const client = createClient({
    throttle: 16,
    publicApiKey: 'pk_dev...',
});
const { room, leave } = client.enterRoom('my-room-id', {
    initialPresence: { cursor: null },
});

const yProvider = getYjsProviderForRoom(room);
const yDoc = yProvider.getYDoc();

Released under the MIT License.