@pixldocs/canvas-renderer 0.5.202 → 0.5.204
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-BVNRSs-v.js → index-BfLA9Iqt.js} +50 -25
- package/dist/{index-BVNRSs-v.js.map → index-BfLA9Iqt.js.map} +1 -1
- package/dist/{index-BfMO-VrX.cjs → index-pfkM2NbI.cjs} +50 -25
- package/dist/{index-BfMO-VrX.cjs.map → index-pfkM2NbI.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DCyVRj7e.cjs → vectorPdfExport-BzQh8tO6.cjs} +4 -4
- package/dist/{vectorPdfExport-DCyVRj7e.cjs.map → vectorPdfExport-BzQh8tO6.cjs.map} +1 -1
- package/dist/{vectorPdfExport-Gj3lwAgo.js → vectorPdfExport-NpBdL1eb.js} +4 -4
- package/dist/{vectorPdfExport-Gj3lwAgo.js.map → vectorPdfExport-NpBdL1eb.js.map} +1 -1
- package/package.json +1 -1
|
@@ -13143,22 +13143,35 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
13143
13143
|
}
|
|
13144
13144
|
return false;
|
|
13145
13145
|
};
|
|
13146
|
-
const
|
|
13147
|
-
if (!(dynamicFields == null ? void 0 : dynamicFields.length)) return
|
|
13146
|
+
const getFieldsForRepeatableKey = (fieldId, fullKey) => {
|
|
13147
|
+
if (!(dynamicFields == null ? void 0 : dynamicFields.length)) return [];
|
|
13148
|
+
const matches = [];
|
|
13149
|
+
const add = (field) => {
|
|
13150
|
+
if (field && !matches.some((existing) => existing.id === field.id)) matches.push(field);
|
|
13151
|
+
};
|
|
13148
13152
|
if (fullKey) {
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13153
|
+
add(dynamicFields.find((f) => f.id === fullKey));
|
|
13154
|
+
const nestedMatch = fullKey.match(NESTED_REPEATABLE_KEY_REGEX);
|
|
13155
|
+
if (nestedMatch) {
|
|
13156
|
+
const [, parentId, , childId, , suffix] = nestedMatch;
|
|
13157
|
+
add(dynamicFields.find((f) => f.id === `field_${parentId}_N_field_${childId}_N_${suffix}`));
|
|
13158
|
+
} else {
|
|
13159
|
+
const match = fullKey.match(REPEATABLE_KEY_REGEX);
|
|
13160
|
+
if (match) {
|
|
13161
|
+
const [, nodeId, , suffix] = match;
|
|
13162
|
+
add(dynamicFields.find((f) => f.id === `field_${nodeId}_N_${suffix}`));
|
|
13163
|
+
}
|
|
13164
|
+
}
|
|
13165
|
+
}
|
|
13166
|
+
add(dynamicFields.find((f) => f.id === fieldId));
|
|
13167
|
+
for (const f of dynamicFields) {
|
|
13168
|
+
if ((f.mappings ?? []).some((m) => (m == null ? void 0 : m.elementId) === fieldId)) add(f);
|
|
13169
|
+
}
|
|
13170
|
+
for (const f of dynamicFields) {
|
|
13171
|
+
if (f.id.endsWith(`_N_${fieldId}`)) add(f);
|
|
13172
|
+
else if (f.id.endsWith(`_${fieldId}`) && f.id.includes("_N_")) add(f);
|
|
13173
|
+
}
|
|
13174
|
+
return matches;
|
|
13162
13175
|
};
|
|
13163
13176
|
if (dynamicFields == null ? void 0 : dynamicFields.length) {
|
|
13164
13177
|
for (const key of Object.keys(formValues)) {
|
|
@@ -13166,8 +13179,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
13166
13179
|
if (nestedMatch) {
|
|
13167
13180
|
const [, parentId, parentIndexStr, childId, childIndexStr, fieldId] = nestedMatch;
|
|
13168
13181
|
const value = formValues[key];
|
|
13169
|
-
const
|
|
13170
|
-
for (const
|
|
13182
|
+
const fields = getFieldsForRepeatableKey(fieldId, key);
|
|
13183
|
+
for (const field of fields) for (const mapping of field.mappings ?? []) {
|
|
13171
13184
|
const oldElementId = mapping.elementId;
|
|
13172
13185
|
const mapKeyByElement = `${baseId(parentId)}_${parentIndexStr}_${baseId(childId)}_${childIndexStr}_${oldElementId}`;
|
|
13173
13186
|
let elementIds = resolvedIdMap.get(mapKeyByElement);
|
|
@@ -13218,8 +13231,8 @@ function applyFormDataToConfig(config, mappings, formValues, repeatableSectionsF
|
|
|
13218
13231
|
if (!match) continue;
|
|
13219
13232
|
const [, nodeId, indexStr, fieldId] = match;
|
|
13220
13233
|
const value = formValues[key];
|
|
13221
|
-
const
|
|
13222
|
-
for (const
|
|
13234
|
+
const fields = getFieldsForRepeatableKey(fieldId, key);
|
|
13235
|
+
for (const field of fields) for (const mapping of field.mappings ?? []) {
|
|
13223
13236
|
const oldElementId = mapping.elementId;
|
|
13224
13237
|
const elementIds = /* @__PURE__ */ new Set();
|
|
13225
13238
|
for (const candidateBaseId of getRepeatableBaseIdsForToken(nodeId)) {
|
|
@@ -15863,11 +15876,17 @@ async function resolveFromForm(options) {
|
|
|
15863
15876
|
}
|
|
15864
15877
|
return void 0;
|
|
15865
15878
|
};
|
|
15879
|
+
const entryMetaForLabel = (label) => {
|
|
15880
|
+
const normalized = label.trim().toLowerCase();
|
|
15881
|
+
const item = inferredRepeatableList.find((candidate) => candidate.label.trim().toLowerCase() === normalized);
|
|
15882
|
+
return { entryMeta: item == null ? void 0 : item.entryMeta, nestedEntryMeta: item == null ? void 0 : item.nestedEntryMeta };
|
|
15883
|
+
};
|
|
15866
15884
|
const fallbackRepeatableList = (repeatableFromSchema ?? []).map((r) => ({
|
|
15867
15885
|
nodeId: r.nodeId,
|
|
15868
15886
|
label: r.label,
|
|
15869
15887
|
entryFilter: r.entryFilter,
|
|
15870
|
-
entryCount: entryCountForLabel(r.label)
|
|
15888
|
+
entryCount: entryCountForLabel(r.label),
|
|
15889
|
+
...entryMetaForLabel(r.label)
|
|
15871
15890
|
}));
|
|
15872
15891
|
const repeatableList = inferredRepeatableList.length > 0 ? [
|
|
15873
15892
|
...inferredRepeatableList,
|
|
@@ -16078,6 +16097,12 @@ function paintRepeatableSections(config, repeatableSections) {
|
|
|
16078
16097
|
function setRepeatable(nodes, nodeId, payload) {
|
|
16079
16098
|
for (const node of nodes) {
|
|
16080
16099
|
const id = node.id;
|
|
16100
|
+
if (node.repeatableSection) {
|
|
16101
|
+
if (Array.isArray(node.children) && setRepeatable(node.children, nodeId, payload)) {
|
|
16102
|
+
return true;
|
|
16103
|
+
}
|
|
16104
|
+
continue;
|
|
16105
|
+
}
|
|
16081
16106
|
if (id && (id === nodeId || baseId(id) === baseId(nodeId))) {
|
|
16082
16107
|
node.repeatableSection = payload;
|
|
16083
16108
|
return true;
|
|
@@ -16925,9 +16950,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
16925
16950
|
}
|
|
16926
16951
|
return svgString;
|
|
16927
16952
|
}
|
|
16928
|
-
const resolvedPackageVersion = "0.5.
|
|
16953
|
+
const resolvedPackageVersion = "0.5.204";
|
|
16929
16954
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
16930
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
16955
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.204";
|
|
16931
16956
|
const roundParityValue = (value) => {
|
|
16932
16957
|
if (typeof value !== "number") return value;
|
|
16933
16958
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -17606,7 +17631,7 @@ class PixldocsRenderer {
|
|
|
17606
17631
|
await this.waitForCanvasScene(container, cloned, i);
|
|
17607
17632
|
}
|
|
17608
17633
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
17609
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
17634
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-NpBdL1eb.js");
|
|
17610
17635
|
const prepared = preparePagesForExport(
|
|
17611
17636
|
cloned.pages,
|
|
17612
17637
|
canvasWidth,
|
|
@@ -19790,7 +19815,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
19790
19815
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
19791
19816
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
19792
19817
|
try {
|
|
19793
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
19818
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-NpBdL1eb.js");
|
|
19794
19819
|
try {
|
|
19795
19820
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
19796
19821
|
} catch {
|
|
@@ -20190,4 +20215,4 @@ export {
|
|
|
20190
20215
|
buildTeaserBlurFlatKeys as y,
|
|
20191
20216
|
collectFontDescriptorsFromConfig as z
|
|
20192
20217
|
};
|
|
20193
|
-
//# sourceMappingURL=index-
|
|
20218
|
+
//# sourceMappingURL=index-BfLA9Iqt.js.map
|