Merge branch 'master' of https://github.com/Alspb/flutter-quill into export_link_functions

pull/2008/head
Alspb 9 months ago
commit 4d0c583597
  1. 16
      CHANGELOG.md
  2. 2
      CHANGELOG_DATA.json
  3. 16
      dart_quill_delta/CHANGELOG.md
  4. 2
      dart_quill_delta/pubspec.yaml
  5. 16
      flutter_quill_extensions/CHANGELOG.md
  6. 102
      flutter_quill_extensions/README.md
  7. 2
      flutter_quill_extensions/pubspec.yaml
  8. 16
      flutter_quill_test/CHANGELOG.md
  9. 2
      flutter_quill_test/pubspec.yaml
  10. 11
      lib/src/models/config/editor/editor_configurations.dart
  11. 3
      lib/src/models/config/raw_editor/raw_editor_configurations.dart
  12. 2
      lib/src/widgets/editor/editor.dart
  13. 6
      lib/src/widgets/raw_editor/raw_editor_state.dart
  14. 4
      pubspec.yaml
  15. 3
      test/utils/delta_x_test.dart

@ -4,6 +4,22 @@
All notable changes to this project will be documented in this file.
## 9.5.17
* Feat(config): added option to disable automatic list conversion by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2011
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.16...v9.5.17
## 9.5.16
* chore: drop support for HTML, PDF, and Markdown converting functions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/1997
* docs(readme): update the extensions package to document the Rich Text Paste feature on web by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2001
* Fix(test): delta_x tests fail by wrong expected Delta for video embed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2010
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.15...v9.5.16
## 9.5.15
* Update delta_from_html to fix nested lists issues and more by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2000

File diff suppressed because one or more lines are too long

@ -4,6 +4,22 @@
All notable changes to this project will be documented in this file.
## 9.5.17
* Feat(config): added option to disable automatic list conversion by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2011
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.16...v9.5.17
## 9.5.16
* chore: drop support for HTML, PDF, and Markdown converting functions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/1997
* docs(readme): update the extensions package to document the Rich Text Paste feature on web by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2001
* Fix(test): delta_x tests fail by wrong expected Delta for video embed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2010
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.15...v9.5.16
## 9.5.15
* Update delta_from_html to fix nested lists issues and more by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2000

@ -1,6 +1,6 @@
name: dart_quill_delta
description: A port of quill-js-delta from typescript to dart
version: 9.5.15
version: 9.5.17
homepage: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/
repository: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/
issue_tracker: https://github.com/singerdmx/flutter-quill/issues/

@ -4,6 +4,22 @@
All notable changes to this project will be documented in this file.
## 9.5.17
* Feat(config): added option to disable automatic list conversion by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2011
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.16...v9.5.17
## 9.5.16
* chore: drop support for HTML, PDF, and Markdown converting functions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/1997
* docs(readme): update the extensions package to document the Rich Text Paste feature on web by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2001
* Fix(test): delta_x tests fail by wrong expected Delta for video embed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2010
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.15...v9.5.16
## 9.5.15
* Update delta_from_html to fix nested lists issues and more by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2000

