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/) # slate-collaborative. Check [demo](https://slate-collaborative.herokuapp.com/)
slatejs collaborative plugin & microservice slatejs collaborative plugin & microservice
![screencast2019-10-2820-06-10](https://user-images.githubusercontent.com/23132107/67700384-ebff7280-f9be-11e9-9005-6ddadcafec47.gif) ![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 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
``` ```

View File

@ -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",

View File

@ -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>

View File

@ -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'

View File

@ -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" }
]
} }

View File

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

View File

@ -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",

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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" }
]
} }

View File

@ -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",

View File

@ -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 = [

View File

@ -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'

View File

@ -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" }
]
} }