v1.6.2: fix RichEditor auto-scroll and PDF offers multi-page header

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-05-09 20:23:36 +02:00
parent e4f14a24b7
commit 59b478f262
3 changed files with 12 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "app-ts", "name": "app-ts",
"version": "1.6.1", "version": "1.6.2",
"description": "", "description": "",
"main": "dist/server.js", "main": "dist/server.js",
"scripts": { "scripts": {

View File

@@ -1,4 +1,4 @@
import { useMemo, useRef, useCallback, useEffect } from "react"; import { useMemo, useRef, useCallback, useLayoutEffect } from "react";
import ReactQuill from "react-quill-new"; import ReactQuill from "react-quill-new";
import "react-quill-new/dist/quill.snow.css"; import "react-quill-new/dist/quill.snow.css";
@@ -96,11 +96,14 @@ export default function RichEditor({
[onChange], [onChange],
); );
useEffect(() => { useLayoutEffect(() => {
if (!quillRef.current) return; if (!quillRef.current) return;
const editor = quillRef.current.getEditor(); const editor = quillRef.current.getEditor();
editor.format("font", "tahoma"); editor.format("font", "tahoma");
editor.format("size", "14px"); editor.format("size", "14px");
// Quill auto-focuses on mount with existing content, which scrolls
// the page to the editor. Blur to prevent unwanted scroll.
editor.blur();
}, []); }, []);
return ( return (

View File

@@ -632,14 +632,6 @@ ${indentCSS}
border: none; border: none;
vertical-align: top; vertical-align: top;
} }
.logo-header {
text-align: right;
padding-bottom: 4mm;
}
.first-content {
margin-top: -26mm;
}
/* ---- Page break helpers ---- */ /* ---- Page break helpers ---- */
table.page-layout thead { display: table-header-group; } table.page-layout thead { display: table-header-group; }
table.items tbody tr { break-inside: avoid; } table.items tbody tr { break-inside: avoid; }
@@ -696,30 +688,16 @@ ${indentCSS}
display: block; display: block;
width: 100%; width: 100%;
} }
.first-content {
margin-top: 0 !important;
}
.logo-header {
text-align: right;
padding-bottom: 0;
margin-bottom: -18mm;
}
} }
</style> </style>
</head> </head>
<body> <body>
<!-- ============ QUOTATION (logo repeats via thead, full header only on first page) ============ --> <!-- ============ QUOTATION (full header in thead repeats on every page) ============ -->
<div class="quotation-page"> <div class="quotation-page">
<table class="page-layout"> <table class="page-layout">
<thead> <thead>
<tr><td> <tr><td>
<div class="logo-header">${logoImg}</div>
</td></tr>
</thead>
<tbody>
<tr><td>
<div class="first-content">
<div class="page-header"> <div class="page-header">
<div class="left"> <div class="left">
<div class="page-title">${escapeHtml(t("title"))}</div> <div class="page-title">${escapeHtml(t("title"))}</div>
@@ -727,9 +705,13 @@ ${indentCSS}
${quotation.project_code ? `<div class="project-code">${escapeHtml(quotation.project_code)}</div>` : ""} ${quotation.project_code ? `<div class="project-code">${escapeHtml(quotation.project_code)}</div>` : ""}
<div class="valid-until">${escapeHtml(t("valid_until"))}: ${escapeHtml(formatDate(quotation.valid_until))}</div> <div class="valid-until">${escapeHtml(t("valid_until"))}: ${escapeHtml(formatDate(quotation.valid_until))}</div>
</div> </div>
${logoImg ? `<div class="right">${logoImg}</div>` : ""}
</div> </div>
<hr class="separator" /> <hr class="separator" />
</td></tr>
</thead>
<tbody>
<tr><td>
<div class="addresses"> <div class="addresses">
<div class="address-block left"> <div class="address-block left">
<div class="address-label">${escapeHtml(t("customer"))}</div> <div class="address-label">${escapeHtml(t("customer"))}</div>
@@ -763,7 +745,6 @@ ${indentCSS}
${totalsHtml} ${totalsHtml}
</div> </div>
</div> </div>
</div>
</td></tr> </td></tr>
</tbody> </tbody>
</table> </table>