├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android-rn ├── README.md ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactlibrary │ ├── MiniAppEnginesModule.java │ └── MiniAppEnginesPackage.java ├── build.android.js ├── build.ios.js ├── docs └── images │ ├── rax.jpeg │ ├── react.jpeg │ └── vue.jpeg ├── index.js ├── ios-rn ├── MiniAppEngines.h ├── MiniAppEngines.m ├── MiniAppEngines.xcodeproj │ └── project.pbxproj ├── MiniAppEngines.xcworkspace │ └── contents.xcworkspacedata ├── Podspecs │ ├── MiniAppEngines-Debug.podspec │ ├── MiniAppEngines-Profile.podspec │ ├── MiniAppEngines-Release.podspec │ └── common.rb └── pods.rb ├── lib └── main.dart ├── mini-app-engines.podspec ├── package.json ├── packages ├── README.md └── webf-0.12.0+1 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── jniLibs │ │ ├── arm64-v8a │ │ │ ├── libc++_shared.so │ │ │ ├── libquickjs.so │ │ │ └── libwebf.so │ │ ├── armeabi-v7a │ │ │ ├── libc++_shared.so │ │ │ ├── libquickjs.so │ │ │ └── libwebf.so │ │ └── x86 │ │ │ ├── libc++_shared.so │ │ │ ├── libquickjs.so │ │ │ └── libwebf.so │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── openwebf │ │ └── webf │ │ ├── WebF.java │ │ └── WebFPlugin.java │ ├── example │ ├── README.md │ ├── android │ │ ├── app │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ ├── com │ │ │ │ │ └── openwebf │ │ │ │ │ │ └── webf_example │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── io │ │ │ │ │ └── flutter │ │ │ │ │ └── plugins │ │ │ │ │ └── GeneratedPluginRegistrant.java │ │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ └── settings.gradle │ ├── assets │ │ ├── bundle.html │ │ ├── bundle.js │ │ ├── bundle.kbc1 │ │ ├── defineA.js │ │ ├── defineB.js │ │ └── kraken.png │ ├── fonts │ │ ├── Alibaba-PuHuiTi-Bold.ttf │ │ ├── Alibaba-PuHuiTi-Heavy.ttf │ │ ├── Alibaba-PuHuiTi-Light.ttf │ │ ├── Alibaba-PuHuiTi-Medium.ttf │ │ ├── Alibaba-PuHuiTi-Regular.ttf │ │ ├── AlibabaSans-Black.otf │ │ ├── AlibabaSans-Bold.otf │ │ ├── AlibabaSans-BoldItalic.otf │ │ ├── AlibabaSans-Heavy.otf │ │ ├── AlibabaSans-HeavyItalic.otf │ │ ├── AlibabaSans-Italic.otf │ │ ├── AlibabaSans-Light.otf │ │ ├── AlibabaSans-LightItalic.otf │ │ ├── AlibabaSans-Medium.otf │ │ ├── AlibabaSans-MediumItalic.otf │ │ └── AlibabaSans-Regular.otf │ ├── ios │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ ├── Generated.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── flutter_export_environment.sh │ │ ├── Podfile │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── Runner │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ └── LaunchImage.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ └── README.md │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── GeneratedPluginRegistrant.h │ │ │ ├── GeneratedPluginRegistrant.m │ │ │ ├── Info.plist │ │ │ ├── Runner-Bridging-Header.h │ │ │ └── main.m │ ├── lib │ │ └── main.dart │ ├── linux │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ │ ├── CMakeLists.txt │ │ │ ├── ephemeral │ │ │ │ └── .plugin_symlinks │ │ │ │ │ ├── connectivity_plus_linux │ │ │ │ │ ├── path_provider_linux │ │ │ │ │ ├── shared_preferences_linux │ │ │ │ │ └── webf │ │ │ ├── generated_plugin_registrant.cc │ │ │ ├── generated_plugin_registrant.h │ │ │ └── generated_plugins.cmake │ │ ├── main.cc │ │ ├── my_application.cc │ │ └── my_application.h │ ├── macos │ │ ├── Flutter │ │ │ ├── Flutter-Debug.xcconfig │ │ │ ├── Flutter-Release.xcconfig │ │ │ ├── GeneratedPluginRegistrant.swift │ │ │ └── ephemeral │ │ │ │ ├── Flutter-Generated.xcconfig │ │ │ │ └── flutter_export_environment.sh │ │ ├── Podfile │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── app_icon_64.png │ │ │ ├── Base.lproj │ │ │ └── MainMenu.xib │ │ │ ├── Configs │ │ │ ├── AppInfo.xcconfig │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── Warnings.xcconfig │ │ │ ├── DebugProfile.entitlements │ │ │ ├── Info.plist │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Release.entitlements │ ├── pubspec.lock │ └── pubspec.yaml │ ├── include │ ├── dart_methods.h │ ├── webf_bridge.h │ └── webf_foundation.h │ ├── ios │ ├── Classes │ │ ├── WebF.h │ │ ├── WebF.m │ │ ├── WebFPlugin.h │ │ └── WebFPlugin.m │ ├── prepare.sh │ ├── quickjs.xcframework │ │ ├── Info.plist │ │ ├── ios-arm64_armv7_armv7s │ │ │ └── quickjs.framework │ │ │ │ ├── Headers │ │ │ │ └── cutils.h │ │ │ │ ├── Info.plist │ │ │ │ └── quickjs │ │ └── ios-x86_64-simulator │ │ │ └── quickjs.framework │ │ │ ├── Headers │ │ │ └── cutils.h │ │ │ ├── Info.plist │ │ │ └── quickjs │ ├── webf.podspec │ └── webf_bridge.xcframework │ │ ├── Info.plist │ │ ├── ios-arm64_armv7_armv7s │ │ └── webf_bridge.framework │ │ │ ├── Headers │ │ │ └── webf_bridge.h │ │ │ ├── Info.plist │ │ │ └── webf_bridge │ │ └── ios-x86_64-simulator │ │ └── webf_bridge.framework │ │ ├── Headers │ │ └── webf_bridge.h │ │ ├── Info.plist │ │ └── webf_bridge │ ├── lib │ ├── bridge.dart │ ├── cli.dart │ ├── css.dart │ ├── devtools.dart │ ├── dom.dart │ ├── foundation.dart │ ├── gesture.dart │ ├── launcher.dart │ ├── module.dart │ ├── painting.dart │ ├── rendering.dart │ ├── scheduler.dart │ ├── src │ │ ├── bridge │ │ │ ├── binding.dart │ │ │ ├── bridge.dart │ │ │ ├── dynamic_library.dart │ │ │ ├── from_native.dart │ │ │ ├── native_types.dart │ │ │ ├── native_value.dart │ │ │ └── to_native.dart │ │ ├── css │ │ │ ├── animation.dart │ │ │ ├── background.dart │ │ │ ├── border.dart │ │ │ ├── border_radius.dart │ │ │ ├── box.dart │ │ │ ├── box_shadow.dart │ │ │ ├── content_visibility.dart │ │ │ ├── display.dart │ │ │ ├── filter.dart │ │ │ ├── flexbox.dart │ │ │ ├── gradient.dart │ │ │ ├── inline.dart │ │ │ ├── keywords.dart │ │ │ ├── margin.dart │ │ │ ├── matrix.dart │ │ │ ├── object_fit.dart │ │ │ ├── object_position.dart │ │ │ ├── opacity.dart │ │ │ ├── origin.dart │ │ │ ├── overflow.dart │ │ │ ├── padding.dart │ │ │ ├── parser │ │ │ │ ├── parser.dart │ │ │ │ ├── style_rule_parser.dart │ │ │ │ └── style_sheet_parser.dart │ │ │ ├── position.dart │ │ │ ├── positioned.dart │ │ │ ├── render_style.dart │ │ │ ├── rule.dart │ │ │ ├── sizing.dart │ │ │ ├── sliver.dart │ │ │ ├── style_declaration.dart │ │ │ ├── style_property.dart │ │ │ ├── style_rule.dart │ │ │ ├── style_sheet.dart │ │ │ ├── text.dart │ │ │ ├── transform.dart │ │ │ ├── transition.dart │ │ │ ├── value.dart │ │ │ ├── values │ │ │ │ ├── angle.dart │ │ │ │ ├── color.dart │ │ │ │ ├── function.dart │ │ │ │ ├── integer.dart │ │ │ │ ├── length.dart │ │ │ │ ├── number.dart │ │ │ │ ├── percentage.dart │ │ │ │ ├── position.dart │ │ │ │ ├── textual.dart │ │ │ │ ├── time.dart │ │ │ │ └── variable.dart │ │ │ ├── variable.dart │ │ │ └── visibility.dart │ │ ├── devtools │ │ │ ├── inspector.dart │ │ │ ├── module.dart │ │ │ ├── modules │ │ │ │ ├── css.dart │ │ │ │ ├── debugger.dart │ │ │ │ ├── dom.dart │ │ │ │ ├── log.dart │ │ │ │ ├── network.dart │ │ │ │ ├── overlay.dart │ │ │ │ ├── page.dart │ │ │ │ ├── profiler.dart │ │ │ │ └── runtime.dart │ │ │ ├── overlay.dart │ │ │ ├── server.dart │ │ │ └── service.dart │ │ ├── dom │ │ │ ├── binding.dart │ │ │ ├── bounding_client_rect.dart │ │ │ ├── comment.dart │ │ │ ├── document.dart │ │ │ ├── document_fragment.dart │ │ │ ├── element.dart │ │ │ ├── element_inspector.dart │ │ │ ├── element_registry.dart │ │ │ ├── elements │ │ │ │ ├── a.dart │ │ │ │ ├── body.dart │ │ │ │ ├── canvas │ │ │ │ │ ├── canvas.dart │ │ │ │ │ ├── canvas_context.dart │ │ │ │ │ ├── canvas_context_2d.dart │ │ │ │ │ ├── canvas_painter.dart │ │ │ │ │ └── canvas_path_2d.dart │ │ │ │ ├── edits.dart │ │ │ │ ├── forms.dart │ │ │ │ ├── grouping_content.dart │ │ │ │ ├── head.dart │ │ │ │ ├── headings.dart │ │ │ │ ├── html.dart │ │ │ │ ├── img.dart │ │ │ │ ├── input.dart │ │ │ │ ├── object.dart │ │ │ │ ├── script.dart │ │ │ │ ├── sections.dart │ │ │ │ ├── semantics_text.dart │ │ │ │ ├── template.dart │ │ │ │ ├── text_form_control.dart │ │ │ │ └── textarea.dart │ │ │ ├── event.dart │ │ │ ├── event_target.dart │ │ │ ├── node.dart │ │ │ ├── object_element_client.dart │ │ │ ├── screen.dart │ │ │ ├── sliver_manager.dart │ │ │ ├── text_node.dart │ │ │ └── window.dart │ │ ├── foundation │ │ │ ├── binding.dart │ │ │ ├── bundle.dart │ │ │ ├── convert.dart │ │ │ ├── environment.dart │ │ │ ├── http_cache.dart │ │ │ ├── http_cache_object.dart │ │ │ ├── http_client.dart │ │ │ ├── http_client_interceptor.dart │ │ │ ├── http_client_request.dart │ │ │ ├── http_client_response.dart │ │ │ ├── http_overrides.dart │ │ │ ├── queue.dart │ │ │ ├── type.dart │ │ │ └── uri_parser.dart │ │ ├── gesture │ │ │ ├── gesture_detector.dart │ │ │ ├── gesture_dispatcher.dart │ │ │ ├── monodrag.dart │ │ │ ├── scroll_activity.dart │ │ │ ├── scroll_context.dart │ │ │ ├── scroll_metrics.dart │ │ │ ├── scroll_physics.dart │ │ │ ├── scroll_position.dart │ │ │ ├── scroll_position_with_single_context.dart │ │ │ ├── scroll_simulation.dart │ │ │ ├── scrollable.dart │ │ │ └── swipe.dart │ │ ├── launcher │ │ │ ├── controller.dart │ │ │ └── launcher.dart │ │ ├── module │ │ │ ├── async_storage.dart │ │ │ ├── clipboard.dart │ │ │ ├── connection.dart │ │ │ ├── fetch.dart │ │ │ ├── history.dart │ │ │ ├── location.dart │ │ │ ├── method_channel.dart │ │ │ ├── module_manager.dart │ │ │ ├── navigation.dart │ │ │ ├── navigator.dart │ │ │ ├── performance_timing.dart │ │ │ ├── schedule_frame.dart │ │ │ └── timer.dart │ │ ├── painting │ │ │ ├── box_fit_image.dart │ │ │ ├── cached_network_image.dart │ │ │ └── image_provider_factory.dart │ │ ├── rendering │ │ │ ├── box_decoration.dart │ │ │ ├── box_decoration_painter.dart │ │ │ ├── box_model.dart │ │ │ ├── content_visibility.dart │ │ │ ├── debug_overlay.dart │ │ │ ├── event.dart │ │ │ ├── fallback_view.dart │ │ │ ├── flex.dart │ │ │ ├── flow.dart │ │ │ ├── image.dart │ │ │ ├── intersection_observer.dart │ │ │ ├── line_break.dart │ │ │ ├── opacity.dart │ │ │ ├── overflow.dart │ │ │ ├── paragraph.dart │ │ │ ├── preferred_size.dart │ │ │ ├── replaced.dart │ │ │ ├── sliver_list.dart │ │ │ ├── text.dart │ │ │ ├── text_control.dart │ │ │ ├── transform.dart │ │ │ └── viewport.dart │ │ ├── scheduler │ │ │ ├── fps.dart │ │ │ └── throttle.dart │ │ └── widget │ │ │ ├── element_to_widget_adaptor.dart │ │ │ ├── text_control.dart │ │ │ ├── webf.dart │ │ │ └── widget_to_element_adaptor.dart │ ├── webf.dart │ └── widget.dart │ ├── linux │ ├── CMakeLists.txt │ ├── include │ │ └── webf │ │ │ └── webf_plugin.h │ ├── libquickjs.so │ ├── libwebf.so │ └── webf_plugin.cc │ ├── macos │ ├── Classes │ │ ├── WebF.h │ │ ├── WebF.m │ │ ├── WebFPlugin.h │ │ └── WebFPlugin.m │ ├── libquickjs.dylib │ ├── libwebf.dylib │ ├── prepare.sh │ └── webf.podspec │ ├── pubspec.lock │ ├── pubspec.yaml │ └── test │ ├── fixtures │ ├── GET_301 │ ├── GET_js_gzipped │ ├── GET_js_over_128k │ ├── GET_json_with_content_length │ ├── GET_json_with_content_length_expires_etag_last_modified │ ├── GET_plain_text_with_content_length_and_last_modified │ ├── GET_plain_text_with_current_time_last_modified │ ├── GET_plain_text_with_etag_and_content_length │ └── POST_plain_text │ ├── local_http_server.dart │ ├── src │ ├── css │ │ ├── style_rule_parser.dart │ │ ├── style_sheet_parser.dart │ │ └── values.dart │ ├── foundation │ │ ├── bundle.dart │ │ ├── convert.dart │ │ ├── environment.dart │ │ ├── http_cache.dart │ │ ├── http_client.dart │ │ ├── http_client_interceptor.dart │ │ └── uri_parser.dart │ ├── gesture │ │ └── scroll_physics.dart │ └── module │ │ └── fetch.dart │ └── webf_test.dart ├── pubspec.lock ├── pubspec.yaml ├── react-native.config.js ├── test └── widget_test.dart └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | .idea/ 8 | .vagrant/ 9 | .sconsign.dblite 10 | .svn/ 11 | 12 | *.swp 13 | profile 14 | 15 | DerivedData/ 16 | 17 | .generated/ 18 | 19 | *.pbxuser 20 | *.mode1v3 21 | *.mode2v3 22 | *.perspectivev3 23 | 24 | !default.pbxuser 25 | !default.mode1v3 26 | !default.mode2v3 27 | !default.perspectivev3 28 | 29 | xcuserdata 30 | 31 | *.moved-aside 32 | 33 | *.pyc 34 | *sync/ 35 | Icon? 36 | .tags* 37 | 38 | build/ 39 | .android/ 40 | .ios/ 41 | .flutter-plugins 42 | .flutter-plugins-dependencies 43 | 44 | # Symbolication related 45 | app.*.symbols 46 | 47 | # Obfuscation related 48 | app.*.map.json 49 | 50 | # OSX 51 | # 52 | .DS_Store 53 | 54 | # node.js 55 | # 56 | node_modules/ 57 | npm-debug.log 58 | yarn-error.log 59 | 60 | # Xcode 61 | # 62 | build/ 63 | *.pbxuser 64 | !default.pbxuser 65 | *.mode1v3 66 | !default.mode1v3 67 | *.mode2v3 68 | !default.mode2v3 69 | *.perspectivev3 70 | !default.perspectivev3 71 | xcuserdata 72 | *.xccheckout 73 | *.moved-aside 74 | DerivedData 75 | *.hmap 76 | *.ipa 77 | *.xcuserstate 78 | project.xcworkspace 79 | 80 | # Android/IntelliJ 81 | # 82 | build/ 83 | .idea 84 | .gradle 85 | local.properties 86 | *.iml 87 | 88 | # BUCK 89 | buck-out/ 90 | \.buckd/ 91 | *.keystore 92 | 93 | !*.zip 94 | /assets/** -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: unknown 9 | 10 | project_type: module 11 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /android-rn/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /android-rn/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android-rn/src/main/java/com/reactlibrary/MiniAppEnginesPackage.java: -------------------------------------------------------------------------------- 1 | // MiniAppEnginesPackage.java 2 | 3 | package com.reactlibrary; 4 | 5 | import java.util.Arrays; 6 | import java.util.Collections; 7 | import java.util.List; 8 | 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.bridge.NativeModule; 11 | import com.facebook.react.bridge.ReactApplicationContext; 12 | import com.facebook.react.uimanager.ViewManager; 13 | 14 | public class MiniAppEnginesPackage implements ReactPackage { 15 | @Override 16 | public List createNativeModules(ReactApplicationContext reactContext) { 17 | return Arrays.asList(new MiniAppEnginesModule(reactContext)); 18 | } 19 | 20 | @Override 21 | public List createViewManagers(ReactApplicationContext reactContext) { 22 | // return Arrays.asList(new MiniAppEnginesViewManager(reactContext)); 23 | return Collections.emptyList(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /build.android.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | 4 | const inputPath = path.join(__dirname, './build/host/outputs/repo'); 5 | 6 | const outPath = path.join(__dirname, './assets/android/repo'); 7 | 8 | fs.copySync(inputPath, outPath); 9 | -------------------------------------------------------------------------------- /build.ios.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const findRemoveSync = require('find-remove'); 4 | const archiver = require('archiver'); 5 | 6 | const quickjsPath = path.join( 7 | __dirname, 8 | './packages/webf-0.12.0+1/ios/quickjs.xcframework', 9 | ); 10 | 11 | const webfBridgePath = path.join( 12 | __dirname, 13 | './packages/webf-0.12.0+1/ios/webf_bridge.xcframework', 14 | ); 15 | 16 | const types = ['Debug', 'Release', 'Profile']; 17 | fs.copySync( 18 | path.join(__dirname, './build/ios/framework/'), 19 | path.join(__dirname, './assets/ios/framework/'), 20 | ); 21 | 22 | for (const key in types) { 23 | zipAssets(types[key]); 24 | } 25 | 26 | function zipAssets(type) { 27 | return new Promise((resolve, reject) => { 28 | const quickjsSavePath = path.join( 29 | __dirname, 30 | `./assets/ios/framework/${type}/quickjs.xcframework`, 31 | ); 32 | fs.copySync(quickjsPath, quickjsSavePath); 33 | const webfBridgeSavePath = path.join( 34 | __dirname, 35 | `./assets/ios/framework/${type}/webf_bridge.xcframework`, 36 | ); 37 | fs.copySync(webfBridgePath, webfBridgeSavePath); 38 | const output = fs.createWriteStream( 39 | path.join(__dirname, `./assets/ios/framework/${type}.zip`), 40 | ); 41 | const archive = archiver('zip', { 42 | zlib: {level: 9}, // Sets the compression level. 43 | }); 44 | archive.pipe(output); 45 | archive.on('warning', function (err) { 46 | console.error(err); 47 | if (err.code === 'ENOENT') { 48 | // log warning 49 | } else { 50 | // throw error 51 | throw err; 52 | } 53 | }); 54 | // good practice to catch this error explicitly 55 | archive.on('error', function (err) { 56 | console.error(err); 57 | throw err; 58 | }); 59 | archive.on('end', function () { 60 | console.log('end', type); 61 | findRemoveSync(path.join(__dirname, `./assets/ios/framework/${type}`), { 62 | dir: 'xcframework$', 63 | regex: true, 64 | }); 65 | resolve('ok'); 66 | }); 67 | 68 | archive.directory( 69 | path.join(__dirname, `./assets/ios/framework/${type}`), 70 | type, 71 | ); 72 | console.log('start', type); 73 | archive.finalize(); 74 | }); 75 | } 76 | -------------------------------------------------------------------------------- /docs/images/rax.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/docs/images/rax.jpeg -------------------------------------------------------------------------------- /docs/images/react.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/docs/images/react.jpeg -------------------------------------------------------------------------------- /docs/images/vue.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/docs/images/vue.jpeg -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // main index.js 2 | 3 | import { NativeModules, requireNativeComponent } from 'react-native'; 4 | const { MiniAppEngines } = NativeModules; 5 | 6 | 7 | export const MiniAppEnginesView = requireNativeComponent('RCTMiniAppEnginesView'); 8 | 9 | export default MiniAppEngines; 10 | -------------------------------------------------------------------------------- /ios-rn/MiniAppEngines.h: -------------------------------------------------------------------------------- 1 | // MiniAppEngines.h 2 | 3 | #import 4 | @import Flutter; 5 | @import FlutterPluginRegistrant; 6 | 7 | @interface MiniAppEngines : NSObject 8 | 9 | @property (nonatomic,strong) FlutterEngine *flutterEngine; 10 | + (void)initWithFlutterEngine:(FlutterEngine * _Nonnull)flutterEngine; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ios-rn/MiniAppEngines.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios-rn/Podspecs/MiniAppEngines-Debug.podspec: -------------------------------------------------------------------------------- 1 | require './common' 2 | 3 | Pod::Spec.new do |s| 4 | generateFrameworksSpecProps(s, "Debug") 5 | end -------------------------------------------------------------------------------- /ios-rn/Podspecs/MiniAppEngines-Profile.podspec: -------------------------------------------------------------------------------- 1 | require './common' 2 | 3 | Pod::Spec.new do |s| 4 | generateFrameworksSpecProps(s, "Profile") 5 | end -------------------------------------------------------------------------------- /ios-rn/Podspecs/MiniAppEngines-Release.podspec: -------------------------------------------------------------------------------- 1 | require './common' 2 | 3 | Pod::Spec.new do |s| 4 | generateFrameworksSpecProps(s, "Release") 5 | end -------------------------------------------------------------------------------- /ios-rn/Podspecs/common.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | def setCommonProps(s) 4 | package = JSON.parse(File.read(File.join(__dir__, '../../package.json'))) 5 | s.version = package["version"] 6 | s.summary = package["description"] 7 | s.homepage = package['homepage'] 8 | s.license = package['license'] 9 | s.authors = { package['author']['name'] => package['author']['url'] } 10 | s.source = { :git => package['repository']['url'], :tag => "#{s.version}" } 11 | s.platforms = { :ios => "11.0" } 12 | s.swift_version = '5.0' 13 | s.requires_arc = true 14 | end 15 | 16 | def generateFrameworksSpecProps(s, configuration) 17 | setCommonProps(s) 18 | s.name = "FlutterModuleFrameworks-#{configuration}" 19 | s.source = { :http => "file://#{__dir__}/../../assets/ios/framework/#{configuration}.zip"} 20 | # You can reference sources as a git repository instead: 21 | # s.source = { :git => "https://github.com/p-mazhnik/rn-package-flutter.git", :tag => 'some tag' } 22 | s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "'${PODS_ROOT}/#{s.name}'"} 23 | s.description = <<-DESC 24 | FlutterModuleFrameworks, #{configuration} 25 | DESC 26 | s.source_files = "**/*.{swift,h,m}" 27 | s.vendored_frameworks = '**/*.xcframework' 28 | s.preserve_paths = "**/*.xcframework" 29 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 30 | 31 | s.dependency "Flutter" 32 | end -------------------------------------------------------------------------------- /ios-rn/pods.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | def use_mini_app_engines! (options={}) 4 | package = JSON.parse(File.read(File.join(__dir__, "../package.json"))) 5 | packageName = package['name'] 6 | prefix = options[:path] ||= "../node_modules/#{packageName}" 7 | 8 | pod 'Flutter', :podspec => "#{prefix}/assets/ios/framework/Release/Flutter.podspec" 9 | pod 'FlutterModuleFrameworks-Debug', 10 | :configuration => 'Debug', 11 | :podspec => "#{prefix}/ios-rn/Podspecs/MiniAppEngines-Debug.podspec" 12 | # pod 'FlutterModuleFrameworks-Profile', 13 | # :configuration => 'Profile', 14 | # :podspec => "#{prefix}/ios-rn/Podspecs/MiniAppEngines-Profile.podspec" 15 | pod 'FlutterModuleFrameworks-Release', 16 | :configuration => 'Release', 17 | :podspec => "#{prefix}/ios-rn/Podspecs/MiniAppEngines-Release.podspec" 18 | end -------------------------------------------------------------------------------- /mini-app-engines.podspec: -------------------------------------------------------------------------------- 1 | # mini-app-engines.podspec 2 | 3 | require "json" 4 | require './ios-rn/Podspecs/common' 5 | 6 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 7 | 8 | Pod::Spec.new do |s| 9 | s.name = "mini-app-engines" 10 | s.version = package["version"] 11 | s.summary = package["description"] 12 | s.description = <<-DESC 13 | mini-app-engines 14 | DESC 15 | s.homepage = "https://github.com/github_account/mini-app-engines" 16 | # brief license entry: 17 | s.license = "MIT" 18 | # optional - use expanded license entry instead: 19 | # s.license = { :type => "MIT", :file => "LICENSE" } 20 | s.authors = { "Your Name" => "yourname@email.com" } 21 | s.platforms = { :ios => "9.0" } 22 | s.source = { :git => "https://github.com/github_account/mini-app-engines.git", :tag => "#{s.version}" } 23 | 24 | s.source_files = "ios-rn/**/*.{h,c,cc,cpp,m,mm,swift}" 25 | s.requires_arc = true 26 | 27 | s.dependency "React" 28 | s.dependency "Flutter" 29 | s.dependency "FlutterModuleFrameworks-Debug" 30 | # s.dependency "FlutterModuleFrameworks-Profile" 31 | s.dependency "FlutterModuleFrameworks-Release" 32 | # ... 33 | # s.dependency "..." 34 | end 35 | 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mini-app-engines", 3 | "title": "Mini App Engines", 4 | "version": "0.0.3", 5 | "description": "TODO", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "index.js", 11 | "ios", 12 | "mini-app-engines.podspec" 13 | ], 14 | "homepage": "https://github.com/dagouzhi/mini-app-engines", 15 | "scripts": { 16 | "build": "rimraf -fr build && npm run build:android && npm run build:ios", 17 | "build:android": "rimraf -fr build/host && flutter build aar && node ./build.android.js", 18 | "build:ios": "rimraf -fr build/ios && flutter build ios-framework --cocoapods && node ./build.ios.js", 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/dagouzhi/mini-app-engines.git", 24 | "baseUrl": "https://github.com/dagouzhi/mini-app-engines" 25 | }, 26 | "keywords": [ 27 | "react-native" 28 | ], 29 | "author": { 30 | "name": "Your Name", 31 | "email": "yourname@email.com" 32 | }, 33 | "license": "MIT", 34 | "licenseFilename": "LICENSE", 35 | "readmeFilename": "README.md", 36 | "peerDependencies": { 37 | "react": ">=16.8.1", 38 | "react-native": ">=0.60.0-rc.0 <1.0.x" 39 | }, 40 | "devDependencies": { 41 | "archiver": "^5.3.1", 42 | "find-remove": "^4.0.4", 43 | "fs-extra": "^10.1.0", 44 | "react": "^16.9.0", 45 | "react-native": "^0.61.5", 46 | "rimraf": "^3.0.2" 47 | }, 48 | "dependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /packages/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/README.md -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.openwebf.kraken' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | maven { 7 | url 'https://maven.aliyun.com/repository/public/' 8 | } 9 | maven { 10 | url 'https://maven.aliyun.com/repository/google/' 11 | } 12 | maven { 13 | url 'https://maven.aliyun.com/repository/jcenter/' 14 | } 15 | } 16 | 17 | dependencies { 18 | classpath 'com.android.tools.build:gradle:4.1.0' 19 | } 20 | } 21 | 22 | rootProject.allprojects { 23 | repositories { 24 | maven { 25 | url 'https://maven.aliyun.com/repository/public/' 26 | } 27 | maven { 28 | url 'https://maven.aliyun.com/repository/google/' 29 | } 30 | maven { 31 | url 'https://maven.aliyun.com/repository/jcenter/' 32 | } 33 | } 34 | } 35 | 36 | apply plugin: 'com.android.library' 37 | 38 | android { 39 | compileSdkVersion 29 40 | 41 | defaultConfig { 42 | minSdkVersion 16 43 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 44 | 45 | ndk { 46 | abiFilters 'armeabi-v7a', 'arm64-v8a' 47 | } 48 | 49 | externalNativeBuild { 50 | cmake { 51 | abiFilters 'armeabi-v7a', 'arm64-v8a' 52 | } 53 | } 54 | } 55 | lintOptions { 56 | disable 'InvalidPackage' 57 | } 58 | 59 | sourceSets { 60 | main { 61 | jniLibs.srcDirs = ['jniLibs'] 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 6 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libc++_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libc++_shared.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libquickjs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libquickjs.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libwebf.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/arm64-v8a/libwebf.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libc++_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libc++_shared.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libquickjs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libquickjs.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libwebf.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/armeabi-v7a/libwebf.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/x86/libc++_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/x86/libc++_shared.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/x86/libquickjs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/x86/libquickjs.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/jniLibs/x86/libwebf.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/android/jniLibs/x86/libwebf.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'webf' 2 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/README.md: -------------------------------------------------------------------------------- 1 | # kraken_example 2 | 3 | Demonstrates how to use the kraken plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | defaultConfig { 37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 38 | applicationId "com.openwebf.webf_example" 39 | minSdkVersion flutter.minSdkVersion 40 | targetSdkVersion flutter.targetSdkVersion 41 | versionCode flutterVersionCode.toInteger() 42 | versionName flutterVersionName 43 | } 44 | 45 | buildTypes { 46 | release { 47 | // TODO: Add your own signing config for the release build. 48 | // Signing with the debug keys for now, so `flutter run --release` works. 49 | signingConfig signingConfigs.debug 50 | } 51 | } 52 | } 53 | 54 | flutter { 55 | source '../..' 56 | } 57 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/java/com/openwebf/webf_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.openwebf.webf_example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import androidx.annotation.Keep; 4 | import androidx.annotation.NonNull; 5 | import io.flutter.Log; 6 | 7 | import io.flutter.embedding.engine.FlutterEngine; 8 | 9 | /** 10 | * Generated file. Do not edit. 11 | * This file is generated by the Flutter tool based on the 12 | * plugins that support the Android platform. 13 | */ 14 | @Keep 15 | public final class GeneratedPluginRegistrant { 16 | private static final String TAG = "GeneratedPluginRegistrant"; 17 | public static void registerWith(@NonNull FlutterEngine flutterEngine) { 18 | try { 19 | flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.connectivity.ConnectivityPlugin()); 20 | } catch(Exception e) { 21 | Log.e(TAG, "Error registering plugin connectivity_plus, dev.fluttercommunity.plus.connectivity.ConnectivityPlugin", e); 22 | } 23 | try { 24 | flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); 25 | } catch(Exception e) { 26 | Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); 27 | } 28 | try { 29 | flutterEngine.getPlugins().add(new com.openwebf.webf.WebFPlugin()); 30 | } catch(Exception e) { 31 | Log.e(TAG, "Error registering plugin webf, com.openwebf.webf.WebFPlugin", e); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/bundle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 |
20 | 21 |
22 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/bundle.js: -------------------------------------------------------------------------------- 1 | var text1 = document.createTextNode('Hello Kraken!'); 2 | var br = document.createElement('br'); 3 | var text2 = document.createTextNode('你好,北海!'); 4 | var p = document.createElement('p'); 5 | p.className = 'p'; 6 | p.style.textAlign = 'center'; 7 | p.appendChild(text1); 8 | p.appendChild(br); 9 | p.appendChild(text2); 10 | 11 | document.body.appendChild(p); 12 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/bundle.kbc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/assets/bundle.kbc1 -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/defineA.js: -------------------------------------------------------------------------------- 1 | window.A = 'A'; 2 | window.bundleALoadTime = Date.now(); 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/defineB.js: -------------------------------------------------------------------------------- 1 | window.B = 'B'; 2 | window.bundleBLoadTime = Date.now(); 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/assets/kraken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/assets/kraken.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Bold.ttf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Heavy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Heavy.ttf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Light.ttf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Medium.ttf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/Alibaba-PuHuiTi-Regular.ttf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Black.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Bold.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-BoldItalic.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Heavy.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Heavy.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-HeavyItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-HeavyItalic.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Italic.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Light.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-LightItalic.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Medium.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-MediumItalic.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/fonts/AlibabaSans-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/fonts/AlibabaSans-Regular.otf -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Flutter/Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=/Users/dgz/flutter 3 | FLUTTER_APPLICATION_PATH=/Users/dgz/code/github/mini_app_engines/packages/webf-0.12.0+1/example 4 | COCOAPODS_PARALLEL_CODE_SIGN=true 5 | FLUTTER_TARGET=lib/main.dart 6 | FLUTTER_BUILD_DIR=build 7 | FLUTTER_BUILD_NAME=1.0.0 8 | FLUTTER_BUILD_NUMBER=1 9 | EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 10 | DART_OBFUSCATION=false 11 | TRACK_WIDGET_CREATION=false 12 | TREE_SHAKE_ICONS=false 13 | PACKAGE_CONFIG=.dart_tool/package_config.json 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/dgz/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/dgz/code/github/mini_app_engines/packages/webf-0.12.0+1/example" 5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true" 6 | export "FLUTTER_TARGET=lib/main.dart" 7 | export "FLUTTER_BUILD_DIR=build" 8 | export "FLUTTER_BUILD_NAME=1.0.0" 9 | export "FLUTTER_BUILD_NUMBER=1" 10 | export "DART_OBFUSCATION=false" 11 | export "TRACK_WIDGET_CREATION=false" 12 | export "TREE_SHAKE_ICONS=false" 13 | export "PACKAGE_CONFIG=.dart_tool/package_config.json" 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GeneratedPluginRegistrant_h 8 | #define GeneratedPluginRegistrant_h 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface GeneratedPluginRegistrant : NSObject 15 | + (void)registerWithRegistry:(NSObject*)registry; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | #endif /* GeneratedPluginRegistrant_h */ 20 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #import "GeneratedPluginRegistrant.h" 8 | 9 | #if __has_include() 10 | #import 11 | #else 12 | @import connectivity_plus; 13 | #endif 14 | 15 | #if __has_include() 16 | #import 17 | #else 18 | @import shared_preferences_ios; 19 | #endif 20 | 21 | #if __has_include() 22 | #import 23 | #else 24 | @import webf; 25 | #endif 26 | 27 | @implementation GeneratedPluginRegistrant 28 | 29 | + (void)registerWithRegistry:(NSObject*)registry { 30 | [ConnectivityPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"ConnectivityPlusPlugin"]]; 31 | [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]]; 32 | [WebFPlugin registerWithRegistrar:[registry registrarForPlugin:@"WebFPlugin"]]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | kraken_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux: -------------------------------------------------------------------------------- 1 | /Users/dgz/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.1/ -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux: -------------------------------------------------------------------------------- 1 | /Users/dgz/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/ -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux: -------------------------------------------------------------------------------- 1 | /Users/dgz/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/ -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/ephemeral/.plugin_symlinks/webf: -------------------------------------------------------------------------------- 1 | /Users/dgz/code/github/mini_app_engines/packages/webf-0.12.0+1/ -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) webf_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "WebfPlugin"); 14 | webf_plugin_register_with_registrar(webf_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | webf 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import connectivity_plus_macos 9 | import shared_preferences_macos 10 | import webf 11 | 12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 13 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) 14 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 15 | WebFPlugin.register(with: registry.registrar(forPlugin: "WebFPlugin")) 16 | } 17 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=/Users/dgz/flutter 3 | FLUTTER_APPLICATION_PATH=/Users/dgz/code/github/mini_app_engines/packages/webf-0.12.0+1/example 4 | COCOAPODS_PARALLEL_CODE_SIGN=true 5 | FLUTTER_BUILD_DIR=build 6 | FLUTTER_BUILD_NAME=1.0.0 7 | FLUTTER_BUILD_NUMBER=1 8 | DART_OBFUSCATION=false 9 | TRACK_WIDGET_CREATION=false 10 | TREE_SHAKE_ICONS=false 11 | PACKAGE_CONFIG=.dart_tool/package_config.json 12 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Flutter/ephemeral/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/dgz/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/dgz/code/github/mini_app_engines/packages/webf-0.12.0+1/example" 5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "FLUTTER_BUILD_NAME=1.0.0" 8 | export "FLUTTER_BUILD_NUMBER=1" 9 | export "DART_OBFUSCATION=false" 10 | export "TRACK_WIDGET_CREATION=false" 11 | export "TREE_SHAKE_ICONS=false" 12 | export "PACKAGE_CONFIG=.dart_tool/package_config.json" 13 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = kraken_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.openkraken.krakenExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.openkraken. All rights reserved. 15 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: webf_example 2 | description: Demonstrates how to use the webf plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | webf: ^0.10.0 15 | 16 | # When depending on this package from a real application, 17 | # you should remove the following overrides. 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | dependency_overrides: 22 | webf: 23 | path: ../ 24 | 25 | # The following section is specific to Flutter. 26 | flutter: 27 | fonts: 28 | - family: AlibabaPuHuiTi 29 | fonts: 30 | - asset: fonts/Alibaba-PuHuiTi-Regular.ttf 31 | - asset: fonts/Alibaba-PuHuiTi-Light.ttf 32 | weight: 300 33 | - asset: fonts/Alibaba-PuHuiTi-Medium.ttf 34 | weight: 500 35 | - asset: fonts/Alibaba-PuHuiTi-Bold.ttf 36 | weight: 700 37 | - asset: fonts/Alibaba-PuHuiTi-Heavy.ttf 38 | weight: 900 39 | - family: AlibabaSans 40 | fonts: 41 | - asset: fonts/AlibabaSans-Regular.otf 42 | - asset: fonts/AlibabaSans-Italic.otf 43 | style: italic 44 | - asset: fonts/AlibabaSans-Light.otf 45 | weight: 300 46 | - asset: fonts/AlibabaSans-LightItalic.otf 47 | weight: 300 48 | style: italic 49 | - asset: fonts/AlibabaSans-Medium.otf 50 | weight: 500 51 | - asset: fonts/AlibabaSans-MediumItalic.otf 52 | weight: 500 53 | style: italic 54 | - asset: fonts/AlibabaSans-Bold.otf 55 | weight: 700 56 | - asset: fonts/AlibabaSans-BoldItalic.otf 57 | weight: 700 58 | style: italic 59 | - asset: fonts/AlibabaSans-Heavy.otf 60 | weight: 900 61 | - asset: fonts/AlibabaSans-HeavyItalic.otf 62 | weight: 900 63 | style: italic 64 | - family: AlibabaSans-Black 65 | fonts: 66 | - asset: fonts/AlibabaSans-Black.otf 67 | 68 | 69 | assets: 70 | - assets/ 71 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/Classes/WebF.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "WebF.h" 3 | #import "WebFPlugin.h" 4 | 5 | typedef void(^MethodHandler)(FlutterMethodCall* _Nonnull , FlutterResult _Nonnull); 6 | 7 | @interface WebF : NSObject 8 | 9 | + (WebF* _Nonnull) instanceByBinaryMessenger: (NSObject* _Nonnull) messenger; 10 | 11 | @property NSString* _Nullable bundleUrl; 12 | @property FlutterEngine* _Nonnull flutterEngine; 13 | @property FlutterMethodChannel* _Nullable channel; 14 | @property MethodHandler _Nullable methodHandler; 15 | 16 | - (instancetype _Nonnull)initWithFlutterEngine: (FlutterEngine* _Nonnull) engine; 17 | 18 | - (NSString* _Nullable) getUrl; 19 | 20 | - (void) loadUrl: (NSString* _Nonnull)url; 21 | 22 | - (void) reload; 23 | 24 | - (void) reloadWithUrl: (NSString* _Nonnull) url; 25 | 26 | - (void) registerMethodCallHandler: (MethodHandler _Nonnull) handler; 27 | 28 | - (void) invokeMethod: (NSString* _Nonnull)method arguments:(nullable id) arguments; 29 | 30 | - (void) _handleMethodCall:(FlutterMethodCall* _Nonnull)call result:(FlutterResult _Nonnull )result; 31 | @end 32 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/Classes/WebFPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define NAME_METHOD_SPLIT @"!!" 4 | 5 | @interface WebFPlugin : NSObject 6 | 7 | @property NSObject *registrar; 8 | 9 | - (instancetype) initWithRegistrar: (NSObject*)registrar; 10 | 11 | + (FlutterMethodChannel *) getMethodChannel; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/Classes/WebFPlugin.m: -------------------------------------------------------------------------------- 1 | #import "WebF.h" 2 | #import "WebFPlugin.h" 3 | 4 | static FlutterMethodChannel *methodChannel = nil; 5 | 6 | @implementation WebFPlugin 7 | 8 | + (FlutterMethodChannel *) getMethodChannel { 9 | return methodChannel; 10 | } 11 | 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | NSObject* messager = [registrar messenger]; 14 | FlutterMethodChannel* channel = [FlutterMethodChannel 15 | methodChannelWithName:@"webf" 16 | binaryMessenger:messager]; 17 | 18 | methodChannel = channel; 19 | 20 | WebFPlugin* instance = [[WebFPlugin alloc] initWithRegistrar: registrar]; 21 | 22 | [registrar addMethodCallDelegate:instance channel:channel]; 23 | } 24 | 25 | - (instancetype) initWithRegistrar: (NSObject*)registrar { 26 | self = [super init]; 27 | self.registrar = registrar; 28 | return self; 29 | } 30 | 31 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 32 | if ([@"getUrl" isEqualToString:call.method]) { 33 | WebF* webfInstance = [WebF instanceByBinaryMessenger: [self.registrar messenger]]; 34 | if (webfInstance != nil) { 35 | result([webfInstance getUrl]); 36 | } else { 37 | result(nil); 38 | } 39 | } else if ([@"invokeMethod" isEqualToString: call.method]) { 40 | WebF* webfInstance = [WebF instanceByBinaryMessenger: [self.registrar messenger]]; 41 | FlutterMethodCall* callWrap = [FlutterMethodCall methodCallWithMethodName: call.arguments[@"method"] arguments: call.arguments[@"args"]]; 42 | [webfInstance _handleMethodCall:callWrap result:result]; 43 | } else if ([@"getTemporaryDirectory" isEqualToString: call.method]) { 44 | result([self getTemporaryDirectory]); 45 | } else { 46 | result(FlutterMethodNotImplemented); 47 | } 48 | } 49 | 50 | - (NSString*) getTemporaryDirectory { 51 | NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 52 | return [paths.firstObject stringByAppendingString: @"/WebF"]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/prepare.sh: -------------------------------------------------------------------------------- 1 | ROOT=$(pwd) 2 | 3 | if [ -L "kraken_bridge.xcframework" ]; then 4 | ROOT=$(pwd) 5 | rm kraken_bridge.xcframework 6 | ln -s $ROOT/../../bridge/build/ios/framework/kraken_bridge.xcframework 7 | fi 8 | 9 | if [ -L "quickjs.xcframework" ]; then 10 | ROOT=$(pwd) 11 | rm quickjs.xcframework 12 | ln -s $ROOT/../../bridge/build/ios/framework/quickjs.xcframework 13 | fi 14 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/quickjs.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | ios-x86_64-simulator 10 | LibraryPath 11 | quickjs.framework 12 | SupportedArchitectures 13 | 14 | x86_64 15 | 16 | SupportedPlatform 17 | ios 18 | SupportedPlatformVariant 19 | simulator 20 | 21 | 22 | LibraryIdentifier 23 | ios-arm64_armv7_armv7s 24 | LibraryPath 25 | quickjs.framework 26 | SupportedArchitectures 27 | 28 | arm64 29 | armv7 30 | armv7s 31 | 32 | SupportedPlatform 33 | ios 34 | 35 | 36 | CFBundlePackageType 37 | XFWK 38 | XCFrameworkFormatVersion 39 | 1.0 40 | 41 | 42 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-arm64_armv7_armv7s/quickjs.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | quickjs 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.openwebf.quickjs 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | MinimumOSVersion 22 | 9.0 23 | CFBundleShortVersionString 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-arm64_armv7_armv7s/quickjs.framework/quickjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-arm64_armv7_armv7s/quickjs.framework/quickjs -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-x86_64-simulator/quickjs.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | quickjs 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.openwebf.quickjs 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | MinimumOSVersion 22 | 9.0 23 | CFBundleShortVersionString 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-x86_64-simulator/quickjs.framework/quickjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/ios/quickjs.xcframework/ios-x86_64-simulator/quickjs.framework/quickjs -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'webf' 6 | s.version = '0.1.0' 7 | s.summary = 'A W3C standard compliant Web rendering engine based on Flutter.' 8 | s.description = <<-DESC 9 | A W3C standard compliant Web rendering engine based on Flutter. 10 | DESC 11 | s.homepage = 'https://openwebf.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'OpenWebF' => 'dongtiangche@outlook.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '8.0' 19 | s.vendored_frameworks = 'webf_bridge.xcframework', 'quickjs.xcframework' 20 | s.prepare_command = 'bash prepare.sh' 21 | 22 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 24 | end 25 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf_bridge.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | ios-x86_64-simulator 10 | LibraryPath 11 | webf_bridge.framework 12 | SupportedArchitectures 13 | 14 | x86_64 15 | 16 | SupportedPlatform 17 | ios 18 | SupportedPlatformVariant 19 | simulator 20 | 21 | 22 | LibraryIdentifier 23 | ios-arm64_armv7_armv7s 24 | LibraryPath 25 | webf_bridge.framework 26 | SupportedArchitectures 27 | 28 | arm64 29 | armv7 30 | armv7s 31 | 32 | SupportedPlatform 33 | ios 34 | 35 | 36 | CFBundlePackageType 37 | XFWK 38 | XCFrameworkFormatVersion 39 | 1.0 40 | 41 | 42 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-arm64_armv7_armv7s/webf_bridge.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | webf_bridge 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.openwebf.webf-bridge 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | MinimumOSVersion 22 | 9.0 23 | CFBundleShortVersionString 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-arm64_armv7_armv7s/webf_bridge.framework/webf_bridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-arm64_armv7_armv7s/webf_bridge.framework/webf_bridge -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-x86_64-simulator/webf_bridge.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | webf_bridge 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.openwebf.webf-bridge 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | MinimumOSVersion 22 | 9.0 23 | CFBundleShortVersionString 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-x86_64-simulator/webf_bridge.framework/webf_bridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/ios/webf_bridge.xcframework/ios-x86_64-simulator/webf_bridge.framework/webf_bridge -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/bridge.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/bridge/bridge.dart'; 7 | export 'src/bridge/binding.dart'; 8 | export 'src/bridge/dynamic_library.dart'; 9 | export 'src/bridge/to_native.dart'; 10 | export 'src/bridge/from_native.dart'; 11 | export 'src/bridge/native_types.dart'; 12 | export 'src/bridge/native_value.dart'; 13 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/cli.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/webf.dart'; 6 | 7 | void main() { 8 | launch(); 9 | } 10 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/css.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/css/animation.dart'; 7 | export 'src/css/background.dart'; 8 | export 'src/css/border_radius.dart'; 9 | export 'src/css/box.dart'; 10 | export 'src/css/box_shadow.dart'; 11 | export 'src/css/content_visibility.dart'; 12 | export 'src/css/flexbox.dart'; 13 | export 'src/css/filter.dart'; 14 | export 'src/css/opacity.dart'; 15 | export 'src/css/overflow.dart'; 16 | export 'src/css/positioned.dart'; 17 | export 'src/css/inline.dart'; 18 | export 'src/css/sizing.dart'; 19 | export 'src/css/padding.dart'; 20 | export 'src/css/margin.dart'; 21 | export 'src/css/border.dart'; 22 | export 'src/css/gradient.dart'; 23 | export 'src/css/render_style.dart'; 24 | export 'src/css/rule.dart'; 25 | export 'src/css/style_rule.dart'; 26 | export 'src/css/style_declaration.dart'; 27 | export 'src/css/style_property.dart'; 28 | export 'src/css/style_sheet.dart'; 29 | export 'src/css/parser/style_rule_parser.dart'; 30 | export 'src/css/parser/style_sheet_parser.dart'; 31 | export 'src/css/parser/parser.dart'; 32 | export 'src/css/text.dart'; 33 | export 'src/css/origin.dart'; 34 | export 'src/css/matrix.dart'; 35 | export 'src/css/transform.dart'; 36 | export 'src/css/transition.dart'; 37 | export 'src/css/visibility.dart'; 38 | export 'src/css/position.dart'; 39 | export 'src/css/display.dart'; 40 | export 'src/css/object_fit.dart'; 41 | export 'src/css/object_position.dart'; 42 | export 'src/css/sliver.dart'; 43 | export 'src/css/value.dart'; 44 | export 'src/css/variable.dart'; 45 | export 'src/css/keywords.dart'; 46 | 47 | // CSS Values 48 | // ignore: directives_ordering 49 | export 'src/css/values/angle.dart'; 50 | export 'src/css/values/color.dart'; 51 | export 'src/css/values/function.dart'; 52 | export 'src/css/values/length.dart'; 53 | export 'src/css/values/number.dart'; 54 | export 'src/css/values/integer.dart'; 55 | export 'src/css/values/position.dart'; 56 | export 'src/css/values/time.dart'; 57 | export 'src/css/values/percentage.dart'; 58 | export 'src/css/values/textual.dart'; 59 | export 'src/css/values/variable.dart'; 60 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/devtools.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/devtools/server.dart'; 7 | export 'src/devtools/service.dart'; 8 | export 'src/devtools/module.dart'; 9 | export 'src/devtools/overlay.dart'; 10 | export 'src/devtools/inspector.dart'; 11 | 12 | // DevTools Modules 13 | export 'src/devtools/modules/css.dart'; 14 | export 'src/devtools/modules/debugger.dart'; 15 | export 'src/devtools/modules/dom.dart'; 16 | export 'src/devtools/modules/log.dart'; 17 | export 'src/devtools/modules/network.dart'; 18 | export 'src/devtools/modules/overlay.dart'; 19 | export 'src/devtools/modules/page.dart'; 20 | export 'src/devtools/modules/profiler.dart'; 21 | export 'src/devtools/modules/runtime.dart'; 22 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/dom.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/dom/binding.dart'; 7 | export 'src/dom/element.dart'; 8 | export 'src/dom/event.dart'; 9 | export 'src/dom/event_target.dart'; 10 | export 'src/dom/object_element_client.dart'; 11 | export 'src/dom/bounding_client_rect.dart'; 12 | export 'src/dom/node.dart'; 13 | export 'src/dom/text_node.dart'; 14 | export 'src/dom/window.dart'; 15 | export 'src/dom/document.dart'; 16 | export 'src/dom/comment.dart'; 17 | export 'src/dom/document_fragment.dart'; 18 | export 'src/dom/sliver_manager.dart'; 19 | export 'src/dom/screen.dart'; 20 | export 'src/dom/element_registry.dart'; 21 | 22 | // Elements 23 | export 'src/dom/elements/semantics_text.dart'; 24 | export 'src/dom/elements/grouping_content.dart'; 25 | export 'src/dom/elements/sections.dart'; 26 | export 'src/dom/elements/headings.dart'; 27 | export 'src/dom/elements/forms.dart'; 28 | export 'src/dom/elements/edits.dart'; 29 | export 'src/dom/elements/a.dart'; 30 | export 'src/dom/elements/body.dart'; 31 | export 'src/dom/elements/canvas/canvas.dart'; 32 | export 'src/dom/elements/canvas/canvas_context_2d.dart'; 33 | export 'src/dom/elements/img.dart'; 34 | export 'src/dom/elements/input.dart'; 35 | export 'src/dom/elements/text_form_control.dart'; 36 | export 'src/dom/elements/textarea.dart'; 37 | export 'src/dom/elements/object.dart'; 38 | export 'src/dom/elements/head.dart'; 39 | export 'src/dom/elements/script.dart'; 40 | export 'src/dom/elements/html.dart'; 41 | export 'src/dom/elements/template.dart'; 42 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/foundation.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/foundation/binding.dart'; 7 | export 'src/foundation/bundle.dart'; 8 | export 'src/foundation/convert.dart'; 9 | export 'src/foundation/environment.dart'; 10 | export 'src/foundation/http_cache.dart'; 11 | export 'src/foundation/http_cache_object.dart'; 12 | export 'src/foundation/http_client.dart'; 13 | export 'src/foundation/http_client_interceptor.dart'; 14 | export 'src/foundation/http_client_request.dart'; 15 | export 'src/foundation/http_client_response.dart'; 16 | export 'src/foundation/http_overrides.dart'; 17 | export 'src/foundation/type.dart'; 18 | export 'src/foundation/uri_parser.dart'; 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/gesture.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/gesture/gesture_detector.dart'; 7 | export 'src/gesture/scrollable.dart'; 8 | export 'src/gesture/swipe.dart'; 9 | export 'src/gesture/monodrag.dart'; 10 | export 'src/gesture/gesture_dispatcher.dart'; 11 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/launcher.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/launcher/launcher.dart'; 7 | export 'src/launcher/controller.dart'; 8 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/module.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/module/module_manager.dart'; 7 | export 'src/module/async_storage.dart'; 8 | export 'src/module/clipboard.dart'; 9 | export 'src/module/connection.dart'; 10 | export 'src/module/fetch.dart'; 11 | export 'src/module/method_channel.dart'; 12 | export 'src/module/schedule_frame.dart'; 13 | export 'src/module/timer.dart'; 14 | export 'src/module/location.dart'; 15 | export 'src/module/history.dart'; 16 | export 'src/module/navigation.dart'; 17 | export 'src/module/navigator.dart'; 18 | export 'src/module/performance_timing.dart'; 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/painting.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/painting/cached_network_image.dart'; 7 | export 'src/painting/image_provider_factory.dart'; 8 | export 'src/painting/box_fit_image.dart'; 9 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/rendering.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/rendering/box_decoration.dart'; 7 | export 'src/rendering/box_decoration_painter.dart'; 8 | export 'src/dom/elements/canvas/canvas_painter.dart'; 9 | export 'src/rendering/fallback_view.dart'; 10 | export 'src/rendering/flex.dart'; 11 | export 'src/rendering/flow.dart'; 12 | export 'src/rendering/intersection_observer.dart'; 13 | export 'src/rendering/box_model.dart'; 14 | export 'src/rendering/replaced.dart'; 15 | export 'src/rendering/sliver_list.dart'; 16 | export 'src/rendering/preferred_size.dart'; 17 | export 'src/rendering/text.dart'; 18 | export 'src/rendering/text_control.dart'; 19 | export 'src/rendering/content_visibility.dart'; 20 | export 'src/rendering/event.dart'; 21 | export 'src/rendering/opacity.dart'; 22 | export 'src/rendering/overflow.dart'; 23 | export 'src/rendering/transform.dart'; 24 | export 'src/rendering/viewport.dart'; 25 | export 'src/rendering/paragraph.dart'; 26 | export 'src/rendering/line_break.dart'; 27 | export 'src/rendering/image.dart'; 28 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/scheduler.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/scheduler/fps.dart'; 7 | export 'src/scheduler/throttle.dart'; 8 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/bridge/bridge.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:async'; 7 | 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/scheduler.dart'; 10 | import 'package:webf/module.dart'; 11 | 12 | import 'binding.dart'; 13 | import 'from_native.dart'; 14 | import 'to_native.dart'; 15 | 16 | /// The maximum webf pages running in the same times. 17 | /// Can be upgrade to larger amount if you have enough memory spaces. 18 | int kWebFJSPagePoolSize = 1024; 19 | 20 | bool _firstView = true; 21 | 22 | /// Init bridge 23 | int initBridge() { 24 | if (kProfileMode) { 25 | PerformanceTiming.instance().mark(PERF_BRIDGE_REGISTER_DART_METHOD_START); 26 | } 27 | 28 | // Register methods first to share ptrs for bridge polyfill. 29 | registerDartMethodsToCpp(); 30 | 31 | // Setup binding bridge. 32 | BindingBridge.setup(); 33 | 34 | if (kProfileMode) { 35 | PerformanceTiming.instance().mark(PERF_BRIDGE_REGISTER_DART_METHOD_END); 36 | } 37 | 38 | int contextId = -1; 39 | 40 | // We should schedule addPersistentFrameCallback() to the next frame because of initBridge() 41 | // will be called from persistent frame callbacks and cause infinity loops. 42 | if (_firstView) { 43 | Future.microtask(() { 44 | // Port flutter's frame callback into bridge. 45 | SchedulerBinding.instance.addPersistentFrameCallback((_) { 46 | flushUICommand(); 47 | flushUICommandCallback(); 48 | }); 49 | }); 50 | } 51 | 52 | if (_firstView) { 53 | initJSPagePool(kWebFJSPagePoolSize); 54 | _firstView = false; 55 | contextId = 0; 56 | } else { 57 | contextId = allocateNewPage(); 58 | if (contextId == -1) { 59 | throw Exception('Can\' allocate new webf bridge: bridge count had reach the maximum size.'); 60 | } 61 | } 62 | 63 | return contextId; 64 | } 65 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/bridge/dynamic_library.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:ffi'; 7 | import 'dart:io' show Platform; 8 | 9 | import 'package:path/path.dart'; 10 | 11 | abstract class WebFDynamicLibrary { 12 | static final String _defaultLibraryPath = Platform.isLinux ? '\$ORIGIN' : ''; 13 | 14 | /// The search path that dynamic library be load, if null using default. 15 | static String _dynamicLibraryPath = _defaultLibraryPath; 16 | 17 | static String get dynamicLibraryPath => _dynamicLibraryPath; 18 | 19 | static set dynamicLibraryPath(String value) { 20 | _dynamicLibraryPath = value; 21 | } 22 | 23 | // The kraken library name. 24 | static String libName = 'libwebf'; 25 | 26 | static String get _nativeDynamicLibraryName { 27 | if (Platform.isMacOS) { 28 | return '$libName.dylib'; 29 | } else if (Platform.isIOS) { 30 | return 'webf_bridge.framework/webf_bridge'; 31 | } else if (Platform.isWindows) { 32 | return '$libName.dll'; 33 | } else if (Platform.isAndroid || Platform.isLinux) { 34 | return '$libName.so'; 35 | } else { 36 | throw UnimplementedError('Not supported platform.'); 37 | } 38 | } 39 | 40 | static DynamicLibrary? _ref; 41 | 42 | static DynamicLibrary get ref { 43 | DynamicLibrary? nativeDynamicLibrary = _ref; 44 | _ref = nativeDynamicLibrary ??= DynamicLibrary.open(join(_dynamicLibraryPath, _nativeDynamicLibraryName)); 45 | return nativeDynamicLibrary; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/border_radius.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui'; 6 | 7 | import 'package:webf/css.dart'; 8 | 9 | mixin CSSBorderRadiusMixin on RenderStyle { 10 | CSSBorderRadius? _borderTopLeftRadius; 11 | set borderTopLeftRadius(CSSBorderRadius? value) { 12 | if (value == _borderTopLeftRadius) return; 13 | _borderTopLeftRadius = value; 14 | renderBoxModel?.markNeedsPaint(); 15 | } 16 | 17 | @override 18 | CSSBorderRadius get borderTopLeftRadius => _borderTopLeftRadius ?? CSSBorderRadius.zero; 19 | 20 | CSSBorderRadius? _borderTopRightRadius; 21 | set borderTopRightRadius(CSSBorderRadius? value) { 22 | if (value == _borderTopRightRadius) return; 23 | _borderTopRightRadius = value; 24 | renderBoxModel?.markNeedsPaint(); 25 | } 26 | 27 | @override 28 | CSSBorderRadius get borderTopRightRadius => _borderTopRightRadius ?? CSSBorderRadius.zero; 29 | 30 | CSSBorderRadius? _borderBottomRightRadius; 31 | set borderBottomRightRadius(CSSBorderRadius? value) { 32 | if (value == _borderBottomRightRadius) return; 33 | _borderBottomRightRadius = value; 34 | renderBoxModel?.markNeedsPaint(); 35 | } 36 | 37 | @override 38 | CSSBorderRadius get borderBottomRightRadius => _borderBottomRightRadius ?? CSSBorderRadius.zero; 39 | 40 | CSSBorderRadius? _borderBottomLeftRadius; 41 | set borderBottomLeftRadius(CSSBorderRadius? value) { 42 | if (value == _borderBottomLeftRadius) return; 43 | _borderBottomLeftRadius = value; 44 | renderBoxModel?.markNeedsPaint(); 45 | } 46 | 47 | @override 48 | CSSBorderRadius get borderBottomLeftRadius => _borderBottomLeftRadius ?? CSSBorderRadius.zero; 49 | 50 | @override 51 | List? get borderRadius { 52 | bool hasBorderRadius = borderTopLeftRadius != CSSBorderRadius.zero || 53 | borderTopRightRadius != CSSBorderRadius.zero || 54 | borderBottomRightRadius != CSSBorderRadius.zero || 55 | borderBottomLeftRadius != CSSBorderRadius.zero; 56 | 57 | return hasBorderRadius 58 | ? [ 59 | borderTopLeftRadius.computedRadius, 60 | borderTopRightRadius.computedRadius, 61 | borderBottomRightRadius.computedRadius, 62 | borderBottomLeftRadius.computedRadius 63 | ] 64 | : null; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/box_shadow.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | 7 | mixin CSSBoxShadowMixin on RenderStyle { 8 | List? _boxShadow; 9 | set boxShadow(List? value) { 10 | if (value == _boxShadow) return; 11 | _boxShadow = value; 12 | renderBoxModel?.markNeedsPaint(); 13 | } 14 | 15 | List? get boxShadow => _boxShadow; 16 | 17 | @override 18 | List? get shadows { 19 | if (boxShadow == null) { 20 | return null; 21 | } 22 | List result = []; 23 | for (CSSBoxShadow shadow in boxShadow!) { 24 | result.add(shadow.computedBoxShadow); 25 | } 26 | return result; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/content_visibility.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/css.dart'; 7 | 8 | // CSS Content Visibility: https://www.w3.org/TR/css-contain-2/#content-visibility 9 | 10 | enum ContentVisibility { auto, hidden, visible } 11 | 12 | mixin CSSContentVisibilityMixin on RenderStyle { 13 | /// Whether the child is hidden from the rest of the tree. 14 | /// 15 | /// If ContentVisibility.hidden, the child is laid out as if it was in the tree, but without 16 | /// painting anything, without making the child available for hit testing, and 17 | /// without taking any room in the parent. 18 | /// 19 | /// If ContentVisibility.visible, the child is included in the tree as normal. 20 | /// 21 | /// If ContentVisibility.auto, the framework will compute the intersection bounds and not to paint when child renderObject 22 | /// are no longer intersection with this renderObject. 23 | @override 24 | ContentVisibility get contentVisibility => _contentVisibility ?? ContentVisibility.visible; 25 | ContentVisibility? _contentVisibility; 26 | set contentVisibility(ContentVisibility? value) { 27 | if (value == _contentVisibility) return; 28 | _contentVisibility = value; 29 | renderBoxModel?.markNeedsPaint(); 30 | } 31 | 32 | static ContentVisibility resolveContentVisibility(String value) { 33 | switch (value) { 34 | case HIDDEN: 35 | return ContentVisibility.hidden; 36 | case AUTO: 37 | return ContentVisibility.auto; 38 | case VISIBLE: 39 | default: 40 | return ContentVisibility.visible; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/inline.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | // https://www.w3.org/TR/css-inline-3/ 7 | 8 | import 'package:webf/css.dart'; 9 | 10 | /// Sets vertical alignment of an inline, inline-block 11 | enum VerticalAlign { 12 | /// Aligns the baseline of the element with the baseline of its parent. 13 | baseline, 14 | 15 | /// Aligns the top of the element and its descendants with the top of the entire line. 16 | top, 17 | 18 | /// Aligns the bottom of the element and its descendants with the bottom of the entire line. 19 | bottom, 20 | 21 | /// Aligns the middle of the element with the baseline plus half the x-height of the parent. 22 | /// @TODO not supported 23 | /// middle, 24 | } 25 | 26 | mixin CSSInlineMixin on RenderStyle { 27 | @override 28 | VerticalAlign get verticalAlign => _verticalAlign ?? VerticalAlign.baseline; 29 | VerticalAlign? _verticalAlign; 30 | set verticalAlign(VerticalAlign? value) { 31 | if (_verticalAlign != value) { 32 | _verticalAlign = value; 33 | renderBoxModel?.markNeedsLayout(); 34 | } 35 | } 36 | 37 | static VerticalAlign resolveVerticalAlign(String verticalAlign) { 38 | switch (verticalAlign) { 39 | case TOP: 40 | return VerticalAlign.top; 41 | case BOTTOM: 42 | return VerticalAlign.bottom; 43 | } 44 | return VerticalAlign.baseline; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/object_fit.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/css.dart'; 8 | 9 | mixin CSSObjectFitMixin on RenderStyle { 10 | @override 11 | BoxFit get objectFit => _objectFit ?? BoxFit.fill; 12 | BoxFit? _objectFit; 13 | set objectFit(BoxFit? value) { 14 | if (_objectFit == value) return; 15 | _objectFit = value; 16 | renderBoxModel?.markNeedsLayout(); 17 | } 18 | 19 | static BoxFit resolveBoxFit(String fit) { 20 | switch (fit) { 21 | case 'contain': 22 | return BoxFit.contain; 23 | 24 | case 'cover': 25 | return BoxFit.cover; 26 | 27 | case 'none': 28 | return BoxFit.none; 29 | 30 | case 'scaleDown': 31 | case 'scale-down': 32 | return BoxFit.scaleDown; 33 | 34 | case 'fitWidth': 35 | case 'fit-width': 36 | return BoxFit.fitWidth; 37 | 38 | case 'fitHeight': 39 | case 'fit-height': 40 | return BoxFit.fitHeight; 41 | 42 | case 'fill': 43 | default: 44 | return BoxFit.fill; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/object_position.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/css.dart'; 8 | 9 | mixin CSSObjectPositionMixin on RenderStyle { 10 | @override 11 | Alignment get objectPosition => _objectPosition ?? Alignment.center; 12 | Alignment? _objectPosition; 13 | set objectPosition(Alignment? value) { 14 | if (_objectPosition == value) return; 15 | _objectPosition = value; 16 | renderBoxModel?.markNeedsLayout(); 17 | } 18 | 19 | static Alignment resolveObjectPosition(String? position) { 20 | // Syntax: object-position: 21 | // position: From one to four values that define the 2D position of the element. Relative or absolute offsets can be used. 22 | // = [ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | ] [ top | center | bottom | ]? | [ [ left | right ] ] && [ [ top | bottom ] ] ] 23 | 24 | if (position != null) { 25 | List values = CSSStyleProperty.getPositionValues(position); 26 | return Alignment(_getAlignmentValueFromString(values[0]!), _getAlignmentValueFromString(values[1]!)); 27 | } 28 | 29 | // The default value for object-position is 50% 50% 30 | return Alignment.center; 31 | } 32 | 33 | static double _getAlignmentValueFromString(String value) { 34 | // Support percentage 35 | if (value.endsWith('%')) { 36 | // 0% equal to -1.0 37 | // 50% equal to 0.0 38 | // 100% equal to 1.0 39 | return double.tryParse(value.substring(0, value.length - 1))! / 50 - 1; 40 | } 41 | 42 | switch (value) { 43 | case 'top': 44 | case 'left': 45 | return -1; 46 | 47 | case 'bottom': 48 | case 'right': 49 | return 1; 50 | 51 | case 'center': 52 | default: 53 | return 0; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/opacity.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:ui' as ui; 7 | 8 | import 'package:webf/css.dart'; 9 | import 'package:webf/rendering.dart'; 10 | 11 | mixin CSSOpacityMixin on RenderStyle { 12 | /// The fraction to scale the child's alpha value. 13 | /// 14 | /// An opacity of 1.0 is fully opaque. An opacity of 0.0 is fully transparent 15 | /// (i.e., invisible). 16 | /// 17 | /// The opacity must not be null. 18 | /// 19 | /// Values 1.0 and 0.0 are painted with a fast path. Other values 20 | /// require painting the child into an intermediate buffer, which is 21 | /// expensive. 22 | @override 23 | double get opacity => _opacity ?? 1.0; 24 | double? _opacity; 25 | set opacity(double? value) { 26 | if (_opacity == value) return; 27 | 28 | _opacity = value; 29 | int alpha = ui.Color.getAlphaFromOpacity(opacity); 30 | renderBoxModel!.alpha = alpha; 31 | 32 | // Mark the compositing state for this render object as dirty 33 | // cause it will create new layer when opacity is valid. 34 | if (alpha != 0 && alpha != 255) { 35 | renderBoxModel?.markNeedsCompositingBitsUpdate(); 36 | } 37 | // Opacity effect the stacking context. 38 | RenderBoxModel? parentRenderer = parent?.renderBoxModel; 39 | if (parentRenderer is RenderLayoutBox) { 40 | parentRenderer.markChildrenNeedsSort(); 41 | } 42 | 43 | renderBoxModel?.markNeedsPaint(); 44 | } 45 | 46 | static double? resolveOpacity(String value) { 47 | return CSSStyleDeclaration.isNullOrEmptyValue(value) ? 1.0 : CSSLength.toDouble(value); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/parser/parser.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | 7 | const int SLASH_CODE = 47; // / 8 | const int NEWLINE_CODE = 10; // \n 9 | const int SPACE_CODE = 32; // ' ' 10 | const int FEED_CODE = 12; // \f 11 | const int TAB_CODE = 9; // \t 12 | const int CR_CODE = 13; // \r 13 | const int OPEN_CURLY_CODE = 123; // { 14 | const int CLOSE_CURLY_CODE = 125; // } 15 | const int SEMICOLON_CODE = 59; // ; 16 | const int ASTERISK_CODE = 42; // * 17 | const int COLON_CODE = 58; // : 18 | const int OPEN_PARENTHESES_CODE = 40; // ( 19 | const int CLOSE_PARENTHESES_CODE = 41; // ) 20 | const int SINGLE_QUOTE_CODE = 39; // '; 21 | const int DOUBLE_QUOTE_CODE = 34; // " 22 | const int HYPHEN_CODE = 45; // - 23 | const int AT_CODE = 64; // @ 24 | const int DOT_CODE = 46; // . 25 | 26 | class CSSParser { 27 | static CSSRule? parseRule(String text, {CSSStyleSheet? parentStyleSheet}) { 28 | // TODO: parse other css rule 29 | CSSStyleRule? rule = CSSStyleRuleParser.parse(text); 30 | if (rule != null) { 31 | rule.parentStyleSheet = parentStyleSheet; 32 | } 33 | return rule; 34 | } 35 | 36 | static List parseRules(String text, {CSSStyleSheet? parentStyleSheet}) { 37 | // TODO: should ingore style rule in at-rules 38 | return CSSStyleSheetParser.parse(text); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/rule.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | 7 | abstract class CSSRule { 8 | String cssText = ''; 9 | CSSStyleSheet? parentStyleSheet; 10 | CSSRule? parentRule; 11 | 12 | // https://drafts.csswg.org/cssom/#dom-cssrule-type 13 | // The following attribute and constants are historical. 14 | int? type; 15 | static const int STYLE_RULE = 1; 16 | static const int CHARSET_RULE = 2; 17 | static const int IMPORT_RULE = 3; 18 | static const int MEDIA_RULE = 4; 19 | static const int FONT_FACE_RULE = 5; 20 | static const int PAGE_RULE = 6; 21 | static const int MARGIN_RULE = 9; 22 | static const int NAMESPACE_RULE = 10; 23 | } 24 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/sliver.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/css.dart'; 8 | 9 | mixin CSSSliverMixin on RenderStyle { 10 | @override 11 | Axis get sliverDirection => _sliverDirection ?? Axis.vertical; 12 | Axis? _sliverDirection; 13 | set sliverDirection(Axis? value) { 14 | if (_sliverDirection == value) return; 15 | _sliverDirection = value; 16 | renderBoxModel?.markNeedsLayout(); 17 | } 18 | 19 | static Axis resolveAxis(String sliverDirection) { 20 | switch (sliverDirection) { 21 | case ROW: 22 | return Axis.horizontal; 23 | 24 | case COLUMN: 25 | default: 26 | return Axis.vertical; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/style_rule.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/css.dart'; 7 | 8 | /// https://drafts.csswg.org/cssom/#the-cssstylerule-interface 9 | class CSSStyleRule extends CSSRule { 10 | final String selectorText; 11 | final Map style; 12 | 13 | CSSStyleRule(this.selectorText, this.style); 14 | } 15 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/style_sheet.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/css.dart'; 7 | 8 | abstract class StyleSheet {} 9 | 10 | const String _CSSStyleSheetType = 'text/css'; 11 | 12 | // https://drafts.csswg.org/cssom-1/#cssstylesheet 13 | class CSSStyleSheet implements StyleSheet { 14 | String type = _CSSStyleSheetType; 15 | 16 | /// A Boolean indicating whether the stylesheet is disabled. False by default. 17 | bool disabled = false; 18 | 19 | /// A string containing the baseURL used to resolve relative URLs in the stylesheet. 20 | String? herf; 21 | 22 | List cssRules = []; 23 | 24 | CSSStyleSheet(String text, {this.disabled = false, this.herf}) { 25 | List rules = CSSParser.parseRules(text, parentStyleSheet: this); 26 | cssRules.addAll(rules); 27 | } 28 | 29 | insertRule(String text, int index) { 30 | CSSRule? rule = CSSParser.parseRule(text); 31 | if (rule != null) { 32 | cssRules.insert(index, rule); 33 | } else { 34 | // TODO: throw error 35 | } 36 | } 37 | 38 | /// Removes a rule from the stylesheet object. 39 | deleteRule(int index) { 40 | cssRules.removeAt(index); 41 | } 42 | 43 | /// Synchronously replaces the content of the stylesheet with the content passed into it. 44 | replaceSync(String text) { 45 | cssRules.clear(); 46 | cssRules.addAll(CSSParser.parseRules(text)); 47 | } 48 | 49 | replace(String text) { 50 | // TODO: put in next frame and return a future 51 | replaceSync(text); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/value.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | 7 | // https://github.com/WebKit/webkit/blob/master/Source/WebCore/css/CSSProperties.json 8 | Map CSSInitialValues = { 9 | BACKGROUND_COLOR: TRANSPARENT, 10 | BACKGROUND_POSITION: '0% 0%', 11 | BORDER_BOTTOM_COLOR: CURRENT_COLOR, 12 | BORDER_LEFT_COLOR: CURRENT_COLOR, 13 | BORDER_RIGHT_COLOR: CURRENT_COLOR, 14 | BORDER_TOP_COLOR: CURRENT_COLOR, 15 | BORDER_BOTTOM_LEFT_RADIUS: ZERO, 16 | BORDER_BOTTOM_RIGHT_RADIUS: ZERO, 17 | BORDER_TOP_LEFT_RADIUS: ZERO, 18 | BORDER_TOP_RIGHT_RADIUS: ZERO, 19 | BORDER_BOTTOM_WIDTH: '3px', 20 | BORDER_RIGHT_WIDTH: '3px', 21 | BORDER_LEFT_WIDTH: '3px', 22 | BORDER_TOP_WIDTH: '3px', 23 | // Depends on user agent. 24 | COLOR: CSSColor.INITIAL_COLOR, 25 | FONT_SIZE: '100%', 26 | FONT_WEIGHT: '400', 27 | LINE_HEIGHT: '120%', 28 | LETTER_SPACING: NORMAL, 29 | PADDING_BOTTOM: ZERO, 30 | PADDING_LEFT: ZERO, 31 | PADDING_RIGHT: ZERO, 32 | PADDING_TOP: ZERO, 33 | MARGIN_BOTTOM: ZERO, 34 | MARGIN_LEFT: ZERO, 35 | MARGIN_RIGHT: ZERO, 36 | MARGIN_TOP: ZERO, 37 | HEIGHT: AUTO, 38 | WIDTH: AUTO, 39 | MAX_HEIGHT: NONE, 40 | MAX_WIDTH: NONE, 41 | MIN_HEIGHT: ZERO, 42 | MIN_WIDTH: ZERO, 43 | OPACITY: '1.0', 44 | LEFT: AUTO, 45 | BOTTOM: AUTO, 46 | RIGHT: AUTO, 47 | TOP: AUTO, 48 | TEXT_SHADOW: '0px 0px 0px transparent', 49 | TRANSFORM: 'matrix3d(${CSSMatrix.initial.storage.join(',')})', 50 | TRANSFORM_ORIGIN: '50% 50% 0', 51 | VERTICAL_ALIGN: ZERO, 52 | VISIBILITY: VISIBLE, 53 | WORD_SPACING: NORMAL, 54 | Z_INDEX: AUTO 55 | }; 56 | 57 | // https://drafts.css-houdini.org/css-properties-values-api/#dependency-cycles 58 | class CSSValue { 59 | String propertyName; 60 | RenderStyle renderStyle; 61 | CSSValue(this.propertyName, this.renderStyle); 62 | } 63 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/angle.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:math' as math; 7 | import 'package:quiver/collection.dart'; 8 | 9 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#angles 10 | const String _DEG = 'deg'; 11 | const String _GRAD = 'grad'; 12 | const String _RAD = 'rad'; 13 | const String _TURN = 'turn'; 14 | 15 | final LinkedLruHashMap _cachedParsedAngle = LinkedLruHashMap(maximumSize: 100); 16 | 17 | class CSSAngle { 18 | /// Judge a string is an angle. 19 | static bool isAngle(String angle) { 20 | return (angle.endsWith(_DEG) || angle.endsWith(_GRAD) || angle.endsWith(_RAD) || angle.endsWith(_TURN)); 21 | } 22 | 23 | static double? parseAngle(String rawAngleValue) { 24 | if (_cachedParsedAngle.containsKey(rawAngleValue)) { 25 | return _cachedParsedAngle[rawAngleValue]; 26 | } 27 | double? angleValue; 28 | if (rawAngleValue.endsWith(_DEG)) { 29 | angleValue = double.tryParse(rawAngleValue.split(_DEG)[0])! * 2 * math.pi / 360; 30 | } else if (rawAngleValue.endsWith(_GRAD)) { 31 | angleValue = double.tryParse(rawAngleValue.split(_GRAD)[0])! * 2 * math.pi / 400; 32 | } else if (rawAngleValue.endsWith(_RAD)) { 33 | angleValue = double.tryParse(rawAngleValue.split(_RAD)[0]); 34 | } else if (rawAngleValue.endsWith(_TURN)) { 35 | angleValue = double.tryParse(rawAngleValue.split(_TURN)[0])! * 2 * math.pi; 36 | } 37 | 38 | return _cachedParsedAngle[rawAngleValue] = angleValue; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/integer.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#integers 7 | class CSSInteger { 8 | static int? parseInteger(String value) { 9 | return int.tryParse(value); 10 | } 11 | 12 | static bool isInteger(String value) { 13 | return int.tryParse(value) != null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/number.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#numbers 7 | final RegExp _numberRegExp = RegExp(r'^[+-]?(\d+)?(\.\d+)?$'); 8 | 9 | class CSSNumber { 10 | static double? parseNumber(String input) { 11 | return double.tryParse(input); 12 | } 13 | 14 | static bool isNumber(String input) { 15 | return _numberRegExp.hasMatch(input); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/percentage.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#percentages 7 | 8 | import 'package:quiver/collection.dart'; 9 | 10 | final _percentageRegExp = RegExp(r'^[+-]?\d+[\.]?\d*\%$', caseSensitive: false); 11 | final _nonNegativePercentageRegExp = RegExp(r'^[+]?\d+[\.]?\d*\%$', caseSensitive: false); 12 | final LinkedLruHashMap _cachedParsedPercentage = LinkedLruHashMap(maximumSize: 100); 13 | 14 | class CSSPercentage { 15 | static String PERCENTAGE = '%'; 16 | 17 | static double? parsePercentage(String value) { 18 | if (_cachedParsedPercentage.containsKey(value)) { 19 | return _cachedParsedPercentage[value]; 20 | } 21 | double? parsed; 22 | if (value.endsWith(PERCENTAGE)) { 23 | parsed = double.tryParse(value.split(PERCENTAGE)[0])! / 100; 24 | } 25 | return _cachedParsedPercentage[value] = parsed; 26 | } 27 | 28 | static bool isPercentage(String? percentageValue) { 29 | return percentageValue != null && _percentageRegExp.hasMatch(percentageValue); 30 | } 31 | 32 | static bool isNonNegativePercentage(String? percentageValue) { 33 | return percentageValue != null && _nonNegativePercentageRegExp.hasMatch(percentageValue); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/textual.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#common-keywords 7 | 8 | final _customIdentRegExp = RegExp(r'^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$', caseSensitive: false); 9 | final _dashedIdentRegExp = RegExp(r'^--[_a-zA-Z]+[_a-zA-Z0-9-]*$', caseSensitive: false); 10 | 11 | /// All of these keywords are normatively defined in the Cascade module. 12 | enum CSSWideKeywords { 13 | /// The initial keyword represents the value specified as the property’s 14 | /// initial value. 15 | initial, 16 | 17 | /// The inherit keyword represents the computed value of the property on 18 | /// the element’s parent. 19 | inherit, 20 | 21 | /// The unset keyword acts as either inherit or initial, depending on whether 22 | /// the property is inherited or not. 23 | unset, 24 | } 25 | 26 | class CSSTextual { 27 | static bool isCustomIdent(String value) { 28 | return _customIdentRegExp.hasMatch(value); 29 | } 30 | 31 | static bool isDashedIdent(String value) { 32 | return _dashedIdentRegExp.hasMatch(value); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/time.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:quiver/collection.dart'; 7 | 8 | final _timeRegExp = RegExp(r'^[+-]?(\d+)?(\.\d+)?ms|s$', caseSensitive: false); 9 | final _0s = '0s'; 10 | final _0ms = '0ms'; 11 | final LinkedLruHashMap _cachedParsedTime = LinkedLruHashMap(maximumSize: 100); 12 | 13 | // CSS Values and Units: https://drafts.csswg.org/css-values-3/#time 14 | class CSSTime { 15 | static const String MILLISECONDS = 'ms'; 16 | static const String SECOND = 's'; 17 | 18 | static bool isTime(String value) { 19 | return (value == _0s || value == _0ms || _timeRegExp.firstMatch(value) != null); 20 | } 21 | 22 | static int? parseTime(String input) { 23 | if (_cachedParsedTime.containsKey(input)) { 24 | return _cachedParsedTime[input]; 25 | } 26 | int? milliseconds; 27 | if (input.endsWith(MILLISECONDS)) { 28 | milliseconds = double.tryParse(input.split(MILLISECONDS)[0])!.toInt(); 29 | } else if (input.endsWith(SECOND)) { 30 | milliseconds = (double.tryParse(input.split(SECOND)[0])! * 1000).toInt(); 31 | } 32 | 33 | return _cachedParsedTime[input] = milliseconds; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/values/variable.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/css.dart'; 7 | 8 | const int _HYPHEN_CODE = 45; // - 9 | 10 | // https://www.w3.org/TR/css-variables-1/#defining-variables 11 | class CSSVariable { 12 | static bool isVariable(String? value) { 13 | if (value == null) { 14 | return false; 15 | } 16 | return value.length > 2 && value.codeUnitAt(0) == _HYPHEN_CODE && value.codeUnitAt(1) == _HYPHEN_CODE; 17 | } 18 | 19 | // Try to parse CSSVariable. 20 | static CSSVariable? tryParse(RenderStyle renderStyle, String propertyName, String propertyValue) { 21 | // font-size: var(--x); 22 | // font-size: var(--x, 28px); 23 | if (CSSFunction.isFunction(propertyValue, functionName: VAR)) { 24 | List fns = CSSFunction.parseFunction(propertyValue); 25 | if (fns.first.args.isNotEmpty) { 26 | if (fns.first.args.length > 1) { 27 | // Has default value for CSS Variable. 28 | return CSSVariable(fns.first.args.first, renderStyle, defaultValue: fns.first.args.last); 29 | } else { 30 | return CSSVariable(fns.first.args.first, renderStyle); 31 | } 32 | } 33 | } 34 | return null; 35 | } 36 | 37 | final String identifier; 38 | final String? defaultValue; 39 | final RenderStyle _renderStyle; 40 | 41 | CSSVariable(this.identifier, this._renderStyle, {this.defaultValue}); 42 | 43 | // Get the lazy calculated CSS resolved value. 44 | dynamic computedValue(String propertyName) { 45 | String? unsolvedValue = _renderStyle.getCSSVariable(identifier, propertyName) ?? defaultValue; 46 | if (unsolvedValue == null) { 47 | return null; 48 | } 49 | 50 | var resolved = _renderStyle.resolveValue(propertyName, unsolvedValue); 51 | if (resolved is CSSVariable) { 52 | return resolved.computedValue(propertyName); 53 | } else { 54 | return resolved; 55 | } 56 | } 57 | 58 | @override 59 | String toString() { 60 | return 'var($identifier${defaultValue != null ? ', $defaultValue' : ''})'; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/variable.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:collection'; 7 | import 'render_style.dart'; 8 | 9 | mixin CSSVariableMixin on RenderStyle { 10 | Map? _storage; 11 | final Map> _propertyDependencies = {}; 12 | 13 | void _addDependency(String identifier, String propertyName) { 14 | List? dep = _propertyDependencies[identifier]; 15 | if (dep == null) { 16 | _propertyDependencies[identifier] = [propertyName]; 17 | } else if (!dep.contains(propertyName)) { 18 | dep.add(propertyName); 19 | } 20 | } 21 | 22 | @override 23 | String? getCSSVariable(String identifier, String propertyName) { 24 | Map? storage = _storage; 25 | _addDependency(identifier, propertyName); 26 | 27 | if (storage != null && storage.containsKey(identifier)) { 28 | return storage[identifier]; 29 | } else { 30 | // Inherits from renderStyle tree. 31 | return parent?.getCSSVariable(identifier, propertyName); 32 | } 33 | } 34 | 35 | // --x: red 36 | // key: --x 37 | // value: red 38 | @override 39 | void setCSSVariable(String identifier, String value) { 40 | _storage ??= HashMap(); 41 | _storage![identifier] = value; 42 | 43 | if (_propertyDependencies.containsKey(identifier)) { 44 | _notifyCSSVariableChanged(_propertyDependencies[identifier]!, value); 45 | } 46 | } 47 | 48 | void _notifyCSSVariableChanged(List propertyNames, String value) { 49 | propertyNames.forEach((String propertyName) { 50 | target.setRenderStyle(propertyName, value); 51 | visitChildren((CSSRenderStyle childRenderStyle) { 52 | childRenderStyle._notifyCSSVariableChanged(propertyNames, value); 53 | }); 54 | }); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/css/visibility.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | 7 | enum Visibility { 8 | visible, 9 | hidden, 10 | } 11 | 12 | mixin CSSVisibilityMixin on RenderStyle { 13 | Visibility? _visibility; 14 | 15 | set visibility(Visibility? value) { 16 | if (_visibility == value) return; 17 | _visibility = value; 18 | renderBoxModel?.markNeedsPaint(); 19 | } 20 | 21 | @override 22 | Visibility get visibility => _visibility ?? Visibility.visible; 23 | 24 | bool get isVisibilityHidden => _visibility == Visibility.hidden; 25 | 26 | static Visibility resolveVisibility(String value) { 27 | switch (value) { 28 | case HIDDEN: 29 | return Visibility.hidden; 30 | case VISIBLE: 31 | default: 32 | return Visibility.visible; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/module.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:convert'; 7 | 8 | import 'package:webf/devtools.dart'; 9 | 10 | abstract class _InspectorModule { 11 | String get name; 12 | 13 | bool _enable = false; 14 | 15 | void invoke(int? id, String method, Map? params) { 16 | switch (method) { 17 | case 'enable': 18 | _enable = true; 19 | sendToFrontend(id, null); 20 | break; 21 | case 'disable': 22 | _enable = false; 23 | sendToFrontend(id, null); 24 | break; 25 | 26 | default: 27 | if (_enable) receiveFromFrontend(id, method, params); 28 | } 29 | } 30 | 31 | void sendToFrontend(int? id, JSONEncodable? result); 32 | void sendEventToFrontend(InspectorEvent event); 33 | void receiveFromFrontend(int? id, String method, Map? params); 34 | } 35 | 36 | // Inspector modules working on flutter.ui thread. 37 | abstract class UIInspectorModule extends _InspectorModule { 38 | final ChromeDevToolsService devtoolsService; 39 | UIInspectorModule(this.devtoolsService); 40 | 41 | @override 42 | void sendToFrontend(int? id, JSONEncodable? result) { 43 | devtoolsService.isolateServerPort!.send(InspectorMethodResult(id, result?.toJson())); 44 | } 45 | 46 | @override 47 | void sendEventToFrontend(InspectorEvent event) { 48 | devtoolsService.isolateServerPort?.send(event); 49 | } 50 | } 51 | 52 | // Inspector modules working on dart isolates 53 | abstract class IsolateInspectorModule extends _InspectorModule { 54 | IsolateInspectorModule(this.server); 55 | 56 | final IsolateInspectorServer server; 57 | 58 | @override 59 | void sendToFrontend(int? id, JSONEncodable? result) { 60 | server.sendToFrontend(id, result?.toJson()); 61 | } 62 | 63 | @override 64 | void sendEventToFrontend(InspectorEvent event) { 65 | server.sendEventToFrontend(event); 66 | } 67 | 68 | void callNativeInspectorMethod(int? id, String method, Map? params) { 69 | assert(server.nativeInspectorMessageHandler != null); 70 | server.nativeInspectorMessageHandler!(jsonEncode({'id': id, 'method': name + '.' + method, 'params': params})); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/modules/debugger.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/devtools.dart'; 7 | 8 | class InspectDebuggerModule extends IsolateInspectorModule { 9 | InspectDebuggerModule(IsolateInspectorServer server) : super(server); 10 | 11 | @override 12 | String get name => 'Debugger'; 13 | 14 | @override 15 | void receiveFromFrontend(int? id, String method, Map? params) { 16 | callNativeInspectorMethod(id, method, params); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/modules/log.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/devtools.dart'; 7 | 8 | class InspectLogModule extends UIInspectorModule { 9 | InspectLogModule(ChromeDevToolsService server) : super(server) { 10 | devtoolsService.controller!.onJSLog = (level, message) { 11 | handleMessage(level, message); 12 | }; 13 | } 14 | 15 | void handleMessage(int level, String message) { 16 | sendEventToFrontend(LogEntryEvent( 17 | text: message, 18 | level: getLevelStr(level), 19 | )); 20 | } 21 | 22 | /// Log = 1, 23 | /// Warning = 2, 24 | /// Error = 3, 25 | /// Debug = 4, 26 | /// Info = 5, 27 | String getLevelStr(int level) { 28 | switch (level) { 29 | case 1: 30 | return 'verbose'; 31 | case 2: 32 | return 'warning'; 33 | case 3: 34 | return 'error'; 35 | case 4: 36 | return 'verbose'; 37 | case 5: 38 | return 'info'; 39 | default: 40 | return 'verbose'; 41 | } 42 | } 43 | 44 | @override 45 | String get name => 'Log'; 46 | 47 | @override 48 | void receiveFromFrontend(int? id, String method, Map? params) { 49 | // callNativeInspectorMethod(id, method, params); 50 | } 51 | } 52 | 53 | class LogEntryEvent extends InspectorEvent { 54 | // Allowed Values: xml, javascript, network, storage, appcache, 55 | // rendering, security, deprecation, worker, violation, intervention, 56 | // recommendation, other 57 | String source; 58 | 59 | // Allowed Values: verbose, info, warning, error 60 | String level; 61 | 62 | // The output text. 63 | String text; 64 | 65 | String? url; 66 | 67 | LogEntryEvent({ 68 | required this.level, 69 | required this.text, 70 | this.source = 'javascript', 71 | this.url, 72 | }); 73 | 74 | @override 75 | String get method => 'Log.entryAdded'; 76 | 77 | @override 78 | JSONEncodable? get params => JSONEncodableMap({ 79 | 'entry': { 80 | 'source': source, 81 | 'level': level, 82 | 'text': text, 83 | 'timestamp': DateTime.now().millisecondsSinceEpoch, 84 | if (url != null) 'url': url, 85 | }, 86 | }); 87 | } 88 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/modules/overlay.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/devtools.dart'; 8 | 9 | class InspectOverlayModule extends UIInspectorModule { 10 | @override 11 | String get name => 'Overlay'; 12 | 13 | Document get document => devtoolsService.controller!.view.document; 14 | InspectOverlayModule(ChromeDevToolsService devtoolsService) : super(devtoolsService); 15 | 16 | @override 17 | void receiveFromFrontend(int? id, String method, Map? params) { 18 | switch (method) { 19 | case 'highlightNode': 20 | onHighlightNode(id, params!); 21 | break; 22 | case 'hideHighlight': 23 | onHideHighlight(id); 24 | break; 25 | } 26 | } 27 | 28 | Element? _highlightElement; 29 | 30 | /// https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-highlightNode 31 | void onHighlightNode(int? id, Map params) { 32 | _highlightElement?.debugHideHighlight(); 33 | 34 | int nodeId = params['nodeId']; 35 | Element? element = document.controller.view.getEventTargetById(nodeId); 36 | 37 | if (element != null) { 38 | element.debugHighlight(); 39 | _highlightElement = element; 40 | } 41 | sendToFrontend(id, null); 42 | } 43 | 44 | void onHideHighlight(int? id) { 45 | _highlightElement?.debugHideHighlight(); 46 | _highlightElement = null; 47 | sendToFrontend(id, null); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/modules/profiler.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/modules/runtime.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/devtools.dart'; 7 | 8 | class InspectRuntimeModule extends IsolateInspectorModule { 9 | InspectRuntimeModule(IsolateInspectorServer server) : super(server); 10 | 11 | @override 12 | String get name => 'Runtime'; 13 | 14 | @override 15 | void receiveFromFrontend(int? id, String method, Map? params) { 16 | callNativeInspectorMethod(id, method, params); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/devtools/overlay.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui'; 6 | 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/foundation.dart'; 9 | 10 | const Color _kHighlightedRenderObjectFillColor = Color.fromARGB(128, 128, 128, 255); 11 | const Color _kHighlightedRenderObjectBorderColor = Color.fromARGB(128, 64, 64, 128); 12 | 13 | class InspectorOverlayLayer extends Layer { 14 | /// Creates a layer that displays the inspector overlay. 15 | InspectorOverlayLayer({required this.overlayRect}) { 16 | bool inDebugMode = kDebugMode || kProfileMode; 17 | if (inDebugMode == false) { 18 | throw FlutterError.fromParts([ 19 | ErrorSummary('The inspector should never be used in production mode due to the ' 20 | 'negative performance impact.'), 21 | ]); 22 | } 23 | } 24 | 25 | /// The rectangle in this layer's coordinate system that the overlay should 26 | /// occupy. 27 | /// 28 | /// The scene must be explicitly recomposited after this property is changed 29 | /// (as described at [Layer]). 30 | final Rect overlayRect; 31 | 32 | late Picture _picture; 33 | 34 | @override 35 | void addToScene(SceneBuilder builder, [Offset layerOffset = Offset.zero]) { 36 | _picture = _buildPicture(); 37 | builder.addPicture(layerOffset, _picture); 38 | } 39 | 40 | Picture _buildPicture() { 41 | final PictureRecorder recorder = PictureRecorder(); 42 | final Canvas canvas = Canvas(recorder, overlayRect); 43 | 44 | final Paint fillPaint = Paint() 45 | ..style = PaintingStyle.fill 46 | ..color = _kHighlightedRenderObjectFillColor; 47 | 48 | final Paint borderPaint = Paint() 49 | ..style = PaintingStyle.stroke 50 | ..strokeWidth = 1.0 51 | ..color = _kHighlightedRenderObjectBorderColor; 52 | 53 | // Highlight the selected renderObject. 54 | canvas 55 | ..save() 56 | // ..transform(state.selected.transform.storage) 57 | ..drawRect(overlayRect, fillPaint) 58 | ..drawRect(overlayRect, borderPaint) 59 | ..restore(); 60 | 61 | return recorder.endRecording(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/bounding_client_rect.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ffi'; 6 | 7 | import 'package:ffi/ffi.dart'; 8 | import 'package:webf/bridge.dart'; 9 | 10 | class BoundingClientRect { 11 | static const BoundingClientRect zero = BoundingClientRect(0, 0, 0, 0, 0, 0, 0, 0); 12 | 13 | final double x; 14 | final double y; 15 | final double width; 16 | final double height; 17 | final double top; 18 | final double right; 19 | final double bottom; 20 | final double left; 21 | 22 | const BoundingClientRect(this.x, this.y, this.width, this.height, this.top, this.right, this.bottom, this.left); 23 | 24 | Pointer toNative() { 25 | Pointer nativeBoundingClientRect = 26 | malloc.allocate(sizeOf()); 27 | nativeBoundingClientRect.ref.width = width; 28 | nativeBoundingClientRect.ref.height = height; 29 | nativeBoundingClientRect.ref.x = x; 30 | nativeBoundingClientRect.ref.y = y; 31 | nativeBoundingClientRect.ref.top = top; 32 | nativeBoundingClientRect.ref.right = right; 33 | nativeBoundingClientRect.ref.left = left; 34 | nativeBoundingClientRect.ref.bottom = bottom; 35 | return nativeBoundingClientRect; 36 | } 37 | 38 | Map toJSON() { 39 | return { 40 | 'x': x, 41 | 'y': y, 42 | 'width': width, 43 | 'height': height, 44 | 'left': left, 45 | 'top': top, 46 | 'right': right, 47 | 'bottom': bottom 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/comment.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:flutter/rendering.dart'; 6 | import 'package:webf/dom.dart'; 7 | 8 | class Comment extends Node { 9 | Comment([context]) : super(NodeType.COMMENT_NODE, context); 10 | 11 | @override 12 | String get nodeName => '#comment'; 13 | 14 | @override 15 | RenderBox? get renderer => null; 16 | 17 | // @TODO: Get data from bridge side. 18 | String get data => ''; 19 | 20 | int get length => data.length; 21 | } 22 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/document_fragment.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/dom.dart'; 8 | 9 | const String DOCUMENT_FRAGMENT = 'DOCUMENTFRAGMENT'; 10 | 11 | class DocumentFragment extends Node { 12 | DocumentFragment([context]) : super(NodeType.COMMENT_NODE, context); 13 | 14 | @override 15 | String get nodeName => '#documentfragment'; 16 | 17 | @override 18 | RenderBox? get renderer => null; 19 | } 20 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/body.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | const String BODY = 'BODY'; 10 | 11 | const Map _defaultStyle = { 12 | DISPLAY: BLOCK, 13 | }; 14 | 15 | class BodyElement extends Element { 16 | BodyElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 17 | 18 | @override 19 | void addEventListener(String eventType, EventHandler eventHandler) { 20 | // Scroll event not working on body. 21 | if (eventType == EVENT_SCROLL) return; 22 | 23 | super.addEventListener(eventType, eventHandler); 24 | } 25 | 26 | @override 27 | void setRenderStyle(String property, String present) { 28 | switch (property) { 29 | // The overflow of body should apply to html. 30 | // https://drafts.csswg.org/css-overflow-3/#overflow-propagation 31 | case OVERFLOW: 32 | case OVERFLOW_X: 33 | case OVERFLOW_Y: 34 | ownerDocument.documentElement?.setRenderStyle(property, present); 35 | break; 36 | default: 37 | super.setRenderStyle(property, present); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/edits.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#demarcating_edits 10 | const String DEL = 'DEL'; 11 | const String INS = 'INS'; 12 | 13 | const Map _insDefaultStyle = {TEXT_DECORATION: UNDERLINE}; 14 | 15 | const Map _delDefaultStyle = {TEXT_DECORATION: LINE_THROUGH}; 16 | 17 | class DelElement extends Element { 18 | DelElement([BindingContext? context]) : super(context, defaultStyle: _delDefaultStyle); 19 | } 20 | 21 | class InsElement extends Element { 22 | InsElement([BindingContext? context]) : super(context, defaultStyle: _insDefaultStyle); 23 | } 24 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/forms.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | const String LABEL = 'LABEL'; 10 | const String BUTTON = 'BUTTON'; 11 | 12 | const Map _defaultStyle = {DISPLAY: INLINE_BLOCK}; 13 | 14 | class LabelElement extends Element { 15 | LabelElement([BindingContext? context]) : super(context); 16 | } 17 | 18 | class ButtonElement extends Element { 19 | ButtonElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 20 | } 21 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/html.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | const String HTML = 'HTML'; 10 | const Map _defaultStyle = { 11 | DISPLAY: BLOCK, 12 | }; 13 | 14 | class HTMLElement extends Element { 15 | static Map defaultStyle = _defaultStyle; 16 | HTMLElement([BindingContext? context]) : super(context, defaultStyle: defaultStyle); 17 | 18 | @override 19 | void dispatchEvent(Event event) { 20 | // Scroll event proxy to document. 21 | if (event.type == EVENT_SCROLL) { 22 | // https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-scroll 23 | // When dispatched on the Document element, this event type must bubble to the Window object. 24 | event.bubbles = true; 25 | ownerDocument.dispatchEvent(event); 26 | return; 27 | } 28 | super.dispatchEvent(event); 29 | } 30 | 31 | @override 32 | void setRenderStyle(String property, String present) { 33 | switch (property) { 34 | // Visible should be interpreted as auto and clip should be interpreted as hidden when overflow apply to html. 35 | // https://drafts.csswg.org/css-overflow-3/#overflow-propagation 36 | case OVERFLOW: 37 | case OVERFLOW_X: 38 | case OVERFLOW_Y: 39 | if (present == VISIBLE || present == '') { 40 | present = AUTO; 41 | } else if (present == CLIP) { 42 | present = HIDDEN; 43 | } 44 | break; 45 | } 46 | super.setRenderStyle(property, present); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/sections.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#content_sectioning 10 | 11 | const String ADDRESS = 'ADDRESS'; 12 | const String ARTICLE = 'ARTICLE'; 13 | const String ASIDE = 'ASIDE'; 14 | const String FOOTER = 'FOOTER'; 15 | const String HEADER = 'HEADER'; 16 | const String MAIN = 'MAIN'; 17 | const String NAV = 'NAV'; 18 | const String SECTION = 'SECTION'; 19 | 20 | const Map _defaultStyle = { 21 | DISPLAY: BLOCK, 22 | }; 23 | 24 | const Map _addressDefaultStyle = {DISPLAY: BLOCK, FONT_STYLE: ITALIC}; 25 | 26 | class AddressElement extends Element { 27 | AddressElement([BindingContext? context]) : super(context, defaultStyle: _addressDefaultStyle); 28 | } 29 | 30 | class ArticleElement extends Element { 31 | ArticleElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 32 | } 33 | 34 | class AsideElement extends Element { 35 | AsideElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 36 | } 37 | 38 | class FooterElement extends Element { 39 | FooterElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 40 | } 41 | 42 | class HeaderElement extends Element { 43 | HeaderElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 44 | } 45 | 46 | class MainElement extends Element { 47 | MainElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 48 | } 49 | 50 | class NavElement extends Element { 51 | NavElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 52 | } 53 | 54 | class SectionElement extends Element { 55 | SectionElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 56 | } 57 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/elements/template.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/css.dart'; 6 | import 'package:webf/dom.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | const String TEMPLATE = 'TEMPLATE'; 10 | 11 | const Map _defaultStyle = { 12 | DISPLAY: NONE, 13 | }; 14 | 15 | class TemplateElement extends Element { 16 | TemplateElement([BindingContext? context]) : super(context, defaultStyle: _defaultStyle); 17 | } 18 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/object_element_client.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/dom.dart'; 8 | 9 | typedef ObjectElementClientFactory = ObjectElementClient Function(ObjectElementHost objectElementHost); 10 | 11 | ObjectElementClientFactory? _objectElementFactory; 12 | 13 | ObjectElementClientFactory? getObjectElementClientFactory() { 14 | return _objectElementFactory; 15 | } 16 | 17 | void setObjectElementFactory(ObjectElementClientFactory factory) { 18 | _objectElementFactory = factory; 19 | } 20 | 21 | abstract class ObjectElementHost implements EventTarget { 22 | updateChildTextureBox(TextureBox? textureBox); 23 | } 24 | 25 | abstract class ObjectElementClient { 26 | Future initElementClient(Map properties); 27 | 28 | dynamic handleJSCall(String method, List argv); 29 | 30 | void setStyle(String key, value); 31 | 32 | void dispose(); 33 | 34 | void setProperty(String key, value); 35 | 36 | dynamic getProperty(String key); 37 | 38 | void removeProperty(String key); 39 | 40 | void willAttachRenderer(); 41 | void didAttachRenderer(); 42 | void willDetachRenderer(); 43 | void didDetachRenderer(); 44 | } 45 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/dom/screen.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-present Alibaba Inc. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui'; 6 | 7 | import 'package:webf/foundation.dart'; 8 | 9 | // As its name suggests, the Screen interface represents information about the screen of the output device. 10 | // https://drafts.csswg.org/cssom-view/#the-screen-interface 11 | class Screen extends BindingObject { 12 | Screen([BindingContext? context]) : super(context); 13 | 14 | @override 15 | getBindingProperty(String key) { 16 | switch (key) { 17 | case 'availWidth': 18 | return availWidth; 19 | case 'availHeight': 20 | return availHeight; 21 | case 'width': 22 | return width; 23 | case 'height': 24 | return height; 25 | default: 26 | return super.getBindingProperty(key); 27 | } 28 | } 29 | 30 | // The availWidth attribute must return the width of the Web-exposed available screen area. 31 | // The Web-exposed available screen area is one of the following: 32 | // - The available area of the rendering surface of the output device, in CSS pixels. 33 | // - The area of the output device, in CSS pixels. 34 | // - The area of the viewport, in CSS pixels. 35 | // @NOTE: Why using physicalSize: in most cases, kraken is integrated into host native app, 36 | // so the size of kraken view is depending on how big is the flutter view, for users 37 | // they can not adjust size of kraken view. The [window.physicalSize] is the size of 38 | // native flutter view. (@zeroling) 39 | int get availWidth => window.physicalSize.width ~/ window.devicePixelRatio; 40 | 41 | // The availHeight attribute must return the height of the Web-exposed available screen area. 42 | int get availHeight => window.physicalSize.height ~/ window.devicePixelRatio; 43 | 44 | // The width attribute must return the width of the Web-exposed screen area. 45 | // The Web-exposed screen area is one of the following: 46 | // - The area of the output device, in CSS pixels. 47 | // - The area of the viewport, in CSS pixels. 48 | int get width => window.physicalSize.width ~/ window.devicePixelRatio; 49 | 50 | // The height attribute must return the height of the Web-exposed screen area. 51 | int get height => window.physicalSize.height ~/ window.devicePixelRatio; 52 | } 53 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/binding.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:flutter/foundation.dart'; 6 | 7 | typedef BindingObjectOperation = void Function(BindingObject bindingObject); 8 | 9 | class BindingContext { 10 | final int contextId; 11 | final pointer; 12 | const BindingContext(this.contextId, this.pointer); 13 | } 14 | 15 | abstract class BindingObject { 16 | static BindingObjectOperation? bind; 17 | static BindingObjectOperation? unbind; 18 | 19 | final BindingContext? _context; 20 | 21 | int? get contextId => _context?.contextId; 22 | get pointer => _context?.pointer; 23 | 24 | BindingObject([BindingContext? context]) : _context = context { 25 | _bind(); 26 | } 27 | 28 | // Bind dart side object method to receive invoking from native side. 29 | void _bind() { 30 | if (bind != null) { 31 | bind!(this); 32 | } 33 | } 34 | 35 | void _unbind() { 36 | if (unbind != null) { 37 | unbind!(this); 38 | } 39 | } 40 | 41 | // Get a property, eg: 42 | // console.log(el.foo); 43 | dynamic getBindingProperty(String key) {} 44 | 45 | // Set a property, eg: 46 | // el.foo = 'bar'; 47 | void setBindingProperty(String key, value) {} 48 | 49 | // Call a method, eg: 50 | // el.getContext('2x'); 51 | dynamic invokeBindingMethod(String method, List args) {} 52 | 53 | @mustCallSuper 54 | void dispose() { 55 | _unbind(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/convert.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:async'; 6 | import 'dart:convert'; 7 | 8 | import 'package:flutter/foundation.dart'; 9 | 10 | FutureOr resolveStringFromData(final List data, {Codec codec = utf8, bool preferSync = false}) async { 11 | if (codec == utf8) { 12 | return _resolveUtf8StringFromData(data, preferSync); 13 | } else { 14 | return codec.decode(data); 15 | } 16 | } 17 | 18 | Future _resolveUtf8StringFromData(final List data, [bool preferSync = false]) async { 19 | // reference: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/asset_bundle.dart#L71 20 | // 50 KB of data should take 2-3 ms to parse on a Moto G4, and about 400 μs 21 | // on a Pixel 4. 22 | if (preferSync || data.length < 50 * 1024) { 23 | return utf8.decode(data); 24 | } 25 | // For strings larger than 50 KB, run the computation in an isolate to 26 | // avoid causing main thread jank. 27 | return compute(_utf8decode, data); 28 | } 29 | 30 | String _utf8decode(List data) => utf8.decode(data); 31 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/environment.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/foundation.dart'; 7 | import 'package:flutter/services.dart'; 8 | 9 | String? _webfTemporaryPath; 10 | Future getWebFTemporaryPath() async { 11 | if (_webfTemporaryPath == null) { 12 | String? temporaryDirectory = await getWebFMethodChannel().invokeMethod('getTemporaryDirectory'); 13 | if (temporaryDirectory == null) { 14 | throw FlutterError('Can\'t get temporary directory from native side.'); 15 | } 16 | _webfTemporaryPath = temporaryDirectory; 17 | } 18 | return _webfTemporaryPath!; 19 | } 20 | 21 | MethodChannel _methodChannel = const MethodChannel('webf'); 22 | MethodChannel getWebFMethodChannel() { 23 | return _methodChannel; 24 | } 25 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/http_client_interceptor.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:io'; 6 | 7 | abstract class HttpClientInterceptor { 8 | /// @params 9 | /// kraken: The `Kraken` widget that is requesting the resource. 10 | /// request: [HttpClientRequest] that containing the detail of the request. 11 | /// @return newRequest: A [HttpClientRequest] containing the response information or null if the kraken should load the resource itself. 12 | Future beforeRequest(HttpClientRequest request); 13 | 14 | /// @params 15 | /// kraken: The `Kraken` widget that is requesting the resource. 16 | /// request: [HttpClientResponse] that containing the detail of the request. 17 | /// @return newRequest: A [HttpClientResponse] containing the response information or null if the kraken should load the resource itself. 18 | Future afterResponse(HttpClientRequest request, HttpClientResponse response); 19 | 20 | Future shouldInterceptRequest(HttpClientRequest request); 21 | } 22 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/type.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui'; 6 | 7 | // Cast any input type to determined type. 8 | T castToType(value) { 9 | assert(value is T, '$value is not or not a subtype of $T'); 10 | return value as T; 11 | } 12 | 13 | class Dimension { 14 | const Dimension(this.width, this.height); 15 | 16 | final int width; 17 | final int height; 18 | 19 | @override 20 | bool operator ==(Object other) { 21 | return other is Dimension && other.width == width && other.height == height; 22 | } 23 | 24 | @override 25 | int get hashCode => hashValues(width, height); 26 | } 27 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/foundation/uri_parser.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | class UriParser { 7 | Uri resolve(Uri base, Uri relative) { 8 | final Uri uri = base.resolveUri(relative); 9 | assert(uri.hasScheme); 10 | return uri; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/gesture/scroll_context.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | // Copyright 2014 The Flutter Authors. All rights reserved. 6 | // Use of this source code is governed by a BSD-style license that can be 7 | // found in the LICENSE file. 8 | 9 | import 'package:flutter/rendering.dart'; 10 | import 'package:flutter/scheduler.dart'; 11 | 12 | /// An interface that [Scrollable] widgets implement in order to use 13 | /// [ScrollPosition]. 14 | /// 15 | /// See also: 16 | /// 17 | /// * [ScrollableState], which is the most common implementation of this 18 | /// interface. 19 | /// * [ScrollPosition], which uses this interface to communicate with the 20 | /// scrollable widget. 21 | abstract class ScrollContext { 22 | /// A [TickerProvider] to use when animating the scroll position. 23 | TickerProvider get vsync; 24 | 25 | /// The direction in which the widget scrolls. 26 | AxisDirection get axisDirection; 27 | 28 | /// Whether the user can drag the widget, for example to initiate a scroll. 29 | void setCanDrag(bool value); 30 | 31 | /// Set the [SemanticsAction]s that should be expose to the semantics tree. 32 | void setSemanticsActions(Set? actions); 33 | } 34 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/module/clipboard.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/services.dart'; 7 | import 'package:webf/src/module/module_manager.dart'; 8 | 9 | class ClipBoardModule extends BaseModule { 10 | @override 11 | String get name => 'Clipboard'; 12 | ClipBoardModule(ModuleManager? moduleManager) : super(moduleManager); 13 | 14 | static Future readText() async { 15 | ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain); 16 | if (data == null) return ''; 17 | return data.text ?? ''; 18 | } 19 | 20 | static Future writeText(String text) async { 21 | await Clipboard.setData(ClipboardData(text: text)); 22 | } 23 | 24 | @override 25 | void dispose() {} 26 | 27 | @override 28 | String invoke(String method, params, callback) { 29 | if (method == 'readText') { 30 | ClipBoardModule.readText().then((String value) { 31 | callback(data: value); 32 | }).catchError((e, stack) { 33 | callback(error: '$e\n$stack'); 34 | }); 35 | } else if (method == 'writeText') { 36 | ClipBoardModule.writeText(params).then((_) { 37 | callback(); 38 | }).catchError((e, stack) { 39 | callback(error: ''); 40 | }); 41 | } 42 | return ''; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/module/connection.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:connectivity_plus/connectivity_plus.dart'; 7 | 8 | import 'module_manager.dart'; 9 | 10 | Map _getResult(ConnectivityResult connectivityResult) { 11 | String type = _parseConnectivityResult(connectivityResult); 12 | return {'isConnected': ConnectivityResult.none != connectivityResult, 'type': type}; 13 | } 14 | 15 | String _parseConnectivityResult(ConnectivityResult state) { 16 | switch (state) { 17 | case ConnectivityResult.wifi: 18 | return 'wifi'; 19 | case ConnectivityResult.mobile: 20 | return 'cellular'; 21 | case ConnectivityResult.none: 22 | default: 23 | return 'none'; 24 | } 25 | } 26 | 27 | typedef OnConnectivityChangedCallback = void Function(Map json); 28 | 29 | class ConnectionModule extends BaseModule { 30 | @override 31 | String get name => 'Connection'; 32 | 33 | static Connectivity? _connectivity; 34 | 35 | static void _initConnectivity() { 36 | _connectivity ??= Connectivity(); 37 | } 38 | 39 | static void getConnectivity(OnConnectivityChangedCallback callback) { 40 | _initConnectivity(); 41 | _connectivity!.checkConnectivity().then((ConnectivityResult connectivityResult) { 42 | callback(_getResult(connectivityResult)); 43 | }); 44 | } 45 | 46 | static void onConnectivityChanged(OnConnectivityChangedCallback callback) { 47 | _initConnectivity(); 48 | _connectivity!.onConnectivityChanged.listen((ConnectivityResult connectivityResul) { 49 | Map json = _getResult(connectivityResul); 50 | callback(json); 51 | }); 52 | } 53 | 54 | ConnectionModule(ModuleManager? moduleManager) : super(moduleManager); 55 | 56 | @override 57 | void dispose() {} 58 | 59 | @override 60 | String invoke(String method, params, InvokeModuleCallback callback) { 61 | switch (method) { 62 | case 'getConnectivity': 63 | { 64 | getConnectivity((Map json) { 65 | callback(data: json); 66 | }); 67 | break; 68 | } 69 | case 'onConnectivityChanged': 70 | { 71 | onConnectivityChanged((Map data) { 72 | moduleManager!.emitModuleEvent(name, data: data); 73 | }); 74 | break; 75 | } 76 | } 77 | 78 | return ''; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/module/location.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'package:webf/module.dart'; 6 | 7 | class LocationModule extends BaseModule { 8 | @override 9 | String get name => 'Location'; 10 | 11 | LocationModule(ModuleManager? moduleManager) : super(moduleManager); 12 | 13 | String get href => moduleManager!.controller.url; 14 | 15 | @override 16 | String invoke(String method, params, InvokeModuleCallback callback) { 17 | switch (method) { 18 | case 'getHref': 19 | return href; 20 | default: 21 | return ''; 22 | } 23 | } 24 | 25 | @override 26 | void dispose() {} 27 | } 28 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/module/schedule_frame.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/scheduler.dart'; 7 | 8 | typedef DoubleCallback = void Function(double); 9 | typedef VoidCallback = void Function(); 10 | 11 | mixin ScheduleFrameMixin { 12 | int _id = 1; 13 | final Map _animationFrameCallbackMap = {}; 14 | 15 | int requestAnimationFrame(DoubleCallback callback) { 16 | int id = _id++; 17 | _animationFrameCallbackMap[id] = true; 18 | SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) { 19 | if (_animationFrameCallbackMap.containsKey(id)) { 20 | _animationFrameCallbackMap.remove(id); 21 | double highResTimeStamp = timeStamp.inMicroseconds / 1000; 22 | callback(highResTimeStamp); 23 | } 24 | }); 25 | SchedulerBinding.instance.scheduleFrame(); 26 | return id; 27 | } 28 | 29 | void cancelAnimationFrame(int id) { 30 | if (_animationFrameCallbackMap.containsKey(id)) { 31 | _animationFrameCallbackMap.remove(id); 32 | } 33 | } 34 | 35 | void requestBatchUpdate() { 36 | SchedulerBinding.instance.scheduleFrame(); 37 | } 38 | 39 | void disposeScheduleFrame() { 40 | _animationFrameCallbackMap.clear(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/content_visibility.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/css.dart'; 8 | import 'package:webf/rendering.dart'; 9 | 10 | /// Lays the child out as if it was in the tree, but without painting anything, 11 | /// without making the child available for hit testing, and without taking any 12 | /// room in the parent. 13 | mixin RenderContentVisibilityMixin on RenderBoxModelBase { 14 | bool contentVisibilityHitTest(BoxHitTestResult result, {Offset? position}) { 15 | ContentVisibility? _contentVisibility = renderStyle.contentVisibility; 16 | return _contentVisibility != ContentVisibility.hidden; 17 | } 18 | 19 | void paintContentVisibility(PaintingContext context, Offset offset, PaintingContextCallback callback) { 20 | ContentVisibility? _contentVisibility = renderStyle.contentVisibility; 21 | if (_contentVisibility == ContentVisibility.hidden) { 22 | return; 23 | } 24 | callback(context, offset); 25 | } 26 | 27 | void debugVisibilityProperties(DiagnosticPropertiesBuilder properties) { 28 | properties.add(DiagnosticsProperty('contentVisibility', renderStyle.contentVisibility)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/debug_overlay.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui'; 6 | 7 | import 'package:flutter/foundation.dart'; 8 | import 'package:flutter/rendering.dart'; 9 | 10 | const Color _kHighlightedRenderObjectFillColor = Color.fromARGB(128, 128, 128, 255); 11 | const Color _kHighlightedRenderObjectBorderColor = Color.fromARGB(128, 64, 64, 128); 12 | 13 | class InspectorOverlayLayer extends Layer { 14 | /// Creates a layer that displays the inspector overlay. 15 | InspectorOverlayLayer({required this.overlayRect}) { 16 | bool inDebugMode = kDebugMode || kProfileMode; 17 | if (inDebugMode == false) { 18 | throw FlutterError.fromParts([ 19 | ErrorSummary('The inspector should never be used in production mode due to the ' 20 | 'negative performance impact.'), 21 | ]); 22 | } 23 | } 24 | 25 | /// The rectangle in this layer's coordinate system that the overlay should 26 | /// occupy. 27 | /// 28 | /// The scene must be explicitly recomposited after this property is changed 29 | /// (as described at [Layer]). 30 | final Rect overlayRect; 31 | 32 | late Picture _picture; 33 | 34 | @override 35 | void addToScene(SceneBuilder builder, [Offset layerOffset = Offset.zero]) { 36 | _picture = _buildPicture(); 37 | builder.addPicture(layerOffset, _picture); 38 | } 39 | 40 | Picture _buildPicture() { 41 | final PictureRecorder recorder = PictureRecorder(); 42 | final Canvas canvas = Canvas(recorder, overlayRect); 43 | 44 | final Paint fillPaint = Paint() 45 | ..style = PaintingStyle.fill 46 | ..color = _kHighlightedRenderObjectFillColor; 47 | 48 | final Paint borderPaint = Paint() 49 | ..style = PaintingStyle.stroke 50 | ..strokeWidth = 1.0 51 | ..color = _kHighlightedRenderObjectBorderColor; 52 | 53 | // Highlight the selected renderObject. 54 | canvas 55 | ..save() 56 | // ..transform(state.selected.transform.storage) 57 | ..drawRect(overlayRect, fillPaint) 58 | ..drawRect(overlayRect, borderPaint) 59 | ..restore(); 60 | 61 | return recorder.endRecording(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/event.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/dom.dart'; 8 | import 'package:webf/src/gesture/gesture_dispatcher.dart'; 9 | 10 | typedef HandleGetEventTarget = EventTarget Function(); 11 | 12 | typedef HandleGetGestureDispather = GestureDispatcher Function(); 13 | 14 | mixin RenderEventListenerMixin on RenderBox { 15 | HandleGetEventTarget? getEventTarget; 16 | 17 | HandleGetGestureDispather? getGestureDispather; 18 | 19 | @override 20 | void handleEvent(PointerEvent event, BoxHitTestEntry entry) { 21 | assert(debugHandleEvent(event, entry)); 22 | // Set event path at begin stage and reset it at end stage on viewport render box. 23 | // And if event path existed, it means current render box is not the first in path. 24 | if (getEventTarget != null && getGestureDispather != null) { 25 | if (event is PointerDownEvent) { 26 | // Store the first handleEvent the event path list. 27 | GestureDispatcher gestureDispatcher = getGestureDispather!(); 28 | if (gestureDispatcher.getEventPath().isEmpty) { 29 | gestureDispatcher.setEventPath(getEventTarget!()); 30 | } 31 | } 32 | } 33 | 34 | super.handleEvent(event, entry); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/fallback_view.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:ui'; 7 | 8 | import 'package:flutter/rendering.dart' hide Gradient; 9 | 10 | const Color _black = Color(0xBF000000); 11 | const Color _yellow = Color(0xBFFFFF00); 12 | 13 | class RenderFallbackViewBox extends RenderBox with RenderObjectWithChildMixin { 14 | RenderFallbackViewBox({required RenderBox child}) { 15 | this.child = child; 16 | } 17 | 18 | static final Paint _linePaint = Paint() 19 | ..shader = Gradient.linear( 20 | const Offset(0.0, 0.0), 21 | const Offset(10.0, 10.0), 22 | [_black, _yellow, _yellow, _black], 23 | [0.25, 0.25, 0.75, 0.75], 24 | TileMode.repeated, 25 | ); 26 | 27 | @override 28 | void paint(PaintingContext context, Offset offset) { 29 | context.canvas.drawRect(Rect.fromLTWH(offset.dx, offset.dy, size.width, size.height), _linePaint); 30 | if (child != null) { 31 | // Add some offset to show borders. 32 | child!.paint(context, offset + Offset(5.0, 5.0)); 33 | } 34 | } 35 | 36 | @override 37 | void performLayout() { 38 | size = constraints.biggest; 39 | if (child != null) { 40 | child!.layout(constraints); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/image.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui' as ui show Image; 6 | import 'package:flutter/rendering.dart'; 7 | 8 | class WebFRenderImage extends RenderImage { 9 | WebFRenderImage({ 10 | ui.Image? image, 11 | BoxFit? fit, 12 | AlignmentGeometry alignment = Alignment.center, 13 | }) : super( 14 | image: image, 15 | fit: fit, 16 | alignment: alignment, 17 | ); 18 | 19 | @override 20 | void performLayout() { 21 | Size trySize = constraints.biggest; 22 | size = trySize.isInfinite ? constraints.smallest : trySize; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/line_break.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:flutter/rendering.dart'; 7 | import 'package:webf/css.dart'; 8 | import 'package:webf/rendering.dart'; 9 | 10 | class RenderLineBreak extends RenderReplaced { 11 | RenderLineBreak( 12 | CSSRenderStyle renderStyle, 13 | ) : super( 14 | renderStyle, 15 | ); 16 | 17 | TextPainter get textPainter { 18 | double fontSize = renderStyle.fontSize.computedValue; 19 | 20 | TextStyle textStyle = TextStyle( 21 | fontFamilyFallback: renderStyle.fontFamily, 22 | fontSize: fontSize, 23 | textBaseline: CSSText.getTextBaseLine(), 24 | package: CSSText.getFontPackage(), 25 | locale: CSSText.getLocale(), 26 | ); 27 | TextPainter painter = TextPainter( 28 | text: TextSpan( 29 | text: ' ', 30 | style: textStyle, 31 | ), 32 | textDirection: TextDirection.ltr); 33 | painter.layout(); 34 | return painter; 35 | } 36 | 37 | // Height of BR element is only determined by its parents line-height. 38 | // @TODO add cache to avoid create TextPainter to measure size on every layout. 39 | double get lineHeight { 40 | CSSLengthValue lineHeight = renderStyle.parent!.lineHeight; 41 | if (lineHeight.type != CSSLengthType.NORMAL) { 42 | return lineHeight.computedValue; 43 | } else { 44 | return textPainter.size.height; 45 | } 46 | } 47 | 48 | @override 49 | void performLayout() { 50 | size = Size(0, constraints.maxHeight); 51 | } 52 | 53 | @override 54 | BoxConstraints getConstraints() { 55 | // BR element is a special element in HTML which accepts no style, 56 | // it dimension is only affected by the line-height of its parent. 57 | // https://www.w3.org/TR/CSS1/#br-elements 58 | double height = lineHeight; 59 | BoxConstraints constraints = BoxConstraints( 60 | minWidth: 0, 61 | maxWidth: 0, 62 | minHeight: height, 63 | maxHeight: height, 64 | ); 65 | return constraints; 66 | } 67 | 68 | @override 69 | double computeDistanceToBaseline() { 70 | return textPainter.computeDistanceToActualBaseline(CSSText.getTextBaseLine()); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/rendering/opacity.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | import 'dart:ui' as ui; 6 | 7 | import 'package:flutter/rendering.dart'; 8 | 9 | mixin RenderOpacityMixin on RenderBox { 10 | bool opacityAlwaysNeedsCompositing() => alpha != 0 && alpha != 255; 11 | 12 | int alpha = ui.Color.getAlphaFromOpacity(1.0); 13 | 14 | final LayerHandle _opacityLayer = LayerHandle(); 15 | 16 | void disposeOpacityLayer() { 17 | _opacityLayer.layer = null; 18 | } 19 | 20 | void paintOpacity(PaintingContext context, Offset offset, PaintingContextCallback callback) { 21 | if (alpha == 255) { 22 | _opacityLayer.layer = null; 23 | // No need to keep the layer. We'll create a new one if necessary. 24 | callback(context, offset); 25 | return; 26 | } 27 | 28 | _opacityLayer.layer = context.pushOpacity(offset, alpha, callback, oldLayer: _opacityLayer.layer); 29 | } 30 | 31 | void debugOpacityProperties(DiagnosticPropertiesBuilder properties) { 32 | if (alpha != 0 && alpha != 255) properties.add(DiagnosticsProperty('alpha', alpha)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/src/scheduler/throttle.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:async'; 7 | 8 | /// Throttling 9 | /// Have method [throttle] 10 | class Throttling { 11 | Duration _duration; 12 | Duration get duration => _duration; 13 | set duration(Duration value) { 14 | assert(!duration.isNegative); 15 | _duration = value; 16 | } 17 | 18 | bool _isReady = true; 19 | bool get isReady => _isReady; 20 | Future get _waiter => Future.delayed(_duration); 21 | // ignore: close_sinks 22 | final StreamController _stateSC = StreamController.broadcast(); 23 | 24 | Throttling({Duration duration = const Duration(seconds: 1)}) 25 | : assert(!duration.isNegative), 26 | _duration = duration { 27 | _stateSC.sink.add(true); 28 | } 29 | 30 | dynamic throttle(Function func) { 31 | if (!_isReady) return null; 32 | _stateSC.sink.add(false); 33 | _isReady = false; 34 | _waiter 35 | ..then((_) { 36 | _isReady = true; 37 | _stateSC.sink.add(true); 38 | }); 39 | return Function.apply(func, List.empty()); 40 | } 41 | 42 | StreamSubscription listen(void Function(bool)? onData) => _stateSC.stream.listen(onData); 43 | 44 | void dispose() { 45 | _stateSC.close(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/webf.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | library webf; 7 | 8 | export 'bridge.dart'; 9 | export 'foundation.dart'; 10 | export 'launcher.dart'; 11 | export 'module.dart'; 12 | export 'widget.dart'; 13 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/lib/widget.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | export 'src/widget/webf.dart'; 7 | export 'src/widget/text_control.dart'; 8 | export 'src/widget/widget_to_element_adaptor.dart'; 9 | export 'src/widget/element_to_widget_adaptor.dart'; 10 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | set(PROJECT_NAME "webf") 3 | project(${PROJECT_NAME} LANGUAGES CXX) 4 | 5 | # This value is used when generating builds using this plugin, so it must 6 | # not be changed 7 | set(PLUGIN_NAME "webf_plugin") 8 | 9 | add_library(${PLUGIN_NAME} SHARED 10 | "webf_plugin.cc" 11 | ) 12 | 13 | add_library(webf SHARED IMPORTED) 14 | set_target_properties(webf PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/libwebf.so") 15 | add_library(quickjs SHARED IMPORTED) 16 | set_target_properties(quickjs PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/libquickjs.so") 17 | 18 | apply_standard_settings(${PLUGIN_NAME}) 19 | set_target_properties(${PLUGIN_NAME} PROPERTIES 20 | CXX_VISIBILITY_PRESET hidden) 21 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) 22 | target_include_directories(${PLUGIN_NAME} INTERFACE 23 | "${CMAKE_CURRENT_SOURCE_DIR}/include") 24 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) 25 | target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) 26 | 27 | execute_process( 28 | COMMAND bash "-c" "readlink -f ${CMAKE_CURRENT_SOURCE_DIR}/libwebf.so" 29 | OUTPUT_VARIABLE WEBF_LIB_PATH 30 | ) 31 | string(REGEX REPLACE "\n$" "" WEBF_LIB_PATH "${WEBF_LIB_PATH}") 32 | 33 | execute_process( 34 | COMMAND bash "-c" "readlink -f ${CMAKE_CURRENT_SOURCE_DIR}/libquickjs.so" 35 | OUTPUT_VARIABLE QUICKJS_LIB_PATH 36 | ) 37 | string(REGEX REPLACE "\n$" "" QUICKJS_LIB_PATH "${QUICKJS_LIB_PATH}") 38 | 39 | # List of absolute paths to libraries that should be bundled with the plugin 40 | set(webf_bundled_libraries 41 | ${QUICKJS_LIB_PATH} 42 | ${WEBF_LIB_PATH} 43 | PARENT_SCOPE 44 | ) 45 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/linux/include/webf/webf_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_PLUGIN_WEBF_PLUGIN_H_ 2 | #define FLUTTER_PLUGIN_WEBF_PLUGIN_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | #ifdef FLUTTER_PLUGIN_IMPL 9 | #define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) 10 | #else 11 | #define FLUTTER_PLUGIN_EXPORT 12 | #endif 13 | 14 | typedef struct _WebfPlugin WebfPlugin; 15 | typedef struct { 16 | GObjectClass parent_class; 17 | } WebfPluginClass; 18 | 19 | FLUTTER_PLUGIN_EXPORT GType webf_plugin_get_type(); 20 | 21 | FLUTTER_PLUGIN_EXPORT void webf_plugin_register_with_registrar( 22 | FlPluginRegistrar* registrar); 23 | 24 | G_END_DECLS 25 | 26 | #endif // FLUTTER_PLUGIN_WEBF_PLUGIN_H_ 27 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/linux/libquickjs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/linux/libquickjs.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/linux/libwebf.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/linux/libwebf.so -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/Classes/WebF.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "WebF.h" 3 | #import "WebFPlugin.h" 4 | 5 | typedef void(^MethodHandler)(FlutterMethodCall* _Nonnull , FlutterResult _Nonnull); 6 | 7 | @interface WebF : NSObject 8 | 9 | + (WebF* _Nonnull) instanceByBinaryMessenger: (NSObject* _Nonnull) messenger; 10 | 11 | @property NSString* _Nullable bundleUrl; 12 | @property FlutterEngine* _Nonnull flutterEngine; 13 | @property FlutterMethodChannel* _Nullable channel; 14 | @property MethodHandler _Nullable methodHandler; 15 | 16 | - (instancetype _Nonnull)initWithFlutterEngine: (FlutterEngine* _Nonnull) engine; 17 | 18 | - (NSString* _Nullable) getUrl; 19 | 20 | - (void) loadUrl: (NSString* _Nonnull)url; 21 | 22 | - (void) reload; 23 | 24 | - (void) reloadWithUrl: (NSString* _Nonnull) url; 25 | 26 | - (void) registerMethodCallHandler: (MethodHandler _Nonnull) handler; 27 | 28 | - (void) invokeMethod: (NSString* _Nonnull)method arguments:(nullable id) arguments; 29 | 30 | - (void) _handleMethodCall:(FlutterMethodCall* _Nonnull)call result:(FlutterResult _Nonnull )result; 31 | @end 32 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/Classes/WebFPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define NAME_METHOD_SPLIT @"!!" 4 | 5 | @interface WebFPlugin : NSObject 6 | 7 | @property NSObject *registrar; 8 | @property FlutterMethodChannel *channel; 9 | 10 | - (instancetype) initWithRegistrar: (NSObject*)registrar; 11 | 12 | + (FlutterMethodChannel *) getMethodChannel; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/Classes/WebFPlugin.m: -------------------------------------------------------------------------------- 1 | #import "WebF.h" 2 | #import "WebFPlugin.h" 3 | 4 | static FlutterMethodChannel *methodChannel = nil; 5 | 6 | @implementation WebFPlugin 7 | 8 | + (FlutterMethodChannel *) getMethodChannel { 9 | return methodChannel; 10 | } 11 | 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | NSObject* messager = [registrar messenger]; 14 | FlutterMethodChannel* channel = [FlutterMethodChannel 15 | methodChannelWithName:@"webf" 16 | binaryMessenger:messager]; 17 | methodChannel = channel; 18 | 19 | WebFPlugin* instance = [[WebFPlugin alloc] initWithRegistrar: registrar]; 20 | [registrar addMethodCallDelegate:instance channel:channel]; 21 | } 22 | 23 | - (instancetype) initWithRegistrar: (NSObject*)registrar{ 24 | self = [super init]; 25 | self.registrar = registrar; 26 | return self; 27 | } 28 | 29 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 30 | if ([@"getUrl" isEqualToString:call.method]) { 31 | WebF* krakenInstance = [WebF instanceByBinaryMessenger: [self.registrar messenger]]; 32 | if (krakenInstance != nil) { 33 | result([krakenInstance getUrl]); 34 | } else { 35 | result(nil); 36 | } 37 | } else if ([@"invokeMethod" isEqualToString: call.method]) { 38 | WebF* krakenInstance = [WebF instanceByBinaryMessenger: [self.registrar messenger]]; 39 | FlutterMethodCall* callWrap = [FlutterMethodCall methodCallWithMethodName: call.arguments[@"method"] arguments: call.arguments[@"args"]]; 40 | [krakenInstance _handleMethodCall:callWrap result:result]; 41 | } else if ([@"getTemporaryDirectory" isEqualToString: call.method]) { 42 | result([self getTemporaryDirectory]); 43 | } else { 44 | result(FlutterMethodNotImplemented); 45 | } 46 | } 47 | 48 | - (NSString*) getTemporaryDirectory { 49 | NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 50 | return [paths.firstObject stringByAppendingString: @"/WebF"]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/libquickjs.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/macos/libquickjs.dylib -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/libwebf.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/macos/libwebf.dylib -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/prepare.sh: -------------------------------------------------------------------------------- 1 | read_version() { 2 | VERSION_STR=$(cat webf.podspec | grep s.version | awk '{print $3}') 3 | END_POS=$(echo ${#VERSION_STR} - 2 | bc) 4 | export VERSION=${VERSION_STR:1:$END_POS} 5 | } 6 | 7 | ROOT=$(pwd) 8 | 9 | if [ -L "libwebf.dylib" ]; then 10 | rm libwebf.dylib 11 | ln -s $ROOT/../../bridge/build/macos/lib/x86_64/libwebf.dylib 12 | fi 13 | 14 | if [ -L "libquickjs.dylib" ]; then 15 | rm libquickjs.dylib 16 | ln -s $ROOT/../../bridge/build/macos/lib/x86_64/libquickjs.dylib 17 | fi 18 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/macos/webf.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint webf.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'webf' 7 | s.version = '0.1.0' 8 | s.summary = 'A W3C standard compliant Web rendering engine based on Flutter.' 9 | s.description = <<-DESC 10 | A W3C standard compliant Web rendering engine based on Flutter.. 11 | DESC 12 | s.homepage = 'https://openwebf.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'WebF' => 'dongtiangche@outlook.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'FlutterMacOS' 19 | s.vendored_libraries = 'libwebf.dylib', 'libquickjs.dylib' 20 | s.prepare_command = 'bash prepare.sh' 21 | 22 | s.platform = :osx, '10.11' 23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 24 | s.swift_version = '5.0' 25 | end 26 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: webf 2 | description: A W3C standard compliant Web rendering engine based on Flutter. 3 | version: 0.12.0+1 4 | homepage: https://openwebf.com 5 | 6 | environment: 7 | sdk: ">=2.17.5 <3.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | path: ^1.8.1 # Pure dart module. 14 | meta: ^1.7.0 # Pure dart module. 15 | ffi: ^2.0.1 # Pure dart module. 16 | characters: ^1.2.0 17 | async: ^2.8.2 # Pure dart module. 18 | quiver: ^3.1.0 # Pure dart module. 19 | vector_math: ^2.1.2 # Pure dart module. 20 | connectivity_plus: ^2.3.5 # No AndroidX used. 21 | shared_preferences: ^2.0.15 # No AndroidX used. 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | test: ^1.20.2 27 | 28 | flutter: 29 | # This section identifies this Flutter project as a plugin project. 30 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 31 | # be modified. They are used by the tooling to maintain consistency when 32 | # adding or updating assets for this project. 33 | # 34 | # NOTE: This new plugin description format is not supported on Flutter's 35 | # stable channel as of 1.9.1. A plugin published using this format will not 36 | # work for most clients until the next major stable release. 37 | # However, it is required in order to declare macOS support. 38 | plugin: 39 | platforms: 40 | android: 41 | package: com.openwebf.webf 42 | pluginClass: WebFPlugin 43 | ios: 44 | pluginClass: WebFPlugin 45 | macos: 46 | pluginClass: WebFPlugin 47 | linux: 48 | pluginClass: WebfPlugin 49 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_301: -------------------------------------------------------------------------------- 1 | HTTP/1.1 301 Moved Permanently 2 | Content-Type: text/html 3 | Content-Length: 262 4 | Connection: keep-alive 5 | Location: https://www.taobao.com/ 6 | Timing-Allow-Origin: * 7 | 8 | 9 | 10 | 301 Moved Permanently 11 | 12 |

