-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
22 changed files
with
170 additions
and
84 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
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 Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Web; | ||
|
||
namespace BlazeKit.Website.Islands; | ||
|
||
[__PrivateComponentRenderModeAttribute] | ||
public abstract class BlzInteractive : ComponentBase | ||
{ | ||
public BlzInteractive() | ||
{ } | ||
|
||
private sealed class __PrivateComponentRenderModeAttribute : global::Microsoft.AspNetCore.Components.RenderModeAttribute | ||
{ | ||
private static global::Microsoft.AspNetCore.Components.IComponentRenderMode ModeImpl => RenderMode.InteractiveWebAssembly; | ||
public override global::Microsoft.AspNetCore.Components.IComponentRenderMode Mode => ModeImpl; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@inherits ReactiveComponentEnvelope | ||
|
||
@code | ||
{ | ||
private ISignal<string> text; | ||
|
23 changes: 23 additions & 0 deletions
23
src/BlazeKit.Website.Islands/Components/HydratedComponent.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,23 @@ | ||
@code { | ||
[Parameter] required public RenderFragment SSG {get;set;} | ||
[Parameter] required public RenderFragment CSR {get;set;} | ||
|
||
[Inject] required public IJSRuntime jsRuntime {get;set;} | ||
|
||
@* [Parameter] public BlazeKit.Islands.LoadOn LoadAt {get;set;} = BlazeKit.Islands.LoadOn.Hover; *@ | ||
private string id = ""; | ||
protected override async void OnInitialized() | ||
{ | ||
if(!OperatingSystem.IsBrowser()) { | ||
// generate SSG id for compoennt | ||
id = Guid.NewGuid().ToString(); | ||
} | ||
} | ||
|
||
} | ||
@if(!OperatingSystem.IsBrowser()) { | ||
@* <div load-on="@LoadAt.ToString().ToLower()" blazekit-id="@id"> *@ | ||
@SSG | ||
@* </div> *@ | ||
} | ||
@CSR |
26 changes: 26 additions & 0 deletions
26
src/BlazeKit.Website.Islands/Components/MVVM/Counter.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 ReactiveComponentEnvelope | ||
@code { | ||
public Islands.Components.MVVM.VMCounter ViewModel { get; set; } | ||
|
||
public Counter() { } | ||
|
||
override protected void OnInitialized() | ||
{ | ||
ViewModel = new Islands.Components.MVVM.VMCounter(this); | ||
} | ||
|
||
private MarkupString AsHtml(string code) | ||
{ | ||
return new MarkupString(code); | ||
} | ||
} | ||
@if(ViewModel == null) { | ||
<p>Loading...</p> | ||
} else { | ||
<article> | ||
<p>Counter: @ViewModel.Counter.Value</p> | ||
<p>Doubled: @ViewModel.Doubled.Value</p> | ||
<button role="button" @onclick:preventDefault="true" @onclick="() => ViewModel.Increment()">Increment</button> | ||
<button role="button" @onclick:preventDefault="true" @onclick="() => ViewModel.Decrement()">Decrement</button> | ||
</article> | ||
} |
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
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 BlzInteractive *@ | ||
@code { | ||
[Parameter] public int CurrentCount { get; set; } | ||
|
||
private void IncrementCount() | ||
{ | ||
CurrentCount++; | ||
} | ||
} | ||
<h3>MyCounter</h3> | ||
<p>Current Count = @CurrentCount</p> | ||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> |
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,6 @@ | ||
namespace BlazeKit.Website.Islands; | ||
|
||
public partial class MyCounter : BlzInteractive | ||
{ | ||
|
||
} |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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,41 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:45568", | ||
"sslPort": 44379 | ||
} | ||
}, | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"applicationUrl": "http://localhost:5000", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"applicationUrl": "https://localhost:7089;http://localhost:5001", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
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
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
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
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,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |