bump version 0.1.5 (#2506)

* chore: bump version 0.1.5

* fix: could not trigger slash menu after inserting an emoji

* Revert "feat: add hover effect on an event card (#2487)"

This reverts commit f0a4b4b77d.

* feat: add hover effect on an event card

* fix: #2469 duplicated cover
This commit is contained in:
Lucas.Xu 2023-05-11 18:04:36 +07:00 committed by GitHub
parent cf27409c8d
commit 54f757d9b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 82 additions and 64 deletions

View File

@ -138,7 +138,7 @@ jobs:
job: job:
- { - {
target: x86_64-apple-darwin, target: x86_64-apple-darwin,
os: macos-10.15, os: macos-11,
extra-build-args: "", extra-build-args: "",
} }
steps: steps:

View File

@ -23,7 +23,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi" CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi" CARGO_MAKE_CRATE_NAME = "dart-ffi"
LIB_NAME = "dart_ffi" LIB_NAME = "dart_ffi"
CURRENT_APP_VERSION = "0.1.4" CURRENT_APP_VERSION = "0.1.5"
FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite" FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite"
PRODUCT_NAME = "AppFlowy" PRODUCT_NAME = "AppFlowy"
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html # CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html

View File

@ -123,7 +123,6 @@ class CalendarDayCard extends StatelessWidget {
child: FlowyText.medium( child: FlowyText.medium(
cellData, cellData,
textAlign: TextAlign.left, textAlign: TextAlign.left,
color: Theme.of(context).colorScheme.onBackground,
fontSize: 11, fontSize: 11,
maxLines: null, // Enable multiple lines maxLines: null, // Enable multiple lines
), ),
@ -193,8 +192,12 @@ class CalendarDayCard extends StatelessWidget {
cardData: event.dateFieldId, cardData: event.dateFieldId,
isEditing: false, isEditing: false,
cellBuilder: cellBuilder, cellBuilder: cellBuilder,
//Since we already have [showEventDetails] in calendar_day.dart, we don't need to implement it here again. openCard: (context) => showEventDetails(
openCard: (_) {}, context: context,
event: event,
viewId: viewId,
rowCache: _rowCache,
),
styleConfiguration: const RowCardStyleConfiguration( styleConfiguration: const RowCardStyleConfiguration(
showAccessory: false, showAccessory: false,
cellPadding: EdgeInsets.zero, cellPadding: EdgeInsets.zero,
@ -204,30 +207,23 @@ class CalendarDayCard extends StatelessWidget {
onEndEditing: () {}, onEndEditing: () {},
); );
return InkWell( return FlowyHover(
onTap: () => showEventDetails( style: HoverStyle(
context: context, hoverColor: Theme.of(context).colorScheme.tertiaryContainer,
event: event, foregroundColorOnHover: Theme.of(context).colorScheme.onBackground,
viewId: viewId,
rowCache: _rowCache,
), ),
child: FlowyHover( child: Container(
style: HoverStyle( padding: const EdgeInsets.symmetric(horizontal: 2),
hoverColor: Theme.of(context).colorScheme.tertiaryContainer, decoration: BoxDecoration(
), border: Border.fromBorderSide(
child: Container( BorderSide(
padding: const EdgeInsets.symmetric(horizontal: 2), color: Theme.of(context).dividerColor,
decoration: BoxDecoration( width: 1.5,
border: Border.fromBorderSide(
BorderSide(
color: Theme.of(context).dividerColor,
width: 1.5,
),
), ),
borderRadius: Corners.s6Border,
), ),
child: card, borderRadius: Corners.s6Border,
), ),
child: card,
), ),
); );
} }

View File

@ -141,6 +141,7 @@ class _RowCardState<T> extends State<RowCard<T>> {
} }
}, },
openAccessory: _handleOpenAccessory, openAccessory: _handleOpenAccessory,
openCard: (context) => widget.openCard(context),
child: _CardContent<T>( child: _CardContent<T>(
rowNotifier: rowNotifier, rowNotifier: rowNotifier,
cellBuilder: widget.cellBuilder, cellBuilder: widget.cellBuilder,

View File

@ -8,9 +8,11 @@ class RowCardContainer extends StatelessWidget {
final Widget child; final Widget child;
final CardAccessoryBuilder? accessoryBuilder; final CardAccessoryBuilder? accessoryBuilder;
final bool Function()? buildAccessoryWhen; final bool Function()? buildAccessoryWhen;
final void Function(BuildContext) openCard;
final void Function(AccessoryType) openAccessory; final void Function(AccessoryType) openAccessory;
const RowCardContainer({ const RowCardContainer({
required this.child, required this.child,
required this.openCard,
required this.openAccessory, required this.openAccessory,
this.accessoryBuilder, this.accessoryBuilder,
this.buildAccessoryWhen, this.buildAccessoryWhen,
@ -40,10 +42,16 @@ class RowCardContainer extends StatelessWidget {
} }
} }
return Container( return GestureDetector(
padding: const EdgeInsets.all(8), behavior: HitTestBehavior.opaque,
constraints: const BoxConstraints(minHeight: 30), onTap: () => openCard(context),
child: container, child: Padding(
padding: const EdgeInsets.all(8),
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 30),
child: container,
),
),
); );
}, },
), ),

View File

