diff --git a/src/OpenSilver.CLI/.gitignore b/src/OpenSilver.CLI/.gitignore new file mode 100644 index 0000000..aebedfb --- /dev/null +++ b/src/OpenSilver.CLI/.gitignore @@ -0,0 +1,3 @@ +C#/**/OpenSilverApplication.* +F#/**/OpenSilverApplication.* +VB/**/OpenSilverApplication.* \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/dotnetcli.host.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..8f6f20a --- /dev/null +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/dotnetcli.host.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "mauiPlatforms": { + "longName": "mauiPlatforms", + "shortName": "mp", + "isHidden": true + } + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 3744723..808c517 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -31,6 +31,12 @@ "exclude": [ "OpenSilverApplication.Simulator/**" ] + }, + { + "condition": "(mauiPlatformsBasic == '' && windowsTarget == '')", + "exclude": [ + "OpenSilverApplication.MauiHybrid/**" + ] } ] } @@ -41,6 +47,10 @@ { "path": "./OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj", "condition": "(operatingSystem == 'Windows_NT')" + }, + { + "path": "./OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj", + "condition": "(mauiPlatformsBasic != '' || windowsTarget != '')" } ], "symbols": { @@ -91,6 +101,44 @@ } ] }, + "mauiPlatforms": { + "type": "parameter", + "datatype": "choice", + "description": "Specifies which MAUI platforms to include.", + "allowMultipleValues": true, + "replaces": "$maui-platforms$", + "choices": [ + { + "choice": "android", + "description": "Android" + }, + { + "choice": "ios", + "description": "iOS" + }, + { + "choice": "macos", + "description": "macOS" + }, + { + "choice": "windows", + "description": "Windows" + }, + { + "choice": "all", + "description": "All supported platforms" + } + ] + }, + + "langShortCode": { + "type": "generated", + "generator": "constant", + "replaces": "$LangShortCode$", + "parameters": { + "value": "cs" + } + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -123,6 +171,14 @@ "value": "3.1.*" } }, + "openSilverMauiHybridPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "$OpenSilverMauiHybridPackageVersion$", + "parameters": { + "value": "3.2.0-preview-2025-01-23-143554-64fb2e70" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", @@ -186,14 +242,113 @@ }, "operatingSystem": { "type": "bind", - "binding": "env:OS" + "binding": "env:OS", + "defaultValue": "" + }, + "androidTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-android" + }, + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-android" + } + ] + } + }, + "iosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-ios" + }, + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-ios" + } + ] + } + }, + "macosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-maccatalyst" + }, + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-maccatalyst" + } + ] + } + }, + "windowsTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$WindowsTarget$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-windows10.0.19041.0" + }, + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-windows10.0.19041.0" + } + ] + } + }, + "mauiPlatformsBasic": { + "type": "generated", + "generator": "join", + "replaces": "$MauiPlatformsBasic$", + "parameters": { + "symbols": [ + { + "type": "ref", + "value": "androidTarget" + }, + { + "type": "ref", + "value": "iosTarget" + }, + { + "type": "ref", + "value": "macosTarget" + } + ], + "removeEmptyValues": true, + "separator": ";" + } } + }, "guids": [ "79254849-EE14-42B2-82CB-07A7D4FA3205", "052AA0E1-BF65-4EE4-B6D3-112AE3350154", "E5006009-F128-4902-AD10-D55E7942946A", - "D59E1426-E892-4863-9C68-E437124A32F5" + "D59E1426-E892-4863-9C68-E437124A32F5", + "E98BBAFF-DE97-48FB-B99E-019727405EFE" ], "postActions": [ { diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj deleted file mode 100644 index 826f049..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - WinExe - net9.0-windows - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.sln b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.sln index a5eea7c..d789cf2 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.sln +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.sln @@ -11,6 +11,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{E5006009-F128-4902-AD10-D55E7942946A}" EndProject #endif +#if (mauiPlatformsBasic != '' || windowsTarget != '') +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.MauiHybrid", "OpenSilverApplication.MauiHybrid\OpenSilverApplication.MauiHybrid.csproj", "{E98BBAFF-DE97-48FB-B99E-019727405EFE}" +EndProject +#endif Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,6 +35,13 @@ Global {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.Build.0 = Release|Any CPU #endif + #if (mauiPlatformsBasic != '' || windowsTarget != '') + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.Build.0 = Release|Any CPU + #endif EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/App.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/App.cs similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/App.cs rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/App.cs diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj similarity index 96% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 4aa7954..620f87d 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Pages/Index.cs similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Pages/Index.cs diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Program.cs similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Program.cs diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Properties/launchSettings.json similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/Properties/launchSettings.json diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/favicon.ico similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/favicon.ico diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/index.html similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/index.html diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/loading-indicator.css similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/loading-indicator.css diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml new file mode 100644 index 0000000..99e80ce --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml.cs new file mode 100644 index 0000000..979d3fc --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/App.xaml.cs @@ -0,0 +1,14 @@ +namespace OpenSilverApplication.MauiHybrid; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new MainPage()) { Title = "OpenSilverApplication.MauiHybrid" }; + } +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Index.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Index.cs new file mode 100644 index 0000000..ef9048f --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Index.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Components; +using OpenSilver.MauiHybrid.Runner; + +namespace OpenSilverApplication.MauiHybrid.Components +{ + [Route("/")] + public class Index : ComponentBase + { + [Inject] + private IMauiHybridRunner? Runner { get; set; } + + protected async override Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + + ArgumentNullException.ThrowIfNull(Runner); + await Runner.RunApplicationAsync(); + } + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Routes.razor b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Routes.razor new file mode 100644 index 0000000..c5ad85a --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/Routes.razor @@ -0,0 +1,5 @@ + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/_Imports.razor b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/_Imports.razor new file mode 100644 index 0000000..a456ccb --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Components/_Imports.razor @@ -0,0 +1,7 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml new file mode 100644 index 0000000..9eeebd5 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml.cs new file mode 100644 index 0000000..3b836c6 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MainPage.xaml.cs @@ -0,0 +1,9 @@ +namespace OpenSilverApplication.MauiHybrid; + +public partial class MainPage : ContentPage +{ + public MainPage() + { + InitializeComponent(); + } +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MauiProgram.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MauiProgram.cs new file mode 100644 index 0000000..ce7ce37 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/MauiProgram.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Components.WebView.Maui; +using Microsoft.Extensions.Logging; +using OpenSilver.MauiHybrid.Runner; + +namespace OpenSilverApplication.MauiHybrid; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + }) + .ConfigureMauiHandlers(conf => + { +//-:cnd:noEmit +#if ANDROID + conf.AddHandler(); +#endif +//+:cnd:noEmit + }); + + builder.Services.AddScoped(); + builder.Services.AddMauiBlazorWebView(); +//-:cnd:noEmit +#if DEBUG + builder.Services.AddBlazorWebViewDeveloperTools(); + builder.Logging.AddDebug(); +#endif +//+:cnd:noEmit + + return builder.Build(); + } +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj new file mode 100644 index 0000000..b5b47a1 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj @@ -0,0 +1,89 @@ + + + + + $MauiPlatformsBasic$ + + + $(TargetFrameworks);$WindowsTarget$ + + + $WindowsTarget$ + + + + + + + + Exe + OpenSilverApplication.MauiHybrid + true + true + enable + false + enable + + + OpenSilverApplication.MauiHybrid + + + com.companyname.opensilverapplication.mauihybrid + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 24.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidManifest.xml b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..dbf9e7e --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidWebViewHandler.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidWebViewHandler.cs new file mode 100644 index 0000000..2b0639e --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/AndroidWebViewHandler.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Components.WebView.Maui; + +namespace OpenSilverApplication.MauiHybrid; + +public class AndroidWebViewHandler : BlazorWebViewHandler +{ + protected override void ConnectHandler(global::Android.Webkit.WebView webView) + { + webView.Settings.SetSupportMultipleWindows(false); + + base.ConnectHandler(webView); + } +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainActivity.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..c2153bf --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace OpenSilverApplication.MauiHybrid; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainApplication.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..2e4ad89 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace OpenSilverApplication.MauiHybrid; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/Resources/values/colors.xml b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/AppDelegate.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..ce7352e --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace OpenSilverApplication.MauiHybrid; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Entitlements.plist b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..de4adc9 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Info.plist b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..7b1e6e6 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Program.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..42eb753 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace OpenSilverApplication.MauiHybrid; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml new file mode 100644 index 0000000..c90b507 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..f20f9cc --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/App.xaml.cs @@ -0,0 +1,24 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace OpenSilverApplication.MauiHybrid.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/Package.appxmanifest b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..90b4b6e --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/app.manifest b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/app.manifest new file mode 100644 index 0000000..4ecfb83 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/AppDelegate.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..ce7352e --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace OpenSilverApplication.MauiHybrid; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Info.plist b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Info.plist new file mode 100644 index 0000000..ecb7f71 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Program.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Program.cs new file mode 100644 index 0000000..766a87f --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace OpenSilverApplication.MauiHybrid; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Resources/PrivacyInfo.xcprivacy b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..24ab3b4 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Platforms/iOS/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,51 @@ + + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + + + + + + diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Properties/launchSettings.json b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Properties/launchSettings.json new file mode 100644 index 0000000..4f85793 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "Project", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appicon.svg b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..2d846c2 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appiconfg.svg b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..d214073 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Fonts/OpenSans-Regular.ttf b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..68fcd94 Binary files /dev/null and b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Raw/AboutAssets.txt b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..6de1c15 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with your package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Splash/splash.svg b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Splash/splash.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/wwwroot/index.html b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/wwwroot/index.html new file mode 100644 index 0000000..bf11f7a --- /dev/null +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.MauiHybrid/wwwroot/index.html @@ -0,0 +1,21 @@ + + + + + + OpenSilverApplication.MauiHybrid + + + + + +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj similarity index 91% rename from src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 1b58f46..903b4a1 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs b/src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Simulator/Startup.cs similarity index 100% rename from src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs rename to src/OpenSilver.CLI/CommonProjectTemplates/OpenSilverApplication.Simulator/Startup.cs diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/dotnetcli.host.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..8f6f20a --- /dev/null +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/dotnetcli.host.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "mauiPlatforms": { + "longName": "mauiPlatforms", + "shortName": "mp", + "isHidden": true + } + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 33e6ba4..b1c7b4b 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -31,6 +31,12 @@ "exclude": [ "OpenSilverApplication.Simulator/**" ] + }, + { + "condition": "(mauiPlatformsBasic == '' && windowsTarget == '')", + "exclude": [ + "OpenSilverApplication.MauiHybrid/**" + ] } ] } @@ -41,6 +47,10 @@ { "path": "./OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj", "condition": "(operatingSystem == 'Windows_NT')" + }, + { + "path": "./OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj", + "condition": "(mauiPlatformsBasic != '' || windowsTarget != '')" } ], "symbols": { @@ -91,6 +101,44 @@ } ] }, + "mauiPlatforms": { + "type": "parameter", + "datatype": "choice", + "description": "Specifies which MAUI platforms to include.", + "allowMultipleValues": true, + "replaces": "$maui-platforms$", + "choices": [ + { + "choice": "android", + "description": "Android" + }, + { + "choice": "ios", + "description": "iOS" + }, + { + "choice": "macos", + "description": "macOS" + }, + { + "choice": "windows", + "description": "Windows" + }, + { + "choice": "all", + "description": "All supported platforms" + } + ] + }, + + "langShortCode": { + "type": "generated", + "generator": "constant", + "replaces": "$LangShortCode$", + "parameters": { + "value": "fs" + } + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -123,6 +171,14 @@ "value": "3.1.*" } }, + "openSilverMauiHybridPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "$OpenSilverMauiHybridPackageVersion$", + "parameters": { + "value": "3.2.0-preview-2025-01-23-143554-64fb2e70" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", @@ -186,14 +242,113 @@ }, "operatingSystem": { "type": "bind", - "binding": "env:OS" + "binding": "env:OS", + "defaultValue": "" + }, + "androidTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-android" + }, + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-android" + } + ] + } + }, + "iosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-ios" + }, + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-ios" + } + ] + } + }, + "macosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-maccatalyst" + }, + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-maccatalyst" + } + ] + } + }, + "windowsTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$WindowsTarget$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-windows10.0.19041.0" + }, + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-windows10.0.19041.0" + } + ] + } + }, + "mauiPlatformsBasic": { + "type": "generated", + "generator": "join", + "replaces": "$MauiPlatformsBasic$", + "parameters": { + "symbols": [ + { + "type": "ref", + "value": "androidTarget" + }, + { + "type": "ref", + "value": "iosTarget" + }, + { + "type": "ref", + "value": "macosTarget" + } + ], + "removeEmptyValues": true, + "separator": ";" + } } + }, "guids": [ - "41168522-4247-4181-BE6B-CD561E266F1B", - "88992088-C7C5-47CF-87AB-FC26135729B8", - "AE40C775-AAE2-4310-8566-AA1EB3F79F04", - "B9762355-C28A-465A-91A1-9BE8B02EAC72" + "79254849-EE14-42B2-82CB-07A7D4FA3205", + "052AA0E1-BF65-4EE4-B6D3-112AE3350154", + "E5006009-F128-4902-AD10-D55E7942946A", + "D59E1426-E892-4863-9C68-E437124A32F5", + "E98BBAFF-DE97-48FB-B99E-019727405EFE" ], "postActions": [ { @@ -208,4 +363,4 @@ "continueOnError": true } ] -} \ No newline at end of file +} diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/App.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/App.cs deleted file mode 100644 index 2a73757..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/App.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.CompilerServices; -using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.AspNetCore.Components.Routing; - -namespace OpenSilverApplication.Browser -{ - public class App : ComponentBase - { - protected override void BuildRenderTree(RenderTreeBuilder builder) - { - builder.OpenComponent(0); - builder.AddAttribute(1, "AppAssembly", RuntimeHelpers.TypeCheck( - typeof(Program).Assembly - )); - builder.AddAttribute(2, "PreferExactMatches", RuntimeHelpers.TypeCheck( - true - )); - builder.AddAttribute(3, "Found", (RenderFragment)(routeData => builder2 => - { - builder2.OpenComponent(4); - builder2.AddAttribute(5, "RouteData", RuntimeHelpers.TypeCheck( - routeData - )); - builder2.CloseComponent(); - } - )); - builder.AddAttribute(7, "NotFound", (RenderFragment)(builder2 => - { - builder2.OpenComponent(8); - builder2.AddAttribute(9, "ChildContent", (RenderFragment)(builder3 => - { - builder3.AddMarkupContent(10, "

