Socket
Socket
Sign inDemoInstall

y-prosemirror

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

y-prosemirror - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "y-prosemirror",
"version": "1.0.3",
"version": "1.0.4",
"description": "Prosemirror bindings for Yjs",

@@ -5,0 +5,0 @@ "main": "./dist/y-prosemirror.cjs",

@@ -104,3 +104,3 @@ import { updateYFragment, ProsemirrorMapping } from './plugins/sync-plugin.js' // eslint-disable-line

if (pos === 0 && n.constructor !== Y.XmlText && n !== type) { // TODO: set to <= 0
return new Y.RelativePosition(n._item === null ? null : n._item.id, n._item === null ? Y.findRootTypeKey(n) : null, null)
return createRelativePosition(n._item.parent, n._item)
}

@@ -111,2 +111,13 @@ }

const createRelativePosition = (type, item) => {
let typeid = null
let tname = null
if (type._item === null) {
tname = Y.findRootTypeKey(type)
} else {
typeid = Y.createID(type._item.id.client, type._item.id.clock)
}
return new Y.RelativePosition(typeid, tname, item.id)
}
/**

@@ -121,3 +132,3 @@ * @param {Y.Doc} y

const decodedPos = Y.createAbsolutePositionFromRelativePosition(relPos, y)
if (decodedPos === null || !Y.isParentOf(documentType, decodedPos.type._item)) {
if (decodedPos === null || (decodedPos.type !== documentType && !Y.isParentOf(documentType, decodedPos.type._item))) {
return null

@@ -124,0 +135,0 @@ }

import * as Y from 'yjs'
import { Decoration, DecorationSet } from 'prosemirror-view' // eslint-disable-line
import { Plugin, PluginKey } from 'prosemirror-state' // eslint-disable-line
import { Plugin } from 'prosemirror-state' // eslint-disable-line
import { Awareness } from 'y-protocols/awareness.js' // eslint-disable-line

@@ -6,0 +6,0 @@ import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, setMeta } from '../lib.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc