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

@contrail/document-generation

Package Overview
Dependencies
Maintainers
9
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/document-generation - npm Package Compare versions

Comparing version 2.0.12 to 2.0.13

1

lib/interfaces.d.ts

@@ -57,2 +57,3 @@ import { DataGroupStructure } from "@contrail/data-grouping";

isHidden?: boolean;
size?: SizeDefinition;
}

@@ -7,3 +7,4 @@ import { DocumentPropertyDefinition } from "../interfaces";

static generatePropertyTextElement(model: any, property: DocumentPropertyDefinition, options: DocumentElement, formatter: PropertyValueFormatter, position: PositionDefinition, isComponent?: boolean): DocumentElement;
static generatePropertyAnnotationElement(data: any, property: DocumentPropertyDefinition, size: SizeDefinition, position: PositionDefinition): DocumentElement;
static generatePropertyImageElement(data: any, property: DocumentPropertyDefinition, imageDimension: SizeDefinition, position: PositionDefinition): DocumentElement;
}

@@ -15,4 +15,8 @@ "use strict";

const formatter = new types_1.PropertyValueFormatter();
let index = 0;
for (let property of properties) {
let element;
if (index === 0 && property.slug === 'annotation') {
yPosition = -15;
}
if (property.propertyDefinition) {

@@ -29,2 +33,6 @@ const fontSize = ((_b = (_a = property.style) === null || _a === void 0 ? void 0 : _a.font) === null || _b === void 0 ? void 0 : _b.size) || 12;

}
else if (property.slug === 'annotation') {
element = DocumentPropertyUtil.generatePropertyAnnotationElement(data, property, property.size, { x: xPosition, y: yPosition });
yPosition += element.size.height - 10;
}
else {

@@ -37,2 +45,3 @@ const imageHeight = imageDimension.height || imageDimension.width || 125;

elements.push(element);
index++;
}

@@ -63,2 +72,14 @@ return elements;

}
static generatePropertyAnnotationElement(data, property, size, position) {
const element = {
type: "annotation",
size: size,
propertyBindings: { annotation: 'annotation' },
position
};
if (property.isHidden) {
element.isHidden = property.isHidden;
}
return element;
}
static generatePropertyImageElement(data, property, imageDimension, position) {

@@ -65,0 +86,0 @@ const imageUrl = util_1.ObjectUtil.getByPath(data, `viewable.mediumViewableDownloadUrl`);

2

package.json
{
"name": "@contrail/document-generation",
"version": "2.0.12",
"version": "2.0.13",
"description": "Utilities for automatic generation of documents.",

@@ -5,0 +5,0 @@ "main": "lib/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