Skip to content

Commit

Permalink
Feature/update to 1 2 6 (#235)
Browse files Browse the repository at this point in the history
## Target
<!--
  Why are you making this change?
 -->

#### Open Questions
<!-- OPTIONAL
- [ ] Use the GitHub checklists to spark discussion on issues that may
arise from your approach. Please tick the box and explain your answer.
-->

## Checklist
<!--
It serves as a gentle reminder for common tasks. Confirm it's done and
check everything that applies.
-->
- [ ] Documentation updated
- [x] Tests cover new or modified code
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] New dependencies added
- [ ] Includes breaking changes
- [x] Version bumped

## Visuals
<!-- OPTIONAL
Show results both before and after this change. When the output changes,
it can be a screenshot of a trace, metric, or log illustrating the
change.
-->

---------

Co-authored-by: ColdForeign <[email protected]>
Co-authored-by: George Radchuk <[email protected]>
  • Loading branch information
3 people authored Oct 8, 2023
1 parent 45bcfff commit 5505a93
Show file tree
Hide file tree
Showing 41 changed files with 902 additions and 394 deletions.
13 changes: 13 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of the level of experience, gender, gender identity, and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Cropper.Blazor
</h1>
<p align="center">
<b>Cropper.Blazor</b> is a component that wraps around <a href="https://github.com/fengyuanchen/cropperjs"><b>Cropper.js</b></a> version 1.6.0
<b>Cropper.Blazor</b> is a component that wraps around <a href="https://github.com/fengyuanchen/cropperjs"><b>Cropper.js</b></a> version 1.6.1
</p>
</p>

Expand All @@ -18,6 +18,11 @@
[![GitHub](https://img.shields.io/github/last-commit/CropperBlazor/Cropper.Blazor?color=009DEA)](https://github.com/CropperBlazor/Cropper.Blazor)
[![NuGet Badge](https://buildstats.info/nuget/Cropper.Blazor)](https://www.nuget.org/packages/Cropper.Blazor/)

The most powerful image cropping tool for Blazor WebAssembly / Server, Hybrid with MAUI, MVC and
other frameworks.

Cropper.Blazor is an essential component for building interactive image cropping and manipulation features in Blazor web applications. This versatile Blazor library empowers developers to integrate intuitive image cropping functionality directly into their Blazor projects, offering users a seamless and responsive image editing experience.

## Demo
- [CropperBlazor.github.io/demo](https://CropperBlazor.github.io/demo)

Expand All @@ -30,6 +35,25 @@
- Blazor Server
- Blazor Server Hybrid with MVC
- MAUI Blazor Hybrid

Note: if you have problem with MAUI project dependencies:
- `dotnet workload update` + rebuilt the project. If that doesn't help, try the step below about override package
- override package, for example: `<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" />`

## Key features and aspects of the Cropper.Blazor package include

- Blazor Integration: Cropper.Blazor is specifically designed for Blazor applications, allowing developers to effortlessly incorporate image cropping capabilities into their Blazor components and pages.
- Drag-and-Resize Interaction: Users can easily drag and resize the cropping area to precisely select the desired portion of an image. This intuitive interaction method ensures accurate and efficient cropping.
- Rotation Support: Cropper.Blazor includes the ability to rotate the selected image area, giving users full control over the orientation of their cropped content.
- Aspect Ratio Control: Developers can define custom aspect ratios for cropping, ensuring that the resulting image maintains specific proportions. This is particularly valuable for applications that require standardized image dimensions.
- Zoom Functionality: Cropper.Blazor allows users to zoom in and out of the image to fine-tune their cropping selection, guaranteeing precise results.
- Data Retrieval: The library provides methods to retrieve detailed information about the cropped area, such as coordinates and dimensions. This data can be easily captured and utilized for further processing or image uploads.
- Customization: Cropper.Blazor offers a wide range of configuration options, enabling developers to tailor the cropping experience to match the visual style and user interface of their Blazor applications.
- Cross-Browser Compatibility: The package is compatible with various modern web browsers, ensuring consistent functionality and user experience across different platforms.
- Documentation: Cropper.Blazor is accompanied by comprehensive documentation and practical examples, simplifying the integration process and helping developers make the most of its features.
- Open Source: Cropper.Blazor is open-source software, available for free use in both personal and commercial Blazor projects.

Cropper.Blazor streamlines the implementation of image cropping and editing within Blazor applications, enhancing user engagement and enabling dynamic image manipulation. Whether you are developing a Blazor-based image editor, profile picture uploader, or any other application that requires image cropping, Cropper.Blazor is a valuable package that simplifies the development process and enriches your application's capabilities.

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.4.1" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="MudBlazor" Version="6.4.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="7.0.1" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.4.1" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.4.1" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.4.1" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
<div class="d-flex gap-x-6 flex-wrap flex-sm-nowrap">
<MudNumericField @bind-Value="MinimumHeight" Label="Minimum Height" Min="0" Max="MaximumHeight"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
</MudNumericField>
<MudNumericField @bind-Value="MinimumWidth" Label="Minimum Width" Min="0" Max="MaximumWidth"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
</MudNumericField>
</div>
<div class="d-flex gap-x-6 flex-wrap flex-sm-nowrap">
<MudNumericField @bind-Value="MaximumHeight" Label="Maximum Height" Min="MinimumHeight ?? 0"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
</MudNumericField>
<MudNumericField @bind-Value="MaximumWidth" Label="Maximum Width" Min="MinimumWidth ?? 0"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
</MudNumericField>
</div>
</MudCardContent>
</MudCard>
51 changes: 51 additions & 0 deletions src/Cropper.Blazor/Client/Components/Docs/ApiLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Cropper.Blazor.Components;
using Cropper.Blazor.Models;
using Cropper.Blazor.Shared.Extensions;

namespace Cropper.Blazor.Client.Components.Docs
{
Expand All @@ -25,5 +27,54 @@ private static string GetComponentName(Type type)

return component;
}

public static Type GetTypeFromComponentLink(string component)
{
if (component.Contains('#') == true)
{
component = component.Substring(0, component.IndexOf('#'));
}

if (string.IsNullOrEmpty(component))
{
throw new ArgumentException(nameof(component));
}

var assembly = typeof(CropperComponent).Assembly;
var types = assembly.GetTypes();

foreach (var x in types)
{
if (new string(x.Name.ToLowerInvariant().TakeWhile(c => c != '`').ToArray()) == $"{component}".ToLowerInvariant())
{
if (x.Name.Contains('`'))
{
return x;
}
else if (x.Name.ToLowerInvariant() == $"{component}".ToLowerInvariant())
{
return x;
}
}
}

throw new ArgumentNullException(nameof(component));
}

public static string GetContextType(this Type type)
{
string value = string.Empty;

if (type == typeof(Options))
{
value = nameof(Options).CreateLink();
}
else if (type == typeof(SetDataOptions))
{
value = nameof(SetDataOptions).CreateLink();
}

return value;
}
}
}
2 changes: 1 addition & 1 deletion src/Cropper.Blazor/Client/Components/Docs/ApiProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ApiProperty
{
public string Name { get; set; }
public Type Type { get; set; }
public PropertyInfo PropertyInfo { get; set; }
public PropertyInfo? PropertyInfo { get; set; }
public string Description { get; set; }
public object Default { get; set; }
public bool IsTwoWay { get; set; }
Expand Down
Loading

0 comments on commit 5505a93

Please sign in to comment.