@pixldocs/canvas-renderer 0.5.255 → 0.5.256

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.
@@ -7160,10 +7160,20 @@ function applyTextPathControls(textbox) {
7160
7160
  ctx.stroke();
7161
7161
  ctx.restore();
7162
7162
  };
7163
- obj.controls.crN = new fabric__namespace.Control({ x: 0, y: -0.5, cursorStyle: "ns-resize", actionName: "textPath", actionHandler: dragRadius("N"), positionHandler: positionAtRing("N"), render: renderRingHandle });
7164
- obj.controls.crE = new fabric__namespace.Control({ x: 0.5, y: 0, cursorStyle: "ew-resize", actionName: "textPath", actionHandler: dragRadius("E"), positionHandler: positionAtRing("E"), render: renderRingHandle });
7165
- obj.controls.crS = new fabric__namespace.Control({ x: 0, y: 0.5, cursorStyle: "ns-resize", actionName: "textPath", actionHandler: dragRadius("S"), positionHandler: positionAtRing("S"), render: renderRingHandle });
7166
- obj.controls.crW = new fabric__namespace.Control({ x: -0.5, y: 0, cursorStyle: "ew-resize", actionName: "textPath", actionHandler: dragRadius("W"), positionHandler: positionAtRing("W"), render: renderRingHandle });
7163
+ const radialCursorHandler = (dir) => (_e2, _control, fabricObject) => {
7164
+ var _a3;
7165
+ const baseAngle = dir === "N" || dir === "S" ? 90 : 0;
7166
+ const objAngle = ((_a3 = fabricObject == null ? void 0 : fabricObject.getTotalAngle) == null ? void 0 : _a3.call(fabricObject)) ?? (fabricObject == null ? void 0 : fabricObject.angle) ?? 0;
7167
+ let a = ((baseAngle + objAngle) % 180 + 180) % 180;
7168
+ if (a < 22.5 || a >= 157.5) return "ew-resize";
7169
+ if (a < 67.5) return "nesw-resize";
7170
+ if (a < 112.5) return "ns-resize";
7171
+ return "nwse-resize";
7172
+ };
7173
+ obj.controls.crN = new fabric__namespace.Control({ x: 0, y: -0.5, cursorStyleHandler: radialCursorHandler("N"), actionName: "textPath", actionHandler: dragRadius("N"), positionHandler: positionAtRing("N"), render: renderRingHandle });
7174
+ obj.controls.crE = new fabric__namespace.Control({ x: 0.5, y: 0, cursorStyleHandler: radialCursorHandler("E"), actionName: "textPath", actionHandler: dragRadius("E"), positionHandler: positionAtRing("E"), render: renderRingHandle });
7175
+ obj.controls.crS = new fabric__namespace.Control({ x: 0, y: 0.5, cursorStyleHandler: radialCursorHandler("S"), actionName: "textPath", actionHandler: dragRadius("S"), positionHandler: positionAtRing("S"), render: renderRingHandle });
7176
+ obj.controls.crW = new fabric__namespace.Control({ x: -0.5, y: 0, cursorStyleHandler: radialCursorHandler("W"), actionName: "textPath", actionHandler: dragRadius("W"), positionHandler: positionAtRing("W"), render: renderRingHandle });
7167
7177
  (_g = obj.setControlVisible) == null ? void 0 : _g.call(obj, "crN", true);
7168
7178
  (_h = obj.setControlVisible) == null ? void 0 : _h.call(obj, "crE", true);
7169
7179
  (_i = obj.setControlVisible) == null ? void 0 : _i.call(obj, "crS", true);
@@ -23529,9 +23539,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23529
23539
  }
23530
23540
  return svgString;
23531
23541
  }
23532
- const resolvedPackageVersion = "0.5.255";
23542
+ const resolvedPackageVersion = "0.5.256";
23533
23543
  const PACKAGE_VERSION = resolvedPackageVersion;
23534
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.255";
23544
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.256";
23535
23545
  const roundParityValue = (value) => {
23536
23546
  if (typeof value !== "number") return value;
23537
23547
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24345,7 +24355,7 @@ class PixldocsRenderer {
24345
24355
  await this.waitForCanvasScene(container, cloned, i);
24346
24356
  }
24347
24357
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24348
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BK2ntULQ.cjs"));
24358
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BNa-hQ-e.cjs"));
24349
24359
  const prepared = preparePagesForExport(
24350
24360
  cloned.pages,
24351
24361
  canvasWidth,
@@ -26665,7 +26675,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26665
26675
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26666
26676
  sanitizeSvgTreeForPdf(svgToDraw);
26667
26677
  try {
26668
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BK2ntULQ.cjs"));
26678
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BNa-hQ-e.cjs"));
26669
26679
  try {
26670
26680
  await logTextMeasurementDiagnostic(svgToDraw);
26671
26681
  } catch {
@@ -27062,4 +27072,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27062
27072
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27063
27073
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27064
27074
  exports.warmTemplateFromForm = warmTemplateFromForm;
27065
- //# sourceMappingURL=index-5whx8gZE.cjs.map
27075
+ //# sourceMappingURL=index-C1nsxh7P.cjs.map