vue-print-designer 1.2.21 → 1.2.22

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.
@@ -34633,7 +34633,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
34633
34633
  const renderBarcode = async () => {
34634
34634
  if (!barcodeRef.value) return;
34635
34635
  try {
34636
- const jsBarcodeModule = await import("./JsBarcode-vgX9_Af1.js").then((n) => n.JsBarcode);
34636
+ const jsBarcodeModule = await import("./JsBarcode-QNk1KY2s.js").then((n) => n.JsBarcode);
34637
34637
  const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
34638
34638
  const content = resolvedContent.value;
34639
34639
  const style = props.element.style;
@@ -34779,7 +34779,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
34779
34779
  });
34780
34780
  const renderQR = async () => {
34781
34781
  try {
34782
- const qrcodeModule = await import("./browser-DGNDbP3U.js").then((n) => n.browser);
34782
+ const qrcodeModule = await import("./browser-DM8FlFgO.js").then((n) => n.browser);
34783
34783
  const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
34784
34784
  const content = resolvedContent.value;
34785
34785
  qrSrc.value = await QRCode.toDataURL(content, {
@@ -37469,6 +37469,16 @@ const createPagination = ({ store }) => {
37469
37469
  const value = parseFloat(el.getAttribute(attr) || "");
37470
37470
  return Number.isFinite(value) ? value : fallback;
37471
37471
  };
37472
+ const getPageScaleY = (pageRect) => {
37473
+ if (pageHeight <= 0 || pageRect.height <= 0) return 1;
37474
+ return pageRect.height / pageHeight;
37475
+ };
37476
+ const pageYToViewportY = (pageRect, pageY) => {
37477
+ return pageRect.top + pageY * getPageScaleY(pageRect);
37478
+ };
37479
+ const viewportYToPageY = (pageRect, viewportY) => {
37480
+ return (viewportY - pageRect.top) / getPageScaleY(pageRect);
37481
+ };
37472
37482
  const getFlowKind = (wrapper) => wrapper.getAttribute("data-flow-kind") || "";
37473
37483
  const resolveAutoHeightContentEl = (wrapper) => {
37474
37484
  return wrapper.querySelector('[data-auto-height="true"]') || wrapper.querySelector(
@@ -37592,7 +37602,10 @@ const createPagination = ({ store }) => {
37592
37602
  );
37593
37603
  const originalBottom = originalTop + originalHeight;
37594
37604
  const contentRect = (table || autoHeightEl).getBoundingClientRect();
37595
- const finalBottomInPage = contentRect.bottom - pageRect.top;
37605
+ const finalBottomInPage = viewportYToPageY(
37606
+ pageRect,
37607
+ contentRect.bottom
37608
+ );
37596
37609
  const finalGlobalBottom = pageIndex * pageHeight + finalBottomInPage;
37597
37610
  const list = tableEntriesByOrigin.get(originPage) || [];
37598
37611
  const existing = list.find(
@@ -37876,7 +37889,10 @@ const createPagination = ({ store }) => {
37876
37889
  const pageRect = page.getBoundingClientRect();
37877
37890
  const marginBottom2 = store.pageSpacingY || 0;
37878
37891
  const effectiveFooterHeight = copyFooter ? footerHeight : 0;
37879
- const limitBottom = pageRect.top + pageHeight - effectiveFooterHeight - marginBottom2;
37892
+ const limitBottom = pageYToViewportY(
37893
+ pageRect,
37894
+ pageHeight - effectiveFooterHeight - marginBottom2
37895
+ );
37880
37896
  const wrappers = Array.from(
37881
37897
  page.querySelectorAll(
37882
37898
  "[data-print-wrapper][data-flow-id][data-flow-paginated]"
@@ -38026,9 +38042,12 @@ const createPagination = ({ store }) => {
38026
38042
  const pageRect = page.getBoundingClientRect();
38027
38043
  const marginBottom2 = store.pageSpacingY || 0;
38028
38044
  const effectiveFooterHeight = copyFooter ? footerHeight : 0;
38029
- const limitBottom = pageRect.top + pageHeight - effectiveFooterHeight - marginBottom2;
38045
+ const limitBottom = pageYToViewportY(
38046
+ pageRect,
38047
+ pageHeight - effectiveFooterHeight - marginBottom2
38048
+ );
38030
38049
  const wrapperRect = wrapper.getBoundingClientRect();
38031
- const wrapperTopInPage = wrapperRect.top - pageRect.top;
38050
+ const wrapperTopInPage = viewportYToPageY(pageRect, wrapperRect.top);
38032
38051
  if (isAutoHeight) {
38033
38052
  if (!autoHeightEl) return;
38034
38053
  const contentRect = autoHeightEl.getBoundingClientRect();
@@ -38310,7 +38329,7 @@ const createImageRenderer = (deps) => {
38310
38329
  const svgToCanvas = async (root) => {
38311
38330
  const svgs = root.querySelectorAll("svg");
38312
38331
  if (svgs.length === 0) return;
38313
- const { Canvg } = await import("./index.es-C4KWgcHt.js");
38332
+ const { Canvg } = await import("./index.es-CdZAYKDy.js");
38314
38333
  svgs.forEach((svg) => {
38315
38334
  const parent = svg.parentElement;
38316
38335
  if (!parent) return;
@@ -38636,7 +38655,7 @@ const createImageRenderer = (deps) => {
38636
38655
  }
38637
38656
  try {
38638
38657
  const generatePageImage = async (page) => {
38639
- const domToImageModule = await import("./dom-to-image-more.min-BZ9FRhxR.js").then((n) => n.domToImageMore_min);
38658
+ const domToImageModule = await import("./dom-to-image-more.min-Do1m7QvX.js").then((n) => n.domToImageMore_min);
38640
38659
  const domtoimage = (domToImageModule == null ? void 0 : domToImageModule.default) || domToImageModule;
38641
38660
  const canvas = await domtoimage.toCanvas(page, {
38642
38661
  filter: (node) => {
@@ -38705,7 +38724,7 @@ const createImageRenderer = (deps) => {
38705
38724
  source.getComputedStyleFn
38706
38725
  );
38707
38726
  tempWrapper = wrapper;
38708
- const jsPdfModule = await import("./jspdf.es.min-ChNFtJOU.js");
38727
+ const jsPdfModule = await import("./jspdf.es.min-DOpJYsPq.js");
38709
38728
  const jsPDF = (jsPdfModule == null ? void 0 : jsPdfModule.default) || (jsPdfModule == null ? void 0 : jsPdfModule.jsPDF) || jsPdfModule;
38710
38729
  const pdf = new jsPDF({
38711
38730
  orientation: width > height ? "l" : "p",
@@ -39087,7 +39106,7 @@ const usePrint = () => {
39087
39106
  link.click();
39088
39107
  document.body.removeChild(link);
39089
39108
  } else {
39090
- const jsZipModule = await import("./jszip.min-BV1cV44d.js").then((n) => n.jszip_min);
39109
+ const jsZipModule = await import("./jszip.min-BgpyKvVn.js").then((n) => n.jszip_min);
39091
39110
  const JSZip = (jsZipModule == null ? void 0 : jsZipModule.default) || jsZipModule;
39092
39111
  const zip = new JSZip();
39093
39112
  await Promise.all(
@@ -39388,7 +39407,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
39388
39407
  emits: ["update:visible", "update:value", "close", "save"],
39389
39408
  setup(__props, { emit: __emit }) {
39390
39409
  const Editor = /* @__PURE__ */ defineAsyncComponent(
39391
- () => import("./index-eOImZGkP.js").then((m) => m.Editor)
39410
+ () => import("./index-B_AgEYHd.js").then((m) => m.Editor)
39392
39411
  );
39393
39412
  const { t } = useI18n();
39394
39413
  const { isDark: isDark2 } = useTheme();
@@ -45495,7 +45514,7 @@ function render$d(_ctx, _cache) {
45495
45514
  }
45496
45515
  const InfoIcon = markRaw({ name: "material-symbols-info", render: render$d });
45497
45516
  const name = "vue-print-designer";
45498
- const version = "1.2.21";
45517
+ const version = "1.2.22";
45499
45518
  const dependencies = { "@guolao/vue-monaco-editor": "^1.6.0", "canvg": "^3.0.11", "dom-to-image-more": "^3.7.2", "jsbarcode": "^3.12.3", "jspdf": "4.2", "jszip": "^3.10.1", "lodash": "^4.17.21", "pinia": "^2.3.0", "qrcode": "^1.5.4", "uuid": "^11.0.3", "vue": "^3.5.13", "vue-i18n": "^11.2.8" };
45500
45519
  const devDependencies = { "@iconify-json/material-symbols": "^1.2.53", "@types/jsbarcode": "^3.11.4", "@types/lodash": "^4.17.13", "@types/node": "^22.10.2", "@types/qrcode": "^1.5.6", "@types/uuid": "^10.0.0", "@vitejs/plugin-vue": "^5.2.1", "@vue/tsconfig": "^0.7.0", "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "rollup-plugin-visualizer": "^7.0.1", "sharp": "^0.34.5", "tailwindcss": "^3.4.17", "terser": "^5.46.1", "typescript": "~5.6.2", "unplugin-icons": "^23.0.1", "vite": "^6.0.1", "vue-tsc": "^2.1.10" };
45501
45520
  const pkg = {
@@ -48349,7 +48368,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
48349
48368
  emits: ["update:value"],
48350
48369
  setup(__props, { emit: __emit }) {
48351
48370
  const Editor = /* @__PURE__ */ defineAsyncComponent(
48352
- () => import("./index-eOImZGkP.js").then((m) => m.Editor)
48371
+ () => import("./index-B_AgEYHd.js").then((m) => m.Editor)
48353
48372
  );
48354
48373
  const emit2 = __emit;
48355
48374
  useDesignerStore();
@@ -50904,7 +50923,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
50904
50923
  };
50905
50924
  const renderBarcodeDataUrl = async (element) => {
50906
50925
  try {
50907
- const jsBarcodeModule = await import("./JsBarcode-vgX9_Af1.js").then((n) => n.JsBarcode);
50926
+ const jsBarcodeModule = await import("./JsBarcode-QNk1KY2s.js").then((n) => n.JsBarcode);
50908
50927
  const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
50909
50928
  const canvas = document.createElement("canvas");
50910
50929
  const style = element.style || {};
@@ -50931,7 +50950,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
50931
50950
  const renderQrDataUrl = async (element) => {
50932
50951
  var _a2, _b;
50933
50952
  try {
50934
- const qrcodeModule = await import("./browser-DGNDbP3U.js").then((n) => n.browser);
50953
+ const qrcodeModule = await import("./browser-DM8FlFgO.js").then((n) => n.browser);
50935
50954
  const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
50936
50955
  return await QRCode.toDataURL(getResolvedContent(element), {
50937
50956
  margin: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-print-designer",
3
3
  "private": false,
4
- "version": "1.2.21",
4
+ "version": "1.2.22",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "main": "dist/print-designer.umd.js",