This commit is contained in:
Eric Maciel 2022-02-17 15:12:55 -05:00
parent d4a7102c71
commit af69710736
5 changed files with 15 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@hiveteams/collab-bridge",
"version": "0.7.27",
"version": "0.7.28",
"files": [
"lib"
],
@ -18,9 +18,8 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn run build:module",
"build:module": "yarn run build:types && yarn run build:js",
"build:types": "tsc --emitDeclarationOnly",
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
"build:module": "yarn run build:js",
"build:js": "./node_modules/typescript/bin/tsc -p ./tsconfig.json",
"watch": "yarn build:js -w",
"test": "jest"
},

View File

@ -1,4 +1,4 @@
import { Operation, Range } from 'slate'
import { BaseSetNodeOperation, Operation, Range } from 'slate'
import { CursorData } from '../model'
import { toJS } from '../utils'
@ -15,7 +15,9 @@ export const setCursor = (
if (!doc.cursors) doc.cursors = {}
const newCursor = cursorOps[cursorOps.length - 1]?.newProperties || {}
const newCursor =
(cursorOps[cursorOps.length - 1] as BaseSetNodeOperation)
?.newProperties || {}
if (selection) {
const newCursorData = Object.assign(

View File

@ -1,3 +1,4 @@
export * from './path'
export * from './apply'
export * from './convert'
export * from './utils'

View File

@ -1,8 +1,8 @@
import { Element, Node, Path } from 'slate'
import { Element, Path } from 'slate'
import { SyncValue } from '../model'
export const isTree = (node: Node): boolean => Boolean(node?.children)
export const isTree = (node: Element): boolean => Boolean(node?.children)
export const getTarget = (doc: SyncValue | Element, path: Path) => {
const iterate = (current: any, idx: number) => {

View File

@ -2,8 +2,12 @@
"extends": "../../tsconfig.base.json",
"include": ["./src/**/*"],
"compilerOptions": {
"target": "es2019",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./lib",
"composite": true
"composite": true,
"declaration": true,
"declarationMap": true
}
}