@pixldocs/canvas-renderer 0.5.254 → 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);
@@ -13324,6 +13334,7 @@ const PageCanvas = react.forwardRef(
13324
13334
  fabricCanvas.on("selection:cleared", () => {
13325
13335
  });
13326
13336
  fabricCanvas.on("object:scaling", (e) => {
13337
+ var _a2;
13327
13338
  if (!isActiveRef.current) return;
13328
13339
  const t = e.target;
13329
13340
  if (t) lastResizeScaleTargetRef.current = t;
@@ -13605,8 +13616,15 @@ const PageCanvas = react.forwardRef(
13605
13616
  } catch {
13606
13617
  }
13607
13618
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
13619
+ if (drilledGroupIdRef.current) {
13620
+ try {
13621
+ (_a2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _a2.call(fabricCanvas);
13622
+ } catch {
13623
+ }
13624
+ }
13608
13625
  });
13609
13626
  fabricCanvas.on("object:resizing", (e) => {
13627
+ var _a2;
13610
13628
  if (!isActiveRef.current) return;
13611
13629
  const t = e.target;
13612
13630
  if (t) lastResizeScaleTargetRef.current = t;
@@ -13683,6 +13701,12 @@ const PageCanvas = react.forwardRef(
13683
13701
  } catch {
13684
13702
  }
13685
13703
  setGuides(gridGuidesForTextResize.length ? [...scaleGuides, ...gridGuidesForTextResize] : scaleGuides);
13704
+ if (drilledGroupIdRef.current) {
13705
+ try {
13706
+ (_a2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _a2.call(fabricCanvas);
13707
+ } catch {
13708
+ }
13709
+ }
13686
13710
  });
13687
13711
  fabricCanvas.on("object:rotating", (e) => {
13688
13712
  markSimpleTransform(e);
@@ -23515,9 +23539,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23515
23539
  }
23516
23540
  return svgString;
23517
23541
  }
23518
- const resolvedPackageVersion = "0.5.254";
23542
+ const resolvedPackageVersion = "0.5.256";
23519
23543
  const PACKAGE_VERSION = resolvedPackageVersion;
23520
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.254";
23544
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.256";
23521
23545
  const roundParityValue = (value) => {
23522
23546
  if (typeof value !== "number") return value;
23523
23547
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24331,7 +24355,7 @@ class PixldocsRenderer {
24331
24355
  await this.waitForCanvasScene(container, cloned, i);
24332
24356
  }
24333
24357
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24334
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BpVM86xb.cjs"));
24358
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BNa-hQ-e.cjs"));
24335
24359
  const prepared = preparePagesForExport(
24336
24360
  cloned.pages,
24337
24361
  canvasWidth,
@@ -26651,7 +26675,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26651
26675
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26652
26676
  sanitizeSvgTreeForPdf(svgToDraw);
26653
26677
  try {
26654
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BpVM86xb.cjs"));
26678
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BNa-hQ-e.cjs"));
26655
26679
  try {
26656
26680
  await logTextMeasurementDiagnostic(svgToDraw);
26657
26681
  } catch {
@@ -27048,4 +27072,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27048
27072
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27049
27073
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27050
27074
  exports.warmTemplateFromForm = warmTemplateFromForm;
27051
- //# sourceMappingURL=index-9Lw_NdWM.cjs.map
27075
+ //# sourceMappingURL=index-C1nsxh7P.cjs.map