Quellcode durchsuchen

Merge branch 'feat/flowy_editor' into feat/flowy_editor

Lucas.Xu vor 2 Jahren
Ursprung
Commit
730c85a0da
23 geänderte Dateien mit 434 neuen und 42 gelöschten Zeilen
  1. 45 24
      frontend/app_flowy/packages/flowy_editor/example/assets/document.json
  2. 1 0
      frontend/app_flowy/packages/flowy_editor/example/ios/Flutter/Debug.xcconfig
  3. 1 0
      frontend/app_flowy/packages/flowy_editor/example/ios/Flutter/Release.xcconfig
  4. 41 0
      frontend/app_flowy/packages/flowy_editor/example/ios/Podfile
  5. 3 1
      frontend/app_flowy/packages/flowy_editor/example/lib/main.dart
  6. 1 11
      frontend/app_flowy/packages/flowy_editor/example/lib/plugin/image_node_widget.dart
  7. 77 4
      frontend/app_flowy/packages/flowy_editor/example/lib/plugin/text_node_widget.dart
  8. 45 0
      frontend/app_flowy/packages/flowy_editor/example/lib/plugin/text_with_heading_node_widget.dart
  9. 4 0
      frontend/app_flowy/packages/flowy_editor/example/linux/flutter/generated_plugin_registrant.cc
  10. 1 0
      frontend/app_flowy/packages/flowy_editor/example/linux/flutter/generated_plugins.cmake
  11. 1 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/Flutter-Debug.xcconfig
  12. 1 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/Flutter-Release.xcconfig
  13. 2 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/GeneratedPluginRegistrant.swift
  14. 40 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Podfile
  15. 22 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Podfile.lock
  16. 61 1
      frontend/app_flowy/packages/flowy_editor/example/macos/Runner.xcodeproj/project.pbxproj
  17. 3 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Runner.xcworkspace/contents.xcworkspacedata
  18. 2 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Runner/DebugProfile.entitlements
  19. 2 0
      frontend/app_flowy/packages/flowy_editor/example/macos/Runner/Release.entitlements
  20. 76 1
      frontend/app_flowy/packages/flowy_editor/example/pubspec.lock
  21. 1 0
      frontend/app_flowy/packages/flowy_editor/example/pubspec.yaml
  22. 3 0
      frontend/app_flowy/packages/flowy_editor/example/windows/flutter/generated_plugin_registrant.cc
  23. 1 0
      frontend/app_flowy/packages/flowy_editor/example/windows/flutter/generated_plugins.cmake

+ 45 - 24
frontend/app_flowy/packages/flowy_editor/example/assets/document.json

