mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
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:
parent
eee32110f4
commit
d665153a9f
@ -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;
|
||||
|
@ -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),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -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(),
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
),
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user