@pdfme/schemas 6.1.1-dev.26 → 6.1.1-dev.30

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.
Files changed (37) hide show
  1. package/dist/box.d.ts +45 -0
  2. package/dist/{builtins-BNd4jd5D.js → builtins-BB2DHceW.js} +177 -73
  3. package/dist/builtins-BB2DHceW.js.map +1 -0
  4. package/dist/builtins.js +1 -1
  5. package/dist/dynamicLayout.js +4 -4
  6. package/dist/{dynamicTemplate-CjbGepw4.js → dynamicTemplate-B4GCNLF9.js} +6 -45
  7. package/dist/dynamicTemplate-B4GCNLF9.js.map +1 -0
  8. package/dist/{dynamicTemplate-BpD4RNw8.js → dynamicTemplate-BwzF9C1L.js} +2 -2
  9. package/dist/{dynamicTemplate-BpD4RNw8.js.map → dynamicTemplate-BwzF9C1L.js.map} +1 -1
  10. package/dist/{dynamicTemplate-CBvwRBx9.js → dynamicTemplate-C7MdZxPm.js} +20 -10
  11. package/dist/dynamicTemplate-C7MdZxPm.js.map +1 -0
  12. package/dist/{helper-BFz9EwDz.js → helper-CEme39Uo.js} +2 -2
  13. package/dist/{helper-BFz9EwDz.js.map → helper-CEme39Uo.js.map} +1 -1
  14. package/dist/index.js +24 -20
  15. package/dist/index.js.map +1 -1
  16. package/dist/lists.js +2 -2
  17. package/dist/{measure-Bjmh9Ro3.js → measure-L5diay3k.js} +34 -7
  18. package/dist/measure-L5diay3k.js.map +1 -0
  19. package/dist/{splitRange-CpXivbmJ.js → splitRange-DmVDtmzO.js} +88 -3
  20. package/dist/splitRange-DmVDtmzO.js.map +1 -0
  21. package/dist/tables/helper.d.ts +4 -96
  22. package/dist/tables/types.d.ts +2 -6
  23. package/dist/tables.js +2 -2
  24. package/dist/text/measure.d.ts +6 -0
  25. package/dist/text/richTextPdfRender.d.ts +1 -1
  26. package/dist/text/types.d.ts +4 -0
  27. package/dist/texts.js +3 -3
  28. package/dist/types.d.ts +1 -0
  29. package/dist/{utils-Bd4CvhPZ.js → utils-zDZkqBnX.js} +2 -2
  30. package/dist/{utils-Bd4CvhPZ.js.map → utils-zDZkqBnX.js.map} +1 -1
  31. package/dist/utils.js +2 -2
  32. package/package.json +1 -1
  33. package/dist/builtins-BNd4jd5D.js.map +0 -1
  34. package/dist/dynamicTemplate-CBvwRBx9.js.map +0 -1
  35. package/dist/dynamicTemplate-CjbGepw4.js.map +0 -1
  36. package/dist/measure-Bjmh9Ro3.js.map +0 -1
  37. package/dist/splitRange-CpXivbmJ.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { E as DEFAULT_ALIGNMENT, K as VERTICAL_ALIGN_MIDDLE, O as DEFAULT_FONT_COLOR, R as PLACEHOLDER_FONT_COLOR, a as createListItemSplitRange, c as getListItemRange, h as getFontKitFont, i as TEXT_LINE_SPLIT_UNIT, l as getTableBodyRange, n as LIST_ITEM_SPLIT_UNIT, o as createTableBodySplitRange, r as TABLE_BODY_SPLIT_UNIT, s as createTextLineSplitRange, t as BUILT_IN_DYNAMIC_LAYOUT_SPLIT_UNITS, u as getTextLineRange, w as CODE_BACKGROUND_COLOR, z as SYNTHETIC_BOLD_CSS_TEXT_SHADOW } from "./splitRange-CpXivbmJ.js";
