Skip to content

Commit 6cebd4e

Browse files
authored
Merge branch 'master' into master
2 parents ee7fcbf + b1d9a59 commit 6cebd4e

File tree

9 files changed

+86
-27
lines changed

9 files changed

+86
-27
lines changed

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111
## [Unreleased]
1212

13-
### Added
13+
### Changed
1414

15+
- **BREAKING**: Change the `options` parameter class type from `QuillToolbarToggleStyleButtonOptions` to `QuillToolbarClipboardButtonOptions` in `QuillToolbarClipboardButton`. To migrate, use `QuillToolbarClipboardButtonOptions` instead of `QuillToolbarToggleStyleButtonOptions` [#2433](https://github.com/singerdmx/flutter-quill/pull/2433).
1516
- `enableClipboardPaste` flag in `QuillToolbarClipboardButton` to determine if the button defaults to `null,` which will use `ClipboardMonitor`, which checks every second if the clipboard has content to paste [#2427](https://github.com/singerdmx/flutter-quill/pull/2427).
16-
- Croatian (hr) language translation.
17+
18+
## [11.0.0-dev.19] - 2025-01-10
19+
20+
### Added
21+
22+
- Croatian (hr) language translation [#2431](https://github.com/singerdmx/flutter-quill/pull/2431).
1723

1824
### Changed
1925

@@ -180,7 +186,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
180186
- Apple-specific font dependency for subscript and superscript functionality from the example.
181187
- **BREAKING**: The [`super_clipboard`](https://pub.dev/packages/super_clipboard) plugin, To restore legacy behavior for `super_clipboard`, use [`flutter_quill_extensions`](https://pub.dev/packages/flutter_quill_extensions) package and `FlutterQuillExtensions.useSuperClipboardPlugin()`.
182188

183-
[unreleased]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.18...HEAD
189+
[unreleased]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.19...HEAD
190+
[11.0.0-dev.19]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.18...v11.0.0-dev.19
184191
[11.0.0-dev.18]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.17...v11.0.0-dev.18
185192
[11.0.0-dev.17]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.16...v11.0.0-dev.17
186193
[11.0.0-dev.16]: https://github.com/singerdmx/flutter-quill/compare/v11.0.0-dev.15...v11.0.0-dev.16

doc/migration/10_to_11.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ required for **custom toolbars**.
351351
- Renames `QuillToolbarToggleCheckListButtonOptions.isShouldRequestKeyboard` to `QuillToolbarToggleCheckListButtonOptions.shouldRequestKeyboard`.
352352
- Moved `onClipboardPaste` from `QuillControllerConfig` to `QuillClipboardConfig`. Added `clipboardConfig` property to `QuillControllerConfig`.
353353
- Moved `onImagePaste` and `onGifPaste` from the editor's config (`QuillEditorConfig` or `QuillRawEditorConfig`) to the clipboard's config (`QuillClipboardConfig`), which is part of the controller's config (`QuillControllerConfig`).
354+
- Changed the options type from `QuillToolbarToggleStyleButtonOptions` to `QuillToolbarClipboardButtonOptions` in `QuillToolbarClipboardButton`, use the new options class.
354355

355356
## 💥 Breaking behavior
356357

@@ -497,5 +498,6 @@ in non-major releases:
497498
- The `shouldNotifyListeners` in `QuillController.replaceText()`, `QuillController.replaceText()`, `QuillController.formatSelection()`.
498499
- The `QuillController.clipboardSelection()`.
499500
- The `CopyCutServiceProvider`, `CopyCutService`, and `DefaultCopyCutService`.
501+
- The clipboard action buttons in the `QuillSimpleToolbar` (`showClipboardCut`, `showClipboardCopy` and `showClipboardPaste`), including `QuillToolbarClipboardButton` and `ClipboardMonitor` due to a performance issue [#2421](https://github.com/singerdmx/flutter-quill/issues/2421).
500502

501503
The functionality itself has not changed and no experimental changes were introduced.

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ packages:
217217
path: ".."
218218
relative: true
219219
source: path
220-
version: "11.0.0-dev.18"
220+
version: "11.0.0-dev.19"
221221
flutter_quill_delta_from_html:
222222
dependency: transitive
223223
description:

lib/src/editor/config/editor_config.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,12 @@ class QuillEditorConfig {
488488
Brightness? keyboardAppearance,
489489
ScrollPhysics? scrollPhysics,
490490
ValueChanged<String>? onLaunchUrl,
491+
bool Function(
492+
TapDragDownDetails details, TextPosition Function(Offset offset))?
493+
onTapDown,
494+
bool Function(
495+
TapDragUpDetails details, TextPosition Function(Offset offset))?
496+
onTapUp,
491497
Iterable<EmbedBuilder>? embedBuilders,
492498
EmbedBuilder? unknownEmbedBuilder,
493499
CustomStyleBuilder? customStyleBuilder,
@@ -547,6 +553,8 @@ class QuillEditorConfig {
547553
keyboardAppearance: keyboardAppearance ?? this.keyboardAppearance,
548554
scrollPhysics: scrollPhysics ?? this.scrollPhysics,
549555
onLaunchUrl: onLaunchUrl ?? this.onLaunchUrl,
556+
onTapUp: onTapUp ?? this.onTapUp,
557+
onTapDown: onTapDown ?? this.onTapDown,
550558
embedBuilders: embedBuilders ?? this.embedBuilders,
551559
unknownEmbedBuilder: unknownEmbedBuilder ?? this.unknownEmbedBuilder,
552560
customStyleBuilder: customStyleBuilder ?? this.customStyleBuilder,

lib/src/toolbar/buttons/clipboard_button.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
@experimental
2+
library;
3+
14
import 'dart:async';
25

36
import 'package:flutter/foundation.dart';
47
import 'package:flutter/material.dart';
8+
import 'package:meta/meta.dart';
59

610
import '../../common/utils/widgets.dart';
711
import '../../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
812
import '../../l10n/extensions/localizations_ext.dart';
913
import '../base_button/base_value_button.dart';
1014
import '../simple_toolbar.dart';
1115

16+
@experimental
1217
enum ClipboardAction { cut, copy, paste }
1318

19+
@experimental
1420
class ClipboardMonitor {
1521
bool _canPaste = false;
1622
bool get canPaste => _canPaste;
@@ -51,17 +57,23 @@ class ClipboardMonitor {
5157
}
5258
}
5359

60+
@experimental
5461
class QuillToolbarClipboardButton extends QuillToolbarToggleStyleBaseButton {
5562
QuillToolbarClipboardButton({
5663
required super.controller,
5764
required this.clipboardAction,
58-
super.options = const QuillToolbarToggleStyleButtonOptions(),
65+
QuillToolbarClipboardButtonOptions? options,
5966

6067
/// Shares common options between all buttons, prefer the [options]
6168
/// over the [baseOptions].
6269
super.baseOptions,
6370
super.key,
64-
});
71+
}) : _options = options,
72+
super(options: options ?? const QuillToolbarClipboardButtonOptions());
73+
74+
// TODO: This field will be used by the PR: https://github.com/singerdmx/flutter-quill/pull/2427
75+
// ignore: unused_field
76+
final QuillToolbarClipboardButtonOptions? _options;
6577

6678
final ClipboardAction clipboardAction;
6779

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// @docImport '../../buttons/clipboard_button.dart';
2+
3+
@experimental
4+
library;
5+
6+
import 'package:meta/meta.dart';
7+
import 'toggle_style_options.dart';
8+
9+
@experimental
10+
class QuillToolbarClipboardButtonOptions
11+
extends QuillToolbarToggleStyleButtonOptions {
12+
const QuillToolbarClipboardButtonOptions({
13+
super.iconData,
14+
super.afterButtonPressed,
15+
super.childBuilder,
16+
super.iconTheme,
17+
super.tooltip,
18+
super.iconSize,
19+
super.iconButtonFactor,
20+
this.enableClipboardPaste,
21+
});
22+
23+
/// Determines if the paste button is enabled. The button is disabled and cannot be clicked if set to `false`.
24+
///
25+
/// Defaults to [ClipboardMonitor] in case of `null`, which checks if the clipboard has content to paste every second and only then enables the button, indicating to the user that they can paste something.
26+
///
27+
/// Set it to `true` to enable it even if the clipboard has no content to paste, which will do nothing on a press.
28+
final bool? enableClipboardPaste;
29+
}

lib/src/toolbar/config/simple_toolbar_button_options.dart

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import 'package:flutter/foundation.dart' show immutable;
1+
import 'package:meta/meta.dart';
22

33
import 'base_button_options.dart';
44
import 'buttons/clear_format_options.dart';
5+
import 'buttons/clipboard_button_options.dart';
56
import 'buttons/color_options.dart';
67
import 'buttons/custom_button_options.dart';
78
import 'buttons/font_family_options.dart';
@@ -21,6 +22,7 @@ import 'buttons/toggle_style_options.dart';
2122
export '../buttons/search/search_dialog.dart';
2223
export 'base_button_options.dart';
2324
export 'buttons/clear_format_options.dart';
25+
export 'buttons/clipboard_button_options.dart';
2426
export 'buttons/color_options.dart';
2527
export 'buttons/custom_button_options.dart';
2628
export 'buttons/font_family_options.dart';
@@ -76,9 +78,12 @@ class QuillSimpleToolbarButtonOptions {
7678
this.linkStyle = const QuillToolbarLinkStyleButtonOptions(),
7779
this.linkStyle2 = const QuillToolbarLinkStyleButton2Options(),
7880
this.customButtons = const QuillToolbarCustomButtonOptions(),
79-
this.clipboardCut = const QuillToolbarToggleStyleButtonOptions(),
80-
this.clipboardCopy = const QuillToolbarToggleStyleButtonOptions(),
81-
this.clipboardPaste = const QuillToolbarToggleStyleButtonOptions(),
81+
@experimental
82+
this.clipboardCut = const QuillToolbarClipboardButtonOptions(),
83+
@experimental
84+
this.clipboardCopy = const QuillToolbarClipboardButtonOptions(),
85+
@experimental
86+
this.clipboardPaste = const QuillToolbarClipboardButtonOptions(),
8287
});
8388

8489
/// The base options that will apply to all buttons,
@@ -109,26 +114,19 @@ class QuillSimpleToolbarButtonOptions {
109114
final QuillToolbarColorButtonOptions backgroundColor;
110115
final QuillToolbarClearFormatButtonOptions clearFormat;
111116

112-
/// The reason we call this buttons in the end because this is responsible
113-
/// for all the alignment buttons and not just one, you still
114-
/// can customize the icons and tooltips
115-
/// and you have child builder
116117
final QuillToolbarSelectAlignmentButtonOptions selectAlignmentButtons;
117118

118119
final QuillToolbarSearchButtonOptions search;
119120

120-
final QuillToolbarToggleStyleButtonOptions clipboardCut;
121-
final QuillToolbarToggleStyleButtonOptions clipboardCopy;
122-
final QuillToolbarToggleStyleButtonOptions clipboardPaste;
121+
@experimental
122+
final QuillToolbarClipboardButtonOptions clipboardCut;
123+
@experimental
124+
final QuillToolbarClipboardButtonOptions clipboardCopy;
125+
@experimental
126+
final QuillToolbarClipboardButtonOptions clipboardPaste;
123127

124-
/// The reason we call this buttons in the end because this is responsible
125-
/// for all the header style buttons and not just one, you still
126-
/// can customize it and you also have child builder
127128
final QuillToolbarSelectHeaderStyleButtonsOptions selectHeaderStyleButtons;
128129

129-
/// The reason we call this buttons in the end because this is responsible
130-
/// for all the header style buttons and not just one, you still
131-
/// can customize it and you also have child builder
132130
final QuillToolbarSelectHeaderStyleDropdownButtonOptions
133131
selectHeaderStyleDropdownButton;
134132

lib/src/toolbar/config/simple_toolbar_config.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ class QuillSimpleToolbarConfig {
107107
this.showSearchButton = true,
108108
this.showSubscript = true,
109109
this.showSuperscript = true,
110-
this.showClipboardCut = false,
111-
this.showClipboardCopy = false,
112-
this.showClipboardPaste = false,
110+
@experimental this.showClipboardCut = false,
111+
@experimental this.showClipboardCopy = false,
112+
@experimental this.showClipboardPaste = false,
113113
this.linkStyleType = LinkStyleType.original,
114114
this.headerStyleType = HeaderStyleType.original,
115115

@@ -179,8 +179,11 @@ class QuillSimpleToolbarConfig {
179179
final bool showSearchButton;
180180
final bool showSubscript;
181181
final bool showSuperscript;
182+
@experimental
182183
final bool showClipboardCut;
184+
@experimental
183185
final bool showClipboardCopy;
186+
@experimental
184187
final bool showClipboardPaste;
185188

186189
/// This activates a functionality that is only implemented in [flutter_quill] and is NOT originally

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_quill
22
description: "A rich text editor built for Android, iOS, Web, and desktop platforms. It's the WYSIWYG editor and a Quill component for Flutter."
3-
version: 11.0.0-dev.18
3+
version: 11.0.0-dev.19
44
homepage: https://github.com/singerdmx/flutter-quill/
55
repository: https://github.com/singerdmx/flutter-quill/
66
issue_tracker: https://github.com/singerdmx/flutter-quill/issues/

0 commit comments

Comments
 (0)