Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move quill delta #1578

Merged
merged 88 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
35a9502
1
Dec 5, 2023
7207dbf
2
Dec 5, 2023
798d907
2+
Dec 5, 2023
09fc229
2++
Dec 5, 2023
2c87552
2+++
Dec 5, 2023
d464443
2++++
Dec 5, 2023
2406cf0
Remove s.yaml file
Dec 5, 2023
309655e
2+++++
Dec 5, 2023
e3a706c
2++++++
Dec 5, 2023
8d6a180
2+++++++
Dec 5, 2023
086dcb7
2++++++++
Dec 5, 2023
4a6bc16
Update the version
Dec 5, 2023
6fa840b
2+++++++++
Dec 5, 2023
44d2d40
2++++++++++
Dec 5, 2023
c9ac8cc
2+++++++++++
Dec 5, 2023
331f9c7
An attemp to fix CI Failure
Dec 5, 2023
dc94460
An attemp to fix CI Failure
Dec 5, 2023
70d0fd2
An attemp to fix CI Failure
Dec 5, 2023
b513bf2
Add development notes
Dec 5, 2023
b074484
3
Dec 5, 2023
08e55ab
Rename button files
Dec 5, 2023
913c33c
Dropdown QuillToolbarSelectHeaderStyleButton
Dec 5, 2023
4b4c148
Organize files
Dec 5, 2023
0d39d9d
3
Dec 5, 2023
d67bd71
3+
Dec 5, 2023
ec38dee
3++
Dec 5, 2023
8d3215f
Fix tests
Dec 5, 2023
2cb886b
Fix analysis warrning
Dec 5, 2023
daa597f
Replace pasteboard with super_cliboard
Dec 5, 2023
026b58a
3+++
Dec 5, 2023
59ada7f
Update version
Dec 5, 2023
8792025
3++++
Dec 5, 2023
5afa35e
Regenerate versions
Dec 5, 2023
25435c9
3+++++
Dec 6, 2023
0c4c6cd
Prepare 9.0.0-dev-4
Dec 6, 2023
9727fea
4
Dec 6, 2023
8daccae
Fix analysis warrnings
Dec 6, 2023
90645f1
Fix tests
Dec 6, 2023
d7ef182
Fix import warrnings
Dec 6, 2023
c5c8083
4+
Dec 6, 2023
21a192f
4++
Dec 6, 2023
9be1a55
Prepare for release dev 6
Dec 6, 2023
1705bff
Prepare for release dev 5
Dec 6, 2023
ec2d28c
Bug fixes
Dec 6, 2023
5e6115d
Bug fixes
Dec 6, 2023
3be21fb
Prepare dev version 6
Dec 6, 2023
6066f2f
Link pattern bug fixes
Dec 7, 2023
64ea5ef
Prepare dev version 7
Dec 7, 2023
5fcda94
5
Dec 7, 2023
70d5fe0
Fix analysis issues
Dec 7, 2023
748c58c
Prepare dev version 8
Dec 7, 2023
1174f1e
Update CHANGELOG.md
Dec 7, 2023
f0fa2d1
Update CHANGELOG.md
Dec 7, 2023
1aab0c7
Update doc and README.md
Dec 7, 2023
6c5bd5d
Update main workflow name
Dec 7, 2023
67adb19
Improves the new logic of pasting HTML contents into the Editor
Dec 7, 2023
af5ac58
Cleanup code
Dec 7, 2023
fb65d0c
Merge remote-tracking branch 'upstream/master' into dev
Dec 7, 2023
0be81a7
Add new todo
Dec 7, 2023
615a0a2
Update font family button to material 3
Dec 7, 2023
2283d8b
Improve font family button
Dec 7, 2023
f8fc9d8
Fix analysis warrnings
Dec 7, 2023
03610e9
Improve font size button
Dec 7, 2023
7266ed9
Update workflows
Dec 7, 2023
94235df
Fix analysis warrning
Dec 7, 2023
3218ee0
Fix a typo
Dec 7, 2023
6896b30
Merge remote-tracking branch 'upstream/master' into dev
Dec 8, 2023
a1e73a5
Update simple toolbar
Dec 8, 2023
12527e8
fix delta from cliboard compose
Dec 8, 2023
d657731
Fix analysis warrning
Dec 8, 2023
59d436d
Fix a bug of the improved pasting HTML contents contents into the editor
Dec 8, 2023
409360a
Update workflows
Dec 8, 2023
343dc4c
Prepare to publish new version
Dec 8, 2023
675deab
Update build.yml
Dec 8, 2023
a3ec1b9
Update build.yml
Dec 8, 2023
b9d9260
Prepare for release
Dec 8, 2023
a8f5dad
An attemp to fix CI failures
Dec 8, 2023
b8f4af9
Prepare for new version 11
Dec 8, 2023
063390b
An attemp to fix CI build failures
Dec 8, 2023
0e278e3
Update pubspec.yaml
Dec 8, 2023
c75e984
Update pubspec.yaml and update build.yml
Dec 8, 2023
34030f1
Disable windows build
Dec 8, 2023
cb04c3b
Update build.yml
Dec 8, 2023
bb13cd5
9.0.0-dev-11
Dec 8, 2023
0fd1125
Update build.yml to avoid duplications
Dec 8, 2023
34b8755
Add bug todo fix
Dec 8, 2023
6bbf680
Add a bug todo
Dec 8, 2023
4df6b26
Split quill delta into seperate package
Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
5
  • Loading branch information
