fix: 0.2.3 known issues (#2886)

* fix: option menu position

* fix: rename helps highlight the text for the user

* fix: export as markdown file name invalid

* chore: align the emoji in callout

* fix: leave more space in the editor

* fix: 0.2.3 known issues

* chore: add flutter pub get in flutter.toml
This commit is contained in:
Lucas.Xu 2023-06-23 10:54:35 +08:00 committed by GitHub
parent eee32110f4
commit d665153a9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 55 additions and 22 deletions

View File

@ -5,6 +5,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/database/r
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart'; import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy/plugins/document/presentation/editor_style.dart'; import 'package:appflowy/plugins/document/presentation/editor_style.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -132,6 +133,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
characterShortcutEvents: characterShortcutEvents, characterShortcutEvents: characterShortcutEvents,
commandShortcutEvents: commandShortcutEvents, commandShortcutEvents: commandShortcutEvents,
header: widget.header, header: widget.header,
footer: const VSpace(200),
); );
return Center( return Center(
@ -161,7 +163,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
]; ];
final configuration = BlockComponentConfiguration( final configuration = BlockComponentConfiguration(
padding: (_) => const EdgeInsets.symmetric(vertical: 4.0), padding: (_) => const EdgeInsets.symmetric(vertical: 5.0),
); );
final customBlockComponentBuilderMap = { final customBlockComponentBuilderMap = {
PageBlockKeys.type: PageBlockComponentBuilder(), PageBlockKeys.type: PageBlockComponentBuilder(),
@ -211,7 +213,10 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
CalloutBlockKeys.type: CalloutBlockComponentBuilder( CalloutBlockKeys.type: CalloutBlockComponentBuilder(
configuration: configuration, configuration: configuration,
), ),
DividerBlockKeys.type: DividerBlockComponentBuilder(), DividerBlockKeys.type: DividerBlockComponentBuilder(
configuration: configuration,
height: 28.0,
),
MathEquationBlockKeys.type: MathEquationBlockComponentBuilder( MathEquationBlockKeys.type: MathEquationBlockComponentBuilder(
configuration: configuration.copyWith( configuration: configuration.copyWith(
padding: (_) => const EdgeInsets.symmetric(vertical: 20), padding: (_) => const EdgeInsets.symmetric(vertical: 20),
@ -277,7 +282,13 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
]; ];
builder.showActions = (_) => true; builder.showActions = (_) => true;
builder.actionBuilder = (context, state) => BlockActionList( builder.actionBuilder = (context, state) {
final padding = context.node.type == HeadingBlockKeys.type
? const EdgeInsets.only(top: 8.0)
: const EdgeInsets.all(0);
return Padding(
padding: padding,
child: BlockActionList(
blockComponentContext: context, blockComponentContext: context,
blockComponentState: state, blockComponentState: state,
editorState: widget.editorState, editorState: widget.editorState,
@ -285,7 +296,9 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
showSlashMenu: () => showSlashMenu( showSlashMenu: () => showSlashMenu(
widget.editorState, widget.editorState,
), ),
),
); );
};
} }
return builders; return builders;

View File

@ -31,14 +31,14 @@ class BlockActionList extends StatelessWidget {
editorState: editorState, editorState: editorState,
showSlashMenu: showSlashMenu, showSlashMenu: showSlashMenu,
), ),
const SizedBox(width: 8.0), const SizedBox(width: 4.0),
BlockOptionButton( BlockOptionButton(
blockComponentContext: blockComponentContext, blockComponentContext: blockComponentContext,
blockComponentState: blockComponentState, blockComponentState: blockComponentState,
actions: actions, actions: actions,
editorState: editorState, editorState: editorState,
), ),
const SizedBox(width: 6.0), const SizedBox(width: 4.0),
], ],
); );
} }

View File

