Skip to content

Commit

Permalink
chore: merge master branch and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoEllet committed Sep 25, 2024
2 parents e1b0eb3 + 38c9b0f commit 3cfdf18
Show file tree
Hide file tree
Showing 23 changed files with 793 additions and 68 deletions.
129 changes: 129 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,135 @@

All notable changes to this project will be documented in this file.

## 10.8.0

> [!CAUTION]
> This release can be breaking change for `flutter_quill_extensions` users as it remove the built-in support for loading YouTube videos
If you're using [flutter_quill_extensions](https://pub.dev/packages/flutter_quill_extensions) then this release, can be a breaking change for you if you load videos in the editor and expect YouTube videos to be supported, [youtube_player_flutter](https://pub.dev/packages/youtube_player_flutter) and [flutter_inappwebview](https://pub.dev/packages/flutter_inappwebview) are no longer dependencies of the extensions package, which are used to support loading YouTube Iframe videos on non-web platforms, more details about the discussion and reasons in [#2286](https://github.com/singerdmx/flutter-quill/pull/2286) and [#2284](https://github.com/singerdmx/flutter-quill/issues/2284).

We have added an experimental property that gives you more flexibility and control about the implementation you want to use for loading videos.

> [!WARNING]
> It's likely to experience some common issues while implementing this feature, especially on desktop platforms as the support for [flutter_inappwebview_windows](https://pub.dev/packages/flutter_inappwebview_windows) and [flutter_inappwebview_macos](https://pub.dev/packages/flutter_inappwebview_macos) before 2 days. Some of the issues are in the Flutter Quill editor.
If you want loading YouTube videos to be a feature again with the latest version of Flutter Quill, you can use an existing plugin or package, or implement your own solution. For example, you might use [`youtube_video_player`](https://pub.dev/packages/youtube_video_player) or [`youtube_player_flutter`](https://pub.dev/packages/youtube_player_flutter), which was previously used in [`flutter_quill_extensions`](https://pub.dev/packages/flutter_quill_extensions).

Here’s an example setup using `youtube_player_flutter`:

```shell
flutter pub add youtube_player_flutter
```

Example widget configuration:

```dart
import 'package:flutter/material.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
class YoutubeVideoPlayer extends StatefulWidget {
const YoutubeVideoPlayer({required this.videoUrl, super.key});
final String videoUrl;
@override
State<YoutubeVideoPlayer> createState() => _YoutubeVideoPlayerState();
}
class _YoutubeVideoPlayerState extends State<YoutubeVideoPlayer> {
late final YoutubePlayerController _youtubePlayerController;
@override
void initState() {
super.initState();
_youtubePlayerController = YoutubePlayerController(
initialVideoId: YoutubePlayer.convertUrlToId(widget.videoUrl) ??
(throw StateError('Expect a valid video URL')),
flags: const YoutubePlayerFlags(
autoPlay: true,
mute: true,
),
);
}
@override
Widget build(BuildContext context) {
return YoutubePlayer(
controller: _youtubePlayerController,
showVideoProgressIndicator: true,
);
}
@override
void dispose() {
_youtubePlayerController.dispose();
super.dispose();
}
}
```

Then, integrate it with `QuillEditorVideoEmbedConfigurations`

```dart
FlutterQuillEmbeds.editorBuilders(
videoEmbedConfigurations: QuillEditorVideoEmbedConfigurations(
customVideoBuilder: (videoUrl, readOnly) {
// Example: Check for YouTube Video URL and return your
// YouTube video widget here.
bool isYouTubeUrl(String videoUrl) {
try {
final uri = Uri.parse(videoUrl);
return uri.host == 'www.youtube.com' ||
uri.host == 'youtube.com' ||
uri.host == 'youtu.be' ||
uri.host == 'www.youtu.be';
} catch (_) {
return false;
}
}
if (isYouTubeUrl(videoUrl)) {
return YoutubeVideoPlayer(
videoUrl: videoUrl,
);
}
// Return null to fallback to the default logic
return null;
},
ignoreYouTubeSupport: true,
),
);
```

> [!NOTE]
> This example illustrates a basic approach, additional adjustments might be necessary to meet your specific needs. YouTube video support is no longer included in this project. Keep in mind that `customVideoBuilder` is experimental and can change without being considered as breaking change. More details in [breaking changes](https://github.com/singerdmx/flutter-quill#-breaking-changes) section.
[`super_clipboard`](https://pub.dev/packages/super_clipboard) will also no longer a dependency of `flutter_quill_extensions` once [PR #2230](https://github.com/singerdmx/flutter-quill/pull/2230) is ready.

We're looking forward to your feedback.

**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.7...v10.8.0

## 10.7.7

This version is nearly identical to `10.7.6` with a build failure bug fix in [#2283](https://github.com/singerdmx/flutter-quill/pull/2283) related to unmerged change in [#2230](https://github.com/singerdmx/flutter-quill/pull/2230)


**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.6...v10.7.7

## 10.7.6

* Code Comments Typo fixes by @Luismi74 in https://github.com/singerdmx/flutter-quill/pull/2267
* docs: add important note for contributors before introducing new features by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2269
* docs(readme): add 'Breaking Changes' section by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2275
* Fix: Resolved issue with broken IME composing rect in Windows desktop(re-implementation) by @agata in https://github.com/singerdmx/flutter-quill/pull/2282

## New Contributors
* @Luismi74 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2267

**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.5...v10.7.6

## 10.7.5

* fix(ci): add flutter pub get step for quill_native_bridge by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2265
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_DATA.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"10.8.0": "> [!CAUTION]\r\n> This release can be breaking change for `flutter_quill_extensions` users as it remove the built-in support for loading YouTube videos\r\n\r\nIf you're using [flutter_quill_extensions](https://pub.dev/packages/flutter_quill_extensions) then this release, can be a breaking change for you if you load videos in the editor and expect YouTube videos to be supported, [youtube_player_flutter](https://pub.dev/packages/youtube_player_flutter) and [flutter_inappwebview](https://pub.dev/packages/flutter_inappwebview) are no longer dependencies of the extensions package, which are used to support loading YouTube Iframe videos on non-web platforms, more details about the discussion and reasons in [#2286](https://github.com/singerdmx/flutter-quill/pull/2286) and [#2284](https://github.com/singerdmx/flutter-quill/issues/2284).\r\n\r\nWe have added an experimental property that gives you more flexibility and control about the implementation you want to use for loading videos.\r\n\r\n> [!WARNING]\r\n> It's likely to experience some common issues while implementing this feature, especially on desktop platforms as the support for [flutter_inappwebview_windows](https://pub.dev/packages/flutter_inappwebview_windows) and [flutter_inappwebview_macos](https://pub.dev/packages/flutter_inappwebview_macos) before 2 days. Some of the issues are in the Flutter Quill editor.\r\n\r\nIf you want loading YouTube videos to be a feature again with the latest version of Flutter Quill, you can use an existing plugin or package, or implement your own solution. For example, you might use [`youtube_video_player`](https://pub.dev/packages/youtube_video_player) or [`youtube_player_flutter`](https://pub.dev/packages/youtube_player_flutter), which was previously used in [`flutter_quill_extensions`](https://pub.dev/packages/flutter_quill_extensions).\r\n\r\nHere’s an example setup using `youtube_player_flutter`:\r\n\r\n```shell\r\nflutter pub add youtube_player_flutter\r\n```\r\n\r\nExample widget configuration:\r\n\r\n```dart\r\nimport 'package:flutter/material.dart';\r\nimport 'package:youtube_player_flutter/youtube_player_flutter.dart';\r\n\r\nclass YoutubeVideoPlayer extends StatefulWidget {\r\n const YoutubeVideoPlayer({required this.videoUrl, super.key});\r\n\r\n final String videoUrl;\r\n\r\n @override\r\n State<YoutubeVideoPlayer> createState() => _YoutubeVideoPlayerState();\r\n}\r\n\r\nclass _YoutubeVideoPlayerState extends State<YoutubeVideoPlayer> {\r\n late final YoutubePlayerController _youtubePlayerController;\r\n @override\r\n void initState() {\r\n super.initState();\r\n _youtubePlayerController = YoutubePlayerController(\r\n initialVideoId: YoutubePlayer.convertUrlToId(widget.videoUrl) ??\r\n (throw StateError('Expect a valid video URL')),\r\n flags: const YoutubePlayerFlags(\r\n autoPlay: true,\r\n mute: true,\r\n ),\r\n );\r\n }\r\n\r\n @override\r\n Widget build(BuildContext context) {\r\n return YoutubePlayer(\r\n controller: _youtubePlayerController,\r\n showVideoProgressIndicator: true,\r\n );\r\n }\r\n\r\n @override\r\n void dispose() {\r\n _youtubePlayerController.dispose();\r\n super.dispose();\r\n }\r\n}\r\n\r\n```\r\n\r\nThen, integrate it with `QuillEditorVideoEmbedConfigurations`\r\n\r\n```dart\r\nFlutterQuillEmbeds.editorBuilders(\r\n videoEmbedConfigurations: QuillEditorVideoEmbedConfigurations(\r\n customVideoBuilder: (videoUrl, readOnly) {\r\n // Example: Check for YouTube Video URL and return your\r\n // YouTube video widget here.\r\n bool isYouTubeUrl(String videoUrl) {\r\n try {\r\n final uri = Uri.parse(videoUrl);\r\n return uri.host == 'www.youtube.com' ||\r\n uri.host == 'youtube.com' ||\r\n uri.host == 'youtu.be' ||\r\n uri.host == 'www.youtu.be';\r\n } catch (_) {\r\n return false;\r\n }\r\n }\r\n\r\n if (isYouTubeUrl(videoUrl)) {\r\n return YoutubeVideoPlayer(\r\n videoUrl: videoUrl,\r\n );\r\n }\r\n\r\n // Return null to fallback to the default logic\r\n return null;\r\n },\r\n ignoreYouTubeSupport: true,\r\n ),\r\n);\r\n```\r\n\r\n> [!NOTE]\r\n> This example illustrates a basic approach, additional adjustments might be necessary to meet your specific needs. YouTube video support is no longer included in this project. Keep in mind that `customVideoBuilder` is experimental and can change without being considered as breaking change. More details in [breaking changes](https://github.com/singerdmx/flutter-quill#-breaking-changes) section.\r\n\r\n[`super_clipboard`](https://pub.dev/packages/super_clipboard) will also no longer a dependency of `flutter_quill_extensions` once [PR #2230](https://github.com/singerdmx/flutter-quill/pull/2230) is ready.\r\n\r\nWe're looking forward to your feedback.\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.7...v10.8.0",
"10.7.7": "This version is nearly identical to `10.7.6` with a build failure bug fix in [#2283](https://github.com/singerdmx/flutter-quill/pull/2283) related to unmerged change in [#2230](https://github.com/singerdmx/flutter-quill/pull/2230)\r\n\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.6...v10.7.7",
"10.7.6": "* Code Comments Typo fixes by @Luismi74 in https://github.com/singerdmx/flutter-quill/pull/2267\r\n* docs: add important note for contributors before introducing new features by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2269\r\n* docs(readme): add 'Breaking Changes' section by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2275\r\n* Fix: Resolved issue with broken IME composing rect in Windows desktop(re-implementation) by @agata in https://github.com/singerdmx/flutter-quill/pull/2282\r\n\r\n## New Contributors\r\n* @Luismi74 made their first contribution in https://github.com/singerdmx/flutter-quill/pull/2267\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.5...v10.7.6",
"10.7.5": "* fix(ci): add flutter pub get step for quill_native_bridge by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2265\r\n* revert: \"Resolved issue with broken IME composing rect in Windows desktop\" by @CatHood0 in https://github.com/singerdmx/flutter-quill/pull/2266\r\n\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.4...v10.7.5",
"10.7.4": "* chore: remove pubspec_overrides.yaml and pubspec_overrides.yaml.disabled by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2262\r\n* ci: remove quill_native_bridge from automated publishing workflow by @EchoEllet in https://github.com/singerdmx/flutter-quill/pull/2263\r\n\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.3...v10.7.4",
"10.7.3": "- Deprecate `FlutterQuillExtensions` in `flutter_quill_extensions`\r\n- Update the minimum version of `flutter_quill` and `super_clipboard` in `flutter_quill_extensions` to avoid using deprecated code.\r\n\r\n**Full Changelog**: https://github.com/singerdmx/flutter-quill/compare/v10.7.2...v10.7.3",
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ You can join our [Slack Group] for discussion.
- [πŸ“¦ Installation](#-installation)
- [πŸ›  Platform Specific Configurations](#-platform-specific-configurations)
- [πŸš€ Usage](#-usage)
- [πŸ’₯ Breaking Changes](#-breaking-changes)
- [πŸ”€ Input / Output](#-input--output)
- [βš™οΈ Configurations](#️-configurations)
- [πŸ“¦ Embed Blocks](#-embed-blocks)
Expand Down Expand Up @@ -197,6 +198,23 @@ void dispose() {

Check out [Sample Page] for more advanced usage.

## πŸ’₯ Breaking Changes

- APIs marked with [`@experimental`](https://api.flutter.dev/flutter/meta/experimental-constant.html)
are subject to change or removal at any time and should be used with caution,
as they may be altered even in minor versions.

- APIs marked with [`@internal`](https://api.flutter.dev/flutter/meta/internal-constant.html)
and [`@visibleForTesting`](https://api.flutter.dev/flutter/meta/visibleForTesting-constant.html) are not intended for
public use and should be avoided entirely.

- The `package:flutter_quill/flutter_quill_internal.dart` expose internal APIs
to be used by other related packages and should be avoided when possible.

We make every effort to ensure internal APIs are not exported by default. Use experimental features at your own discretion.

We recommend checking the `CHANGELOG.md` or release notes for each update to stay informed.

## πŸ”€ Input / Output

This library uses [Quill Delta](https://quilljs.com/docs/delta/)
Expand Down
Loading

0 comments on commit 3cfdf18

Please sign in to comment.