mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: imporve the functionality of pasting from html
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
import 'package:appflowy/plugins/document/application/doc_bloc.dart';
|
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_plugins/plugins.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
|
||||||
import 'package:appflowy/workspace/application/settings/shortcuts/settings_shortcuts_service.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:appflowy_editor/appflowy_editor.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flowy_infra/theme_extension.dart';
|
import 'package:flowy_infra/theme_extension.dart';
|
||||||
|
@ -3,6 +3,7 @@ import 'package:flowy_infra/theme_extension.dart';
|
|||||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../base/emoji_picker_button.dart';
|
import '../base/emoji_picker_button.dart';
|
||||||
|
|
||||||
// defining the keys of the callout block's attributes for easy access
|
// defining the keys of the callout block's attributes for easy access
|
||||||
@ -138,7 +139,7 @@ class _CalloutBlockComponentWidgetState
|
|||||||
Color get backgroundColor {
|
Color get backgroundColor {
|
||||||
final colorString =
|
final colorString =
|
||||||
node.attributes[CalloutBlockKeys.backgroundColor] as String;
|
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 '📌'
|
// get the emoji of the note block from the node's attributes or default to '📌'
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:appflowy_editor/appflowy_editor.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:flowy_infra_ui/style_widget/hover.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@ -84,7 +84,7 @@ class _OutlineBlockWidgetState extends State<OutlineBlockWidget>
|
|||||||
if (colorString == null) {
|
if (colorString == null) {
|
||||||
return Colors.transparent;
|
return Colors.transparent;
|
||||||
}
|
}
|
||||||
return colorString.toColor();
|
return colorString.toColor() ?? Colors.transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
late EditorState editorState = context.read<EditorState>();
|
late EditorState editorState = context.read<EditorState>();
|
||||||
|
@ -32,7 +32,6 @@ class EditorStyleCustomizer {
|
|||||||
final fontFamily = context.read<DocumentAppearanceCubit>().state.fontFamily;
|
final fontFamily = context.read<DocumentAppearanceCubit>().state.fontFamily;
|
||||||
return EditorStyle.desktop(
|
return EditorStyle.desktop(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
backgroundColor: theme.colorScheme.surface,
|
|
||||||
cursorColor: theme.colorScheme.primary,
|
cursorColor: theme.colorScheme.primary,
|
||||||
textStyleConfiguration: TextStyleConfiguration(
|
textStyleConfiguration: TextStyleConfiguration(
|
||||||
text: baseTextStyle(fontFamily).copyWith(
|
text: baseTextStyle(fontFamily).copyWith(
|
||||||
@ -76,7 +75,6 @@ class EditorStyleCustomizer {
|
|||||||
|
|
||||||
return EditorStyle.desktop(
|
return EditorStyle.desktop(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
backgroundColor: theme.colorScheme.surface,
|
|
||||||
cursorColor: theme.colorScheme.primary,
|
cursorColor: theme.colorScheme.primary,
|
||||||
textStyleConfiguration: TextStyleConfiguration(
|
textStyleConfiguration: TextStyleConfiguration(
|
||||||
text: baseTextStyle(fontFamily).copyWith(
|
text: baseTextStyle(fontFamily).copyWith(
|
||||||
|
@ -53,8 +53,8 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: e5a10c4
|
ref: "56474e8b"
|
||||||
resolved-ref: e5a10c4b4da10ae2faab8fd9a040633f66e3763b
|
resolved-ref: "56474e8bd9f08be7090495c255eea20a694ab1f3"
|
||||||
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
|
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
|
||||||
source: git
|
source: git
|
||||||
version: "1.2.3"
|
version: "1.2.3"
|
||||||
|
@ -48,7 +48,7 @@ dependencies:
|
|||||||
appflowy_editor:
|
appflowy_editor:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/AppFlowy-IO/appflowy-editor.git
|
url: https://github.com/AppFlowy-IO/appflowy-editor.git
|
||||||
ref: e5a10c4
|
ref: 56474e8b
|
||||||
appflowy_popover:
|
appflowy_popover:
|
||||||
path: packages/appflowy_popover
|
path: packages/appflowy_popover
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user