Improve: subscript and superscript should now work for all languages and characters. (#1909)

* Value setting Stateful toolbar buttons derive from base class

* Rename base class as QuillToolbarBaseValueButton

* Removed deprecated functions

* Move clipboard actions to QuillController

* Fix: collectAllIndividualStylesAndEmbed for result span

* Add: Clipboard toolbar buttons

* Add: test for QuillController clipboard
Dart Formatted

* Subscript and Superscript

* Translation Justify

* Translation alignJustify

* Fix: Translation ko

* Fix: Translation en-US

---------

Co-authored-by: Douglas Ward <dward@scied.com>
pull/1919/head
AtlasAutocode 10 months ago committed by GitHub
parent 8fe65f1d10
commit 62c655b880
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      lib/src/l10n/generated/quill_localizations.dart
  2. 3
      lib/src/l10n/generated/quill_localizations_ar.dart
  3. 3
      lib/src/l10n/generated/quill_localizations_bg.dart
  4. 3
      lib/src/l10n/generated/quill_localizations_bn.dart
  5. 3
      lib/src/l10n/generated/quill_localizations_cs.dart
  6. 3
      lib/src/l10n/generated/quill_localizations_da.dart
  7. 3
      lib/src/l10n/generated/quill_localizations_de.dart
  8. 3
      lib/src/l10n/generated/quill_localizations_en.dart
  9. 3
      lib/src/l10n/generated/quill_localizations_es.dart
  10. 3
      lib/src/l10n/generated/quill_localizations_fa.dart
  11. 3
      lib/src/l10n/generated/quill_localizations_fr.dart
  12. 3
      lib/src/l10n/generated/quill_localizations_he.dart
  13. 3
      lib/src/l10n/generated/quill_localizations_hi.dart
  14. 3
      lib/src/l10n/generated/quill_localizations_id.dart
  15. 3
      lib/src/l10n/generated/quill_localizations_it.dart
  16. 3
      lib/src/l10n/generated/quill_localizations_ja.dart
  17. 3
      lib/src/l10n/generated/quill_localizations_ko.dart
  18. 3
      lib/src/l10n/generated/quill_localizations_ku.dart
  19. 3
      lib/src/l10n/generated/quill_localizations_ms.dart
  20. 3
      lib/src/l10n/generated/quill_localizations_ne.dart
  21. 3
      lib/src/l10n/generated/quill_localizations_nl.dart
  22. 3
      lib/src/l10n/generated/quill_localizations_no.dart
  23. 3
      lib/src/l10n/generated/quill_localizations_pl.dart
  24. 3
      lib/src/l10n/generated/quill_localizations_pt.dart
  25. 3
      lib/src/l10n/generated/quill_localizations_ro.dart
  26. 3
      lib/src/l10n/generated/quill_localizations_ru.dart
  27. 3
      lib/src/l10n/generated/quill_localizations_sk.dart
  28. 3
      lib/src/l10n/generated/quill_localizations_sr.dart
  29. 3
      lib/src/l10n/generated/quill_localizations_sv.dart
  30. 3
      lib/src/l10n/generated/quill_localizations_sw.dart
  31. 3
      lib/src/l10n/generated/quill_localizations_tk.dart
  32. 3
      lib/src/l10n/generated/quill_localizations_tr.dart
  33. 3
      lib/src/l10n/generated/quill_localizations_uk.dart
  34. 3
      lib/src/l10n/generated/quill_localizations_ur.dart
  35. 3
      lib/src/l10n/generated/quill_localizations_vi.dart
  36. 3
      lib/src/l10n/generated/quill_localizations_zh.dart
  37. 4
      lib/src/l10n/quill_en.arb
  38. 43
      lib/src/l10n/untranslated.json
  39. 8
      lib/src/models/config/quill_controller_configurations.dart
  40. 1
      lib/src/widgets/editor/editor.dart
  41. 60
      lib/src/widgets/quill/text_line.dart
  42. 5
      lib/src/widgets/toolbar/buttons/toggle_style_button.dart
  43. 2
      scripts/ensure_translations_correct.dart

@ -415,6 +415,12 @@ abstract class FlutterQuillLocalizations {
/// **'Align right'** /// **'Align right'**
String get alignRight; String get alignRight;
/// Justify the text over the full window width
///
/// In en, this message translates to:
/// **'Align justify'**
String get alignJustify;
/// No description provided for @justifyWinWidth. /// No description provided for @justifyWinWidth.
/// ///
/// In en, this message translates to: /// In en, this message translates to:

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsAr extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'محاذاة اليمين'; String get alignRight => 'محاذاة اليمين';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'تبرير مع العرض'; String get justifyWinWidth => 'تبرير مع العرض';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsBg extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Подравни вдясно'; String get alignRight => 'Подравни вдясно';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Подравни във всяка колонка'; String get justifyWinWidth => 'Подравни във всяка колонка';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsBn extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'ন সিবদ'; String get alignRight => 'ন সিবদ';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'রসর সযত'; String get justifyWinWidth => 'রসর সযত';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsCs extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Zarovnat vpravo'; String get alignRight => 'Zarovnat vpravo';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Zarovnat do bloku'; String get justifyWinWidth => 'Zarovnat do bloku';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsDa extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsDe extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Rechtsbündig ausrichten'; String get alignRight => 'Rechtsbündig ausrichten';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Blocksatz'; String get justifyWinWidth => 'Blocksatz';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsEn extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Alinear a la derecha'; String get alignRight => 'Alinear a la derecha';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justificar'; String get justifyWinWidth => 'Justificar';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsFa extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'چیدمان راست'; String get alignRight => 'چیدمان راست';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'تضمین عرض پنجره'; String get justifyWinWidth => 'تضمین عرض پنجره';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsFr extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Aligner à droite'; String get alignRight => 'Aligner à droite';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justifier'; String get justifyWinWidth => 'Justifier';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsHe extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'יישור לימין'; String get alignRight => 'יישור לימין';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'יישור לרוחב החלון'; String get justifyWinWidth => 'יישור לרוחב החלון';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsHi extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'ित कर'; String get alignRight => 'ित कर';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'जसिन च'; String get justifyWinWidth => 'जसिन च';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsId extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Rata Kanan'; String get alignRight => 'Rata Kanan';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Rata Kanan dan Kiri'; String get justifyWinWidth => 'Rata Kanan dan Kiri';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsIt extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Allinea a destra'; String get alignRight => 'Allinea a destra';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Giustifica per larghezza finestra'; String get justifyWinWidth => 'Giustifica per larghezza finestra';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsJa extends FlutterQuillLocalizations {
@override @override
String get alignRight => '右揃え'; String get alignRight => '右揃え';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => '両端揃え'; String get justifyWinWidth => '両端揃え';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsKo extends FlutterQuillLocalizations {
@override @override
String get alignRight => '오른쪽 정렬'; String get alignRight => '오른쪽 정렬';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => '좌우로 정렬'; String get justifyWinWidth => '좌우로 정렬';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsKu extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'بۆ ڕاست'; String get alignRight => 'بۆ ڕاست';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'پانی ڕێکبخە'; String get justifyWinWidth => 'پانی ڕێکبخە';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsMs extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsNe extends FlutterQuillLocalizations {
@override @override
String get alignRight => ' पङिबद'; String get alignRight => ' पङिबद';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'जसिन च'; String get justifyWinWidth => 'जसिन च';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsNl extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsNo extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Høyrejuster'; String get alignRight => 'Høyrejuster';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Rettferdiggjør bredden'; String get justifyWinWidth => 'Rettferdiggjør bredden';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsPl extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsPt extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Align right'; String get alignRight => 'Align right';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsRo extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Aliniază la dreapta'; String get alignRight => 'Aliniază la dreapta';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justifică lățimea ferestrei'; String get justifyWinWidth => 'Justifică lățimea ferestrei';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Выровнять по правому краю'; String get alignRight => 'Выровнять по правому краю';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Выровнять по ширине окна'; String get justifyWinWidth => 'Выровнять по ширине окна';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsSk extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Zarovnať vpravo'; String get alignRight => 'Zarovnať vpravo';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Zarovnať na šírku okna'; String get justifyWinWidth => 'Zarovnať na šírku okna';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsSr extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Poravnanje desno'; String get alignRight => 'Poravnanje desno';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Centriraj širinu prozora'; String get justifyWinWidth => 'Centriraj širinu prozora';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsSv extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Högerjustera'; String get alignRight => 'Högerjustera';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justera till fönsterbredd'; String get justifyWinWidth => 'Justera till fönsterbredd';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsSw extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Pangilia Kulia'; String get alignRight => 'Pangilia Kulia';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Kuhalalisha Upana wa Ushindi'; String get justifyWinWidth => 'Kuhalalisha Upana wa Ushindi';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsTk extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Saga deňleşdir'; String get alignRight => 'Saga deňleşdir';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Justify win width'; String get justifyWinWidth => 'Justify win width';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsTr extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Sağa Hizala'; String get alignRight => 'Sağa Hizala';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Kenarlara Hizala'; String get justifyWinWidth => 'Kenarlara Hizala';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsUk extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Вирівняти праворуч'; String get alignRight => 'Вирівняти праворуч';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Вирівняти за шириною вікна'; String get justifyWinWidth => 'Вирівняти за шириною вікна';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsUr extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'دائیں ہم آہنگ ہوں'; String get alignRight => 'دائیں ہم آہنگ ہوں';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'جسٹیفائی ون چوڑائی'; String get justifyWinWidth => 'جسٹیفائی ون چوڑائی';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsVi extends FlutterQuillLocalizations {
@override @override
String get alignRight => 'Căn phải'; String get alignRight => 'Căn phải';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => 'Căn đều chiều rộng'; String get justifyWinWidth => 'Căn đều chiều rộng';

@ -127,6 +127,9 @@ class FlutterQuillLocalizationsZh extends FlutterQuillLocalizations {
@override @override
String get alignRight => '右对齐'; String get alignRight => '右对齐';
@override
String get alignJustify => 'Align justify';
@override @override
String get justifyWinWidth => '两端对齐'; String get justifyWinWidth => '两端对齐';

@ -41,6 +41,10 @@
"alignLeft": "Align left", "alignLeft": "Align left",
"alignCenter": "Align center", "alignCenter": "Align center",
"alignRight": "Align right", "alignRight": "Align right",
"alignJustify": "Align justify",
"@alignJustify": {
"description": "Justify the text over the full window width"
},
"justifyWinWidth": "Justify win width", "justifyWinWidth": "Justify win width",
"textDirection": "Text direction", "textDirection": "Text direction",
"headerStyle": "Header style", "headerStyle": "Header style",

@ -1,5 +1,6 @@
{ {
"ar": [ "ar": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -10,6 +11,7 @@
], ],
"bg": [ "bg": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -33,6 +35,7 @@
], ],
"bn": [ "bn": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -56,6 +59,7 @@
], ],
"cs": [ "cs": [
"alignJustify",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
"close", "close",
@ -65,6 +69,7 @@
], ],
"da": [ "da": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -88,6 +93,7 @@
], ],
"de": [ "de": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -106,6 +112,7 @@
], ],
"en_US": [ "en_US": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -129,6 +136,7 @@
], ],
"es": [ "es": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -147,6 +155,7 @@
], ],
"fa": [ "fa": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -170,6 +179,7 @@
], ],
"fr": [ "fr": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -180,6 +190,7 @@
], ],
"he": [ "he": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -203,6 +214,7 @@
], ],
"hi": [ "hi": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -226,6 +238,7 @@
], ],
"id": [ "id": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -249,6 +262,7 @@
], ],
"it": [ "it": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -272,6 +286,7 @@
], ],
"ja": [ "ja": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -294,7 +309,12 @@
"paste" "paste"
], ],
"ko": [
"alignJustify"
],
"ku": [ "ku": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -305,6 +325,7 @@
], ],
"ku_CKB": [ "ku_CKB": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -315,6 +336,7 @@
], ],
"ms": [ "ms": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -338,6 +360,7 @@
], ],
"ne": [ "ne": [
"alignJustify",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
"close", "close",
@ -347,6 +370,7 @@
], ],
"nl": [ "nl": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -370,6 +394,7 @@
], ],
"no": [ "no": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -393,6 +418,7 @@
], ],
"pl": [ "pl": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -416,6 +442,7 @@
], ],
"pt": [ "pt": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -439,6 +466,7 @@
], ],
"pt_BR": [ "pt_BR": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -462,6 +490,7 @@
], ],
"ro": [ "ro": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -472,6 +501,7 @@
], ],
"ro_RO": [ "ro_RO": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -482,6 +512,7 @@
], ],
"ru": [ "ru": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -500,6 +531,7 @@
], ],
"sk": [ "sk": [
"alignJustify",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
"close", "close",
@ -509,6 +541,7 @@
], ],
"sr": [ "sr": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -532,6 +565,7 @@
], ],
"sv": [ "sv": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -542,6 +576,7 @@
], ],
"sw": [ "sw": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -565,6 +600,7 @@
], ],
"tk": [ "tk": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -588,6 +624,7 @@
], ],
"tr": [ "tr": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -611,6 +648,7 @@
], ],
"uk": [ "uk": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -621,6 +659,7 @@
], ],
"ur": [ "ur": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -644,6 +683,7 @@
], ],
"vi": [ "vi": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",
@ -667,6 +707,7 @@
], ],
"zh": [ "zh": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -677,6 +718,7 @@
], ],
"zh_CN": [ "zh_CN": [
"alignJustify",
"theImageHasBeenSavedAt", "theImageHasBeenSavedAt",
"caseSensitive", "caseSensitive",
"wholeWord", "wholeWord",
@ -687,6 +729,7 @@
], ],
"zh_HK": [ "zh_HK": [
"alignJustify",
"normal", "normal",
"heading1", "heading1",
"heading2", "heading2",

@ -1,8 +1,14 @@
class QuillControllerConfigurations { class QuillControllerConfigurations {
const QuillControllerConfigurations({this.onClipboardPaste}); const QuillControllerConfigurations(
{this.onClipboardPaste, this.requireScriptFontFeatures = false});
/// Callback when the user pastes and data has not already been processed /// Callback when the user pastes and data has not already been processed
/// ///
/// Return true if the paste operation was handled /// Return true if the paste operation was handled
final Future<bool> Function()? onClipboardPaste; final Future<bool> Function()? onClipboardPaste;
/// Render subscript and superscript text using Open Type FontFeatures
///
/// Default is false to use built-in script rendering that is independent of font capabilities
final bool requireScriptFontFeatures;
} }

@ -173,6 +173,7 @@ class QuillEditorState extends State<QuillEditor>
void initState() { void initState() {
super.initState(); super.initState();
widget.configurations.controller.editorFocusNode ??= widget.focusNode; widget.configurations.controller.editorFocusNode ??= widget.focusNode;
widget.configurations.controller.editorFocusNode?.requestFocus();
_editorKey = configurations.editorKey ?? GlobalKey<EditorState>(); _editorKey = configurations.editorKey ?? GlobalKey<EditorState>();
_selectionGestureDetectorBuilder = _selectionGestureDetectorBuilder =
_QuillEditorSelectionGestureDetectorBuilder( _QuillEditorSelectionGestureDetectorBuilder(

@ -322,19 +322,71 @@ class _TextLineState extends State<TextLine> {
return textStyle; return textStyle;
} }
TextSpan _getTextSpanFromNode( /// Processes subscript and superscript attributed text.
///
/// Reduces text fontSize and shifts down or up. Increases fontWeight to maintain balance with normal text.
/// Outputs characters individually to allow correct caret positioning and text selection.
InlineSpan _scriptSpan(String text, bool superScript, TextStyle style,
DefaultStyles defaultStyles) {
assert(text.isNotEmpty);
//
final lineStyle = style.fontSize == null || style.fontWeight == null
? _getLineStyle(defaultStyles)
: null;
final fontWeight = FontWeight.lerp(
style.fontWeight ?? lineStyle?.fontWeight ?? FontWeight.normal,
FontWeight.w900,
0.25);
final fontSize = style.fontSize ?? lineStyle?.fontSize ?? 16;
final y = (superScript ? -0.4 : 0.14) * fontSize;
final charStyle = style.copyWith(
fontFeatures: <FontFeature>[],
fontWeight: fontWeight,
fontSize: fontSize * 0.7);
//
final offset = Offset(0, y);
final children = <WidgetSpan>[];
for (final c in text.characters) {
children.add(WidgetSpan(
child: Transform.translate(
offset: offset,
child: Text(
c,
style: charStyle,
))));
}
//
if (children.length > 1) {
return TextSpan(children: children);
}
return children[0];
}
InlineSpan _getTextSpanFromNode(
DefaultStyles defaultStyles, Node node, Style lineStyle) { DefaultStyles defaultStyles, Node node, Style lineStyle) {
final textNode = node as leaf.QuillText; final textNode = node as leaf.QuillText;
final nodeStyle = textNode.style; final nodeStyle = textNode.style;
final isLink = nodeStyle.containsKey(Attribute.link.key) && final isLink = nodeStyle.containsKey(Attribute.link.key) &&
nodeStyle.attributes[Attribute.link.key]!.value != null; nodeStyle.attributes[Attribute.link.key]!.value != null;
final recognizer = _getRecognizer(node, isLink); final style = _getInlineTextStyle(
textNode, defaultStyles, nodeStyle, lineStyle, isLink);
if (widget.controller.configurations.requireScriptFontFeatures == false &&
textNode.value.isNotEmpty) {
if (nodeStyle.containsKey(Attribute.script.key)) {
final attr = nodeStyle.attributes[Attribute.script.key];
if (attr == Attribute.superscript || attr == Attribute.subscript) {
return _scriptSpan(textNode.value, attr == Attribute.superscript,
style, defaultStyles);
}
}
}
final recognizer = _getRecognizer(node, isLink);
return TextSpan( return TextSpan(
text: textNode.value, text: textNode.value,
style: _getInlineTextStyle( style: style,
textNode, defaultStyles, nodeStyle, lineStyle, isLink),
recognizer: recognizer, recognizer: recognizer,
mouseCursor: (recognizer != null) ? SystemMouseCursors.click : null, mouseCursor: (recognizer != null) ? SystemMouseCursors.click : null,
); );

@ -78,10 +78,7 @@ class QuillToolbarToggleStyleButtonState
'left' => (context.loc.alignLeft, Icons.format_align_left), 'left' => (context.loc.alignLeft, Icons.format_align_left),
'right' => (context.loc.alignRight, Icons.format_align_right), 'right' => (context.loc.alignRight, Icons.format_align_right),
'center' => (context.loc.alignCenter, Icons.format_align_center), 'center' => (context.loc.alignCenter, Icons.format_align_center),
'justify' => ( 'justify' => (context.loc.alignJustify, Icons.format_align_justify),
context.loc.justifyWinWidth,
Icons.format_align_justify
),
Object() => throw ArgumentError(widget.attribute.value), Object() => throw ArgumentError(widget.attribute.value),
null => (context.loc.alignCenter, Icons.format_align_center), null => (context.loc.alignCenter, Icons.format_align_center),
}; };

@ -18,7 +18,7 @@ import 'package:yaml/yaml.dart';
// This must be updated once add or remove some translation keys // This must be updated once add or remove some translation keys
// if you update existing keys, no need to update it // if you update existing keys, no need to update it
const _expectedTranslationKeysLength = 96; const _expectedTranslationKeysLength = 98;
Future<void> main(List<String> args) async { Future<void> main(List<String> args) async {
final l10nYamlText = await File('l10n.yaml').readAsString(); final l10nYamlText = await File('l10n.yaml').readAsString();

Loading…
Cancel
Save