@@ -3,53 +3,74 @@
       "type": "editor",
       "attributes": {},
       "children": [
+        {
+          "type": "image",
+          "attributes": {
+            "image_src": "https://images.squarespace-cdn.com/content/v1/617f6f16b877c06711e87373/c3f23723-37f4-44d7-9c5d-6e2a53064ae7/Asset+10.png?format=1500w"
+          }
+        },
         {
           "type": "text",
           "delta": [
-            { "insert": "With " },
-            { "insert": "AppFlowy", "attributes": { "href": "https://www.appflowy.io/" } },
-            { "insert": ", you can build detailed lists of to-do’s for different projects while tracking the status of each one" }
+            { "insert": "👋 Welcome to AppFlowy!", "attributes": { "href": "https://www.appflowy.io/", "heading": "h1" } }
           ],
           "attributes": {
-            "subtype": "with-checkbox",
-            "font-size": 30,
-            "checkbox": false
+            "subtype": "with-heading",
+            "heading": "h1"
           }
         },
         {
           "type": "text",
           "delta": [
-            { "insert": "You can " },
-            { "insert": "host", "attributes": { "italic": true } },
-            { "insert": " " },
-            { "insert": "AppFlowy", "attributes": { "bold": true } },
-            { "insert": " " },
-            { "insert": "wherever you want", "attributes": { "underline": true }},
-            { "insert": "; no vendor lock-in." }
+            { "insert": "Here are the basics", "attributes": { "heading": "h2" } }
+          ],
+          "attributes": { 
+            "subtype": "with-heading",
+            "heading": "h2" 
+          }
+        },
+        {
+          "type": "text",
+          "delta": [
+            { "insert": "Click anywhere and just start typing." }
           ],
           "attributes": {
             "subtype": "with-checkbox",
-            "text-type": "heading1",
-            "font-size": 30,
-            "checkbox": false
+            "checkbox": true
           }
         },
         {
           "type": "text",
-          "delta": [{ "insert": "Design and modify AppFlowy your way with an open core codebase." }],
+          "delta": [
+            { "insert": "Highlight", "attributes": { "highlight": "0xFFFFFF00" } },
+            { "insert": " Click anywhere and just start typing" },
+            { "insert": " any text, and use the menu at the bottom to " },
+            { "insert": "style", "attributes": { "italic": true } },
+            { "insert": " your ", "attributes": { "bold": true } },
+            { "insert": "writing", "attributes": { "underline": true } },
+            { "insert": " howeverv you like.", "attributes": { "strikethrough": true } }
+          ],
           "attributes": {
-            "text-type": "heading1",
-            "font-size": 30
+            "subtype": "with-checkbox",
+            "checkbox": false
           }
         },
         {
           "type": "text",
-          "delta": [{ "insert": "AppFlowy is built with Flutter and Rust. What does this mean? Faster development, better native experience, and more reliable performance." }],
-          "attributes": {
-            "text-type": "heading1",
-            "font-size": 30,
-            "content": "dddddddddddddddddddd"
+          "delta": [
+            { "insert": "Have a question? ", "attributes": { "heading": "h2" } }
+          ],
+          "attributes": { 
+            "subtype": "with-heading",
+            "heading": "h2"
           }
+        },
+        {
+          "type": "text",
+          "delta": [
+            { "insert": "Click the '?' at the bottom right for help and support."}
+          ],
+          "attributes": {}
         }
       ]
     }

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/ios/Flutter/Debug.xcconfig

@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
 #include "Generated.xcconfig"

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/ios/Flutter/Release.xcconfig

@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
 #include "Generated.xcconfig"

+ 41 - 0
frontend/app_flowy/packages/flowy_editor/example/ios/Podfile

@@ -0,0 +1,41 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, '9.0'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+  'Debug' => :debug,
+  'Profile' => :release,
+  'Release' => :release,
+}
+
+def flutter_root
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+  unless File.exist?(generated_xcode_build_settings_path)
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+  end
+
+  File.foreach(generated_xcode_build_settings_path) do |line|
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
+    return matches[1].strip if matches
+  end
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
+target 'Runner' do
+  use_frameworks!
+  use_modular_headers!
+
+  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+end
+
+post_install do |installer|
+  installer.pods_project.targets.each do |target|
+    flutter_additional_ios_build_settings(target)
+  end
+end

+ 3 - 1
frontend/app_flowy/packages/flowy_editor/example/lib/main.dart

@@ -1,6 +1,7 @@
 import 'dart:convert';
 
 import 'package:example/plugin/document_node_widget.dart';
+import 'package:example/plugin/text_with_heading_node_widget.dart';
 import 'package:example/plugin/image_node_widget.dart';
 import 'package:example/plugin/text_node_widget.dart';
 import 'package:example/plugin/text_with_check_box_node_widget.dart';
@@ -66,7 +67,8 @@ class _MyHomePageState extends State<MyHomePage> {
       ..register('editor', EditorNodeWidgetBuilder.create)
       ..register('text', TextNodeBuilder.create)
       ..register('image', ImageNodeBuilder.create)
-      ..register('text/with-checkbox', TextWithCheckBoxNodeBuilder.create);
+      ..register('text/with-checkbox', TextWithCheckBoxNodeBuilder.create)
+      ..register('text/with-heading', TextWithHeadingNodeBuilder.create);
   }
 
   @override

