TF-3264 Fix composer drag drop all modes (#3279)
This commit is contained in:
@@ -237,6 +237,7 @@ class ComposerController extends BaseController
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
if (PlatformInfo.isWeb) {
|
if (PlatformInfo.isWeb) {
|
||||||
|
responsiveContainerKey = GlobalKey();
|
||||||
richTextWebController = getBinding<RichTextWebController>();
|
richTextWebController = getBinding<RichTextWebController>();
|
||||||
responsiveContainerKey = GlobalKey();
|
responsiveContainerKey = GlobalKey();
|
||||||
menuMoreOptionController = CustomPopupMenuController();
|
menuMoreOptionController = CustomPopupMenuController();
|
||||||
@@ -286,6 +287,7 @@ class ComposerController extends BaseController
|
|||||||
richTextMobileTabletController = null;
|
richTextMobileTabletController = null;
|
||||||
}
|
}
|
||||||
_identityContentOnOpenPolicy = SignatureStatus.editedAvailable;
|
_identityContentOnOpenPolicy = SignatureStatus.editedAvailable;
|
||||||
|
responsiveContainerKey = null;
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2246,6 +2248,12 @@ class ComposerController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handleOnDragOverHtmlEditorWeb(List<dynamic>? types) {
|
||||||
|
if (types.validateFilesTransfer) {
|
||||||
|
mailboxDashBoardController.localFileDraggableAppState.value = DraggableAppState.active;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void onLocalFileDropZoneListener({
|
void onLocalFileDropZoneListener({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required DropDoneDetails details,
|
required DropDoneDetails details,
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
||||||
height: constraints.maxHeight,
|
height: constraints.maxHeight,
|
||||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||||
|
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||||
context: context,
|
context: context,
|
||||||
maxWidth: constraintsEditor.maxWidth,
|
maxWidth: constraintsEditor.maxWidth,
|
||||||
@@ -460,6 +461,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
onEditorTextSizeChanged: controller.richTextWebController?.onEditorTextSizeChanged,
|
onEditorTextSizeChanged: controller.richTextWebController?.onEditorTextSizeChanged,
|
||||||
height: constraints.maxHeight,
|
height: constraints.maxHeight,
|
||||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||||
|
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||||
context: context,
|
context: context,
|
||||||
maxWidth: constraintsEditor.maxWidth,
|
maxWidth: constraintsEditor.maxWidth,
|
||||||
@@ -744,6 +746,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
||||||
height: constraints.maxHeight,
|
height: constraints.maxHeight,
|
||||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||||
|
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||||
context: context,
|
context: context,
|
||||||
maxWidth: constraintsBody.maxWidth,
|
maxWidth: constraintsBody.maxWidth,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
||||||
final double? height;
|
final double? height;
|
||||||
final OnDragEnterListener? onDragEnter;
|
final OnDragEnterListener? onDragEnter;
|
||||||
|
final OnDragOverListener? onDragOver;
|
||||||
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
||||||
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
||||||
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
||||||
@@ -50,6 +51,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
this.onEditorTextSizeChanged,
|
this.onEditorTextSizeChanged,
|
||||||
this.height,
|
this.height,
|
||||||
this.onDragEnter,
|
this.onDragEnter,
|
||||||
|
this.onDragOver,
|
||||||
this.onPasteImageSuccessAction,
|
this.onPasteImageSuccessAction,
|
||||||
this.onPasteImageFailureAction,
|
this.onPasteImageFailureAction,
|
||||||
this.onInitialContentLoadComplete,
|
this.onInitialContentLoadComplete,
|
||||||
@@ -78,6 +80,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
@@ -106,6 +109,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
@@ -133,6 +137,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
@@ -169,6 +174,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
@@ -200,6 +206,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
@@ -221,6 +228,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
|||||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||||
height: height,
|
height: height,
|
||||||
onDragEnter: onDragEnter,
|
onDragEnter: onDragEnter,
|
||||||
|
onDragOver: onDragOver,
|
||||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ typedef OnMouseDownEditorAction = Function();
|
|||||||
typedef OnEditorSettingsChange = Function(EditorSettings settings);
|
typedef OnEditorSettingsChange = Function(EditorSettings settings);
|
||||||
typedef OnEditorTextSizeChanged = Function(int? size);
|
typedef OnEditorTextSizeChanged = Function(int? size);
|
||||||
typedef OnDragEnterListener = Function(List<dynamic>? types);
|
typedef OnDragEnterListener = Function(List<dynamic>? types);
|
||||||
|
typedef OnDragOverListener = Function(List<dynamic>? types);
|
||||||
typedef OnPasteImageSuccessAction = Function(List<FileUpload> listFileUpload);
|
typedef OnPasteImageSuccessAction = Function(List<FileUpload> listFileUpload);
|
||||||
typedef OnPasteImageFailureAction = Function(
|
typedef OnPasteImageFailureAction = Function(
|
||||||
List<FileUpload>? listFileUpload,
|
List<FileUpload>? listFileUpload,
|
||||||
@@ -34,6 +35,7 @@ class WebEditorWidget extends StatefulWidget {
|
|||||||
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
||||||
final double? height;
|
final double? height;
|
||||||
final OnDragEnterListener? onDragEnter;
|
final OnDragEnterListener? onDragEnter;
|
||||||
|
final OnDragOverListener? onDragOver;
|
||||||
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
||||||
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
||||||
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
||||||
@@ -52,6 +54,7 @@ class WebEditorWidget extends StatefulWidget {
|
|||||||
this.onEditorTextSizeChanged,
|
this.onEditorTextSizeChanged,
|
||||||
this.height,
|
this.height,
|
||||||
this.onDragEnter,
|
this.onDragEnter,
|
||||||
|
this.onDragOver,
|
||||||
this.onPasteImageSuccessAction,
|
this.onPasteImageSuccessAction,
|
||||||
this.onPasteImageFailureAction,
|
this.onPasteImageFailureAction,
|
||||||
this.onInitialContentLoadComplete,
|
this.onInitialContentLoadComplete,
|
||||||
@@ -160,6 +163,7 @@ class _WebEditorState extends State<WebEditorWidget> {
|
|||||||
HtmlUtils.lineHeight100Percent.name
|
HtmlUtils.lineHeight100Percent.name
|
||||||
),
|
),
|
||||||
onDragEnter: widget.onDragEnter,
|
onDragEnter: widget.onDragEnter,
|
||||||
|
onDragOver: widget.onDragOver,
|
||||||
onDragLeave: (_) {},
|
onDragLeave: (_) {},
|
||||||
onImageUpload: widget.onPasteImageSuccessAction,
|
onImageUpload: widget.onPasteImageSuccessAction,
|
||||||
onImageUploadError: widget.onPasteImageFailureAction,
|
onImageUploadError: widget.onPasteImageFailureAction,
|
||||||
|
|||||||
Reference in New Issue
Block a user