mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-09-11 19:17:43 +03:00
fix: migrate OKRs issues (#5215)
* fix: disable color paraser when pasting texts * fix: compile error * fix: register hotkeys in init function * fix: improve settings hotkey * chore: update editor * fix: view title overflow * fix: integration test * chore: improve auto expanding animation * chore: bump version 0.5.6 * chore: enable collab workspace --------- Co-authored-by: Mathias Mogensen <mathias@appflowy.io>
This commit is contained in:
parent
119fb03342
commit
3fce5eebf8
@ -26,7 +26,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
|||||||
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
|
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
|
||||||
CARGO_MAKE_CRATE_NAME = "dart-ffi"
|
CARGO_MAKE_CRATE_NAME = "dart-ffi"
|
||||||
LIB_NAME = "dart_ffi"
|
LIB_NAME = "dart_ffi"
|
||||||
APPFLOWY_VERSION = "0.5.5"
|
APPFLOWY_VERSION = "0.5.6"
|
||||||
FLUTTER_DESKTOP_FEATURES = "dart"
|
FLUTTER_DESKTOP_FEATURES = "dart"
|
||||||
PRODUCT_NAME = "AppFlowy"
|
PRODUCT_NAME = "AppFlowy"
|
||||||
MACOSX_DEPLOYMENT_TARGET = "11.0"
|
MACOSX_DEPLOYMENT_TARGET = "11.0"
|
||||||
|
@ -106,58 +106,13 @@ void main() {
|
|||||||
expect(node2.type, ParagraphBlockKeys.type);
|
expect(node2.type, ParagraphBlockKeys.type);
|
||||||
expect(node3.type, ParagraphBlockKeys.type);
|
expect(node3.type, ParagraphBlockKeys.type);
|
||||||
expect(node1.delta!.toJson(), [
|
expect(node1.delta!.toJson(), [
|
||||||
{
|
{'insert': 'void main() {'},
|
||||||
"insert": "void",
|
|
||||||
"attributes": {"font_color": "0xfffede5d"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": " ",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "main",
|
|
||||||
"attributes": {"font_color": "0xff36f9f6"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "() {",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
}
|
|
||||||
]);
|
]);
|
||||||
expect(node2.delta!.toJson(), [
|
expect(node2.delta!.toJson(), [
|
||||||
{
|
{'insert': " runApp(const MyApp());"},
|
||||||
"insert": " ",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "runApp",
|
|
||||||
"attributes": {"font_color": "0xff36f9f6"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "(",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "const",
|
|
||||||
"attributes": {"font_color": "0xfffede5d"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": " ",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "MyApp",
|
|
||||||
"attributes": {"font_color": "0xfffe4450"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"insert": "());",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
}
|
|
||||||
]);
|
]);
|
||||||
expect(node3.delta!.toJson(), [
|
expect(node3.delta!.toJson(), [
|
||||||
{
|
{"insert": "}"},
|
||||||
"insert": "}",
|
|
||||||
"attributes": {"font_color": "0xffff7edb"},
|
|
||||||
}
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
|
import 'package:appflowy/plugins/document/presentation/editor_page.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/actions/mobile_block_action_buttons.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/actions/mobile_block_action_buttons.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/code_block/code_block_copy_button.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/code_block/code_block_copy_button.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/custom_image_block_component.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/custom_image_block_component.dart';
|
||||||
@ -11,6 +9,8 @@ import 'package:appflowy_editor/appflowy_editor.dart';
|
|||||||
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
|
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart' hide TextDirection;
|
import 'package:easy_localization/easy_localization.dart' hide TextDirection;
|
||||||
import 'package:flowy_infra/theme_extension.dart';
|
import 'package:flowy_infra/theme_extension.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
Map<String, BlockComponentBuilder> getEditorBuilderMap({
|
Map<String, BlockComponentBuilder> getEditorBuilderMap({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
@ -104,6 +104,16 @@ Map<String, BlockComponentBuilder> getEditorBuilderMap({
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TableCellBlockKeys.type: TableCellBlockComponentBuilder(
|
TableCellBlockKeys.type: TableCellBlockComponentBuilder(
|
||||||
|
colorBuilder: (context, node) {
|
||||||
|
final String colorString =
|
||||||
|
node.attributes[TableCellBlockKeys.colBackgroundColor] ??
|
||||||
|
node.attributes[TableCellBlockKeys.rowBackgroundColor] ??
|
||||||
|
'';
|
||||||
|
if (colorString.isEmpty) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return buildEditorCustomizedColor(context, node, colorString);
|
||||||
|
},
|
||||||
menuBuilder: (node, editorState, position, dir, onBuild, onClose) =>
|
menuBuilder: (node, editorState, position, dir, onBuild, onClose) =>
|
||||||
TableMenu(
|
TableMenu(
|
||||||
node: node,
|
node: node,
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
import 'package:appflowy/plugins/document/application/document_bloc.dart';
|
import 'package:appflowy/plugins/document/application/document_bloc.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_configuration.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_configuration.dart';
|
||||||
@ -29,6 +26,8 @@ import 'package:collection/collection.dart';
|
|||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flowy_infra/theme_extension.dart';
|
import 'package:flowy_infra/theme_extension.dart';
|
||||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
final codeBlockLocalization = CodeBlockLocalizations(
|
final codeBlockLocalization = CodeBlockLocalizations(
|
||||||
@ -229,6 +228,8 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
|
|||||||
convertibleBlockTypes.add(ToggleListBlockKeys.type);
|
convertibleBlockTypes.add(ToggleListBlockKeys.type);
|
||||||
slashMenuItems = _customSlashMenuItems();
|
slashMenuItems = _customSlashMenuItems();
|
||||||
effectiveScrollController = widget.scrollController ?? ScrollController();
|
effectiveScrollController = widget.scrollController ?? ScrollController();
|
||||||
|
// disable the color parse in the HTML decoder.
|
||||||
|
DocumentHTMLDecoder.enableColorParse = false;
|
||||||
|
|
||||||
editorScrollController = EditorScrollController(
|
editorScrollController = EditorScrollController(
|
||||||
editorState: widget.editorState,
|
editorState: widget.editorState,
|
||||||
@ -455,33 +456,12 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _customizeBlockComponentBackgroundColorDecorator() {
|
void _customizeBlockComponentBackgroundColorDecorator() {
|
||||||
blockComponentBackgroundColorDecorator = (Node node, String colorString) {
|
blockComponentBackgroundColorDecorator =
|
||||||
// the color string is from FlowyTint.
|
(Node node, String colorString) => buildEditorCustomizedColor(
|
||||||
final tintColor = FlowyTint.values.firstWhereOrNull(
|
context,
|
||||||
(e) => e.id == colorString,
|
node,
|
||||||
);
|
colorString,
|
||||||
if (tintColor != null) {
|
);
|
||||||
return tintColor.color(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
final themeColor = themeBackgroundColors[colorString];
|
|
||||||
if (themeColor != null) {
|
|
||||||
return themeColor.color(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colorString == optionActionColorDefaultColor) {
|
|
||||||
final defaultColor = node.type == CalloutBlockKeys.type
|
|
||||||
? AFThemeExtension.of(context).calloutBGColor
|
|
||||||
: Colors.transparent;
|
|
||||||
return defaultColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colorString == tableCellDefaultColor) {
|
|
||||||
return AFThemeExtension.of(context).tableCellBGColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initEditorL10n() => AppFlowyEditorL10n.current = EditorI18n();
|
void _initEditorL10n() => AppFlowyEditorL10n.current = EditorI18n();
|
||||||
@ -507,6 +487,38 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color? buildEditorCustomizedColor(
|
||||||
|
BuildContext context,
|
||||||
|
Node node,
|
||||||
|
String colorString,
|
||||||
|
) {
|
||||||
|
// the color string is from FlowyTint.
|
||||||
|
final tintColor = FlowyTint.values.firstWhereOrNull(
|
||||||
|
(e) => e.id == colorString,
|
||||||
|
);
|
||||||
|
if (tintColor != null) {
|
||||||
|
return tintColor.color(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
final themeColor = themeBackgroundColors[colorString];
|
||||||
|
if (themeColor != null) {
|
||||||
|
return themeColor.color(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorString == optionActionColorDefaultColor) {
|
||||||
|
final defaultColor = node.type == CalloutBlockKeys.type
|
||||||
|
? AFThemeExtension.of(context).calloutBGColor
|
||||||
|
: Colors.transparent;
|
||||||
|
return defaultColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorString == tableCellDefaultColor) {
|
||||||
|
return AFThemeExtension.of(context).tableCellBGColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
bool showInAnyTextType(EditorState editorState) {
|
bool showInAnyTextType(EditorState editorState) {
|
||||||
final selection = editorState.selection;
|
final selection = editorState.selection;
|
||||||
if (selection == null) {
|
if (selection == null) {
|
||||||
|
@ -85,9 +85,9 @@ enum FeatureFlag {
|
|||||||
|
|
||||||
bool get isOn {
|
bool get isOn {
|
||||||
if ([
|
if ([
|
||||||
// release this feature in version 0.5.5
|
// release this feature in version 0.5.6
|
||||||
// FeatureFlag.collaborativeWorkspace,
|
FeatureFlag.collaborativeWorkspace,
|
||||||
// FeatureFlag.membersSettings,
|
FeatureFlag.membersSettings,
|
||||||
// release this feature in version 0.5.4
|
// release this feature in version 0.5.4
|
||||||
FeatureFlag.syncDatabase,
|
FeatureFlag.syncDatabase,
|
||||||
FeatureFlag.syncDocument,
|
FeatureFlag.syncDocument,
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:appflowy/plugins/blank/blank.dart';
|
import 'package:appflowy/plugins/blank/blank.dart';
|
||||||
import 'package:appflowy/startup/plugin/plugin.dart';
|
import 'package:appflowy/startup/plugin/plugin.dart';
|
||||||
import 'package:appflowy/startup/startup.dart';
|
import 'package:appflowy/startup/startup.dart';
|
||||||
@ -23,13 +26,12 @@ import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
|
|||||||
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'
|
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'
|
||||||
show UserProfilePB;
|
show UserProfilePB;
|
||||||
import 'package:flowy_infra_ui/style_widget/container.dart';
|
import 'package:flowy_infra_ui/style_widget/container.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:sized_context/sized_context.dart';
|
import 'package:sized_context/sized_context.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
import '../widgets/edit_panel/edit_panel.dart';
|
import '../widgets/edit_panel/edit_panel.dart';
|
||||||
|
|
||||||
import 'home_layout.dart';
|
import 'home_layout.dart';
|
||||||
import 'home_stack.dart';
|
import 'home_stack.dart';
|
||||||
|
|
||||||
@ -87,6 +89,7 @@ class DesktopHomeScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: HomeHotKeys(
|
child: HomeHotKeys(
|
||||||
|
userProfile: userProfile,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
floatingActionButton: enableMemoryLeakDetect
|
floatingActionButton: enableMemoryLeakDetect
|
||||||
? const FloatingActionButton(
|
? const FloatingActionButton(
|
||||||
|
@ -8,6 +8,7 @@ import 'package:appflowy/workspace/application/settings/appearance/appearance_cu
|
|||||||
import 'package:appflowy/workspace/application/sidebar/rename_view/rename_view_bloc.dart';
|
import 'package:appflowy/workspace/application/sidebar/rename_view/rename_view_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
||||||
import 'package:appflowy/workspace/presentation/home/menu/sidebar/sidebar_setting.dart';
|
import 'package:appflowy/workspace/presentation/home/menu/sidebar/sidebar_setting.dart';
|
||||||
|
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pb.dart';
|
||||||
import 'package:hotkey_manager/hotkey_manager.dart';
|
import 'package:hotkey_manager/hotkey_manager.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@ -33,13 +34,22 @@ class HotKeyItem {
|
|||||||
hotKeyManager.register(hotKey, keyDownHandler: keyDownHandler);
|
hotKeyManager.register(hotKey, keyDownHandler: keyDownHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
class HomeHotKeys extends StatelessWidget {
|
class HomeHotKeys extends StatefulWidget {
|
||||||
const HomeHotKeys({required this.child, super.key});
|
const HomeHotKeys({
|
||||||
|
super.key,
|
||||||
|
required this.userProfile,
|
||||||
|
required this.child,
|
||||||
|
});
|
||||||
|
|
||||||
|
final UserProfilePB userProfile;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
State<HomeHotKeys> createState() => _HomeHotKeysState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HomeHotKeysState extends State<HomeHotKeys> {
|
||||||
|
late final items = [
|
||||||
// Collapse sidebar menu
|
// Collapse sidebar menu
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
hotKey: HotKey(
|
hotKey: HotKey(
|
||||||
@ -51,7 +61,7 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
keyDownHandler: (_) => context
|
keyDownHandler: (_) => context
|
||||||
.read<HomeSettingBloc>()
|
.read<HomeSettingBloc>()
|
||||||
.add(const HomeSettingEvent.collapseMenu()),
|
.add(const HomeSettingEvent.collapseMenu()),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
// Toggle theme mode light/dark
|
// Toggle theme mode light/dark
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
@ -65,7 +75,7 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
keyDownHandler: (_) =>
|
keyDownHandler: (_) =>
|
||||||
context.read<AppearanceSettingsCubit>().toggleThemeMode(),
|
context.read<AppearanceSettingsCubit>().toggleThemeMode(),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
// Close current tab
|
// Close current tab
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
@ -76,7 +86,7 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
keyDownHandler: (_) =>
|
keyDownHandler: (_) =>
|
||||||
context.read<TabsBloc>().add(const TabsEvent.closeCurrentTab()),
|
context.read<TabsBloc>().add(const TabsEvent.closeCurrentTab()),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
// Go to previous tab
|
// Go to previous tab
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
@ -86,7 +96,7 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
scope: HotKeyScope.inapp,
|
scope: HotKeyScope.inapp,
|
||||||
),
|
),
|
||||||
keyDownHandler: (_) => _selectTab(context, -1),
|
keyDownHandler: (_) => _selectTab(context, -1),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
// Go to next tab
|
// Go to next tab
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
@ -96,7 +106,7 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
scope: HotKeyScope.inapp,
|
scope: HotKeyScope.inapp,
|
||||||
),
|
),
|
||||||
keyDownHandler: (_) => _selectTab(context, 1),
|
keyDownHandler: (_) => _selectTab(context, 1),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
// Rename current view
|
// Rename current view
|
||||||
HotKeyItem(
|
HotKeyItem(
|
||||||
@ -106,15 +116,33 @@ class HomeHotKeys extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
keyDownHandler: (_) =>
|
keyDownHandler: (_) =>
|
||||||
getIt<RenameViewBloc>().add(const RenameViewEvent.open()),
|
getIt<RenameViewBloc>().add(const RenameViewEvent.open()),
|
||||||
).register();
|
),
|
||||||
|
|
||||||
_asyncRegistration(context);
|
// Open settings dialog
|
||||||
|
openSettingsHotKey(context, widget.userProfile),
|
||||||
|
];
|
||||||
|
|
||||||
return child;
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_registerHotKeys(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _asyncRegistration(BuildContext context) async {
|
@override
|
||||||
(await openSettingsHotKey(context))?.register();
|
void didChangeDependencies() {
|
||||||
|
super.didChangeDependencies();
|
||||||
|
|
||||||
|
_registerHotKeys(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => widget.child;
|
||||||
|
|
||||||
|
void _registerHotKeys(BuildContext context) {
|
||||||
|
for (final element in items) {
|
||||||
|
element.register();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _selectTab(BuildContext context, int change) {
|
void _selectTab(BuildContext context, int change) {
|
||||||
|
@ -91,9 +91,17 @@ class SectionFolder extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.read<TabsBloc>().openPlugin(view);
|
context.read<TabsBloc>().openPlugin(view);
|
||||||
viewContext.read<ViewBloc>().add(
|
|
||||||
const ViewEvent.setIsExpanded(true),
|
// Delay to expand the view to prevent the view from being
|
||||||
);
|
// expanded when the user is trying to open the view in a new tab
|
||||||
|
// This will improve the animation performance
|
||||||
|
Future.delayed(const Duration(milliseconds: 50), () {
|
||||||
|
if (viewContext.mounted) {
|
||||||
|
viewContext
|
||||||
|
.read<ViewBloc>()
|
||||||
|
.add(const ViewEvent.setIsExpanded(true));
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onTertiarySelected: (view, viewContext) =>
|
onTertiarySelected: (view, viewContext) =>
|
||||||
context.read<TabsBloc>().openTab(view),
|
context.read<TabsBloc>().openTab(view),
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart';
|
import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart';
|
||||||
import 'package:appflowy/startup/startup.dart';
|
import 'package:appflowy/startup/startup.dart';
|
||||||
import 'package:appflowy/user/application/auth/auth_service.dart';
|
|
||||||
import 'package:appflowy/workspace/presentation/home/hotkeys.dart';
|
import 'package:appflowy/workspace/presentation/home/hotkeys.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/settings_dialog.dart';
|
import 'package:appflowy/workspace/presentation/settings/settings_dialog.dart';
|
||||||
import 'package:appflowy_backend/log.dart';
|
import 'package:appflowy_backend/log.dart';
|
||||||
@ -11,17 +12,16 @@ import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'
|
|||||||
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
|
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hotkey_manager/hotkey_manager.dart';
|
import 'package:hotkey_manager/hotkey_manager.dart';
|
||||||
|
|
||||||
final GlobalKey _settingsDialogKey = GlobalKey();
|
final GlobalKey _settingsDialogKey = GlobalKey();
|
||||||
|
|
||||||
Future<HotKeyItem?> openSettingsHotKey(BuildContext context) async {
|
HotKeyItem openSettingsHotKey(
|
||||||
final userProfileOrFailure = await getIt<AuthService>().getUser();
|
BuildContext context,
|
||||||
|
UserProfilePB userProfile,
|
||||||
return userProfileOrFailure.fold(
|
) =>
|
||||||
(userProfile) => HotKeyItem(
|
HotKeyItem(
|
||||||
hotKey: HotKey(
|
hotKey: HotKey(
|
||||||
KeyCode.comma,
|
KeyCode.comma,
|
||||||
scope: HotKeyScope.inapp,
|
scope: HotKeyScope.inapp,
|
||||||
@ -37,13 +37,7 @@ Future<HotKeyItem?> openSettingsHotKey(BuildContext context) async {
|
|||||||
.popUntil((route) => route.isFirst);
|
.popUntil((route) => route.isFirst);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
);
|
||||||
(e) {
|
|
||||||
Log.error('Failed to get user $e');
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class UserSettingButton extends StatelessWidget {
|
class UserSettingButton extends StatelessWidget {
|
||||||
const UserSettingButton({required this.userProfile, super.key});
|
const UserSettingButton({required this.userProfile, super.key});
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:appflowy/plugins/base/emoji/emoji_text.dart';
|
import 'package:appflowy/plugins/base/emoji/emoji_text.dart';
|
||||||
import 'package:appflowy/startup/tasks/app_window_size_manager.dart';
|
import 'package:appflowy/startup/tasks/app_window_size_manager.dart';
|
||||||
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
||||||
@ -70,7 +72,7 @@ class _ViewTitleBarState extends State<ViewTitleBar> {
|
|||||||
child: _ViewTitle(
|
child: _ViewTitle(
|
||||||
key: ValueKey(ancestors.last),
|
key: ValueKey(ancestors.last),
|
||||||
view: ancestors.last,
|
view: ancestors.last,
|
||||||
maxTitleWidth: constraints.maxWidth - 50.0,
|
maxTitleWidth: constraints.maxWidth,
|
||||||
onUpdated: () => setState(() => _reloadAncestors()),
|
onUpdated: () => setState(() => _reloadAncestors()),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -223,23 +225,25 @@ class _ViewTitleState extends State<_ViewTitle> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final child = Row(
|
final child = SingleChildScrollView(
|
||||||
children: [
|
child: Row(
|
||||||
EmojiText(
|
children: [
|
||||||
emoji: icon,
|
EmojiText(
|
||||||
fontSize: 18.0,
|
emoji: icon,
|
||||||
),
|
fontSize: 18.0,
|
||||||
const HSpace(2.0),
|
|
||||||
ConstrainedBox(
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
maxWidth: widget.maxTitleWidth,
|
|
||||||
),
|
),
|
||||||
child: FlowyText.regular(
|
const HSpace(2.0),
|
||||||
name,
|
ConstrainedBox(
|
||||||
overflow: TextOverflow.ellipsis,
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: max(0, widget.maxTitleWidth),
|
||||||
|
),
|
||||||
|
child: FlowyText.regular(
|
||||||
|
name,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (widget.behavior == _ViewTitleBehavior.uneditable) {
|
if (widget.behavior == _ViewTitleBehavior.uneditable) {
|
||||||
|
@ -19,7 +19,7 @@ dependencies:
|
|||||||
uuid: ">=2.2.2"
|
uuid: ">=2.2.2"
|
||||||
bloc: ^8.1.2
|
bloc: ^8.1.2
|
||||||
freezed_annotation: ^2.1.0
|
freezed_annotation: ^2.1.0
|
||||||
file_picker: ^6.1.1
|
file_picker: ^8.0.2
|
||||||
file: ^7.0.0
|
file: ^7.0.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
@ -53,8 +53,8 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: bcaa58e8554963083931272afcfc907f15b804cb
|
ref: "1d5cdb7"
|
||||||
resolved-ref: bcaa58e8554963083931272afcfc907f15b804cb
|
resolved-ref: "1d5cdb758123aa3d391b62211707b4c14a92f85a"
|
||||||
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
|
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
|
||||||
source: git
|
source: git
|
||||||
version: "2.3.4"
|
version: "2.3.4"
|
||||||
@ -325,10 +325,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: cross_file
|
name: cross_file
|
||||||
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
|
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.3+8"
|
version: "0.3.4+1"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -365,10 +365,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: device_info_plus
|
name: device_info_plus
|
||||||
sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"
|
sha256: eead12d1a1ed83d8283ab4c2f3fca23ac4082f29f25f29dff0f758f57d06ec91
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.1.2"
|
version: "10.1.0"
|
||||||
device_info_plus_platform_interface:
|
device_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -477,10 +477,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
name: file_picker
|
||||||
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
|
sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.1"
|
version: "8.0.3"
|
||||||
file_selector_linux:
|
file_selector_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -848,10 +848,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
|
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.1"
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1237,10 +1237,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: package_info_plus
|
name: package_info_plus
|
||||||
sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79"
|
sha256: cb44f49b6e690fa766f023d5b22cac6b9affe741dd792b6ac7ad4fabe0d7b097
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.1"
|
version: "6.0.0"
|
||||||
package_info_plus_platform_interface:
|
package_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1457,70 +1457,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
rich_clipboard:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard
|
|
||||||
sha256: "48bfc84a0d3eeec5692b3afd0277aa658a7c95d1dbda72bb623188fba6a8e253"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
rich_clipboard_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_android
|
|
||||||
sha256: "72725b248d5359a7ad6db2fea5aef921015ba9a00af275cbce3721a4fef20356"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
rich_clipboard_ios:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_ios
|
|
||||||
sha256: "9d6bc037463b1b24cb14ae35ee9d7530bd6b2bdb15b30909fb47a1af01bf3233"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
rich_clipboard_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_linux
|
|
||||||
sha256: "0d0ab273afd60cb7314d01fdf3994fa01be2be79528f448241d9d70ea19b3db9"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
rich_clipboard_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_macos
|
|
||||||
sha256: "1aeb409e267576baaced347549e42dabc59895b10b2e09dabd9f753f469deb3e"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
rich_clipboard_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_platform_interface
|
|
||||||
sha256: a1cbf255719cd4e340d33eca02b619d9ffb9cb571f1905e80b9345d4266e893d
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
rich_clipboard_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_web
|
|
||||||
sha256: c1dd2b75b8ce83fed0027828900bbfd5c33c0f8ff22efb266931db5aa7acffa0
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
rich_clipboard_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: rich_clipboard_windows
|
|
||||||
sha256: "633198bcd74642bb03c4a628c7e350ee18bb391cd8c6132152f7c97ab250e901"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.3"
|
|
||||||
run_with_network_images:
|
run_with_network_images:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -1613,10 +1549,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
|
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.3.0"
|
||||||
shared_preferences_windows:
|
shared_preferences_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1844,10 +1780,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: super_native_extensions
|
name: super_native_extensions
|
||||||
sha256: f96db6b137a0b135e43034289bb55ca6447b65225076036e81f97ebb6381ffeb
|
sha256: "530a2118d032483b192713c68ed7105fe64418f22492165f87ed01f9b01d4965"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.5"
|
version: "0.8.12"
|
||||||
sync_http:
|
sync_http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2028,10 +1964,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b
|
sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.3"
|
version: "2.3.1"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2125,18 +2061,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web
|
name: web
|
||||||
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
|
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.5.1"
|
||||||
web_socket_channel:
|
web_socket_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web_socket_channel
|
name: web_socket_channel
|
||||||
sha256: "939ab60734a4f8fa95feacb55804fa278de28bdeef38e616dc08e44a84adea23"
|
sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.3"
|
version: "2.4.5"
|
||||||
webdriver:
|
webdriver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 0.5.5
|
version: 0.5.6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
flutter: ">=3.19.0"
|
flutter: ">=3.19.0"
|
||||||
@ -68,12 +68,12 @@ dependencies:
|
|||||||
expandable: ^5.0.1
|
expandable: ^5.0.1
|
||||||
flutter_colorpicker: ^1.0.3
|
flutter_colorpicker: ^1.0.3
|
||||||
highlight: ^0.7.0
|
highlight: ^0.7.0
|
||||||
package_info_plus: ^5.0.1
|
package_info_plus: ^6.0.0
|
||||||
url_launcher: ^6.1.11
|
url_launcher: ^6.1.11
|
||||||
clipboard: ^0.1.3
|
clipboard: ^0.1.3
|
||||||
connectivity_plus: ^5.0.2
|
connectivity_plus: ^5.0.2
|
||||||
easy_localization: ^3.0.2
|
easy_localization: ^3.0.2
|
||||||
device_info_plus: ^9.0.1
|
device_info_plus: ^10.1.0
|
||||||
fluttertoast: ^8.2.2
|
fluttertoast: ^8.2.2
|
||||||
json_annotation: ^4.8.1
|
json_annotation: ^4.8.1
|
||||||
table_calendar: ^3.0.9
|
table_calendar: ^3.0.9
|
||||||
@ -168,7 +168,7 @@ dependency_overrides:
|
|||||||
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: "bcaa58e8554963083931272afcfc907f15b804cb"
|
ref: "1d5cdb7"
|
||||||
|
|
||||||
sheet:
|
sheet:
|
||||||
git:
|
git:
|
||||||
@ -252,4 +252,4 @@ flutter:
|
|||||||
- assets/template/
|
- assets/template/
|
||||||
- assets/test/workspaces/markdowns/
|
- assets/test/workspaces/markdowns/
|
||||||
- assets/test/workspaces/database/
|
- assets/test/workspaces/database/
|
||||||
# END: EXCLUDE_IN_RELEASE
|
# END: EXCLUDE_IN_RELEASE
|
@ -113,7 +113,7 @@ void main() {
|
|||||||
section: ViewSectionPB.Public,
|
section: ViewSectionPB.Public,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await blocResponseFuture();
|
await blocResponseFuture(millisecond: 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(viewBloc.state.view.childViews.length, 3);
|
expect(viewBloc.state.view.childViews.length, 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user