@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.
@@ -13386,6 +13386,14 @@ const PageCanvas = react.forwardRef(
13386
13386
  clearMeasurementCache();
13387
13387
  }
13388
13388
  doSyncRef.current();
13389
+ if ((isPreviewMode || isExportMode) && fc && (pageChildren == null ? void 0 : pageChildren.length)) {
13390
+ runFontReloadAndReflow({
13391
+ canvas: fc,
13392
+ pageTree: pageChildren,
13393
+ pageBoundsOptions,
13394
+ preserveGlobalFontCache
13395
+ });
13396
+ }
13389
13397
  if (isPreviewMode && fc && (fc.width ?? 0) > 0 && (fc.height ?? 0) > 0) {
13390
13398
  fc.requestRenderAll();
13391
13399
  }
@@ -19452,10 +19460,10 @@ async function resolveTemplateData(options) {
19452
19460
  const inlineFormSchema = template.form_schema;
19453
19461
  const defaultData = template.default_data;
19454
19462
  if (inlineFormSchema && typeof inlineFormSchema === "object") {
19455
- if (!Array.isArray(config.dynamicFields) && Array.isArray(inlineFormSchema.dynamicFields)) {
19463
+ if ((!Array.isArray(config.dynamicFields) || config.dynamicFields.length === 0) && Array.isArray(inlineFormSchema.dynamicFields)) {
19456
19464
  config.dynamicFields = inlineFormSchema.dynamicFields;
19457
19465
  }
19458
- if (!Array.isArray(config.fieldGroups) && Array.isArray(inlineFormSchema.fieldGroups)) {
19466
+ if ((!Array.isArray(config.fieldGroups) || config.fieldGroups.length === 0) && Array.isArray(inlineFormSchema.fieldGroups)) {
19459
19467
  config.fieldGroups = inlineFormSchema.fieldGroups;
19460
19468
  }
19461
19469
  }
@@ -19536,10 +19544,10 @@ async function resolveFromForm(options) {
19536
19544
  const templateFormSchema = templateRow.form_schema;
19537
19545
  const formSchema = (formSchemaRow == null ? void 0 : formSchemaRow.schema) ?? void 0;
19538
19546
  if (templateFormSchema) {
19539
- if (!Array.isArray(templateConfig.dynamicFields) && Array.isArray(templateFormSchema.dynamicFields)) {
19547
+ if ((!Array.isArray(templateConfig.dynamicFields) || templateConfig.dynamicFields.length === 0) && Array.isArray(templateFormSchema.dynamicFields)) {
19540
19548
  templateConfig.dynamicFields = templateFormSchema.dynamicFields;
19541
19549
  }
19542
- if (!Array.isArray(templateConfig.fieldGroups) && Array.isArray(templateFormSchema.fieldGroups)) {
19550
+ if ((!Array.isArray(templateConfig.fieldGroups) || templateConfig.fieldGroups.length === 0) && Array.isArray(templateFormSchema.fieldGroups)) {
19543
19551
  templateConfig.fieldGroups = templateFormSchema.fieldGroups;
19544
19552
  }
19545
19553
  }
@@ -19586,7 +19594,11 @@ async function resolveFromForm(options) {
19586
19594
  mergedSectionState = mergeRepeatableEntryMeta(mergedSectionState, templateDefaultMetaSectionState, inferredSections);
19587
19595
  mergedSectionState = mergeRepeatableEntryMeta(mergedSectionState, defaultFormMetaSectionState, inferredSections);
19588
19596
  mergedSectionState = sanitizeSectionStateAgainstSchema(mergedSectionState, formSchema);
19589
- const flatFormData = flattenSectionStateToFormData(mergedSectionState, inferredSections);
19597
+ const sectionFlatFormData = flattenSectionStateToFormData(mergedSectionState, inferredSections);
19598
+ const flatFormData = {
19599
+ ...sectionFlatFormData,
19600
+ ...directFlatFormData && typeof directFlatFormData === "object" ? directFlatFormData : {}
19601
+ };
19590
19602
  const dynamicFields = templateConfig.dynamicFields || [];
19591
19603
  const mappings = [];
19592
19604
  for (const field of dynamicFields) {
@@ -19990,7 +20002,6 @@ async function resolveForRender(input) {
19990
20002
  sectionState,
19991
20003
  flatFormData,
19992
20004
  themeId,
19993
- watermark,
19994
20005
  prefetched,
19995
20006
  supabaseUrl,
19996
20007
  supabaseAnonKey
@@ -21104,9 +21115,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
21104
21115
  }
21105
21116
  return svgString;
21106
21117
  }
21107
- const resolvedPackageVersion = "0.5.232";
21118
+ const resolvedPackageVersion = "0.5.234";
21108
21119
  const PACKAGE_VERSION = resolvedPackageVersion;
21109
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.232";
21120
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.234";
21110
21121
  const roundParityValue = (value) => {
21111
21122
  if (typeof value !== "number") return value;
21112
21123
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -21850,7 +21861,7 @@ class PixldocsRenderer {
21850
21861
  await this.waitForCanvasScene(container, cloned, i);
21851
21862
  }
21852
21863
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
21853
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-HZtiPy3x.cjs"));
21864
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Bf3z99NE.cjs"));
21854
21865
  const prepared = preparePagesForExport(
21855
21866
  cloned.pages,
21856
21867
  canvasWidth,
@@ -24170,7 +24181,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
24170
24181
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
24171
24182
  sanitizeSvgTreeForPdf(svgToDraw);
24172
24183
  try {
24173
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-HZtiPy3x.cjs"));
24184
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Bf3z99NE.cjs"));
24174
24185
  try {
24175
24186
  await logTextMeasurementDiagnostic(svgToDraw);
24176
24187
  } catch {
@@ -24567,4 +24578,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
24567
24578
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
24568
24579
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
24569
24580
  exports.warmTemplateFromForm = warmTemplateFromForm;
24570
- //# sourceMappingURL=index-BqnHjSp9.cjs.map
24581
+ //# sourceMappingURL=index-DQRByRIO.cjs.map