From 23065aa76d99bf4b3f9592269df30c2d1f119a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Thu, 4 Dec 2025 17:01:31 +0100 Subject: [PATCH] Forward text selection callback from editor view to editor --- .../presentation/view/mobile/mobile_editor_view.dart | 3 +++ .../composer/presentation/view/web/web_editor_view.dart | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/features/composer/presentation/view/mobile/mobile_editor_view.dart b/lib/features/composer/presentation/view/mobile/mobile_editor_view.dart index 9d9e00291..032806020 100644 --- a/lib/features/composer/presentation/view/mobile/mobile_editor_view.dart +++ b/lib/features/composer/presentation/view/mobile/mobile_editor_view.dart @@ -19,6 +19,7 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin { final OnCreatedEditorAction onCreatedEditorAction; final OnLoadCompletedEditorAction onLoadCompletedEditorAction; final OnEditorContentHeightChanged? onEditorContentHeightChanged; + final OnTextSelectionChanged? onTextSelectionChanged; const MobileEditorView({ super.key, @@ -27,6 +28,7 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin { this.arguments, this.contentViewState, this.onEditorContentHeightChanged, + this.onTextSelectionChanged, }); @override @@ -147,6 +149,7 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin { onCreatedEditorAction: onCreatedEditorAction, onLoadCompletedEditorAction: onLoadCompletedEditorAction, onEditorContentHeightChanged: onEditorContentHeightChanged, + onTextSelectionChanged: onTextSelectionChanged, ); } } \ No newline at end of file diff --git a/lib/features/composer/presentation/view/web/web_editor_view.dart b/lib/features/composer/presentation/view/web/web_editor_view.dart index f23dcf371..bc93796d6 100644 --- a/lib/features/composer/presentation/view/web/web_editor_view.dart +++ b/lib/features/composer/presentation/view/web/web_editor_view.dart @@ -36,6 +36,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { final OnPasteImageFailureAction? onPasteImageFailureAction; final OnInitialContentLoadComplete? onInitialContentLoadComplete; final OnKeyDownEditorAction? onKeyDownEditorAction; + final OnTextSelectionChanged? onTextSelectionChanged; const WebEditorView({ super.key, @@ -59,6 +60,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { this.onPasteImageFailureAction, this.onInitialContentLoadComplete, this.onKeyDownEditorAction, + this.onTextSelectionChanged, }); @override @@ -91,6 +93,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ); case EmailActionType.editDraft: case EmailActionType.editSendingEmail: @@ -123,6 +126,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ), (success) { if (success is GetEmailContentLoading) { @@ -157,6 +161,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ); } } @@ -197,6 +202,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ); }, (success) { @@ -232,6 +238,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ); } } @@ -257,6 +264,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { onPasteImageFailureAction: onPasteImageFailureAction, onInitialContentLoadComplete: onInitialContentLoadComplete, onKeyDownEditorAction: onKeyDownEditorAction, + onTextSelectionChanged: onTextSelectionChanged, ); } }