Skip to content

Commit

Permalink
Merge pull request #12395 from Youssef1313/merge-master-into-breaking…
Browse files Browse the repository at this point in the history
…-changes

Merge master into breaking changes
  • Loading branch information
jeromelaban authored May 25, 2023
2 parents c29fff3 + baa9875 commit 59b7842
Show file tree
Hide file tree
Showing 150 changed files with 6,171 additions and 2,491 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ root = true

[*]
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.{xaml,xml,targets,props,csproj,cs,tt,java,ts,json}]
Expand Down
5 changes: 0 additions & 5 deletions build/ci/.azure-devops-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
- template: templates/gitversion.yml
- template: templates/jdk-setup.yml

- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.9.1
checkLatest: false

- task: MSBuild@1
inputs:
solution: Build/Uno.UI.Build.csproj
Expand Down
5 changes: 0 additions & 5 deletions build/ci/.azure-devops-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ jobs:
xCodeRoot: ${{ parameters.xCodeRoot }}
XamarinSDKVersion: ${{ parameters.XamarinSDKVersion }}

- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.7.0
checkLatest: false

- script: |
cd src/SamplesApp/SamplesApp.netcoremobile
dotnet build -f net7.0-macos -r osx-x64 -c Release -p:UnoTargetFrameworkOverride=net7.0-macos -p:CreatePackage=true -p:EnableCodeSigning=false -p:UnoDisableNet8Mobile=true /p:UnoDisableNet8=true /bl:$BUILD_ARTIFACTSTAGINGDIRECTORY/macos-netcoremobile-sampleapp.binlog
Expand Down
5 changes: 0 additions & 5 deletions build/ci/.azure-devops-screenshot-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ jobs:
- checkout: self
clean: true

- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.9.1
checkLatest: false

- template: templates/dotnet-install.yml

