chore: change to hiveteams package

This commit is contained in:
Eric Maciel 2020-10-27 14:41:32 -04:00
parent 3ebca642d2
commit adec1b719b
16 changed files with 33 additions and 38 deletions

View File

@ -1,4 +1,5 @@
# slate-collaborative. Check [demo](https://slate-collaborative.herokuapp.com/)
slatejs collaborative plugin & microservice
![screencast2019-10-2820-06-10](https://user-images.githubusercontent.com/23132107/67700384-ebff7280-f9be-11e9-9005-6ddadcafec47.gif)
@ -14,7 +15,7 @@ Based on idea of https://github.com/humandx/slate-automerge
Use it as a simple slatejs plugin
```ts
import { withIOCollaboration } from '@slate-collaborative/client'
import { withIOCollaboration } from '@hiveteams/collab-client'
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)
### Options:
```ts
{
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
```ts
import { useCursor } from '@slate-collaborative/client'
import { useCursor } from '@hiveteams/collab-client'
const decorator = useCursor(editor)
```
## Backend
```ts
const { SocketIOConnection } = require('@slate-collaborative/backend')
const { SocketIOConnection } = require('@hiveteams/collab-backend')
const connection = new SocketIOConnection(options)
```
### options:
```ts
{
entry: Server // or specify port to start io server
@ -75,8 +77,8 @@ const connection = new SocketIOConnection(options)
You welcome to contribute!
start it ease:
```
yarn
yarn dev
```

View File

@ -1,5 +1,5 @@
{
"name": "@slate-collaborative/backend",
"name": "@hiveteams/collab-backend",
"version": "0.7.1",
"files": [
"lib"
@ -26,7 +26,7 @@
"dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/runtime": "^7.6.3",
"@slate-collaborative/bridge": "^0.7.1",
"@hiveteams/collab-bridge": "^0.7.1",
"@types/lodash": "^4.14.150",
"@types/socket.io": "^2.1.4",
"automerge": "0.14.0",

View File

@ -7,7 +7,7 @@ import {
toSync,
SyncDoc,
CollabAction
} from '@slate-collaborative/bridge'
} from '@hiveteams/collab-bridge'
export interface Connections {
[key: string]: Automerge.Connection<SyncDoc>

View File

@ -5,7 +5,7 @@ import { Server } from 'http'
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'

View File

@ -7,10 +7,8 @@
"outDir": "./lib",
"composite": true,
"paths": {
"@slate-collaborative/bridge": ["../../bridge"]
"@hiveteams/collab-bridge": ["../../bridge"]
}
},
"references": [
{ "path": "../bridge" }
]
"references": [{ "path": "../bridge" }]
}

View File

@ -1,5 +1,5 @@
{
"name": "@slate-collaborative/bridge",
"name": "@hiveteams/collab-bridge",
"version": "0.7.1",
"files": [
"lib"

View File

@ -1,5 +1,5 @@
{
"name": "@slate-collaborative/client",
"name": "@hiveteams/collab-client",
"version": "0.7.1",
"files": [
"lib"
@ -26,7 +26,7 @@
"dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/preset-react": "^7.0.0",
"@slate-collaborative/bridge": "^0.7.1",
"@hiveteams/collab-bridge": "^0.7.1",
"automerge": "0.14.0",
"slate": "0.58.3",
"slate-history": "0.58.3",

View File

@ -12,7 +12,7 @@ import {
setCursor,
toSlateOp,
CursorData
} from '@slate-collaborative/bridge'
} from '@hiveteams/collab-bridge'
export interface AutomergeEditor extends Editor {
clientId: string

View File

@ -2,7 +2,7 @@ import { useState, useCallback, useEffect, useMemo } from 'react'
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'

View File

@ -4,7 +4,7 @@ import { Editor } from 'slate'
import { AutomergeEditor } from './automerge-editor'
import { CursorData, CollabAction } from '@slate-collaborative/bridge'
import { CursorData, CollabAction } from '"@hiveteams/collab-bridge'
export interface AutomergeOptions {
docId: string

View File

@ -2,7 +2,7 @@ import io from 'socket.io-client'
import { AutomergeEditor } from './automerge-editor'
import { CollabAction } from '@slate-collaborative/bridge'
import { CollabAction } from '"@hiveteams/collab-bridge'
export interface SocketIOPluginOptions {
url: string

View File

@ -7,10 +7,8 @@
"outDir": "./lib",
"composite": true,
"paths": {
"@slate-collaborative/bridge": ["../../bridge"]
"@hiveteams/collab-bridge": ["../../bridge"]
}
},
"references": [
{ "path": "../bridge" }
]
"references": [{ "path": "../bridge" }]
}

View File

@ -1,12 +1,12 @@
{
"name": "@slate-collaborative/example",
"name": "@hiveteams/collab-example",
"version": "0.7.1",
"private": true,
"dependencies": {
"@emotion/core": "^10.0.17",
"@emotion/styled": "^10.0.17",
"@slate-collaborative/backend": "^0.7.1",
"@slate-collaborative/client": "^0.7.1",
"@hiveteams/collab-backend": "^0.7.1",
"@hiveteams/collab-client": "^0.7.1",
"@types/faker": "^4.1.5",
"@types/is-url": "^1.2.28",
"@types/jest": "24.0.18",

View File

@ -1,4 +1,4 @@
const { SocketIOConnection } = require('@slate-collaborative/backend')
const { SocketIOConnection } = require('@hiveteams/collab-backend')
const express = require('express')
const defaultValue = [

View File

@ -8,7 +8,7 @@ import randomColor from 'randomcolor'
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'

View File

@ -3,12 +3,9 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@slate-collaborative/bridge": ["../../bridge"],
"@slate-collaborative/client": ["../../client"]
"@hiveteams/collab-bridge": ["../../bridge"],
"@hiveteams/collab-client": ["../../client"]
}
},
"references": [
{ "path": "../client" },
{ "path": "../backend" }
]
"references": [{ "path": "../client" }, { "path": "../backend" }]
}