@pixldocs/canvas-renderer 0.5.251 → 0.5.252

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.
@@ -11848,11 +11848,10 @@ const PageCanvas = forwardRef(
11848
11848
  const selectAllActiveTextbox = (textbox) => {
11849
11849
  var _a2;
11850
11850
  try {
11851
- textbox.selectAll();
11852
- } catch {
11853
11851
  const len = ((_a2 = textbox.text) == null ? void 0 : _a2.length) ?? 0;
11854
- textbox.selectionStart = 0;
11852
+ textbox.selectionStart = len;
11855
11853
  textbox.selectionEnd = len;
11854
+ } catch {
11856
11855
  }
11857
11856
  fabricCanvas.requestRenderAll();
11858
11857
  };
@@ -13215,6 +13214,21 @@ const PageCanvas = forwardRef(
13215
13214
  onDynamicFieldClick(clickedId);
13216
13215
  }
13217
13216
  }
13217
+ try {
13218
+ if (allowEditing && !didTransformRef.current) {
13219
+ const active = fabricCanvas.getActiveObject();
13220
+ const tb = active instanceof fabric.Textbox ? active : active instanceof fabric.ActiveSelection && active.getObjects().length === 1 && active.getObjects()[0] instanceof fabric.Textbox ? active.getObjects()[0] : null;
13221
+ if (tb && !tb.isEditing && (tb.text ?? "") === "" && tb.editable !== false && !tb.__formattingEnabled && !tb.__pixldocsSuppressNextEdit && Date.now() >= suppressTextDoubleClickUntilRef.current) {
13222
+ const tbId = getObjectId(tb);
13223
+ if (tbId) editingTextIdRef.current = tbId;
13224
+ tb.enterEditing();
13225
+ tb.selectionStart = 0;
13226
+ tb.selectionEnd = 0;
13227
+ fabricCanvas.requestRenderAll();
13228
+ }
13229
+ }
13230
+ } catch {
13231
+ }
13218
13232
  });
13219
13233
  const markSimpleTransform = (e) => {
13220
13234
  if (!isActiveRef.current) return;
@@ -14507,7 +14521,13 @@ const PageCanvas = forwardRef(
14507
14521
  }
14508
14522
  editingTextIdRef.current = elementId || null;
14509
14523
  target.enterEditing();
14510
- target.selectAll();
14524
+ try {
14525
+ const len = (target.text ?? "").length;
14526
+ target.selectionStart = len;
14527
+ target.selectionEnd = len;
14528
+ } catch {
14529
+ }
14530
+ fabricCanvas.requestRenderAll();
14511
14531
  }
14512
14532
  });
14513
14533
  fabricCanvas.on("text:editing:entered", (e) => {
@@ -23439,9 +23459,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23439
23459
  }
23440
23460
  return svgString;
23441
23461
  }
23442
- const resolvedPackageVersion = "0.5.251";
23462
+ const resolvedPackageVersion = "0.5.252";
23443
23463
  const PACKAGE_VERSION = resolvedPackageVersion;
23444
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.251";
23464
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.252";
23445
23465
  const roundParityValue = (value) => {
23446
23466
  if (typeof value !== "number") return value;
23447
23467
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24255,7 +24275,7 @@ class PixldocsRenderer {
24255
24275
  await this.waitForCanvasScene(container, cloned, i);
24256
24276
  }
24257
24277
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24258
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CaBuNR6t.js");
24278
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Cat5oceo.js");
24259
24279
  const prepared = preparePagesForExport(
24260
24280
  cloned.pages,
24261
24281
  canvasWidth,
@@ -26575,7 +26595,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26575
26595
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26576
26596
  sanitizeSvgTreeForPdf(svgToDraw);
26577
26597
  try {
26578
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CaBuNR6t.js");
26598
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Cat5oceo.js");
26579
26599
  try {
26580
26600
  await logTextMeasurementDiagnostic(svgToDraw);
26581
26601
  } catch {
@@ -26975,4 +26995,4 @@ export {
26975
26995
  buildTeaserBlurFlatKeys as y,
26976
26996
  collectFontDescriptorsFromConfig as z
26977
26997
  };
26978
- //# sourceMappingURL=index-jYZgiC9h.js.map
26998
+ //# sourceMappingURL=index-k8vzqr4-.js.map