@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.
- package/dist/{index-krO2Qm7P.js → index-BElB2Mv_.js} +14 -41
- package/dist/index-BElB2Mv_.js.map +1 -0
- package/dist/{index-DtQblfr0.cjs → index-KuNxjXIo.cjs} +14 -41
- package/dist/index-KuNxjXIo.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-D91zbb8z.js → vectorPdfExport-C-KlhNei.js} +4 -4
- package/dist/{vectorPdfExport-D91zbb8z.js.map → vectorPdfExport-C-KlhNei.js.map} +1 -1
- package/dist/{vectorPdfExport-g3JJf7fm.cjs → vectorPdfExport-C_y0i2dG.cjs} +4 -4
- package/dist/{vectorPdfExport-g3JJf7fm.cjs.map → vectorPdfExport-C_y0i2dG.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DtQblfr0.cjs.map +0 -1
- package/dist/index-krO2Qm7P.js.map +0 -1
|
@@ -9479,7 +9479,7 @@ 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
|
-
let text = element.text
|
|
9482
|
+
let text = element.text != null && element.text !== "" ? element.text : " ";
|
|
9483
9483
|
let fontSize = element.fontSize || 16;
|
|
9484
9484
|
const minFontSize = element.minFontSize || 8;
|
|
9485
9485
|
const maxLines = element.maxLines || 3;
|
|
@@ -9570,7 +9570,7 @@ function createText(element) {
|
|
|
9570
9570
|
}
|
|
9571
9571
|
}
|
|
9572
9572
|
if (overflowPolicy === "max-lines-ellipsis") {
|
|
9573
|
-
const originalText = element.text || "
|
|
9573
|
+
const originalText = element.text || " ";
|
|
9574
9574
|
const countLines = (testText) => {
|
|
9575
9575
|
var _a3;
|
|
9576
9576
|
const tb = new fabric__namespace.Textbox(testText, {
|
|
@@ -11750,7 +11750,7 @@ const PageCanvas = react.forwardRef(
|
|
|
11750
11750
|
const targetWidth = Math.max(1, Number(element.width) > 0 ? Number(element.width) : Number(obj.width ?? 200));
|
|
11751
11751
|
const overflowPolicy = element.overflowPolicy || "grow-and-push";
|
|
11752
11752
|
const splitByGrapheme = overflowPolicy === "auto-shrink" ? false : element.splitByGrapheme ?? element.wordWrap === "break-word";
|
|
11753
|
-
let reflowText = element.text
|
|
11753
|
+
let reflowText = element.text != null && element.text !== "" ? element.text : " ";
|
|
11754
11754
|
let reflowParsedStyles = null;
|
|
11755
11755
|
if (element.formattingEnabled === true) {
|
|
11756
11756
|
const parsed = parseTextMarkdown(reflowText);
|
|
@@ -12857,7 +12857,7 @@ const PageCanvas = react.forwardRef(
|
|
|
12857
12857
|
};
|
|
12858
12858
|
fabricCanvas.__updateDrilledGroupOutline = updateDrilledGroupOutline;
|
|
12859
12859
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12860
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
12860
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12861
12861
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12862
12862
|
if (editLockRef.current) {
|
|
12863
12863
|
const active = fabricCanvas.getActiveObject();
|
|
@@ -12972,43 +12972,16 @@ const PageCanvas = react.forwardRef(
|
|
|
12972
12972
|
}
|
|
12973
12973
|
pendingGroupDrillInRef.current = null;
|
|
12974
12974
|
} 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
12975
|
pendingGroupPromotionRef.current = null;
|
|
12996
12976
|
pendingGroupDrillInRef.current = { groupId: drillGroup.id, childId: effectiveTargetId, target: effectiveTarget };
|
|
12997
12977
|
if (effectiveTarget instanceof fabric__namespace.Textbox) {
|
|
12998
12978
|
suppressTextEditForClick(effectiveTarget);
|
|
12999
|
-
} else {
|
|
13000
|
-
effectiveTarget.selected = false;
|
|
13001
|
-
effectiveTarget.__lastSelected = false;
|
|
13002
|
-
effectiveTarget.__corner = void 0;
|
|
13003
12979
|
}
|
|
13004
|
-
selectElements([effectiveTargetId], false, false);
|
|
13005
|
-
updateDrilledGroupOutline();
|
|
13006
|
-
fabricCanvas.requestRenderAll();
|
|
13007
12980
|
}
|
|
13008
12981
|
} else if (!target || targetId === "__background__") {
|
|
13009
|
-
const isMultiSelectKey = !!(((
|
|
12982
|
+
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
12983
|
if (isMultiSelectKey) return;
|
|
13011
|
-
if ((
|
|
12984
|
+
if ((_m = opt.e) == null ? void 0 : _m.altKey) return;
|
|
13012
12985
|
try {
|
|
13013
12986
|
const pointer = fabricCanvas.getPointer(opt.e);
|
|
13014
12987
|
const px = pointer.x;
|
|
@@ -16249,7 +16222,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16249
16222
|
});
|
|
16250
16223
|
} else if (obj instanceof fabric__namespace.Textbox) {
|
|
16251
16224
|
const overflowPolicy = element.overflowPolicy || "grow-and-push";
|
|
16252
|
-
let text = element.text
|
|
16225
|
+
let text = element.text != null && element.text !== "" ? element.text : " ";
|
|
16253
16226
|
let parsedStyles = null;
|
|
16254
16227
|
if (element.formattingEnabled === true) {
|
|
16255
16228
|
const parsed = parseTextMarkdown(text);
|
|
@@ -16287,7 +16260,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16287
16260
|
}
|
|
16288
16261
|
}
|
|
16289
16262
|
if (overflowPolicy === "max-lines-ellipsis") {
|
|
16290
|
-
const testTextbox = new fabric__namespace.Textbox(element.text || "
|
|
16263
|
+
const testTextbox = new fabric__namespace.Textbox(element.text || " ", {
|
|
16291
16264
|
width: rW,
|
|
16292
16265
|
fontSize,
|
|
16293
16266
|
fontFamily: element.fontFamily || "Open Sans",
|
|
@@ -16297,7 +16270,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16297
16270
|
testTextbox.initDimensions();
|
|
16298
16271
|
const lines = testTextbox.textLines || [];
|
|
16299
16272
|
if (lines.length > maxLines) {
|
|
16300
|
-
const originalText = element.text || "
|
|
16273
|
+
const originalText = element.text || " ";
|
|
16301
16274
|
const countLines = (testText) => {
|
|
16302
16275
|
var _a3;
|
|
16303
16276
|
const tb = new fabric__namespace.Textbox(testText, {
|
|
@@ -23463,9 +23436,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23463
23436
|
}
|
|
23464
23437
|
return svgString;
|
|
23465
23438
|
}
|
|
23466
|
-
const resolvedPackageVersion = "0.5.
|
|
23439
|
+
const resolvedPackageVersion = "0.5.248";
|
|
23467
23440
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23468
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23441
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.248";
|
|
23469
23442
|
const roundParityValue = (value) => {
|
|
23470
23443
|
if (typeof value !== "number") return value;
|
|
23471
23444
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24279,7 +24252,7 @@ class PixldocsRenderer {
|
|
|
24279
24252
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24280
24253
|
}
|
|
24281
24254
|
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-
|
|
24255
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-C_y0i2dG.cjs"));
|
|
24283
24256
|
const prepared = preparePagesForExport(
|
|
24284
24257
|
cloned.pages,
|
|
24285
24258
|
canvasWidth,
|
|
@@ -26599,7 +26572,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26599
26572
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26600
26573
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26601
26574
|
try {
|
|
26602
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26575
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-C_y0i2dG.cjs"));
|
|
26603
26576
|
try {
|
|
26604
26577
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26605
26578
|
} catch {
|
|
@@ -26996,4 +26969,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
26996
26969
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
26997
26970
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
26998
26971
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
26999
|
-
//# sourceMappingURL=index-
|
|
26972
|
+
//# sourceMappingURL=index-KuNxjXIo.cjs.map
|