-
Notifications
You must be signed in to change notification settings - Fork 198
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
WIP: Support the mobile platforms (iOS and Android) and make the editor more extensible. #97
Closed
2 tasks done
Labels
editor
features related to the rich-text editor
mobile
features related to mobile
new feature
this is something new for the end user
Comments
LucasXu0
changed the title
Placeholder
WIP: Support the mobile platforms (iOS and Android) and make the editor more extensible.
Apr 24, 2023
10 tasks
annieappflowy
added
new feature
this is something new for the end user
mobile
features related to mobile
editor
features related to the rich-text editor
labels
Apr 25, 2023
Test migration
Reference
|
How to define a new block component
1. define the keys for your blockclass CalloutBlockKeys {
const CalloutBlockKeys._();
static const String type = 'callout';
/// The content of a code block.
///
/// The value is a String.
static const String delta = 'delta';
/// The background color of a callout block.
///
/// The value is a String.
static const String backgroundColor = 'bgColor';
/// The emoji icon of a callout block.
///
/// The value is a String.
static const String icon = 'icon';
} 2. define your node constructor// creating a new callout node
Node calloutNode({
Delta? delta,
String emoji = '📌',
String backgroundColor = '#F0F0F0',
}) {
final attributes = {
CalloutBlockKeys.delta: (delta ?? Delta()).toJson(),
CalloutBlockKeys.icon: emoji,
CalloutBlockKeys.backgroundColor: backgroundColor,
};
return Node(
type: CalloutBlockKeys.type,
attributes: attributes,
);
} 3. define a component builder extended
|
This was referenced May 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
editor
features related to the rich-text editor
mobile
features related to mobile
new feature
this is something new for the end user
Hi, All. I'm refactoring the rendered part for appflowy_editor to support the mobile platform. Here's an update for the job.
Major refactor
keep the services structure as it is, but split them into two parts: mobile service and desktop service.
currenctSelection
andcurrentSelectedNodes
from it, and move this functionality to theeditor_state
. Theselection
is no longer dependent on the UI, making it more testable.Listen
used to update the document's offset and replace it withSingleChildScrollView
.CharacterShortcutEvent
is based on a singlecharacter
and used indelta_input_service.dart
(Software keyboard, IME), like/
,CommandShortcutEvent
is based on a series ofcommand
s and used inkeyboard_service.dart
(Hardware keyboard), likecmd+c
,ctrl+c
, and so on.Replace the
NodeWidgetBuilder
withBlockComponentBuilder
.Split the toolbar service into a separate directory and extract it into a independent package.
Move all of the built-in node builders to the 'block_component' folder and do not add these builders to the editor as default builders. Now, developers need to register them with the editor as needed.
TextNode
and add thedelta
attribute to theNode
instead.Directory structure
Tasks
The text was updated successfully, but these errors were encountered: