@pixldocs/canvas-renderer 0.5.282 → 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-DeBKmZZc.cjs → index-A4ICnK--.cjs} +36 -60
- package/dist/index-A4ICnK--.cjs.map +1 -0
- package/dist/{index-d5uaicum.js → index-DZrJdP7E.js} +36 -60
- package/dist/index-DZrJdP7E.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CIvJyIlB.cjs → vectorPdfExport-48Xfutfv.cjs} +4 -4
- package/dist/{vectorPdfExport-CIvJyIlB.cjs.map → vectorPdfExport-48Xfutfv.cjs.map} +1 -1
- package/dist/{vectorPdfExport-DRVboAKK.js → vectorPdfExport-DwiSa6HT.js} +4 -4
- package/dist/{vectorPdfExport-DRVboAKK.js.map → vectorPdfExport-DwiSa6HT.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DeBKmZZc.cjs.map +0 -1
- package/dist/index-d5uaicum.js.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,26 +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
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
memberIds: preservedGroupMemberIds,
|
|
14398
|
-
groupSelectionId,
|
|
14399
|
-
expiresAt: Date.now() + 1200
|
|
14400
|
-
};
|
|
14401
|
-
preservedGroupMemberIds.forEach((id) => {
|
|
14402
|
-
justModifiedIdsRef.current.add(id);
|
|
14403
|
-
modifiedIdsThisRound.add(id);
|
|
14404
|
-
});
|
|
14405
|
-
setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
|
|
14389
|
+
const targetObjects = isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects() : activeObjects;
|
|
14390
|
+
if (groupSelectionId && activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14391
|
+
restoreGroupSelectionVisualState(activeObj, groupSelectionId);
|
|
14392
|
+
fabricCanvas.setActiveObject(activeObj);
|
|
14393
|
+
activeObj.setCoords();
|
|
14406
14394
|
}
|
|
14407
14395
|
selectElements([groupSelectionId], false, false);
|
|
14408
14396
|
fabricCanvas.requestRenderAll();
|
|
14409
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);
|
|
14410
14406
|
groupSelectionTransformStartRef.current = null;
|
|
14411
14407
|
activeSelectionMoveStartRef.current = null;
|
|
14408
|
+
restorePreservedGroupSelectionSoon({
|
|
14409
|
+
memberIds: targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
|
|
14410
|
+
groupSelectionId
|
|
14411
|
+
});
|
|
14412
14412
|
unlockEditsSoon();
|
|
14413
14413
|
return;
|
|
14414
14414
|
}
|
|
@@ -14670,7 +14670,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14670
14670
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14671
14671
|
obj.setCoords();
|
|
14672
14672
|
}
|
|
14673
|
-
const pageChildrenForReflow = ((
|
|
14673
|
+
const pageChildrenForReflow = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14674
14674
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14675
14675
|
for (const id of modifiedIdsThisRound) {
|
|
14676
14676
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -15037,23 +15037,6 @@ const PageCanvas = react.forwardRef(
|
|
|
15037
15037
|
fc.discardActiveObject();
|
|
15038
15038
|
}
|
|
15039
15039
|
}
|
|
15040
|
-
const forceLogicalGroupStorePositionSyncIds = /* @__PURE__ */ new Set();
|
|
15041
|
-
const needsLooseLogicalGroupPositionSync = !!((activeSelectionSnapshot == null ? void 0 : activeSelectionSnapshot.groupSelectionId) && !syncTriggeredByPanelRef.current && !shouldSkipUpdates2 && !isTransforming2 && activeSelectionSnapshot.memberIds.some((id) => justModifiedIdsRef.current.has(id)));
|
|
15042
|
-
if (needsLooseLogicalGroupPositionSync) {
|
|
15043
|
-
activeSelectionSnapshot.memberIds.forEach((id) => forceLogicalGroupStorePositionSyncIds.add(id));
|
|
15044
|
-
const activeForLooseSync = fc.getActiveObject();
|
|
15045
|
-
if (activeForLooseSync instanceof fabric__namespace.ActiveSelection && activeForLooseSync.__pixldocsGroupSelection === activeSelectionSnapshot.groupSelectionId) {
|
|
15046
|
-
try {
|
|
15047
|
-
skipSelectionClearOnDiscardRef.current = true;
|
|
15048
|
-
skipActiveSelectionBakeOnClearRef.current = true;
|
|
15049
|
-
fc.discardActiveObject();
|
|
15050
|
-
} finally {
|
|
15051
|
-
skipActiveSelectionBakeOnClearRef.current = false;
|
|
15052
|
-
skipSelectionClearOnDiscardRef.current = false;
|
|
15053
|
-
}
|
|
15054
|
-
}
|
|
15055
|
-
activeSelectionSnapshot.memberIds.forEach((id) => justModifiedIdsRef.current.delete(id));
|
|
15056
|
-
}
|
|
15057
15040
|
const currentFabricObjects = /* @__PURE__ */ new Map();
|
|
15058
15041
|
fc.getObjects().forEach((obj) => {
|
|
15059
15042
|
const id = getObjectId(obj);
|
|
@@ -15067,8 +15050,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15067
15050
|
const replacementById = !activeStillOnCanvas && activeId ? fc.getObjects().find((o) => getObjectId(o) === activeId) ?? null : null;
|
|
15068
15051
|
const restoreTarget = activeStillOnCanvas ? activeBeforeSync : replacementById;
|
|
15069
15052
|
const isActiveTextBeingEdited = activeId && editingTextIdRef.current === activeId && activeBeforeSync instanceof fabric__namespace.Textbox;
|
|
15070
|
-
|
|
15071
|
-
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2 && !needsLooseLogicalGroupPositionSync && !keepLiveLogicalActiveSelection) {
|
|
15053
|
+
if (!skipRestoreSelection && activeSelectionSnapshot && !isActiveTextBeingEdited && !shouldSkipUpdates2) {
|
|
15072
15054
|
const freshMembers = activeSelectionSnapshot.memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
15073
15055
|
if (freshMembers.length > 1) {
|
|
15074
15056
|
isSyncingSelectionToFabricRef.current = true;
|
|
@@ -15078,9 +15060,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15078
15060
|
applyLogicalGroupSelectionVisualState(newSel, activeSelectionSnapshot.groupSelectionId);
|
|
15079
15061
|
}
|
|
15080
15062
|
fc.setActiveObject(newSel);
|
|
15081
|
-
|
|
15082
|
-
newSel.setCoords();
|
|
15083
|
-
}
|
|
15063
|
+
newSel.setCoords();
|
|
15084
15064
|
fc.requestRenderAll();
|
|
15085
15065
|
} finally {
|
|
15086
15066
|
isSyncingSelectionToFabricRef.current = false;
|
|
@@ -15495,8 +15475,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15495
15475
|
continue;
|
|
15496
15476
|
}
|
|
15497
15477
|
if (existingObj instanceof fabric__namespace.Group && existingObj.__cropGroup) {
|
|
15498
|
-
|
|
15499
|
-
updateFabricObject(existingObj, element, wasJustModified && !forceStorePositionSync2);
|
|
15478
|
+
updateFabricObject(existingObj, element, wasJustModified);
|
|
15500
15479
|
existingObj.set({
|
|
15501
15480
|
flipX: element.flipX ?? false,
|
|
15502
15481
|
flipY: element.flipY ?? false,
|
|
@@ -15507,7 +15486,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15507
15486
|
if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
|
|
15508
15487
|
continue;
|
|
15509
15488
|
}
|
|
15510
|
-
if (existingObj instanceof fabric__namespace.Textbox && wasJustModified && !syncTriggeredByPanelRef.current
|
|
15489
|
+
if (existingObj instanceof fabric__namespace.Textbox && wasJustModified && !syncTriggeredByPanelRef.current) {
|
|
15511
15490
|
justModifiedIdsRef.current.delete(element.id);
|
|
15512
15491
|
continue;
|
|
15513
15492
|
}
|
|
@@ -15526,8 +15505,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15526
15505
|
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15527
15506
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15528
15507
|
const comparePosForImg = getObjectSyncComparePosition(existingObj);
|
|
15529
|
-
const
|
|
15530
|
-
const preserveSelectionMemberPosition = !forceStorePositionSync && shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15508
|
+
const preserveSelectionMemberPosition = shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15531
15509
|
const positionChanged = !preserveSelectionMemberPosition && (Math.abs(comparePosForImg.left - storePosForImg.left) > 0.1 || Math.abs(comparePosForImg.top - storePosForImg.top) > 0.1);
|
|
15532
15510
|
if (visibilityChanged && !positionChanged || visibilityUpdateInProgressRef.current) {
|
|
15533
15511
|
const isDynamicField = dynamicFieldIds.includes(element.id);
|
|
@@ -15543,7 +15521,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15543
15521
|
previousVisibilityRef.current.set(element.id, currentVisible);
|
|
15544
15522
|
} else {
|
|
15545
15523
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15546
|
-
updateFabricObject(existingObj, element, wasJustModified
|
|
15524
|
+
updateFabricObject(existingObj, element, wasJustModified || preserveSelectionMemberPosition);
|
|
15547
15525
|
}
|
|
15548
15526
|
const isDynamicField = dynamicFieldIds.includes(element.id);
|
|
15549
15527
|
const canBeEvented = isEditorMode || isPreviewMode && isDynamicField;
|
|
@@ -15576,14 +15554,13 @@ const PageCanvas = react.forwardRef(
|
|
|
15576
15554
|
const storeTop = storePos.top;
|
|
15577
15555
|
const deltaX = Math.abs(fabricLeft - storeLeft);
|
|
15578
15556
|
const deltaY = Math.abs(fabricTop - storeTop);
|
|
15579
|
-
const
|
|
15580
|
-
const preserveSelectionMemberPosition = !forceStorePositionSync && shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15557
|
+
const preserveSelectionMemberPosition = shouldPreserveActiveSelectionMemberPosition(existingObj);
|
|
15581
15558
|
let positionChanged = !preserveSelectionMemberPosition && (deltaX > 0.1 || deltaY > 0.1);
|
|
15582
15559
|
const activeObj = fc.getActiveObject();
|
|
15583
15560
|
const isInActiveSelection = activeObj && (activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects().includes(existingObj) : activeObj === existingObj);
|
|
15584
15561
|
const isInSelectedIds = selectedIdsFromStore.has(element.id);
|
|
15585
15562
|
const isSelected = isInActiveSelection || isInSelectedIds;
|
|
15586
|
-
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)
|
|
15563
|
+
if (positionChanged && isSelected && (wasJustModified || isBeingTransformed)) {
|
|
15587
15564
|
positionChanged = false;
|
|
15588
15565
|
}
|
|
15589
15566
|
const resolvedSizeForCompare = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 0, height: typeof element.height === "number" ? element.height : 0 };
|
|
@@ -15630,9 +15607,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15630
15607
|
});
|
|
15631
15608
|
previousVisibilityRef.current.set(element.id, currentVisible);
|
|
15632
15609
|
} else {
|
|
15633
|
-
const skipPositionBecauseSelection = preserveSelectionMemberPosition ||
|
|
15610
|
+
const skipPositionBecauseSelection = preserveSelectionMemberPosition || isSelected && (deltaX > 0.1 || deltaY > 0.1) && (wasJustModified || isBeingTransformed);
|
|
15634
15611
|
const anyChange = positionChanged || otherPropsChanged || forceApplyFromPanel;
|
|
15635
|
-
if (shouldLogGroupMove() && (
|
|
15612
|
+
if (shouldLogGroupMove() && (preserveSelectionMemberPosition || (deltaX > 0.1 || deltaY > 0.1))) {
|
|
15636
15613
|
console.log("[GRP-MOVE] doSync-member", {
|
|
15637
15614
|
id: element.id,
|
|
15638
15615
|
type: element.type,
|
|
@@ -15640,7 +15617,6 @@ const PageCanvas = react.forwardRef(
|
|
|
15640
15617
|
store: { left: storeLeft, top: storeTop },
|
|
15641
15618
|
delta: { x: deltaX, y: deltaY },
|
|
15642
15619
|
flags: {
|
|
15643
|
-
forceStorePositionSync,
|
|
15644
15620
|
preserveSelectionMemberPosition,
|
|
15645
15621
|
isSelected,
|
|
15646
15622
|
wasJustModified,
|
|
@@ -15655,7 +15631,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15655
15631
|
}
|
|
15656
15632
|
if (!visibilityUpdateInProgressRef.current) {
|
|
15657
15633
|
if (anyChange && !skipPositionBecauseSelection) {
|
|
15658
|
-
updateFabricObject(existingObj, element, wasJustModified
|
|
15634
|
+
updateFabricObject(existingObj, element, wasJustModified);
|
|
15659
15635
|
if (wasJustModified) justModifiedIdsRef.current.delete(element.id);
|
|
15660
15636
|
} else if (skipPositionBecauseSelection && anyChange) {
|
|
15661
15637
|
const savedLeft = existingObj.left;
|
|
@@ -23834,9 +23810,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23834
23810
|
}
|
|
23835
23811
|
return svgString;
|
|
23836
23812
|
}
|
|
23837
|
-
const resolvedPackageVersion = "0.5.
|
|
23813
|
+
const resolvedPackageVersion = "0.5.283";
|
|
23838
23814
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23839
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23815
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.283";
|
|
23840
23816
|
const roundParityValue = (value) => {
|
|
23841
23817
|
if (typeof value !== "number") return value;
|
|
23842
23818
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24650,7 +24626,7 @@ class PixldocsRenderer {
|
|
|
24650
24626
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24651
24627
|
}
|
|
24652
24628
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24653
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24629
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-48Xfutfv.cjs"));
|
|
24654
24630
|
const prepared = preparePagesForExport(
|
|
24655
24631
|
cloned.pages,
|
|
24656
24632
|
canvasWidth,
|
|
@@ -26970,7 +26946,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26970
26946
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26971
26947
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26972
26948
|
try {
|
|
26973
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26949
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-48Xfutfv.cjs"));
|
|
26974
26950
|
try {
|
|
26975
26951
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26976
26952
|
} catch {
|
|
@@ -27367,4 +27343,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27367
27343
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27368
27344
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27369
27345
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27370
|
-
//# sourceMappingURL=index-
|
|
27346
|
+
//# sourceMappingURL=index-A4ICnK--.cjs.map
|