@pixldocs/canvas-renderer 0.5.251 → 0.5.253
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-CQtUwS7t.cjs → index-BTDu7FNP.cjs} +62 -10
- package/dist/index-BTDu7FNP.cjs.map +1 -0
- package/dist/{index-jYZgiC9h.js → index-BsuNRFPC.js} +62 -10
- package/dist/index-BsuNRFPC.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BuNDbR35.cjs → vectorPdfExport-BNcQDkad.cjs} +4 -4
- package/dist/{vectorPdfExport-BuNDbR35.cjs.map → vectorPdfExport-BNcQDkad.cjs.map} +1 -1
- package/dist/{vectorPdfExport-CaBuNR6t.js → vectorPdfExport-DyfBSeYs.js} +4 -4
- package/dist/{vectorPdfExport-CaBuNR6t.js.map → vectorPdfExport-DyfBSeYs.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CQtUwS7t.cjs.map +0 -1
- package/dist/index-jYZgiC9h.js.map +0 -1
|
@@ -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 =
|
|
11852
|
+
textbox.selectionStart = len;
|
|
11855
11853
|
textbox.selectionEnd = len;
|
|
11854
|
+
} catch {
|
|
11856
11855
|
}
|
|
11857
11856
|
fabricCanvas.requestRenderAll();
|
|
11858
11857
|
};
|
|
@@ -12034,7 +12033,7 @@ const PageCanvas = forwardRef(
|
|
|
12034
12033
|
}
|
|
12035
12034
|
});
|
|
12036
12035
|
fabricCanvas.on("object:scaling", () => {
|
|
12037
|
-
var _a2;
|
|
12036
|
+
var _a2, _b2;
|
|
12038
12037
|
fabricCanvas.__isUserTransforming = true;
|
|
12039
12038
|
if (drilledGroupIdRef.current) {
|
|
12040
12039
|
try {
|
|
@@ -12042,6 +12041,38 @@ const PageCanvas = forwardRef(
|
|
|
12042
12041
|
} catch {
|
|
12043
12042
|
}
|
|
12044
12043
|
}
|
|
12044
|
+
const active = fabricCanvas.getActiveObject();
|
|
12045
|
+
if (!active) return;
|
|
12046
|
+
const state = useEditorStore.getState();
|
|
12047
|
+
const canvasPage = (_b2 = state.canvas.pages) == null ? void 0 : _b2.find((p) => p.id === pageId);
|
|
12048
|
+
const children = (canvasPage == null ? void 0 : canvasPage.children) ?? [];
|
|
12049
|
+
if (!canvasPage) return;
|
|
12050
|
+
const ids = state.canvas.selectedIds ?? [];
|
|
12051
|
+
let selectedGroup2 = null;
|
|
12052
|
+
for (const id of ids) {
|
|
12053
|
+
const node = findNodeById(children, id);
|
|
12054
|
+
if (node && isGroup(node)) {
|
|
12055
|
+
selectedGroup2 = node;
|
|
12056
|
+
break;
|
|
12057
|
+
}
|
|
12058
|
+
}
|
|
12059
|
+
if (!selectedGroup2) {
|
|
12060
|
+
const firstId = ids[0];
|
|
12061
|
+
const parent = firstId ? findParentGroup(children, firstId) : null;
|
|
12062
|
+
if (parent) {
|
|
12063
|
+
const memberIds = new Set(getAllElementIds(parent.children ?? []));
|
|
12064
|
+
const allSelectedInGroup = ids.every((id) => memberIds.has(id) || id === parent.id);
|
|
12065
|
+
if (allSelectedInGroup) selectedGroup2 = parent;
|
|
12066
|
+
}
|
|
12067
|
+
}
|
|
12068
|
+
if (!selectedGroup2) return;
|
|
12069
|
+
const rect = active.getBoundingRect();
|
|
12070
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
12071
|
+
const bounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height };
|
|
12072
|
+
flushSync(() => {
|
|
12073
|
+
setGroupOverlayLiveBoundsRef.current(bounds);
|
|
12074
|
+
});
|
|
12075
|
+
}
|
|
12045
12076
|
});
|
|
12046
12077
|
fabricCanvas.on("object:moving", () => {
|
|
12047
12078
|
var _a2, _b2;
|
|
@@ -13215,6 +13246,21 @@ const PageCanvas = forwardRef(
|
|
|
13215
13246
|
onDynamicFieldClick(clickedId);
|
|
13216
13247
|
}
|
|
13217
13248
|
}
|
|
13249
|
+
try {
|
|
13250
|
+
if (allowEditing && !didTransformRef.current) {
|
|
13251
|
+
const active = fabricCanvas.getActiveObject();
|
|
13252
|
+
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;
|
|
13253
|
+
if (tb && !tb.isEditing && (tb.text ?? "") === "" && tb.editable !== false && !tb.__formattingEnabled && !tb.__pixldocsSuppressNextEdit && Date.now() >= suppressTextDoubleClickUntilRef.current) {
|
|
13254
|
+
const tbId = getObjectId(tb);
|
|
13255
|
+
if (tbId) editingTextIdRef.current = tbId;
|
|
13256
|
+
tb.enterEditing();
|
|
13257
|
+
tb.selectionStart = 0;
|
|
13258
|
+
tb.selectionEnd = 0;
|
|
13259
|
+
fabricCanvas.requestRenderAll();
|
|
13260
|
+
}
|
|
13261
|
+
}
|
|
13262
|
+
} catch {
|
|
13263
|
+
}
|
|
13218
13264
|
});
|
|
13219
13265
|
const markSimpleTransform = (e) => {
|
|
13220
13266
|
if (!isActiveRef.current) return;
|
|
@@ -14507,7 +14553,13 @@ const PageCanvas = forwardRef(
|
|
|
14507
14553
|
}
|
|
14508
14554
|
editingTextIdRef.current = elementId || null;
|
|
14509
14555
|
target.enterEditing();
|
|
14510
|
-
|
|
14556
|
+
try {
|
|
14557
|
+
const len = (target.text ?? "").length;
|
|
14558
|
+
target.selectionStart = len;
|
|
14559
|
+
target.selectionEnd = len;
|
|
14560
|
+
} catch {
|
|
14561
|
+
}
|
|
14562
|
+
fabricCanvas.requestRenderAll();
|
|
14511
14563
|
}
|
|
14512
14564
|
});
|
|
14513
14565
|
fabricCanvas.on("text:editing:entered", (e) => {
|
|
@@ -23439,9 +23491,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23439
23491
|
}
|
|
23440
23492
|
return svgString;
|
|
23441
23493
|
}
|
|
23442
|
-
const resolvedPackageVersion = "0.5.
|
|
23494
|
+
const resolvedPackageVersion = "0.5.253";
|
|
23443
23495
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23444
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23496
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.253";
|
|
23445
23497
|
const roundParityValue = (value) => {
|
|
23446
23498
|
if (typeof value !== "number") return value;
|
|
23447
23499
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24255,7 +24307,7 @@ class PixldocsRenderer {
|
|
|
24255
24307
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24256
24308
|
}
|
|
24257
24309
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24258
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
24310
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DyfBSeYs.js");
|
|
24259
24311
|
const prepared = preparePagesForExport(
|
|
24260
24312
|
cloned.pages,
|
|
24261
24313
|
canvasWidth,
|
|
@@ -26575,7 +26627,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26575
26627
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26576
26628
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26577
26629
|
try {
|
|
26578
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
26630
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DyfBSeYs.js");
|
|
26579
26631
|
try {
|
|
26580
26632
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26581
26633
|
} catch {
|
|
@@ -26975,4 +27027,4 @@ export {
|
|
|
26975
27027
|
buildTeaserBlurFlatKeys as y,
|
|
26976
27028
|
collectFontDescriptorsFromConfig as z
|
|
26977
27029
|
};
|
|
26978
|
-
//# sourceMappingURL=index-
|
|
27030
|
+
//# sourceMappingURL=index-BsuNRFPC.js.map
|