ts-d2 0.0.4 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Border/index.ts","../src/Color/index.ts","../src/Connection/index.ts","../src/Content/Barcode/index.ts","../src/Content/DocumentElement/index.ts","../src/Measure/index.ts","../src/Measure/Measure.ts","../src/Content/ReferencePoint/index.ts","../src/Content/ColumnDefinition/index.ts","../src/Content/Directory/index.ts","../src/Content/Text/index.ts","../src/Content/BranchDocumentElement/index.ts","../src/Content/Document/index.ts","../src/OutputFormat/index.ts","../src/Content/Footer/index.ts","../src/Content/Header/index.ts","../src/Content/PageDefinition/index.ts","../src/ParagraphFormat/index.ts","../src/Content/SpaceVertically/index.ts","../src/Font/index.ts","../src/Content/Formatted/index.ts","../src/Content/Linebreak/index.ts","../src/Content/Pagebreak/index.ts","../src/Content/Paragraph/index.ts","../src/Content/Span/index.ts","../src/Content/Table/index.ts","../src/Content/TableCell/index.ts","../src/Content/TableRow/index.ts","../src/Content/index.ts","../src/index.ts"],"sourcesContent":["import Proto from \"docframe-types\";\nimport { Color } from \"~/Color\";\nimport { AbsoluteMeasure, Sides } from \"~/Measure\";\n\nexport class Border {\n width: AbsoluteMeasure;\n color: Color;\n\n constructor(width: AbsoluteMeasure, color: Color) {\n this.width = width;\n this.color = color;\n }\n\n public toDocFrame(): Proto.ProtoBorder {\n return new Proto.ProtoBorder({\n weight: this.width.toDocFrame(),\n color: this.color.toDocFrame(),\n });\n }\n}\n\nexport class SideBorders {\n value: Sides<Border>;\n\n constructor(settings: Sides<Border>) {\n this.value = settings;\n }\n\n public toDocFrame(): Proto.ProtoSideBorders {\n return new Proto.ProtoSideBorders({\n top: this.value.top?.toDocFrame(),\n right: this.value.right?.toDocFrame(),\n bottom: this.value.bottom?.toDocFrame(),\n left: this.value.left?.toDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nexport class Color {\n private color: Proto.ProtoColor;\n\n static rgb(r: number, g: number, b: number): Color {\n if (r < 0 || r > 255) {\n throw new Error(`Invalid red value: ${r}`);\n }\n\n if (g < 0 || g > 255) {\n throw new Error(`Invalid green value: ${g}`);\n }\n\n if (b < 0 || b > 255) {\n throw new Error(`Invalid blue value: ${b}`);\n }\n\n return new Color(Proto.ProtoColor.create({\n type: Proto.ProtoColorType.RGB,\n r,\n g,\n b,\n }));\n }\n\n static cmyk(c: number, m: number, y: number, k: number): Color {\n if (c < 0 || c > 100) {\n throw new Error(`Invalid cyan value: ${c}`);\n }\n\n if (m < 0 || m > 100) {\n throw new Error(`Invalid magenta value: ${m}`);\n }\n\n if (y < 0 || y > 100) {\n throw new Error(`Invalid yellow value: ${y}`);\n }\n\n if (k < 0 || k > 100) {\n throw new Error(`Invalid black value: ${k}`);\n }\n\n return new Color(Proto.ProtoColor.create({\n type: Proto.ProtoColorType.CMYK,\n c,\n m,\n y,\n k,\n }));\n }\n\n static fromHex(hex: string): Color {\n if (hex.startsWith(\"#\")) {\n hex = hex.slice(1);\n }\n\n if (hex.length !== 6) {\n throw new Error(`Invalid hex color: ${hex}`);\n }\n\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n\n return new Color(Proto.ProtoColor.create({\n type: Proto.ProtoColorType.RGB,\n r,\n g,\n b,\n }));\n }\n\n private constructor(color: Proto.ProtoColor) {\n this.color = color;\n }\n\n\n public toDocFrame(): Proto.ProtoColor {\n return this.color;\n }\n}\n\nexport namespace Colors {\n export const white = Color.rgb(255, 255, 255);\n\n export const black = Color.cmyk(0, 0, 0, 100);\n}\n","import axios from \"axios\";\nimport FormData from \"form-data\";\nimport dotenv from \"dotenv\";\n\nimport Proto from \"docframe-types\";\n\nimport { Document } from \"content/Document\";\nimport { OutputParams } from \"~/OutputFormat\";\n\n// Load environment variables from .env file\ndotenv.config();\n\nexport class Connection {\n url: string;\n token: string;\n\n constructor(url?: string, token?: string) {\n this.url = url || process.env.DOCPIPE_URL || \"http://localhost:8080\";\n this.token = token || process.env.DOCPIPE_TOKEN || \"\";\n }\n\n get docframeCallUrl() {\n return `${this.url}/api/docframe?token=${this.token}`;\n }\n\n convertTo<K extends keyof OutputParams>(\n format: K,\n doc: Document,\n outputParams?: OutputParams[K],\n jobParams?: Record<string, any>,\n ): Promise<Blob> {\n const node = doc.toDocFrame();\n\n const protoData = Proto.Node.encode(node).finish();\n\n const form = new FormData();\n\n let meta = {\n format,\n };\n\n if (outputParams) {\n meta = {\n ...meta,\n ...outputParams,\n };\n }\n\n if (jobParams) {\n meta = {\n ...meta,\n ...jobParams,\n };\n }\n\n form.append(\"meta\", JSON.stringify(meta), {\n contentType: \"application/json\",\n filename: \"meta\",\n });\n\n form.append(\"proto-data\", protoData, {\n contentType: \"application/protobuf\",\n filename: \"data.proto\",\n });\n\n return new Promise((resolve, reject) => {\n axios\n .postForm(this.docframeCallUrl, form, {\n headers: {\n ...form.getHeaders(),\n },\n responseType: \"arraybuffer\",\n })\n .then(async (res) => {\n const blob = await new Response(res.data, {\n headers: {\n \"Content-Type\": res.headers[\"content-type\"],\n },\n }).blob();\n\n resolve(blob);\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n}\n\nexport const defaultConnection = new Connection();\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\nimport { AbsoluteMeasure, Measure } from \"~/Measure\";\nimport {\n ReferencePoint,\n referencePointToDocFrame,\n} from \"content/ReferencePoint\";\n\ninterface BarcodeProperties {\n type: Proto.ProtoBarcodeType;\n x: AbsoluteMeasure;\n y: AbsoluteMeasure;\n referencePoint: ReferencePoint;\n\n /**\n * Rotation in degrees, counter-clockwise\n */\n rotation: number;\n width: AbsoluteMeasure;\n height: AbsoluteMeasure;\n data: string;\n positionAbsolute: boolean;\n}\n\nexport class Barcode extends DocumentElement {\n props: BarcodeProperties;\n\n constructor(props: BarcodeProperties) {\n super();\n\n this.props = props;\n }\n\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n barcode: Proto.ProtoBarcode.create({\n type: this.props.type,\n\n positionAbsolute: this.props.positionAbsolute,\n referencePoint: referencePointToDocFrame(this.props.referencePoint),\n x: this.props.x.toDocFrame(),\n y: this.props.y.toDocFrame(),\n rotation: this.props.rotation,\n\n width: this.props.width.toDocFrame(),\n height: this.props.height.toDocFrame(),\n padding: Measure.zero.toDocFrame(),\n\n data: this.props.data,\n }),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nexport abstract class DocumentElement {\n public abstract toDocFrame(): Proto.Node;\n}\n\nexport type Content = string | DocumentElement | (DocumentElement | string)[];\n","import { AbsoluteMeasure, Measure, SideMeasures, Sides } from \"./Measure\";\n\nexport { AbsoluteMeasure, Measure, SideMeasures, Sides };\n","import Proto from \"docframe-types\";\n\nexport type AbsoluteMeasureUnit = \"pt\" | \"cm\" | \"mm\" | \"in\" | \"px\";\n\nexport type RelativeMeasureUnit = \"%\";\nexport type MeasureUnit = AbsoluteMeasureUnit | RelativeMeasureUnit;\n\nexport class Measure<Unit = MeasureUnit> {\n readonly value: number;\n readonly unit: Unit;\n\n static zero = new Measure(0, \"pt\" as AbsoluteMeasureUnit);\n\n constructor(value: number, unit: Unit) {\n this.value = value;\n this.unit = unit;\n }\n\n public toDocFrame(): Proto.ProtoMeasure {\n switch (this.unit) {\n case \"pt\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.PT,\n });\n\n case \"cm\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.CM,\n });\n\n case \"mm\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.MM,\n });\n\n case \"in\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.IN,\n });\n\n case \"px\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.PX,\n });\n\n case \"%\":\n return new Proto.ProtoMeasure({\n value: this.value,\n mtype: Proto.ProtoMeasureType.PERCENT,\n });\n\n default:\n throw new Error(`Unknown measure unit: ${this.unit}`);\n }\n }\n}\n\nexport class AbsoluteMeasure extends Measure<AbsoluteMeasureUnit> {}\n\nexport class SideMeasures {\n value: Sides<AbsoluteMeasure>;\n\n constructor(settings: Sides<AbsoluteMeasure>) {\n this.value = settings;\n }\n\n public toDocFrame(): Proto.ProtoSideMeasures {\n return new Proto.ProtoSideMeasures({\n top: this.value.top?.toDocFrame(),\n right: this.value.right?.toDocFrame(),\n bottom: this.value.bottom?.toDocFrame(),\n left: this.value.left?.toDocFrame(),\n });\n }\n}\n\n\nexport class Sides<T> {\n top?: T;\n right?: T;\n bottom?: T;\n left?: T;\n}\n\n/*\n\n\n\nexport class RelativeMeasure extends Measure<RelativeMeasureUnit> {\n constructor(value: number) {\n super(value, \"%\");\n }\n}\n\n\n\n\n*/","import Proto from \"docframe-types\";\n\n/**\n * A ReferencePoint is used for elements like barcodes to specify the reference point\n * of an object.\n * Example:\n * When specified reference point \"top-left\", the top-left point of a barcode is positioned\n * relative to the top-left edge of the current line or page.\n */\nexport type ReferencePoint = \"top-left\" | \"top-right\" | \"center\" | \"bottom-left\" | \"bottom-right\";\n\nexport function referencePointToDocFrame(point: ReferencePoint): Proto.ProtoImageReferencePoint {\n switch (point) {\n case \"top-left\":\n return Proto.ProtoImageReferencePoint.REF_POINT_TOP_LEFT;\n\n case \"top-right\":\n return Proto.ProtoImageReferencePoint.REF_POINT_TOP_RIGHT;\n\n case \"center\":\n return Proto.ProtoImageReferencePoint.REF_POINT_CENTER;\n\n case \"bottom-left\":\n return Proto.ProtoImageReferencePoint.REF_POINT_BOTTOM_LEFT;\n\n case \"bottom-right\":\n return Proto.ProtoImageReferencePoint.REF_POINT_BOTTOM_RIGHT;\n\n default:\n throw new Error(`Unknown reference point: ${point}`);\n }\n}","import Proto from \"docframe-types\";\n\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AbsoluteMeasure } from \"~/Measure\";\n\nclass ColumnPositionMode {\n public readonly value: Proto.ProtoPositionMode;\n\n constructor(value: Proto.ProtoPositionMode) {\n this.value = value;\n }\n\n public toDocFrame(): Proto.ProtoPositionMode {\n return this.value;\n }\n}\n\nexport namespace ColumnPosition {\n export const Center = new ColumnPositionMode(Proto.ProtoPositionMode.CENTER);\n export const Left = new ColumnPositionMode(Proto.ProtoPositionMode.LEFT);\n export const Folio = new ColumnPositionMode(Proto.ProtoPositionMode.FOLIO);\n export const Right = new ColumnPositionMode(Proto.ProtoPositionMode.RIGHT);\n export const ReverseFolio = new ColumnPositionMode(\n Proto.ProtoPositionMode.REVERSE_FOLIO,\n );\n}\n\nexport interface ColumnDefinitionProperties {\n width: AbsoluteMeasure;\n position: ColumnPositionMode;\n interColumnSpace: AbsoluteMeasure;\n positionOffset: AbsoluteMeasure;\n}\n\nexport class ColumnDefinition {\n props: ColumnDefinitionProperties;\n uuid: string;\n\n constructor(props: ColumnDefinitionProperties) {\n this.props = props;\n\n this.uuid = uuidv4();\n }\n\n public toDocFrame(applyImmediate: boolean): Proto.Node[] {\n const result = [\n Proto.Node.create({\n cDef: Proto.ProtoCDef.create({\n Uuid: this.uuid,\n columSettings: Proto.ProtoColumnSettings.create({\n width: Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.width.toDocFrame(),\n }),\n positionOffset: Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.positionOffset.toDocFrame(),\n }),\n positionMode: this.props.position.toDocFrame(),\n interColumnSpace: Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.interColumnSpace.toDocFrame(),\n }),\n }),\n }),\n }),\n ];\n\n if (applyImmediate) {\n result.push(\n Proto.Node.create({\n applyCDef: Proto.ProtoApplyProtoCDef.create({\n cDefUuid: this.uuid,\n }),\n }),\n );\n }\n\n return result;\n }\n}\n\nexport const ColumnDefinitions = {\n A4: {\n Single: new ColumnDefinition({\n width: new AbsoluteMeasure(490, \"pt\"),\n position: ColumnPosition.Left,\n positionOffset: new AbsoluteMeasure(70, \"pt\"),\n interColumnSpace: new AbsoluteMeasure(30, \"pt\"),\n }),\n Double: new ColumnDefinition({\n width: new AbsoluteMeasure(230, \"pt\"),\n position: ColumnPosition.Left,\n positionOffset: new AbsoluteMeasure(70, \"pt\"),\n interColumnSpace: new AbsoluteMeasure(30, \"pt\"),\n }),\n },\n};\n","import Proto from \"docframe-types\";\n\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\n\nexport class Directory extends BranchDocumentElement {\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n directory: Proto.ProtoDirectory.create({}),\n\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\n\nexport class Text extends DocumentElement {\n constructor(content: string) {\n super();\n this.content = content;\n }\n\n public content: string;\n\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n text: Proto.ProtoText.create({\n content: this.content,\n }),\n });\n }\n}\n","import { Node } from \"docframe-types\";\nimport { Content, DocumentElement } from \"content/DocumentElement\";\nimport { Text } from \"content/Text\";\n\nexport abstract class BranchDocumentElement<P = never> extends DocumentElement {\n protected children: DocumentElement[] = [];\n protected _props?: P;\n\n constructor(children?: Content, props?: P) {\n super();\n\n this._props = props;\n\n if (children === undefined) {\n this.children = [];\n return;\n }\n\n this.children = documentElementsFromContent(children);\n }\n\n public appendChildren(children: DocumentElement[]): void {\n this.children = this.children.concat(children);\n }\n\n public appendChild(child: DocumentElement): void {\n this.children.push(child);\n }\n\n public prependChildren(children: DocumentElement[]): void {\n this.children = children.concat(this.children);\n }\n\n public prependChild(child: DocumentElement): void {\n this.children.unshift(child);\n }\n\n public childrenToDocFrame(): Node[] {\n return this.children.map((child) => child.toDocFrame());\n }\n\n set props(props: P | undefined) {\n this._props = props;\n }\n\n get props(): P | undefined {\n return this._props;\n }\n}\n\nfunction documentElementsFromContent(content: Content): DocumentElement[] {\n if (typeof content === \"string\") {\n return [new Text(content)];\n } else if (Array.isArray(content)) {\n return content.map(documentElementsFromContent).flat();\n } else {\n return [content];\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { defaultConnection } from \"~/Connection\";\nimport { OutputFormat, OutputParams } from \"~/OutputFormat\";\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\nimport { ColumnDefinition, ColumnDefinitions } from \"content/ColumnDefinition\";\nimport { Content } from \"content/DocumentElement\";\nimport { Footer } from \"content/Footer\";\nimport { Header } from \"content/Header\";\nimport { PageDefinition, PageDefinitions } from \"content/PageDefinition\";\nimport { ParagraphFormat } from \"~/ParagraphFormat\";\nimport { SpaceVertically } from \"content/SpaceVertically\";\nimport { StandardFonts } from \"~/Font\";\nimport { AbsoluteMeasure } from \"~/Measure\";\n\nexport interface DocumentProperties {\n pageDefinition: PageDefinition;\n columnDefinition: ColumnDefinition;\n\n defaultHeader?: Header;\n defaultFooter?: Footer;\n\n paragraphFormats?: Record<string, ParagraphFormat>;\n}\n\nexport class Document extends BranchDocumentElement<DocumentProperties> {\n paragraphFormats: Record<string, ParagraphFormat> = {};\n\n constructor(content?: Content, props?: DocumentProperties) {\n super(content, props);\n\n if (props === undefined) {\n this.props = {\n pageDefinition: PageDefinitions.A4,\n columnDefinition: ColumnDefinitions.A4.Single,\n defaultHeader: new Header(\n new SpaceVertically(new AbsoluteMeasure(40, \"pt\")),\n ),\n defaultFooter: new Footer(\n new SpaceVertically(new AbsoluteMeasure(40, \"pt\")),\n ),\n };\n } else {\n this.props = props;\n }\n\n this.paragraphFormats = this.props.paragraphFormats || {\n Text: new ParagraphFormat({\n font: StandardFonts.Helvetica,\n fontSize: new AbsoluteMeasure(12, \"pt\"),\n lineFeed: new AbsoluteMeasure(14, \"pt\"),\n indentionWidth: new AbsoluteMeasure(15, \"pt\"),\n name: \"Text\",\n default: true,\n }),\n };\n }\n\n getParagraphFormat(name: string): ParagraphFormat | undefined {\n return this.paragraphFormats[name];\n }\n\n registerParagraphFormat(name: string, pf: ParagraphFormat) {\n this.paragraphFormats[name] = pf;\n }\n\n convertTo<Format extends keyof OutputParams>(\n outputFormat: Format,\n outputParams?: OutputParams[Format],\n ): Promise<Blob> {\n return defaultConnection.convertTo(outputFormat, this, outputParams);\n }\n\n convertToPDF(outputParams?: OutputParams[\"pdf\"]): Promise<Blob> {\n return defaultConnection.convertTo(OutputFormat.PDF, this, outputParams);\n }\n\n /*\n public getProtoParagraphFormat(format?: ParagraphFormat): Proto.IProtoParagraphFormat {\n if (!format) {\n return this.defaultParagraphFormat;\n }\n\n if (!format.format.name) {\n throw new Error(\"ParagraphFormat must have a name\");\n }\n\n if (!this.paragraphFormats[format.format.name]) {\n this.paragraphFormats[format.format.name] = format.toDocFrame();\n }\n\n return this.paragraphFormats[format.format.name];\n }\n */\n\n public toDocFrame(): Proto.Node {\n const props = this.props!;\n\n const docSettings = Object.values(this.paragraphFormats)\n .map((pf) =>\n Proto.Node.create({\n paragraphFormat: pf.toDocFrame(),\n }),\n )\n .concat([\n Proto.Node.create({\n pDef: props.pageDefinition.toDocFrame(),\n }),\n Proto.Node.create({\n applyPDef: Proto.ProtoApplyProtoPDef.create({\n pDefUuid: props.pageDefinition.uuid,\n }),\n }),\n ...props.columnDefinition.toDocFrame(true),\n ]);\n\n if (props.defaultHeader) {\n docSettings.push(props.defaultHeader.toDocFrame());\n }\n\n if (props.defaultFooter) {\n docSettings.push(props.defaultFooter.toDocFrame());\n }\n\n const content = this.childrenToDocFrame();\n\n for (const format of Object.values(this.paragraphFormats)) {\n docSettings.push(\n Proto.Node.create({\n paragraphFormat: format.toDocFrame(),\n }),\n );\n }\n\n return Proto.Node.create({\n children: docSettings.concat(...content),\n });\n }\n}\n","enum OutputFormat {\n PDF = \"pdf\",\n PNG = \"png\",\n JPEG = \"jpeg\",\n HTML = \"html\",\n PS = \"ps\",\n TEXT = \"text\",\n}\n\ntype OutputParams = {\n [OutputFormat.HTML]: {};\n [OutputFormat.PDF]: {};\n [OutputFormat.JPEG]: {};\n [OutputFormat.PS]: {};\n [OutputFormat.TEXT]: {};\n [OutputFormat.PNG]: {\n /**\n * The width of the output in pixels.\n * @default The width of the document in pixels.\n */\n width?: number;\n\n /**\n * The height of the output in pixels.\n * @default The height of the document in pixels.\n */\n height?: number;\n\n /**\n * The resolution of the output in pixels per inch.\n * @default 300 dpi.\n */\n dpi?: number;\n };\n}\n\nexport {\n OutputFormat,\n OutputParams,\n}","import { BranchDocumentElement } from \"content/BranchDocumentElement\";\n\nimport Proto from \"docframe-types\";\n\nexport class Footer extends BranchDocumentElement {\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n footer: Proto.ProtoFooter.create(),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import { BranchDocumentElement } from \"content/BranchDocumentElement\";\n\nimport Proto from \"docframe-types\";\n\nexport class Header extends BranchDocumentElement<never> {\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n header: Proto.ProtoHeader.create(),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\nimport { v4 } from \"uuid\";\nimport { AbsoluteMeasure } from \"~/Measure\";\n\nexport class PageDefinition {\n width?: AbsoluteMeasure;\n height?: AbsoluteMeasure;\n uuid: string;\n\n constructor(width?: AbsoluteMeasure, height?: AbsoluteMeasure) {\n this.width = width;\n this.height = height;\n\n this.uuid = v4();\n }\n\n public toDocFrame(): Proto.ProtoPDef {\n return new Proto.ProtoPDef({\n pageDepth: new Proto.ProtoBoxedMeasure({\n isNull: this.height === undefined,\n value: this.height?.toDocFrame(),\n }),\n pageWidth: new Proto.ProtoBoxedMeasure({\n isNull: this.width === undefined,\n value: this.width?.toDocFrame(),\n }),\n Uuid: this.uuid,\n });\n }\n}\n\nexport namespace PageDefinitions {\n export const A3 = new PageDefinition(\n new AbsoluteMeasure(297, \"mm\"),\n new AbsoluteMeasure(420, \"mm\"),\n );\n\n export const A4 = new PageDefinition(\n new AbsoluteMeasure(210, \"mm\"),\n new AbsoluteMeasure(297, \"mm\"),\n );\n\n export const A5 = new PageDefinition(\n new AbsoluteMeasure(148, \"mm\"),\n new AbsoluteMeasure(210, \"mm\"),\n );\n}\n","import Proto, { IProtoParagraphFormat } from \"docframe-types\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AbsoluteMeasure } from \"~/Measure\";\nimport { Font } from \"~/Font\";\nimport { HorizontalAlignment } from \"~/Alignment\";\n\nexport interface ParagraphFormatProperties {\n default?: boolean;\n name?: string;\n\n alignment?: HorizontalAlignment;\n\n font?: Font;\n fontSize?: AbsoluteMeasure;\n characterWidth?: AbsoluteMeasure;\n characterSpacing?: AbsoluteMeasure;\n lineFeed?: AbsoluteMeasure;\n bold?: boolean;\n italic?: boolean;\n\n indentionLevel?: number;\n indentionWidth?: AbsoluteMeasure;\n\n spaceAbove?: AbsoluteMeasure;\n spaceBelow?: AbsoluteMeasure;\n}\n\nexport class ParagraphFormat {\n props: ParagraphFormatProperties;\n\n constructor(props: ParagraphFormatProperties) {\n this.props = props;\n\n this.props.name = props.name || uuidv4();\n }\n\n public toDocFrame(): Proto.IProtoParagraphFormat {\n let format: IProtoParagraphFormat = {\n default: Proto.ProtoBoxedBool.create({\n isNull: false,\n value: this.props.default || false,\n }),\n name: Proto.ProtoBoxedString.create({\n isNull: false,\n value: this.props.name,\n }),\n };\n\n if (this.props.alignment) {\n format.alignment = Proto.ProtoBoxedHorizontalAlignment.create({\n isNull: false,\n value: this.props.alignment.toDocFrame(),\n });\n }\n\n if (this.props.font) {\n format.font = Proto.ProtoBoxedFont.create({\n isNull: false,\n value: this.props.font.toDocFrame(),\n });\n }\n\n if (this.props.fontSize) {\n format.fontSize = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.fontSize.toDocFrame(),\n });\n }\n\n if (this.props.characterWidth) {\n format.characterWidth = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.characterWidth.toDocFrame(),\n });\n }\n\n if (this.props.characterSpacing) {\n format.characterSpacing = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.characterSpacing.toDocFrame(),\n });\n }\n\n if (this.props.lineFeed) {\n format.lineFeed = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.lineFeed.toDocFrame(),\n });\n }\n\n if (this.props.indentionLevel !== undefined) {\n format.indentionLevel = Proto.ProtoBoxedInt32.create({\n isNull: false,\n value: this.props.indentionLevel,\n });\n }\n\n if (this.props.indentionWidth) {\n format.indentionWidth = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.indentionWidth.toDocFrame(),\n });\n }\n\n if (this.props.bold !== undefined) {\n format.bold = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: !!this.props.bold,\n });\n }\n\n if (this.props.italic !== undefined) {\n format.italic = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: !!this.props.italic,\n });\n }\n\n if (this.props.spaceAbove) {\n format.spaceAbove = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.spaceAbove.toDocFrame(),\n });\n }\n\n if (this.props.spaceBelow) {\n format.spaceBelow = Proto.ProtoBoxedMeasure.create({\n isNull: false,\n value: this.props.spaceBelow.toDocFrame(),\n });\n }\n\n return Proto.ProtoParagraphFormat.create(format);\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\nimport { AbsoluteMeasure } from \"~/Measure\";\n\nexport class SpaceVertically extends DocumentElement {\n space: AbsoluteMeasure;\n\n constructor(space: AbsoluteMeasure) {\n super();\n\n this.space = space;\n }\n\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n spaceVertically: Proto.ProtoSpaceVertically.create({\n space: this.space.toDocFrame(),\n }),\n });\n }\n}\n","import { ProtoFont } from \"docframe-types\";\n\nexport class Font {\n private name: string;\n\n constructor(name: string) {\n this.name = name;\n }\n\n public toDocFrame(): ProtoFont {\n return ProtoFont.create({\n name: this.name,\n // TODO: suppot font mapping for docframe step\n id: 5\n });\n }\n}\n\nexport const StandardFonts = {\n Helvetica: new Font(\"helvetica\"),\n};\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\n\nexport class Formatted extends DocumentElement {\n constructor(doctypeContent: string | undefined, htmlContent?: string) {\n super();\n this.content = {\n doctype: doctypeContent,\n html: htmlContent,\n };\n }\n\n public content: {\n doctype: string | undefined;\n html: string | undefined;\n };\n\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n formatted: Proto.ProtoFormatted.create({\n doctypeContent: this.content.doctype,\n htmlContent: this.content.html,\n }),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\n\nexport class Linebreak extends DocumentElement {\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n linebreak: Proto.ProtoLinebreak.create({}),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { DocumentElement } from \"content/DocumentElement\";\n\nexport class Pagebreak extends DocumentElement {\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n newPage: Proto.ProtoNewPage.create({}),\n });\n }\n}\n","import { BranchDocumentElement } from \"content/BranchDocumentElement\";\n\nimport Proto from \"docframe-types\";\nimport { ParagraphFormat } from \"~/ParagraphFormat\";\nimport { Content } from \"content/DocumentElement\";\n\nexport interface ParagraphSettings {\n paragraphFormatName?: string;\n overwrite?: ParagraphFormat;\n}\n\nexport class Paragraph extends BranchDocumentElement<ParagraphSettings> {\n constructor(\n content?: Content,\n paragraphFormatName?: string | ParagraphFormat,\n overwrite?: ParagraphFormat,\n ) {\n super(content, {\n overwrite,\n paragraphFormatName:\n typeof paragraphFormatName === \"string\"\n ? paragraphFormatName\n : paragraphFormatName?.props?.name,\n });\n }\n\n public toDocFrame(): Proto.Node {\n const par = {} as Proto.IProtoParagraph;\n\n if (this.props!.overwrite) {\n par.overwrite = this.props!.overwrite.toDocFrame();\n }\n\n if (this.props!.paragraphFormatName) {\n par.format = Proto.ProtoParagraphFormat.create({\n name: Proto.ProtoBoxedString.create({\n isNull: false,\n value: this.props!.paragraphFormatName,\n }),\n });\n }\n\n return Proto.Node.create({\n paragraph: Proto.ProtoParagraph.create(par),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\nimport { Content } from \"content/DocumentElement\";\n\nexport interface SpanProperties {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n}\n\nexport class Span extends BranchDocumentElement<SpanProperties> {\n constructor(content?: Content, props?: SpanProperties) {\n super(content, props || {});\n }\n\n public toDocFrame(): Proto.Node {\n let bold: Proto.ProtoBoxedBool | undefined = undefined;\n if (this.props?.bold !== undefined) {\n bold = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: this.props.bold,\n });\n }\n\n let italic: Proto.ProtoBoxedBool | undefined = undefined;\n if (this.props?.italic !== undefined) {\n italic = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: this.props.italic,\n });\n }\n\n let underline: Proto.ProtoBoxedBool | undefined = undefined;\n if (this.props?.underline !== undefined) {\n underline = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: this.props.underline,\n });\n }\n\n let strikethrough: Proto.ProtoBoxedBool | undefined = undefined;\n if (this.props?.strikethrough !== undefined) {\n strikethrough = Proto.ProtoBoxedBool.create({\n isNull: false,\n value: this.props.strikethrough,\n });\n }\n\n return Proto.Node.create({\n span: Proto.ProtoSpan.create({\n bold: bold,\n italic: italic,\n underline: underline,\n strikethrough: strikethrough,\n }),\n\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\nimport { Content } from \"content/DocumentElement\";\nimport { Measure } from \"~/Measure\";\n\nexport interface TableSettings {\n width?: Measure;\n xOffset?: Measure;\n}\n\nexport class Table extends BranchDocumentElement<TableSettings> {\n constructor(content?: Content, props?: TableSettings) {\n super(content, props || {});\n if (!this.props!.xOffset) {\n this.props!.xOffset = Measure.zero;\n }\n }\n\n public toDocFrame(): Proto.Node {\n const props = this.props!;\n\n return Proto.Node.create({\n table: Proto.ProtoTable.create({\n settings: Proto.ProtoTableSettings.create({\n width: props.width?.toDocFrame(),\n leftMeasure: Proto.ProtoBoxedBool.create({\n isNull: false,\n value: false,\n }),\n xOffset: props.xOffset?.toDocFrame(),\n }),\n }),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\nimport { Content } from \"content/DocumentElement\";\nimport { Measure, SideMeasures } from \"~/Measure\";\nimport { HorizontalAlignment, VerticalAlignment } from \"~/Alignment\";\nimport { Color } from \"~/Color\";\nimport { SideBorders } from \"~/Border\";\n\nexport interface TableCellProperties {\n alignment?: HorizontalAlignment;\n backgroundColor?: Color;\n border?: SideBorders;\n margin?: SideMeasures;\n padding?: SideMeasures;\n verticalAlignment?: VerticalAlignment;\n width?: Measure;\n}\n\nexport class TableCell extends BranchDocumentElement<TableCellProperties> {\n constructor(content?: Content, props?: TableCellProperties) {\n super(content, props || {});\n }\n\n public toDocFrame(): Proto.Node {\n const props = this.props!;\n\n return Proto.Node.create({\n tableCell: Proto.ProtoTableCell.create({\n settings: Proto.ProtoTableCellSettings.create({\n align: Proto.ProtoBoxedHorizontalAlignment.create({\n isNull: false,\n value:\n props!.alignment?.toDocFrame() ||\n Proto.ProtoHorizontalAlignment.ALIGN_LEFT,\n }),\n backgroundColor: props.backgroundColor?.toDocFrame(),\n border: props.border?.toDocFrame(),\n margin: props.margin?.toDocFrame(),\n padding: props.padding?.toDocFrame(),\n valign: Proto.ProtoBoxedVerticalAlignment.create({\n isNull: false,\n value:\n props.verticalAlignment?.toDocFrame() ||\n Proto.ProtoVerticalAlignment.TOP,\n }),\n width: props.width?.toDocFrame(),\n }),\n }),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import Proto from \"docframe-types\";\n\nimport { BranchDocumentElement } from \"content/BranchDocumentElement\";\nimport { Content } from \"content/DocumentElement\";\nimport { AbsoluteMeasure } from \"~/Measure\";\n\nexport interface TableRowProperties {\n minHeight?: AbsoluteMeasure;\n}\n\nexport class TableRow extends BranchDocumentElement<TableRowProperties> {\n constructor(content?: Content, props?: TableRowProperties) {\n super(content, props || {});\n }\n\n public toDocFrame(): Proto.Node {\n return Proto.Node.create({\n tableRow: Proto.ProtoTableRow.create({\n settings: Proto.ProtoTableRowSettings.create({\n minHeight: this.props!.minHeight?.toDocFrame(),\n }),\n }),\n children: this.childrenToDocFrame(),\n });\n }\n}\n","import { Barcode } from \"./Barcode\";\nimport { ColumnDefinition, ColumnPosition } from \"./ColumnDefinition\";\nimport { Directory } from \"./Directory\";\nimport { Document } from \"./Document\";\nimport { Footer } from \"./Footer\";\nimport { Formatted } from \"./Formatted\";\nimport { Header } from \"./Header\";\nimport { Linebreak } from \"./Linebreak\";\nimport { Pagebreak } from \"./Pagebreak\";\nimport { PageDefinition } from \"./PageDefinition\";\nimport { Paragraph } from \"./Paragraph\";\nimport { SpaceVertically } from \"./SpaceVertically\";\nimport { Span } from \"./Span\";\nimport { Table } from \"./Table\";\nimport { TableCell } from \"./TableCell\";\nimport { TableRow } from \"./TableRow\";\nimport { Text } from \"./Text\";\n\nexport default {\n Barcode,\n ColumnDefinition,\n ColumnPosition,\n Directory,\n Document,\n Footer,\n Formatted,\n Header,\n Linebreak,\n Pagebreak,\n PageDefinition,\n Paragraph,\n SpaceVertically,\n Span,\n Table,\n TableCell,\n TableRow,\n Text,\n};\n","import { Border, SideBorders } from \"./Border\";\nimport { Color, Colors } from \"./Color\";\nimport { Connection } from \"./Connection\";\nimport Content from \"./Content\";\nimport { Font, StandardFonts } from \"./Font\";\nimport * as Measure from \"./Measure\";\nimport * as Output from \"./OutputFormat\";\nimport { ParagraphFormat } from \"./ParagraphFormat\";\n\nexport default {\n Border: {\n Border,\n SideBorders,\n },\n Color: {\n Color,\n Colors,\n },\n Connection,\n Content,\n Font: {\n Font,\n St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AAAA,MACH,CAAC;AAAA,MACD,UAAU,KAAK,mBAAmB;AAAA,IACpC,CAAC;AAAA,EACH;AACF;;;ACpDA,OAAOC,aAAW;AAUX,IAAM,WAAN,cAAuB,sBAA0C;AAAA,EACtE,YAAY,SAAmB,OAA4B;AACzD,UAAM,SAAS,SAAS,CAAC,CAAC;AAAA,EAC5B;AAAA,EAEO,aAAyB;AAflC;AAgBI,WAAOC,QAAM,KAAK,OAAO;AAAA,MACvB,UAAUA,QAAM,cAAc,OAAO;AAAA,QACnC,UAAUA,QAAM,sBAAsB,OAAO;AAAA,UAC3C,YAAW,UAAK,MAAO,cAAZ,mBAAuB;AAAA,QACpC,CAAC;AAAA,MACH,CAAC;AAAA,MACD,UAAU,KAAK,mBAAmB;AAAA,IACpC,CAAC;AAAA,EACH;AACF;;;ACPA,IAAO,kBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AC5BA,IAAO,gBAAQ;AAAA,EACb,QAAQ;AAAA,IACN;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["Proto","Colors","Proto","Proto","Proto","Proto","Proto","Proto","ColumnPosition","Proto","Proto","Proto","Proto","Proto","Proto","OutputFormat","Proto","Proto","Proto","Proto","PageDefinitions","Proto","uuidv4","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto","Proto"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-d2",
3
- "version": "0.0.4",
3
+ "version": "0.0.20",
4
4
  "description": "Deuterium is a TypeScript library for professional output creation.",
