-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f3e8e1
commit 50aa944
Showing
83 changed files
with
1,441 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using JetBrains.Annotations; | ||
using Sitko.Core.App; | ||
|
||
namespace Sitko.Blockly.MudBlazor; | ||
|
||
[PublicAPI] | ||
public static class ApplicationExtensions | ||
{ | ||
public static Application AddAntDesignBlockly(this Application application, | ||
Action<IApplicationContext, MudBlazorBlocklyModuleOptions> configure, | ||
string? configKey = null) => | ||
application.AddModule<MudBlazorBlocklyModule, MudBlazorBlocklyModuleOptions>(configure, configKey); | ||
|
||
public static Application AddAntDesignBlockly(this Application application, | ||
Action<MudBlazorBlocklyModuleOptions>? configure = null, string? configKey = null) => | ||
application.AddModule<MudBlazorBlocklyModule, MudBlazorBlocklyModuleOptions>(configure, configKey); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Sitko.Blockly.MudBlazor/Blocks/MudCutBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using MudBlazor; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record MudCutBlockDescriptor : BlazorBlockDescriptor<CutBlock, MudCutBlockComponent, MudCutBlockForm> | ||
{ | ||
public MudCutBlockDescriptor(ILocalizationProvider<CutBlock> localizationProvider) : base(localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.ContentCut); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Sitko.Blockly.MudBlazor/Blocks/MudFilesBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record MudFilesBlockDescriptor : BlazorBlockDescriptor<FilesBlock, MudFilesBlockComponent, MudFilesBlockForm> | ||
{ | ||
public MudFilesBlockDescriptor(ILocalizationProvider<FilesBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("attach"); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Blocks/MudGalleryBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record | ||
MudGalleryBlockDescriptor : BlazorBlockDescriptor<GalleryBlock, MudGalleryBlockComponent, MudGalleryBlockForm> | ||
{ | ||
public MudGalleryBlockDescriptor(ILocalizationProvider<GalleryBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("gallery"); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Blocks/MudIframeBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record | ||
MudIframeBlockDescriptor : BlazorBlockDescriptor<IframeBlock, MudIframeBlockComponent, MudIFrameBlockForm> | ||
{ | ||
public MudIframeBlockDescriptor(ILocalizationProvider<IframeBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("embed"); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Sitko.Blockly.MudBlazor/Blocks/MudQuoteBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record MudQuoteBlockDescriptor : BlazorBlockDescriptor<QuoteBlock, MudQuoteBlockComponent, MudQuoteBlockForm> | ||
{ | ||
public MudQuoteBlockDescriptor(ILocalizationProvider<QuoteBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("quote"); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Sitko.Blockly.MudBlazor/Blocks/MudTextBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record MudTextBlockDescriptor : BlazorBlockDescriptor<TextBlock, MudTextBlockComponent, MudTextBlockForm> | ||
{ | ||
public MudTextBlockDescriptor(ILocalizationProvider<TextBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("text"); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Blocks/MudTwitchBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record | ||
MudTwitchBlockDescriptor : BlazorBlockDescriptor<TwitchBlock, MudTwitchBlockComponent, MudTwitchBlockForm> | ||
{ | ||
public MudTwitchBlockDescriptor(ILocalizationProvider<TwitchBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("twitch"); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Blocks/MudTwitterBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record | ||
MudTwitterBlockDescriptor : BlazorBlockDescriptor<TwitterBlock, MudTwitterBlockComponent, MudTwitterBlockForm> | ||
{ | ||
public MudTwitterBlockDescriptor(ILocalizationProvider<TwitterBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("twitter"); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Blocks/MudYoutubeBlockDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Sitko.Blockly.Blazor; | ||
using Sitko.Blockly.Blocks; | ||
using Sitko.Blockly.MudBlazor.Display.Blocks; | ||
using Sitko.Blockly.MudBlazor.Forms.Blocks; | ||
using Sitko.Core.App.Localization; | ||
|
||
namespace Sitko.Blockly.MudBlazor.Blocks; | ||
|
||
public record | ||
MudYoutubeBlockDescriptor : BlazorBlockDescriptor<YoutubeBlock, MudYoutubeBlockComponent, MudYoutubeBlockForm> | ||
{ | ||
public MudYoutubeBlockDescriptor(ILocalizationProvider<YoutubeBlock> localizationProvider) : base( | ||
localizationProvider) | ||
{ | ||
} | ||
|
||
public override RenderFragment Icon => builder => builder.AddIcon("youtube"); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudCutBlockComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@inherits CutBlockComponent<MudBlazorBlocklyListOptions> | ||
@if (Options.EntityUrl is not null) | ||
{ | ||
<a href="@Options.EntityUrl"> | ||
<Button> | ||
@{ | ||
if (string.IsNullOrEmpty(Block.ButtonText)) | ||
{ | ||
<span> | ||
@LocalizationProvider["Read more..."] | ||
</span> | ||
} | ||
else | ||
{ | ||
<span> | ||
@Block.ButtonText | ||
</span> | ||
} | ||
} | ||
</Button> | ||
</a> | ||
} | ||
else | ||
{ | ||
<AntBlockErrorComponent Error="@LocalizationProvider["Not Entity url provided"]"></AntBlockErrorComponent> | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudCutBlockComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Sitko.Blockly.MudBlazor.Display.Blocks; | ||
|
||
public partial class MudCutBlockComponent | ||
{ | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudFilesBlockComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@inherits FilesBlockComponent<MudBlazorBlocklyListOptions> | ||
@if (Options.Storage is not null) | ||
{ | ||
<ul> | ||
@foreach (var file in Block.Files) | ||
{ | ||
<li> | ||
<AntDesign.Icon Type="paper-clip"/> <a target="_blank" rel="noopener noreferrer" title="@file.FileName" href="@Options.Storage.PublicUri(file)">@file.FileName</a><span class="filesize"> (@file.HumanSize)</span> | ||
</li> | ||
} | ||
</ul> | ||
} | ||
else | ||
{ | ||
<AntBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></AntBlockErrorComponent> | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudFilesBlockComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Sitko.Blockly.MudBlazor.Display.Blocks; | ||
|
||
public partial class MudFilesBlockComponent | ||
{ | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudFilesBlockComponent.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ul { | ||
padding: 0; | ||
margin: 0; | ||
font-size: 1.1em; | ||
} | ||
|
||
li { | ||
display: inline-block; | ||
} | ||
|
||
li + li { | ||
margin-left: 1em; | ||
} | ||
|
||
li span.filesize { | ||
color: rgba(128, 128, 128, .5); | ||
font-size: .8em; | ||
vertical-align: bottom; | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudGalleryBlockComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@inherits GalleryBlockComponent<MudBlazorBlocklyListOptions> | ||
@if (Options.Storage is not null) | ||
{ | ||
if (Block.Pictures.Any()) | ||
{ | ||
@if (Block.Pictures.Count > 1) | ||
{ | ||
<div class="block-content"> | ||
<Carousel Autoplay="TimeSpan.FromSeconds(2)"> | ||
@foreach (var image in Block.Pictures) | ||
{ | ||
<CarouselSlick> | ||
<img src="@Options.Storage.PublicUri(image).ToString()" alt="Image: @image.FileName"/> | ||
</CarouselSlick> | ||
} | ||
</Carousel> | ||
</div> | ||
} | ||
else | ||
{ | ||
var image = Block.Pictures.First(); | ||
<div class="single-image"> | ||
<img src="@Options.Storage.PublicUri(image).ToString()" alt="Image: @image.FileName"/> | ||
</div> | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
<AntBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></AntBlockErrorComponent> | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudGalleryBlockComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Sitko.Blockly.MudBlazor.Display.Blocks; | ||
|
||
public partial class MudGalleryBlockComponent | ||
{ | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudGalleryBlockComponent.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.single-image { | ||
text-align: center; | ||
} | ||
|
||
img { | ||
max-width: 100%; | ||
max-height: 50vh; | ||
} | ||
|
||
.ant-carousel .slick-slide img { | ||
max-height: 50vh; | ||
margin: 0 auto; | ||
} | ||
|
||
.slick-list { | ||
background-color: rgba(128, 128, 128, .05); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudIframeBlockComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@inherits IframeBlockComponent<MudBlazorBlocklyListOptions> | ||
<!--suppress HtmlDeprecatedAttribute --> | ||
<div class="block-content"> | ||
<div class="iframe-container-wrapper"> | ||
<div class="iframe-container"> | ||
@* ReSharper disable once Html.Obsolete *@ | ||
<iframe src="@Block.Src" | ||
frameborder="0" allowfullscreen class="iframe-content"> | ||
</iframe> | ||
</div> | ||
</div> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudIframeBlockComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Sitko.Blockly.MudBlazor.Display.Blocks; | ||
|
||
public partial class MudIframeBlockComponent | ||
{ | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Sitko.Blockly.MudBlazor/Display/Blocks/MudIframeBlockComponent.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.iframe-container-wrapper { | ||
position: relative; | ||
width: 50%; | ||
margin: 0 auto; | ||
} | ||
|
||
.iframe-container { | ||
position: relative; | ||
width: 100%; | ||
height: 0; | ||
padding-bottom: 56.25%; | ||
} | ||
|
||
.iframe-content { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} |
Oops, something went wrong.