@pixldocs/canvas-renderer 0.5.246 → 0.5.248

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.
@@ -9461,7 +9461,7 @@ function createShape(element) {
9461
9461
  function createText(element) {
9462
9462
  var _a2, _b2, _c, _d, _e;
9463
9463
  const overflowPolicy = element.overflowPolicy || "grow-and-push";
9464
- let text = element.text || "Text";
9464
+ let text = element.text != null && element.text !== "" ? element.text : " ";
9465
9465
  let fontSize = element.fontSize || 16;
9466
9466
  const minFontSize = element.minFontSize || 8;
9467
9467
  const maxLines = element.maxLines || 3;
@@ -9552,7 +9552,7 @@ function createText(element) {
9552
9552
  }
9553
9553
  }
9554
9554
  if (overflowPolicy === "max-lines-ellipsis") {
9555
- const originalText = element.text || "Text";
9555
+ const originalText = element.text || " ";
9556
9556
  const countLines = (testText) => {
9557
9557
  var _a3;
9558
9558
  const tb = new fabric.Textbox(testText, {
@@ -11732,7 +11732,7 @@ const PageCanvas = forwardRef(
11732
11732
  const targetWidth = Math.max(1, Number(element.width) > 0 ? Number(element.width) : Number(obj.width ?? 200));
11733
11733
  const overflowPolicy = element.overflowPolicy || "grow-and-push";
11734
11734
  const splitByGrapheme = overflowPolicy === "auto-shrink" ? false : element.splitByGrapheme ?? element.wordWrap === "break-word";
11735
- let reflowText = element.text || "Text";
11735
+ let reflowText = element.text != null && element.text !== "" ? element.text : " ";
11736
11736
  let reflowParsedStyles = null;
11737
11737
  if (element.formattingEnabled === true) {
11738
11738
  const parsed = parseTextMarkdown(reflowText);
@@ -12839,7 +12839,7 @@ const PageCanvas = forwardRef(
12839
12839
  };
12840
12840
  fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
12841
12841
  fabricCanvas.on("mouse:down:before", (opt) => {
12842
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
12842
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
12843
12843
  const activeBeforeMouseDown = fabricCanvas.getActiveObject();
12844
12844
  if (editLockRef.current) {
12845
12845
  const active = fabricCanvas.getActiveObject();
@@ -12954,43 +12954,16 @@ const PageCanvas = forwardRef(
12954
12954
  }
12955
12955
  pendingGroupDrillInRef.current = null;
12956
12956
  } else if (drillGroup && !drillGroup.backgroundColor && !targetIsInCrop && alreadyThisGroup && !isMultiSelectKey && effectiveTarget !== activeNow) {
12957
- try {
12958
- skipSelectionClearOnDiscardRef.current = true;
12959
- preserveEditingScopeOnSelectionClearRef.current = true;
12960
- restoreSuppressedGroupBorders();
12961
- fabricCanvas.discardActiveObject();
12962
- } finally {
12963
- skipSelectionClearOnDiscardRef.current = false;
12964
- preserveEditingScopeOnSelectionClearRef.current = false;
12965
- }
12966
- fabricCanvas.__activeEditingGroupId = drillGroup.id;
12967
- delete effectiveTarget.__pixldocsGroupSelection;
12968
- delete effectiveTarget.__pixldocsLogicalGroupIds;
12969
- try {
12970
- (_j = effectiveTarget.set) == null ? void 0 : _j.call(effectiveTarget, { selectable: true, evented: true, hasBorders: true, hasControls: true });
12971
- } catch {
12972
- }
12973
- fabricCanvas.setActiveObject(effectiveTarget);
12974
- effectiveTarget.setCoords();
12975
- fabricCanvas._target = effectiveTarget;
12976
- opt.target = effectiveTarget;
12977
12957
  pendingGroupPromotionRef.current = null;
12978
12958
  pendingGroupDrillInRef.current = { groupId: drillGroup.id, childId: effectiveTargetId, target: effectiveTarget };
12979
12959
  if (effectiveTarget instanceof fabric.Textbox) {
12980
12960
  suppressTextEditForClick(effectiveTarget);
12981
- } else {
12982
- effectiveTarget.selected = false;
12983
- effectiveTarget.__lastSelected = false;
12984
- effectiveTarget.__corner = void 0;
12985
12961
  }
12986
- selectElements([effectiveTargetId], false, false);
12987
- updateDrilledGroupOutline();
12988
- fabricCanvas.requestRenderAll();
12989
12962
  }
12990
12963
  } else if (!target || targetId === "__background__") {
12991
- const isMultiSelectKey = !!(((_k = opt.e) == null ? void 0 : _k.shiftKey) || ((_l = opt.e) == null ? void 0 : _l.metaKey) || ((_m = opt.e) == null ? void 0 : _m.ctrlKey));
12964
+ const isMultiSelectKey = !!(((_j = opt.e) == null ? void 0 : _j.shiftKey) || ((_k = opt.e) == null ? void 0 : _k.metaKey) || ((_l = opt.e) == null ? void 0 : _l.ctrlKey));
12992
12965
  if (isMultiSelectKey) return;
12993
- if ((_n = opt.e) == null ? void 0 : _n.altKey) return;
12966
+ if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
12994
12967
  try {
12995
12968
  const pointer = fabricCanvas.getPointer(opt.e);
12996
12969
  const px = pointer.x;
@@ -16231,7 +16204,7 @@ const PageCanvas = forwardRef(
16231
16204
  });
16232
16205
  } else if (obj instanceof fabric.Textbox) {
16233
16206
  const overflowPolicy = element.overflowPolicy || "grow-and-push";
16234
- let text = element.text || "Text";
16207
+ let text = element.text != null && element.text !== "" ? element.text : " ";
16235
16208
  let parsedStyles = null;
16236
16209
  if (element.formattingEnabled === true) {
16237
16210
  const parsed = parseTextMarkdown(text);
@@ -16269,7 +16242,7 @@ const PageCanvas = forwardRef(
16269
16242
  }
16270
16243
  }
16271
16244
  if (overflowPolicy === "max-lines-ellipsis") {
16272
- const testTextbox = new fabric.Textbox(element.text || "Text", {
16245
+ const testTextbox = new fabric.Textbox(element.text || " ", {
16273
16246
  width: rW,
16274
16247
  fontSize,
16275
16248
  fontFamily: element.fontFamily || "Open Sans",
@@ -16279,7 +16252,7 @@ const PageCanvas = forwardRef(
16279
16252
  testTextbox.initDimensions();
16280
16253
  const lines = testTextbox.textLines || [];
16281
16254
  if (lines.length > maxLines) {
16282
- const originalText = element.text || "Text";
16255
+ const originalText = element.text || " ";
16283
16256
  const countLines = (testText) => {
16284
16257
  var _a3;
16285
16258
  const tb = new fabric.Textbox(testText, {
@@ -23445,9 +23418,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23445
23418
  }
23446
23419
  return svgString;
23447
23420
  }
23448
- const resolvedPackageVersion = "0.5.246";
23421
+ const resolvedPackageVersion = "0.5.248";
23449
23422
  const PACKAGE_VERSION = resolvedPackageVersion;
23450
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.246";
23423
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.248";
23451
23424
  const roundParityValue = (value) => {
23452
23425
  if (typeof value !== "number") return value;
23453
23426
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24261,7 +24234,7 @@ class PixldocsRenderer {
24261
24234
  await this.waitForCanvasScene(container, cloned, i);
24262
24235
  }
24263
24236
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24264
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-D91zbb8z.js");
24237
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C-KlhNei.js");
24265
24238
  const prepared = preparePagesForExport(
24266
24239
  cloned.pages,
24267
24240
  canvasWidth,
@@ -26581,7 +26554,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26581
26554
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26582
26555
  sanitizeSvgTreeForPdf(svgToDraw);
26583
26556
  try {
26584
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-D91zbb8z.js");
26557
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C-KlhNei.js");
26585
26558
  try {
26586
26559
  await logTextMeasurementDiagnostic(svgToDraw);
26587
26560
  } catch {
@@ -26981,4 +26954,4 @@ export {
26981
26954
  buildTeaserBlurFlatKeys as y,
26982
26955
  collectFontDescriptorsFromConfig as z
26983
26956
  };
26984
- //# sourceMappingURL=index-krO2Qm7P.js.map
26957
+ //# sourceMappingURL=index-BElB2Mv_.js.map