@pixldocs/canvas-renderer 0.5.282 → 0.5.284
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-d5uaicum.js → index-BAQJjsT4.js} +40 -62
- package/dist/index-BAQJjsT4.js.map +1 -0
- package/dist/{index-DeBKmZZc.cjs → index-n9HBI3ow.cjs} +40 -62
- package/dist/index-n9HBI3ow.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CIvJyIlB.cjs → vectorPdfExport-C28yMJ_a.cjs} +4 -4
- package/dist/{vectorPdfExport-CIvJyIlB.cjs.map → vectorPdfExport-C28yMJ_a.cjs.map} +1 -1
- package/dist/{vectorPdfExport-DRVboAKK.js → vectorPdfExport-LTu10COA.js} +4 -4
- package/dist/{vectorPdfExport-DRVboAKK.js.map → vectorPdfExport-LTu10COA.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
|
@@ -10496,7 +10496,7 @@ let ensureCanvaControlRenders = () => {
|
|
|
10496
10496
|
};
|
|
10497
10497
|
const shouldLogGroupMove = () => {
|
|
10498
10498
|
if (typeof window === "undefined") return false;
|
|
10499
|
-
return window.__pixldocsDebugGroupMove
|
|
10499
|
+
return window.__pixldocsDebugGroupMove === true;
|
|
10500
10500
|
};
|
|
10501
10501
|
try {
|
|
10502
10502
|
const InteractiveBase = fabric__namespace.InteractiveFabricObject ?? fabric__namespace.Object;
|
|
@@ -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;
|
|
@@ -15823,7 +15799,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15823
15799
|
const groupSelectionId = activeAfterObjectSync.__pixldocsGroupSelection;
|
|
15824
15800
|
if (groupSelectionId) {
|
|
15825
15801
|
applyLogicalGroupSelectionVisualState(activeAfterObjectSync, groupSelectionId);
|
|
15826
|
-
activeAfterObjectSync.
|
|
15802
|
+
if (!activeAfterObjectSync.getObjects().every((obj) => !(obj instanceof fabric__namespace.Group))) {
|
|
15803
|
+
activeAfterObjectSync.setCoords();
|
|
15804
|
+
}
|
|
15827
15805
|
}
|
|
15828
15806
|
}
|
|
15829
15807
|
isRebuildingRef.current = false;
|
|
@@ -23834,9 +23812,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23834
23812
|
}
|
|
23835
23813
|
return svgString;
|
|
23836
23814
|
}
|
|
23837
|
-
const resolvedPackageVersion = "0.5.
|
|
23815
|
+
const resolvedPackageVersion = "0.5.284";
|
|
23838
23816
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23839
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23817
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.284";
|
|
23840
23818
|
const roundParityValue = (value) => {
|
|
23841
23819
|
if (typeof value !== "number") return value;
|
|
23842
23820
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24650,7 +24628,7 @@ class PixldocsRenderer {
|
|
|
24650
24628
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24651
24629
|
}
|
|
24652
24630
|
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-
|
|
24631
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-C28yMJ_a.cjs"));
|
|
24654
24632
|
const prepared = preparePagesForExport(
|
|
24655
24633
|
cloned.pages,
|
|
24656
24634
|
canvasWidth,
|
|
@@ -26970,7 +26948,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26970
26948
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26971
26949
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26972
26950
|
try {
|
|
26973
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26951
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-C28yMJ_a.cjs"));
|
|
26974
26952
|
try {
|
|
26975
26953
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26976
26954
|
} catch {
|
|
@@ -27367,4 +27345,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27367
27345
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27368
27346
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27369
27347
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27370
|
-
//# sourceMappingURL=index-
|
|
27348
|
+
//# sourceMappingURL=index-n9HBI3ow.cjs.map
|