abstract-image
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -7,4 +7,5 @@ import * as React from "react"; | ||
readonly onMouseMove?: MouseCallback; | ||
readonly onContextMenu?: MouseCallback; | ||
} | ||
export declare type MouseCallback = (id: string | undefined, point: AbstractImage.Point) => void; | ||
export declare function createReactSvg(image: AbstractImage.AbstractImage, callbacks?: ReactSvgCallbacks): React.ReactElement<{}>; |
@@ -8,6 +8,5 @@ "use strict"; | ||
var cb = callbacks || {}; | ||
return (React.createElement("div", { onClick: _callback(cb.onClick), onDoubleClick: _callback(cb.onDoubleClick), onMouseMove: _callback(cb.onMouseMove) }, | ||
React.createElement("svg", { width: image.size.width + "px", height: image.size.height + "px", viewBox: [0, 0, image.size.width, image.size.height].join(" ") }, R.unnest(R.addIndex(R.map)( | ||
// tslint:disable-next-line:no-any | ||
function (c, i) { return _visit(i.toString(), c); }, image.components))))); | ||
return (React.createElement("svg", { width: image.size.width + "px", height: image.size.height + "px", viewBox: [0, 0, image.size.width, image.size.height].join(" "), onClick: _callback(cb.onClick), onDoubleClick: _callback(cb.onDoubleClick), onMouseMove: _callback(cb.onMouseMove), onContextMenu: _callback(cb.onContextMenu) }, R.unnest(R.addIndex(R.map)( | ||
// tslint:disable-next-line:no-any | ||
function (c, i) { return _visit(i.toString(), c); }, image.components)))); | ||
} | ||
@@ -40,3 +39,3 @@ exports.createReactSvg = createReactSvg; | ||
return [ | ||
React.createElement("g", { key: key, dangerouslySetInnerHTML: { | ||
React.createElement("g", { key: key, id: component.id, dangerouslySetInnerHTML: { | ||
__html: component.data.reduce(function (a, b) { return a + String.fromCharCode(b); }, "") | ||
@@ -43,0 +42,0 @@ } }) |
@@ -7,4 +7,5 @@ import * as React from "react"; | ||
readonly onMouseMove?: MouseCallback; | ||
readonly onContextMenu?: MouseCallback; | ||
} | ||
export declare type MouseCallback = (id: string | undefined, point: AbstractImage.Point) => void; | ||
export declare function createReactSvg(image: AbstractImage.AbstractImage, callbacks?: ReactSvgCallbacks): React.ReactElement<{}>; |
@@ -6,6 +6,5 @@ import * as R from "ramda"; | ||
var cb = callbacks || {}; | ||
return (React.createElement("div", { onClick: _callback(cb.onClick), onDoubleClick: _callback(cb.onDoubleClick), onMouseMove: _callback(cb.onMouseMove) }, | ||
React.createElement("svg", { width: image.size.width + "px", height: image.size.height + "px", viewBox: [0, 0, image.size.width, image.size.height].join(" ") }, R.unnest(R.addIndex(R.map)( | ||
// tslint:disable-next-line:no-any | ||
function (c, i) { return _visit(i.toString(), c); }, image.components))))); | ||
return (React.createElement("svg", { width: image.size.width + "px", height: image.size.height + "px", viewBox: [0, 0, image.size.width, image.size.height].join(" "), onClick: _callback(cb.onClick), onDoubleClick: _callback(cb.onDoubleClick), onMouseMove: _callback(cb.onMouseMove), onContextMenu: _callback(cb.onContextMenu) }, R.unnest(R.addIndex(R.map)( | ||
// tslint:disable-next-line:no-any | ||
function (c, i) { return _visit(i.toString(), c); }, image.components)))); | ||
} | ||
@@ -37,3 +36,3 @@ function _callback(callback) { | ||
return [ | ||
React.createElement("g", { key: key, dangerouslySetInnerHTML: { | ||
React.createElement("g", { key: key, id: component.id, dangerouslySetInnerHTML: { | ||
__html: component.data.reduce(function (a, b) { return a + String.fromCharCode(b); }, "") | ||
@@ -40,0 +39,0 @@ } }) |
{ | ||
"name": "abstract-image", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Dynamically create images using code or JSX and render to any format", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/dividab/abstract-visuals/packages/abstract-image", |
@@ -0,0 +0,0 @@ # abstract-image |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
143816
1910
0