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_style.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_bloc/flutter_bloc.dart';
@ -132,6 +133,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
characterShortcutEvents: characterShortcutEvents,
commandShortcutEvents: commandShortcutEvents,
header: widget.header,
footer: const VSpace(200),
);
return Center(
@ -161,7 +163,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
];
final configuration = BlockComponentConfiguration(
padding: (_) => const EdgeInsets.symmetric(vertical: 4.0),
padding: (_) => const EdgeInsets.symmetric(vertical: 5.0),
);
final customBlockComponentBuilderMap = {
PageBlockKeys.type: PageBlockComponentBuilder(),
@ -211,7 +213,10 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
CalloutBlockKeys.type: CalloutBlockComponentBuilder(
configuration: configuration,
),
DividerBlockKeys.type: DividerBlockComponentBuilder(),
DividerBlockKeys.type: DividerBlockComponentBuilder(
configuration: configuration,
height: 28.0,
),
MathEquationBlockKeys.type: MathEquationBlockComponentBuilder(
configuration: configuration.copyWith(
padding: (_) => const EdgeInsets.symmetric(vertical: 20),
@ -277,7 +282,13 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
];
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,
blockComponentState: state,
editorState: widget.editorState,
@ -285,7 +296,9 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
showSlashMenu: () => showSlashMenu(
widget.editorState,
),
);
),
);
};
}
return builders;

View File

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

View File

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

View File

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

View File

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

View File

@ -99,6 +99,7 @@ class ViewSectionItem extends StatelessWidget {
case ViewDisclosureAction.rename:
NavigatorTextFieldDialog(
title: LocaleKeys.disclosureAction_rename.tr(),
autoSelectAllText: true,
value: blocContext.read<ViewBloc>().state.view.name,
confirm: (newValue) {
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';
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 title;
final void Function()? cancel;
final void Function(String) confirm;
const NavigatorTextFieldDialog({
required this.title,
required this.value,
required this.confirm,
this.cancel,
Key? key,
}) : super(key: key);
final bool autoSelectAllText;
@override
State<NavigatorTextFieldDialog> createState() => _CreateTextFieldDialog();
State<NavigatorTextFieldDialog> createState() =>
_NavigatorTextFieldDialogState();
}
class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
class _NavigatorTextFieldDialogState extends State<NavigatorTextFieldDialog> {
String newValue = "";
final controller = TextEditingController();
@override
void initState() {
newValue = widget.value;
controller.text = newValue;
if (widget.autoSelectAllText) {
controller.selection = TextSelection(
baseOffset: 0,
extentOffset: newValue.length,
);
}
super.initState();
}
@ -52,7 +63,7 @@ class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
FlowyFormTextInput(
textAlign: TextAlign.center,
hintText: LocaleKeys.dialogCreatePageNameHint.tr(),
initialValue: widget.value,
controller: controller,
textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: FontSizes.s16,
),

View File

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

View File

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

View File

@ -188,6 +188,7 @@ script = [
"""
cd appflowy_flutter
flutter clean
flutter 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 build_runner build -d
@ -200,6 +201,7 @@ script = [
"""
cd ./appflowy_flutter/
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 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