@ -19,6 +19,7 @@ Check [Flutter Quill](https://github.com/singerdmx/flutter-quill) for details of
- [📦 Embed Blocks](#-embed-blocks)
- [🔍 Element properties](#-element-properties)
- [🔧 Custom Element properties](#-custom-element-properties)
- [📝 Rich Text Paste Feature](#-rich-text-paste-feature)
- [🖼 Image Assets](#-image-assets)
- [🎯 Drag and drop feature](#-drag-and-drop-feature)
- [💡 Features](#-features)
@ -72,8 +73,8 @@ The package uses the following plugins:
Android, iOS, and macOS, we must inform you that you can't pick photos using the camera on a desktop so make sure to
handle that if you plan on adding support for the desktop, this may change in the future, and for more info follow
this [link](https://pub.dev/packages/image_picker#windows-macos-and-linux)
5. [`super_clipboard`](https://pub.dev/packages/super_clipboard) which needs some setup on Android only, is used to
support copying images and pasting them into the editor then you must set up it, open the page in pub.dev, and read
5. [`super_clipboard`](https://pub.dev/packages/super_clipboard) which needs some setup on Android only, it's used to
support copying images and pasting them into editor, it's also required to support rich text pasting feature on non-web platforms, open the page in pub.dev and read
the `README.md` or click on this [link](https://pub.dev/packages/super_clipboard#android-support) to get the
instructions.
@ -96,44 +97,29 @@ The minSdkVersion is `23` as `super_clipboard` requires it
## 🚀 Usage
Start using the package in 3 steps:
Be sure to follow the [Installation](#installation) section.
1. Be sure to follow the [Installation](#installation) section.
2. This package already includes `super_clipboard` and will be used internally in this package, to use it
in `flutter_quill`, call this function before using any of the widgets or functionalities
Set the `embedBuilders` and `embedToolbar` params in configurations of `QuillEditor` and `QuillToolbar`.
```dart
FlutterQuillExtensions.useSuperClipboardPlugin();
```
`super_clipboard` is a comprehensive plugin that provides many clipboard features for reading and writing rich text,
images and other formats.
Executing this function will allow `flutter_quill` to use modern rich text features to paste HTML and Markdown,
support for GIF files, and other formats.
3. Set the `embedBuilders` and `embedToolbar` params in configurations of `QuillEditor` and `QuillToolbar` with the
values provided by this repository.
**Quill Toolbar**:
```dart
QuillToolbar(
configurations: QuillToolbarConfigurations(
embedButtons: FlutterQuillEmbeds.toolbarButtons(),
),
),
```
**Quill Toolbar**:
```dart
QuillToolbar(
configurations: QuillToolbarConfigurations(
embedButtons: FlutterQuillEmbeds.toolbarButtons(),
),
**Quill Editor**:
```dart
Expanded(
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(
embedBuilders: kIsWeb ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders(),
),
```
**Quill Editor**
```dart
Expanded(
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(
embedBuilders: kIsWeb ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders(),
),
),
)
```
),
)
```
## ⚙ Configurations
@ -182,6 +168,50 @@ Define flutterAlignment` as follows:
This works for all platforms except Web
### 📝 Rich Text Paste Feature
The Rich Text Pasting feature requires native code to access
the `Clipboard` data as HTML, the plugin `super_clipboard` is required on all platforms except Web.
This package already includes `super_clipboard` and will be used internally in this package, to use it
in `flutter_quill`, call this function before using any of the widgets or functionalities:
```dart
FlutterQuillExtensions.useSuperClipboardPlugin();
```
`super_clipboard` is a comprehensive plugin that provides many clipboard features for reading and writing rich text,
images and other formats.
Executing this function will allow `flutter_quill` to use modern rich text features to paste HTML and Markdown,
support for GIF files, and other formats.
> [!IMPORTANT]
> On web platforms, you can only get the HTML from `Clipboard` on the
> `paste` event, `super_clipboard`, or any plugin is not required.
> The paste feature will not work using the standard paste hotkey logic.
> As such, you will be unable to use the **Rich Text Paste Feature** on a button or in the web app itself.
> So you might want to either display a dialog when pressing the paste button that explains the limitation and shows the hotkey they need to press in order to paste or develop an extension for the browser that bypasses this limitation similarly to **Google Docs** and provide a link to install the browser extension.
> See [Issue #1998](https://github.com/singerdmx/flutter-quill/issues/1998) for more details.
To register the `paste` event:
```dart
import 'package:web/web.dart';
EventStreamProviders.pasteEvent.forTarget(web.document).listen((e) {
final html = e.clipboardData?.getData('text/html');
// Convert the HTML to Delta and paste it into the editor
});
```
Don't forget to cancel the `StreamSubscription` when no longer needed.
> [!NOTE]
> We're still planning on how this should be implemented in
> [Issue #1998](https://github.com/singerdmx/flutter-quill/issues/1998).
### 🖼 Image Assets
If you want to use image assets in the Quill Editor, you need to make sure your assets folder is `assets` otherwise:

@ -1,6 +1,6 @@
name: flutter_quill_extensions
description: Embed extensions for flutter_quill including image, video, formula and etc.
version: 9.5.15
version: 9.5.17
homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/
repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/
issue_tracker: https://github.com/singerdmx/flutter-quill/issues/

@ -4,6 +4,22 @@
All notable changes to this project will be documented in this file.
## 9.5.17
* Feat(config): added option to disable automatic list conversion by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2011
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.16...v9.5.17
## 9.5.16
* chore: drop support for HTML, PDF, and Markdown converting functions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/1997
* docs(readme): update the extensions package to document the Rich Text Paste feature on web by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2001
* Fix(test): delta_x tests fail by wrong expected Delta for video embed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2010
**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.15...v9.5.16
## 9.5.15
* Update delta_from_html to fix nested lists issues and more by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2000

@ -1,6 +1,6 @@
name: flutter_quill_test
description: Test utilities for flutter_quill which includes methods to simplify interacting with the editor in test cases.
version: 9.5.15
version: 9.5.17
homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/
repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/
issue_tracker: https://github.com/singerdmx/flutter-quill/issues/

@ -53,6 +53,7 @@ class QuillEditorConfigurations extends Equatable {
this.onSingleLongTapStart,
this.onSingleLongTapMoveUpdate,
this.onSingleLongTapEnd,
this.enableMarkdownStyleConversion = true,
this.embedBuilders,
this.unknownEmbedBuilder,
this.linkActionPickerDelegate = defaultLinkActionPickerDelegate,
@ -127,6 +128,13 @@ class QuillEditorConfigurations extends Equatable {
final bool scrollable;
final double scrollBottomInset;
/// Configuration to enable or disable automatic Markdown style conversions.
///
/// This setting controls the behavior of input. Specifically, when enabled,
/// entering '1.' followed by a space or '-' followed by a space
/// will automatically convert the input into a Markdown list format.
final bool enableMarkdownStyleConversion;
/// Additional space around the content of this editor.
/// by default will be [EdgeInsets.zero]
final EdgeInsetsGeometry padding;
@ -385,6 +393,7 @@ class QuillEditorConfigurations extends Equatable {
bool? checkBoxReadOnly,
bool? disableClipboard,
bool? scrollable,
bool? enableMarkdownStyleConversion,
double? scrollBottomInset,
EdgeInsetsGeometry? padding,
bool? autoFocus,
@ -439,6 +448,8 @@ class QuillEditorConfigurations extends Equatable {
scrollable: scrollable ?? this.scrollable,
scrollBottomInset: scrollBottomInset ?? this.scrollBottomInset,
padding: padding ?? this.padding,
enableMarkdownStyleConversion:
enableMarkdownStyleConversion ?? this.enableMarkdownStyleConversion,
autoFocus: autoFocus ?? this.autoFocus,
isOnTapOutsideEnabled:
isOnTapOutsideEnabled ?? this.isOnTapOutsideEnabled,

@ -67,6 +67,7 @@ class QuillRawEditorConfigurations extends Equatable {
this.customActions,
this.expands = false,
this.isOnTapOutsideEnabled = true,
this.enableMarkdownStyleConversion = true,
this.onTapOutside,
this.keyboardAppearance,
this.enableInteractiveSelection = true,
@ -100,6 +101,8 @@ class QuillRawEditorConfigurations extends Equatable {
/// Additional space around the editor contents.
final EdgeInsetsGeometry padding;
final bool enableMarkdownStyleConversion;
/// Whether the text can be changed.
///
/// When this is set to true, the text cannot be modified

@ -236,6 +236,8 @@ class QuillEditorState extends State<QuillEditor>
focusNode: widget.focusNode,
scrollController: widget.scrollController,
scrollable: configurations.scrollable,
enableMarkdownStyleConversion:
configurations.enableMarkdownStyleConversion,
scrollBottomInset: configurations.scrollBottomInset,
padding: configurations.padding,
readOnly: configurations.readOnly,

@ -785,10 +785,12 @@ class QuillRawEditorState extends EditorState
const olKeyPhrase = '1.';
const ulKeyPhrase = '-';
final enableMdConversion =
widget.configurations.enableMarkdownStyleConversion;
if (text.value == olKeyPhrase) {
if (text.value == olKeyPhrase && enableMdConversion) {
_updateSelectionForKeyPhrase(olKeyPhrase, Attribute.ol);
} else if (text.value == ulKeyPhrase) {
} else if (text.value == ulKeyPhrase && enableMdConversion) {
_updateSelectionForKeyPhrase(ulKeyPhrase, Attribute.ul);
} else {
return KeyEventResult.ignored;

@ -1,6 +1,6 @@
name: flutter_quill
description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter.
version: 9.5.15
version: 9.5.17
homepage: https://1o24bbs.com/c/bulletjournal/108/
repository: https://github.com/singerdmx/flutter-quill/
issue_tracker: https://github.com/singerdmx/flutter-quill/issues/
@ -54,7 +54,7 @@ dependencies:
flutter_colorpicker: ^1.1.0
# For converting HTML to Quill delta
flutter_quill_delta_from_html: ^1.3.0
flutter_quill_delta_from_html: ^1.3.1
markdown: ^7.2.1
charcode: ^1.3.1

@ -32,14 +32,13 @@ void main() {
]);
final expectedDeltaVideo = Delta.fromOperations([
Operation.insert('\n'),
Operation.insert({'video': 'https://www.youtube.com/embed/dQw4w9WgXcQ'}),
Operation.insert('\n'),
]);
final expectedDeltaLinkAndVideoLink = Delta.fromOperations([
Operation.insert('fdsfsd', {'link': 'https://www.macrumors.com/'}),
Operation.insert('\n\n'),
Operation.insert('\n'),
Operation.insert({'video': 'https://www.youtube.com/embed/dQw4w9WgXcQ'}),
Operation.insert('\n'),
]);

Loading…
Cancel
Save