@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
|
@@ -11866,11 +11866,10 @@ const PageCanvas = react.forwardRef(
|
|
|
11866
11866
|
const selectAllActiveTextbox = (textbox) => {
|
|
11867
11867
|
var _a2;
|
|
11868
11868
|
try {
|
|
11869
|
-
textbox.selectAll();
|
|
11870
|
-
} catch {
|
|
11871
11869
|
const len = ((_a2 = textbox.text) == null ? void 0 : _a2.length) ?? 0;
|
|
11872
|
-
textbox.selectionStart =
|
|
11870
|
+
textbox.selectionStart = len;
|
|
11873
11871
|
textbox.selectionEnd = len;
|
|
11872
|
+
} catch {
|
|
11874
11873
|
}
|
|
11875
11874
|
fabricCanvas.requestRenderAll();
|
|
11876
11875
|
};
|
|
@@ -12052,7 +12051,7 @@ const PageCanvas = react.forwardRef(
|
|
|
12052
12051
|
}
|
|
12053
12052
|
});
|
|
12054
12053
|
fabricCanvas.on("object:scaling", () => {
|
|
12055
|
-
var _a2;
|
|
12054
|
+
var _a2, _b2;
|
|
12056
12055
|
fabricCanvas.__isUserTransforming = true;
|
|
12057
12056
|
if (drilledGroupIdRef.current) {
|
|
12058
12057
|
try {
|
|
@@ -12060,6 +12059,38 @@ const PageCanvas = react.forwardRef(
|
|
|
12060
12059
|
} catch {
|
|
12061
12060
|
}
|
|
12062
12061
|
}
|
|
12062
|
+
const active = fabricCanvas.getActiveObject();
|
|
12063
|
+
if (!active) return;
|
|
12064
|
+
const state = useEditorStore.getState();
|
|
12065
|
+
const canvasPage = (_b2 = state.canvas.pages) == null ? void 0 : _b2.find((p) => p.id === pageId);
|
|
12066
|
+
const children = (canvasPage == null ? void 0 : canvasPage.children) ?? [];
|
|
12067
|
+
if (!canvasPage) return;
|
|
12068
|
+
const ids = state.canvas.selectedIds ?? [];
|
|
12069
|
+
let selectedGroup2 = null;
|
|
12070
|
+
for (const id of ids) {
|
|
12071
|
+
const node = findNodeById(children, id);
|
|
12072
|
+
if (node && isGroup(node)) {
|
|
12073
|
+
selectedGroup2 = node;
|
|
12074
|
+
break;
|
|
12075
|
+
}
|
|
12076
|
+
}
|
|
12077
|
+
if (!selectedGroup2) {
|
|
12078
|
+
const firstId = ids[0];
|
|
12079
|
+
const parent = firstId ? findParentGroup(children, firstId) : null;
|
|
12080
|
+
if (parent) {
|
|
12081
|
+
const memberIds = new Set(getAllElementIds(parent.children ?? []));
|
|
12082
|
+
const allSelectedInGroup = ids.every((id) => memberIds.has(id) || id === parent.id);
|
|
12083
|
+
if (allSelectedInGroup) selectedGroup2 = parent;
|
|
12084
|
+
}
|
|
12085
|
+
}
|
|
12086
|
+
if (!selectedGroup2) return;
|
|
12087
|
+
const rect = active.getBoundingRect();
|
|
12088
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
12089
|
+
const bounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height };
|
|
12090
|
+
reactDom.flushSync(() => {
|
|
12091
|
+
setGroupOverlayLiveBoundsRef.current(bounds);
|
|
12092
|
+
});
|
|
12093
|
+
}
|
|
12063
12094
|
});
|
|
12064
12095
|
fabricCanvas.on("object:moving", () => {
|
|
12065
12096
|
var _a2, _b2;
|
|
@@ -13233,6 +13264,21 @@ const PageCanvas = react.forwardRef(
|
|
|
13233
13264
|
onDynamicFieldClick(clickedId);
|
|
13234
13265
|
}
|
|
13235
13266
|
}
|
|
13267
|
+
try {
|
|
13268
|
+
if (allowEditing && !didTransformRef.current) {
|
|
13269
|
+
const active = fabricCanvas.getActiveObject();
|
|
13270
|
+
const tb = active instanceof fabric__namespace.Textbox ? active : active instanceof fabric__namespace.ActiveSelection && active.getObjects().length === 1 && active.getObjects()[0] instanceof fabric__namespace.Textbox ? active.getObjects()[0] : null;
|
|
13271
|
+
if (tb && !tb.isEditing && (tb.text ?? "") === "" && tb.editable !== false && !tb.__formattingEnabled && !tb.__pixldocsSuppressNextEdit && Date.now() >= suppressTextDoubleClickUntilRef.current) {
|
|
13272
|
+
const tbId = getObjectId(tb);
|
|
13273
|
+
if (tbId) editingTextIdRef.current = tbId;
|
|
13274
|
+
tb.enterEditing();
|
|
13275
|
+
tb.selectionStart = 0;
|
|
13276
|
+
tb.selectionEnd = 0;
|
|
13277
|
+
fabricCanvas.requestRenderAll();
|
|
13278
|
+
}
|
|
13279
|
+
}
|
|
13280
|
+
} catch {
|
|
13281
|
+
}
|
|
13236
13282
|
});
|
|
13237
13283
|
const markSimpleTransform = (e) => {
|
|
13238
13284
|
if (!isActiveRef.current) return;
|
|
@@ -14525,7 +14571,13 @@ const PageCanvas = react.forwardRef(
|
|
|
14525
14571
|
}
|
|
14526
14572
|
editingTextIdRef.current = elementId || null;
|
|
14527
14573
|
target.enterEditing();
|
|
14528
|
-
|
|
14574
|
+
try {
|
|
14575
|
+
const len = (target.text ?? "").length;
|
|
14576
|
+
target.selectionStart = len;
|
|
14577
|
+
target.selectionEnd = len;
|
|
14578
|
+
} catch {
|
|
14579
|
+
}
|
|
14580
|
+
fabricCanvas.requestRenderAll();
|
|
14529
14581
|
}
|
|
14530
14582
|
});
|
|
14531
14583
|
fabricCanvas.on("text:editing:entered", (e) => {
|
|
@@ -23457,9 +23509,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23457
23509
|
}
|
|
23458
23510
|
return svgString;
|
|
23459
23511
|
}
|
|
23460
|
-
const resolvedPackageVersion = "0.5.
|
|
23512
|
+
const resolvedPackageVersion = "0.5.253";
|
|
23461
23513
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23462
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23514
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.253";
|
|
23463
23515
|
const roundParityValue = (value) => {
|
|
23464
23516
|
if (typeof value !== "number") return value;
|
|
23465
23517
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24273,7 +24325,7 @@ class PixldocsRenderer {
|
|
|
24273
24325
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24274
24326
|
}
|
|
24275
24327
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24276
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24328
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BNcQDkad.cjs"));
|
|
24277
24329
|
const prepared = preparePagesForExport(
|
|
24278
24330
|
cloned.pages,
|
|
24279
24331
|
canvasWidth,
|
|
@@ -26593,7 +26645,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26593
26645
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26594
26646
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26595
26647
|
try {
|
|
26596
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26648
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BNcQDkad.cjs"));
|
|
26597
26649
|
try {
|
|
26598
26650
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26599
26651
|
} catch {
|
|
@@ -26990,4 +27042,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
26990
27042
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
26991
27043
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
26992
27044
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
26993
|
-
//# sourceMappingURL=index-
|
|
27045
|
+
//# sourceMappingURL=index-BTDu7FNP.cjs.map
|