- task: MSBuild@1
Expand Down
2 changes: 1 addition & 1 deletion doc/articles/get-started-dotnet-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dotnet new unoapp -preset=recommended -o test
```

> [!NOTE]
> It is possible to create a .NET 6 template by using the `-f net6.0` parameter.
> It is possible to create a .NET 6 template by using the `-tfm net6.0` parameter.
More articles on WinUI 3:

Expand Down
6 changes: 3 additions & 3 deletions doc/import_external_docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ $external_docs = @{
# use either commit, or branch name to use its latest commit
"uno.wasm.bootstrap" = "4abadfc93ffeddc82420cc28af04cd7f6b2693ab"
"uno.themes" = "3d12f341f3ce9ecd7738e163a3a0904e9b94466f"
"uno.toolkit.ui" = "434712b657f479d1329ff60af3b6f22bb6fdb34c"
"uno.toolkit.ui" = "e358da0eb3e912ed0c8ba01d022ad0fcdb83b0f0"
"uno.check" = "5dec33b3cb4c26f578c8d6bd7a84000bf265a14e"
"uno.xamlmerge.task" = "7e8ffef206e87dfea90c53805c45e93a7d8c0b46"
"figma-docs" = "f13d08f2bd7b62fc274b43a4ede4d75909d0f41f"
"uno.resizetizer" = "f650e844cb66a7dafa084a7e778f14f4fd3ce8a2"
"figma-docs" = "a74bc3b13b73a7b5f9a93dd7b9533f9b24784e63"
"uno.resizetizer" = "6ebb69b1e9d442b2304e9e4d41274bf46c00de87"
"uno.uitest" = "555453c2985ef2745fe44503c5809a6168d063c2"
"uno.extensions" = "539d6b0f2e61fbc2ae5d6e35a77de41cafacf5ce"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal static partial void SetPlaybackRate(nint htmlId, double playbackRate)
internal static partial void SetAttribute(nint htmlId, string name, string value);

#if !USE_JSIMPORT
internal static partial void setAttribute(nint htmlId, string name, string value)
internal static partial void SetAttribute(nint htmlId, string name, string value)
=> throw new NotSupportedException();
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</PropertyGroup>

<PropertyGroup>
<MicrosoftNetCompilersToolsetVersion>4.6.0-1.final</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>4.6.0</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PackageReference Update="Uno.UITest.Selenium" Version="1.1.0-dev.59" />
<PackageReference Update="Uno.UITest.Xamarin" Version="1.1.0-dev.59" />
<PackageReference Update="Uno.UITest.Helpers" Version="1.1.0-dev.59" />
<PackageReference Update="Uno.Fonts.Fluent" Version="2.2.0" />
<PackageReference Update="Uno.Fonts.Fluent" Version="2.2.2" />
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
<PackageReference Update="Xamarin.DuoSdk" Version="0.0.3.4" />
<PackageReference Update="Xamarin.UITest" Version="4.1.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public void BitmapImage_vs_SvgImageSource_BitmapRemote()
showLow.SetDependencyPropertyValue("IsCheked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "https://nv-assets.azurewebsites.net/tests/images/uno-overalls.png");
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.png");
streamMode.SetDependencyPropertyValue("IsChecked", "False");

btnBitmap.FastTap();
Expand Down Expand Up @@ -285,7 +285,7 @@ public void BitmapImage_vs_SvgImageSource_SvgRemote()
showLow.SetDependencyPropertyValue("IsCheked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "https://nv-assets.azurewebsites.net/tests/images/uno-overalls.svg");
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.svg");
streamMode.SetDependencyPropertyValue("IsChecked", "False");

btnSvg.FastTap();
Expand Down Expand Up @@ -333,7 +333,7 @@ public void BitmapImage_vs_SvgImageSource_BitmapLocal()

using var screenshotDirect = TakeScreenshot("url_local");

url.SetDependencyPropertyValue("Text", "https://nv-assets.azurewebsites.net/tests/images/uno-overalls.png");
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.png");

btnBitmap.FastTap();

Expand Down Expand Up @@ -372,7 +372,7 @@ public void BitmapImage_vs_SvgImageSource_SvgLocal()

using var screenshotDirect = TakeScreenshot("url_local");

url.SetDependencyPropertyValue("Text", "https://nv-assets.azurewebsites.net/tests/images/uno-overalls.svg");
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.svg");

btnSvg.FastTap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public void WebView_NavigateToAnchor()
var navigateToAnchorButton = _app.Marked("NavigateToAnchorButton");
var clickAnchorButton = _app.Marked("ClickAnchorButton");

_app.WaitForText(navigationCompletedTextBlock, "https://nv-assets.azurewebsites.net/tests/docs/WebView_NavigateToAnchor.html");
_app.WaitForText(navigationCompletedTextBlock, "https://uno-assets.platform.uno/tests/docs/WebView_NavigateToAnchor.html");

// navigate to anchor
_app.FastTap(navigateToAnchorButton);
_app.WaitForText(navigationCompletedTextBlock, "https://nv-assets.azurewebsites.net/tests/docs/WebView_NavigateToAnchor.html#section-1");
_app.WaitForText(navigationCompletedTextBlock, "https://uno-assets.platform.uno/tests/docs/WebView_NavigateToAnchor.html#section-1");

TakeScreenshot("navigate to anchor");

// user click in the browser itself
_app.FastTap(clickAnchorButton);
_app.WaitForText(navigationCompletedTextBlock, "https://nv-assets.azurewebsites.net/tests/docs/WebView_NavigateToAnchor.html#page-4");
_app.WaitForText(navigationCompletedTextBlock, "https://uno-assets.platform.uno/tests/docs/WebView_NavigateToAnchor.html#page-4");

TakeScreenshot("click anchor");
}
Expand Down
1 change: 1 addition & 0 deletions src/SamplesApp/SamplesApp.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="confirmAppClose" />
<rescap:Capability Name="inputInjectionBrokered" />
<uap:Capability Name="appointments"/>
<uap:Capability Name="contacts"/>
<uap2:Capability Name="phoneCallHistoryPublic"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public WebView2_AnchorNavigation()

#if HAS_UNO
//TODO:MZ:
//webView.Navigate(new Uri("https://nv-assets.azurewebsites.net/tests/docs/WebView2_NavigateToAnchor.html"));
//webView.Navigate(new Uri("https://uno-assets.platform.uno/tests/docs/WebView2_NavigateToAnchor.html"));
//webView.NavigationStarting += WebView2_NavigationStarting;
//webView.NavigationCompleted += WebView2_NavigationCompleted;
#endif
Expand All @@ -33,7 +33,7 @@ private void WebView2_NavigationCompleted(Microsoft.UI.Xaml.Controls.WebView2 se
private async void ButtonClicked()
{
await webView.EnsureCoreWebView2Async();
webView.CoreWebView2.Navigate("https://nv-assets.azurewebsites.net/tests/docs/WebView2_NavigateToAnchor.html#section-1");
webView.CoreWebView2.Navigate("https://uno-assets.platform.uno/tests/docs/WebView2_NavigateToAnchor.html#section-1");
}

private void OnClickAnchor()
Expand Down
14 changes: 13 additions & 1 deletion src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Input\SetProtectedCursor.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Input\VisualStatesTests\Buttons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1594,6 +1598,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\SvgImageSource_FromMsAppData.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ListView\ListView_Snap_Rubberband.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -5607,6 +5615,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Input\PointersTests\ScrollViewer_PointerMoved.xaml.cs">
<DependentUpon>ScrollViewer_PointerMoved.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Input\SetProtectedCursor.xaml.cs">
<DependentUpon>SetProtectedCursor.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Input\VisualStatesTests\TextBox_VisualStates.xaml.cs">
<DependentUpon>TextBox_VisualStates.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -5663,6 +5674,7 @@
<DependentUpon>Image_Source_Nullify.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ListView\ListView_BringIntoView.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\SvgImageSource_FromMsAppData.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ListView\ListView_Snap_Rubberband.xaml.cs">
<DependentUpon>ListView_Snap_Rubberband.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -9034,4 +9046,4 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\libre-camera-panorama.svg" />
</ItemGroup>
<Import Project="ItemExclusions.props" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace SamplesApp.Wasm.Windows_UI_Core
{
[SampleControlInfo("Windows.UI.Core", "SetCursor")]
[SampleControlInfo("Windows.UI.Core", "SetCursor", isManualTest: true, description: "Demonstrates use of CoreWindow.PointerCursor / CoreCursor / CoreCursorType")]
public sealed partial class SetCursor : Page
{
public SetCursor()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<Page x:Class="SamplesApp.Wasm.Windows_UI_Input.SetProtectedCursor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Uno.UI.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400"
Background="Cyan"
mc:Ignorable="d">

<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping"
Value="Wrap" />
</Style>
</Grid.Resources>

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<StackPanel Margin="20">
<TextBlock Text="Tests for all platforms. Note for Wasm, Uno.UI.FeatureConfiguration.Cursors.UseHandForInteraction will need to be set to false to match the expected behavior." />
<TextBlock Text="- Test 1: Hover the Button. Expected behavior: Cursor should show SizeWestEast cursor." />
<TextBlock Text="- Test 2: Hover the Button and move to hover the yellow area. Expected behavior: Cursor should show SizeWestEast cursor the entire time." />
<TextBlock Text="- Test 3: Hover the Button and move to hover the blue area. Expected behavior: Cursor should show SizeWestEast cursor first then show back the default Arrow cursor when hovering the blue area." />
<TextBlock Text="- Test 4: Hover the Button, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show SizeWestEast cursor the entire time." />
<TextBlock Text="- Test 5: Hover the pink Border. Expected behavior: Cursor should show Wait cursor." />
<TextBlock Text="- Test 6: Hover the pink Border and move to hover the yellow area. Expected behavior: Cursor should show Wait cursor the entire time." />
<TextBlock Text="- Test 7: Hover the pink Border and move to hover the blue area. Expected behavior: Cursor should show Wait cursor first then show back the default Arrow cursor when hovering the blue area." />
<TextBlock Text="- Test 8: Hover the pink border, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show Wait cursor the entire time." />
<TextBlock Margin="0,10,0,0" Text="Tests for Wasm only. Uno.UI.FeatureConfiguration.Cursors.UseHandForInteraction will need to be set to true to match the expected behavior." />
<TextBlock Text="- Test 1: Hover the Button. Expected behavior: Cursor should show Hand cursor." />
<TextBlock Text="- Test 2: Hover the Button and move to hover the yellow area. Expected behavior: Cursor should show Hand cursor the entire time." />
<TextBlock Text="- Test 3: Hover the Button and move to hover the blue area. Expected behavior: Cursor should show Hand cursor first then show back the default Arrow cursor when hovering the blue area." />
<TextBlock Text="- Test 4: Hover the Button, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show Hand cursor the entire time." />
</StackPanel>

<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Yellow">

<Button Content="Test SizeWestEast Cursor"
PointerEntered="ChangeButtonCursor" />

<Border PointerEntered="ChangeBorderCursor"
PointerPressed="CaptureCursor"
Height="80"
Width="80"
Background="DeepPink">
<TextBlock Text="Test Wait Cursor"
TextAlignment="Center"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Border>

</StackPanel>
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Uno.UI.Samples.Controls;
using System.Collections.Generic;
using System;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;

#if !WINDOWS_UWP
using Microsoft.UI.Input;
#endif

namespace SamplesApp.Wasm.Windows_UI_Input
{
[SampleControlInfo("Windows.UI.Input", "SetProtectedCursor", isManualTest: true, description: "Demonstrates use of UIElement.ProtectedCursor / InputSystemCursor / InputSystemCursorShape")]
public sealed partial class SetProtectedCursor : Page
{
public SetProtectedCursor()
{
this.InitializeComponent();
}

private void ChangeButtonCursor(object sender, PointerRoutedEventArgs e)
{
#if !WINDOWS_UWP
var SizeWestEastCursor = InputSystemCursor.Create(InputSystemCursorShape.SizeWestEast);
this.ProtectedCursor = SizeWestEastCursor;
#endif
}

private void ChangeBorderCursor(object sender, PointerRoutedEventArgs e)
{
#if !WINDOWS_UWP
var waitCursor = InputSystemCursor.Create(InputSystemCursorShape.Wait);
this.ProtectedCursor = waitCursor;
#endif
}

private void CaptureCursor(object sender, PointerRoutedEventArgs e)
{
#if !WINDOWS_UWP
var border = (Border)sender;
border.CapturePointer(e.Pointer);
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</Grid.RowDefinitions>

<StackPanel Spacing="5" Margin="15" VerticalAlignment="Top">
<TextBox x:Name="url" Header="Image Url" Text="https://nv-assets.azurewebsites.net/tests/images/uno-overalls.svg" />
<TextBox x:Name="url" Header="Image Url" Text="https://uno-assets.platform.uno/tests/images/uno-overalls.svg" />
<StackPanel Orientation="Horizontal" Spacing="6">
<CheckBox x:Name="streamMode">Use streaming mode instead of url</CheckBox>
<CheckBox x:Name="showLow" IsChecked="True">Show Log Output</CheckBox>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Page x:Class="UITests.Windows_UI_Xaml_Controls.ImageTests.SvgImageSource_FromMsAppData"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.ImageTests"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<StackPanel Spacing="4">
<ComboBox ItemsSource="{x:Bind Sources}" SelectedItem="{x:Bind SelectedSource, Mode=TwoWay}" Header="SVG image">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="local:SampleSvgSource">
<TextBlock Text="{x:Bind Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox ItemsSource="{x:Bind Stretches}" SelectedItem="{x:Bind SelectedStretch, Mode=TwoWay}" Header="Stretch" />
<TextBox Text="{x:Bind ImageWidth, Mode=TwoWay}" Header="Image width" />
<TextBox Text="{x:Bind ImageHeight, Mode=TwoWay}" Header="Image height" />
<TextBox Text="{x:Bind RasterizedWidth, Mode=TwoWay}" Header="Rasterized width" />
<TextBox Text="{x:Bind RasterizedHeight, Mode=TwoWay}" Header="Rasterized height" />
</StackPanel>

<Grid Grid.Row="1">
<Border HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="Black" BorderThickness="2">
<Image x:Name="ImageElement" />
</Border>
</Grid>
</Grid>
</Page>
Loading

0 comments on commit 59b7842

Please sign in to comment.