diff --git a/src/Templates/src/templates/maui-blazor-solution/.template.config/dotnetcli.host.json b/src/Templates/src/templates/maui-blazor-solution/.template.config/dotnetcli.host.json index 97a8ef71383e..afc0706de6a9 100644 --- a/src/Templates/src/templates/maui-blazor-solution/.template.config/dotnetcli.host.json +++ b/src/Templates/src/templates/maui-blazor-solution/.template.config/dotnetcli.host.json @@ -1,5 +1,5 @@ { - "$schema": "http://json.schemastore.org/dotnetcli.host", + "$schema": "https://json.schemastore.org/dotnetcli.host", "symbolInfo": { "Framework": { "longName": "framework" diff --git a/src/Templates/src/templates/maui-blazor-solution/.template.config/ide.host.json b/src/Templates/src/templates/maui-blazor-solution/.template.config/ide.host.json index eb4c7be5ca2d..08b7c7b49bbd 100644 --- a/src/Templates/src/templates/maui-blazor-solution/.template.config/ide.host.json +++ b/src/Templates/src/templates/maui-blazor-solution/.template.config/ide.host.json @@ -1,5 +1,5 @@ { - "$schema": "http://json.schemastore.org/ide.host", + "$schema": "https://json.schemastore.org/ide.host", "icon": "ide/icon.ico", "disableHttpsSymbol": "NoHttps", "unsupportedHosts": [ diff --git a/src/Templates/src/templates/maui-blazor-solution/.template.config/template.json b/src/Templates/src/templates/maui-blazor-solution/.template.config/template.json index 9277b0ad4e0c..c5436549eba1 100644 --- a/src/Templates/src/templates/maui-blazor-solution/.template.config/template.json +++ b/src/Templates/src/templates/maui-blazor-solution/.template.config/template.json @@ -1,7 +1,17 @@ { - "$schema": "http://json.schemastore.org/template", + "$schema": "https://json.schemastore.org/template", "author": "Microsoft", - "classifications": [ "MAUI", "Android", "iOS", "macOS", "Mac Catalyst", "Windows", "Blazor", "Blazor Hybrid", "Mobile" ], + "classifications": [ + "MAUI", + "Android", + "iOS", + "macOS", + "Mac Catalyst", + "Windows", + "Blazor", + "Blazor Hybrid", + "Mobile" + ], "identity": "Microsoft.Maui.BlazorSolution.CSharp.DOTNET_TFM_VERSION_VALUE", "groupIdentity": "Microsoft.Maui.BlazorSolution", "precedence": "DOTNET_TFM_VERSION_MAJOR_VALUE", @@ -52,65 +62,83 @@ { "source": "./", "target": "./", - "copyOnly": [ "**/wwwroot/css/**", "**/*.svg", "**/*.ttf" ], + "copyOnly": [ + "**/wwwroot/lib/bootstrap/**", + "**/*.svg", + "**/*.ttf" + ], "modifiers": [ { - "condition": "(!UseWebAssembly)", - "exclude": [ - "MauiApp.1.Web.Client/**" - ] - }, - { - "condition": "(!UseProgramMain)", - "exclude": [ - "MauiApp.1.Web/Program.Main.cs", - "MauiApp.1.Web.Client/Program.Main.cs" - ] - }, - { - "condition": "(UseProgramMain)", - "exclude": [ - "MauiApp.1.Web/Program.cs", - "MauiApp.1.Web.Client/Program.cs" - ], - "rename": { - "Program.Main.cs": "Program.cs" - } - }, - { - "condition": "(ExcludeLaunchSettings)", - "exclude": [ - "MauiApp.1.Web/Properties/launchSettings.json" - ] - }, - { - "condition": "(InteractivityPlatform == \"None\")", - "exclude": [ - "MauiApp.1.Shared/Pages/Counter.*" - ] - }, - { - "condition": "(!SampleContent)", - "exclude": [ - "MauiApp.1/Services/**", - "MauiApp.1.Shared/Layout/NavMenu.*", - "MauiApp.1.Shared/Pages/Counter.*", - "MauiApp.1.Shared/Pages/Weather.*", - "MauiApp.1.Shared/Services/**", - "MauiApp.1.Shared/wwwroot/bootstrap/**", - "MauiApp.1.Shared/wwwroot/favicon.*", - "MauiApp.1.Web/Services/**", - "MauiApp.1.Web.Client/Services/**", - "MauiApp.1.Web.Client/wwwroot/**" - ] - }, - { - "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", - "exclude": [ - "*.sln" - ] + "condition": "(!UseWebAssembly)", + "exclude": [ + "MauiApp.1.Web.Client/**" + ] + }, + { + "condition": "(UseWebAssembly && InteractiveAtRoot)", + "rename": { + "MauiApp.1.Web/Components/Layout/": "./MauiApp.1.Web.Client/Layout/" } - ] + }, + { + "condition": "(!UseProgramMain)", + "exclude": [ + "MauiApp.1.Web/Program.Main.cs", + "MauiApp.1.Web.Client/Program.Main.cs" + ] + }, + { + "condition": "(UseProgramMain)", + "exclude": [ + "MauiApp.1.Web/Program.cs", + "MauiApp.1.Web.Client/Program.cs" + ], + "rename": { + "Program.Main.cs": "Program.cs" + } + }, + { + "condition": "(ExcludeLaunchSettings)", + "exclude": [ + "MauiApp.1.Web/Properties/launchSettings.json" + ] + }, + { + "condition": "(InteractivityPlatform == \"None\")", + "exclude": [ + "MauiApp.1.Shared/Pages/Counter.*" + ] + }, + { + "condition": "(!UseServer)", + "exclude": [ + "MauiApp.1.Web/Components/Layout/ReconnectModal.razor", + "MauiApp.1.Web/Components/Layout/ReconnectModal.razor.css", + "MauiApp.1.Web/Components/Layout/ReconnectModal.razor.js" + ] + }, + { + "condition": "(!SampleContent)", + "exclude": [ + "MauiApp.1/Services/**", + "MauiApp.1.Shared/Layout/NavMenu.*", + "MauiApp.1.Shared/Pages/Counter.*", + "MauiApp.1.Shared/Pages/Weather.*", + "MauiApp.1.Shared/Services/**", + "MauiApp.1.Shared/wwwroot/lib/**", + "MauiApp.1.Shared/wwwroot/favicon.*", + "MauiApp.1.Web/Services/**", + "MauiApp.1.Web.Client/Services/**", + "MauiApp.1.Web.Client/wwwroot/**" + ] + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "exclude": [ + "*.sln" + ] + } + ] } ], "preferNameDirectory": true, @@ -142,12 +170,12 @@ "defaultValue": "MS_COMPONENTS_WEBASSEMBLY_VERSION_VALUE" }, "componentsWebAssemblyServerVersion": { - "type": "parameter", - "dataType": "string", - "replaces": "MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION", - "defaultValue": "MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION_VALUE" - }, - "Framework": { + "type": "parameter", + "dataType": "string", + "replaces": "MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION", + "defaultValue": "MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION_VALUE" + }, + "Framework": { "type": "parameter", "description": "The target framework for the project.", "datatype": "choice", @@ -161,49 +189,49 @@ "defaultValue": "DOTNET_TFM_VALUE" }, "FrameworkAspNet": { - "type": "parameter", - "datatype": "string", - "replaces": "${DefaultNetCoreTargetFramework}", - "defaultValue": "DOTNET_TFM_VALUE" - }, - "HostIdentifier": { + "type": "parameter", + "datatype": "string", + "replaces": "${DefaultNetCoreTargetFramework}", + "defaultValue": "DOTNET_TFM_VALUE" + }, + "HostIdentifier": { "type": "bind", "binding": "HostIdentifier" }, "PhoneProductId": { - "type": "generated", - "generator": "guid", - "replaces": "$guid9$" - }, - "nameToLower":{ + "type": "generated", + "generator": "guid", + "replaces": "$guid9$" + }, + "nameToLower": { "type": "generated", "generator": "casing", "parameters": { - "source" : "name", + "source": "name", "toLower": true } }, "nameToAppId": { - "type": "generated", - "generator": "regex", - "dataType": "string", - "parameters": { - "source": "nameToLower", - "steps": [ - { - "regex": "[^a-z0-9_\\.]", - "replacement": "" - } - ] - } - }, - "XmlEncodedAppNameParam": { - "type": "derived", - "valueSource": "name", - "valueTransform": "encode", - "replaces": "XmlEncodedAppName" - }, - "defaultAppId":{ + "type": "generated", + "generator": "regex", + "dataType": "string", + "parameters": { + "source": "nameToLower", + "steps": [ + { + "regex": "[^a-z0-9_\\.]", + "replacement": "" + } + ] + } + }, + "XmlEncodedAppNameParam": { + "type": "derived", + "valueSource": "name", + "valueTransform": "encode", + "replaces": "XmlEncodedAppName" + }, + "defaultAppId": { "type": "generated", "generator": "join", "parameters": { @@ -219,8 +247,8 @@ ] } }, - "finalAppId":{ - "type":"generated", + "finalAppId": { + "type": "generated", "generator": "coalesce", "parameters": { "sourceVariableName": "applicationId", @@ -236,224 +264,231 @@ "description": "The ID to use for secrets (use with Individual auth)." }, "ExcludeLaunchSettings": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "false", - "description": "Whether to exclude launchSettings.json from the generated template." - }, - "kestrelHttpPort": { - "type": "parameter", - "datatype": "integer", - "description": "Port number to use for the HTTP endpoint in launchSettings.json." - }, - "kestrelHttpPortGenerated": { - "type": "generated", - "generator": "port", - "parameters": { - "low": 5000, - "high": 5300 - } + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "Whether to exclude launchSettings.json from the generated template." + }, + "kestrelHttpPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the HTTP endpoint in launchSettings.json." + }, + "kestrelHttpPortGenerated": { + "type": "generated", + "generator": "port", + "parameters": { + "low": 5000, + "high": 5300 + } + }, + "kestrelHttpPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "kestrelHttpPort", + "fallbackVariableName": "kestrelHttpPortGenerated" }, - "kestrelHttpPortReplacer": { - "type": "generated", - "generator": "coalesce", - "parameters": { - "sourceVariableName": "kestrelHttpPort", - "fallbackVariableName": "kestrelHttpPortGenerated" - }, - "replaces": "5500" + "replaces": "5500" + }, + "kestrelHttpsPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used)." + }, + "kestrelHttpsPortGenerated": { + "type": "generated", + "generator": "port", + "parameters": { + "low": 7000, + "high": 7300 + } + }, + "kestrelHttpsPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "kestrelHttpsPort", + "fallbackVariableName": "kestrelHttpsPortGenerated" }, - "kestrelHttpsPort": { - "type": "parameter", - "datatype": "integer", - "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used)." + "replaces": "5501" + }, + "iisHttpPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json." + }, + "iisHttpPortGenerated": { + "type": "generated", + "generator": "port" + }, + "iisHttpPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "iisHttpPort", + "fallbackVariableName": "iisHttpPortGenerated" }, - "kestrelHttpsPortGenerated": { - "type": "generated", - "generator": "port", - "parameters": { - "low": 7000, - "high": 7300 - } + "replaces": "8080" + }, + "iisHttpsPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used)." + }, + "iisHttpsPortGenerated": { + "type": "generated", + "generator": "port", + "parameters": { + "low": 44300, + "high": 44399 + } + }, + "iisHttpsPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "iisHttpsPort", + "fallbackVariableName": "iisHttpsPortGenerated" }, - "kestrelHttpsPortReplacer": { - "type": "generated", - "generator": "coalesce", - "parameters": { - "sourceVariableName": "kestrelHttpsPort", - "fallbackVariableName": "kestrelHttpsPortGenerated" + "replaces": "44300" + }, + "InteractivityPlatform": { + "type": "parameter", + "datatype": "choice", + "defaultValue": "Server", + "displayName": "_Interactive render mode", + "description": "Chooses which interactive render mode to use for interactive components", + "choices": [ + { + "choice": "None", + "displayName": "None", + "description": "No interactivity (static server rendering only)" }, - "replaces": "5501" - }, - "iisHttpPort": { - "type": "parameter", - "datatype": "integer", - "description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json." - }, - "iisHttpPortGenerated": { - "type": "generated", - "generator": "port" - }, - "iisHttpPortReplacer": { - "type": "generated", - "generator": "coalesce", - "parameters": { - "sourceVariableName": "iisHttpPort", - "fallbackVariableName": "iisHttpPortGenerated" + { + "choice": "Server", + "displayName": "Server", + "description": "Runs on the server" }, - "replaces": "8080" - }, - "iisHttpsPort": { - "type": "parameter", - "datatype": "integer", - "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if Individual auth is used)." - }, - "iisHttpsPortGenerated": { - "type": "generated", - "generator": "port", - "parameters": { - "low": 44300, - "high": 44399 - } - }, - "iisHttpsPortReplacer": { - "type": "generated", - "generator": "coalesce", - "parameters": { - "sourceVariableName": "iisHttpsPort", - "fallbackVariableName": "iisHttpsPortGenerated" + { + "choice": "WebAssembly", + "displayName": "WebAssembly", + "description": "Runs in the browser using WebAssembly" }, - "replaces": "44300" - }, - "InteractivityPlatform": { - "type": "parameter", - "datatype": "choice", - "defaultValue": "Server", - "displayName": "_Interactive render mode", - "description": "Chooses which interactive render mode to use for interactive components", - "choices": [ - { - "choice": "None", - "displayName": "None", - "description": "No interactivity (static server rendering only)" - }, - { - "choice": "Server", - "displayName": "Server", - "description": "Runs on the server" - }, - { - "choice": "WebAssembly", - "displayName": "WebAssembly", - "description": "Runs in the browser using WebAssembly" - }, - { - "choice": "Auto", - "displayName": "Auto (Server and WebAssembly)", - "description": "Uses Server while downloading WebAssembly assets, then uses WebAssembly" - } - ] - }, - "InteractivityLocation": { - "type": "generated", - "generator": "constant", - "parameters": { - "value":"InteractiveGlobal" - } - }, - "UseWebAssembly": { - "type": "computed", - "value": "(InteractivityPlatform == \"WebAssembly\" || InteractivityPlatform == \"Auto\")" - }, - "UseServer": { - "type": "computed", - "value": "(InteractivityPlatform == \"Server\" || InteractivityPlatform == \"Auto\")" - }, - "IncludeSampleContent": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "true", - "displayName": "_Include sample pages", - "description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns." - }, - "Empty": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "false", - "description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns." - }, - "auth": { - "type": "generated", - "generator": "constant", - "parameters": { - "value":"None" - } - }, - "UseLocalDB": { - "type": "generated", - "generator": "constant", - "parameters": { - "value":"false" - } - }, - "SampleContent": { - "type": "computed", - "value": "(((IncludeSampleContent && (HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\"))) || ((!Empty && (HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\"))))" - }, - "AllInteractive": { - "type": "parameter", - "datatype": "bool", - "isEnabled": "(InteractivityPlatform != \"None\")", - "defaultValue": "false", - "displayName": "_Enable interactive rendering globally throughout the site", - "description": "Configures whether to make every page interactive by applying an interactive render mode at the top level. If false, pages will use static server rendering by default, and can be marked interactive on a per-page or per-component basis." - }, - "InteractiveAtRoot": { - "type": "computed", - "value": "(InteractivityLocation == \"InteractiveGlobal\" || AllInteractive)" - }, - "IndividualLocalAuth": { - "type": "computed", - "value": "(auth == \"Individual\")" - }, - "RequiresHttps": { - "type": "computed", - "value": "(OrganizationalAuth || IndividualLocalAuth)" - }, - "HasHttpProfile": { - "type": "computed", - "value": "(!RequiresHttps)" - }, - "HasHttpsProfile": { - "type": "computed", - "value": "(RequiresHttps || !NoHttps)" - }, - "NoHttps": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual isn't used for --auth." - }, - "copyrightYear": { - "type": "generated", - "generator": "now", - "replaces": "copyrightYear", - "parameters": { - "format": "yyyy" + { + "choice": "Auto", + "displayName": "Auto (Server and WebAssembly)", + "description": "Uses Server while downloading WebAssembly assets, then uses WebAssembly" } - }, - "UseProgramMain": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "false", - "displayName": "Do not use _top-level statements", - "description": "Whether to generate an explicit Program class and Main method instead of top-level statements." + ] + }, + "InteractivityLocation": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "InteractiveGlobal" } }, - "forms": { - "encode": { - "identifier": "xmlEncode" - } + "UseWebAssembly": { + "type": "computed", + "value": "(InteractivityPlatform == \"WebAssembly\" || InteractivityPlatform == \"Auto\")" + }, + "UseServer": { + "type": "computed", + "value": "(InteractivityPlatform == \"Server\" || InteractivityPlatform == \"Auto\")" + }, + "IncludeSampleContent": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "true", + "displayName": "_Include sample pages", + "description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns." + }, + "Empty": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns." + }, + "auth": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "None" + } + }, + "UseLocalDB": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "false" + } + }, + "SampleContent": { + "type": "computed", + "value": "(((IncludeSampleContent && (HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\"))) || ((!Empty && (HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\"))))" + }, + "AllInteractive": { + "type": "parameter", + "datatype": "bool", + "isEnabled": "(InteractivityPlatform != \"None\")", + "defaultValue": "false", + "displayName": "_Enable interactive rendering globally throughout the site", + "description": "Configures whether to make every page interactive by applying an interactive render mode at the top level. If false, pages will use static server rendering by default, and can be marked interactive on a per-page or per-component basis." + }, + "InteractiveAtRoot": { + "type": "computed", + "value": "(InteractivityLocation == \"InteractiveGlobal\" || AllInteractive)" + }, + "IndividualLocalAuth": { + "type": "computed", + "value": "(auth == \"Individual\")" + }, + "RequiresHttps": { + "type": "computed", + "value": "(OrganizationalAuth || IndividualLocalAuth)" + }, + "HasHttpProfile": { + "type": "computed", + "value": "(!RequiresHttps)" + }, + "HasHttpsProfile": { + "type": "computed", + "value": "(RequiresHttps || !NoHttps)" + }, + "NoHttps": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "Whether to turn off HTTPS. This option only applies if Individual isn't used for --auth." + }, + "copyrightYear": { + "type": "generated", + "generator": "now", + "replaces": "copyrightYear", + "parameters": { + "format": "yyyy" + } + }, + "UseProgramMain": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "displayName": "Do not use _top-level statements", + "description": "Whether to generate an explicit Program class and Main method instead of top-level statements." }, - "defaultName": "MauiApp1" -} + "LocalhostTld": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "displayName": "Use the .dev.localhost TLD in the application URL", + "description": "Whether to combine the project name with the .dev.localhost TLD in the application URL for local development, e.g. https://myapp.dev.localhost:12345." + } + }, + "forms": { + "encode": { + "identifier": "xmlEncode" + } + }, + "defaultName": "MauiApp1" +} \ No newline at end of file diff --git a/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/MainLayout.razor.css b/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/MainLayout.razor.css index 9d5804098621..6937ae37a6ea 100644 --- a/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/MainLayout.razor.css +++ b/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/MainLayout.razor.css @@ -79,6 +79,7 @@ main { /*#endif*/ #blazor-error-ui { + color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); diff --git a/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/NavMenu.razor b/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/NavMenu.razor index 632a8263d90c..fbeaf6944377 100644 --- a/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/NavMenu.razor +++ b/src/Templates/src/templates/maui-blazor-solution/MauiApp.1.Shared/Layout/NavMenu.razor @@ -13,7 +13,7 @@