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

Feat: support for dynamic placeholders #2238

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
c6636b7
Chore: added transparent_attribue
Sep 15, 2024
87cea7a
Partial improvements
Sep 17, 2024
d5e4f55
Feat: support for dynamic placeholders
Sep 18, 2024
8f4b0da
Fix: web cannot use dynamic placeholders
Sep 18, 2024
14fe2b3
Chore: removed isLink check since is unnecessary
Sep 18, 2024
811c9a0
Chore: renamed builder param to builders for make more sense to its f…
Sep 18, 2024
c9c5a3d
Chore: dart format .
Sep 18, 2024
98f817f
Chore: fix example in doc comment
Sep 18, 2024
d2a0a63
Chore: renamed PlaceholderConfiguration to PlaceholderArguments
Sep 18, 2024
dd81cc2
Feat: support custom attributes for placeholders
Sep 18, 2024
82b3780
Chore: dart format
Sep 18, 2024
5741e6b
Chore: added late keyword for blackList
Sep 18, 2024
d6edcd2
Feat: added support for cursor placeholder
Sep 18, 2024
8d274a0
Fix: make CursorParagraphPlaceholderConfiguration nullable
Sep 18, 2024
88e9cca
Chore: improve placeholders examples
Sep 18, 2024
1485ba6
Merge branch 'master' into improve_headers
CatHood0 Sep 18, 2024
7be52d5
Fix(merge): missing trailing comma on EditableTextLine constructor
Sep 18, 2024
abf8363
Chore: run before_push to fix formats
Sep 18, 2024
d7c5d14
Chore: make placeholderComponentsConfiguration fully optional
Sep 18, 2024
1eefa9d
Fix: add validation to avoid show component placeholder when found co…
Sep 19, 2024
385586e
Merge branch 'master' into improve_headers
CatHood0 Sep 19, 2024
cece358
Chore: dart format
Sep 19, 2024
aa131a4
Chore: revert change where the placeholder is hiden if node contains …
Sep 20, 2024
f2db22b
Fix: placeholder does not show the aligned applied in the line
Sep 20, 2024
b90f3af
Chore: removed unused imports
Sep 20, 2024
2fb3131
Chore: fix curly issue with flutter analysis
Sep 20, 2024
e412236
Chore: add internal annotations and make strutStyle optional in build…
Sep 20, 2024
3f2d4e4
Fix: widget span is generating unexpected behaviors with the caret
Sep 20, 2024
8556861
Fix: placeholder text span is not taking the style of the dev
Sep 20, 2024
612a36a
chore(github): update the question template to add the question label…
EchoEllet Sep 19, 2024
6411648
chore(github): remove 'Code sample' text area input from bug report t…
EchoEllet Sep 19, 2024
8e57431
chore: rename closeWebPasteEvent() to cancelWebPasteEvent(), improve …
EchoEllet Sep 20, 2024
8e6dd4f
Feat: Removing check not allowing spell check on web (#2252)
joeserhtf Sep 20, 2024
eed3599
chore(version): update to version 10.6.6
singerdmx Sep 20, 2024
8dfac75
Chore: deprecate embed table feature (#2254)
CatHood0 Sep 21, 2024
55fbb16
chore(version): update to version 10.7.0
singerdmx Sep 21, 2024
03fc81c
chore: deprecate markdown_quill export, ignore warnings (#2256)
EchoEllet Sep 21, 2024
708baf2
chore: deprecate spell checker service (#2255)
EchoEllet Sep 21, 2024
ec520c4
chore(version): update to version 10.7.1
singerdmx Sep 21, 2024
35546ca
chore: deprecate flutter_quill/extensions.dart (#2258)
EchoEllet Sep 21, 2024
e228f14
chore(version): update to version 10.7.2
EchoEllet Sep 21, 2024
4076c98
chore: update minimum version of flutter_quill and super_clipboard in…
EchoEllet Sep 21, 2024
503ad20
chore: deprecate FlutterQuillExtensions
EchoEllet Sep 21, 2024
d2606a4
chore(version): update to version 10.7.3
EchoEllet Sep 21, 2024
a1bfa2d
chore(example): update pub.dev version of flutter_quill packages
EchoEllet Sep 21, 2024
0b78052
chore: deprecate QuillImageUtilities
EchoEllet Sep 21, 2024
bb4e47d
chore: remove pubspec_overrides.yaml and pubspec_overrides.yaml.disab…
EchoEllet Sep 21, 2024
1e989d2
ci: remove quill_native_bridge from automated publishing workflow (#2…
EchoEllet Sep 21, 2024
73dc05f
chore: remove quill_native_bridge from rootPackages in scripts to ens…
EchoEllet Sep 21, 2024
0eb4987
chore(version): update to version 10.7.4
singerdmx Sep 21, 2024
4ce5bc8
fix(ci): add flutter pub get step for quill_native_bridge to fix fail…
EchoEllet Sep 21, 2024
40fd709
revert: "Resolved issue with broken IME composing rect in Windows des…
CatHood0 Sep 22, 2024
4c23d98
chore(version): update to version 10.7.5
singerdmx Sep 22, 2024
a4f69a7
Comment Typos fix (#2267)
Luismi74 Sep 22, 2024
0f03135
docs: add important note for contributors before introducing new feat…
EchoEllet Sep 22, 2024
1690bff
docs: remove table support note in README of flutter_quill_extensions…
EchoEllet Sep 22, 2024
9cf64d2
docs: add 'and' before videos in extensions package
EchoEllet Sep 22, 2024
c8bd92e
docs(readme): add 'Breaking Changes' section (#2275)
EchoEllet Sep 23, 2024
abbe9ce
chore(example): update macOS Podfile.lock
EchoEllet Sep 24, 2024
e7e6b3f
Fix: Resolved issue with broken IME composing rect in Windows desktop…
agata Sep 25, 2024
b589972
chore(version): update to version 10.7.6
singerdmx Sep 25, 2024
740c0cd
fix: update version range of quill_native_bridge to avoid using lates…
EchoEllet Sep 25, 2024
45b6618
chore(version): update to version 10.7.7
EchoEllet Sep 25, 2024
5d2b74c
fix(extensions)!: drop support for YouTube iframeView for non-web pla…
EchoEllet Sep 25, 2024
b8e6af1
chore(version): update to version 10.8.0
EchoEllet Sep 25, 2024
e34ae5f
chore(example): exclude flutter_inappwebview_web web support js file …
EchoEllet Sep 25, 2024
ffe66fb
chore(deps): update dev dependency flutter_lints to 5.0.0, solve warn…
EchoEllet Sep 27, 2024
60ff374
Add Hungarian (hu) localization (#2291)
G-Greg Sep 27, 2024
da1ed15
fix: replace flutter_keyboard_visibility with flutter_keyboard_visibi…
EchoEllet Sep 27, 2024
65eadbf
chore: remove dart_quill_delta directory to move it outside of the re…
EchoEllet Sep 27, 2024
5f6dff2
docs(readme): update flutter_keyboard_visibility to flutter_keyboard_…
EchoEllet Sep 27, 2024
bafa87d
chore: remove .pubignore
EchoEllet Sep 27, 2024
8d6e401
chore(version): update to version 10.8.1
EchoEllet Sep 27, 2024
c9cdadf
fix(ci): use fixed version of simple_spell_checker to fix CI warnings
EchoEllet Sep 28, 2024
59810e9
Fixed minor typo in Hungarian (hu) localization (#2307)
G-Greg Oct 1, 2024
37529b0
chore(version): update to version 10.8.2
singerdmx Oct 1, 2024
241c6fa
fix(example): build failure on Android with latest version of Android…
EchoEllet Oct 6, 2024
d09e479
feat: Use quill_native_bridge as default impl in DefaultClipboardServ…
EchoEllet Oct 16, 2024
48cdbb4
chore(version): update to version 10.8.3-dev.0
EchoEllet Oct 17, 2024
5761021
chore(deps): update minimum version of flutter_quill in flutter_quill…
EchoEllet Oct 17, 2024
a18ab28
chore(version): update to version 10.8.3
EchoEllet Oct 17, 2024
071edab
chore(deps): bump minimum flutter_quill to 10.8.3 in flutter_quill_ex…
EchoEllet Oct 17, 2024
f2220cc
chore(deps): update min version of quill_native_bridge
EchoEllet Oct 17, 2024
62d8212
fix: avoid using getClipboardFiles() if unsupported on the current pl…
EchoEllet Oct 17, 2024
5ecebd2
chore(version): update to version 10.8.4
EchoEllet Oct 17, 2024
002a92f
docs(readme): improve the note message of quill_super_clipboard and q…
EchoEllet Oct 17, 2024
3482130
fix: allow all correct URLs to be formatted (#2328)
orevial Oct 22, 2024
c6fb247
fix(macos): Implement actions for ExpandSelectionToDocumentBoundaryIn…
EchoEllet Oct 23, 2024
bbf1ccf
chore(version): update to version 10.8.5
EchoEllet Oct 23, 2024
1cc1b50
fix: link menu action Cupertino modal popup now does NOT use root nav…
Zambrella Oct 24, 2024
0bd7513
Partial improvements
Sep 17, 2024
4b36413
Fix(merge): missing trailing comma on EditableTextLine constructor
Sep 18, 2024
364cb19
Chore: textDirection in build method from PlaceholderBuilder was chan…
Oct 28, 2024
09fb1d6
Remove unnecessary manual positioning of placeholder
Oct 28, 2024
c408522
Chore: remove print call and unnecessary import
Oct 28, 2024
5b7b65a
Chore: dart format
Oct 28, 2024
c4ccec7
Merge branch 'master' into improve_headers
CatHood0 Oct 28, 2024
8304a19
Merge from master branch
Nov 28, 2024
4bbd064
Chore: dart formatting
Nov 28, 2024
3a37acd
Chore: rename class names to make more sense with their functions
Nov 28, 2024
33a8cdd
Chore: fix missed changes on cursor, text_block and text_line
Nov 28, 2024
ce4c09b
Chore: changed param names to have the same from their classes
Nov 28, 2024
47bfd2b
Chore: fixed placeholders text scale issue on mobile devices
Nov 28, 2024
172a85c
Chore: dart formatting
Nov 28, 2024
d022960
Chore: restore example app
Nov 28, 2024
ce51947
Chore: removed _internal part from placeholder_builder file
Nov 28, 2024
8429efa
Chore: improved description of the _blackList in placeholder_builder …
Nov 28, 2024
6bb3a13
Chore: convert _isNodeInline into a function in a extension for Node …
Nov 28, 2024
057b8bd
Chore: dart format and removed unnecessary validation of localOffset …
Nov 28, 2024
47540d4
Chore: dart formatting
Nov 28, 2024
a4177ca
Fix: import from the old path of placeholder_builder
Nov 28, 2024
fb5b11a
Chore: improved doc comments and renamed params in QuillEditorConfig
Nov 29, 2024
13f858b
Chore: dart format
Jan 19, 2025
dcbf188
Chore(doc): added placeholder_introduction documentation
Jan 20, 2025
d07a680
Merge branch 'master' into improve_headers
CatHood0 Jan 20, 2025
03bf936
Chore: update pubspec.lock
Jan 20, 2025
7500ddb
Chore: updated changelog to the current version in stable release
Jan 20, 2025
cf20894
Chore: added missed letter in changelog
Jan 20, 2025
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
47 changes: 35 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ class _HomePageState extends State<HomePage> {
}
// Save the image somewhere and return the image URL that will be
// stored in the Quill Delta JSON (the document).
final newFileName =
'image-file-${DateTime.now().toIso8601String()}.png';
final newFileName = 'image-file-${DateTime.now().toIso8601String()}.png';
final newPath = path.join(
io.Directory.systemTemp.path,
newFileName,
Expand Down Expand Up @@ -86,9 +85,8 @@ class _HomePageState extends State<HomePage> {
icon: const Icon(Icons.output),
tooltip: 'Print Delta JSON to log',
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content:
Text('The JSON Delta has been printed to the console.')));
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(content: Text('The JSON Delta has been printed to the console.')));
CatHood0 marked this conversation as resolved.
Show resolved Hide resolved
debugPrint(jsonEncode(_controller.document.toDelta().toJson()));
},
),
Expand Down Expand Up @@ -127,11 +125,8 @@ class _HomePageState extends State<HomePage> {
buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
afterButtonPressed: () {
final isDesktop = {
TargetPlatform.linux,
TargetPlatform.windows,
TargetPlatform.macOS
}.contains(defaultTargetPlatform);
final isDesktop = {TargetPlatform.linux, TargetPlatform.windows, TargetPlatform.macOS}
.contains(defaultTargetPlatform);
CatHood0 marked this conversation as resolved.
Show resolved Hide resolved
if (isDesktop) {
_editorFocusNode.requestFocus();
}
Expand All @@ -147,6 +142,35 @@ class _HomePageState extends State<HomePage> {
controller: _controller,
config: QuillEditorConfig(
placeholder: 'Start writing your notes...',
characterShortcutEvents: standardCharactersShortcutEvents,
spaceShortcutEvents: standardSpaceShorcutEvents,
cursorPlaceholderConfig: CursorPlaceholderConfig(
text: 'Write something...',
textStyle: TextStyle(color: Colors.grey, fontStyle: FontStyle.italic),
show: true,
offset: Offset(3.5, 2)
),
placeholderComponentsConfiguration: PlaceholderConfig(
builders: {
Attribute.header.key: (Attribute attr, style) {
final values = [30, 27, 22];
final level = attr.value as int?;
if (level == null) return null;
final fontSize = values[(level - 1 < 0 || level - 1 > 3 ? 0 : level - 1)];
return PlaceholderTextBuilder(
placeholderText: 'Header $level',
style:
TextStyle(fontSize: fontSize.toDouble()).merge(style.copyWith(color: Colors.grey)),
);
},
Attribute.list.key: (Attribute attr, style) {
return PlaceholderTextBuilder(
placeholderText: 'List item',
style: style.copyWith(color: Colors.grey),
);
},
},
),
CatHood0 marked this conversation as resolved.
Show resolved Hide resolved
padding: const EdgeInsets.all(16),
embedBuilders: [
...FlutterQuillEmbeds.editorBuilders(
Expand Down Expand Up @@ -193,8 +217,7 @@ class TimeStampEmbed extends Embeddable {

static const String timeStampType = 'timeStamp';

static TimeStampEmbed fromDocument(Document document) =>
TimeStampEmbed(jsonEncode(document.toDelta().toJson()));
static TimeStampEmbed fromDocument(Document document) => TimeStampEmbed(jsonEncode(document.toDelta().toJson()));

Document get document => Document.fromJson(jsonDecode(data));
}
Expand Down
60 changes: 30 additions & 30 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
characters:
dependency: transitive
description:
Expand All @@ -45,18 +45,18 @@ packages:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.19.0"
version: "1.18.0"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -93,10 +93,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.1"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -286,10 +286,10 @@ packages:
dependency: transitive
description:
name: http_parser
sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360"
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.1.1"
version: "4.0.2"
image_picker:
dependency: transitive
description:
Expand Down Expand Up @@ -366,18 +366,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand All @@ -390,10 +390,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3"
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
url: "https://pub.dev"
source: hosted
version: "5.1.0"
version: "5.0.0"
markdown:
dependency: transitive
description:
Expand Down Expand Up @@ -438,10 +438,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.9.0"
photo_view:
dependency: transitive
description:
Expand Down Expand Up @@ -534,7 +534,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
version: "0.0.99"
source_span:
dependency: transitive
description:
Expand All @@ -547,10 +547,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
Expand All @@ -563,10 +563,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
Expand All @@ -579,10 +579,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.3"
version: "0.7.2"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -723,10 +723,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "14.2.5"
web:
dependency: transitive
description:
Expand All @@ -744,5 +744,5 @@ packages:
source: hosted
version: "5.8.0"
sdks:
dart: ">=3.6.0-0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"
2 changes: 2 additions & 0 deletions lib/flutter_quill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ export 'src/document/style.dart';
export 'src/editor/editor.dart';
export 'src/editor/embed/embed_editor_builder.dart';
export 'src/editor/raw_editor/builders/leading_block_builder.dart';
export 'src/editor/raw_editor/builders/placeholder/placeholder_configuration.dart';
export 'src/editor/raw_editor/config/events/events.dart';
export 'src/editor/raw_editor/config/raw_editor_config.dart';
export 'src/editor/raw_editor/quill_single_child_scroll_view.dart';
export 'src/editor/raw_editor/raw_editor.dart';
export 'src/editor/raw_editor/raw_editor_state.dart';
export 'src/editor/style_widgets/style_widgets.dart';
export 'src/editor/widgets/cursor.dart';
export 'src/editor/widgets/cursor_configuration/cursor_configuration.dart';
export 'src/editor/widgets/default_styles.dart';
export 'src/editor/widgets/link.dart';
export 'src/editor/widgets/text/utils/text_block_utils.dart';
Expand Down
44 changes: 44 additions & 0 deletions lib/src/editor/config/editor_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import '../../document/nodes/node.dart';
import '../../toolbar/theme/quill_dialog_theme.dart';
import '../embed/embed_editor_builder.dart';
import '../raw_editor/builders/leading_block_builder.dart';
import '../raw_editor/builders/placeholder/placeholder_configuration.dart';
import '../raw_editor/config/events/events.dart';
import '../raw_editor/config/raw_editor_config.dart';
import '../raw_editor/raw_editor.dart';
import '../widgets/cursor_configuration/cursor_configuration.dart';
import '../widgets/default_styles.dart';
import '../widgets/delegate.dart';
import '../widgets/link.dart';
Expand All @@ -26,6 +28,8 @@ class QuillEditorConfig {
const QuillEditorConfig({
this.scrollable = true,
this.padding = EdgeInsets.zero,
this.placeholderComponentsConfiguration,
this.cursorPlaceholderConfig,
@experimental this.characterShortcutEvents = const [],
@experimental this.spaceShortcutEvents = const [],
this.autoFocus = false,
Expand Down Expand Up @@ -137,6 +141,39 @@ class QuillEditorConfig {
@experimental
final List<SpaceShortcutEvent> spaceShortcutEvents;

/// Whether the line is empty, this let us add a placeholder
///
/// _Note: these placeholders are limited only to lines with block styles_
///
/// ### Example
///
/// Assume that you want to show only a placeholder text for the header items,
/// so, we only need to configure `placeholderComponentsConfiguration` like:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the Flutter/Dart style for writing docs (see example doc comment).

Try to remove the redundancy, keeping it as short as possible without details loss (not necessarily short), avoid let us, assume that you want to ..., we, you, and our in docs.

While our current doc comments are not qualified enough, I would like to improve, not add more things to improve on the list. I will update this soon, currently, I'm fixing #2394 and other related issues in flutter_quill_extensions (broken behavior on desktop and web platforms), once I'm done, I will handle all of the nits soon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't focused on improving the documentation yet. As you said before, I will follow the documentation style you mentioned, however, my priority at the moment is to check that all the functionality is working as it should. Once I can see that everything is working correctly, I will take the time to create more documentation (not only adding doc comments but also adding files for the official documentation of the package)

///
///```dart
///final configuration = PlaceholderComponentsConfiguration(
Copy link
Collaborator

@EchoEllet EchoEllet Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not formatted properly, formatting is important for consistent codebase docs, and handling conflicts, not necessarily for the final output.

The general idea is to follow the Dart and Flutter style for writing docs. The lints and checks will be updated later.

/// builders: <String, PlaceholderConfigurationBuilder>{
/// Attribute.header.key: (Attribute attr, style) {
/// final values = [30, 27, 22];
/// final level = attr.value as int?;
/// if (level == null) return null;
/// final fontSize = values[level - 1];
/// return PlaceholderArguments(
/// placeholderText: 'Header $level',
/// style: TextStyle(fontSize: fontSize.toDouble()).merge(style),
/// );
/// },
/// },
/// // if you use custom attribute keys into the `builders` param, them you will need to implement that
/// // here too
/// customBlockAttributesKeys: null,
///),
///```
final PlaceholderConfig? placeholderComponentsConfiguration;

/// This argument configure how will be showed the placeholder at right or left of the cursor
final CursorPlaceholderConfig? cursorPlaceholderConfig;

/// A handler for keys that are pressed when the editor is focused.
///
/// This feature is supported on **desktop devices only**.
Expand Down Expand Up @@ -505,7 +542,9 @@ class QuillEditorConfig {
ContentInsertionConfiguration? contentInsertionConfiguration,
GlobalKey<EditorState>? editorKey,
TextSelectionThemeData? textSelectionThemeData,
PlaceholderConfig? placeholderComponentsConfiguration,
bool? requestKeyboardFocusOnCheckListChanged,
CursorPlaceholderConfig? cursorPlaceholderConfig,
TextMagnifierConfiguration? magnifierConfiguration,
TextInputAction? textInputAction,
bool? enableScribble,
Expand All @@ -514,6 +553,11 @@ class QuillEditorConfig {
void Function(TextInputAction action)? onPerformAction,
}) {
return QuillEditorConfig(
cursorPlaceholderConfig:
cursorPlaceholderConfig ??
this.cursorPlaceholderConfig,
placeholderComponentsConfiguration: placeholderComponentsConfiguration ??
this.placeholderComponentsConfiguration,
customLeadingBlockBuilder:
customLeadingBlockBuilder ?? this.customLeadingBlockBuilder,
placeholder: placeholder ?? this.placeholder,
Expand Down
Loading
Loading