mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-11-03 03:24:08 +00:00
fix: ai writer not working in database rows (#7746)
* fix: ai writer not working in database rows * chore: dart analysis
This commit is contained in:
parent
03ecc3d6c9
commit
d01909830d
@ -5,6 +5,7 @@ import 'package:appflowy/plugins/document/application/document_bloc.dart';
|
|||||||
import 'package:appflowy/plugins/document/presentation/editor_drop_handler.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_drop_handler.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_drop_manager.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_drop_manager.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_page.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_page.dart';
|
||||||
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/ai/widgets/ai_writer_scroll_wrapper.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/shared_context/shared_context.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/shared_context/shared_context.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/transaction_handler/editor_transaction_service.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/transaction_handler/editor_transaction_service.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
||||||
@ -120,29 +121,34 @@ class _RowEditor extends StatelessWidget {
|
|||||||
return context;
|
return context;
|
||||||
},
|
},
|
||||||
dispose: (_, editorContext) => editorContext.dispose(),
|
dispose: (_, editorContext) => editorContext.dispose(),
|
||||||
child: EditorDropHandler(
|
child: AiWriterScrollWrapper(
|
||||||
viewId: view.id,
|
viewId: view.id,
|
||||||
editorState: editorState,
|
editorState: editorState,
|
||||||
isLocalMode: context.read<DocumentBloc>().isLocalMode,
|
child: EditorDropHandler(
|
||||||
dropManagerState: context.read<EditorDropManagerState>(),
|
|
||||||
child: EditorTransactionService(
|
|
||||||
viewId: view.id,
|
viewId: view.id,
|
||||||
editorState: editorState,
|
editorState: editorState,
|
||||||
child: Provider(
|
isLocalMode: context.read<DocumentBloc>().isLocalMode,
|
||||||
create: (context) =>
|
dropManagerState: context.read<EditorDropManagerState>(),
|
||||||
DatabasePluginWidgetBuilderSize(horizontalPadding: 0),
|
child: EditorTransactionService(
|
||||||
child: AppFlowyEditorPage(
|
viewId: view.id,
|
||||||
shrinkWrap: true,
|
editorState: editorState,
|
||||||
autoFocus: false,
|
child: Provider(
|
||||||
editorState: editorState,
|
create: (context) => DatabasePluginWidgetBuilderSize(
|
||||||
styleCustomizer: EditorStyleCustomizer(
|
horizontalPadding: 0,
|
||||||
context: context,
|
),
|
||||||
padding: const EdgeInsets.only(left: 16, right: 54),
|
child: AppFlowyEditorPage(
|
||||||
|
shrinkWrap: true,
|
||||||
|
autoFocus: false,
|
||||||
|
editorState: editorState,
|
||||||
|
styleCustomizer: EditorStyleCustomizer(
|
||||||
|
context: context,
|
||||||
|
padding: const EdgeInsets.only(left: 16, right: 54),
|
||||||
|
),
|
||||||
|
showParagraphPlaceholder: (editorState, _) =>
|
||||||
|
editorState.document.isEmpty,
|
||||||
|
placeholderText: (_) =>
|
||||||
|
LocaleKeys.cardDetails_notesPlaceholder.tr(),
|
||||||
),
|
),
|
||||||
showParagraphPlaceholder: (editorState, _) =>
|
|
||||||
editorState.document.isEmpty,
|
|
||||||
placeholderText: (_) =>
|
|
||||||
LocaleKeys.cardDetails_notesPlaceholder.tr(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import 'package:appflowy/plugins/document/presentation/banner.dart';
|
|||||||
import 'package:appflowy/plugins/document/presentation/editor_drop_handler.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_drop_handler.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_notification.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_notification.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_page.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_page.dart';
|
||||||
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/ai/widgets/ai_writer_scroll_wrapper.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/transaction_handler/editor_transaction_service.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/transaction_handler/editor_transaction_service.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
||||||
import 'package:appflowy/shared/flowy_error_page.dart';
|
import 'package:appflowy/shared/flowy_error_page.dart';
|
||||||
@ -104,7 +105,11 @@ class _DatabaseDocumentPageState extends State<DatabaseDocumentPage> {
|
|||||||
return BlocListener<ActionNavigationBloc, ActionNavigationState>(
|
return BlocListener<ActionNavigationBloc, ActionNavigationState>(
|
||||||
listener: _onNotificationAction,
|
listener: _onNotificationAction,
|
||||||
listenWhen: (_, curr) => curr.action != null,
|
listenWhen: (_, curr) => curr.action != null,
|
||||||
child: _buildEditorPage(context, state),
|
child: AiWriterScrollWrapper(
|
||||||
|
viewId: widget.view.id,
|
||||||
|
editorState: editorState,
|
||||||
|
child: _buildEditorPage(context, state),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user