@pixldocs/canvas-renderer 0.5.281 → 0.5.283
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-m0_zL8dr.cjs → index-A4ICnK--.cjs} +35 -55
- package/dist/index-A4ICnK--.cjs.map +1 -0
- package/dist/{index-CcnLc5LI.js → index-DZrJdP7E.js} +35 -55
- package/dist/index-DZrJdP7E.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CyvVvmOr.cjs → vectorPdfExport-48Xfutfv.cjs} +4 -4
- package/dist/{vectorPdfExport-CyvVvmOr.cjs.map → vectorPdfExport-48Xfutfv.cjs.map} +1 -1
- package/dist/{vectorPdfExport-CT_DagYd.js → vectorPdfExport-DwiSa6HT.js} +4 -4
- package/dist/{vectorPdfExport-CT_DagYd.js.map → vectorPdfExport-DwiSa6HT.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CcnLc5LI.js.map +0 -1
- package/dist/index-m0_zL8dr.cjs.map +0 -1
|
@@ -13923,7 +13923,7 @@ const PageCanvas = react.forwardRef(
|
|
|
13923
13923
|
let cropGroupSaveTimer = null;
|
|
13924
13924
|
let objectModifiedInFlight = false;
|
|
13925
13925
|
fabricCanvas.on("object:modified", (e) => {
|
|
13926
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j
|
|
13926
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
13927
13927
|
if (objectModifiedInFlight) {
|
|
13928
13928
|
if (shouldLogGroupMove()) {
|
|
13929
13929
|
console.log("[GRP-MOVE] object:modified re-entry skipped", {
|
|
@@ -14316,10 +14316,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14316
14316
|
const groupAbs = getAbsoluteBounds(groupToMove, pageChildren2);
|
|
14317
14317
|
let movedGroupLeft = groupAbs.left;
|
|
14318
14318
|
let movedGroupTop = groupAbs.top;
|
|
14319
|
-
if (activeObj instanceof fabric__namespace.ActiveSelection &&
|
|
14320
|
-
movedGroupLeft = groupAbs.left + activeSelectionDelta.x;
|
|
14321
|
-
movedGroupTop = groupAbs.top + activeSelectionDelta.y;
|
|
14322
|
-
} else if (activeObj instanceof fabric__namespace.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14319
|
+
if (activeObj instanceof fabric__namespace.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14323
14320
|
const selectionRect = activeObj.getBoundingRect();
|
|
14324
14321
|
movedGroupLeft = transformStart.groupLeft + (selectionRect.left - transformStart.selectionLeft);
|
|
14325
14322
|
movedGroupTop = transformStart.groupTop + (selectionRect.top - transformStart.selectionTop);
|
|
@@ -14389,22 +14386,29 @@ const PageCanvas = react.forwardRef(
|
|
|
14389
14386
|
setDrilledGroupBounds(null);
|
|
14390
14387
|
drilledGroupIdRef.current = null;
|
|
14391
14388
|
const groupSelectionId = (isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0) ?? groupToMove.id;
|
|
14392
|
-
const
|
|
14393
|
-
|
|
14394
|
-
const preservedGroupMemberIds = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : selectedElementIds;
|
|
14395
|
-
if (activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14389
|
+
const targetObjects = isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects() : activeObjects;
|
|
14390
|
+
if (groupSelectionId && activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14396
14391
|
restoreGroupSelectionVisualState(activeObj, groupSelectionId);
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
groupSelectionId,
|
|
14400
|
-
expiresAt: Date.now() + 1200
|
|
14401
|
-
};
|
|
14392
|
+
fabricCanvas.setActiveObject(activeObj);
|
|
14393
|
+
activeObj.setCoords();
|
|
14402
14394
|
}
|
|
14403
14395
|
selectElements([groupSelectionId], false, false);
|
|
14404
14396
|
fabricCanvas.requestRenderAll();
|
|
14405
14397
|
elementsRef.current = getCurrentElements();
|
|
14398
|
+
for (const obj of targetObjects) {
|
|
14399
|
+
const objId = getObjectId(obj);
|
|
14400
|
+
if (objId && objId !== "__background__") {
|
|
14401
|
+
justModifiedIdsRef.current.add(objId);
|
|
14402
|
+
modifiedIdsThisRound.add(objId);
|
|
14403
|
+
}
|
|
14404
|
+
}
|
|
14405
|
+
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14406
14406
|
groupSelectionTransformStartRef.current = null;
|
|
14407
14407
|
activeSelectionMoveStartRef.current = null;
|
|
14408
|
+
restorePreservedGroupSelectionSoon({
|
|
14409
|
+
memberIds: targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
|
|
14410
|
+
groupSelectionId
|
|
14411
|
+
});
|
|
14408
14412
|
unlockEditsSoon();
|
|
14409
14413
|
return;
|
|
14410
14414
|
}
|
|
@@ -14666,7 +14670,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14666
14670
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14667
14671
|
obj.setCoords();
|
|
14668
14672
|
}
|
|
14669
|
-
const pageChildrenForReflow = ((
|
|
14673
|
+
const pageChildrenForReflow = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14670
14674
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14671
14675
|
for (const id of modifiedIdsThisRound) {
|
|
14672
14676
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -15033,23 +15037,6 @@ const PageCanvas = react.forwardRef(
|
|
|
15033
15037
|
fc.discardActiveObject();
|
|
15034
15038
|
}
|
|
15035
15039
|
}
|
|
15036
|
-
const forceLogicalGroupStorePositionSyncIds = /* @__PURE__ */ new Set();
|
|
15037
|
-
const needsLooseLogicalGroupPositionSync = !!((activeSelectionSnapshot == null ? void 0 : activeSelectionSnapshot.groupSelectionId) && !syncTriggeredByPanelRef.current && !shouldSkipUpdates2 && !isTransforming2 && activeSelectionSnapshot.memberIds.some((id) => justModifiedIdsRef.current.has(id)));
|
|
15038
|
-
if (needsLooseLogicalGroupPositionSync) {
|
|
15039
|
-
activeSelectionSnapshot.memberIds.forEach((id) => forceLogicalGroupStorePositionSyncIds.add(id));
|
|
15040
|
-
const activeForLooseSync = fc.getActiveObject();
|
|
15041
|
-
if (activeForLooseSync instanceof fabric__namespace.ActiveSelection && activeForLooseSync.__pixldocsGroupSelection === activeSelectionSnapshot.groupSelectionId) {
|
|
15042
|
-
try {
|
|
15043
|
-
skipSelectionClearOnDiscardRef.current = true;
|
|
15044
|
-
skipActiveSelectionBakeOnClearRef.current = true;
|
|
15045
|
-
fc.discardActiveObject();
|
|
15046
|
-
} finally {
|
|
15047
|
-
skipActiveSelectionBakeOnClearRef.current = false;
|
|
15048
|
-
skipSelectionClearOnDiscardRef.current = false;
|
|
15049
|
-
}
|
|
15050
|
-
}
|
|
15051
|
-
activeSelectionSnapshot.memberIds.forEach((id) => justModifiedIdsRef.current.delete(id));
|
|
15052
|
-
}
|
|
15053
15040
|
const currentFabricObjects = /* @__PURE__ */ new Map();
|
|
15054
15041
|
fc.getObjects().forEach((obj) => {
|
|
15055
15042
|
const id = getObjectId(obj);
|
|
@@ -15063,8 +15050,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15063
15050
|
const replacementById = !activeStillOnCanvas && activeId ? fc.getObjects().find((o) => getObjectId(o) === activeId) ?? null : null;
|
|
15064
15051
|
const restoreTarget = activeStillOnCanvas ? activeBeforeSync : replacementById;
|
|
15065
15052
|
const isActiveTextBeingEdited = activeId && editingTextIdRef.current === activeId && activeBeforeSync instanceof fabric__namespace.Textbox;
|
|
15066
|
-
|
|
15067
|
-
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2 && !needsLooseLogicalGroupPositionSync && !keepLiveLogicalActiveSelection) {
|
|
15053
|
+
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2) {
|
|
15068
15054
|
const freshMembers = activeSelectionSnapshot.memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
15069
15055
|
if (freshMembers.length > 1) {
|
|
15070
15056
|
isSyncingSelectionToFabricRef.current = true;
|
|
@@ -15074,9 +15060,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15074
15060
|
applyLogicalGroupSelectionVisualState(newSel, activeSelectionSnapshot.groupSelectionId);
|
|
15075
15061
|
}
|
|
15076
15062
|
fc.setActiveObject(newSel);
|
|
15077
|
-
|
|
15078
|
-
newSel.setCoords();
|
|
15079
|
-
}
|
|
15063
|
+
newSel.setCoords();
|
|
15080
15064
|
fc.requestRenderAll();
|
|
15081
15065
|
} finally {
|
|
15082
15066
|
isSyncingSelectionToFabricRef.current = false;
|
|
@@ -15491,8 +15475,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15491
15475
|
continue;
|
|
15492
15476
|
}
|
|
15493
15477
|
if (existingObj instanceof fabric__namespace.Group && existingObj.__cropGroup) {
|
|
15494
|
-
|
|
15495
|
-
updateFabricObject(existingObj, element, wasJustModified && !forceStorePositionSync2);
|
|
15478
|
+
updateFabricObject(existingObj, element, wasJustModified);
|
|
15496
15479
|
existingObj.set({
|
|
15497
15480
|
flipX: element.flipX ?? false,
|
|
15498
15481
|
flipY: element.flipY ?? false,
|
|
@@ -15503,7 +15486,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15503
15486
|
if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
|
|
15504
15487
|
continue;
|
|
15505
15488
|
}
|
|
15506
|
-
if (existingObj instanceof fabric__namespace.Textbox && wasJustModified && !syncTriggeredByPanelRef.current
|
|
15489
|
+
if (existingObj instanceof fabric__namespace.Textbox && wasJustModified && !syncTriggeredByPanelRef.current) {
|
|
15507
15490
|
justModifiedIdsRef.current.delete(element.id);
|
|
15508
15491
|
continue;
|
|
15509
15492
|
}
|
|
@@ -15522,8 +15505,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15522
15505
|
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15523
15506
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15524
15507
|
const comparePosForImg = getObjectSyncComparePosition(existingObj);
|
|
15525
|
-
const
|
|
15526
|
-
const preserveSelectionMemberPosition = !forceStorePositionSync && shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15508
|
+
const preserveSelectionMemberPosition = shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15527
15509
|
const positionChanged = !preserveSelectionMemberPosition && (Math.abs(comparePosForImg.left - storePosForImg.left) > 0.1 || Math.abs(comparePosForImg.top - storePosForImg.top) > 0.1);
|
|
15528
15510
|
if (visibilityChanged && !positionChanged || visibilityUpdateInProgressRef.current) {
|
|
15529
15511
|
const isDynamicField = dynamicFieldIds.includes(element.id);
|
|
@@ -15539,7 +15521,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15539
15521
|
previousVisibilityRef.current.set(element.id, currentVisible);
|
|
15540
15522
|
} else {
|
|
15541
15523
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15542
|
-
updateFabricObject(existingObj, element, wasJustModified
|
|
15524
|
+
updateFabricObject(existingObj, element, wasJustModified || preserveSelectionMemberPosition);
|
|
15543
15525
|
}
|
|
15544
15526
|
const isDynamicField = dynamicFieldIds.includes(element.id);
|
|
15545
15527
|
const canBeEvented = isEditorMode || isPreviewMode && isDynamicField;
|
|
@@ -15572,14 +15554,13 @@ const PageCanvas = react.forwardRef(
|
|
|
15572
15554
|
const storeTop = storePos.top;
|
|
15573
15555
|
const deltaX = Math.abs(fabricLeft - storeLeft);
|
|
15574
15556
|
const deltaY = Math.abs(fabricTop - storeTop);
|
|
15575
|
-
const
|
|
15576
|
-
const preserveSelectionMemberPosition = !forceStorePositionSync && shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15557
|
+
const preserveSelectionMemberPosition = shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15577
15558
|
let positionChanged = !preserveSelectionMemberPosition && (deltaX > 0.1 || deltaY > 0.1);
|
|
15578
15559
|
const activeObj = fc.getActiveObject();
|
|
15579
15560
|
const isInActiveSelection = activeObj && (activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects().includes(existingObj) : activeObj === existingObj);
|
|
15580
15561
|
const isInSelectedIds = selectedIdsFromStore.has(element.id);
|
|
15581
15562
|
const isSelected = isInActiveSelection || isInSelectedIds;
|
|
15582
|
-
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)
|
|
15563
|
+
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
|
|
15583
15564
|
positionChanged = false;
|
|
15584
15565
|
}
|
|
15585
15566
|
const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
|
|
@@ -15626,9 +15607,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15626
15607
|
});
|
|
15627
15608
|
previousVisibilityRef.current.set(element.id, currentVisible);
|
|
15628
15609
|
} else {
|
|
15629
|
-
const skipPositionBecauseSelection = preserveSelectionMemberPosition ||
|
|
15610
|
+
const skipPositionBecauseSelection = preserveSelectionMemberPosition || isSelected && (deltaX > 0.1 || deltaY > 0.1) && (wasJustModified || isBeingTransformed);
|
|
15630
15611
|
const anyChange = positionChanged || otherPropsChanged || forceApplyFromPanel;
|
|
15631
|
-
if (shouldLogGroupMove() && (
|
|
15612
|
+
if (shouldLogGroupMove() && (preserveSelectionMemberPosition || (deltaX > 0.1 || deltaY > 0.1))) {
|
|
15632
15613
|
console.log("[GRP-MOVE] doSync-member", {
|
|
15633
15614
|
id: element.id,
|
|
15634
15615
|
type: element.type,
|
|
@@ -15636,7 +15617,6 @@ const PageCanvas = react.forwardRef(
|
|
|
15636
15617
|
store: { left: storeLeft, top: storeTop },
|
|
15637
15618
|
delta: { x: deltaX, y: deltaY },
|
|
15638
15619
|
flags: {
|
|
15639
|
-
forceStorePositionSync,
|
|
15640
15620
|
preserveSelectionMemberPosition,
|
|
15641
15621
|
isSelected,
|
|
15642
15622
|
wasJustModified,
|
|
@@ -15651,7 +15631,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15651
15631
|
}
|
|
15652
15632
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15653
15633
|
if (anyChange && !skipPositionBecauseSelection) {
|
|
15654
|
-
updateFabricObject(existingObj, element, wasJustModified
|
|
15634
|
+
updateFabricObject(existingObj, element, wasJustModified);
|
|
15655
15635
|
if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
|
|
15656
15636
|
} else if (skipPositionBecauseSelection && anyChange) {
|
|
15657
15637
|
const savedLeft = existingObj.left;
|
|
@@ -23830,9 +23810,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23830
23810
|
}
|
|
23831
23811
|
return svgString;
|
|
23832
23812
|
}
|
|
23833
|
-
const resolvedPackageVersion = "0.5.
|
|
23813
|
+
const resolvedPackageVersion = "0.5.283";
|
|
23834
23814
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23835
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23815
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.283";
|
|
23836
23816
|
const roundParityValue = (value) => {
|
|
23837
23817
|
if (typeof value !== "number") return value;
|
|
23838
23818
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24646,7 +24626,7 @@ class PixldocsRenderer {
|
|
|
24646
24626
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24647
24627
|
}
|
|
24648
24628
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24649
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24629
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-48Xfutfv.cjs"));
|
|
24650
24630
|
const prepared = preparePagesForExport(
|
|
24651
24631
|
cloned.pages,
|
|
24652
24632
|
canvasWidth,
|
|
@@ -26966,7 +26946,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26966
26946
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26967
26947
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26968
26948
|
try {
|
|
26969
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26949
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-48Xfutfv.cjs"));
|
|
26970
26950
|
try {
|
|
26971
26951
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26972
26952
|
} catch {
|
|
@@ -27363,4 +27343,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27363
27343
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27364
27344
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27365
27345
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27366
|
-
//# sourceMappingURL=index-
|
|
27346
|
+
//# sourceMappingURL=index-A4ICnK--.cjs.map
|