-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: restructure project into modular architecture for flutter_q…
…uill (#2032) * refactor: restructure project into modular architecture for flutter_quill * refactor: move LineHeightAttribute class to custom_attributes.dart * chore: remove nullable controller extension
- Loading branch information
Showing
153 changed files
with
747 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
library flutter_quill.extensions; | ||
|
||
export 'src/models/documents/nodes/leaf.dart'; | ||
export 'src/models/rules/insert.dart'; | ||
export 'src/utils/platform.dart'; | ||
export 'src/utils/string.dart'; | ||
export 'src/utils/widgets.dart'; | ||
export 'src/common/utils/platform.dart'; | ||
export 'src/common/utils/string.dart'; | ||
export 'src/common/utils/widgets.dart'; | ||
export 'src/document/nodes/leaf.dart'; | ||
export 'src/rules/insert.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
library flutter_quill; | ||
|
||
export '/src/widgets/raw_editor/quill_single_child_scroll_view.dart'; | ||
export 'src/extensions/quill_configurations_ext.dart'; | ||
export 'src/models/config/quill_configurations.dart'; | ||
export 'src/models/config/raw_editor/raw_editor_configurations.dart'; | ||
export 'src/models/config/toolbar/toolbar_configurations.dart'; | ||
export 'src/models/documents/attribute.dart'; | ||
export 'src/models/documents/document.dart'; | ||
export 'src/models/documents/nodes/block.dart'; | ||
export 'src/models/documents/nodes/embeddable.dart'; | ||
export 'src/models/documents/nodes/leaf.dart'; | ||
export 'src/models/documents/nodes/line.dart'; | ||
export 'src/models/documents/nodes/node.dart'; | ||
export 'src/models/documents/style.dart'; | ||
export 'src/models/structs/doc_change.dart'; | ||
export 'src/models/structs/image_url.dart'; | ||
export 'src/models/structs/link_dialog_action.dart'; | ||
export 'src/models/structs/offset_value.dart'; | ||
export 'src/models/structs/optional_size.dart'; | ||
export 'src/models/structs/vertical_spacing.dart'; | ||
export 'src/models/themes/quill_dialog_theme.dart'; | ||
export 'src/models/themes/quill_icon_theme.dart'; | ||
export 'src/utils/embeds.dart'; | ||
export 'src/widgets/editor/editor.dart'; | ||
export 'src/widgets/others/cursor.dart'; | ||
export 'src/widgets/others/default_styles.dart'; | ||
export 'src/widgets/others/link.dart'; | ||
export 'src/widgets/quill/embeds.dart'; | ||
export 'src/widgets/quill/quill_controller.dart'; | ||
export 'src/widgets/raw_editor/raw_editor.dart'; | ||
export 'src/widgets/raw_editor/raw_editor_state.dart'; | ||
export 'src/widgets/style_widgets/style_widgets.dart'; | ||
export 'src/widgets/toolbar/base_toolbar.dart'; | ||
export 'src/widgets/toolbar/buttons/alignment/select_alignment_button.dart'; | ||
export 'src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart'; | ||
export 'src/widgets/toolbar/simple_toolbar.dart'; | ||
export 'src/widgets/utils/provider.dart'; | ||
export 'src/common/structs/image_url.dart'; | ||
export 'src/common/structs/offset_value.dart'; | ||
export 'src/common/structs/optional_size.dart'; | ||
export 'src/common/structs/vertical_spacing.dart'; | ||
export 'src/common/utils/embeds.dart'; | ||
export 'src/controller/provider.dart'; | ||
export 'src/controller/quill_controller.dart'; | ||
export 'src/document/attribute.dart'; | ||
export 'src/document/document.dart'; | ||
export 'src/document/nodes/block.dart'; | ||
export 'src/document/nodes/embeddable.dart'; | ||
export 'src/document/nodes/leaf.dart'; | ||
export 'src/document/nodes/line.dart'; | ||
export 'src/document/nodes/node.dart'; | ||
export 'src/document/structs/doc_change.dart'; | ||
export 'src/document/style.dart'; | ||
export 'src/editor/editor.dart'; | ||
export 'src/editor/embed/embed_editor_builder.dart'; | ||
export 'src/editor/provider.dart'; | ||
export 'src/editor/raw_editor/config/raw_editor_configurations.dart'; | ||
export 'src/editor/raw_editor/quill_single_child_scroll_view.dart'; | ||
export 'src/editor/raw_editor/raw_editor.dart'; | ||
export 'src/editor/raw_editor/raw_editor_state.dart'; | ||
export 'src/editor/style_widgets/style_widgets.dart'; | ||
export 'src/editor/widgets/cursor.dart'; | ||
export 'src/editor/widgets/default_styles.dart'; | ||
export 'src/editor/widgets/link.dart'; | ||
export 'src/editor_toolbar_controller_shared/quill_configurations.dart'; | ||
export 'src/editor_toolbar_shared/quill_configurations_ext.dart'; | ||
export 'src/toolbar/base_toolbar.dart'; | ||
export 'src/toolbar/buttons/alignment/select_alignment_button.dart'; | ||
export 'src/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart'; | ||
export 'src/toolbar/config/toolbar_configurations.dart'; | ||
export 'src/toolbar/embed/embed_button_builder.dart'; | ||
export 'src/toolbar/provider.dart'; | ||
export 'src/toolbar/simple_toolbar.dart'; | ||
export 'src/toolbar/simple_toolbar_provider.dart'; | ||
export 'src/toolbar/structs/link_dialog_action.dart'; | ||
export 'src/toolbar/theme/quill_dialog_theme.dart'; | ||
export 'src/toolbar/theme/quill_icon_theme.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
library quill_markdown; | ||
|
||
// TODO: Might avoid exposing the quill_markdown package | ||
|
||
export 'src/packages/quill_markdown/delta_to_markdown.dart'; | ||
export 'src/packages/quill_markdown/embeddable_table_syntax.dart'; | ||
export 'src/packages/quill_markdown/markdown_to_delta.dart'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...src/models/structs/segment_leaf_node.dart → ...src/common/structs/segment_leaf_node.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:flutter/widgets.dart' show BuildContext; | ||
|
||
import '../editor/provider.dart'; | ||
import '../toolbar/simple_toolbar_provider.dart'; | ||
import 'quill_controller.dart'; | ||
|
||
extension QuillControllerExt on BuildContext { | ||
QuillController? get quilController { | ||
return quillSimpleToolbarConfigurations?.controller ?? | ||
quillEditorConfigurations?.controller; | ||
} | ||
|
||
QuillController get requireQuillController { | ||
return quillSimpleToolbarConfigurations?.controller ?? | ||
quillEditorConfigurations?.controller ?? | ||
(throw ArgumentError( | ||
'The quill provider is required, you must only call requireQuillController inside the QuillToolbar and QuillEditor')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/src/models/documents/delta_x.dart → lib/src/delta/delta_x.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'attribute.dart'; | ||
|
||
// Attributes that don't conform to standard Quill Delta | ||
// and are not compatible with https://quilljs.com/docs/delta/ | ||
|
||
/// This attribute represents the space between text lines. The line height can be | ||
/// adjusted using predefined constants or custom values | ||
/// | ||
/// The attribute at the json looks like: "attributes":{"line-height": 1.5 } | ||
class LineHeightAttribute extends Attribute<double?> { | ||
const LineHeightAttribute({double? lineHeight}) | ||
: super('line-height', AttributeScope.block, lineHeight); | ||
|
||
static const Attribute<double?> lineHeightNormal = | ||
LineHeightAttribute(lineHeight: 1); | ||
|
||
static const Attribute<double?> lineHeightTight = | ||
LineHeightAttribute(lineHeight: 1.15); | ||
|
||
static const Attribute<double?> lineHeightOneAndHalf = | ||
LineHeightAttribute(lineHeight: 1.5); | ||
|
||
static const Attribute<double?> lineHeightDouble = | ||
LineHeightAttribute(lineHeight: 2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
lib/src/models/documents/history.dart → lib/src/document/history.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...src/models/documents/nodes/container.dart → lib/src/document/nodes/container.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.