+ 1 - 11
frontend/app_flowy/packages/flowy_editor/example/lib/plugin/image_node_widget.dart

@@ -30,17 +30,7 @@ class _ImageNodeWidget extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    return GestureDetector(
-      child: _build(context),
-      onTap: () {
-        TransactionBuilder(editorState)
-          ..updateNode(node, {
-            'image_src':
-                "https://images.pexels.com/photos/9995076/pexels-photo-9995076.png?cs=srgb&dl=pexels-temmuz-uzun-9995076.jpg&fm=jpg&w=640&h=400"
-          })
-          ..commit();
-      },
-    );
+    return _build(context);
   }
 
   Widget _build(BuildContext context) {

+ 77 - 4
frontend/app_flowy/packages/flowy_editor/example/lib/plugin/text_node_widget.dart

@@ -5,7 +5,7 @@ import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:flowy_editor/flowy_editor.dart';
 import 'package:flutter/services.dart';
-import 'package:flowy_editor/document/attributes.dart';
+import 'package:url_launcher/url_launcher_string.dart';
 
 class TextNodeBuilder extends NodeWidgetBuilder {
   TextNodeBuilder.create({
@@ -17,8 +17,6 @@ class TextNodeBuilder extends NodeWidgetBuilder {
     });
   }
 
-  String get content => node.attributes['content'] as String;
-
   @override
   Widget build(BuildContext buildContext) {
     return _TextNodeWidget(node: node, editorState: editorState);
@@ -146,6 +144,10 @@ class __TextNodeWidgetState extends State<_TextNodeWidget>
   TextNode get node => widget.node as TextNode;
   EditorState get editorState => widget.editorState;
 
+  TextEditingValue get textEditingValue => TextEditingValue(
+        text: node.toRawString(),
+      );
+
   TextInputConnection? _textInputConnection;
 
   _backDeleteTextAtSelection(TextSelection? sel) {
@@ -249,7 +251,10 @@ class __TextNodeWidgetState extends State<_TextNodeWidget>
                 editorState: editorState,
               ),
             ),
-          )
+          ),
+        const SizedBox(
+          height: 10,
+        ),
       ],
     );
   }
@@ -327,3 +332,71 @@ class __TextNodeWidgetState extends State<_TextNodeWidget>
     // TODO: implement updateFloatingCursor
   }
 }
+
+extension on TextNode {
+  List<TextSpan> toTextSpans() => delta.operations
+      .whereType<TextInsert>()
+      .map((op) => _textInsertToTextSpan(op))
+      .toList();
+
+  String toRawString() => delta.operations
+      .whereType<TextInsert>()
+      .map((op) => op.content)
+      .toString();
+}
+
+TextSpan _textInsertToTextSpan(TextInsert textInsert) {
+  FontWeight? fontWeight;
+  FontStyle? fontStyle;
+  TextDecoration? decoration;
+  GestureRecognizer? gestureRecognizer;
+  Color? color;
+  Color highLightColor = Colors.transparent;
+  double fontSize = 16.0;
+  final attributes = textInsert.attributes;
+  if (attributes?['bold'] == true) {
+    fontWeight = FontWeight.bold;
+  }
+  if (attributes?['italic'] == true) {
+    fontStyle = FontStyle.italic;
+  }
+  if (attributes?['underline'] == true) {
+    decoration = TextDecoration.underline;
+  }
+  if (attributes?['strikethrough'] == true) {
+    decoration = TextDecoration.lineThrough;
+  }
+  if (attributes?['highlight'] is String) {
+    highLightColor = Color(int.parse(attributes!['highlight']));
+  }
+  if (attributes?['href'] is String) {
+    color = const Color.fromARGB(255, 55, 120, 245);
+    decoration = TextDecoration.underline;
+    gestureRecognizer = TapGestureRecognizer()
+      ..onTap = () {
+        launchUrlString(attributes?['href']);
+      };
+  }
+  final heading = attributes?['heading'] as String?;
+  if (heading != null) {
+    // TODO: make it better
+    if (heading == 'h1') {
+      fontSize = 30.0;
+    } else if (heading == 'h2') {
+      fontSize = 20.0;
+    }
+    fontWeight = FontWeight.bold;
+  }
+  return TextSpan(
+    text: textInsert.content,
+    style: TextStyle(
+      fontWeight: fontWeight,
+      fontStyle: fontStyle,
+      decoration: decoration,
+      color: color,
+      fontSize: fontSize,
+      backgroundColor: highLightColor,
+    ),
+    recognizer: gestureRecognizer,
+  );
+}

