@pdfme/jsx 6.1.1-dev.18 → 6.1.1-dev.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.
- package/README.md +1 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ it provides its own `jsx-runtime` and `jsx-dev-runtime`.
|
|
|
30
30
|
|
|
31
31
|
- `Text` and `MultiVariableText` heights are measured with pdfme's text/rich text wrapping helpers
|
|
32
32
|
when `height` is omitted. Pass an explicit `height` when you need a fixed field box.
|
|
33
|
+
- `Text textFormat="inline-markdown"` is read-only only. Editable `Text` values use plain content.
|
|
33
34
|
- `MultiVariableText` uses `text` or children as the template string and stores `values` as the
|
|
34
35
|
JSON input. Variable names are inferred from `{name}` placeholders and can also be passed with
|
|
35
36
|
`variables`.
|
package/dist/index.js
CHANGED
|
@@ -265,8 +265,10 @@ var renderText = async (props, frame, ctx) => {
|
|
|
265
265
|
const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;
|
|
266
266
|
const width = props.width ?? frame.width;
|
|
267
267
|
const value = childrenToString(props.children);
|
|
268
|
-
const name = resolveName(ctx, "text", props.name);
|
|
269
268
|
const readOnly = props.readOnly ?? props.name == null;
|
|
269
|
+
const textFormat = props.textFormat ?? "plain";
|
|
270
|
+
if (!readOnly && textFormat === "inline-markdown") throw new Error("@pdfme/jsx: editable <Text> does not support textFormat=\"inline-markdown\". Use read-only <Text> or <MultiVariableText>.");
|
|
271
|
+
const name = resolveName(ctx, "text", props.name);
|
|
270
272
|
const schema = {
|
|
271
273
|
name,
|
|
272
274
|
type: "text",
|
|
@@ -289,7 +291,7 @@ var renderText = async (props, frame, ctx) => {
|
|
|
289
291
|
characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,
|
|
290
292
|
fontColor: props.color ?? DEFAULT_FONT_COLOR,
|
|
291
293
|
backgroundColor: props.background ?? "",
|
|
292
|
-
textFormat
|
|
294
|
+
textFormat,
|
|
293
295
|
overflow: props.overflow,
|
|
294
296
|
strikethrough: props.strikethrough ?? false,
|
|
295
297
|
underline: props.underline ?? false
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/components.ts","../src/render.ts"],"sourcesContent":["import { createElementNode } from './node.js';\nimport type {\n BoxProps,\n EllipseProps,\n ImageProps,\n LineProps,\n ListProps,\n MultiVariableTextProps,\n PageBreakProps,\n PageProps,\n RectangleProps,\n RowProps,\n SpacerProps,\n StackProps,\n SvgProps,\n TableProps,\n TextProps,\n} from './types.js';\n\nconst makeBuiltin =\n <Props extends Record<string, unknown>, K extends Parameters<typeof createElementNode>[0]>(\n kind: K,\n ) =>\n (props: Props): ReturnType<typeof createElementNode<K>> =>\n createElementNode(kind, props);\n\nexport const Page = makeBuiltin<PageProps, 'page'>('page');\nexport const Stack = makeBuiltin<StackProps, 'stack'>('stack');\nexport const Row = makeBuiltin<RowProps, 'row'>('row');\nexport const Box = makeBuiltin<BoxProps, 'box'>('box');\nexport const Spacer = makeBuiltin<SpacerProps, 'spacer'>('spacer');\nexport const Text = makeBuiltin<TextProps, 'text'>('text');\nexport const MultiVariableText = makeBuiltin<MultiVariableTextProps, 'multiVariableText'>(\n 'multiVariableText',\n);\nexport const Image = makeBuiltin<ImageProps, 'image'>('image');\nexport const Svg = makeBuiltin<SvgProps, 'svg'>('svg');\nexport const Rectangle = makeBuiltin<RectangleProps, 'rectangle'>('rectangle');\nexport const Ellipse = makeBuiltin<EllipseProps, 'ellipse'>('ellipse');\nexport const Line = makeBuiltin<LineProps, 'line'>('line');\nexport const List = makeBuiltin<ListProps, 'list'>('list');\nexport const Table = makeBuiltin<TableProps, 'table'>('table');\nexport const PageBreak = (props?: PageBreakProps) => createElementNode('pagebreak', props);\n","import { getDefaultFont, pt2mm, resolvePageSize } from '@pdfme/common';\nimport type { Font, Schema, Template } from '@pdfme/common';\nimport type {\n CellStyle as SchemaCellStyle,\n ImageSchema,\n LineSchema,\n ListSchema,\n MultiVariableTextSchema,\n ShapeSchema,\n SVGSchema,\n TableSchema,\n TextSchema,\n} from '@pdfme/schemas/types';\nimport {\n escapeInlineMarkdown,\n getVariableNames,\n measureTextHeight,\n visitVariables,\n} from '@pdfme/schemas/utils';\nimport { cloneElementWithChildren, isPdfJsxElement, isPdfJsxFragment } from './node.js';\nimport type {\n BoxProps,\n BoxSides,\n CellStyle,\n EllipseProps,\n ImageProps,\n LineProps,\n ListProps,\n MultiVariableTextProps,\n MultiVariableTextValues,\n PageProps,\n PdfJsxChild,\n PdfJsxElement,\n RectangleProps,\n RenderOptions,\n RenderResult,\n RowProps,\n SpacerProps,\n StackProps,\n SvgProps,\n TableProps,\n TextProps,\n} from './types.js';\n\ntype Rect = { x: number; y: number; width: number; height: number };\n\ntype RenderCtx = {\n schemas: Schema[];\n inputs: Record<string, string>;\n usedNames: Set<string>;\n nameCounters: Record<string, number>;\n defaultFont?: string;\n font: Font;\n _cache: Map<string | number, unknown>;\n};\n\nconst DEFAULT_FONT_SIZE = 10;\nconst DEFAULT_LINE_HEIGHT = 1;\nconst DEFAULT_CHARACTER_SPACING = 0;\nconst DEFAULT_FONT_COLOR = '#000000';\nconst DEFAULT_VISUAL_HEIGHT = 40;\nconst DEFAULT_LINE_THICKNESS = 0.5;\nconst DEFAULT_LINE_COLOR = '#000000';\nconst DEFAULT_SHAPE_BORDER_COLOR = '#000000';\nconst DEFAULT_DYNAMIC_FONT_SIZE = {\n min: 4,\n max: 72,\n fit: 'vertical',\n} as const satisfies NonNullable<TextSchema['dynamicFontSize']>;\n\nexport const renderToTemplate = async (\n node: PdfJsxChild,\n options: RenderOptions = {},\n): Promise<RenderResult> => {\n validatePageBreakPlacement(node);\n const expanded = expandPageBreaks(node);\n const pages = flattenChildren(expanded).filter(\n (child): child is PdfJsxElement<'page'> => isPdfJsxElement(child) && child.kind === 'page',\n );\n\n if (pages.length === 0) {\n throw new Error('@pdfme/jsx: renderToTemplate root must contain at least one <Page>.');\n }\n\n const firstPageProps = pages[0]?.props as PageProps;\n const firstMargin = resolveBoxSides(firstPageProps.margin);\n const pageSize = resolvePageSize(firstPageProps.size, firstPageProps.orientation);\n validateConsistentPageProps(pages, pageSize, firstMargin);\n const inputs: Record<string, string> = {};\n const usedNames = new Set<string>();\n const nameCounters: Record<string, number> = {};\n const font = options.font ?? getDefaultFont();\n const _cache = new Map<string | number, unknown>();\n const pageSchemas: Schema[][] = [];\n\n for (const page of pages) {\n const props = page.props as PageProps;\n const margin = resolveBoxSides(props.margin);\n const frame = {\n x: margin.left,\n y: margin.top,\n width: pageSize.width - margin.left - margin.right,\n height: pageSize.height - margin.top - margin.bottom,\n };\n const ctx: RenderCtx = {\n schemas: [],\n inputs,\n usedNames,\n nameCounters,\n defaultFont: props.font,\n font,\n _cache,\n };\n await layoutChildren(page.children, frame, 'stack', { gap: 0 }, ctx);\n pageSchemas.push(ctx.schemas);\n }\n\n const template: Template = {\n basePdf: options.basePdf ?? {\n width: pageSize.width,\n height: pageSize.height,\n padding: [firstMargin.top, firstMargin.right, firstMargin.bottom, firstMargin.left],\n },\n schemas: pageSchemas,\n };\n\n return { template, inputs: [inputs] };\n};\n\nconst flattenChildren = (\n children: PdfJsxChild | PdfJsxChild[],\n): (PdfJsxElement | string | number)[] => {\n if (children == null || children === false || children === true) return [];\n if (typeof children === 'string' || typeof children === 'number') return [children];\n if (Array.isArray(children)) return children.flatMap((child) => flattenChildren(child));\n if (isPdfJsxFragment(children)) return flattenChildren(children.children);\n if (isPdfJsxElement(children)) return [children];\n return [];\n};\n\nconst childrenToString = (children: PdfJsxChild | PdfJsxChild[]): string =>\n flattenChildren(children)\n .map((child) => {\n if (typeof child === 'string' || typeof child === 'number') return String(child);\n return childrenToString(child.children);\n })\n .join('');\n\nconst splitChildrenByPageBreak = (children: PdfJsxChild | PdfJsxChild[]): PdfJsxChild[][] => {\n const segments: PdfJsxChild[][] = [[]];\n\n for (const child of flattenForSplitting(children)) {\n if (isPdfJsxElement(child) && child.kind === 'pagebreak') {\n segments.push([]);\n continue;\n }\n\n if (\n isPdfJsxElement(child) &&\n (child.kind === 'page' || child.kind === 'stack' || child.kind === 'box')\n ) {\n const childSegments = splitChildrenByPageBreak(child.children);\n if (childSegments.length === 1) {\n segments[segments.length - 1]?.push(child);\n continue;\n }\n\n segments[segments.length - 1]?.push(cloneElementWithChildren(child, childSegments[0] ?? []));\n for (let i = 1; i < childSegments.length; i += 1) {\n segments.push([cloneElementWithChildren(child, childSegments[i] ?? [])]);\n }\n continue;\n }\n\n segments[segments.length - 1]?.push(child);\n }\n\n return segments;\n};\n\nconst flattenForSplitting = (children: PdfJsxChild | PdfJsxChild[]): PdfJsxChild[] => {\n if (children == null || children === false || children === true) return [];\n if (Array.isArray(children)) return children.flatMap((child) => flattenForSplitting(child));\n if (isPdfJsxFragment(children)) return flattenForSplitting(children.children);\n return [children];\n};\n\nconst expandPageBreaks = (node: PdfJsxChild): PdfJsxChild[] =>\n splitChildrenByPageBreak(node).flat();\n\nconst layoutChildren = async (\n children: PdfJsxChild | PdfJsxChild[],\n frame: Rect,\n mode: 'stack' | 'row',\n opts: { gap: number },\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const items = flattenChildren(children);\n const widths = mode === 'row' ? resolveRowWidths(items, frame.width, opts.gap) : undefined;\n let cursor = 0;\n let crossMax = 0;\n\n for (let i = 0; i < items.length; i += 1) {\n const child = items[i];\n const width = mode === 'row' ? (widths?.[i] ?? 0) : frame.width;\n const childFrame =\n mode === 'stack'\n ? { x: frame.x, y: frame.y + cursor, width, height: Math.max(0, frame.height - cursor) }\n : { x: frame.x + cursor, y: frame.y, width, height: frame.height };\n\n const size =\n typeof child === 'string' || typeof child === 'number'\n ? await renderText({ children: String(child) }, childFrame, ctx)\n : await renderElement(child, childFrame, mode, ctx);\n\n const advance = mode === 'stack' ? size.height : width;\n cursor += advance + (i < items.length - 1 ? opts.gap : 0);\n crossMax = Math.max(crossMax, mode === 'stack' ? size.width : size.height);\n }\n\n return mode === 'stack'\n ? { width: crossMax, height: cursor }\n : { width: cursor, height: crossMax };\n};\n\nconst resolveRowWidths = (\n items: (PdfJsxElement | string | number)[],\n frameWidth: number,\n gap: number,\n): number[] => {\n let fixedWidth = 0;\n let flexCount = 0;\n const widths = items.map((item) => {\n if (typeof item === 'string' || typeof item === 'number') {\n flexCount += 1;\n return undefined;\n }\n const width = (item.props as { width?: number }).width;\n if (typeof width === 'number') {\n fixedWidth += width;\n return width;\n }\n flexCount += 1;\n return undefined;\n });\n\n const remaining = Math.max(0, frameWidth - fixedWidth - Math.max(0, items.length - 1) * gap);\n const flexWidth = flexCount > 0 ? remaining / flexCount : 0;\n return widths.map((width) => width ?? flexWidth);\n};\n\nconst renderElement = async (\n element: PdfJsxElement,\n frame: Rect,\n parentMode: 'stack' | 'row',\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n switch (element.kind) {\n case 'stack':\n return renderStack(element.props as StackProps, element.children, frame, ctx);\n case 'row':\n return renderRow(element.props as RowProps, element.children, frame, ctx);\n case 'box':\n return renderBox(element.props as BoxProps, element.children, frame, parentMode, ctx);\n case 'spacer':\n return Promise.resolve(renderSpacer(element.props as SpacerProps));\n case 'text':\n return renderText(\n { ...(element.props as TextProps), children: element.children },\n frame,\n ctx,\n );\n case 'multiVariableText':\n return renderMultiVariableText(\n { ...(element.props as MultiVariableTextProps), children: element.children },\n frame,\n ctx,\n );\n case 'image':\n return renderImage(element.props as ImageProps, frame, ctx);\n case 'svg':\n return renderSvg({ ...(element.props as SvgProps), children: element.children }, frame, ctx);\n case 'rectangle':\n return renderShape('rectangle', element.props as RectangleProps, frame, ctx);\n case 'ellipse':\n return renderShape('ellipse', element.props as EllipseProps, frame, ctx);\n case 'line':\n return renderLine(element.props as LineProps, frame, ctx);\n case 'list':\n return renderList(\n { ...(element.props as ListProps), children: element.children },\n frame,\n ctx,\n );\n case 'table':\n return renderTable(element.props as TableProps, frame, ctx);\n default:\n return { width: 0, height: 0 };\n }\n};\n\nconst renderStack = (\n props: StackProps,\n children: PdfJsxChild[],\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> =>\n layoutChildren(\n children,\n { ...frame, width: props.width ?? frame.width },\n 'stack',\n {\n gap: props.gap ?? 0,\n },\n ctx,\n );\n\nconst renderRow = (\n props: RowProps,\n children: PdfJsxChild[],\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> =>\n layoutChildren(\n children,\n { ...frame, width: props.width ?? frame.width, height: props.height ?? frame.height },\n 'row',\n { gap: props.gap ?? 0 },\n ctx,\n );\n\nconst renderBox = async (\n props: BoxProps,\n children: PdfJsxChild[],\n frame: Rect,\n _parentMode: 'stack' | 'row',\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const width = props.width ?? frame.width;\n const padding = resolveBoxSides(props.padding);\n const needsRect = Boolean(props.background || props.borderColor || props.borderWidth);\n const beforeCount = ctx.schemas.length;\n\n if (needsRect) {\n ctx.schemas.push({\n name: resolveName(ctx, 'box'),\n type: 'rectangle',\n position: { x: frame.x, y: frame.y },\n width,\n height: 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n color: props.background ?? '',\n borderColor: props.borderColor ?? '',\n borderWidth: props.borderWidth ?? 0,\n radius: props.radius ?? 0,\n });\n }\n\n const innerFrame = {\n x: frame.x + padding.left,\n y: frame.y + padding.top,\n width: width - padding.left - padding.right,\n height: (props.height ?? frame.height) - padding.top - padding.bottom,\n };\n const childSize = await layoutChildren(children, innerFrame, 'stack', { gap: 0 }, ctx);\n const height = props.height ?? childSize.height + padding.top + padding.bottom;\n\n if (needsRect) {\n ctx.schemas[beforeCount] = { ...ctx.schemas[beforeCount]!, height };\n }\n\n return { width, height };\n};\n\nconst renderSpacer = (props: SpacerProps): { width: number; height: number } => ({\n width: props.width ?? 0,\n height: props.height ?? 0,\n});\n\nconst renderText = async (\n props: TextProps,\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const width = props.width ?? frame.width;\n const value = childrenToString(props.children);\n const name = resolveName(ctx, 'text', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n\n const schema: TextSchema = {\n name,\n type: 'text',\n content: value,\n position: { x: frame.x, y: frame.y },\n width,\n height: props.height ?? 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: props.valign ?? 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n textFormat: props.textFormat ?? 'plain',\n overflow: props.overflow,\n strikethrough: props.strikethrough ?? false,\n underline: props.underline ?? false,\n };\n\n if (props.borderColor) schema.borderColor = props.borderColor;\n if (props.borderWidth != null) schema.borderWidth = props.borderWidth;\n if (props.dynamicFontSize) {\n schema.dynamicFontSize = {\n min: props.dynamicFontSize.min ?? DEFAULT_DYNAMIC_FONT_SIZE.min,\n max: props.dynamicFontSize.max ?? DEFAULT_DYNAMIC_FONT_SIZE.max,\n fit: props.dynamicFontSize.fit ?? DEFAULT_DYNAMIC_FONT_SIZE.fit,\n };\n }\n if (props.height == null) {\n schema.height = await measureTextHeight({ value, schema, font: ctx.font, _cache: ctx._cache });\n }\n if (!readOnly) ctx.inputs[name] = value;\n ctx.schemas.push(schema);\n\n return { width, height: schema.height };\n};\n\nconst renderMultiVariableText = async (\n props: MultiVariableTextProps,\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const width = props.width ?? frame.width;\n const templateText = props.text ?? childrenToString(props.children);\n const values = normalizeMultiVariableTextValues(props.values);\n const variables = resolveMultiVariableTextVariables(templateText, props.variables, values);\n const name = resolveName(ctx, 'multiVariableText', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const textFormat = props.textFormat ?? 'plain';\n const content = readOnly\n ? substituteMultiVariableText(templateText, values, textFormat === 'inline-markdown')\n : JSON.stringify(values);\n\n const schema: MultiVariableTextSchema = {\n name,\n type: 'multiVariableText',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height: props.height ?? 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: props.valign ?? 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n textFormat,\n overflow: props.overflow,\n strikethrough: props.strikethrough ?? false,\n underline: props.underline ?? false,\n text: templateText,\n variables,\n };\n\n if (props.borderColor) schema.borderColor = props.borderColor;\n if (props.borderWidth != null) schema.borderWidth = props.borderWidth;\n if (props.dynamicFontSize) {\n schema.dynamicFontSize = {\n min: props.dynamicFontSize.min ?? DEFAULT_DYNAMIC_FONT_SIZE.min,\n max: props.dynamicFontSize.max ?? DEFAULT_DYNAMIC_FONT_SIZE.max,\n fit: props.dynamicFontSize.fit ?? DEFAULT_DYNAMIC_FONT_SIZE.fit,\n };\n }\n if (props.height == null) {\n const measureValue = readOnly\n ? content\n : substituteMultiVariableText(templateText, values, textFormat === 'inline-markdown');\n schema.height = await measureTextHeight({\n value: measureValue,\n schema,\n font: ctx.font,\n _cache: ctx._cache,\n });\n }\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height: schema.height };\n};\n\nconst renderImage = (\n props: ImageProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const name = resolveName(ctx, 'image', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const content = props.src ?? '';\n\n const schema: ImageSchema = {\n name,\n type: 'image',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n };\n\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderSvg = (\n props: SvgProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const name = resolveName(ctx, 'svg', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const content = props.svg ?? childrenToString(props.children);\n\n const schema: SVGSchema = {\n name,\n type: 'svg',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n };\n\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderShape = (\n type: ShapeSchema['type'],\n props: RectangleProps | EllipseProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const fill = props.fill ?? '';\n const borderWidth = props.borderWidth ?? (props.borderColor || !fill ? 1 : 0);\n\n const schema: ShapeSchema = {\n name: resolveName(ctx, type, props.name),\n type,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n borderWidth,\n borderColor: props.borderColor ?? (borderWidth > 0 ? DEFAULT_SHAPE_BORDER_COLOR : ''),\n color: fill,\n radius: type === 'rectangle' ? ((props as RectangleProps).radius ?? 0) : 0,\n };\n\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderLine = (\n props: LineProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_LINE_THICKNESS;\n\n const schema: LineSchema = {\n name: resolveName(ctx, 'line', props.name),\n type: 'line',\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n color: props.color ?? DEFAULT_LINE_COLOR,\n };\n\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderList = (\n props: ListProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const items = normalizeListItems(props);\n const serialized = JSON.stringify(items.map(serializeListItem));\n const width = props.width ?? frame.width;\n const height =\n props.height ??\n Math.max(1, items.length) * estimateTextHeight(fontSize, lineHeight) +\n Math.max(0, items.length - 1) * (props.itemSpacing ?? 1);\n const name = resolveName(ctx, 'list', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n\n const schema: ListSchema = {\n name,\n type: 'list',\n content: serialized,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n listStyle: props.listStyle ?? 'bullet',\n markerWidth: props.markerWidth ?? 6,\n markerGap: props.markerGap ?? 2,\n indentSize: props.indentSize ?? 6,\n itemSpacing: props.itemSpacing ?? 1,\n };\n\n if (!readOnly) ctx.inputs[name] = serialized;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderTable = (\n props: TableProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const rows = (props.rows ?? props.data ?? []).map((row) => row.map(String));\n const width = props.width ?? frame.width;\n const showHead = props.showHead ?? true;\n const headerHeight = props.headerHeight ?? 9;\n const rowHeight = props.rowHeight ?? 6.5;\n const height =\n props.height ?? (showHead ? headerHeight : 0) + Math.max(1, rows.length) * rowHeight;\n const name = resolveName(ctx, 'table', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const value = JSON.stringify(rows);\n\n const schema: TableSchema = {\n name,\n type: 'table',\n content: value,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n showHead,\n repeatHead: props.repeatHead ?? false,\n head: props.head,\n headWidthPercentages: normalizeColumnWidths(props.widths, props.head.length),\n tableStyles: {\n borderColor: props.tableStyles?.borderColor ?? '#000000',\n borderWidth: props.tableStyles?.borderWidth ?? 0.3,\n },\n headStyles: {\n ...defaultCellStyle(props.font ?? ctx.defaultFont, props.fontSize),\n fontColor: '#ffffff',\n backgroundColor: '#2980ba',\n ...normalizeCellStyle(props.headStyles),\n },\n bodyStyles: {\n ...defaultCellStyle(props.font ?? ctx.defaultFont, props.fontSize),\n alternateBackgroundColor: '#f5f5f5',\n ...normalizeCellStyle(props.bodyStyles),\n },\n columnStyles: props.columnStyles ?? {},\n };\n\n if (!readOnly) ctx.inputs[name] = value;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst normalizeListItems = (props: ListProps): { text: string; level: number }[] => {\n if (props.items) {\n return props.items.map((item) =>\n typeof item === 'string'\n ? { text: item, level: 0 }\n : { text: item.text, level: item.level ?? 0 },\n );\n }\n return childrenToString(props.children)\n .split('\\n')\n .map((item) => item.trim())\n .filter(Boolean)\n .map((text) => ({ text, level: 0 }));\n};\n\nconst serializeListItem = (item: { text: string; level: number }) =>\n `${'\\t'.repeat(Math.max(0, item.level))}${item.text}`;\n\nconst normalizeMultiVariableTextValues = (\n values: MultiVariableTextValues | undefined,\n): Record<string, string> => {\n const normalized: Record<string, string> = {};\n Object.entries(values ?? {}).forEach(([key, value]) => {\n normalized[key] = value == null ? '' : String(value);\n });\n return normalized;\n};\n\nconst resolveMultiVariableTextVariables = (\n templateText: string,\n variables: string[] | undefined,\n values: Record<string, string>,\n) => {\n const result: string[] = [];\n const seen = new Set<string>();\n const add = (name: string) => {\n if (!seen.has(name)) {\n seen.add(name);\n result.push(name);\n }\n };\n\n variables?.forEach(add);\n getVariableNames(templateText).forEach(add);\n Object.keys(values).forEach(add);\n return result;\n};\n\nconst substituteMultiVariableText = (\n templateText: string,\n values: Record<string, string>,\n escapeMarkdown: boolean,\n) => {\n let result = '';\n let lastIndex = 0;\n\n visitVariables(templateText, ({ name, startIndex, endIndex }) => {\n result += templateText.slice(lastIndex, startIndex);\n const value = values[name];\n if (value != null) {\n result += escapeMarkdown ? escapeInlineMarkdown(value) : value;\n }\n lastIndex = endIndex + 1;\n });\n\n return result + templateText.slice(lastIndex);\n};\n\nconst normalizeColumnWidths = (widths: number[] | undefined, columnCount: number): number[] => {\n if (widths && widths.length > 0) return widths;\n if (columnCount <= 0) return [];\n return Array.from({ length: columnCount }, () => 100 / columnCount);\n};\n\nconst defaultCellStyle = (fontName: string | undefined, fontSize = 10): SchemaCellStyle => ({\n fontName,\n alignment: 'left',\n verticalAlignment: 'middle',\n fontSize,\n lineHeight: 1,\n characterSpacing: 0,\n fontColor: '#000000',\n backgroundColor: '#ffffff',\n borderColor: '#000000',\n borderWidth: { top: 0, right: 0, bottom: 0, left: 0 },\n padding: { top: 5, right: 5, bottom: 5, left: 5 },\n});\n\nconst normalizeCellStyle = (\n style: CellStyle | undefined,\n): Partial<SchemaCellStyle & { alternateBackgroundColor: string }> => {\n if (!style) return {};\n const { borderWidth, padding, ...rest } = style;\n return {\n ...rest,\n ...(borderWidth != null ? { borderWidth: resolveBoxSides(borderWidth) } : {}),\n ...(padding != null ? { padding: resolveBoxSides(padding) } : {}),\n };\n};\n\nconst resolveBoxSides = (value?: number | BoxSides) => {\n if (value == null) return { top: 0, right: 0, bottom: 0, left: 0 };\n if (typeof value === 'number') return { top: value, right: value, bottom: value, left: value };\n const x = value.x ?? 0;\n const y = value.y ?? 0;\n return {\n top: value.top ?? y,\n right: value.right ?? x,\n bottom: value.bottom ?? y,\n left: value.left ?? x,\n };\n};\n\nconst resolveName = (ctx: RenderCtx, prefix: string, userName?: string): string => {\n if (userName) {\n if (ctx.usedNames.has(userName)) {\n throw new Error(`@pdfme/jsx: duplicate schema name \"${userName}\"`);\n }\n ctx.usedNames.add(userName);\n return userName;\n }\n\n let name = '';\n do {\n ctx.nameCounters[prefix] = (ctx.nameCounters[prefix] ?? 0) + 1;\n name = `${prefix}_${ctx.nameCounters[prefix]}`;\n } while (ctx.usedNames.has(name));\n ctx.usedNames.add(name);\n return name;\n};\n\nconst estimateTextHeight = (fontSize: number, lineHeight: number) =>\n Math.max(4, pt2mm(fontSize * lineHeight));\n\nconst validateConsistentPageProps = (\n pages: PdfJsxElement<'page'>[],\n firstPageSize: { width: number; height: number },\n firstMargin: ReturnType<typeof resolveBoxSides>,\n) => {\n for (let i = 1; i < pages.length; i += 1) {\n const props = pages[i]?.props as PageProps;\n const pageSize = resolvePageSize(props.size, props.orientation);\n const margin = resolveBoxSides(props.margin);\n\n if (!isSameSize(pageSize, firstPageSize) || !isSameBoxSides(margin, firstMargin)) {\n throw new Error(\n '@pdfme/jsx: all <Page> nodes must use the same size, orientation, and margin. pdfme templates have one blank basePdf size and padding.',\n );\n }\n }\n};\n\nconst isSameSize = (\n first: { width: number; height: number },\n second: { width: number; height: number },\n) => first.width === second.width && first.height === second.height;\n\nconst isSameBoxSides = (\n first: ReturnType<typeof resolveBoxSides>,\n second: ReturnType<typeof resolveBoxSides>,\n) =>\n first.top === second.top &&\n first.right === second.right &&\n first.bottom === second.bottom &&\n first.left === second.left;\n\nconst PAGE_BREAK_PARENT_KINDS = new Set(['page', 'stack', 'box']);\n\nconst validatePageBreakPlacement = (\n node: PdfJsxChild | PdfJsxChild[],\n parentKind: string | undefined = undefined,\n canBreak = false,\n) => {\n for (const child of flattenForSplitting(node)) {\n if (!isPdfJsxElement(child)) continue;\n\n if (child.kind === 'pagebreak') {\n if (!canBreak || !parentKind || !PAGE_BREAK_PARENT_KINDS.has(parentKind)) {\n throw new Error(\n '@pdfme/jsx: <PageBreak> can only be used inside <Page>, <Stack>, or <Box>.',\n );\n }\n continue;\n }\n\n const childCanBreak =\n child.kind === 'page' ? true : canBreak && PAGE_BREAK_PARENT_KINDS.has(child.kind);\n validatePageBreakPlacement(child.children, child.kind, childCanBreak);\n }\n};\n"],"mappings":";;;;AAmBA,IAAM,eAEF,UAED,UACC,kBAAkB,MAAM,MAAM;AAElC,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,QAAQ,YAAiC,QAAQ;AAC9D,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,SAAS,YAAmC,SAAS;AAClE,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,oBAAoB,YAC/B,oBACD;AACD,IAAa,QAAQ,YAAiC,QAAQ;AAC9D,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,YAAY,YAAyC,YAAY;AAC9E,IAAa,UAAU,YAAqC,UAAU;AACtE,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,QAAQ,YAAiC,QAAQ;AAC9D,IAAa,aAAa,UAA2B,kBAAkB,aAAa,MAAM;;;ACc1F,IAAM,oBAAoB;AAC1B,IAAM,sBAAsB;AAC5B,IAAM,4BAA4B;AAClC,IAAM,qBAAqB;AAC3B,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAC3B,IAAM,6BAA6B;AACnC,IAAM,4BAA4B;CA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KAAK,EAAE;AAC7C,MAAI,CAAC,gBAAgB,MAAM,CAAE;AAE7B,MAAI,MAAM,SAAS,aAAa;AAC9B,OAAI,CAAC,YAAY,CAAC,cAAc,CAAC,wBAAwB,IAAI,WAAW,CACtE,OAAM,IAAI,MACR,6EACD;AAEH;;EAGF,MAAM,gBACJ,MAAM,SAAS,SAAS,OAAO,YAAY,wBAAwB,IAAI,MAAM,KAAK;AACpF,6BAA2B,MAAM,UAAU,MAAM,MAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/components.ts","../src/render.ts"],"sourcesContent":["import { createElementNode } from './node.js';\nimport type {\n BoxProps,\n EllipseProps,\n ImageProps,\n LineProps,\n ListProps,\n MultiVariableTextProps,\n PageBreakProps,\n PageProps,\n RectangleProps,\n RowProps,\n SpacerProps,\n StackProps,\n SvgProps,\n TableProps,\n TextProps,\n} from './types.js';\n\nconst makeBuiltin =\n <Props extends Record<string, unknown>, K extends Parameters<typeof createElementNode>[0]>(\n kind: K,\n ) =>\n (props: Props): ReturnType<typeof createElementNode<K>> =>\n createElementNode(kind, props);\n\nexport const Page = makeBuiltin<PageProps, 'page'>('page');\nexport const Stack = makeBuiltin<StackProps, 'stack'>('stack');\nexport const Row = makeBuiltin<RowProps, 'row'>('row');\nexport const Box = makeBuiltin<BoxProps, 'box'>('box');\nexport const Spacer = makeBuiltin<SpacerProps, 'spacer'>('spacer');\nexport const Text = makeBuiltin<TextProps, 'text'>('text');\nexport const MultiVariableText = makeBuiltin<MultiVariableTextProps, 'multiVariableText'>(\n 'multiVariableText',\n);\nexport const Image = makeBuiltin<ImageProps, 'image'>('image');\nexport const Svg = makeBuiltin<SvgProps, 'svg'>('svg');\nexport const Rectangle = makeBuiltin<RectangleProps, 'rectangle'>('rectangle');\nexport const Ellipse = makeBuiltin<EllipseProps, 'ellipse'>('ellipse');\nexport const Line = makeBuiltin<LineProps, 'line'>('line');\nexport const List = makeBuiltin<ListProps, 'list'>('list');\nexport const Table = makeBuiltin<TableProps, 'table'>('table');\nexport const PageBreak = (props?: PageBreakProps) => createElementNode('pagebreak', props);\n","import { getDefaultFont, pt2mm, resolvePageSize } from '@pdfme/common';\nimport type { Font, Schema, Template } from '@pdfme/common';\nimport type {\n CellStyle as SchemaCellStyle,\n ImageSchema,\n LineSchema,\n ListSchema,\n MultiVariableTextSchema,\n ShapeSchema,\n SVGSchema,\n TableSchema,\n TextSchema,\n} from '@pdfme/schemas/types';\nimport {\n escapeInlineMarkdown,\n getVariableNames,\n measureTextHeight,\n visitVariables,\n} from '@pdfme/schemas/utils';\nimport { cloneElementWithChildren, isPdfJsxElement, isPdfJsxFragment } from './node.js';\nimport type {\n BoxProps,\n BoxSides,\n CellStyle,\n EllipseProps,\n ImageProps,\n LineProps,\n ListProps,\n MultiVariableTextProps,\n MultiVariableTextValues,\n PageProps,\n PdfJsxChild,\n PdfJsxElement,\n RectangleProps,\n RenderOptions,\n RenderResult,\n RowProps,\n SpacerProps,\n StackProps,\n SvgProps,\n TableProps,\n TextProps,\n} from './types.js';\n\ntype Rect = { x: number; y: number; width: number; height: number };\n\ntype RenderCtx = {\n schemas: Schema[];\n inputs: Record<string, string>;\n usedNames: Set<string>;\n nameCounters: Record<string, number>;\n defaultFont?: string;\n font: Font;\n _cache: Map<string | number, unknown>;\n};\n\nconst DEFAULT_FONT_SIZE = 10;\nconst DEFAULT_LINE_HEIGHT = 1;\nconst DEFAULT_CHARACTER_SPACING = 0;\nconst DEFAULT_FONT_COLOR = '#000000';\nconst DEFAULT_VISUAL_HEIGHT = 40;\nconst DEFAULT_LINE_THICKNESS = 0.5;\nconst DEFAULT_LINE_COLOR = '#000000';\nconst DEFAULT_SHAPE_BORDER_COLOR = '#000000';\nconst DEFAULT_DYNAMIC_FONT_SIZE = {\n min: 4,\n max: 72,\n fit: 'vertical',\n} as const satisfies NonNullable<TextSchema['dynamicFontSize']>;\n\nexport const renderToTemplate = async (\n node: PdfJsxChild,\n options: RenderOptions = {},\n): Promise<RenderResult> => {\n validatePageBreakPlacement(node);\n const expanded = expandPageBreaks(node);\n const pages = flattenChildren(expanded).filter(\n (child): child is PdfJsxElement<'page'> => isPdfJsxElement(child) && child.kind === 'page',\n );\n\n if (pages.length === 0) {\n throw new Error('@pdfme/jsx: renderToTemplate root must contain at least one <Page>.');\n }\n\n const firstPageProps = pages[0]?.props as PageProps;\n const firstMargin = resolveBoxSides(firstPageProps.margin);\n const pageSize = resolvePageSize(firstPageProps.size, firstPageProps.orientation);\n validateConsistentPageProps(pages, pageSize, firstMargin);\n const inputs: Record<string, string> = {};\n const usedNames = new Set<string>();\n const nameCounters: Record<string, number> = {};\n const font = options.font ?? getDefaultFont();\n const _cache = new Map<string | number, unknown>();\n const pageSchemas: Schema[][] = [];\n\n for (const page of pages) {\n const props = page.props as PageProps;\n const margin = resolveBoxSides(props.margin);\n const frame = {\n x: margin.left,\n y: margin.top,\n width: pageSize.width - margin.left - margin.right,\n height: pageSize.height - margin.top - margin.bottom,\n };\n const ctx: RenderCtx = {\n schemas: [],\n inputs,\n usedNames,\n nameCounters,\n defaultFont: props.font,\n font,\n _cache,\n };\n await layoutChildren(page.children, frame, 'stack', { gap: 0 }, ctx);\n pageSchemas.push(ctx.schemas);\n }\n\n const template: Template = {\n basePdf: options.basePdf ?? {\n width: pageSize.width,\n height: pageSize.height,\n padding: [firstMargin.top, firstMargin.right, firstMargin.bottom, firstMargin.left],\n },\n schemas: pageSchemas,\n };\n\n return { template, inputs: [inputs] };\n};\n\nconst flattenChildren = (\n children: PdfJsxChild | PdfJsxChild[],\n): (PdfJsxElement | string | number)[] => {\n if (children == null || children === false || children === true) return [];\n if (typeof children === 'string' || typeof children === 'number') return [children];\n if (Array.isArray(children)) return children.flatMap((child) => flattenChildren(child));\n if (isPdfJsxFragment(children)) return flattenChildren(children.children);\n if (isPdfJsxElement(children)) return [children];\n return [];\n};\n\nconst childrenToString = (children: PdfJsxChild | PdfJsxChild[]): string =>\n flattenChildren(children)\n .map((child) => {\n if (typeof child === 'string' || typeof child === 'number') return String(child);\n return childrenToString(child.children);\n })\n .join('');\n\nconst splitChildrenByPageBreak = (children: PdfJsxChild | PdfJsxChild[]): PdfJsxChild[][] => {\n const segments: PdfJsxChild[][] = [[]];\n\n for (const child of flattenForSplitting(children)) {\n if (isPdfJsxElement(child) && child.kind === 'pagebreak') {\n segments.push([]);\n continue;\n }\n\n if (\n isPdfJsxElement(child) &&\n (child.kind === 'page' || child.kind === 'stack' || child.kind === 'box')\n ) {\n const childSegments = splitChildrenByPageBreak(child.children);\n if (childSegments.length === 1) {\n segments[segments.length - 1]?.push(child);\n continue;\n }\n\n segments[segments.length - 1]?.push(cloneElementWithChildren(child, childSegments[0] ?? []));\n for (let i = 1; i < childSegments.length; i += 1) {\n segments.push([cloneElementWithChildren(child, childSegments[i] ?? [])]);\n }\n continue;\n }\n\n segments[segments.length - 1]?.push(child);\n }\n\n return segments;\n};\n\nconst flattenForSplitting = (children: PdfJsxChild | PdfJsxChild[]): PdfJsxChild[] => {\n if (children == null || children === false || children === true) return [];\n if (Array.isArray(children)) return children.flatMap((child) => flattenForSplitting(child));\n if (isPdfJsxFragment(children)) return flattenForSplitting(children.children);\n return [children];\n};\n\nconst expandPageBreaks = (node: PdfJsxChild): PdfJsxChild[] =>\n splitChildrenByPageBreak(node).flat();\n\nconst layoutChildren = async (\n children: PdfJsxChild | PdfJsxChild[],\n frame: Rect,\n mode: 'stack' | 'row',\n opts: { gap: number },\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const items = flattenChildren(children);\n const widths = mode === 'row' ? resolveRowWidths(items, frame.width, opts.gap) : undefined;\n let cursor = 0;\n let crossMax = 0;\n\n for (let i = 0; i < items.length; i += 1) {\n const child = items[i];\n const width = mode === 'row' ? (widths?.[i] ?? 0) : frame.width;\n const childFrame =\n mode === 'stack'\n ? { x: frame.x, y: frame.y + cursor, width, height: Math.max(0, frame.height - cursor) }\n : { x: frame.x + cursor, y: frame.y, width, height: frame.height };\n\n const size =\n typeof child === 'string' || typeof child === 'number'\n ? await renderText({ children: String(child) }, childFrame, ctx)\n : await renderElement(child, childFrame, mode, ctx);\n\n const advance = mode === 'stack' ? size.height : width;\n cursor += advance + (i < items.length - 1 ? opts.gap : 0);\n crossMax = Math.max(crossMax, mode === 'stack' ? size.width : size.height);\n }\n\n return mode === 'stack'\n ? { width: crossMax, height: cursor }\n : { width: cursor, height: crossMax };\n};\n\nconst resolveRowWidths = (\n items: (PdfJsxElement | string | number)[],\n frameWidth: number,\n gap: number,\n): number[] => {\n let fixedWidth = 0;\n let flexCount = 0;\n const widths = items.map((item) => {\n if (typeof item === 'string' || typeof item === 'number') {\n flexCount += 1;\n return undefined;\n }\n const width = (item.props as { width?: number }).width;\n if (typeof width === 'number') {\n fixedWidth += width;\n return width;\n }\n flexCount += 1;\n return undefined;\n });\n\n const remaining = Math.max(0, frameWidth - fixedWidth - Math.max(0, items.length - 1) * gap);\n const flexWidth = flexCount > 0 ? remaining / flexCount : 0;\n return widths.map((width) => width ?? flexWidth);\n};\n\nconst renderElement = async (\n element: PdfJsxElement,\n frame: Rect,\n parentMode: 'stack' | 'row',\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n switch (element.kind) {\n case 'stack':\n return renderStack(element.props as StackProps, element.children, frame, ctx);\n case 'row':\n return renderRow(element.props as RowProps, element.children, frame, ctx);\n case 'box':\n return renderBox(element.props as BoxProps, element.children, frame, parentMode, ctx);\n case 'spacer':\n return Promise.resolve(renderSpacer(element.props as SpacerProps));\n case 'text':\n return renderText(\n { ...(element.props as TextProps), children: element.children },\n frame,\n ctx,\n );\n case 'multiVariableText':\n return renderMultiVariableText(\n { ...(element.props as MultiVariableTextProps), children: element.children },\n frame,\n ctx,\n );\n case 'image':\n return renderImage(element.props as ImageProps, frame, ctx);\n case 'svg':\n return renderSvg({ ...(element.props as SvgProps), children: element.children }, frame, ctx);\n case 'rectangle':\n return renderShape('rectangle', element.props as RectangleProps, frame, ctx);\n case 'ellipse':\n return renderShape('ellipse', element.props as EllipseProps, frame, ctx);\n case 'line':\n return renderLine(element.props as LineProps, frame, ctx);\n case 'list':\n return renderList(\n { ...(element.props as ListProps), children: element.children },\n frame,\n ctx,\n );\n case 'table':\n return renderTable(element.props as TableProps, frame, ctx);\n default:\n return { width: 0, height: 0 };\n }\n};\n\nconst renderStack = (\n props: StackProps,\n children: PdfJsxChild[],\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> =>\n layoutChildren(\n children,\n { ...frame, width: props.width ?? frame.width },\n 'stack',\n {\n gap: props.gap ?? 0,\n },\n ctx,\n );\n\nconst renderRow = (\n props: RowProps,\n children: PdfJsxChild[],\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> =>\n layoutChildren(\n children,\n { ...frame, width: props.width ?? frame.width, height: props.height ?? frame.height },\n 'row',\n { gap: props.gap ?? 0 },\n ctx,\n );\n\nconst renderBox = async (\n props: BoxProps,\n children: PdfJsxChild[],\n frame: Rect,\n _parentMode: 'stack' | 'row',\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const width = props.width ?? frame.width;\n const padding = resolveBoxSides(props.padding);\n const needsRect = Boolean(props.background || props.borderColor || props.borderWidth);\n const beforeCount = ctx.schemas.length;\n\n if (needsRect) {\n ctx.schemas.push({\n name: resolveName(ctx, 'box'),\n type: 'rectangle',\n position: { x: frame.x, y: frame.y },\n width,\n height: 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n color: props.background ?? '',\n borderColor: props.borderColor ?? '',\n borderWidth: props.borderWidth ?? 0,\n radius: props.radius ?? 0,\n });\n }\n\n const innerFrame = {\n x: frame.x + padding.left,\n y: frame.y + padding.top,\n width: width - padding.left - padding.right,\n height: (props.height ?? frame.height) - padding.top - padding.bottom,\n };\n const childSize = await layoutChildren(children, innerFrame, 'stack', { gap: 0 }, ctx);\n const height = props.height ?? childSize.height + padding.top + padding.bottom;\n\n if (needsRect) {\n ctx.schemas[beforeCount] = { ...ctx.schemas[beforeCount]!, height };\n }\n\n return { width, height };\n};\n\nconst renderSpacer = (props: SpacerProps): { width: number; height: number } => ({\n width: props.width ?? 0,\n height: props.height ?? 0,\n});\n\nconst renderText = async (\n props: TextProps,\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const width = props.width ?? frame.width;\n const value = childrenToString(props.children);\n const readOnly = props.readOnly ?? props.name == null;\n const textFormat = props.textFormat ?? 'plain';\n\n if (!readOnly && textFormat === 'inline-markdown') {\n throw new Error(\n '@pdfme/jsx: editable <Text> does not support textFormat=\"inline-markdown\". Use read-only <Text> or <MultiVariableText>.',\n );\n }\n const name = resolveName(ctx, 'text', props.name);\n\n const schema: TextSchema = {\n name,\n type: 'text',\n content: value,\n position: { x: frame.x, y: frame.y },\n width,\n height: props.height ?? 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: props.valign ?? 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n textFormat,\n overflow: props.overflow,\n strikethrough: props.strikethrough ?? false,\n underline: props.underline ?? false,\n };\n\n if (props.borderColor) schema.borderColor = props.borderColor;\n if (props.borderWidth != null) schema.borderWidth = props.borderWidth;\n if (props.dynamicFontSize) {\n schema.dynamicFontSize = {\n min: props.dynamicFontSize.min ?? DEFAULT_DYNAMIC_FONT_SIZE.min,\n max: props.dynamicFontSize.max ?? DEFAULT_DYNAMIC_FONT_SIZE.max,\n fit: props.dynamicFontSize.fit ?? DEFAULT_DYNAMIC_FONT_SIZE.fit,\n };\n }\n if (props.height == null) {\n schema.height = await measureTextHeight({ value, schema, font: ctx.font, _cache: ctx._cache });\n }\n if (!readOnly) ctx.inputs[name] = value;\n ctx.schemas.push(schema);\n\n return { width, height: schema.height };\n};\n\nconst renderMultiVariableText = async (\n props: MultiVariableTextProps,\n frame: Rect,\n ctx: RenderCtx,\n): Promise<{ width: number; height: number }> => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const width = props.width ?? frame.width;\n const templateText = props.text ?? childrenToString(props.children);\n const values = normalizeMultiVariableTextValues(props.values);\n const variables = resolveMultiVariableTextVariables(templateText, props.variables, values);\n const name = resolveName(ctx, 'multiVariableText', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const textFormat = props.textFormat ?? 'plain';\n const content = readOnly\n ? substituteMultiVariableText(templateText, values, textFormat === 'inline-markdown')\n : JSON.stringify(values);\n\n const schema: MultiVariableTextSchema = {\n name,\n type: 'multiVariableText',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height: props.height ?? 0,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: props.valign ?? 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n textFormat,\n overflow: props.overflow,\n strikethrough: props.strikethrough ?? false,\n underline: props.underline ?? false,\n text: templateText,\n variables,\n };\n\n if (props.borderColor) schema.borderColor = props.borderColor;\n if (props.borderWidth != null) schema.borderWidth = props.borderWidth;\n if (props.dynamicFontSize) {\n schema.dynamicFontSize = {\n min: props.dynamicFontSize.min ?? DEFAULT_DYNAMIC_FONT_SIZE.min,\n max: props.dynamicFontSize.max ?? DEFAULT_DYNAMIC_FONT_SIZE.max,\n fit: props.dynamicFontSize.fit ?? DEFAULT_DYNAMIC_FONT_SIZE.fit,\n };\n }\n if (props.height == null) {\n const measureValue = readOnly\n ? content\n : substituteMultiVariableText(templateText, values, textFormat === 'inline-markdown');\n schema.height = await measureTextHeight({\n value: measureValue,\n schema,\n font: ctx.font,\n _cache: ctx._cache,\n });\n }\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height: schema.height };\n};\n\nconst renderImage = (\n props: ImageProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const name = resolveName(ctx, 'image', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const content = props.src ?? '';\n\n const schema: ImageSchema = {\n name,\n type: 'image',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n };\n\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderSvg = (\n props: SvgProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const name = resolveName(ctx, 'svg', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const content = props.svg ?? childrenToString(props.children);\n\n const schema: SVGSchema = {\n name,\n type: 'svg',\n content,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n };\n\n if (!readOnly) ctx.inputs[name] = content;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderShape = (\n type: ShapeSchema['type'],\n props: RectangleProps | EllipseProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_VISUAL_HEIGHT;\n const fill = props.fill ?? '';\n const borderWidth = props.borderWidth ?? (props.borderColor || !fill ? 1 : 0);\n\n const schema: ShapeSchema = {\n name: resolveName(ctx, type, props.name),\n type,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n borderWidth,\n borderColor: props.borderColor ?? (borderWidth > 0 ? DEFAULT_SHAPE_BORDER_COLOR : ''),\n color: fill,\n radius: type === 'rectangle' ? ((props as RectangleProps).radius ?? 0) : 0,\n };\n\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderLine = (\n props: LineProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const width = props.width ?? frame.width;\n const height = props.height ?? DEFAULT_LINE_THICKNESS;\n\n const schema: LineSchema = {\n name: resolveName(ctx, 'line', props.name),\n type: 'line',\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly: true,\n color: props.color ?? DEFAULT_LINE_COLOR,\n };\n\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderList = (\n props: ListProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const fontSize = props.size ?? DEFAULT_FONT_SIZE;\n const lineHeight = props.lineHeight ?? DEFAULT_LINE_HEIGHT;\n const items = normalizeListItems(props);\n const serialized = JSON.stringify(items.map(serializeListItem));\n const width = props.width ?? frame.width;\n const height =\n props.height ??\n Math.max(1, items.length) * estimateTextHeight(fontSize, lineHeight) +\n Math.max(0, items.length - 1) * (props.itemSpacing ?? 1);\n const name = resolveName(ctx, 'list', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n\n const schema: ListSchema = {\n name,\n type: 'list',\n content: serialized,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n alignment: props.align ?? 'left',\n verticalAlignment: 'top',\n fontSize,\n fontName: props.font ?? ctx.defaultFont,\n lineHeight,\n characterSpacing: props.spacing ?? DEFAULT_CHARACTER_SPACING,\n fontColor: props.color ?? DEFAULT_FONT_COLOR,\n backgroundColor: props.background ?? '',\n listStyle: props.listStyle ?? 'bullet',\n markerWidth: props.markerWidth ?? 6,\n markerGap: props.markerGap ?? 2,\n indentSize: props.indentSize ?? 6,\n itemSpacing: props.itemSpacing ?? 1,\n };\n\n if (!readOnly) ctx.inputs[name] = serialized;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst renderTable = (\n props: TableProps,\n frame: Rect,\n ctx: RenderCtx,\n): { width: number; height: number } => {\n const rows = (props.rows ?? props.data ?? []).map((row) => row.map(String));\n const width = props.width ?? frame.width;\n const showHead = props.showHead ?? true;\n const headerHeight = props.headerHeight ?? 9;\n const rowHeight = props.rowHeight ?? 6.5;\n const height =\n props.height ?? (showHead ? headerHeight : 0) + Math.max(1, rows.length) * rowHeight;\n const name = resolveName(ctx, 'table', props.name);\n const readOnly = props.readOnly ?? props.name == null;\n const value = JSON.stringify(rows);\n\n const schema: TableSchema = {\n name,\n type: 'table',\n content: value,\n position: { x: frame.x, y: frame.y },\n width,\n height,\n rotate: props.rotate ?? 0,\n opacity: props.opacity ?? 1,\n readOnly,\n required: props.required,\n showHead,\n repeatHead: props.repeatHead ?? false,\n head: props.head,\n headWidthPercentages: normalizeColumnWidths(props.widths, props.head.length),\n tableStyles: {\n borderColor: props.tableStyles?.borderColor ?? '#000000',\n borderWidth: props.tableStyles?.borderWidth ?? 0.3,\n },\n headStyles: {\n ...defaultCellStyle(props.font ?? ctx.defaultFont, props.fontSize),\n fontColor: '#ffffff',\n backgroundColor: '#2980ba',\n ...normalizeCellStyle(props.headStyles),\n },\n bodyStyles: {\n ...defaultCellStyle(props.font ?? ctx.defaultFont, props.fontSize),\n alternateBackgroundColor: '#f5f5f5',\n ...normalizeCellStyle(props.bodyStyles),\n },\n columnStyles: props.columnStyles ?? {},\n };\n\n if (!readOnly) ctx.inputs[name] = value;\n ctx.schemas.push(schema);\n\n return { width, height };\n};\n\nconst normalizeListItems = (props: ListProps): { text: string; level: number }[] => {\n if (props.items) {\n return props.items.map((item) =>\n typeof item === 'string'\n ? { text: item, level: 0 }\n : { text: item.text, level: item.level ?? 0 },\n );\n }\n return childrenToString(props.children)\n .split('\\n')\n .map((item) => item.trim())\n .filter(Boolean)\n .map((text) => ({ text, level: 0 }));\n};\n\nconst serializeListItem = (item: { text: string; level: number }) =>\n `${'\\t'.repeat(Math.max(0, item.level))}${item.text}`;\n\nconst normalizeMultiVariableTextValues = (\n values: MultiVariableTextValues | undefined,\n): Record<string, string> => {\n const normalized: Record<string, string> = {};\n Object.entries(values ?? {}).forEach(([key, value]) => {\n normalized[key] = value == null ? '' : String(value);\n });\n return normalized;\n};\n\nconst resolveMultiVariableTextVariables = (\n templateText: string,\n variables: string[] | undefined,\n values: Record<string, string>,\n) => {\n const result: string[] = [];\n const seen = new Set<string>();\n const add = (name: string) => {\n if (!seen.has(name)) {\n seen.add(name);\n result.push(name);\n }\n };\n\n variables?.forEach(add);\n getVariableNames(templateText).forEach(add);\n Object.keys(values).forEach(add);\n return result;\n};\n\nconst substituteMultiVariableText = (\n templateText: string,\n values: Record<string, string>,\n escapeMarkdown: boolean,\n) => {\n let result = '';\n let lastIndex = 0;\n\n visitVariables(templateText, ({ name, startIndex, endIndex }) => {\n result += templateText.slice(lastIndex, startIndex);\n const value = values[name];\n if (value != null) {\n result += escapeMarkdown ? escapeInlineMarkdown(value) : value;\n }\n lastIndex = endIndex + 1;\n });\n\n return result + templateText.slice(lastIndex);\n};\n\nconst normalizeColumnWidths = (widths: number[] | undefined, columnCount: number): number[] => {\n if (widths && widths.length > 0) return widths;\n if (columnCount <= 0) return [];\n return Array.from({ length: columnCount }, () => 100 / columnCount);\n};\n\nconst defaultCellStyle = (fontName: string | undefined, fontSize = 10): SchemaCellStyle => ({\n fontName,\n alignment: 'left',\n verticalAlignment: 'middle',\n fontSize,\n lineHeight: 1,\n characterSpacing: 0,\n fontColor: '#000000',\n backgroundColor: '#ffffff',\n borderColor: '#000000',\n borderWidth: { top: 0, right: 0, bottom: 0, left: 0 },\n padding: { top: 5, right: 5, bottom: 5, left: 5 },\n});\n\nconst normalizeCellStyle = (\n style: CellStyle | undefined,\n): Partial<SchemaCellStyle & { alternateBackgroundColor: string }> => {\n if (!style) return {};\n const { borderWidth, padding, ...rest } = style;\n return {\n ...rest,\n ...(borderWidth != null ? { borderWidth: resolveBoxSides(borderWidth) } : {}),\n ...(padding != null ? { padding: resolveBoxSides(padding) } : {}),\n };\n};\n\nconst resolveBoxSides = (value?: number | BoxSides) => {\n if (value == null) return { top: 0, right: 0, bottom: 0, left: 0 };\n if (typeof value === 'number') return { top: value, right: value, bottom: value, left: value };\n const x = value.x ?? 0;\n const y = value.y ?? 0;\n return {\n top: value.top ?? y,\n right: value.right ?? x,\n bottom: value.bottom ?? y,\n left: value.left ?? x,\n };\n};\n\nconst resolveName = (ctx: RenderCtx, prefix: string, userName?: string): string => {\n if (userName) {\n if (ctx.usedNames.has(userName)) {\n throw new Error(`@pdfme/jsx: duplicate schema name \"${userName}\"`);\n }\n ctx.usedNames.add(userName);\n return userName;\n }\n\n let name = '';\n do {\n ctx.nameCounters[prefix] = (ctx.nameCounters[prefix] ?? 0) + 1;\n name = `${prefix}_${ctx.nameCounters[prefix]}`;\n } while (ctx.usedNames.has(name));\n ctx.usedNames.add(name);\n return name;\n};\n\nconst estimateTextHeight = (fontSize: number, lineHeight: number) =>\n Math.max(4, pt2mm(fontSize * lineHeight));\n\nconst validateConsistentPageProps = (\n pages: PdfJsxElement<'page'>[],\n firstPageSize: { width: number; height: number },\n firstMargin: ReturnType<typeof resolveBoxSides>,\n) => {\n for (let i = 1; i < pages.length; i += 1) {\n const props = pages[i]?.props as PageProps;\n const pageSize = resolvePageSize(props.size, props.orientation);\n const margin = resolveBoxSides(props.margin);\n\n if (!isSameSize(pageSize, firstPageSize) || !isSameBoxSides(margin, firstMargin)) {\n throw new Error(\n '@pdfme/jsx: all <Page> nodes must use the same size, orientation, and margin. pdfme templates have one blank basePdf size and padding.',\n );\n }\n }\n};\n\nconst isSameSize = (\n first: { width: number; height: number },\n second: { width: number; height: number },\n) => first.width === second.width && first.height === second.height;\n\nconst isSameBoxSides = (\n first: ReturnType<typeof resolveBoxSides>,\n second: ReturnType<typeof resolveBoxSides>,\n) =>\n first.top === second.top &&\n first.right === second.right &&\n first.bottom === second.bottom &&\n first.left === second.left;\n\nconst PAGE_BREAK_PARENT_KINDS = new Set(['page', 'stack', 'box']);\n\nconst validatePageBreakPlacement = (\n node: PdfJsxChild | PdfJsxChild[],\n parentKind: string | undefined = undefined,\n canBreak = false,\n) => {\n for (const child of flattenForSplitting(node)) {\n if (!isPdfJsxElement(child)) continue;\n\n if (child.kind === 'pagebreak') {\n if (!canBreak || !parentKind || !PAGE_BREAK_PARENT_KINDS.has(parentKind)) {\n throw new Error(\n '@pdfme/jsx: <PageBreak> can only be used inside <Page>, <Stack>, or <Box>.',\n );\n }\n continue;\n }\n\n const childCanBreak =\n child.kind === 'page' ? true : canBreak && PAGE_BREAK_PARENT_KINDS.has(child.kind);\n validatePageBreakPlacement(child.children, child.kind, childCanBreak);\n }\n};\n"],"mappings":";;;;AAmBA,IAAM,eAEF,UAED,UACC,kBAAkB,MAAM,MAAM;AAElC,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,QAAQ,YAAiC,QAAQ;AAC9D,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,SAAS,YAAmC,SAAS;AAClE,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,oBAAoB,YAC/B,oBACD;AACD,IAAa,QAAQ,YAAiC,QAAQ;AAC9D,IAAa,MAAM,YAA6B,MAAM;AACtD,IAAa,YAAY,YAAyC,YAAY;AAC9E,IAAa,UAAU,YAAqC,UAAU;AACtE,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAAa,OAAO,YAA+B,OAAO;AAC1D,IAA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