5
5
  "keywords": [
6
6
  "pdf",
@@ -20,61 +20,53 @@
20
20
  "url": "git+https://github.com/documatrix/ts-d2.git"
21
21
  },
22
22
  "license": "MIT",
23
+ "type": "module",
23
24
  "author": "DocuMatrix GmbH",
24
- "main": "dist/index.js",
25
- "module": "dist/index.esm.js",
26
- "typings": "dist/index.d.ts",
27
- "files": [
28
- "dist"
29
- ],
25
+ "engines": {
26
+ "node": ">=18.17.0"
27
+ },
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "require": "./dist/index.cjs"
36
+ }
37
+ },
30
38
  "scripts": {
31
- "build": "cross-env NODE_ENV=production tsup-node",
32
- "build:dev": " cross-env NODE_ENV=development tsup-node",
39
+ "build": "tsup",
40
+ "dev": "tsup --watch",
33
41
  "format": "dprint fmt",
34
42
  "lint": "eslint src --ext .ts",
35
- "prepare": "husky",
36
- "test": "jest",
37
- "prepublish": "npm run build"
43
+ "prepublish": "npm run build",
44
+ "test": "vitest"
38
45
  },
46
+ "files": [
47
+ "dist"
48
+ ],
39
49
  "husky": {
40
50
  "hooks": {
41
- "pre-commit": "pnpm format && pnpm lint",
51
+ "pre-commit": "npm format && npm lint",
42
52
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
43
53
  }
44
54
  },