+ 45 - 0
frontend/app_flowy/packages/flowy_editor/example/lib/plugin/text_with_heading_node_widget.dart

@@ -0,0 +1,45 @@
+import 'package:flowy_editor/flowy_editor.dart';
+import 'package:flutter/material.dart';
+
+class TextWithHeadingNodeBuilder extends NodeWidgetBuilder {
+  TextWithHeadingNodeBuilder.create({
+    required super.editorState,
+    required super.node,
+  }) : super.create() {
+    nodeValidator = (node) => node.attributes.containsKey('heading');
+  }
+
+  String get heading => node.attributes['heading'] as String;
+  Widget buildPadding() {
+    if (heading == 'h1') {
+      return const Padding(
+        padding: EdgeInsets.only(top: 10),
+      );
+    } else if (heading == 'h1') {
+      return const Padding(
+        padding: EdgeInsets.only(top: 10),
+      );
+    }
+    return const Padding(
+      padding: EdgeInsets.only(top: 0),
+    );
+  }
+
+  @override
+  Widget build(BuildContext buildContext) {
+    return Column(
+      children: [
+        buildPadding(),
+        renderPlugins.buildWidget(
+          context: NodeWidgetContext(
+            buildContext: buildContext,
+            node: node,
+            editorState: editorState,
+          ),
+          withSubtype: false,
+        ),
+        buildPadding(),
+      ],
+    );
+  }
+}

+ 4 - 0
frontend/app_flowy/packages/flowy_editor/example/linux/flutter/generated_plugin_registrant.cc

@@ -6,6 +6,10 @@
 
 #include "generated_plugin_registrant.h"
 
+#include <url_launcher_linux/url_launcher_plugin.h>
 
 void fl_register_plugins(FlPluginRegistry* registry) {
+  g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
+      fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
+  url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
 }

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/linux/flutter/generated_plugins.cmake

@@ -3,6 +3,7 @@
 #
 
 list(APPEND FLUTTER_PLUGIN_LIST
+  url_launcher_linux
 )
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/Flutter-Debug.xcconfig

@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
 #include "ephemeral/Flutter-Generated.xcconfig"

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/Flutter-Release.xcconfig

@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
 #include "ephemeral/Flutter-Generated.xcconfig"

+ 2 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Flutter/GeneratedPluginRegistrant.swift

@@ -5,6 +5,8 @@
 import FlutterMacOS
 import Foundation
 
+import url_launcher_macos
 
 func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
+  UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
 }

+ 40 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Podfile

@@ -0,0 +1,40 @@
+platform :osx, '10.11'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+  'Debug' => :debug,
+  'Profile' => :release,
+  'Release' => :release,
+}
+
+def flutter_root
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
+  unless File.exist?(generated_xcode_build_settings_path)
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
+  end
+
+  File.foreach(generated_xcode_build_settings_path) do |line|
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
+    return matches[1].strip if matches
+  end
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_macos_podfile_setup
+
+target 'Runner' do
+  use_frameworks!
+  use_modular_headers!
+
+  flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+end
+
+post_install do |installer|
+  installer.pods_project.targets.each do |target|
+    flutter_additional_macos_build_settings(target)
+  end
+end

