New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-konva-grid

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-konva-grid - npm Package Compare versions

Comparing version 3.0.7 to 3.0.8

src/tests/useUndo.test.ts

2

package.json
{
"name": "react-konva-grid",
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets",
"version": "3.0.7",
"version": "3.0.8",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -15,4 +15,4 @@ import React, { useReducer, useRef, useEffect, useCallback } from "react";

export interface UndoProps {
onRedo: (patches: Patches) => void;
onUndo: (patches: Patches) => void;
onRedo?: (patches: Patches) => void;
onUndo?: (patches: Patches) => void;
}

@@ -23,3 +23,3 @@

redo: () => void;
addToUndoStack: (stack: Stack) => void;
add: (stack: Stack) => void;
canUndo: boolean;

@@ -45,2 +45,9 @@ canRedo: boolean;

/**
* Create patches
* @param path
* @param value
* @param previousValue
* @param op
*/
export function createPatches(

@@ -61,3 +68,4 @@ path: Path,

*/
const useUndo = ({ onRedo, onUndo }: UndoProps): UndoResults => {
const useUndo = (props: UndoProps = {}): UndoResults => {
const { onRedo, onUndo } = props;
const undoStack = useRef<Stack[]>([]);

@@ -88,2 +96,3 @@ const undoStackPointer = useRef<number>(-1);

onUndo && onUndo(patches);
forceRender();
};

@@ -96,2 +105,3 @@

onRedo && onRedo(patches);
forceRender();
};

@@ -103,2 +113,3 @@

undoStack.current[pointer] = { patches, inversePatches };
forceRender();
};

@@ -109,3 +120,3 @@

redo: handleRedo,
addToUndoStack: addUndoable,
add: addUndoable,
canUndo: !(undoStackPointer.current < 0),

@@ -112,0 +123,0 @@ canRedo: !(undoStackPointer.current === undoStack.current.length - 1),

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