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

yjs

Package Overview
Dependencies
Maintainers
1
Versions
286
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yjs - npm Package Compare versions

Comparing version 13.5.36 to 13.5.37

10

dist/src/utils/UndoManager.d.ts
/**
* @typedef {Object} UndoManagerOptions
* @property {number} [UndoManagerOptions.captureTimeout=500]
* @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.
* @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes

@@ -25,3 +26,3 @@ * it is necessary to filter whan an Undo/Redo operation can delete. If this

*/
constructor(typeScope: AbstractType<any> | Array<AbstractType<any>>, { captureTimeout, deleteFilter, trackedOrigins, ignoreRemoteMapChanges }?: UndoManagerOptions);
constructor(typeScope: AbstractType<any> | Array<AbstractType<any>>, { captureTimeout, captureTransaction, deleteFilter, trackedOrigins, ignoreRemoteMapChanges }?: UndoManagerOptions);
/**

@@ -33,2 +34,3 @@ * @type {Array<AbstractType<any>>}

trackedOrigins: Set<any>;
captureTransaction: (arg0: Transaction) => boolean;
/**

@@ -118,2 +120,6 @@ * @type {Array<StackItem>}

/**
* Do not capture changes of a Transaction if result false.
*/
captureTransaction?: ((arg0: Transaction) => boolean) | undefined;
/**
* Sometimes

@@ -134,2 +140,3 @@ * it is necessary to filter whan an Undo/Redo operation can delete. If this

import { Item } from "../structs/Item.js";
import { Transaction } from "./Transaction.js";
declare class StackItem {

@@ -149,4 +156,3 @@ /**

import { Doc } from "./Doc.js";
import { Transaction } from "./Transaction.js";
import { DeleteSet } from "./DeleteSet.js";
export {};

2

package.json
{
"name": "yjs",
"version": "13.5.36",
"version": "13.5.37",
"description": "Shared Editing Library",

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

@@ -135,2 +135,3 @@ import {

* @property {number} [UndoManagerOptions.captureTimeout=500]
* @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.
* @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes

@@ -158,3 +159,9 @@ * it is necessary to filter whan an Undo/Redo operation can delete. If this

*/
constructor (typeScope, { captureTimeout = 500, deleteFilter = () => true, trackedOrigins = new Set([null]), ignoreRemoteMapChanges = false } = {}) {
constructor (typeScope, {
captureTimeout = 500,
captureTransaction = tr => true,
deleteFilter = () => true,
trackedOrigins = new Set([null]),
ignoreRemoteMapChanges = false
} = {}) {
super()

@@ -169,2 +176,3 @@ /**

this.trackedOrigins = trackedOrigins
this.captureTransaction = captureTransaction
/**

@@ -193,3 +201,8 @@ * @type {Array<StackItem>}

// Only track certain transactions
if (!this.scope.some(type => transaction.changedParentTypes.has(type)) || (!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor)))) {
if (this.captureTransaction(transaction) && (
!this.scope.some(type => transaction.changedParentTypes.has(type)) ||
(
!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor))
)
)) {
return

@@ -196,0 +209,0 @@ }

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 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