45
- "commitlint": {
46
- "extends": [
47
- "@commitlint/config-conventional"
48
- ]
49
- },
50
55
  "devDependencies": {
51
- "@babel/preset-typescript": "^7.26.0",
52
- "@commitlint/cli": "19.8.0",
53
- "@commitlint/config-conventional": "19.8.0",
54
- "@jest/globals": "^29.5.0",
55
- "@swc/core": "^1.11.9",
56
- "@swc/helpers": "^0.5.15",
57
- "@types/jest": "^29.5.14",
58
- "@types/node": "22.13.10",
59
56
  "@types/uuid": "^10.0.0",
60
- "typescript-eslint": "8.26.1",
61
- "cross-env": "^7.0.3",
62
- "dotenv": "16.4.7",
63
- "dprint": "^0.49.0",
64
- "esbuild": "0.25.1",
65
- "eslint": "9.22.0",
57
+ "dprint": "^0.51.1",
58
+ "eslint": "10.0.1",
66
59
  "husky": "^9.1.7",
67
- "jest": "^29.7.0",
68
- "semantic-release": "24.2.3",
69
- "ts-jest": "^29.2.6",
70
- "tslib": "2.8.1",
71
- "tsup": "8.4.0",
72
- "typescript": "5.8.2"
60
+ "tsup": "8.5.1",
61
+ "typescript": "5.9.3",
62
+ "vitest": "^4.0.18"
73
63
  },
74
64
  "dependencies": {
75
- "axios": "^1.8.3",
76
- "docframe-types": "^0.4.2",
77
- "form-data": "^4.0.2",
78
- "uuid": "^11.1.0"
65
+ "axios": "^1.13.5",
66
+ "docframe-types": "^0.7.4",
67
+ "dotenv": "^17.3.1",
68
+ "form-data": "^4.0.5",
69
+ "tslib": "^2.8.1",
70
+ "uuid": "^13.0.0"
79
71
  }
80
72
  }