@pixldocs/canvas-renderer 0.5.247 → 0.5.249
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.
- package/dist/{index-B70vNKRX.js → index-Bjb8trdG.js} +30 -37
- package/dist/index-Bjb8trdG.js.map +1 -0
- package/dist/{index-D3P-zkRH.cjs → index-ChwgcxsY.cjs} +30 -37
- package/dist/index-ChwgcxsY.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-7--PybIt.cjs → vectorPdfExport-Cn6AKrk7.cjs} +4 -4
- package/dist/{vectorPdfExport-7--PybIt.cjs.map → vectorPdfExport-Cn6AKrk7.cjs.map} +1 -1
- package/dist/{vectorPdfExport-Cej7-4rP.js → vectorPdfExport-D6dDBhHF.js} +4 -4
- package/dist/{vectorPdfExport-Cej7-4rP.js.map → vectorPdfExport-D6dDBhHF.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-B70vNKRX.js.map +0 -1
- package/dist/index-D3P-zkRH.cjs.map +0 -1
|
@@ -9461,7 +9461,8 @@ 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
|
-
|
|
9464
|
+
const isEmptyText = !(element.text != null && element.text !== "");
|
|
9465
|
+
let text = isEmptyText ? " " : element.text;
|
|
9465
9466
|
let fontSize = element.fontSize || 16;
|
|
9466
9467
|
const minFontSize = element.minFontSize || 8;
|
|
9467
9468
|
const maxLines = element.maxLines || 3;
|
|
@@ -9643,6 +9644,7 @@ function createText(element) {
|
|
|
9643
9644
|
...element.textPath && element.textPath.preset && element.textPath.preset !== "none" ? { textPath: element.textPath } : {}
|
|
9644
9645
|
});
|
|
9645
9646
|
textbox.__formattingEnabled = formattingEnabled;
|
|
9647
|
+
textbox.__pixldocsEmptyPlaceholder = isEmptyText;
|
|
9646
9648
|
textbox.initDimensions();
|
|
9647
9649
|
textbox.set({
|
|
9648
9650
|
width: targetWidth,
|
|
@@ -11732,7 +11734,8 @@ const PageCanvas = forwardRef(
|
|
|
11732
11734
|
const targetWidth = Math.max(1, Number(element.width) > 0 ? Number(element.width) : Number(obj.width ?? 200));
|
|
11733
11735
|
const overflowPolicy = element.overflowPolicy || "grow-and-push";
|
|
11734
11736
|
const splitByGrapheme = overflowPolicy === "auto-shrink" ? false : element.splitByGrapheme ?? element.wordWrap === "break-word";
|
|
11735
|
-
|
|
11737
|
+
const isEmptyReflowText = !(element.text != null && element.text !== "");
|
|
11738
|
+
let reflowText = isEmptyReflowText ? " " : element.text;
|
|
11736
11739
|
let reflowParsedStyles = null;
|
|
11737
11740
|
if (element.formattingEnabled === true) {
|
|
11738
11741
|
const parsed = parseTextMarkdown(reflowText);
|
|
@@ -11757,6 +11760,7 @@ const PageCanvas = forwardRef(
|
|
|
11757
11760
|
}
|
|
11758
11761
|
obj.editable = element.formattingEnabled !== true;
|
|
11759
11762
|
obj.__formattingEnabled = element.formattingEnabled === true;
|
|
11763
|
+
obj.__pixldocsEmptyPlaceholder = isEmptyReflowText;
|
|
11760
11764
|
obj.initDimensions();
|
|
11761
11765
|
if (Math.abs((obj.width ?? 0) - targetWidth) > 0.01) {
|
|
11762
11766
|
obj.width = targetWidth;
|
|
@@ -12839,7 +12843,7 @@ const PageCanvas = forwardRef(
|
|
|
12839
12843
|
};
|
|
12840
12844
|
fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
|
|
12841
12845
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12842
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
12846
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12843
12847
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12844
12848
|
if (editLockRef.current) {
|
|
12845
12849
|
const active = fabricCanvas.getActiveObject();
|
|
@@ -12954,43 +12958,16 @@ const PageCanvas = forwardRef(
|
|
|
12954
12958
|
}
|
|
12955
12959
|
pendingGroupDrillInRef.current = null;
|
|
12956
12960
|
} 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
12961
|
pendingGroupPromotionRef.current = null;
|
|
12978
12962
|
pendingGroupDrillInRef.current = { groupId: drillGroup.id, childId: effectiveTargetId, target: effectiveTarget };
|
|
12979
12963
|
if (effectiveTarget instanceof fabric.Textbox) {
|
|
12980
12964
|
suppressTextEditForClick(effectiveTarget);
|
|
12981
|
-
} else {
|
|
12982
|
-
effectiveTarget.selected = false;
|
|
12983
|
-
effectiveTarget.__lastSelected = false;
|
|
12984
|
-
effectiveTarget.__corner = void 0;
|
|
12985
12965
|
}
|
|
12986
|
-
selectElements([effectiveTargetId], false, false);
|
|
12987
|
-
updateDrilledGroupOutline();
|
|
12988
|
-
fabricCanvas.requestRenderAll();
|
|
12989
12966
|
}
|
|
12990
12967
|
} else if (!target || targetId === "__background__") {
|
|
12991
|
-
const isMultiSelectKey = !!(((
|
|
12968
|
+
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
12969
|
if (isMultiSelectKey) return;
|
|
12993
|
-
if ((
|
|
12970
|
+
if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
|
|
12994
12971
|
try {
|
|
12995
12972
|
const pointer = fabricCanvas.getPointer(opt.e);
|
|
12996
12973
|
const px = pointer.x;
|
|
@@ -14547,6 +14524,22 @@ const PageCanvas = forwardRef(
|
|
|
14547
14524
|
return;
|
|
14548
14525
|
}
|
|
14549
14526
|
editingTextIdRef.current = elementId || null;
|
|
14527
|
+
if (target.__pixldocsEmptyPlaceholder) {
|
|
14528
|
+
try {
|
|
14529
|
+
target.__pixldocsEmptyPlaceholder = false;
|
|
14530
|
+
target.set("text", "");
|
|
14531
|
+
target.hiddenTextarea && (target.hiddenTextarea.value = "");
|
|
14532
|
+
target.initDimensions();
|
|
14533
|
+
target.setCoords();
|
|
14534
|
+
target.selectionStart = 0;
|
|
14535
|
+
target.selectionEnd = 0;
|
|
14536
|
+
fabricCanvas.requestRenderAll();
|
|
14537
|
+
} catch {
|
|
14538
|
+
}
|
|
14539
|
+
selectAllTextOnEditingEnterRef.current = null;
|
|
14540
|
+
setEditingText(true);
|
|
14541
|
+
return;
|
|
14542
|
+
}
|
|
14550
14543
|
if (elementId && selectAllTextOnEditingEnterRef.current === elementId) {
|
|
14551
14544
|
selectAllTextOnEditingEnterRef.current = null;
|
|
14552
14545
|
selectAllActiveTextbox(target);
|
|
@@ -23445,9 +23438,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23445
23438
|
}
|
|
23446
23439
|
return svgString;
|
|
23447
23440
|
}
|
|
23448
|
-
const resolvedPackageVersion = "0.5.
|
|
23441
|
+
const resolvedPackageVersion = "0.5.249";
|
|
23449
23442
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23450
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23443
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.249";
|
|
23451
23444
|
const roundParityValue = (value) => {
|
|
23452
23445
|
if (typeof value !== "number") return value;
|
|
23453
23446
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24261,7 +24254,7 @@ class PixldocsRenderer {
|
|
|
24261
24254
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24262
24255
|
}
|
|
24263
24256
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24264
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24257
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-D6dDBhHF.js");
|
|
24265
24258
|
const prepared = preparePagesForExport(
|
|
24266
24259
|
cloned.pages,
|
|
24267
24260
|
canvasWidth,
|
|
@@ -26581,7 +26574,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26581
26574
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26582
26575
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26583
26576
|
try {
|
|
26584
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
26577
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-D6dDBhHF.js");
|
|
26585
26578
|
try {
|
|
26586
26579
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26587
26580
|
} catch {
|
|
@@ -26981,4 +26974,4 @@ export {
|
|
|
26981
26974
|
buildTeaserBlurFlatKeys as y,
|
|
26982
26975
|
collectFontDescriptorsFromConfig as z
|
|
26983
26976
|
};
|
|
26984
|
-
//# sourceMappingURL=index-
|
|
26977
|
+
//# sourceMappingURL=index-Bjb8trdG.js.map
|