@pixldocs/canvas-renderer 0.5.300 → 0.5.301
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-eWyfu-3k.cjs → index-BUG1_dx7.cjs} +34 -6
- package/dist/index-BUG1_dx7.cjs.map +1 -0
- package/dist/{index-DSa_E6-5.js → index-CUodp3G_.js} +34 -6
- package/dist/index-CUodp3G_.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BVHpWHXp.cjs → vectorPdfExport-hHMDys-j.cjs} +4 -4
- package/dist/{vectorPdfExport-BVHpWHXp.cjs.map → vectorPdfExport-hHMDys-j.cjs.map} +1 -1
- package/dist/{vectorPdfExport-Bgb4ctNH.js → vectorPdfExport-wfJpS8kd.js} +4 -4
- package/dist/{vectorPdfExport-Bgb4ctNH.js.map → vectorPdfExport-wfJpS8kd.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DSa_E6-5.js.map +0 -1
- package/dist/index-eWyfu-3k.cjs.map +0 -1
|
@@ -209,6 +209,26 @@ function removeNodeFromTree(children, id) {
|
|
|
209
209
|
return node;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
+
function pruneEmptyGroups(children) {
|
|
213
|
+
const prunedGroupIds = /* @__PURE__ */ new Set();
|
|
214
|
+
const walk = (nodes) => {
|
|
215
|
+
const next = [];
|
|
216
|
+
for (const node of nodes) {
|
|
217
|
+
if (isGroup(node)) {
|
|
218
|
+
const prunedChildren = walk(node.children);
|
|
219
|
+
if (prunedChildren.length === 0) {
|
|
220
|
+
prunedGroupIds.add(node.id);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
next.push({ ...node, children: prunedChildren });
|
|
224
|
+
} else {
|
|
225
|
+
next.push(node);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return next;
|
|
229
|
+
};
|
|
230
|
+
return { children: walk(children), prunedGroupIds };
|
|
231
|
+
}
|
|
212
232
|
function addNodeToTree(children, node, parentId, index) {
|
|
213
233
|
if (!parentId) {
|
|
214
234
|
if (index !== void 0) {
|
|
@@ -1522,8 +1542,16 @@ const useEditorStore = zustand.create((set, get) => ({
|
|
|
1522
1542
|
if (rootLevelIds.has(id)) ;
|
|
1523
1543
|
nextChildren = removeNodeFromTree(nextChildren, id);
|
|
1524
1544
|
}
|
|
1545
|
+
const { children: prunedChildren, prunedGroupIds } = pruneEmptyGroups(nextChildren);
|
|
1546
|
+
nextChildren = prunedChildren;
|
|
1547
|
+
for (const gid of prunedGroupIds) {
|
|
1548
|
+
allDeletedIds.add(gid);
|
|
1549
|
+
if (rootLevelIds.has(gid)) ;
|
|
1550
|
+
}
|
|
1525
1551
|
let nextCanvas = updateCurrentPageChildren(state.canvas, () => nextChildren);
|
|
1526
|
-
nextCanvas.selectedIds = state.canvas.selectedIds.filter(
|
|
1552
|
+
nextCanvas.selectedIds = state.canvas.selectedIds.filter(
|
|
1553
|
+
(id) => !ids.includes(id) && !prunedGroupIds.has(id)
|
|
1554
|
+
);
|
|
1527
1555
|
if (nextCanvas.themeConfig) {
|
|
1528
1556
|
const remainingProps = nextCanvas.themeConfig.properties.filter((p) => !allDeletedIds.has(p.elementId));
|
|
1529
1557
|
if (remainingProps.length !== nextCanvas.themeConfig.properties.length) {
|
|
@@ -24015,9 +24043,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24015
24043
|
}
|
|
24016
24044
|
return svgString;
|
|
24017
24045
|
}
|
|
24018
|
-
const resolvedPackageVersion = "0.5.
|
|
24046
|
+
const resolvedPackageVersion = "0.5.301";
|
|
24019
24047
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24020
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24048
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.301";
|
|
24021
24049
|
const roundParityValue = (value) => {
|
|
24022
24050
|
if (typeof value !== "number") return value;
|
|
24023
24051
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24831,7 +24859,7 @@ class PixldocsRenderer {
|
|
|
24831
24859
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24832
24860
|
}
|
|
24833
24861
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24834
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24862
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-hHMDys-j.cjs"));
|
|
24835
24863
|
const prepared = preparePagesForExport(
|
|
24836
24864
|
cloned.pages,
|
|
24837
24865
|
canvasWidth,
|
|
@@ -27151,7 +27179,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27151
27179
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27152
27180
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27153
27181
|
try {
|
|
27154
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27182
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-hHMDys-j.cjs"));
|
|
27155
27183
|
try {
|
|
27156
27184
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27157
27185
|
} catch {
|
|
@@ -27548,4 +27576,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27548
27576
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27549
27577
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27550
27578
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27551
|
-
//# sourceMappingURL=index-
|
|
27579
|
+
//# sourceMappingURL=index-BUG1_dx7.cjs.map
|