@pixldocs/canvas-renderer 0.5.433 → 0.5.435

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.
@@ -14036,7 +14036,7 @@ const PageCanvas = forwardRef(
14036
14036
  };
14037
14037
  fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
14038
14038
  fabricCanvas.on("mouse:down:before", (opt) => {
14039
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
14039
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
14040
14040
  const activeBeforeMouseDown = fabricCanvas.getActiveObject();
14041
14041
  if (editLockRef.current) {
14042
14042
  const active = fabricCanvas.getActiveObject();
@@ -14162,6 +14162,17 @@ const PageCanvas = forwardRef(
14162
14162
  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));
14163
14163
  if (isMultiSelectKey) return;
14164
14164
  if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
14165
+ try {
14166
+ const activeForCornerCheck = fabricCanvas.getActiveObject();
14167
+ if (activeForCornerCheck) {
14168
+ const ptrForCorner = fabricCanvas.getPointer(opt.e);
14169
+ const cornerHit = ((_n = activeForCornerCheck.findControl) == null ? void 0 : _n.call(activeForCornerCheck, ptrForCorner)) || ((_o = activeForCornerCheck._findTargetCorner) == null ? void 0 : _o.call(activeForCornerCheck, ptrForCorner));
14170
+ if (cornerHit) {
14171
+ return;
14172
+ }
14173
+ }
14174
+ } catch {
14175
+ }
14165
14176
  try {
14166
14177
  const pointer = fabricCanvas.getPointer(opt.e);
14167
14178
  const px = pointer.x;
@@ -14351,6 +14362,31 @@ const PageCanvas = forwardRef(
14351
14362
  if (!o) return;
14352
14363
  o.__lockScaleDuringCrop = false;
14353
14364
  });
14365
+ fabricCanvas.on("mouse:down", () => {
14366
+ const pending = pendingGroupPromotionRef.current;
14367
+ if (!pending) return;
14368
+ const activeNow = fabricCanvas.getActiveObject();
14369
+ if (activeNow === pending.selection) return;
14370
+ isSyncingSelectionToFabricRef.current = true;
14371
+ try {
14372
+ fabricCanvas.setActiveObject(pending.selection);
14373
+ pending.selection.setCoords();
14374
+ fabricCanvas._target = pending.selection;
14375
+ if (pending.selection instanceof fabric.ActiveSelection) {
14376
+ restoreGroupSelectionVisualState(pending.selection, pending.groupId);
14377
+ pending.selection.hasBorders = true;
14378
+ applyWarpAwareSelectionBorders(pending.selection);
14379
+ } else {
14380
+ pending.selection.__pixldocsGroupSelection = pending.groupId;
14381
+ }
14382
+ fabricCanvas.requestRenderAll();
14383
+ } catch {
14384
+ } finally {
14385
+ requestAnimationFrame(() => {
14386
+ isSyncingSelectionToFabricRef.current = false;
14387
+ });
14388
+ }
14389
+ });
14354
14390
  fabricCanvas.on("mouse:up", (e) => {
14355
14391
  var _a2, _b2, _c2;
14356
14392
  clearTransforming();
@@ -25792,9 +25828,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25792
25828
  }
25793
25829
  return svgString;
25794
25830
  }
25795
- const resolvedPackageVersion = "0.5.433";
25831
+ const resolvedPackageVersion = "0.5.435";
25796
25832
  const PACKAGE_VERSION = resolvedPackageVersion;
25797
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.433";
25833
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.435";
25798
25834
  const roundParityValue = (value) => {
25799
25835
  if (typeof value !== "number") return value;
25800
25836
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26608,7 +26644,7 @@ class PixldocsRenderer {
26608
26644
  await this.waitForCanvasScene(container, cloned, i);
26609
26645
  }
26610
26646
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26611
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-6d2YhE8F.js");
26647
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DaUbsdKS.js");
26612
26648
  const prepared = preparePagesForExport(
26613
26649
  cloned.pages,
26614
26650
  canvasWidth,
@@ -28928,7 +28964,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28928
28964
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28929
28965
  sanitizeSvgTreeForPdf(svgToDraw);
28930
28966
  try {
28931
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-6d2YhE8F.js");
28967
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DaUbsdKS.js");
28932
28968
  try {
28933
28969
  await logTextMeasurementDiagnostic(svgToDraw);
28934
28970
  } catch {
@@ -29328,4 +29364,4 @@ export {
29328
29364
  buildTeaserBlurFlatKeys as y,
29329
29365
  collectFontDescriptorsFromConfig as z
29330
29366
  };
29331
- //# sourceMappingURL=index-XUxKXZ1L.js.map
29367
+ //# sourceMappingURL=index-BtkdFbJD.js.map