@pdfme/schemas 6.1.1-dev.14 → 6.1.1-dev.17
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/dist/{builtins-IF8ozb_E.js → builtins-BNd4jd5D.js} +2 -2
- package/dist/{builtins-IF8ozb_E.js.map → builtins-BNd4jd5D.js.map} +1 -1
- package/dist/builtins.js +1 -1
- package/dist/dynamicLayout.js +2 -2
- package/dist/{dynamicTemplate-Fn7mpUsu.js → dynamicTemplate-BpD4RNw8.js} +1 -1
- package/dist/{dynamicTemplate-Fn7mpUsu.js.map → dynamicTemplate-BpD4RNw8.js.map} +1 -1
- package/dist/{dynamicTemplate-CB2Hj9cN.js → dynamicTemplate-CBvwRBx9.js} +2 -2
- package/dist/{dynamicTemplate-CB2Hj9cN.js.map → dynamicTemplate-CBvwRBx9.js.map} +1 -1
- package/dist/{helper-BJzBqIT4.js → helper-BFz9EwDz.js} +1 -1
- package/dist/{helper-BJzBqIT4.js.map → helper-BFz9EwDz.js.map} +1 -1
- package/dist/index.js +19 -42
- package/dist/index.js.map +1 -1
- package/dist/lists.js +1 -1
- package/dist/texts.js +1 -1
- package/dist/utils-Bd4CvhPZ.js +250 -0
- package/dist/utils-Bd4CvhPZ.js.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +3 -216
- package/package.json +1 -1
- package/dist/utils.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
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
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-
|
|
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
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 {
|
|
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-
|
|
7
|
-
import { n as substituteVariablesAsInlineMarkdownLiterals, r as validateVariables, t as substituteVariables } from "./helper-
|
|
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";
|
|
8
8
|
import "./tables.js";
|
|
9
9
|
import "./lists.js";
|
|
10
|
-
import { DEFAULT_FONT_NAME, ZOOM, b64toUint8Array, getDefaultFont, getFallbackFontName, mm2pt, px2mm } from "@pdfme/common";
|
|
10
|
+
import { DEFAULT_FONT_NAME, ZOOM, b64toUint8Array, getDefaultFont, getFallbackFontName, getInternalLinkTarget, mm2pt, normalizeLinkHref, px2mm } from "@pdfme/common";
|
|
11
11
|
import { Buffer as Buffer$1 } from "buffer";
|
|
12
12
|
import { toRadians } from "@pdfme/pdf-lib";
|
|
13
13
|
import { Barcode, Calendar, CalendarClock, ChevronDown, Circle, CircleDot, Clock, Image, List, Minus, QrCode, Route, Square, SquareCheck, Table, Type } from "lucide";
|
|
@@ -58,41 +58,6 @@ var pdfRender$3 = async (arg) => {
|
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region src/multiVariableText/variables.ts
|
|
62
|
-
var visitVariables = (content, visitor) => {
|
|
63
|
-
let startIndex = -1;
|
|
64
|
-
for (let i = 0; i < content.length; i++) {
|
|
65
|
-
const char = content[i];
|
|
66
|
-
if (char === "{") {
|
|
67
|
-
startIndex = i;
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
if (char === "}" && startIndex !== -1) {
|
|
71
|
-
const name = content.slice(startIndex + 1, i);
|
|
72
|
-
if (name.length > 0) visitor({
|
|
73
|
-
name,
|
|
74
|
-
startIndex,
|
|
75
|
-
endIndex: i
|
|
76
|
-
});
|
|
77
|
-
startIndex = -1;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
var countUniqueVariableNames = (content) => {
|
|
82
|
-
const variableNames = /* @__PURE__ */ new Set();
|
|
83
|
-
visitVariables(content, ({ name }) => {
|
|
84
|
-
variableNames.add(name);
|
|
85
|
-
});
|
|
86
|
-
return variableNames.size;
|
|
87
|
-
};
|
|
88
|
-
var getVariableNames = (content) => {
|
|
89
|
-
const variableNames = [];
|
|
90
|
-
visitVariables(content, ({ name }) => {
|
|
91
|
-
variableNames.push(name);
|
|
92
|
-
});
|
|
93
|
-
return variableNames;
|
|
94
|
-
};
|
|
95
|
-
//#endregion
|
|
96
61
|
//#region src/multiVariableText/propPanel.ts
|
|
97
62
|
var mapDynamicVariables = (props) => {
|
|
98
63
|
const { rootElement, changeSchemas, activeSchema, i18n, options } = props;
|
|
@@ -390,7 +355,7 @@ var renderSplitVariableSpans = (arg) => {
|
|
|
390
355
|
});
|
|
391
356
|
return;
|
|
392
357
|
}
|
|
393
|
-
const span = document.createElement("span");
|
|
358
|
+
const span = segment.run ? createStaticInlineMarkdownElement(segment.run) : document.createElement("span");
|
|
394
359
|
span.style.letterSpacing = lineIndex === lineSegments.length - 1 ? "0" : "inherit";
|
|
395
360
|
span.textContent = segment.text;
|
|
396
361
|
if (segment.run) applyInlineMarkdownStyle({
|
|
@@ -558,6 +523,7 @@ var applyInlineMarkdownStyle = (arg) => {
|
|
|
558
523
|
}
|
|
559
524
|
if (resolvedFont.syntheticItalic) element.style.fontStyle = "italic";
|
|
560
525
|
const textDecorations = [];
|
|
526
|
+
if (run.href) textDecorations.push("underline");
|
|
561
527
|
if (run.strikethrough) textDecorations.push("line-through");
|
|
562
528
|
if (textDecorations.length > 0) element.style.textDecoration = textDecorations.join(" ");
|
|
563
529
|
if (run.code) {
|
|
@@ -567,10 +533,21 @@ var applyInlineMarkdownStyle = (arg) => {
|
|
|
567
533
|
if (!schema.fontVariants?.code || !font[schema.fontVariants.code]) element.style.fontFamily = resolvedFont.fontName ? `'${resolvedFont.fontName}', monospace` : "monospace";
|
|
568
534
|
}
|
|
569
535
|
};
|
|
536
|
+
var createStaticInlineMarkdownElement = (run) => {
|
|
537
|
+
const href = run.href ? normalizeLinkHref(run.href) : void 0;
|
|
538
|
+
if (!href) return document.createElement("span");
|
|
539
|
+
const anchor = document.createElement("a");
|
|
540
|
+
anchor.href = href;
|
|
541
|
+
if (!getInternalLinkTarget(href)) {
|
|
542
|
+
anchor.target = "_blank";
|
|
543
|
+
anchor.rel = "noopener noreferrer";
|
|
544
|
+
}
|
|
545
|
+
return anchor;
|
|
546
|
+
};
|
|
570
547
|
var appendTextSpan = (arg) => {
|
|
571
548
|
const { textBlock, text, run, schema, font } = arg;
|
|
572
549
|
if (!text) return;
|
|
573
|
-
const span =
|
|
550
|
+
const span = createStaticInlineMarkdownElement(run);
|
|
574
551
|
span.textContent = text;
|
|
575
552
|
applyInlineMarkdownStyle({
|
|
576
553
|
element: span,
|