TF-3944 Use new style with line height 24px in content writing of composer view

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-08-21 10:19:57 +07:00
committed by Dat H. Pham
parent 575abd235f
commit 346b115169
6 changed files with 26 additions and 8 deletions
@@ -14,7 +14,7 @@ class HideDraftSignatureTransformer extends DomTransformer {
Map<String, String>? mapUrlDownloadCID
}) async {
try {
final signature = document.querySelector('div.tmail-signature');
final signature = document.querySelector('.tmail-signature');
if (signature == null) return;
final currentStyle = signature.attributes['style']?.trim();
if (currentStyle == null) {
@@ -15,7 +15,7 @@ class SignatureTransformer extends DomTransformer {
Map<String, String>? mapUrlDownloadCID,
}) async {
try {
final signatureElements = document.querySelectorAll('div.tmail-signature');
final signatureElements = document.querySelectorAll('.tmail-signature');
if (signatureElements.isEmpty) return;
+21 -4
View File
@@ -25,8 +25,10 @@ class HtmlTemplate {
static const String printDocumentCssStyle = '''
<style>
$fontFaceStyle
body,td,div,p,a,input {
font-family: arial, sans-serif;
font-family: 'Inter', sans-serif;
}
body, td {
@@ -102,12 +104,27 @@ class HtmlTemplate {
''';
static const String defaultFontStyle = '''
body {
div, p, span, th, td, tr, ul, ol, li, a, button {
font-weight: 400;
font-size: 16px;
line-height: 24px;
letter-spacing: -0.01em; /* -1% */
}
p {
margin: 0px;
}
''';
static const String defaultEditorFontStyle = '''
#editor, .note-editable, .note-frame {
font-size: 16px;
color: #222222;
}
p {
margin: 0px;
}
''';
static const String previewEMLFileCssStyle = '''
@@ -271,7 +288,7 @@ class HtmlTemplate {
<style>
${HtmlTemplate.fontFaceStyle}
${useDefaultFontStyle ? HtmlTemplate.defaultFontStyle : ''}
${useDefaultFontStyle ? HtmlTemplate.defaultEditorFontStyle : ''}
${customScrollbar ? '''
html, .note-editable, .note-codable {
@@ -311,7 +328,7 @@ class HtmlTemplate {
}) => '''
${HtmlTemplate.fontFaceStyle}
${useDefaultFontStyle ? HtmlTemplate.defaultFontStyle : ''}
${useDefaultFontStyle ? HtmlTemplate.defaultEditorFontStyle : ''}
#editor {
direction: ${direction.name};
+1
View File
@@ -49,6 +49,7 @@ class HtmlUtils {
<style>
.note-frame, .note-tooltip-content, .note-popover {
font-family: 'Inter', sans-serif;
color: #222222;
}
.note-editable {
@@ -13,7 +13,7 @@ extension SanitizeSignatureInEmailContentExtension on ComposerController {
final existedSignatureButton = emailDocument.querySelector('.tmail-signature-button');
if (existedSignatureButton != null) return;
final signature = emailDocument.querySelector('div.tmail-signature');
final signature = emailDocument.querySelector('.tmail-signature');
if (signature == null) return;
restoringSignatureButton = true;
@@ -192,7 +192,7 @@ class HtmlAnalyzer {
Future<String> removeCollapsedExpandedSignatureEffect({required String emailContent}) async {
try {
final document = parse(emailContent);
final signatureElements = document.querySelectorAll('div.tmail-signature');
final signatureElements = document.querySelectorAll('.tmail-signature');
await Future.wait(signatureElements.map((signatureTag) async {
final signatureChildren = signatureTag.children;
for (var child in signatureChildren) {