301 Moved Permanently

13 |

The requested resource has been assigned a new permanent URI.

14 |
Powered by Tengine 15 | 16 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_js_gzipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dagouzhi/mini-app-engines/fe9866decaf1d5b3234036025101855e739c86b2/packages/webf-0.12.0+1/test/fixtures/GET_js_gzipped -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_json_with_content_length: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Content-Type: application/json 3 | Content-Length: 72 4 | 5 | { 6 | "method": "GET", 7 | "data": { 8 | "userName": "12345" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_json_with_content_length_expires_etag_last_modified: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Connection: close 3 | Content-Type: application/json 4 | Content-Length: 72 5 | ETag: "4EE5B35FB8C5FB2CF8041FC41D3D199E" 6 | expires: Mon, 16 Aug 2221 10:17:45 GMT 7 | Last-Modified: Sun, 15 Mar 2020 11:32:20 GMT 8 | 9 | { 10 | "method": "GET", 11 | "data": { 12 | "userName": "12345" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_plain_text_with_content_length_and_last_modified: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Content-Type: text/plain 3 | Last-Modified: Sun, 15 Mar 2020 11:32:20 GMT 4 | Content-Length: 10 5 | 6 | CachedData 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_plain_text_with_current_time_last_modified: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Content-Type: text/plain 3 | Last-Modified: CURRENT_TIME 4 | Content-Length: 10 5 | 6 | CachedData 7 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/GET_plain_text_with_etag_and_content_length: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Content-Type: text/plain 3 | x-custom-header: hello-world 4 | eTag: "foo" 5 | Content-Length: 10 6 | 7 | CachedData 8 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/fixtures/POST_plain_text: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Content-Type: text/plain 3 | Content-Length: 10 4 | 5 | helloworld 6 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/css/values.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/css.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | void main() { 10 | group('CSSValues', () { 11 | group('CSSFunction', () { 12 | var cases = [ 13 | 'var(--x)', 14 | 'url(https://some.com/path)', 15 | 'conic-gradient(from 45deg, blue, red)', 16 | 'device-cmyk(0 81% 81% 30% / .5, rgb(178 34 34))', 17 | 'calc(var(--widthA) / 2)', 18 | 'url(https://some.com/path), url(https://some.com/path2)' 19 | '''conic-gradient( 20 | hsl(360, 100%, 50%), 21 | hsl(315, 100%, 50%), 22 | hsl(270, 100%, 50%), 23 | hsl(225, 100%, 50%), 24 | hsl(180, 100%, 50%), 25 | hsl(135, 100%, 50%), 26 | hsl(90, 100%, 50%), 27 | hsl(45, 100%, 50%), 28 | hsl(0, 100%, 50%) 29 | )''', 30 | ]; 31 | cases.forEach((String input) { 32 | test('simple case #${cases.indexOf(input)}', () { 33 | expect(CSSFunction.isFunction(input), true); 34 | }); 35 | }); 36 | 37 | test('specified function name #0', () { 38 | var input = 'var(--x)'; 39 | expect(CSSFunction.isFunction(input, functionName: 'var'), true); 40 | }); 41 | 42 | test('specified function name #1', () { 43 | var input = 'var(--x)'; 44 | expect(CSSFunction.isFunction(input, functionName: 'var1'), false); 45 | }); 46 | 47 | test('specified function name #2', () { 48 | var input = 'var(--x)'; 49 | expect(CSSFunction.isFunction(input, functionName: 'url'), false); 50 | }); 51 | 52 | test('specified function name #3', () { 53 | var input = 'conic-gradient(--x)'; 54 | expect(CSSFunction.isFunction(input, functionName: 'conic-gradient'), true); 55 | }); 56 | }); 57 | }); 58 | } 59 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/foundation/convert.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/foundation.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | void main() { 10 | group('Convert', () { 11 | test('utf8 decode basic', () async { 12 | String spec = 'Hello World!'; 13 | List rawData = spec.codeUnits; 14 | String decoded = await resolveStringFromData(rawData); 15 | 16 | expect(decoded, spec); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/foundation/environment.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:test/test.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | void main() { 10 | group('environment', () { 11 | test('getWebFTemporaryPath()', () async { 12 | String tempPath = await getWebFTemporaryPath(); 13 | expect(tempPath, './temp'); 14 | }); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/foundation/uri_parser.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:test/test.dart'; 7 | import 'package:webf/foundation.dart'; 8 | 9 | void main() { 10 | group('UriParser', () { 11 | var uriParser = UriParser(); 12 | 13 | var resolveTests = [ 14 | // base, relative, result 15 | ['https://foo.com', '//bar.org', 'https://bar.org'], 16 | ['https://foo.com', '/bar', 'https://foo.com/bar'], 17 | ['https://foo.com', 'file:///Users/bar', 'file:///Users/bar'], 18 | ['https://foo.com/?a=1', 'bar?b=2', 'https://foo.com/bar?b=2'], 19 | ['https://foo.com/?a=1', '//bar.org', 'https://bar.org'], 20 | ['assets:foo', './bar', 'assets:bar'], 21 | ['assets:foo', '/bar', 'assets:/bar'], 22 | ['assets:foo', './bar', 'assets:bar'], 23 | ['assets:foo', '../bar', 'assets:bar'], 24 | ['http://foo.com/bar', '../bar', 'http://foo.com/bar'], 25 | ['http://foo.com/bar', 'http://bar.com/', 'http://bar.com/'], 26 | ['file:///Users/foo', '/bar', 'file:///bar'], 27 | ['file:///Users/foo', 'bar', 'file:///Users/bar'], 28 | ['file:///Users/foo', '//foo.com/bar?a=1', 'file://foo.com/bar?a=1'], 29 | ]; 30 | 31 | for (var spec in resolveTests) { 32 | String index = resolveTests.indexOf(spec).toString().padLeft(3, '0'); 33 | 34 | test('resolve $index', () { 35 | Uri base = Uri.parse(spec[0]); 36 | Uri relative = Uri.parse(spec[1]); 37 | expect(uriParser.resolve(base, relative).toString(), spec[2]); 38 | }); 39 | } 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/gesture/scroll_physics.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'dart:io' show Platform; 7 | 8 | import 'package:test/test.dart'; 9 | import 'package:webf/src/gesture/scroll_physics.dart'; 10 | 11 | // Only for test. 12 | class TestScrollPhysics extends ScrollPhysics {} 13 | 14 | void main() { 15 | group('ScrollPhysics', () { 16 | test('createScrollPhysics', () { 17 | ScrollPhysics scrollPhysics = ScrollPhysics.createScrollPhysics(); 18 | // In test env, that should be macos env. 19 | expect(Platform.operatingSystem, 'linux'); 20 | expect(scrollPhysics.runtimeType.toString(), 'ClampingScrollPhysics'); 21 | }); 22 | 23 | test('ScrollPhysics Factory', () { 24 | // ScrollPhysics 25 | ScrollPhysics.scrollPhysicsFactory = (ScrollPhysics? parent) { 26 | return TestScrollPhysics(); 27 | }; 28 | 29 | ScrollPhysics scrollPhysics = ScrollPhysics.createScrollPhysics(); 30 | expect(scrollPhysics.runtimeType.toString(), 'TestScrollPhysics'); 31 | 32 | ScrollPhysics.scrollPhysicsFactory = null; 33 | }); 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /packages/webf-0.12.0+1/test/src/module/fetch.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. 3 | * Copyright (C) 2022-present The WebF authors. All rights reserved. 4 | */ 5 | 6 | import 'package:webf/module.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | import '../../local_http_server.dart'; 10 | 11 | void main() { 12 | group('fetch', () { 13 | FetchModule fetchModule = FetchModule(null); 14 | var server = LocalHttpServer.getInstance(); 15 | 16 | test('Custom Headers', () async { 17 | var request = 18 | await fetchModule.getRequest(server.getUri('plain_text'), 'POST', {'foo': 'bar'}, null); 19 | expect(request.uri.path, '/plain_text'); 20 | expect(request.method, 'POST'); 21 | expect(request.headers.value('foo'), 'bar'); 22 | await request.close(); 23 | }); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | dependency: { 3 | platforms: { 4 | ios: { 5 | project: './ios-rn/MiniAppEngines.xcworkspace', 6 | }, 7 | android: { 8 | sourceDir: './android-rn/', 9 | }, 10 | }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_module_rn/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------