-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avalonia.Web (wasm) #7029
Merged
Merged
Avalonia.Web (wasm) #7029
Changes from 24 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
89482b0
add Avalonia.Blazor and sample project.
danwalmsley e51efdd
add missing stuff.
danwalmsley 3e5f3f6
hide and show inputbox.
danwalmsley 8c62f0f
remove lock code.
danwalmsley 6c11cd7
dont optimize debug builds
danwalmsley 8ea4572
remove bootstrap and other stuff that isnt used.
danwalmsley d4563de
remove duplicated code.
danwalmsley 8dfed08
remove map files.
danwalmsley 623c14d
set package name.
danwalmsley 9bc5037
fix build.
danwalmsley 683f2a6
fix build
danwalmsley b5ae0eb
fix compile issues.
danwalmsley c6ca3b4
truly fix build/
danwalmsley 010ca19
upgrade to net462
danwalmsley 7470b94
fix api diff.
danwalmsley 02f5ea5
disable api diff.
danwalmsley 65f56f2
use newer skiasharp version.
danwalmsley c78179e
Revert "upgrade to net462"
danwalmsley 0114291
Revert "fix api diff."
danwalmsley 1c88901
update skia.
danwalmsley a212489
Fix namspaces
Gillibald e0a6c67
Merge branch 'features/web' of https://github.com/AvaloniaUI/Avalonia…
danwalmsley f88bebc
Make SKTypefaceCollection/Cache publich for code reuse
Gillibald b329233
Merge branch 'features/web' of https://github.com/AvaloniaUI/Avalonia…
danwalmsley f8d73e2
add linker config file.
danwalmsley 236e02a
implement mouse event modifiers.
danwalmsley a0e93c6
optimizations.
danwalmsley e44c36b
Revert "Revert "upgrade to net462""
danwalmsley ec226bc
Revert "Revert "fix api diff.""
danwalmsley c8aea23
Merge branch 'master' into features/web
jmacato 285cc2c
add targets file for required native dependencies.
danwalmsley 6dd74a3
make avalonia.skia pull in wasm native assets.
danwalmsley 7314525
move input interop code to component.
danwalmsley 167f863
implement touch support.
danwalmsley d265006
embed fonts.
danwalmsley b4c6c82
fix font assets.
danwalmsley dba0d2d
fix project file.
danwalmsley fbbcdd7
Merge branch 'master' into features/web
danwalmsley 136ba93
remove git ignore file from wwwroot.
danwalmsley 5687b27
fix gitignore.
danwalmsley aba3c93
Fix custom font manager
Gillibald b2c0769
Merge branch 'features/web' of https://github.com/AvaloniaUI/Avalonia…
Gillibald b231f9e
Revert "Revert "Revert "fix api diff."""
danwalmsley b89e884
Revert "Revert "Revert "upgrade to net462"""
danwalmsley 8954577
Merge remote-tracking branch 'origin/master' into features/web
danwalmsley 30af93b
fix app builder api.
danwalmsley 4a1bbcd
rename appbuilder.
danwalmsley 0ed5a00
remove non-required call.
danwalmsley 21b9d08
fix touch support.
danwalmsley a12d947
remove embedded font.
danwalmsley e41271e
remove navmenu page unused code.
danwalmsley 0a26d62
turn of antialiasing.
danwalmsley 9ddca48
remove emoji code.
danwalmsley 90971df
make osk show immediately on mobile
danwalmsley b7d87cf
fix warnings and remove redundant code.
danwalmsley 2c51cf4
Merge branch 'master' into features/web
danwalmsley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,3 +210,4 @@ obj-Skia/ | |
coc-settings.json | ||
.ccls-cache | ||
.ccls | ||
*.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<PackageReference Include="HarfBuzzSharp" Version="2.8.2-preview.155" /> | ||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2-preview.155" /> | ||
<PackageReference Include="HarfBuzzSharp" Version="2.8.2-preview.171" /> | ||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2-preview.171" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.155" /> | ||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.155" /> | ||
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.171" /> | ||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.171" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
</Found> | ||
<NotFound> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p>Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Avalonia.Web.Blazor; | ||
|
||
namespace ControlCatalog.Web; | ||
|
||
public partial class App | ||
{ | ||
protected override void OnParametersSet() | ||
{ | ||
BlazorSingleViewLifetimeExtensions.SetupWithBlazorSingleViewLifetime<ControlCatalog.App>(); | ||
|
||
base.OnParametersSet(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<!-- In debug, make builds faster by reducing optimizations --> | ||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> | ||
<WasmNativeStrip>false</WasmNativeStrip> | ||
<EmccCompileOptimizationFlag>-O1</EmccCompileOptimizationFlag> | ||
<RunAOTCompilation>false</RunAOTCompilation> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<Optimize>true</Optimize> | ||
<WasmNativeStrip>true</WasmNativeStrip> | ||
<EmccCompileOptimizationFlag>-O2</EmccCompileOptimizationFlag> | ||
<RunAOTCompilation>false</RunAOTCompilation> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="2.8.2-preview.171" /> | ||
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.0-preview.171" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\2.0.23\libHarfBuzzSharp.a" /> | ||
<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\2.0.23\libSkiaSharp.a" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.csproj" /> | ||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "/" | ||
|
||
@using Avalonia.Web.Blazor | ||
|
||
<AvaloniaView /> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using ControlCatalog.Web; | ||
|
||
public class Program | ||
{ | ||
public static async Task Main(string[] args) | ||
{ | ||
await CreateHostBuilder(args).Build().RunAsync(); | ||
} | ||
|
||
public static WebAssemblyHostBuilder CreateHostBuilder(string[] args) | ||
{ | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
|
||
builder.RootComponents.Add<App>("#app"); | ||
|
||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
|
||
return builder; | ||
} | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:13961", | ||
"sslPort": 44319 | ||
} | ||
}, | ||
"profiles": { | ||
"ControlCatalog.Web - IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"ControlCatalog.Web": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": "true", | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"applicationUrl": "https://localhost:5001;http://localhost:5000", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@inherits LayoutComponentBase | ||
|
||
<div class="page"> | ||
<div class="main"> | ||
@Body | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.page { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.main { | ||
flex: 1; | ||
} | ||
|
||
.sidebar { | ||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); | ||
} | ||
|
||
.top-row { | ||
background-color: #f7f7f7; | ||
border-bottom: 1px solid #d6d5d5; | ||
justify-content: flex-end; | ||
height: 3.5rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.top-row ::deep a, .top-row .btn-link { | ||
white-space: nowrap; | ||
margin-left: 1.5rem; | ||
} | ||
|
||
.top-row a:first-child { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
@media (max-width: 640.98px) { | ||
.top-row:not(.auth) { | ||
display: none; | ||
} | ||
|
||
.top-row.auth { | ||
justify-content: space-between; | ||
} | ||
|
||
.top-row a, .top-row .btn-link { | ||
margin-left: 0; | ||
} | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.page { | ||
flex-direction: row; | ||
} | ||
|
||
.sidebar { | ||
width: 250px; | ||
height: 100vh; | ||
position: sticky; | ||
top: 0; | ||
} | ||
|
||
.top-row { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
.main > div { | ||
padding-left: 2rem !important; | ||
padding-right: 1.5rem !important; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might as well separate
<AvaloniaView Content="..."/>
and<AvaloniaMainView/>
that hosts the view fromISingleViewApplicationLifetime
. Not required right now.