@pixldocs/canvas-renderer 0.5.426 → 0.5.427

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.
@@ -11255,6 +11255,48 @@ try {
11255
11255
  ControlProto.__pixldocsCanvaCursorFallback = true;
11256
11256
  ControlProto.__pixldocsCanvaCursorFallbackVersion = 2;
11257
11257
  }
11258
+ if (ControlProto && ControlProto.__pixldocsCanvaFullEdgeActivateVersion !== 1) {
11259
+ const originalShouldActivate = ControlProto.__pixldocsOriginalShouldActivate ?? ControlProto.shouldActivate;
11260
+ ControlProto.__pixldocsOriginalShouldActivate = originalShouldActivate;
11261
+ const edgeSegments = {
11262
+ ml: ["tl", "bl"],
11263
+ mr: ["tr", "br"],
11264
+ mt: ["tl", "tr"],
11265
+ mb: ["bl", "br"]
11266
+ };
11267
+ const distanceToSegment = (p, a, b) => {
11268
+ const vx = b.x - a.x;
11269
+ const vy = b.y - a.y;
11270
+ const lenSq = vx * vx + vy * vy;
11271
+ if (lenSq <= 1e-4) return { distance: Number.POSITIVE_INFINITY, t: 0 };
11272
+ const rawT = ((p.x - a.x) * vx + (p.y - a.y) * vy) / lenSq;
11273
+ const t = Math.max(0, Math.min(1, rawT));
11274
+ const x = a.x + vx * t;
11275
+ const y = a.y + vy * t;
11276
+ const dx = p.x - x;
11277
+ const dy = p.y - y;
11278
+ return { distance: Math.hypot(dx, dy), t: rawT };
11279
+ };
11280
+ ControlProto.shouldActivate = function(controlKey, fabricObject, pointer, corners) {
11281
+ var _a2, _b2, _c2;
11282
+ if (typeof originalShouldActivate === "function" && originalShouldActivate.call(this, controlKey, fabricObject, pointer, corners)) {
11283
+ return true;
11284
+ }
11285
+ const segment = edgeSegments[controlKey];
11286
+ if (!segment || !(fabricObject == null ? void 0 : fabricObject.canvas) || ((_b2 = (_a2 = fabricObject.canvas).getActiveObject) == null ? void 0 : _b2.call(_a2)) !== fabricObject) return false;
11287
+ if (!((_c2 = fabricObject.isControlVisible) == null ? void 0 : _c2.call(fabricObject, controlKey)) || shouldCollapseHandles(fabricObject)) return false;
11288
+ const coords = fabricObject.oCoords;
11289
+ const a = coords == null ? void 0 : coords[segment[0]];
11290
+ const b = coords == null ? void 0 : coords[segment[1]];
11291
+ if (!a || !b || !pointer) return false;
11292
+ const len = Math.hypot((b.x ?? 0) - (a.x ?? 0), (b.y ?? 0) - (a.y ?? 0));
11293
+ if (len <= 1) return false;
11294
+ const alongPad = Math.min(24, len * 0.35);
11295
+ const { distance, t } = distanceToSegment(pointer, a, b);
11296
+ return t >= alongPad / len && t <= 1 - alongPad / len && distance <= EDGE_HIT_PERP / 2 + 3;
11297
+ };
11298
+ ControlProto.__pixldocsCanvaFullEdgeActivateVersion = 1;
11299
+ }
11258
11300
  ensureCanvaControlRenders = (obj) => {
11259
11301
  try {
11260
11302
  if (obj && obj.controls) installPillRenders(obj.controls);
@@ -25640,9 +25682,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25640
25682
  }
25641
25683
  return svgString;
25642
25684
  }
25643
- const resolvedPackageVersion = "0.5.426";
25685
+ const resolvedPackageVersion = "0.5.427";
25644
25686
  const PACKAGE_VERSION = resolvedPackageVersion;
25645
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.426";
25687
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.427";
25646
25688
  const roundParityValue = (value) => {
25647
25689
  if (typeof value !== "number") return value;
25648
25690
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26456,7 +26498,7 @@ class PixldocsRenderer {
26456
26498
  await this.waitForCanvasScene(container, cloned, i);
26457
26499
  }
26458
26500
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26459
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bu0JJXZS.js");
26501
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bc2upktw.js");
26460
26502
  const prepared = preparePagesForExport(
26461
26503
  cloned.pages,
26462
26504
  canvasWidth,
@@ -28776,7 +28818,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28776
28818
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28777
28819
  sanitizeSvgTreeForPdf(svgToDraw);
28778
28820
  try {
28779
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bu0JJXZS.js");
28821
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bc2upktw.js");
28780
28822
  try {
28781
28823
  await logTextMeasurementDiagnostic(svgToDraw);
28782
28824
  } catch {
@@ -29176,4 +29218,4 @@ export {
29176
29218
  buildTeaserBlurFlatKeys as y,
29177
29219
  collectFontDescriptorsFromConfig as z
29178
29220
  };
29179
- //# sourceMappingURL=index--hMXhxT-.js.map
29221
+ //# sourceMappingURL=index-BMuhbMdO.js.map