@ -226,6 +226,9 @@ class _AppFlowyEditorPageState extends State<_AppFlowyEditorPage> {
if (temporaryNodeTypes.contains(node.type)) { if (temporaryNodeTypes.contains(node.type)) {
transaction.deleteNode(node); transaction.deleteNode(node);
} }
if (kCoverType == node.type && !node.path.equals([0])) {
transaction.deleteNode(node);
}
} }
if (transaction.operations.isNotEmpty) { if (transaction.operations.isNotEmpty) {
await editorState.apply(transaction, withUpdateCursor: false); await editorState.apply(transaction, withUpdateCursor: false);

View File

@ -29,29 +29,32 @@ void _showEmojiSelectionMenu(
menuService.dismiss(); menuService.dismiss();
_emojiSelectionMenu?.remove(); _emojiSelectionMenu?.remove();
_emojiSelectionMenu = OverlayEntry(builder: (context) { _emojiSelectionMenu = OverlayEntry(
return Positioned( builder: (context) {
top: alignment == Alignment.bottomLeft ? offset.dy : null, return Positioned(
bottom: alignment == Alignment.topLeft ? offset.dy : null, top: alignment == Alignment.bottomLeft ? offset.dy : null,
left: offset.dx, bottom: alignment == Alignment.topLeft ? offset.dy : null,
child: Material( left: offset.dx,
child: EmojiSelectionMenu( child: Material(
editorState: editorState, child: EmojiSelectionMenu(
onSubmitted: (text) { editorState: editorState,
// insert emoji onSubmitted: (text) {
editorState.insertEmoji(text); // insert emoji
}, editorState.insertEmoji(text);
onExit: () { },
_dismissEmojiSelectionMenu(); onExit: () {
//close emoji panel _dismissEmojiSelectionMenu();
}, //close emoji panel
},
),
), ),
), );
); },
},); );
Overlay.of(context).insert(_emojiSelectionMenu!); Overlay.of(context).insert(_emojiSelectionMenu!);
_editorState = editorState;
editorState.service.selectionService.currentSelection editorState.service.selectionService.currentSelection
.addListener(_dismissEmojiSelectionMenu); .addListener(_dismissEmojiSelectionMenu);
} }
@ -62,6 +65,7 @@ void _dismissEmojiSelectionMenu() {
_editorState?.service.selectionService.currentSelection _editorState?.service.selectionService.currentSelection
.removeListener(_dismissEmojiSelectionMenu); .removeListener(_dismissEmojiSelectionMenu);
_editorState?.service.keyboardService?.enable();
_editorState = null; _editorState = null;
} }

View File

@ -132,6 +132,21 @@ class FlowyHoverContainer extends StatelessWidget {
width: style.borderWidth, width: style.borderWidth,
); );
final theme = Theme.of(context);
final textTheme = theme.textTheme;
final iconTheme = theme.iconTheme;
// override text's theme with foregroundColorOnHover when it is hovered
final hoverTheme = theme.copyWith(
textTheme: textTheme.copyWith(
bodyMedium: textTheme.bodyMedium?.copyWith(
color: style.foregroundColorOnHover ?? theme.colorScheme.onSurface,
),
),
iconTheme: iconTheme.copyWith(
color: style.foregroundColorOnHover ?? theme.colorScheme.onSurface,
),
);
return Container( return Container(
margin: style.contentMargin, margin: style.contentMargin,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -139,19 +154,8 @@ class FlowyHoverContainer extends StatelessWidget {
color: style.hoverColor ?? Theme.of(context).colorScheme.secondary, color: style.hoverColor ?? Theme.of(context).colorScheme.secondary,
borderRadius: style.borderRadius, borderRadius: style.borderRadius,
), ),
child: child: Theme(
//override text's theme with foregroundColorOnHover when it is hovered data: hoverTheme,
Theme(
data: Theme.of(context).copyWith(
textTheme: Theme.of(context).textTheme.copyWith(
bodyMedium: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: style.foregroundColorOnHover ??
Theme.of(context).colorScheme.onSurface),
),
iconTheme: Theme.of(context).iconTheme.copyWith(
color: style.foregroundColorOnHover ??
Theme.of(context).colorScheme.onSurface),
),
child: child, child: child,
), ),
); );

View File

@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.1.4 version: 0.1.5
environment: environment:
sdk: ">=2.19.0 <3.0.0" sdk: ">=2.19.0 <3.0.0"

View File

@ -1,6 +1,7 @@
[Setup] [Setup]
AppName=AppFlowy AppName=AppFlowy
AppVersion={#AppVersion} AppVersion={#AppVersion}
AppPublisher=AppFlowy-IO
WizardStyle=modern WizardStyle=modern
Compression=lzma2 Compression=lzma2
SolidCompression=yes SolidCompression=yes
@ -9,8 +10,8 @@ DefaultGroupName=AppFlowy
SetupIconFile=flowy_logo.ico SetupIconFile=flowy_logo.ico
UninstallDisplayIcon={app}\AppFlowy.exe UninstallDisplayIcon={app}\AppFlowy.exe
UninstallDisplayName=AppFlowy UninstallDisplayName=AppFlowy
AppPublisher=AppFlowy-IO
VersionInfoVersion={#AppVersion} VersionInfoVersion={#AppVersion}
UsePreviousAppDir=no
[Files] [Files]
Source: "AppFlowy\AppFlowy.exe";DestDir: "{app}";DestName: "AppFlowy.exe" Source: "AppFlowy\AppFlowy.exe";DestDir: "{app}";DestName: "AppFlowy.exe"
@ -18,4 +19,5 @@ Source: "AppFlowy\*";DestDir: "{app}"
Source: "AppFlowy\data\*";DestDir: "{app}\data\"; Flags: recursesubdirs Source: "AppFlowy\data\*";DestDir: "{app}\data\"; Flags: recursesubdirs
[Icons] [Icons]
Name: "{group}\AppFlowy";Filename: "{app}\AppFlowy.exe" Name: "{userdesktop}\AppFlowy"; Filename: "{app}\AppFlowy.exe"
Name: "{group}\AppFlowy"; Filename: "{app}\AppFlowy.exe"