mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore(typos): fix typos (#1961)
Co-authored-by: Nathan.fooo <86001920+appflowy@users.noreply.github.com>
This commit is contained in:
parent
77d787a929
commit
4798467621
@ -86,7 +86,7 @@ void main() {
|
|||||||
await tester.tapGoButton();
|
await tester.tapGoButton();
|
||||||
await tester.expectToSeeWelcomePage();
|
await tester.expectToSeeWelcomePage();
|
||||||
|
|
||||||
// swith to user B
|
// switch to user B
|
||||||
{
|
{
|
||||||
await tester.openSettings();
|
await tester.openSettings();
|
||||||
await tester.openSettingsPage(SettingsPage.user);
|
await tester.openSettingsPage(SettingsPage.user);
|
||||||
@ -120,7 +120,7 @@ void main() {
|
|||||||
expect(find.textContaining(userA), findsOneWidget);
|
expect(find.textContaining(userA), findsOneWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// swith to the userB again
|
// switch to the userB again
|
||||||
{
|
{
|
||||||
await tester.openSettings();
|
await tester.openSettings();
|
||||||
await tester.openSettingsPage(SettingsPage.files);
|
await tester.openSettingsPage(SettingsPage.files);
|
||||||
|
@ -39,7 +39,7 @@ extension AppFlowySettings on WidgetTester {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open the page taht insides the settings page
|
/// Open the page that insides the settings page
|
||||||
Future<void> openSettingsPage(SettingsPage page) async {
|
Future<void> openSettingsPage(SettingsPage page) async {
|
||||||
final button = find.text(page.name, findRichText: true);
|
final button = find.text(page.name, findRichText: true);
|
||||||
expect(button, findsOneWidget);
|
expect(button, findsOneWidget);
|
||||||
@ -49,25 +49,25 @@ extension AppFlowySettings on WidgetTester {
|
|||||||
|
|
||||||
/// Restore the AppFlowy data storage location
|
/// Restore the AppFlowy data storage location
|
||||||
Future<void> restoreLocation() async {
|
Future<void> restoreLocation() async {
|
||||||
final buton =
|
final button =
|
||||||
find.byTooltip(LocaleKeys.settings_files_restoreLocation.tr());
|
find.byTooltip(LocaleKeys.settings_files_restoreLocation.tr());
|
||||||
expect(buton, findsOneWidget);
|
expect(button, findsOneWidget);
|
||||||
await tapButton(buton);
|
await tapButton(button);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> tapOpenFolderButton() async {
|
Future<void> tapOpenFolderButton() async {
|
||||||
final buton = find.text(LocaleKeys.settings_files_open.tr());
|
final button = find.text(LocaleKeys.settings_files_open.tr());
|
||||||
expect(buton, findsOneWidget);
|
expect(button, findsOneWidget);
|
||||||
await tapButton(buton);
|
await tapButton(button);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> tapCustomLocationButton() async {
|
Future<void> tapCustomLocationButton() async {
|
||||||
final buton =
|
final button =
|
||||||
find.byTooltip(LocaleKeys.settings_files_customizeLocation.tr());
|
find.byTooltip(LocaleKeys.settings_files_customizeLocation.tr());
|
||||||
expect(buton, findsOneWidget);
|
expect(button, findsOneWidget);
|
||||||
await tapButton(buton);
|
await tapButton(button);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class FieldController {
|
|||||||
//Listen on setting changes
|
//Listen on setting changes
|
||||||
_listenOnSettingChanges();
|
_listenOnSettingChanges();
|
||||||
|
|
||||||
//Listen on the fitler changes
|
//Listen on the filter changes
|
||||||
_listenOnFilterChanges();
|
_listenOnFilterChanges();
|
||||||
|
|
||||||
//Listen on the sort changes
|
//Listen on the sort changes
|
||||||
@ -177,7 +177,7 @@ class FieldController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _listenOnFilterChanges() {
|
void _listenOnFilterChanges() {
|
||||||
//Listen on the fitler changes
|
//Listen on the filter changes
|
||||||
|
|
||||||
deleteFilterFromChangeset(
|
deleteFilterFromChangeset(
|
||||||
List<FilterInfo> filters,
|
List<FilterInfo> filters,
|
||||||
@ -230,7 +230,7 @@ class FieldController {
|
|||||||
.removeWhere((key, value) => value.id == updatedFilter.filterId);
|
.removeWhere((key, value) => value.id == updatedFilter.filterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert the filter if there is a fitler and its field info is
|
// Insert the filter if there is a filter and its field info is
|
||||||
// not null
|
// not null
|
||||||
if (updatedFilter.hasFilter()) {
|
if (updatedFilter.hasFilter()) {
|
||||||
final fieldInfo = _findFieldInfo(
|
final fieldInfo = _findFieldInfo(
|
||||||
|
@ -27,7 +27,7 @@ class SettingController {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listen on the seting changes
|
// Listen on the setting changes
|
||||||
_listener.start(onSettingUpdated: (result) {
|
_listener.start(onSettingUpdated: (result) {
|
||||||
result.fold(
|
result.fold(
|
||||||
(newSetting) => updateSetting(newSetting),
|
(newSetting) => updateSetting(newSetting),
|
||||||
@ -36,7 +36,7 @@ class SettingController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void startListeing({
|
void startListening({
|
||||||
required OnSettingUpdated onSettingUpdated,
|
required OnSettingUpdated onSettingUpdated,
|
||||||
required OnError onError,
|
required OnError onError,
|
||||||
}) {
|
}) {
|
||||||
|
@ -87,7 +87,7 @@ class _CheckboxFilterEditorState extends State<CheckboxFilterEditor> {
|
|||||||
child: BlocBuilder<CheckboxFilterEditorBloc, CheckboxFilterEditorState>(
|
child: BlocBuilder<CheckboxFilterEditorBloc, CheckboxFilterEditorState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final List<Widget> children = [
|
final List<Widget> children = [
|
||||||
_buildFilterPannel(context, state),
|
_buildFilterPanel(context, state),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
@ -99,7 +99,7 @@ class _CheckboxFilterEditorState extends State<CheckboxFilterEditor> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFilterPannel(
|
Widget _buildFilterPanel(
|
||||||
BuildContext context, CheckboxFilterEditorState state) {
|
BuildContext context, CheckboxFilterEditorState state) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -96,7 +96,7 @@ class _SelectOptionFilterEditorState extends State<SelectOptionFilterEditor> {
|
|||||||
SelectOptionFilterEditorState>(
|
SelectOptionFilterEditorState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
List<Widget> slivers = [
|
List<Widget> slivers = [
|
||||||
SliverToBoxAdapter(child: _buildFilterPannel(context, state)),
|
SliverToBoxAdapter(child: _buildFilterPanel(context, state)),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (state.filter.condition != SelectOptionConditionPB.OptionIsEmpty &&
|
if (state.filter.condition != SelectOptionConditionPB.OptionIsEmpty &&
|
||||||
@ -131,7 +131,7 @@ class _SelectOptionFilterEditorState extends State<SelectOptionFilterEditor> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFilterPannel(
|
Widget _buildFilterPanel(
|
||||||
BuildContext context, SelectOptionFilterEditorState state) {
|
BuildContext context, SelectOptionFilterEditorState state) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -94,7 +94,7 @@ class _TextFilterEditorState extends State<TextFilterEditor> {
|
|||||||
child: BlocBuilder<TextFilterEditorBloc, TextFilterEditorState>(
|
child: BlocBuilder<TextFilterEditorBloc, TextFilterEditorState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final List<Widget> children = [
|
final List<Widget> children = [
|
||||||
_buildFilterPannel(context, state),
|
_buildFilterPanel(context, state),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (state.filter.condition != TextFilterConditionPB.TextIsEmpty &&
|
if (state.filter.condition != TextFilterConditionPB.TextIsEmpty &&
|
||||||
@ -112,7 +112,7 @@ class _TextFilterEditorState extends State<TextFilterEditor> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFilterPannel(BuildContext context, TextFilterEditorState state) {
|
Widget _buildFilterPanel(BuildContext context, TextFilterEditorState state) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -128,11 +128,11 @@ class _AppFlowyEditorPageState extends State<_AppFlowyEditorPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
final autoFocusParamters = _autoFocusParamters();
|
final autoFocusParameters = _autoFocusParameters();
|
||||||
final editor = AppFlowyEditor(
|
final editor = AppFlowyEditor(
|
||||||
editorState: editorState,
|
editorState: editorState,
|
||||||
autoFocus: autoFocusParamters.value1,
|
autoFocus: autoFocusParameters.value1,
|
||||||
focusedSelection: autoFocusParamters.value2,
|
focusedSelection: autoFocusParameters.value2,
|
||||||
customBuilders: {
|
customBuilders: {
|
||||||
// Divider
|
// Divider
|
||||||
kDividerType: DividerWidgetBuilder(),
|
kDividerType: DividerWidgetBuilder(),
|
||||||
@ -234,7 +234,7 @@ class _AppFlowyEditorPageState extends State<_AppFlowyEditorPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dartz.Tuple2<bool, Selection?> _autoFocusParamters() {
|
dartz.Tuple2<bool, Selection?> _autoFocusParameters() {
|
||||||
if (editorState.document.isEmpty) {
|
if (editorState.document.isEmpty) {
|
||||||
return dartz.Tuple2(true, Selection.single(path: [0], startOffset: 0));
|
return dartz.Tuple2(true, Selection.single(path: [0], startOffset: 0));
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,8 @@ Iterable<ThemeExtension<dynamic>> customPluginTheme(BuildContext context) {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
final pluginTheme = Theme.of(context).brightness == Brightness.dark
|
final pluginTheme = Theme.of(context).brightness == Brightness.dark
|
||||||
? darkPlguinStyleExtension
|
? darkPluginStyleExtension
|
||||||
: lightPlguinStyleExtension;
|
: lightPluginStyleExtension;
|
||||||
return pluginTheme.toList()
|
return pluginTheme.toList()
|
||||||
..removeWhere((element) =>
|
..removeWhere((element) =>
|
||||||
element is HeadingPluginStyle || element is NumberListPluginStyle)
|
element is HeadingPluginStyle || element is NumberListPluginStyle)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:bloc/bloc.dart';
|
import 'package:bloc/bloc.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
const String _kDocumentAppearenceFontSize = 'kDocumentAppearenceFontSize';
|
const String _kDocumentAppearanceFontSize = 'kDocumentAppearanceFontSize';
|
||||||
|
|
||||||
class DocumentAppearance {
|
class DocumentAppearance {
|
||||||
const DocumentAppearance({
|
const DocumentAppearance({
|
||||||
@ -24,7 +24,7 @@ class DocumentAppearanceCubit extends Cubit<DocumentAppearance> {
|
|||||||
|
|
||||||
void fetch() async {
|
void fetch() async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
final fontSize = prefs.getDouble(_kDocumentAppearenceFontSize) ?? 14.0;
|
final fontSize = prefs.getDouble(_kDocumentAppearanceFontSize) ?? 14.0;
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
));
|
));
|
||||||
@ -32,7 +32,7 @@ class DocumentAppearanceCubit extends Cubit<DocumentAppearance> {
|
|||||||
|
|
||||||
void syncFontSize(double fontSize) async {
|
void syncFontSize(double fontSize) async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
prefs.setDouble(_kDocumentAppearenceFontSize, fontSize);
|
prefs.setDouble(_kDocumentAppearanceFontSize, fontSize);
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
));
|
));
|
||||||
|
@ -20,7 +20,7 @@ void showLinkToPageMenu(
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
ViewLayoutTypePB pageType,
|
ViewLayoutTypePB pageType,
|
||||||
) {
|
) {
|
||||||
final aligment = menuService.alignment;
|
final alignment = menuService.alignment;
|
||||||
final offset = menuService.offset;
|
final offset = menuService.offset;
|
||||||
menuService.dismiss();
|
menuService.dismiss();
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ void showLinkToPageMenu(
|
|||||||
_linkToPageMenu?.remove();
|
_linkToPageMenu?.remove();
|
||||||
_linkToPageMenu = OverlayEntry(builder: (context) {
|
_linkToPageMenu = OverlayEntry(builder: (context) {
|
||||||
return Positioned(
|
return Positioned(
|
||||||
top: aligment == Alignment.bottomLeft ? offset.dy : null,
|
top: alignment == Alignment.bottomLeft ? offset.dy : null,
|
||||||
bottom: aligment == Alignment.topLeft ? offset.dy : null,
|
bottom: alignment == Alignment.topLeft ? offset.dy : null,
|
||||||
left: offset.dx,
|
left: offset.dx,
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
@ -463,7 +463,7 @@ class _CoverImageState extends State<_CoverImage> {
|
|||||||
coverImage = const SizedBox();
|
coverImage = const SizedBox();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//OverflowBox needs to be wraped by a widget with constraints(or from its parent) first,otherwise it will occur an erorr
|
//OverflowBox needs to be wraped by a widget with constraints(or from its parent) first,otherwise it will occur an error
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: height,
|
height: height,
|
||||||
child: OverflowBox(
|
child: OverflowBox(
|
||||||
|
@ -17,7 +17,7 @@ class Loading {
|
|||||||
return const SimpleDialog(
|
return const SimpleDialog(
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Colors.transparent, // can change this to your prefered color
|
Colors.transparent, // can change this to your preferred color
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Center(
|
Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
|
@ -27,7 +27,7 @@ import 'tasks/prelude.dart';
|
|||||||
// └───▶│AppWidgetTask│────────▶│ApplicationWidget │─────▶│ SplashScreen │
|
// └───▶│AppWidgetTask│────────▶│ApplicationWidget │─────▶│ SplashScreen │
|
||||||
// └─────────────┘ └──────────────────┘ └───────────────┘
|
// └─────────────┘ └──────────────────┘ └───────────────┘
|
||||||
//
|
//
|
||||||
// 3.build MeterialApp
|
// 3.build MaterialApp
|
||||||
final getIt = GetIt.instance;
|
final getIt = GetIt.instance;
|
||||||
|
|
||||||
abstract class EntryPoint {
|
abstract class EntryPoint {
|
||||||
|
@ -141,7 +141,7 @@ class AppEvent with _$AppEvent {
|
|||||||
PluginBuilder pluginBuilder, {
|
PluginBuilder pluginBuilder, {
|
||||||
String? desc,
|
String? desc,
|
||||||
|
|
||||||
/// The initial data should be the JSON of the doucment
|
/// The initial data should be the JSON of the document
|
||||||
/// For example: {"document":{"type":"editor","children":[]}}
|
/// For example: {"document":{"type":"editor","children":[]}}
|
||||||
String? initialData,
|
String? initialData,
|
||||||
Map<String, String>? ext,
|
Map<String, String>? ext,
|
||||||
|
@ -33,14 +33,14 @@ class ViewSection extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: BlocBuilder<ViewSectionBloc, ViewSectionState>(
|
child: BlocBuilder<ViewSectionBloc, ViewSectionState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return _reorderableColum(context, state);
|
return _reorderableColumn(context, state);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReorderableColumn _reorderableColum(
|
ReorderableColumn _reorderableColumn(
|
||||||
BuildContext context, ViewSectionState state) {
|
BuildContext context, ViewSectionState state) {
|
||||||
final children = state.views.map((view) {
|
final children = state.views.map((view) {
|
||||||
return ViewSectionItem(
|
return ViewSectionItem(
|
||||||
|
@ -365,7 +365,7 @@ ThemeData customizeEditorTheme(BuildContext context) {
|
|||||||
|
|
||||||
return Theme.of(context).copyWith(extensions: [
|
return Theme.of(context).copyWith(extensions: [
|
||||||
editorStyle,
|
editorStyle,
|
||||||
...darkPlguinStyleExtension,
|
...darkPluginStyleExtension,
|
||||||
quote,
|
quote,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
ThemeData _themeData = ThemeData.light().copyWith(
|
ThemeData _themeData = ThemeData.light().copyWith(
|
||||||
extensions: [
|
extensions: [
|
||||||
...lightEditorStyleExtension,
|
...lightEditorStyleExtension,
|
||||||
...lightPlguinStyleExtension,
|
...lightPluginStyleExtension,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
|||||||
|
|
||||||
// Theme Demo
|
// Theme Demo
|
||||||
_buildSeparator(context, 'Theme Demo'),
|
_buildSeparator(context, 'Theme Demo'),
|
||||||
_buildListTile(context, 'Bulit In Dark Mode', () {
|
_buildListTile(context, 'Built In Dark Mode', () {
|
||||||
_jsonString = Future<String>.value(
|
_jsonString = Future<String>.value(
|
||||||
jsonEncode(_editorState.document.toJson()).toString(),
|
jsonEncode(_editorState.document.toJson()).toString(),
|
||||||
);
|
);
|
||||||
@ -159,7 +159,7 @@ Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
|||||||
_themeData = ThemeData.dark().copyWith(
|
_themeData = ThemeData.dark().copyWith(
|
||||||
extensions: [
|
extensions: [
|
||||||
...darkEditorStyleExtension,
|
...darkEditorStyleExtension,
|
||||||
...darkPlguinStyleExtension,
|
...darkPluginStyleExtension,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -372,7 +372,7 @@ Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
|||||||
|
|
||||||
return Theme.of(context).copyWith(extensions: [
|
return Theme.of(context).copyWith(extensions: [
|
||||||
editorStyle,
|
editorStyle,
|
||||||
...darkPlguinStyleExtension,
|
...darkPluginStyleExtension,
|
||||||
quote,
|
quote,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ ThemeData customizeEditorTheme(BuildContext context) {
|
|||||||
|
|
||||||
return Theme.of(context).copyWith(extensions: [
|
return Theme.of(context).copyWith(extensions: [
|
||||||
editorStyle,
|
editorStyle,
|
||||||
...darkPlguinStyleExtension,
|
...darkPluginStyleExtension,
|
||||||
quote,
|
quote,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class EditorState {
|
|||||||
|
|
||||||
// TODO: only for testing.
|
// TODO: only for testing.
|
||||||
bool disableSealTimer = false;
|
bool disableSealTimer = false;
|
||||||
bool disbaleRules = false;
|
bool disableRules = false;
|
||||||
|
|
||||||
bool editable = true;
|
bool editable = true;
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ class EditorState {
|
|||||||
|
|
||||||
void _applyRules(int ruleCount) {
|
void _applyRules(int ruleCount) {
|
||||||
// Set a maximum count to prevent a dead loop.
|
// Set a maximum count to prevent a dead loop.
|
||||||
if (ruleCount >= 5 || disbaleRules) {
|
if (ruleCount >= 5 || disableRules) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class SelectionMenu implements SelectionMenuService {
|
|||||||
editorState.renderBox?.localToGlobal(Offset.zero) ?? Offset.zero;
|
editorState.renderBox?.localToGlobal(Offset.zero) ?? Offset.zero;
|
||||||
final editorHeight = editorState.renderBox!.size.height;
|
final editorHeight = editorState.renderBox!.size.height;
|
||||||
|
|
||||||
// show below defualt
|
// show below default
|
||||||
var showBelow = true;
|
var showBelow = true;
|
||||||
_alignment = Alignment.bottomLeft;
|
_alignment = Alignment.bottomLeft;
|
||||||
final bottomRight = selectionRects.first.bottomRight;
|
final bottomRight = selectionRects.first.bottomRight;
|
||||||
|
@ -2,14 +2,14 @@ import 'package:appflowy_editor/appflowy_editor.dart';
|
|||||||
import 'package:appflowy_editor/src/infra/flowy_svg.dart';
|
import 'package:appflowy_editor/src/infra/flowy_svg.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
Iterable<ThemeExtension<dynamic>> get lightPlguinStyleExtension => [
|
Iterable<ThemeExtension<dynamic>> get lightPluginStyleExtension => [
|
||||||
HeadingPluginStyle.light,
|
HeadingPluginStyle.light,
|
||||||
CheckboxPluginStyle.light,
|
CheckboxPluginStyle.light,
|
||||||
NumberListPluginStyle.light,
|
NumberListPluginStyle.light,
|
||||||
QuotedTextPluginStyle.light,
|
QuotedTextPluginStyle.light,
|
||||||
];
|
];
|
||||||
|
|
||||||
Iterable<ThemeExtension<dynamic>> get darkPlguinStyleExtension => [
|
Iterable<ThemeExtension<dynamic>> get darkPluginStyleExtension => [
|
||||||
HeadingPluginStyle.dark,
|
HeadingPluginStyle.dark,
|
||||||
CheckboxPluginStyle.dark,
|
CheckboxPluginStyle.dark,
|
||||||
NumberListPluginStyle.dark,
|
NumberListPluginStyle.dark,
|
||||||
|
@ -16,14 +16,14 @@ class ToolbarWidget extends StatefulWidget {
|
|||||||
required this.layerLink,
|
required this.layerLink,
|
||||||
required this.offset,
|
required this.offset,
|
||||||
required this.items,
|
required this.items,
|
||||||
this.aligment = Alignment.topLeft,
|
this.alignment = Alignment.topLeft,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final EditorState editorState;
|
final EditorState editorState;
|
||||||
final LayerLink layerLink;
|
final LayerLink layerLink;
|
||||||
final Offset offset;
|
final Offset offset;
|
||||||
final List<ToolbarItem> items;
|
final List<ToolbarItem> items;
|
||||||
final Alignment aligment;
|
final Alignment alignment;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ToolbarWidget> createState() => _ToolbarWidgetState();
|
State<ToolbarWidget> createState() => _ToolbarWidgetState();
|
||||||
@ -41,7 +41,7 @@ class _ToolbarWidgetState extends State<ToolbarWidget> with ToolbarMixin {
|
|||||||
link: widget.layerLink,
|
link: widget.layerLink,
|
||||||
showWhenUnlinked: true,
|
showWhenUnlinked: true,
|
||||||
offset: widget.offset,
|
offset: widget.offset,
|
||||||
followerAnchor: widget.aligment,
|
followerAnchor: widget.alignment,
|
||||||
child: _buildToolbar(context),
|
child: _buildToolbar(context),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -39,7 +39,7 @@ class AppFlowyEditor extends StatefulWidget {
|
|||||||
this.themeData = themeData ??
|
this.themeData = themeData ??
|
||||||
ThemeData.light().copyWith(extensions: [
|
ThemeData.light().copyWith(extensions: [
|
||||||
...lightEditorStyleExtension,
|
...lightEditorStyleExtension,
|
||||||
...lightPlguinStyleExtension,
|
...lightPluginStyleExtension,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ ShortcutEventHandler underscoreToItalicHandler = (editorState, event) {
|
|||||||
return KeyEventResult.handled;
|
return KeyEventResult.handled;
|
||||||
};
|
};
|
||||||
|
|
||||||
ShortcutEventHandler doubleAsteriskToBoldHanlder = (editorState, event) {
|
ShortcutEventHandler doubleAsteriskToBoldHandler = (editorState, event) {
|
||||||
final selectionService = editorState.service.selectionService;
|
final selectionService = editorState.service.selectionService;
|
||||||
final selection = selectionService.currentSelection.value;
|
final selection = selectionService.currentSelection.value;
|
||||||
final textNodes = selectionService.currentSelectedNodes.whereType<TextNode>();
|
final textNodes = selectionService.currentSelectedNodes.whereType<TextNode>();
|
||||||
@ -366,8 +366,8 @@ ShortcutEventHandler doubleAsteriskToBoldHanlder = (editorState, event) {
|
|||||||
return KeyEventResult.handled;
|
return KeyEventResult.handled;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Implement in the same way as doubleAsteriskToBoldHanlder
|
//Implement in the same way as doubleAsteriskToBoldHandler
|
||||||
ShortcutEventHandler doubleUnderscoreToBoldHanlder = (editorState, event) {
|
ShortcutEventHandler doubleUnderscoreToBoldHandler = (editorState, event) {
|
||||||
final selectionService = editorState.service.selectionService;
|
final selectionService = editorState.service.selectionService;
|
||||||
final selection = selectionService.currentSelection.value;
|
final selection = selectionService.currentSelection.value;
|
||||||
final textNodes = selectionService.currentSelectedNodes.whereType<TextNode>();
|
final textNodes = selectionService.currentSelectedNodes.whereType<TextNode>();
|
||||||
|
@ -310,12 +310,12 @@ List<ShortcutEvent> builtInShortcutEvents = [
|
|||||||
ShortcutEvent(
|
ShortcutEvent(
|
||||||
key: 'Double asterisk to bold',
|
key: 'Double asterisk to bold',
|
||||||
command: 'shift+digit 8',
|
command: 'shift+digit 8',
|
||||||
handler: doubleAsteriskToBoldHanlder,
|
handler: doubleAsteriskToBoldHandler,
|
||||||
),
|
),
|
||||||
ShortcutEvent(
|
ShortcutEvent(
|
||||||
key: 'Double underscore to bold',
|
key: 'Double underscore to bold',
|
||||||
command: 'shift+underscore',
|
command: 'shift+underscore',
|
||||||
handler: doubleUnderscoreToBoldHanlder,
|
handler: doubleUnderscoreToBoldHandler,
|
||||||
),
|
),
|
||||||
// https://github.com/flutter/flutter/issues/104944
|
// https://github.com/flutter/flutter/issues/104944
|
||||||
// Workaround: Using space editing on the web platform often results in errors,
|
// Workaround: Using space editing on the web platform often results in errors,
|
||||||
|
@ -66,7 +66,7 @@ class _FlowyToolbarState extends State<FlowyToolbar>
|
|||||||
layerLink: layerLink,
|
layerLink: layerLink,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
items: items,
|
items: items,
|
||||||
aligment: alignment,
|
alignment: alignment,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
Overlay.of(context)?.insert(_toolbarOverlay!);
|
Overlay.of(context)?.insert(_toolbarOverlay!);
|
||||||
|
@ -4,7 +4,7 @@ import '../infra/test_editor.dart';
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('command_extension.dart', () {
|
group('command_extension.dart', () {
|
||||||
testWidgets('insert a new checkbox after an exsiting checkbox',
|
testWidgets('insert a new checkbox after an existing checkbox',
|
||||||
(tester) async {
|
(tester) async {
|
||||||
final editor = tester.editor
|
final editor = tester.editor
|
||||||
..insertTextNode(
|
..insertTextNode(
|
||||||
|
@ -45,7 +45,7 @@ void main() {
|
|||||||
expect(result, false);
|
expect(result, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('insert a new checkbox after an exsiting checkbox',
|
testWidgets('insert a new checkbox after an existing checkbox',
|
||||||
(tester) async {
|
(tester) async {
|
||||||
const text = 'Welcome to Appflowy 😁';
|
const text = 'Welcome to Appflowy 😁';
|
||||||
final editor = tester.editor
|
final editor = tester.editor
|
||||||
|
@ -160,7 +160,7 @@ class EditorWidgetTester {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
..disableSealTimer = true
|
..disableSealTimer = true
|
||||||
..disbaleRules = true;
|
..disableRules = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool runAction(int actionIndex, Node node) {
|
bool runAction(int actionIndex, Node node) {
|
||||||
|
@ -71,7 +71,7 @@ void main() async {
|
|||||||
|
|
||||||
// https://github.com/AppFlowy-IO/AppFlowy/issues/1763
|
// https://github.com/AppFlowy-IO/AppFlowy/issues/1763
|
||||||
// // [Bug] Mouse unable to click a certain area #1763
|
// // [Bug] Mouse unable to click a certain area #1763
|
||||||
testWidgets('insert a new checkbox after an exsiting checkbox',
|
testWidgets('insert a new checkbox after an existing checkbox',
|
||||||
(tester) async {
|
(tester) async {
|
||||||
// Before
|
// Before
|
||||||
//
|
//
|
||||||
|
@ -27,7 +27,7 @@ void main() async {
|
|||||||
Selection.single(path: [1], startOffset: 0, endOffset: text.length),
|
Selection.single(path: [1], startOffset: 0, endOffset: text.length),
|
||||||
);
|
);
|
||||||
|
|
||||||
// mutliple selection
|
// multiple selection
|
||||||
await _testSelection(
|
await _testSelection(
|
||||||
editor,
|
editor,
|
||||||
Selection(
|
Selection(
|
||||||
|
@ -24,15 +24,15 @@ void _showEmojiSelectionMenu(
|
|||||||
SelectionMenuService menuService,
|
SelectionMenuService menuService,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) {
|
) {
|
||||||
final aligment = menuService.alignment;
|
final alignment = menuService.alignment;
|
||||||
final offset = menuService.offset;
|
final offset = menuService.offset;
|
||||||
menuService.dismiss();
|
menuService.dismiss();
|
||||||
|
|
||||||
_emojiSelectionMenu?.remove();
|
_emojiSelectionMenu?.remove();
|
||||||
_emojiSelectionMenu = OverlayEntry(builder: (context) {
|
_emojiSelectionMenu = OverlayEntry(builder: (context) {
|
||||||
return Positioned(
|
return Positioned(
|
||||||
top: aligment == Alignment.bottomLeft ? offset.dy : null,
|
top: alignment == Alignment.bottomLeft ? offset.dy : null,
|
||||||
bottom: aligment == Alignment.topLeft ? offset.dy : null,
|
bottom: alignment == Alignment.topLeft ? offset.dy : null,
|
||||||
left: offset.dx,
|
left: offset.dx,
|
||||||
child: Material(
|
child: Material(
|
||||||
child: EmojiSelectionMenu(
|
child: EmojiSelectionMenu(
|
||||||
|
@ -45,7 +45,7 @@ export class TypeOptionController {
|
|||||||
if (this.initialFieldInfo.some) {
|
if (this.initialFieldInfo.some) {
|
||||||
return this.initialFieldInfo.val;
|
return this.initialFieldInfo.val;
|
||||||
} else {
|
} else {
|
||||||
throw Error('Unexpect empty type option data. Should call initialize first');
|
throw Error('Unexpected empty type option data. Should call initialize first');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new FieldInfo(this.typeOptionData.val.field);
|
return new FieldInfo(this.typeOptionData.val.field);
|
||||||
@ -69,7 +69,7 @@ export class TypeOptionController {
|
|||||||
void this.fieldBackendSvc?.updateField({ name: name });
|
void this.fieldBackendSvc?.updateField({ name: name });
|
||||||
this.fieldNotifier.notify(this.typeOptionData.val.field);
|
this.fieldNotifier.notify(this.typeOptionData.val.field);
|
||||||
} else {
|
} else {
|
||||||
throw Error('Unexpect empty type option data. Should call initialize first');
|
throw Error('Unexpected empty type option data. Should call initialize first');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -82,20 +82,20 @@ export class TypeOptionController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
throw Error('Unexpect empty type option data. Should call initialize first');
|
throw Error('Unexpected empty type option data. Should call initialize first');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
deleteField = async () => {
|
deleteField = async () => {
|
||||||
if (this.fieldBackendSvc === undefined) {
|
if (this.fieldBackendSvc === undefined) {
|
||||||
Log.error('Unexpect empty field backend service');
|
Log.error('Unexpected empty field backend service');
|
||||||
}
|
}
|
||||||
return this.fieldBackendSvc?.deleteField();
|
return this.fieldBackendSvc?.deleteField();
|
||||||
};
|
};
|
||||||
|
|
||||||
duplicateField = async () => {
|
duplicateField = async () => {
|
||||||
if (this.fieldBackendSvc === undefined) {
|
if (this.fieldBackendSvc === undefined) {
|
||||||
Log.error('Unexpect empty field backend service');
|
Log.error('Unexpected empty field backend service');
|
||||||
}
|
}
|
||||||
return this.fieldBackendSvc?.duplicateField();
|
return this.fieldBackendSvc?.duplicateField();
|
||||||
};
|
};
|
||||||
|
@ -241,7 +241,7 @@
|
|||||||
"insert": "bold text",
|
"insert": "bold text",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"bold": true,
|
"bold": true,
|
||||||
"defaultFormating": true
|
"defaultFormatting": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
## Extensively extensible For those with no coding experience, AppFlowy enables you to create apps that suit your needs. It's built on a community-driven toolbox, including templates, plugins, themes, and more.
|
## Extensively extensible For those with no coding experience, AppFlowy enables you to create apps that suit your needs. It's built on a community-driven toolbox, including templates, plugins, themes, and more.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
## Truely native experience Faster, more stable with support for offline mode. It's also better integrated with different devices. Moreover, AppFlowy enables users to access features and possibilities not available on the web.
|
## Truly native experience Faster, more stable with support for offline mode. It's also better integrated with different devices. Moreover, AppFlowy enables users to access features and possibilities not available on the web.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ run_task = { name = [
|
|||||||
|
|
||||||
[tasks.compile_test_backend]
|
[tasks.compile_test_backend]
|
||||||
mac_alias = "compile_test_backend_default"
|
mac_alias = "compile_test_backend_default"
|
||||||
windows_alias = "compile_test_backend_widnows"
|
windows_alias = "compile_test_backend_windows"
|
||||||
linux_alias = "compile_test_backend_default"
|
linux_alias = "compile_test_backend_default"
|
||||||
|
|
||||||
[tasks.compile_test_backend_default]
|
[tasks.compile_test_backend_default]
|
||||||
@ -217,7 +217,7 @@ script = [
|
|||||||
]
|
]
|
||||||
script_runner = "@shell"
|
script_runner = "@shell"
|
||||||
|
|
||||||
[tasks.compile_test_backend_widnows]
|
[tasks.compile_test_backend_windows]
|
||||||
private = true
|
private = true
|
||||||
script = [
|
script = [
|
||||||
"""
|
"""
|
||||||
|
@ -139,7 +139,7 @@ lazy_static! {
|
|||||||
BuildInTextAttributeKey::Background,
|
BuildInTextAttributeKey::Background,
|
||||||
BuildInTextAttributeKey::InlineCode,
|
BuildInTextAttributeKey::InlineCode,
|
||||||
]);
|
]);
|
||||||
static ref INGORE_KEYS: HashSet<BuildInTextAttributeKey> = HashSet::from_iter(vec![
|
static ref IGNORE_KEYS: HashSet<BuildInTextAttributeKey> = HashSet::from_iter(vec![
|
||||||
BuildInTextAttributeKey::Width,
|
BuildInTextAttributeKey::Width,
|
||||||
BuildInTextAttributeKey::Height,
|
BuildInTextAttributeKey::Height,
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user