@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.
@@ -11273,6 +11273,48 @@ try {
11273
11273
  ControlProto.__pixldocsCanvaCursorFallback = true;
11274
11274
  ControlProto.__pixldocsCanvaCursorFallbackVersion = 2;
11275
11275
  }
11276
+ if (ControlProto && ControlProto.__pixldocsCanvaFullEdgeActivateVersion !== 1) {
11277
+ const originalShouldActivate = ControlProto.__pixldocsOriginalShouldActivate ?? ControlProto.shouldActivate;
11278
+ ControlProto.__pixldocsOriginalShouldActivate = originalShouldActivate;
11279
+ const edgeSegments = {
11280
+ ml: ["tl", "bl"],
11281
+ mr: ["tr", "br"],
11282
+ mt: ["tl", "tr"],
11283
+ mb: ["bl", "br"]
11284
+ };
11285
+ const distanceToSegment = (p, a, b) => {
11286
+ const vx = b.x - a.x;
11287
+ const vy = b.y - a.y;
11288
+ const lenSq = vx * vx + vy * vy;
11289
+ if (lenSq <= 1e-4) return { distance: Number.POSITIVE_INFINITY, t: 0 };
11290
+ const rawT = ((p.x - a.x) * vx + (p.y - a.y) * vy) / lenSq;
11291
+ const t = Math.max(0, Math.min(1, rawT));
11292
+ const x = a.x + vx * t;
11293
+ const y = a.y + vy * t;
11294
+ const dx = p.x - x;
11295
+ const dy = p.y - y;
11296
+ return { distance: Math.hypot(dx, dy), t: rawT };
11297
+ };
11298
+ ControlProto.shouldActivate = function(controlKey, fabricObject, pointer, corners) {
11299
+ var _a2, _b2, _c2;
11300
+ if (typeof originalShouldActivate === "function" && originalShouldActivate.call(this, controlKey, fabricObject, pointer, corners)) {
11301
+ return true;
11302
+ }
11303
+ const segment = edgeSegments[controlKey];
11304
+ if (!segment || !(fabricObject == null ? void 0 : fabricObject.canvas) || ((_b2 = (_a2 = fabricObject.canvas).getActiveObject) == null ? void 0 : _b2.call(_a2)) !== fabricObject) return false;
11305
+ if (!((_c2 = fabricObject.isControlVisible) == null ? void 0 : _c2.call(fabricObject, controlKey)) || shouldCollapseHandles(fabricObject)) return false;
11306
+ const coords = fabricObject.oCoords;
11307
+ const a = coords == null ? void 0 : coords[segment[0]];
11308
+ const b = coords == null ? void 0 : coords[segment[1]];
11309
+ if (!a || !b || !pointer) return false;
11310
+ const len = Math.hypot((b.x ?? 0) - (a.x ?? 0), (b.y ?? 0) - (a.y ?? 0));
11311
+ if (len <= 1) return false;
11312
+ const alongPad = Math.min(24, len * 0.35);
11313
+ const { distance, t } = distanceToSegment(pointer, a, b);
11314
+ return t >= alongPad / len && t <= 1 - alongPad / len && distance <= EDGE_HIT_PERP / 2 + 3;
11315
+ };
11316
+ ControlProto.__pixldocsCanvaFullEdgeActivateVersion = 1;
11317
+ }
11276
11318
  ensureCanvaControlRenders = (obj) => {
11277
11319
  try {
11278
11320
  if (obj && obj.controls) installPillRenders(obj.controls);
@@ -25658,9 +25700,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25658
25700
  }
25659
25701
  return svgString;
25660
25702
  }
25661
- const resolvedPackageVersion = "0.5.426";
25703
+ const resolvedPackageVersion = "0.5.427";
25662
25704
  const PACKAGE_VERSION = resolvedPackageVersion;
25663
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.426";
25705
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.427";
25664
25706
  const roundParityValue = (value) => {
25665
25707
  if (typeof value !== "number") return value;
25666
25708
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26474,7 +26516,7 @@ class PixldocsRenderer {
26474
26516
  await this.waitForCanvasScene(container, cloned, i);
26475
26517
  }
26476
26518
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26477
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-onpGluLh.cjs"));
26519
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BUi4rX_J.cjs"));
26478
26520
  const prepared = preparePagesForExport(
26479
26521
  cloned.pages,
26480
26522
  canvasWidth,
@@ -28794,7 +28836,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28794
28836
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28795
28837
  sanitizeSvgTreeForPdf(svgToDraw);
28796
28838
  try {
28797
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-onpGluLh.cjs"));
28839
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BUi4rX_J.cjs"));
28798
28840
  try {
28799
28841
  await logTextMeasurementDiagnostic(svgToDraw);
28800
28842
  } catch {
@@ -29191,4 +29233,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29191
29233
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29192
29234
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29193
29235
  exports.warmTemplateFromForm = warmTemplateFromForm;
29194
- //# sourceMappingURL=index-ScUMI-6A.cjs.map
29236
+ //# sourceMappingURL=index-DKaw5wif.cjs.map