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

react-konva-utils

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-konva-utils - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

12

es/html.d.ts
import Konva from 'konva';
import { PropsWithChildren } from 'react';
declare type TransformAttrs = {
x: number;
y: number;
scaleX: number;
scaleY: number;
rotation: number;
skewX: number;
skewY: number;
};
declare type Props = PropsWithChildren<{

@@ -7,4 +16,5 @@ groupProps?: Konva.ContainerConfig;

transform?: boolean;
transformFunc?: (attrs: TransformAttrs) => TransformAttrs;
}>;
export declare const Html: ({ children, groupProps, divProps, transform }: Props) => JSX.Element;
export declare const Html: ({ children, groupProps, divProps, transform, transformFunc, }: Props) => JSX.Element;
export {};

7

es/html.js

@@ -20,3 +20,3 @@ var __rest = (this && this.__rest) || function (s, e) {

};
export const Html = ({ children, groupProps, divProps, transform }) => {
export const Html = ({ children, groupProps, divProps, transform, transformFunc, }) => {
const groupRef = React.useRef(null);

@@ -32,3 +32,6 @@ const container = React.useRef();

const tr = groupRef.current.getAbsoluteTransform();
const attrs = tr.decompose();
let attrs = tr.decompose();
if (transformFunc) {
attrs = transformFunc(attrs);
}
div.style.position = 'absolute';

@@ -35,0 +38,0 @@ div.style.zIndex = '10';

{
"name": "react-konva-utils",
"version": "0.1.7",
"version": "0.2.0",
"description": "Useful components and hooks for react-konva",

@@ -27,8 +27,2 @@ "author": "Anton Lavrenov",

],
"size-limit": [
{
"path": "./lib/polotno-app.js",
"limit": "395 KB"
}
],
"devDependencies": {

@@ -35,0 +29,0 @@ "@babel/core": "^7.13.14",

@@ -12,2 +12,3 @@ # Useful components and hooks for [react-konva](https://github.com/konvajs/react-konva/) apps.

transform // should we apply position transform automatically to DOM container, default is true
transformFunc={(transformAttrs) => newAttrs} // function to overwrite transformation attributes, not used if transform = false, default is undefined
groupProps={{}} // additional properties to the group wrapper, useful for some position offset

@@ -14,0 +15,0 @@ divProps={{}} // additional props for wrapped div elements, useful for styles

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