@ -150,7 +150,11 @@ class _CalloutBlockComponentWidgetState
children: [ children: [
// the emoji picker button for the note // the emoji picker button for the note
Padding( Padding(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.only(
top: 6.0,
left: 2.0,
right: 2.0,
),
child: EmojiPickerButton( child: EmojiPickerButton(
key: ValueKey( key: ValueKey(
emoji.toString(), emoji.toString(),

View File

@ -118,7 +118,8 @@ class ShareActionListState extends State<ShareActionList> {
case ShareAction.markdown: case ShareAction.markdown:
final exportPath = await getIt<FilePickerService>().saveFile( final exportPath = await getIt<FilePickerService>().saveFile(
dialogTitle: '', dialogTitle: '',
fileName: '$name.md', // encode the file name in case it contains special characters
fileName: '${Uri.encodeComponent(name)}.md',
); );
if (exportPath != null) { if (exportPath != null) {
docShareBloc.add(DocShareEvent.shareMarkdown(exportPath)); docShareBloc.add(DocShareEvent.shareMarkdown(exportPath));

View File

@ -87,6 +87,7 @@ class MenuAppHeader extends StatelessWidget {
case AppDisclosureAction.rename: case AppDisclosureAction.rename:
NavigatorTextFieldDialog( NavigatorTextFieldDialog(
title: LocaleKeys.menuAppHeader_renameDialog.tr(), title: LocaleKeys.menuAppHeader_renameDialog.tr(),
autoSelectAllText: true,
value: context.read<AppBloc>().state.view.name, value: context.read<AppBloc>().state.view.name,
confirm: (newValue) { confirm: (newValue) {
context.read<AppBloc>().add(AppEvent.rename(newValue)); context.read<AppBloc>().add(AppEvent.rename(newValue));

View File

@ -99,6 +99,7 @@ class ViewSectionItem extends StatelessWidget {
case ViewDisclosureAction.rename: case ViewDisclosureAction.rename:
NavigatorTextFieldDialog( NavigatorTextFieldDialog(
title: LocaleKeys.disclosureAction_rename.tr(), title: LocaleKeys.disclosureAction_rename.tr(),
autoSelectAllText: true,
value: blocContext.read<ViewBloc>().state.view.name, value: blocContext.read<ViewBloc>().state.view.name,
confirm: (newValue) { confirm: (newValue) {
blocContext blocContext

View File

@ -12,29 +12,40 @@ export 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
class NavigatorTextFieldDialog extends StatefulWidget { class NavigatorTextFieldDialog extends StatefulWidget {
const NavigatorTextFieldDialog({
super.key,
required this.title,
this.autoSelectAllText = false,
required this.value,
required this.confirm,
this.cancel,
});
final String value; final String value;
final String title; final String title;
final void Function()? cancel; final void Function()? cancel;
final void Function(String) confirm; final void Function(String) confirm;
final bool autoSelectAllText;
const NavigatorTextFieldDialog({
required this.title,
required this.value,
required this.confirm,
this.cancel,
Key? key,
}) : super(key: key);
@override @override
State<NavigatorTextFieldDialog> createState() => _CreateTextFieldDialog(); State<NavigatorTextFieldDialog> createState() =>
_NavigatorTextFieldDialogState();
} }
class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> { class _NavigatorTextFieldDialogState extends State<NavigatorTextFieldDialog> {
String newValue = ""; String newValue = "";
final controller = TextEditingController();
@override @override
void initState() { void initState() {
newValue = widget.value; newValue = widget.value;
controller.text = newValue;
if (widget.autoSelectAllText) {
controller.selection = TextSelection(
baseOffset: 0,
extentOffset: newValue.length,
);
}
super.initState(); super.initState();
} }
@ -52,7 +63,7 @@ class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
FlowyFormTextInput( FlowyFormTextInput(
textAlign: TextAlign.center, textAlign: TextAlign.center,
hintText: LocaleKeys.dialogCreatePageNameHint.tr(), hintText: LocaleKeys.dialogCreatePageNameHint.tr(),
initialValue: widget.value, controller: controller,
textStyle: Theme.of(context).textTheme.bodySmall?.copyWith( textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: FontSizes.s16, fontSize: FontSizes.s16,
), ),

View File

@ -53,8 +53,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "4f83b6f" ref: cd0f67a
resolved-ref: "4f83b6feb92963f104f3f1f77a473a06aa4870f5" resolved-ref: cd0f67a48e40188114800fae9a0f59cafe15b0f2
url: "https://github.com/AppFlowy-IO/appflowy-editor.git" url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git source: git
version: "1.0.4" version: "1.0.4"

View File

@ -46,7 +46,7 @@ dependencies:
appflowy_editor: appflowy_editor:
git: git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git url: https://github.com/AppFlowy-IO/appflowy-editor.git
ref: 4f83b6f ref: cd0f67a
appflowy_popover: appflowy_popover:
path: packages/appflowy_popover path: packages/appflowy_popover

View File

@ -188,6 +188,7 @@ script = [
""" """
cd appflowy_flutter cd appflowy_flutter
flutter clean flutter clean
flutter pub get
flutter packages pub get flutter packages pub get
dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
dart run build_runner build -d dart run build_runner build -d
@ -200,6 +201,7 @@ script = [
""" """
cd ./appflowy_flutter/ cd ./appflowy_flutter/
exec cmd.exe /c flutter clean exec cmd.exe /c flutter clean
exec cmd.exe /c flutter pub get
exec cmd.exe /c flutter packages pub get exec cmd.exe /c flutter packages pub get
exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c dart run build_runner build -d exec cmd.exe /c dart run build_runner build -d