@pixldocs/canvas-renderer 0.5.285 → 0.5.287
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-CqoBp7NY.cjs → index-B8mo_6bC.cjs} +39 -32
- package/dist/index-B8mo_6bC.cjs.map +1 -0
- package/dist/{index-3k0uE4wB.js → index-SOarDnbw.js} +39 -32
- package/dist/index-SOarDnbw.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-B0C--0iz.js → vectorPdfExport-Cdzd1M4c.js} +4 -4
- package/dist/{vectorPdfExport-B0C--0iz.js.map → vectorPdfExport-Cdzd1M4c.js.map} +1 -1
- package/dist/{vectorPdfExport-BLNaGpPE.cjs → vectorPdfExport-PuXmC5oW.cjs} +4 -4
- package/dist/{vectorPdfExport-BLNaGpPE.cjs.map → vectorPdfExport-PuXmC5oW.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-3k0uE4wB.js.map +0 -1
- package/dist/index-CqoBp7NY.cjs.map +0 -1
|
@@ -11248,6 +11248,26 @@ const PageCanvas = react.forwardRef(
|
|
|
11248
11248
|
hoveredGroupId
|
|
11249
11249
|
} = useEditorStore();
|
|
11250
11250
|
const storeSelectedIds = canvas.selectedIds ?? [];
|
|
11251
|
+
const restoreGroupSelectionSnapshot = react.useCallback((snapshot) => {
|
|
11252
|
+
const fc = fabricRef.current;
|
|
11253
|
+
const groupId = snapshot == null ? void 0 : snapshot.groupSelectionId;
|
|
11254
|
+
if (!fc || !groupId || snapshot.memberIds.length < 2 || editingTextIdRef.current) return;
|
|
11255
|
+
const members = snapshot.memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
11256
|
+
if (members.length < 2) return;
|
|
11257
|
+
isSyncingSelectionToFabricRef.current = true;
|
|
11258
|
+
try {
|
|
11259
|
+
const active = fc.getActiveObject();
|
|
11260
|
+
const selection = active instanceof fabric__namespace.ActiveSelection && members.every((member) => active.getObjects().includes(member)) ? active : new fabric__namespace.ActiveSelection(members, { canvas: fc });
|
|
11261
|
+
applyLogicalGroupSelectionVisualState(selection, groupId);
|
|
11262
|
+
fc.setActiveObject(selection);
|
|
11263
|
+
selection.setCoords();
|
|
11264
|
+
fc.requestRenderAll();
|
|
11265
|
+
} finally {
|
|
11266
|
+
requestAnimationFrame(() => {
|
|
11267
|
+
isSyncingSelectionToFabricRef.current = false;
|
|
11268
|
+
});
|
|
11269
|
+
}
|
|
11270
|
+
}, [applyLogicalGroupSelectionVisualState]);
|
|
11251
11271
|
const currentPage = react.useMemo(() => (canvas.pages ?? []).find((p) => p.id === pageId), [canvas.pages, pageId]);
|
|
11252
11272
|
react.useMemo(() => {
|
|
11253
11273
|
const ids = storeSelectedIds ?? [];
|
|
@@ -12702,32 +12722,11 @@ const PageCanvas = react.forwardRef(
|
|
|
12702
12722
|
const restorePreservedGroupSelectionSoon = (snapshot = preserveActiveSelectionAfterTransformRef.current) => {
|
|
12703
12723
|
if (!(snapshot == null ? void 0 : snapshot.groupSelectionId) || snapshot.memberIds.length < 2) return;
|
|
12704
12724
|
const groupId = snapshot.groupSelectionId;
|
|
12705
|
-
const memberIds = [...snapshot.memberIds];
|
|
12706
12725
|
selectElements([groupId], false, false);
|
|
12707
12726
|
requestAnimationFrame(() => {
|
|
12708
12727
|
setTimeout(() => {
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
const active = fc.getActiveObject();
|
|
12712
|
-
if (active instanceof fabric__namespace.ActiveSelection && active.__pixldocsGroupSelection === groupId) {
|
|
12713
|
-
restoreGroupSelectionVisualState(active, groupId);
|
|
12714
|
-
fc.requestRenderAll();
|
|
12715
|
-
return;
|
|
12716
|
-
}
|
|
12717
|
-
const members = memberIds.map((id) => fc.getObjects().find((o) => getObjectId(o) === id)).filter((o) => !!o);
|
|
12718
|
-
if (members.length < 2) return;
|
|
12719
|
-
isSyncingSelectionToFabricRef.current = true;
|
|
12720
|
-
try {
|
|
12721
|
-
const selection = new fabric__namespace.ActiveSelection(members, { canvas: fc });
|
|
12722
|
-
restoreGroupSelectionVisualState(selection, groupId);
|
|
12723
|
-
fc.setActiveObject(selection);
|
|
12724
|
-
selection.setCoords();
|
|
12725
|
-
fc.requestRenderAll();
|
|
12726
|
-
} finally {
|
|
12727
|
-
requestAnimationFrame(() => {
|
|
12728
|
-
isSyncingSelectionToFabricRef.current = false;
|
|
12729
|
-
});
|
|
12730
|
-
}
|
|
12728
|
+
if (!isActiveRef.current) return;
|
|
12729
|
+
restoreGroupSelectionSnapshot(snapshot);
|
|
12731
12730
|
}, 0);
|
|
12732
12731
|
});
|
|
12733
12732
|
};
|
|
@@ -13197,7 +13196,8 @@ const PageCanvas = react.forwardRef(
|
|
|
13197
13196
|
if (memberIds.length > 1) {
|
|
13198
13197
|
restorePreservedGroupSelectionSoon({
|
|
13199
13198
|
memberIds,
|
|
13200
|
-
groupSelectionId: pendingDrillIn.groupId
|
|
13199
|
+
groupSelectionId: pendingDrillIn.groupId,
|
|
13200
|
+
expiresAt: Date.now() + 1200
|
|
13201
13201
|
});
|
|
13202
13202
|
} else {
|
|
13203
13203
|
selectElements([pendingDrillIn.groupId], false, false);
|
|
@@ -14614,10 +14614,13 @@ const PageCanvas = react.forwardRef(
|
|
|
14614
14614
|
}
|
|
14615
14615
|
skipSelectionClearOnDiscardRef.current = false;
|
|
14616
14616
|
if (wasGroupSel) {
|
|
14617
|
-
|
|
14617
|
+
const resizeRestoreSnapshot = {
|
|
14618
14618
|
memberIds: membersToReselect.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__"),
|
|
14619
|
-
groupSelectionId: wasGroupSel
|
|
14620
|
-
|
|
14619
|
+
groupSelectionId: wasGroupSel,
|
|
14620
|
+
expiresAt: Date.now() + 1200
|
|
14621
|
+
};
|
|
14622
|
+
recentGroupSelectionRestoreRef.current = resizeRestoreSnapshot;
|
|
14623
|
+
restorePreservedGroupSelectionSoon(resizeRestoreSnapshot);
|
|
14621
14624
|
}
|
|
14622
14625
|
fabricCanvas.requestRenderAll();
|
|
14623
14626
|
}
|
|
@@ -15707,6 +15710,10 @@ const PageCanvas = react.forwardRef(
|
|
|
15707
15710
|
}
|
|
15708
15711
|
}
|
|
15709
15712
|
}
|
|
15713
|
+
const recentGroupRestore = recentGroupSelectionRestoreRef.current;
|
|
15714
|
+
if ((recentGroupRestore == null ? void 0 : recentGroupRestore.groupSelectionId) && recentGroupRestore.expiresAt > Date.now()) {
|
|
15715
|
+
restoreGroupSelectionSnapshot(recentGroupRestore);
|
|
15716
|
+
}
|
|
15710
15717
|
preserveSelectionAfterTransformIdRef.current = null;
|
|
15711
15718
|
preserveActiveSelectionAfterTransformRef.current = null;
|
|
15712
15719
|
syncTriggeredByPanelRef.current = false;
|
|
@@ -23630,9 +23637,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23630
23637
|
}
|
|
23631
23638
|
return svgString;
|
|
23632
23639
|
}
|
|
23633
|
-
const resolvedPackageVersion = "0.5.
|
|
23640
|
+
const resolvedPackageVersion = "0.5.287";
|
|
23634
23641
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23635
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23642
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.287";
|
|
23636
23643
|
const roundParityValue = (value) => {
|
|
23637
23644
|
if (typeof value !== "number") return value;
|
|
23638
23645
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24446,7 +24453,7 @@ class PixldocsRenderer {
|
|
|
24446
24453
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24447
24454
|
}
|
|
24448
24455
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24449
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24456
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-PuXmC5oW.cjs"));
|
|
24450
24457
|
const prepared = preparePagesForExport(
|
|
24451
24458
|
cloned.pages,
|
|
24452
24459
|
canvasWidth,
|
|
@@ -26766,7 +26773,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26766
26773
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26767
26774
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26768
26775
|
try {
|
|
26769
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26776
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-PuXmC5oW.cjs"));
|
|
26770
26777
|
try {
|
|
26771
26778
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26772
26779
|
} catch {
|
|
@@ -27163,4 +27170,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27163
27170
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27164
27171
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27165
27172
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27166
|
-
//# sourceMappingURL=index-
|
|
27173
|
+
//# sourceMappingURL=index-B8mo_6bC.cjs.map
|