diff --git a/MIGRATION.md b/MIGRATION.md index 3693391b..6cc91638 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,9 +1,13 @@ # Parchment +## 1.11.0 > 1.12.0 + +* Change `FleatherController(document);` to `FleatherController(document: document);` + ## 1.6.0 > 1.7.0 * Change `import 'package:parchment/convert.dart';` to `import 'package:parchment/codecs.dart';` * Change `parchmentMarkdown.encode(delta);` to `parchmentMarkdown.encode(ParchmentDocument.fromDelta(delta));` -* Change `parchmentMarkdown.decode(markdown);` to `parchmentMarkdown.decode(markdown).toDelta()` +* Change `parchmentMarkdown.decode(markdown);` to `parchmentMarkdown.decode(markdown).toDelta();` * Change `parchmentHtml.encode(delta);` to `parchmentHtml.encode(ParchmentDocument.fromDelta(delta));` -* Change `parchmentHtml.decode(html);` to `parchmentHtml.decode(html).toDelta()` +* Change `parchmentHtml.decode(html);` to `parchmentHtml.decode(html).toDelta();` diff --git a/packages/fleather/CHANGELOG.md b/packages/fleather/CHANGELOG.md index 0251946c..e8b58f75 100644 --- a/packages/fleather/CHANGELOG.md +++ b/packages/fleather/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.14.0 + +* Add `ClipboardManager` which can be used to implement rich clipboard +* Use overlay entries to prevent focus loss when selection color or heading in default toolbar +* Replace quill_delta package with parchment_delta +* [Fix] Caret movement issues +* [Fix] Caret painting on focus gain + ## 1.13.2 * [Fix] pub.dev issues diff --git a/packages/fleather/README.md b/packages/fleather/README.md index 737e1704..8057ba1a 100644 --- a/packages/fleather/README.md +++ b/packages/fleather/README.md @@ -28,7 +28,7 @@ Add Fleather to your dependencies. dependencies: flutter: sdk: flutter - fleather: ^1.13.2 + fleather: ^1.14.0 ``` ## Usage diff --git a/packages/fleather/lib/src/services/clipboard_manager.dart b/packages/fleather/lib/src/services/clipboard_manager.dart index 8c43b5f0..b52ec397 100644 --- a/packages/fleather/lib/src/services/clipboard_manager.dart +++ b/packages/fleather/lib/src/services/clipboard_manager.dart @@ -16,6 +16,8 @@ class FleatherClipboardData { bool get hasDelta => delta != null; bool get hasPlainText => plainText != null; + + bool get isEmpty => !hasPlainText && !hasDelta; } /// An abstract class for getting and setting data to clipboard diff --git a/packages/fleather/lib/src/widgets/editor.dart b/packages/fleather/lib/src/widgets/editor.dart index 495df5ee..483d8cba 100644 --- a/packages/fleather/lib/src/widgets/editor.dart +++ b/packages/fleather/lib/src/widgets/editor.dart @@ -1197,11 +1197,11 @@ class RawEditorState extends EditorState // Snapshot the input before using `await`. // See https://github.com/flutter/flutter/issues/11427 final data = await widget.clipboardManager.getData(); - if (data?.hasPlainText != true && data?.hasDelta != true) { + if (data == null || data.isEmpty) { return; } - if (data!.hasDelta) { + if (data.hasDelta) { controller.compose( (Delta() ..retain(selection.baseOffset) diff --git a/packages/fleather/pubspec.yaml b/packages/fleather/pubspec.yaml index 96c29d7d..5bf04795 100644 --- a/packages/fleather/pubspec.yaml +++ b/packages/fleather/pubspec.yaml @@ -1,6 +1,6 @@ name: fleather description: Clean, minimalistic and collaboration-ready rich text editor for Flutter. -version: 1.13.2 +version: 1.14.0 homepage: https://fleather-editor.github.io repository: https://github.com/fleather-editor/fleather issue_tracker: https://github.com/fleather-editor/fleather/issues diff --git a/packages/parchment/CHANGELOG.md b/packages/parchment/CHANGELOG.md index b610a0c3..f4d1c2c4 100644 --- a/packages/parchment/CHANGELOG.md +++ b/packages/parchment/CHANGELOG.md @@ -1,7 +1,13 @@ ## 1.13.0 + +* Replace quill_delta package with parchment_delta + +## 1.13.0 + * Upgrade dependencies ## 1.12.0 + * Introduce AutoFormats to handle automatic text formatting and make Heuristics only responsible for validity of document * [Fix] preserve line style on new line diff --git a/packages/parchment/pubspec.yaml b/packages/parchment/pubspec.yaml index f52ca411..f7f0afd6 100644 --- a/packages/parchment/pubspec.yaml +++ b/packages/parchment/pubspec.yaml @@ -1,6 +1,6 @@ name: parchment description: Platform-agnostic rich text document model based on Delta format and used in Fleather editor. -version: 1.13.0 +version: 1.14.0 homepage: https://fleather-editor.github.io repository: https://github.com/fleather-editor/fleather issue_tracker: https://github.com/fleather-editor/fleather/issues