Skip to content

Commit

Permalink
Merge branch 'main' into opacitymaskview-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
h82258652 authored Apr 3, 2024
2 parents 5adf13a + 54ff01c commit 1decd44
Show file tree
Hide file tree
Showing 100 changed files with 4,583 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"uno.check": {
"version": "1.18.1",
"version": "1.20.2",
"commands": [
"uno-check"
]
Expand All @@ -15,7 +15,7 @@
]
},
"microsoft.visualstudio.slngen.tool": {
"version": "9.5.4",
"version": "11.2.3",
"commands": [
"slngen"
]
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.208.0/containers/dotnet/.devcontainer/base.Dockerfile

# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal
ARG VARIANT="6.0-bullseye-slim"
# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal, etc
ARG VARIANT="8.0-bullseye-slim"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"ms-dotnettools.csdevkit",
"unoplatform.vscode",
"ms-vsliveshare.vsliveshare",
"ms-vscode.powershell"
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
merge_group:

env:
DOTNET_VERSION: ${{ '7.0.402' }}
DOTNET_VERSION: ${{ '8.0.201' }}
ENABLE_DIAGNOSTICS: false
#COREHOST_TRACE: 1
MSBUILD_VERBOSITY: normal
Expand Down Expand Up @@ -106,7 +106,6 @@ jobs:
- name: Restore dotnet tools
run: dotnet tool restore

# Pinning Manifest for 1.18 version of Uno.Check at the moment to unblock build, see https://github.com/CommunityToolkit/Windows/pull/320
- name: Run Uno Check to Install Dependencies
run: >
dotnet tool run uno-check
Expand All @@ -117,10 +116,11 @@ jobs:
--skip androidemulator
--skip vswinworkloads
--verbose
--manifest https://raw.githubusercontent.com/unoplatform/uno.check/1660eba219684491362704c75153b40ce6ef7a35/manifests/uno.ui.manifest.json
- name: Add msbuild to PATH
uses: microsoft/[email protected]
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.9,)'

- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
Expand Down Expand Up @@ -158,6 +158,10 @@ jobs:
working-directory: ./tooling/Scripts/
run: ./PackEachExperiment.ps1 -date ${{ env.VERSION_DATE }}${{ env.VERSION_PROPERTY != '' && format(' -postfix {0}', env.VERSION_PROPERTY) || '' }}

- name: Validate package names
if: ${{ env.VERSION_PROPERTY != '' }}
run: powershell -version 5.1 -command "Get-ChildItem -Path '**/*.nupkg' | ForEach-Object { if (`$_.Name -notmatch '${{ env.VERSION_PROPERTY }}') { throw 'Nupkg name is missing trailing VERSION_PROPERTY' + `$_.Name } }" -ErrorAction Stop

# Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
- name: Push PR packages (if not fork)
if: ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"recommendations": [
"fernandoescolar.vscode-solution-explorer",
"ms-dotnettools.csdevkit",
]
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"omnisharp.defaultLaunchSolution": "CommunityToolkit.AllComponents.sln",
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.useGlobalMono": "never",
Expand All @@ -8,5 +7,6 @@
"csharp.suppressDotnetRestoreNotification": true,
"csharp.semanticHighlighting.enabled": true,
"omnisharp.enableMsBuildLoadProjectsOnDemand": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
"dotnet.defaultSolution": "CommunityToolkit.AllComponents.sln"
}
47 changes: 0 additions & 47 deletions components/.vsconfig

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>AppServices</ToolkitComponentName>
<Description>This package contains AppServices, to easily communicate between UWP apps and Win32 extensions.</Description>
Expand Down
3 changes: 2 additions & 1 deletion components/CanvasLayout/samples/CanvasLayout.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>CanvasLayout</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>CanvasLayout</ToolkitComponentName>
<Description>This package contains a CanvasLayout Layout for ItemsRepeater.</Description>
Expand Down
3 changes: 2 additions & 1 deletion components/CanvasView/samples/CanvasView.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>CanvasView</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>CanvasView</ToolkitComponentName>
<Description>This package contains CanvasView.</Description>
Expand Down
3 changes: 2 additions & 1 deletion components/DataTable/samples/DataTable.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>DataTable</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>DataTable</ToolkitComponentName>
<Description>This package contains DataTable.</Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>Extensions.DependencyInjection</ToolkitComponentName>
<Description>This package contains Extensions.DependencyInjection.</Description>
Expand Down
3 changes: 3 additions & 0 deletions components/MarkdownTextBlock/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions components/MarkdownTextBlock/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.
MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
For .NET Standard packages, you can use the Nuget Package Manager in Visual Studio.
For UWP / WinAppSDK / Uno packages, place the package references here.
-->
<Project>
<!-- WinUI 2 / UWP -->
<ItemGroup Condition="'$(IsUwp)' == 'true'">
<!-- <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Primitives" Version="7.1.2"/> -->
</ItemGroup>

