-
Notifications
You must be signed in to change notification settings - Fork 868
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
Create QuillToolbarSelectHeaderStyleDropdownButton
#1575
Create QuillToolbarSelectHeaderStyleDropdownButton
#1575
Conversation
Hi, I appreciate your efforts but we already did that in the dev branch, we will look into some solution don't worry we will try to merge your PR |
Can you fix Ci failure by doing it aginst the latest master branch? |
Besides the header styles for the new ones And that's the whole idea behind the repo or the port |
@freshtechtips and @singerdmx I tested this new class and it works. See images. All headings are shown correctly. Qulll does not care on how many H is specified in configuration. Configuration is customizable. |
I'm not sure but I think you are right, but can at least do it with the new class that was added before you sent this PR but to the dev branch, and now it's merged with the master |
The example code which I've just took from this. var toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }], // custom button values
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
[{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
[{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent
[{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], // <------------------------------ headers
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
[{ 'font': [] }],
[{ 'align': [] }],
['clean'] // remove formatting button
];
var quill = new Quill('#editor', {
modules: {
toolbar: toolbarOptions
},
theme: 'snow'
}); The aim of Quill I think is to keep rich text which can be converted to HTML which in its turn supports H1...H6. |
It seems I didn't catch what do you mean. |
Sure but that's not the problem, the problem we already have restored the deleted button from the past in 2022, I restored it with fewer features, and yours contains more features, do you want to fix the conflicts or let me handle it? |
I will appreciate you if you can do this. And I think I could not do it by myself because of |
I think there are not many places of default package code which must be changed. The new widget and config are new files. It is required to update Attributes to add new ones from H4 to H6 and expand |
Do you want me to carry the changes to a separate PR or fetch and edit this PR? What do you prefer? |
Please do as you feel comfortable. The important thing is correct work of my app which already uses this new widget my own branch. :) |
Just one thing, is the header styles always up to h6 from h1 or the developer can override it? |
|
||
/// No description provided for @normal. | ||
/// | ||
/// In en, this message translates to: | ||
/// **'Normal'** | ||
String get normal => 'Normal'; | ||
|
||
/// No description provided for @heading1. | ||
/// | ||
/// In en, this message translates to: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is auto-generated, please edit the the quill_en.arb
instead
and run the script we mentioned in the development notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I was to hurry. I think I can update translations after merge the PR with new widget.
String get pickAPhotoFromYourGallery => 'Выберите фотографю из вашей галереи'; | ||
|
||
@override | ||
String get takeAPhotoUsingYourCamera => | ||
'Take a photo using your phone camera'; | ||
'Создайте фотографю, использую фотокамеру'; | ||
|
||
@override | ||
String get pasteAPhotoUsingALink => 'Paste a photo using a link'; | ||
String get pasteAPhotoUsingALink => 'Вставьте фотографию, используя ссылку'; | ||
|
||
@override | ||
String get pickAVideoFromYourGallery => 'Pick a video from your gallery'; | ||
String get pickAVideoFromYourGallery => 'Выберете видео из вашей галереи'; | ||
|
||
@override | ||
String get recordAVideoUsingYourCamera => | ||
'Record a video using your phone camera'; | ||
'Запишите видео, используя вдеокамеру'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, you should update the quill_ru.arb
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
String get pickAPhotoFromYourGallery => 'Оберіть фотографію з вашої галереї'; | ||
|
||
@override | ||
String get takeAPhotoUsingYourCamera => | ||
'Take a photo using your phone camera'; | ||
'Створіть фотографію, використовуючи фотокамеру'; | ||
|
||
@override | ||
String get pasteAPhotoUsingALink => 'Paste a photo using a link'; | ||
String get pasteAPhotoUsingALink => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quill_uk.arb
file
/// "attributes":{"header": 4 } | ||
static const Attribute<int?> h4 = HeaderAttribute(level: 4); | ||
|
||
/// "attributes":{"header": 5 } | ||
static const Attribute<int?> h5 = HeaderAttribute(level: 5); | ||
|
||
/// "attributes":{"header": 6 } | ||
static const Attribute<int?> h6 = HeaderAttribute(level: 6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singerdmx
What do you think of this?
color: defaultTextStyle.style.color!.withOpacity(0.70), | ||
height: 1.15, | ||
fontWeight: FontWeight.w300, | ||
color: defaultTextStyle.style.color, | ||
letterSpacing: -1, | ||
height: 1, | ||
fontWeight: FontWeight.bold, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I added new heading I need to have som wide used values for heading so I searched the Internet and find a few links which suggest such values. The link with data which I used you may find in the start post.
Usually headers are used for highlighting some titles but opacity do the reading hard making usual text more higlighted then header. Usually defautt values for text black or white depending on theme brightness.
fontSize: 30, | ||
color: defaultTextStyle.style.color, | ||
letterSpacing: -0.8, | ||
height: 1.067, | ||
fontWeight: FontWeight.bold, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new default values from HTML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the data from here
Get started with Boosted, a Bootstrap fork — the world’s most popular framework for building responsive, mobile-first sites, with jsDelivr and a template starter page.
.
This pull request has been moved to |
It is fixed list from H1 to H6 and then Normal. I thought it is logical. It is shown in the image I post in start topic. |
I add the ability to edit it |
Why do think it is necessary? To place more large font somewhere in middle? I think it not good idea. Or do you mean moving only Normal options to top or bottom? |
No, it's just one variable, which is a list that has default value, and you can change it back to previous value, it's necessary otherwise this can be considered as a breaking change |
We already carried the changes of this PR, thank you |
* Restore correct feel&look of `QuillToolbarIconButton` * Export `QuillToolbarSelectAlignmentButtons` * Restore old call of `QuillToolbarIconButton` * Restore old call of `QuillToolbarIconButton` * Resore original button PR #1575 * Restore old feel&look of buttons * Restore original `QuillToolbarSelectAlignmentButton` * Restore original `QuillToolbarLinkStyleButton2` * Make `options` optional * Restore old `QuillToolbarFontFamilyButton` build * Restore old build of `QuillToolbarFontSizeButton` * Change `textStyle` to `style` * Remove redundant export --------- Co-authored-by: Ellet Hnewa <73608287+ellet0@users.noreply.github.com>
Description
The alternative widget
QuillToolbarSelectHeaderStyleDropdownButton
for heading style is created. Also the list of available headings is expanded to H6. So the new widget supports headings H1..H6. Font sizes,line heights and spacing are updated from this link. Basically standard HTML values are used.P.S. Also some translations (uk and ru) are updated.
Images
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files../scripts/before-push.sh
and it all passed successfullyBreaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!
in the title as explained in Conventional Commits).