@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
|
@@ -9479,7 +9479,8 @@ function createShape(element) {
|
|
|
9479
9479
|
function createText(element) {
|
|
9480
9480
|
var _a2, _b2, _c, _d, _e;
|
|
9481
9481
|
const overflowPolicy = element.overflowPolicy || "grow-and-push";
|
|
9482
|
-
|
|
9482
|
+
const isEmptyText = !(element.text != null && element.text !== "");
|
|
9483
|
+
let text = isEmptyText ? " " : element.text;
|
|
9483
9484
|
let fontSize = element.fontSize || 16;
|
|
9484
9485
|
const minFontSize = element.minFontSize || 8;
|
|
9485
9486
|
const maxLines = element.maxLines || 3;
|
|
@@ -9661,6 +9662,7 @@ function createText(element) {
|
|
|
9661
9662
|
...element.textPath && element.textPath.preset && element.textPath.preset !== "none" ? { textPath: element.textPath } : {}
|
|
9662
9663
|
});
|
|
9663
9664
|
textbox.__formattingEnabled = formattingEnabled;
|
|
9665
|
+
textbox.__pixldocsEmptyPlaceholder = isEmptyText;
|
|
9664
9666
|
textbox.initDimensions();
|
|
9665
9667
|
textbox.set({
|
|
9666
9668
|
width: targetWidth,
|
|
@@ -11750,7 +11752,8 @@ const PageCanvas = react.forwardRef(
|
|
|
11750
11752
|
const targetWidth = Math.max(1, Number(element.width) > 0 ? Number(element.width) : Number(obj.width ?? 200));
|
|
11751
11753
|
const overflowPolicy = element.overflowPolicy || "grow-and-push";
|
|
11752
11754
|
const splitByGrapheme = overflowPolicy === "auto-shrink" ? false : element.splitByGrapheme ?? element.wordWrap === "break-word";
|
|
11753
|
-
|
|
11755
|
+
const isEmptyReflowText = !(element.text != null && element.text !== "");
|
|
11756
|
+
let reflowText = isEmptyReflowText ? " " : element.text;
|
|
11754
11757
|
let reflowParsedStyles = null;
|
|
11755
11758
|
if (element.formattingEnabled === true) {
|
|
11756
11759
|
const parsed = parseTextMarkdown(reflowText);
|
|
@@ -11775,6 +11778,7 @@ const PageCanvas = react.forwardRef(
|
|
|
11775
11778
|
}
|
|
11776
11779
|
obj.editable = element.formattingEnabled !== true;
|
|
11777
11780
|
obj.__formattingEnabled = element.formattingEnabled === true;
|
|
11781
|
+
obj.__pixldocsEmptyPlaceholder = isEmptyReflowText;
|
|
11778
11782
|
obj.initDimensions();
|
|
11779
11783
|
if (Math.abs((obj.width ?? 0) - targetWidth) > 0.01) {
|
|
11780
11784
|
obj.width = targetWidth;
|
|
@@ -12857,7 +12861,7 @@ const PageCanvas = react.forwardRef(
|
|
|
12857
12861
|
};
|
|
12858
12862
|
fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
|
|
12859
12863
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12860
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
12864
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12861
12865
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12862
12866
|
if (editLockRef.current) {
|
|
12863
12867
|
const active = fabricCanvas.getActiveObject();
|
|
@@ -12972,43 +12976,16 @@ const PageCanvas = react.forwardRef(
|
|
|
12972
12976
|
}
|
|
12973
12977
|
pendingGroupDrillInRef.current = null;
|
|
12974
12978
|
} else if (drillGroup && !drillGroup.backgroundColor && !targetIsInCrop && alreadyThisGroup && !isMultiSelectKey && effectiveTarget !== activeNow) {
|
|
12975
|
-
try {
|
|
12976
|
-
skipSelectionClearOnDiscardRef.current = true;
|
|
12977
|
-
preserveEditingScopeOnSelectionClearRef.current = true;
|
|
12978
|
-
restoreSuppressedGroupBorders();
|
|
12979
|
-
fabricCanvas.discardActiveObject();
|
|
12980
|
-
} finally {
|
|
12981
|
-
skipSelectionClearOnDiscardRef.current = false;
|
|
12982
|
-
preserveEditingScopeOnSelectionClearRef.current = false;
|
|
12983
|
-
}
|
|
12984
|
-
fabricCanvas.__activeEditingGroupId = drillGroup.id;
|
|
12985
|
-
delete effectiveTarget.__pixldocsGroupSelection;
|
|
12986
|
-
delete effectiveTarget.__pixldocsLogicalGroupIds;
|
|
12987
|
-
try {
|
|
12988
|
-
(_j = effectiveTarget.set) == null ? void 0 : _j.call(effectiveTarget, { selectable: true, evented: true, hasBorders: true, hasControls: true });
|
|
12989
|
-
} catch {
|
|
12990
|
-
}
|
|
12991
|
-
fabricCanvas.setActiveObject(effectiveTarget);
|
|
12992
|
-
effectiveTarget.setCoords();
|
|
12993
|
-
fabricCanvas._target = effectiveTarget;
|
|
12994
|
-
opt.target = effectiveTarget;
|
|
12995
12979
|
pendingGroupPromotionRef.current = null;
|
|
12996
12980
|
pendingGroupDrillInRef.current = { groupId: drillGroup.id, childId: effectiveTargetId, target: effectiveTarget };
|
|
12997
12981
|
if (effectiveTarget instanceof fabric__namespace.Textbox) {
|
|
12998
12982
|
suppressTextEditForClick(effectiveTarget);
|
|
12999
|
-
} else {
|
|
13000
|
-
effectiveTarget.selected = false;
|
|
13001
|
-
effectiveTarget.__lastSelected = false;
|
|
13002
|
-
effectiveTarget.__corner = void 0;
|
|
13003
12983
|
}
|
|
13004
|
-
selectElements([effectiveTargetId], false, false);
|
|
13005
|
-
updateDrilledGroupOutline();
|
|
13006
|
-
fabricCanvas.requestRenderAll();
|
|
13007
12984
|
}
|
|
13008
12985
|
} else if (!target || targetId === "__background__") {
|
|
13009
|
-
const isMultiSelectKey = !!(((
|
|
12986
|
+
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));
|
|
13010
12987
|
if (isMultiSelectKey) return;
|
|
13011
|
-
if ((
|
|
12988
|
+
if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
|
|
13012
12989
|
try {
|
|
13013
12990
|
const pointer = fabricCanvas.getPointer(opt.e);
|
|
13014
12991
|
const px = pointer.x;
|
|
@@ -14565,6 +14542,22 @@ const PageCanvas = react.forwardRef(
|
|
|
14565
14542
|
return;
|
|
14566
14543
|
}
|
|
14567
14544
|
editingTextIdRef.current = elementId || null;
|
|
14545
|
+
if (target.__pixldocsEmptyPlaceholder) {
|
|
14546
|
+
try {
|
|
14547
|
+
target.__pixldocsEmptyPlaceholder = false;
|
|
14548
|
+
target.set("text", "");
|
|
14549
|
+
target.hiddenTextarea && (target.hiddenTextarea.value = "");
|
|
14550
|
+
target.initDimensions();
|
|
14551
|
+
target.setCoords();
|
|
14552
|
+
target.selectionStart = 0;
|
|
14553
|
+
target.selectionEnd = 0;
|
|
14554
|
+
fabricCanvas.requestRenderAll();
|
|
14555
|
+
} catch {
|
|
14556
|
+
}
|
|
14557
|
+
selectAllTextOnEditingEnterRef.current = null;
|
|
14558
|
+
setEditingText(true);
|
|
14559
|
+
return;
|
|
14560
|
+
}
|
|
14568
14561
|
if (elementId && selectAllTextOnEditingEnterRef.current === elementId) {
|
|
14569
14562
|
selectAllTextOnEditingEnterRef.current = null;
|
|
14570
14563
|
selectAllActiveTextbox(target);
|
|
@@ -23463,9 +23456,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23463
23456
|
}
|
|
23464
23457
|
return svgString;
|
|
23465
23458
|
}
|
|
23466
|
-
const resolvedPackageVersion = "0.5.
|
|
23459
|
+
const resolvedPackageVersion = "0.5.249";
|
|
23467
23460
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23468
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23461
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.249";
|
|
23469
23462
|
const roundParityValue = (value) => {
|
|
23470
23463
|
if (typeof value !== "number") return value;
|
|
23471
23464
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24279,7 +24272,7 @@ class PixldocsRenderer {
|
|
|
24279
24272
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24280
24273
|
}
|
|
24281
24274
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24282
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24275
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Cn6AKrk7.cjs"));
|
|
24283
24276
|
const prepared = preparePagesForExport(
|
|
24284
24277
|
cloned.pages,
|
|
24285
24278
|
canvasWidth,
|
|
@@ -26599,7 +26592,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26599
26592
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26600
26593
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26601
26594
|
try {
|
|
26602
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26595
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Cn6AKrk7.cjs"));
|
|
26603
26596
|
try {
|
|
26604
26597
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26605
26598
|
} catch {
|
|
@@ -26996,4 +26989,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
26996
26989
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
26997
26990
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
26998
26991
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
26999
|
-
//# sourceMappingURL=index-
|
|
26992
|
+
//# sourceMappingURL=index-ChwgcxsY.cjs.map
|