@pixldocs/canvas-renderer 0.5.232 → 0.5.234

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.
@@ -13368,6 +13368,14 @@ const PageCanvas = forwardRef(
13368
13368
  clearMeasurementCache();
13369
13369
  }
13370
13370
  doSyncRef.current();
13371
+ if ((isPreviewMode || isExportMode) && fc && (pageChildren == null ? void 0 : pageChildren.length)) {
13372
+ runFontReloadAndReflow({
13373
+ canvas: fc,
13374
+ pageTree: pageChildren,
13375
+ pageBoundsOptions,
13376
+ preserveGlobalFontCache
13377
+ });
13378
+ }
13371
13379
  if (isPreviewMode && fc && (fc.width ?? 0) > 0 && (fc.height ?? 0) > 0) {
13372
13380
  fc.requestRenderAll();
13373
13381
  }
@@ -19434,10 +19442,10 @@ async function resolveTemplateData(options) {
19434
19442
  const inlineFormSchema = template.form_schema;
19435
19443
  const defaultData = template.default_data;
19436
19444
  if (inlineFormSchema && typeof inlineFormSchema === "object") {
19437
- if (!Array.isArray(config.dynamicFields) && Array.isArray(inlineFormSchema.dynamicFields)) {
19445
+ if ((!Array.isArray(config.dynamicFields) || config.dynamicFields.length === 0) && Array.isArray(inlineFormSchema.dynamicFields)) {
19438
19446
  config.dynamicFields = inlineFormSchema.dynamicFields;
19439
19447
  }
19440
- if (!Array.isArray(config.fieldGroups) && Array.isArray(inlineFormSchema.fieldGroups)) {
19448
+ if ((!Array.isArray(config.fieldGroups) || config.fieldGroups.length === 0) && Array.isArray(inlineFormSchema.fieldGroups)) {
19441
19449
  config.fieldGroups = inlineFormSchema.fieldGroups;
19442
19450
  }
19443
19451
  }
@@ -19518,10 +19526,10 @@ async function resolveFromForm(options) {
19518
19526
  const templateFormSchema = templateRow.form_schema;
19519
19527
  const formSchema = (formSchemaRow == null ? void 0 : formSchemaRow.schema) ?? void 0;
19520
19528
  if (templateFormSchema) {
19521
- if (!Array.isArray(templateConfig.dynamicFields) && Array.isArray(templateFormSchema.dynamicFields)) {
19529
+ if ((!Array.isArray(templateConfig.dynamicFields) || templateConfig.dynamicFields.length === 0) && Array.isArray(templateFormSchema.dynamicFields)) {
19522
19530
  templateConfig.dynamicFields = templateFormSchema.dynamicFields;
19523
19531
  }
19524
- if (!Array.isArray(templateConfig.fieldGroups) && Array.isArray(templateFormSchema.fieldGroups)) {
19532
+ if ((!Array.isArray(templateConfig.fieldGroups) || templateConfig.fieldGroups.length === 0) && Array.isArray(templateFormSchema.fieldGroups)) {
19525
19533
  templateConfig.fieldGroups = templateFormSchema.fieldGroups;
19526
19534
  }
19527
19535
  }
@@ -19568,7 +19576,11 @@ async function resolveFromForm(options) {
19568
19576
  mergedSectionState = mergeRepeatableEntryMeta(mergedSectionState, templateDefaultMetaSectionState, inferredSections);
19569
19577
  mergedSectionState = mergeRepeatableEntryMeta(mergedSectionState, defaultFormMetaSectionState, inferredSections);
19570
19578
  mergedSectionState = sanitizeSectionStateAgainstSchema(mergedSectionState, formSchema);
19571
- const flatFormData = flattenSectionStateToFormData(mergedSectionState, inferredSections);
19579
+ const sectionFlatFormData = flattenSectionStateToFormData(mergedSectionState, inferredSections);
19580
+ const flatFormData = {
19581
+ ...sectionFlatFormData,
19582
+ ...directFlatFormData && typeof directFlatFormData === "object" ? directFlatFormData : {}
19583
+ };
19572
19584
  const dynamicFields = templateConfig.dynamicFields || [];
19573
19585
  const mappings = [];
19574
19586
  for (const field of dynamicFields) {
@@ -19972,7 +19984,6 @@ async function resolveForRender(input) {
19972
19984
  sectionState,
19973
19985
  flatFormData,
19974
19986
  themeId,
19975
- watermark,
19976
19987
  prefetched,
19977
19988
  supabaseUrl,
19978
19989
  supabaseAnonKey
@@ -21086,9 +21097,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
21086
21097
  }
21087
21098
  return svgString;
21088
21099
  }
21089
- const resolvedPackageVersion = "0.5.232";
21100
+ const resolvedPackageVersion = "0.5.234";
21090
21101
  const PACKAGE_VERSION = resolvedPackageVersion;
21091
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.232";
21102
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.234";
21092
21103
  const roundParityValue = (value) => {
21093
21104
  if (typeof value !== "number") return value;
21094
21105
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -21832,7 +21843,7 @@ class PixldocsRenderer {
21832
21843
  await this.waitForCanvasScene(container, cloned, i);
21833
21844
  }
21834
21845
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
21835
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BcNEn5nI.js");
21846
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DZm2JXde.js");
21836
21847
  const prepared = preparePagesForExport(
21837
21848
  cloned.pages,
21838
21849
  canvasWidth,
@@ -24152,7 +24163,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
24152
24163
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
24153
24164
  sanitizeSvgTreeForPdf(svgToDraw);
24154
24165
  try {
24155
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BcNEn5nI.js");
24166
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DZm2JXde.js");
24156
24167
  try {
24157
24168
  await logTextMeasurementDiagnostic(svgToDraw);
24158
24169
  } catch {
@@ -24552,4 +24563,4 @@ export {
24552
24563
  buildTeaserBlurFlatKeys as y,
24553
24564
  collectFontDescriptorsFromConfig as z
24554
24565
  };
24555
- //# sourceMappingURL=index-DlrTh8y7.js.map
24566
+ //# sourceMappingURL=index-BStk6K2C.js.map