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

abstract-image

Package Overview
Dependencies
Maintainers
8
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-image - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

20

lib-cjs/exporters/react-svg-export-image.js

@@ -96,3 +96,5 @@ "use strict";

var lines_1 = component.text !== null ? component.text.split("\n") : [];
var tSpans = lines_1.map(function (t) { return (React.createElement("tspan", { key: t, x: component.position.x, y: component.position.y + (lines_1.indexOf(t) + dy_1) * lineHeight_1, height: lineHeight_1.toString() + "px" }, t)); });
var tSpans = lines_1.map(function (t) {
return renderLine(t, component.position.x, component.position.y + (lines_1.indexOf(t) + dy_1) * lineHeight_1, component.fontSize, lineHeight_1);
});
var cs = [];

@@ -134,2 +136,18 @@ if (component.strokeThickness > 0 && component.strokeColor) {

}
function renderLine(text, x, y, fontSize, lineHeight) {
var split = R.unnest(text.split("<sub>").map(function (t) { return t.split("</sub>"); }));
var inside = false;
var tags = [];
for (var _i = 0, split_1 = split; _i < split_1.length; _i++) {
var text_1 = split_1[_i];
if (inside) {
tags.push(React.createElement("tspan", { baselineShift: "sub", style: { fontSize: (fontSize * 0.8).toString() + "px" } }, text_1));
}
else {
tags.push(React.createElement("tspan", null, text_1));
}
inside = !inside;
}
return (React.createElement("tspan", { key: text, x: x, y: y, height: lineHeight.toString() + "px" }, tags));
}
function getBaselineAdjustment(d) {

@@ -136,0 +154,0 @@ if (d === "up") {

@@ -89,3 +89,8 @@ "use strict";

height: lineHeight_1.toString() + "px"
}, [t]);
}, [
t
.replace("<sub>", "<tspan style=\"font-size: " + component.fontSize *
0.8 + "px\" baseline-shift=\"sub\">")
.replace("</sub>", "</tspan>")
]);
});

@@ -92,0 +97,0 @@ var cs = [];

@@ -93,3 +93,5 @@ import * as R from "ramda";

var lines_1 = component.text !== null ? component.text.split("\n") : [];
var tSpans = lines_1.map(function (t) { return (React.createElement("tspan", { key: t, x: component.position.x, y: component.position.y + (lines_1.indexOf(t) + dy_1) * lineHeight_1, height: lineHeight_1.toString() + "px" }, t)); });
var tSpans = lines_1.map(function (t) {
return renderLine(t, component.position.x, component.position.y + (lines_1.indexOf(t) + dy_1) * lineHeight_1, component.fontSize, lineHeight_1);
});
var cs = [];

@@ -131,2 +133,18 @@ if (component.strokeThickness > 0 && component.strokeColor) {

}
function renderLine(text, x, y, fontSize, lineHeight) {
var split = R.unnest(text.split("<sub>").map(function (t) { return t.split("</sub>"); }));
var inside = false;
var tags = [];
for (var _i = 0, split_1 = split; _i < split_1.length; _i++) {
var text_1 = split_1[_i];
if (inside) {
tags.push(React.createElement("tspan", { baselineShift: "sub", style: { fontSize: (fontSize * 0.8).toString() + "px" } }, text_1));
}
else {
tags.push(React.createElement("tspan", null, text_1));
}
inside = !inside;
}
return (React.createElement("tspan", { key: text, x: x, y: y, height: lineHeight.toString() + "px" }, tags));
}
function getBaselineAdjustment(d) {

@@ -133,0 +151,0 @@ if (d === "up") {

@@ -86,3 +86,8 @@ export function createSVG(image, pixelWidth, pixelHeight) {

height: lineHeight_1.toString() + "px"
}, [t]);
}, [
t
.replace("<sub>", "<tspan style=\"font-size: " + component.fontSize *
0.8 + "px\" baseline-shift=\"sub\">")
.replace("</sub>", "</tspan>")
]);
});

@@ -89,0 +94,0 @@ var cs = [];

2

package.json
{
"name": "abstract-image",
"version": "2.2.4",
"version": "2.2.5",
"description": "Dynamically create images using code or JSX and render to any format",

@@ -5,0 +5,0 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-image",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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