mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-06-30 02:33:03 -04:00
feat: observe mention block change and support block navigation (#6568)
* feat: observe mentioned block changes and navigate to block * test: add delete mentioned block test * chore: update editor version * feat: navigate block in same page * fix: sometimes turn into menu doesn't work * test: add test * fix: integration test
This commit is contained in:
parent
7cad04bbf4
commit
0413100e2b
14 changed files with 296 additions and 34 deletions
|
@ -51,6 +51,7 @@ class DocumentPlugin extends Plugin {
|
|||
required ViewPB view,
|
||||
required PluginType pluginType,
|
||||
this.initialSelection,
|
||||
this.initialBlockId,
|
||||
}) : notifier = ViewPluginNotifier(view: view) {
|
||||
_pluginType = pluginType;
|
||||
}
|
||||
|
@ -61,13 +62,18 @@ class DocumentPlugin extends Plugin {
|
|||
@override
|
||||
final ViewPluginNotifier notifier;
|
||||
|
||||
// the initial selection of the document
|
||||
final Selection? initialSelection;
|
||||
|
||||
// the initial block id of the document
|
||||
final String? initialBlockId;
|
||||
|
||||
@override
|
||||
PluginWidgetBuilder get widgetBuilder => DocumentPluginWidgetBuilder(
|
||||
bloc: _viewInfoBloc,
|
||||
notifier: notifier,
|
||||
initialSelection: initialSelection,
|
||||
initialBlockId: initialBlockId,
|
||||
);
|
||||
|
||||
@override
|
||||
|
@ -95,6 +101,7 @@ class DocumentPluginWidgetBuilder extends PluginWidgetBuilder
|
|||
required this.bloc,
|
||||
required this.notifier,
|
||||
this.initialSelection,
|
||||
this.initialBlockId,
|
||||
});
|
||||
|
||||
final ViewInfoBloc bloc;
|
||||
|
@ -102,6 +109,7 @@ class DocumentPluginWidgetBuilder extends PluginWidgetBuilder
|
|||
ViewPB get view => notifier.view;
|
||||
int? deletedViewIndex;
|
||||
final Selection? initialSelection;
|
||||
final String? initialBlockId;
|
||||
|
||||
@override
|
||||
EdgeInsets get contentPadding => EdgeInsets.zero;
|
||||
|
@ -129,6 +137,7 @@ class DocumentPluginWidgetBuilder extends PluginWidgetBuilder
|
|||
view: view,
|
||||
onDeleted: () => context.onDeleted?.call(view, deletedViewIndex),
|
||||
initialSelection: initialSelection,
|
||||
initialBlockId: initialBlockId,
|
||||
fixedTitle: fixedTitle,
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue