@pixldocs/canvas-renderer 0.5.266 → 0.5.268
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-Dno8Fb1D.js → index-D4jC3E0x.js} +20 -11
- package/dist/index-D4jC3E0x.js.map +1 -0
- package/dist/{index-BTlyH7B1.cjs → index-DNGRsx4X.cjs} +20 -11
- package/dist/index-DNGRsx4X.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CO8Kr9ha.js → vectorPdfExport-CO7vD_-C.js} +4 -4
- package/dist/{vectorPdfExport-CO8Kr9ha.js.map → vectorPdfExport-CO7vD_-C.js.map} +1 -1
- package/dist/{vectorPdfExport-i1DTwWah.cjs → vectorPdfExport-D2g8-LcJ.cjs} +4 -4
- package/dist/{vectorPdfExport-i1DTwWah.cjs.map → vectorPdfExport-D2g8-LcJ.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BTlyH7B1.cjs.map +0 -1
- package/dist/index-Dno8Fb1D.js.map +0 -1
|
@@ -12023,6 +12023,9 @@ const PageCanvas = forwardRef(
|
|
|
12023
12023
|
selectionLeft: rect.left,
|
|
12024
12024
|
selectionTop: rect.top
|
|
12025
12025
|
};
|
|
12026
|
+
if (active.__pixldocsGroupSelection) {
|
|
12027
|
+
prepareGroupSelectionTransformStart(active);
|
|
12028
|
+
}
|
|
12026
12029
|
}
|
|
12027
12030
|
if (fabricCanvas._currentTransform) {
|
|
12028
12031
|
fabricCanvas.__isUserTransforming = true;
|
|
@@ -12888,6 +12891,9 @@ const PageCanvas = forwardRef(
|
|
|
12888
12891
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12889
12892
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12890
12893
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12894
|
+
if (activeBeforeMouseDown instanceof fabric.ActiveSelection && activeBeforeMouseDown.__pixldocsGroupSelection) {
|
|
12895
|
+
prepareGroupSelectionTransformStart(activeBeforeMouseDown);
|
|
12896
|
+
}
|
|
12891
12897
|
if (editLockRef.current) {
|
|
12892
12898
|
const active = fabricCanvas.getActiveObject();
|
|
12893
12899
|
if (active && (((_a2 = active._ct) == null ? void 0 : _a2.isCropGroup) || active.__cropGroup)) {
|
|
@@ -14232,7 +14238,10 @@ const PageCanvas = forwardRef(
|
|
|
14232
14238
|
const groupAbs = getAbsoluteBounds(groupToMove, pageChildren2);
|
|
14233
14239
|
let movedGroupLeft = groupAbs.left;
|
|
14234
14240
|
let movedGroupTop = groupAbs.top;
|
|
14235
|
-
if (activeObj instanceof fabric.ActiveSelection &&
|
|
14241
|
+
if (activeObj instanceof fabric.ActiveSelection && activeSelectionDelta) {
|
|
14242
|
+
movedGroupLeft = groupAbs.left + activeSelectionDelta.x;
|
|
14243
|
+
movedGroupTop = groupAbs.top + activeSelectionDelta.y;
|
|
14244
|
+
} else if (activeObj instanceof fabric.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14236
14245
|
const selectionRect = activeObj.getBoundingRect();
|
|
14237
14246
|
movedGroupLeft = transformStart.groupLeft + (selectionRect.left - transformStart.selectionLeft);
|
|
14238
14247
|
movedGroupTop = transformStart.groupTop + (selectionRect.top - transformStart.selectionTop);
|
|
@@ -15401,9 +15410,9 @@ const PageCanvas = forwardRef(
|
|
|
15401
15410
|
const currentVisible = element.visible !== false;
|
|
15402
15411
|
const fabricLeft = existingObj.left ?? 0;
|
|
15403
15412
|
const fabricTop = existingObj.top ?? 0;
|
|
15404
|
-
const storePos =
|
|
15405
|
-
const node = findNodeById(
|
|
15406
|
-
return node ? getAbsoluteBounds(node,
|
|
15413
|
+
const storePos = pageTree.length ? (() => {
|
|
15414
|
+
const node = findNodeById(pageTree, element.id);
|
|
15415
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15407
15416
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15408
15417
|
const storeLeft = storePos.left;
|
|
15409
15418
|
const storeTop = storePos.top;
|
|
@@ -15417,7 +15426,7 @@ const PageCanvas = forwardRef(
|
|
|
15417
15426
|
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
|
|
15418
15427
|
positionChanged = false;
|
|
15419
15428
|
}
|
|
15420
|
-
const resolvedSizeForCompare =
|
|
15429
|
+
const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
|
|
15421
15430
|
const fabricText = existingObj.text ?? "";
|
|
15422
15431
|
const storeText = element.text ?? "";
|
|
15423
15432
|
const otherPropsChanged = Math.abs((existingObj.width ?? 0) - resolvedSizeForCompare.width) > 0.1 || Math.abs((existingObj.height ?? 0) - resolvedSizeForCompare.height) > 0.1 || Math.abs((existingObj.angle ?? 0) - (element.angle ?? 0)) > 0.1 || Math.abs((existingObj.scaleX ?? 1) - (element.scaleX ?? 1)) > 0.01 || Math.abs((existingObj.scaleY ?? 1) - (element.scaleY ?? 1)) > 0.01 || (existingObj.flipX ?? false) !== (element.flipX ?? false) || (existingObj.flipY ?? false) !== (element.flipY ?? false) || fabricText !== storeText || existingObj.fill !== (element.fill ?? "") || existingObj.stroke !== (element.stroke ?? "") || Math.abs((existingObj.strokeWidth ?? 0) - (element.strokeWidth ?? 0)) > 0.01 || Math.abs((existingObj.opacity ?? 1) - (element.opacity ?? 1)) > 0.01 || (existingObj.fontSize ?? 0) !== (element.fontSize ?? 0) || (existingObj.fontFamily ?? "") !== (element.fontFamily ?? "") || // Vertical alignment & min box height: panel-driven changes must trigger a re-apply
|
|
@@ -16057,7 +16066,7 @@ const PageCanvas = forwardRef(
|
|
|
16057
16066
|
if (fc && isTransforming(fc)) {
|
|
16058
16067
|
return;
|
|
16059
16068
|
}
|
|
16060
|
-
const currentPageTree = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
|
|
16069
|
+
const currentPageTree = (isPreviewMode && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
|
|
16061
16070
|
const fabricPos = currentPageTree.length > 0 ? (() => {
|
|
16062
16071
|
const node = findNodeById(currentPageTree, element.id);
|
|
16063
16072
|
return node ? getAbsoluteBounds(node, currentPageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
@@ -23635,9 +23644,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23635
23644
|
}
|
|
23636
23645
|
return svgString;
|
|
23637
23646
|
}
|
|
23638
|
-
const resolvedPackageVersion = "0.5.
|
|
23647
|
+
const resolvedPackageVersion = "0.5.268";
|
|
23639
23648
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23640
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23649
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.268";
|
|
23641
23650
|
const roundParityValue = (value) => {
|
|
23642
23651
|
if (typeof value !== "number") return value;
|
|
23643
23652
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24451,7 +24460,7 @@ class PixldocsRenderer {
|
|
|
24451
24460
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24452
24461
|
}
|
|
24453
24462
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24454
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24463
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CO7vD_-C.js");
|
|
24455
24464
|
const prepared = preparePagesForExport(
|
|
24456
24465
|
cloned.pages,
|
|
24457
24466
|
canvasWidth,
|
|
@@ -26771,7 +26780,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26771
26780
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26772
26781
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26773
26782
|
try {
|
|
26774
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
26783
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CO7vD_-C.js");
|
|
26775
26784
|
try {
|
|
26776
26785
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26777
26786
|
} catch {
|
|
@@ -27171,4 +27180,4 @@ export {
|
|
|
27171
27180
|
buildTeaserBlurFlatKeys as y,
|
|
27172
27181
|
collectFontDescriptorsFromConfig as z
|
|
27173
27182
|
};
|
|
27174
|
-
//# sourceMappingURL=index-
|
|
27183
|
+
//# sourceMappingURL=index-D4jC3E0x.js.map
|