@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
|
@@ -12041,6 +12041,9 @@ const PageCanvas = react.forwardRef(
|
|
|
12041
12041
|
selectionLeft: rect.left,
|
|
12042
12042
|
selectionTop: rect.top
|
|
12043
12043
|
};
|
|
12044
|
+
if (active.__pixldocsGroupSelection) {
|
|
12045
|
+
prepareGroupSelectionTransformStart(active);
|
|
12046
|
+
}
|
|
12044
12047
|
}
|
|
12045
12048
|
if (fabricCanvas._currentTransform) {
|
|
12046
12049
|
fabricCanvas.__isUserTransforming = true;
|
|
@@ -12906,6 +12909,9 @@ const PageCanvas = react.forwardRef(
|
|
|
12906
12909
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12907
12910
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12908
12911
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12912
|
+
if (activeBeforeMouseDown instanceof fabric__namespace.ActiveSelection && activeBeforeMouseDown.__pixldocsGroupSelection) {
|
|
12913
|
+
prepareGroupSelectionTransformStart(activeBeforeMouseDown);
|
|
12914
|
+
}
|
|
12909
12915
|
if (editLockRef.current) {
|
|
12910
12916
|
const active = fabricCanvas.getActiveObject();
|
|
12911
12917
|
if (active && (((_a2 = active._ct) == null ? void 0 : _a2.isCropGroup) || active.__cropGroup)) {
|
|
@@ -14250,7 +14256,10 @@ const PageCanvas = react.forwardRef(
|
|
|
14250
14256
|
const groupAbs = getAbsoluteBounds(groupToMove, pageChildren2);
|
|
14251
14257
|
let movedGroupLeft = groupAbs.left;
|
|
14252
14258
|
let movedGroupTop = groupAbs.top;
|
|
14253
|
-
if (activeObj instanceof fabric__namespace.ActiveSelection &&
|
|
14259
|
+
if (activeObj instanceof fabric__namespace.ActiveSelection && activeSelectionDelta) {
|
|
14260
|
+
movedGroupLeft = groupAbs.left + activeSelectionDelta.x;
|
|
14261
|
+
movedGroupTop = groupAbs.top + activeSelectionDelta.y;
|
|
14262
|
+
} else if (activeObj instanceof fabric__namespace.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14254
14263
|
const selectionRect = activeObj.getBoundingRect();
|
|
14255
14264
|
movedGroupLeft = transformStart.groupLeft + (selectionRect.left - transformStart.selectionLeft);
|
|
14256
14265
|
movedGroupTop = transformStart.groupTop + (selectionRect.top - transformStart.selectionTop);
|
|
@@ -15419,9 +15428,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15419
15428
|
const currentVisible = element.visible !== false;
|
|
15420
15429
|
const fabricLeft = existingObj.left ?? 0;
|
|
15421
15430
|
const fabricTop = existingObj.top ?? 0;
|
|
15422
|
-
const storePos =
|
|
15423
|
-
const node = findNodeById(
|
|
15424
|
-
return node ? getAbsoluteBounds(node,
|
|
15431
|
+
const storePos = pageTree.length ? (() => {
|
|
15432
|
+
const node = findNodeById(pageTree, element.id);
|
|
15433
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15425
15434
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15426
15435
|
const storeLeft = storePos.left;
|
|
15427
15436
|
const storeTop = storePos.top;
|
|
@@ -15435,7 +15444,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15435
15444
|
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
|
|
15436
15445
|
positionChanged = false;
|
|
15437
15446
|
}
|
|
15438
|
-
const resolvedSizeForCompare =
|
|
15447
|
+
const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
|
|
15439
15448
|
const fabricText = existingObj.text ?? "";
|
|
15440
15449
|
const storeText = element.text ?? "";
|
|
15441
15450
|
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
|
|
@@ -16075,7 +16084,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16075
16084
|
if (fc && isTransforming(fc)) {
|
|
16076
16085
|
return;
|
|
16077
16086
|
}
|
|
16078
|
-
const currentPageTree = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
|
|
16087
|
+
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) ?? [];
|
|
16079
16088
|
const fabricPos = currentPageTree.length > 0 ? (() => {
|
|
16080
16089
|
const node = findNodeById(currentPageTree, element.id);
|
|
16081
16090
|
return node ? getAbsoluteBounds(node, currentPageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
@@ -23653,9 +23662,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23653
23662
|
}
|
|
23654
23663
|
return svgString;
|
|
23655
23664
|
}
|
|
23656
|
-
const resolvedPackageVersion = "0.5.
|
|
23665
|
+
const resolvedPackageVersion = "0.5.268";
|
|
23657
23666
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23658
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23667
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.268";
|
|
23659
23668
|
const roundParityValue = (value) => {
|
|
23660
23669
|
if (typeof value !== "number") return value;
|
|
23661
23670
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24469,7 +24478,7 @@ class PixldocsRenderer {
|
|
|
24469
24478
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24470
24479
|
}
|
|
24471
24480
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24472
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24481
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-D2g8-LcJ.cjs"));
|
|
24473
24482
|
const prepared = preparePagesForExport(
|
|
24474
24483
|
cloned.pages,
|
|
24475
24484
|
canvasWidth,
|
|
@@ -26789,7 +26798,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26789
26798
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26790
26799
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26791
26800
|
try {
|
|
26792
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26801
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-D2g8-LcJ.cjs"));
|
|
26793
26802
|
try {
|
|
26794
26803
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26795
26804
|
} catch {
|
|
@@ -27186,4 +27195,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27186
27195
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27187
27196
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27188
27197
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27189
|
-
//# sourceMappingURL=index-
|
|
27198
|
+
//# sourceMappingURL=index-DNGRsx4X.cjs.map
|