@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
|
@@ -13908,9 +13908,23 @@ const PageCanvas = react.forwardRef(
|
|
|
13908
13908
|
});
|
|
13909
13909
|
let cropGroupSaveTimer = null;
|
|
13910
13910
|
fabricCanvas.on("object:modified", (e) => {
|
|
13911
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
13911
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
13912
13912
|
try {
|
|
13913
13913
|
dragStarted = false;
|
|
13914
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
13915
|
+
const t = e.target;
|
|
13916
|
+
console.log("[GRP-MOVE] object:modified fired", {
|
|
13917
|
+
targetType: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
|
|
13918
|
+
isActiveSelection: t instanceof fabric__namespace.ActiveSelection,
|
|
13919
|
+
groupSelectionId: t ? t.__pixldocsGroupSelection : null,
|
|
13920
|
+
memberIds: t instanceof fabric__namespace.ActiveSelection ? t.getObjects().map((o) => getObjectId(o)) : [getObjectId(t)],
|
|
13921
|
+
targetLeft: t == null ? void 0 : t.left,
|
|
13922
|
+
targetTop: t == null ? void 0 : t.top,
|
|
13923
|
+
scaleX: t == null ? void 0 : t.scaleX,
|
|
13924
|
+
scaleY: t == null ? void 0 : t.scaleY,
|
|
13925
|
+
angle: t == null ? void 0 : t.angle
|
|
13926
|
+
});
|
|
13927
|
+
}
|
|
13914
13928
|
setGuides([]);
|
|
13915
13929
|
setGroupOverlayLiveBoundsRef.current(null);
|
|
13916
13930
|
objectResizeActiveSnapRef.current = null;
|
|
@@ -13952,7 +13966,7 @@ const PageCanvas = react.forwardRef(
|
|
|
13952
13966
|
const active = fabricCanvas.getActiveObject();
|
|
13953
13967
|
const activeId = active ? getObjectId(active) : null;
|
|
13954
13968
|
if (active && activeId && activeId !== "__background__" && !(active instanceof fabric__namespace.Group)) {
|
|
13955
|
-
const pageChildrenForParent = ((
|
|
13969
|
+
const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
|
|
13956
13970
|
const parentGroup = findParentGroup(pageChildrenForParent, activeId);
|
|
13957
13971
|
if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
|
|
13958
13972
|
let fabricSectionGroup = active.group && active.group instanceof fabric__namespace.Group ? active.group : null;
|
|
@@ -14034,7 +14048,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14034
14048
|
useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
|
|
14035
14049
|
}
|
|
14036
14050
|
const stateAfter = useEditorStore.getState();
|
|
14037
|
-
const pageAfter = ((
|
|
14051
|
+
const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
14038
14052
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14039
14053
|
if (groupNodeAfter) {
|
|
14040
14054
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14096,7 +14110,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14096
14110
|
}
|
|
14097
14111
|
if (active && active instanceof fabric__namespace.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
|
|
14098
14112
|
const groupId = getObjectId(active);
|
|
14099
|
-
const pageChildrenSec = ((
|
|
14113
|
+
const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
|
|
14100
14114
|
const modifiedTarget2 = e == null ? void 0 : e.target;
|
|
14101
14115
|
const resizeScaleTarget = lastResizeScaleTargetRef.current;
|
|
14102
14116
|
lastResizeScaleTargetRef.current = null;
|
|
@@ -14127,7 +14141,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14127
14141
|
const node = findNodeById(pageChildrenSec, groupId);
|
|
14128
14142
|
if (isChildModified && node && !groupMoved) {
|
|
14129
14143
|
const stateAfter = useEditorStore.getState();
|
|
14130
|
-
const pageAfter = ((
|
|
14144
|
+
const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
|
|
14131
14145
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14132
14146
|
if (groupNodeAfter) {
|
|
14133
14147
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14143,7 +14157,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14143
14157
|
}
|
|
14144
14158
|
if (active && active instanceof fabric__namespace.Group && !(active instanceof fabric__namespace.ActiveSelection) && getObjectId(active)) {
|
|
14145
14159
|
const groupId = getObjectId(active);
|
|
14146
|
-
const pageChildren3 = ((
|
|
14160
|
+
const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
14147
14161
|
const w = (active.width ?? 0) * (active.scaleX ?? 1);
|
|
14148
14162
|
const h = (active.height ?? 0) * (active.scaleY ?? 1);
|
|
14149
14163
|
const centerX = active.left ?? 0;
|
|
@@ -14165,7 +14179,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14165
14179
|
}
|
|
14166
14180
|
const activeObj = fabricCanvas.getActiveObject();
|
|
14167
14181
|
let activeObjects = fabricCanvas.getActiveObjects();
|
|
14168
|
-
const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((
|
|
14182
|
+
const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
|
|
14169
14183
|
const activeSelectionDelta = activeObj instanceof fabric__namespace.ActiveSelection && activeSelectionMoveStart ? (() => {
|
|
14170
14184
|
const rect = activeObj.getBoundingRect();
|
|
14171
14185
|
return {
|
|
@@ -14256,6 +14270,22 @@ const PageCanvas = react.forwardRef(
|
|
|
14256
14270
|
return memberIds.every((mid) => selectedSet.has(mid));
|
|
14257
14271
|
})();
|
|
14258
14272
|
const groupToMove = candidateIsStack || allMembersSelected ? candidateGroup : null;
|
|
14273
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
14274
|
+
console.log("[GRP-MOVE] entry", {
|
|
14275
|
+
selectedElementIds,
|
|
14276
|
+
isActiveSelection,
|
|
14277
|
+
activeSelectionGroupId: activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : null,
|
|
14278
|
+
parentGroupIds: parentGroups.map((g) => g.id),
|
|
14279
|
+
sameDirectParent,
|
|
14280
|
+
commonAncestorId: commonAncestor == null ? void 0 : commonAncestor.id,
|
|
14281
|
+
candidateGroupId: candidateGroup == null ? void 0 : candidateGroup.id,
|
|
14282
|
+
candidateIsStack,
|
|
14283
|
+
allMembersSelected,
|
|
14284
|
+
groupToMoveId: (groupToMove == null ? void 0 : groupToMove.id) ?? null,
|
|
14285
|
+
activeSelectionHadTransform,
|
|
14286
|
+
selectedLogicalGroupIds
|
|
14287
|
+
});
|
|
14288
|
+
}
|
|
14259
14289
|
if (groupToMove) {
|
|
14260
14290
|
const activeGroupSelectionId = activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0;
|
|
14261
14291
|
const transformStart = activeGroupSelectionId === groupToMove.id ? groupSelectionTransformStartRef.current : null;
|
|
@@ -14316,6 +14346,18 @@ const PageCanvas = react.forwardRef(
|
|
|
14316
14346
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14317
14347
|
const newLeft = (groupToMove.left ?? 0) + deltaX;
|
|
14318
14348
|
const newTop = (groupToMove.top ?? 0) + deltaY;
|
|
14349
|
+
const __dbg = !!(typeof window !== "undefined" && window.__pixldocsDebugGroupMove);
|
|
14350
|
+
if (__dbg) {
|
|
14351
|
+
console.log("[GRP-MOVE] commit", {
|
|
14352
|
+
groupId: groupToMove.id,
|
|
14353
|
+
groupAbs,
|
|
14354
|
+
movedGroup: { left: movedGroupLeft, top: movedGroupTop },
|
|
14355
|
+
delta: { x: deltaX, y: deltaY },
|
|
14356
|
+
newStored: { left: newLeft, top: newTop },
|
|
14357
|
+
activeSelectionAngle: isActiveSelection && activeObj ? activeObj.angle : null,
|
|
14358
|
+
hasGroupSelectionId: !!(isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection && activeObj.__pixldocsGroupSelection)
|
|
14359
|
+
});
|
|
14360
|
+
}
|
|
14319
14361
|
updateNodeStore(groupToMove.id, { left: newLeft, top: newTop }, { recordHistory: false, skipLayoutRecalc: true });
|
|
14320
14362
|
commitHistoryStore();
|
|
14321
14363
|
pendingGroupDrillInRef.current = null;
|
|
@@ -14337,7 +14379,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14337
14379
|
}
|
|
14338
14380
|
} catch {
|
|
14339
14381
|
}
|
|
14340
|
-
const pageAfterMove = ((
|
|
14382
|
+
const pageAfterMove = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
|
|
14341
14383
|
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14342
14384
|
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14343
14385
|
preservedGroupMemberIds = memberIdsAfterMove;
|
|
@@ -14348,12 +14390,25 @@ const PageCanvas = react.forwardRef(
|
|
|
14348
14390
|
if (!node) continue;
|
|
14349
14391
|
const abs = getAbsoluteBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14350
14392
|
const bounds = getNodeBounds(node, pageAfterMove, pageBoundsOptions);
|
|
14393
|
+
const __prevLeft = obj.left;
|
|
14394
|
+
const __prevTop = obj.top;
|
|
14351
14395
|
if (obj instanceof fabric__namespace.Group && obj.__cropGroup || obj instanceof fabric__namespace.FabricImage && (obj.originX === "center" || obj.originY === "center")) {
|
|
14352
14396
|
obj.set({ left: abs.left + Math.max(1, bounds.width) / 2, top: abs.top + Math.max(1, bounds.height) / 2 });
|
|
14353
14397
|
} else {
|
|
14354
14398
|
obj.set({ left: abs.left, top: abs.top });
|
|
14355
14399
|
}
|
|
14356
14400
|
obj.setCoords();
|
|
14401
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
14402
|
+
console.log("[GRP-MOVE] rebake-member", {
|
|
14403
|
+
id,
|
|
14404
|
+
nodeType: node.type,
|
|
14405
|
+
storeAbs: abs,
|
|
14406
|
+
bounds,
|
|
14407
|
+
origin: { x: obj.originX, y: obj.originY },
|
|
14408
|
+
prev: { left: __prevLeft, top: __prevTop },
|
|
14409
|
+
after: { left: obj.left, top: obj.top }
|
|
14410
|
+
});
|
|
14411
|
+
}
|
|
14357
14412
|
}
|
|
14358
14413
|
const bakedSelection = reselectionObjects.length > 1 ? new fabric__namespace.ActiveSelection(reselectionObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14359
14414
|
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
@@ -14639,7 +14694,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14639
14694
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14640
14695
|
obj.setCoords();
|
|
14641
14696
|
}
|
|
14642
|
-
const pageChildrenForReflow = ((
|
|
14697
|
+
const pageChildrenForReflow = ((_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
|
|
14643
14698
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14644
14699
|
for (const id of modifiedIdsThisRound) {
|
|
14645
14700
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -15597,6 +15652,27 @@ const PageCanvas = react.forwardRef(
|
|
|
15597
15652
|
} else {
|
|
15598
15653
|
const skipPositionBecauseSelection = preserveSelectionMemberPosition || !forceStorePositionSync && isSelected && (deltaX > 0.1 || deltaY > 0.1) && (wasJustModified || isBeingTransformed);
|
|
15599
15654
|
const anyChange = positionChanged || otherPropsChanged || forceApplyFromPanel;
|
|
15655
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove && (forceStorePositionSync || preserveSelectionMemberPosition || (deltaX > 0.1 || deltaY > 0.1))) {
|
|
15656
|
+
console.log("[GRP-MOVE] doSync-member", {
|
|
15657
|
+
id: element.id,
|
|
15658
|
+
type: element.type,
|
|
15659
|
+
fabric: { left: fabricLeft, top: fabricTop },
|
|
15660
|
+
store: { left: storeLeft, top: storeTop },
|
|
15661
|
+
delta: { x: deltaX, y: deltaY },
|
|
15662
|
+
flags: {
|
|
15663
|
+
forceStorePositionSync,
|
|
15664
|
+
preserveSelectionMemberPosition,
|
|
15665
|
+
isSelected,
|
|
15666
|
+
wasJustModified,
|
|
15667
|
+
isBeingTransformed,
|
|
15668
|
+
positionChanged,
|
|
15669
|
+
otherPropsChanged,
|
|
15670
|
+
skipPositionBecauseSelection,
|
|
15671
|
+
anyChange,
|
|
15672
|
+
syncTriggeredByPanel: syncTriggeredByPanelRef.current
|
|
15673
|
+
}
|
|
15674
|
+
});
|
|
15675
|
+
}
|
|
15600
15676
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15601
15677
|
if (anyChange && !skipPositionBecauseSelection) {
|
|
15602
15678
|
updateFabricObject(existingObj, element, wasJustModified && !forceStorePositionSync);
|
|
@@ -23779,9 +23855,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23779
23855
|
}
|
|
23780
23856
|
return svgString;
|
|
23781
23857
|
}
|
|
23782
|
-
const resolvedPackageVersion = "0.5.
|
|
23858
|
+
const resolvedPackageVersion = "0.5.276";
|
|
23783
23859
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23784
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23860
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.276";
|
|
23785
23861
|
const roundParityValue = (value) => {
|
|
23786
23862
|
if (typeof value !== "number") return value;
|
|
23787
23863
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24595,7 +24671,7 @@ class PixldocsRenderer {
|
|
|
24595
24671
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24596
24672
|
}
|
|
24597
24673
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24598
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24674
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CvLitjuI.cjs"));
|
|
24599
24675
|
const prepared = preparePagesForExport(
|
|
24600
24676
|
cloned.pages,
|
|
24601
24677
|
canvasWidth,
|
|
@@ -26915,7 +26991,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26915
26991
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26916
26992
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26917
26993
|
try {
|
|
26918
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26994
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CvLitjuI.cjs"));
|
|
26919
26995
|
try {
|
|
26920
26996
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26921
26997
|
} catch {
|
|
@@ -27312,4 +27388,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27312
27388
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27313
27389
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27314
27390
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27315
|
-
//# sourceMappingURL=index-
|
|
27391
|
+
//# sourceMappingURL=index-AzU8Pmse.cjs.map
|