Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

abstract-document

Package Overview
Dependencies
137
Maintainers
15
Versions
135
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.12.4 to 6.12.5

31

lib/abstract-document-xml/abstract-doc-of-xml/creator.js

@@ -20,6 +20,15 @@ "use strict";

TextRun: (props) => index_1.TextRun.create(props),
ImageRow: (props) => (0, custom_elements_1.ImageRow)(imageProps(images, props), styleNames),
ImageCell: (props) => (0, custom_elements_1.ImageCell)(imageProps(images, props), styleNames),
ImageParagraph: (props) => (0, custom_elements_1.ImageParagraph)(imageProps(images, props), styleNames),
Image: (props) => index_1.Image.create(imageProps(images, props)),
ImageRow: (props) => {
mutateImageProps(images, props);
return (0, custom_elements_1.ImageRow)(props, styleNames);
},
ImageCell: (props) => {
return (0, custom_elements_1.ImageCell)(props, styleNames);
},
ImageParagraph: (props) => {
return (0, custom_elements_1.ImageParagraph)(props, styleNames);
},
Image: (props) => {
return index_1.Image.create(props);
},
Table: (props, children) => index_1.Table.create(props, children),

@@ -200,10 +209,9 @@ TableRow: (props, children) => index_1.TableRow.create(props, children),

};
function imageProps(images, props) {
function mutateImageProps(images, props) {
var _a;
const newProps = Object.assign(Object.assign({}, props), { width: props.width, height: props.height, imageResource: props.src });
const image = images[(_a = props.src) !== null && _a !== void 0 ? _a : ""];
if (image) {
if (image.width && image.height) {
newProps.width = image.width;
newProps.height = image.height;
props.width = image.width;
props.height = image.height;
}

@@ -214,12 +222,11 @@ else {

if (scaleX < scaleY) {
newProps.height = props.height * (scaleX / scaleY);
props.height = props.height * (scaleX / scaleY);
}
else {
newProps.width = props.width * (scaleY / scaleX);
props.width = props.width * (scaleY / scaleX);
}
}
newProps.imageResource = props.src;
props.imageResource = images[props.src];
}
return newProps;
}
//# sourceMappingURL=creator.js.map

@@ -17,4 +17,4 @@ export declare const abstractDoc = "<xs:element name=\"AbstractDoc\">\n <xs:complexType>\n\t\t<xs:sequence>\n\t\t\t\t<xs:element name=\"StyleNames\" type=\"StyleNames\" minOccurs=\"0\"></xs:element>\n\t\t\t\t<xs:element name=\"Section\" type=\"Section\"></xs:element>\n\t\t</xs:sequence>\n\t</xs:complexType>\n</xs:element>";

export declare const textField = "<xs:complexType name=\"TextField\">\n\t<xs:sequence>\n\t\t<xs:element name=\"style\" type=\"TextStyle\" />\n\t</xs:sequence>\n\t<xs:attribute name=\"styleName\" type=\"xs:string\">\n\t\t<xs:annotation>\n\t\t\t<xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name=\"...\" /> \\</StyleNames> \\</AbstractDoc></xs:documentation>\n\t\t</xs:annotation>\n\t</xs:attribute>\n\t<xs:attribute name=\"fieldType\">\n\t\t<xs:simpleType>\n\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t<xs:enumeration value=\"Date\" />\n\t\t\t\t<xs:enumeration value=\"PageNumber\" />\n\t\t\t\t<xs:enumeration value=\"TotalPages\" />\n\t\t\t\t<xs:enumeration value=\"PageNumberOf\" />\n\t\t\t</xs:restriction>\n\t\t</xs:simpleType>\n\t</xs:attribute>\n\t<xs:attribute name=\"target\" type=\"xs:string\" />\n\t<xs:attribute name=\"text\" type=\"xs:string\" />\n</xs:complexType>";
export declare const image = "<xs:complexType name=\"Image\">\n <xs:attribute name=\"src\" type=\"xs:string\" use=\"required\" />\n <xs:attribute name=\"width\" type=\"xs:decimal\" use=\"required\" />\n <xs:attribute name=\"height\" type=\"xs:decimal\" use=\"required\" />\n</xs:complexType>";
export declare const image = "<xs:complexType name=\"Image\">\n <xs:attribute name=\"src\" type=\"xs:string\" use=\"required\" />\n <xs:attribute name=\"width\" type=\"xs:decimal\" />\n <xs:attribute name=\"height\" type=\"xs:decimal\" />\n</xs:complexType>";
export declare const pageBreak = "<xs:complexType name=\"PageBreak\" />";
//# sourceMappingURL=elements.d.ts.map

@@ -209,6 +209,6 @@ "use strict";

<xs:attribute name="src" type="xs:string" use="required" />
<xs:attribute name="width" type="xs:decimal" use="required" />
<xs:attribute name="height" type="xs:decimal" use="required" />
<xs:attribute name="width" type="xs:decimal" />
<xs:attribute name="height" type="xs:decimal" />
</xs:complexType>`;
exports.pageBreak = `<xs:complexType name="PageBreak" />`;
//# sourceMappingURL=elements.js.map
{
"name": "abstract-document",
"version": "6.12.4",
"version": "6.12.5",
"description": "Dynamically create documents using code or JSX and render to any format",

@@ -43,3 +43,3 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-document",

},
"gitHead": "b9f791d809bfd9b80c25852c7a52fc40a4bae868"
"gitHead": "e4891b3e4b5d5ecb1f90674286492267b76d80b9"
}

@@ -68,7 +68,15 @@ import { propIs } from "ramda";

TextRun: (props) => TextRun.create(props as unknown as TextRun.TextRunProps),
ImageRow: (props: ImageRowProps) => ImageRow(imageProps(images, props) as unknown as ImageRowProps, styleNames),
ImageCell: (props: ImageCellProps) => ImageCell(imageProps(images, props) as unknown as ImageCellProps, styleNames),
ImageParagraph: (props: ImageParagraphProps) =>
ImageParagraph(imageProps(images, props) as unknown as ImageParagraphProps, styleNames),
Image: (props: Record<string, unknown>) => Image.create(imageProps(images, props)),
ImageRow: (props: ImageRowProps) => {
mutateImageProps(images, props);
return ImageRow(props, styleNames);
},
ImageCell: (props: ImageCellProps) => {
return ImageCell(props, styleNames);
},
ImageParagraph: (props: ImageParagraphProps) => {
return ImageParagraph(props, styleNames);
},
Image: (props: Record<string, unknown>) => {
return Image.create(props as unknown as Image.ImageProps);
},
Table: (props, children: ReadonlyArray<TableRow.TableRow>) =>

@@ -260,9 +268,8 @@ Table.create(props as unknown as Table.TableProps, children),

function imageProps(images: Record<string, ImageResource>, props: Record<string, unknown>): Image.ImageProps {
const newProps = { ...props, width: props.width, height: props.height, imageResource: props.src };
function mutateImageProps(images: Record<string, ImageResource>, props: Record<string, unknown>): void {
const image = images[(props.src as string) ?? ""];
if (image) {
if (image.width && image.height) {
newProps.width = image.width;
newProps.height = image.height;
props.width = image.width;
props.height = image.height;
} else {

@@ -272,10 +279,10 @@ const scaleX = (props.width as number) / image.abstractImage.size.width;

if (scaleX < scaleY) {
newProps.height = (props.height as number) * (scaleX / scaleY);
props.height = (props.height as number) * (scaleX / scaleY);
} else {
newProps.width = (props.width as number) * (scaleY / scaleX);
props.width = (props.width as number) * (scaleY / scaleX);
}
}
newProps.imageResource = props.src as string;
props.imageResource = images[props.src as string];
}
return newProps as unknown as Image.ImageProps;
}

@@ -204,6 +204,6 @@ import * as Custom from "./custom-elements";

<xs:attribute name="src" type="xs:string" use="required" />
<xs:attribute name="width" type="xs:decimal" use="required" />
<xs:attribute name="height" type="xs:decimal" use="required" />
<xs:attribute name="width" type="xs:decimal" />
<xs:attribute name="height" type="xs:decimal" />
</xs:complexType>`;
export const pageBreak = `<xs:complexType name="PageBreak" />`;

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

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

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

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

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

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc