@pixldocs/canvas-renderer 0.5.274 → 0.5.276
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-DvrcUgha.cjs → index-AzU8Pmse.cjs} +90 -14
- package/dist/index-AzU8Pmse.cjs.map +1 -0
- package/dist/{index-C3onaRVR.js → index-CszEZlZ7.js} +90 -14
- package/dist/index-CszEZlZ7.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-oOUmmqgb.js → vectorPdfExport-C9akdCtS.js} +4 -4
- package/dist/{vectorPdfExport-oOUmmqgb.js.map → vectorPdfExport-C9akdCtS.js.map} +1 -1
- package/dist/{vectorPdfExport-BECWB93v.cjs → vectorPdfExport-CvLitjuI.cjs} +4 -4
- package/dist/{vectorPdfExport-BECWB93v.cjs.map → vectorPdfExport-CvLitjuI.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-C3onaRVR.js.map +0 -1
- package/dist/index-DvrcUgha.cjs.map +0 -1
|
@@ -13890,9 +13890,23 @@ const PageCanvas = forwardRef(
|
|
|
13890
13890
|
});
|
|
13891
13891
|
let cropGroupSaveTimer = null;
|
|
13892
13892
|
fabricCanvas.on("object:modified", (e) => {
|
|
13893
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
13893
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
13894
13894
|
try {
|
|
13895
13895
|
dragStarted = false;
|
|
13896
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
13897
|
+
const t = e.target;
|
|
13898
|
+
console.log("[GRP-MOVE] object:modified fired", {
|
|
13899
|
+
targetType: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
|
|
13900
|
+
isActiveSelection: t instanceof fabric.ActiveSelection,
|
|
13901
|
+
groupSelectionId: t ? t.__pixldocsGroupSelection : null,
|
|
13902
|
+
memberIds: t instanceof fabric.ActiveSelection ? t.getObjects().map((o) => getObjectId(o)) : [getObjectId(t)],
|
|
13903
|
+
targetLeft: t == null ? void 0 : t.left,
|
|
13904
|
+
targetTop: t == null ? void 0 : t.top,
|
|
13905
|
+
scaleX: t == null ? void 0 : t.scaleX,
|
|
13906
|
+
scaleY: t == null ? void 0 : t.scaleY,
|
|
13907
|
+
angle: t == null ? void 0 : t.angle
|
|
13908
|
+
});
|
|
13909
|
+
}
|
|
13896
13910
|
setGuides([]);
|
|
13897
13911
|
setGroupOverlayLiveBoundsRef.current(null);
|
|
13898
13912
|
objectResizeActiveSnapRef.current = null;
|
|
@@ -13934,7 +13948,7 @@ const PageCanvas = forwardRef(
|
|
|
13934
13948
|
const active = fabricCanvas.getActiveObject();
|
|
13935
13949
|
const activeId = active ? getObjectId(active) : null;
|
|
13936
13950
|
if (active && activeId && activeId !== "__background__" && !(active instanceof fabric.Group)) {
|
|
13937
|
-
const pageChildrenForParent = ((
|
|
13951
|
+
const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
|
|
13938
13952
|
const parentGroup = findParentGroup(pageChildrenForParent, activeId);
|
|
13939
13953
|
if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
|
|
13940
13954
|
let fabricSectionGroup = active.group && active.group instanceof fabric.Group ? active.group : null;
|
|
@@ -14016,7 +14030,7 @@ const PageCanvas = forwardRef(
|
|
|
14016
14030
|
useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
|
|
14017
14031
|
}
|
|
14018
14032
|
const stateAfter = useEditorStore.getState();
|
|
14019
|
-
const pageAfter = ((
|
|
14033
|
+
const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
14020
14034
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14021
14035
|
if (groupNodeAfter) {
|
|
14022
14036
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14078,7 +14092,7 @@ const PageCanvas = forwardRef(
|
|
|
14078
14092
|
}
|
|
14079
14093
|
if (active && active instanceof fabric.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
|
|
14080
14094
|
const groupId = getObjectId(active);
|
|
14081
|
-
const pageChildrenSec = ((
|
|
14095
|
+
const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
|
|
14082
14096
|
const modifiedTarget2 = e == null ? void 0 : e.target;
|
|
14083
14097
|
const resizeScaleTarget = lastResizeScaleTargetRef.current;
|
|
14084
14098
|
lastResizeScaleTargetRef.current = null;
|
|
@@ -14109,7 +14123,7 @@ const PageCanvas = forwardRef(
|
|
|
14109
14123
|
const node = findNodeById(pageChildrenSec, groupId);
|
|
14110
14124
|
if (isChildModified && node && !groupMoved) {
|
|
14111
14125
|
const stateAfter = useEditorStore.getState();
|
|
14112
|
-
const pageAfter = ((
|
|
14126
|
+
const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
|
|
14113
14127
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14114
14128
|
if (groupNodeAfter) {
|
|
14115
14129
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14125,7 +14139,7 @@ const PageCanvas = forwardRef(
|
|
|
14125
14139
|
}
|
|
14126
14140
|
if (active && active instanceof fabric.Group && !(active instanceof fabric.ActiveSelection) && getObjectId(active)) {
|
|
14127
14141
|
const groupId = getObjectId(active);
|
|
14128
|
-
const pageChildren3 = ((
|
|
14142
|
+
const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
14129
14143
|
const w = (active.width ?? 0) * (active.scaleX ?? 1);
|
|
14130
14144
|
const h = (active.height ?? 0) * (active.scaleY ?? 1);
|
|
14131
14145
|
const centerX = active.left ?? 0;
|
|
@@ -14147,7 +14161,7 @@ const PageCanvas = forwardRef(
|
|
|
14147
14161
|
}
|
|
14148
14162
|
const activeObj = fabricCanvas.getActiveObject();
|
|
14149
14163
|
let activeObjects = fabricCanvas.getActiveObjects();
|
|
14150
|
-
const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((
|
|
14164
|
+
const activeSelectionMoveStart = activeObj instanceof fabric.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
|
|
14151
14165
|
const activeSelectionDelta = activeObj instanceof fabric.ActiveSelection && activeSelectionMoveStart ? (() => {
|
|
14152
14166
|
const rect = activeObj.getBoundingRect();
|
|
14153
14167
|
return {
|
|
@@ -14238,6 +14252,22 @@ const PageCanvas = forwardRef(
|
|
|
14238
14252
|
return memberIds.every((mid) => selectedSet.has(mid));
|
|
14239
14253
|
})();
|
|
14240
14254
|
const groupToMove = candidateIsStack || allMembersSelected ? candidateGroup : null;
|
|
14255
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
14256
|
+
console.log("[GRP-MOVE] entry", {
|
|
14257
|
+
selectedElementIds,
|
|
14258
|
+
isActiveSelection,
|
|
14259
|
+
activeSelectionGroupId: activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : null,
|
|
14260
|
+
parentGroupIds: parentGroups.map((g) => g.id),
|
|
14261
|
+
sameDirectParent,
|
|
14262
|
+
commonAncestorId: commonAncestor == null ? void 0 : commonAncestor.id,
|
|
14263
|
+
candidateGroupId: candidateGroup == null ? void 0 : candidateGroup.id,
|
|
14264
|
+
candidateIsStack,
|
|
14265
|
+
allMembersSelected,
|
|
14266
|
+
groupToMoveId: (groupToMove == null ? void 0 : groupToMove.id) ?? null,
|
|
14267
|
+
activeSelectionHadTransform,
|
|
14268
|
+
selectedLogicalGroupIds
|
|
14269
|
+
});
|
|
14270
|
+
}
|
|
14241
14271
|
if (groupToMove) {
|
|
14242
14272
|
const activeGroupSelectionId = activeObj instanceof fabric.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0;
|
|
14243
14273
|
const transformStart = activeGroupSelectionId === groupToMove.id ? groupSelectionTransformStartRef.current : null;
|
|
@@ -14298,6 +14328,18 @@ const PageCanvas = forwardRef(
|
|
|
14298
14328
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14299
14329
|
const newLeft = (groupToMove.left ?? 0) + deltaX;
|
|
14300
14330
|
const newTop = (groupToMove.top ?? 0) + deltaY;
|
|
14331
|
+
const __dbg = !!(typeof window !== "undefined" && window.__pixldocsDebugGroupMove);
|
|
14332
|
+
if (__dbg) {
|
|
14333
|
+
console.log("[GRP-MOVE] commit", {
|
|
14334
|
+
groupId: groupToMove.id,
|
|
14335
|
+
groupAbs,
|
|
14336
|
+
movedGroup: { left: movedGroupLeft, top: movedGroupTop },
|
|
14337
|
+
delta: { x: deltaX, y: deltaY },
|
|
14338
|
+
newStored: { left: newLeft, top: newTop },
|
|
14339
|
+
activeSelectionAngle: isActiveSelection && activeObj ? activeObj.angle : null,
|
|
14340
|
+
hasGroupSelectionId: !!(isActiveSelection && activeObj instanceof fabric.ActiveSelection && activeObj.__pixldocsGroupSelection)
|
|
14341
|
+
});
|
|
14342
|
+
}
|
|
14301
14343
|
updateNodeStore(groupToMove.id, { left: newLeft, top: newTop }, { recordHistory: false, skipLayoutRecalc: true });
|
|
14302
14344
|
commitHistoryStore();
|
|
14303
14345
|
pendingGroupDrillInRef.current = null;
|
|
@@ -14319,7 +14361,7 @@ const PageCanvas = forwardRef(
|
|
|
14319
14361
|
}
|
|
14320
14362
|
} catch {
|
|
14321
14363
|
}
|
|
14322
|
-
const pageAfterMove = ((
|
|
14364
|
+
const pageAfterMove = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
|
|
14323
14365
|
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14324
14366
|
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14325
14367
|
preservedGroupMemberIds = memberIdsAfterMove;
|
|
@@ -14330,12 +14372,25 @@ const PageCanvas = forwardRef(
|
|
|
14330
14372
|
if (!node) continue;
|
|
14331
14373
|
const abs = getAbsoluteBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14332
14374
|
const bounds = getNodeBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14375
|
+
const __prevLeft = obj.left;
|
|
14376
|
+
const __prevTop = obj.top;
|
|
14333
14377
|
if (obj instanceof fabric.Group && obj.__cropGroup || obj instanceof fabric.FabricImage && (obj.originX === "center" || obj.originY === "center")) {
|
|
14334
14378
|
obj.set({ left: abs.left + Math.max(1, bounds.width) / 2, top: abs.top + Math.max(1, bounds.height) / 2 });
|
|
14335
14379
|
} else {
|
|
14336
14380
|
obj.set({ left: abs.left, top: abs.top });
|
|
14337
14381
|
}
|
|
14338
14382
|
obj.setCoords();
|
|
14383
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
14384
|
+
console.log("[GRP-MOVE] rebake-member", {
|
|
14385
|
+
id,
|
|
14386
|
+
nodeType: node.type,
|
|
14387
|
+
storeAbs: abs,
|
|
14388
|
+
bounds,
|
|
14389
|
+
origin: { x: obj.originX, y: obj.originY },
|
|
14390
|
+
prev: { left: __prevLeft, top: __prevTop },
|
|
14391
|
+
after: { left: obj.left, top: obj.top }
|
|
14392
|
+
});
|
|
14393
|
+
}
|
|
14339
14394
|
}
|
|
14340
14395
|
const bakedSelection = reselectionObjects.length > 1 ? new fabric.ActiveSelection(reselectionObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14341
14396
|
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
@@ -14621,7 +14676,7 @@ const PageCanvas = forwardRef(
|
|
|
14621
14676
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14622
14677
|
obj.setCoords();
|
|
14623
14678
|
}
|
|
14624
|
-
const pageChildrenForReflow = ((
|
|
14679
|
+
const pageChildrenForReflow = ((_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
|
|
14625
14680
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14626
14681
|
for (const id of modifiedIdsThisRound) {
|
|
14627
14682
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -15579,6 +15634,27 @@ const PageCanvas = forwardRef(
|
|
|
15579
15634
|
} else {
|
|
15580
15635
|
const skipPositionBecauseSelection = preserveSelectionMemberPosition || !forceStorePositionSync && isSelected && (deltaX > 0.1 || deltaY > 0.1) && (wasJustModified || isBeingTransformed);
|
|
15581
15636
|
const anyChange = positionChanged || otherPropsChanged || forceApplyFromPanel;
|
|
15637
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove && (forceStorePositionSync || preserveSelectionMemberPosition || (deltaX > 0.1 || deltaY > 0.1))) {
|
|
15638
|
+
console.log("[GRP-MOVE] doSync-member", {
|
|
15639
|
+
id: element.id,
|
|
15640
|
+
type: element.type,
|
|
15641
|
+
fabric: { left: fabricLeft, top: fabricTop },
|
|
15642
|
+
store: { left: storeLeft, top: storeTop },
|
|
15643
|
+
delta: { x: deltaX, y: deltaY },
|
|
15644
|
+
flags: {
|
|
15645
|
+
forceStorePositionSync,
|
|
15646
|
+
preserveSelectionMemberPosition,
|
|
15647
|
+
isSelected,
|
|
15648
|
+
wasJustModified,
|
|
15649
|
+
isBeingTransformed,
|
|
15650
|
+
positionChanged,
|
|
15651
|
+
otherPropsChanged,
|
|
15652
|
+
skipPositionBecauseSelection,
|
|
15653
|
+
anyChange,
|
|
15654
|
+
syncTriggeredByPanel: syncTriggeredByPanelRef.current
|
|
15655
|
+
}
|
|
15656
|
+
});
|
|
15657
|
+
}
|
|
15582
15658
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15583
15659
|
if (anyChange && !skipPositionBecauseSelection) {
|
|
15584
15660
|
updateFabricObject(existingObj, element, wasJustModified && !forceStorePositionSync);
|
|
@@ -23761,9 +23837,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23761
23837
|
}
|
|
23762
23838
|
return svgString;
|
|
23763
23839
|
}
|
|
23764
|
-
const resolvedPackageVersion = "0.5.
|
|
23840
|
+
const resolvedPackageVersion = "0.5.276";
|
|
23765
23841
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23766
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23842
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.276";
|
|
23767
23843
|
const roundParityValue = (value) => {
|
|
23768
23844
|
if (typeof value !== "number") return value;
|
|
23769
23845
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24577,7 +24653,7 @@ class PixldocsRenderer {
|
|
|
24577
24653
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24578
24654
|
}
|
|
24579
24655
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24580
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24656
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C9akdCtS.js");
|
|
24581
24657
|
const prepared = preparePagesForExport(
|
|
24582
24658
|
cloned.pages,
|
|
24583
24659
|
canvasWidth,
|
|
@@ -26897,7 +26973,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26897
26973
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26898
26974
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26899
26975
|
try {
|
|
26900
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
26976
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C9akdCtS.js");
|
|
26901
26977
|
try {
|
|
26902
26978
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26903
26979
|
} catch {
|
|
@@ -27297,4 +27373,4 @@ export {
|
|
|
27297
27373
|
buildTeaserBlurFlatKeys as y,
|
|
27298
27374
|
collectFontDescriptorsFromConfig as z
|
|
27299
27375
|
};
|
|
27300
|
-
//# sourceMappingURL=index-
|
|
27376
|
+
//# sourceMappingURL=index-CszEZlZ7.js.map
|