mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: integrate new editor (#2536)
* feat: update editor * feat: integrate new editor * feat: integrate the document2 into folder2 * feat: integrate the new editor * chore: cargo fix * chore: active document feature for flowy-error * feat: convert the editor action to collab action * feat: migrate the grid and board * feat: migrate the callout block * feat: migrate the divider * chore: migrate the callout and math equation * feat: migrate the code block * feat: add shift + enter command in code block * feat: support tab and shift+tab in code block * fix: cursor error after inserting divider * feat: migrate the grid and board * feat: migrate the emoji picker * feat: migrate openai * feat: integrate floating toolbar * feat: migrate the smart editor * feat: migrate the cover * feat: add option block action * chore: implement block selection and delete option * feat: support background color * feat: dismiss color picker afer setting color * feat: migrate the cover block * feat: resize the font * chore: cutomsize the padding * chore: wrap the option button with ignore widget * feat: customize the heading style * chore: optimize the divider line height * fix: the option button can't dismiss * ci: rust test * chore: flutter analyze * fix: code block selection * fix: dismiss the emoji picker after selecting one * chore: optimize the transaction adapter * fix: can't save the new content * feat: show export page when some errors happen * feat: implement get_view_data for document --------- Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -66,7 +66,12 @@ class SelectOptionTypeOptionEditor extends StatelessWidget {
|
||||
if (showOptions) {
|
||||
cells.add(const TypeOptionSeparator());
|
||||
cells.add(
|
||||
SelectOptionColorList(selectedColor: state.option.color),
|
||||
SelectOptionColorList(
|
||||
selectedColor: state.option.color,
|
||||
onSelectedColor: (color) => context
|
||||
.read<EditSelectOptionBloc>()
|
||||
.add(EditSelectOptionEvent.updateColor(color)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -147,16 +152,22 @@ class _OptionNameTextField extends StatelessWidget {
|
||||
}
|
||||
|
||||
class SelectOptionColorList extends StatelessWidget {
|
||||
final SelectOptionColorPB selectedColor;
|
||||
const SelectOptionColorList({required this.selectedColor, Key? key})
|
||||
: super(key: key);
|
||||
const SelectOptionColorList({
|
||||
super.key,
|
||||
this.selectedColor,
|
||||
required this.onSelectedColor,
|
||||
});
|
||||
|
||||
final SelectOptionColorPB? selectedColor;
|
||||
final void Function(SelectOptionColorPB color) onSelectedColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cells = SelectOptionColorPB.values.map((color) {
|
||||
return _SelectOptionColorCell(
|
||||
color: color,
|
||||
isSelected: selectedColor == color,
|
||||
isSelected: selectedColor != null ? selectedColor == color : false,
|
||||
onSelectedColor: onSelectedColor,
|
||||
);
|
||||
}).toList();
|
||||
|
||||
@ -193,14 +204,17 @@ class SelectOptionColorList extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _SelectOptionColorCell extends StatelessWidget {
|
||||
final SelectOptionColorPB color;
|
||||
final bool isSelected;
|
||||
const _SelectOptionColorCell({
|
||||
required this.color,
|
||||
required this.isSelected,
|
||||
required this.onSelectedColor,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
final SelectOptionColorPB color;
|
||||
final bool isSelected;
|
||||
final void Function(SelectOptionColorPB color) onSelectedColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget? checkmark;
|
||||
@ -228,11 +242,7 @@ class _SelectOptionColorCell extends StatelessWidget {
|
||||
),
|
||||
leftIcon: colorIcon,
|
||||
rightIcon: checkmark,
|
||||
onTap: () {
|
||||
context
|
||||
.read<EditSelectOptionBloc>()
|
||||
.add(EditSelectOptionEvent.updateColor(color));
|
||||
},
|
||||
onTap: () => onSelectedColor(color),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user