feat: imporve the functionality of pasting from html

This commit is contained in:
Lucas.Xu 2023-08-17 14:09:26 +08:00
parent a1f1559936
commit e226eaad45
6 changed files with 8 additions and 9 deletions

View File

@ -1,8 +1,8 @@
import 'package:appflowy/plugins/document/application/doc_bloc.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/inline_page/inline_page_reference.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
import 'package:appflowy/workspace/application/settings/shortcuts/settings_shortcuts_service.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/inline_page/inline_page_reference.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:collection/collection.dart';
import 'package:flowy_infra/theme_extension.dart';

View File

@ -3,6 +3,7 @@ import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../base/emoji_picker_button.dart';
// defining the keys of the callout block's attributes for easy access
@ -138,7 +139,7 @@ class _CalloutBlockComponentWidgetState
Color get backgroundColor {
final colorString =
node.attributes[CalloutBlockKeys.backgroundColor] as String;
return colorString.toColor();
return colorString.toColor() ?? Colors.transparent;
}
// get the emoji of the note block from the node's attributes or default to '📌'

View File

@ -1,8 +1,8 @@
import 'dart:async';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -84,7 +84,7 @@ class _OutlineBlockWidgetState extends State<OutlineBlockWidget>
if (colorString == null) {
return Colors.transparent;
}
return colorString.toColor();
return colorString.toColor() ?? Colors.transparent;
}
late EditorState editorState = context.read<EditorState>();

View File

@ -32,7 +32,6 @@ class EditorStyleCustomizer {
final fontFamily = context.read<DocumentAppearanceCubit>().state.fontFamily;
return EditorStyle.desktop(
padding: padding,
backgroundColor: theme.colorScheme.surface,
cursorColor: theme.colorScheme.primary,
textStyleConfiguration: TextStyleConfiguration(
text: baseTextStyle(fontFamily).copyWith(
@ -76,7 +75,6 @@ class EditorStyleCustomizer {
return EditorStyle.desktop(
padding: padding,
backgroundColor: theme.colorScheme.surface,
cursorColor: theme.colorScheme.primary,
textStyleConfiguration: TextStyleConfiguration(
text: baseTextStyle(fontFamily).copyWith(

View File

@ -53,8 +53,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: e5a10c4
resolved-ref: e5a10c4b4da10ae2faab8fd9a040633f66e3763b
ref: "56474e8b"
resolved-ref: "56474e8bd9f08be7090495c255eea20a694ab1f3"
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git
version: "1.2.3"

View File

@ -48,7 +48,7 @@ dependencies:
appflowy_editor:
git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git
ref: e5a10c4
ref: 56474e8b
appflowy_popover:
path: packages/appflowy_popover