From ab214d4a74e877103990a50b598b4be0ba4bd218 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 12 Dec 2021 23:37:34 -0500 Subject: [PATCH 1/5] Added missing attributes to markdown renderer --- .../markdown/src/delta_markdown_encoder.dart | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/infrastructure/markdown/src/delta_markdown_encoder.dart b/frontend/app_flowy/lib/workspace/infrastructure/markdown/src/delta_markdown_encoder.dart index 12f57e6e8e..bd2aa4c281 100644 --- a/frontend/app_flowy/lib/workspace/infrastructure/markdown/src/delta_markdown_encoder.dart +++ b/frontend/app_flowy/lib/workspace/infrastructure/markdown/src/delta_markdown_encoder.dart @@ -65,8 +65,7 @@ class DeltaMarkdownEncoder extends Converter { // First close any current styles if needed final markedForRemoval = []; // Close the styles in reverse order, e.g. **_ for _**Test**_. - for (final value - in currentInlineStyle.attributes.values.toList().reversed) { + for (final value in currentInlineStyle.attributes.values.toList().reversed) { // TODO(tillf): Is block correct? if (value.scope == AttributeScope.BLOCK) { continue; @@ -123,10 +122,8 @@ class DeltaMarkdownEncoder extends Converter { // Close any open inline styles. _handleInline(lineBuffer, '', null); - final lineBlock = Style.fromJson(attributes) - .attributes - .values - .singleWhereOrNull((a) => a.scope == AttributeScope.BLOCK); + final lineBlock = + Style.fromJson(attributes).attributes.values.singleWhereOrNull((a) => a.scope == AttributeScope.BLOCK); if (lineBlock == currentBlockStyle) { currentBlockLines.add(lineBuffer.toString()); @@ -220,6 +217,16 @@ class DeltaMarkdownEncoder extends Converter { buffer.write(!close ? '[' : '](${attribute.value})'); } else if (attribute == Attribute.codeBlock) { buffer.write(!close ? '```\n' : '\n```'); + } else if (attribute.key == Attribute.background.key) { + buffer.write(!close ? '' : ''); + } else if (attribute.key == Attribute.underline.key) { + buffer.write(!close ? '' : ''); + } else if (attribute.key == Attribute.codeBlock.key) { + buffer.write(!close ? '```\n' : '\n```'); + } else if (attribute.key == Attribute.inlineCode.key) { + buffer.write(!close ? '`' : '`'); + } else if (attribute.key == Attribute.strikeThrough.key) { + buffer.write(!close ? '~~' : '~~'); } else { throw ArgumentError('Cannot handle $attribute'); } @@ -246,6 +253,8 @@ class DeltaMarkdownEncoder extends Converter { buffer.write('## '); } else if (block.key == Attribute.h3.key && block.value == 3) { buffer.write('### '); + } else if (block.key == Attribute.list.key) { + buffer.write('* '); } else { throw ArgumentError('Cannot handle block $block'); } From 5946dd0b7bae11b52ab099d68973f2f6e077afc5 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 13 Dec 2021 16:50:04 -0500 Subject: [PATCH 2/5] Changed string "Untitles" to "Untitled" --- frontend/app_flowy/assets/translations/en.json | 4 ++-- frontend/app_flowy/lib/generated/codegen_loader.g.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app_flowy/assets/translations/en.json b/frontend/app_flowy/assets/translations/en.json index 57d02b3967..2285416727 100644 --- a/frontend/app_flowy/assets/translations/en.json +++ b/frontend/app_flowy/assets/translations/en.json @@ -1,5 +1,5 @@ { - "appName": "Appflowy", + "appName": "AppFlowy", "defaultUsername": "Me", "welcomeText": "Welcome to @:appName", "githubStarText": "Star on GitHub", @@ -69,7 +69,7 @@ }, "menuAppHeader": { "addPageTooltip": "Quickly add a page inside", - "defaultNewPageName": "Untitles", + "defaultNewPageName": "Untitled", "renameDialog": "Rename" }, "toolbar": { diff --git a/frontend/app_flowy/lib/generated/codegen_loader.g.dart b/frontend/app_flowy/lib/generated/codegen_loader.g.dart index b150ffcbc4..b14c83a850 100644 --- a/frontend/app_flowy/lib/generated/codegen_loader.g.dart +++ b/frontend/app_flowy/lib/generated/codegen_loader.g.dart @@ -85,7 +85,7 @@ class CodegenLoader extends AssetLoader{ }, "menuAppHeader": { "addPageTooltip": "Quickly add a page inside", - "defaultNewPageName": "Untitles", + "defaultNewPageName": "Untitled", "renameDialog": "Rename" }, "toolbar": { From 6f05d317e93849072a346b0b832db18e478ae08e Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 14 Dec 2021 12:52:20 +0800 Subject: [PATCH 3/5] Fix spelling --- shared-lib/flowy-derive/src/proto_buf/serialize.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-lib/flowy-derive/src/proto_buf/serialize.rs b/shared-lib/flowy-derive/src/proto_buf/serialize.rs index 9e838a5aa3..9a14034c18 100644 --- a/shared-lib/flowy-derive/src/proto_buf/serialize.rs +++ b/shared-lib/flowy-derive/src/proto_buf/serialize.rs @@ -109,7 +109,7 @@ fn gen_token_stream(ctxt: &Ctxt, member: &syn::Member, ty: &syn::Type, is_option } } -// e.g. pub cells: Vec, the memeber will be cells, ty would be Vec +// e.g. pub cells: Vec, the member will be cells, ty would be Vec fn token_stream_for_vec(ctxt: &Ctxt, member: &syn::Member, ty: &syn::Type) -> Option { let ty_info = parse_ty(ctxt, ty)?; match ident_category(ty_info.ident) { From 75f021744b0cebc5f55f08dccafc81dd0d5906f7 Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 14 Dec 2021 12:55:49 +0800 Subject: [PATCH 4/5] fix spelling --- .../stack_page/doc/widget/toolbar/color_picker.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/toolbar/color_picker.dart b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/toolbar/color_picker.dart index b103ae2fc2..da91a1d2cf 100644 --- a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/toolbar/color_picker.dart +++ b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/toolbar/color_picker.dart @@ -128,10 +128,10 @@ class _FlowyColorButtonState extends State { final style = widget.controller.getSelectionStyle(); final values = style.values.where((v) => v.key == Attribute.background.key).map((v) => v.value); - int initailColor = 0; + int initialColor = 0; if (values.isNotEmpty) { assert(values.length == 1); - initailColor = stringToHex(values.first); + initialColor = stringToHex(values.first); } StyledDialog( @@ -145,7 +145,7 @@ class _FlowyColorButtonState extends State { _changeColor(context, color); } }, - initailColor: initailColor, + initialColor: initialColor, ), ), ).show(context); @@ -168,8 +168,8 @@ class FlowyColorPicker extends StatefulWidget { 0xffdefff1, ]; final Function(Color?) onColorChanged; - final int initailColor; - FlowyColorPicker({Key? key, required this.onColorChanged, this.initailColor = 0}) : super(key: key); + final int initialColor; + FlowyColorPicker({Key? key, required this.onColorChanged, this.initialColor = 0}) : super(key: key); @override State createState() => _FlowyColorPickerState(); @@ -207,7 +207,7 @@ class _FlowyColorPickerState extends State { delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { if (widget.colors.length > index) { - final isSelected = widget.colors[index] == widget.initailColor; + final isSelected = widget.colors[index] == widget.initialColor; return ColorItem( color: Color(widget.colors[index]), onPressed: widget.onColorChanged, From 2e24ae65fd5430273aaf091dd01ecd56c459d7bf Mon Sep 17 00:00:00 2001 From: naughtz Date: Tue, 14 Dec 2021 17:34:11 +0800 Subject: [PATCH 5/5] build on windows 10 X86_64 verified --- doc/BUILD_ON_WINDOWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/BUILD_ON_WINDOWS.md b/doc/BUILD_ON_WINDOWS.md index 5ec1c2ebdb..9f99dd97e4 100644 --- a/doc/BUILD_ON_WINDOWS.md +++ b/doc/BUILD_ON_WINDOWS.md @@ -13,7 +13,7 @@ git clone https://github.com/AppFlowy-IO/appflowy.git Note: * Both Windows cmd and powershell can be used for running commands * Following steps are verified on - - [x] Windows 10 X86_64 + - [ ] Windows 10 X86_64 - [ ] Windows 10 arm64 - [ ] Windows 11 X86_64 - [ ] Windows 11 arm64