+ 22 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Podfile.lock

@@ -0,0 +1,22 @@
+PODS:
+  - FlutterMacOS (1.0.0)
+  - url_launcher_macos (0.0.1):
+    - FlutterMacOS
+
+DEPENDENCIES:
+  - FlutterMacOS (from `Flutter/ephemeral`)
+  - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
+
+EXTERNAL SOURCES:
+  FlutterMacOS:
+    :path: Flutter/ephemeral
+  url_launcher_macos:
+    :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
+
+SPEC CHECKSUMS:
+  FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
+  url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
+
+PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
+
+COCOAPODS: 1.11.3

+ 61 - 1
frontend/app_flowy/packages/flowy_editor/example/macos/Runner.xcodeproj/project.pbxproj

@@ -26,6 +26,7 @@
 		33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
 		33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
 		33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
+		8FD791997F0D60CE136153FB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F21284F13DB2F7E10C6EB1F7 /* Pods_Runner.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -54,7 +55,7 @@
 /* Begin PBXFileReference section */
 		333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
 		335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
-		33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
 		33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -66,8 +67,12 @@
 		33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
 		33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
 		33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
+		4C1351C0AA74138239028404 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
+		BBAF6135AB8D71FE6D8B315C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
+		BE3A038D8FDF07F3AD1C02FB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
+		F21284F13DB2F7E10C6EB1F7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -75,6 +80,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				8FD791997F0D60CE136153FB /* Pods_Runner.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -99,6 +105,7 @@
 				33CEB47122A05771004F2AC0 /* Flutter */,
 				33CC10EE2044A3C60003C045 /* Products */,
 				D73912EC22F37F3D000D13A0 /* Frameworks */,
+				7B5E3B15415D0C17244EF9E7 /* Pods */,
 			);
 			sourceTree = "<group>";
 		};
@@ -145,9 +152,21 @@
 			path = Runner;
 			sourceTree = "<group>";
 		};
+		7B5E3B15415D0C17244EF9E7 /* Pods */ = {
+			isa = PBXGroup;
+			children = (
+				BBAF6135AB8D71FE6D8B315C /* Pods-Runner.debug.xcconfig */,
+				4C1351C0AA74138239028404 /* Pods-Runner.release.xcconfig */,
+				BE3A038D8FDF07F3AD1C02FB /* Pods-Runner.profile.xcconfig */,
+			);
+			name = Pods;
+			path = Pods;
+			sourceTree = "<group>";
+		};
 		D73912EC22F37F3D000D13A0 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				F21284F13DB2F7E10C6EB1F7 /* Pods_Runner.framework */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";
@@ -159,11 +178,13 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
 			buildPhases = (
+				87BB3D0057F20B3618A17B82 /* [CP] Check Pods Manifest.lock */,
 				33CC10E92044A3C60003C045 /* Sources */,
 				33CC10EA2044A3C60003C045 /* Frameworks */,
 				33CC10EB2044A3C60003C045 /* Resources */,
 				33CC110E2044A8840003C045 /* Bundle Framework */,
 				3399D490228B24CF009A79C7 /* ShellScript */,
+				09CDF3F9864A27F94DEE8EC6 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -233,6 +254,23 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
+		09CDF3F9864A27F94DEE8EC6 /* [CP] Embed Pods Frameworks */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+			);
+			name = "[CP] Embed Pods Frameworks";
+			outputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+			showEnvVarsInLog = 0;
+		};
 		3399D490228B24CF009A79C7 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -270,6 +308,28 @@
 			shellPath = /bin/sh;
 			shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
 		};
+		87BB3D0057F20B3618A17B82 /* [CP] Check Pods Manifest.lock */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			showEnvVarsInLog = 0;
+		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */

