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

@slate-yjs/core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-yjs/core - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

CHANGELOG.md
# @slate-yjs/core
## 1.0.1
### Patch Changes
- [#402](https://github.com/BitPhinix/slate-yjs/pull/402) [`c453baf`](https://github.com/BitPhinix/slate-yjs/commit/c453baf5c7a720436ee434eda3e93fe16e1482fc) Thanks [@juliankrispel](https://github.com/juliankrispel)! - Fix applyDelta to produce correct slate operations for adjacent text operations
## 1.0.0

@@ -4,0 +10,0 @@

8

dist/index.js

@@ -410,3 +410,9 @@ var __defProp = Object.defineProperty;

if (Text4.isText(child)) {
if (typeof change.insert === "string" && deepEquals((_a = change.attributes) != null ? _a : {}, getProperties(child))) {
const lastOp = ops[ops.length - 1];
const currentProps = lastOp != null && lastOp.type === "insert_node" ? lastOp.node : getProperties(child);
let lastPath = [];
if (lastOp != null && (lastOp.type === "insert_node" || lastOp.type === "insert_text" || lastOp.type === "split_node" || lastOp.type === "set_node")) {
lastPath = lastOp.path;
}
if (typeof change.insert === "string" && deepEquals((_a = change.attributes) != null ? _a : {}, currentProps) && Path2.equals(childPath, lastPath)) {
return ops.push({

@@ -413,0 +419,0 @@ type: "insert_text",

2

package.json
{
"name": "@slate-yjs/core",
"sideEffects": false,
"version": "1.0.0",
"version": "1.0.1",
"description": "Yjs binding for Slate.",

@@ -6,0 +6,0 @@ "keywords": [

@@ -162,5 +162,34 @@ import { Editor, Element, Node, Operation, Path, Text } from 'slate';

if (Text.isText(child)) {
const lastOp = ops[ops.length - 1];
/**
* The props that exist at the current path
* Since we're not actually using slate to update the node
* this is a simulation
*/
const currentProps =
lastOp != null && lastOp.type === 'insert_node'
? lastOp.node
: getProperties(child);
let lastPath: Path = [];
if (
lastOp != null &&
(lastOp.type === 'insert_node' ||
lastOp.type === 'insert_text' ||
lastOp.type === 'split_node' ||
lastOp.type === 'set_node')
) {
lastPath = lastOp.path;
}
/**
* If the insert is a string and the attributes are the same as the
* props at the current path, we can just insert a text node
*/
if (
typeof change.insert === 'string' &&
deepEquals(change.attributes ?? {}, getProperties(child))
deepEquals(change.attributes ?? {}, currentProps) &&
Path.equals(childPath, lastPath)
) {

@@ -167,0 +196,0 @@ return ops.push({

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

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