@pixldocs/canvas-renderer 0.5.336 → 0.5.337
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-9lp-EDhu.js → index-B5OFG6Dl.js} +42 -15
- package/dist/index-B5OFG6Dl.js.map +1 -0
- package/dist/{index-BUYwGfVW.cjs → index-Ze4pswgN.cjs} +42 -15
- package/dist/index-Ze4pswgN.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BgFbzhxa.cjs → vectorPdfExport-11EJIk-M.cjs} +4 -4
- package/dist/{vectorPdfExport-BgFbzhxa.cjs.map → vectorPdfExport-11EJIk-M.cjs.map} +1 -1
- package/dist/{vectorPdfExport-430yRzXb.js → vectorPdfExport-CpYoH5k1.js} +4 -4
- package/dist/{vectorPdfExport-430yRzXb.js.map → vectorPdfExport-CpYoH5k1.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-9lp-EDhu.js.map +0 -1
- package/dist/index-BUYwGfVW.cjs.map +0 -1
|
@@ -14433,7 +14433,7 @@ const PageCanvas = forwardRef(
|
|
|
14433
14433
|
});
|
|
14434
14434
|
let cropGroupSaveTimer = null;
|
|
14435
14435
|
fabricCanvas.on("object:modified", (e) => {
|
|
14436
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
14436
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
14437
14437
|
try {
|
|
14438
14438
|
dragStarted = false;
|
|
14439
14439
|
setGuides([]);
|
|
@@ -14441,6 +14441,33 @@ const PageCanvas = forwardRef(
|
|
|
14441
14441
|
objectResizeActiveSnapRef.current = null;
|
|
14442
14442
|
groupResizeActiveSnapRef.current = null;
|
|
14443
14443
|
onDragEnd == null ? void 0 : onDragEnd();
|
|
14444
|
+
try {
|
|
14445
|
+
const mt = e.target;
|
|
14446
|
+
const children = mt instanceof fabric.Group || mt instanceof fabric.ActiveSelection ? mt.getObjects() : [];
|
|
14447
|
+
logGroupImageResizeDebug("modified-entry", {
|
|
14448
|
+
time: Math.round(performance.now()),
|
|
14449
|
+
didTransform: didTransformRef.current,
|
|
14450
|
+
targetType: mt == null ? void 0 : mt.type,
|
|
14451
|
+
targetCtor: (_a2 = mt == null ? void 0 : mt.constructor) == null ? void 0 : _a2.name,
|
|
14452
|
+
isActiveSelection: mt instanceof fabric.ActiveSelection,
|
|
14453
|
+
isGroup: mt instanceof fabric.Group,
|
|
14454
|
+
angle: mt == null ? void 0 : mt.angle,
|
|
14455
|
+
childCount: children.length,
|
|
14456
|
+
childTypes: children.map((c) => c == null ? void 0 : c.type),
|
|
14457
|
+
hasImageChild: children.some((c) => isGroupResizeImageLikeObject(c)),
|
|
14458
|
+
target: mt ? summarizeFabricObjectForResizeDebug(mt) : null,
|
|
14459
|
+
children: children.map((c) => {
|
|
14460
|
+
var _a3;
|
|
14461
|
+
return {
|
|
14462
|
+
type: c == null ? void 0 : c.type,
|
|
14463
|
+
ctor: (_a3 = c == null ? void 0 : c.constructor) == null ? void 0 : _a3.name,
|
|
14464
|
+
summary: summarizeFabricObjectForResizeDebug(c)
|
|
14465
|
+
};
|
|
14466
|
+
})
|
|
14467
|
+
});
|
|
14468
|
+
} catch (err) {
|
|
14469
|
+
console.warn("[Pixldocs][group-image-side-resize] modified-entry log failed", err);
|
|
14470
|
+
}
|
|
14444
14471
|
try {
|
|
14445
14472
|
const t = e.target;
|
|
14446
14473
|
if (t instanceof fabric.ActiveSelection) {
|
|
@@ -14478,7 +14505,7 @@ const PageCanvas = forwardRef(
|
|
|
14478
14505
|
const active = fabricCanvas.getActiveObject();
|
|
14479
14506
|
const activeId = active ? getObjectId(active) : null;
|
|
14480
14507
|
if (active && activeId && activeId !== "__background__" && !(active instanceof fabric.Group)) {
|
|
14481
|
-
const pageChildrenForParent = ((
|
|
14508
|
+
const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
|
|
14482
14509
|
const parentGroup = findParentGroup(pageChildrenForParent, activeId);
|
|
14483
14510
|
if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
|
|
14484
14511
|
let fabricSectionGroup = active.group && active.group instanceof fabric.Group ? active.group : null;
|
|
@@ -14560,7 +14587,7 @@ const PageCanvas = forwardRef(
|
|
|
14560
14587
|
useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
|
|
14561
14588
|
}
|
|
14562
14589
|
const stateAfter = useEditorStore.getState();
|
|
14563
|
-
const pageAfter = ((
|
|
14590
|
+
const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
14564
14591
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14565
14592
|
if (groupNodeAfter) {
|
|
14566
14593
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14623,7 +14650,7 @@ const PageCanvas = forwardRef(
|
|
|
14623
14650
|
}
|
|
14624
14651
|
if (active && active instanceof fabric.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
|
|
14625
14652
|
const groupId = getObjectId(active);
|
|
14626
|
-
const pageChildrenSec = ((
|
|
14653
|
+
const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
|
|
14627
14654
|
const modifiedTarget2 = e == null ? void 0 : e.target;
|
|
14628
14655
|
const resizeScaleTarget = lastResizeScaleTargetRef.current;
|
|
14629
14656
|
lastResizeScaleTargetRef.current = null;
|
|
@@ -14654,7 +14681,7 @@ const PageCanvas = forwardRef(
|
|
|
14654
14681
|
const node = findNodeById(pageChildrenSec, groupId);
|
|
14655
14682
|
if (isChildModified && node && !groupMoved) {
|
|
14656
14683
|
const stateAfter = useEditorStore.getState();
|
|
14657
|
-
const pageAfter = ((
|
|
14684
|
+
const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
|
|
14658
14685
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14659
14686
|
if (groupNodeAfter) {
|
|
14660
14687
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14670,7 +14697,7 @@ const PageCanvas = forwardRef(
|
|
|
14670
14697
|
}
|
|
14671
14698
|
if (active && active instanceof fabric.Group && !(active instanceof fabric.ActiveSelection) && getObjectId(active)) {
|
|
14672
14699
|
const groupId = getObjectId(active);
|
|
14673
|
-
const pageChildren3 = ((
|
|
14700
|
+
const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
14674
14701
|
const w = (active.width ?? 0) * (active.scaleX ?? 1);
|
|
14675
14702
|
const h = (active.height ?? 0) * (active.scaleY ?? 1);
|
|
14676
14703
|
const centerX = active.left ?? 0;
|
|
@@ -14692,7 +14719,7 @@ const PageCanvas = forwardRef(
|
|
|
14692
14719
|
}
|
|
14693
14720
|
const activeObj = fabricCanvas.getActiveObject();
|
|
14694
14721
|
let activeObjects = fabricCanvas.getActiveObjects();
|
|
14695
|
-
const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((
|
|
14722
|
+
const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
|
|
14696
14723
|
const activeSelectionDelta = activeObj instanceof fabric.ActiveSelection && activeSelectionMoveStart ? (() => {
|
|
14697
14724
|
const rect = activeObj.getBoundingRect();
|
|
14698
14725
|
return {
|
|
@@ -15111,7 +15138,7 @@ const PageCanvas = forwardRef(
|
|
|
15111
15138
|
const localScaleX = 1 / sx;
|
|
15112
15139
|
const localScaleY = 1 / sy;
|
|
15113
15140
|
obj.set({ scaleX: localScaleX, scaleY: localScaleY });
|
|
15114
|
-
const selectionMatrix = (
|
|
15141
|
+
const selectionMatrix = (_h = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _h.call(activeObj);
|
|
15115
15142
|
const localCenter = selectionMatrix ? fabric.util.transformPoint(preBakeCenter, fabric.util.invertTransform(selectionMatrix)) : preBakeCenter;
|
|
15116
15143
|
obj.setPositionByOrigin(localCenter, "center", "center");
|
|
15117
15144
|
}
|
|
@@ -15262,7 +15289,7 @@ const PageCanvas = forwardRef(
|
|
|
15262
15289
|
const localScaleX = 1 / sx;
|
|
15263
15290
|
const localScaleY = 1 / sy;
|
|
15264
15291
|
obj.set({ scaleX: localScaleX, scaleY: localScaleY });
|
|
15265
|
-
const selectionMatrix = (
|
|
15292
|
+
const selectionMatrix = (_i = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _i.call(activeObj);
|
|
15266
15293
|
const localCenter = selectionMatrix ? fabric.util.transformPoint(preBakeCenter, fabric.util.invertTransform(selectionMatrix)) : preBakeCenter;
|
|
15267
15294
|
obj.setPositionByOrigin(localCenter, "center", "center");
|
|
15268
15295
|
} else {
|
|
@@ -15410,7 +15437,7 @@ const PageCanvas = forwardRef(
|
|
|
15410
15437
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
15411
15438
|
obj.setCoords();
|
|
15412
15439
|
}
|
|
15413
|
-
const pageChildrenForReflow = ((
|
|
15440
|
+
const pageChildrenForReflow = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
15414
15441
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
15415
15442
|
for (const id of modifiedIdsThisRound) {
|
|
15416
15443
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -24550,9 +24577,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24550
24577
|
}
|
|
24551
24578
|
return svgString;
|
|
24552
24579
|
}
|
|
24553
|
-
const resolvedPackageVersion = "0.5.
|
|
24580
|
+
const resolvedPackageVersion = "0.5.337";
|
|
24554
24581
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24555
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24582
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.337";
|
|
24556
24583
|
const roundParityValue = (value) => {
|
|
24557
24584
|
if (typeof value !== "number") return value;
|
|
24558
24585
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25366,7 +25393,7 @@ class PixldocsRenderer {
|
|
|
25366
25393
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25367
25394
|
}
|
|
25368
25395
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25369
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25396
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CpYoH5k1.js");
|
|
25370
25397
|
const prepared = preparePagesForExport(
|
|
25371
25398
|
cloned.pages,
|
|
25372
25399
|
canvasWidth,
|
|
@@ -27686,7 +27713,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27686
27713
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27687
27714
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27688
27715
|
try {
|
|
27689
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27716
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CpYoH5k1.js");
|
|
27690
27717
|
try {
|
|
27691
27718
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27692
27719
|
} catch {
|
|
@@ -28086,4 +28113,4 @@ export {
|
|
|
28086
28113
|
buildTeaserBlurFlatKeys as y,
|
|
28087
28114
|
collectFontDescriptorsFromConfig as z
|
|
28088
28115
|
};
|
|
28089
|
-
//# sourceMappingURL=index-
|
|
28116
|
+
//# sourceMappingURL=index-B5OFG6Dl.js.map
|