百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

slate-collaborative

> 前端框架
开源

slatejs 协作插件与微服务 https://slate-collaborative.herokuapp.com/

389 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

slatejs 协作插件与微服务 https://slate-collaborative.herokuapp.com/

slate-collaborative. Check demo

slatejs collaborative plugin & microservice

A little experiment for co-editing.

Based on idea of https://github.com/humandx/slate-automerge

API

Client

Use it as a simple slatejs plugin

typescript
import { withIOCollaboration } from '@slate-collaborative/client'

const collaborationEditor = withIOCollaboration(editor, options)

Check detailed example

Options:

typescript
{
  docId?: // document id
  url?: string // url to open connection
  connectOpts?: SocketIOClient.ConnectOpts // socket.io-client options
  cursorData?: any // any data passed to cursor
  onConnect?: () => void // connect callback
  onDisconnect?: () => void // disconnect callback
  onError?: (reason: string) => void // error callback
  preserveExternalHistory?: boolean // preserve slate-history operations form other clients
}

You need to attach the useCursor decorator to provide custom cursor data in renderLeaf function

typescript
import { useCursor } from '@slate-collaborative/client'

const decorator = useCursor(editor)

Backend

typescript
const { SocketIOConnection } = require('@slate-collaborative/backend')

const connection = new SocketIOConnection(options)

options:

typescript
{
  entry: Server // or specify port to start io server
  defaultValue: Node[] // default value
  saveFrequency: number // frequency of onDocumentSave callback execution in ms
  onAuthRequest: ( // auth callback
    query: Object,
    socket?: SocketIO.Socket
  ) => Promise | boolean
  onDocumentLoad: ( // request slate document callback
    pathname: string,
    query?: Object
  ) => Promise | Node[]
  onDocumentSave: (pathname: string, doc: Node[]) => Promise | void // save document callback
}

Contribute

You welcome to contribute!

start it ease:

bash
yarn
yarn dev

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptautomergecollaborationcollaborative-editingcrdt

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架