diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aefda4b23..9adb75e62 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,6 @@ jobs: - name: πŸ“¦ Install flutter_quill_test dependencies run: flutter pub get -C flutter_quill_test - - name: πŸ“¦ Install quill_native_bridge dependencies - run: flutter pub get -C quill_native_bridge - - name: πŸ” Run Flutter analysis run: flutter analyze diff --git a/README.md b/README.md index e8e12ee71..7ac721aa7 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ You can join our [Slack Group] for discussion. - [πŸ“¦ Embed Blocks](#-embed-blocks) - [πŸ”„ Conversion to HTML](#-conversion-to-html) - [πŸ“ Spelling checker](#-spelling-checker) +- [πŸ“ Rich Text Paste](#-rich-text-paste) - [βœ‚οΈ Shortcut events](#-shortcut-events) - [🌐 Translation](#-translation) - [πŸ§ͺ Testing](#-testing) @@ -108,20 +109,57 @@ dependencies: The `flutter_quill` package uses the following plugins: -1. [`url_launcher`](https://pub.dev/packages/url_launcher) to open links. -2. [`quill_native_bridge`](https://pub.dev/packages/quill_native_bridge) to access platform-specific APIs for the +1. [`url_launcher`](https://pub.dev/packages/url_launcher): to open links. +2. [`quill_native_bridge`](https://pub.dev/packages/quill_native_bridge): to access platform-specific APIs for the editor. 3. [`flutter_keyboard_visibility_temp_fork`](https://pub.dev/packages/flutter_keyboard_visibility_temp_fork) to listen for keyboard - visibility - changes. + visibility changes. -All of them don't require any platform-specific setup. +### Android Configuration for `quill_native_bridge` + +To support copying images to the clipboard to be accessed by other apps, you need to configure your Android project. +If not set up, a warning will appear in the log during debug mode only. + +> [!TIP] +> This is only required on **Android** for this optional feature. +> You should be able to copy images and paste them inside the editor without any additional configuration. + +**1. Update `AndroidManifest.xml`** + +Open `your_project/android/app/src/main/AndroidManifest.xml` and add the following inside the `` tag: + +```xml + + + ... + + + + ... + + +``` + +**2. Create `file_paths.xml`** + +Create the file `your_project/android/app/src/main/res/xml/file_paths.xml` with the following content: + +```xml + + + +``` > [!NOTE] -> Starting from Flutter Quill `9.4.x`, [super_clipboard](https://pub.dev/packages/super_clipboard) has been moved -> to [FlutterQuill Extensions], to use rich text pasting, support pasting images, and gif files from external apps or -> websites, take a look -> at `flutter_quill_extensions` Readme. +> [super_clipboard](https://pub.dev/packages/super_clipboard) is no longer required +> in recent versions of Flutter Quill in `flutter_quill` or `flutter_quill_extensions`. +> [`quill_native_bridge`](https://pub.dev/packages/quill_native_bridge) is a plugin that provide clipboard operations functionality for `flutter_quill`. ## πŸš€ Usage @@ -307,6 +345,16 @@ The following packages can be used: This feature is currently not implemented and is being planned. Refer to [#2246](https://github.com/singerdmx/flutter-quill/issues/2246) for discussion. +## πŸ“ Rich Text Paste + +This feature allows the user to paste the content copied from other apps into the editor as rich text. +The plugin [`quill_native_bridge`](https://pub.dev/packages/quill_native_bridge) provides access to the system Clipboard. + +> [!IMPORTANT] +> Currently this feature is not supported on the web. +> See [issue #1998](https://github.com/singerdmx/flutter-quill/issues/1998) and [issue #2220](https://github.com/singerdmx/flutter-quill/issues/2220) + for more details + ## βœ‚οΈ Shortcut events We can customize some Shorcut events, using the parameters `characterShortcutEvents` or `spaceShortcutEvents` from `QuillEditorConfigurations` to add more functionality to our editor. diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index e68e61dfa..b4ca5acfe 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -62,5 +62,16 @@ android:authorities="com.example.example.SuperClipboardDataProvider" android:exported="true" android:grantUriPermissions="true" /> + + + + + \ No newline at end of file diff --git a/example/android/app/src/main/res/xml/file_paths.xml b/example/android/app/src/main/res/xml/file_paths.xml new file mode 100644 index 000000000..11a4d5070 --- /dev/null +++ b/example/android/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index 499b11bca..27e107671 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -7,7 +7,6 @@ import 'package:flutter_localizations/flutter_localizations.dart' GlobalWidgetsLocalizations; import 'package:flutter_quill/flutter_quill.dart' show Document; import 'package:flutter_quill/translations.dart' show FlutterQuillLocalizations; -import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'; import 'screens/home/widgets/home_screen.dart'; import 'screens/quill/quill_screen.dart'; @@ -20,8 +19,6 @@ import 'screens/settings/widgets/settings_screen.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - // ignore: deprecated_member_use - FlutterQuillExtensions.useSuperClipboardPlugin(); runApp(const MyApp()); } diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index bf1bbe800..988945165 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -11,6 +11,7 @@ import file_selector_macos import gal import irondash_engine_context import path_provider_foundation +import quill_native_bridge_macos import share_plus import sqflite import super_native_extensions @@ -24,6 +25,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin")) IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + QuillNativeBridgePlugin.register(with: registry.registrar(forPlugin: "QuillNativeBridgePlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin")) diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 72d8d70f9..d9fe20ac9 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -5,19 +5,17 @@ PODS: - FlutterMacOS - file_selector_macos (0.0.1): - FlutterMacOS - - flutter_inappwebview_macos (0.0.1): - - FlutterMacOS - - OrderedSet (~> 5.0) - FlutterMacOS (1.0.0) - gal (1.0.0): - Flutter - FlutterMacOS - irondash_engine_context (0.0.1): - FlutterMacOS - - OrderedSet (5.0.0) - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS + - quill_native_bridge_macos (0.0.1): + - FlutterMacOS - share_plus (0.0.1): - FlutterMacOS - sqflite (0.0.3): @@ -35,21 +33,17 @@ DEPENDENCIES: - desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`) - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - - flutter_inappwebview_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - gal (from `Flutter/ephemeral/.symlinks/plugins/gal/darwin`) - irondash_engine_context (from `Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - quill_native_bridge_macos (from `Flutter/ephemeral/.symlinks/plugins/quill_native_bridge_macos/macos`) - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`) - super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - video_player_avfoundation (from `Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin`) -SPEC REPOS: - trunk: - - OrderedSet - EXTERNAL SOURCES: desktop_drop: :path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos @@ -57,8 +51,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos file_selector_macos: :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos - flutter_inappwebview_macos: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos FlutterMacOS: :path: Flutter/ephemeral gal: @@ -67,6 +59,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + quill_native_bridge_macos: + :path: Flutter/ephemeral/.symlinks/plugins/quill_native_bridge_macos/macos share_plus: :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos sqflite: @@ -82,12 +76,11 @@ SPEC CHECKSUMS: desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720 file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2 - flutter_inappwebview_macos: 9600c9df9fdb346aaa8933812009f8d94304203d FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1 irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478 - OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + quill_native_bridge_macos: f90985c5269ac7ba84d933605b463d96e5f544fe share_plus: 36537c04ce0c3e3f5bd297ce4318b6d5ee5fd6cf sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index d87d3c7c3..5666871d5 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -59,7 +59,6 @@ dependency_overrides: flutter_quill_test: path: ../flutter_quill_test - dev_dependencies: flutter_test: sdk: flutter diff --git a/flutter_quill_extensions/README.md b/flutter_quill_extensions/README.md index 8a6ab3388..98988ae9d 100644 --- a/flutter_quill_extensions/README.md +++ b/flutter_quill_extensions/README.md @@ -50,11 +50,6 @@ The package uses the following plugins: platform-specific setup. 2. [`image_picker`](https://pub.dev/packages/image_picker) for picking images. See the [Installation](https://pub.dev/packages/image_picker#installation) section. -3. [`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 [Android Support](https://pub.dev/packages/super_clipboard#android-support) page for - instructions. - The `minSdkVersion` for **Android** is `23` as `super_clipboard` requires it ### Loading Images from the Internet @@ -151,35 +146,8 @@ This works only for non-web platforms. ### πŸ“ 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. - -Calling 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. - -> [!NOTE] -> We're still planning on how this should be implemented in -> [Issue #1998](https://github.com/singerdmx/flutter-quill/issues/1998). +The rich text paste feature is now supported directly in `flutter_quill` +as platform code is not bundled with the project. ### πŸ–ΌοΈ Image Assets diff --git a/flutter_quill_extensions/lib/flutter_quill_extensions.dart b/flutter_quill_extensions/lib/flutter_quill_extensions.dart index 3abf9314e..e36dce9e1 100644 --- a/flutter_quill_extensions/lib/flutter_quill_extensions.dart +++ b/flutter_quill_extensions/lib/flutter_quill_extensions.dart @@ -1,7 +1,7 @@ library; -// ignore: implementation_imports -import 'package:flutter_quill/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart'; +import 'package:flutter_quill/flutter_quill_internal.dart' + show ClipboardServiceProvider; import 'package:meta/meta.dart' show experimental; import 'src/editor_toolbar_controller_shared/clipboard/super_clipboard_service.dart'; @@ -64,8 +64,11 @@ class FlutterQuillExtensions { /// to allow `flutter_quill` package to use `super_clipboard` plugin /// to support rich text features, gif and images. @Deprecated( - 'Should not be used anymore as super_clipboard will moved outside of flutter_quill_extensions soon.\n' - 'A replacement is being made in https://github.com/singerdmx/flutter-quill/pull/2230', + 'The functionality of super_clipboard is now built-in in recent versions of flutter_quill.\n' + 'To migrate, remove this function call and see ' + 'https://pub.dev/packages/quill_native_bridge#-platform-configuration (optional for copying images on Android) to use quill_native_bridge implementation (the new default).\n' + 'Or if you want to use super_clipboard implementation (support might discontinued in newer versions), use the package https://pub.dev/packages/quill_super_clipboard\n' + 'See https://github.com/singerdmx/flutter-quill/pull/2230 for more details.', ) @experimental static void useSuperClipboardPlugin() { diff --git a/flutter_quill_extensions/lib/src/common/utils/utils.dart b/flutter_quill_extensions/lib/src/common/utils/utils.dart index f8fa05f4f..7e6b6d8ca 100644 --- a/flutter_quill_extensions/lib/src/common/utils/utils.dart +++ b/flutter_quill_extensions/lib/src/common/utils/utils.dart @@ -1,8 +1,6 @@ import 'dart:io' show File; -import 'package:cross_file/cross_file.dart'; -import 'package:flutter/foundation.dart' show Uint8List, immutable; -import 'package:http/http.dart' as http; +import 'package:flutter/foundation.dart' show immutable; import '../../editor/image/widgets/image.dart'; import '../../editor_toolbar_shared/image_saver/s_image_saver.dart'; @@ -51,23 +49,6 @@ class SaveImageResult { final SaveImageResultMethod method; } -Future convertImageToUint8List(String image) async { - if (isHttpBasedUrl(image)) { - final response = await http.get(Uri.parse(image)); - if (response.statusCode == 200) { - return Uint8List.fromList(response.bodyBytes); - } - return null; - } - // TODO: Add support for all image providers like AssetImage - try { - final file = XFile(image); - return await file.readAsBytes(); - } catch (e) { - return null; - } -} - Future saveImage({ required String imageUrl, required ImageSaverService imageSaverService, diff --git a/flutter_quill_extensions/lib/src/editor/image/image_embed.dart b/flutter_quill_extensions/lib/src/editor/image/image_embed.dart index 4e41985dd..5e6985541 100644 --- a/flutter_quill_extensions/lib/src/editor/image/image_embed.dart +++ b/flutter_quill_extensions/lib/src/editor/image/image_embed.dart @@ -29,8 +29,6 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder { bool inline, TextStyle textStyle, ) { - // assert(!kIsWeb, 'Please provide image EmbedBuilder for Web'); - final imageSource = standardizeImageUrl(node.value.data); final ((imageSize), margin, alignment) = getElementAttributes( node, @@ -40,7 +38,7 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder { final width = imageSize.width; final height = imageSize.height; - final image = getImageWidgetByImageSource( + final imageWidget = getImageWidgetByImageSource( context: context, imageSource, imageProviderBuilder: configurations.imageProviderBuilder, @@ -72,6 +70,7 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder { imageSize: imageSize, isReadOnly: readOnly, imageSaverService: imageSaverService, + imageProvider: imageWidget.image, ), ), ); @@ -81,10 +80,10 @@ class QuillEditorImageEmbedBuilder extends EmbedBuilder { if (margin != null) { return Padding( padding: EdgeInsets.all(margin), - child: image, + child: imageWidget, ); } - return image; + return imageWidget; }, ), ); diff --git a/flutter_quill_extensions/lib/src/editor/image/image_menu.dart b/flutter_quill_extensions/lib/src/editor/image/image_menu.dart index 36e009c5c..6f64c4e5f 100644 --- a/flutter_quill_extensions/lib/src/editor/image/image_menu.dart +++ b/flutter_quill_extensions/lib/src/editor/image/image_menu.dart @@ -1,11 +1,13 @@ +import 'dart:async' show Completer; +import 'dart:ui' as ui; + import 'package:flutter/cupertino.dart' show showCupertinoModalPopup; -import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:flutter/foundation.dart' show kIsWeb, Uint8List; import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart' show ImageUrl, QuillController, StyleAttribute, getEmbedNode; import 'package:flutter_quill/flutter_quill_internal.dart'; import 'package:flutter_quill/translations.dart'; -import 'package:super_clipboard/super_clipboard.dart'; import '../../common/utils/element_utils/element_utils.dart'; import '../../common/utils/string.dart'; @@ -24,6 +26,7 @@ class ImageOptionsMenu extends StatelessWidget { required this.imageSize, required this.isReadOnly, required this.imageSaverService, + required this.imageProvider, super.key, }); @@ -33,6 +36,7 @@ class ImageOptionsMenu extends StatelessWidget { final ElementSize imageSize; final bool isReadOnly; final ImageSaverService imageSaverService; + final ImageProvider imageProvider; @override Widget build(BuildContext context) { @@ -87,22 +91,16 @@ class ImageOptionsMenu extends StatelessWidget { leading: const Icon(Icons.copy_all_outlined), title: Text(context.loc.copy), onTap: () async { - final navigator = Navigator.of(context); - final imageNode = - getEmbedNode(controller, controller.selection.start).value; - final image = imageNode.value.data; + Navigator.of(context).pop(); controller.copiedImageUrl = ImageUrl( - image, + imageSource, getImageStyleString(controller), ); - final data = await convertImageToUint8List(image); - final clipboard = SystemClipboard.instance; - if (data != null) { - final item = DataWriterItem()..add(Formats.png(data)); - await clipboard?.write([item]); + final imageBytes = await _loadImageBytesFromImageProvider(); + if (imageBytes != null) { + await ClipboardServiceProvider.instance.copyImage(imageBytes); } - navigator.pop(); }, ), if (!isReadOnly) @@ -199,4 +197,23 @@ class ImageOptionsMenu extends StatelessWidget { ), ); } + + // TODO: This will load the image again, in case it was network image + // then it will send a GET request each time to load the image. + Future _loadImageBytesFromImageProvider() async { + final stream = imageProvider.resolve(ImageConfiguration.empty); + final completer = Completer(); + + ImageStreamListener? listener; + listener = ImageStreamListener((info, _) { + completer.complete(info.image); + stream.removeListener(listener!); + }); + + stream.addListener(listener); + + final image = await completer.future; + final byteData = await image.toByteData(format: ui.ImageByteFormat.png); + return byteData?.buffer.asUint8List(); + } } diff --git a/flutter_quill_extensions/lib/src/editor_toolbar_controller_shared/clipboard/super_clipboard_service.dart b/flutter_quill_extensions/lib/src/editor_toolbar_controller_shared/clipboard/super_clipboard_service.dart index cd83b410e..51466ff61 100644 --- a/flutter_quill_extensions/lib/src/editor_toolbar_controller_shared/clipboard/super_clipboard_service.dart +++ b/flutter_quill_extensions/lib/src/editor_toolbar_controller_shared/clipboard/super_clipboard_service.dart @@ -2,14 +2,16 @@ import 'dart:async' show Completer; import 'dart:convert' show utf8; import 'package:flutter/foundation.dart'; -// ignore: implementation_imports -import 'package:flutter_quill/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart'; +import 'package:flutter_quill/flutter_quill_internal.dart' + show ClipboardService; +import 'package:meta/meta.dart' show experimental; import 'package:super_clipboard/super_clipboard.dart'; -/// Implementation based on https://pub.dev/packages/super_clipboard -class SuperClipboardService implements ClipboardService { - /// Null if the Clipboard API is not supported on this platform +/// Implementation using the https://pub.dev/packages/super_clipboard plugin. +@experimental +class SuperClipboardService extends ClipboardService { + /// [Null] if the Clipboard API is not supported on this platform /// https://pub.dev/packages/super_clipboard#usage SystemClipboard? _getSuperClipboard() { return SystemClipboard.instance; @@ -74,99 +76,63 @@ class SuperClipboardService implements ClipboardService { } @override - Future canProvideHtmlText() { - return _canProvide(format: Formats.htmlText); - } - - @override - Future getHtmlText() { + Future getHtmlText() async { + if (!(await _canProvide(format: Formats.htmlText))) { + return null; + } return _provideSimpleValueFormatAsString(format: Formats.htmlText); } @override - Future canProvideHtmlTextFromFile() { - return _canProvide(format: Formats.htmlFile); - } - - @override - Future getHtmlTextFromFile() { - return _provideFileAsString(format: Formats.htmlFile); - } - - @override - Future canProvideMarkdownText() async { - // Formats.markdownText or Formats.mdText does not exist yet in super_clipboard - return false; - } - - @override - Future getMarkdownText() async { - // Formats.markdownText or Formats.mdText does not exist yet in super_clipboard - throw UnsupportedError( - 'SuperClipboardService does not support retrieving image files.', - ); - } - - @override - Future canProvideMarkdownTextFromFile() async { - // Formats.md is for markdown files - return _canProvide(format: Formats.md); - } - - @override - Future getMarkdownTextFromFile() async { - // Formats.md is for markdown files - return _provideFileAsString(format: Formats.md); - } - - @override - Future canProvidePlainText() { - return _canProvide(format: Formats.plainText); + Future getHtmlFile() async { + if (!(await _canProvide(format: Formats.htmlFile))) { + return null; + } + return await _provideFileAsString(format: Formats.htmlFile); } @override - Future getPlainText() { - return _provideSimpleValueFormatAsString(format: Formats.plainText); + Future getGifFile() async { + if (!(await _canProvide(format: Formats.gif))) { + return null; + } + return await _provideFileAsBytes(format: Formats.gif); } - /// This will need to be updated if [getImageFileAsBytes] updated. - /// Notice that even if the copied image is JPEG, it still can be provided - /// as PNG, will handle JPEG check in case this info is incorrect. @override - Future canProvideImageFile() async { + Future getImageFile() async { final canProvidePngFile = await _canProvide(format: Formats.png); if (canProvidePngFile) { - return true; + return _provideFileAsBytes(format: Formats.png); } final canProvideJpegFile = await _canProvide(format: Formats.jpeg); if (canProvideJpegFile) { - return true; + return _provideFileAsBytes(format: Formats.jpeg); } - return false; + return null; } - /// This will need to be updated if [canProvideImageFile] updated. @override - Future getImageFileAsBytes() async { - final canProvidePngFile = await _canProvide(format: Formats.png); - if (canProvidePngFile) { - return _provideFileAsBytes(format: Formats.png); + Future getMarkdownFile() async { + // Formats.md is for markdown files + if (!(await _canProvide(format: Formats.md))) { + return null; } - return _provideFileAsBytes(format: Formats.jpeg); + return await _provideFileAsString(format: Formats.md); } @override - Future canProvideGifFile() { - return _canProvide(format: Formats.gif); - } - - @override - Future getGifFileAsBytes() { - return _provideFileAsBytes(format: Formats.gif); + Future copyImage(Uint8List imageBytes) async { + final clipboard = SystemClipboard.instance; + if (clipboard == null) { + return; + } + final item = DataWriterItem()..add(Formats.png(imageBytes)); + await clipboard.write([item]); } @override - Future canPaste() async { + Future get hasClipboardContent async { final clipboard = _getSuperClipboard(); if (clipboard == null) { return false; diff --git a/flutter_quill_extensions/pubspec_overrides.yaml b/flutter_quill_extensions/pubspec_overrides.yaml new file mode 100644 index 000000000..b4f64788e --- /dev/null +++ b/flutter_quill_extensions/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# TODO: Remove this file completely once https://github.com/singerdmx/flutter-quill/pull/2230 is complete before publishing +dependency_overrides: + flutter_quill: + path: ../ \ No newline at end of file diff --git a/lib/extensions.dart b/lib/extensions.dart index 9ce60ebf1..9b5596b03 100644 --- a/lib/extensions.dart +++ b/lib/extensions.dart @@ -13,6 +13,8 @@ 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/editor_toolbar_controller_shared/clipboard/clipboard_service.dart'; +export 'src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart'; export 'src/rules/delete.dart'; export 'src/rules/format.dart'; export 'src/rules/insert.dart'; diff --git a/lib/flutter_quill_internal.dart b/lib/flutter_quill_internal.dart index 215778ee1..50d2fde78 100644 --- a/lib/flutter_quill_internal.dart +++ b/lib/flutter_quill_internal.dart @@ -15,6 +15,8 @@ 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/editor_toolbar_controller_shared/clipboard/clipboard_service.dart'; +export 'src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart'; export 'src/rules/delete.dart'; export 'src/rules/format.dart'; export 'src/rules/insert.dart'; diff --git a/lib/src/controller/quill_controller.dart b/lib/src/controller/quill_controller.dart index 97a6a5391..2ffdcb049 100644 --- a/lib/src/controller/quill_controller.dart +++ b/lib/src/controller/quill_controller.dart @@ -551,7 +551,7 @@ class QuillController extends ChangeNotifier { } /// Returns whether paste operation was handled here. - /// updateEditor is called if paste operation was successful. + /// [updateEditor] is called if paste operation was successful. Future clipboardPaste({void Function()? updateEditor}) async { if (readOnly || !selection.isValid) return true; @@ -612,7 +612,7 @@ class QuillController extends ChangeNotifier { return false; } - /// Return true if can paste internal image + /// Return `true` if can paste internal image Future _pasteInternalImage() async { final copiedImageUrl = _copiedImageUrl; if (copiedImageUrl != null) { diff --git a/lib/src/controller/quill_controller_rich_paste.dart b/lib/src/controller/quill_controller_rich_paste.dart index ed1ca318c..486516bed 100644 --- a/lib/src/controller/quill_controller_rich_paste.dart +++ b/lib/src/controller/quill_controller_rich_paste.dart @@ -24,11 +24,13 @@ extension QuillControllerRichPaste on QuillController { if (html != null) { return html; } - if (await clipboardService.canProvideHtmlTextFromFile()) { - return await clipboardService.getHtmlTextFromFile(); + final clipboardHtmlText = await clipboardService.getHtmlText(); + if (clipboardHtmlText != null) { + return clipboardHtmlText; } - if (await clipboardService.canProvideHtmlText()) { - return await clipboardService.getHtmlText(); + final clipboardHtmlFile = await clipboardService.getHtmlFile(); + if (clipboardHtmlFile != null) { + return clipboardHtmlFile; } return null; } @@ -61,11 +63,9 @@ extension QuillControllerRichPaste on QuillController { if (markdown != null) { return markdown; } - if (await clipboardService.canProvideMarkdownTextFromFile()) { - return await clipboardService.getMarkdownTextFromFile(); - } - if (await clipboardService.canProvideMarkdownText()) { - return await clipboardService.getMarkdownText(); + final clipboardMarkdownFile = await clipboardService.getMarkdownFile(); + if (clipboardMarkdownFile != null) { + return clipboardMarkdownFile; } return null; } diff --git a/lib/src/editor/raw_editor/raw_editor_state.dart b/lib/src/editor/raw_editor/raw_editor_state.dart index b2c0d044e..b7e3d57e0 100644 --- a/lib/src/editor/raw_editor/raw_editor_state.dart +++ b/lib/src/editor/raw_editor/raw_editor_state.dart @@ -153,8 +153,8 @@ class QuillRawEditorState extends EditorState final onImagePaste = widget.configurations.onImagePaste; if (onImagePaste != null) { - if (await clipboardService.canProvideImageFile()) { - final imageBytes = await clipboardService.getImageFileAsBytes(); + final imageBytes = await clipboardService.getImageFile(); + if (imageBytes != null) { final imageUrl = await onImagePaste(imageBytes); if (imageUrl == null) { return; @@ -171,8 +171,8 @@ class QuillRawEditorState extends EditorState final onGifPaste = widget.configurations.onGifPaste; if (onGifPaste != null) { - if (await clipboardService.canProvideGifFile()) { - final gifBytes = await clipboardService.getGifFileAsBytes(); + final gifBytes = await clipboardService.getGifFile(); + if (gifBytes != null) { final gifUrl = await onGifPaste(gifBytes); if (gifUrl == null) { return; diff --git a/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart b/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart index 848821f52..46e6c3733 100644 --- a/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart +++ b/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service.dart @@ -1,44 +1,32 @@ -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show Uint8List; +import 'package:flutter/services.dart' show Clipboard; +import 'package:meta/meta.dart' show experimental; -/// An abstraction to make it easy to provide different implementations -@immutable +/// A more rich abstraction of Flutter [Clipboard] to support images, rich text +/// and more clipboard operations. +@experimental abstract class ClipboardService { - Future canProvideHtmlText(); - - /// Get Clipboard content as Html Text, this is platform specific and not the - /// same as [getPlainText] for two reasons: - /// 1. The user might want to paste Html text - /// 2. Copying Html text from other apps and use [getPlainText] will ignore - /// the Html content and provide it as text + /// Return HTML from the Clipboard. Future getHtmlText(); - Future canProvideHtmlTextFromFile(); - - /// Get the Html file in the Clipboard from the system - Future getHtmlTextFromFile(); - - Future canProvideMarkdownText(); - - /// Get Clipboard content as Markdown Text, this is platform specific and not the - /// same as [getPlainText] for two reasons: - /// 1. The user might want to paste Markdown text - /// 2. Copying Markdown text from other apps and use [getPlainText] will ignore - /// the Markdown content and provide it as text - Future getMarkdownText(); - - Future canProvideMarkdownTextFromFile(); + /// Return HTML text file from the Clipboard. + Future getHtmlFile(); - /// Get the Markdown file in the Clipboard from the system - Future getMarkdownTextFromFile(); + /// Return the Markdown file in the Clipboard. + Future getMarkdownFile(); - Future canProvidePlainText(); - Future getPlainText(); + /// Return image from the Clipboard. + Future getImageFile(); - Future canProvideImageFile(); - Future getImageFileAsBytes(); + /// Return Gif from the Clipboard. + Future getGifFile(); - Future canProvideGifFile(); - Future getGifFileAsBytes(); + /// Copy an image to the system clipboard to paste it on other apps. + Future copyImage(Uint8List imageBytes); - Future canPaste(); + /// If the Clipboard is not empty or has something to paste + Future get hasClipboardContent async { + final clipboardData = await Clipboard.getData(Clipboard.kTextPlain); + return clipboardData != null; + } } diff --git a/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart b/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart index f90a7a9d2..aa7b9c402 100644 --- a/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart +++ b/lib/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart @@ -1,10 +1,11 @@ -import 'package:flutter/foundation.dart' show immutable; +import 'package:meta/meta.dart' show experimental; + import 'clipboard_service.dart'; import 'default_clipboard_service.dart'; -@immutable +@experimental class ClipboardServiceProvider { - const ClipboardServiceProvider._(); + ClipboardServiceProvider._(); static ClipboardService _instance = DefaultClipboardService(); static ClipboardService get instance => _instance; diff --git a/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart b/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart index 4509c1100..21db10cdd 100644 --- a/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart +++ b/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart @@ -1,96 +1,79 @@ -import 'package:flutter/services.dart' show Clipboard, Uint8List; +import 'dart:io' as io; -import 'clipboard_service.dart'; - -/// Default implementation using only internal flutter plugins -class DefaultClipboardService implements ClipboardService { - @override - Future canProvideHtmlText() async { - return false; - } - - @override - Future getHtmlText() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving HTML text.', - ); - } +import 'package:flutter/foundation.dart'; +import 'package:meta/meta.dart' show experimental; +import 'package:quill_native_bridge/quill_native_bridge.dart' + show QuillNativeBridge, QuillNativeBridgeFeature; - @override - Future canProvideHtmlTextFromFile() async { - return false; - } - - @override - Future getHtmlTextFromFile() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving HTML files.', - ); - } - - @override - Future canProvideMarkdownText() async { - return false; - } - - @override - Future getMarkdownText() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving HTML files.', - ); - } - - @override - Future canProvideMarkdownTextFromFile() async { - return false; - } +import 'clipboard_service.dart'; +/// Default implementation of [ClipboardService] to support rich clipboard +/// operations. +@experimental +class DefaultClipboardService extends ClipboardService { @override - Future getMarkdownTextFromFile() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving Markdown text.', - ); + Future getHtmlText() async { + if (!(await QuillNativeBridge.isSupported( + QuillNativeBridgeFeature.getClipboardHtml))) { + return null; + } + return await QuillNativeBridge.getClipboardHtml(); } @override - Future canProvidePlainText() async { - final plainText = (await Clipboard.getData(Clipboard.kTextPlain))?.text; - return plainText == null; + Future getImageFile() async { + if (!(await QuillNativeBridge.isSupported( + QuillNativeBridgeFeature.getClipboardImage))) { + return null; + } + return await QuillNativeBridge.getClipboardImage(); } @override - Future getPlainText() async { - final plainText = (await Clipboard.getData(Clipboard.kTextPlain))?.text; - return plainText; + Future copyImage(Uint8List imageBytes) async { + if (!(await QuillNativeBridge.isSupported( + QuillNativeBridgeFeature.copyImageToClipboard))) { + return; + } + await QuillNativeBridge.copyImageToClipboard(imageBytes); } @override - Future canProvideImageFile() async { - return false; + Future getGifFile() async { + if (!(await QuillNativeBridge.isSupported( + QuillNativeBridgeFeature.getClipboardGif))) { + return null; + } + return QuillNativeBridge.getClipboardGif(); } - @override - Future getImageFileAsBytes() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving image files.', + Future _getClipboardFile({required String fileExtension}) async { + if (kIsWeb) { + // TODO: Can't read file with dart:io on the Web (See related https://github.com/FlutterQuill/quill-native-bridge/issues/6) + return null; + } + final filePaths = await QuillNativeBridge.getClipboardFiles(); + final filePath = filePaths.firstWhere( + (filePath) => filePath.endsWith('.$fileExtension'), + orElse: () => '', ); + if (filePath.isEmpty) { + // Could not find an item + return null; + } + final fileText = await io.File(filePath).readAsString(); + return fileText; } @override - Future canProvideGifFile() async { - return false; - } - - @override - Future getGifFileAsBytes() { - throw UnsupportedError( - 'DefaultClipboardService does not support retrieving GIF files.', - ); + Future getHtmlFile() async { + final htmlFileText = await _getClipboardFile(fileExtension: 'html'); + return htmlFileText; } @override - Future canPaste() async { - final plainText = await getPlainText(); - return plainText != null; + Future getMarkdownFile() async { + final htmlFileText = await _getClipboardFile(fileExtension: 'md'); + return htmlFileText; } } diff --git a/lib/src/toolbar/buttons/clipboard_button.dart b/lib/src/toolbar/buttons/clipboard_button.dart index b66ffbb62..4f1d43bea 100644 --- a/lib/src/toolbar/buttons/clipboard_button.dart +++ b/lib/src/toolbar/buttons/clipboard_button.dart @@ -3,11 +3,12 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import '../../../flutter_quill.dart'; import '../../common/utils/widgets.dart'; import '../../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart'; import '../../l10n/extensions/localizations_ext.dart'; import '../base_button/base_value_button.dart'; +import '../base_toolbar.dart'; +import '../simple_toolbar_provider.dart'; enum ClipboardAction { cut, copy, paste } @@ -28,7 +29,7 @@ class ClipboardMonitor { Future _update(void Function() listener) async { final clipboardService = ClipboardServiceProvider.instance; - if (await clipboardService.canPaste()) { + if (await clipboardService.hasClipboardContent) { _canPaste = true; listener(); } diff --git a/pubspec.yaml b/pubspec.yaml index a947aab86..98a900959 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -61,7 +61,7 @@ dependencies: # Plugins url_launcher: ^6.2.4 flutter_keyboard_visibility_temp_fork: ^0.1.1 - quill_native_bridge: '>=10.5.14 <=10.6.2' + quill_native_bridge: ^10.7.8 dev_dependencies: flutter_lints: ^5.0.0 diff --git a/quill_native_bridge/.gitignore b/quill_native_bridge/.gitignore deleted file mode 100644 index ac5aa9893..000000000 --- a/quill_native_bridge/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/quill_native_bridge/.metadata b/quill_native_bridge/.metadata deleted file mode 100644 index 5d0b67954..000000000 --- a/quill_native_bridge/.metadata +++ /dev/null @@ -1,30 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "5874a72aa4c779a02553007c47dacbefba2374dc" - channel: "stable" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - - platform: ios - create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/quill_native_bridge/CHANGELOG.md b/quill_native_bridge/CHANGELOG.md deleted file mode 100644 index f29609c4b..000000000 --- a/quill_native_bridge/CHANGELOG.md +++ /dev/null @@ -1,2970 +0,0 @@ - - -# Changelog - -All notable changes to this project will be documented in this file. - -## 10.7.3 - -- Deprecate `FlutterQuillExtensions` in `flutter_quill_extensions` -- Update the minimum version of `flutter_quill` and `super_clipboard` in `flutter_quill_extensions` to avoid using deprecated code. - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.2...v10.7.3 - -## 10.7.2 - -## What's Changed -* chore: deprecate flutter_quill/extensions.dart by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2258 - -This is a minor release introduced to upload a new version of `flutter_quill` and `flutter_quill_extensions` to update the minimum required to avoid using deprecated code in `flutter_quill_extensions`. - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.1...v10.7.2 - -## 10.7.1 - -* chore: deprecate markdown_quill export, ignore warnings by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2256 -* chore: deprecate spell checker service by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2255 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.0...v10.7.1 - -## 10.7.0 - -* Chore: deprecate embed table feature by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2254 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.6...v10.7.0 - -## 10.6.6 - -* Bug fix: Removing check not allowing spell check on web by @joeserhtf in https://github.com/singerdmx/flutter-quill/pull/2252 - -## New Contributors -* @joeserhtf made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2252 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.5...v10.6.6 - -## 10.6.5 - -* Refine IME composing range styling by applying underline as text style by @agata in https://github.com/singerdmx/flutter-quill/pull/2244 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.4...v10.6.5 - -## 10.6.4 - -* fix: the composing text did not show an underline during IME conversion by @agata in https://github.com/singerdmx/flutter-quill/pull/2242 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.3...v10.6.4 - -## 10.6.3 - -* Fix: Resolved issue with broken IME composing rect in Windows desktop by @agata in https://github.com/singerdmx/flutter-quill/pull/2239 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.2...v10.6.3 - -## 10.6.2 - -* Fix: QuillToolbarToggleStyleButton Switching failure by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2234 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.1...v10.6.2 - -## 10.6.1 - -* Chore: update `flutter_quill_delta_from_html` to remove exception calls by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2232 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.6.0...v10.6.1 - -## 10.6.0 - -* docs: cleanup the docs, remove outdated resources, general changes by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2227 -* Feat: customizable character and space shortcut events by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2228 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.19...v10.6.0 - -## 10.5.19 - -* fix: properties other than 'style' for custom inline code styles (such as 'backgroundColor') were not being applied correctly by @agata in https://github.com/singerdmx/flutter-quill/pull/2226 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.18...v10.5.19 - -## 10.5.18 - -* feat(web): rich text paste from Clipboard using HTML by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2009 -* revert: disable rich text paste feature on web as a workaround by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2221 -* refactor: moved shortcuts and onKeyEvents to its own file by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2223 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.17...v10.5.18 - -## 10.5.17 - -* feat(l10n): localize all untranslated.json by @erdnx in https://github.com/singerdmx/flutter-quill/pull/2217 -* Fix: Block Attributes are not displayed if the editor is empty by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2210 - -## New Contributors -* @erdnx made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2217 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.16...v10.5.17 - -## 10.5.16 - -* chore: remove device_info_plus and add quill_native_bridge to access platform specific APIs by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2194 -* Not show/update/hiden mangnifier when manifier config is disbale by @demoYang in https://github.com/singerdmx/flutter-quill/pull/2212 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.14...v10.5.16 - -## 10.5.15-dev.0 - -Introduce `quill_native_bridge` which is an internal plugin to use by `flutter_quill` to access platform APIs. - -For now, the only functionality it supports is to check whatever the iOS app is running on iOS simulator without requiring [`device_info_plus`](pub.dev/packages/device_info_plus) as a dependency. - -> [!NOTE] -> `quill_native_bridge` is a plugin for internal use and should not be used in production applications -> as breaking changes can happen and can removed at any time. - -For more details and discussion see [#2194](https://github.com/singerdmx/flutter-quill/pull/2194). - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.14...v10.5.15-dev.0 - -## 10.5.14 - -* chore(localization): add Greek language support by @DKalathas in https://github.com/singerdmx/flutter-quill/pull/2206 - -## New Contributors -* @DKalathas made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2206 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.13...v10.5.14 - -## 10.5.13 - -* Revert "Fix: Allow backspace at start of document to remove block style and header style by @agata in https://github.com/singerdmx/flutter-quill/pull/2201 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.12...v10.5.13 - -## 10.5.12 - -* Fix: Backspace remove block attributes at start by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2200 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.11...v10.5.12 - -## 10.5.11 - -* Enhancement: Backspace handling at the start of blocks in delete rules by @agata in https://github.com/singerdmx/flutter-quill/pull/2199 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.10...v10.5.11 - -## 10.5.10 - -* Allow backspace at start of document to remove block style and header style by @agata in https://github.com/singerdmx/flutter-quill/pull/2198 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.9...v10.5.10 - -## 10.5.9 - -* chore: improve platform check by using constants and defaultTargetPlatform by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2188 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.8...v10.5.9 - -## 10.5.8 - -* Feat: Add configuration option to always indent on TAB key press by @agata in https://github.com/singerdmx/flutter-quill/pull/2187 - -## New Contributors -* @agata made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2187 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.7...v10.5.8 - -## 10.5.7 - -* chore(example): downgrade Kotlin from 1.9.24 to 1.7.10 by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2185 -* style: refactor build leading function style, width, and padding parameters for custom node leading builder by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2182 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.6...v10.5.7 - -## 10.5.6 - -* chore(deps): update super_clipboard to 0.8.20 in flutter_quill_extensions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2181 -* Update quill_screen.dart, i chaged the logic for showing a lock when … by @rightpossible in https://github.com/singerdmx/flutter-quill/pull/2183 - -## New Contributors -* @rightpossible made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2183 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.5...v10.5.6 - -## 10.5.5 - -* Fix text selection handles when scroll mobile by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2176 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.4...v10.5.5 - -## 10.5.4 - -* Add Thai (th) localization by @silkyland in https://github.com/singerdmx/flutter-quill/pull/2175 - -## New Contributors -* @silkyland made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2175 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.3...v10.5.4 - -## 10.5.3 - -* Fix: Assertion Failure in line.dart When Editing Text with Block-Level Attributes by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2174 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.2...v10.5.3 - -## 10.5.2 - -* fix(toolbar): regard showDividers in simple toolbar by @realth000 in https://github.com/singerdmx/flutter-quill/pull/2172 - -## New Contributors -* @realth000 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2172 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.1...v10.5.2 - -## 10.5.1 - -* fix drag selection extension (does not start at tap location if you are dragging quickly by @jezell in https://github.com/singerdmx/flutter-quill/pull/2170 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.5.0...v10.5.1 - -## 10.5.0 - -* Feat: custom leading builder by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2146 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.9...v10.5.0 - -## 10.4.9 - -* fix floating cursor not disappearing after scroll end by @vishna in https://github.com/singerdmx/flutter-quill/pull/2163 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.8...v10.4.9 - -## 10.4.8 - -* Fix: direction has no opposite effect if the language is rtl by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2154 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.7...v10.4.8 - -## 10.4.7 - -* Fix: Unable to scroll 2nd editor window by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2152 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.6...v10.4.7 - -## 10.4.6 - -* Handle null child query by @jezell in https://github.com/singerdmx/flutter-quill/pull/2151 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.5...v10.4.6 - -## 10.4.5 - -* chore!: move spell checker to example by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2145 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.4...v10.4.5 - -## 10.4.4 - -* fix custom recognizer builder not being passed to editabletextblock by @jezell in https://github.com/singerdmx/flutter-quill/pull/2143 -* fix null reference exception when dragging selection on non scrollable selection by @jezell in https://github.com/singerdmx/flutter-quill/pull/2144 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.3...v10.4.4 - -## 10.4.3 - -* Chore: update simple_spell_checker package by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2139 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.2...v10.4.3 - -## 10.4.2 - -* Revert "fix: Double click to select text sometimes doesn't work. ([#2086](https://github.com/singerdmx/flutter-quill/pull/2086)) - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.1...v10.4.2 - -## 10.4.1 - -* Chore: improve Spell checker API to the example by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2133 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.4.0...v10.4.1 - -## 10.4.0 - -* Copy TapAndPanGestureRecognizer from TextField by @demoYang in https://github.com/singerdmx/flutter-quill/pull/2128 -* enhance stringToColor with a custom defined palette from `DefaultStyles` by @vishna in https://github.com/singerdmx/flutter-quill/pull/2095 -* Feat: include spell checker for example app by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2127 - -## New Contributors -* @vishna made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2095 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.3.3...v10.4.0 - -## 10.3.2 - -* Fix: Loss of style when backspace by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2125 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.3.1...v10.3.2 - -## 10.3.1 - -* Chore: Move spellchecker service to extensions by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2120 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.3.0...v10.3.1 - -## 10.3.0 - -* Feat: Spellchecker for Flutter Quill by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2118 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.2.1...v10.3.0 - -## 10.2.1 - -* Fix: context menu is visible even when selection is collapsed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2116 -* Fix: unsafe operation while getting overlayEntry in text_selection by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2117 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.2.0...v10.2.1 - -## 10.2.0 - -* refactor!: restructure project into modular architecture for flutter_quill_extensions by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2106 -* Fix: Link selection and editing by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2114 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.10...v10.2.0 - -## 10.1.10 - -* Fix(example): image_cropper outdated version by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2100 -* Using dart.library.js_interop instead of dart.library.html by @h1376h in https://github.com/singerdmx/flutter-quill/pull/2103 - -## New Contributors -* @h1376h made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2103 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.9...v10.1.10 - -## 10.1.9 - -* restore ability to pass in key to QuillEditor by @mtallenca in https://github.com/singerdmx/flutter-quill/pull/2093 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.8...v10.1.9 - -## 10.1.8 - -* Enhancement: Search within Embed objects by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2090 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.7...v10.1.8 - -## 10.1.7 - -* Feature/allow shortcut override by @InstrinsicAutomations in https://github.com/singerdmx/flutter-quill/pull/2089 - -## New Contributors -* @InstrinsicAutomations made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2089 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.6...v10.1.7 - -## 10.1.6 - -* fixed #1295 Double click to select text sometimes doesn't work. by @li8607 in https://github.com/singerdmx/flutter-quill/pull/2086 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.5...v10.1.6 - -## 10.1.5 - -* ref: add `VerticalSpacing.zero` and `HorizontalSpacing.zero` named constants by @adil192 in https://github.com/singerdmx/flutter-quill/pull/2083 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.4...v10.1.5 - -## 10.1.4 - -* Fix: collectStyles for lists and alignments by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2082 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.3...v10.1.4 - -## 10.1.3 - -* Move Controller outside of configurations data class by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2078 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.2...v10.1.3 - -## 10.1.2 - -* Fix Multiline paste with attributes and embeds by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2074 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.1...v10.1.2 - -## 10.1.1 - -* Toolbar dividers fixes + Docs updates by @troyanskiy in https://github.com/singerdmx/flutter-quill/pull/2071 - -## New Contributors -* @troyanskiy made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2071 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.1.0...v10.1.1 - -## 10.1.0 - -* Feat: support for customize copy and cut Embeddables to Clipboard by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2067 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.10...v10.1.0 - -## 10.0.10 - -* fix: Hide selection toolbar if editor loses focus by @huandu in https://github.com/singerdmx/flutter-quill/pull/2066 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.9...v10.0.10 - -## 10.0.9 - -* Fix: manual checking of directionality by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2063 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.8...v10.0.9 - -## 10.0.8 - -* feat: add callback to handle performAction by @huandu in https://github.com/singerdmx/flutter-quill/pull/2061 -* fix: Invalid selection when tapping placeholder text by @huandu in https://github.com/singerdmx/flutter-quill/pull/2062 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.7...v10.0.8 - -## 10.0.7 - -* Fix: RTL issues by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2060 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.6...v10.0.7 - -## 10.0.6 - -* fix: textInputAction is not set when creating QuillRawEditorConfiguration by @huandu in https://github.com/singerdmx/flutter-quill/pull/2057 - -## New Contributors -* @huandu made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2057 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.5...v10.0.6 - -## 10.0.5 - -* Add tests for PreserveInlineStylesRule and fix link editing. Other minor fixes. by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2058 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.4...v10.0.5 - -## 10.0.4 - -* Add ability to set up horizontal spacing for block style by @dimkanovikov in https://github.com/singerdmx/flutter-quill/pull/2051 -* add catalan language by @spilioio in https://github.com/singerdmx/flutter-quill/pull/2054 - -## New Contributors -* @dimkanovikov made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2051 -* @spilioio made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2054 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.3...v10.0.4 - -## 10.0.3 - -* doc(Delta): more documentation about Delta by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2042 -* doc(attribute): added documentation about Attribute class and how create one by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2048 -* if magnifier removes toolbar, restore it when it is hidden by @mtallenca in https://github.com/singerdmx/flutter-quill/pull/2049 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.2...v10.0.3 - -## 10.0.2 - -* chore(scripts): migrate the scripts from sh to dart by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2036 -* Have the ability to create custom rules, closes #1162 by @Guillergood in https://github.com/singerdmx/flutter-quill/pull/2040 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.1...v10.0.2 - -## 10.0.1 - -This release is identical to [10.0.0](https://github.com/singerdmx/flutter-quill/releases/tag/v10.0.0) with a fix that addresses issue #2034 by requiring `10.0.0` as the minimum version for quill related dependencies. - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.0.0...v10.0.1 - -## 10.0.0 - -* refactor: restructure project into modular architecture for flutter_quill by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2032 -* chore: update GitHub PR template by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2033 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.6.0...v10.0.0 - -## 9.6.0 - -* [feature] : quill add magnifier by @demoYang in https://github.com/singerdmx/flutter-quill/pull/2026 - -## New Contributors -* @demoYang made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2026 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.23...v9.6.0 - -## 9.5.23 - -* add untranslated Kurdish keys by @Xoshbin in https://github.com/singerdmx/flutter-quill/pull/2029 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.22...v9.5.23 - -## 9.5.22 - -* Fix outdated contributor guide link on PR template by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2027 -* Fix(rule): PreserveInlineStyleRule assume the type of the operation data and throw stacktrace by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2028 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.21...v9.5.22 - -## 9.5.21 - -* Fix: Key actions not being handled by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/2025 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.20...v9.5.21 - -## 9.5.20 - -* Remove useless delta_x_test by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2017 -* Update flutter_quill_delta_from_html package on pubspec.yaml by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2018 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.19...v9.5.20 - -## 9.5.19 - -* fixed #1835 Embed Reloads on Cmd Key Press by @li8607 in https://github.com/singerdmx/flutter-quill/pull/2013 - -## New Contributors -* @li8607 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2013 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.18...v9.5.19 - -## 9.5.18 - -* Refactor: Moved core link button functions to link.dart by @Alspb in https://github.com/singerdmx/flutter-quill/pull/2008 -* doc: more documentation about Rules by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2014 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.17...v9.5.18 - -## 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 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.14...v9.5.15 - -## 9.5.14 - -* docs(readme): update 'Conversion to HTML' section to include more details by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/1996 -* Update flutter_quill_delta_from_html on pubspec.yaml to fix current issues by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1999 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.13...v9.5.14 - -## 9.5.13 - -* Added new default ConverterOptions configurations by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1990 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.12...v9.5.13 - -## 9.5.12 - -* fix: Fixed passing textStyle to formula embed by @shubham030 in https://github.com/singerdmx/flutter-quill/pull/1989 - -## New Contributors -* @shubham030 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1989 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.11...v9.5.12 - -## 9.5.11 - -* Update flutter_quill_delta_from_html in pubspec.yaml by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1988 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.10...v9.5.11 - -## 9.5.10 - -* chore: remove dependency html converter by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1987 -* Fix: LineHeight button to use MenuAnchor by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/1986 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.9...v9.5.10 - -## 9.5.9 - -* Update pubspec.yaml to remove html2md by @singerdmx in https://github.com/singerdmx/flutter-quill/pull/1985 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.8...v9.5.9 - -## 9.5.8 - -* fix(typo): fix typo ClipboardServiceProvider.instacne by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1983 -* Feat: New way to get Delta from HTML inputs by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1984 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.7...v9.5.8 - -## 9.5.7 - -* refactor: context menu function, add test code by @n7484443 in https://github.com/singerdmx/flutter-quill/pull/1979 -* Fix: PreserveInlineStylesRule by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/1980 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.6...v9.5.7 - -## 9.5.6 - -* fix: common link is detected as a video link by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1978 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.5...v9.5.6 - -## 9.5.5 - -* fix: context menu behavior in mouse, desktop env by @n7484443 in https://github.com/singerdmx/flutter-quill/pull/1976 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.4...v9.5.5 - -## 9.5.4 - -* Feat: Line height support by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1972 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.3...v9.5.4 - -## 9.5.3 - -* Perf: Performance optimization by @Alspb in https://github.com/singerdmx/flutter-quill/pull/1964 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.2...v9.5.3 - -## 9.5.2 - -* Fix style settings by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/1962 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.1...v9.5.2 - -## 9.5.1 - -* feat(extensions): Youtube Video Player Support Mode by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1916 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.5.0...v9.5.1 - -## 9.5.0 - -* Partial support for table embed by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1960 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.9...v9.5.0 - -## 9.4.9 - -* Upgrade photo_view to 0.15.0 for flutter_quill_extensions by @singerdmx in https://github.com/singerdmx/flutter-quill/pull/1958 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.8...v9.4.9 - -## 9.4.8 - -* Add support for html underline and videos by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1955 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.7...v9.4.8 - -## 9.4.7 - -* fixed #1953 italic detection error by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/1954 - -## New Contributors -* @CatHood0 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1954 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.6...v9.4.7 - -## 9.4.6 - -* fix: search dialog throw an exception due to missing FlutterQuillLocalizations.delegate in the editor by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1938 -* fix(editor): implement editor shortcut action for home and end keys to fix exception about unimplemented ScrollToDocumentBoundaryIntent by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1937 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.5...v9.4.6 - -## 9.4.5 - -* fix: color picker hex unfocus on web by @geronimol in https://github.com/singerdmx/flutter-quill/pull/1934 - -## New Contributors -* @geronimol made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1934 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.4...v9.4.5 - -## 9.4.4 - -* fix: Enabled link regex to be overridden by @JoepHeijnen in https://github.com/singerdmx/flutter-quill/pull/1931 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.3...v9.4.4 - -## 9.4.3 - -* Fix: setState() called after dispose(): QuillToolbarClipboardButtonState #1895 by @windows7lake in https://github.com/singerdmx/flutter-quill/pull/1926 - -## New Contributors -* @windows7lake made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1926 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.2...v9.4.3 - -## 9.4.2 - -* Respect autofocus, closes #1923 by @Guillergood in https://github.com/singerdmx/flutter-quill/pull/1924 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.1...v9.4.2 - -## 9.4.1 - -* replace base64 regex string by @salba360496 in https://github.com/singerdmx/flutter-quill/pull/1919 - -## New Contributors -* @salba360496 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1919 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.4.0...v9.4.1 - -## 9.4.0 - -This release can be used without changing anything, although it can break the behavior a little, we provided a way to use the old behavior in `9.3.x` - -- Thanks to @Alspb, the search bar/dialog has been reworked for improved UI that fits **Material 3** look and feel, the search happens on the fly, and other minor changes, if you want the old search bar, you can restore it with one line if you're using `QuillSimpleToolbar`: - ```dart - QuillToolbar.simple( - configurations: QuillSimpleToolbarConfigurations( - searchButtonType: SearchButtonType.legacy, - ), - ) - ``` - While the changes are mostly to the `QuillToolbarSearchDialog` and it seems this should be `searchDialogType`, we provided the old button with the old dialog in case we update the button in the future. - - If you're using `QuillToolbarSearchButton` in a custom Toolbar, you don't need anything to get the new button. if you want the old button, use the `QuillToolbarLegacySearchButton` widget - - Consider using the improved button with the improved dialog as the legacy button might removed in future releases (for now, it's not deprecated) - -
- Before - - ![image](https://github.com/singerdmx/flutter-quill/assets/73608287/9b40ad03-717f-4518-95f1-8d9cad773b2b) - - -
- -
- Improved - - ![image](https://github.com/singerdmx/flutter-quill/assets/73608287/e581733d-63fa-4984-9c41-4a325a0a0c04) - -
- - For the detailed changes, see #1904 - -- Korean translations by @leegh519 in https://github.com/singerdmx/flutter-quill/pull/1911 - -- The usage of `super_clipboard` plugin in `flutter_quill` has been moved to the `flutter_quill_extensions` package, this will restore the old behavior in `8.x.x` though it will break the `onImagePaste`, `onGifPaste` and rich text pasting from HTML or Markdown, most of those features are available in `super_clipboard` plugin except `onImagePaste` which was available as we were using [pasteboard](https://pub.dev/packages/pasteboard), Unfortunately, it's no longer supported on recent versions of Flutter, and some functionalities such as an image from Clipboard and Html paste are not supported on some platforms such as Android, your project will continue to work, calls of `onImagePaste` and `onGifPaste` will be ignored unless you include [flutter_quill_extensions](https://pub.dev/packages/flutter_quill_extensions) package in your project and call: - - ```dart - FlutterQuillExtensions.useSuperClipboardPlugin(); - ``` - Before using any `flutter_quill` widgets, this will restore the old behavior in `9.x.x` - - We initially wanted to publish `flutter_quill_super_clipboard` to allow: - - Using `super_clipboard` without `flutter_quill_extensions` packages and plugins - - Using `flutter_quill_extensions` with optional `super_clipboard` - - To simplify the usage, we moved it to `flutter_quill_extensions`, let us know if you want any of the use cases above. - - Overall `super_clipboard` is a Comprehensive clipboard plugin with a lot of features, the only thing that developers didn't want is Rust installation even though it's automated. - - The main goal of `ClipboardService` is to make `super_clipboard` optional, you can use your own implementation, and create a class that implements `ClipboardService`, which you can get by: - ```dart - // ignore: implementation_imports - import 'package:flutter_quill/src/services/clipboard/clipboard_service.dart'; - ``` - - Then you can call: - ```dart - // ignore: implementation_imports -import 'package:flutter_quill/src/services/clipboard/clipboard_service_provider.dart'; - ClipboardServiceProvider.setInstance(YourClipboardService()); -``` - - The interface could change at any time and will be updated internally for `flutter_quill` and `flutter_quill_extensions`, we didn't export those two classes by default to avoid breaking changes in case you use them as we might change them in the future. - - If you use the above imports, you might get **breaking changes** in **non-breaking change releases**. - -- Subscript and Superscript should now work for all languages and characters - - The previous implementation required the Apple 'SF-Pro-Display-Regular.otf' font which is only licensed/permitted for use on Apple devices. -We have removed the Apple font from the example - -- Allow pasting Markdown and HTML file content from the system to the editor - - Before `9.4.x` if you try to copy an HTML or Markdown file, and paste it into the editor, you will get the file name in the editor - Copying an HTML file, or HTML content from apps and websites is different than copying plain text. - - This is why this change requires `super_clipboard` implementation as this is platform-dependent: - ```dart - FlutterQuillExtensions.useSuperClipboardPlugin(); - ``` - as mentioned above. - - The following example for copying a Markdown file: - -
- Markdown File Content - - ```md - - **Note**: This package supports converting from HTML back to Quill delta but it's experimental and used internally when pasting HTML content from the clipboard to the Quill Editor - - You have two options: - - 1. Using [quill_html_converter](./quill_html_converter/) to convert to HTML, the package can convert the Quill delta to HTML well - (it uses [vsc_quill_delta_to_html](https://pub.dev/packages/vsc_quill_delta_to_html)), it is just a handy extension to do it more quickly - 1. Another option is to use - [vsc_quill_delta_to_html](https://pub.dev/packages/vsc_quill_delta_to_html) to convert your document - to HTML. - This package has full support for all Quill operationsβ€”including images, videos, formulas, - tables, and mentions. - Conversion can be performed in vanilla Dart (i.e., server-side or CLI) or in Flutter. - It is a complete Dart part of the popular and mature [quill-delta-to-html](https://www.npmjs.com/package/quill-delta-to-html) - Typescript/Javascript package. - this package doesn't convert the HTML back to Quill Delta as far as we know - - ``` - -
- -
- Before - - ![image](https://github.com/singerdmx/flutter-quill/assets/73608287/03f5ae20-796c-4e8b-8668-09a994211c1e) - -
- -
- After - - ![image](https://github.com/singerdmx/flutter-quill/assets/73608287/7e3a1987-36e7-4665-944a-add87d24e788) - -
- - Markdown, and HTML converting from and to Delta are **currently far from perfect**, the current implementation could improved a lot - however **it will likely not work like expected**, due to differences between HTML and Delta, see this [comment](https://github.com/slab/quill/issues/1551#issuecomment-311458570) for more info. - - ![Copying Markdown file into Flutter Quill Editor](https://github.com/singerdmx/flutter-quill/assets/73608287/63bd6ba6-cc49-4335-84dc-91a0fa5c95a9) - - For more details see #1915 - - Using or converting to HTML or Markdown is highly experimental and shouldn't be used for production applications. - - We use it internally as it is more suitable for our specific use case., copying content from external websites and pasting it into the editor - previously breaks the styles, while the current implementation is not ready, it provides a better user experience and doesn't have many downsides. - - Feel free to report any bugs or feature requests at [Issues](https://github.com/singerdmx/flutter-quill/issues) or drop any suggestions and questions at [Discussions](https://github.com/singerdmx/flutter-quill/discussions) - -## New Contributors -* @leegh519 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1911 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.21...v9.4.0 - -## 9.3.21 - -* fix: assertion failure for swipe typing and undo on Android by @crasowas in https://github.com/singerdmx/flutter-quill/pull/1898 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.20...v9.3.21 - -## 9.3.20 - -* Fix: Issue 1887 by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/1892 -* fix: toolbar style change will be invalid when inputting more than 2 characters at a time by @crasowas in https://github.com/singerdmx/flutter-quill/pull/1890 - -## New Contributors -* @crasowas made their first contribution in https://github.com/singerdmx/flutter-quill/pull/1890 - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.19...v9.3.20 - -## 9.3.19 - -* Fix reported issues by @AtlasAutocode in https://github.com/singerdmx/flutter-quill/pull/1886 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.18...v9.3.19 - -## 9.3.18 - -* Fix: Undo/redo cursor position fixed by @Alspb in https://github.com/singerdmx/flutter-quill/pull/1885 - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.17...v9.3.18 - -## 9.3.17 - -* Update super_clipboard plugin to 0.8.15 to address [#1882](https://github.com/singerdmx/flutter-quill/issues/1882) - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.16...v9.3.17 - -## 9.3.16 - -* Update `lint` dev package to 4.0.0 -* Require at least version 0.8.13 of the plugin - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.15...v9.3.16 - -## 9.3.15 - - -* Ci/automate updating the files by @ellet0 in https://github.com/singerdmx/flutter-quill/pull/1879 -* Updating outdated README.md and adding a few guidelines for CONTRIBUTING.md - - -**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v9.3.14...v9.3.15 - -## 9.3.14 - -* Chore/use original color picker package in [#1877](https://github.com/singerdmx/flutter-quill/pull/1877) - -## 9.3.13 - -* fix: `readOnlyMouseCursor` losing in construction function -* Fix block multi-line selection style - -## 9.3.12 - -* Add `readOnlyMouseCursor` to config mouse cursor type - -## 9.3.11 - -* Fix typo in QuillHtmlConverter -* Fix re-create checkbox - -## 9.3.10 - -* Support clipboard actions from the toolbar - -## 9.3.9 - -* fix: MD Parsing for multi space -* fix: FontFamily and FontSize toolbars track the text selected in the editor -* feat: Add checkBoxReadOnly property which can override readOnly for checkbox - -## 9.3.8 - -* fix: removed misleading parameters -* fix: added missed translations for ru, es, de -* added translations for Nepali Locale('ne', 'NP') - -## 9.3.7 - -* Fix for keyboard jumping when switching focus from a TextField -* Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care - -## 9.3.6 - -* Add SK and update CS locales [#1796](https://github.com/singerdmx/flutter-quill/pull/1796) -* Fixes: - * QuillIconTheme changes for FontFamily and FontSize buttons are not applied [#1797](https://github.com/singerdmx/flutter-quill/pull/1796) - * Make the arrow_drop_down icons in the QuillToolbar the same size for all MenuAnchor buttons [#1799](https://github.com/singerdmx/flutter-quill/pull/1796) - -## 9.3.5 - -* Update the minimum version for the packages to support `device_info_plus` version 10.0.0 [#1783](https://github.com/singerdmx/flutter-quill/issues/1783) -* Update the minimum version for `youtube_player_flutter` to new major version 9.0.0 in the `flutter_quill_extensions` - -## 9.3.4 - -* fix: multiline styling stuck/not working properly [#1782](https://github.com/singerdmx/flutter-quill/pull/1782) - -## 9.3.3 - -* Update `quill_html_converter` versions - -## 9.3.2 - -* Fix dispose of text painter [#1774](https://github.com/singerdmx/flutter-quill/pull/1774) - -## 9.3.1 - -* Require Flutter 3.19.0 as minimum version - -## 9.3.0 - -* **Breaking change**: `Document.fromHtml(html)` is now returns `Document` instead of `Delta`, use `DeltaX.fromHtml` to return `Delta` -* Update old deprecated api from Flutter 3.19 -* Scribble scroll fix by @mtallenca in https://github.com/singerdmx/flutter-quill/pull/1745 - -## 9.2.14 - -* feat: move cursor after inserting video/image -* Apple pencil - -## 9.2.13 - -* Fix crash with inserting text from contextMenuButtonItems -* Fix incorrect behaviour of context menu -* fix: selection handles behaviour and unnessesary style assert -* Update quill_fr.arb - -## 9.2.12 - -* Fix safari clipboard bug -* Add the option to disable clipboard functionality - -## 9.2.11 - -* Fix a bug where it has problems with pasting text into the editor when the clipboard has styled text - -## 9.2.10 - -* Update example screenshots -* Refactor `Container` to `QuillContainer` with backward compatibility -* A workaround fix in history feature - -## 9.2.9 - -* Refactor the type of `Delta().toJson()` to be more clear type - -## 9.2.8 - -* feat: Export Container node as QuillContainer -* fix web cursor position / height (don't use iOS logic) -* Added Swedish translation - -## 9.2.6 - -* [fix selection.affinity always downstream after updateEditingValue](https://github.com/singerdmx/flutter-quill/pull/1682) -* Bumb version of `super_clipboard` - -## 9.2.5 - -* Bumb version of `super_clipboard` - -## 9.2.4 - -* Use fixed version of intl - -## 9.2.3 - -* remove unncessary column in Flutter quill video embed block - -## 9.2.2 - -* Fix bug [#1627](https://github.com/singerdmx/flutter-quill/issues/1627) - -## 9.2.1 - -* Fix [bug](https://github.com/singerdmx/flutter-quill/issues/1119#issuecomment-1872605246) with font size button -* Added ro RO translations -* πŸ“– Update zh, zh_CN translations - -## 9.2.0 - -* Require minimum version `6.0.0` of `flutter_keyboard_visibility` to fix some build issues with Android Gradle Plugin 8.2.0 -* Add on image clicked in `flutter_quill_extensions` callback -* Deprecate `globalIconSize` and `globalIconButtonFactor`, use `iconSize` and `iconButtonFactor` instead -* Fix the `QuillToolbarSelectAlignmentButtons` - -## 9.1.1 - -* Require `super_clipboard` minimum version `0.8.1` to fix some bug with Linux build failure - -## 9.1.1-dev - -* Fix bug [#1636](https://github.com/singerdmx/flutter-quill/issues/1636) -* Fix a where you paste styled content (HTML) it always insert a new line at first even if the document is empty -* Fix the font size button and migrate to `MenuAnchor` -* The `defaultDisplayText` is no longer required in the font size and header dropdown buttons -* Add pdf converter in a new package (`quill_pdf_converter`) - -## 9.1.0 - -* Fix the simple toolbar by add properties of `IconButton` and fix some buttons - -## 9.1.0-dev.2 - -* Fix the history buttons - -## 9.1.0-dev.1 - -* Bug fixes in the simple toolbar buttons - -## 9.1.0-dev - -* **Breaking Change**: in the `QuillSimpleToolbar` Fix the `QuillIconTheme` by replacing all the properties with two properties of type `ButtonStyle`, use `IconButton.styleFrom()` - -## 9.0.6 - -* Fix bug in QuillToolbarSelectAlignmentButtons - -## 9.0.5 - -* You can now use most of the buttons without internal provider - -## 9.0.4 - -* Feature: [#1611](https://github.com/singerdmx/flutter-quill/issues/1611) -* Export missing widgets - -## 9.0.3 - -* Flutter Quill Extensions: - * Fix file image support for web image emebed builder - -## 9.0.2 - -* Remove unused properties in the `QuillToolbarSelectHeaderStyleDropdownButton` -* Fix the `QuillSimpleToolbar` when `useMaterial3` is false, please upgrade to the latest version of flutter for better support - -## 9.0.2-dev.3 - -* Export `QuillSingleChildScrollView` - -## 9.0.2-dev.2 - -* Add the new translations for ru, uk arb files by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575) -* Add a new dropdown button by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575) -* Update the default style values by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575) -* Fix bug [#1562](https://github.com/singerdmx/flutter-quill/issues/1562) -* Fix the second bug of [#1480](https://github.com/singerdmx/flutter-quill/issues/1480) - -## 9.0.2-dev.1 - -* Add configurations for the new dropdown `QuillToolbarSelectHeaderStyleButton`, you can use the orignal one or this -* Fix the [issue](https://github.com/singerdmx/flutter-quill/issues/1119) when enter is pressed, all font settings is lost - -## 9.0.2-dev - -* **Breaking change** Remove the spacer widget, removed the controller option for each button -* Add `toolbarRunSpacing` property to the simple toolbar - -## 9.0.1 - -* Fix default icon size - -## 9.0.0 - -* This version is quite stable but it's not how we wanted to be, because the lack of time and there are not too many maintainers active, we decided to publish it, we might make a new breaking changes verion - -## 9.0.1-dev.1 - -* Flutter Quill Extensions: - * Update `QuillImageUtilities` and fixining some bugs - -## 9.0.1-dev - -* Test new GitHub workflows - -## 9.0.0-dev-10 - -* Fix a bug of the improved pasting HTML contents contents into the editor - -## 9.0.0-dev-9 - -* Improves the new logic of pasting HTML contents into the Editor -* Update `README.md` and the doc -* Dispose the `QuillToolbarSelectHeaderStyleButton` state listener in `dispose` -* Upgrade the font family button to material 3 -* Rework the font family and font size functionalities to change the font once and type all over the editor - -## 9.0.0-dev-8 - -* Better support for pasting HTML contents from external websites to the editor -* The experimental support of converting the HTML from `quill_html_converter` is now built-in in the `flutter_quill` and removed from there (Breaking change for `quill_html_converter`) - -## 9.0.0-dev-7 - -* Fix a bug in chaning the background/font color of ol/ul list -* Flutter Quill Extensions: - * Fix link bug in the video url - * Fix patterns - -## 9.0.0-dev-6 - -* Move the `child` from `QuillToolbarConfigurations` into `QuillToolbar` directly -* Bug fixes -* Add the ability to change the background and font color of the ol/ul elements dots and numbers -* Flutter Quill Extensions: - * **Breaking Change**: The `imageProviderBuilder`is now providing the context and image url - -## 9.0.0-dev-5 - -* The `QuillToolbar` is now accepting only `child` with no configurations so you can customize everything you wants, the `QuillToolbar.simple()` or `QuillSimpleToolbar` implements a simple toolbar that is based on `QuillToolbar`, you are free to use it but it just an example and not standard -* Flutter Quill Extensions: - * Improve the camera button - -## 9.0.0-dev-4 - -* The options parameter in all of the buttons is no longer required which can be useful to create custom toolbar with minimal efforts -* Toolbar buttons fixes in both `flutter_quill` and `flutter_quill_extensions` -* The `QuillProvider` has been dropped and no longer used, the providers will be used only internally from now on and we will not using them as much as possible - -## 9.0.0-dev-3 - -* Breaking Changes: - * Rename `QuillToolbar` to `QuillSimpleToolbar` - * Rename `QuillBaseToolbar` to `QuillToolbar` - * Replace `pasteboard` with `rich_cliboard` -* Fix a bug in the example when inserting an image from url -* Flutter Quill Extensions: - * Add support for copying the image to the system cliboard - -## 9.0.0-dev-2 - -* An attemp to fix CI automated publishing - -## 9.0.0-dev-1 - -* An attemp to fix CI automated publishing - -## 9.0.0-dev - -* **Major Breaking change**: The `QuillProvider` is now optional, the `controller` parameter has been moved to the `QuillEditor` and `QuillToolbar` once again. -* Flutter Quill Extensions; - * **Breaking Change**: Completly change the way how the source code structured to more basic and simple way, organize folders and file names, if you use the library -from `flutter_quill_extensions.dart` then there is nothing you need to do, but if you are using any other import then you need to re-imports -embed, this won't affect how quill js work - * Improvemenets to the image embed - * Add support for `margin` for web - * Add untranslated strings to the `quill_en.arb` - -## 8.6.4 - -* The default value of `keyboardAppearance` for the iOS will be the one from the App/System theme mode instead of always using the `Brightness.light` -* Fix typos in `README.md` - -## 8.6.3 - -* Update the minimum flutter version to `3.16.0` - -## 8.6.2 - -* Restore use of alternative QuillToolbarLinkStyleButton2 widget - -## 8.6.1 - -* Temporary revert style bug fix - -## 8.6.0 - -* **Breaking Change** Support [Flutter 3.16](https://medium.com/flutter/whats-new-in-flutter-3-16-dba6cb1015d1), please upgrade to the latest stable version of flutter to use this update -* **Breaking Change**: Remove Deprecated Fields -* **Breaking Change**: Extract the shared things between `QuillToolbarConfigurations` and `QuillBaseToolbarConfigurations` -* **Breaking Change**: You no longer need to use `QuillToolbarProvider` when using custom toolbar buttons, the example has been updated -* Bug fixes - -## 8.5.5 - -* Now when opening dialogs by `QuillToolbar` you will not get an exception when you don't use `FlutterQuillLocalizations.delegate` in your `WidgetsApp`, `MaterialApp`, or `CupertinoApp`. The fix is for the `QuillToolbarSearchButton`, `QuillToolbarLinkStyleButton`, and `QuillToolbarColorButton` buttons - -## 8.5.4 - -* The `mobileWidth`, `mobileHeight`, `mobileMargin`, and `mobileAlignment` is now deprecated in `flutter_quill`, they are now defined in `flutter_quill_extensions` -* Deprecate `replaceStyleStringWithSize` function which is in `string.dart` -* Deprecate `alignment`, and `margin` as they don't conform to official Quill JS - -## 8.5.3 - -* Update doc -* Update `README.md` and `CHANGELOG.md` -* Fix typos -* Use `immutable` when possible -* Update `.pubignore` - -## 8.5.2 - -* Updated `README.md`. -* Feature: Added the ability to include a custom callback when the `QuillToolbarColorButton` is pressed. -* The `QuillToolbar` now implements `PreferredSizeWidget`, enabling usage in the AppBar, similar to `QuillBaseToolbar`. - -## 8.5.1 - -* Updated `README.md`. - -## 8.5.0 - -* Migrated to `flutter_localizations` for translations. -* Fixed: Translated all previously untranslated localizations. -* Fixed: Added translations for missing items. -* Fixed: Introduced default Chinese fallback translation. -* Removed: Unused parameters `items` in `QuillToolbarFontFamilyButtonOptions` and `QuillToolbarFontSizeButtonOptions`. -* Updated: Documentation. - -## 8.4.4 - -* Updated `.pubignore` to ignore unnecessary files and folders. - -## 8.4.3 - -* Updated `CHANGELOG.md`. - -## 8.4.2 - -* **Breaking change**: Configuration for `QuillRawEditor` has been moved to a separate class. Additionally, `readOnly` has been renamed to `isReadOnly`. If using `QuillEditor`, no action is required. -* Introduced the ability for developers to override `TextInputAction` in both `QuillRawEditor` and `QuillEditor`. -* Enabled using `QuillRawEditor` without `QuillEditorProvider`. -* Bug fixes. -* Added image cropping implementation in the example. - -## 8.4.1 - -* Added `copyWith` in `OptionalSize` class. - -## 8.4.0 - -* **Breaking change**: Updated `QuillCustomButton` to use `QuillCustomButtonOptions`. Moved all properties from `QuillCustomButton` to `QuillCustomButtonOptions`, replacing `iconData` with `icon` widget for increased customization. -* **Breaking change**: `customButtons` in `QuillToolbarConfigurations` is now of type `List`. -* Bug fixes following the `8.0.0` update. -* Updated `README.md`. -* Improved platform checking. - -## 8.3.0 - -* Added `iconButtonFactor` property to `QuillToolbarBaseButtonOptions` for customizing button size relative to its icon size (defaults to `kIconButtonFactor`, consistent with previous releases). - -## 8.2.6 - -* Organized `QuillRawEditor` code. - -## 8.2.5 - -* Added `builder` property in `QuillEditorConfigurations`. - -## 8.2.4 - -* Adhered to Flutter best practices. -* Fixed auto-focus bug. - -## 8.2.3 - -* Updated `README.md`. - -## 8.2.2 - -* Moved `flutter_quill_test` to a separate package: [flutter_quill_test](https://pub.dev/packages/flutter_quill_test). - -## 8.2.1 - -* Updated `README.md`. - -## 8.2.0 - -* Added the option to add configurations for `flutter_quill_extensions` using `extraConfigurations`. - -## 8.1.11 - -* Followed Dart best practices by using `lints` and removed `pedantic` and `platform` since they are not used. -* Fixed text direction bug. -* Updated `README.md`. - -## 8.1.10 - -* Secret for automated publishing to pub.dev. - -## 8.1.9 - -* Fixed automated publishing to pub.dev. - -## 8.1.8 - -* Fixed automated publishing to pub.dev. - -## 8.1.7 - -* Automated publishing to pub.dev. - -## 8.1.6 - -* Fixed compatibility with `integration_test` by downgrading the minimum version of the platform package to 3.1.0. - -## 8.1.5 - -* Reversed background/font color toolbar button icons. - -## 8.1.4 - -* Reversed background/font color toolbar button tooltips. - -## 8.1.3 - -* Moved images to screenshots instead of `README.md`. - -## 8.1.2 - -* Fixed a bug related to the regexp of the insert link dialog. -* Required Dart 3 as the minimum version. -* Code cleanup. -* Added a spacer widget between each button in the `QuillToolbar`. - -## 8.1.1 - -* Fixed null error in line.dart #1487(https://github.com/singerdmx/flutter*quill/issues/1487). - -## 8.1.0 - -* Fixed a word typo of `mirgration` to `migration` in the readme & migration document. -* Updated migration guide. -* Removed property `enableUnfocusOnTapOutside` in `QuillEditor` configurations and added `isOnTapOutsideEnabled` instead. -* Added a new callback called `onTapOutside` in the `QuillEditorConfigurations` to perform actions when tapping outside the editor. -* Fixed a bug that caused the web platform to not unfocus the editor when tapping outside of it. To override this, please pass a value to the `onTapOutside` callback. -* Removed the old property of `iconTheme`. Instead, pass `iconTheme` in the button options; you will find the `base` property inside it with `iconTheme`. - -## 8.0.0 - -* If you have migrated recently, don't be alarmed by this update; it adds documentation, a migration guide, and marks the version as a more stable release. Although there are breaking changes (as reported by some developers), the major version was not changed due to time constraints during development. A single property was also renamed from `code` to `codeBlock` in the `elements` of the new `QuillEditorConfigurations` class. -* Updated the README for better readability. - -## 7.10.2 - -* Removed line numbers from code blocks by default. You can still enable this feature thanks to the new configurations in the `QuillEditor`. Find the `elementOptions` property and enable `enableLineNumbers`. - -## 7.10.1 - -* Fixed issues and utilized the new parameters. -* No longer need to use `MaterialApp` for most toolbar button child builders. -* Compatibility with [fresh_quill_extensions](https://pub.dev/packages/fresh_quill_extensions), a temporary alternative to [flutter_quill_extensions](https://pub.dev/packages/flutter_quill_extensions). -* Updated most of the documentation in `README.md`. - -## 7.10.0 - -* **Breaking change**: `QuillToolbar.basic()` can be accessed directly from `QuillToolbar()`, and the old `QuillToolbar` can be accessed from `QuillBaseToolbar`. -* Refactored Quill editor and toolbar configurations into a single class each. -* After changing checkbox list values, the controller will not request keyboard focus by default. -* Moved toolbar and editor configurations directly into the widget but still use inherited widgets internally. -* Fixes to some code after the refactoring. - -## 7.9.0 - -* Buttons Improvemenets -* Refactor all the button configurations that used in `QuillToolbar.basic()` but there are still few lefts -* **Breaking change**: Remove some configurations from the QuillToolbar and move them to the new `QuillProvider`, please notice this is a development version and this might be changed in the next few days, the stable release will be ready in less than 3 weeks -* Update `flutter_quill_extensions` and it will be published into pub.dev soon. -* Allow you to customize the search dialog by custom callback with child builder - -## 7.8.0 - -* **Important note**: this is not test release yet, it works but need more test and changes and breaking changes, we don't have development version and it will help us if you try the latest version and report the issues in Github but if you want a stable version please use `7.4.16`. this refactoring process will not take long and should be done less than three weeks with the testing. -* We managed to refactor most of the buttons configurations and customizations in the `QuillProvider`, only three lefts then will start on refactoring the toolbar configurations -* Code improvemenets - -## 7.7.0 - -* **Breaking change**: We have mirgrated more buttons in the toolbar configurations, you can do change them in the `QuillProvider` -* Important bug fixes - -## 7.6.1 - -* Bug fixes - -## 7.6.0 - -* **Breaking change**: To customize the buttons in the toolbar, you can do that in the `QuillProvider` - -## 7.5.0 - -* **Breaking change**: The widgets `QuillEditor` and `QuillToolbar` are no longer have controller parameter, instead you need to make sure in the widget tree you have wrapped them with `QuillProvider` widget and provide the controller and the require configurations - -## 7.4.16 - -* Update documentation and README.md - -## 7.4.15 - -* Custom style attrbuites for platforms other than mobile (alignment, margin, width, height) -* Bug fixes and other improvemenets - -## 7.4.14 - -* Improve performance by reducing the number of widgets rebuilt by listening to media query for only the needed things, for example instead of using `MediaQuery.of(context).size`, now we are using `MediaQuery.sizeOf(context)` -* Add MediaButton for picking the images only since the video one is not ready -* A new feature which allows customizing the text selection in quill editor which is useful for custom theme design system for custom app widget - -## 7.4.13 - -* Fixed tab editing when in readOnly mode. - -## 7.4.12 - -* Update the minimum version of device_info_plus to 9.1.0. - -## 7.4.11 - -* Add sw locale. - -## 7.4.10 - -* Update translations. - -## 7.4.9 - -* Style recognition fixes. - -## 7.4.8 - -* Upgrade dependencies. - -## 7.4.7 - -* Add Vietnamese and German translations. - -## 7.4.6 - -* Fix more null errors in Leaf.retain [##1394](https://github.com/singerdmx/flutter-quill/issues/1394) and Line.delete [##1395](https://github.com/singerdmx/flutter-quill/issues/1395). - -## 7.4.5 - -* Fix null error in Container.insert [##1392](https://github.com/singerdmx/flutter-quill/issues/1392). - -## 7.4.4 - -* Fix extra padding on checklists [##1131](https://github.com/singerdmx/flutter-quill/issues/1131). - -## 7.4.3 - -* Fixed a space input error on iPad. - -## 7.4.2 - -* Fix bug with keepStyleOnNewLine for link. - -## 7.4.1 - -* Fix toolbar dividers condition. - -## 7.4.0 - -* Support Flutter version 3.13.0. - -## 7.3.3 - -* Updated Dependencies conflicting. - -## 7.3.2 - -* Added builder for custom button in _LinkDialog. - -## 7.3.1 - -* Added case sensitive and whole word search parameters. -* Added wrap around. -* Moved search dialog to the bottom in order not to override the editor and the text found. -* Other minor search dialog enhancements. - -## 7.3.0 - -* Add default attributes to basic factory. - -## 7.2.19 - -* Feat/link regexp. - -## 7.2.18 - -* Fix paste block text in words apply same style. - -## 7.2.17 - -* Fix paste text mess up style. -* Add support copy/cut block text. - -## 7.2.16 - -* Allow for custom context menu. - -## 7.2.15 - -* Add flutter_quill.delta library which only exposes Delta datatype. - -## 7.2.14 - -* Fix errors when the editor is used in the `screenshot` package. - -## 7.2.13 - -* Fix around image can't delete line break. - -## 7.2.12 - -* Add support for copy/cut select image and text together. - -## 7.2.11 - -* Add affinity for localPosition. - -## 7.2.10 - -* LINE._getPlainText queryChild inclusive=false. - -## 7.2.9 - -* Add toPlainText method to `EmbedBuilder`. - -## 7.2.8 - -* Add custom button widget in toolbar. - -## 7.2.7 - -* Fix language code of Japan. - -## 7.2.6 - -* Style custom toolbar buttons like builtins. - -## 7.2.5 - -* Always use text cursor for editor on desktop. - -## 7.2.4 - -* Fixed keepStyleOnNewLine. - -## 7.2.3 - -* Get pixel ratio from view. - -## 7.2.2 - -* Prevent operations on stale editor state. - -## 7.2.1 - -* Add support for android keyboard content insertion. -* Enhance color picker, enter hex color and color palette option. - -## 7.2.0 - -* Checkboxes, bullet points, and number points are now scaled based on the default paragraph font size. - -## 7.1.20 - -* Pass linestyle to embedded block. - -## 7.1.19 - -* Fix Rtl leading alignment problem. - -## 7.1.18 - -* Support flutter latest version. - -## 7.1.17+1 - -* Updates `device_info_plus` to version 9.0.0 to benefit from AGP 8 (see [changelog##900](https://pub.dev/packages/device_info_plus/changelog##900)). - -## 7.1.16 - -* Fixed subscript key from 'sup' to 'sub'. - -## 7.1.15 - -* Fixed a bug introduced in 7.1.7 where each section in `QuillToolbar` was displayed on its own line. - -## 7.1.14 - -* Add indents change for multiline selection. - -## 7.1.13 - -* Add custom recognizer. - -## 7.1.12 - -* Add superscript and subscript styles. - -## 7.1.11 - -* Add inserting indents for lines of list if text is selected. - -## 7.1.10 - -* Image embedding tweaks - * Add MediaButton which is intened to superseed the ImageButton and VideoButton. Only image selection is working. - * Implement image insert for web (image as base64) - -## 7.1.9 - -* Editor tweaks PR from bambinoua(https://github.com/bambinoua). - * Shortcuts now working in Mac OS - * QuillDialogTheme is extended with new properties buttonStyle, linkDialogConstraints, imageDialogConstraints, isWrappable, runSpacing, - * Added LinkStyleButton2 with new LinkStyleDialog (similar to Quill implementation - * Conditinally use Row or Wrap for dialog's children. - * Update minimum Dart SDK version to 2.17.0 to use enum extensions. - * Use merging shortcuts and actions correclty (if the key combination is the same) - -## 7.1.8 - -* Dropdown tweaks - * Add itemHeight, itemPadding, defaultItemColor for customization of dropdown items. - * Remove alignment property as useless. - * Fix bugs with max width when width property is null. - -## 7.1.7 - -* Toolbar tweaks. - * Implement tooltips for embed CameraButton, VideoButton, FormulaButton, ImageButton. - * Extends customization for SelectAlignmentButton, QuillFontFamilyButton, QuillFontSizeButton adding padding, text style, alignment, width. - * Add renderFontFamilies to QuillFontFamilyButton to show font faces in dropdown. - * Add AxisDivider and its named constructors for for use in parent project. - * Export ToolbarButtons enum to allow specify tooltips for SelectAlignmentButton. - * Export QuillFontFamilyButton, SearchButton as they were not exported before. - * Deprecate items property in QuillFontFamilyButton, QuillFontSizeButton as the it can be built usinr rawItemsMap. - * Make onSelection QuillFontFamilyButton, QuillFontSizeButton omittable as no need to execute callback outside if controller is passed to widget. - -Now the package is more friendly for web projects. - -## 7.1.6 - -* Add enableUnfocusOnTapOutside field to RawEditor and Editor widgets. - -## 7.1.5 - -* Add tooltips for toolbar buttons. - -## 7.1.4 - -* Fix inserting tab character in lists. - -## 7.1.3 - -* Fix ios cursor bug when word.length==1. - -## 7.1.2 - -* Fix non scrollable editor exception, when tapped under content. - -## 7.1.1 - -* customLinkPrefixes parameter * makes possible to open links with custom protoco. - -## 7.1.0 - -* Fix ordered list numeration with several lists in document. - -## 7.0.9 - -* Use const constructor for EmbedBuilder. - -## 7.0.8 - -* Fix IME position bug with scroller. - -## 7.0.7 - -* Add TextFieldTapRegion for contextMenu. - -## 7.0.6 - -* Fix line style loss on new line from non string. - -## 7.0.5 - -* Fix IME position bug for Mac and Windows. -* Unfocus when tap outside editor. fix the bug that cant refocus in afterButtonPressed after click ToggleStyleButton on Mac. - -## 7.0.4 - -* Have text selection span full line height for uneven sized text. - -## 7.0.3 - -* Fix ordered list numeration for lists with more than one level of list. - -## 7.0.2 - -* Allow widgets to override widget span properties. - -## 7.0.1 - -* Update i18n_extension dependency to version 8.0.0. - -## 7.0.0 - -* Breaking change: Tuples are no longer used. They have been replaced with a number of data classes. - -## 6.4.4 - -* Increased compatibility with Flutter widget tests. - -## 6.4.3 - -* Update dependencies (collection: 1.17.0, flutter_keyboard_visibility: 5.4.0, quiver: 3.2.1, tuple: 2.0.1, url_launcher: 6.1.9, characters: 1.2.1, i18n_extension: 7.0.0, device_info_plus: 8.1.0) - -## 6.4.2 - -* Replace `buildToolbar` with `contextMenuBuilder`. - -## 6.4.1 - -* Control the detect word boundary behaviour. - -## 6.4.0 - -* Use `axis` to make the toolbar vertical. -* Use `toolbarIconCrossAlignment` to align the toolbar icons on the cross axis. -* Breaking change: `QuillToolbar`'s parameter `toolbarHeight` was renamed to `toolbarSize`. - -## 6.3.5 - -* Ability to add custom shortcuts. - -## 6.3.4 - -* Update clipboard status prior to showing selected text overlay. - -## 6.3.3 - -* Fixed handling of mac intents. - -## 6.3.2 - -* Added `unknownEmbedBuilder` to QuillEditor. -* Fix error style when input chinese japanese or korean. - -## 6.3.1 - -* Add color property to the basic factory function. - -## 6.3.0 - -* Support Flutter 3.7. - -## 6.2.2 - -* Fix: nextLine getter null where no assertion. - -## 6.2.1 - -* Revert "Align numerical and bullet lists along with text content". - -## 6.2.0 - -* Align numerical and bullet lists along with text content. - -## 6.1.12 - -* Apply i18n for default font dropdown option labels corresponding to 'Clear'. - -## 6.1.11 - -* Remove iOS hack for delaying focus calculation. - -## 6.1.10 - -* Delay focus calculation for iOS. - -## 6.1.9 - -* Bump keyboard show up wait to 1 sec. - -## 6.1.8 - -* Recalculate focus when showing keyboard. - -## 6.1.7 - -* Add czech localizations. - -## 6.1.6 - -* Upgrade i18n_extension to 6.0.0. - -## 6.1.5 - -* Fix formatting exception. - -## 6.1.4 - -* Add double quotes validation. - -## 6.1.3 - -* Revert "fix order list numbering (##988)". - -## 6.1.2 - -* Add typing shortcuts. - -## 6.1.1 - -* Fix order list numbering. - -## 6.1.0 - -* Add keyboard shortcuts for editor actions. - -## 6.0.10 - -* Upgrade device info plus to ^7.0.0. - -## 6.0.9 - -* Don't throw showAutocorrectionPromptRect not implemented. The function is called with every keystroke as a user is typing. - -## 6.0.8+1 - -* Fixes null pointer when setting documents. - -## 6.0.8 - -* Make QuillController.document mutable. - -## 6.0.7 - -* Allow disabling of selection toolbar. - -## 6.0.6+1 - -* Revert 6.0.6. - -## 6.0.6 - -* Fix wrong custom embed key. - -## 6.0.5 - -* Fixes toolbar buttons stealing focus from editor. - -## 6.0.4 - -* Bug fix for Type 'Uint8List' not found. - -## 6.0.3 - -* Add ability to paste images. - -## 6.0.2 - -* Address Dart Analysis issues. - -## 6.0.1 - -* Changed translation country code (zh_HK -> zh_hk) to lower case, which is required for i18n_extension used in flutter_quill. -* Add localization in example's main to demonstrate translation. -* Issue Windows selection's copy / paste tool bar not shown ##861: add selection's copy / paste toolbar, escape to hide toolbar, mouse right click to show toolbar, ctrl-Y / ctrl-Z to undo / redo. -* Image and video displayed in Windows platform caused screen flickering while selecting text, a sample_data_nomedia.json asset is added for Desktop to demonstrate the added features. -* Known issue: keyboard action sometimes causes exception mentioned in Flutter's issue ##106475 (Windows Keyboard shortcuts stop working after modifier key repeat flutter/flutter##106475). -* Know issue: user needs to click the editor to get focus before toolbar is able to display. - -## 6.0.0 BREAKING CHANGE - -* Removed embed (image, video & formula) blocks from the package to reduce app size. - -These blocks have been moved to the package `flutter_quill_extensions`, migrate by filling the `embedBuilders` and `embedButtons` parameters as follows: - -``` -import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'; - -QuillEditor.basic( - controller: controller, - embedBuilders: FlutterQuillEmbeds.builders(), -); - -QuillToolbar.basic( - controller: controller, - embedButtons: FlutterQuillEmbeds.buttons(), -); -``` - -## 5.4.2 - -* Upgrade i18n_extension. - -## 5.4.1 - -* Update German Translation. - -## 5.4.0 - -* Added Formula Button (for maths support). - -## 5.3.2 - -* Add more font family. - -## 5.3.1 - -* Enable search when text is not empty. - -## 5.3.0 - -* Added search function. - -## 5.2.11 - -* Remove default small color. - -## 5.2.10 - -* Don't wrap the QuillEditor's child in the EditorTextSelectionGestureDetector if selection is disabled. - -## 5.2.9 - -* Added option to modify SelectHeaderStyleButton options. -* Added option to click again on h1, h2, h3 button to go back to normal. - -## 5.2.8 - -* Remove tooltip for LinkStyleButton. -* Make link match regex case insensitive. - -## 5.2.7 - -* Add locale to QuillEditor.basic. - -## 5.2.6 - -* Fix keyboard pops up when resizing the image. - -## 5.2.5 - -* Upgrade youtube_player_flutter_quill to 8.2.2. - -## 5.2.4 - -* Upgrade youtube_player_flutter_quill to 8.2.1. - -## 5.2.3 - -* Flutter Quill Doesn't Work On iOS 16 or Xcode 14 Betas (Stored properties cannot be marked potentially unavailable with '@available'). - -## 5.2.2 - -* Fix Web Unsupported operation: Platform.\_operatingSystem error. - -## 5.2.1 - -* Rename QuillCustomIcon to QuillCustomButton. - -## 5.2.0 - -* Support font family selection. - -## 5.1.1 - -* Update README. - -## 5.1.0 - -* Added CustomBlockEmbed and customElementsEmbedBuilder. - -## 5.0.5 - -* Upgrade device_info_plus to 4.0.0. - -## 5.0.4 - -* Added onVideoInit callback for video documents. - -## 5.0.3 - -* Update dependencies. - -## 5.0.2 - -* Keep cursor position on checkbox tap. - -## 5.0.1 - -* Fix static analysis errors. - -## 5.0.0 - -* Flutter 3.0.0 support. - -## 4.2.3 - -* Ignore color:inherit and convert double to int for level. - -## 4.2.2 - -* Add clear option to font size dropdown. - -## 4.2.1 - -* Refactor font size dropdown. - -## 4.2.0 - -* Ensure selectionOverlay is available for showToolbar. - -## 4.1.9 - -* Using properly iconTheme colors. - -## 4.1.8 - -* Update font size dropdown. - -## 4.1.7 - -* Convert FontSize to a Map to allow for named Font Size. - -## 4.1.6 - -* Update quill_dropdown_button.dart. - -## 4.1.5 - -* Add Font Size dropdown to the toolbar. - -## 4.1.4 - -* New borderRadius for iconTheme. - -## 4.1.3 - -* Fix selection handles show/hide after paste, backspace, copy. - -## 4.1.2 - -* Add full support for hardware keyboards (Chromebook, Android tablets, etc) that don't alter screen UI. - -## 4.1.1 - -* Added textSelectionControls field in QuillEditor. - -## 4.1.0 - -* Added Node to linkActionPickerDelegate. - -## 4.0.12 - -* Add Persian(fa) language. - -## 4.0.11 - -* Fix cut selection error in multi-node line. - -## 4.0.10 - -* Fix vertical caret position bug. - -## 4.0.9 - -* Request keyboard focus when no child is found. - -## 4.0.8 - -* Fix blank lines do not display when **web*renderer=html. - -## 4.0.7 - -* Refactor getPlainText (better handling of blank lines and lines with multiple markups. - -## 4.0.6 - -* Bug fix for copying text with new lines. - -## 4.0.5 - -* Fixed casting null to Tuple2 when link dialog is dismissed without any input (e.g. barrier dismissed). - -## 4.0.4 - -* Bug fix for text direction rtl. - -## 4.0.3 - -* Support text direction rtl. - -## 4.0.2 - -* Clear toggled style on selection change. - -## 4.0.1 - -* Fix copy/cut/paste/selectAll not working. - -## 4.0.0 - -* Upgrade for Flutter 2.10. - -## 3.9.11 - -* Added Indonesian translation. - -## 3.9.10 - -* Fix for undoing a modification ending with an indented line. - -## 3.9.9 - -* iOS: Save image whose filename does not end with image file extension. - -## 3.9.8 - -* Added Urdu translation. - -## 3.9.7 - -* Fix for clicking on the Link button without any text on a new line crashes. - -## 3.9.6 - -* Apply locale to QuillEditor(contents). - -## 3.9.5 - -* Fix image pasting. - -## 3.9.4 - -* Hiding dialog after selecting action for image. - -## 3.9.3 - -* Update ImageResizer for Android. - -## 3.9.2 - -* Copy image with its style. - -## 3.9.1 - -* Support resizing image. - -## 3.9.0 - -* Image menu options for copy/remove. - -## 3.8.8 - -* Update set textEditingValue. - -## 3.8.7 - -* Fix checkbox not toggled correctly in toolbar button. - -## 3.8.6 - -* Fix cursor position changes when checking/unchecking the checkbox. - -## 3.8.5 - -* Fix \_handleDragUpdate in \_TextSelectionHandleOverlayState. - -## 3.8.4 - -* Fix link dialog layout. - -## 3.8.3 - -* Fix for errors on a non scrollable editor. - -## 3.8.2 - -* Fix certain keys not working on web when editor is a child of a scroll view. - -## 3.8.1 - -* Refactor \_QuillEditorState to QuillEditorState. - -## 3.8.0 - -* Support pasting with format. - -## 3.7.3 - -* Fix selection overlay for collapsed selection. - -## 3.7.2 - -* Reverted Embed toPlainText change. - -## 3.7.1 - -* Change Embed toPlainText to be empty string. - -## 3.7.0 - -* Replace Toolbar showHistory group with individual showRedo and showUndo. - -## 3.6.5 - -* Update Link dialogue for image/video. - -## 3.6.4 - -* Link dialogue TextInputType.multiline. - -## 3.6.3 - -* Bug fix for link button text selection. - -## 3.6.2 - -* Improve link button. - -## 3.6.1 - -* Remove SnackBar 'What is entered is not a link'. - -## 3.6.0 - -* Allow link button to enter text. - -## 3.5.3 - -* Change link button behavior. - -## 3.5.2 - -* Bug fix for embed. - -## 3.5.1 - -* Bug fix for platform util. - -## 3.5.0 - -* Removed redundant classes. - -## 3.4.4 - -* Add more translations. - -## 3.4.3 - -* Preset link from attributes. - -## 3.4.2 - -* Fix launch link edit mode. - -## 3.4.1 - -* Placeholder effective in scrollable. - -## 3.4.0 - -* Option to save image in read-only mode. - -## 3.3.1 - -* Pass any specified key in QuillEditor constructor to super. - -## 3.3.0 - -* Fixed Style toggle issue. - -## 3.2.1 - -* Added new translations. - -## 3.2.0 - -* Support multiple links insertion on the go. - -## 3.1.1 - -* Add selection completed callback. - -## 3.1.0 - -* Fixed image ontap functionality. - -## 3.0.4 - -* Add maxContentWidth constraint to editor. - -## 3.0.3 - -* Do not show caret on screen when the editor is not focused. - -## 3.0.2 - -* Fix launch link for read-only mode. - -## 3.0.1 - -* Handle null value of Attribute.link. - -## 3.0.0 - -* Launch link improvements. -* Removed QuillSimpleViewer. - -## 2.5.2 - -* Skip image when pasting. - -## 2.5.1 - -* Bug fix for Desktop `Shift` + `Click` support. - -## 2.5.0 - -* Update checkbox list. - -## 2.4.1 - -* Desktop selection improvements. - -## 2.4.0 - -* Improve inline code style. - -## 2.3.3 - -* Improves selection rects to have consistent height regardless of individual segment text styles. - -## 2.3.2 - -* Allow disabling floating cursor. - -## 2.3.1 - -* Preserve last newline character on delete. - -## 2.3.0 - -* Massive changes to support flutter 2.8. - -## 2.2.2 - -* iOS - floating cursor. - -## 2.2.1 - -* Bug fix for imports supporting flutter 2.8. - -## 2.2.0 - -* Support flutter 2.8. - -## 2.1.1 - -* Add methods of clearing editor and moving cursor. - -## 2.1.0 - -* Add delete handler. - -## 2.0.23 - -* Support custom replaceText handler. - -## 2.0.22 - -* Fix attribute compare and fix font size parsing. - -## 2.0.21 - -* Handle click on embed object. - -## 2.0.20 - -* Improved UX/UI of Image widget. - -## 2.0.19 - -* When uploading a video, applying indicator. - -## 2.0.18 - -* Make toolbar dividers optional. - -## 2.0.17 - -* Allow alignment of the toolbar icons to match WrapAlignment. - -## 2.0.16 - -* Add hide / show alignment buttons. - -## 2.0.15 - -* Implement change cursor to SystemMouseCursors.click when hovering a link styled text. - -## 2.0.14 - -* Enable customize the checkbox widget using DefaultListBlockStyle style. - -## 2.0.13 - -* Improve the scrolling performance by reducing the repaint areas. - -## 2.0.12 - -* Fix the selection effect can't be seen as the textLine with background color. - -## 2.0.11 - -* Fix visibility of text selection handlers on scroll. - -## 2.0.10 - -* cursorConnt.color notify the text_line to repaint if it was disposed. - -## 2.0.9 - -* Improve UX when trying to add a link. - -## 2.0.8 - -* Adding translations to the toolbar. - -## 2.0.7 - -* Added theming options for toolbar icons and LinkDialog. - -## 2.0.6 - -* Avoid runtime error when placed inside TabBarView. - -## 2.0.5 - -* Support inline code formatting. - -## 2.0.4 - -* Enable history shortcuts for desktop. - -## 2.0.3 - -* Fix cursor when line contains image. - -## 2.0.2 - -* Address KeyboardListener class name conflict. - -## 2.0.1 - -* Upgrade flutter_colorpicker to 0.5.0. - -## 2.0.0 - -* Text Alignment functions + Block Format standards. - -## 1.9.6 - -* Support putting QuillEditor inside a Scrollable view. - -## 1.9.5 - -* Skip image when pasting. - -## 1.9.4 - -* Bug fix for cursor position when tapping at the end of line with image(s). - -## 1.9.3 - -* Bug fix when line only contains one image. - -## 1.9.2 - -* Support for building custom inline styles. - -## 1.9.1 - -* Cursor jumps to the most appropriate offset to display selection. - -## 1.9.0 - -* Support inline image. - -## 1.8.3 - -* Updated quill_delta. - -## 1.8.2 - -* Support mobile image alignment. - -## 1.8.1 - -* Support mobile custom size image. - -## 1.8.0 - -* Support entering link for image/video. - -## 1.7.3 - -* Bumps photo_view version. - -## 1.7.2 - -* Fix static analysis error. - -## 1.7.1 - -* Support Youtube video. - -## 1.7.0 - -* Support video. - -## 1.6.4 - -* Bug fix for clear format button. - -## 1.6.3 - -* Fixed dragging right handle scrolling issue. - -## 1.6.2 - -* Fixed the position of the selection status drag handle. - -## 1.6.1 - -* Upgrade image_picker and flutter_colorpicker. - -## 1.6.0 - -* Support Multi Row Toolbar. - -## 1.5.0 - -* Remove file_picker dependency. - -## 1.4.1 - -* Remove filesystem_picker dependency. - -## 1.4.0 - -* Remove path_provider dependency. - -## 1.3.4 - -* Add option to paintCursorAboveText. - -## 1.3.3 - -* Upgrade file_picker version. - -## 1.3.2 - -* Fix copy/paste bug. - -## 1.3.1 - -* New logo. - -## 1.3.0 - -* Support flutter 2.2.0. - -## 1.2.2 - -* Checkbox supports tapping. - -## 1.2.1 - -* Indented position not holding while editing. - -## 1.2.0 - -* Fix image button cancel causes crash. - -## 1.1.8 - -* Fix height of empty line bug. - -## 1.1.7 - -* Fix text selection in read-only mode. - -## 1.1.6 - -* Remove universal_html dependency. - -## 1.1.5 - -* Enable "Select", "Select All" and "Copy" in read-only mode. - -## 1.1.4 - -* Fix text selection issue. - -## 1.1.3 - -* Update example folder. - -## 1.1.2 - -* Add pedantic. - -## 1.1.1 - -* Base64 image support. - -## 1.1.0 - -* Support null safety. - -## 1.0.9 - -* Web support for raw editor and keyboard listener. - -## 1.0.8 - -* Support token attribute. - -## 1.0.7 - -* Fix crash on web (dart:io). - -## 1.0.6 - -* Add desktop support WINDOWS, MACOS and LINUX. - -## 1.0.5 - -* Bug fix: Can not insert newline when Bold is toggled ON. - -## 1.0.4 - -* Upgrade photo_view to ^0.11.0. - -## 1.0.3 - -* Fix issue that text is not displayed while typing WEB. - -## 1.0.2 - -* Update toolbar in sample home page. - -## 1.0.1 - -* Fix static analysis errors. - -## 1.0.0 - -* Support flutter 2.0. - -## 1.0.0-dev.2 - -* Improve link handling for tel, mailto and etc. - -## 1.0.0-dev.1 - -* Upgrade prerelease SDK & Bump for master. - -## 0.3.5 - -* Fix for cursor focus issues when keyboard is on. - -## 0.3.4 - -* Improve link handling for tel, mailto and etc. - -## 0.3.3 - -* More fix on cursor focus issue when keyboard is on. - -## 0.3.2 - -* Fix cursor focus issue when keyboard is on. - -## 0.3.1 - -* cursor focus when keyboard is on. - -## 0.3.0 - -* Line Height calculated based on font size. - -## 0.2.12 - -* Support placeholder. - -## 0.2.11 - -* Fix static analysis error. - -## 0.2.10 - -* Update TextInputConfiguration autocorrect to true in stable branch. - -## 0.2.9 - -* Update TextInputConfiguration autocorrect to true. - -## 0.2.8 - -* Support display local image besides network image in stable branch. - -## 0.2.7 - -* Support display local image besides network image. - -## 0.2.6 - -* Fix cursor after pasting. - -## 0.2.5 - -* Toggle text/background color button in toolbar. - -## 0.2.4 - -* Support the use of custom icon size in toolbar. - -## 0.2.3 - -* Support custom styles and image on local device storage without uploading. - -## 0.2.2 - -* Update git repo. - -## 0.2.1 - -* Fix static analysis error. - -## 0.2.0 - -* Add checked/unchecked list button in toolbar. - -## 0.1.8 - -* Support font and size attributes. - -## 0.1.7 - -* Support checked/unchecked list. - -## 0.1.6 - -* Fix getExtentEndpointForSelection. - -## 0.1.5 - -* Support text alignment. - -## 0.1.4 - -* Handle url with trailing spaces. - -## 0.1.3 - -* Handle cursor position change when undo/redo. - -## 0.1.2 - -* Handle more text colors. - -## 0.1.1 - -* Fix cursor issue when undo. - -## 0.1.0 - -* Fix insert image. - -## 0.0.9 - -* Handle rgba color. - -## 0.0.8 - -* Fix launching url. - -## 0.0.7 - -* Handle multiple image inserts. - -## 0.0.6 - -* More toolbar functionality. - -## 0.0.5 - -* Update example. - -## 0.0.4 - -* Update example. - -## 0.0.3 - -* Update home page meta data. - -## 0.0.2 - -* Support image upload and launch url in read-only mode. - -## 0.0.1 - -* Rich text editor based on Quill Delta. - diff --git a/quill_native_bridge/LICENSE b/quill_native_bridge/LICENSE deleted file mode 100644 index e7ff73e1b..000000000 --- a/quill_native_bridge/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Flutter Quill project and open source contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/quill_native_bridge/README.md b/quill_native_bridge/README.md deleted file mode 100644 index 216dfc41e..000000000 --- a/quill_native_bridge/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# πŸͺΆ Quill Native Bridge - -An internal plugin for [`flutter_quill`](https://pub.dev/packages/flutter_quill) package to access platform-specific APIs. - -> [!NOTE] -> **Internal Use Only**: Exclusively for `flutter_quill`. Breaking changes may occur. \ No newline at end of file diff --git a/quill_native_bridge/analysis_options.yaml b/quill_native_bridge/analysis_options.yaml deleted file mode 100644 index b6065426f..000000000 --- a/quill_native_bridge/analysis_options.yaml +++ /dev/null @@ -1,32 +0,0 @@ -include: package:flutter_lints/flutter.yaml - -linter: - rules: - always_declare_return_types: true - always_put_required_named_parameters_first: true - annotate_overrides: true - avoid_empty_else: true - avoid_escaping_inner_quotes: true - avoid_print: true - avoid_types_on_closure_parameters: true - avoid_void_async: true - cascade_invocations: true - directives_ordering: true - omit_local_variable_types: true - prefer_const_constructors: true - prefer_const_constructors_in_immutables: true - prefer_const_declarations: true - prefer_final_fields: true - prefer_final_in_for_each: true - prefer_final_locals: true - prefer_initializing_formals: true - prefer_int_literals: true - prefer_interpolation_to_compose_strings: true - prefer_relative_imports: true - prefer_single_quotes: true - sort_constructors_first: true - sort_unnamed_constructors_first: true - unnecessary_lambdas: true - unnecessary_parenthesis: true - unnecessary_string_interpolations: true - avoid_web_libraries_in_flutter: true diff --git a/quill_native_bridge/ios/.gitignore b/quill_native_bridge/ios/.gitignore deleted file mode 100644 index 034771fc9..000000000 --- a/quill_native_bridge/ios/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig -/Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh diff --git a/quill_native_bridge/ios/Assets/.gitkeep b/quill_native_bridge/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/quill_native_bridge/ios/Classes/QuillNativeBridgePlugin.swift b/quill_native_bridge/ios/Classes/QuillNativeBridgePlugin.swift deleted file mode 100644 index e5e9997ab..000000000 --- a/quill_native_bridge/ios/Classes/QuillNativeBridgePlugin.swift +++ /dev/null @@ -1,23 +0,0 @@ -import Flutter -import UIKit - -public class QuillNativeBridgePlugin: NSObject, FlutterPlugin { - public static func register(with registrar: FlutterPluginRegistrar) { - let channel = FlutterMethodChannel(name: "quill_native_bridge", binaryMessenger: registrar.messenger()) - let instance = QuillNativeBridgePlugin() - registrar.addMethodCallDelegate(instance, channel: channel) - } - - public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - switch call.method { - case "isIOSSimulator": - #if targetEnvironment(simulator) - result(true) - #else - result(false) - #endif - default: - result(FlutterMethodNotImplemented) - } - } -} diff --git a/quill_native_bridge/ios/quill_native_bridge.podspec b/quill_native_bridge/ios/quill_native_bridge.podspec deleted file mode 100644 index 3e59e619e..000000000 --- a/quill_native_bridge/ios/quill_native_bridge.podspec +++ /dev/null @@ -1,29 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint quill_native_bridge.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'quill_native_bridge' - s.version = '0.0.1' - s.summary = 'A plugin for flutter_quill' - s.description = <<-DESC -An internal plugin for flutter_quill package to access platform-specific APIs. - DESC - s.homepage = 'https://github.com/singerdmx/flutter-quill' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Quill' => 'https://github.com/singerdmx/flutter-quill' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'Flutter' - s.platform = :ios, '12.0' - - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } - s.swift_version = '5.0' - - # If your plugin requires a privacy manifest, for example if it uses any - # required reason APIs, update the PrivacyInfo.xcprivacy file to describe your - # plugin's privacy impact, and then uncomment this line. For more information, - # see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files - # s.resource_bundles = {'quill_native_bridge_privacy' => ['Resources/PrivacyInfo.xcprivacy']} -end diff --git a/quill_native_bridge/lib/quill_native_bridge.dart b/quill_native_bridge/lib/quill_native_bridge.dart deleted file mode 100644 index a14a6d271..000000000 --- a/quill_native_bridge/lib/quill_native_bridge.dart +++ /dev/null @@ -1,14 +0,0 @@ -library; - -import 'src/quill_native_bridge_platform_interface.dart'; - -class QuillNativeBridge { - QuillNativeBridge._(); - - /// Check if the app is running on [iOS Simulator](https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device). - /// - /// This function should only be called when [defaultTargetPlatform] - /// is [TargetPlatform.iOS] and [kIsWeb] is `false`. - static Future isIOSSimulator() => - QuillNativeBridgePlatform.instance.isIOSSimulator(); -} diff --git a/quill_native_bridge/lib/src/quill_native_bridge_method_channel.dart b/quill_native_bridge/lib/src/quill_native_bridge_method_channel.dart deleted file mode 100644 index e4475cbc5..000000000 --- a/quill_native_bridge/lib/src/quill_native_bridge_method_channel.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import 'quill_native_bridge_platform_interface.dart'; - -class MethodChannelQuillNativeBridge implements QuillNativeBridgePlatform { - @visibleForTesting - final methodChannel = const MethodChannel('quill_native_bridge'); - - @override - Future isIOSSimulator() async { - assert(() { - if (kIsWeb || defaultTargetPlatform != TargetPlatform.iOS) { - throw FlutterError( - 'isIOSSimulator() method should be called only on iOS.', - ); - } - return true; - }()); - final isSimulator = - await methodChannel.invokeMethod('isIOSSimulator'); - assert(() { - if (isSimulator == null) { - throw FlutterError( - 'isSimulator should not be null.', - ); - } - return true; - }()); - return isSimulator ?? false; - } -} diff --git a/quill_native_bridge/lib/src/quill_native_bridge_platform_interface.dart b/quill_native_bridge/lib/src/quill_native_bridge_platform_interface.dart deleted file mode 100644 index 406c530e3..000000000 --- a/quill_native_bridge/lib/src/quill_native_bridge_platform_interface.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -import 'quill_native_bridge_method_channel.dart'; - -abstract class QuillNativeBridgePlatform extends PlatformInterface { - /// Constructs a QuillNativeBridgePlatform. - QuillNativeBridgePlatform() : super(token: _token); - - /// Avoid using `const` when creating the `Object` for `_token` - static final Object _token = Object(); - - static QuillNativeBridgePlatform _instance = MethodChannelQuillNativeBridge(); - - /// The default instance of [QuillNativeBridgePlatform] to use. - /// - /// Defaults to [MethodChannelQuillNativeBridge]. - static QuillNativeBridgePlatform get instance => _instance; - - /// Platform-specific implementations should set this with their own - /// platform-specific class that extends [QuillNativeBridgePlatform] when - /// they register themselves. - static set instance(QuillNativeBridgePlatform instance) { - PlatformInterface.verify(instance, _token); - _instance = instance; - } - - /// Check if the app is running on [iOS Simulator](https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device). - Future isIOSSimulator() { - throw UnimplementedError('isIOSSimulator() has not been implemented.'); - } -} diff --git a/quill_native_bridge/pubspec.yaml b/quill_native_bridge/pubspec.yaml deleted file mode 100644 index da87139e3..000000000 --- a/quill_native_bridge/pubspec.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: quill_native_bridge -description: "An internal plugin for flutter_quill package to access platform-specific APIs" -version: 10.7.3 -homepage: https://github.com/singerdmx/flutter-quill/tree/master/quill_native_bridge/ -repository: https://github.com/singerdmx/flutter-quill/tree/master/quill_native_bridge/ -issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ -documentation: https://github.com/singerdmx/flutter-quill/tree/master/quill_native_bridge/ - -environment: - sdk: ^3.5.1 - flutter: '>=3.3.0' - -dependencies: - flutter: - sdk: flutter - plugin_platform_interface: ^2.1.8 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^5.0.0 - -flutter: - plugin: - platforms: - ios: - pluginClass: QuillNativeBridgePlugin \ No newline at end of file diff --git a/quill_native_bridge/test/quill_native_bridge_method_channel_test.dart b/quill_native_bridge/test/quill_native_bridge_method_channel_test.dart deleted file mode 100644 index d0e1bbd46..000000000 --- a/quill_native_bridge/test/quill_native_bridge_method_channel_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:quill_native_bridge/src/quill_native_bridge_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - final platform = MethodChannelQuillNativeBridge(); - const channel = MethodChannel('quill_native_bridge'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler( - channel, - (methodCall) async { - return false; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler(channel, null); - }); - - test('isIOSSimulator', () async { - debugDefaultTargetPlatformOverride = TargetPlatform.iOS; - expect(await platform.isIOSSimulator(), false); - }); -} diff --git a/quill_native_bridge/test/quill_native_bridge_test.dart b/quill_native_bridge/test/quill_native_bridge_test.dart deleted file mode 100644 index 5ad8c969e..000000000 --- a/quill_native_bridge/test/quill_native_bridge_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; -import 'package:quill_native_bridge/quill_native_bridge.dart'; -import 'package:quill_native_bridge/src/quill_native_bridge_method_channel.dart'; -import 'package:quill_native_bridge/src/quill_native_bridge_platform_interface.dart'; - -class MockQuillNativeBridgePlatform - with MockPlatformInterfaceMixin - implements QuillNativeBridgePlatform { - @override - Future isIOSSimulator() async => false; -} - -void main() { - final initialPlatform = QuillNativeBridgePlatform.instance; - - test('$MethodChannelQuillNativeBridge is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('isIOSSimulator', () async { - final fakePlatform = MockQuillNativeBridgePlatform(); - QuillNativeBridgePlatform.instance = fakePlatform; - - debugDefaultTargetPlatformOverride = TargetPlatform.iOS; - expect(await QuillNativeBridge.isIOSSimulator(), false); - }); -}