<!-- WinUI 2 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2'">
<!-- <PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI.Controls.Primitives" Version="7.1.11"/> -->
</ItemGroup>

<!-- WinUI 3 / WinAppSdk -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true'">
<!-- <PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Primitives" Version="7.1.2"/> -->
</ItemGroup>

<!-- WinUI 3 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3'">
<!-- <PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls.Primitives" Version="7.1.100-dev.15.g12261e2626"/> -->
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
<PropertyGroup>
<ToolkitComponentName>MarkdownTextBlock</ToolkitComponentName>
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
<ItemGroup>
<None Remove="Assets\MarkdownTextBlock.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\MarkdownTextBlock.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
34 changes: 34 additions & 0 deletions components/MarkdownTextBlock/samples/MarkdownTextBlock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: MarkdownTextBlock
author: nerocui
description: A control for displaying markdown natively.
keywords: MarkdownTextBlock, Control, Layout
dev_langs:
- csharp
category: Controls
subcategory: StatusAndInfo
experimental: true
discussion-id: 0
issue-id: 0
icon: Assets/MarkdownTextBlock.png
---

<!-- To know about all the available Markdown syntax, Check out https://docs.microsoft.com/contribute/markdown-reference -->
<!-- Ensure you remove all comments before submission, to ensure that there are no formatting issues when displaying this page. -->
<!-- It is recommended to check how the Documentation will look in the sample app, before Merging a PR -->
<!-- **Note:** All links to other docs.microsoft.com pages should be relative without locale, i.e. for the one above would be /contribute/markdown-reference -->
<!-- Included images should be optimized for size and not include any Intellectual Property references. -->

<!-- Be sure to update the discussion/issue numbers above with your Labs discussion/issue id numbers in order for UI links to them from the sample app to work. -->

# MarkdownTextBlock

MarkdownTextBlock is a evolution of the existing MarkdownTextBlock in the community toolkit. This new implementation uses the popular [Markdig](https://github.com/xoofx/markdig) library for parsing. This solves some long standing bugs and feature gaps in our existing implementation.

## Templated Controls

The Toolkit is built with templated controls. This provides developers a flexible way to restyle components
easily while still inheriting the general functionality a control provides. The examples below show
how a component can use a default style and then get overridden by the end developer.

> [!Sample MarkdownTextBlockCustomSample]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Page x:Class="MarkdownTextBlockExperiment.Samples.MarkdownTextBlockCustomSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.Labs.WinUI.MarkdownTextBlock"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:MarkdownTextBlockExperiment.Samples"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Margin="0,0,0,12"
FontSize="16"
FontWeight="Bold"
Text="Try it live!" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:MarkdownTextBlock Grid.Column="0"
Config="{x:Bind LiveMarkdownConfig, Mode=OneTime}"
Text="{x:Bind MarkdownTextBox.Text, Mode=OneWay}" />
<TextBox x:Name="MarkdownTextBox"
Grid.Column="1"
AcceptsReturn="True" />
</Grid>
<TextBlock Grid.Row="2"
Margin="0,0,0,12"
FontSize="16"
FontWeight="Bold"
Text="Built-in Sample" />
<controls:MarkdownTextBlock Grid.Row="3"
Config="{x:Bind MarkdownConfig, Mode=OneTime}"
Text="{x:Bind Text, Mode=OneTime}" />
</Grid>
</Page>
Loading

0 comments on commit 1decd44

Please sign in to comment.