Ellet committed Dec 7, 2023
commit 5fcda94b59502d808d40ce353c631aa0b2d6873d
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## 9.0.0-dev-7
* Fix a bug in chaning the background/font color of ol/ul list
* 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`)
* Flutter Quill Extensions:
* Fix link bug in the video url
* Fix patterns
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,13 @@ To see how to use the extension package, please take a look at the [README](./fl
Having your document stored in Quill Delta format is sometimes not enough. Often you'll need to convert
it to other formats such as HTML to publish it, or send an email.

**Note**: This package support converting from HTML back to Quill delta but it's experimental and used internally when pasting Html content from the cliboard to the Quill Editor

You have two options:

1. Using [quill_html_converter](./packages/quill_html_converter/) to convert to/from 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)) but the converting from HTML back to Quill delta is experimental
2. Another option is to use
1. Using [quill_html_converter](./packages/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 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,
Expand Down
11 changes: 5 additions & 6 deletions doc/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ This is a todo list page that added recently and will be updated soon.
- Extract the shared properties between `QuillRawEditorConfigurations` and `QuillEditorConfigurations`
- The todo in the this [commit](https://github.com/singerdmx/flutter-quill/commit/79597ea6425357795c0663588ac079665241f23a) needs to be checked
- use `maybeOf` and of instead `ofNotNull` in the providers to follow flutter offical convenstion, completly rework the providers and update the build context extensions
- Add line through to the text when the check point checked is true
- Change the color of the numbers and dots in ol/ul to match the ones in the item list
- Fix the bugs of the font family and font size
- Try to update Quill Html Converter

### Bugs

Expand All @@ -39,12 +43,7 @@ Please go to the [issues](https://github.com/singerdmx/flutter-quill/issues)
## Flutter Quill Extensions

### Features
- Add support for copying images to the Clipboard

### Improvemenets

Please check the todos, this list will be updated soon.

### Bugs

Please check the todos, this list will be updated soon.
### Bugs
31 changes: 21 additions & 10 deletions example/lib/presentation/quill/quill_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'
show FlutterQuillEmbeds, QuillSharedExtensionsConfigurations;

import 'package:quill_html_converter/quill_html_converter.dart';
import 'package:share_plus/share_plus.dart' show Share;

Expand Down Expand Up @@ -46,6 +45,18 @@ class _QuillScreenState extends State<QuillScreen> {
_controller.document = widget.args.document;
}

// Future<void> _init() async {
// final reader = await ClipboardReader.readClipboard();
// if (reader.canProvide(Formats.htmlText)) {
// final html = await reader.readValue(Formats.htmlText);
// if (html == null) {
// return;
// }
// final delta = DeltaHtmlExt.fromHtml(html);
// _controller.document = Document.fromDelta(delta);
// }
// }

@override
void dispose() {
_controller.dispose();
Expand All @@ -65,7 +76,7 @@ class _QuillScreenState extends State<QuillScreen> {
onPressed: () {
final html = _controller.document.toDelta().toHtml();
_controller.document =
Document.fromDelta(DeltaHtmlExt.fromHtml(html));
Document.fromDelta(QuillController.fromHtml(html));
},
icon: const Icon(Icons.html),
),
Expand Down Expand Up @@ -119,14 +130,14 @@ class _QuillScreenState extends State<QuillScreen> {
codeBlock: QuillEditorCodeBlockElementOptions(
enableLineNumbers: true,
),
orderedList: QuillEditorOrderedListElementOptions(
backgroundColor: Colors.amber,
fontColor: Colors.black,
),
unorderedList: QuillEditorUnOrderedListElementOptions(
backgroundColor: Colors.green,
fontColor: Colors.red,
),
// orderedList: QuillEditorOrderedListElementOptions(
// backgroundColor: Colors.amber,
// fontColor: Colors.black,
// ),
// unorderedList: QuillEditorUnOrderedListElementOptions(
// backgroundColor: Colors.green,
// fontColor: Colors.red,
// ),
),
),
scrollController: _editorScrollController,
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies:
file_picker: ^6.1.1
# For sharing text
share_plus: ^7.2.1
super_clipboard: ^0.7.3

dependency_overrides:
flutter_quill:
Expand Down
2 changes: 2 additions & 0 deletions flutter_quill_extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## 9.0.0-dev-7
* Fix a bug in chaning the background/font color of ol/ul list
* 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`)
* Flutter Quill Extensions:
* Fix link bug in the video url
* Fix patterns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/widgets.dart' show BuildContext;
import 'package:flutter_quill/flutter_quill.dart';
import 'package:meta/meta.dart' show immutable;

