react-konva-grid
Advanced tools
Comparing version 3.0.6 to 3.0.7
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -28,6 +28,8 @@ import React, { useReducer, useRef, useEffect, useCallback } from "react"; | ||
export type Path = [string, any]; | ||
export interface Patches { | ||
path: [string, any]; | ||
path: Path; | ||
value: any; | ||
operator: Operator; | ||
op: Operator; | ||
} | ||
@@ -42,8 +44,17 @@ | ||
export function createPatches(path, value, previousValue, op = "replace") { | ||
const patches = { op, value, path }; | ||
const inversePatches = { op, value: previousValue, path }; | ||
export function createPatches( | ||
path: Path, | ||
value: any, | ||
previousValue: any, | ||
op: Operator = "replace" | ||
): Stack { | ||
const patches: Patches = { op, value, path }; | ||
const inversePatches: Patches = { op, value: previousValue, path }; | ||
return { patches, inversePatches }; | ||
} | ||
/** | ||
* Undo/Redo hook | ||
* @param | ||
*/ | ||
const useUndo = ({ onRedo, onUndo }: UndoProps): UndoResults => { | ||
@@ -54,8 +65,2 @@ const undoStack = useRef<Stack[]>([]); | ||
useEffect(() => { | ||
document.addEventListener("undo", () => { | ||
console.log("calld"); | ||
}); | ||
}, []); | ||
const handleKeyDown = useCallback( | ||
@@ -62,0 +67,0 @@ (e: React.KeyboardEvent<HTMLDivElement>) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
400620
8816