@pixldocs/canvas-renderer 0.5.301 → 0.5.302
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-BUG1_dx7.cjs → index-Basn7lBW.cjs} +87 -8
- package/dist/index-Basn7lBW.cjs.map +1 -0
- package/dist/{index-CUodp3G_.js → index-ZeWTxoUj.js} +87 -8
- package/dist/index-ZeWTxoUj.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-wfJpS8kd.js → vectorPdfExport-Bje676YF.js} +4 -4
- package/dist/{vectorPdfExport-wfJpS8kd.js.map → vectorPdfExport-Bje676YF.js.map} +1 -1
- package/dist/{vectorPdfExport-hHMDys-j.cjs → vectorPdfExport-DXYVw9V2.cjs} +4 -4
- package/dist/{vectorPdfExport-hHMDys-j.cjs.map → vectorPdfExport-DXYVw9V2.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BUG1_dx7.cjs.map +0 -1
- package/dist/index-CUodp3G_.js.map +0 -1
|
@@ -1532,7 +1532,7 @@ const useEditorStore = create((set, get) => ({
|
|
|
1532
1532
|
}
|
|
1533
1533
|
let nextCanvas = updateCurrentPageChildren(state.canvas, () => nextChildren);
|
|
1534
1534
|
nextCanvas.selectedIds = state.canvas.selectedIds.filter(
|
|
1535
|
-
(id) => !
|
|
1535
|
+
(id) => !allDeletedIds.has(id) && !prunedGroupIds.has(id)
|
|
1536
1536
|
);
|
|
1537
1537
|
if (nextCanvas.themeConfig) {
|
|
1538
1538
|
const remainingProps = nextCanvas.themeConfig.properties.filter((p) => !allDeletedIds.has(p.elementId));
|
|
@@ -11287,6 +11287,41 @@ const PageCanvas = forwardRef(
|
|
|
11287
11287
|
const [groupResizeState, setGroupResizeState] = useState(null);
|
|
11288
11288
|
const [groupOverlayLiveBounds, setGroupOverlayLiveBounds] = useState(null);
|
|
11289
11289
|
const setGroupOverlayLiveBoundsRef = useRef(setGroupOverlayLiveBounds);
|
|
11290
|
+
const restoreSuppressedGroupMemberVisuals = useCallback(() => {
|
|
11291
|
+
const list = suppressGroupMemberBordersRef.current;
|
|
11292
|
+
if (!list || list.length === 0) return;
|
|
11293
|
+
for (const member of list) {
|
|
11294
|
+
const origBorders = member.__pixldocsOrigHasBorders;
|
|
11295
|
+
const origControls = member.__pixldocsOrigHasControls;
|
|
11296
|
+
const origLockX = member.__pixldocsOrigLockScalingX;
|
|
11297
|
+
if (origBorders !== void 0) member.hasBorders = origBorders;
|
|
11298
|
+
else member.hasBorders = true;
|
|
11299
|
+
if (origControls !== void 0) member.hasControls = origControls;
|
|
11300
|
+
else member.hasControls = true;
|
|
11301
|
+
if (origLockX !== void 0) {
|
|
11302
|
+
member.lockScalingX = origLockX;
|
|
11303
|
+
member.lockScalingY = member.__pixldocsOrigLockScalingY;
|
|
11304
|
+
}
|
|
11305
|
+
delete member.__pixldocsOrigHasBorders;
|
|
11306
|
+
delete member.__pixldocsOrigHasControls;
|
|
11307
|
+
delete member.__pixldocsOrigLockScalingX;
|
|
11308
|
+
delete member.__pixldocsOrigLockScalingY;
|
|
11309
|
+
}
|
|
11310
|
+
suppressGroupMemberBordersRef.current = [];
|
|
11311
|
+
}, []);
|
|
11312
|
+
const clearCanvasActiveVisuals = useCallback((fc) => {
|
|
11313
|
+
setGroupOverlayLiveBoundsRef.current(null);
|
|
11314
|
+
restoreSuppressedGroupMemberVisuals();
|
|
11315
|
+
try {
|
|
11316
|
+
fc.discardActiveObject();
|
|
11317
|
+
const topContext = fc.contextTop;
|
|
11318
|
+
if (topContext && typeof fc.clearContext === "function") {
|
|
11319
|
+
fc.clearContext(topContext);
|
|
11320
|
+
}
|
|
11321
|
+
fc.requestRenderAll();
|
|
11322
|
+
} catch {
|
|
11323
|
+
}
|
|
11324
|
+
}, [restoreSuppressedGroupMemberVisuals]);
|
|
11290
11325
|
const skipSelectionClearOnDiscardRef = useRef(false);
|
|
11291
11326
|
const skipActiveSelectionBakeOnClearRef = useRef(false);
|
|
11292
11327
|
const preserveEditingScopeOnSelectionClearRef = useRef(false);
|
|
@@ -11375,6 +11410,34 @@ const PageCanvas = forwardRef(
|
|
|
11375
11410
|
useEffect(() => {
|
|
11376
11411
|
selectedIdsRef.current = selectedIds;
|
|
11377
11412
|
}, [selectedIds]);
|
|
11413
|
+
useEffect(() => {
|
|
11414
|
+
const fc = fabricRef.current;
|
|
11415
|
+
if (!fc || !isActive || !currentPage) return;
|
|
11416
|
+
const pageChildren2 = currentPage.children ?? [];
|
|
11417
|
+
const hasMissingSelection = selectedIds.some((id) => !findNodeById(pageChildren2, id));
|
|
11418
|
+
const activeEditingGroupId = fc.__activeEditingGroupId ?? null;
|
|
11419
|
+
const activeEditingGroupMissing = !!activeEditingGroupId && !findNodeById(pageChildren2, activeEditingGroupId);
|
|
11420
|
+
const drilledGroupMissing = !!drilledGroupIdRef.current && !findNodeById(pageChildren2, drilledGroupIdRef.current);
|
|
11421
|
+
const hasGroupEditContext = !!activeEditingGroupId || !!drilledGroupIdRef.current;
|
|
11422
|
+
if (selectedIds.length === 0 && !hasGroupEditContext || hasMissingSelection || activeEditingGroupMissing || drilledGroupMissing) {
|
|
11423
|
+
fc.__activeEditingGroupId = null;
|
|
11424
|
+
drilledGroupIdRef.current = null;
|
|
11425
|
+
setDrilledGroupBounds(null);
|
|
11426
|
+
preserveActiveSelectionAfterTransformRef.current = null;
|
|
11427
|
+
recentGroupSelectionRestoreRef.current = null;
|
|
11428
|
+
clearCanvasActiveVisuals(fc);
|
|
11429
|
+
} else if (hasGroupEditContext) {
|
|
11430
|
+
requestAnimationFrame(() => {
|
|
11431
|
+
var _a2;
|
|
11432
|
+
if (fabricRef.current !== fc) return;
|
|
11433
|
+
try {
|
|
11434
|
+
(_a2 = fc.__updateDrilledGroupOutline) == null ? void 0 : _a2.call(fc);
|
|
11435
|
+
} catch {
|
|
11436
|
+
}
|
|
11437
|
+
fc.requestRenderAll();
|
|
11438
|
+
});
|
|
11439
|
+
}
|
|
11440
|
+
}, [selectedIds, currentPage, isActive, clearCanvasActiveVisuals]);
|
|
11378
11441
|
useEffect(() => {
|
|
11379
11442
|
isActiveRef.current = isActive;
|
|
11380
11443
|
if (isEditorMode && isActive && fabricRef.current) ;
|
|
@@ -15276,7 +15339,7 @@ const PageCanvas = forwardRef(
|
|
|
15276
15339
|
visibilityUpdateInProgressRef.current = false;
|
|
15277
15340
|
}
|
|
15278
15341
|
doSyncRef.current = () => {
|
|
15279
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
15342
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
15280
15343
|
const shouldSkipUpdates2 = syncLockedRef.current || editLockRef.current;
|
|
15281
15344
|
const state = useEditorStore.getState();
|
|
15282
15345
|
const elementsToSync = elements;
|
|
@@ -15301,10 +15364,20 @@ const PageCanvas = forwardRef(
|
|
|
15301
15364
|
const activeBeforeSync = fc.getActiveObject();
|
|
15302
15365
|
const transformSelectionId = preserveSelectionAfterTransformIdRef.current;
|
|
15303
15366
|
const isTransforming2 = !!fc._currentTransform;
|
|
15304
|
-
const
|
|
15367
|
+
const rawActiveSelectionSnapshot = activeBeforeSync instanceof fabric.ActiveSelection ? {
|
|
15305
15368
|
memberIds: activeBeforeSync.getObjects().map((o) => getObjectId(o)).filter((id) => !!id && id !== "__background__"),
|
|
15306
15369
|
groupSelectionId: activeBeforeSync.__pixldocsGroupSelection
|
|
15307
15370
|
} : preserveActiveSelectionAfterTransformRef.current;
|
|
15371
|
+
const activeSelectionSnapshot = rawActiveSelectionSnapshot ? (() => {
|
|
15372
|
+
let memberIds = rawActiveSelectionSnapshot.memberIds.filter((id) => allElementIds.has(id));
|
|
15373
|
+
const groupSelectionId = rawActiveSelectionSnapshot.groupSelectionId;
|
|
15374
|
+
if (groupSelectionId) {
|
|
15375
|
+
const groupNode = findNodeById(pageTree, groupSelectionId);
|
|
15376
|
+
if (!groupNode || !isGroup(groupNode)) return null;
|
|
15377
|
+
memberIds = getAllElementIds(groupNode.children ?? []).filter((id) => allElementIds.has(id));
|
|
15378
|
+
}
|
|
15379
|
+
return memberIds.length > 0 ? { ...rawActiveSelectionSnapshot, memberIds, groupSelectionId } : null;
|
|
15380
|
+
})() : null;
|
|
15308
15381
|
if (syncTriggeredByPanelRef.current && !transformSelectionId && !shouldSkipUpdates2 && !isTransforming2) {
|
|
15309
15382
|
const activeObj = fc.getActiveObject();
|
|
15310
15383
|
const activeObjId = activeObj ? getObjectId(activeObj) : null;
|
|
@@ -16098,6 +16171,12 @@ const PageCanvas = forwardRef(
|
|
|
16098
16171
|
}
|
|
16099
16172
|
}
|
|
16100
16173
|
}
|
|
16174
|
+
if (fc.__activeEditingGroupId) {
|
|
16175
|
+
try {
|
|
16176
|
+
(_k = fc.__updateDrilledGroupOutline) == null ? void 0 : _k.call(fc);
|
|
16177
|
+
} catch {
|
|
16178
|
+
}
|
|
16179
|
+
}
|
|
16101
16180
|
const recentGroupRestore = recentGroupSelectionRestoreRef.current;
|
|
16102
16181
|
if ((recentGroupRestore == null ? void 0 : recentGroupRestore.groupSelectionId) && recentGroupRestore.expiresAt > Date.now()) {
|
|
16103
16182
|
restoreGroupSelectionSnapshot(recentGroupRestore);
|
|
@@ -24025,9 +24104,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24025
24104
|
}
|
|
24026
24105
|
return svgString;
|
|
24027
24106
|
}
|
|
24028
|
-
const resolvedPackageVersion = "0.5.
|
|
24107
|
+
const resolvedPackageVersion = "0.5.302";
|
|
24029
24108
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24030
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24109
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.302";
|
|
24031
24110
|
const roundParityValue = (value) => {
|
|
24032
24111
|
if (typeof value !== "number") return value;
|
|
24033
24112
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24841,7 +24920,7 @@ class PixldocsRenderer {
|
|
|
24841
24920
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24842
24921
|
}
|
|
24843
24922
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24844
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24923
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bje676YF.js");
|
|
24845
24924
|
const prepared = preparePagesForExport(
|
|
24846
24925
|
cloned.pages,
|
|
24847
24926
|
canvasWidth,
|
|
@@ -27161,7 +27240,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27161
27240
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27162
27241
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27163
27242
|
try {
|
|
27164
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27243
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bje676YF.js");
|
|
27165
27244
|
try {
|
|
27166
27245
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27167
27246
|
} catch {
|
|
@@ -27561,4 +27640,4 @@ export {
|
|
|
27561
27640
|
buildTeaserBlurFlatKeys as y,
|
|
27562
27641
|
collectFontDescriptorsFromConfig as z
|
|
27563
27642
|
};
|
|
27564
|
-
//# sourceMappingURL=index-
|
|
27643
|
+
//# sourceMappingURL=index-ZeWTxoUj.js.map
|