Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Nov 11, 2024
2 parents 7440afc + 19e822b commit 6c42e6b
Show file tree
Hide file tree
Showing 47 changed files with 208 additions and 177 deletions.
2 changes: 1 addition & 1 deletion src/Besql/Bit.Besql/wwwroot/bit-besql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var BitBesql = BitBesql || {};
BitBesql.version = window['bit-besql version'] = '8.12.0-pre-13';
BitBesql.version = window['bit-besql version'] = '8.12.0-pre-14';

async function synchronizeDbWithCache(file) {

Expand Down
4 changes: 2 additions & 2 deletions src/Bit.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

<ReleaseVersion>8.12.0</ReleaseVersion>

<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)-pre-13</PackageReleaseNotes>
<PackageVersion>$(ReleaseVersion)-pre-13</PackageVersion>
<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)-pre-14</PackageReleaseNotes>
<PackageVersion>$(ReleaseVersion)-pre-14</PackageVersion>

<!-- Version -->
<Version Condition=" '$(Configuration)' == 'Release' ">$(ReleaseVersion).$([System.DateTime]::Now.ToString(HHmm))</Version>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorUI/Bit.BlazorUI/Scripts/general.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '8.12.0-pre-13';
(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '8.12.0-pre-14';

interface DotNetObject {
invokeMethod<T>(methodIdentifier: string, ...args: any[]): T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<Content Remove="appsettings.json" />
<EmbeddedResource Include="appsettings.json" />

<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.6" />
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bit.Bswup" Version="8.12.0-pre-13" />
<PackageReference Include="Bit.Bswup" Version="8.12.0-pre-14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14
// https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup

self.assetsInclude = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<Using Include="Bit.BlazorUI.Demo.Client.Core.Services.Contracts" />
<Using Include="Bit.BlazorUI.Demo.Client.Core.Services" />

<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorUI/Demo/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Generated by bit-bp template v-8.12.0-pre-13 -->
<!-- Generated by bit-bp template v-8.12.0-pre-14 -->
<Project>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

self.assetsExclude = [/\.scp\.css$/, /weather\.json$/];
self.caseInsensitiveUrl = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

self.assetsExclude = [/\.scp\.css$/, /weather\.json$/];
self.caseInsensitiveUrl = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

// In development, always fetch from the network and do not enable offline support.
// This is because caching would make development more difficult (changes would not
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

self.assetsInclude = [];
self.assetsExclude = [
Expand Down
2 changes: 1 addition & 1 deletion src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
window['bit-bswup.progress version'] = '8.12.0-pre-13';
window['bit-bswup.progress version'] = '8.12.0-pre-14';

; (function () {
(window as any).startBswupProgress = (autoReload: boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
self['bit-bswup.sw version'] = '8.12.0-pre-13';
self['bit-bswup.sw version'] = '8.12.0-pre-14';

interface Window {
clients: any
Expand Down
2 changes: 1 addition & 1 deletion src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const BitBswup = {} as any;
BitBswup.version = window['bit-bswup version'] = '8.12.0-pre-13';
BitBswup.version = window['bit-bswup version'] = '8.12.0-pre-14';

declare const Blazor: any;

Expand Down
2 changes: 1 addition & 1 deletion src/Bswup/FullDemo/Client/wwwroot/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

// In development, always fetch from the network and do not enable offline support.
// This is because caching would make development more difficult (changes would not
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14

self.assetsInclude = [];
self.assetsExclude = [/\.scp\.css$/, /weather\.json$/];
Expand Down
2 changes: 1 addition & 1 deletion src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
window['bit-bup.progress version'] = '8.12.0-pre-13';
window['bit-bup.progress version'] = '8.12.0-pre-14';

; (function () {
(window as any).startBupProgress = (showLogs: boolean, showAssets: boolean, appContainerSelector: string, hideApp: boolean, autoHide: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion src/Bup/Bit.Bup/Scripts/bit-bup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var BitBup = BitBup || {};
BitBup.version = window['bit-bup version'] = '8.12.0-pre-13';
BitBup.version = window['bit-bup version'] = '8.12.0-pre-14';

declare const Blazor: any;

Expand Down
66 changes: 34 additions & 32 deletions src/Butil/Bit.Butil/Publics/Notification.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Microsoft.JSInterop;

namespace Bit.Butil;
Expand All @@ -18,37 +19,6 @@ public async ValueTask<bool> IsSupported()
return await js.InvokeAsync<bool>("BitButil.notification.isSupported");
}

/// <summary>
/// Requests a native notification to show to the user.
/// <br/>
/// <see href="https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification">https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification</see>
/// </summary>
public async ValueTask Show(string title, NotificationOptions? options)
{
object? opts = null;
if (options is not null)
{
opts = new
{
badge = options.Badge,
body = options.Body,
data = options.Data,
dir = options.Dir.ToString().ToLower(),
icon = options.Icon,
image = options.Image,
lang = options.Lang,
renotify = options.Renotify,
requireInteraction = options.RequireInteraction,
silent = options.Silent,
tag = options.Tag,
timestamp = options.Timestamp,
vibrate = options.Vibrate,
};
}

await js.InvokeVoidAsync("BitButil.notification.show", title, opts);
}

/// <summary>
/// Gets the current permission of the Notification API.
/// <br/>
Expand Down Expand Up @@ -84,4 +54,36 @@ public async ValueTask<NotificationPermission> RequestPermission()
_ => NotificationPermission.Default
};
}

/// <summary>
/// Requests a native notification to show to the user.
/// <br/>
/// <see href="https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification">https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification</see>
/// </summary>
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NotificationOptions))]
public async ValueTask Show(string title, NotificationOptions? options)
{
object? opts = null;
if (options is not null)
{
opts = new
{
badge = options.Badge,
body = options.Body,
data = options.Data,
dir = options.Dir.ToString().ToLower(),
icon = options.Icon,
image = options.Image,
lang = options.Lang,
renotify = options.Renotify,
requireInteraction = options.RequireInteraction,
silent = options.Silent,
tag = options.Tag,
timestamp = options.Timestamp,
vibrate = options.Vibrate,
};
}

await js.InvokeVoidAsync("BitButil.notification.show", title, opts);
}
}
2 changes: 1 addition & 1 deletion src/Butil/Bit.Butil/Scripts/butil.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
var BitButil = BitButil || {};
BitButil.version = window['bit-butil version'] = '8.12.0-pre-13';
BitButil.version = window['bit-butil version'] = '8.12.0-pre-14';
29 changes: 21 additions & 8 deletions src/Butil/Demo/Bit.Butil.Demo.Core/Pages/NotificationPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@
<hr />
<br />

<input @bind=@notifTitle />
<button @onclick="GetPermission">Get current permission</button>

<br />
<textarea @bind=@notifBody />
<br />
<button @onclick="Show">Show</button>
<hr />
<br />

<button @onclick="RequestPermission">Request permission</button>

<br />
<br />
<hr />
<br />

<button @onclick="GetPermission">Get current permission</button>
<input @bind=@notifTitle />
<br />
<textarea @bind=@notifBody />
<br />
<button @onclick="Show">Show</button>

<br />
<br />
Expand All @@ -44,14 +51,20 @@
private string notifTitle;
private string notifBody;

private async Task Show()
private async Task GetPermission()
{
await notification.Show(notifTitle, new() { Body = notifBody });
var permission = await notification.GetPermission();
await console.Log("Notification permission:", permission.ToString());
}

private async Task GetPermission()
private async Task RequestPermission()
{
var permission = await notification.GetPermission();
var permission = await notification.RequestPermission();
await console.Log("Notification permission:", permission.ToString());
}

private async Task Show()
{
await notification.Show(notifTitle, new() { Body = notifBody });
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Generated by bit-empty template v-8.12.0-pre-13 -->
<!-- Generated by bit-empty template v-8.12.0-pre-14 -->

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

Expand All @@ -17,14 +17,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bit.BlazorUI" Version="8.12.0-pre-13" />
<PackageReference Include="Bit.BlazorUI" Version="8.12.0-pre-14" />

<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Generated by bit-empty template v-8.12.0-pre-13 -->
<!-- Generated by bit-empty template v-8.12.0-pre-14 -->

<Project Sdk="Microsoft.NET.Sdk.Web">

Expand All @@ -19,14 +19,14 @@
<!--#endif -->

<ItemGroup>
<PackageReference Include="Bit.BlazorUI" Version="8.12.0-pre-13" />
<PackageReference Include="Bit.BlazorUI" Version="8.12.0-pre-14" />

<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-13">
<PackageReference Include="Bit.CodeAnalyzers" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-13">
<PackageReference Include="Bit.SourceGenerators" Version="8.12.0-pre-14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//+:cnd:noEmit
// bit version: 8.12.0-pre-13
// bit version: 8.12.0-pre-14
// https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup

//#if (notification == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Generated by bit-bp template v-8.12.0-pre-13 -->
<!-- Generated by bit-bp template v-8.12.0-pre-14 -->
<Project>
<!--/-:msbuild-conditional:noEmit -->
<PropertyGroup>
Expand Down
Loading

0 comments on commit 6c42e6b

Please sign in to comment.