mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-30 21:23:23 +08:00
Compare commits
1 Commits
cpm
...
496aef2126
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
496aef2126 |
92
.github/COMMIT_CONVENTION.md
vendored
92
.github/COMMIT_CONVENTION.md
vendored
@@ -1,92 +0,0 @@
|
|||||||
# Git Commit Message Convention
|
|
||||||
|
|
||||||
This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages.
|
|
||||||
|
|
||||||
## Format
|
|
||||||
|
|
||||||
```
|
|
||||||
<type>[optional scope]: <description>
|
|
||||||
|
|
||||||
[optional body]
|
|
||||||
|
|
||||||
[optional footer(s)]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Types
|
|
||||||
|
|
||||||
| Type | Description |
|
|
||||||
|------|-------------|
|
|
||||||
| `feat` | A new feature |
|
|
||||||
| `fix` | A bug fix |
|
|
||||||
| `docs` | Documentation only changes |
|
|
||||||
| `style` | Changes that do not affect the meaning of the code (formatting, missing semicolons, etc.) |
|
|
||||||
| `refactor` | A code change that neither fixes a bug nor adds a feature |
|
|
||||||
| `perf` | A code change that improves performance |
|
|
||||||
| `test` | Adding missing tests or correcting existing tests |
|
|
||||||
| `build` | Changes that affect the build system or external dependencies |
|
|
||||||
| `ci` | Changes to CI configuration files and scripts |
|
|
||||||
| `chore` | Other changes that don't modify source or test files |
|
|
||||||
| `revert` | Reverts a previous commit |
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
|
|
||||||
1. **Limit the subject line to 50 characters** (72 character hard limit)
|
|
||||||
2. **Use the imperative mood** in the subject line (e.g., "add feature" not "added feature")
|
|
||||||
3. **Do not end the subject line with a period**
|
|
||||||
4. **Use lowercase** for the description (e.g., "add feature" not "Add feature")
|
|
||||||
5. **Separate subject from body with a blank line**
|
|
||||||
6. **Wrap the body at 72 characters**
|
|
||||||
7. **Use the body to explain what and why**, not how
|
|
||||||
8. **Reference issues and pull requests** in the footer
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
The scope should be the name of the package or area affected (e.g., `button`, `datepicker`, `theme`, `demo`).
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
### Simple commit
|
|
||||||
|
|
||||||
```
|
|
||||||
feat(button): add loading state support
|
|
||||||
```
|
|
||||||
|
|
||||||
### Commit with body
|
|
||||||
|
|
||||||
```
|
|
||||||
fix(datepicker): correct month navigation overflow
|
|
||||||
|
|
||||||
When navigating past December, the month index wrapped to a
|
|
||||||
negative value instead of rolling over to January of the next year.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Commit with breaking change
|
|
||||||
|
|
||||||
```
|
|
||||||
feat(theme)!: rename SemiColorPrimary to SemiColorBrand
|
|
||||||
|
|
||||||
BREAKING CHANGE: The token SemiColorPrimary has been renamed to
|
|
||||||
SemiColorBrand. Update all references in your custom theme files.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Commit referencing an issue
|
|
||||||
|
|
||||||
```
|
|
||||||
fix(textbox): placeholder not visible in dark mode
|
|
||||||
|
|
||||||
Closes #123
|
|
||||||
```
|
|
||||||
|
|
||||||
## Breaking Changes
|
|
||||||
|
|
||||||
Breaking changes must be indicated by appending a `!` after the type/scope, or by including a `BREAKING CHANGE:` footer. Both methods may be used together.
|
|
||||||
|
|
||||||
## Revert Commits
|
|
||||||
|
|
||||||
When reverting a previous commit, use the `revert` type and reference the reverted commit SHA in the footer:
|
|
||||||
|
|
||||||
```
|
|
||||||
revert: feat(button): add loading state support
|
|
||||||
|
|
||||||
Revert commit a1b2c3d.
|
|
||||||
```
|
|
||||||
25
.github/workflows/remove-old-artifacts.yml
vendored
25
.github/workflows/remove-old-artifacts.yml
vendored
@@ -1,25 +0,0 @@
|
|||||||
name: Remove old artifacts
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
# Every day at 1am
|
|
||||||
- cron: '0 1 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
remove-old-artifacts:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
# For private repos
|
|
||||||
permissions:
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Remove old artifacts
|
|
||||||
uses: c-hive/gha-remove-artifacts@v1
|
|
||||||
with:
|
|
||||||
age: '15 days' # '<number> <unit>', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js
|
|
||||||
# Optional inputs
|
|
||||||
skip-tags: true
|
|
||||||
skip-recent: 5
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
|
||||||
<CentralPackageVersionOverrideEnabled>true</CentralPackageVersionOverrideEnabled>
|
|
||||||
<AvaloniaVersion>12.0.1</AvaloniaVersion>
|
|
||||||
<DataGridVersion>12.0.0</DataGridVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<!--src-->
|
|
||||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
|
||||||
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0"/>
|
|
||||||
<!--demo-->
|
|
||||||
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
|
||||||
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1"/>
|
|
||||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2"/>
|
|
||||||
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.2"/>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -12,18 +12,13 @@
|
|||||||
<File Path=".github/workflows/pack.yml"/>
|
<File Path=".github/workflows/pack.yml"/>
|
||||||
<File Path=".github/workflows/publish.yml"/>
|
<File Path=".github/workflows/publish.yml"/>
|
||||||
<File Path=".github/workflows/release-tag.yml"/>
|
<File Path=".github/workflows/release-tag.yml"/>
|
||||||
<File Path=".github/workflows/remove-old-artifacts.yml"/>
|
|
||||||
</Folder>
|
|
||||||
<Folder Name="/Solution Items/">
|
|
||||||
<File Path="Directory.Packages.props"/>
|
|
||||||
<File Path="global.json"/>
|
|
||||||
<File Path="Nuget.Config"/>
|
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/Solution Items/Demo/">
|
<Folder Name="/Solution Items/Demo/">
|
||||||
<File Path="demo/Directory.Build.targets"/>
|
<File Path="demo/Directory.Packages.props"/>
|
||||||
<File Path="demo/global.json"/>
|
<File Path="demo/global.json"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/Solution Items/Src/">
|
<Folder Name="/Solution Items/Package/">
|
||||||
|
<File Path="src/Directory.Packages.props"/>
|
||||||
<File Path="src/Directory.Build.props"/>
|
<File Path="src/Directory.Build.props"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Project Path="src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj"/>
|
<Project Path="src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj"/>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AvaloniaVersion>12.0.2</AvaloniaVersion>
|
|
||||||
<DataGridVersion>12.0.0</DataGridVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Update="Avalonia" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.Android" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.Browser" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.Desktop" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.iOS" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.LinuxFramebuffer" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.Controls.ColorPicker" VersionOverride="$(AvaloniaVersion)"/>
|
|
||||||
<PackageReference Update="Avalonia.Controls.DataGrid" VersionOverride="$(DataGridVersion)"/>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
26
demo/Directory.Packages.props
Normal file
26
demo/Directory.Packages.props
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
<AvaloniaVersion>12.0.1</AvaloniaVersion>
|
||||||
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
|
<SkiaSharpVersion>3.119.3-preview.1.1</SkiaSharpVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||||
|
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
||||||
|
<PackageVersion Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
|
||||||
|
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
|
||||||
|
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||||
|
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0-beta3"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
|
||||||
|
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.2"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2"/>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia.Browser"/>
|
<PackageReference Include="Avalonia.Browser"/>
|
||||||
|
<PackageReference Include="SkiaSharp"/>
|
||||||
|
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -28,15 +28,6 @@
|
|||||||
CommandParameter="{Binding $self.Header}" />
|
CommandParameter="{Binding $self.Header}" />
|
||||||
</NativeMenu>
|
</NativeMenu>
|
||||||
</NativeMenu.Menu>
|
</NativeMenu.Menu>
|
||||||
<NativeDock.Menu>
|
|
||||||
<NativeMenu>
|
|
||||||
<NativeMenuItem Header="New Window" />
|
|
||||||
<NativeMenuItemSeparator />
|
|
||||||
<NativeMenuItem Header="Show Main Window" />
|
|
||||||
<NativeMenuItemSeparator />
|
|
||||||
<NativeMenuItem Header="Add Dock Menu Item" />
|
|
||||||
</NativeMenu>
|
|
||||||
</NativeDock.Menu>
|
|
||||||
<TrayIcon.Icons>
|
<TrayIcon.Icons>
|
||||||
<TrayIcons>
|
<TrayIcons>
|
||||||
<TrayIcon
|
<TrayIcon
|
||||||
@@ -58,4 +49,4 @@
|
|||||||
</TrayIcon>
|
</TrayIcon>
|
||||||
</TrayIcons>
|
</TrayIcons>
|
||||||
</TrayIcon.Icons>
|
</TrayIcon.Icons>
|
||||||
</Application>
|
</Application>
|
||||||
@@ -12,16 +12,14 @@ public partial class PaletteDemo : UserControl
|
|||||||
public PaletteDemo()
|
public PaletteDemo()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = PaletteDemoViewModel.Instance.Value;
|
this.DataContext = new PaletteDemoViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
if (this.DataContext is PaletteDemoViewModel vm && !vm.IsInitialized)
|
PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
|
||||||
{
|
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Copy(object? o)
|
public async Task Copy(object? o)
|
||||||
@@ -33,4 +31,4 @@ public partial class PaletteDemo : UserControl
|
|||||||
await c.SetTextAsync(o.ToString());
|
await c.SetTextAsync(o.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,6 @@ namespace Semi.Avalonia.Demo.ViewModels;
|
|||||||
|
|
||||||
public partial class PaletteDemoViewModel : ObservableObject
|
public partial class PaletteDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
public static Lazy<PaletteDemoViewModel> Instance { get; } = new(() => new PaletteDemoViewModel());
|
|
||||||
public bool IsInitialized { get; private set; }
|
|
||||||
private readonly string[] _predefinedColorNames =
|
private readonly string[] _predefinedColorNames =
|
||||||
[
|
[
|
||||||
"Red", "Pink", "Purple", "Violet", "Indigo",
|
"Red", "Pink", "Purple", "Violet", "Indigo",
|
||||||
@@ -46,7 +44,6 @@ public partial class PaletteDemoViewModel : ObservableObject
|
|||||||
InitializePalette();
|
InitializePalette();
|
||||||
InitializeFunctionalColors();
|
InitializeFunctionalColors();
|
||||||
InitializeShadows();
|
InitializeShadows();
|
||||||
IsInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializePalette()
|
private void InitializePalette()
|
||||||
@@ -292,4 +289,4 @@ public partial class ShadowGroupViewModel : ObservableObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,6 @@
|
|||||||
<Border Classes="NavItemHost" Classes.Selected="{Binding IsSelected}">
|
<Border Classes="NavItemHost" Classes.Selected="{Binding IsSelected}">
|
||||||
<Button
|
<Button
|
||||||
Classes="NavItem"
|
Classes="NavItem"
|
||||||
FontWeight="Normal"
|
|
||||||
Classes.Selected="{Binding IsSelected}"
|
Classes.Selected="{Binding IsSelected}"
|
||||||
Command="{Binding NavigateCommand}"
|
Command="{Binding NavigateCommand}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
|
|||||||
14
src/Directory.Packages.props
Normal file
14
src/Directory.Packages.props
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
<AvaloniaVersion>12.0.1</AvaloniaVersion>
|
||||||
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||||
|
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
||||||
|
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0"/>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user