@pixldocs/canvas-renderer 0.5.219 → 0.5.220
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-CBB2UdwF.cjs → index-DRHaeOxK.cjs} +21 -14
- package/dist/{index-CBB2UdwF.cjs.map → index-DRHaeOxK.cjs.map} +1 -1
- package/dist/{index-DbUPI6zs.js → index-KtRZhEPi.js} +21 -14
- package/dist/{index-DbUPI6zs.js.map → index-KtRZhEPi.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-Dejgf_PM.js → vectorPdfExport-D5bhT-57.js} +4 -4
- package/dist/{vectorPdfExport-Dejgf_PM.js.map → vectorPdfExport-D5bhT-57.js.map} +1 -1
- package/dist/{vectorPdfExport-CwyiHDGD.cjs → vectorPdfExport-UBFTDrVt.cjs} +4 -4
- package/dist/{vectorPdfExport-CwyiHDGD.cjs.map → vectorPdfExport-UBFTDrVt.cjs.map} +1 -1
- package/package.json +1 -1
|
@@ -13644,7 +13644,9 @@ function formDefSectionsToInferred(schemaSections, repeatableNodeMap) {
|
|
|
13644
13644
|
function convert(defs, parentId) {
|
|
13645
13645
|
var _a, _b;
|
|
13646
13646
|
for (const def of defs) {
|
|
13647
|
-
|
|
13647
|
+
const isRepeatable = def.repeatable === true || def.type === "repeatable";
|
|
13648
|
+
const defFields = def.fields ?? def.entryFields ?? [];
|
|
13649
|
+
if (isRepeatable) {
|
|
13648
13650
|
const rawPrefix = def.templateKeyPrefix || def.label.toLowerCase().replace(/\s+/g, "_");
|
|
13649
13651
|
const labelPrefix = rawPrefix.startsWith("field_") ? rawPrefix : `field_${rawPrefix}`;
|
|
13650
13652
|
const treeNodeId = repeatableNodeMap == null ? void 0 : repeatableNodeMap.get(def.label.trim().toLowerCase());
|
|
@@ -13658,7 +13660,7 @@ function formDefSectionsToInferred(schemaSections, repeatableNodeMap) {
|
|
|
13658
13660
|
templateKeyPrefix: prefix,
|
|
13659
13661
|
minEntries,
|
|
13660
13662
|
maxEntries: def.maxEntries,
|
|
13661
|
-
entryFields:
|
|
13663
|
+
entryFields: defFields.map((f, i) => ({
|
|
13662
13664
|
key: f.key,
|
|
13663
13665
|
label: f.label,
|
|
13664
13666
|
type: mapFormDefFieldType(f.type),
|
|
@@ -13683,7 +13685,7 @@ function formDefSectionsToInferred(schemaSections, repeatableNodeMap) {
|
|
|
13683
13685
|
label: def.label,
|
|
13684
13686
|
order: def.order ?? 0,
|
|
13685
13687
|
type: "single",
|
|
13686
|
-
fields:
|
|
13688
|
+
fields: defFields.map((f, i) => ({
|
|
13687
13689
|
key: f.key,
|
|
13688
13690
|
label: f.label,
|
|
13689
13691
|
type: mapFormDefFieldType(f.type),
|
|
@@ -17294,7 +17296,7 @@ function repeatablePageToSection(page) {
|
|
|
17294
17296
|
label: page.label,
|
|
17295
17297
|
description: page.description,
|
|
17296
17298
|
order: typeof page.order === "number" ? page.order + 1e4 : 1e4,
|
|
17297
|
-
fields: page.fields,
|
|
17299
|
+
fields: page.fields ?? page.entryFields ?? [],
|
|
17298
17300
|
repeatable: true,
|
|
17299
17301
|
minEntries: page.minEntries,
|
|
17300
17302
|
maxEntries: page.maxEntries,
|
|
@@ -17664,7 +17666,8 @@ async function resolveFromForm(options) {
|
|
|
17664
17666
|
(repeatableFromSchema ?? []).map((r) => [baseId(r.nodeId), r])
|
|
17665
17667
|
);
|
|
17666
17668
|
const topLevelRepeatables = inferredSections.filter((s) => s.type === "repeatable" && !s.parentId).map((s) => {
|
|
17667
|
-
const
|
|
17669
|
+
const rawEntries = mergedSectionState[s.id];
|
|
17670
|
+
const entries = Array.isArray(rawEntries) ? rawEntries : [];
|
|
17668
17671
|
const nodeId = s.treeNodeId ?? s.id;
|
|
17669
17672
|
const schemaRepeatable = repeatableFromSchemaByBase.get(baseId(nodeId));
|
|
17670
17673
|
const entryMeta = entries.map((e) => getRepeatableEntryMeta(e, s));
|
|
@@ -17676,11 +17679,13 @@ async function resolveFromForm(options) {
|
|
|
17676
17679
|
const parentId = s.parentId;
|
|
17677
17680
|
const parentSection = inferredSections.find((ps) => ps.id === parentId);
|
|
17678
17681
|
const parentNodeId = parentSection ? parentSection.treeNodeId ?? parentSection.id : parentId;
|
|
17679
|
-
const
|
|
17682
|
+
const rawParentEntries = mergedSectionState[parentId];
|
|
17683
|
+
const parentEntries = Array.isArray(rawParentEntries) ? rawParentEntries : [];
|
|
17680
17684
|
const nestedEntryMeta = {};
|
|
17681
17685
|
const merged = [];
|
|
17682
17686
|
for (let pi = 0; pi < parentEntries.length; pi++) {
|
|
17683
|
-
const
|
|
17687
|
+
const rawChildEntries = mergedSectionState[`${parentId}_${pi}_${s.id}`];
|
|
17688
|
+
const childEntries = Array.isArray(rawChildEntries) ? rawChildEntries : [];
|
|
17684
17689
|
const meta = childEntries.map((e) => getRepeatableEntryMeta(e, s));
|
|
17685
17690
|
nestedEntryMeta[`${baseId(parentNodeId)}_${pi + 1}_${baseId(nodeId)}`] = meta;
|
|
17686
17691
|
merged.push(...meta);
|
|
@@ -17720,13 +17725,15 @@ async function resolveFromForm(options) {
|
|
|
17720
17725
|
if (s.type !== "repeatable") continue;
|
|
17721
17726
|
const parentId = s.parentId;
|
|
17722
17727
|
if (parentId == null) continue;
|
|
17723
|
-
const
|
|
17728
|
+
const rawParentEntries2 = mergedSectionState[parentId];
|
|
17729
|
+
const parentEntries = Array.isArray(rawParentEntries2) ? rawParentEntries2 : [];
|
|
17724
17730
|
const parentSection = inferredSections.find((ps) => ps.id === parentId);
|
|
17725
17731
|
const parentTreeNodeId = parentSection ? parentSection.treeNodeId ?? parentSection.id : parentId;
|
|
17726
17732
|
const childTreeNodeId = s.treeNodeId ?? s.id;
|
|
17727
17733
|
for (let pi = 0; pi < parentEntries.length; pi++) {
|
|
17728
17734
|
const compositeKey = `${parentId}_${pi}_${s.id}`;
|
|
17729
|
-
const
|
|
17735
|
+
const rawEntries2 = mergedSectionState[compositeKey];
|
|
17736
|
+
const entries = Array.isArray(rawEntries2) ? rawEntries2 : [];
|
|
17730
17737
|
const nestedKey = `${baseId(parentTreeNodeId)}_${pi + 1}_${baseId(childTreeNodeId)}`;
|
|
17731
17738
|
repeatableNestedEntryCounts[nestedKey] = Math.max(1, entries.length);
|
|
17732
17739
|
}
|
|
@@ -19085,9 +19092,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
19085
19092
|
}
|
|
19086
19093
|
return svgString;
|
|
19087
19094
|
}
|
|
19088
|
-
const resolvedPackageVersion = "0.5.
|
|
19095
|
+
const resolvedPackageVersion = "0.5.220";
|
|
19089
19096
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
19090
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
19097
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.220";
|
|
19091
19098
|
const roundParityValue = (value) => {
|
|
19092
19099
|
if (typeof value !== "number") return value;
|
|
19093
19100
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19831,7 +19838,7 @@ class PixldocsRenderer {
|
|
|
19831
19838
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19832
19839
|
}
|
|
19833
19840
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
19834
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
19841
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-UBFTDrVt.cjs"));
|
|
19835
19842
|
const prepared = preparePagesForExport(
|
|
19836
19843
|
cloned.pages,
|
|
19837
19844
|
canvasWidth,
|
|
@@ -22021,7 +22028,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
22021
22028
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
22022
22029
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
22023
22030
|
try {
|
|
22024
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
22031
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-UBFTDrVt.cjs"));
|
|
22025
22032
|
try {
|
|
22026
22033
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
22027
22034
|
} catch {
|
|
@@ -22418,4 +22425,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
22418
22425
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
22419
22426
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
22420
22427
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
22421
|
-
//# sourceMappingURL=index-
|
|
22428
|
+
//# sourceMappingURL=index-DRHaeOxK.cjs.map
|