TF-2116 Support expanded/collapsed for Signature in composer

(cherry picked from commit 3ff79dcc8b43b9ae9af0c9b8f5133b5bfd210d18)
This commit is contained in:
dab246
2023-09-08 03:28:14 +07:00
committed by Dat H. Pham
parent 27b5342132
commit d0744e7560
4 changed files with 83 additions and 51 deletions
@@ -134,6 +134,42 @@ class HtmlUtils {
div.tmail-signature {
text-align: left;
margin: 16px 0px 16px 0px;
}
.tmail-signature-button,
.tmail-signature-button * {
box-sizing: border-box;
}
.tmail-signature-button {
padding: 6px 40px 6px 16px;
border-radius: 4px;
color: #fff;
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.0003 11.8319L5.53383 8.1098C5.18027 7.81516 4.6548 7.86293 4.36016 8.21649C4.06553 8.57006 4.1133 9.09553 4.46686 9.39016L9.46686 13.5568C9.7759 13.8144 10.2248 13.8144 10.5338 13.5568L15.5338 9.39016C15.8874 9.09553 15.9352 8.57006 15.6405 8.21649C15.3459 7.86293 14.8204 7.81516 14.4669 8.1098L10.0003 11.8319Z' fill='%23AEAEC0'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-position: right 16px center;
background-color: #FFFFFF;
border-radius: 36px;
border-style: solid;
border-color: var(--m-3-syslight-outline-shadow-outline-variant, #cac4d0);
border-width: 0.5px;
flex-direction: row;
gap: 8px;
align-items: center;
justify-content: flex-start;
flex-shrink: 0;
position: relative;
cursor: pointer;
color: var(--m-3-syslight-tetirary-tertiary, #8c9caf);
text-align: left;
font: var(--m-3-body-large-2, 400 17px/24px "Inter", sans-serif);
}
.tmail-signature-content {
padding: 12px;
display: none;
overflow: hidden;
}
</style>
''';
@@ -145,6 +181,42 @@ class HtmlUtils {
div.tmail-signature {
text-align: left;
margin: 16px 0px 16px 0px;
}
.tmail-signature-button,
.tmail-signature-button * {
box-sizing: border-box;
}
.tmail-signature-button {
padding: 6px 40px 6px 16px;
border-radius: 4px;
color: #fff;
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.0003 11.8319L5.53383 8.1098C5.18027 7.81516 4.6548 7.86293 4.36016 8.21649C4.06553 8.57006 4.1133 9.09553 4.46686 9.39016L9.46686 13.5568C9.7759 13.8144 10.2248 13.8144 10.5338 13.5568L15.5338 9.39016C15.8874 9.09553 15.9352 8.57006 15.6405 8.21649C15.3459 7.86293 14.8204 7.81516 14.4669 8.1098L10.0003 11.8319Z' fill='%23AEAEC0'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-position: right 16px center;
background-color: #FFFFFF;
border-radius: 36px;
border-style: solid;
border-color: var(--m-3-syslight-outline-shadow-outline-variant, #cac4d0);
border-width: 0.5px;
flex-direction: row;
gap: 8px;
align-items: center;
justify-content: flex-start;
flex-shrink: 0;
position: relative;
cursor: pointer;
color: var(--m-3-syslight-tetirary-tertiary, #8c9caf);
text-align: left;
font: var(--m-3-body-large-2, 400 17px/24px "Inter", sans-serif);
}
.tmail-signature-content {
padding: 12px;
display: none;
overflow: hidden;
}
''';
} else {
@@ -1,45 +0,0 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tmail_ui_user/features/composer/domain/state/download_image_as_base64_state.dart';
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
import 'package:tmail_ui_user/features/upload/domain/state/attachment_upload_state.dart';
mixin ComposerLoadingMixin {
Widget _loadingWidgetWithSizeColor({double? size, Color? color}) {
return Center(child: Container(
margin: const EdgeInsets.all(10),
width: size ?? 24,
height: size ?? 24,
child: CircularProgressIndicator(color: color ?? AppColor.primaryColor)));
}
Widget buildInlineLoadingView(ComposerController controller) {
return Obx(() => controller.uploadController.uploadInlineViewState.value.fold(
(failure) {
return controller.viewState.value.fold(
(failure) => const SizedBox.shrink(),
(success) {
if (success is DownloadingImageAsBase64) {
return _loadingWidgetWithSizeColor();
}
return const SizedBox.shrink();
});
},
(success) {
if (success is UploadingAttachmentUploadState) {
return _loadingWidgetWithSizeColor();
}
return controller.viewState.value.fold(
(failure) => const SizedBox.shrink(),
(success) {
if (success is DownloadingImageAsBase64) {
return _loadingWidgetWithSizeColor();
}
return const SizedBox.shrink();
});
}));
}
}
+5 -5
View File
@@ -369,11 +369,11 @@ packages:
source: hosted
version: "2.0.0"
enough_html_editor:
dependency: transitive
dependency: "direct overridden"
description:
path: "."
ref: email_supported
resolved-ref: ed465d707389bbb959ce2898b899fabb9e9608ed
ref: "improvement/support-expanded-collapsed-signature"
resolved-ref: f69ea3c0d84c32fe291b1b6092a30af1544a3038
url: "https://github.com/linagora/enough_html_editor.git"
source: git
version: "0.0.5"
@@ -913,8 +913,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: email_supported
resolved-ref: "11cf3928c18a43ad29f6dfb3d3b0a712a41ec816"
ref: "improvement/support-expanded-collapsed-signature"
resolved-ref: "96ae5c4ce7c2f5b84bd481df3aa02b38ac527a1d"
url: "https://github.com/linagora/html-editor-enhanced.git"
source: git
version: "2.5.1"
+6 -1
View File
@@ -54,7 +54,7 @@ dependencies:
html_editor_enhanced:
git:
url: https://github.com/linagora/html-editor-enhanced.git
ref: email_supported
ref: improvement/support-expanded-collapsed-signature
jmap_dart_client:
git:
@@ -232,6 +232,11 @@ dependency_overrides:
pointer_interceptor: 0.9.1
enough_html_editor:
git:
url: https://github.com/linagora/enough_html_editor.git
ref: improvement/support-expanded-collapsed-signature
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec