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

View File

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

View File

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

View File

@ -1,8 +1,8 @@
import { Element, Node, Path } from 'slate' import { Element, Path } from 'slate'
import { SyncValue } from '../model' 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) => { export const getTarget = (doc: SyncValue | Element, path: Path) => {
const iterate = (current: any, idx: number) => { const iterate = (current: any, idx: number) => {

View File

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