2
- import { d as resolveFontVariant, l as isInlineMarkdownTextSchema, m as parseInlineMarkdown, r as measureTextLines } from "./measure-Bjmh9Ro3.js";
3
- import { a as mapVerticalAlignToFlex, c as Formatter, i as makeElementPlainTextContentEditable, l as getExtraFormatterSchema, n as textSchema, o as uiRender$4, r as buildStyledTextContainer, s as propPanel$3, t as builtInPlugins, u as pdfRender$4 } from "./builtins-BNd4jd5D.js";
4
- import { a as getCellPropPanelSchema, c as HEX_COLOR_PATTERN, i as getBodyWithSchemaRange, l as createSingleTable, n as getDynamicLayoutForTable, o as getColumnStylesPropPanelSchema, r as getBody, s as getDefaultCellStyles, t as getDynamicHeightsForTable } from "./dynamicTemplate-CjbGepw4.js";
5
- import { c as isEditable, d as countUniqueVariableNames, f as getVariableNames, i as createSvgStr, l as readFile, n as convertForPdfLayoutProps, o as hex2PrintingColor, p as visitVariables, r as createErrorElm, t as addAlphaToHex, u as rotatePoint } from "./utils-Bd4CvhPZ.js";
6
- import { a as normalizeListItems, c as LIST_STYLE_BULLET, i as normalizeListItemEntries, l as LIST_STYLE_ORDERED, n as calculateListLayout, o as serializeListItems, s as DEFAULT_LIST_STYLE, t as getDynamicLayoutForList } from "./dynamicTemplate-BpD4RNw8.js";
7
- import { n as substituteVariablesAsInlineMarkdownLiterals, r as validateVariables, t as substituteVariables } from "./helper-BFz9EwDz.js";
1
+ import { $ as VERTICAL_ALIGN_MIDDLE, F as DEFAULT_FONT_COLOR, G as PLACEHOLDER_FONT_COLOR, K as SYNTHETIC_BOLD_CSS_TEXT_SHADOW, N as DEFAULT_ALIGNMENT, a as createListItemSplitRange, b as createBoxDimension, c as getListItemRange, h as getFontKitFont, i as TEXT_LINE_SPLIT_UNIT, j as CODE_BACKGROUND_COLOR, l as getTableBodyRange, n as LIST_ITEM_SPLIT_UNIT, o as createTableBodySplitRange, r as TABLE_BODY_SPLIT_UNIT, s as createTextLineSplitRange, t as BUILT_IN_DYNAMIC_LAYOUT_SPLIT_UNITS, u as getTextLineRange, x as getBoxContentArea } from "./splitRange-DmVDtmzO.js";
2
+ import { a as measureTextLines, d as isInlineMarkdownTextSchema, g as parseInlineMarkdown, p as resolveFontVariant } from "./measure-L5diay3k.js";
3
+ import { a as mapVerticalAlignToFlex, c as Formatter, i as makeElementPlainTextContentEditable, l as getExtraFormatterSchema, n as textSchema, o as uiRender$4, r as buildStyledTextContainer, s as propPanel$3, t as builtInPlugins, u as pdfRender$4 } from "./builtins-BB2DHceW.js";
4
+ import { a as getCellPropPanelSchema, c as HEX_COLOR_PATTERN, i as getBodyWithSchemaRange, l as createSingleTable, n as getDynamicLayoutForTable, o as getColumnStylesPropPanelSchema, r as getBody, s as getDefaultCellStyles, t as getDynamicHeightsForTable } from "./dynamicTemplate-B4GCNLF9.js";
5
+ import { c as isEditable, d as countUniqueVariableNames, f as getVariableNames, i as createSvgStr, l as readFile, n as convertForPdfLayoutProps, o as hex2PrintingColor, p as visitVariables, r as createErrorElm, t as addAlphaToHex, u as rotatePoint } from "./utils-zDZkqBnX.js";
6
+ import { a as normalizeListItems, c as LIST_STYLE_BULLET, i as normalizeListItemEntries, l as LIST_STYLE_ORDERED, n as calculateListLayout, o as serializeListItems, s as DEFAULT_LIST_STYLE, t as getDynamicLayoutForList } from "./dynamicTemplate-BwzF9C1L.js";
7
+ import { n as substituteVariablesAsInlineMarkdownLiterals, r as validateVariables, t as substituteVariables } from "./helper-CEme39Uo.js";
8
8
  import "./tables.js";
