@pdfme/ui 6.1.2-dev.2 → 6.1.2-dev.21

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
@@ -45966,7 +45966,7 @@ var UIProps = CommonProps.extend({
45966
45966
  });
45967
45967
  var PreviewProps = UIProps.extend({ inputs: Inputs }).strict();
45968
45968
  var DesignerProps = UIProps.extend({}).strict();
45969
- var cloneDeep$1 = structuredClone;
45969
+ var cloneDeep$1 = (value) => structuredClone(value);
45970
45970
  var uniq = (array) => Array.from(new Set(array));
45971
45971
  var getFallbackFontName = (font) => {
45972
45972
  const initial = "";
@@ -46665,6 +46665,10 @@ var getDynamicTemplate = async (arg) => {
46665
46665
  const PARALLEL_LIMIT = 10;
46666
46666
  for (let pageIndex = 0; pageIndex < template.schemas.length; pageIndex++) {
46667
46667
  const pageSchemas = template.schemas[pageIndex];
46668
+ if (pageSchemas.length === 0) {
46669
+ resultPages.push([]);
46670
+ continue;
46671
+ }
46668
46672
  const { items, orderMap } = normalizePageSchemas(pageSchemas, paddingTop);
46669
46673
  for (let i = 0; i < items.length; i += PARALLEL_LIMIT) {
46670
46674
  const chunk = items.slice(i, i + PARALLEL_LIMIT);
@@ -46681,7 +46685,6 @@ var getDynamicTemplate = async (arg) => {
46681
46685
  const processedPages = processDynamicPage(items, orderMap, contentHeight, paddingTop);
46682
46686
  resultPages.push(...processedPages);
46683
46687
  }
46684
- removeTrailingEmptyPages(resultPages);
46685
46688
  if (resultPages.length === template.schemas.length) {
46686
46689
  let unchanged = true;
46687
46690
  for (let i = 0; i < resultPages.length && unchanged; i++) {
@@ -213907,7 +213910,7 @@ withProvider(FormCore, { Html: html });
213907
213910
  //#region ../../node_modules/form-render/es/index.js
213908
213911
  var es_default = withProvider(FormCore, widgets_exports);
213909
213912
  //#endregion
213910
- //#region ../schemas/dist/helper-CEme39Uo.js
213913
+ //#region ../schemas/dist/helper-Doen9Okh.js
213911
213914
  var substituteVariables = (text, variablesIn, valueMapper = (value) => value) => {
213912
213915
  if (!text) return "";
213913
213916
  let substitutedText = text;
@@ -213936,14 +213939,14 @@ var validateVariables = (value, schema) => {
213936
213939
  } catch {
213937
213940
  throw new SyntaxError(`[@pdfme/generator] invalid JSON string '${value}' for variables in field ${schema.name}`);
213938
213941
  }
213939
- for (const variable of schema.variables) if (!values[variable]) {
213942
+ for (const variable of schema.variables) if (!Object.prototype.hasOwnProperty.call(values, variable) || values[variable] === null || values[variable] === void 0) {
213940
213943
  if (schema.required) throw new Error(`[@pdfme/generator] variable ${variable} is missing for field ${schema.name}`);
213941
213944
  return false;
213942
213945
  }
213943
213946
  return true;
213944
213947
  };
213945
213948
  //#endregion
213946
- //#region ../schemas/dist/dynamicTemplate-C7MdZxPm.js
213949
+ //#region ../schemas/dist/dynamicTemplate-CRjx4Mjc.js
213947
213950
  var getDynamicLayoutForMultiVariableText = async (value, args) => {
213948
213951
  if (args.schema.type !== "multiVariableText") return { heights: [args.schema.height] };
213949
213952
  const schema = args.schema;