import '../../../extensions/controller.dart';
import '../../../extensions/controller_ext.dart';
import '../../../services/image_picker/s_image_picker.dart';

/// When request picking an image, for example when the image button toolbar
Expand Down
2 changes: 1 addition & 1 deletion flutter_quill_extensions/lib/embeds/video/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/widgets.dart' show BuildContext;
import 'package:flutter_quill/flutter_quill.dart';
import 'package:meta/meta.dart' show immutable;

import '../../extensions/controller.dart';
import '../../extensions/controller_ext.dart';
import '../../services/image_picker/s_image_picker.dart';

/// When request picking an video, for example when the video button toolbar
Expand Down
2 changes: 1 addition & 1 deletion flutter_quill_extensions/lib/flutter_quill_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export 'embeds/video/editor/video_embed.dart';
export 'embeds/video/editor/video_web_embed.dart';
export 'embeds/video/toolbar/video_button.dart';
export 'embeds/video/video.dart';
export 'extensions/controller.dart';
export 'extensions/controller_ext.dart';
export 'models/config/editor/image/image.dart';
export 'models/config/editor/image/image_web.dart';
export 'models/config/editor/video/video.dart';
Expand Down
2 changes: 2 additions & 0 deletions flutter_quill_test/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## 9.0.0-dev-7
* Fix a bug in chaning the background/font color of ol/ul list
* 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`)
* Flutter Quill Extensions:
* Fix link bug in the video url
* Fix patterns
Expand Down
4 changes: 2 additions & 2 deletions lib/flutter_quill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export 'src/models/themes/quill_dialog_theme.dart';
export 'src/models/themes/quill_icon_theme.dart';
export 'src/utils/embeds.dart';
export 'src/widgets/editor/editor.dart';
export 'src/widgets/others/controller.dart';
export 'src/widgets/quill/quill_controller.dart';
export 'src/widgets/others/cursor.dart';
export 'src/widgets/others/default_styles.dart';
export 'src/widgets/others/embeds.dart';
export 'src/widgets/quill/embeds.dart';
export 'src/widgets/others/link.dart'
show LinkActionPickerDelegate, LinkMenuAction;
export 'src/widgets/raw_editor/raw_editor.dart';
Expand Down
5 changes: 5 additions & 0 deletions lib/markdown_quill.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library quill_markdown;

export 'src/packages/quill_markdown/delta_to_markdown.dart';
export 'src/packages/quill_markdown/embeddable_table_syntax.dart';
export 'src/packages/quill_markdown/markdown_to_delta.dart';
4 changes: 2 additions & 2 deletions lib/src/models/config/editor/editor_configurations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart' show experimental;

import '../../../widgets/editor/editor_builder.dart';
import '../../../widgets/others/controller.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../../widgets/others/default_styles.dart';
import '../../../widgets/others/delegate.dart';
import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/embeds.dart';
import '../../../widgets/others/link.dart';
import '../../../widgets/raw_editor/raw_editor.dart';
import '../../themes/quill_dialog_theme.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import 'package:flutter/widgets.dart'
Widget;
import 'package:meta/meta.dart' show immutable;

import '../../../widgets/others/controller.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../../widgets/others/cursor.dart';
import '../../../widgets/others/default_styles.dart';
import '../../../widgets/others/delegate.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart' show Color;

import '../../../../widgets/others/controller.dart';
import '../../../../widgets/quill/quill_controller.dart';
import '../../quill_shared_configurations.dart' show QuillSharedConfigurations;
import 'base_configurations.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'
import 'package:flutter/widgets.dart'
show Color, EdgeInsets, EdgeInsetsGeometry, TextOverflow, TextStyle;

import '../../../../widgets/others/controller.dart';
import '../../../../widgets/quill/quill_controller.dart';
import '../../../documents/attribute.dart';
import '../../../themes/quill_icon_theme.dart';
import '../../quill_configurations.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter/widgets.dart'
show Axis, Widget, WrapAlignment, WrapCrossAlignment;

import '../../../widgets/others/controller.dart';
import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../../widgets/quill/embeds.dart';
import '../../themes/quill_dialog_theme.dart';
import '../../themes/quill_icon_theme.dart';
import 'buttons/base_configurations.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/src/models/documents/document.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import '../../widgets/others/embeds.dart';
import '../../widgets/quill/embeds.dart';
import '../quill_delta.dart';
import '../rules/rule.dart';
import '../structs/doc_change.dart';
Expand Down Expand Up @@ -402,6 +402,7 @@ class Document {
throw ArgumentError.value(doc, 'Document Delta cannot be empty.');
}

// print(doc.last.data.runtimeType);
assert((doc.last.data as String).endsWith('\n'));

var offset = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/documents/nodes/container.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:collection';

import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/embeds.dart';
import '../style.dart';
import 'leaf.dart';
import 'line.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/documents/nodes/leaf.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:math' as math;

import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/embeds.dart';
import '../../quill_delta.dart';
import '../style.dart';
import 'embeddable.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/documents/nodes/line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:math' as math;

import 'package:collection/collection.dart';

import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/embeds.dart';
import '../../quill_delta.dart';
import '../../structs/offset_value.dart';
import '../attribute.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/documents/nodes/node.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:collection';

import '../../../widgets/others/embeds.dart';
import '../../../widgets/quill/embeds.dart';
import '../../quill_delta.dart';
import '../attribute.dart';
import '../style.dart';
Expand Down
11 changes: 11 additions & 0 deletions lib/src/packages/quill_markdown/custom_quill_attributes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:flutter_quill/flutter_quill.dart';

/// Custom attribute to save the language of codeblock
class CodeBlockLanguageAttribute extends Attribute<String?> {
/// @nodoc
const CodeBlockLanguageAttribute(String? value)
: super(attrKey, AttributeScope.ignore, value);

/// attribute key
static const attrKey = 'x-md-codeblock-lang';
}
Loading
Loading