+ 3 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Runner.xcworkspace/contents.xcworkspacedata

@@ -4,4 +4,7 @@
    <FileRef
       location = "group:Runner.xcodeproj">
    </FileRef>
+   <FileRef
+      location = "group:Pods/Pods.xcodeproj">
+   </FileRef>
 </Workspace>

+ 2 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Runner/DebugProfile.entitlements

@@ -8,5 +8,7 @@
 	<true/>
 	<key>com.apple.security.network.server</key>
 	<true/>
+	<key>com.apple.security.network.client</key>
+    <true/>
 </dict>
 </plist>

+ 2 - 0
frontend/app_flowy/packages/flowy_editor/example/macos/Runner/Release.entitlements

@@ -4,5 +4,7 @@
 <dict>
 	<key>com.apple.security.app-sandbox</key>
 	<true/>
+	<key>com.apple.security.network.client</key>
+    <true/>
 </dict>
 </plist>

+ 76 - 1
frontend/app_flowy/packages/flowy_editor/example/pubspec.lock

@@ -81,6 +81,18 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_web_plugins:
+    dependency: transitive
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  js:
+    dependency: transitive
+    description:
+      name: js
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.6.4"
   lints:
     dependency: transitive
     description:
@@ -123,6 +135,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.8.1"
+  plugin_platform_interface:
+    dependency: transitive
+    description:
+      name: plugin_platform_interface
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.1.2"
   provider:
     dependency: "direct main"
     description:
@@ -177,6 +196,62 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "0.4.9"
+  url_launcher:
+    dependency: "direct main"
+    description:
+      name: url_launcher
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "6.1.5"
+  url_launcher_android:
+    dependency: transitive
+    description:
+      name: url_launcher_android
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "6.0.17"
+  url_launcher_ios:
+    dependency: transitive
+    description:
+      name: url_launcher_ios
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "6.0.17"
+  url_launcher_linux:
+    dependency: transitive
+    description:
+      name: url_launcher_linux
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "3.0.1"
+  url_launcher_macos:
+    dependency: transitive
+    description:
+      name: url_launcher_macos
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "3.0.1"
+  url_launcher_platform_interface:
+    dependency: transitive
+    description:
+      name: url_launcher_platform_interface
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.1.0"
+  url_launcher_web:
+    dependency: transitive
+    description:
+      name: url_launcher_web
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.0.12"
+  url_launcher_windows:
+    dependency: transitive
+    description:
+      name: url_launcher_windows
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "3.0.1"
   vector_math:
     dependency: transitive
     description:
@@ -186,4 +261,4 @@ packages:
     version: "2.1.2"
 sdks:
   dart: ">=2.17.0 <3.0.0"
-  flutter: ">=1.17.0"
+  flutter: ">=2.10.0"

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/pubspec.yaml

@@ -37,6 +37,7 @@ dependencies:
   flowy_editor:
     path: ../
   provider: ^6.0.3
+  url_launcher: ^6.1.5
 
 dev_dependencies:
   flutter_test:

+ 3 - 0
frontend/app_flowy/packages/flowy_editor/example/windows/flutter/generated_plugin_registrant.cc

@@ -6,6 +6,9 @@
 
 #include "generated_plugin_registrant.h"
 
+#include <url_launcher_windows/url_launcher_windows.h>
 
 void RegisterPlugins(flutter::PluginRegistry* registry) {
+  UrlLauncherWindowsRegisterWithRegistrar(
+      registry->GetRegistrarForPlugin("UrlLauncherWindows"));
 }

+ 1 - 0
frontend/app_flowy/packages/flowy_editor/example/windows/flutter/generated_plugins.cmake

@@ -3,6 +3,7 @@
 #
 
 list(APPEND FLUTTER_PLUGIN_LIST
+  url_launcher_windows
 )
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST