@pixldocs/canvas-renderer 0.5.219 → 0.5.221
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-DIokvyoP.cjs} +27 -19
- package/dist/{index-CBB2UdwF.cjs.map → index-DIokvyoP.cjs.map} +1 -1
- package/dist/{index-DbUPI6zs.js → index-mmjF0tPc.js} +27 -19
- package/dist/{index-DbUPI6zs.js.map → index-mmjF0tPc.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-Dejgf_PM.js → vectorPdfExport-BR2dJuvJ.js} +4 -4
- package/dist/{vectorPdfExport-Dejgf_PM.js.map → vectorPdfExport-BR2dJuvJ.js.map} +1 -1
- package/dist/{vectorPdfExport-CwyiHDGD.cjs → vectorPdfExport-CZjhPHZh.cjs} +4 -4
- package/dist/{vectorPdfExport-CwyiHDGD.cjs.map → vectorPdfExport-CZjhPHZh.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,
|
|
@@ -17578,10 +17580,11 @@ async function resolveTemplateData(options) {
|
|
|
17578
17580
|
async function resolveFromForm(options) {
|
|
17579
17581
|
var _a, _b, _c;
|
|
17580
17582
|
const { templateId, formSchemaId, sectionState, flatFormData: directFlatFormData, themeId, supabaseUrl, supabaseAnonKey, prefetched } = options;
|
|
17581
|
-
|
|
17583
|
+
const hasSectionStateInput = !!sectionState && Object.keys(sectionState).length > 0;
|
|
17584
|
+
if (!formSchemaId && !hasSectionStateInput) {
|
|
17582
17585
|
return resolveTemplateData({
|
|
17583
17586
|
templateId,
|
|
17584
|
-
formData: directFlatFormData ??
|
|
17587
|
+
formData: directFlatFormData ?? {},
|
|
17585
17588
|
supabaseUrl,
|
|
17586
17589
|
supabaseAnonKey,
|
|
17587
17590
|
prefetched: (prefetched == null ? void 0 : prefetched.templateRow) ? { templateRow: prefetched.templateRow } : void 0
|
|
@@ -17589,12 +17592,12 @@ async function resolveFromForm(options) {
|
|
|
17589
17592
|
}
|
|
17590
17593
|
const [templateRow, formSchemaRow, defaultForm] = await Promise.all([
|
|
17591
17594
|
(prefetched == null ? void 0 : prefetched.templateRow) ? Promise.resolve(prefetched.templateRow) : fetchRow(supabaseUrl, supabaseAnonKey, "templates", templateId),
|
|
17592
|
-
(prefetched == null ? void 0 : prefetched.formSchemaRow) !== void 0 ? Promise.resolve(prefetched.formSchemaRow) : fetchRow(supabaseUrl, supabaseAnonKey, "form_schemas", formSchemaId),
|
|
17593
|
-
(prefetched == null ? void 0 : prefetched.defaultForm) !== void 0 ? Promise.resolve(prefetched.defaultForm) : fetchDefaultForm(supabaseUrl, supabaseAnonKey, formSchemaId)
|
|
17595
|
+
(prefetched == null ? void 0 : prefetched.formSchemaRow) !== void 0 ? Promise.resolve(prefetched.formSchemaRow) : formSchemaId ? fetchRow(supabaseUrl, supabaseAnonKey, "form_schemas", formSchemaId).catch(() => null) : Promise.resolve(null),
|
|
17596
|
+
(prefetched == null ? void 0 : prefetched.defaultForm) !== void 0 ? Promise.resolve(prefetched.defaultForm) : formSchemaId ? fetchDefaultForm(supabaseUrl, supabaseAnonKey, formSchemaId) : Promise.resolve(null)
|
|
17594
17597
|
]);
|
|
17595
17598
|
const templateConfig = templateRow.config;
|
|
17596
17599
|
const templateFormSchema = templateRow.form_schema;
|
|
17597
|
-
const formSchema = formSchemaRow.schema;
|
|
17600
|
+
const formSchema = (formSchemaRow == null ? void 0 : formSchemaRow.schema) ?? void 0;
|
|
17598
17601
|
if (templateFormSchema) {
|
|
17599
17602
|
if (!Array.isArray(templateConfig.dynamicFields) && Array.isArray(templateFormSchema.dynamicFields)) {
|
|
17600
17603
|
templateConfig.dynamicFields = templateFormSchema.dynamicFields;
|
|
@@ -17664,7 +17667,8 @@ async function resolveFromForm(options) {
|
|
|
17664
17667
|
(repeatableFromSchema ?? []).map((r) => [baseId(r.nodeId), r])
|
|
17665
17668
|
);
|
|
17666
17669
|
const topLevelRepeatables = inferredSections.filter((s) => s.type === "repeatable" && !s.parentId).map((s) => {
|
|
17667
|
-
const
|
|
17670
|
+
const rawEntries = mergedSectionState[s.id];
|
|
17671
|
+
const entries = Array.isArray(rawEntries) ? rawEntries : [];
|
|
17668
17672
|
const nodeId = s.treeNodeId ?? s.id;
|
|
17669
17673
|
const schemaRepeatable = repeatableFromSchemaByBase.get(baseId(nodeId));
|
|
17670
17674
|
const entryMeta = entries.map((e) => getRepeatableEntryMeta(e, s));
|
|
@@ -17676,11 +17680,13 @@ async function resolveFromForm(options) {
|
|
|
17676
17680
|
const parentId = s.parentId;
|
|
17677
17681
|
const parentSection = inferredSections.find((ps) => ps.id === parentId);
|
|
17678
17682
|
const parentNodeId = parentSection ? parentSection.treeNodeId ?? parentSection.id : parentId;
|
|
17679
|
-
const
|
|
17683
|
+
const rawParentEntries = mergedSectionState[parentId];
|
|
17684
|
+
const parentEntries = Array.isArray(rawParentEntries) ? rawParentEntries : [];
|
|
17680
17685
|
const nestedEntryMeta = {};
|
|
17681
17686
|
const merged = [];
|
|
17682
17687
|
for (let pi = 0; pi < parentEntries.length; pi++) {
|
|
17683
|
-
const
|
|
17688
|
+
const rawChildEntries = mergedSectionState[`${parentId}_${pi}_${s.id}`];
|
|
17689
|
+
const childEntries = Array.isArray(rawChildEntries) ? rawChildEntries : [];
|
|
17684
17690
|
const meta = childEntries.map((e) => getRepeatableEntryMeta(e, s));
|
|
17685
17691
|
nestedEntryMeta[`${baseId(parentNodeId)}_${pi + 1}_${baseId(nodeId)}`] = meta;
|
|
17686
17692
|
merged.push(...meta);
|
|
@@ -17720,13 +17726,15 @@ async function resolveFromForm(options) {
|
|
|
17720
17726
|
if (s.type !== "repeatable") continue;
|
|
17721
17727
|
const parentId = s.parentId;
|
|
17722
17728
|
if (parentId == null) continue;
|
|
17723
|
-
const
|
|
17729
|
+
const rawParentEntries2 = mergedSectionState[parentId];
|
|
17730
|
+
const parentEntries = Array.isArray(rawParentEntries2) ? rawParentEntries2 : [];
|
|
17724
17731
|
const parentSection = inferredSections.find((ps) => ps.id === parentId);
|
|
17725
17732
|
const parentTreeNodeId = parentSection ? parentSection.treeNodeId ?? parentSection.id : parentId;
|
|
17726
17733
|
const childTreeNodeId = s.treeNodeId ?? s.id;
|
|
17727
17734
|
for (let pi = 0; pi < parentEntries.length; pi++) {
|
|
17728
17735
|
const compositeKey = `${parentId}_${pi}_${s.id}`;
|
|
17729
|
-
const
|
|
17736
|
+
const rawEntries2 = mergedSectionState[compositeKey];
|
|
17737
|
+
const entries = Array.isArray(rawEntries2) ? rawEntries2 : [];
|
|
17730
17738
|
const nestedKey = `${baseId(parentTreeNodeId)}_${pi + 1}_${baseId(childTreeNodeId)}`;
|
|
17731
17739
|
repeatableNestedEntryCounts[nestedKey] = Math.max(1, entries.length);
|
|
17732
17740
|
}
|
|
@@ -19085,9 +19093,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
19085
19093
|
}
|
|
19086
19094
|
return svgString;
|
|
19087
19095
|
}
|
|
19088
|
-
const resolvedPackageVersion = "0.5.
|
|
19096
|
+
const resolvedPackageVersion = "0.5.221";
|
|
19089
19097
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
19090
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
19098
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.221";
|
|
19091
19099
|
const roundParityValue = (value) => {
|
|
19092
19100
|
if (typeof value !== "number") return value;
|
|
19093
19101
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -19831,7 +19839,7 @@ class PixldocsRenderer {
|
|
|
19831
19839
|
await this.waitForCanvasScene(container, cloned, i);
|
|
19832
19840
|
}
|
|
19833
19841
|
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-
|
|
19842
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CZjhPHZh.cjs"));
|
|
19835
19843
|
const prepared = preparePagesForExport(
|
|
19836
19844
|
cloned.pages,
|
|
19837
19845
|
canvasWidth,
|
|
@@ -22021,7 +22029,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
22021
22029
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
22022
22030
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
22023
22031
|
try {
|
|
22024
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
22032
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CZjhPHZh.cjs"));
|
|
22025
22033
|
try {
|
|
22026
22034
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
22027
22035
|
} catch {
|
|
@@ -22418,4 +22426,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
22418
22426
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
22419
22427
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
22420
22428
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
22421
|
-
//# sourceMappingURL=index-
|
|
22429
|
+
//# sourceMappingURL=index-DIokvyoP.cjs.map
|