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

@react-pdf/textkit

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf/textkit - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

16

layout/layoutParagraph.js

@@ -36,11 +36,12 @@ "use strict";

var layoutLines = function layoutLines(rect, lines) {
var layoutLines = function layoutLines(rect, lines, indent) {
var currentY = rect.y;
return R.map(R.compose(function (line) {
return R.addIndex(R.map)(R.compose(purgeAttachments, function (line, i) {
var lineIndent = i === 0 ? indent : 0;
var style = R.pathOr({}, ['runs', 0, 'attributes'], line);
var height = Math.max((0, _height["default"])(line), style.lineHeight);
var box = {
x: rect.x,
x: rect.x + lineIndent,
y: currentY,
width: rect.width,
width: rect.width - lineIndent,
height: height

@@ -50,3 +51,3 @@ };

return R.compose(R.assoc('box', box), R.omit(['syllables']))(line);
}, purgeAttachments))(lines);
}))(lines);
};

@@ -66,4 +67,5 @@ /**

return function (rect, paragraph) {
var lines = engines.linebreaker(options)(paragraph, [rect.width]);
var lineFragments = layoutLines(rect, lines);
var indent = R.pathOr(0, ['runs', 0, 'attributes', 'indent'], paragraph);
var lines = engines.linebreaker(options)(paragraph, [rect.width - indent, rect.width]);
var lineFragments = layoutLines(rect, lines, indent);
return lineFragments;

@@ -70,0 +72,0 @@ };

{
"name": "@react-pdf/textkit",
"version": "0.3.1",
"version": "0.3.2",
"description": "An advanced text layout framework",

@@ -5,0 +5,0 @@ "main": "./index.js",

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