9
9
  import "./lists.js";
10
10
  import { DEFAULT_FONT_NAME, ZOOM, b64toUint8Array, getDefaultFont, getFallbackFontName, getInternalLinkTarget, mm2pt, normalizeLinkHref, px2mm } from "@pdfme/common";
@@ -2476,14 +2476,14 @@ var renderLine = async (arg, schema, position, width, height) => linePdfRender({
2476
2476
  }
2477
2477
  });
2478
2478
  var createTextDiv = (schema) => {
2479
- const { borderWidth: bw, width, height, padding: pd } = schema;
2479
+ const contentArea = getBoxContentArea(schema);
2480
2480
  const textDiv = document.createElement("div");
2481
2481
  textDiv.style.position = "absolute";
2482
2482
  textDiv.style.zIndex = "1";
2483
- textDiv.style.width = `${width - bw.left - bw.right - pd.left - pd.right}mm`;
2484
- textDiv.style.height = `${height - bw.top - bw.bottom - pd.top - pd.bottom}mm`;
2485
- textDiv.style.top = `${bw.top + pd.top}mm`;
2486
- textDiv.style.left = `${bw.left + pd.left}mm`;
2483
+ textDiv.style.width = `${contentArea.width}mm`;
2484
+ textDiv.style.height = `${contentArea.height}mm`;
2485
+ textDiv.style.top = `${contentArea.topInset}mm`;
2486
+ textDiv.style.left = `${contentArea.leftInset}mm`;
2487
2487
  return textDiv;
2488
2488
  };
2489
2489
  var createLineDiv = (width, height, top, right, bottom, left, borderColor) => {
@@ -2501,7 +2501,8 @@ var createLineDiv = (width, height, top, right, bottom, left, borderColor) => {
2501
2501
  var cellSchema = {
2502
2502
  pdf: async (arg) => {
2503
2503
  const { schema } = arg;
2504
- const { position, width, height, borderWidth, padding } = schema;
2504
+ const { position, width, height, borderWidth } = schema;
2505
+ const contentArea = getBoxContentArea(schema);
2505
2506
  await Promise.all([
2506
2507
  rectanglePdfRender$1({
2507
2508
  ...arg,
@@ -2538,12 +2539,12 @@ var cellSchema = {
2538
2539
  ...schema,
2539
2540
  type: "text",
2540
2541
  backgroundColor: "",
2541
- position: {
2542
- x: position.x + borderWidth.left + padding.left,
2543
- y: position.y + borderWidth.top + padding.top
2544
- },
2545
- width: width - borderWidth.left - borderWidth.right - padding.left - padding.right,
2546
- height: height - borderWidth.top - borderWidth.bottom - padding.top - padding.bottom
2542
+ borderColor: "",
2543
+ borderWidth: createBoxDimension(0),
2544
+ padding: createBoxDimension(0),
2545
+ position: contentArea.position,
2546
+ width: contentArea.width,
2547
+ height: contentArea.height
2547
2548
  }
2548
2549
  });
2549
2550
  },
@@ -2556,7 +2557,10 @@ var cellSchema = {
2556
2557
  ...arg,
2557
2558
  schema: {
2558
2559
  ...schema,
2559
- backgroundColor: ""
2560
+ backgroundColor: "",
2561
+ borderColor: "",
2562
+ borderWidth: createBoxDimension(0),
2563
+ padding: createBoxDimension(0)
2560
2564
  },
2561
2565
  rootElement: textDiv
2562
2566
  });