@pixldocs/canvas-renderer 0.5.233 → 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) {
@@ -21103,9 +21115,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
21103
21115
  }
21104
21116
  return svgString;
21105
21117
  }
21106
- const resolvedPackageVersion = "0.5.233";
21118
+ const resolvedPackageVersion = "0.5.234";
21107
21119
  const PACKAGE_VERSION = resolvedPackageVersion;
21108
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.233";
21120
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.234";
21109
21121
  const roundParityValue = (value) => {
21110
21122
  if (typeof value !== "number") return value;
21111
21123
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -21849,7 +21861,7 @@ class PixldocsRenderer {
21849
21861
  await this.waitForCanvasScene(container, cloned, i);
21850
21862
  }
21851
21863
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
21852
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DTCd5GSf.cjs"));
21864
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Bf3z99NE.cjs"));
21853
21865
  const prepared = preparePagesForExport(
21854
21866
  cloned.pages,
21855
21867
  canvasWidth,
@@ -24169,7 +24181,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
24169
24181
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
24170
24182
  sanitizeSvgTreeForPdf(svgToDraw);
24171
24183
  try {
24172
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DTCd5GSf.cjs"));
24184
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Bf3z99NE.cjs"));
24173
24185
  try {
24174
24186
  await logTextMeasurementDiagnostic(svgToDraw);
24175
24187
  } catch {
@@ -24566,4 +24578,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
24566
24578
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
24567
24579
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
24568
24580
  exports.warmTemplateFromForm = warmTemplateFromForm;
24569
- //# sourceMappingURL=index-3rzFNy2Z.cjs.map
24581
+ //# sourceMappingURL=index-DQRByRIO.cjs.map