Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-collab

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-collab - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.md

19

dist/collab.js

@@ -103,7 +103,17 @@ 'use strict';

// :: (state: EditorState, steps: [Step], clientIDs: [union<number, string>]) → Transaction
// :: (state: EditorState, steps: [Step], clientIDs: [union<number, string>], options: ?Object) → Transaction
// Create a transaction that represents a set of new steps received from
// the authority. Applying this transaction moves the state forward to
// adjust to the authority's view of the document.
function receiveTransaction(state, steps, clientIDs) {
//
// options::- Additional options.
//
// mapSelectionBackward:: ?boolean
// When enabled (the default is `false`), if the current selection
// is a [text selection](#state.TextSelection), its sides are
// mapped with a negative bias for this transaction, so that
// content inserted at the cursor ends up after the cursor. Users
// usually prefer this, but it isn't done by default for reasons
// of backwards compatibility.
function receiveTransaction(state, steps, clientIDs, options) {
// Pushes a set of steps (received from the central authority) into

@@ -138,2 +148,7 @@ // the editor state (which should have the collab plugin enabled).

var newCollabState = new CollabState(version, unconfirmed);
if (options && options.mapSelectionBackard && state.selection instanceof prosemirrorState.TextSelection) {
tr.setSelection(prosemirrorState.TextSelection.between(tr.doc.resolve(tr.mapping.map(state.selection.head, -1)),
tr.doc.resolve(tr.mapping.map(state.selection.anchor, -1)), -1));
tr.updated &= ~1;
}
return tr.setMeta("rebased", nUnconfirmed).setMeta("addToHistory", false).setMeta(collabKey, newCollabState)

@@ -140,0 +155,0 @@ }

2

package.json
{
"name": "prosemirror-collab",
"version": "1.0.0",
"version": "1.1.0",
"description": "Collaborative editing for ProseMirror",

@@ -5,0 +5,0 @@ "main": "dist/collab.js",

@@ -1,2 +0,2 @@

import {Plugin, PluginKey} from "prosemirror-state"
import {Plugin, PluginKey, TextSelection} from "prosemirror-state"

@@ -101,7 +101,17 @@ class Rebaseable {

// :: (state: EditorState, steps: [Step], clientIDs: [union<number, string>]) → Transaction
// :: (state: EditorState, steps: [Step], clientIDs: [union<number, string>], options: ?Object) → Transaction
// Create a transaction that represents a set of new steps received from
// the authority. Applying this transaction moves the state forward to
// adjust to the authority's view of the document.
export function receiveTransaction(state, steps, clientIDs) {
//
// options::- Additional options.
//
// mapSelectionBackward:: ?boolean
// When enabled (the default is `false`), if the current selection
// is a [text selection](#state.TextSelection), its sides are
// mapped with a negative bias for this transaction, so that
// content inserted at the cursor ends up after the cursor. Users
// usually prefer this, but it isn't done by default for reasons
// of backwards compatibility.
export function receiveTransaction(state, steps, clientIDs, options) {
// Pushes a set of steps (received from the central authority) into

@@ -136,2 +146,7 @@ // the editor state (which should have the collab plugin enabled).

let newCollabState = new CollabState(version, unconfirmed)
if (options && options.mapSelectionBackard && state.selection instanceof TextSelection) {
tr.setSelection(TextSelection.between(tr.doc.resolve(tr.mapping.map(state.selection.head, -1)),
tr.doc.resolve(tr.mapping.map(state.selection.anchor, -1)), -1))
tr.updated &= ~1
}
return tr.setMeta("rebased", nUnconfirmed).setMeta("addToHistory", false).setMeta(collabKey, newCollabState)

@@ -138,0 +153,0 @@ }

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