y-prosemirror
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "y-prosemirror", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Prosemirror bindings for Yjs", | ||
"main": "./dist/y-prosemirror.cjs", | ||
"module": "./src/y-prosemirror.js", | ||
"types": "./dist/src/y-prosemirror.d.ts", | ||
"sideEffects": false, | ||
"scripts": { | ||
"dist": "rm -rf dist && rollup -c", | ||
"dist": "rm -rf dist && rollup -c && tsc", | ||
"test": "rollup -c && node dist/test.cjs", | ||
@@ -53,2 +54,3 @@ "lint": "standard", | ||
"@rollup/plugin-node-resolve": "^7.0.0", | ||
"@types/prosemirror-state": "^1.2.3", | ||
"concurrently": "^4.1.0", | ||
@@ -55,0 +57,0 @@ "http-server": "^0.12.1", |
@@ -5,3 +5,2 @@ import { ProsemirrorMapping } from './plugins/sync-plugin.js' // eslint-disable-line | ||
import * as error from 'lib0/error.js' | ||
import * as PModel from 'prosemirror-model' // eslint-disable-line | ||
@@ -8,0 +7,0 @@ /** |
import * as Y from 'yjs' | ||
import { Decoration, DecorationSet } from 'prosemirror-view' // eslint-disable-line | ||
import { Plugin, PluginKey, EditorState, TextSelection } from 'prosemirror-state' // eslint-disable-line | ||
import { Plugin, PluginKey } from 'prosemirror-state' // eslint-disable-line | ||
import { Awareness } from 'y-protocols/awareness.js' // eslint-disable-line | ||
@@ -99,2 +99,3 @@ import { ySyncPluginKey } from './sync-plugin.js' | ||
setTimeout(() => { | ||
// @ts-ignore | ||
if (view.docView) { | ||
@@ -101,0 +102,0 @@ view.dispatch(view.state.tr.setMeta(yCursorPluginKey, { awarenessUpdated: true })) |
@@ -7,3 +7,2 @@ /** | ||
import * as PModel from 'prosemirror-model' | ||
import { EditorView, Decoration, DecorationSet } from 'prosemirror-view' // eslint-disable-line | ||
import { Plugin, PluginKey, EditorState, TextSelection } from 'prosemirror-state' // eslint-disable-line | ||
@@ -230,2 +229,3 @@ import * as math from 'lib0/math.js' | ||
const fragmentContent = this.type.toArray().map(t => createNodeFromYElement(/** @type {Y.XmlElement} */ (t), this.prosemirrorView.state.schema, this.mapping)).filter(n => n !== null) | ||
// @ts-ignore | ||
const tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) | ||
@@ -240,2 +240,3 @@ tr.setMeta(ySyncPluginKey, { snapshot: null, prevSnapshot: null }) | ||
const fragmentContent = this.type.toArray().map(t => createNodeFromYElement(/** @type {Y.XmlElement} */ (t), this.prosemirrorView.state.schema, this.mapping)).filter(n => n !== null) | ||
// @ts-ignore | ||
const tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) | ||
@@ -284,2 +285,3 @@ this.prosemirrorView.dispatch(tr) | ||
}).filter(n => n !== null) | ||
// @ts-ignore | ||
const tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) | ||
@@ -311,2 +313,3 @@ this.prosemirrorView.dispatch(tr) | ||
const fragmentContent = this.type.toArray().map(t => createNodeIfNotExists(/** @type {Y.XmlElement | Y.XmlHook} */ (t), this.prosemirrorView.state.schema, this.mapping)).filter(n => n !== null) | ||
// @ts-ignore | ||
let tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) | ||
@@ -313,0 +316,0 @@ restoreRelativeSelection(tr, this.beforeTransactionSelection, this) |
import { Plugin, PluginKey, EditorState, TextSelection } from 'prosemirror-state' // eslint-disable-line | ||
import { Plugin, PluginKey } from 'prosemirror-state' // eslint-disable-line | ||
@@ -4,0 +4,0 @@ import { ySyncPluginKey, getRelativeSelection } from './sync-plugin.js' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3136375
19
29290
15