소스 검색

chore: rename flowy_x to appflowy_x

Lucas.Xu 2 년 전
부모
커밋
66275ca232
20개의 변경된 파일66개의 추가작업 그리고 65개의 파일을 삭제
  1. 1 1
      frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/image_node_widget.dart
  2. 1 1
      frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/underscore_to_italic_key_event_handler.dart
  3. 6 6
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart
  4. 7 7
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/input_service.dart
  5. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart
  6. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart
  7. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/default_key_event_handlers.dart
  8. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/delete_text_handler.dart
  9. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart
  10. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/page_up_down_handler.dart
  11. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/redo_undo_handler.dart
  12. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/select_all_handler.dart
  13. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/slash_handler.dart
  14. 2 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/update_text_style_by_command_x_handler.dart
  15. 1 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/whitespace_handler.dart
  16. 9 9
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart
  17. 3 3
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/render_plugin_service.dart
  18. 7 7
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/scroll_service.dart
  19. 7 7
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart
  20. 13 13
      frontend/app_flowy/packages/appflowy_editor/lib/src/service/service.dart

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/image_node_widget.dart

@@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
 ///
 /// 4. override the getter `nodeValidator`
 ///     to verify the data structure in [Node].
-/// 5. register the plugin with `type` to `flowy_editor` in `main.dart`.
+/// 5. register the plugin with `type` to `AppFlowyEditor` in `main.dart`.
 /// 6. Congratulations!
 
 class ImageNodeBuilder extends NodeWidgetBuilder<Node> {

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/underscore_to_italic_key_event_handler.dart

@@ -2,7 +2,7 @@ import 'package:appflowy_editor/appflowy_editor.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
-FlowyKeyEventHandler underscoreToItalicHandler = (editorState, event) {
+AppFlowyKeyEventHandler underscoreToItalicHandler = (editorState, event) {
   // Since we only need to handler the input of `underscore`.
   // All inputs except `underscore` will be ignored directly.
   if (event.logicalKey != LogicalKeyboardKey.underscore) {

+ 6 - 6
frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart

@@ -40,7 +40,7 @@ class AppFlowyEditor extends StatefulWidget {
   final NodeWidgetBuilders customBuilders;
 
   /// Keyboard event handlers.
-  final List<FlowyKeyEventHandler> keyEventHandlers;
+  final List<AppFlowyKeyEventHandler> keyEventHandlers;
 
   @override
   State<AppFlowyEditor> createState() => _AppFlowyEditorState();
@@ -67,15 +67,15 @@ class _AppFlowyEditorState extends State<AppFlowyEditor> {
 
   @override
   Widget build(BuildContext context) {
-    return FlowyScroll(
+    return AppFlowyScroll(
         key: editorState.service.scrollServiceKey,
-        child: FlowySelection(
+        child: AppFlowySelection(
           key: editorState.service.selectionServiceKey,
           editorState: editorState,
-          child: FlowyInput(
+          child: AppFlowyInput(
             key: editorState.service.inputServiceKey,
             editorState: editorState,
-            child: FlowyKeyboard(
+            child: AppFlowyKeyboard(
               key: editorState.service.keyboardServiceKey,
               handlers: [
                 ...defaultKeyEventHandlers,
@@ -99,7 +99,7 @@ class _AppFlowyEditorState extends State<AppFlowyEditor> {
         ));
   }
 
-  FlowyRenderPlugin _createRenderPlugin() => FlowyRenderPlugin(
+  AppFlowyRenderPlugin _createRenderPlugin() => AppFlowyRenderPlugin(
         editorState: editorState,
         builders: {
           ...defaultBuilders,

+ 7 - 7
frontend/app_flowy/packages/appflowy_editor/lib/src/service/input_service.dart

@@ -7,7 +7,7 @@ import 'package:appflowy_editor/src/editor_state.dart';
 import 'package:appflowy_editor/src/extensions/node_extensions.dart';
 import 'package:appflowy_editor/src/operation/transaction_builder.dart';
 
-/// [FlowyInputService] is responsible for processing text input,
+/// [AppFlowyInputService] is responsible for processing text input,
 ///   including text insertion, deletion and replacement.
 ///
 /// Usually, this service can be obtained by the following code.
@@ -21,7 +21,7 @@ import 'package:appflowy_editor/src/operation/transaction_builder.dart';
 /// inputService?.apply(...);
 /// ```
 ///
-abstract class FlowyInputService {
+abstract class AppFlowyInputService {
   /// Updates the [TextEditingValue] of the text currently being edited.
   ///
   /// Note that if there are IME-related requirements,
@@ -39,8 +39,8 @@ abstract class FlowyInputService {
 }
 
 /// Processes text input
-class FlowyInput extends StatefulWidget {
-  const FlowyInput({
+class AppFlowyInput extends StatefulWidget {
+  const AppFlowyInput({
     Key? key,
     required this.editorState,
     required this.child,
@@ -50,11 +50,11 @@ class FlowyInput extends StatefulWidget {
   final Widget child;
 
   @override
-  State<FlowyInput> createState() => _FlowyInputState();
+  State<AppFlowyInput> createState() => _AppFlowyInputState();
 }
 
-class _FlowyInputState extends State<FlowyInput>
-    implements FlowyInputService, DeltaTextInputClient {
+class _AppFlowyInputState extends State<AppFlowyInput>
+    implements AppFlowyInputService, DeltaTextInputClient {
   TextInputConnection? _textInputConnection;
   TextRange? _composingTextRange;
 

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart

@@ -103,7 +103,7 @@ KeyEventResult _handleShiftKey(EditorState editorState, RawKeyEvent event) {
   return KeyEventResult.ignored;
 }
 
-FlowyKeyEventHandler arrowKeysHandler = (editorState, event) {
+AppFlowyKeyEventHandler arrowKeysHandler = (editorState, event) {
   if (event.isShiftPressed) {
     return _handleShiftKey(editorState, event);
   }

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart

@@ -304,7 +304,7 @@ _deleteSelectedContent(EditorState editorState) {
   tb.commit();
 }
 
-FlowyKeyEventHandler copyPasteKeysHandler = (editorState, event) {
+AppFlowyKeyEventHandler copyPasteKeysHandler = (editorState, event) {
   if (event.isMetaPressed && event.logicalKey == LogicalKeyboardKey.keyC) {
     _handleCopy(editorState);
     return KeyEventResult.handled;

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/default_key_event_handlers.dart

@@ -10,7 +10,7 @@ import 'package:appflowy_editor/src/service/internal_key_event_handlers/select_a
 import 'package:appflowy_editor/src/service/internal_key_event_handlers/page_up_down_handler.dart';
 import 'package:appflowy_editor/src/service/keyboard_service.dart';
 
-List<FlowyKeyEventHandler> defaultKeyEventHandlers = [
+List<AppFlowyKeyEventHandler> defaultKeyEventHandlers = [
   deleteTextHandler,
   slashShortcutHandler,
   arrowKeysHandler,

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/delete_text_handler.dart

@@ -150,7 +150,7 @@ void _deleteNodes(TransactionBuilder transactionBuilder,
 }
 
 // Handle delete text.
-FlowyKeyEventHandler deleteTextHandler = (editorState, event) {
+AppFlowyKeyEventHandler deleteTextHandler = (editorState, event) {
   if (event.logicalKey == LogicalKeyboardKey.backspace) {
     return _handleBackspace(editorState, event);
   }

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart

@@ -18,7 +18,7 @@ import 'package:appflowy_editor/src/service/keyboard_service.dart';
 /// 2. Single selection and the selected node is [TextNode]
 ///   2.1 split the node into two nodes with style
 ///   2.2 or insert a empty text node before.
-FlowyKeyEventHandler enterWithoutShiftInTextNodesHandler =
+AppFlowyKeyEventHandler enterWithoutShiftInTextNodesHandler =
     (editorState, event) {
   if (event.logicalKey != LogicalKeyboardKey.enter || event.isShiftPressed) {
     return KeyEventResult.ignored;

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/page_up_down_handler.dart

@@ -2,7 +2,7 @@ import 'package:appflowy_editor/appflowy_editor.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
-FlowyKeyEventHandler pageUpDownHandler = (editorState, event) {
+AppFlowyKeyEventHandler pageUpDownHandler = (editorState, event) {
   if (event.logicalKey == LogicalKeyboardKey.pageUp) {
     final scrollHeight = editorState.service.scrollService?.onePageHeight;
     final scrollService = editorState.service.scrollService;

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/redo_undo_handler.dart

@@ -2,7 +2,7 @@ import 'package:appflowy_editor/src/service/keyboard_service.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
-FlowyKeyEventHandler redoUndoKeysHandler = (editorState, event) {
+AppFlowyKeyEventHandler redoUndoKeysHandler = (editorState, event) {
   if (event.isMetaPressed && event.logicalKey == LogicalKeyboardKey.keyZ) {
     if (event.isShiftPressed) {
       editorState.undoManager.redo();

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/select_all_handler.dart

@@ -18,7 +18,7 @@ KeyEventResult _selectAll(EditorState editorState) {
   return KeyEventResult.handled;
 }
 
-FlowyKeyEventHandler selectAllHandler = (editorState, event) {
+AppFlowyKeyEventHandler selectAllHandler = (editorState, event) {
   if (event.isMetaPressed && event.logicalKey == LogicalKeyboardKey.keyA) {
     return _selectAll(editorState);
   }

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/slash_handler.dart

@@ -67,7 +67,7 @@ final List<PopupListItem> _popupListItems = [
 OverlayEntry? _popupListOverlay;
 EditorState? _editorState;
 bool _selectionChangeBySlash = false;
-FlowyKeyEventHandler slashShortcutHandler = (editorState, event) {
+AppFlowyKeyEventHandler slashShortcutHandler = (editorState, event) {
   if (event.logicalKey != LogicalKeyboardKey.slash) {
     return KeyEventResult.ignored;
   }

+ 2 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/update_text_style_by_command_x_handler.dart

@@ -5,7 +5,8 @@ import 'package:appflowy_editor/src/service/default_text_operations/format_rich_
 import 'package:appflowy_editor/src/service/keyboard_service.dart';
 import 'package:flutter/services.dart';
 
-FlowyKeyEventHandler updateTextStyleByCommandXHandler = (editorState, event) {
+AppFlowyKeyEventHandler updateTextStyleByCommandXHandler =
+    (editorState, event) {
   if (!event.isMetaPressed) {
     return KeyEventResult.ignored;
   }

+ 1 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/whitespace_handler.dart

@@ -20,7 +20,7 @@ const _bulletedListSymbols = ['*', '-'];
 const _checkboxListSymbols = ['[x]', '-[x]'];
 const _unCheckboxListSymbols = ['[]', '-[]'];
 
-FlowyKeyEventHandler whiteSpaceHandler = (editorState, event) {
+AppFlowyKeyEventHandler whiteSpaceHandler = (editorState, event) {
   if (event.logicalKey != LogicalKeyboardKey.space) {
     return KeyEventResult.ignored;
   }

+ 9 - 9
frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart

@@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
 
 import 'package:flutter/material.dart';
 
-/// [FlowyKeyboardService] is responsible for processing shortcut keys,
+/// [AppFlowyKeyboardService] is responsible for processing shortcut keys,
 ///   like command, shift, control keys.
 ///
 /// Usually, this service can be obtained by the following code.
@@ -18,7 +18,7 @@ import 'package:flutter/material.dart';
 /// keyboardService?.disable();
 /// ```
 ///
-abstract class FlowyKeyboardService {
+abstract class AppFlowyKeyboardService {
   /// Processes shortcut key input.
   KeyEventResult onKey(RawKeyEvent event);
 
@@ -35,14 +35,14 @@ abstract class FlowyKeyboardService {
   void disable();
 }
 
-typedef FlowyKeyEventHandler = KeyEventResult Function(
+typedef AppFlowyKeyEventHandler = KeyEventResult Function(
   EditorState editorState,
   RawKeyEvent event,
 );
 
 /// Process keyboard events
-class FlowyKeyboard extends StatefulWidget {
-  const FlowyKeyboard({
+class AppFlowyKeyboard extends StatefulWidget {
+  const AppFlowyKeyboard({
     Key? key,
     required this.handlers,
     required this.editorState,
@@ -51,14 +51,14 @@ class FlowyKeyboard extends StatefulWidget {
 
   final EditorState editorState;
   final Widget child;
-  final List<FlowyKeyEventHandler> handlers;
+  final List<AppFlowyKeyEventHandler> handlers;
 
   @override
-  State<FlowyKeyboard> createState() => _FlowyKeyboardState();
+  State<AppFlowyKeyboard> createState() => _AppFlowyKeyboardState();
 }
 
-class _FlowyKeyboardState extends State<FlowyKeyboard>
-    implements FlowyKeyboardService {
+class _AppFlowyKeyboardState extends State<AppFlowyKeyboard>
+    implements AppFlowyKeyboardService {
   final FocusNode _focusNode = FocusNode(debugLabel: 'flowy_keyboard_service');
 
   bool isFocus = true;

+ 3 - 3
frontend/app_flowy/packages/appflowy_editor/lib/src/service/render_plugin_service.dart

@@ -13,7 +13,7 @@ abstract class NodeWidgetBuilder<T extends Node> {
 
 typedef NodeWidgetBuilders = Map<String, NodeWidgetBuilder>;
 
-abstract class FlowyRenderPluginService {
+abstract class AppFlowyRenderPluginService {
   /// Register render plugin with specified [name].
   ///
   /// [name] should be [Node].type
@@ -55,8 +55,8 @@ class NodeWidgetContext<T extends Node> {
   }
 }
 
-class FlowyRenderPlugin extends FlowyRenderPluginService {
-  FlowyRenderPlugin({
+class AppFlowyRenderPlugin extends AppFlowyRenderPluginService {
+  AppFlowyRenderPlugin({
     required this.editorState,
     required NodeWidgetBuilders builders,
   }) {

+ 7 - 7
frontend/app_flowy/packages/appflowy_editor/lib/src/service/scroll_service.dart

@@ -2,14 +2,14 @@ import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:appflowy_editor/src/extensions/object_extensions.dart';
 
-/// [FlowyScrollService] is responsible for processing document scrolling.
+/// [AppFlowyScrollService] is responsible for processing document scrolling.
 ///
 /// Usually, this service can be obtained by the following code.
 /// ```dart
 /// final keyboardService = editorState.service.scrollService;
 /// ```
 ///
-abstract class FlowyScrollService {
+abstract class AppFlowyScrollService {
   /// Returns the offset of the current document on the vertical axis.
   double get dy;
 
@@ -44,8 +44,8 @@ abstract class FlowyScrollService {
   void disable();
 }
 
-class FlowyScroll extends StatefulWidget {
-  const FlowyScroll({
+class AppFlowyScroll extends StatefulWidget {
+  const AppFlowyScroll({
     Key? key,
     required this.child,
   }) : super(key: key);
@@ -53,11 +53,11 @@ class FlowyScroll extends StatefulWidget {
   final Widget child;
 
   @override
-  State<FlowyScroll> createState() => _FlowyScrollState();
+  State<AppFlowyScroll> createState() => _AppFlowyScrollState();
 }
 
-class _FlowyScrollState extends State<FlowyScroll>
-    implements FlowyScrollService {
+class _AppFlowyScrollState extends State<AppFlowyScroll>
+    implements AppFlowyScrollService {
   final _scrollController = ScrollController();
   final _scrollViewKey = GlobalKey();
 

+ 7 - 7
frontend/app_flowy/packages/appflowy_editor/lib/src/service/selection_service.dart

@@ -13,7 +13,7 @@ import 'package:appflowy_editor/src/render/selection/selectable.dart';
 import 'package:appflowy_editor/src/render/selection/selection_widget.dart';
 import 'package:appflowy_editor/src/service/selection/selection_gesture.dart';
 
-/// [FlowySelectionService] is responsible for processing
+/// [AppFlowySelectionService] is responsible for processing
 /// the [Selection] changes and updates.
 ///
 /// Usually, this service can be obtained by the following code.
@@ -27,7 +27,7 @@ import 'package:appflowy_editor/src/service/selection/selection_gesture.dart';
 /// final nodes = selectionService.currentSelectedNodes;
 /// ```
 ///
-abstract class FlowySelectionService {
+abstract class AppFlowySelectionService {
   /// The current [Selection] in editor.
   ///
   /// The value is null if there is no nodes are selected.
@@ -75,8 +75,8 @@ abstract class FlowySelectionService {
   List<Rect> get selectionRects;
 }
 
-class FlowySelection extends StatefulWidget {
-  const FlowySelection({
+class AppFlowySelection extends StatefulWidget {
+  const AppFlowySelection({
     Key? key,
     this.cursorColor = Colors.black,
     this.selectionColor = const Color.fromARGB(53, 111, 201, 231),
@@ -90,12 +90,12 @@ class FlowySelection extends StatefulWidget {
   final Color selectionColor;
 
   @override
-  State<FlowySelection> createState() => _FlowySelectionState();
+  State<AppFlowySelection> createState() => _AppFlowySelectionState();
 }
 
-class _FlowySelectionState extends State<FlowySelection>
+class _AppFlowySelectionState extends State<AppFlowySelection>
     with WidgetsBindingObserver
-    implements FlowySelectionService {
+    implements AppFlowySelectionService {
   final _cursorKey = GlobalKey(debugLabel: 'cursor');
 
   @override

+ 13 - 13
frontend/app_flowy/packages/appflowy_editor/lib/src/service/service.dart

@@ -5,34 +5,34 @@ import 'package:flutter/material.dart';
 class FlowyService {
   // selection service
   final selectionServiceKey = GlobalKey(debugLabel: 'flowy_selection_service');
-  FlowySelectionService get selectionService {
+  AppFlowySelectionService get selectionService {
     assert(selectionServiceKey.currentState != null &&
-        selectionServiceKey.currentState is FlowySelectionService);
-    return selectionServiceKey.currentState! as FlowySelectionService;
+        selectionServiceKey.currentState is AppFlowySelectionService);
+    return selectionServiceKey.currentState! as AppFlowySelectionService;
   }
 
   // keyboard service
   final keyboardServiceKey = GlobalKey(debugLabel: 'flowy_keyboard_service');
-  FlowyKeyboardService? get keyboardService {
+  AppFlowyKeyboardService? get keyboardService {
     if (keyboardServiceKey.currentState != null &&
-        keyboardServiceKey.currentState is FlowyKeyboardService) {
-      return keyboardServiceKey.currentState! as FlowyKeyboardService;
+        keyboardServiceKey.currentState is AppFlowyKeyboardService) {
+      return keyboardServiceKey.currentState! as AppFlowyKeyboardService;
     }
     return null;
   }
 
   // input service
   final inputServiceKey = GlobalKey(debugLabel: 'flowy_input_service');
-  FlowyInputService? get inputService {
+  AppFlowyInputService? get inputService {
     if (inputServiceKey.currentState != null &&
-        inputServiceKey.currentState is FlowyInputService) {
-      return inputServiceKey.currentState! as FlowyInputService;
+        inputServiceKey.currentState is AppFlowyInputService) {
+      return inputServiceKey.currentState! as AppFlowyInputService;
     }
     return null;
   }
 
   // render plugin service
-  late FlowyRenderPlugin renderPluginService;
+  late AppFlowyRenderPlugin renderPluginService;
 
   // toolbar service
   final toolbarServiceKey = GlobalKey(debugLabel: 'flowy_toolbar_service');
@@ -46,10 +46,10 @@ class FlowyService {
 
   // scroll service
   final scrollServiceKey = GlobalKey(debugLabel: 'flowy_scroll_service');
-  FlowyScrollService? get scrollService {
+  AppFlowyScrollService? get scrollService {
     if (scrollServiceKey.currentState != null &&
-        scrollServiceKey.currentState is FlowyScrollService) {
-      return scrollServiceKey.currentState! as FlowyScrollService;
+        scrollServiceKey.currentState is AppFlowyScrollService) {
+      return scrollServiceKey.currentState! as AppFlowyScrollService;
     }
     return null;
   }