@pixldocs/canvas-renderer 0.5.432 → 0.5.433

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.
@@ -11976,6 +11976,7 @@ const PageCanvas = react.forwardRef(
11976
11976
  const preserveEditingScopeOnSelectionClearRef = react.useRef(false);
11977
11977
  const preserveActiveSelectionAfterTransformRef = react.useRef(null);
11978
11978
  const recentGroupSelectionRestoreRef = react.useRef(null);
11979
+ const intentionalGroupDeselectRef = react.useRef(null);
11979
11980
  const pendingGroupPromotionRef = react.useRef(null);
11980
11981
  const pendingGroupDrillInRef = react.useRef(null);
11981
11982
  const imageReloadRequestSeqRef = react.useRef(/* @__PURE__ */ new Map());
@@ -13507,6 +13508,14 @@ const PageCanvas = react.forwardRef(
13507
13508
  setDrilledGroupBounds(null);
13508
13509
  drilledGroupIdRef.current = null;
13509
13510
  }
13511
+ const explicitGroupDeselect = intentionalGroupDeselectRef.current;
13512
+ if (explicitGroupDeselect) {
13513
+ preserveActiveSelectionAfterTransformRef.current = null;
13514
+ recentGroupSelectionRestoreRef.current = null;
13515
+ preserveSelectionAfterTransformIdRef.current = null;
13516
+ editLockRef.current = false;
13517
+ syncLockedRef.current = false;
13518
+ }
13510
13519
  const preservedGroupSelection = preserveActiveSelectionAfterTransformRef.current;
13511
13520
  const shouldRestoreGroupSelection = !!((preservedGroupSelection == null ? void 0 : preservedGroupSelection.groupSelectionId) && (!preservedGroupSelection.expiresAt || preservedGroupSelection.expiresAt > Date.now()));
13512
13521
  if (skipSelectionClearOnDiscardRef.current) {
@@ -13515,11 +13524,12 @@ const PageCanvas = react.forwardRef(
13515
13524
  }
13516
13525
  const recentGroupSelectionRestore = recentGroupSelectionRestoreRef.current;
13517
13526
  const shouldReassertRecentGroupSelection = !!((recentGroupSelectionRestore == null ? void 0 : recentGroupSelectionRestore.groupSelectionId) && recentGroupSelectionRestore.expiresAt > Date.now());
13518
- if (editLockRef.current || syncLockedRef.current || didTransformRef.current || preserveSelectionAfterTransformIdRef.current || shouldRestoreGroupSelection || shouldReassertRecentGroupSelection) {
13527
+ if (!explicitGroupDeselect && (editLockRef.current || syncLockedRef.current || didTransformRef.current || preserveSelectionAfterTransformIdRef.current || shouldRestoreGroupSelection || shouldReassertRecentGroupSelection)) {
13519
13528
  if (shouldRestoreGroupSelection) restorePreservedGroupSelectionSoon(preservedGroupSelection);
13520
13529
  else if (shouldReassertRecentGroupSelection) restorePreservedGroupSelectionSoon(recentGroupSelectionRestore);
13521
13530
  return;
13522
13531
  }
13532
+ intentionalGroupDeselectRef.current = null;
13523
13533
  restoreSuppressedGroupBorders();
13524
13534
  editLockRef.current = false;
13525
13535
  syncLockedRef.current = false;
@@ -14166,7 +14176,7 @@ const PageCanvas = react.forwardRef(
14166
14176
  suppressTextEditForClick(effectiveTarget);
14167
14177
  }
14168
14178
  }
14169
- } else if (!target || targetId === "__background__") {
14179
+ } else if (!target || !targetId || targetId === "__background__") {
14170
14180
  const isMultiSelectKey = !!(((_j = opt.e) == null ? void 0 : _j.shiftKey) || ((_k = opt.e) == null ? void 0 : _k.metaKey) || ((_l = opt.e) == null ? void 0 : _l.ctrlKey));
14171
14181
  if (isMultiSelectKey) return;
14172
14182
  if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
@@ -14175,6 +14185,26 @@ const PageCanvas = react.forwardRef(
14175
14185
  const px = pointer.x;
14176
14186
  const py = pointer.y;
14177
14187
  const pick = pickGroupAtPointer(px, py, childrenNow, activeEditingGroupId);
14188
+ if (!pick) {
14189
+ const activeNow = fabricCanvas.getActiveObject();
14190
+ const groupSelectionId = activeNow instanceof fabric__namespace.ActiveSelection ? activeNow.__pixldocsGroupSelection : activeNow == null ? void 0 : activeNow.__pixldocsGroupSelection;
14191
+ if (groupSelectionId) {
14192
+ intentionalGroupDeselectRef.current = groupSelectionId;
14193
+ preserveActiveSelectionAfterTransformRef.current = null;
14194
+ recentGroupSelectionRestoreRef.current = null;
14195
+ preserveSelectionAfterTransformIdRef.current = null;
14196
+ pendingGroupPromotionRef.current = null;
14197
+ pendingGroupDrillInRef.current = null;
14198
+ editLockRef.current = false;
14199
+ syncLockedRef.current = false;
14200
+ fabricCanvas._target = void 0;
14201
+ fabricCanvas._currentTransform = null;
14202
+ opt.target = void 0;
14203
+ fabricCanvas.discardActiveObject();
14204
+ fabricCanvas.requestRenderAll();
14205
+ }
14206
+ return;
14207
+ }
14178
14208
  if (pick) {
14179
14209
  const parent = pick.group;
14180
14210
  if (activeEditingGroupId !== parent.id) {
@@ -25780,9 +25810,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25780
25810
  }
25781
25811
  return svgString;
25782
25812
  }
25783
- const resolvedPackageVersion = "0.5.432";
25813
+ const resolvedPackageVersion = "0.5.433";
25784
25814
  const PACKAGE_VERSION = resolvedPackageVersion;
25785
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.432";
25815
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.433";
25786
25816
  const roundParityValue = (value) => {
25787
25817
  if (typeof value !== "number") return value;
25788
25818
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26596,7 +26626,7 @@ class PixldocsRenderer {
26596
26626
  await this.waitForCanvasScene(container, cloned, i);
26597
26627
  }
26598
26628
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26599
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DgXV6S2u.cjs"));
26629
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BXdCe5ek.cjs"));
26600
26630
  const prepared = preparePagesForExport(
26601
26631
  cloned.pages,
26602
26632
  canvasWidth,
@@ -28916,7 +28946,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28916
28946
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28917
28947
  sanitizeSvgTreeForPdf(svgToDraw);
28918
28948
  try {
28919
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DgXV6S2u.cjs"));
28949
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BXdCe5ek.cjs"));
28920
28950
  try {
28921
28951
  await logTextMeasurementDiagnostic(svgToDraw);
28922
28952
  } catch {
@@ -29313,4 +29343,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29313
29343
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29314
29344
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29315
29345
  exports.warmTemplateFromForm = warmTemplateFromForm;
29316
- //# sourceMappingURL=index-CK9heNqN.cjs.map
29346
+ //# sourceMappingURL=index-Dl-ilqW_.cjs.map