@pdfme/ui 6.1.4-dev.4 → 6.1.5-dev.10

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/index.js CHANGED
@@ -45988,7 +45988,7 @@ function parseExpressionAt(input, pos, options) {
45988
45988
  }
45989
45989
  //#endregion
45990
45990
  //#region ../common/dist/index.js
45991
- var PDFME_VERSION = "6.1.4";
45991
+ var PDFME_VERSION = "6.1.5";
45992
45992
  var PAGE_SIZE_PRESETS = {
45993
45993
  A3: {
45994
45994
  width: 297,
@@ -98926,7 +98926,7 @@ $d636bc798e7178db$export$36b2f24e97d43be($21ee218f84ac7f32$export$2e2bcd8739ae03
98926
98926
  $d636bc798e7178db$export$36b2f24e97d43be($cd5853a56c68fec7$export$2e2bcd8739ae039);
98927
98927
  $d636bc798e7178db$export$36b2f24e97d43be($05f49f930186144e$export$2e2bcd8739ae039);
98928
98928
  //#endregion
98929
- //#region ../schemas/dist/splitRange-Dh3WRCAN.js
98929
+ //#region ../schemas/dist/splitRange-BOUo4Tvl.js
98930
98930
  var ALIGN_LEFT = "left";
98931
98931
  var ALIGN_CENTER = "center";
98932
98932
  var ALIGN_RIGHT = "right";
@@ -99167,16 +99167,28 @@ var fetchRemoteFontData = async (url) => {
99167
99167
  var getFontKitFont = async (fontName, font, _cache) => {
99168
99168
  const fntNm = fontName || getFallbackFontName(font);
99169
99169
  const cacheKey = getCacheKey(fntNm);
99170
- if (_cache.has(cacheKey)) return _cache.get(cacheKey);
99171
- let fontData = (font[fntNm] || getFallbackFont(font) || getDefaultFont()["Roboto"]).data;
99172
- if (typeof fontData === "string") if (fontData.startsWith("http")) fontData = await fetchRemoteFontData(fontData);
99173
- else fontData = b64toUint8Array(fontData);
99174
- let fontDataBuffer;
99175
- if (fontData instanceof Buffer$1) fontDataBuffer = fontData;
99176
- else fontDataBuffer = Buffer$1.from(fontData);
99177
- const fontKitFont = $d636bc798e7178db$export$185802fd694ee1f5(fontDataBuffer);
99178
- _cache.set(cacheKey, fontKitFont);
99179
- return fontKitFont;
99170
+ const fontCache = _cache;
99171
+ const cachedFont = fontCache.get(cacheKey);
99172
+ if (cachedFont) return await cachedFont;
99173
+ const currentFont = font[fntNm] || getFallbackFont(font) || getDefaultFont()["Roboto"];
99174
+ const fontKitFontPromise = (async () => {
99175
+ let fontData = currentFont.data;
99176
+ if (typeof fontData === "string") if (fontData.startsWith("http")) fontData = await fetchRemoteFontData(fontData);
99177
+ else fontData = b64toUint8Array(fontData);
99178
+ let fontDataBuffer;
99179
+ if (fontData instanceof Buffer$1) fontDataBuffer = fontData;
99180
+ else fontDataBuffer = Buffer$1.from(fontData);
99181
+ return $d636bc798e7178db$export$185802fd694ee1f5(fontDataBuffer);
99182
+ })();
99183
+ fontCache.set(cacheKey, fontKitFontPromise);
99184
+ try {
99185
+ const fontKitFont = await fontKitFontPromise;
99186
+ fontCache.set(cacheKey, fontKitFont);
99187
+ return fontKitFont;
99188
+ } catch (error) {
99189
+ if (fontCache.get(cacheKey) === fontKitFontPromise) fontCache.delete(cacheKey);
99190
+ throw error;
99191
+ }
99180
99192
  };
99181
99193
  /**
99182
99194
  * If using dynamic font size, iteratively increment or decrement the
@@ -99392,7 +99404,7 @@ var createTextLineSplitRange = (start, end) => createDynamicLayoutSplitRange(TEX
99392
99404
  var getTableBodyRange = (schema) => getDynamicLayoutSplitRange(schema, TABLE_BODY_SPLIT_UNIT);
99393
99405
  var getTextLineRange = (schema) => getDynamicLayoutSplitRange(schema, TEXT_LINE_SPLIT_UNIT);
99394
99406
  //#endregion
99395
- //#region ../schemas/dist/measure-egCJqCr0.js
99407
+ //#region ../schemas/dist/measure-_MO-Voz3.js
99396
99408
  var MARKDOWN_ESCAPABLE_CHARS = new Set([
99397
99409
  "\\",
99398
99410
  "*",
@@ -99991,7 +100003,7 @@ var getRichTextLineHeight = (line, fontSize) => {
99991
100003
  return Math.max(...line.runs.map((run) => heightOfFontAtSize(run.fontKitFont, fontSize)));
99992
100004
  };
99993
100005
  //#endregion
99994
- //#region ../schemas/dist/dynamicTemplate-CXBCt5wk.js
100006
+ //#region ../schemas/dist/dynamicTemplate-C9FSccAm.js
99995
100007
  function _typeof$18(o) {
99996
100008
  "@babel/helpers - typeof";
99997
100009
  return _typeof$18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -100555,7 +100567,7 @@ var getDynamicLayoutForTable = async (value, args) => {
100555
100567
  };
100556
100568
  };
100557
100569
  //#endregion
100558
- //#region ../schemas/dist/utils-TWv_zwgS.js
100570
+ //#region ../schemas/dist/utils-B8i6Nc_7.js
100559
100571
  var convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = true }) => {
100560
100572
  const { width: mmWidth, height: mmHeight, position, rotate, opacity } = schema;
100561
100573
  const { x: mmX, y: mmY } = position;
@@ -100845,7 +100857,7 @@ var Underline = [["path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }], ["line", {
100845
100857
  y2: "20"
100846
100858
  }]];
100847
100859
  //#endregion
100848
- //#region ../schemas/dist/builtins-6irEILr7.js
100860
+ //#region ../schemas/dist/builtins-Bs4Z7Q4K.js
100849
100861
  var addUriLinkAnnotation = (arg) => {
100850
100862
  const { pdfDoc, page, uri, rect, borderWidth = 0 } = arg;
100851
100863
  const safeUri = normalizeSafeLinkUri(uri);
@@ -214385,7 +214397,7 @@ function _regeneratorRuntime() {
214385
214397
  //#region ../../node_modules/form-render/es/index.js
214386
214398
  var es_default = withProvider(FormCore, widgets_exports);
214387
214399
  //#endregion
214388
- //#region ../schemas/dist/helper-DvnX6Fyq.js
214400
+ //#region ../schemas/dist/helper-CbU88kUO.js
214389
214401
  var substituteVariables = (text, variablesIn, valueMapper = (value) => value) => {
214390
214402
  if (!text) return "";
214391
214403
  let substitutedText = text;
@@ -214421,7 +214433,7 @@ var validateVariables = (value, schema) => {
214421
214433
  return true;
214422
214434
  };
214423
214435
  //#endregion
214424
- //#region ../schemas/dist/dynamicTemplate-B5BkzQ4n.js
214436
+ //#region ../schemas/dist/dynamicTemplate-DILLiIp6.js
214425
214437
  var getDynamicLayoutForMultiVariableText = async (value, args) => {
214426
214438
  if (args.schema.type !== "multiVariableText") return { heights: [args.schema.height] };
214427
214439
  const schema = args.schema;
@@ -236669,7 +236681,7 @@ var Designer = class extends BaseUIClass {
236669
236681
  }
236670
236682
  };
236671
236683
  //#endregion
236672
- //#region ../schemas/dist/dynamicTemplate-DFzbqkhF.js
236684
+ //#region ../schemas/dist/dynamicTemplate-C4UKzQbP.js
236673
236685
  var normalizeListItems = (value) => {
236674
236686
  if (Array.isArray(value)) return value.map((item) => String(item));
236675
236687
  if (typeof value !== "string") return value == null ? [] : [String(value)];