Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NuGet package version to 1.2.5 #212

Merged
merged 73 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
2f7593f
add Dimensions Settings
MaxymGorn May 5, 2023
89089b1
Fix whitespace formatting.
MaxymGorn May 5, 2023
ed60820
Add Dimensions Settings (#130)
MaxymGorn May 5, 2023
6e441da
Merge branch 'dev' of https://github.com/CropperBlazor/Cropper.Blazor…
MaxymGorn May 28, 2023
ca0865a
add aspect ratio settings
MaxymGorn May 28, 2023
bac52dc
Feature/add aspect ratio settings (#136)
MaxymGorn May 28, 2023
26ec4f4
fix update current aspect ratio in settings
MaxymGorn May 29, 2023
2a4d534
small fix
MaxymGorn May 29, 2023
8dcea02
update nuget packages
MaxymGorn May 29, 2023
5f4ce94
fix tests
MaxymGorn May 29, 2023
78dbbfb
fix update current aspect ratio in settings (#138)
MaxymGorn May 30, 2023
c82d4e6
add download cropped image functionality to UI
MaxymGorn Jun 21, 2023
9c9b371
format file
MaxymGorn Jun 21, 2023
b816777
add download cropped image functionality to UI (#149)
MaxymGorn Jun 21, 2023
220aa78
add replace image functionality
MaxymGorn Jun 22, 2023
bbe58f0
align code
MaxymGorn Jun 22, 2023
33d1746
fix comment
MaxymGorn Jun 22, 2023
9f3b953
update version nuget package
MaxymGorn Jun 22, 2023
63f83ca
add replace image functionality (#151)
MaxymGorn Jun 22, 2023
ed9969b
fix incorrect Base Path Resolution for CropperJSInterop.min.js
MaxymGorn Jun 22, 2023
8536753
fix incorrect Base Path Resolution for CropperJSInterop.min.js (#153)
MaxymGorn Jun 22, 2023
46edcc6
consolidate nuget versions
MaxymGorn Jun 22, 2023
2a98eb2
Merge branch 'dev' into feature/fix_Base_Path_Resolution_for_CropperJ…
MaxymGorn Jun 22, 2023
eafeae3
consolidate nuget versions (#155)
MaxymGorn Jun 22, 2023
9367a27
Update README.md (#156)
MaxymGorn Jun 23, 2023
e7fdc03
Fix double initialization cropper (#157)
MaxymGorn Jun 23, 2023
cb95048
Feature/fix styles (#158)
MaxymGorn Jun 23, 2023
af7286a
add cropper view figures for demo (#161)
MaxymGorn Jun 28, 2023
1ab440f
adding a “New Update Available” notification (#166)
MaxymGorn Jul 7, 2023
70773ed
Update excubo.webcompiler
ColdForeign Jul 10, 2023
8614ed4
Update excubo.webcompiler (#171)
ColdForeign Jul 10, 2023
388bcfa
extend GetCroppedCanvasDataURLAsync function (#172)
MaxymGorn Jul 11, 2023
fc81ac9
Extend preview in options (#173)
MaxymGorn Jul 15, 2023
32e8cab
Feature/sync dev with master (#176)
MaxymGorn Jul 17, 2023
26f5004
Fix/isolation multiple active croppers (#178)
MaxymGorn Jul 24, 2023
0ac933a
Demo's actions UI updated
ColdForeign May 7, 2023
7e13a2c
Demo's settings and GetSetData UI updated
ColdForeign May 7, 2023
8817ebe
Update issue templates (#183)
MaxymGorn Jul 26, 2023
4e8cad3
Demo's settings UI updated
ColdForeign May 7, 2023
037235f
Fix UI blocks spaces
ColdForeign May 8, 2023
a9805da
Update GetSetData, fix flex in settings
ColdForeign May 8, 2023
bb780d2
fix description in readme for cropper component, add release badge
MaxymGorn Jul 27, 2023
cb322bf
Cards update
ColdForeign May 8, 2023
abca896
GetSetData updated.
ColdForeign May 8, 2023
dd68b88
Merge remote-tracking branch 'origin/feature/update_demo_ui' into fea…
ColdForeign Jul 27, 2023
f02c818
Fix margins and Numbers
ColdForeign May 9, 2023
22b8655
Merge branch 'dev' into feature/update_demo_ui
ColdForeign Jul 27, 2023
7ac5614
Update Docs and Demo UX/UI (#184)
ColdForeign Jul 27, 2023
1566e48
Fix initial zoom ratio in UI (#186)
MaxymGorn Jul 28, 2023
233b092
Fix aspect ratio settings
ColdForeign May 9, 2023
a6bb747
Fix zoom event settings
ColdForeign May 10, 2023
390d8e8
Fix override zoom event
ColdForeign May 10, 2023
c284b9f
Added SEO for demo site (#188)
MaxymGorn Aug 1, 2023
943f013
Feature/add seo for wasm (#195)
MaxymGorn Aug 2, 2023
8c5a9cd
Update cd.yml (#196)
MaxymGorn Aug 2, 2023
30e9f49
Fix dimensions settings
ColdForeign May 10, 2023
c9b2af1
Rename free aspect ratio variable
ColdForeign May 11, 2023
457d2d0
revert changes (#197)
MaxymGorn Aug 2, 2023
d48b033
Update Main Page
ColdForeign May 11, 2023
a423a16
Merge branch 'dev' into fix/event_settings
ColdForeign Aug 2, 2023
1c2841e
Fix warnings in scss
ColdForeign May 11, 2023
7c7ec2b
Fix warnings in scss
ColdForeign May 11, 2023
85e49de
verify site in google search console (#198)
MaxymGorn Aug 2, 2023
d25c43a
Fix warnings in scss
ColdForeign May 12, 2023
66f9c75
Merge branch 'dev' into fix/event_settings
MaxymGorn Aug 2, 2023
99b7e7e
Fix/event settings (#189)
ColdForeign Aug 2, 2023
1d308b1
Added sitemap.xml file (#199)
MaxymGorn Aug 3, 2023
5b8369f
fix UI bugs (#200)
MaxymGorn Aug 5, 2023
1ad0262
Added API (#209)
MaxymGorn Sep 10, 2023
b462d02
Added API to README.md (#210)
MaxymGorn Sep 11, 2023
2d59637
Add a rounded option to the GetCroppedCanvas method (#211)
MaxymGorn Sep 12, 2023
8eb7076
update nuget to 1.6.0
MaxymGorn Sep 12, 2023
11a6654
fix pipeline
MaxymGorn Sep 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

**Pull Request**
- [ ] I would like to do a Pull Request
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Github Discussions
url: https://github.com/CropperBlazor/Cropper.Blazor/discussions
about: Please ask and answer questions here
- name: Telegram
url: https://t.me/+dLQD8Al6C9s0ZjMy
about: You can also ask and answer questions here
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Pull Request**
- [ ] I would like to do a Pull Request
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ jobs:

- name: DotNet Build Blazor MAUI Demo Project for .net 6
run: dotnet build --no-restore
working-directory: examples\Cropper.Blazor.MAUI.Net6
working-directory: examples\Cropper.Blazor.MAUI.Net6
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
Cropper.Blazor
</h1>
<p align="center">
<b>Cropper.Blazor</b> is a component element that wraps around <a href="https://github.com/fengyuanchen/cropperjs"><b>Cropper.js</b></a>
<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
</p>
</p>

[![Build and run test](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/ci.yml)
[![Deploy to GitHub Pages](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/cd.yml/badge.svg?event=push)](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/cd.yml)
[![Deploy to NuGet](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/release.yml/badge.svg?event=push)](https://github.com/CropperBlazor/Cropper.Blazor/actions/workflows/release.yml)
[![coverage](https://codecov.io/github/CropperBlazor/Cropper.Blazor/branch/dev/graph/badge.svg?token=39M66DO85T)](https://codecov.io/github/CropperBlazor/Cropper.Blazor)
[![GitHub](https://img.shields.io/github/license/CropperBlazor/Cropper.Blazor?color=ff5c9b)](https://github.com/CropperBlazor/Cropper.Blazor/blob/dev/LICENSE)
[![GitHub](https://img.shields.io/github/last-commit/CropperBlazor/Cropper.Blazor?color=009DEA)](https://github.com/CropperBlazor/Cropper.Blazor)
Expand All @@ -20,6 +21,9 @@
## Demo
- [CropperBlazor.github.io/demo](https://CropperBlazor.github.io/demo)

## API
- [https://cropperblazor.github.io/api](https://cropperblazor.github.io/api)

## Prerequisites
- Supported .NET 7.0, .NET 6.0 versions for these web platforms:
- Blazor WebAssembly
Expand Down
38 changes: 24 additions & 14 deletions src/Cropper.Blazor/Client/Components/AspectRatioSettings.razor
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
<MudCard Class="d-flex justify-space-between flex-column mb-6">
<MudCardContent>
<MudText>Aspect Ratio Settings (only for FREE aspect ratio)</MudText>
<MudNumericField @bind-Value="MinAspectRatio"
Label="Min aspect ratio"
Disabled="!IsEnableAspectRatioSettings"
Min="0"
Max="MaxAspectRatio">
<MudCard Class="mud-height-full">
<MudCardHeader Class="border-solid border-b mud-border-lines-default">
<CardHeaderContent>
<div class="d-flex flex-column gap-2">
<MudText Typo="Typo.h5">Aspect Ratio Settings</MudText>
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined" Dense="true">
This option work's only for <b>FREE</b> aspect ratio mode!
</MudAlert>
</div>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent Class="mud-height-full pt-0">
<MudNumericField @bind-Value="MinAspectRatio" Label="Min aspect ratio"
Disabled="!IsFreeAspectRatioEnabled"
Min="0" Max="MaxAspectRatio">
</MudNumericField>
<MudNumericField @bind-Value="MaxAspectRatio"
Label="Max aspect ratio"
Disabled="!IsEnableAspectRatioSettings"
<MudNumericField @bind-Value="MaxAspectRatio" Label="Max aspect ratio"
Disabled="!IsFreeAspectRatioEnabled"
Min="MinAspectRatio ?? 0">
</MudNumericField>
<MudText Class="mt-4">
Current aspect ratio: @AspectRatio
</MudText>
<div class="d-flex gap-x-6 align-end">
<MudChip Variant="Variant.Outlined" Color="Color.Primary" Class="flex-1 ma-0 mt-4">
Current aspect ratio:
</MudChip>
<MudNumericField @bind-Value="AspectRatio" Format="N4" Variant="Variant.Text"
HideSpinButtons="true" ReadOnly="true" Class="flex-1" />
</div>
</MudCardContent>
</MudCard>
26 changes: 15 additions & 11 deletions src/Cropper.Blazor/Client/Components/AspectRatioSettings.razor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.ComponentModel.DataAnnotations;
using Cropper.Blazor.Client.Pages;
using Cropper.Blazor.Components;
using Cropper.Blazor.Models;
using Microsoft.AspNetCore.Components;

Expand All @@ -17,7 +17,7 @@ public decimal? MaxAspectRatio
set
{
maxAspectRatio = value;
ApplyAspectRatioRulesForCropperAsync();
InvokeAsync(ApplyAspectRatioRulesForCropperAsync);
}
}

Expand All @@ -27,18 +27,18 @@ public decimal? MinAspectRatio
set
{
minAspectRatio = value;
ApplyAspectRatioRulesForCropperAsync();
InvokeAsync(ApplyAspectRatioRulesForCropperAsync);
}
}

[CascadingParameter(Name = "AspectRatio"), Required]
private decimal? AspectRatio { get; set; }

[CascadingParameter(Name = "CropperDemo"), Required]
private CropperDemo CropperDemo { get; set; } = null!;
[CascadingParameter(Name = "CropperComponent"), Required]
private CropperComponent CropperComponent { get; set; } = null!;

[CascadingParameter(Name = "IsEnableAspectRatioSettings"), Required]
private bool IsEnableAspectRatioSettings
[CascadingParameter(Name = "IsFreeAspectRatioEnabled"), Required]
private bool IsFreeAspectRatioEnabled
{
get => isEnableAspectRatioSettings;
set
Expand All @@ -57,8 +57,8 @@ public async Task ApplyAspectRatioRulesForCropperAsync()
{
if (minAspectRatio is not null || maxAspectRatio is not null)
{
ContainerData containerData = await CropperDemo.CropperComponent!.GetContainerDataAsync();
CropBoxData cropBoxData = await CropperDemo.CropperComponent!.GetCropBoxDataAsync();
ContainerData containerData = await CropperComponent!.GetContainerDataAsync();
CropBoxData cropBoxData = await CropperComponent!.GetCropBoxDataAsync();

if (cropBoxData.Height != 0)
{
Expand All @@ -67,12 +67,16 @@ public async Task ApplyAspectRatioRulesForCropperAsync()
if (aspectRatio < minAspectRatio || aspectRatio > maxAspectRatio)
{
decimal? newCropBoxWidth = cropBoxData.Height * ((minAspectRatio + maxAspectRatio) / 2);
decimal? left = (containerData.Width - newCropBoxWidth) / 2;

CropperDemo.CropperComponent!.SetCropBoxData(new SetCropBoxDataOptions
CropperComponent!.SetCropBoxData(new SetCropBoxDataOptions
{
Left = (containerData.Width - newCropBoxWidth) / 2,
Left = left,
Width = newCropBoxWidth,
});

cropBoxData = await CropperComponent!.GetCropBoxDataAsync();
aspectRatio = cropBoxData.Width / cropBoxData.Height;
}

SetUpAspectRatio(aspectRatio);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<MudCard Class="d-flex justify-space-between flex-column mb-6">
<MudCardContent>
<MudText>
Dimensions Settings
<h6>This option may not work with arbitrary 'Aspect Ratios' images, it is recommended to use a free Aspect Ratio for this option or calculate the allowed values yourself</h6>
</MudText>
<MudNumericField @bind-Value="MinimumWidth"
Label="Minimum Width"
Min="0"
Max="MaximumWidth">
<MudCard Class="mud-height-full">
<MudCardHeader Class="border-solid border-b mud-border-lines-default">
<CardHeaderContent>
<div class="d-flex flex-column gap-2">
<MudText Typo="Typo.h5">Dimensions Settings</MudText>
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined" Dense="true">
<b>This setting may not work with a specific aspect ratio.</b>
It is recommended to use a <b>FREE</b> aspect ratio for this
option or calculate the valid values yourself.
</MudAlert>
</div>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent Class="mud-height-full pt-0">
<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 @bind-Value="MaximumWidth"
Label="Maximum Width"
Min="MinimumWidth ?? 0">
<MudNumericField @bind-Value="MinimumWidth" Label="Minimum Width" Min="0" Max="MaximumWidth"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
<MudNumericField @bind-Value="MinimumHeight"
Label="Minimum Height"
Min="0"
Max="MaximumHeight">
</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 @bind-Value="MaximumHeight"
Label="Maximum Height"
Min="MinimumHeight ?? 0">
<MudNumericField @bind-Value="MaximumWidth" Label="Maximum Width" Min="MinimumWidth ?? 0"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary">
</MudNumericField>
</div>
</MudCardContent>
</MudCard>
8 changes: 4 additions & 4 deletions src/Cropper.Blazor/Client/Components/CropperDataPreview.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="X" Step=".2M" Label="X" Variant="Variant.Text"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" />
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" Format="N4" />
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="Y" Label="Y" Step=".2M" Variant="Variant.Text"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" />
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" Format="N4" />
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="Width" Label="Width" Step=".2M" Variant="Variant.Text"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" />
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" Format="N4" />
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="Height" Label="Height" Step=".2M" Variant="Variant.Text"
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" />
Adornment="Adornment.End" AdornmentText="px" AdornmentColor="Color.Primary" Margin="Margin.Dense" Format="N4" />
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="Rotate" Label="Rotate" Step=".2M" Variant="Variant.Text"
Adornment="Adornment.End" AdornmentText="deg" AdornmentColor="Color.Primary" Margin="Margin.Dense" />
<MudNumericField ReadOnly="true" Class="mb-2" HideSpinButtons="true" @bind-Value="ScaleX" Label="ScaleX" Variant="Variant.Text" Step=".2M" />
Expand Down
29 changes: 29 additions & 0 deletions src/Cropper.Blazor/Client/Components/Docs/ApiLink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Cropper.Blazor.Components;

namespace Cropper.Blazor.Client.Components.Docs
{
public static class ApiLink
{
private static Dictionary<Type, string> SpecialCaseComponents =
new()
{
[typeof(CropperComponent)] = "cropper-component"
};

public static string GetComponentLinkFor(Type type)
{
return $"components/{GetComponentName(type)}";
}

private static string GetComponentName(Type type)
{
if (!SpecialCaseComponents.TryGetValue(type, out var component))
{
component = new string(type.ToString().Replace("Cropper.Blazor", "").TakeWhile(c => c != '`').ToArray())
.ToLowerInvariant();
}

return component;
}
}
}
13 changes: 13 additions & 0 deletions src/Cropper.Blazor/Client/Components/Docs/ApiMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Reflection;

namespace Cropper.Blazor.Client.Components.Docs
{
public class ApiMethod
{
public string Signature { get; set; }
public ParameterInfo Return { get; set; }
public string Documentation { get; set; }
public MethodInfo MethodInfo { get; set; }
public ParameterInfo[] Parameters { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Cropper.Blazor/Client/Components/Docs/ApiProperty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Reflection;

namespace Cropper.Blazor.Client.Components.Docs
{
public class ApiProperty
{
public string Name { get; set; }
public Type Type { get; set; }
public PropertyInfo PropertyInfo { get; set; }
public string Description { get; set; }
public object Default { get; set; }
public bool IsTwoWay { get; set; }
}
}
Loading