mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
chore: change to hiveteams package
This commit is contained in:
parent
3ebca642d2
commit
adec1b719b
14
README.md
14
README.md
@ -1,4 +1,5 @@
|
|||||||
# slate-collaborative. Check [demo](https://slate-collaborative.herokuapp.com/)
|
# slate-collaborative. Check [demo](https://slate-collaborative.herokuapp.com/)
|
||||||
|
|
||||||
slatejs collaborative plugin & microservice
|
slatejs collaborative plugin & microservice
|
||||||
|
|
||||||

|

|
||||||
@ -14,7 +15,7 @@ Based on idea of https://github.com/humandx/slate-automerge
|
|||||||
Use it as a simple slatejs plugin
|
Use it as a simple slatejs plugin
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { withIOCollaboration } from '@slate-collaborative/client'
|
import { withIOCollaboration } from '@hiveteams/collab-client'
|
||||||
|
|
||||||
const collaborationEditor = withIOCollaboration(editor, options)
|
const collaborationEditor = withIOCollaboration(editor, options)
|
||||||
```
|
```
|
||||||
@ -22,6 +23,7 @@ const collaborationEditor = withIOCollaboration(editor, options)
|
|||||||
Check [detailed example](https://github.com/cudr/slate-collaborative/blob/master/packages/example/src/Client.tsx)
|
Check [detailed example](https://github.com/cudr/slate-collaborative/blob/master/packages/example/src/Client.tsx)
|
||||||
|
|
||||||
### Options:
|
### Options:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
{
|
{
|
||||||
docId?: // document id
|
docId?: // document id
|
||||||
@ -38,21 +40,21 @@ Check [detailed example](https://github.com/cudr/slate-collaborative/blob/master
|
|||||||
You need to attach the useCursor decorator to provide custom cursor data in renderLeaf function
|
You need to attach the useCursor decorator to provide custom cursor data in renderLeaf function
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { useCursor } from '@slate-collaborative/client'
|
import { useCursor } from '@hiveteams/collab-client'
|
||||||
|
|
||||||
const decorator = useCursor(editor)
|
const decorator = useCursor(editor)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Backend
|
## Backend
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const { SocketIOConnection } = require('@slate-collaborative/backend')
|
const { SocketIOConnection } = require('@hiveteams/collab-backend')
|
||||||
|
|
||||||
const connection = new SocketIOConnection(options)
|
const connection = new SocketIOConnection(options)
|
||||||
```
|
```
|
||||||
|
|
||||||
### options:
|
### options:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
{
|
{
|
||||||
entry: Server // or specify port to start io server
|
entry: Server // or specify port to start io server
|
||||||
@ -75,8 +77,8 @@ const connection = new SocketIOConnection(options)
|
|||||||
You welcome to contribute!
|
You welcome to contribute!
|
||||||
|
|
||||||
start it ease:
|
start it ease:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn
|
yarn
|
||||||
yarn dev
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@slate-collaborative/backend",
|
"name": "@hiveteams/collab-backend",
|
||||||
"version": "0.7.1",
|
"version": "0.7.1",
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
|
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
|
||||||
"@babel/runtime": "^7.6.3",
|
"@babel/runtime": "^7.6.3",
|
||||||
"@slate-collaborative/bridge": "^0.7.1",
|
"@hiveteams/collab-bridge": "^0.7.1",
|
||||||
"@types/lodash": "^4.14.150",
|
"@types/lodash": "^4.14.150",
|
||||||
"@types/socket.io": "^2.1.4",
|
"@types/socket.io": "^2.1.4",
|
||||||
"automerge": "0.14.0",
|
"automerge": "0.14.0",
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
toSync,
|
toSync,
|
||||||
SyncDoc,
|
SyncDoc,
|
||||||
CollabAction
|
CollabAction
|
||||||
} from '@slate-collaborative/bridge'
|
} from '@hiveteams/collab-bridge'
|
||||||
|
|
||||||
export interface Connections {
|
export interface Connections {
|
||||||
[key: string]: Automerge.Connection<SyncDoc>
|
[key: string]: Automerge.Connection<SyncDoc>
|
||||||
|
@ -5,7 +5,7 @@ import { Server } from 'http'
|
|||||||
|
|
||||||
import throttle from 'lodash/throttle'
|
import throttle from 'lodash/throttle'
|
||||||
|
|
||||||
import { SyncDoc, CollabAction, toJS } from '@slate-collaborative/bridge'
|
import { SyncDoc, CollabAction, toJS } from '@hiveteams/collab-bridge'
|
||||||
|
|
||||||
import { getClients } from './utils'
|
import { getClients } from './utils'
|
||||||
|
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@slate-collaborative/bridge": ["../../bridge"]
|
"@hiveteams/collab-bridge": ["../../bridge"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [{ "path": "../bridge" }]
|
||||||
{ "path": "../bridge" }
|
|
||||||
]
|
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@slate-collaborative/bridge",
|
"name": "@hiveteams/collab-bridge",
|
||||||
"version": "0.7.1",
|
"version": "0.7.1",
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@slate-collaborative/client",
|
"name": "@hiveteams/collab-client",
|
||||||
"version": "0.7.1",
|
"version": "0.7.1",
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
|
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
"@slate-collaborative/bridge": "^0.7.1",
|
"@hiveteams/collab-bridge": "^0.7.1",
|
||||||
"automerge": "0.14.0",
|
"automerge": "0.14.0",
|
||||||
"slate": "0.58.3",
|
"slate": "0.58.3",
|
||||||
"slate-history": "0.58.3",
|
"slate-history": "0.58.3",
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
setCursor,
|
setCursor,
|
||||||
toSlateOp,
|
toSlateOp,
|
||||||
CursorData
|
CursorData
|
||||||
} from '@slate-collaborative/bridge'
|
} from '@hiveteams/collab-bridge'
|
||||||
|
|
||||||
export interface AutomergeEditor extends Editor {
|
export interface AutomergeEditor extends Editor {
|
||||||
clientId: string
|
clientId: string
|
||||||
|
@ -2,7 +2,7 @@ import { useState, useCallback, useEffect, useMemo } from 'react'
|
|||||||
|
|
||||||
import { Text, Range, Path, NodeEntry } from 'slate'
|
import { Text, Range, Path, NodeEntry } from 'slate'
|
||||||
|
|
||||||
import { toJS, Cursor, Cursors } from '@slate-collaborative/bridge'
|
import { toJS, Cursor, Cursors } from '"@hiveteams/collab-bridge'
|
||||||
|
|
||||||
import { AutomergeEditor } from './automerge-editor'
|
import { AutomergeEditor } from './automerge-editor'
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { Editor } from 'slate'
|
|||||||
|
|
||||||
import { AutomergeEditor } from './automerge-editor'
|
import { AutomergeEditor } from './automerge-editor'
|
||||||
|
|
||||||
import { CursorData, CollabAction } from '@slate-collaborative/bridge'
|
import { CursorData, CollabAction } from '"@hiveteams/collab-bridge'
|
||||||
|
|
||||||
export interface AutomergeOptions {
|
export interface AutomergeOptions {
|
||||||
docId: string
|
docId: string
|
||||||
|
@ -2,7 +2,7 @@ import io from 'socket.io-client'
|
|||||||
|
|
||||||
import { AutomergeEditor } from './automerge-editor'
|
import { AutomergeEditor } from './automerge-editor'
|
||||||
|
|
||||||
import { CollabAction } from '@slate-collaborative/bridge'
|
import { CollabAction } from '"@hiveteams/collab-bridge'
|
||||||
|
|
||||||
export interface SocketIOPluginOptions {
|
export interface SocketIOPluginOptions {
|
||||||
url: string
|
url: string
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@slate-collaborative/bridge": ["../../bridge"]
|
"@hiveteams/collab-bridge": ["../../bridge"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [{ "path": "../bridge" }]
|
||||||
{ "path": "../bridge" }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@slate-collaborative/example",
|
"name": "@hiveteams/collab-example",
|
||||||
"version": "0.7.1",
|
"version": "0.7.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/core": "^10.0.17",
|
"@emotion/core": "^10.0.17",
|
||||||
"@emotion/styled": "^10.0.17",
|
"@emotion/styled": "^10.0.17",
|
||||||
"@slate-collaborative/backend": "^0.7.1",
|
"@hiveteams/collab-backend": "^0.7.1",
|
||||||
"@slate-collaborative/client": "^0.7.1",
|
"@hiveteams/collab-client": "^0.7.1",
|
||||||
"@types/faker": "^4.1.5",
|
"@types/faker": "^4.1.5",
|
||||||
"@types/is-url": "^1.2.28",
|
"@types/is-url": "^1.2.28",
|
||||||
"@types/jest": "24.0.18",
|
"@types/jest": "24.0.18",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const { SocketIOConnection } = require('@slate-collaborative/backend')
|
const { SocketIOConnection } = require('@hiveteams/collab-backend')
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
|
|
||||||
const defaultValue = [
|
const defaultValue = [
|
||||||
|
@ -8,7 +8,7 @@ import randomColor from 'randomcolor'
|
|||||||
|
|
||||||
import styled from '@emotion/styled'
|
import styled from '@emotion/styled'
|
||||||
|
|
||||||
import { withIOCollaboration, useCursor } from '@slate-collaborative/client'
|
import { withIOCollaboration, useCursor } from '@hiveteams/collab-client'
|
||||||
|
|
||||||
import { Instance, Title, H4, Button } from './Components'
|
import { Instance, Title, H4, Button } from './Components'
|
||||||
|
|
||||||
|
@ -3,12 +3,9 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@slate-collaborative/bridge": ["../../bridge"],
|
"@hiveteams/collab-bridge": ["../../bridge"],
|
||||||
"@slate-collaborative/client": ["../../client"]
|
"@hiveteams/collab-client": ["../../client"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [{ "path": "../client" }, { "path": "../backend" }]
|
||||||
{ "path": "../client" },
|
|
||||||
{ "path": "../backend" }
|
|
||||||
]
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user