From 2d04f79e101fd9da9212f24f575b3ac0fab4d006 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 16 Aug 2022 16:11:46 +0800 Subject: [PATCH] chore: publish preparation --- .../flowy_editor/example/assets/example.json | 79 ++++--------------- .../src/render/rich_text/rich_text_style.dart | 4 +- .../src/render/selection/toolbar_widget.dart | 9 +-- .../packages/flowy_editor/pubspec.yaml | 1 + 4 files changed, 23 insertions(+), 70 deletions(-) diff --git a/frontend/app_flowy/packages/flowy_editor/example/assets/example.json b/frontend/app_flowy/packages/flowy_editor/example/assets/example.json index e6357d93f9..549cd4f765 100644 --- a/frontend/app_flowy/packages/flowy_editor/example/assets/example.json +++ b/frontend/app_flowy/packages/flowy_editor/example/assets/example.json @@ -6,7 +6,7 @@ { "type": "image", "attributes": { - "image_src": "https://s1.ax1x.com/2022/07/28/vCgz1x.png" + "image_src": "https://images.squarespace-cdn.com/content/v1/617f6f16b877c06711e87373/c3f23723-37f4-44d7-9c5d-6e2a53064ae7/Asset+10.png?format=500w" } }, { @@ -25,7 +25,7 @@ "type": "text", "delta": [ { - "insert": "👋 Welcome to Appflowy" + "insert": "👋 Welcome to FlowyEditor" } ], "attributes": { @@ -37,11 +37,16 @@ "type": "text", "delta": [ { - "insert": "At " + "insert": "We are still developing more features. Please give us a star if the " }, - { "insert": "AppFlowy", "attributes": { "code": true, "bold": true, "color": "0xFFED459C"} }, { - "insert": ", we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." + "insert": "FlowyEditor", + "attributes": { + "href": "https://github.com/AppFlowy-IO/AppFlowy" + } + }, + { + "insert": " helps you." } ] }, @@ -76,7 +81,7 @@ "attributes": { "backgroundColor": "0xFFFFFF00" } }, { - "insert": "to see all the types of content you can add - entity, headers, videos, sub pages, etc." + "insert": "to see all the types of content you can add - headers, bulleted lists, checkboxes, etc." } ] }, @@ -84,7 +89,11 @@ "type": "text", "delta": [ { - "insert": "Highlight any text, and use the menu that pops up to " + "insert": "Highlight", + "attributes": { "backgroundColor": "0xFF00BCFB" } + }, + { + "insert": " any text, and use the menu that pops up to " }, { "insert": "style", "attributes": { "bold": true } }, { "insert": " your ", "attributes": { "italic": true } }, @@ -245,62 +254,6 @@ "subtype": "number-list", "number": 3 } - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] - }, - { - "type": "text", - "delta": [ - { - "insert": "At AppFlowy, we embody what we value deep in our hearts, taking inspiration from other great companies while forging our own path. AppFlowy’s five core values are Mission Driven, Aim High & Iterate, Transparency, Collaboration, and Honesty. Together, they spell MATCH. We will continue to iterate and refine these values as we grow." - } - ] } ] } diff --git a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart index 31cbafc18b..178f5de5b8 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart @@ -2,6 +2,7 @@ import 'package:flowy_editor/src/document/attributes.dart'; import 'package:flowy_editor/src/document/node.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher_string.dart'; /// /// Supported partial rendering types: @@ -235,7 +236,6 @@ class RichTextStyle { var decorations = [TextDecoration.none]; if (attributes.underline || attributes.href != null) { decorations.add(TextDecoration.underline); - // TextDecoration.underline; } if (attributes.strikethrough) { decorations.add(TextDecoration.lineThrough); @@ -275,7 +275,7 @@ class RichTextStyle { if (href != null) { return TapGestureRecognizer() ..onTap = () async { - // FIXME: launch the url + await launchUrlString(href); }; } return null; diff --git a/frontend/app_flowy/packages/flowy_editor/lib/src/render/selection/toolbar_widget.dart b/frontend/app_flowy/packages/flowy_editor/lib/src/render/selection/toolbar_widget.dart index 2c9fb9ad93..5d6ae6bedf 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/src/render/selection/toolbar_widget.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/src/render/selection/toolbar_widget.dart @@ -15,7 +15,6 @@ ToolbarEventHandlers defaultToolbarEventHandlers = { 'strikethrough': (editorState) => formatStrikethrough(editorState), 'underline': (editorState) => formatUnderline(editorState), 'quote': (editorState) => formatQuote(editorState), - 'number_list': (editorState) {}, 'bulleted_list': (editorState) => formatBulletedList(editorState), 'Text': (editorState) => formatText(editorState), 'H1': (editorState) => formatHeading(editorState, StyleKey.h1), @@ -94,15 +93,15 @@ class _ToolbarWidgetState extends State with ToolbarMixin { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - _listToolbar(context), - _centerToolbarIcon('divider', width: 10), + // _listToolbar(context), + // _centerToolbarIcon('divider', width: 10), _centerToolbarIcon('bold'), _centerToolbarIcon('italic'), _centerToolbarIcon('strikethrough'), _centerToolbarIcon('underline'), - _centerToolbarIcon('divider', width: 10), + _centerToolbarIcon('divider', width: 2), _centerToolbarIcon('quote'), - _centerToolbarIcon('number_list'), + // _centerToolbarIcon('number_list'), _centerToolbarIcon('bulleted_list'), ], ), diff --git a/frontend/app_flowy/packages/flowy_editor/pubspec.yaml b/frontend/app_flowy/packages/flowy_editor/pubspec.yaml index 1f84c47ef6..948405701c 100644 --- a/frontend/app_flowy/packages/flowy_editor/pubspec.yaml +++ b/frontend/app_flowy/packages/flowy_editor/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: html: ^0.15.0 flutter_svg: ^1.1.1+1 provider: ^6.0.3 + url_launcher: ^6.1.5 dev_dependencies: flutter_test: