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

react-konva

Package Overview
Dependencies
Maintainers
1
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-konva - npm Package Compare versions

Comparing version

to
19.0.0

8

es/ReactKonvaCore.js

@@ -33,5 +33,5 @@ /**

const StageWrap = (props) => {
const container = React.useRef();
const stage = React.useRef();
const fiberRef = React.useRef();
const container = React.useRef(null);
const stage = React.useRef(null);
const fiberRef = React.useRef(null);
const oldProps = usePrevious(props);

@@ -58,3 +58,3 @@ const Bridge = useContextBridge();

_setRef(stage.current);
// @ts-ignore
// @ts-ignore
fiberRef.current = KonvaRenderer.createContainer(stage.current, LegacyRoot, null, null, undefined, undefined, console.error, console.error, console.error, null);

@@ -61,0 +61,0 @@ KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updatePicture = exports.applyNodeProps = exports.toggleStrictMode = exports.EVENTS_NAMESPACE = void 0;
exports.EVENTS_NAMESPACE = void 0;
exports.toggleStrictMode = toggleStrictMode;
exports.applyNodeProps = applyNodeProps;
exports.updatePicture = updatePicture;
const Global_js_1 = require("konva/lib/Global.js");

@@ -21,3 +24,2 @@ const propsToSkip = {

}
exports.toggleStrictMode = toggleStrictMode;
const DRAGGABLE_WARNING = `ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.

@@ -114,3 +116,2 @@ Position of a node will be changed during drag&drop, so you should update state of the react app as well.

}
exports.applyNodeProps = applyNodeProps;
function updatePicture(node) {

@@ -122,2 +123,1 @@ if (!Global_js_1.Konva.autoDrawEnabled) {

}
exports.updatePicture = updatePicture;

@@ -25,9 +25,19 @@ /**

});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -62,5 +72,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const StageWrap = (props) => {
const container = react_1.default.useRef();
const stage = react_1.default.useRef();
const fiberRef = react_1.default.useRef();
const container = react_1.default.useRef(null);
const stage = react_1.default.useRef(null);
const fiberRef = react_1.default.useRef(null);
const oldProps = usePrevious(props);

@@ -87,3 +97,3 @@ const Bridge = (0, its_fine_1.useContextBridge)();

_setRef(stage.current);
// @ts-ignore
// @ts-ignore
fiberRef.current = exports.KonvaRenderer.createContainer(stage.current, constants_js_1.LegacyRoot, null, null, undefined, undefined, console.error, console.error, console.error, null);

@@ -90,0 +100,0 @@ exports.KonvaRenderer.updateContainer(react_1.default.createElement(Bridge, {}, props.children), fiberRef.current);

@@ -6,4 +6,46 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.suspendInstance = exports.startSuspendingCommit = exports.preloadInstance = exports.maySuspendCommit = exports.requestPostPaintCallback = exports.shouldAttemptEagerTransition = exports.resolveUpdatePriority = exports.getCurrentUpdatePriority = exports.setCurrentUpdatePriority = exports.getInstanceFromScope = exports.prepareScopeUpdate = exports.getCurrentEventPriority = exports.detachDeletedInstance = exports.clearContainer = exports.unhideTextInstance = exports.unhideInstance = exports.hideTextInstance = exports.hideInstance = exports.commitUpdate = exports.commitMount = exports.commitTextUpdate = exports.removeChildFromContainer = exports.removeChild = exports.insertInContainerBefore = exports.insertBefore = exports.appendChildToContainer = exports.appendChild = exports.supportsMutation = exports.warnsIfNotActing = exports.isPrimaryRenderer = exports.shouldSetTextContent = exports.noTimeout = exports.cancelTimeout = exports.scheduleTimeout = exports.getChildHostContext = exports.getRootHostContext = exports.shouldDeprioritizeSubtree = exports.resetTextContent = exports.resetAfterCommit = exports.prepareUpdate = exports.preparePortalMount = exports.prepareForCommit = exports.getPublicInstance = exports.finalizeInitialChildren = exports.createTextInstance = exports.createInstance = exports.appendInitialChild = exports.run = exports.idlePriority = exports.now = void 0;
exports.resetFormInstance = exports.NotPendingTransition = exports.waitForCommitToBeReady = void 0;
exports.NotPendingTransition = exports.supportsMutation = exports.warnsIfNotActing = exports.isPrimaryRenderer = exports.noTimeout = exports.cancelTimeout = exports.scheduleTimeout = exports.run = exports.idlePriority = exports.now = void 0;
exports.appendInitialChild = appendInitialChild;
exports.createInstance = createInstance;
exports.createTextInstance = createTextInstance;
exports.finalizeInitialChildren = finalizeInitialChildren;
exports.getPublicInstance = getPublicInstance;
exports.prepareForCommit = prepareForCommit;
exports.preparePortalMount = preparePortalMount;
exports.prepareUpdate = prepareUpdate;
exports.resetAfterCommit = resetAfterCommit;
exports.resetTextContent = resetTextContent;
exports.shouldDeprioritizeSubtree = shouldDeprioritizeSubtree;
exports.getRootHostContext = getRootHostContext;
exports.getChildHostContext = getChildHostContext;
exports.shouldSetTextContent = shouldSetTextContent;
exports.appendChild = appendChild;
exports.appendChildToContainer = appendChildToContainer;
exports.insertBefore = insertBefore;
exports.insertInContainerBefore = insertInContainerBefore;
exports.removeChild = removeChild;
exports.removeChildFromContainer = removeChildFromContainer;
exports.commitTextUpdate = commitTextUpdate;
exports.commitMount = commitMount;
exports.commitUpdate = commitUpdate;
exports.hideInstance = hideInstance;
exports.hideTextInstance = hideTextInstance;
exports.unhideInstance = unhideInstance;
exports.unhideTextInstance = unhideTextInstance;
exports.clearContainer = clearContainer;
exports.detachDeletedInstance = detachDeletedInstance;
exports.getCurrentEventPriority = getCurrentEventPriority;
exports.prepareScopeUpdate = prepareScopeUpdate;
exports.getInstanceFromScope = getInstanceFromScope;
exports.setCurrentUpdatePriority = setCurrentUpdatePriority;
exports.getCurrentUpdatePriority = getCurrentUpdatePriority;
exports.resolveUpdatePriority = resolveUpdatePriority;
exports.shouldAttemptEagerTransition = shouldAttemptEagerTransition;
exports.requestPostPaintCallback = requestPostPaintCallback;
exports.maySuspendCommit = maySuspendCommit;
exports.preloadInstance = preloadInstance;
exports.startSuspendingCommit = startSuspendingCommit;
exports.suspendInstance = suspendInstance;
exports.waitForCommitToBeReady = waitForCommitToBeReady;
exports.resetFormInstance = resetFormInstance;
const Core_js_1 = __importDefault(require("konva/lib/Core.js"));

@@ -31,3 +73,2 @@ const makeUpdates_js_1 = require("./makeUpdates.js");

}
exports.appendInitialChild = appendInitialChild;
function createInstance(type, props, internalInstanceHandle) {

@@ -60,47 +101,35 @@ let NodeClass = Core_js_1.default[type];

}
exports.createInstance = createInstance;
function createTextInstance(text, rootContainerInstance, internalInstanceHandle) {
console.error(`Text components are not supported for now in ReactKonva. Your text is: "${text}"`);
}
exports.createTextInstance = createTextInstance;
function finalizeInitialChildren(domElement, type, props) {
return false;
}
exports.finalizeInitialChildren = finalizeInitialChildren;
function getPublicInstance(instance) {
return instance;
}
exports.getPublicInstance = getPublicInstance;
function prepareForCommit() {
return null;
}
exports.prepareForCommit = prepareForCommit;
function preparePortalMount() {
return null;
}
exports.preparePortalMount = preparePortalMount;
function prepareUpdate(domElement, type, oldProps, newProps) {
return UPDATE_SIGNAL;
}
exports.prepareUpdate = prepareUpdate;
function resetAfterCommit() {
// Noop
}
exports.resetAfterCommit = resetAfterCommit;
function resetTextContent(domElement) {
// Noop
}
exports.resetTextContent = resetTextContent;
function shouldDeprioritizeSubtree(type, props) {
return false;
}
exports.shouldDeprioritizeSubtree = shouldDeprioritizeSubtree;
function getRootHostContext() {
return NO_CONTEXT;
}
exports.getRootHostContext = getRootHostContext;
function getChildHostContext() {
return NO_CONTEXT;
}
exports.getChildHostContext = getChildHostContext;
exports.scheduleTimeout = setTimeout;

@@ -114,3 +143,2 @@ exports.cancelTimeout = clearTimeout;

}
exports.shouldSetTextContent = shouldSetTextContent;
// The Konva renderer is secondary to the React DOM renderer.

@@ -129,3 +157,2 @@ exports.isPrimaryRenderer = false;

}
exports.appendChild = appendChild;
function appendChildToContainer(parentInstance, child) {

@@ -140,3 +167,2 @@ if (child.parent === parentInstance) {

}
exports.appendChildToContainer = appendChildToContainer;
function insertBefore(parentInstance, child, beforeChild) {

@@ -151,7 +177,5 @@ // child._remove() will not stop dragging

}
exports.insertBefore = insertBefore;
function insertInContainerBefore(parentInstance, child, beforeChild) {
insertBefore(parentInstance, child, beforeChild);
}
exports.insertInContainerBefore = insertInContainerBefore;
function removeChild(parentInstance, child) {

@@ -162,3 +186,2 @@ child.destroy();

}
exports.removeChild = removeChild;
function removeChildFromContainer(parentInstance, child) {

@@ -169,15 +192,11 @@ child.destroy();

}
exports.removeChildFromContainer = removeChildFromContainer;
function commitTextUpdate(textInstance, oldText, newText) {
console.error(`Text components are not yet supported in ReactKonva. You text is: "${newText}"`);
}
exports.commitTextUpdate = commitTextUpdate;
function commitMount(instance, type, newProps) {
// Noop
}
exports.commitMount = commitMount;
function commitUpdate(instance, type, oldProps, newProps) {
(0, makeUpdates_js_1.applyNodeProps)(instance, newProps, oldProps);
}
exports.commitUpdate = commitUpdate;
function hideInstance(instance) {

@@ -187,7 +206,5 @@ instance.hide();

}
exports.hideInstance = hideInstance;
function hideTextInstance(textInstance) {
// Noop
}
exports.hideTextInstance = hideTextInstance;
function unhideInstance(instance, props) {

@@ -198,59 +215,41 @@ if (props.visible == null || props.visible) {

}
exports.unhideInstance = unhideInstance;
function unhideTextInstance(textInstance, text) {
// Noop
}
exports.unhideTextInstance = unhideTextInstance;
function clearContainer(container) {
// Noop
}
exports.clearContainer = clearContainer;
function detachDeletedInstance() { }
exports.detachDeletedInstance = detachDeletedInstance;
function getCurrentEventPriority() {
return currentUpdatePriority;
}
exports.getCurrentEventPriority = getCurrentEventPriority;
function prepareScopeUpdate() { }
exports.prepareScopeUpdate = prepareScopeUpdate;
function getInstanceFromScope() {
return null;
}
exports.getInstanceFromScope = getInstanceFromScope;
function setCurrentUpdatePriority(newPriority) {
currentUpdatePriority = newPriority;
}
exports.setCurrentUpdatePriority = setCurrentUpdatePriority;
function getCurrentUpdatePriority() {
return currentUpdatePriority;
}
exports.getCurrentUpdatePriority = getCurrentUpdatePriority;
function resolveUpdatePriority() {
return currentUpdatePriority || constants_js_1.DefaultEventPriority;
}
exports.resolveUpdatePriority = resolveUpdatePriority;
function shouldAttemptEagerTransition() {
return false;
}
exports.shouldAttemptEagerTransition = shouldAttemptEagerTransition;
function requestPostPaintCallback() { }
exports.requestPostPaintCallback = requestPostPaintCallback;
function maySuspendCommit() {
return false;
}
exports.maySuspendCommit = maySuspendCommit;
function preloadInstance() {
return true;
}
exports.preloadInstance = preloadInstance;
function startSuspendingCommit() { }
exports.startSuspendingCommit = startSuspendingCommit;
function suspendInstance() { }
exports.suspendInstance = suspendInstance;
function waitForCommitToBeReady() {
return null;
}
exports.waitForCommitToBeReady = waitForCommitToBeReady;
exports.NotPendingTransition = null;
function resetFormInstance() { }
exports.resetFormInstance = resetFormInstance;

@@ -5,3 +5,3 @@ {

"description": "React binding to canvas element via Konva framework",
"version": "19.0.0-1",
"version": "19.0.0",
"keywords": [

@@ -23,4 +23,4 @@ "react",

"its-fine": "^1.2.5",
"react-reconciler": "0.31.0-beta-73bcdfbae5-20240502",
"scheduler": "0.25.0-beta-73bcdfbae5-20240502"
"react-reconciler": "0.31.0",
"scheduler": "0.25.0"
},

@@ -46,19 +46,20 @@ "targets": {

"konva": "^8.0.1 || ^7.2.5 || ^9.0.0",
"react": ">=19.0.0-beta",
"react-dom": ">=19.0.0-beta"
"react": "^18.3.0 || ^19.0.0",
"react-dom": "^18.3.0 || ^19.0.0"
},
"devDependencies": {
"@types/chai": "^4.3.17",
"@types/mocha": "^10.0.7",
"@types/react": "18.3.3",
"chai": "4.3.7",
"konva": "^9.3.14",
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.10",
"@types/react": "19.0.0",
"assert": "^2.1.0",
"chai": "5.1.2",
"konva": "^9.3.16",
"mocha-headless-chrome": "^4.0.0",
"parcel": "^2.12.0",
"parcel": "^2.13.2",
"process": "^0.11.10",
"react": "19.0.0-beta-73bcdfbae5-20240502",
"react-dom": "19.0.0-beta-73bcdfbae5-20240502",
"sinon": "^15.1.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sinon": "^19.0.2",
"timers-browserify": "^2.0.12",
"typescript": "^5.1.3",
"typescript": "^5.7.2",
"use-image": "^1.1.1",

@@ -65,0 +66,0 @@ "util": "^0.12.5"