Sorry, there\'s nothing at this address.

"); - } - )); - builder2.CloseComponent(); - } - )); - builder.CloseComponent(); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj deleted file mode 100644 index a91222c..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - net9.0 - 7 - true - false - - - - - - - - - - - - True - - - - - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs deleted file mode 100644 index b9ba02e..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using OpenSilver.WebAssembly; - -namespace OpenSilverApplication.Browser.Pages -{ - [Route("/")] - public class Index : ComponentBase - { - protected override void BuildRenderTree(RenderTreeBuilder __builder) - { - } - - protected async override Task OnInitializedAsync() - { - await base.OnInitializedAsync(); - await Runner.RunApplicationAsync(); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs deleted file mode 100644 index a654b19..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using System.Threading.Tasks; - -namespace OpenSilverApplication.Browser -{ - public class Program - { - public static async Task Main(string[] args) - { - var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("#app"); - var host = builder.Build(); - await host.RunAsync(); - } - } -} diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json deleted file mode 100644 index e79929a..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:55591/", - "sslPort": 0 - } - }, - "profiles": { - "OpenSilverApplication.Browser": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico deleted file mode 100644 index a4bff57..0000000 Binary files a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico and /dev/null differ diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html deleted file mode 100644 index f345f35..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - OpenSilverApplication - - - - - - - - - - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- - - -
-
-
- -
-
- - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css deleted file mode 100644 index f85e049..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css +++ /dev/null @@ -1,165 +0,0 @@ -@keyframes loading-indicator-ball-anim { - 0% { - transform: translate(-50%, -50%) scale(0); - opacity: 0; - } - - 25% { - transform: translate(-50%, -50%) scale(1); - opacity: 1; - } - - 32% { - transform: translate(-50%, -50%) scale(0.5); - opacity: 0; - } - - 100% { - transform: translate(-50%, -50%) scale(0); - opacity: 0; - } -} - -body { - margin: 0; -} - -.loading-indicator-wrapper { - display: flex; - justify-content: center; - align-items: center; - width: 100vw; - height: 100vh; - background-color: #f0f0f0; /* Lighter background */ -} - -.loading-indicator { - position: relative; - width: 80px; - height: 80px; - pointer-events: none; -} - -.loading-indicator-ball { - will-change: transform, opacity; - position: absolute; - width: 16%; - height: 16%; - border-radius: 50%; - background: #3b8eea; /* Light blue */ - filter: blur(3px); /* Slightly lighter blur */ - opacity: 0; - animation: loading-indicator-ball-anim 9s infinite; -} - - .loading-indicator-ball:nth-child(1) { - left: 85.3553390593%; - top: 85.3553390593%; - animation-delay: 0s; - } - - .loading-indicator-ball:nth-child(2) { - left: 100%; - top: 50%; - animation-delay: 0.2s; - } - - .loading-indicator-ball:nth-child(3) { - left: 85.3553390593%; - top: 14.6446609407%; - --rotation: calc(-45deg * 3); - animation-delay: 0.4s; - } - - .loading-indicator-ball:nth-child(4) { - left: 50%; - top: 0%; - animation-delay: 0.6s; - } - - .loading-indicator-ball:nth-child(5) { - left: 14.6446609407%; - top: 14.6446609407%; - animation-delay: 0.8s; - } - - .loading-indicator-ball:nth-child(6) { - left: 0%; - top: 50%; - animation-delay: 1.0s; - } - - .loading-indicator-ball:nth-child(7) { - left: 14.6446609407%; - top: 85.3553390593%; - animation-delay: 1.2s; - } - - .loading-indicator-ball:nth-child(8) { - left: 50%; - top: 100%; - animation-delay: 1.4s; - } - - .loading-indicator-ball:nth-child(9) { - left: 50%; - top: 100%; - animation-delay: 4.5s; - } - - .loading-indicator-ball:nth-child(10) { - left: 14.6446609407%; - top: 85.3553390593%; - animation-delay: 4.7s; - } - - .loading-indicator-ball:nth-child(11) { - left: 0%; - top: 50%; - animation-delay: 4.9s; - } - - .loading-indicator-ball:nth-child(12) { - left: 14.6446609407%; - top: 14.6446609407%; - animation-delay: 5.1s; - } - - .loading-indicator-ball:nth-child(13) { - left: 50%; - top: 0%; - animation-delay: 5.3s; - } - - .loading-indicator-ball:nth-child(14) { - left: 85.3553390593%; - top: 14.6446609407%; - animation-delay: 5.5s; - } - - .loading-indicator-ball:nth-child(15) { - left: 100%; - top: 50%; - animation-delay: 5.7s; - } - - .loading-indicator-ball:nth-child(16) { - left: 85.3553390593%; - top: 85.3553390593%; - animation-delay: 5.9s; - } - -.loading-indicator-text { - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; -} - - .loading-indicator-text:after { - content: var(--blazor-load-percentage-text, "Loading..."); - color: #555; /* Darker text for contrast */ - font-size: 1.2rem; - font-family: 'Arial', sans-serif; - } diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js deleted file mode 100644 index 2495622..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js +++ /dev/null @@ -1,115 +0,0 @@ -(function () { - let lastAnimationTime = 0; - const ANIMATION_THROTTLE_DELAY = 150; // Minimum time between animations - const ANIMATION_DURATION = 150; // Total animation duration - - const odometerClass = "opensilver-odometer"; - - function startLoader() { - const count = document.querySelectorAll("." + odometerClass); - const loader = document.querySelector(".opensilver-loader-progress-bar"); - const loaderProgress = document.querySelector(".opensilver-loader-progress"); - if (!count || !loader) return; - - loader.style.width = "0%"; - const observer = new MutationObserver(updateCount); - - function updateCount() { - const loadPercentageText = getComputedStyle(document.documentElement) - .getPropertyValue("--blazor-load-percentage-text") - .trim(); - const loadPercentage = parseInt(loadPercentageText.replace(/"/g, "")); - const currentValue = isNaN(loadPercentage) ? 0 : loadPercentage; - - // Always animate 100 regardless of throttling - if (currentValue === 100) { - animateCounter(currentValue, true); - loader.style.width = "100%"; - loaderProgress.style["border-right"] = "none"; - observer.disconnect(); - return; - } - - // Throttle animations to prevent too frequent updates - const now = Date.now(); - if (now - lastAnimationTime >= ANIMATION_THROTTLE_DELAY) { - animateCounter(currentValue); - lastAnimationTime = now; - } - - loader.style.width = currentValue + "%"; - } - - observer.observe(document.documentElement, { - attributes: true, - attributeFilter: ["style"], - }); - updateCount(); - } - - function animateCounter(newValue, force = false) { - const odometers = Array.from(document.querySelectorAll("." + odometerClass)); - const newValueString = String(newValue).padStart(3, "0"); - - for (let index = odometers.length - 1; index > -1; index--) { - const element = odometers[index]; - - if (force) { - const finalOdometer = document.createElement("div"); - finalOdometer.textContent = newValueString[index]; - finalOdometer.classList.add(odometerClass); - element.replaceWith(finalOdometer); - continue; - } - - if (element.textContent === "") { - element.textContent = "0"; - } - const currentValue = element.textContent || "0"; - - if (newValueString[index] !== currentValue) { - element.style.transition = `transform ${ANIMATION_DURATION}ms, opacity ${ANIMATION_DURATION}ms`; - element.style.transform = "translateY(-4px)"; - element.style.opacity = "0.5"; - - setTimeout(() => { - element.textContent = newValueString[index]; - element.style.transform = "translateY(4px)"; - element.style.opacity = "0.5"; - - setTimeout(() => { - element.style.transform = "translateY(0)"; - element.style.opacity = "1"; - }, ANIMATION_DURATION / 2); - }, ANIMATION_DURATION / 2); - } - }; - } - - function onDomReady() { - startLoader(); - startAnimations(); - } - - function startAnimations() { - const loaderProgress = document.querySelector(".opensilver-loader-progress"); - const counterContainer = document.querySelector(".opensilver-counter-container"); - - if (loaderProgress) { - loaderProgress.style.transition = "width 1.25s, opacity 1.25s"; - loaderProgress.style.width = "60vw"; - loaderProgress.style.opacity = "1"; - } - - if (counterContainer) { - counterContainer.style.transition = "opacity 0.3s"; - counterContainer.style.opacity = "1"; - } - } - - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', onDomReady); - } else { - onDomReady(); - } -})(); \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css deleted file mode 100644 index 66c7776..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css +++ /dev/null @@ -1,70 +0,0 @@ -html body { - background: var(--opensilver-loading-background-color); -} - -.opensilver-loading-indicator { - position: fixed; - top: 0; - left: 0; - display: flex; - justify-content: center; - align-items: center; - pointer-events: none; - height: 100vh; - width: 100vw; - overflow: hidden; - background: var(--opensilver-loading-background-color); -} - -.opensilver-loading-indicator .opensilver-loader-container { - display: flex; - justify-content: center; - align-items: center; - gap: 8px; -} - -.opensilver-loading-indicator .opensilver-loader { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 10px; - width: 100%; - height: 100%; - margin-left: 20px; -} - -.opensilver-loading-indicator .opensilver-loader-progress { - display: flex; - justify-content: flex-start; - align-items: center; - width: 0; - max-width: 200px; - height: 4px; - border-radius: 12px; - background-color: var(--opensilver-loading-progress-bg); - border-bottom: 1px var(--opensilver-loading-progress-border-color) solid; - border-right: 1px var(--opensilver-loading-progress-border-color) solid; -} - -.opensilver-loading-indicator .opensilver-loader-progress-bar { - width: 0%; - height: 5px; - border-radius: 12px; - background-color: var(--opensilver-loading-progress-bar-color); -} - -.opensilver-loading-indicator .opensilver-counter-container { - align-self: end; - display: flex; - justify-content: end; - align-items: center; - font-family: sans-serif; - font-size: 0.8rem; - font-weight: 500; - width: 100%; - min-width: 26px; - line-height: 1; - gap: 1px; - color: var(--opensilver-loading-counter-color); -} diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj deleted file mode 100644 index 2234dd3..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - WinExe - net9.0-windows - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs deleted file mode 100644 index 924abe0..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs +++ /dev/null @@ -1,14 +0,0 @@ -using OpenSilver.Simulator; -using System; - -namespace OpenSilverApplication.Simulator -{ - internal static class Startup - { - [STAThread] - static int Main(string[] args) - { - return SimulatorLauncher.Start(typeof(App)); - } - } -} diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.sln b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.sln index 8b8351c..d5f488b 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.sln +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.sln @@ -3,39 +3,50 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34310.174 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Browser", "OpenSilverApplication.Browser\OpenSilverApplication.Browser.csproj", "{41168522-4247-4181-BE6B-CD561E266F1B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Browser", "OpenSilverApplication.Browser\OpenSilverApplication.Browser.csproj", "{79254849-EE14-42B2-82CB-07A7D4FA3205}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "OpenSilverApplication", "OpenSilverApplication\OpenSilverApplication.fsproj", "{052AA0E1-BF65-4EE4-B6D3-112AE3350154}" EndProject #if (operatingSystem == 'Windows_NT') -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{88992088-C7C5-47CF-87AB-FC26135729B8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{E5006009-F128-4902-AD10-D55E7942946A}" EndProject #endif -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "OpenSilverApplication", "OpenSilverApplication\OpenSilverApplication.fsproj", "{AE40C775-AAE2-4310-8566-AA1EB3F79F04}" +#if (mauiPlatformsBasic != '' || windowsTarget != '') +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.MauiHybrid", "OpenSilverApplication.MauiHybrid\OpenSilverApplication.MauiHybrid.csproj", "{E98BBAFF-DE97-48FB-B99E-019727405EFE}" EndProject +#endif Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {41168522-4247-4181-BE6B-CD561E266F1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Release|Any CPU.Build.0 = Release|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Release|Any CPU.Build.0 = Release|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Debug|Any CPU.Build.0 = Debug|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Release|Any CPU.ActiveCfg = Release|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Release|Any CPU.Build.0 = Release|Any CPU #if (operatingSystem == 'Windows_NT') - {88992088-C7C5-47CF-87AB-FC26135729B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Release|Any CPU.Build.0 = Release|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.Build.0 = Release|Any CPU + #endif + #if (mauiPlatformsBasic != '' || windowsTarget != '') + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.Build.0 = Release|Any CPU #endif - {AE40C775-AAE2-4310-8566-AA1EB3F79F04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE40C775-AAE2-4310-8566-AA1EB3F79F04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE40C775-AAE2-4310-8566-AA1EB3F79F04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE40C775-AAE2-4310-8566-AA1EB3F79F04}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B9762355-C28A-465A-91A1-9BE8B02EAC72} + SolutionGuid = {D59E1426-E892-4863-9C68-E437124A32F5} EndGlobalSection EndGlobal diff --git a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj index a769390..2bbb795 100644 --- a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj +++ b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj @@ -12,7 +12,7 @@ Template - 3.1.3 + 3.1.4 OpenSilver.Templates Opensilver CLI templates Userware @@ -36,4 +36,16 @@ + + + + + + + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/Tools/TemplateTweaker/Program.cs b/src/OpenSilver.CLI/Tools/TemplateTweaker/Program.cs new file mode 100644 index 0000000..cad6e5c --- /dev/null +++ b/src/OpenSilver.CLI/Tools/TemplateTweaker/Program.cs @@ -0,0 +1,92 @@ +using System; +using System.IO; + +namespace TemplateTweaker +{ + public static class Program + { + public static void Main() + { + // If you have multiple "common" folders, list them all here: + var sourceFolders = new[] + { + "CommonProjectTemplates/OpenSilverApplication.Browser", + "CommonProjectTemplates/OpenSilverApplication.Simulator", + "CommonProjectTemplates/OpenSilverApplication.MauiHybrid" + // Add more sources if needed... + }; + + // List all the template folders that should receive the "common" content: + var destinationFolders = new[] + { + "C#/OpenSilverApplication", + "F#/OpenSilverApplication", + "VB/OpenSilverApplication" + // Add more destinations if needed... + }; + + foreach (var sourceFolder in sourceFolders) + { + if (!Directory.Exists(sourceFolder)) + { + Console.WriteLine($"[WARN] Source folder not found: {sourceFolder}"); + continue; + } + + // We'll copy the entire directory named sourceFolder into each destination. + // For example, if sourceFolder = "CommonProjectTemplates", + // it ends up as e.g. Template1/CommonProjectTemplates + var subfolderName = Path.GetFileName(sourceFolder); + + foreach (var destFolder in destinationFolders) + { + if (!Directory.Exists(destFolder)) + { + Console.WriteLine($"[WARN] Destination folder not found: {destFolder}"); + continue; + } + + var finalPath = Path.Combine(destFolder, subfolderName); + + // 1) Remove any existing folder to avoid stale files + if (Directory.Exists(finalPath)) + { + Console.WriteLine($"Removing existing folder: {finalPath}"); + Directory.Delete(finalPath, recursive: true); + } + + // 2) Copy the folder + Console.WriteLine($"Copying '{sourceFolder}' into '{destFolder}'..."); + DirectoryCopy(sourceFolder, finalPath); + } + } + + Console.WriteLine("All done!"); + } + + /// + /// Recursively copies a directory (all subdirs/files) to a new location. + /// + private static void DirectoryCopy(string sourceDir, string destDir) + { + // Create destination directory + Directory.CreateDirectory(destDir); + + // Copy all files in the current level + foreach (var file in Directory.GetFiles(sourceDir)) + { + var fileName = Path.GetFileName(file); + var destFile = Path.Combine(destDir, fileName); + File.Copy(file, destFile, overwrite: true); + } + + // Copy all subdirectories (recursively) + foreach (var subDir in Directory.GetDirectories(sourceDir)) + { + var subDirName = Path.GetFileName(subDir); + var destSubDir = Path.Combine(destDir, subDirName); + DirectoryCopy(subDir, destSubDir); + } + } + } +} diff --git a/src/OpenSilver.CLI/Tools/TemplateTweaker/TemplateTweaker.csproj b/src/OpenSilver.CLI/Tools/TemplateTweaker/TemplateTweaker.csproj new file mode 100644 index 0000000..aa2c637 --- /dev/null +++ b/src/OpenSilver.CLI/Tools/TemplateTweaker/TemplateTweaker.csproj @@ -0,0 +1,6 @@ + + + Exe + net9.0 + + \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/dotnetcli.host.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/dotnetcli.host.json new file mode 100644 index 0000000..8f6f20a --- /dev/null +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/dotnetcli.host.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "mauiPlatforms": { + "longName": "mauiPlatforms", + "shortName": "mp", + "isHidden": true + } + } +} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index 90a8ff4..1ab4b91 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -31,6 +31,12 @@ "exclude": [ "OpenSilverApplication.Simulator/**" ] + }, + { + "condition": "(mauiPlatformsBasic == '' && windowsTarget == '')", + "exclude": [ + "OpenSilverApplication.MauiHybrid/**" + ] } ] } @@ -41,6 +47,10 @@ { "path": "./OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj", "condition": "(operatingSystem == 'Windows_NT')" + }, + { + "path": "./OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj", + "condition": "(mauiPlatformsBasic != '' || windowsTarget != '')" } ], "symbols": { @@ -91,6 +101,44 @@ } ] }, + "mauiPlatforms": { + "type": "parameter", + "datatype": "choice", + "description": "Specifies which MAUI platforms to include.", + "allowMultipleValues": true, + "replaces": "$maui-platforms$", + "choices": [ + { + "choice": "android", + "description": "Android" + }, + { + "choice": "ios", + "description": "iOS" + }, + { + "choice": "macos", + "description": "macOS" + }, + { + "choice": "windows", + "description": "Windows" + }, + { + "choice": "all", + "description": "All supported platforms" + } + ] + }, + + "langShortCode": { + "type": "generated", + "generator": "constant", + "replaces": "$LangShortCode$", + "parameters": { + "value": "vb" + } + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -123,6 +171,14 @@ "value": "3.1.*" } }, + "openSilverMauiHybridPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "$OpenSilverMauiHybridPackageVersion$", + "parameters": { + "value": "3.2.0-preview-2025-01-23-143554-64fb2e70" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", @@ -186,14 +242,113 @@ }, "operatingSystem": { "type": "bind", - "binding": "env:OS" + "binding": "env:OS", + "defaultValue": "" + }, + "androidTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-android" + }, + { + "condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-android" + } + ] + } + }, + "iosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-ios" + }, + { + "condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-ios" + } + ] + } + }, + "macosTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-maccatalyst" + }, + { + "condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-maccatalyst" + } + ] + } + }, + "windowsTarget": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$WindowsTarget$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net8.0')", + "value": "net8.0-windows10.0.19041.0" + }, + { + "condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net9.0')", + "value": "net9.0-windows10.0.19041.0" + } + ] + } + }, + "mauiPlatformsBasic": { + "type": "generated", + "generator": "join", + "replaces": "$MauiPlatformsBasic$", + "parameters": { + "symbols": [ + { + "type": "ref", + "value": "androidTarget" + }, + { + "type": "ref", + "value": "iosTarget" + }, + { + "type": "ref", + "value": "macosTarget" + } + ], + "removeEmptyValues": true, + "separator": ";" + } } + }, "guids": [ - "41168522-4247-4181-BE6B-CD561E266F1B", - "F563F170-CE74-449A-86D7-16311BE5D624", - "88992088-C7C5-47CF-87AB-FC26135729B8", - "B9762355-C28A-465A-91A1-9BE8B02EAC72" + "79254849-EE14-42B2-82CB-07A7D4FA3205", + "052AA0E1-BF65-4EE4-B6D3-112AE3350154", + "E5006009-F128-4902-AD10-D55E7942946A", + "D59E1426-E892-4863-9C68-E437124A32F5", + "E98BBAFF-DE97-48FB-B99E-019727405EFE" ], "postActions": [ { @@ -208,4 +363,4 @@ "continueOnError": true } ] -} \ No newline at end of file +} diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/App.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/App.cs deleted file mode 100644 index 2a73757..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/App.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.CompilerServices; -using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.AspNetCore.Components.Routing; - -namespace OpenSilverApplication.Browser -{ - public class App : ComponentBase - { - protected override void BuildRenderTree(RenderTreeBuilder builder) - { - builder.OpenComponent(0); - builder.AddAttribute(1, "AppAssembly", RuntimeHelpers.TypeCheck( - typeof(Program).Assembly - )); - builder.AddAttribute(2, "PreferExactMatches", RuntimeHelpers.TypeCheck( - true - )); - builder.AddAttribute(3, "Found", (RenderFragment)(routeData => builder2 => - { - builder2.OpenComponent(4); - builder2.AddAttribute(5, "RouteData", RuntimeHelpers.TypeCheck( - routeData - )); - builder2.CloseComponent(); - } - )); - builder.AddAttribute(7, "NotFound", (RenderFragment)(builder2 => - { - builder2.OpenComponent(8); - builder2.AddAttribute(9, "ChildContent", (RenderFragment)(builder3 => - { - builder3.AddMarkupContent(10, "

Sorry, there\'s nothing at this address.

"); - } - )); - builder2.CloseComponent(); - } - )); - builder.CloseComponent(); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj deleted file mode 100644 index f310836..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - net9.0 - 7 - true - false - - - - - - - - - - - - True - - - - - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs deleted file mode 100644 index b9ba02e..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using OpenSilver.WebAssembly; - -namespace OpenSilverApplication.Browser.Pages -{ - [Route("/")] - public class Index : ComponentBase - { - protected override void BuildRenderTree(RenderTreeBuilder __builder) - { - } - - protected async override Task OnInitializedAsync() - { - await base.OnInitializedAsync(); - await Runner.RunApplicationAsync(); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs deleted file mode 100644 index a654b19..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using System.Threading.Tasks; - -namespace OpenSilverApplication.Browser -{ - public class Program - { - public static async Task Main(string[] args) - { - var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("#app"); - var host = builder.Build(); - await host.RunAsync(); - } - } -} diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json deleted file mode 100644 index e79929a..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:55591/", - "sslPort": 0 - } - }, - "profiles": { - "OpenSilverApplication.Browser": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico deleted file mode 100644 index a4bff57..0000000 Binary files a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/favicon.ico and /dev/null differ diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html deleted file mode 100644 index f345f35..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - OpenSilverApplication - - - - - - - - - - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- - - -
-
-
- -
-
- - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css deleted file mode 100644 index f85e049..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/loading-indicator.css +++ /dev/null @@ -1,165 +0,0 @@ -@keyframes loading-indicator-ball-anim { - 0% { - transform: translate(-50%, -50%) scale(0); - opacity: 0; - } - - 25% { - transform: translate(-50%, -50%) scale(1); - opacity: 1; - } - - 32% { - transform: translate(-50%, -50%) scale(0.5); - opacity: 0; - } - - 100% { - transform: translate(-50%, -50%) scale(0); - opacity: 0; - } -} - -body { - margin: 0; -} - -.loading-indicator-wrapper { - display: flex; - justify-content: center; - align-items: center; - width: 100vw; - height: 100vh; - background-color: #f0f0f0; /* Lighter background */ -} - -.loading-indicator { - position: relative; - width: 80px; - height: 80px; - pointer-events: none; -} - -.loading-indicator-ball { - will-change: transform, opacity; - position: absolute; - width: 16%; - height: 16%; - border-radius: 50%; - background: #3b8eea; /* Light blue */ - filter: blur(3px); /* Slightly lighter blur */ - opacity: 0; - animation: loading-indicator-ball-anim 9s infinite; -} - - .loading-indicator-ball:nth-child(1) { - left: 85.3553390593%; - top: 85.3553390593%; - animation-delay: 0s; - } - - .loading-indicator-ball:nth-child(2) { - left: 100%; - top: 50%; - animation-delay: 0.2s; - } - - .loading-indicator-ball:nth-child(3) { - left: 85.3553390593%; - top: 14.6446609407%; - --rotation: calc(-45deg * 3); - animation-delay: 0.4s; - } - - .loading-indicator-ball:nth-child(4) { - left: 50%; - top: 0%; - animation-delay: 0.6s; - } - - .loading-indicator-ball:nth-child(5) { - left: 14.6446609407%; - top: 14.6446609407%; - animation-delay: 0.8s; - } - - .loading-indicator-ball:nth-child(6) { - left: 0%; - top: 50%; - animation-delay: 1.0s; - } - - .loading-indicator-ball:nth-child(7) { - left: 14.6446609407%; - top: 85.3553390593%; - animation-delay: 1.2s; - } - - .loading-indicator-ball:nth-child(8) { - left: 50%; - top: 100%; - animation-delay: 1.4s; - } - - .loading-indicator-ball:nth-child(9) { - left: 50%; - top: 100%; - animation-delay: 4.5s; - } - - .loading-indicator-ball:nth-child(10) { - left: 14.6446609407%; - top: 85.3553390593%; - animation-delay: 4.7s; - } - - .loading-indicator-ball:nth-child(11) { - left: 0%; - top: 50%; - animation-delay: 4.9s; - } - - .loading-indicator-ball:nth-child(12) { - left: 14.6446609407%; - top: 14.6446609407%; - animation-delay: 5.1s; - } - - .loading-indicator-ball:nth-child(13) { - left: 50%; - top: 0%; - animation-delay: 5.3s; - } - - .loading-indicator-ball:nth-child(14) { - left: 85.3553390593%; - top: 14.6446609407%; - animation-delay: 5.5s; - } - - .loading-indicator-ball:nth-child(15) { - left: 100%; - top: 50%; - animation-delay: 5.7s; - } - - .loading-indicator-ball:nth-child(16) { - left: 85.3553390593%; - top: 85.3553390593%; - animation-delay: 5.9s; - } - -.loading-indicator-text { - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; -} - - .loading-indicator-text:after { - content: var(--blazor-load-percentage-text, "Loading..."); - color: #555; /* Darker text for contrast */ - font-size: 1.2rem; - font-family: 'Arial', sans-serif; - } diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js deleted file mode 100644 index 2495622..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js +++ /dev/null @@ -1,115 +0,0 @@ -(function () { - let lastAnimationTime = 0; - const ANIMATION_THROTTLE_DELAY = 150; // Minimum time between animations - const ANIMATION_DURATION = 150; // Total animation duration - - const odometerClass = "opensilver-odometer"; - - function startLoader() { - const count = document.querySelectorAll("." + odometerClass); - const loader = document.querySelector(".opensilver-loader-progress-bar"); - const loaderProgress = document.querySelector(".opensilver-loader-progress"); - if (!count || !loader) return; - - loader.style.width = "0%"; - const observer = new MutationObserver(updateCount); - - function updateCount() { - const loadPercentageText = getComputedStyle(document.documentElement) - .getPropertyValue("--blazor-load-percentage-text") - .trim(); - const loadPercentage = parseInt(loadPercentageText.replace(/"/g, "")); - const currentValue = isNaN(loadPercentage) ? 0 : loadPercentage; - - // Always animate 100 regardless of throttling - if (currentValue === 100) { - animateCounter(currentValue, true); - loader.style.width = "100%"; - loaderProgress.style["border-right"] = "none"; - observer.disconnect(); - return; - } - - // Throttle animations to prevent too frequent updates - const now = Date.now(); - if (now - lastAnimationTime >= ANIMATION_THROTTLE_DELAY) { - animateCounter(currentValue); - lastAnimationTime = now; - } - - loader.style.width = currentValue + "%"; - } - - observer.observe(document.documentElement, { - attributes: true, - attributeFilter: ["style"], - }); - updateCount(); - } - - function animateCounter(newValue, force = false) { - const odometers = Array.from(document.querySelectorAll("." + odometerClass)); - const newValueString = String(newValue).padStart(3, "0"); - - for (let index = odometers.length - 1; index > -1; index--) { - const element = odometers[index]; - - if (force) { - const finalOdometer = document.createElement("div"); - finalOdometer.textContent = newValueString[index]; - finalOdometer.classList.add(odometerClass); - element.replaceWith(finalOdometer); - continue; - } - - if (element.textContent === "") { - element.textContent = "0"; - } - const currentValue = element.textContent || "0"; - - if (newValueString[index] !== currentValue) { - element.style.transition = `transform ${ANIMATION_DURATION}ms, opacity ${ANIMATION_DURATION}ms`; - element.style.transform = "translateY(-4px)"; - element.style.opacity = "0.5"; - - setTimeout(() => { - element.textContent = newValueString[index]; - element.style.transform = "translateY(4px)"; - element.style.opacity = "0.5"; - - setTimeout(() => { - element.style.transform = "translateY(0)"; - element.style.opacity = "1"; - }, ANIMATION_DURATION / 2); - }, ANIMATION_DURATION / 2); - } - }; - } - - function onDomReady() { - startLoader(); - startAnimations(); - } - - function startAnimations() { - const loaderProgress = document.querySelector(".opensilver-loader-progress"); - const counterContainer = document.querySelector(".opensilver-counter-container"); - - if (loaderProgress) { - loaderProgress.style.transition = "width 1.25s, opacity 1.25s"; - loaderProgress.style.width = "60vw"; - loaderProgress.style.opacity = "1"; - } - - if (counterContainer) { - counterContainer.style.transition = "opacity 0.3s"; - counterContainer.style.opacity = "1"; - } - } - - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', onDomReady); - } else { - onDomReady(); - } -})(); \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css deleted file mode 100644 index 66c7776..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css +++ /dev/null @@ -1,70 +0,0 @@ -html body { - background: var(--opensilver-loading-background-color); -} - -.opensilver-loading-indicator { - position: fixed; - top: 0; - left: 0; - display: flex; - justify-content: center; - align-items: center; - pointer-events: none; - height: 100vh; - width: 100vw; - overflow: hidden; - background: var(--opensilver-loading-background-color); -} - -.opensilver-loading-indicator .opensilver-loader-container { - display: flex; - justify-content: center; - align-items: center; - gap: 8px; -} - -.opensilver-loading-indicator .opensilver-loader { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 10px; - width: 100%; - height: 100%; - margin-left: 20px; -} - -.opensilver-loading-indicator .opensilver-loader-progress { - display: flex; - justify-content: flex-start; - align-items: center; - width: 0; - max-width: 200px; - height: 4px; - border-radius: 12px; - background-color: var(--opensilver-loading-progress-bg); - border-bottom: 1px var(--opensilver-loading-progress-border-color) solid; - border-right: 1px var(--opensilver-loading-progress-border-color) solid; -} - -.opensilver-loading-indicator .opensilver-loader-progress-bar { - width: 0%; - height: 5px; - border-radius: 12px; - background-color: var(--opensilver-loading-progress-bar-color); -} - -.opensilver-loading-indicator .opensilver-counter-container { - align-self: end; - display: flex; - justify-content: end; - align-items: center; - font-family: sans-serif; - font-size: 0.8rem; - font-weight: 500; - width: 100%; - min-width: 26px; - line-height: 1; - gap: 1px; - color: var(--opensilver-loading-counter-color); -} diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs deleted file mode 100644 index 924abe0..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/Startup.cs +++ /dev/null @@ -1,14 +0,0 @@ -using OpenSilver.Simulator; -using System; - -namespace OpenSilverApplication.Simulator -{ - internal static class Startup - { - [STAThread] - static int Main(string[] args) - { - return SimulatorLauncher.Start(typeof(App)); - } - } -} diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.sln b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.sln index 46ebf2d..d4b6bd8 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.sln +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.sln @@ -3,12 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34310.174 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSilverApplication.Browser", "OpenSilverApplication.Browser\OpenSilverApplication.Browser.csproj", "{41168522-4247-4181-BE6B-CD561E266F1B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Browser", "OpenSilverApplication.Browser\OpenSilverApplication.Browser.csproj", "{79254849-EE14-42B2-82CB-07A7D4FA3205}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OpenSilverApplication", "OpenSilverApplication\OpenSilverApplication.vbproj", "{F563F170-CE74-449A-86D7-16311BE5D624}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OpenSilverApplication", "OpenSilverApplication\OpenSilverApplication.vbproj", "{052AA0E1-BF65-4EE4-B6D3-112AE3350154}" EndProject #if (operatingSystem == 'Windows_NT') -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{88992088-C7C5-47CF-87AB-FC26135729B8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{E5006009-F128-4902-AD10-D55E7942946A}" +EndProject +#endif +#if (mauiPlatformsBasic != '' || windowsTarget != '') +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.MauiHybrid", "OpenSilverApplication.MauiHybrid\OpenSilverApplication.MauiHybrid.csproj", "{E98BBAFF-DE97-48FB-B99E-019727405EFE}" EndProject #endif Global @@ -17,25 +21,32 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {41168522-4247-4181-BE6B-CD561E266F1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41168522-4247-4181-BE6B-CD561E266F1B}.Release|Any CPU.Build.0 = Release|Any CPU - {F563F170-CE74-449A-86D7-16311BE5D624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F563F170-CE74-449A-86D7-16311BE5D624}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F563F170-CE74-449A-86D7-16311BE5D624}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F563F170-CE74-449A-86D7-16311BE5D624}.Release|Any CPU.Build.0 = Release|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79254849-EE14-42B2-82CB-07A7D4FA3205}.Release|Any CPU.Build.0 = Release|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Debug|Any CPU.Build.0 = Debug|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Release|Any CPU.ActiveCfg = Release|Any CPU + {052AA0E1-BF65-4EE4-B6D3-112AE3350154}.Release|Any CPU.Build.0 = Release|Any CPU #if (operatingSystem == 'Windows_NT') - {88992088-C7C5-47CF-87AB-FC26135729B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88992088-C7C5-47CF-87AB-FC26135729B8}.Release|Any CPU.Build.0 = Release|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.Build.0 = Release|Any CPU + #endif + #if (mauiPlatformsBasic != '' || windowsTarget != '') + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.Build.0 = Release|Any CPU #endif EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B9762355-C28A-465A-91A1-9BE8B02EAC72} + SolutionGuid = {D59E1426-E892-4863-9C68-E437124A32F5} EndGlobalSection EndGlobal